Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Accessing to the save/load game data
#9
The offset and bloc number can be arbitrary set.

The easiest way is to uses the values I gave you in the fist post.
offset           : 0x1FA000
bloc number : 0x21

with these values, the data will be stored at 0x3FA000

Using this parameters, your data will be saved if you play from flashmasta card.

Technically, the NeoGeo Pocket see the "memory" as an array, starting from 0x000000 to 0x5FFFFF (on 32Mbit games like Metal Slug 2nd mission)
the memory part (or array range) from 0x000000 to 0x1FFFFF is used for storing displayed tiles, game RAM, color palettes, bios and other stuff.

the cartridge itself is logically subdivided in blocs. This layout depend on the cartridge size.

To write data on the cartridge, you first need to clear the bloc receiving your data (in this case, clearing 2000 bytes).
One this step is completed, you can write your data. I guess that the writing function only turns 0 to 1 and the erase function turns everything to 0.

I think that in the C code, you call flash(array to save)
the address of this array is then read by : __ASM("ld xhl, (xsp+4)" (xsp being the stack pointer. C language transmit functions args using the stack)




Better take a look at gears of fate sources, where the flash(data) is used.

Loïc
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-17-2018, 02:11 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)