.SetUpGMAFile IF _GMA86_PAL TAX ; Copy the number of the GMA file into X CLC ; Add X to the ASCII for '0' to turn 3, 4 or 5 into ADC #'0' ; ASCII characters "3", "4" or "5" ENDIF STA fileNumber ; Store the ASCII file number in fileNumber so the ; filename gets set to GMA3, GMA4 or GMA5 IF _GMA86_PAL TXA ; Set X = X * 2 ASL A ; TAX ; so we can use X as an index into the trackSector ; table, which has two bytes per entry LDA trackSector,X ; Modify the code at mod1 and mod2 with the track STA mod1+1 ; and sector numbers for file X, so the fast loader LDA trackSector+1,X ; knows where to find the file on disk STA mod2+1 ENDIF LDX #LO(filename) ; Call SETNAM to set the filename parameters as follows: LDY #HI(filename) ; LDA #4 ; * A = filename length of 4 JSR KERNALSETNAM ; ; * (Y X) = address of filename ; ; So this sets the filename to "GMA*" where "*" is the ; number passed to the subroutine in A RTS ; Return from the subroutineName: SetUpGMAFile [Show more] Type: Subroutine Category: Loader Summary: Configure the filename parameters to load a specific GMA fileContext: See this subroutine in context in the source code References: This subroutine is called as follows: * LoadGMAFile calls SetUpGMAFile
Arguments: A The number of the GMA file to load * For the GMA85 NTSC variant: as an ASCII character * For the GMA86 PAL variant: as an integer
[X]
Configuration variable KERNALSETNAM = $FFBD
The Kernal function to set a filename
[X]
Label fileNumber in variable filename
[X]
Variable filename (category: Loader)
The GMA filename used to load the game files, buried in a message from GMA, the author of the loader
[X]
Label mod1 in subroutine SetUpFastLoader
[X]
Label mod2 in subroutine SetUpFastLoader
[X]
Variable trackSector (category: Loader)
Track and sector numbers for all the files on the disk, for use in the fast loader