mirror of
https://github.com/bobbimanners/Applecorn.git
synced 2025-01-19 05:30:35 +00:00
First implementation of *EXEC (called *XEXEC for now)
This commit is contained in:
parent
02347adde2
commit
421b3bc8ce
@ -259,16 +259,15 @@ NEGCALL >>> XF2MAIN,MACHRD ; Try to read Machine ID
|
||||
* On exit, CS=no keypress
|
||||
* CC=keypress
|
||||
* A =keycode, X,Y=corrupted
|
||||
KEYREAD
|
||||
* TO DO: check *EXEC source
|
||||
* LDY FXEXEC
|
||||
* BEQ KEYREAD1
|
||||
* JSR OSBGET
|
||||
* BCC KEYREADOK
|
||||
* LDA #0
|
||||
* STA FXVAREXEC
|
||||
* JSR OSFIND
|
||||
* KEYREAD1
|
||||
KEYREAD LDY FXEXEC ; See if *EXEC file is open
|
||||
BEQ KEYREAD1
|
||||
JSR OSBGET ; Read keypress from file
|
||||
BCC KEYREADOK
|
||||
LDA #0 ; EOF, close *EXEC file
|
||||
STA FXEXEC
|
||||
JSR OSFIND
|
||||
KEYREAD1
|
||||
|
||||
*
|
||||
* TO DO: expand current soft key
|
||||
* LDA SOFTKEYLEN
|
||||
@ -283,7 +282,6 @@ KEYREAD
|
||||
*
|
||||
JSR KBDREAD ; Fetch character from KBD "buffer"
|
||||
BCS KEYREADOK ; Nothing pending
|
||||
*
|
||||
TAY
|
||||
BPL KEYREADOK ; Not top-bit key
|
||||
AND #$CF
|
||||
|
@ -310,6 +310,9 @@ FSCCOMMAND ASC 'CHDIR'
|
||||
ASC 'COPY'
|
||||
DB $80
|
||||
DW FSCCOPY-1 ; COPY <listspec> <*objspec*>, LPTR=>params
|
||||
ASC 'XEXEC'
|
||||
DB $80
|
||||
DW FSCEXEC-1 ; EXEC <*objspec*>, LPTR=>params
|
||||
ASC 'TYPE'
|
||||
DB $80
|
||||
DW FSCTYPE-1 ; TYPE <*objspec*>, LPTR=>params
|
||||
@ -840,6 +843,7 @@ DESTROY JSR PARSLPTR ; Copy filename->MOSFILE
|
||||
*
|
||||
FSCTITLE RTS
|
||||
|
||||
|
||||
* Handle *TYPE command
|
||||
* LPTR=>parameters string
|
||||
*
|
||||
@ -880,6 +884,36 @@ FSCTYPE JSR LPTRtoXY
|
||||
ASC 'Escape'
|
||||
BRK
|
||||
|
||||
|
||||
* Handle *EXEC command
|
||||
* LPTR=>parameters string
|
||||
*
|
||||
FSCEXEC JSR LPTRtoXY
|
||||
PHX
|
||||
PHY
|
||||
JSR XYtoLPTR
|
||||
JSR PARSLPTR ; Just for error handling
|
||||
BEQ :SYNTAX ; No filename
|
||||
PLY
|
||||
PLX
|
||||
LDA #$FF
|
||||
JSR FINDHND ; Try to open file
|
||||
CMP #$00 ; Was file opened?
|
||||
BEQ :NOTFOUND
|
||||
STA FXEXEC ; Store EXEC file handle
|
||||
RTS
|
||||
RTS
|
||||
:SYNTAX BRK
|
||||
DB $DC
|
||||
ASC 'Syntax: EXEC <*objspec*>'
|
||||
BRK
|
||||
:NOTFOUND STZ FXEXEC
|
||||
BRK
|
||||
DB $D6
|
||||
ASC 'Not found'
|
||||
BRK
|
||||
|
||||
|
||||
* Parse filename pointed to by XY
|
||||
* Write filename to MOSFILE in main memory
|
||||
* Returns length in A with EQ/NE set
|
||||
|
Loading…
x
Reference in New Issue
Block a user