Hi,
I recently made good progress with my VMU emulator. But now it looks as if
the timing is incorrect. Some games run too fast, some too slow. Since I
don't have a real VMU myself, I can't do any comparissons. Well, I will just
drop my code wich handles the OCR register, and perhaps someone can tell me
if the timings are correct:
case 0x10E: /* Oscillation Control Regitser */
{
Cpu.OCR = Data;
int OldSpeed = Cpu.Speed;
switch (Data & 0xA0)
{
case 0x00:
Cpu.Speed = 5000; /* (600Khz / 2) / 60 (RC Clock / 12) */
break;
case 0x20:
Cpu.Speed = 273; /* (32768Hz / 2) / 60 (Sub Clock / 12) */
break;
case 0x80:
Cpu.Speed = 10000; /* (600Khz / 1) / 60 (RC Clock / 6) */
break;
case 0xA0:
Cpu.Speed = 546; /* (32768Hz / 1) / 60 (Sub Clock / 6) */
break;
}
/* Calculate remaining cycles to run, based on new clock speed */
Cpu.NrCycles = Cpu.Speed * (Cpu.NrCycles / OldSpeed);
return;
}
Notes: I'm rendering the VMU at 60 FPS, so the timing values are divided by
60. Cpu.Speed is the current clock speed. Cpu.NrCycles is the remaining
cycles to run during this frame.
Anyone noticed something wrong with this code ??
BTW: If you want to compare my emu to a real thing, just ask, and I can send
a private build of it.
Thanks in advance,
Michel Gerritse (Gerrie)
_________________________________________________________________
Chatten met je vrienden via het web? Probeer MSN Messenger
http://messenger.msn.nl/default.asp?client=1