#########################################################################

# define Page 1 background file and size (80*25 lines)

MENU_BIN        MENU.BIN 25

# define menu variables

### --- line 6

SPINBUTTON HPFS          7  6 "200"+"800"+"2048" "2048" h

SPINBUTTON FAT          20  6 "128"+"2048"+"8000"+"14000" "2048" f

SPINBUTTON JFS          34  6 "--"+"5"+"40" "40" j
Hidden Var JFSCACHE 1
EndStatement If JFS = "--" Then JFSCACHE :=     0
EndStatement If JFS =  "5" Then JFSCACHE :=  5120
EndStatement If JFS = "40" Then JFSCACHE := 40960

SPINBUTTON FAT32        45  6 "off"+"read"+"r+w" "off" a

SPINBUTTON NTFS         54  6 "off"+"read"+"r+w" "off"

SPINBUTTON RAMFS        63  6 "---"+"99"+"99R" "99R" r

### --- line 9

SPINBUTTON SHELL         7  9 L20 "Command Line"        ~
                                 +"single FC/2"         ~
                                 +"PM+Command line"     ~
                                 +"PM+FC/2"             ~
                                 +"Workplace Shell"     ~
                                 +"TShell"              ~
                                  "Workplace Shell" s

Hidden Boolean TSHELL false
EndStatement TSHELL := SHELL = "TShell"

SPINBUTTON DOS          32  9 L12 "ProtectOnly"         ~
                                 +"DOS Support"         ~
                                 +"DOS+WinOS2"          ~
                                  "DOS Support" d

VAR        ODIN         50  9 Boolean FALSE o

VAR        VIRTUALPC    63  9 Boolean TRUE

### --- line 12

SPINBUTTON NET           7 12 L20 "none"                ~
                                 +"TCP/IP"              ~
                                 +"TCP/IP+Peer"         ~
                                  "TCP/IP" n
#                                 "none" n Delete_at_Menu_Exit

STRING     USER         33 12 20 "guest" u

VAR        ACPI         66 12 Boolean FALSE

### --- line 15

SPINBUTTON MOUSE         7 15 L20 "none"                ~
                             +"Mouse Systems"           ~
                             +"Microsoft"               ~
                             +"PS/2"                    ~
                             +"Rodent"                  ~
                              "PS/2" m

VAR        SOUND        33 15 Boolean TRUE e

VAR        PCMCIA       44 15 Boolean TRUE p

VAR        USB          55 15 Boolean TRUE b

VAR        IOMEGA       66 15 Boolean FALSE i

### --- line 18

VAR        NETDRIVE      8 18 Boolean True
VAR        CDWRITER     23 18 Boolean FALSE w
VAR        SVDISK       39 18 Boolean TRUE k
VAR        TVFS         60 18 Boolean FALSE

### --- line 21

VAR        OS2KRND       8 21 Boolean FALSE g
SPINBUTTON AUTOCHECK    33 21 L15 "disabled"            ~
                                 +"normal"              ~
                                 +"forced"              ~
                                  "normal" c
###

#########################################################################
#
# boot to command line
QUICKKEY 1 HPFS="200" FAT="128" JFS="--" SHELL="TShell" DOS=1 SOUND=FALSE NET="none" NETDRIVE=False
#
# config for work on HPFS with PM-program
QUICKKEY 2 HPFS="2048" FAT="128" JFS="40" SHELL="PM+FC/2" NET="none" DOS=1 ~
           CDWRITER=FALSE SVDISK=FALSE VIRTUALPC=FALSE NETDRIVE=True
#
# desktop
QUICKKEY 3 HPFS="2048" FAT="2048" JFS="40" SHELL="Workplace Shell" NET="TCP/IP+Peer" NETDRIVE=True
#
#########################################################################

# 0=unlimited,1..1000 seconds
TIMELIMIT 12

#########################################################################

# set default value for HPFS cache size

Hidden Spinbutton OS2CSM_MEMORY "0..4"+"5..8"+"9..16"+"17..24" ~
     +"25..32"+"33..48"+"49..64"+"65..96"+"97..128"+"129..256" ~
     +"257..512"+"513.."   "513.."

BeginStatement  HPFS := "800"
BeginStatement  if OS2CSM_MEMORY > "5..8" then HPFS := "2048"


# detect mouse

Hidden Boolean found false
BeginStatement  Search_PNP_DeviceID( "PNP0F13" found )
BeginStatement  if     found then MOUSE := "PS/2"
BeginStatement  if not found then MOUSE := "Mouse Systems"

# detect USB (e|o|u)hci

BeginStatement  USB := false
BeginStatement  Search_PCI_DeviceClass( "0C03" "00" found )
BeginStatement  USB := USB or found
BeginStatement  Search_PCI_DeviceClass( "0C03" "10" found )
BeginStatement  USB := USB or found
BeginStatement  Search_PCI_DeviceClass( "0C03" "20" found )
BeginStatement  USB := USB or found

# detect CardBus

BeginStatement Search_PCI_DeviceClass( $0607 $00 PCMCIA )

# Virtual PC needs PM

EndStatement    if SHELL = "TShell" then VIRTUALPC := false
EndStatement    if SHELL = "TShell" then ODIN := false

EndStatement    if JFS = "--" then VIRTUALPC := false

Hidden Boolean MPTS  false
Hidden Boolean TCPIP false
Hidden Boolean LAN   false

EndStatement mpts  := net <> "none"
EndStatement lan   := net >= "TCP/IP+Peer"
EndStatement tcpip := net >= "TCP/IP"

# i have a CardBus (realtek card) and a PCCard modem.
# tcpip(dialup) and peer(lan) needs PCMCIA

EndStatement if lan then PCMCIA := true



#########################################################################
# F10
# MENU_ACCEPT_SCANCODE $4400
# Ctrl+F5
# MENU_VIEWBIOSSCREEN_SCANCODE $6200


# Help source file
  MENU_HELP_SOURCEFILE    MENU_HLP.TXT
# F1
  MENU_HELP_SCANCODE      $3b00

# F10->
#*(off)*MENU_CONFIRM_BIN  CONFIRM.BIN
# Enter
MENU_CONFIRM_YES_SCANCODE $1c0d
# Esc
MENU_CONFIRM_NO_SCANCODE  $011b

# Esc->
MENU_CANCEL_BIN           CANCEL.BIN
# Enter
MENU_CANCEL_YES_SCANCODE  $1c0d
# Esc
MENU_CANCEL_NO_SCANCODE   $011b

# F9->
MENU_RESET_BIN            RESET.BIN
# Enter
MENU_RESET_YES_SCANCODE   $1c0d
# Esc
MENU_RESET_NO_SCANCODE    $011b


RGB  0   0   0   0
RGB  1   0   0 170
RGB  2   0 170   0
RGB  3   0 170 170
RGB  4 170   0   0
RGB  5 170   0 170
RGB  6 170  85   0
RGB  7 170 170 170
RGB  8  85  85  85
RGB  9  85  85 255
RGB 10  85 255  85
RGB 11  85 255 255
RGB 12 255  85  85
RGB 13 255  85 255
RGB 14 255 255  85
RGB 15 255 255 255

# rgb 15   0   0   0
# rgb 14   0   0 170
# rgb 13   0 170   0
# rgb 12   0 170 170
# rgb 11 170   0   0
# rgb 10 170   0 170
# rgb  9 170  85   0
# rgb  8 170 170 170
# rgb  7  85  85  85
# rgb  6  85  85 255
# rgb  5  85 255  85
# rgb  4  85 255 255
# rgb  3 255  85  85
# rgb  2 255  85 255
# rgb  1 255 255  85
# rgb  0 255 255 255

#
Hidden Boolean OS2CSM_QUIET TRUE
Hidden Boolean OS2CSM_VPC   FALSE
Hidden Boolean OS2CSM_2OS2  FALSE

#########################################################################
#
# other sample code, disabled
#
# Spinbutton DRIVE_BOOT 78 9 L1 "A"+"B"+"C"+"D"+"E"+"F"+"G"+"H"+"I"+"J" ~
#                              +"K"+"L"+"M"+"N"+"O"+"P"+"Q"+"R"+"S"+"T" ~
#                              +"U"+"V"+"W"+"X"+"Y"+"Z"   "B"
# BeginStatement QUERY_BOOTDRIVE_LETTER( DRIVE_BOOT )
# EndStatement   SET_BOOTDRIVE_LETTER( DRIVE_BOOT )
#
#########################################################################
#
# add an option for device driver development, disabled
#
#
BeginStatement Str_Display( 52 20 1 ' test driver ' )
#
BeginStatement Str_Display( 52 21 1 ' [x] load             ' )
#
VAR        testdriver       54 21 Boolean FALSE
#
#########################################################################
#########################################################################
#
#          page2: network drivers
#
# this scren background fits eCS 1.1..
menu_bin        menu5net.bin 25
#
# include generated source code, either full or restricted(democd) list
#include menu_nic.txt
 include menu_nid.txt
#
#########################################################################
#########################################################################
#
#          page3: DMI/CPU information
#
menu_bin        blank.bin 25
#
BeginStatement Str_Display(  1 1 0 'Page 3: DMI/CPU information' )
#
String DummyVarPage3 1 1 0 ""
#
# these variable names are filled in by os2csm during startup
#
Hidden String OS2CSM_SysInfo_MANF 64 "unknown"
Hidden String OS2CSM_SysInfo_PROD 64 "unknown"
Hidden String OS2CSM_SysInfo_VERS 64 "unknown"
Hidden String OS2CSM_SysInfo_SERN 64 "unknown"
Hidden String OS2CSM_SysInfo_UUID 32 "unknown"
#
BeginStatement Str_Display(  3  3 0 'MANF:' )
BeginStatement Str_Display(  3  4 0 'PROD:' )
BeginStatement Str_Display(  3  5 0 'VERS:' )
BeginStatement Str_Display(  3  6 0 'SERN:' )
BeginStatement Str_Display(  3  7 0 'UUID:' )
BeginStatement Str_Display( 10  3 0 OS2CSM_SysInfo_MANF )
BeginStatement Str_Display( 10  4 0 OS2CSM_SysInfo_PROD )
BeginStatement Str_Display( 10  5 0 OS2CSM_SysInfo_VERS )
BeginStatement Str_Display( 10  6 0 OS2CSM_SysInfo_SERN )
BeginStatement Str_Display( 10  7 0 OS2CSM_SysInfo_UUID )
#
# display CPU info
Hidden String OS2CSM_CPU_FMS   3 '000'
Hidden String OS2CSM_CPU_NAME 12 '?'
#
BeginStatement Str_Display(  3 10 0 'OS2CSM_CPU_FMS' )
BeginStatement Str_Display( 20 10 0 OS2CSM_CPU_FMS )
BeginStatement Str_Display(  3 11 0 'OS2CSM_CPU_NAME' )
BeginStatement Str_Display( 20 11 0 OS2CSM_CPU_NAME )
#
# config.sys edit (memdisk mode)
BeginStatement Str_Display(  3 14 0 'Edit config.sys' )
Boolean MEMDISK_CONFIG_SYS_EDIT 20 14 true
#
# rename fileset function (memdisk mode)
BeginStatement Str_Display(  3 16 0 'Rename File Set' )
STRING MEMDISK_RENAME_FILESETA 20 16 1 "0"
STRING MEMDISK_RENAME_FILESETB 20 17 1 "0"
STRING MEMDISK_RENAME_FILESETC 20 18 1 "0"
STRING MEMDISK_RENAME_FILESETD 20 19 1 "0"
#
# delete OS2LOGO function (memdisk mode)
BeginStatement Str_Display(  3 21 0 'Delete OS2LOGO' )
Boolean MEMDISK_OS2LOGO_DELETE 20 21 False
#
#########################################################################
#########################################################################
#
#          page4: memdisk/os2ldr, memdisk size, PCI video, APM, ACPI detection
#
menu_bin        blank.bin 25
#
BeginStatement Str_Display(  1 1 0 'Page 4: memdisk/os2ldr, memdisk size, PCI video, APM, ACPI detection' )
#
String DummyVarPage4 1 1 0 ""
#
# these variable names are filled in by os2csm.bin during startup
#
Hidden String OS2CSM_Video_Vendor   4 "FFFF"
Hidden String OS2CSM_Video_DeviceID 4 "FFFF"
#
BeginStatement Str_Display(  3 3 0 'OS2CSM_Video_Vendor    :' )
BeginStatement Str_Display(  3 4 0 'OS2CSM_Video_DeviceID  :' )
BeginStatement Str_Display( 30 3 0 OS2CSM_Video_Vendor )
BeginStatement Str_Display( 30 4 0 OS2CSM_Video_DeviceID )
#
#
Hidden Var OS2CSM_MemDisk 1 0
#
BeginStatement Str_Display(  3 6 0 'OS2CSM_MemDisk         :' )
BeginStatement if OS2CSM_MemDisk = 0 then Str_Display( 30 6 0 'OS2CSM module type is OS2LDR attachment')
BeginStatement if OS2CSM_MemDisk = 1 then Str_Display( 30 6 0 'OS2CSM module type is MemDisk module')
#
#
Hidden Var OS2CSM_MemDisk_DiskSize 65535 0
Hidden Var OS2CSM_MemDisk_DiskFree 65535 0
#
BeginStatement Str_Display(  3 8 0 'OS2CSM_MemDisk_DiskSize:' )
BeginStatement Str_Display( 30 8 0 OS2CSM_MemDisk_DiskSize )
BeginStatement Str_Display( 40 8 0 'MiB' )
BeginStatement Str_Display(  3 9 0 'OS2CSM_MemDisk_DiskFree:' )
BeginStatement Str_Display( 30 9 0 OS2CSM_MemDisk_DiskFree )
BeginStatement Str_Display( 40 9 0 'MiB' )
#
# guess, if there is room for Scitech SNAP video driver
# Assume that 16 MiB disk should be free, to load it.
#
Hidden Boolean CAN_USE_SNAP_VIDEO false
#
BeginStatement CAN_USE_SNAP_VIDEO := OS2CSM_MemDisk_DiskFree > 16
#
# here you could do special 'detection' to avoid SNAP on specific VGA chips
#
# display the result
BeginStatement Str_Display(  3 11 0 'CAN_USE_SNAP_VIDEO     :' )
BeginStatement if not CAN_USE_SNAP_VIDEO then Str_Display( 30 11 0 'no. ' )
BeginStatement if     CAN_USE_SNAP_VIDEO then Str_Display( 30 11 0 'yes.' )
#
#
Hidden Boolean OS2CSM_APM false
#
BeginStatement Str_Display(  3 13 0 'APM BIOS present       :')
BeginStatement if not OS2CSM_APM then Str_Display( 30 13 0 'no. ' )
BeginStatement if     OS2CSM_APM then Str_Display( 30 13 0 'yes.' )
#
Hidden Boolean OS2CSM_ACPI false
#
BeginStatement Str_Display(  3 15 0 'ACPI tables present    :')
BeginStatement if not OS2CSM_ACPI then Str_Display( 30 15 0 'no. ' )
BeginStatement if     OS2CSM_ACPI then Str_Display( 30 15 0 'yes.' )
#
Hidden Boolean OS2CSM_UART false
#
BeginStatement Str_Display(  3 17 0 'UART (COM.SYS /F)      :')
BeginStatement if not OS2CSM_UART then Str_Display( 30 17 0 'no. ' )
BeginStatement if     OS2CSM_UART then Str_Display( 30 17 0 'yes.' )
#
#########################################################################
#########################################################################
#
#          page5: live search for PCI/PNP devices
#
menu_bin        blank.bin 25
#
BeginStatement Str_Display(  1  1 0 'Page 5: live search for PCI/PNP devices' )
#
# intel piix4 usb chip
BeginStatement Str_Display(  3  3 0 'Search for PCI Vendor/Device:' )
String Vendor 3  4 4 "8086"
String Device 8  4 4 "7112"
Hidden Boolean pci_pnp_found false
Hidden Var pci_pnp_count 255 1
Statement Search_PCI_DeviceID( Vendor Device pci_pnp_found )
Statement Count_PCI_DeviceID(  Vendor Device pci_pnp_count )
Statement If     pci_pnp_found Then Str_Display( 13  4 0 'device found :)' )
Statement If not pci_pnp_found Then Str_Display( 13  4 0 'not present ?  ' )
Statement Str_Display( 37  4 0 pci_pnp_count )

# 04=multimedia 01=sound
BeginStatement Str_Display(  3  6 0 'Search for PCI Class/Access:' )
#String PCIClass  3  7 4 "0401"
String PCIClass   3  7 4 "0607"
String PCIAccess  8  7 2 "00"
Statement Search_PCI_DeviceClass( PCIClass PCIAccess pci_pnp_found )
Statement Count_PCI_DeviceClass(  PCIClass PCIAccess pci_pnp_count )
Statement If     pci_pnp_found Then Str_Display( 13  7 0 'Class/Access found    ' )
Statement If not pci_pnp_found Then Str_Display( 13  7 0 'Class/Access not found' )
Statement Str_Display( 37  7 0 pci_pnp_count )

# pnp0b00=at real time clock
BeginStatement Str_Display(  3  9 0 'Search for PNP CODE:' )
String PNPID 3 10 7 "PNP0B00"
Statement Search_PNP_DeviceID( PNPID pci_pnp_found )
Statement Count_PNP_DeviceID(  PNPID pci_pnp_count )
Statement If     pci_pnp_found Then Str_Display( 13 10 0 'has realtime clock.  ' )
Statement If not pci_pnp_found Then Str_Display( 13 10 0 'do not have a clock ?' )
Statement Str_Display( 37 10 0 pci_pnp_count )

# 07=communication device 01=lpt ff=value 02 (?) is ok
BeginStatement Str_Display(  3 12 0 'Search for PNP Class/Access:' )
String PNPClass    3 13 4 "0701"
String PNPAccess   8 13 2 "FF"
Statement Search_PNP_DeviceClass( PNPClass PNPAccess pci_pnp_found )
Statement Count_PNP_DeviceClass(  PNPClass PNPAccess pci_pnp_count )
Statement If     pci_pnp_found Then Str_Display( 13 13 0 'Class/Access found    ' )
Statement If not pci_pnp_found Then Str_Display( 13 13 0 'Class/Access not found' )
Statement Str_Display( 37 13 0 pci_pnp_count )
#
#########################################################################
#
#  modified default values

BeginStatement  if OS2CSM_CPU_FMS = '681' then USER := "Veit"

BeginStatement  USB      := false
BeginStatement  CDWRITER := true
BeginStatement  ODIN     := true

# i have enough RAM

EndStateMent    IF FAT <= "8000" THEN FAT := "8000"

#########################################################################

