output_capture.tcl 600 B

123456789101112131415161718192021
  1. # Tcl script for OpenMSX to capture the textual output of the MSX to a file
  2. #
  3. # Written by Pedro Gimeno Fortea, January 2020.
  4. # Donated to the public domain.
  5. # Special thanks to IRC users Vampier and BiFi for their help getting this to
  6. # work.
  7. #
  8. # Usage: openmsx -script output_capture.tcl <rest_of_options>
  9. # The output is written to a file called msx.out in the current directory.
  10. debug set_bp 0x18 {[pc_in_slot 0 0]} {output_txt::out_char}
  11. namespace eval output_txt {
  12. variable fout [open "msx.out" w]
  13. proc out_char {} {
  14. variable fout
  15. puts -nonewline $fout [format %c [reg A]]
  16. }
  17. }