Date : Tue, 30 Aug 1994 10:45:16 +0100
From : jfid@... (James Fidell)
Subject: Re: Emulator Fundamentals
Stephen Quan wrote:
> > Hi,
> >
> > Is there a general structure to software emulators? For example, in
> > James Fidell's BBC B emulator, the first thing that is done is to
> > load the OS ROM. What happens after that? If someone could explain
> > generally how it all works, I would appreciate it very much.
> >
> > Thanks.
> >
> > Raymond.
>
> Well, as far writing the emulator goes, the first thing was get
> a working 6502. I started with a very limited set of structions
> that were emulated, and have it bomb out on the first RTS command.
>
> When the 6502 is done, you can load in the OS rom at $C000-$FFFF,
> and load in a memory image of $000-$DFF and set your PC to the
> word address stored in $FFFC, and you things will work.
Well I started by completing as much of the 6502 emulation as possible.
At the same time as writing the instruction code, I also added debug
code to print out the currently executing instruction.
Then I transferred the OS and BASIC ROMs from my Beeb to my PC, loaded
them in at the appropriate addresses, set the PC to (&FFFC) and set it
off to see what would happen.
By following the list of instructions being executed, I gradually worked
out which bits of hardware needed to be emulated first and which I could
reasonably safely forget about.
James.
--
"Yield to temptation -- |
it may not pass your way again" | jfid@...
|
- Lazarus Long | James Fidell