Question on SRAM
Posted: Wed Dec 23, 2015 12:49 am
I think I'm having a bit of misunderstanding with initializing the SRAM in the header, and I'm hoping one of you more experienced programmers can help me out 
Using the BEX ASM library and this wiki article: https://en.wikibooks.org/wiki/Genesis_Programming , I've attempted to set the header up with the following:
If I understand the wiki article, then the SRAM should be enabled and addressing both even and odd bytes, and SRAM size is 8 KB. I'm able to successfully write to SRAM from my BASIC compiler, and this is where my questioning/misunderstanding is coming in. When I look at the .SRM file that Fusion creates, the file is only a few bytes large. If I run the same SRAM code from BEX (using the BEX SRAM syntax), the .SRM file that is created is 8 kb.
My question is: Does the size of the SRAM file that Fusion creates (or I suppose every emulator creates) just depend on how much you utilize the SRAM (like, if I only write 6 bytes, the file will be 6 bytes), or does the file get padded based on the size in the header? Or, does the size in the header not really matter like some of the other options?

Using the BEX ASM library and this wiki article: https://en.wikibooks.org/wiki/Genesis_Programming , I've attempted to set the header up with the following:
Code: Select all
dc.b 'SEGA GENESIS '
dc.b '(C)SEGA 2003.DEC'
dc.b ' '
dc.b ' '
dc.b ' '
dc.b ' '
dc.b ' '
dc.b ' '
dc.b 'GM MK-0000 -00'
dc.w $0000
dc.b 'J '
dc.l $00000000,$003FFFFF
dc.l $00E00000,$00FFFFFF
dc.b "RA",%11100000,%0010000 ; SRAM
dc.l $0000
dc.l $200000,$202000
dc.l $0000,$0000
dc.b 'JUE '
My question is: Does the size of the SRAM file that Fusion creates (or I suppose every emulator creates) just depend on how much you utilize the SRAM (like, if I only write 6 bytes, the file will be 6 bytes), or does the file get padded based on the size in the header? Or, does the size in the header not really matter like some of the other options?