\ --- Mod: Code added for Elite-A: --------------------> IF _BUG_FIX .SwitchToFileSys \ This routine restores the filing system workspace to \ &C000 on a BBC Master, but only if CATF is non-zero \ and we overwrote it in SwitchToCharSet \ \ Call it at SwitchToFileSys+5 to restore the workspace \ irrespective of the value of CATF LDX CATF \ If CATF = 0, jump to file1, otherwise we are BEQ file1 \ printing a disc catalogue LDA #0 \ Call OSBYTE with A = 0 and X = 1 to fetch bit 0 of the LDX #1 \ operating system version into X JSR OSBYTE CPX #3 \ If X =< 3 then this is not a BBC Master, so jump to BCC file1 \ file1 to continue drawing the character BIT wsstatecopy \ If bit 7 of wsstatecopy is set then the character set BMI file1 \ was already present before this call, so skip the \ following so we don't change that JSR restorews \ Call restorews to restore the filing system workspace .file1 RTS \ Return from the subroutine ENDIF \ --- End of added code ------------------------------->Name: SwitchToFileSys [Show more] Type: Subroutine Category: Utility routines Summary: Restore the filing system workspace to &C000 on a BBC MasterContext: See this subroutine in context in the source code References: This subroutine is called as follows: * CHPR calls SwitchToFileSys * MEBRK calls via SwitchToFileSys+5
Other entry points: SwitchToFileSys+5 Restore the workspace irrespective of the value of CATF
[X]
Configuration variable OSBYTE = &FFF4
The address for the OSBYTE routine
[X]
Label file1 is local to this routine
[X]
Configuration variable restorews = &DD65
The address for the restorews workspace routine from the loader so we can call it to ensure the MOS character definitions are loaded before printing text on the BBC Master
[X]
Variable wsstatecopy in subroutine SwitchToCharSet
We store a copy of the wstate here so we know which state to switch back to after printing