Checkpoint prints a wrong cycle id
Versatile Commodore Emulator
Brought to you by:
blackystardust,
gpz
Steps:
>1000 ea 4c 00 10r pc = 1000break 1001dev 8:xResult:
#1 (Stop on exec 1001) 137/$089, 4/$04
.C:1001 4C 00 10 JMP $1000 - A:00 X:00 Y:0A SP:f3 ..-...Z. 3839200
(C:$1001) chis
[SNIP]
.C:1000 EA NOP A:00 X:00 Y:0a SP:f3 ..-...Z. 3782585
(C:$1001) dev 8:
Setting default device to `Disk8'
(8:$ec12) chis
[SNIP]
.8:ec12 A6 72 LDX $72 A:ff X:06 Y:ff SP:45 ..-....C 3839200
(8:$ec12)
3839200 is the clock number from the drive CPU, not the CPU of the checkpoint. Probably due to a wrong vice_interface in:
void mon_stopwatch_show(const char *prefix, const char *suffix)
{
unsigned long t;
monitor_interface_t *vice_interface;
vice_interface = mon_interfaces[default_memspace];
t = (unsigned long)
(*vice_interface->clk - stopwatch_start_time[default_memspace]);
mon_out("%s%10lu%s", prefix, t, suffix);
}
It looks correct to me so far:
Note that the two clock counters may look very similar unless you reset one of them
But you are correct, its wrong in chis... looking
First observation: its not the stopwatch clock that is written into the cpu history, its always the actual CPU clock (which can never be "reset" like the stopwatch)
Also it correctly writes the origin memspace (alternating 1 and 2) and different clock values.
The function we are looking at is monitor_cpuhistory_store() in mon_memmap.c
OK full reproducer:
I was wrong of course - chis is correct. Its the checkpoint. looking more... :)
so you were actually correct, the problem was that mon_stopwatch_show() always used the default memspace. should be fixed in r46035 - please test
thanks for the fix, it works fine now.