This page is a mirror of Tepples' nesdev forum mirror (URL TBD).
Last updated on Oct-18-2019 Download

a questtion of PPU,please help.

a questtion of PPU,please help.
by on (#49808)
nes PPU NTSC mode:
------------------------------------------
Base clock:21477270.0Hz
Cpu clock:1789772.5Hz
Total scanlines:262
Scanline total cycles:1364(15.75KHz)
H-Draw cycles:1024
H-Blank cycles:340
End cycles:4
Frame cycles:1364*262
FrameIRQ cycles:29830
------------------------------------------
what's the meaning of 'End cycles' and 'FrameIRQ cycles',when will they occur?

another,i was counted the clock cycle:1364*262*60 = 21442080,it's not equal to Base clock(21477270),why?

by on (#49809)
Well for one, there's no decimal part to those numbers.

Assuming the system runs at 59.94hz video frame rate, then a single frame is 21477270 / 59.94 = 358312.81281281281281281281281281 cycles / 262 scalines is 1367.6061557740947053924153160794 cycles in a scanline. 21477270 / 1367.6061557740947053924153160794 cycles = 15704.28hz for the scanline frequency.

by on (#49810)
tomaitheous wrote:
Well for one, there's no decimal part to those numbers.

Assuming the system runs at 59.94hz video frame rate, then a single frame is 21477270 / 59.94 = 358312.81281281281281281281281281 cycles / 262 scalines is 1367.6061557740947053924153160794 cycles in a scanline. 21477270 / 1367.6061557740947053924153160794 cycles = 15704.28hz for the scanline frequency.


oh,i understand.thank u.
do yu know what's the meaning of 'End cycles' and 'FrameIRQ cycles' and when will they occur?

by on (#49816)
Pay attention to what units are used here. It seems that all the Cycles are based on units of the base clock. The PPU usually uses "Dots", or rendered pixels as the unit of measurement. Divide the master clock by 4, so you get 256 Draw pixels, then 85 hblank pixels, for 341 pixels per scanline, and 341*262 pixels per frame.

"End Cycles" might have something to do with the extra PPU pixel which is added on every other frame if rendering is enabled during the pre-render scanline.

FrameIRQ cycles is given in units of CPU clock cycles, and has nothing to do with the PPU. It's built into the CPU/APU. The FrameIRQ feature allows games to get an interrupt approximately every frame. Very few games use it, because it's redundant compared with the Vblank NMI interrupt. Compared with VBlank NMI which happens every 89342 PPU dots, APU Frame IRQ happens every 89490 dots. Most games just turn off the APU Frame IRQ feature, or use a blank interrupt handler to handle it. The games that DO use the APU Frame IRQ feature include Dragon Quest 1/2 (Japanese Version only), Door Door, and maybe a few others.