67726e wrote:
How exactly would one know where the unused slots are? The information that I have on the '.rsset' directive with NESASM3 allows you to start the addressing at $0000 and work your way up from there so wouldn't that have the potential to screw with the 'special meanings'
Instructions using indirection need to use addresses in $0000-$00FF, the 256-byte "zero page". Stack instructions (PHA, PLA, JSR, RTS, etc.) need to use addresses in $0100-$01FF, the 256-byte "stack page". Those are the only two areas with special meanings to the CPU, but rough conventions about the use of some other areas arose during the NES's commercial era. I just wrote a wiki article showing
suggested uses for parts of RAM.
Quote:
To load the sprites into the RAM so it occupies $0200-$0217, now in NMI I have to put:
Code:
LDA #$00
STA $2003
LDA #$02
STA $4014
I actually have two question regarding this:
1) How does the PPU know when to stop reading?
The CPU's DMA unit always copies exactly 256 bytes from this page to the OAM data port on the PPU ($2004). Unused memory in this page should be cleared to values between $EF and $FF, so that unused sprites are hidden below the bottom of the visible area of the screen.
Quote:
2) Why do I write the second byte of the address to $4014 instead of $2003?
You're writing the
destination address, which is inside OAM, to PPU port $2003. (This address should always be set to zero unless you really know what you're doing.) You're writing the upper 8 bits of the
source address, which is inside ordinary RAM, to $4014. The copy always starts at the first byte ($xx00) of this page.