Page 1 of 1
Error dump from SRAM_enable()
Posted: Sun Jun 23, 2019 10:03 am
by realbrucest
Hi, I'm starting now to mess around with SRAM routines but sadly I got my first trouble at the very first routine
Calling "SRAM_enable()" I got this crash:
I did check rom_head.c and changed the two chars control value ("RA"), same result.
What am I missing at those first steps?
Re: Error dump from SRAM_enable()
Posted: Sun Jun 23, 2019 4:31 pm
by Chilly Willy
If your rom is too big, turning on the save ram may cause it to crash because the rom above 0x200000 is bank switch away. Code that turns on/off the sram or reads/writes the sram MUST be below that address or in work ram. If any interrupt code may be above that address, the interrupts MUST be disabled while sram is enabled.
Given your rom is tiny, my guess is you screwed up the header when you changed it, causing it to be too big or too small, or something to do with not setting the ram type to a proper value (0xF820 should follow the RA).
Double check all those strings in the header that you didn't change their length compared to the default header. The format of the rom header is CRUCIAL, and a single byte can make the rom fail.
Re: Error dump from SRAM_enable()
Posted: Mon Jun 24, 2019 5:05 pm
by realbrucest
OK, I'll have a look to that; starting from a "clean" rom file I'll check the changes one by one.
Thanks a lot for all the clues Chilly Willy.