Prev: 27471 Up: Map Next: 27661
27545: Print Instructions Menu
instructions
Print_InstructionsMenu 27545 CALL ClearScreen Call ClearScreen.
27548 LD A,(26358) Jump to Input_SelectLevel if *ControlMethod is a joystick method.
27551 OR A
27552 JR NZ,Input_SelectLevel
The player has selected to use the keyboard, so remind them what the keys are.
Print "Instructions".
27554 LD HL,25718 Call Configurable_PrintString using Messaging_Instructions; printing 12 characters in YELLOW.
27557 LD DE,16553
27560 LD BC,3078
27563 CALL Configurable_PrintString
Print "Left".
27566 LD DE,18439 Call Configurable_PrintString using Messaging_Left; printing 20 characters in INK:MAGENTA, PAPER:BLACK(BRIGHT).
27569 LD BC,5187
27572 CALL Configurable_PrintString
Print "Right".
27575 LD E,71 Call Configurable_PrintString using Messaging_Right; printing 11 characters.
27577 LD B,11
27579 CALL Configurable_PrintString
Print "Fire".
27582 LD E,135 Call Configurable_PrintString using Messaging_Fire; printing 15 characters.
27584 LD B,15
27586 CALL Configurable_PrintString
Print "Barrier".
27589 LD E,199 Call Configurable_PrintString using Messaging_Barrier; printing 15 characters.
27591 LD B,15
27593 CALL Configurable_PrintString
Print "Select Level".
Input_SelectLevel 27596 LD HL,25791 Call Configurable_PrintString using Messaging_Level; printing 18 characters in WHITE.
27599 LD DE,20615
27602 LD BC,4615
27605 CALL Configurable_PrintString
Read keyboard input to select level 1-5.
Input_SelectLevel_Loop 27608 DI Disable interrupts.
27609 LD A,247 Read from the keyboard;
Port Number Bit
0 1 2 3 4
247 1 2 3 4 5
27611 IN A,(254)
27613 XOR %11111111 Flip the bits.
27615 AND %00011111 Keep only bits 0-4 (the key states).
27617 JR Z,Input_SelectLevel_Loop Jump to Input_SelectLevel_Loop if no keys were pressed.
27619 LD C,49 Start a count in C starting at 49 (ASCII "1").
27621 BIT 0,A Jump to Input_SelectLevel_Store if bit 0 of A was set (key "1" pressed).
27623 JR NZ,Input_SelectLevel_Store
27625 INC C Increment C by one (ASCII "2").
27626 BIT 1,A Jump to Input_SelectLevel_Store if bit 1 of A was set (key "2" pressed).
27628 JR NZ,Input_SelectLevel_Store
27630 INC C Increment C by one (ASCII "3").
27631 BIT 2,A Jump to Input_SelectLevel_Store if bit 2 of A was set (key "3" pressed).
27633 JR NZ,Input_SelectLevel_Store
27635 INC C Increment C by one (ASCII "4").
27636 BIT 3,A Jump to Input_SelectLevel_Store if bit 3 of A was set (key "4" pressed).
27638 JR NZ,Input_SelectLevel_Store
27640 INC C Increment C by one (ASCII "5").
27641 BIT 4,A Jump to Input_SelectLevel_Loop if bit 4 of A was set (key "5" pressed).
27643 JR Z,Input_SelectLevel_Loop
Input_SelectLevel_Store 27645 LD HL,25895 Write C to *Messaging_Header_LevelNumber.
27648 LD (HL),C
27649 LD A,C Convert the ASCII digit to a numeric value by, subtracting 48 multiply by 2 and subtracting the result from 10 e.g.
ASCII Byte Result
"1" 49 8
"2" 50 6
"3" 51 4
"4" 52 2
"5" 53 0
Write the result to *26776.
27650 SUB 48
27652 ADD A,A
27653 LD C,A
27654 LD A,10
27656 SUB C
27657 LD (26776),A
27660 RET Return.
Prev: 27471 Up: Map Next: 27661