Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
NGPC Z80 instruction timing
Does anyone know if the Z80 used in the NGPC has standard instruction timing? And what its default frequency is if it can be changed?

I've worked under the assumption that the Z80 clock is 3,072 Mhz, and that it has the same instruction timing that is listed here (I rely on the numbers being exactly as listed there, as I use timed loops in my Z80 code to handle the sound refresh rate). My code runs at the speed I had expected it to when I run it in Mednafen, but on a real NGPC it's much slower.
I sounds about OK on a real NGPC if I time my Z80 code based on a clock of 3,072*5/6 Mhz (which I find quite odd).
To answer my own question: there's nothing strange about the Z80 clock or the instruction timings. The results I got was because the Z80 apparently can't run at full speed if the TLCS900H is accessing the shared RAM area at the same time

E.g. having a wait loop like this on the TLCS side:

   ld a,(Z80_COUNTER)  ; this address is in the shared RAM area
   ld a, (VBCOUNTER)
   cp a, w
   jr nz, vbw1

would make the Z80 run at approx 88% of it's normal speed.

Forum Jump:

Users browsing this thread: 1 Guest(s)