I can't be sure of the mechanism, but commercial ROMs include
an embedded string, e.g. 'SRAM_V112' which I believe programming
utilities look for to determine storage type. I suppose that
there might be enough of a clue here to also know the amount of
storage.
I tend to include a similar string in my own work.
If anyone knows the factual answer please correct me.
--- In gbadev@yahoogroups.com, "David Sharp" <dave@d...> wrote:
> I've written a little game and want to add a save state to it.
>
> By writing to memory from 0xE000000 onwards a byte at a time I can
see the
> values being written to the .SAV file that VisualBoyAdvance
automatically
> creates.
>
> If I put my ROM image into EZ-Client v1.08a (for use on an XG flash
cart) it
> defaults to having 0kB of RAM allocated to it while various other
ROM images
> have predefined RAM amounts. By manually setting this value to
128kB,
> running the game and then saving the RAM out from the cart I can
see the
> values being saved to it so things seem to be working fine.
>
> So, how do I change my ROM image file to define the amount of RAM
it should
> use on the flash cart?
>
> Cheers
> Dave