Prev: F111 Up: Map Next: F251
F220: 128K mode routines and data
This is relocated to $8014/load_stage onwards during init (926 bytes long).
load_stage_128k F220 LD A,($8007) Load wanted_stage_number
F223 LD HL,$A13A Load address of current_stage_number
F226 CP (HL) Return if the stage is already loaded
F227 RET Z
F228 LD (HL),A Set wanted_stage_number to current_stage_number
Copy the stage data from the correct bank and address to $5C00..$76EF (from the horizon backdrop to just before the turbo icons).
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 Advance to source data address high byte
F233 LD H,(HL) Load source data address high byte
F234 LD L,B HL is source data address (B is zero)
F235 LD BC,$7FFD 128K: Page in required bank
F238 OUT (C),A
F23A LD DE,$5C00 Set destination to $5C00
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 at $C000, Paging from bank 1
F247 DEFW $E001 Level 2: Source at $E000, Paging from bank 1
F249 DEFW $C006 Level 3: Source at $C000, Paging from bank 6
F24B DEFW $E006 Level 4: Source at $E000, Paging from bank 6
F24D DEFW $C007 Level 5: Source at $C000, Paging from bank 7
F24F DEFW $E007 Level 6: Source at $E000, Paging from bank 7
Prev: F111 Up: Map Next: F251