First implementation of *SPOOL.

This commit is contained in:
Bobbi Webber-Manners 2022-09-20 23:29:07 -04:00
parent 421b3bc8ce
commit 0a2b891b7c
3 changed files with 46 additions and 14 deletions

Binary file not shown.

View File

@ -56,7 +56,7 @@ WRCHHND PHA
PHX PHX
PHY PHY
* TO DO Check any output redirections * TO DO Check any output redirections
* PHA PHA
JSR OUTCHAR JSR OUTCHAR
* TO DO Check any printer output * TO DO Check any printer output
@ -67,14 +67,13 @@ WRCHHND PHA
* WRCHHND3 * WRCHHND3
* TO DO Check any spool output * TO DO Check any spool output
* LDY FXSPOOL LDY FXSPOOL
* BEQ WRCHHND4 BEQ WRCHHND4
* PLA PLA
* PHA PHA
* JSR OSBPUT JSR OSBPUT
* WRCHHND4 WRCHHND4 PLA
* PLA
*
PLY PLY
PLX PLX
PLA PLA

View File

@ -310,12 +310,15 @@ FSCCOMMAND ASC 'CHDIR'
ASC 'COPY' ASC 'COPY'
DB $80 DB $80
DW FSCCOPY-1 ; COPY <listspec> <*objspec*>, LPTR=>params DW FSCCOPY-1 ; COPY <listspec> <*objspec*>, LPTR=>params
ASC 'XEXEC'
DB $80
DW FSCEXEC-1 ; EXEC <*objspec*>, LPTR=>params
ASC 'TYPE' ASC 'TYPE'
DB $80 DB $80
DW FSCTYPE-1 ; TYPE <*objspec*>, LPTR=>params DW FSCTYPE-1 ; TYPE <*objspec*>, LPTR=>params
ASC 'SPOOL'
DB $80
DW FSCSPOOL-1 ; SPOOL <*objspec*>, LPTR=>params
ASC 'XEXEC'
DB $80
DW FSCEXEC-1 ; EXEC <*objspec*>, LPTR=>params
* *
DB $FF ; Terminator DB $FF ; Terminator
@ -855,7 +858,7 @@ FSCTYPE JSR LPTRtoXY
BEQ :SYNTAX ; No filename BEQ :SYNTAX ; No filename
PLY PLY
PLX PLX
LDA #$FF LDA #$40 ; Open for input
JSR FINDHND ; Try to open file JSR FINDHND ; Try to open file
CMP #$00 ; Was file opened? CMP #$00 ; Was file opened?
BEQ :NOTFOUND BEQ :NOTFOUND
@ -885,6 +888,36 @@ FSCTYPE JSR LPTRtoXY
BRK BRK
* Handle *SPOOL command
* LPTR=>parameters string
*
FSCSPOOL JSR LPTRtoXY
PHX
PHY
JSR XYtoLPTR
JSR PARSLPTR ; Just for error handling
BEQ :CLOSE ; No filename - stop spooling
PLY
PLX
LDA FXSPOOL
BNE :NOTTWICE
LDA #$80 ; Open for writing
JSR FINDHND ; Try to open file
STA FXSPOOL ; Store SPOOL file handle
RTS
:CLOSE LDY FXSPOOL
CPY #$00
BEQ :DONE
LDA #$00
JSR FINDHND ; Close file
STZ FXSPOOL
:DONE RTS
:NOTTWICE BRK
DB $D6
ASC 'Already spooling'
BRK
* Handle *EXEC command * Handle *EXEC command
* LPTR=>parameters string * LPTR=>parameters string
* *
@ -896,7 +929,7 @@ FSCEXEC JSR LPTRtoXY
BEQ :SYNTAX ; No filename BEQ :SYNTAX ; No filename
PLY PLY
PLX PLX
LDA #$FF LDA #$40 ; Open for input
JSR FINDHND ; Try to open file JSR FINDHND ; Try to open file
CMP #$00 ; Was file opened? CMP #$00 ; Was file opened?
BEQ :NOTFOUND BEQ :NOTFOUND