[Coco] Writing a CPU simulator for the 6809

William Astle lost at l-w.ca
Tue Aug 27 00:16:15 EDT 2013


On 2013-08-26 21:13, Tony Cappellini wrote:
> I don't understand how one would attempt to write software to simulate a
> hires graphics screen, while maintaining the timings that the VDG normally
> handles.

You do it exactly the same way you do the CPU. You do, of course, need 
to apply the appropriate code to actually display the result of the VDG, 
which is potentially difficult. However, if you are not interested in 
precise timing but rather just having non-timing critical stuff working, 
then it becomes a lot easier. I once lashed up a very basic "emulation" 
of the VDG which only converted the assigned video memory to a window. I 
think it took me a few hours to do that in C using SDL. It was not 
timing accurate but it was enough to display what the rest of the 
emulation was doing.

The PIAs and other stuff is no different. For a simple emulation, you 
look at what behaviour is presented to the program and make that happen. 
Accurate emulation is much harder.

Now, here's the fun part. You can implement a timing accurate emulation 
without actually emulating in real time! As long as it doesn't need to 
interface accurately with external timing sensitive stuff like sound 
hardware, you can run slower than real time as long as all the relative 
timings are correct. The machine being emulated won't know the 
difference. If the hardware running the emulator is fast enough, the 
simulation will be able to run in real time, of course.



More information about the Coco mailing list