diff --git a/images/apple/PLASMA-2.1-BLD.po b/images/apple/PLASMA-2.1-BLD.po index ea7a613..4645f43 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-FPSOS.po b/images/apple/PLASMA-2.1-FPSOS.po index 6b3125e..b337034 100644 Binary files a/images/apple/PLASMA-2.1-FPSOS.po and b/images/apple/PLASMA-2.1-FPSOS.po differ diff --git a/images/apple/apple3.hd b/images/apple/apple3.hd index 20d83a0..fbb41a3 100644 Binary files a/images/apple/apple3.hd and b/images/apple/apple3.hd differ diff --git a/src/libsrc/apple/grafix.pla b/src/libsrc/apple/grafix.pla index 8f09851..b1401f6 100644 --- a/src/libsrc/apple/grafix.pla +++ b/src/libsrc/apple/grafix.pla @@ -2,6 +2,7 @@ include "inc/cmdsys.plh" byte gfxref, gfxseg byte params[8], cmd[16] +byte textmode[] = 16, 0, 15 export def pencolor(clr)#0 params:4 = 2 @@ -112,6 +113,31 @@ export def drawmode(mode)#0 syscall($CB, @params) end +def gfxopen#1 + // + // Allocate bank 0 + // + params.0 = 4 + params:1 = $2000 + params:3 = $9F00 + params.5 = $10 + params.6 = $00 + syscall($40, @params) + gfxseg = params.6 + ^$1907 = $80 // Set graphics pages allocated + // + // Open graphics driver + // + params.0 = 4 + params:1 = ".GRAFIX" + params.3 = 0 + params:4 = 0 + params.6 = 0 + syscall($C8, @params) + gfxref = params.3 + return gfxref <> 0 +end + export def setmode(mode)#0 if mode < 0 // @@ -122,15 +148,19 @@ export def setmode(mode)#0 syscall($CC, @params) gfxref = 0 // - // Deaalocate bank 0 + // Deallocate bank 0 // params.0 = 1 params.1 = gfxseg syscall($45, @params) ^$1907 = $00 // Unset graphics pages allocated - fin - if not gfxref + // + // Reset textmode + // + cmdsys:syswrite(cmdsys.refcons, @textmode, 3) return + elsif not gfxref + gfxopen fin params.0 = 3 params.1 = gfxref @@ -151,28 +181,7 @@ if MACHID <> $F2 return -1 fin // -// Allocate bank 0 -// -params.0 = 4 -params:1 = $2000 -params:3 = $9F00 -params.5 = $10 -params.6 = $00 -syscall($40, @params) -gfxseg = params.6 -^$1907 = $80 // Set graphics pages allocated -// -// Open graphics driver -// -params.0 = 4 -params:1 = ".GRAFIX" -params.3 = 0 -params:4 = 0 -params.6 = 0 -syscall($C8, @params) -gfxref = params.3 -// // Keep module in memory // -return modkeep +return gfxopen ?? modkeep :: -1 done diff --git a/src/scripts/gfxplot.4th b/src/scripts/gfxplot.4th index 8b8d014..e7924bf 100644 --- a/src/scripts/gfxplot.4th +++ b/src/scripts/gfxplot.4th @@ -5,7 +5,7 @@ SRC" FPU.4TH" : DRAWAXIS 3 GFXSETMODE - 1 GFXPENCOLOR + 6 GFXPENCOLOR 0 96 139 96 GFXLINE 70 0 70 191 GFXLINE ; @@ -19,12 +19,12 @@ FPEXT XSCALE FPCONSTPI 69 >FPINT FP/ XSCALE FPEXT! FPEXT YSCALE --95 >FPINT YSCALE FPEXT! +95 >FPINT YSCALE FPEXT! DEFER FUNC : PLOTFUNC - 3 GFXPENCOLOR + 15 GFXPENCOLOR 140 0 DO I DUP 69 - >FPINT XSCALE FPEXT@ FP* FUNC