[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cycle by Cycle Problem?



Your first post was quite long, but I'm not sure exactly what you are
asking. If you are simply asking:

> Do you think that emulation project can record nsec per cycle
> to match 1MHz and 14MHz freq per second?

Perhaps. But why would you want do this?

> It looks like that there is more than two clock system which they
> can operate independently at the same time.

In some machines there are separate clocks (e.g. a Zip Chip or //c+
etc). Actually I have no experience with these - but at some point the
CPU's fast RAM cache must sync with normal video RAM. In the case of a
regular 1Mz CPU, it is always in sync with the video scanner.

> Why do you expect to be perfect NTSC's vertical 60Hz to match
> 6502 CPU?

The output is not NTSC, but is _nearly_ NTSC. It has sync pulses, so
the monitor will sync to the video output at 17030 cycles/frame. The
CPU doesn't care.

> The reason is that I am asking because Apple II Emulator can't
> be done independently.

Sure it can. You output a video frame every 17030 cycles. After that is
a good time to sleep() to keep the framerate at ~60Hz. If you want your
CPU at 1MHz, you'll do 17030 cycles worth of CPU emulation before
outputting the frame.

I suppose if you want 2MHz, double the cycles of CPU emulation per
frame. But you'll want to "decouple" the CPU clock from the video clock
in a way similar to accelerator chips. Perhaps someone else here knows
how these chips interact with video.

Cheers,
Nick.