View Single Post
Old 17 February 2015, 05:11   #8

Join Date: Dec 2014
Location: Montreal
Posts: 129
Originally Posted by Toni Wilen View Post
Not going to happen until display DMA stuff is completely understood, including all hidden internal hardware flags. (It is much more complex than "ddfstrt passed" and "ddfstop passed" and OCS and ECS also work quite differently even if results appear to be mostly same. I have many test cases that prove it)

Currently emulation has too many flags, I am quite sure real hardware is simpler. If current flags are stored to statefile, it forces emulation to stay compatible with them (even if it is totally wrong) or other choice is statefile that breaks between versions. I can't accept either one.

Scanline based state file support is more possible. (vpos can be anything but hpos must be zero). Much less unknown state to save.
Oh, I see. I thought that was more a code design issue but it's indeed very sound to avoid relying on emulator side state since it's bound to change as the knowledge of the underlying hardware changes.

With emulator side state you cannot guarantee that a statefile can be converted safely since future knowledge could make it invalid and not obviously convertible.

This said, there's a way to cheaply store a statefile at whichever cycle is desired without storing any emulator state:
- Record state at the last VBL here it's safe. (Business as usual.)
- Record all "external" inputs between state record and current cycle (human inputs: mouse, keyboard, all human inputs essentially) and the cycle at which they were first known (I guess they are emulated at the beginning of the frame though but let's assume they can happen anytime.).
- Record the current clock cycle number since the recorded state.
And that's it.

After the state is loaded, you just set the inputs at the time they were recorded while playing all cycles in cycle exact mode until you reach the expected clock cycle. If UAE is deterministic then you will be in the exact state the emulator was paused in, if it's not then well it's a bug right?

Of course this works only with stock hardware or if you also have the whole state of any signal-generating external hardware. How do you do for hard drives at the moment? Are they virtualized or also emulated?
Nekoniaow is offline  
Page generated in 0.05002 seconds with 10 queries