| Chase H.Q. | Routines |
| Prev: 8D8F | Up: Map | Next: 8E29 |
|
Picks one of the four three-byte entries in the forward ($EC00) or reverse ($EC0C) half of the table at random and plants its frame count and mask pointer, along with the stride passed in, into the three self-modified operands transition reads.
Used by the routines at load_stage, main_loop, run_pregame_screen, escape_scene, set_up_stage, handle_perp_caught and load_stage_128k.
|
||||||||
| setup_transition | 8DF9 | AND A | Set flags from A | |||||
| 8DFA | LD C,A | Widen A to BC | ||||||
| 8DFB | LD B,$00 | |||||||
| 8DFD | LD DE,$EC00 | Points to first half of table | ||||||
| 8E00 | JP P,st_set_offset | Jump over if A was +ve | ||||||
| 8E03 | DEC B | B = $FF to make BC properly negative | ||||||
| 8E04 | LD DE,$EC0C | Points to second half of table | ||||||
| st_set_offset | 8E07 | LD ($8DB1),BC | Self modify "LD DE,x" at 8DB0 to load BC | |||||
|
Pick a random entry in the table.
|
||||||||
| 8E0B | CALL rng | Get a random number 0..3 | ||||||
| 8E0E | AND $03 | |||||||
| 8E10 | LD L,A | HL = A * 3 + DE | ||||||
| 8E11 | RLCA | |||||||
| 8E12 | ADD A,L | |||||||
| 8E13 | LD L,A | |||||||
| 8E14 | LD H,$00 | |||||||
| 8E16 | ADD HL,DE | |||||||
| 8E17 | LD A,(HL) | Load first byte from entry | ||||||
| 8E18 | LD ($8DA1),A | Self modify "LD A,x" at 8DA0 to load A | ||||||
| 8E1B | INC HL | DE = wordat(++HL) | ||||||
| 8E1C | LD E,(HL) | |||||||
| 8E1D | INC HL | |||||||
| 8E1E | LD D,(HL) | |||||||
| 8E1F | LD ($8DBB),DE | Set transition animation start address | ||||||
| 8E23 | LD A,$04 | Set transition_control to 4 (the fade case in transition) | ||||||
| 8E25 | LD ($A231),A | transition_control = A | ||||||
| 8E28 | RET | Return | ||||||
| Prev: 8D8F | Up: Map | Next: 8E29 |