It is currently Wed Nov 22, 2017 4:20 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sat Apr 22, 2017 11:34 am 
Offline

Joined: Wed Feb 15, 2017 6:41 pm
Posts: 8
I'm reading through the triangle generator docs here and I had a question about the following snippet:

Quote:
DPCM samples must begin in the memory range $C000-FFFF at an address set by register $4012 (address = %11AAAAAA.AA000000).
The length of the sample in bytes is set by register $4013 (length = %LLLL.LLLL0001).


I'm confused by the formats used for address and length calculations—What does the "%" prefix mean, and what's the significance of the period? It's unlike any format I've seen while reading through the PPU docs, so I want to make sure I'm interpreting it correctly.


Top
 Profile  
 
PostPosted: Sat Apr 22, 2017 11:38 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 6447
Location: UK (temporarily)
wbrian wrote:
What does the "%" prefix mean
Binary number. From what I've seen, it's actually vaguely standard among 6502 assemblers.
Quote:
and what's the significance of the period?
Byte separator.


Top
 Profile  
 
PostPosted: Sat Apr 22, 2017 11:39 am 
Offline
User avatar

Joined: Fri May 08, 2015 7:17 pm
Posts: 1827
Location: DIGDUG
Binary. Those are the digits.

You set the address with 1 byte (8 bits). Bit-shift left 6 times, OR with 0xc0 (the upper byte of a 2 byte address) gets a CPU address between 0xc000 and 0xffc0 as the start address of the DMC sample.

(Edited slightly.)

_________________
nesdoug.com -- blog/tutorial on programming for the NES


Top
 Profile  
 
PostPosted: Sat Apr 22, 2017 3:12 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3075
Location: Brazil
Let me translate them to you.
Code:
              dmc_address = 0xC000 | (reg4012 << 6);
              dmc_length = (reg4013 << 4) | 1;


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: Bing [Bot] and 5 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