.SetUpFastLoader JSR fast47 JSR fast46 RTS LDA #$06 STA $31 JSR $F50A .fast1 BVC fast1 CLV LDA $1C01 IF _GMA86_PAL STA $0600,Y ELIF _GMA85_NTSC STA ($30),Y ENDIF INY BNE fast1 LDY #$BA .fast2 BVC fast2 CLV LDA $1C01 STA $0100,Y INY BNE fast2 JSR $F8E0 LDA $38 CMP $47 BEQ fast3 LDA #$04 BNE fast12 .fast3 JSR $F5E9 CMP $3A BEQ fast4 LDA #$05 BNE fast12 .fast4 IF _GMA86_PAL LDA $0601 STA $07 LDY #$02 LDX #$FF LDA $0600 BEQ fast5 STX $0601 .fast5 INC $0601 .fast6 LDX $0600,Y CPX #$01 BNE fast7 JSR load3 .fast7 JSR load3 INY CPY $0601 BNE fast6 LDA $0600 BEQ fast14 CMP $06 STA $06 BEQ fast13 LDA #$01 .fast8 ELIF _GMA85_NTSC LDA ($30),Y BNE fast9 INC $0601 .fast9 LDA ($30),Y TAX .fast10 BIT $1800 BPL fast10 LDA #$10 STA $1800 .fast11 BIT $1800 BMI fast11 TXA LSR A LSR A LSR A LSR A STA $1800 ASL A AND #$0F NOP STA $1800 TXA AND #$0F NOP STA $1800 ASL A AND #$0F NOP STA $1800 LDX #$0F NOP NOP STX $1800 LDA $0600 BEQ fast17 INY BNE fast9 LDA $0601 STA $0F LDA ($30),Y CMP $0E STA $0E BEQ fast13 LDA #$01 ENDIF .fast12 JMP $F969 .fast13 IF _GMA86_PAL JMP $0304 .fast14 LDX #$01 JSR load3 LDX #$02 JSR load3 LDA #$7F JMP $F969 .fast15 BIT $1800 BPL fast15 LDA #$10 STA $1800 .fast16 BIT $1800 BMI fast16 TXA LSR A LSR A LSR A LSR A STA $1800 ASL A AND #$0F STA $1800 TXA AND #$0F STA $1800 ASL A AND #$0F STA $1800 LDA #$0F NOP STA $1800 RTS JSR $D042 .mod1 LDA #$FF STA $06 .mod2 LDA #$FF STA $07 ELIF _GMA85_NTSC JMP $0704 .fast17 INY CPY $0601 BNE fast9 LDA #$7F BNE fast12 LDA $18 STA $0E LDA $19 STA $0F ENDIF .fast18 IF _GMA86_PAL LDA #$E0 STA $00 .fast19 LDA $00 ELIF _GMA85_NTSC LDA #$E0 STA $04 .fast19 LDA $04 ENDIF BMI fast19 CMP #$7F BEQ fast20 BCC fast18 .fast20 JMP $D048 .fast21 LDA $A4 STA $DD00 .fast22 LDA $DD00 BPL fast22 .fast23 LDA VIC+$12 CMP #$31 BCC fast24 AND #$06 CMP #$02 BEQ fast23 .fast24 LDA $A5 STA $DD00 NOP NOP NOP NOP NOP NOP NOP NOP NOP NOP IF _GMA86_PAL LDX $DD00 LDA $CF00,X LDX $DD00 ORA $CF08,X LDX $DD00 ORA $CF10,X LDX $DD00 ORA $CF18,X ELIF _GMA85_NTSC NOP LDY $DD00 LDA $CF00,Y NOP LDY $DD00 ORA $CF08,Y NOP LDY $DD00 ORA $CF10,Y NOP LDY $DD00 ORA $CF18,Y ENDIF RTS IF _GMA85_NTSC LDA #$00 STA $93 LDA $BA CMP #$08 BCS fast25 LDA #$08 .fast25 STA $BA STA $B8 JSR $F5AF JSR $F333 LDX $B9 STX $02 LDA #$60 STA $B9 JSR $F3D5 LDA $BA JSR $ED09 LDA $B9 JSR $EDC7 JSR $EE13 LDA $90 LSR A LSR A BCC fast26 JMP $F704 .fast26 JSR $F5D2 ENDIF LDA #$00 STA $A4 .fast27 JSR fast43 LDA #$57 JSR $EDDD LDA $A4 JSR $EDDD IF _GMA86_PAL LDA #$03 ELIF _GMA85_NTSC LDA #$07 ENDIF JSR $EDDD LDA #$20 JSR $EDDD LDY $A4 CLC LDA $A4 ADC #$20 STA $A4 .fast28 IF _GMA86_PAL LDA $0403,Y ELIF _GMA85_NTSC LDA $03D6,Y ENDIF JSR $EDDD INY CPY $A4 BNE fast28 IF _GMA86_PAL JSR $FFCC LDA $A4 CMP #$CE ELIF _GMA85_NTSC JSR $EDFE LDA $A4 CMP #$B5 ENDIF BCC fast27 JSR fast43 LDA #$45 JSR $EDDD IF _GMA86_PAL LDA #$B2 JSR $EDDD LDA #$03 JSR $EDDD JSR $FFCC ELIF _GMA85_NTSC LDA #$9C JSR $EDDD LDA #$07 JSR $EDDD JSR $EDFE ENDIF LDA $DD00 AND #$07 STA $A5 ORA #$08 STA $A4 SEI IF _GMA85_NTSC LDX #$04 .fast29 JSR fast21 BEQ fast34 CMP #$FF BNE fast30 LDA #$02 STA $90 BNE fast41 .fast30 JSR fast21 CPX #$02 BEQ fast31 JSR fast44 .fast31 JSR fast21 JSR fast50 LDY #$00 STA ($AE),Y INC $AE BEQ fast33 .fast32 INX BNE fast31 LDX #$02 JMP fast29 .fast33 INC $AF JMP fast32 .fast34 JSR fast21 CPX #$02 PHP TAX PLP BEQ fast35 JSR fast44 DEX DEX .fast35 DEX DEX .fast36 JSR fast21 ENDIF IF _GMA86_PAL JSR fast44 LDY #$00 .fast37 JSR fast50 JSR fast21 CMP #$01 BNE fast38 JSR fast21 CMP #$01 BNE fast39 .fast38 STA ($AE),Y INY BNE fast37 INC $AF BNE fast37 .fast39 LDA $A5 STA $0618 JSR $F646 ELIF _GMA85_NTSC JSR fast50 LDY #$00 STA ($AE),Y INC $AE BNE fast40 INC $AF .fast40 DEX BNE fast36 .fast41 LDA $A5 STA $064E JSR $F646 ENDIF .fast42 LDA VIC+$11 BPL fast42 JSR $FDA3 LDA $DD00 AND #$F8 IF _GMA86_PAL ORA $0618 STA $DD00 ELIF _GMA85_NTSC ORA $064E STA $DD00 LDX $AE LDY $AF ENDIF RTS .fast43 IF _GMA86_PAL LDA #$00 JSR KERNALSETNAM LDA #$0F TAY LDX #$08 JSR KERNALSETLFS JSR $FFC0 LDX #$0F JSR $FFC9 LDA #$4D JSR KERNALCHROUT LDA #$2D JSR KERNALCHROUT ELIF _GMA85_NTSC LDA $BA JSR $ED0C LDA #$6F JSR $EDB9 LDA #$4D JSR $EDDD LDA #$2D JSR $EDDD ENDIF RTS .fast44 JSR fast21 STA $AE JSR fast21 IF _GMA85_NTSC LDY $02 BNE fast45 LDA $C3 STA $AE LDA $C4 .fast45 ENDIF STA $AF RTS .fast46 IF _GMA86_PAL LDA #$10 STA $0330 LDA #$05 STA $0331 ELIF _GMA85_NTSC LDA #$CE STA $0330 LDA #$04 STA $0331 ENDIF RTS .fast47 LDX #$00 LDY #$00 .fast48 LDA #$08 IF _GMA86_PAL STA $0618 LDA $05FC,X ELIF _GMA85_NTSC STA $064E LDA $0632,X ENDIF .fast49 STA $CF00,Y INY IF _GMA86_PAL DEC $0618 ELIF _GMA85_NTSC DEC $064E ENDIF BNE fast49 INX CPX #$1C BCC fast48 RTS .fast50 INC VIC+$20 DEC VIC+$20 RTSName: SetUpFastLoader [Show more] Type: Subroutine Category: Loader Summary: Set up the fast loader so that calls to the Kernal's file functions use the fast loader routines insteadContext: See this subroutine in context in the source code References: This subroutine is called as follows: * OfferFastLoader calls SetUpFastLoader
This routine implements a fast loader that intercepts the Kernal's file functions to provide a faster load experience than the default system does. As this code isn't really Elite-specific and is only run if you choose the optional fast loader, I haven't added any commentary. For an excellent commented version of this routine, I highly recommend Kroc Camen's epic Elite Harmless project: https://github.com/Kroc/elite-harmless/blob/kroc/src/boot/gma/stage1.asm
[X]
Configuration variable KERNALCHROUT = $FFD2
The Kernal function to print characters
[X]
Configuration variable KERNALSETLFS = $FFBA
The Kernal function to set the logical, first, and second addresses for file access
[X]
Configuration variable KERNALSETNAM = $FFBD
The Kernal function to set a filename
[X]
Configuration variable VIC = $D000
Registers for the VIC-II video controller chip, which are memory-mapped to the 46 bytes from $D000 to $D02E (see page 454 of the Programmer's Reference Guide)
[X]
Label fast1 is local to this routine
[X]
Label fast10 is local to this routine
[X]
Label fast11 is local to this routine
[X]
Label fast12 is local to this routine
[X]
Label fast13 is local to this routine
[X]
Label fast14 is local to this routine
[X]
Label fast15 is local to this routine
[X]
Label fast16 is local to this routine
[X]
Label fast17 is local to this routine
[X]
Label fast18 is local to this routine
[X]
Label fast19 is local to this routine
[X]
Label fast2 is local to this routine
[X]
Label fast20 is local to this routine
[X]
Label fast21 is local to this routine
[X]
Label fast22 is local to this routine
[X]
Label fast23 is local to this routine
[X]
Label fast24 is local to this routine
[X]
Label fast25 is local to this routine
[X]
Label fast26 is local to this routine
[X]
Label fast27 is local to this routine
[X]
Label fast28 is local to this routine
[X]
Label fast29 is local to this routine
[X]
Label fast3 is local to this routine
[X]
Label fast30 is local to this routine
[X]
Label fast31 is local to this routine
[X]
Label fast32 is local to this routine
[X]
Label fast33 is local to this routine
[X]
Label fast34 is local to this routine
[X]
Label fast35 is local to this routine
[X]
Label fast36 is local to this routine
[X]
Label fast37 is local to this routine
[X]
Label fast38 is local to this routine
[X]
Label fast39 is local to this routine
[X]
Label fast4 is local to this routine
[X]
Label fast40 is local to this routine
[X]
Label fast41 is local to this routine
[X]
Label fast42 is local to this routine
[X]
Label fast43 is local to this routine
[X]
Label fast44 is local to this routine
[X]
Label fast45 is local to this routine
[X]
Label fast46 is local to this routine
[X]
Label fast47 is local to this routine
[X]
Label fast48 is local to this routine
[X]
Label fast49 is local to this routine
[X]
Label fast5 is local to this routine
[X]
Label fast50 is local to this routine
[X]
Label fast6 is local to this routine
[X]
Label fast7 is local to this routine
[X]
Label fast9 is local to this routine
[X]
Entry point load3 in subroutine Elite GMA loader (Part 3 of 4) (category: Loader)
Jump to the entry point in elite-loader