2015-05-27 01:11:31 +00:00
|
|
|
from fallout_functions import slowWrite
|
2015-06-14 21:05:56 +00:00
|
|
|
from fallout_functions import INPUT_PAUSE
|
|
|
|
from fallout_functions import TYPE_DELAY
|
|
|
|
from fallout_functions import upperInput
|
2015-05-31 21:54:43 +00:00
|
|
|
import curses
|
2015-05-27 01:11:31 +00:00
|
|
|
|
|
|
|
######################## global 'constants' ##############
|
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
ENTRY_1 = 'SET TERMINAL/INQUIRE'
|
|
|
|
|
|
|
|
ENTRY_2 = 'SET FILE/PROTECTION=OWNER:RWED ACCOUNTS.F'
|
|
|
|
|
|
|
|
ENTRY_3 = 'SET HALT RESTART/MAINT'
|
|
|
|
|
|
|
|
ENTRY_4 = 'RUN DEBUG/ACCOUNTS.F'
|
|
|
|
|
2015-05-27 01:11:31 +00:00
|
|
|
|
|
|
|
######################## text strings ####################
|
|
|
|
|
|
|
|
MESSAGE_1 = 'WELCOME TO ROBCO INDUSTRIES (TM) TERMLINK'
|
|
|
|
|
|
|
|
MESSAGE_2 = 'RIT-V300'
|
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
MESSAGE_3 = 'Initializing Robco Industries(TM) MF Boot Agent v2.3.0\n' \
|
|
|
|
'RETROS BIOS\n' \
|
|
|
|
'RBIOS-4.02.08.00 52EE5.E7.E8\n' \
|
|
|
|
'Copyright 2201-2203 Robco Ind.\n' \
|
|
|
|
'Uppermem: 64 KB\n' \
|
|
|
|
'Root (5A8)\n' \
|
|
|
|
'Maintenance Mode'
|
|
|
|
|
|
|
|
|
2015-05-27 01:11:31 +00:00
|
|
|
######################## functions #######################
|
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
def runBoot(scr, hardMode):
|
2015-05-27 01:11:31 +00:00
|
|
|
"""
|
|
|
|
Start the boot portion of the terminal
|
2015-06-14 21:05:56 +00:00
|
|
|
|
|
|
|
hardMode - boolean indicating whether the user has to enter the ENTRY
|
|
|
|
constants, or if they are entered automatically
|
2015-05-27 01:11:31 +00:00
|
|
|
"""
|
|
|
|
curses.use_default_colors()
|
|
|
|
scr.erase()
|
|
|
|
scr.move(0, 0)
|
2015-05-31 21:54:43 +00:00
|
|
|
|
2015-06-14 21:05:56 +00:00
|
|
|
curses.noecho()
|
|
|
|
scr.scrollok(True)
|
2015-05-27 01:11:31 +00:00
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
slowWrite(scr, MESSAGE_1 + '\n\n')
|
|
|
|
|
|
|
|
if hardMode:
|
|
|
|
# use must enter the correct text to proceed
|
|
|
|
entry = ''
|
|
|
|
while entry.upper() != ENTRY_1.upper():
|
|
|
|
slowWrite(scr, '>')
|
2015-06-14 21:05:56 +00:00
|
|
|
entry = upperInput(scr)
|
2015-05-31 21:54:43 +00:00
|
|
|
else:
|
|
|
|
# input is entered for them
|
|
|
|
slowWrite(scr, '>')
|
|
|
|
curses.napms(INPUT_PAUSE)
|
|
|
|
slowWrite(scr, ENTRY_1 + '\n', TYPE_DELAY)
|
|
|
|
|
|
|
|
slowWrite(scr, '\n' + MESSAGE_2 + '\n\n')
|
|
|
|
|
|
|
|
if hardMode:
|
|
|
|
entry = ''
|
|
|
|
while entry.upper() != ENTRY_2.upper():
|
|
|
|
slowWrite(scr, '>')
|
2015-06-14 21:05:56 +00:00
|
|
|
entry = upperInput(scr)
|
2015-05-31 21:54:43 +00:00
|
|
|
while entry.upper() != ENTRY_3.upper():
|
|
|
|
slowWrite(scr, '>')
|
2015-06-14 21:05:56 +00:00
|
|
|
entry = upperInput(scr)
|
2015-05-31 21:54:43 +00:00
|
|
|
else:
|
|
|
|
slowWrite(scr, '>')
|
|
|
|
curses.napms(INPUT_PAUSE)
|
|
|
|
slowWrite(scr, ENTRY_2 + '\n', TYPE_DELAY)
|
|
|
|
slowWrite(scr, '>')
|
|
|
|
curses.napms(INPUT_PAUSE)
|
|
|
|
slowWrite(scr, ENTRY_3 + '\n', TYPE_DELAY)
|
2015-05-27 01:11:31 +00:00
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
slowWrite(scr, '\n' + MESSAGE_3 + '\n\n')
|
2015-05-27 01:11:31 +00:00
|
|
|
|
2015-05-31 21:54:43 +00:00
|
|
|
if hardMode:
|
|
|
|
entry = ''
|
|
|
|
while entry.upper() != ENTRY_4.upper():
|
|
|
|
slowWrite(scr, '>')
|
2015-06-14 21:05:56 +00:00
|
|
|
entry = upperInput(scr)
|
2015-05-31 21:54:43 +00:00
|
|
|
else:
|
|
|
|
slowWrite(scr, '>')
|
|
|
|
curses.napms(INPUT_PAUSE)
|
|
|
|
slowWrite(scr, ENTRY_4 + '\n', TYPE_DELAY)
|
|
|
|
|
|
|
|
curses.napms(INPUT_PAUSE)
|
2015-05-27 01:11:31 +00:00
|
|
|
return True
|
|
|
|
|
|
|
|
def beginBoot(hardMode):
|
|
|
|
"""
|
|
|
|
Initialize curses and start the boot process
|
|
|
|
|
|
|
|
hardMode - boolean indicating whether the user has to enter the ENTRY
|
|
|
|
constants, or if they are entered automatically
|
|
|
|
Returns true if hardMode == false or if the user entered the correct string
|
|
|
|
"""
|
2015-05-31 21:54:43 +00:00
|
|
|
res = curses.wrapper(runBoot, hardMode)
|
2015-05-27 01:11:31 +00:00
|
|
|
return res
|