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

Re: The Perfect Emulator?



On Mon, 29 Sep 2003 20:24:29 +0000, Michael J. Mahon wrote:

> Bryan Parkoff asked:
> 
>>    Do you think that you will be able to program Apple II Emulator into
>>perfection with accuracy?
> 
> Accuracy of emulation is relative to the objectives of the emulator.
> 
> Most Apple II emulators have the objective of running most Apple II
> software unchanged, so that it appears to be running on a real Apple.
> They generally achieve this objective well.

More to the point, timing at sub-instruction granularity is generally
not visible to software, so there's not much point implementing it.

> One of the very few examples of a program which would require this
> detailed accuracy for correct appearance is a program which uses
> software to synchronize with the video refresh in order to perform
> synchronous video mode switches.  Although there are a few demo
> programs that use this technique, to my knowledge it has never been
> used in commercially-released software.
> 
> Therefore, providing support for this level of cycle-counting accuracy
> would reduce emulator performance for very little practical gain.

Many emulators accurately emulate the video refresh without counting
every CPU cycle. My emulator does this by clocking through the appropriate
number of 14Mhz video cycles after every instruction. I have written
some test software that uses refresh-synchronized video mode switching
to display various patterns on a real IIe, and it works on my emulator
as well.

>>    Why don't the programmers want to update 7 pixels each one 6502 cycle
>>instead they want the complete screen to be updated every 17030 cycles?

As above, many emulators do update more frequently than once per vertical
refresh.

> The video display of an emulator is actually a function of the host machine
> video generation.  The emulator simply maps visible Apple II pixels into the
> video memory of the host, and it displays them however it will.
> 
> Although there might be subtle animation effects that would benefit from
> a more faithful evolution of displayed pixels in time, that complication is
> generally not needed (since most Apple II programs at most synchronize
> video memory updates with VBL, and are otherwise not precisely synched
> to the video refresh cycle).

This guy (http://www.tlb.org/) wrote an Apple II video emulator as a
screen saver module for XScreenSaver. It looks like an Apple II
using an old, blurry, color TV set as a monitor. It is remarkably
realistic looking.

-Sheldon