diff --git a/images/apple/PLASMA-2.1-BLD.po b/images/apple/PLASMA-2.1-BLD.po index a8d6418..5880455 100644 Binary files a/images/apple/PLASMA-2.1-BLD.po and b/images/apple/PLASMA-2.1-BLD.po differ diff --git a/images/apple/PLASMA-2.1-INST.po b/images/apple/PLASMA-2.1-INST.po index 535588a..4f83ef8 100644 Binary files a/images/apple/PLASMA-2.1-INST.po and b/images/apple/PLASMA-2.1-INST.po differ diff --git a/images/apple/PLASMA-2.1.po b/images/apple/PLASMA-2.1.po index f547f31..3e5c5b3 100644 Binary files a/images/apple/PLASMA-2.1.po and b/images/apple/PLASMA-2.1.po differ diff --git a/images/apple/PLASMA2.2mg b/images/apple/PLASMA2.2mg index e8702cd..2927d05 100644 Binary files a/images/apple/PLASMA2.2mg and b/images/apple/PLASMA2.2mg differ diff --git a/images/apple/PLFORTH.PO b/images/apple/PLFORTH.PO index cdae5b2..add396c 100644 Binary files a/images/apple/PLFORTH.PO and b/images/apple/PLFORTH.PO differ diff --git a/images/apple/apple3.hd b/images/apple/apple3.hd index d8468d5..76ab7df 100644 Binary files a/images/apple/apple3.hd and b/images/apple/apple3.hd differ diff --git a/src/mk4th b/src/mk4th index eb32ae7..20d385a 100755 --- a/src/mk4th +++ b/src/mk4th @@ -39,4 +39,5 @@ cat scripts/rod.4th | ./ac.jar -ptx PLFORTH.PO scripts/ROD.4TH TX cat scripts/bounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/BOUNCE.4TH TXT cat scripts/dbounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/DBOUNCE.4TH TXT cat scripts/hrbounce.4th | ./ac.jar -ptx PLFORTH.PO scripts/HRBOUNCE.4TH TXT +cat scripts/hrplot.4th | ./ac.jar -ptx PLFORTH.PO scripts/HRPLOT.4TH TXT echo "+PLFORTH PLASMA.4TH" | ./ac.jar -ptx PLFORTH.PO AUTORUN TXT diff --git a/src/mk800 b/src/mk800 index 2e84eaf..01e7d5e 100755 --- a/src/mk800 +++ b/src/mk800 @@ -231,7 +231,7 @@ cat samplesrc/testlib.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/TESTLIB.PL cat samplesrc/playseq.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/PLAYSEQ.PLA TXT cat samplesrc/rpncalc.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/RPNCALC.PLA TXT cat samplesrc/fatcat.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/FATCAT.PLA TXT -cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/GFXDEMO.PLA TXT +#cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/GFXDEMO.PLA TXT cat samplesrc/lz4cat.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/LZ4CAT.PLA TXT cat samplesrc/sfm.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/SFM.PLA TXT cat samplesrc/sfmsprt.pla | ./ac.jar -ptx PLASMA-2.1.po bld/samples/SFMSPRT.PLA TXT @@ -244,6 +244,7 @@ cat scripts/rod.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/ROD.4TH TXT cat scripts/bounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/BOUNCE.4TH TXT cat scripts/dbounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/DBOUNCE.4TH TXT cat scripts/hrbounce.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/HRBOUNCE.4TH TXT +cat scripts/hrplot.4th | ./ac.jar -ptx PLASMA-2.1.po bld/scripts/HRPLOT.4TH TXT #mkdir bld/examples #cat samplesrc/examples/ex.1.pla bld/examples/EX.1.PLA TXT diff --git a/src/mkbld b/src/mkbld index 41f3027..32df408 100755 --- a/src/mkbld +++ b/src/mkbld @@ -50,7 +50,7 @@ cat samplesrc/rod.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/ROD.PL cat samplesrc/playseq.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/PLAYSEQ.PLA TXT cat samplesrc/rpncalc.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/RPNCALC.PLA TXT #cat samplesrc/fatcat.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/FATCAT.PLA TXT -cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/GFXDEMO.PLA TXT +#cat samplesrc/gfxdemo.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/GFXDEMO.PLA TXT cat samplesrc/lz4cat.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/LZ4CAT.PLA TXT cat samplesrc/sfm.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/SFM.PLA TXT cat samplesrc/sfmsprt.pla | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/samples/SFMSPRT.PLA TXT @@ -62,3 +62,4 @@ cat scripts/rod.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/ROD.4T cat scripts/bounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/BOUNCE.4TH TXT cat scripts/dbounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/DBOUNCE.4TH TXT cat scripts/hrbounce.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/HRBOUNCE.4TH TXT +cat scripts/hrplot.4th | ./ac.jar -ptx PLASMA-2.1-BLD.po bld/scripts/HRPLOT.4TH TXT diff --git a/src/mkrel b/src/mkrel index 849c816..09d43cb 100755 --- a/src/mkrel +++ b/src/mkrel @@ -61,15 +61,15 @@ cp rel/TX2FORTH#FE1000 prodos/sys/TX2FORTH.REL cp rel/PLFORTH#FE1000 prodos/sys/PLFORTH.REL mkdir prodos/sys/scripts -cp scripts/plasma.4th prodos/sys/scripts/PLASMA.4TH.TXT -cp scripts/machid.4th prodos/sys/scripts/MACHID.4TH.TXT -cp scripts/conio.4th prodos/sys/scripts/CONIO.4TH.TXT -cp scripts/fileio.4th prodos/sys/scripts/FILEIO.4TH.TXT -cp scripts/grlib.4th prodos/sys/scripts/GRLIB.4TH.TXT -cp scripts/dgrlib.4th prodos/sys/scripts/DGRLIB.4TH.TXT -cp scripts/hgrlib.4th prodos/sys/scripts/HGRLIB.4TH.TXT -cp scripts/int32.4th prodos/sys/scripts/INT32.4TH.TXT -cp scripts/fpu.4th prodos/sys/scripts/FPU.4TH.TXT +cp scripts/plasma.4th prodos/sys/scripts/PLASMA.4TH.TXT +cp scripts/machid.4th prodos/sys/scripts/MACHID.4TH.TXT +cp scripts/conio.4th prodos/sys/scripts/CONIO.4TH.TXT +cp scripts/fileio.4th prodos/sys/scripts/FILEIO.4TH.TXT +cp scripts/grlib.4th prodos/sys/scripts/GRLIB.4TH.TXT +cp scripts/dgrlib.4th prodos/sys/scripts/DGRLIB.4TH.TXT +cp scripts/hgrlib.4th prodos/sys/scripts/HGRLIB.4TH.TXT +cp scripts/int32.4th prodos/sys/scripts/INT32.4TH.TXT +cp scripts/fpu.4th prodos/sys/scripts/FPU.4TH.TXT rm -rf prodos/demos mkdir prodos/demos @@ -148,6 +148,7 @@ cp scripts/rod.4th prodos/bld/scripts/ROD.4TH.TXT cp scripts/bounce.4th prodos/bld/scripts/BOUNCE.4TH.TXT cp scripts/dbounce.4th prodos/bld/scripts/DBOUNCE.4TH.TXT cp scripts/hrbounce.4th prodos/bld/scripts/HRBOUNCE.4TH.TXT +cp scripts/hrplot.4th prodos/bld/scripts/HRPLOT.4TH.TXT #mkdir prodos/bld/examples #cp samplesrc/examples/ex.1.pla prodos/bld/examples/EX.1.PLA.TXT diff --git a/src/scripts/fpu.4th b/src/scripts/fpu.4th index c11bef8..2db70eb 100644 --- a/src/scripts/fpu.4th +++ b/src/scripts/fpu.4th @@ -74,11 +74,13 @@ FPULIB 65 IFACE PLASMA _FPPOW : FPPOW _FPPOW FPERR ! ; FPULIB 66 IFACE PLASMA _FPCOMP : FPCOMP _FPCOMP FPERR ! ; FPULIB 67 IFACE PLASMA _FPANNUITY : FPANNUITY _FPANNUITY FPERR ! ; FPULIB 68 IFACE PLASMA _FPRANDNUM : FPRANDNUM _FPRANDNUM FPERR ! ; -1 CONSTANT FPSTR.FIXED +1 CONSTANT FPSTR.FIXED 0 CONSTANT FPSTR.FLOAT 2 CONSTANT FPSTR.STRIP 4 CONSTANT FPSTR.EXP 8 CONSTANT FPSTR.FLEX -: FP. HERE 10 4 FPSTR.FLEX FPSTR! HERE (.") ; +: >FPINT PAD ! PAD FPINT@ ; +: FPINT> PAD FPINT! PAD @ ; +: FP. PAD 10 4 FPSTR.FLEX FPSTR! PAD (.") ; : FPEXT CREATE 10 ALLOT ; -FPRESET \ No newline at end of file +FPRESET diff --git a/src/scripts/hrplot.4th b/src/scripts/hrplot.4th new file mode 100644 index 0000000..771e1e0 --- /dev/null +++ b/src/scripts/hrplot.4th @@ -0,0 +1,44 @@ +LOOKUP HRFORTH ( HGR page 1 reserved ) +NOT ?ABORT" Must run with HRFORTH." + +SRC" PLASMA.4TH" +SRC" CONIO.4TH" +SRC" HGRLIB.4TH" +SRC" FPU.4TH" + +: DRAWAXIS + 0 HGRMODE HGRDRAWBUF TILEDRAWBUF DROP + 1 HGRCOLOR + 0 96 279 96 HGRLINE + 139 0 139 191 HGRLINE + 140 0 140 191 HGRLINE +; + +: PLOTDONE + KEY DROP + -1 HGRMODE DROP +; + +FPEXT XSCALE +FPCONSTPI 140 >FPINT FP/ XSCALE FPEXT! + +FPEXT YSCALE +96 >FPINT YSCALE FPEXT! + +DEFER FUNC + +: PLOTFUNC + 3 HGRCOLOR + 279 0 DO + I DUP 139 - >FPINT XSCALE FPEXT@ FP* + FUNC + YSCALE FPEXT@ FP* FPINT> 95 + + OVER 1+ OVER HGRPLOT HGRPLOT + LOOP +; + +' FPSIN IS FUNC +DRAWAXIS PLOTFUNC PLOTDONE + +' FPCOS IS FUNC +DRAWAXIS PLOTFUNC PLOTDONE diff --git a/src/toolsrc/plforth.pla b/src/toolsrc/plforth.pla index fe6b413..332e063 100644 --- a/src/toolsrc/plforth.pla +++ b/src/toolsrc/plforth.pla @@ -7,7 +7,8 @@ include "inc/longjmp.plh" // Internal variables // const JSR = $20 // 6502 JSR opcode needed for VM entry -const RTS = $60 +const RTS = $60 // 6502 RTS opcode +const JMP = $4C // 6502 JMP opcode const SRCREFS = 2 const INBUF_SIZE = 128 word latest, infunc, inptr, IIP, W @@ -1322,7 +1323,7 @@ def _dodefer_#0 end def _defer_#0 newdict - _dictaddb_(RTS); _dictaddb_(0) // NO-OP and space for deferred pfa + _dictaddb_(RTS); _dictaddw_(0) // NO-OP and space for deferred pfa addhash(latest) end def _is_(a)#0 @@ -1330,12 +1331,13 @@ def _is_(a)#0 dentry = find(nextword(' ')) if dentry - if ^_ffa_(a) & itc_flag - *_cfa_(dentry) = @_dodefer_ - *_pfa_(dentry) = a - ^(_ffa_(dentry)) = ^(_ffa_(dentry)) | itc_flag + ^(_ffa_(dentry)) = ^(_ffa_(a)) + if ^_ffa_(dentry) & itc_flag + *_cfa_(dentry) = @_dodefer_ + *_pfa_(dentry) = a else // comp_pbc_flag - *_cfa_(dentry) = *_cfa_(a) + ^_pfa_(dentry) = JMP + *(_pfa_(dentry) + 1) = *_cfa_(a) fin else puts(a); puts(" Not found")