Date : Thu, 04 Jan 1996 20:43:24 +0000 (GMT)
From : James Fidell <james@...>
Subject: Re: Beeb emulator snapshot format
Alan Gilbert wrote:
> An idea and a question:
> You don't have anywhere for the sound chip information.
Good point. I'll have a think about what's needed for that.
> Why not create a tagged file format which contains a number of
> sections each starting with a keyword. Emulators would only store
> information for devices they know about, and similarly emulators could
> ignore sections for hardware they haven't got while its loading state
> in.
Very true. Are you suggesting a completely ASCII format for the file,
or binary data separated by ASCII keywords ?
> What is the 'number of outstanding IRQs' field for - I don't keep a count,
> I keep a bit field of who is generating IRQs/NMIs.
I neither know nor care who is generating IRQs/NMIs -- if I know that
one has been generated, I just hand it off to the OS interrupt-handler
to deal with -- it will sort out who is responsible. For that reason,
I just need to know how many devices have interrupts that are queued for
processing.
I've looked at this again today and I guess this field could be thrown
out. As far as I can see, it can be regenerated from other information
stored in the snapshot. I'll attempt to re-write my code as soon
as I can and re-write the spec. accordingly. I believe that I can
improve the way that I handle IRQs anyway.
Out of interest, why do you keep track of who has requested an interrupt ?
> I think there are also issues about exactly when the snapshot is taken
- for
> example my code is basically:
>
> while 1
> execute intruction
> Check for interrupts
> poll hardware
> end
>
> Where exactly is the state stored/loaded - the different places it could
> go in that loop could produce subtly different results if you are very
> unlucky.
Agreed. I have the same code layout as you (though it hasn't always been
so) and my snapshot is created right at the end of the loop (as a result
of checking the real hardware to see what it's up to). It seems like the
most sensible place to take a snapshot because that means that the
emulator would always start up on the point of executing the next
instruction. Perhaps this should be part of the spec. too.
James.
--
"Yield to temptation -- | Work: Somewhere at Netcom UK (soon)
it may not pass your way again" | Play: james@...
| http://www.OiT.co.uk/~james/
- Lazarus Long | James Fidell