Prev: 63935 Up: Map Next: 64334
64168: User Defined Keys
Used by the routine at ChangeControls.
UserDefinedKeys 64168 CALL CreateAdminPageTemplate Call CreateAdminPageTemplate.
64171 CALL GetKeypress Call GetKeypress.
64174 JR NZ,UserDefinedKeys Loop back to UserDefinedKeys until the pressed key is released.
64176 LD HL,64334 Write UserDefinedKeys_Buffer to *UserDefinedKeys_Pointer.
64179 LD (64344),HL
Print "SELECT THE CONTROLS FOR".
64182 LD HL,53461 HL=Messaging_ChangeControls.
64185 LD BC,1027 BC=1027 (screen co-ordinates).
64188 CALL PrintString Call PrintString.
64191 INC HL Move onto the start of the next message.
64192 LD BC,1538 BC=1538 (screen co-ordinates).
64195 CALL PrintString Call PrintString.
Programmatically display all the Messaging_Controls options.
64198 LD HL,53483 HL=Messaging_Controls.
64201 LD BC,2052 BC=2052 (screen co-ordinates).
64204 LD A,5 A=5 (control counter).
UserDefinedKeys_PrintLoop 64206 PUSH AF Stash the control counter and current screen co-ordinates on the stack.
64207 PUSH BC
64208 CALL PrintString Call PrintString.
64211 POP BC Restore the current screen co-ordinates and control counter from the stack.
64212 POP AF
64213 INC HL Move onto the start of the next message.
The options are two lines apart.
64214 INC B Increment B by two.
64215 INC B
64216 DEC A Decrease the control counter by one.
64217 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).
64219 DEC B Decrease B by one.
64220 CALL PrintString Call PrintString.
Set up displaying the "?" indicator to request the user defined keypress.
64223 LD BC,2059 BC=2059 (screen co-ordinates).
UserDefinedKeys_Request 64226 PUSH BC Stash BC on the stack twice.
64227 PUSH BC
64228 LD HL,53508 HL=Messaging_QuestionMark.
64231 CALL PrintString Call PrintString.
Output to the screen buffer.
64234 CALL ScreenBuffer_Update Call ScreenBuffer_Update.
64237 CALL AttributeBuffer_Update Call AttributeBuffer_Update.
UserDefinedKeys_Input 64240 CALL ChooseControlType Call ChooseControlType.
64243 JR NZ,UserDefinedKeys_Input Loop back to UserDefinedKeys_Input until an option has been selected.
64245 LD A,D A=keypress.
64246 CP 255 Jump to UserDefinedKeys_Input if the keypress is invalid.
64248 JR Z,UserDefinedKeys_Input
64250 EX DE,HL Exchange the DE and HL registers.
64251 LD HL,64498 HL=Table_ASCII.
64254 LD B,0 Create an offset using BC.
64256 LD C,A
64257 ADD HL,BC HL+=BC.
64258 LD A,(HL) A=*HL.
64259 CP 128 Jump to UserDefinedKeys_Input if A is higher than 128.
64261 JR NC,UserDefinedKeys_Input
Set a print terminator.
64263 OR %10000000 Set bit 7.
64265 LD (HL),A Write A to *HL.
64266 LD HL,53510 HL=Messaging_Buffer.
Remove the print terminator and write to the buffer.
64269 AND %01111111 Keep only bits 0-6.
64271 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.
64272 CP 33 Jump to UserDefinedKeys_CheckIfCapsShift if A is not equal to 33.
64274 JR NZ,UserDefinedKeys_CheckIfCapsShift
64276 LD HL,53518 HL=Messaging_Enter.
UserDefinedKeys_CheckIfCapsShift 64279 CP 39 Jump to UserDefinedKeys_CheckIfSymbolShift if A is not equal to 39.
64281 JR NZ,UserDefinedKeys_CheckIfSymbolShift
64283 LD HL,53512 HL=Messaging_CapsShift.
UserDefinedKeys_CheckIfSymbolShift 64286 CP 24 Jump to UserDefinedKeys_CheckIfSpace if A is not equal to 24.
64288 JR NZ,UserDefinedKeys_CheckIfSpace
64290 LD HL,53514 HL=Messaging_SymbolShift.
UserDefinedKeys_CheckIfSpace 64293 CP 32 Jump to UserDefinedKeys_PrintKey if A is not equal to 32.
64295 JR NZ,UserDefinedKeys_PrintKey
64297 LD HL,53516 HL=Messaging_Space.
Print the user defined key on the screen in the appropriate location.
UserDefinedKeys_PrintKey 64300 POP BC Restore BC from the stack.
64301 PUSH DE Stash DE on the stack.
64302 CALL PrintString Call PrintString.
64305 POP DE Restore DE from the stack.
Store the keypress port and value in the buffer.
64306 LD HL,(64344) HL=*UserDefinedKeys_Pointer.
64309 LD (HL),E Write E to *HL.
64310 INC HL Increment HL by one.
64311 LD (HL),D Write D to *HL.
64312 INC HL Move onto the next buffer location.
64313 LD (64344),HL Update the stored buffer at *UserDefinedKeys_Pointer.
64316 POP BC Restore BC from the stack.
Move down two lines onto the next option.
64317 INC B Increment B by two.
64318 INC B
Check if we've reached the end?
64319 LD A,B Jump to UserDefinedKeys_Request until B is equal to 18.
64320 CP 18
64322 JR NZ,UserDefinedKeys_Request
Output to the screen buffer.
64324 CALL ScreenBuffer_Update Call ScreenBuffer_Update.
64327 CALL AttributeBuffer_Update Call AttributeBuffer_Update.
64330 CALL ShortPause Call ShortPause.
64333 RET Return.
Prev: 63935 Up: Map Next: 64334