![]() |
Routines |
| Prev: 63174 | Up: Map | Next: 63402 |
|
Used by the routine at JumpTable_MoveEntity.
Moves an entity and erases the vacated cells.
|
||||
| Move_Entity | 63201 | XOR A | Write 0 to *25661. | |
| 63202 | LD (25661),A | |||
| 63205 | LD A,C | Jump to Move_Entity_Skip if the column matches *IX+10. | ||
| 63206 | SUB (IX+10) | |||
| 63209 | JR Z,Move_Entity_Skip | |||
| 63211 | CP 128 | Call Move_Entity_Target when the column moved left. | ||
| 63213 | PUSH AF | |||
| 63214 | CALL NC,Move_Entity_Target | |||
| 63217 | POP AF | |||
| 63218 | CALL C,Move_Entity_Target2 | Call Move_Entity_Target2 when the column moved right and jump to Move_Entity_Skip2. | ||
| 63221 | JR Move_Entity_Skip2 | |||
| Move_Entity_Skip | 63223 | LD A,E | Jump to Move_Entity_Skip2 if the fine-X matches *IX+12. | |
| 63224 | CP (IX+12) | |||
| 63227 | JR Z,Move_Entity_Skip2 | |||
| 63229 | CP 7 | Call Move_Entity_Target2 when the fine-X wrapped to 7. | ||
| 63231 | CALL Z,Move_Entity_Target2 | |||
| Move_Entity_Skip2 | 63234 | LD A,B | Jump to Move_Entity_Skip3 if the row matches *IX+11. | |
| 63235 | SUB (IX+11) | |||
| 63238 | JR Z,Move_Entity_Skip3 | |||
| 63240 | CP 128 | Call Move_Entity_Target3 when the row moved up. | ||
| 63242 | PUSH AF | |||
| 63243 | CALL NC,Move_Entity_Target3 | |||
| 63246 | POP AF | |||
| 63247 | JR C,Move_Entity_Branch | Jump to Move_Entity_Branch if the row moved down, else return. | ||
| 63249 | RET | |||
| Move_Entity_Skip3 | 63250 | LD A,D | Return if the fine-Y matches *IX+13. | |
| 63251 | CP (IX+13) | |||
| 63254 | RET Z | |||
| 63255 | CP 7 | Jump to Move_Entity_Branch when the fine-Y wrapped to 7 else return. | ||
| 63257 | JR Z,Move_Entity_Branch | |||
| 63259 | RET | |||
|
Erase the left-hand column that has just been vacated.
|
||||
| Move_Entity_Target | 63260 | PUSH BC | Stash the new position and size. | |
| 63261 | PUSH DE | |||
| 63262 | LD A,255 | Write 255 to *25661. | ||
| 63264 | LD (25661),A | |||
| 63267 | LD C,(IX+10) | Fill a one-column strip at the old column and row. | ||
| 63270 | LD B,(IX+11) | |||
| 63273 | LD D,(IX+5) | |||
| 63276 | LD E,1 | |||
| 63278 | LD A,(IX+13) | Increase the height when the old fine-Y is not 7. | ||
| 63281 | CP 7 | |||
| 63283 | JR Z,Move_Entity_Skip4 | |||
| 63285 | INC D | |||
| Move_Entity_Skip4 | 63286 | CALL Fill_Tiles | Call Fill_Tiles. | |
| 63289 | POP DE | Restore the registers from the stack. | ||
| 63290 | POP BC | |||
| 63291 | RET | Return. | ||
|
Erase the right-hand column that has just been vacated.
|
||||
| Move_Entity_Target2 | 63292 | LD A,1 | Write 1 to *25661. | |
| 63294 | LD (25661),A | |||
| 63297 | PUSH BC | Stash the new position and size. | ||
| 63298 | PUSH DE | |||
| 63299 | LD A,(IX+10) | Fill a one-column strip at the old right-hand edge. | ||
| 63302 | LD C,(IX+4) | |||
| 63305 | SUB C | |||
| 63306 | LD C,A | |||
| 63307 | LD B,(IX+11) | |||
| 63310 | LD D,(IX+5) | |||
| 63313 | LD E,1 | |||
| 63315 | LD A,(IX+13) | Increase the height when the old fine-Y is not 7. | ||
| 63318 | CP 7 | |||
| 63320 | JR Z,Move_Entity_Skip5 | |||
| 63322 | INC D | |||
| Move_Entity_Skip5 | 63323 | CALL Fill_Tiles | Call Fill_Tiles. | |
| 63326 | POP DE | Restore the registers from the stack. | ||
| 63327 | POP BC | |||
| 63328 | RET | Return. | ||
|
Erase the bottom row that has just been vacated.
|
||||
| Move_Entity_Branch | 63329 | PUSH BC | Stash the new position and size. | |
| 63330 | PUSH DE | |||
| 63331 | LD A,(IX+11) | Fill a one-row strip at the old bottom edge. | ||
| 63334 | LD D,(IX+5) | |||
| 63337 | SUB D | |||
| 63338 | LD B,A | |||
| 63339 | LD E,(IX+4) | |||
| 63342 | LD C,(IX+10) | |||
| 63345 | LD D,1 | |||
| 63347 | LD A,(IX+2) | Increase the width when the fine-X is not 7. | ||
| 63350 | CP 7 | |||
| 63352 | JR Z,Move_Entity_Skip6 | |||
| 63354 | INC E | |||
| Move_Entity_Skip6 | 63355 | LD A,(25661) | Increase the width again when *25661 is set. | |
| 63358 | OR A | |||
| 63359 | JR Z,Move_Entity_Skip7 | |||
| 63361 | INC E | |||
| Move_Entity_Skip7 | 63362 | CALL Fill_Tiles | Call Fill_Tiles. | |
| 63365 | POP DE | Restore the registers from the stack. | ||
| 63366 | POP BC | |||
| 63367 | RET | Return. | ||
|
Erase the top row that has just been vacated.
|
||||
| Move_Entity_Target3 | 63368 | PUSH BC | Stash the new position and size. | |
| 63369 | PUSH DE | |||
| 63370 | LD C,(IX+10) | Fill a one-row strip at the old column and row. | ||
| 63373 | LD B,(IX+11) | |||
| 63376 | LD D,1 | |||
| 63378 | LD E,(IX+4) | |||
| 63381 | LD A,(IX+12) | Increase the width when the old fine-X is not 7. | ||
| 63384 | CP 7 | |||
| 63386 | JR Z,Move_Entity_Skip8 | |||
| 63388 | INC E | |||
| Move_Entity_Skip8 | 63389 | LD A,(25661) | Increase the width again when *25661 is set. | |
| 63392 | OR A | |||
| 63393 | JR Z,Move_Entity_Skip9 | |||
| 63395 | INC E | |||
| Move_Entity_Skip9 | 63396 | CALL Fill_Tiles | Call Fill_Tiles. | |
| 63399 | POP DE | Restore the registers from the stack. | ||
| 63400 | POP BC | |||
| 63401 | RET | Return. | ||
| Prev: 63174 | Up: Map | Next: 63402 |