Prev: F9BF Up: Map Next: FB4E
FAA8: User Defined Keys
Used by the routine at ChangeControls.
UserDefinedKeys FAA8 CALL CreateAdminPageTemplate Call CreateAdminPageTemplate.
FAAB CALL GetKeypress Call GetKeypress.
FAAE JR NZ,UserDefinedKeys Loop back to UserDefinedKeys until the pressed key is released.
FAB0 LD HL,$FB4E Write UserDefinedKeys_Buffer to *UserDefinedKeys_Pointer.
FAB3 LD ($FB58),HL
FAB6 LD HL,$D0D5 HL=Messaging_ChangeControls.
FAB9 LD BC,$0403 BC=0403 (screen co-ordinates).
FABC CALL PrintString Call PrintString.
FABF INC HL Move onto the start of the next message.
FAC0 LD BC,$0602 BC=0602 (screen co-ordinates).
FAC3 CALL PrintString Call PrintString.
Programmatically display all the Messaging_Controls options.
FAC6 LD HL,$D0EB HL=Messaging_Controls.
FAC9 LD BC,$0804 BC=0804 (screen co-ordinates).
FACC LD A,$05 A=05 (control counter).
UserDefinedKeys_PrintLoop FACE PUSH AF Stash the control counter and current screen co-ordinates on the stack.
FAD0 CALL PrintString Call PrintString.
FAD3 POP BC Restore the current screen co-ordinates and control counter from the stack.
FAD5 INC HL Move onto the start of the next message.
The options are two lines apart.
FAD6 INC B Increment B by two.
FAD8 DEC A Decrease the control counter by one.
FAD9 JR NZ,UserDefinedKeys_PrintLoop Jump to UserDefinedKeys_PrintLoop until all controls have been printed.
Prints the last line manually "PUNCH" (as it's the second line of the option before it).
FADB DEC B Decrease B by one.
FADC CALL PrintString Call PrintString.
Set up displaying the "?" indicator to request the user defined keypress.
FADF LD BC,$080B BC=080B (screen co-ordinates).
UserDefinedKeys_Request FAE2 PUSH BC Stash BC on the stack twice.
FAE4 LD HL,$D104 HL=Messaging_QuestionMark.
FAE7 CALL PrintString Call PrintString.
Output to the screen buffer.
FAEA CALL ScreenBuffer_Update Call ScreenBuffer_Update.
FAED CALL AttributeBuffer_Update Call AttributeBuffer_Update.
UserDefinedKeys_Input FAF0 CALL ChooseControlType Call ChooseControlType.
FAF3 JR NZ,UserDefinedKeys_Input Loop back to UserDefinedKeys_Input until an option has been selected.
FAF5 LD A,D A=keypress.
FAF6 CP $FF Jump to UserDefinedKeys_Input if the keypress is invalid.
FAF8 JR Z,UserDefinedKeys_Input
FAFA EX DE,HL Exchange the DE and HL registers.
FAFE LD B,$00 Create an offset using BC.
FB02 LD A,(HL) A=*HL.
FB03 CP $80 Jump to UserDefinedKeys_Input if A is higher than 80.
FB05 JR NC,UserDefinedKeys_Input
Set a print terminator.
FB07 OR %10000000 Set bit 7.
FB09 LD (HL),A Write A to *HL.
FB0A LD HL,$D106 HL=Messaging_Buffer.
Remove the print terminator and write to the buffer.
FB0D AND %01111111 Keep only bits 0-6.
FB0F LD (HL),A Write A to *HL.
If "special keys" (e.g. Caps Shift/ Symbol Shift/ Enter/ Space) are selected, provide a means to show that these have been selected.
FB10 CP $21 Jump to UserDefinedKeys_CheckIfCapsShift if A is not equal to 21.
FB12 JR NZ,UserDefinedKeys_CheckIfCapsShift
FB14 LD HL,$D10E HL=Messaging_Enter.
UserDefinedKeys_CheckIfCapsShift FB17 CP $27 Jump to UserDefinedKeys_CheckIfSymbolShift if A is not equal to 27.
FB19 JR NZ,UserDefinedKeys_CheckIfSymbolShift
FB1B LD HL,$D108 HL=Messaging_CapsShift.
UserDefinedKeys_CheckIfSymbolShift FB1E CP $18 Jump to UserDefinedKeys_CheckIfSpace if A is not equal to 18.
FB20 JR NZ,UserDefinedKeys_CheckIfSpace
FB22 LD HL,$D10A HL=Messaging_SymbolShift.
UserDefinedKeys_CheckIfSpace FB25 CP $20 Jump to UserDefinedKeys_PrintKey if A is not equal to 20.
FB27 JR NZ,UserDefinedKeys_PrintKey
FB29 LD HL,$D10C HL=Messaging_Space.
Print the user defined key on the screen in the appropriate location.
UserDefinedKeys_PrintKey FB2C POP BC Restore BC from the stack.
FB2D PUSH DE Stash DE on the stack.
FB2E CALL PrintString Call PrintString.
FB31 POP DE Restore DE from the stack.
Store the keypress port and value in the buffer.
FB32 LD HL,($FB58) HL=*UserDefinedKeys_Pointer.
FB35 LD (HL),E Write E to *HL.
FB36 INC HL Increment HL by one.
FB37 LD (HL),D Write D to *HL.
FB38 INC HL Move onto the next buffer location.
FB39 LD ($FB58),HL Update the stored buffer at *UserDefinedKeys_Pointer.
FB3C POP BC Restore BC from the stack.
Move down two lines onto the next option.
FB3D INC B Increment B by two.
Check if we've reached the end?
FB3F LD A,B Jump to UserDefinedKeys_Request until B is equal to 12.
FB40 CP $12
FB42 JR NZ,UserDefinedKeys_Request
Output to the screen buffer.
FB44 CALL ScreenBuffer_Update Call ScreenBuffer_Update.
FB47 CALL AttributeBuffer_Update Call AttributeBuffer_Update.
FB4A CALL ShortPause Call ShortPause.
FB4D RET Return.
Prev: F9BF Up: Map Next: FB4E