Code: Select all
.db $a bunch of numbers
Loop:
LDA $db address,X
STA $2007
INX
CPX EndPoint
BNE Loop
Moderator: Moderators
Code: Select all
.db $a bunch of numbers
Loop:
LDA $db address,X
STA $2007
INX
CPX EndPoint
BNE Loop
That's a truly bizarre idea. The NES could have mapped ROM to the ZP if it wanted, but that would not have been a sane design choice at all.DementedPurple wrote:(ZP ROM)
I don't know what you think .db does, or why you think it's related to the ZP at all. It simply stores a byte in ROM. I can't comprehend what alternative you're comparing it to?DementedPurple wrote:then what purpose do .db statements provide? I mean I guess if you want to load registers with constant values from the ROM and have names for the numbers without using zeropage, but if you ask me, it just uses an extra byte in the ROM for the other half of the address. Another situation where having the NES run off of a z80 would've been useful.
I should clarify, though, that this opinion on design sanity is limited to just the fixed ZP of the 6502.rainwarrior wrote:That's a truly bizarre idea. The NES could have mapped ROM to the ZP if it wanted, but that would not have been a sane design choice at all.
Yeah, that sounds like a good trade to me.pubby wrote:I suppose it would be nice if the PPU registers were mapped to zeropage.
I've thought about putting the OAM buffer in the stack. It's not as ridiculous as it sounds, you just need to make sure your stack is nearly empty at the point you push the buffer to the OAM. You might have to shuffle a few bytes around before and after that, and limit your # of sprites to 56. But, it might potentially free up some extra RAM.you can put your sprite buffer in ZP if you want.
At the cost of tremendous inconvenience you could save up to 256 cycles per frame on the STAs.dougeff wrote:But don't put the sprite buffer in the zero page. That would be dumb.
Sort of interesting to think of the stack and OAM buffer as a temporary space that you don't need all the time. If you do your sprites last before waiting on the NMI, seems like that would be somewhat doable. Temporarily shifting out some of the stack before the DMA would be a little fussy, and timing would be strict, but sure it could actually be a good use especially if your RAM budget is really tight.dougeff wrote:I've thought about putting the OAM buffer in the stack.
I think using the stack is way dumber. If you use ZP, at least you can reliably make the Y coordinate >= 239 to hide unused sprites, and use the remaining 3 bytes of each sprite freely. If you use the stack page, however, setting the Y coordinate will be much harder, since normal stack usage will constantly temper with the Y coordinates of unused sprites.dougeff wrote:But don't put the sprite buffer in the zero page. That would be dumb.