![]() |
Routines |
| Prev: E6B4 | Up: Map | Next: E6F7 |
|
Used by the routine at Process_Cluster_Entity.
Applies a pre-computed velocity nudge (BC) to the Y and X position bytes of the entity record, clamping each to the play area bounds, and redraws the entity via Draw_Narrow_Entity_Sprite. Called as the contact handler from Process_Cluster_Entity when a cluster entity reaches the player.
|
||||
| Apply_Entity_Velocity | E6C4 | EXX | Switch to alternate registers, save the entity position pointer, and load the Y and X position bytes. | |
| E6C5 | LD D,H | |||
| E6C6 | LD E,L | |||
| E6C7 | INC DE | |||
| E6C8 | INC DE | |||
| E6C9 | INC DE | |||
| E6CA | INC DE | |||
| E6CB | LD A,(DE) | |||
| E6CC | ADD A,(HL) | |||
| E6CD | CP $10 | Test and apply the Y nudge; clamp Y to 10-B3 and write back. | ||
| E6CF | JP C,Apply_Entity_Velocity_X | |||
| E6D2 | CP $B3 | |||
| E6D4 | JP NC,Apply_Entity_Velocity_X | |||
| E6D7 | LD (HL),A | |||
| Apply_Entity_Velocity_X | E6D8 | INC HL | Test and apply the X nudge; clamp X to 08-F3 and write back. | |
| E6D9 | INC DE | |||
| E6DA | LD A,(DE) | |||
| E6DB | ADD A,(HL) | |||
| E6DC | CP $08 | |||
| E6DE | JP C,Apply_Entity_Velocity_Draw | |||
| E6E1 | CP $F3 | |||
| E6E3 | JP NC,Apply_Entity_Velocity_Draw | |||
| E6E6 | LD (HL),A | |||
| Apply_Entity_Velocity_Draw | E6E7 | DEC HL | Step back two bytes, set colour INK: WHITE, PAPER: BLACK (BRIGHT) in B', and draw the entity via Draw_Narrow_Entity_Sprite. | |
| E6E8 | DEC HL | |||
| E6E9 | PUSH DE | |||
| E6EA | EXX | |||
| E6EB | LD B,$47 | |||
| E6ED | EXX | |||
| E6EE | CALL Draw_Narrow_Entity_Sprite | Restore DE, copy to HL, advance two bytes, and return. | ||
| E6F1 | POP DE | |||
| E6F2 | LD H,D | |||
| E6F3 | LD L,E | |||
| E6F4 | INC HL | |||
| E6F5 | INC HL | |||
| E6F6 | RET | |||
| Prev: E6B4 | Up: Map | Next: E6F7 |