Save startup path for relaunching CMD after SYS program

This commit is contained in:
David Schmenk 2014-05-24 14:18:43 -07:00
parent 3d1ea51011
commit e9f854c06a

View File

@ -37,6 +37,7 @@ ALTRDON = $C003
ALTWROFF= $C004
ALTWRON = $C005
!SOURCE "plvm02zp.inc"
STRBUF = $0280
;**********************************************************
;*
;* INTERPRETER INSTRUCTION POINTER INCREMENT MACRO
@ -131,6 +132,35 @@ RAMDONE CLI
INY
BNE -
;*
;* SAVE DEFAULT COMMAND INTERPRETER PATH IN LC
;*
JSR PRODOS ; GET PREFIX
!BYTE $C7
!WORD GETPFXPARMS
LDY STRBUF ; APPEND "CMD"
LDA #"/"
CMP STRBUF,Y
BEQ +
INY
STA STRBUF,Y
+ LDA #"C"
INY
STA STRBUF,Y
LDA #"M"
INY
STA STRBUF,Y
LDA #"D"
INY
STA STRBUF,Y
STY STRBUF
BIT LCRWEN+LCBNK2 ; COPY TO LC FOR BYE
BIT LCRWEN+LCBNK2
- LDA STRBUF,Y
STA $D103,Y ; YEAH, I HARDCODED THE ADDRESS
DEY
BPL -
;*
;* LOOK FOR STARTUP FILE
;*
JSR PRODOS ; OPEN AUTORUN
@ -150,12 +180,13 @@ RAMDONE CLI
!WORD READPARMS
BNE NOAUTO
LDX READPARMS+6
STX $0280
STX STRBUF ; STRING LENGTH
JSR PRODOS
!BYTE $CC
!WORD CLOSEPARMS
JMP CMDEXEC
NOAUTO JMP BYE ; LOAD DEFAULT
NOAUTO JMP CMDEXEC
GETPFXPARMS !BYTE 1
!WORD STRBUF ; PATH STRING GOES HERE
AUTORUN !BYTE 7
!TEXT "AUTORUN"
OPENPARMS !BYTE 3
@ -168,7 +199,7 @@ NLPARMS !BYTE 3
!BYTE $0D
READPARMS !BYTE 4
!BYTE 0
!WORD $0281
!WORD STRBUF+1
!WORD $0080
!WORD 0
CLOSEPARMS !BYTE 1
@ -218,19 +249,18 @@ OPTBL !WORD ZERO,ADD,SUB,MUL,DIV,MOD,INCR,DECR ; 00 02 04 06 08 0A 0C 0E
;*
;* CLEAR COMMAND LINE LENGTH BYTE IF CALLED FROM 'BYE'
;*
BYE LDY DEFCMD
STY $0280 ; SET DEFAULT COMMAND WHEN CALLED FROM 'BYE'
- LDA DEFCMD,Y
STA $0280,Y
BYE JMP CPYCMD
DEFCMD !FILL 63 ; AT $D103 IN LC MEMORY
CPYCMD LDY DEFCMD
- LDA DEFCMD,Y ; SET DEFAULT COMMAND WHEN CALLED FROM 'BYE'
STA STRBUF,Y
DEY
BNE -
BEQ CMDEXEC
DEFCMD !BYTE 3
!TEXT "CMD"
BPL -
;*
;* MOVE REST OF CMD FROM LANGUAGE CARD
;*
CMDEXEC STY SRCL
CMDEXEC LDY #$00
STY SRCL
STY DSTL
LDA #$D2
STA SRCH