Skip to navigation


Loader: OfferFastLoader

[Commodore 64 version, Disk Loader 2]

Name: OfferFastLoader [Show more] Type: Subroutine Category: Loader Summary: Offer the option of using the fast loader, if we haven't already, and set up the fast loader if it is chosen
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * Elite GMA loader (Part 2 of 4) calls OfferFastLoader
.OfferFastLoader LDA VIC+$11 ; Loop back to OfferFastLoader until bit 7 of VIC-II BPL OfferFastLoader ; register $11 (control register 1) is set ; ; Bit 7 of register $11 contains the top bit of the ; current raster line (which is a 9-bit value), so this ; waits until the raster has reached at least line 256 LDA #$08 ; Set the high byte of the pointer to screen memory to STA $0288 ; $08, so screen memory gets set to $0800 JSR KERNALSCINIT ; Call the Kernal's SCINIT function to initialise the ; VIC-II and start using the new screen memory address LDA VIC+$18 ; Set bits 4-7 of VIC register $18 to %0010 to set the AND #%00001111 ; address of screen RAM to $0800 ORA #%00100000 STA VIC+$18 LDA #2 ; Set VIC register $20 to set the border colour to the STA VIC+$20 ; colour number in bits 0-3 (i.e. colour 2, red) STA VIC+$21 ; Set VIC register $21 to set the background colour to ; the colour number in bits 0-3 (i.e. colour 2, red) LDX #0 ; Print the first string from loaderScreens, which JSR PrintString ; clears the screen and prints the "FAST LOADER? (Y/N)" ; prompt TXA ; Store X on the stack, as it contains the offset of the PHA ; second string in loaderScreens LDA fastLoaderOffered ; If fastLoaderOffered is non-zero then we have already BNE setf2 ; asked about the fast loader, so jump to setf2 to skip ; the following and go straight to the loading screen ; (so we don't ask twice) INC fastLoaderOffered ; Set fastLoaderOffered to 1 to record that we have ; asked about the fast loader LDA #$1C ; Change the colour of the "FAST LOADER? (Y/N)" prompt STA promptText ; from yellow to red to hide it, as it is on a red ; background .setf1 JSR KERNALGETIN ; Call the Kernal's GETIN function to fetch a key press ; from the keyboard BEQ setf1 ; Loop back to setf1 until a key is pressed CMP #'N' ; If "N" was pressed then jump to setf2 to skip the fast BEQ setf2 ; loader setup and stick to the standard load routines CMP #'Y' ; If "Y" was not pressed then loop back to setf1 to wait BNE setf1 ; for another key press ; If we get here then "Y" was pressed, so we need to set ; up the fast loader JSR SetUpFastLoader ; Call SetUpFastLoader to set up the fast loader, so ; that calls to the Kernal's file functions use the fast ; loader routines instead of the built-in functions .setf2 PLA ; Retrieve the value of X from the stack so it points to TAX ; the second string in loaderScreens, i.e. the "LOADING ; ELITE" screen ; Fall through into PrintString to display the "LOADING ; ELITE" screen