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

VirtuaNES region constants
http://forums.nesdev.com/viewtopic.php?f=3&t=13398
Page 1 of 1

Author:  Eugene.S [ Sun Oct 25, 2015 7:35 am ]
Post subject:  VirtuaNES region constants

Hi, nesdev. I want to add Hybrid(Dendy) mode into VirtuaNES 0.97 for personal desire.

nes.cpp (original v0.97):
Code:
NESCONFIG NESCONFIG_NTSC = {
   21477270.0f,   // Base clock
   1789772.5f,      // Cpu clock

   262,         // Total scanlines

   1364,         // Scanline total cycles (15.75KHz)

   1024,         // H-Draw cycles
   340,         // H-Blank cycles
   4,         // End cycles

   1364*262,      // Frame cycles
   29830,      // FrameIRQ cycles

   60,         // Frame rate (Be originally 59.94Hz)
   1000.0f/60.0f   // Frame period (ms)
};

NESCONFIG NESCONFIG_PAL = {
   26601714.0f,      // Base clock
   1662607.125f,      // Cpu clock

   312,         // Total scanlines

   1278,         // Scanline total cycles (15.625KHz)

   960,         // H-Draw cycles
   318,         // H-Blank cycles
   2,         // End cycles

   1278*312,      // Frame cycles
   33252,      // FrameIRQ cycles

   50,         // Frame rate (Hz)
   1000.0f/50.0f   // Frame period (ms)
};



But i doubt about constants.
How was calculated FrameIRQ cycles, scanline total cycles, H-Draw, H-Blank and End cycles?

P.S. I've already able to slowdown NTSC-mode to 50FPS, so it looks like Dendy. But i want to do it "right" way.

Author:  lidnariq [ Sun Oct 25, 2015 2:26 pm ]
Post subject:  Re: VirtuaNES region constants

Without knowing how these numbers are used elsewhere, it's hard to say, but a naïve interpretation (based on the NTSC numbers here) implies the PAL numbers are all weird.
I'm really confused by that 1278. The number "ought" to be 1705. ((5 chroma phases per pixel)×(341 pixels) on each scanline).
Similarly, all the subsequent numbers are weird too: 960 "should" be 1280 (5×256), 318 "should" be 425 (5×85), "end cycles" "should" be 0 (there's no prerender missing pixel on the 2C07).

The Frame IRQ timing was measured manually on the NTSC NES. I don't know that anyone's ever sat down and measured that timing on a PAL NES or Dendy.

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