h02213
s 01384/00000/00000
d D 1.1 83/03/23 16:18:05 bog 1 0
c date and time created 83/03/23 16:18:05 by bog
e
u
4
U
t
T
I 1
#############################################################################
#									    #
#	This material is confidential and is furnished under		    #
#	a written license agreement.  It may not be used,		    #
#	copied or disclosed to others except in accordance		    #
#	with the terms of that agreement.				    #
#									    #
#	Copyright (C) 1982 Graphic Software Systems, Inc.		    #
#	All rights reserved.						    #
#									    #
#############################################################################
#									    #
#	Function:  							    #
#		Block Data EmMDau					    #
#		    Menu code data structure initialization		    #
#									    #
#	Called By:							    #
#									    #
#	Routines Called:						    #
#									    #
#############################################################################
 
Block Data EmMDau
 
BEGINCOMMON
COMMON(BEAMSTATE)
COMMON(SWITCHES)
COMMON(STRAPS)
COMMON(INITIALIZATION)
COMMON(COMMSTATE)
COMMON(COMMCAPABILITY)
COMMON(SPECIALKEYS)
COMMON(MENUMACHINE)
ENDCOMMON
 
# Configuration Menu
 
MProc
 MLabel(`CfgPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`CfgB')
  MShowString(`SelectOption')
  MShowLine(`Config     A:',0)
  MGroups(`
    MGroup(`CfO1',`
      MItem(`
	MShowString(`SNo')
	MShowString(`CfL1')
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`Spec Key   C:',0)
	')
      ')
    MGroup(`CfO2',`
      MItem(`
	MShowString(`SNo')
	MShowString(`CfL2')
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`4010 Opt   E:',0)
	')
      ')
    MGroup(`CfO3',`
      MItem(`
	MShowString(`SNo')
	MShowString(`CfL3')
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`Pagefull   G:',0)
	')
      ')
    MGroup(`CfO4',`
      MItem(`
	MShowString(`SNo')
	MShowLine(`           H:',0)
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`Char Opt   I:',0)
	')
      ')
    MGroup(`CfO5',`
      MItem(`
	MShowString(`SNo')
	MShowLine(`           J:',0)
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`Disp Opt   K:',0)
	')
      ')
    MGroup(`CfO6',`
      MItem(`
	MShowString(`SNo')
	MShowLine(`           L:',0)
	')
      MItem(`
	MShowString(`SYes')
	MShowLine(`Hardcopy   M:',0)
	')
      ')
    MGroup(`CfO7',`
      MItem(`
	MShowString(`SNo')
	MShowLine(`           O:',0)
	')
      MItem(`
	MShowString(`SYes')
	')
      ')
    ')
  MShowString(`RetExitHelp')
 MLabel(`CfgPoll')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMCfOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO1')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMSKOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO2')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MM10Opt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO3')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMPgOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO4')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMChOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO5')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMDsOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO6')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MMHcOpt')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`CfO7')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`CfgHPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`CfgH')
      MShowString(`TypeRet')
      MShowString(`CfgB')
     MLabel(`CfgHPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`CfgPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`CfgHPage')')
	',`
	')
      MGoto(`CfgHPoll')
      ')
    MCase(`UPA',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMCfOpt')
      ')
    MCase(`UPB',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMCfOpt')
      ')
    MCase(`UPC',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMSKOpt')
      ')
    MCase(`UPD',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMSKOpt')
      ')
    MCase(`UPE',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MM10Opt')
      ')
    MCase(`UPF',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MM10Opt')
      ')
    MCase(`UPG',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMPgOpt')
      ')
    MCase(`UPH',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMPgOpt')
      ')
    MCase(`UPI',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMChOpt')
      ')
    MCase(`UPJ',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMChOpt')
      ')
    MCase(`UPK',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMDsOpt')
      ')
    MCase(`UPL',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMDsOpt')
      ')
    MCase(`UPM',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MMHcOpt')
      ')
    MCase(`UPN',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MMHcOpt')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    ',`
    ')
  MGoto(`CfgPoll')
 
# Special Keys Menu
 
MProc
 MLabel(`SpKeyPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`SpKB')
  MShowString(`SelectOption')
  MShowOptLine(1,`Page                        ',0)
  MSaveXY(`MenuMachine',`MReg0')
  MShowString(`M1CrLf')
  MShowOptLine(2,`Reset',1)
  MShowOptLine(3,`Local/Line',1)
  MShowOptLine(4,`Break',1)
  MShowOptLine(5,`Go to Menus',1)
  MLoadLogical(`MenuMachine',`MMHcOpt')
  MIf(`
    MShowOptLine(6,`Make Hardcopy',1)
    ')
  MLoadLogical(`MenuMachine',`MMPgOpt',)
  MIf(`
    MShowOptLine(7,`Release Pagefull',1)
    MShowOptLine(8,`Toggle Pagefull Margin',1)
    ')
  MShowOptLine(9,`Exit to Operating System',1)
 
  MLoadImmed(1)		#Loop counter
  MStoreInteger(`MenuMachine',`MReg4')	#Save as loop count
 
  MMove(`MenuMachine',`MReg0')	#Move to beginning of 1st string
  MLoadChar(`MSpecialKeys',`MTargPt')	#Load ptr to 1st string
 
 MLabel(`SpKeyLoop')
  # Reg0:  X,Y of beginning of next displayed string
  # Reg4:  Loop count: 1..MnNChN  (number of potentially shown strings)
  # Reg5:  Ptr to string corresponding to loop count
  MStoreInteger(`MenuMachine',`MReg5')	#Save ptr to string struct
  MLoadInteger(`MenuMachine',`MReg4')	#Get loop count
  MStoreInteger(`MenuMachine',`MIndex')	# as index
  MLoadChar(`-MenuMachine',`MMenNCh')	# into strings used
  MIfGe(`					#If this string used, disp
    MLoadInteger(`MenuMachine',`MReg5')	#Get ptr to string struct
    MStoreInteger(`MenuMachine',`MIndex')	#Ptr to this string
    MShowEditString(`-MSpecialKeys',eval(MTarget+STRING+1),
	eval(MTarget+STRINGLENGTH))	#Show "strng"
    MMove(`MenuMachine',`MReg0')		#Move to beginning
    MShowChar(`LF')			#Down a line
    MSaveXY(`MenuMachine',`MReg0')	#Save position
    ')					#End display if
  MLoadInteger(`MenuMachine',`MReg4')	#Get count
  MAddImmed(1)			#Increment
  MStoreInteger(`MenuMachine',`MReg4')	#Save incremented count
  MSubImmed(9)	#Test for all strings shown
  MIfLe(`
    MLoadInteger(`MenuMachine',`MReg5')	#Get ptr to string struct
    MStoreInteger(`MenuMachine',`MIndex')	#Ptr to this string
    MLoadChar(`-MSpecialKeys',`MTarget')	#Load ptr to next
    MGoto(`SpKeyLoop')		#Loop for next string
    ')
 
  MShowString(`RetExitHelp')
 
 MLabel(`SpKeyPoll')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`SpKeyH1Page')
      MNewPage
      MShowString(`Header1')
      MShowString(`SpKeyH1')
      MShowString(`TypeRet')
      MShowString(`SpKB')
     MLabel(`SpKeyH1Poll')
      MSwitch(`
	MCase(`CR',`MGoto(`SpKeyPage')')
	MCase(`QUESTIONMARK',`
	 MLabel(`SpKeyH2Page')
	  MNewPage
	  MShowString(`Header1')
	  MShowString(`SpKeyH2')
	  MShowString(`TypeRet')
	  MShowString(`SpKB')
	 MLabel(`SpKeyH2Poll')
	  MSwitch(`
	    MCase(`CR',`MGoto(`SpKeyPage')')
	    MCase(`QUESTIONMARK',`MGoto(`SpKeyH1Page')')
	    MCase(`UPS',`MRet')
	    MCase(`UPX',`MExit')
	    MCase(`PAGE',`MGoto(`SpKeyH2Page')')
	    ',`
	    ')			#End SpKeyH2Poll Switch
	  MGoto(`SpKeyH2Poll')
	  ')			#End SpKeyH2Page
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`SpKeyH1Page')')
	',`
	')				#End SpKeyH1Poll Switch
      MGoto(`SpKeyH1Poll')
      ')				#End SpKeyH1Page
    MCase(-1,`MLoadImmed(1)')	#Fall to common edit handler
    MCase(-2,`MLoadImmed(2)')	#Fall to common edit handler
    MCase(-3,`MLoadImmed(3)')	#Fall to common edit handler
    MCase(-4,`MLoadImmed(4)')	#Fall to common edit handler
    MCase(-5,`MLoadImmed(5)')	#Fall to common edit handler
    MCase(-6,`MLoadImmed(6)')	#Fall to common edit handler
    MCase(-7,`MLoadImmed(7)')	#Fall to common edit handler
    MCase(-8,`MLoadImmed(8)')	#Fall to common edit handler
    MCase(-9,`MLoadImmed(9)')	#Fall to common edit handler
    MCase(`UPS',`MRet')
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`SpKeyPage')')
    ',`
    MGoto(`SpKeyPoll')		#OTHERWISE ignore unknowns
    ')				#End SpKeyPoll Switch
  # IAc holds number of links to follow to find string to edit
  MStoreInteger(`MenuMachine',`MReg0')	#Save link count
  MLoadChar(`MSpecialKeys',`MTargPt')	#Get ptr to first string
 
 MLabel(`SpKeyFind')
  MStoreInteger(`MenuMachine',`MIndex')	#Save ptr to this string
  MLoadInteger(`MenuMachine',`MReg0')	#Get link count
  MSubImmed(1)			#Decrement
  MStoreInteger(`MenuMachine',`MReg0')	#Save decremented count
  MIfGt(`					#If not yet found
    MLoadChar(`-MSpecialKeys',`MTarget')	# get ptr to next
    MGoto(`SpKeyFind')
    ')
  MEditString(`-MSpecialKeys',eval(MTarget+STRING+1),
      eval(MTarget+STRINGLENGTH),10)	#Construct a new string
  MGoto(`SpKeyPage')			# & reshow page
					#End of SpKeyPage
 
# 4010 Options Menu
 
MProc
 MLabel(`EmOptPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`EmOB')
  MShowString(`SelectOption')
  MShowString(`EO1')
  MGroups(`
    MGroup(`EmOpt1',`
      MItem(`
	MShowString(`EO2')
	')
      MItem(`
	MShowString(`EO3')
	')
      ')
    MGroup(`EmOpt2',`
      MItem(`
	MShowString(`EO4')
	')
      MItem(`
	MShowString(`EO5')
	')
      ')
    MGroup(`EmOpt3',`
      MItem(`
	MShowString(`EO6')
	')
      MItem(`
	MShowString(`EO7')
	')
      MItem(`
	MShowString(`EO8')
	')
      ')
    MGroup(`EmOpt4',`
      MItem(`
	MShowString(`EO9')
	')
      MItem(`
	MShowString(`EO10')
	')
      ')
    MGroup(`EmOpt5',`
      MItem(`
	MShowString(`EO11')
	')
      MItem(`
	MShowString(`EO12')
	')
      ')
    ')
  MShowString(`RetExitHelp')
 MLabel(`EmOptPoll')
  # Update the *s in the various group
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MLCrLf')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`EmOpt1')
  MLoadImmed(1)
  MLoadLogical(`MenuMachine',`MLLfCr')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`EmOpt2')
  MLoadChar(`MEmStraps',`MGinTrm')
  MIfEq(`MLoadImmed(3)')
  MUpdateGroup(`EmOpt3')
  MLoadImmed(1)
  MLoadLogical(`MEmStraps',`MLocEch')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`EmOpt4')
  MLoadImmed(1)
  MLoadLogical(`MEmStraps',`MDelLoY')
  MIfNot(`MLoadImmed(2)')
  MUpdateGroup(`EmOpt5')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`EmOptHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`EmOptHelp')
      MShowString(`TypeRet')
      MShowString(`EmOB')
     MLabel(`EmOptHelpPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`EmOptPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`EmOptHelpPage')')
	',`
	')			#End EmOptHelpPoll Switch
      MGoto(`EmOptHelpPoll')
      ')			#End EmOptHelpPage
    MCase(`UPA',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MLCrLf')
      ')
    MCase(`UPB',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MLCrLf')
      ')
    MCase(`UPC',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MLLfCr')
      ')
    MCase(`UPD',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MLLfCr')
      ')
    MCase(`UPE',`
      MLoadImmed(`CRGINTERM')
      MStoreChar(`MEmStraps',`MGinTrm')
      ')
    MCase(`UPF',`
      MLoadImmed(`CREOTGINTERM')
      MStoreChar(`MEmStraps',`MGinTrm')
      ')
    MCase(`UPG',`
      MLoadImmed(`NOGINTERM')
      MStoreChar(`MEmStraps',`MGinTrm')
      ')
    MCase(`UPH',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MLocEch')
      ')
    MCase(`UPI',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MLocEch')
      ')
    MCase(`UPJ',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MDelLoY')
      ')
    MCase(`UPK',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MDelLoY')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`EmOptPage')')
    ',`
    ')				#End EmOptPoll Switch
  MGoto(`EmOptPoll')		#End EmOptPage
 
End
Block Data EmMDa4
BEGINCOMMON
COMMON(MENUMACHINE)
ENDCOMMON
 
# Pagefull Options Menu
 
MProc
 MLabel(`PfPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`PfB')
  MShowString(`SelectOption')
  MShowLine(`On Pagefull:',1)
  MShowString(`PfL1')
  MGroups(`
    MGroup(`Pf1',`
      MItem(`
	MNewCase(1)
	MShowString(`SNo')
	MShowString(`PfL0')
	MShowLine(`B:',0)
	')
      MItem(`
	MNewCase(2)
	MShowString(`SYes')
	')
      ')
    MLoadLogical(`MenuMachine',`MMHcOpt')
    MIf(`
      MShowString(`PfL2')
      MNewCase(3)
      MShowChar(-3)
      MShowChar(COLON)
      MGroup(`Pf2',`
	MItem(`
	  MShowString(`SNo')
	  MShowString(`PfL0')
	  MNewCase(4)
	  MShowChar(-4)
	  MShowChar(COLON)
	  ')
	MItem(`
	  MShowString(`SYes')
	  ')
	')
      ')
    MShowString(`PfL3')
    MNewCase(5)
    MShowChar(-5)
    MShowChar(COLON)
    MGroup(`Pf3',`
      MItem(`
	MShowString(`SNo')
	MShowString(`PfL0')
	MNewCase(6)
	MShowChar(-6)
	MShowChar(COLON)
	')
      MItem(`
	MShowString(`SYes')
	MShowString(`PfL4')
	MNewCase(7)
	MShowChar(-7)
	MShowChar(COLON)
	')
      ')
    MGroup(`Pf4',`
      MItem(`
	MShowString(`SNo')
	MShowString(`PfL0')
	MNewCase(8)
	MShowChar(-8)
	MShowChar(COLON)
	')
      MItem(`
	MShowString(`SYes')
	')
      ')
    ')
  MShowString(`PfL5')
  MLoadLogical(`MEmSwitches',`MPFMar1')
  MIf(`
    MShowLine(`1',1)
    ',`
    MShowLine(`2',1)
    ')
  MShowString(`RetExitHelp')
 MLabel(`PfPoll')
  MLoadImmed(1)
  MLoadLogical(`MEmStraps',`MPFBrk')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`Pf1')
  MLoadLogical(`MenuMachine',`MMHcOpt')
  MIf(`
    MLoadImmed(1)
    MLoadLogical(`MEmStraps',`MPFHdCp')
    MIf(`MLoadImmed(2)')
    MUpdateGroup(`Pf2')
    ')
  MLoadImmed(1)
  MLoadLogical(`MEmStraps',`MPFWait')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`Pf3')
  MLoadImmed(1)
  MLoadLogical(`MEmStraps',`MPFPage')
  MIf(`MLoadImmed(2)')
  MUpdateGroup(`Pf4')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`PfHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`PagefullHelp')
      MLoadLogical(`MenuMachine',`MMHcOpt')
      MIf(`MShowString(`PfH1')')
      MShowString(`PfH2')
      MShowString(`TypeRet')
      MShowString(`PfB')
     MLabel(`PfHelpPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`PfPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`PfHelpPage')')
	',`
	')			#End PfHelpPoll Switch
      MGoto(`PfHelpPoll')
      ')			#End PfHelpPage
    MCase(`-1',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MPFBrk')
      ')
    MCase(`-2',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MPFBrk')
      ')
    MCase(`-3',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MPFHdCp')
      ')
    MCase(`-4',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MPFHdCp')
      ')
    MCase(`-5',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MPFWait')
      ')
    MCase(`-6',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MPFWait')
      ')
    MCase(`-7',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MEmStraps',`MPFPage')
      ')
    MCase(`-8',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MEmStraps',`MPFPage')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`PfPage')')
    ',`
    ')				#End PfPoll Switch
  MGoto(`PfPoll')		#End PfPage
 
# Character Spacing Subroutine
 
MProc
 MLabel(`ChSpacing')
  MMove(`MenuMachine',`MReg0')
  MShowString(`ChSp1')
  MSaveXY(`MenuMachine',`MReg0')
  MShowString(`ChSp2')
  MMove(`MenuMachine',`MReg0')
  MShowString(`ChSp3')
  MSaveXY(`MenuMachine',`MReg0')
  MShowString(`ChSp4')
  MMove(`MenuMachine',`MReg0')
  MShowString(`ChSp5')
  MSaveXY(`MenuMachine',`MReg0')
  MShowString(`ChSp6')
  MMove(`MenuMachine',`MReg0')
  MShowString(`ChSp7')
  MRet
 
# Character Options Menu
 
MProc
 MLabel(`ChPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`ChB')
  MShowString(`SelectOption')
  MShowLine(`A:   ',0)
  MLoadLogical(`MenuMachine',`MLNativ')
  MIf(`
    MShowChar(SPACE)
    ',`
    MShowChar(SPLAT)
    ')
  MShowLine(` 4010 Ch',0)
  MSaveXY(`MenuMachine',`MReg0')
  MShowLine(`aracter Spacing',0)
  MChMode(2)
  MCall(`ChSpacing')
  MSaveXY(`MenuMachine',`MReg0')
  MChMode(1)
  MMove(`MenuMachine',`MReg0')
  MShowChar(`LF')
  MShowLine(`B:   ',0)
  MLoadLogical(`MenuMachine',`MLNativ')
  MIf(`
    MShowChar(SPLAT)
    ',`
    MShowChar(SPACE)
    ')
  MShowLine(` Native ',0)
  MSaveXY(`MenuMachine',`MReg0')
  MShowLine(`Character Spacing',0)
  MCall(`ChSpacing')
  MShowString(`RetExitHelp')
 MLabel(`ChPoll')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`ChHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`ChHelp')
      MShowString(`TypeRet')
      MShowString(`ChB')
     MLabel(`ChHelpPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`ChPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`ChHelpPage')')
	',`
	')			#End ChHelpPoll Switch
      MGoto(`ChHelpPoll')
      ')			#End ChHelpPage
    MCase(`UPA',`
      MLoadLogical(`MenuMachine',`MFalse')
      MStoreLogical(`MenuMachine',`MLNativ')
      MGoto(`ChPage')
      ')
    MCase(`UPB',`
      MLoadLogical(`MenuMachine',`MTrue')
      MStoreLogical(`MenuMachine',`MLNativ')
      MGoto(`ChPage')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`ChPage')')
    ',`
    ')				#End ChPoll Switch
  MGoto(`ChPoll')		#End ChPage
 
# Display Options Menu
 
MProc
 MLabel(`DispPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`DsB')
  MShowString(`SelectOption')
  MShowChar(`UPA')
  MShowChar(`COLON')
  MGroups(`
    MGroup(`DO1',`
      MItem(`
	MShowLine(`Use 4010 Aspect Ratio',1)
	MShowChar(`UPB')
	MShowChar(`COLON')
	')
      MItem(`
	MShowLine(`Expand Display to Full Screen',2)
	')
      ')
    ')
  MShowLine(`C:  Menu Device       ',0)
  MShowInteger(`MenuMachine',`MMenDev')
  MShowString(`DS1')
  MShowInteger(`MenuMachine',`MNMNDev')
  MShowChar(`LF')
  MShowString(`RetExitHelp')
 MLabel(`DispPoll')
  MLoadImmed(2)
  MLoadLogical(`MenuMachine',`MLPAspc')
  MIf(`MLoadImmed(1)')
  MUpdateGroup(`DO1')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`DispHPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`DispH')
      MShowString(`TypeRet')
      MShowString(`DsB')
     MLabel(`DispHPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`DispPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`DispHPage')')
	',`
	')			#End DispHPoll Switch
      MGoto(`DispHPoll')
      ')			#End DispHPage
    MCase(`UPA',`MLoadLogical(`MenuMachine',`MTrue')')
    MCase(`UPB',`MLoadLogical(`MenuMachine',`MFalse')')
    MCase(`UPC',`
      MEditInteger(`MenuMachine',`MMenDev')
      MGoto(`DispPage')
      ')
    MCase(`UPD',`
      MEditInteger(`MenuMachine',`MNMNDev')
      MGoto(`DispPage')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`DispPage')')
    ',`
    MGoto(`DispPoll')
    ')				#End DispPoll Switch
  MStoreLogical(`MenuMachine',`MLPAspc')
  MGoto(`DispPoll')		#End DispPage
 
# Baud Rate Menu
 
MProc
 MLabel(`BaudPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`BdB')
  MShowString(`SelectOption')
  MGroups(`
    MShowLine(`  ',0)
    MGroup(`Bauds',`
      MLoadImmed(0)
      MIfGt(`			#Never take true path
       MLabel(`BaudItems')
	MItem			#1
	MRet
	MItem			#2
	MRet
	MItem			#3
	MRet
	MItem			#4
	MRet
	MItem			#5
	MRet
	MItem			#6
	MRet
	MItem			#7
	MRet
	MItem			#8
	MRet
	MItem			#9
	MRet
	MItem			#10
	MRet
	MItem			#11
	MRet
	MItem			#12
	MRet
	MItem			#13
	MRet
	MItem			#14
	MRet
	MItem			#15
	MRet
	')
      MStoreInteger(`MenuMachine',`MIndex')	#Initialize Ix to 0
     MLabel(`BaudLoop0')
      MLoadInteger(`MenuMachine',`MIndex')
      MAddImmed(1)
      MStoreInteger(`MenuMachine',`MIndex')
      MSubImmed(`BAUDDIM')
      MIfLe(`
	MLoadChar(`MCommCap',`MRBdCpL')
	MSubInteger(`MenuMachine',`MIndex')
	MIfGe(`
	  MLoadInteger(`MenuMachine',`MIndex')
	  MNewCase(0)
	  MShowChar(BS)
	  MShowChar(BS)
	  MLoadImmed(0)
	  MSubInteger(`MenuMachine',`MIndex')
	  MShowChar(0)
	  MShowChar(COLON)
	  MIxCall(5,`BaudItems')
	  MLoadInteger(`-MCommCap',`MRxBdCp')
	  MIfGe(`
	    MShowInteger(`-MCommCap',`MRxBdCp')
	    MShowString(`BaudString')
	    ',`
	    MShowLine(`externally clocked')
	    ')
	  ')
	MGoto(`BaudLoop0')
	')
      ')
    ')
  MShowString(`RetExitHelp')
 MLabel(`BaudPoll')
  MLoadChar(`MCommState',`MBaudIx')
  MUpdateGroup(`Bauds')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`BaudHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`BaudHelp')
      MShowString(`TypeRet')
      MShowString(`BdB')
     MLabel(`BaudHelpPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`BaudPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`BaudHelpPage')')
	',`
	')			#End BaudHelpPoll Switch
      MGoto(`BaudHelpPoll')
      ')			#End BaudHelpPage
    MCase(-1,`MLoadImmed(1)')
    MCase(-2,`MLoadImmed(2)')
    MCase(-3,`MLoadImmed(3)')
    MCase(-4,`MLoadImmed(4)')
    MCase(-5,`MLoadImmed(5)')
    MCase(-6,`MLoadImmed(6)')
    MCase(-7,`MLoadImmed(7)')
    MCase(-8,`MLoadImmed(8)')
    MCase(-9,`MLoadImmed(9)')
    MCase(-10,`MLoadImmed(10)')
    MCase(-11,`MLoadImmed(11)')
    MCase(-12,`MLoadImmed(12)')
    MCase(-13,`MLoadImmed(13)')
    MCase(-14,`MLoadImmed(14)')
    MCase(-15,`MLoadImmed(15)')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`BaudPage')')
    ',`
    MGoto(`BaudPoll')		#OTHERWISE poll again
    ')				#End BaudPoll Switch
  MStoreChar(`MCommState',`MBaudIx')
  MStoreInteger(`MenuMachine',`MIndex')
  MLoadInteger(`-MCommCap',`MRxBdCp')
  MStoreInteger(`MCommState',`MRxBaud')
  `# MStoreInteger(`MCommState',`MTxBaud')' # If split rates someday
  MLoadLogical(`MenuMachine',`MTrue')
  MStoreLogical(`MCommState',`MComChg')
  MGoto(`BaudPoll')		#End BaudPage
 
# Show a stop bit selection; IAc: 1 is 1, 2 is 1.5, 3 is 2
MProc
 MLabel(`CStBtShow')
  MSubImmed(2)
  MIfLe(`
    MShowChar(`ONE')
    MIfEq(`
      MShowChar(`DOT')
      MShowChar(`FIVE')
      ')
    ',`
    MShowChar(`TWO')
    ')
  MShowChar(`CR')
  MShowChar(`LF')
  MAddImmed(2)
  MRet
 
End
Block Data EmMDa5
BEGINCOMMON
COMMON(MENUMACHINE)
ENDCOMMON
 
# Data Bit Format Search Subroutine
#  Logical Function CmDtCk(IAc:Value)
#	Input:	Value	in MenIAc integer accumulator; value to search
#			`MCommCap':`MDtBtCp', available data bit format
#			table for.
#		CmDtCk:	(in MenLAc, logical accumulator) false if Value
#			not found, true if value found.
#    See if the requested data bit format is available.  Do not crash
#    the integer accumulator.  Return true or false in the logical accum
#    so that Ifs may be done.  Do not crash MReg0, either.
MProc
 MLabel(`CmDtCk')
  MStoreInteger(`MenuMachine',`MReg1')	# Save Value
  MLoadLogical(`MenuMachine',`MFalse')	# Assume not found
  MLoadImmed(1)				# First index
 MLabel(`CmDtCkLp')
  MStoreInteger(`MenuMachine',`MIndex')	# Index into MDtBtCp
  MSubChar(`MCommCap',`MDtBCpL')	# IAc <= Ix-(# of data bit formats)
  MIfLe(`				# While Ix <= (# of databit formats)
    MLoadInteger(`MenuMachine',`MReg1')	#  Get Value to test
    MSubChar(`-MCommCap',`MDtBtCp')	#   less avail format
    MIfEq(`				#  Value found; return true
      MLoadLogical(`MenuMachine',`MTrue')
      ')
    MLoadInteger(`MenuMachine',`MIndex')#  Get old Index
    MAddImmed(1)			#  Increment it
    MGoto(`CmDtCkLp')			#   & loop
    ')
  MLoadInteger(`MenuMachine',`MReg1')	# Get Value back
  MRet					#  & return
 
# Communications Options Menu
 
MProc
 MLabel(`CommPage')
  MNewPage
  MShowString(`Header1')
  MShowString(`OCB')
  MShowString(`SelectOption')
  MGroups(`
    MLoadChar(`MCommCap',`MStBCpL')
    MSubImmed(1)
    MIfGt(`
      MShowString(`CL1')
      MNewCase(1)
      MShowChar(-1)
      MShowChar(`COLON')
      MGroup(`CG1',`
	MItem
	MLoadChar(`MCommCap',`MStBtCp')
	MCall(`CStBtShow')
	MShowString(`CL0')
	MNewCase(2)
	MShowChar(-2)
	MShowChar(`COLON')
	MItem
	MLoadChar(`MCommCap',`eval(MStBtCp+1)')
	MCall(`CStBtShow')
	MLoadChar(`MCommCap',`MStBCpL')
	MSubImmed(3)
	MIfGe(`
	  MShowString(`CL0')
	  MNewCase(3)
	  MShowChar(-3)
	  MShowChar(`COLON')
	  MItem
	  MLoadChar(`MCommCap',`eval(MStBtCp+2)')
	  MCall(`CStBtShow')
	  ')
	')
      ')
    MLoadLogical(`MCommCap',`MParCap')
    MIf(`
      MShowString(`CL2')
      MNewCase(4)
      MShowChar(-4)
      MShowChar(`COLON')
      MGroup(`CG2',`
	MItem
	MShowLine(`None',1)
	MShowString(`CL0')
	MNewCase(5)
	MShowChar(-5)
	MShowChar(`COLON')
	MItem
	MShowLine(`Odd',1)
	MShowString(`CL0')
	MNewCase(6)
	MShowChar(-6)
	MShowChar(`COLON')
	MItem
	MShowLine(`Even',1)
	MShowString(`CL0')
	MNewCase(7)
	MShowChar(-7)
	MShowChar(`COLON')
	MItem
	MShowLine(`On',1)
	MShowString(`CL0')
	MNewCase(8)
	MShowChar(-8)
	MShowChar(`COLON')
	MItem
	MShowLine(`Off',1)
	')
      ')
    MLoadImmed(0)
    MLoadLogical(`MCommCap',`MRHwFCp')	# Rx h/w flagging capability
    MIf(`MLoadImmed(1)')
    MAddChar(`MCommCap',`MRStFCp')	# Rx str flagging capability
    MIfGt(`				# Rx some flagging capability
      MShowString(`CL3')
      MGroup(`CG3',`
	MLoadChar(`MCommCap',`MRStFCp')
	MIfGt(`
	  MNewCase(9)
	  MShowChar(`BS')
	  MShowChar(`BS')
	  MShowChar(-9)
	  MShowChar(`COLON')
	  MItem
	  MShowLine(`Data String',1)
	  MShowString(`CL4')
	  ')
	MLoadLogical(`MCommCap',`MRHwFCp')
	MIf(`
	  MNewCase(10)
	  MShowChar(`BS')
	  MShowChar(`BS')
	  MShowChar(-10)
	  MShowChar(`COLON')
	  MItem
	  MShowLine(`DTR/DSR',1)
	  MShowString(`CL4')
	  ')
	MNewCase(11)
	MShowChar(`BS')
	MShowChar(`BS')
	MShowChar(-11)
	MShowChar(`COLON')
	MItem
	MShowLine(`None',1)
	')
      ')
    ')
  MLoadChar(`MCommCap',`MRStFCp')	# Rx str flagging capability
  MIfGt(`
    MShowOptLine(12,`Stop String   ',0)
    MLoadInteger(`MCommState',`MRxStopStrLen')
    MStoreChar(`MCommState',`MTmpStL')
    MShowEditString(`MCommState',`MInStSS',`MTmpStL')
    MShowChar(`CR')
    MShowChar(`LF')
    MShowOptLine(13,`Go String     ',0)
    MLoadInteger(`MCommState',`MRxGoStrLen')
    MStoreChar(`MCommState',`MTmpStL')
    MShowEditString(`MCommState',`MInGoSS',`MTmpStL')
    MShowChar(`CR')
    MShowChar(`LF')
    ')
  MShowString(`RetExitHelp')
 MLabel(`CommPoll')
  MLoadInteger(`MCommState',`MStopBits')
  MUpdateGroup(`CG1')
  MLoadChar(`MCommState',`MPOnOff')
  MAddImmed(1)
  MUpdateGroup(`CG2')
  MLoadInteger(`MCommState',`MRxFlagMode')
  MIfEq(`MLoadImmed(3)')
  MUpdateGroup(`CG3')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`CommHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`OtherHelp')
      MLoadChar(`MCommCap',`MStBCpL')
      MSubImmed(1)
      MIfGt(`MShowString(`OH1')')
      MLoadLogical(`MCommCap',`MParCap')
      MIf(`MShowString(`OH2')')
      MLoadLogical(`MCommCap',`MRHwFCp')
      MIf(`
	MLoadChar(`MCommCap',`MRStFCp')
	MIfGt(`MShowString(`OH3')')
	')
      MShowString(`OH4')
      MShowString(`TypeRet')
      MShowString(`OCB')
     MLabel(`CommHelpPoll')
      MSwitch(`
	MCase(`CR',`MGoto(`CommPage')')
	MCase(`UPS',`MRet')
	MCase(`UPX',`MExit')
	MCase(`PAGE',`MGoto(`CommHelpPage')')
	',`
	')			#End CommHelpPoll Switch
      MGoto(`CommHelpPoll')
      ')			#End CommHelpPage
    MCase(`-1',`
      MLoadImmed(1)
      MStoreInteger(`MCommState',`MStopBits')
      ')
    MCase(`-2',`
      MLoadImmed(2)
      MStoreInteger(`MCommState',`MStopBits')
      ')
    MCase(`-3',`
      MLoadImmed(3)
      MStoreInteger(`MCommState',`MStopBits')
      ')
    MCase(`-4',`
      MLoadImmed(0)
      MStoreChar(`MCommState',`MPOnOff')
      ')
    MCase(`-5',`
      MLoadImmed(1)
      MStoreChar(`MCommState',`MPOnOff')
      ')
    MCase(`-6',`
      MLoadImmed(2)
      MStoreChar(`MCommState',`MPOnOff')
      ')
    MCase(`-7',`
      MLoadImmed(3)
      MStoreChar(`MCommState',`MPOnOff')
      ')
    MCase(`-8',`
      MLoadImmed(4)
      MStoreChar(`MCommState',`MPOnOff')
      ')
    MCase(`-9',`
      MLoadImmed(1)
      MStoreInteger(`MCommState',`MRxFlagMode')
      ')
    MCase(`-10',`
      MLoadImmed(2)
      MStoreInteger(`MCommState',`MRxFlagMode')
      ')
    MCase(`-11',`
      MLoadImmed(0)
      MStoreInteger(`MCommState',`MRxFlagMode')
      ')
    MCase(`-12',`
      MLoadChar(`MCommCap',`MRStFCp')
      MSubImmed(1)
      MIfLe(`
	MEditString(`MCommState',`MInStSS',`MTmpStL',1)
	',`
	MEditString(`MCommState',`MInStSS',`MTmpStL',FLAGSTRINGDIM)
	')
      MLoadChar(`MCommState',`MTmpStL')
      MStoreInteger(`MCommState',`MRxStopStrLen')
      MGoto(`CommPage')
      ')
    MCase(`-13',`
      MLoadChar(`MCommCap',`MRStFCp')
      MSubImmed(1)
      MIfLe(`
	MEditString(`MCommState',`MInGoSS',`MTmpStL',1)
	',`
	MEditString(`MCommState',`MInGoSS',`MTmpStL',FLAGSTRINGDIM)
	')
      MLoadChar(`MCommState',`MTmpStL')
      MStoreInteger(`MCommState',`MRxGoStrLen')
      MGoto(`CommPage')
      ')
    MCase(`UPS',`MRet')		#to MainPage
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`CommPage')')
    ',`
    MGoto(`CommPoll')
    ')				#End CommPoll Switch
  MLoadChar(`MCommState',`MPOnOff')
  MSubImmed(2)
  MIfGt(`
    MLoadImmed(0)		# Parity forced ON or OFF
    MStoreInteger(`MCommState',`MParity')
    MLoadImmed(7)		# Try 7 data bits if 8 does not work
    MStoreInteger(`MenuMachine',`MReg0')
    MLoadImmed(8)		# Parity forced by Emulator requires 8 data
    ',`
    MAddImmed(2)		# Parity set by comm driver or none
    MStoreInteger(`MCommState',`MParity')
    MLoadImmed(8)		# Try 8 data bits if 7 does not work
    MStoreInteger(`MenuMachine',`MReg0')
    MLoadImmed(7)		# 7 data bits plus none or 1 from driver
    ')
  MCall(`CmDtCk')		# Check existence of desired data bits
  MIfNot(`
    MLoadInteger(`MenuMachine',`MReg0')	# Try secondary desire
    MCall(`CmDtCk')		# Check existence of alternate data bit count
    MIfNot(`MLoadImmed(0)')	# Neither alternative; use 0
    ')
  MStoreInteger(`MCommState',`MDataBits')	# 7, 8 or 0 data bits
  MLoadLogical(`MenuMachine',`MTrue')
  MStoreLogical(`MCommState',`MComChg')
  MGoto(`CommPoll')		#End CommPage
 
End
Block Data EmMDa6
BEGINCOMMON
COMMON(MENUMACHINE)
ENDCOMMON
 
# Main Menu
 
MProg
 MLabel(`MainPage')
  MNewPage			#Home,erase,reset NewCase
  MShowString(`Header1')
  MShowString(`MainB')
  MShowString(`SelectOption')
  MLoadLogical(`MenuMachine',`MMCfOpt')
  MIf(`
    MShowOptLine(1,`Configuration',1)
    ')
  MLoadLogical(`MenuMachine',`MMSKOpt')
  MIf(`
    MShowOptLine(2,`Special Key Definitions',1)
    ')
  MLoadLogical(`MenuMachine',`MM10Opt')
  MIf(`
    MShowOptLine(3,`4010 Options',1)
    ')
  MLoadLogical(`MenuMachine',`MMPgOpt')
  MIf(`
    MShowOptLine(4,`Pagefull Options',1)
    ')
  MLoadLogical(`MenuMachine',`MMChOpt')
  MIf(`
    MShowOptLine(5,`Character Options',1)
    ')
  MLoadLogical(`MenuMachine',`MMDsOpt')
  MIf(`
    MShowOptLine(6,`Display Options',1)
    ')
  MLoadChar(`MCommCap',`MRBdCpL')
  MAddChar(`MCommCap',`MTBdCpL')
  MIfNe(`
    MShowOptLine(7,`Baud Rate',1)
    ')
  MLoadLogical(`MCommCap',`MParCap')
  MOrLogical(`MCommCap',`MTBkTCp')
  MOrLogical(`MCommCap',`MRHwFCp')
  MOrLogical(`MCommCap',`MTHwFCp')
  MIf(`
   MLabel(`OthPresent')
    MShowOptLine(8,`Other Communications Options',1)
    ',`
    MLoadChar(`MCommCap',`MStBCpL')
    MAddChar(`MCommCap',`MRStFCp')
   `#MAddChar(`MCommCap',`MTStFCp') No transmit flagging'
    MIfNe(`MGoto(`OthPresent')')
    ')
  MShowChar(`LF')
  MShowLine(`GSS-ACCESS10 is currently ',0)
  MLoadLogical(`MEmSwitches',`MOnLine')
  MIf(`
    MShowLine(`On Line.',1)
    ',`
    MShowLine(`in Local Mode.',1)
    ')
  MShowChar(`LF')
  MShowString(`ExitHelp')
 MLabel(`MainPoll')
  MSwitch(`
    MCase(`QUESTIONMARK',`
     MLabel(`MainHelpPage')
      MNewPage
      MShowString(`Header1')
      MShowString(`MainHelp')
      MShowString(`TypeRet')
      MShowString(`MainB')
     MLabel(`MainHelpPoll')
      MSwitch(`
        MCase(`CR',`MGoto(`MainPage')')
        MCase(`UPX',`MExit')
        MCase(`PAGE',`MGoto(`MainHelpPage')')
        ',`
        ')
      MGoto(`MainHelpPoll')
      ')
    MCase(-1,`MCall(`CfgPage')')	#Return from Config to Main
    MCase(-2,`MCall(`SpKeyPage')')	#Return from SpKey to Main
    MCase(-3,`MCall(`EmOptPage')')	#Return from EmOpt to Main
    MCase(-4,`MCall(`PfPage')')		#Return from Pagefull to Main
    MCase(-5,`MCall(`ChPage')')		#Return from Char Options to Main
    MCase(-6,`MCall(`DispPage')')	#Return from Disp Options to Main
    MCase(-7,`MCall(`BaudPage')')	#Return from Baud Rates to Main
    MCase(-8,`MCall(`CommPage')')	#Return from Comm Options to Main
    MCase(`UPX',`MExit')
    MCase(`PAGE',`MGoto(`MainPage')')
    ',`
    MGoto(`MainPoll')		#OTHERWISE ignore unknowns
    ')
  MGoto(`MainPage')
 
End
E 1
