/usr/share/openmsx/scripts/screenshot.tcl is in openmsx-data 0.10.0-1ubuntu1.
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 | namespace eval openmsx {
rename ::screenshot old_screenshot
proc screenshot {args} {
set args2 [list]
set sprites true
foreach arg $args {
if {$arg eq "-no-sprites"} {
set sprites false
} elseif {$arg eq "-guess-name"} {
set base [utils::filename_clean [guess_title untitled]]
if {$base ne ""} {lappend args2 -prefix "$base "}
} else {
lappend args2 $arg
}
}
if {$sprites} {
old_screenshot {*}$args2
} else {
# disable sprites, wait for one complete frame and take screenshot
set orig_disable_sprites $::disablesprites
set ::disablesprites true
after frame [namespace code [list screenshot_helper1 $orig_disable_sprites $args2]]
}
}
proc screenshot_helper1 {orig_disable_sprites args2} {
after frame [namespace code [list screenshot_helper2 $orig_disable_sprites $args2]]
}
proc screenshot_helper2 {orig_disable_sprites args2} {
# take screenshot and restore 'disablesprites' setting
old_screenshot {*}$args2
set ::disablesprites $orig_disable_sprites
}
namespace export screenshot
}; # namespace
namespace import openmsx::screenshot
|