![]() |
Routines |
| Prev: 45277 | Up: Map | Next: 45320 |
|
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.
|
||||||||
|
Build a direction index from the facing bits.
|
||||||||
| SetMouseSpeed | 45287 | LD A,(IX+7) | Fetch the flags. | |||||
| 45290 | RLCA | Move bit 6 to bit 1. | ||||||
| 45291 | RLCA | |||||||
| 45292 | RLCA | |||||||
| 45293 | AND %00000010 | Keep bit 1. | ||||||
| 45295 | LD B,A | Keep it in B. | ||||||
| 45296 | LD A,(IX+0) | Fetch the sprite number. | ||||||
| 45299 | AND %00000001 | Keep bit 0. | ||||||
| 45301 | OR B | Combine it with the flip flag. | ||||||
| 45302 | SLA A | Double it. | ||||||
| 45304 | LD HL,45320 | Point HL at MouseSpeeds. | ||||||
| 45307 | CALL AddAToHL | Call AddAToHL. | ||||||
| 45310 | LD A,(HL) | Fetch the speed along the x axis. | ||||||
| 45311 | INC HL | |||||||
| 45312 | LD (IX+9),A | Set the speed along the x axis. | ||||||
| 45315 | LD A,(HL) | Fetch the speed along the y axis. | ||||||
| 45316 | LD (IX+10),A | Set the speed along the y axis. | ||||||
| 45319 | RET | Return. | ||||||
| Prev: 45277 | Up: Map | Next: 45320 |