I've got this really, really annoying bug in my project (Pulsar, my new tracker) where very occasionally I get a bit of the NVRAM (three or four bytes) filled with rogue values (strangely, all $01).
I tried to set up a breakpoint based on writes to the addresses (they're always in the same area) but so far I've not managed to make it happen in FCEUX - it only seems to do it in Nestopia.
I've spent the weekend going through all the code and I can't see any possible places that I could be writing to the NVRAM with rogue indexes (all writes to that particular area of the RAM are done with (indirect),y
I was wondering though if doing too much DMA or going over a frame with the background code loop (which does happen occasionally) could cause this kind of corruption? If so, do you have any advice or safeguards?
I'm clutching at straws.
NVRAM Corruption
Moderator: Moderators
- neilbaldwin
- Posts: 481
- Joined: Tue Apr 28, 2009 4:12 am
- Contact:
NVRAM Corruption
Last edited by neilbaldwin on Mon Aug 23, 2010 1:24 am, edited 1 time in total.
- neilbaldwin
- Posts: 481
- Joined: Tue Apr 28, 2009 4:12 am
- Contact:
You're using 32K WRAM in this, correct? Could you be in the wrong 8K bank? Since the bank is controlled by some CHR bank bits, could you be in 4K CHR mapping mode by mistake, and have it randomly switching as the PPU reads from alternate CHR 4K banks? e.g. if you enable 4K CHR banking, set the WRAM bank bits differently in each CHR bank, enable PPU rendering, then start executing code from $6000, you can get some really crazy crashes.
- neilbaldwin
- Posts: 481
- Joined: Tue Apr 28, 2009 4:12 am
- Contact:
Grrrrr. I've just found the bug. I always suspected it was human error (the pattern of corruption was too similar each time).
One absent "cpy, bne" branch caused all that fuss. I must've stared at that code a hundred times over the weekend.
Thanks for your inputs though - I still learned a couple of tricks.
One absent "cpy, bne" branch caused all that fuss. I must've stared at that code a hundred times over the weekend.
Thanks for your inputs though - I still learned a couple of tricks.