| |
Scarzix
Registered: Aug 2010 Posts: 143 |
VICE or similar cycle "perfect" emulator for screenshot?
Question: is there a way to get VICE or other "almost perfect emulater" to run a PRG for eg. 100 frames and then produce a screenshot automatically?
Scenario:
1) Run assembler
2) Spawn VICE ( or other near perfect emulator ) with PRG from assembler
3) Run for xxx frames
4) Save screen (including border colors/rastersplits) as a bitmap file (fileformat is not an issue)
I need to call this from within a program automatically. So a Commandline interface or a Dll perhaps. Writing my mainprogram in C# so a slow, but "true emulation" is needed.
Hope someone has a solution?
Cheers,
Scarzix/Offence |
|
... 18 posts hidden. Click here to view all posts.... |
| |
Scarzix
Registered: Aug 2010 Posts: 143 |
Nice ideas, might have to try them even the remote version. Still I wouldn't "feel in control" with frames so a bit hard to step through frames.
Wish there was some way to "pause" then "step" frame by frame.. or... "start with PRG and run until frame xxxx" then save PNG or something. |
| |
Scarzix
Registered: Aug 2010 Posts: 143 |
Thinking, maybe I could just embed VICE inside a Windows program and then mimick some sort of user-control on top of it... hmmm.. |
| |
Oswald
Registered: Apr 2002 Posts: 5017 |
Quote: Thinking, maybe I could just embed VICE inside a Windows program and then mimick some sort of user-control on top of it... hmmm..
autoit/autohotkey is the tool for that |
| |
Scarzix
Registered: Aug 2010 Posts: 143 |
Problem is that I in the end I will be running this on a webserver without anyone logged in, so actually no desktop user... no interaction.
Must figure out a way to "call the render" and "retrieve screenshot". |
| |
Rex
Registered: Sep 2011 Posts: 14 |
I have had some success using Tcl Expect and VICE Remote Monitor to remote control VICE to automatically create screenshots after the program has run for a while.
Using Expect to communicate with VICE remote monitor will allow you to call monitor commands , run the program for a while, send more monitor commands when the monitor regains control and so on.
This still requires a desktop on the computer running VICE and Tcl/Expect.
Determining when to make the screenshot could be done using the "step <count>" command of the monitor. This wont wait an exact number of cycles, but based on the average cycle consumption of instructions you should be able to find an OK value to use.
My Expect Code for creating a screenshot looks like this:
# Create a screenshot
set shotnameout "$output.$shotnum"
incr shotnum
set command "screenshot \"$shotnameout\""
# Send the command from the input-file
send "$command\r"
# Wait for the monitor to complete the command (or meet the next breakpoint)
expect "(C:*) $"
|
| |
MagerValp
Registered: Dec 2001 Posts: 1055 |
Quoting RexDetermining when to make the screenshot could be done using the "step <count>" command of the monitor. This wont wait an exact number of cycles, but based on the average cycle consumption of instructions you should be able to find an OK value to use.
You can use the "registers" command to display the current line, cycle, and total cycle count, allowing you to pinpoint a specific frame and raster line. |
| |
Perplex
Registered: Feb 2009 Posts: 254 |
Is there a way via the remote monitor to wait for a breakpoint to be triggered, then run some commands? Then you could do all the timing/frame counting from the C64 code and trigger the breakpoint at the exact right time. |
| |
Mr. SID
Registered: Jan 2003 Posts: 421 |
Yes you can attach a command to a breakpoint:
Syntax: command <checknum> "<Command>"
Specify `command' as the command to execute when checkpoint `checknum'
is hit. Note that the `x' command is not yet supported as a
command argument. |
| |
Rex
Registered: Sep 2011 Posts: 14 |
Quote: Is there a way via the remote monitor to wait for a breakpoint to be triggered, then run some commands? Then you could do all the timing/frame counting from the C64 code and trigger the breakpoint at the exact right time.
The reason for using Expect/Tcl is that it allows you to do exactly that.
The following code will create a breakpoint, run the program, wait for the breakpoint to trigger and the save a screenshot:
send "b $2100\r"
send "r\r"
expect "(C:*) $"
send "screenshot \"screen\""
expect "(C:*) $"
However what Scarzix wanted was a program to create screenshots automatically - so he probably does not know where to set a breakpoint to wait the right amount of cycles. |
| |
Scarzix
Registered: Aug 2010 Posts: 143 |
Correct Rex, I am looking for "frames" - like "100" frames from boot and that number could be changed or multiple shots could be made to form an animation. |
Previous - 1 | 2 | 3 - Next |