Open SpiceWare opened 7 years ago
There's already something somewhat similar to this in the code, but it's commented out. I experimented with the ability to do what I called 'event recording'. Basically, when this was turned on, an initial state save was done, and then for every frame, the events generated were also saved. Upon 'replaying' the recording, the state file was reloaded, and the events replayed. In effect, the emulation ran itself, as if someone was inputting the events. But they were synthetic, not from an actual player.
This sounds very much like what is needed here. The only difference is that the events are read from some external file, vs. from an event recording generated by Stella itself. A very cool thing to have, if we ever find time to do it.
IMO we should use an universal, editable format e.g. XML
This would be pretty useful for testing (haven't forgotten about that) and benchmarking as well. As a format: please not XML --- I always get nervous cramps when trying to write XML without a XSD and full IDE support 😉 What about YAML? It is easy to read, easy to write, and there are parsers aplenty out there.
An XSD would be no problem. But whatever you prefer, even key/value pairs should work.
Maybe a batch file for the debugger would be simpler/quicker to implement. There's already a frame command so would need new commands to set the bits in SWCHA, SWCHB, INPT4, etc and a new command RUN {batfile} to read in the file and act as if the user typed them in a line at a time.
; frame 1 RESET=ON FRAME ; frame 2 RESET=OFF LEFT=ON FRAME ; frames 3-7 LEFT=OFF FIRE=ON FRAME 5 ; frame 8 FIRE=OFF ...
So the frame would only advance when you issue a FRAME command and values would stay set to whatever you last set them to.
What frame command do you mean?
type HELP in the debugger's prompt and you'll see a list of commands, frame is one of them. Type frame by itself to advance the emulation a single frame, or type frame # to advance it multiple frames. # is a hex value so frame 10 would advance 16 frames.
Ah, I thought you meant the command line.
Aha - yeah, I was thinking it would be faster to take advantage of the command parser that's already in place than to create a new parser.
I think could be further enhanced, e.g.
During a discussion about Todd Roger's score in Dragster, it became apparent that a way to play back a sequence of the input state values would be handy. A text file containing something like this:
would be used like this: