Prev: 34254 Up: Map Next: 34304
34279: Handler: Controls
Output
E The control code
Byte Bits Meaning
0 00000000 Right
8 00001000 Down
16 00010000 Left
24 00011000 Up
32 00100000 Fire
40 00101000 No input
Handler_Controls 34279 LD E,0 E=0.
34281 LD HL,61408 HL=ActiveKeyMap.
Handler_Controls_Loop 34284 LD C,(HL) Load the port into C.
34285 INC HL Increment HL by one.
34286 LD B,(HL) B=*HL.
34287 INC HL Increment HL by one.
34288 LD D,(HL) D=*HL.
34289 INC HL Increment HL by one.
34290 IN A,(C) A=byte from port held by *C.
Self-modifying code. See; SetNoOperation, SetActiveKeyMap and SetKempstonJoystick.
HandleControlBits 34292 NOP Will be either "no operation" or "invert the bits".
34293 AND D Merge the bits from D.
34294 RET Z Return if the result is zero.
34295 LD A,8 E+=8.
34297 ADD A,E
34298 LD E,A
34299 CP 40 Return if there was no input.
34301 RET Z
34302 JR Handler_Controls_Loop Jump to Handler_Controls_Loop.
Prev: 34254 Up: Map Next: 34304