So I'm looking into sprite 0 to do my status bar. I just want to make sure I'm understanding correctly how this works.
So when the first sprite in your chr file is rendered on top of a non transparent tile bit 6 in $2002 get's set to 1
So do I need to sit and monitor $2002 at the beginning of my game loop?
If so, doesn't this waste a lot of cycles that could be used for other things?
Also, it's my understanding that you only have about 20 cycles to work with while the hblank is running, is that right?
So in my little asteroid game I was going to render the score and level status stuff as background tiles. I'm using horizontal mirroring so I was going to render it at the top of Nametable 0. I'm using background tiles for the largest asteroids because they are 32x32 and I'd like to prevent flickering. Those asteroids will only be able to move horizontally and all of them will move at the same speed.
So if I'm understanding what I need to do it's basically the following.
1. At the end of the NMI, change the $2000 register to point to PPU $2000 memory location (Nametable 0)
2. At the beginning of the game loop, loop until the sprite 0 hit appears in the $2002 register
3. When sprite 0 hit appears in $2002 register, change the $2000 register to point to PPU $2800 memory location (Nametable 2)
4. Change the PPU Scroll Register ($2005) to have Y=0 and X to asteroid move value. (also during the hblank)
Am I understanding what needs to happen correctly? Are there any gotchas I need to look out for?
Any advice or suggestions are appreciated.
Thanks
So when the first sprite in your chr file is rendered on top of a non transparent tile bit 6 in $2002 get's set to 1
So do I need to sit and monitor $2002 at the beginning of my game loop?
If so, doesn't this waste a lot of cycles that could be used for other things?
Also, it's my understanding that you only have about 20 cycles to work with while the hblank is running, is that right?
So in my little asteroid game I was going to render the score and level status stuff as background tiles. I'm using horizontal mirroring so I was going to render it at the top of Nametable 0. I'm using background tiles for the largest asteroids because they are 32x32 and I'd like to prevent flickering. Those asteroids will only be able to move horizontally and all of them will move at the same speed.
So if I'm understanding what I need to do it's basically the following.
1. At the end of the NMI, change the $2000 register to point to PPU $2000 memory location (Nametable 0)
2. At the beginning of the game loop, loop until the sprite 0 hit appears in the $2002 register
3. When sprite 0 hit appears in $2002 register, change the $2000 register to point to PPU $2800 memory location (Nametable 2)
4. Change the PPU Scroll Register ($2005) to have Y=0 and X to asteroid move value. (also during the hblank)
Am I understanding what needs to happen correctly? Are there any gotchas I need to look out for?
Any advice or suggestions are appreciated.
Thanks