Blame | Last modification | View Log | Download
OUTPUT "build/loader6128.bin"code_start equ $8000org code_startstart:ld a,$FF ; OFFcall $BC6B ; CASNOISY; check loading screenld a,(settings.load_screen)or ajr z,.load_pages.load_screen:; load screenld hl,$C000 ; destld de,$4000 ; sizeld a,$16 ; type: datacall $BCA1 ; CASREAD (headerless).load_pages:ld hl,page_tableld a,(hl) : inc hl ; read entry countor ajr z,.load_code.loop_pages:push afld a,(hl) : inc hl ; page numor %11000000 ; mask to set bank 1: page n (eg: page at $4000)ld b,$74ld c,adiout (c),c ; mmr -> page in 'n' at $C000ld c,(hl) : inc hl ; offset from base int bcld b,(hl) : inc hlld e,(hl) : inc hl ; len into deld d,(hl) : inc hlpush hlld hl,$4000 ; baseadd hl,bc ; hl contains target addr; load the pageld a,$16 ; type: datacall $BCA1 ; CASREAD (headerless)ld bc,$74C0out (c),c ; put mmr back to normalpop hleipop afdec ajr nz,.loop_pages.load_code:ld hl,(settings.start_addr)push hlld hl,(settings.code_addr)ld de,(settings.code_len)ld a,$16 ; type: datajp $BCA1 ; CASREADsettings:.load_screen: .db $00.start_addr: .dw $0000.code_addr: .dw $0000.code_len: .dw $0000page_table:.num: .db $00 ; how many pages to load?.data:; .db num; .dw start; .dw len