It is currently Sun Nov 19, 2017 2:50 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4
Author Message
PostPosted: Fri Jan 20, 2017 3:23 am 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10113
Location: Rio de Janeiro - Brazil
WheelInventor wrote:
Has this been mentioned in previous threads? I haven't informed myself on this.

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.


Top
 Profile  
 
PostPosted: Fri Jan 20, 2017 3:30 am 
Offline
User avatar

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 5822
Location: Canada
WheelInventor wrote:
That's really useful! Must TAS scripts be played @ real-time emulation speed?

No, they play back at whatever rate you're emulating. You can step through frame by frame or however you want to do it.


Top
 Profile  
 
PostPosted: Fri Jan 20, 2017 3:35 am 
Offline
Formerly WheelInventor

Joined: Thu Apr 14, 2016 2:55 am
Posts: 1012
Location: Gothenburg, Sweden
tokumaru: That's quite a difference. :lol:

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.

_________________
http://www.frankengraphics.com - personal NES blog


Top
 Profile  
 
PostPosted: Fri Jan 20, 2017 7:00 am 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 866
Location: Sweden
tokumaru wrote:
WheelInventor wrote:
Has this been mentioned in previous threads? I haven't informed myself on this.

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.

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.

A correct comment should probably be something like this:
Code:
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

OAM is an internal memory in the PPU that is different from VRAM. It's only 256 byte so it doesn't need 16-bit addresses.


Top
 Profile  
 
PostPosted: Fri Jan 20, 2017 2:01 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10113
Location: Rio de Janeiro - Brazil
Precisely. Does anyone still maintains the NN tutorials? Is there anyone who can fix this to stop propagating this misconception?


Top
 Profile  
 
PostPosted: Fri Jan 20, 2017 11:25 pm 
Offline

Joined: Tue May 28, 2013 5:49 am
Posts: 866
Location: Sweden
Maybe someone with an account over on Nintendo Age can raise the topic there? I don't have a Nintendo Age account.


Top
 Profile  
 
PostPosted: Sun Jan 22, 2017 11:37 am 
Offline

Joined: Sat Jan 14, 2017 8:40 am
Posts: 23
Pokun wrote:
Maybe someone with an account over on Nintendo Age can raise the topic there? I don't have a Nintendo Age account.


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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 52 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group