Skip to navigation

Save and load: QUS1, Removed

[Elite Demonstration Disc]

Name: QUS1, Removed [Show more] Type: Subroutine Category: Save and load Summary: Save or load the commander file Deep dive: Commander save files
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file

The filename should be stored at INWK, terminated with a carriage return (13). The routine should be called with Y set to &C.
Arguments: A File operation to be performed. Can be one of the following: * 0 (save file) * &FF (load file) Y Points to the page number containing the OSFILE block, which must be &C because that's where the pointer to the filename in INWK is stored below (by the STX &0C00 instruction)
\ --- Mod: Code removed for Demonstration Disc: -------> \.QUS1 \ \LDX #INWK \ Store a pointer to INWK at the start of the block at \STX &0C00 \ &0C00, storing #INWK in the low byte because INWK is \ \ in zero page \ \LDX #0 \ Set X to 0 so (Y X) = &0C00 \ \JMP OSFILE \ Jump to OSFILE to do the file operation specified in \ \ &0C00 (i.e. save or load a file depending on the value \ \ of A), returning from the subroutine using a tail call \ --- End of removed code ----------------------------->