Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing to the save/load game data
#28
here's a little description of the neogeo pocket ram/rom structure


+-------------------+--------------------------------+-----------------------------------+
|  internal stuff   |  1st flash rom                 |   2nd flash rom                   |
+-------------------+--------------------------------+-----------------------------------+


- internal stuff is the range from 0x000000 to 0x1FFFFF. it's divided in parts like main RAM, z80 ram, tile memory, scroll planes, palettes and other technical stuff. everything here is most likely handled by the c framework.
- 1st flash rom : from the handheld point of view, the flash start at 0x200000. if your cartridge is 4 to 16mbit, only one flash rom is present on the cartridge.
- 2nd flash rom : only for bung/flashmasta/retrohq or 32mbits games.

the data linked above are from the cartridge point of view, thus starting at 0x000000.
When refering to the data, you must think with base address of 0x200000 + offfset (ex : 0x1FA000)

if I refer to those data, 0x1FA000 is only present for 16mbit or above, and it's part of the 33rd bloc.

you can save your data here on 16/32mbit cartridges.
If you do that on a 32mbit cartridge, then your card structure will be like (only flash structure :

+------------------------+--------------------------+-----------------------------------+
|  code and data         |  savegame bloc 33 (0x21) |   remaining data (or code)        |
+------------------------+--------------------------+-----------------------------------+
                         ^                          ^
                         |                          |
       offset 0x1FA000 --+                          +-- offset 0x1FC000

In this case, you clear bloc 0x21, write at offset 0x1FA000, but you read at direct address 0x3FA000 (0x200000 + 0x1FA000)

It may be easier, mainly in C, to move the save bloc near the end of the cartridge (the last bloc is reserved for technical purpose).
Moving your data according to this diagram (32mbit cartridge) :

+--------------------------------------------+--------------------------+
|  code and data                             |  savegame bloc 68 (0x44) |
+--------------------------------------------+--------------------------+
                                             ^                          ^
                                             |                          |
                           offset 0x3FA000 --+                          +-- offset 0x3FC000, end of code+data+savegame

Here, you clear bloc 0x44, write at offset 0x3FA000, but you read at direct address 0x5FA000 (0x200000 + 0x3FA000)


I hope that's clear enough now ?
Reply


Messages In This Thread
Accessing to the save/load game data - by KeiDash - 11-14-2018, 11:38 PM
RE: Accessing to the save/load game data - by Loïc - 11-25-2018, 04:28 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)