1
0
mirror of https://github.com/dschmenk/PLASMA.git synced 2026-04-24 12:18:26 +00:00

Fix PLFORTH and FP loading. Fix return to default text mode

This commit is contained in:
David Schmenk
2025-04-18 08:32:31 -07:00
parent f3c15e7d3d
commit 919058b039
19 changed files with 36 additions and 27 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1 -1
View File
@@ -361,7 +361,7 @@ def reset
word zero
zero = 0
sane:initFP()
if sane:initFP() < 0; return -1; fin
sane:saveZP()
for i = 0 to 3
stackRegs[i] = @stack[i * t_extended]
+24 -18
View File
@@ -732,27 +732,33 @@ def loadcode(codefile)
//puts(codefile); puts(":\n")
pcode = 0
ref = fileio:open(strcat(strcpy(@filepath, cmdsys:syspath), codefile))
//puts("ref = "); prbyte(ref); puts(" perr = "); prbyte(perr); putln
//puts("ref = "); puti(ref); puts(" perr = "); puti(perr); putln
if ref
pcode = heapalloc(512)
fileio:read(ref, pcode, 512)
//puts("Read header bytes: "); puti(seglen)
//if seglen == 0; puts(" perr = "); prbyte(perr); fin
//getc; putln
//dumpheader(pcode)
//putname(pcode + segname + 8); putc('='); prword(pcode); putln
heaprelease(pcode + (pcode + t_diskinfo)=>codeaddr) // REserve heap to end of buffer
seglen = fileio:read(ref, pcode, (pcode + t_diskinfo)=>codeaddr)
//puts("Read segment bytes: "); puti(seglen); putln
fileio:close(ref)
if !fp6502 and (MACHID & $F0 == $B0) // 128K Apple //e or //c
seglen = fixup(AUXADDR, pcode + seglen - 2) - pcode
auxmove(AUXADDR, pcode, seglen)
if pcode
fileio:read(ref, pcode, 512)
seglen = (pcode + t_diskinfo)=>codeaddr // Length of first code segment = start of second - 1
//puts("Read header bytes: "); puti(seglen)
//if seglen == 0; puts(" perr = "); prbyte(perr); fin
//getc; putln
//dumpheader(pcode)
//putname(pcode + segname + 8); putc('='); prword(pcode); putln
heaprelease(pcode)
pcode = AUXADDR
else
heaprelease(fixup(pcode, pcode + seglen - 2)) // Set heap to beginning of relocation list
pcode = heapalloc(seglen)
if pcode // Reserve heap to end of buffer
seglen = fileio:read(ref, pcode, seglen)
//puts("Read segment bytes: "); puti(seglen); putln
if !fp6502 and (MACHID & $F0 == $B0) // 128K Apple //e or //c
seglen = fixup(AUXADDR, pcode + seglen - 2) - pcode
auxmove(AUXADDR, pcode, seglen)
heaprelease(pcode)
pcode = AUXADDR
else
heaprelease(fixup(pcode, pcode + seglen - 2)) // Set heap to beginning of relocation list
fin
fin
fin
fileio:close(ref)
fin
return pcode
end
@@ -814,7 +820,7 @@ def fpInit()
if !fp6502
fp6502 = loadcode("FP6502.CODE")
if !fp6502
puts("SANE library not found.\n")
puts("SANE library not loaded.\n")
return -1
fin
if fp6502 == AUXADDR
+1 -1
View File
@@ -37,6 +37,6 @@ conio:grmode(TRUE)
conio:gotoxy(11, 1)
puts("Press any key to exit.")
rod
conio:textmode(40)
conio:textmode(0)
puts("That's all, folks!\n")
done
+1
View File
@@ -842,6 +842,7 @@ end
// Print title page
//
conio:textmode(40)
conio:clear(cls)
while ^titlestr
puts(titlestr)
+1
View File
@@ -675,6 +675,7 @@ while loadmap(level)
break
fin
loop
conio:textmode(0)
conio:textctrl(ctrlecho, ON)
if player.health > 0
puts(@youmadeitstr)
+2
View File
@@ -201,6 +201,7 @@ def initDisplay#0
byte i
word pkeys
conio:textmode(40)
conio:clear(cls)
rect(0, 0, 40, 23, 1, "<RPN Calculator>")
rect(1, 1, 19, 6, 0, ":Stack:")
@@ -454,5 +455,6 @@ showMem
showInput
showStatus("Version 0.7")
inputKey
conio:textmode(0)
conio:gotoxy(0, 22)
done
+1 -1
View File
@@ -83,4 +83,4 @@ FPULIB 68 IFACE PLASMA _FPRANDNUM : FPRANDNUM _FPRANDNUM FPERR ! ;
: FPINT> PAD FPINT! PAD @ ;
: FP. PAD 10 4 FPSTR.FLEX FPSTR! PAD (.") ;
: FPEXT CREATE 10 ALLOT ;
FPRESET
_FPRESET 0< ?ABORT" Failed to init FP module"
+1 -1
View File
@@ -7,9 +7,9 @@ MACHID MACHID.MEM AND MACHID.128K
FORGET MACHID
SRC" PLASMA.4TH"
SRC" FPU.4TH"
SRC" CONIO.4TH"
SRC" HGRLIB.4TH"
SRC" FPU.4TH"
: DRAWAXIS
0 HGRMODE HGRDRAWBUF TILEDRAWBUF DROP
+4 -5
View File
@@ -776,15 +776,15 @@ def showtrace(dentry)#0
putln; puts("( "); _prstack_; puts(") "); puts(dentry); putc(' ')
end
def brkhandle(dentry)#0
word brk_infn, brk_inptr, brk_iip, brk_inbuf
word brk_infn, brk_inptr, brk_iip
byte brk_state
char brk_inbuf[INBUF_SIZE + 1]
showtrace(dentry)
brk_iip = IIP
brk_infn = infunc
brk_inptr = inptr
brk_inbuf = keyinbuf
keyinbuf = heapalloc(INBUF_SIZE + 1)
memcpy(@brk_inbuf, keyinbuf, INBUF_SIZE + 1)
infunc = @keyin
inptr = keyinbuf
^inptr = 0
@@ -797,8 +797,7 @@ def brkhandle(dentry)#0
IIP = brk_iip
infunc = brk_infn
inptr = brk_inptr
heaprelease(keyinbuf)
keyinbuf = brk_inbuf
memcpy(keyinbuf, @brk_inbuf, INBUF_SIZE + 1)
end
//
// Execute code in CFA