1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2025-01-11 13:29:44 +00:00

Allocate all interp bank. Check path during set_pfx

This commit is contained in:
David Schmenk 2018-02-09 14:16:06 -08:00
parent 7af5d53fbb
commit ebff3ebc07
2 changed files with 57 additions and 37 deletions

View File

@ -42,17 +42,17 @@ DSTX = XPAGE+DSTH
;*
;* INTERPRETER HEADER+INITIALIZATION
;*
SEGSTART = $A000
SEGSTART = $2000
*= SEGSTART-$0E
!TEXT "SOS NTRP"
!WORD $0000
!WORD SEGSTART
!WORD SEGEND-SEGSTART
+SOS $40, SEGREQ ; ALLOCATE SEG 1 AND MAP IT
BNE FAIL ; PRHEX
LDA #$01
STA MEMBANK
; +SOS $40, SEGREQ ; ALLOCATE SEG 1 AND MAP IT
; BNE FAIL ; PRHEX
; LDA #$00
; STA MEMBANK
LDY #$0F ; INSTALL PAGE 0 FETCHOP ROUTINE
LDA #$00
- LDX PAGE0,Y
@ -67,12 +67,31 @@ SEGSTART = $A000
STA DSTX
STA PPX ; INIT FRAME & POOL POINTERS
STA IFPX
LDA #<SEGSTART
LDA #$00
STA PPL
STA IFPL
LDA #>SEGSTART
LDA #$A0
STA PPH
STA IFPH
!IF 1 {
LDA #<VMCORE ; COPY VM+CMD INTO SBANK
STA SRCL
LDA #>VMCORE
STA SRCH
LDY #$00
STY DSTL
LDA #$A0
STA DSTH
- LDA (SRC),Y
STA (DST),Y
INY
BNE -
INC SRCH
INC DSTH
LDA DSTH
CMP #$B8
BNE -
}
LDX #$FF ; INIT STACK POINTER
TXS
LDX #ESTKSZ/2 ; INIT EVAL STACK INDEX
@ -95,13 +114,13 @@ SEGSTART = $A000
; BCC +
; ADC #6
;+ STA $481 ;$880
FAIL STA $0480
RTS
SEGREQ !BYTE 4
!WORD $2001
!WORD $9F01
!BYTE $10
!BYTE $00
;FAIL STA $0480
; RTS
;SEGREQ !BYTE 4
; !WORD $2000
; !WORD $9F00
; !BYTE $10
; !BYTE $00
PAGE0 = *
!PSEUDOPC DROP {
;*
@ -113,6 +132,8 @@ PAGE0 = *
STA OPIDX
JMP (OPTBL)
}
VMCORE = *
!PSEUDOPC $A000 {
;*
;* SYSTEM INTERPRETER ENTRYPOINT
;*
@ -1064,4 +1085,5 @@ LEAVE INY ;+INC_IP
RET RTS
SOSCMD = *
!SOURCE "vmsrc/soscmd.a"
}
SEGEND = *

View File

@ -323,9 +323,9 @@ asm memxcpy(dst,src,size)#0
ADC #$60
STA DSTH
LDA ESTKL+2,X
ORA #$80
CLC
ADC #$7F
STA DSTX
DEC DSTX
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
@ -361,9 +361,9 @@ asm xpokeb(seg, dst, byteval)#0
ADC #$60
STA DSTH
LDA ESTKL+2,X
ORA #$80
CLC
ADC #$7F
STA DSTX
DEC DSTX
LDY #$00
LDA ESTKL,X
STA (DST),Y
@ -571,9 +571,9 @@ asm lookuptbl(dci, tbl)#1
ADC #$60
STA DSTH
LDA ESTKL,X
ORA #$80
CLC
ADC #$7F
STA DSTX
DEC DSTX
LDA ESTKL+1,X
STA SRCL
LDA ESTKH+1,X
@ -797,11 +797,21 @@ def getpfx(path)#1
return path
end
def setpfx(path)#1
byte params[3]
byte params[6]
byte fileinfo[2]
params.0 = 1
params.0 = 3
params:1 = path
perr = syscall($C6, @params)
params:3 = @fileinfo
params.5 = 2
perr = syscall($C4, @params) // Get file info
if not perr and (fileinfo.1 == $00 or fileinfo.1 == $0F) // Make sure it's a directory
params.0 = 1
params:1 = path
perr = syscall($C6, @params)
else
perr = $44
fin
return path
end
def volume(devname, volname)#1
@ -982,18 +992,6 @@ def allocheap(size)#1
word addr
addr = heap
heap = heap + size
if systemflags & reshgr1
if uword_islt(addr, $4000) and uword_isgt(heap, $2000)
addr = $4000
heap = addr + size
fin
fin
if systemflags & reshgr2
if uword_islt(addr, $6000) and uword_isgt(heap, $4000)
addr = $6000
heap = addr + size
fin
fin
if uword_isge(heap, @addr)
return 0
fin
@ -1183,7 +1181,7 @@ def loadmod(mod)#1
return -perr
fin
modid++
defext = (codeseg.0 | $80) - 1
defext = codeseg.0 + $7F // (codeseg.0 | $80) - 1
defaddr = (codeseg & $FF00) + $6000
codefix = defaddr - bytecode
defofst = defaddr - defofst
@ -1430,7 +1428,7 @@ init_cons
//
// Print PLASMA version
//
prstr("PLASMA 01.01\n")//; prbyte(version.1); cout('.'); prbyte(version.0); crout
prstr("PLASMA "); prbyte(version.1); cout('.'); prbyte(version.0); crout
//
// Init 2K symbol table.
//