Prev: 58144 Up: Map Next: 58262
58194: Routine at E352
Used by the routines at 62037, 62366 and 62526.
58194 LD A,R Set the low byte in L to the contents of the Memory Refresh Register.
58196 LD L,A
58197 LD H,200 Set the high byte in H to 200.
58199 LD B,50 Set a loop counter in B to 50.
58201 LD D,5 Set a delay counter in D of 5.
58203 LD A,(HL) A=*HL.
58204 AND %00011000 Keep only bits 3-4.
58206 OR %00000101 Set bits 0, 2.
58208 OUT (254),A Set border to the colour held by A.
58210 INC HL Increment HL by one.
58211 PUSH BC Stash the loop counter on the stack.
58212 LD B,D Set the delay loop counter.
Delay_Loop_01 58213 DJNZ Delay_Loop_01 Decrease the delay counter by one and loop back to Delay_Loop_01 until the delay counter is zero.
58215 POP BC Restore the loop counter from the stack.
58216 DJNZ 58203 Decrease the loop counter by one and loop back to 58203 until the loop counter is zero.
58218 HALT Halt operation (suspend CPU until the next interrupt) twice.
58219 HALT
58220 CALL Handler_PlayerInput Call Handler_PlayerInput.
58223 CP 1 Return if the player has pressed any direction key.
58225 RET Z
58226 CP 2
58228 RET Z
58229 CP 4
58231 RET Z
58232 CP 8
58234 RET Z
58235 HALT Halt operation (suspend CPU until the next interrupt) twice.
58236 HALT
58237 LD A,R Set the low byte in L to the contents of the Memory Refresh Register.
58239 LD L,A
58240 LD H,10 Set the high byte in H to 10.
58242 LD B,35 Set a loop counter in B to 35.
58244 LD C,100 Set a delay counter in C this time of 100.
58246 LD A,(HL) A=*HL.
58247 AND %00011000 Keep only bits 3-4.
58249 OR %00000101 Set bits 0, 2.
58251 OUT (254),A Set border to the colour held by A.
58253 INC HL Increment HL by one.
58254 PUSH BC Stash the loop counter on the stack.
58255 LD B,C Set the delay loop counter.
Delay_Loop_02 58256 DJNZ Delay_Loop_02 Decrease the delay counter by one and loop back to Delay_Loop_02 until the delay counter is zero.
58258 POP BC Restore the loop counter from the stack.
58259 DJNZ 58246 Decrease the loop counter by one and loop back to 58246 until the loop counter is zero.
58261 RET Return.
Prev: 58144 Up: Map Next: 58262