Hey guys, been plugging away all weekend at getting my PPU more and more bug free for NROM games and I'm really stuck on implementing Loopy's method for scrolling. I've been staring at this for way too long so I'm hoping it's just a couple of dumb mistakes and some of you guys can point me in the right direction.
Basically I started learning the PPU by building a nametable viewer, nothing really more than that, so its rendering was really sloppy. After enough cycles for VBlank to begin I would render every tile in the nametable in one fell swoop. I was actually able to get Donkey Kong, Donkey Kong Jr, and Balloon Fight very very playable and almost totally cool by using that method. Now I'm trying to break up my run loop into a more cycle/scanline accurate way so that I can add scrolling (Ice Hockey and Excitebike are my current testing targets). What I've done is break up the tile rendering into a process that occurs every 8 scanlines on the last cycle of the scanline. This way I still do rendering tile-by-tile but it happens in a manner that allows things to happen mid-frame.
I've left the original sloppy render function in place, here is what I get (note the palette error is something new, I was playing with a new method of picking palettes last night):
When I flip to the row-of-tiles method I get:
The functions in question are renderNametable() and renderTileRow(). The code is available here: https://gist.github.com/3687553
I'm hoping I'm just missing some minute detail, but like I said, I've been staring at this way too long. Thanks for any help guys!
Basically I started learning the PPU by building a nametable viewer, nothing really more than that, so its rendering was really sloppy. After enough cycles for VBlank to begin I would render every tile in the nametable in one fell swoop. I was actually able to get Donkey Kong, Donkey Kong Jr, and Balloon Fight very very playable and almost totally cool by using that method. Now I'm trying to break up my run loop into a more cycle/scanline accurate way so that I can add scrolling (Ice Hockey and Excitebike are my current testing targets). What I've done is break up the tile rendering into a process that occurs every 8 scanlines on the last cycle of the scanline. This way I still do rendering tile-by-tile but it happens in a manner that allows things to happen mid-frame.
I've left the original sloppy render function in place, here is what I get (note the palette error is something new, I was playing with a new method of picking palettes last night):
When I flip to the row-of-tiles method I get:
The functions in question are renderNametable() and renderTileRow(). The code is available here: https://gist.github.com/3687553
I'm hoping I'm just missing some minute detail, but like I said, I've been staring at this way too long. Thanks for any help guys!