This file is indexed.

/usr/share/openmsx/scripts/text_echo.tcl is in openmsx-data 0.8.2-2.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# $Id: text_echo.tcl 12042 2011-03-18 19:54:51Z m9710797 $

# TODO: add a way to turn this off...

namespace eval text_echo {

set_help_text text_echo \
{Echoes all characters printed in text mode to stderr, meaning they will appear on the command line that openMSX was started from.
}

variable graph
variable escape
variable escape_count

proc text_echo {} {
	variable graph 0
	variable escape 0
	variable escape_count 0
	debug set_bp 0x0018 {[pc_in_slot 0 0]} {text_echo::print}
	debug set_bp 0x00A2 {[pc_in_slot 0 0]} {text_echo::print}
	return ""
}

proc print {} {
	variable graph
	variable escape
	variable escape_count

	set char [reg A]
	if {$graph} {
		#puts -nonewline stderr [format "\[G%x\]" $char]
		set graph 0
	} elseif {$escape} {
		#puts -nonewline stderr [format "\[E%x\]" $char]
		if {$escape_count == 0} {
			if {$char == 0x59} {
				set escape_count 2
			} else {
				set escape_count 1
			}
		} else {
			incr escape_count -1
			if {$escape_count == 0} {
				set escape 0
			}
		}
	} elseif {$char == 0x01} {
		set graph 1
	} elseif {$char == 0x1B} {
		set escape 1
	} elseif {$char == 0x0A || $char >= 0x20} {
		puts -nonewline stderr [format %c $char]
	} else {
		#puts -nonewline stderr [format "\[N%x\]" $char]
	}
}

namespace export text_echo

} ;# namespace text_echo

namespace import text_echo::*