# remember to "dbrm /State/GeneralConfig Complete" after setting PAL GS to make tivo come up in GS.
proc action_pal_ntsc {chan path env} {
if {[string index $path 0] == "/"} {
set path [string range $path 1 end]
}
puts $chan [html_start ""]
set bootargs "[exec bootpage -p /dev/hda]"
set bootmsg "Current TiVo Boot Parameters:"
puts $chan "ozTiVo Video Switching Utility
"
puts $chan "Options:
"
puts -nonewline $chan [html_link "PAL" "Set PAL"]
puts $chan "
"
puts -nonewline $chan [html_link "NTSC" "Set NTSC"]
puts $chan "
"
puts -nonewline $chan [html_link "GS" "Set PAL Guided Setup Mode"]
puts $chan "
"
if {$path == "PAL" } {
if {! [regexp TV_STD $bootargs ] } {
append bootargs " TV_STD=NTSC"
}
regsub -all TV_STD=NTSC $bootargs TV_STD=PAL newbootargs
regsub -all " GS=\[01\]" $newbootargs "" newbootargs
set bootmsg "TiVo set to PAL mode. Please reboot for change to take effect. Boot params are now:"
set bootargs "$newbootargs"
exec bootpage -P "$bootargs" /dev/hda
} elseif {$path == "NTSC" } {
regsub -all " TV_STD=PAL" $bootargs "" newbootargs
regsub -all " GS=\[01\]" $newbootargs "" newbootargs
set bootmsg "TiVo set to NTSC mode. Please reboot for change to take effect. Boot params are now:"
set bootargs "$newbootargs"
exec bootpage -P "$bootargs" /dev/hda
} elseif {$path == "GS" } {
if {! [regexp TV_STD $bootargs ] } {
append bootargs " TV_STD=NTSC"
}
if {! [regexp GS=0 $bootargs ] } {
append bootargs " GS=0"
}
regsub -all GS=0 $bootargs GS=1 newbootargs
regsub -all TV_STD=NTSC $newbootargs TV_STD=PAL newbootargs
set bootmsg "TiVo set for PAL Guided Setup. Please Reboot."
set bootargs "$newbootargs"
exec bootpage -P "$bootargs" /dev/hda
}
puts $chan "
$bootmsg
"
puts $chan "$bootargs
"
puts $chan [html_end]
}
register_module "pal_ntsc" "PAL NTSC" "Change between PAL and NTSC. Enable Guided Setup in PAL."