| Chase H.Q. | Routines |
| Prev: 8C58 | Up: Map | Next: 8DF9 |
|
Dispatches on transition_control: 1, 2 and 3 hand straight over to draw_mugshots, draw_overlay_messages and fill_attributes respectively. 4 is the fade proper, which draws eight pairs of back-buffer stripes per frame by ORing a mask into the pixels, stepping the mask pointer on by the per-frame stride until the frame count runs out.
Three self-modified operands hold the state: the frame count at $8DA1, the mask pointer at $8DBB and the stride at $8DB1. All three are set up by setup_transition.
Used by the routines at load_stage, attract_mode_48k, main_loop, run_pregame_screen, escape_scene and load_stage_128k.
|
||||
| transition | 8D8F | LD A,($A231) | Load transition_control | |
| 8D92 | AND A | Exit early if it's zero | ||
| 8D93 | RET Z | |||
| 8D94 | DEC A | If transition_control was 1, exit via draw_mugshots | ||
| 8D95 | JP Z,draw_mugshots | |||
| 8D98 | DEC A | If transition_control was 2, exit via draw_overlay_messages | ||
| 8D99 | JP Z,draw_overlay_messages | |||
| 8D9C | DEC A | If transition_control was 3, exit via fill_attributes | ||
| 8D9D | JP Z,fill_attributes | |||
|
Otherwise transition_control was 4.
|
||||
| 8DA0 | LD A,$00 | A = <self modified> - 1 -- Self modified by 8E18, and below | ||
| 8DA2 | DEC A | |||
| 8DA3 | LD ($8DA1),A | Self modify above | ||
| 8DA6 | JR NZ,t_8dad | Jump if non-zero | ||
| 8DA8 | LD ($A231),A | transition_control = A | ||
| 8DAB | JR t_8db7 | Jump to t_8db7 | ||
| t_8dad | 8DAD | LD HL,($8DBB) | Read 8DBA below | |
| 8DB0 | LD DE,$0008 | Load offset -- Self modified by st_set_offset | ||
| 8DB3 | ADD HL,DE | Move to next frame | ||
| 8DB4 | LD ($8DBB),HL | Set anim address? (Self modify 8DBA below) | ||
| t_8db7 | 8DB7 | LD H,$FF | H = $FF -- row counter | |
| 8DB9 | EXX | Bank | ||
| 8DBA | LD HL,$0000 | HL = <self modified> -- Self modified by 8E1F, and above | ||
| 8DBD | LD B,$08 | 8 chunks | ||
| t_loop | 8DBF | LD A,(HL) | Load a byte of anim | |
| 8DC0 | EXX | Unbank | ||
| 8DC1 | LD E,A | Get it into E (value ORred in) | ||
| 8DC2 | LD D,H | Preserve H in D (which is safe) | ||
| 8DC3 | LD L,$FE | Reset ptr | ||
| 8DC5 | CALL transition_fade_chunk | Draw all even? chunks | ||
| 8DC8 | LD L,$FE | Reset ptr | ||
| 8DCA | LD A,H | Move up (screen-wise) by 8 | ||
| 8DCB | SUB $08 | |||
| 8DCD | LD H,A | |||
| 8DCE | CALL transition_fade_chunk | Draw all odd? chunks | ||
| 8DD1 | DEC D | H = D - 1 -- drop down 1 row | ||
| 8DD2 | LD H,D | |||
| 8DD3 | EXX | Bank | ||
| 8DD4 | INC HL | Next byte of anim | ||
| 8DD5 | DJNZ t_loop | Loop | ||
| 8DD7 | RET | Return | ||
|
Fade odd/even UDG rows of the screen with a single byte.
|
||||
| transition_fade_chunk | 8DD8 | LD C,$08 | 8 rows | |
| t_fade_row_loop | 8DDA | LD B,$06 | 6 iterations (of 5 ops each in the loop below) = 30 bytes written (~ a scanline) | |
| t_fade_column_loop | 8DDC | LD A,(HL) | OR E into the screen pixels | |
| 8DDD | OR E | |||
| 8DDE | LD (HL),A | |||
| 8DDF | DEC L | Repeat another four times | ||
| 8DE0 | LD A,(HL) | |||
| 8DE1 | OR E | |||
| 8DE2 | LD (HL),A | |||
| 8DE3 | DEC L | |||
| 8DE4 | LD A,(HL) | |||
| 8DE5 | OR E | |||
| 8DE6 | LD (HL),A | |||
| 8DE7 | DEC L | |||
| 8DE8 | LD A,(HL) | |||
| 8DE9 | OR E | |||
| 8DEA | LD (HL),A | |||
| 8DEB | DEC L | |||
| 8DEC | LD A,(HL) | |||
| 8DED | OR E | |||
| 8DEE | LD (HL),A | |||
| 8DEF | DEC L | |||
| 8DF0 | DJNZ t_fade_column_loop | Loop | ||
| 8DF2 | DEC L | Move to next start address | ||
| 8DF3 | DEC L | |||
| 8DF4 | DEC C | Loop | ||
| 8DF5 | JP NZ,t_fade_row_loop | |||
| 8DF8 | RET | Return | ||
| Prev: 8C58 | Up: Map | Next: 8DF9 |