Yes, yes, yes …

One of the features I missed the most is not in VICE, as per one of the most recent builds (one of the last builds before 3.3 becomes 3.4). Logging to file. Quite often when I make a version of a game, I need to record values. Especially games where the loader is fed with data that is not in a consistent table, you need to set a trap at each call of the loader and record the values. That’s tedious and error-prone.

The new commands are logname and log on/off.

Logname is quite obvious – it sets the name of the textfile. I guess one could wish for an option to overwrite or append if the file already exists, but here I think it always overwrites.

The next command is log on/off and if it’s on, it simply copies the same content as sent to the screen also to the file set by the logname.

So how to use this? Well, it’s here quite handy to also know a few other commands:

Break – triggers a break to the monitor window where the breakpoint address is executed.

Watch – triggers a break to the monitor where the address is read/written to.

These are basically the same command but break defaults to trigger on execution and watch defaults to read/write, but if you give the arguments they can be the same. “Watch exec” is the same as break with no argument.

Trace – triggers a break on all of the exec/load/store but doesn’t open the monitor window on the hit. It merely prints it to the console. With the new log, it can also print to file.

Command – The break/watch/trace points are allocated an index. Issuing Command <index> and a string, the command in the string is issued when the breakpoint latches. The index is incremented with every new one, but the counter is reset to 1 when you issue a delete to clear all points defined. I issue the delete in order to ensure that the index reference in the trace command is correct.

As you can see in my example you can also stack commands using a semicolon, so a command can issue multiple commands.


logname "my_log.txt"
trace exec cb00
command 1 "m ce44 ce45;m ce47 ce48;m cb20 cb21;m cb49 cb4a;m 67 68;chis 5"
log on

The above silently triggers an execution on cb00 and then issues a stack of commands.

Please mind that the file is written to, but you OS might buffer the writes so that the file isn’t updated until it’s closed. Opening the monitor, you might need to do a “log off” to make that happen, or it might not happen before you close VICE.

As a bonus, I could also add that in case you don’t feel like typing the commands multiple times, you can create command files. This is done using the record “<filename>” command. To execute it, you playback using pb”<filename>”.

Thanks for rating this! Now tell the world how you feel - .
How does this post make you feel?
  • Excited
  • Fascinated
  • Amused
  • Bored
  • Sad
  • Angry