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.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).
Confusing byte format in APU docs
Moderator: Moderators
Confusing byte format in APU docs
I'm reading through the triangle generator docs here and I had a question about the following snippet:
Re: Confusing byte format in APU docs
Binary number. From what I've seen, it's actually vaguely standard among 6502 assemblers.wbrian wrote:What does the "%" prefix mean
Byte separator.and what's the significance of the period?
Re: Confusing byte format in APU docs
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.)
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
Re: Confusing byte format in APU docs
Let me translate them to you.
Code: Select all
dmc_address = 0xC000 | (reg4012 << 6);
dmc_length = (reg4013 << 4) | 1;