Prev: BD38 Up: Map Next: BD6B
BD58: Test Pickup Drop Key
Used by the routine at HandlePickupAndDrop.
Tests whether the control for picking up or dropping an object is pressed. If a joystick is used with directional control then the other of the two bits for this is used.
Output
F Zero flag set if the control is not pressed
Use the directional bit when a joystick has directional control.
TestPickupDropKey BD58 LD HL,$5B04 Point HL at ControlMethod.
BD5B LD A,(HL) Fetch it.
BD5C AND %00000110 Keep only bits 1 and 2.
BD5E LD A,($5B15) Fetch ControlsPressed.
BD61 JR Z,TestPickupDropKey_Test Jump to TestPickupDropKey_Test if the keyboard is in use.
BD63 BIT 3,(HL) Jump to TestPickupDropKey_Test if directional control is off.
BD65 JR Z,TestPickupDropKey_Test
BD67 RRCA Move the bit for directional control into place.
TestPickupDropKey_Test BD68 AND %00010000 Keep only bit 4.
BD6A RET Return.
View the equivalent code in;
Prev: BD38 Up: Map Next: BD6B