Posted: Wed Sep 19, 2007 9:01 pm
Because I felt like poking around, I was looking at Sack of Flour - Heart of Gold tonight. When running it on Nintendulator previously and when testing it on a real NES I found that seemingly randomly the name tables would get trashed when it loaded a level. I also noticed on the title screen and level start screen (where it says the level's name) has seemingly random junk on them.
I traced out one subroutine which seemed to be like a "clear screen" sort of routine which was zeroing the entire name table. But he expected he could write the entire name table within vblank. So I corrected it and fixed the garbage on those 2 screens. That left the main problem of when you start a level or die the nametables could be trashed and it's impossible to see what you are doing. I "think" I fixed this as it didn't happen to me when testing on the emulator or on the NES.
There's still 2 problems. Randomly weird corruption seems to happen on some tiles. I'm not really sure how this is possible since it uses CHRROM which shouldn't be writable.... The other problem is whenever you are scrolling the screen and it has to update the name tables, it's taking too long and my guess is Sprite DMA doesn't finish and falls into rendering. Later on this causes some interesting sprites that never seem to move.
Still it's more playable than it was before, now you can play it to the ending credits screen where it crashes/locks up from an invalid opcode. Who knows if there was anything after that or if it just meant to reset the game.
Anyway if you care to see the patched SoF is here.
I traced out one subroutine which seemed to be like a "clear screen" sort of routine which was zeroing the entire name table. But he expected he could write the entire name table within vblank. So I corrected it and fixed the garbage on those 2 screens. That left the main problem of when you start a level or die the nametables could be trashed and it's impossible to see what you are doing. I "think" I fixed this as it didn't happen to me when testing on the emulator or on the NES.
There's still 2 problems. Randomly weird corruption seems to happen on some tiles. I'm not really sure how this is possible since it uses CHRROM which shouldn't be writable.... The other problem is whenever you are scrolling the screen and it has to update the name tables, it's taking too long and my guess is Sprite DMA doesn't finish and falls into rendering. Later on this causes some interesting sprites that never seem to move.
Still it's more playable than it was before, now you can play it to the ending credits screen where it crashes/locks up from an invalid opcode. Who knows if there was anything after that or if it just meant to reset the game.
Anyway if you care to see the patched SoF is here.