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?
Error dump from SRAM_enable()
Moderator: Stef
-
- Interested
- Posts: 27
- Joined: Wed Sep 21, 2011 9:00 pm
- Location: Sevilla, Spain
- Contact:
-
- Very interested
- Posts: 2984
- Joined: Fri Aug 17, 2007 9:33 pm
Re: Error dump from SRAM_enable()
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.
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.
-
- Interested
- Posts: 27
- Joined: Wed Sep 21, 2011 9:00 pm
- Location: Sevilla, Spain
- Contact:
Re: Error dump from SRAM_enable()
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.
Thanks a lot for all the clues Chilly Willy.