| Chase H.Q. | Routines |
| Prev: B4CC | Up: Map | Next: B549 |
|
Called each time the hero car rams the perp. It steps the debris sub-table selector on one place of four, resets the debris frame counter to 9 and increments smash_counter. Twenty hits finish the perp off via fully_smashed; nineteen brings on Raymond's "ONE MORE TIME". smash_level, which drives the smash-o-meter, is then derived from smash_counter by a ladder of thresholds at 1, 4, 7, 11, 14 and 17 hits.
There is no direct caller: spawn_cars pushes this address onto the stack as the perp's collision handler.
|
||||
| smash | B4F0 | LD A,$00 | Cycle A one step through 0..3 each time the routine is entered | |
| B4F2 | INC A | |||
| B4F3 | AND $03 | |||
| B4F5 | LD ($B4F1),A | |||
|
Setup debris_table entry in draw_debris
|
||||
| B4F8 | RLCA | *$B55C = debris_table + A * 6 | ||
| B4F9 | LD C,A | |||
| B4FA | RLCA | |||
| B4FB | ADD A,C | |||
| B4FC | LD C,A | |||
| B4FD | LD HL,$CE33 | |||
| B500 | LD B,$00 | |||
| B502 | ADD HL,BC | |||
| B503 | LD ($B55C),HL | |||
| B506 | LD A,$09 | $B54A = 9 -- set counter in draw_debris | ||
| B508 | LD ($B54A),A | |||
| B50B | LD A,($A233) | Load and increment smash_counter | ||
| B50E | INC A | |||
| B50F | CP $14 | 20 hits? [POKE this for single hit capture] | ||
| B511 | JP NC,fully_smashed | Exit via fully_smashed if so | ||
| B514 | CP $13 | 19 hits? | ||
| B516 | JR NZ,smash_set_counter | Jump to smash_set_counter if not | ||
|
We have 19 hits
|
||||
| B518 | PUSH AF | Preserve new smash counter | ||
| B519 | LD A,$0A | Set priority to 10 | ||
| B51B | LD HL,$9926 | Raymond: "ONE MORE TIME" | ||
| B51E | CALL start_chatter | Call start_chatter (priority 10) | ||
| B521 | POP AF | Restore new smash counter | ||
| smash_set_counter | B522 | LD ($A233),A | Set smash_counter to A | |
| B525 | LD C,$00 | Set smash_level to zero if smash_counter is zero | ||
| B527 | AND A | |||
| B528 | JR Z,smash_set | |||
| B52A | INC C | Set smash_level to 1 if smash_counter < 4 | ||
| B52B | CP $04 | |||
| B52D | JR C,smash_set | |||
| B52F | INC C | Set smash_level to 2 if smash_counter < 7 | ||
| B530 | CP $07 | |||
| B532 | JR C,smash_set | |||
| B534 | INC C | Set smash_level to 3 if smash_counter < 11 | ||
| B535 | CP $0B | |||
| B537 | JR C,smash_set | |||
| B539 | INC C | Set smash_level to 4 if smash_counter < 14 | ||
| B53A | CP $0E | |||
| B53C | JR C,smash_set | |||
| B53E | INC C | Set smash_level to 5 if smash_counter < 17 | ||
| B53F | CP $11 | |||
| B541 | JR C,smash_set | |||
| B543 | INC C | Otherwise set smash_level to 6 | ||
| smash_set | B544 | LD A,C | Set smash_level to C | |
| B545 | LD ($A232),A | |||
| B548 | RET | Return | ||
| Prev: B4CC | Up: Map | Next: B549 |