Prev: 85CE Up: Map Next: 8600
85E7: Handler: Controls
Output
E The control code
Byte Bits Meaning
00 00000000 Right
08 00001000 Down
10 00010000 Left
18 00011000 Up
20 00100000 Fire
28 00101000 No input
Handler_Controls 85E7 LD E,$00 E=00.
85E9 LD HL,$EFE0 HL=ActiveKeyMap.
Handler_Controls_Loop 85EC LD C,(HL) Load the port into C.
85ED INC HL Increment HL by one.
85EE LD B,(HL) B=*HL.
85EF INC HL Increment HL by one.
85F0 LD D,(HL) D=*HL.
85F1 INC HL Increment HL by one.
85F2 IN A,(C) A=byte from port held by *C.
Self-modifying code. See; SetNoOperation, SetActiveKeyMap and SetKempstonJoystick.
HandleControlBits 85F4 NOP Will be either "no operation" or "invert the bits".
85F5 AND D Merge the bits from D.
85F6 RET Z Return if the result is zero.
85F7 LD A,$08 E+=08.
85F9 ADD A,E
85FA LD E,A
85FB CP $28 Return if there was no input.
85FD RET Z
85FE JR Handler_Controls_Loop Jump to Handler_Controls_Loop.
Prev: 85CE Up: Map Next: 8600