File: _toggle_freq.tcl

package info (click to toggle)
openmsx 21.0%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: forky
  • size: 28,132 kB
  • sloc: cpp: 244,928; xml: 54,344; tcl: 15,603; python: 5,335; perl: 281; sh: 78; makefile: 57
file content (9 lines) | stat: -rw-r--r-- 271 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
set_help_text toggle_freq "Switch the VDP between PAL (50 Hz)/NTSC (60 Hz)."

proc toggle_freq {} {
	vdpreg 9    [expr {[vdpreg 9   ] ^ 2}]
	poke 0xFFE8 [expr {[peek 0xFFE8] ^ 2}]

	set freq [expr {([vdpreg 9] & 2) ? 50 : 60}]
	message "Frequency set to $freq Hz" info
}