nesdev.com
http://forums.nesdev.com/

apu quick question
http://forums.nesdev.com/viewtopic.php?f=3&t=40
Page 1 of 1

Author:  Zepper [ Wed Nov 17, 2004 1:48 pm ]
Post subject:  apu quick question

is correct to output 1 sample at every 1.79*60/44.1 CPU clock cycles, or is my logic wrong?

CPU_CLOCK * 60 / SAMPLE_RATE

TKS

Author:  Disch [ Wed Nov 17, 2004 1:54 pm ]
Post subject: 

1789772 -- pAPU cycles per second
44100 -- Samples per second (assuming 44KHz output)

therefore: ~40.58 pAPU cycles per sample (CPU_CLOCK / SAMPLE_RATE)

Author:  Quietust [ Wed Nov 17, 2004 2:06 pm ]
Post subject: 

Sounds right - this is exactly what my sound core does.

Author:  Zepper [ Wed Nov 17, 2004 3:37 pm ]
Post subject: 

Yeah, but slightly different, this way [NTSC PPU clock cycles]:

LINE_CYCLES = 341 PPU cc's
CYCLES_PER_FRAME = 341*262 = 89342
CYCLES_PER_SECOND = 89342*60 = 5360520
SAMPLE_RATE = 44100Hz

then = CYCLES_PER_SECOND / SAMPLE_RATE
then = 5360520 / 44100 = ~121.55 cycles/sample (or ~40.51 CPU cc/sample)

Author:  laughy [ Thu Nov 18, 2004 12:47 am ]
Post subject: 

This is probably due to the fact the ppu doesn't render at EXACTLY 60 frames per second.

Prolly more accurate to go with the cpu timing, since this is how the apu is clocked.

My question is what about the dead cycle on every odd frame brad was talking about. Does this mean that it's not really 341 * 262 * ~60, but really

(341 * 262 * ~30) + (340 * 262 * ~30) cycles per second?

:|

Author:  Quietust [ Thu Nov 18, 2004 1:22 am ]
Post subject: 

The CPU runs at 1.78977272727MHz, with a small amount of variance. The PPU runs at (341*262-1/2)/3 = 29780.5 CPU cycles per frame.
The actual framerate works out to be about 60.0988Hz for NTSC.

As for laughy's question, the cycle difference every other frame only applies to the FIRST scanline, not all 262 of them.

As for PAL, CPU speed is 1.662607MHz, and the PPU runs at (341*312*50)/3.2 = 33247.5 CPU cycles per frame (a test rig made by Kevin Horton showed that the PAL PPU does *not* have the cycle difference every other frame). This works out to 50.00698Hz for PAL.

Author:  laughy [ Thu Nov 18, 2004 10:13 am ]
Post subject:  :)

Oops:

(341 * 261 * ~30) + (340 * ~30) + (341 * 262 * ~30)

Quietust's equation is mo betta =]

However MINE doesn't require a floating point UNIT!!!

FASTER!

:)

Page 1 of 1 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/