| Ant Attack | Routines |
| Prev: 8448 | Up: Map | Next: 8497 |
|
Used by the routine at DRAW_VIEW.
Reads where the player was placed this frame (the last entry of SPRITE_LIST) and, if that is outside a central window of the view, steps VIEW_ORIGIN a cell in the direction the player is facing -- unless the player is jumping or falling. It takes effect next frame, since the view has already been gathered.
|
||||
| SCROLL_VIEW | 8460 | LD DE,(PLAYER_SPRITE) | Off the view altogether: leave it. | |
| 8464 | LD A,D | |||
| 8465 | INC A | |||
| 8466 | RET Z | |||
| 8467 | DEC DE | Undo the +1 PROJECT_SPRITES adds. | ||
| 8468 | LD A,E | Across: inside if the column is 4-11 of 16... | ||
| 8469 | SUB $04 | |||
| 846B | AND $0F | |||
| 846D | CP $08 | |||
| 846F | JR NC,SCROLL_VIEW_0 | |||
| 8471 | LD A,E | ...and down: inside if the row is 8-23 of 32. | ||
| 8472 | RR D | |||
| 8474 | RRA | |||
| 8475 | RRA | |||
| 8476 | RRA | |||
| 8477 | RRA | |||
| 8478 | SUB $08 | |||
| 847A | AND $1F | |||
| 847C | CP $10 | |||
| 847E | RET C | |||
| SCROLL_VIEW_0 | 847F | LD HL,(VIEW_ORIGIN) | Outside: move the view. | |
| 8482 | LD A,(PLAYER_FLAGS) | Not while jumping or falling. | ||
| 8485 | BIT 1,A | |||
| 8487 | RET NZ | |||
| 8488 | LD A,(PLAYER_FALL) | |||
| 848B | AND A | |||
| 848C | RET NZ | |||
| 848D | LD A,(PLAYER_FACING) | A cell the way the player faces. | ||
| 8490 | CALL STEP | |||
| 8493 | LD (VIEW_ORIGIN),HL | |||
| 8496 | RET | |||
| Prev: 8448 | Up: Map | Next: 8497 |