Prev: B0DD Up: Map Next: B108
B0E7: Set Mouse Speed
Used by the routines at HandleCircuitMouse and HandleBouncingMouse.
Sets the speed of a robot mouse along the x and y axes from the way it faces, using the table at MouseSpeeds.
Input
IX The address of the object
Build a direction index from the facing bits.
SetMouseSpeed B0E7 LD A,(IX+$07) Fetch the flags.
B0EA RLCA Move bit 6 to bit 1.
B0EB RLCA
B0EC RLCA
B0ED AND %00000010 Keep bit 1.
B0EF LD B,A Keep it in B.
B0F0 LD A,(IX+$00) Fetch the sprite number.
B0F3 AND %00000001 Keep bit 0.
B0F5 OR B Combine it with the flip flag.
B0F6 SLA A Double it.
B0F8 LD HL,$B108 Point HL at MouseSpeeds.
B0FB CALL AddAToHL Call AddAToHL.
B0FE LD A,(HL) Fetch the speed along the x axis.
B0FF INC HL
B100 LD (IX+$09),A Set the speed along the x axis.
B103 LD A,(HL) Fetch the speed along the y axis.
B104 LD (IX+$0A),A Set the speed along the y axis.
B107 RET Return.
Prev: B0DD Up: Map Next: B108