# Callback on changing the VDP command registers while a command is still in
20
# progress. Not enabled by default.
21
set_help_text vdpcmdinprogresscallback \
22
{This is an example of a vdpcmdinprogress callback function. To use it execute
23
set vdpcmdinprogress_callback vdpcmdinprogresscallback
24
After changing that setting this proc will be called whenever openMSX detects a
25
write to a VDP command engine register while there's still a VDP command in
26
progress. Often this is an indication of a bug in the MSX program. This example
27
callback proc only prints the register number, the value that was being written
28
and the program counter. Feel free to write your own callback procs. For
29
example it might be a good idea to enter 'debug break' mode in your callback,
30
so that you can easily examine what is going on.
31
32
@param reg The VDP command engine register number that was being written
33
This is in range 0..14. Note that it's OK to write register 12
34
while a command is in progress. So this callback will not be
35
triggered for writes to register 12.
36
@param val The value that was being written.
37
}
38
39
procvdpcmdinprogresscallback{regval}{
40
puts stderr [format"Write to VDP command engine detected while there's still a command in progress: reg = %d, val = %d, PC = 0x%04X"[expr{$reg+32}]$val[reg PC]]
message"The running MSX software has set bit 0 of VDP register 9 (dot clock direction) to one. In an ordinary MSX, the screen would go black and the CPU would stop running." warning