It is currently Mon Oct 16, 2017 5:48 pm

All times are UTC - 7 hours





Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: apu quick question
PostPosted: Wed Nov 17, 2004 1:48 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
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

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 1:54 pm 
Offline
User avatar

Joined: Wed Nov 10, 2004 6:47 pm
Posts: 1845
1789772 -- pAPU cycles per second
44100 -- Samples per second (assuming 44KHz output)

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


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 2:06 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
Sounds right - this is exactly what my sound core does.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 17, 2004 3:37 pm 
Offline
Formerly Fx3
User avatar

Joined: Fri Nov 12, 2004 4:59 pm
Posts: 3064
Location: Brazil
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)

_________________
Zepper
RockNES developer


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 12:47 am 
Offline
User avatar

Joined: Wed Nov 17, 2004 12:34 pm
Posts: 41
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?

:|


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 18, 2004 1:22 am 
Offline
User avatar

Joined: Sun Sep 19, 2004 10:59 pm
Posts: 1389
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.

_________________
Quietust, QMT Productions
P.S. If you don't get this note, let me know and I'll write you another.


Top
 Profile  
 
 Post subject: :)
PostPosted: Thu Nov 18, 2004 10:13 am 
Offline
User avatar

Joined: Wed Nov 17, 2004 12:34 pm
Posts: 41
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!

:)


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

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users 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