| Chase H.Q. | Routines |
| Prev: B318 | Up: Map | Next: B4CC |
|
Three cases, chosen by hand_flag. Zero returns at once and draws nothing. Any other value bar one draws the static hand, frame 36 or 37, through draw_crash. One is the animating case: a two speed delay counter steps through seven animation frames, the cherry light is switched on at the final frame, and one or two hand sprites are drawn per tick through draw_crash_unflipped.
Used by the routine at animate_hero_car.
|
||||
| ahc_check_hand_flag | B457 | LD A,($A22F) | Return if hand_flag is zero | |
| B45A | AND A | |||
| B45B | RET Z | |||
|
Start the hand animation.
|
||||
| ahc_hand_flag_non_zero | B45C | DEC A | Jump if hand_flag is one | |
| B45D | JR Z,ahc_hand_flag_one | |||
|
Show the "stop" hand.
|
||||
| ahc_hand_flag_gt_one | B45F | EXX | Bank | |
| B460 | LD B,A | BC' = A | ||
| B461 | LD C,$00 | |||
| B463 | EXX | Unbank | ||
|
Avoid the hand animation if turning hard?
|
||||
| B464 | LD A,($A250) | Is turn_speed 2? (turn hard) | ||
| B467 | CP $02 | |||
| B469 | LD A,$24 | A = 36 | ||
| B46B | JP NZ,draw_crash | Exit via draw_crash if turn_speed != 2 | ||
|
Otherwise turn_speed is 2 (turn hard).
|
||||
| B46E | LD A,($A251) | A = flip_car + 37 | ||
| B471 | ADD A,$25 | |||
| B473 | JP draw_crash | Exit via draw_crash | ||
|
Start the animation.
|
||||
| ahc_hand_flag_one | B476 | LD C,$00 | C = <self modified> zeroed in start_chase | |
| B478 | LD A,$00 | A = <self modified> -- a frame delay counter for the hand animation, gets set to 2 | ||
| B47A | DEC A | Decrement counter | ||
| B47B | LD ($B479),A | Self modify 'LD A' @ B478 (above) to load A | ||
| B47E | JR NZ,ahc_b493 | Jump to ahc_b493 if A != 0 | ||
|
A was zero.
|
||||
| B480 | LD B,$02 | B = 2 | ||
| B482 | INC C | Increment C | ||
| B483 | LD A,C | A = C | ||
| B484 | CP $04 | Jump if >= 4 | ||
| B486 | JR NC,ahc_b48f | |||
| B488 | INC A | Increment A | ||
| B489 | LD C,A | C = A | ||
| B48A | CP $02 | Jump if != 2 | ||
| B48C | JR NZ,ahc_b48f | |||
| B48E | INC B | Increment B | ||
| ahc_b48f | B48F | LD A,B | Self modify 'LD A' @ B478 (above) to load B | |
| B490 | LD ($B479),A | |||
| ahc_b493 | B493 | LD A,C | Self modify 'LD C' @ ahc_hand_flag_one (above) to load C | |
| B494 | LD ($B477),A | |||
| B497 | CP $07 | Jump if < 7 | ||
| B499 | JR C,ahc_b4a0 | |||
|
Hide the "stop" hand.
|
||||
| B49B | XOR A | hand_flag = 0 | ||
| B49C | LD ($A22F),A | |||
| B49F | RET | Return | ||
| ahc_b4a0 | B4A0 | LD A,($A250) | Load turn_speed | |
| B4A3 | CP $02 | Turning hard? | ||
| B4A5 | LD A,$06 | Jump if not turning hard with A = 6 | ||
| B4A7 | JR NZ,ahc_b4b3 | |||
| B4A9 | LD A,($A251) | A = (flip_car * 7) + 13 | ||
| B4AC | LD B,A | |||
| B4AD | RLCA | |||
| B4AE | RLCA | |||
| B4AF | RLCA | |||
| B4B0 | SUB B | |||
| B4B1 | ADD A,$0D | |||
| ahc_b4b3 | B4B3 | ADD A,C | A += C -- C is as $B493 | |
| B4B4 | PUSH AF | Preserve A | ||
| B4B5 | CALL draw_crash_unflipped | Call draw_crash_unflipped | ||
| B4B8 | POP AF | Restore A | ||
| B4B9 | LD C,A | C = A | ||
| B4BA | LD A,($B477) | Read from 'LD C' @ ahc_hand_flag_one (above) to load A | ||
| B4BD | CP $04 | Jump to ahc_enable_cherry_light if A >= 4 | ||
| B4BF | JR NC,ahc_enable_cherry_light | |||
|
A < 4
|
||||
| B4C1 | INC C | C++ | ||
| B4C2 | LD A,C | A = C | ||
| B4C3 | JP draw_crash_unflipped | Exit via draw_crash_unflipped | ||
| ahc_enable_cherry_light | B4C6 | LD A,$01 | Enable the cherry_light | |
| B4C8 | LD ($A228),A | |||
| B4CB | RET | Return | ||
| Prev: B318 | Up: Map | Next: B4CC |