Prev: 55760 Up: Map Next: 55814
55768: Select Magic Knight's room and USS Pisces' current location (cheat / debug routine)
Used by the routine at 27136.
Input
A Keyboard / joystick input
55768 LD (55776),A Store keyboard / joystick input at 55776
55771 LD A,(23728) Set zero flag if cheat-mode-enabled flag is reset (see trivia)...
55774 OR A ...
The operand of the instruction at 55775 represents the most recent keyboard / joystick input. This is modified by the instruction at 55768.
55775 LD A,0 Restore keyboard / joystick input to A
55777 RET Z Return if zero flag was set
55778 POP HL Remove return address from top of stack
55779 CALL 35790 Set parameters (for cheat routine sound) and play
This entry point is used by the routine at 55814.
55782 LD A,2 Set BORDER to red...
55784 OUT (254),A ...
55786 CALL 54942 Capture keyboard or joystick input loading result into A
55789 BIT 0,A If left pressed...
55791 JR NZ,55819 ...then jump to 55819 (decrease Magic Knight's current room index, wrapping around to 24 if below zero)
55793 BIT 1,A If right pressed...
55795 JR NZ,55836 ...then jump to 55836 (increase Magic Knight's current room index, wrapping around to zero if above 24)
55797 BIT 2,A If up pressed...
55799 JP NZ,55869 ...then jump to 55869 (increase USS Pisces' current location index, wrapping around to 1 if above 24)
55802 BIT 3,A If down pressed...
55804 JP NZ,55853 ...then jump to 55853 (decrease USS Pisces' current location index, wrapping around to 24 if below 1)
55807 BIT 4,A If fire pressed...
55809 JP NZ,55887 ...then jump to 55887 (exit cheat / debug mode)
55812 JR 55782 Loop back to 55782
Prev: 55760 Up: Map Next: 55814