I normally mention it every time someone posts code with that comment. The code itself isn't wrong, it's just the comment that's misleading. $2003 doesn't "set the low byte of the address", seeing as the sprite DMA always starts copying from $XX00, $XX being the value you write to $4014. What $2003 does is select the DESTINATION address, inside the OAM, where the data will be written to.WheelInventor wrote:Has this been mentioned in previous threads? I haven't informed myself on this.
Reset handler/reset vector confusion?
Moderator: Moderators
Re: Reset handler/reset vector confusion?
- rainwarrior
- Posts: 8732
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Reset handler/reset vector confusion?
No, they play back at whatever rate you're emulating. You can step through frame by frame or however you want to do it.WheelInventor wrote:That's really useful! Must TAS scripts be played @ real-time emulation speed?
- FrankenGraphics
- Formerly WheelInventor
- Posts: 2064
- Joined: Thu Apr 14, 2016 2:55 am
- Location: Gothenburg, Sweden
- Contact:
Re: Reset handler/reset vector confusion?
tokumaru: That's quite a difference.
rainwarrior: That's even more useful, then. Very good for complete control over factors when trying to figure what's causing what and when in a bug.
rainwarrior: That's even more useful, then. Very good for complete control over factors when trying to figure what's causing what and when in a bug.
Re: Reset handler/reset vector confusion?
Yeah I myself had a similar comment in my older projects. It confused me why the lower and upper byte of the OAM address should be set to a PPU port register and a CPU register respectively, until I looked them up in the wiki and unsterstood that it was a misunderstanding of how they work. I always thought I had made this misunderstanding by myself, but I guess the comment really came from the Nerdynights tutorial.tokumaru wrote:I normally mention it every time someone posts code with that comment. The code itself isn't wrong, it's just the comment that's misleading. $2003 doesn't "set the low byte of the address", seeing as the sprite DMA always starts copying from $XX00, $XX being the value you write to $4014. What $2003 does is select the DESTINATION address, inside the OAM, where the data will be written to.WheelInventor wrote:Has this been mentioned in previous threads? I haven't informed myself on this.
A correct comment should probably be something like this:
Code: Select all
obj_update:
lda #$00
sta $2003 ;make sure OAM address $00 is selected as destination start address
lda #$02
sta $4014 ;set the RAM page to be used as source address and invoke OAM-DMA
Re: Reset handler/reset vector confusion?
Precisely. Does anyone still maintains the NN tutorials? Is there anyone who can fix this to stop propagating this misconception?
Re: Reset handler/reset vector confusion?
Maybe someone with an account over on Nintendo Age can raise the topic there? I don't have a Nintendo Age account.
-
- Posts: 23
- Joined: Sat Jan 14, 2017 8:40 am
Re: Reset handler/reset vector confusion?
When I'm finished with my PONG I plan to submit the code there. I can request that members of NESDEV who helped me complete it would like this updated.Pokun wrote:Maybe someone with an account over on Nintendo Age can raise the topic there? I don't have a Nintendo Age account.