Chase H.Q. | Routines |
Prev: F111 | Up: Map | Next: F251 |
This is relocated to $8014/load_stage onwards during init (926 bytes long).
|
||||
page_in_stage_128k | F220 | LD A,($8007) | Load wanted_stage_number | |
F223 | LD HL,$A13A | Address of current_stage_number | ||
F226 | CP (HL) | Return if the stage is already loaded | ||
F227 | RET Z | |||
F228 | LD (HL),A | wanted_stage_number = current_stage_number | ||
Copy the stage data from the correct bank and address to $5C00..$76EF.
|
||||
F229 | ADD A,A | Point HL at stage_data_locations[current_stage_number] | ||
F22A | LD B,$00 | |||
F22C | LD C,A | |||
F22D | LD HL,$8037 | |||
F230 | ADD HL,BC | |||
F231 | LD A,(HL) | Load paging flags byte | ||
F232 | INC HL | HL++ | ||
F233 | LD H,(HL) | HL = Source data address (B is zero) | ||
F234 | LD L,B | |||
F235 | LD BC,$7FFD | 128K: Page in required bank | ||
F238 | OUT (C),A | |||
F23A | LD DE,$5C00 | Destination $5C00..$76EF (from the horizon backdrop to just before the turbo icons) | ||
F23D | LD BC,$1AF0 | Bytes to copy (worst case) | ||
F240 | LDIR | Copy | ||
F242 | JP $8208 | Exit via relocated reset_paging_128k | ||
Pairs of (top byte of source data address, paging flags).
|
||||
stage_data_locations | F245 | DEFW $C001 | Level 1. Source = $C000, Paging = bank 1 | |
F247 | DEFW $E001 | Level 2. Source = $E000, Paging = bank 1 | ||
F249 | DEFW $C006 | Level 3. Source = $C000, Paging = bank 6 | ||
F24B | DEFW $E006 | Level 4. Source = $E000, Paging = bank 6 | ||
F24D | DEFW $C007 | Level 5. Source = $C000, Paging = bank 7 | ||
F24F | DEFW $E007 | Level 6. Source = $E000, Paging = bank 7 |
Prev: F111 | Up: Map | Next: F251 |