I was thinking about how to synchronize a game speed for both PAL and NTSC systems. My first guess is a kind of "downclocking" the NTSC cpu by skipping 1 every 6 frames to emulate the PAL's 50Hz like this:
Am I on right direction or totally wrong?
Thanks in advance!
Code:
Pseudo code
-----------------
// game loop
while(true) {
// nmiDone is a flag updated during NMI
// frame is a counter from 0 to 60 updated during NMI
if (not nmiDone or (system == NTSC and isMultipleOf6(frame) )) {
continue;
}
//game logic
...
}
-----------------
// game loop
while(true) {
// nmiDone is a flag updated during NMI
// frame is a counter from 0 to 60 updated during NMI
if (not nmiDone or (system == NTSC and isMultipleOf6(frame) )) {
continue;
}
//game logic
...
}
Am I on right direction or totally wrong?
Thanks in advance!