diff --git a/images/apple/PLASMA-2.1-4TH.po b/images/apple/PLASMA-2.1-4TH.po index 2eaeec2..37ba432 100644 Binary files a/images/apple/PLASMA-2.1-4TH.po and b/images/apple/PLASMA-2.1-4TH.po differ diff --git a/images/apple/PLASMA-2.1-BLD.po b/images/apple/PLASMA-2.1-BLD.po index dad33ce..c683562 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-DEMOS.po b/images/apple/PLASMA-2.1-DEMOS.po index 5219e2d..a86c516 100644 Binary files a/images/apple/PLASMA-2.1-DEMOS.po and b/images/apple/PLASMA-2.1-DEMOS.po differ diff --git a/images/apple/PLASMA-2.1-FPSOS.po b/images/apple/PLASMA-2.1-FPSOS.po index c494f68..4718fdf 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/PLASMA-2.1-INET.po b/images/apple/PLASMA-2.1-INET.po index 99c6c8e..89f32f8 100644 Binary files a/images/apple/PLASMA-2.1-INET.po and b/images/apple/PLASMA-2.1-INET.po differ diff --git a/images/apple/PLASMA-2.1-SYS.po b/images/apple/PLASMA-2.1-SYS.po index efb53cf..b32efef 100644 Binary files a/images/apple/PLASMA-2.1-SYS.po and b/images/apple/PLASMA-2.1-SYS.po differ diff --git a/images/apple/PLASMA-2.1.po b/images/apple/PLASMA-2.1.po index 28a9983..f71c518 100644 Binary files a/images/apple/PLASMA-2.1.po and b/images/apple/PLASMA-2.1.po differ diff --git a/src/inc/dgrlib.plh b/src/inc/dgrlib.plh index 71e86e4..b11121f 100644 --- a/src/inc/dgrlib.plh +++ b/src/inc/dgrlib.plh @@ -13,4 +13,7 @@ import dgrlib predef dgrSwap#0 predef dgrDrawBuf(page)#0 predef dgrColor(clr)#0 + const dgrPage1 = 0 + const dgrPage2 = 1 + const dgrOff = -1 end diff --git a/src/inc/grlib.plh b/src/inc/grlib.plh index 7a884a1..8aa3337 100644 --- a/src/inc/grlib.plh +++ b/src/inc/grlib.plh @@ -13,4 +13,7 @@ import grlib predef grSwap#0 predef grDrawBuf(page)#0 predef grColor(clr)#0 + const grPage1 = 0 + const grPage2 = 1 + const grOff = -1 end diff --git a/src/inc/hgrlib.plh b/src/inc/hgrlib.plh index 251fcf1..0384eac 100644 --- a/src/inc/hgrlib.plh +++ b/src/inc/hgrlib.plh @@ -21,4 +21,7 @@ import hgrlib predef hgrSwap#1 predef hgrDrawBuf(page)#1 predef hgrColor(clr)#0 + const hgrPage1 = 0 + const hgrPage2 = 1 + const hgrOff = -1 end diff --git a/src/inc/hgrtile.plh b/src/inc/hgrtile.plh index 9a8bac9..2172e86 100644 --- a/src/inc/hgrtile.plh +++ b/src/inc/hgrtile.plh @@ -5,9 +5,5 @@ import hgrtile predef tileAndDraw(x, y, tileptr)#0 predef tileDrawStr(x, y, strptr, strlen, tileset)#0 predef tileFromText(txtpage, tileset)#0 - predef tileMode(mode)#1 - predef tileClear#0 - predef tileShow(page)#1 - predef tileSwap#1 predef tileDrawBuf(page)#1 end diff --git a/src/libsrc/apple/dgrlib.pla b/src/libsrc/apple/dgrlib.pla index 3bc0900..441c27e 100755 --- a/src/libsrc/apple/dgrlib.pla +++ b/src/libsrc/apple/dgrlib.pla @@ -520,32 +520,48 @@ export def dgrClear(clr)#0 dgrFill(0, 0, @clrtile) end export def dgrMode(mode)#1 - if mode - // - // Set double lores graphics, return draw buffer - // - ^showlores - ^showfull - ^showgraphics - ^showpage1 - ^ena80 = 0 - ^show80 = 0 - ^an3on - drawpage = 1 - drawbuff = dgrbuff[1] - return 1 - fin - // - // Set text mode - // - ^showtext - ^showpage1 - ^ena80 = 0 - ^show40 = 0 - ^mapmain = 0 - ^an3off - call($FC58, 0, 0, 0, 0) // home() - return 0 + when mode + is page1 + // + // Set double lores graphics, return draw buffer + // + ^showlores + ^showfull + ^showgraphics + ^showpage1 + ^ena80 = 0 + ^show80 = 0 + ^an3on + drawpage = page2 + drawbuff = dgrbuff[page2] + break + is page2 + // + // Set double lores graphics, return draw buffer + // + ^showlores + ^showfull + ^showgraphics + ^showpage1 + ^ena80 = 0 + ^show80 = 0 + ^an3on + drawpage = 1 + drawbuff = dgrbuff[1] + break + otherwise + // + // Set text mode + // + ^showtext + ^showpage1 + ^ena80 = 0 + ^show40 = 0 + ^mapmain = 0 + ^an3off + call($FC58, 0, 0, 0, 0) // home() + wend + return mode end // // Set display page, return other page diff --git a/src/libsrc/apple/grlib.pla b/src/libsrc/apple/grlib.pla index 25553ee..01a45d6 100644 --- a/src/libsrc/apple/grlib.pla +++ b/src/libsrc/apple/grlib.pla @@ -443,33 +443,50 @@ end // Set lores graphics, return draw buffer // export def grMode(mode)#1 - if mode - // - // Set GR mode - // - ^showlores - ^showfull - ^showgraphics - ^showpage1 - ^ena80 = 0 - ^show40 = 0 - ^mapmain = 0 - ^an3off - drawpage = 1 - drawbuff = grbuff[1] - return 1 - fin - // - // Set text mode - // - ^showtext - ^showpage1 - ^ena80 = 0 - ^show40 = 0 - ^mapmain = 0 - ^an3off - call($FC58, 0, 0, 0, 0) // home() - return 0 + when mode + is page1 + // + // Set GR mode + // + ^showlores + ^showfull + ^showgraphics + ^showpage1 + ^ena80 = 0 + ^show40 = 0 + ^mapmain = 0 + ^an3off + drawpage = page2 + drawbuff = grbuff[page2] + break + is page2 + // + // Set GR mode + // + ^showlores + ^showfull + ^showgraphics + ^showpage2 + ^ena80 = 0 + ^show40 = 0 + ^mapmain = 0 + ^an3off + drawpage = page1 + drawbuff = grbuff[page1] + break + otherwise + // + // Set text mode + // + ^showtext + ^showpage1 + ^ena80 = 0 + ^show40 = 0 + ^mapmain = 0 + ^an3off + call($FC58, 0, 0, 0, 0) // home() + wend + return mode end // // Set display page, return other page diff --git a/src/libsrc/apple/hgrlib.pla b/src/libsrc/apple/hgrlib.pla index a252703..6d4e67c 100644 --- a/src/libsrc/apple/hgrlib.pla +++ b/src/libsrc/apple/hgrlib.pla @@ -1157,14 +1157,7 @@ export def hgrBLT(x, y, w, h, srcptr)#0 end export def hgrMode(mode)#1 when mode - is 0 - // - // Show text mode - // - ^showpage1 - ^showtext - break - is 1 + is page1 // // Set HGR1 mode // @@ -1173,21 +1166,27 @@ export def hgrMode(mode)#1 ^showfull ^showhires ^showgraphics - drawpage = 1 - drawbuff = hgrbuff[1] + drawpage = page2 + drawbuff = hgrbuff[page2] break - is 2 + is page2 // // Set HGR2 mode // memset(hgr2, 0, $2000) // Clear HGR2 - ^showpage1 + ^showpage2 ^showfull ^showhires ^showgraphics - drawpage = 1 - drawbuff = hgrbuff[1] + drawpage = page1 + drawbuff = hgrbuff[page1] break + otherwise + // + // Show text mode + // + ^showpage1 + ^showtext wend return mode end diff --git a/src/libsrc/apple/hgrtile.pla b/src/libsrc/apple/hgrtile.pla index 1069ae9..f45071e 100644 --- a/src/libsrc/apple/hgrtile.pla +++ b/src/libsrc/apple/hgrtile.pla @@ -353,44 +353,9 @@ export def tileFromText(txtpage, tileset)#0 tileDrawStr(0, y, rowaddr[y] | txtptr, 40, tileset) next end -export def tileMode(mode)#1 - if mode - // - // Set HGR mode - // - memset(hgr1, 0, $2000) // Clear HGR page 1 - ^showpage1 - ^showfull - ^showhires - ^showgraphics - drawpage = 0 - drawbuff = hgr1 - return 0 - fin - // - // Show text mode - // - ^showpage1 - ^showtext - return 0 -end -export def tileClear#0 - memset(drawbuff, $0000, drawbuff) // Clear current HGR page -end // -// Set display page, return other page +// Set draw buffer // -export def tileShow(page)#1 - page = page & 1 - ^(showpage1 + page) - return page ^ 1 -end -export def tileSwap#1 - ^(showpage1 + drawpage) - drawpage = drawpage ^ 1 - drawbuff = hgrbuff[drawpage] - return drawpage -end export def tileDrawBuf(page)#1 drawpage = page & 1 drawbuff = hgrbuff[drawpage] diff --git a/src/samplesrc/dgrtest.pla b/src/samplesrc/dgrtest.pla index c5ead35..ee701af 100644 --- a/src/samplesrc/dgrtest.pla +++ b/src/samplesrc/dgrtest.pla @@ -24,8 +24,8 @@ def dgrTest#0 byte b, l, k word i, j, ii, ij - b = dgrMode(TRUE) - dgrDrawBuf(0) + b = dgrMode(dgrPage1) + dgrDrawBuf(dgrPage1) for k = 15 downto 0 dgrClear(k) next @@ -43,7 +43,7 @@ def dgrTest#0 i = 40 j = 10 ^$C010 - dgrDrawBuf(1) + dgrDrawBuf(dgrPage2) while ^$C000 < 128 dgrFill(k, k, @tile1) dgrBLT(i, j, 8, 8, @sprite1) @@ -59,7 +59,7 @@ def dgrTest#0 fin loop ^$C010 - dgrMode(FALSE) + dgrMode(dgrOff) end dgrTest diff --git a/src/samplesrc/grtest.pla b/src/samplesrc/grtest.pla index 88880a7..51b01d3 100644 --- a/src/samplesrc/grtest.pla +++ b/src/samplesrc/grtest.pla @@ -24,8 +24,8 @@ def grTest#0 byte b, l, k word i, j, ii, ij - b = grMode(TRUE) - grDrawBuf(0) + b = grMode(grPage1) + grDrawBuf(grPage1) for k = 15 downto 0 grClear(k) next @@ -43,7 +43,7 @@ def grTest#0 i = 20 j = 10 ^$C010 - grDrawBuf(1) + grDrawBuf(grPage2) while ^$C000 < 128 grFill(k, k, @tile1) grBLT(i, j, 8, 8, @sprite1) @@ -59,7 +59,7 @@ def grTest#0 fin loop ^$C010 - grMode(FALSE) + grMode(grOff) end grTest diff --git a/src/samplesrc/hgrtest.pla b/src/samplesrc/hgrtest.pla index 7c3ff4a..1b592f5 100644 --- a/src/samplesrc/hgrtest.pla +++ b/src/samplesrc/hgrtest.pla @@ -65,16 +65,16 @@ def testblt(sprtnum)#0 loop end -hgrMode(TRUE) -spriteDrawBuf(hgrDrawBuf(0)) // So we can see the compile process +hgrMode(hgrPage1) +spriteDrawBuf(hgrDrawBuf(hgrPage1)) // So we can see the compile process sprtBall = spriteCompile(10, 10, 5, 5, @ball) hgrColor(0) hgrClear() testline memcpy($4000, $2000, $2000) // Copy to both buffers -spriteDrawBuf(hgrDrawBuf(1)) +spriteDrawBuf(hgrDrawBuf(hgrPage2)) spriteAdd(0, sprtBall) testblt(16) getc -hgrMode(FALSE) +hgrMode(hgrOff) done diff --git a/src/samplesrc/sfm.pla b/src/samplesrc/sfm.pla index 69396f6..7efd7fb 100644 --- a/src/samplesrc/sfm.pla +++ b/src/samplesrc/sfm.pla @@ -575,8 +575,8 @@ next heapstart = heapmark() //puts("\nBeginning available memory: "); puti(heapavail()); putln repeat - hgrMode(TRUE) - spriteDrawBuf(hgrDrawBuf(0)) // Single buffered + hgrMode(hgrPage1) + spriteDrawBuf(hgrDrawBuf(hgrPage1)) // Single buffered spriteAdd(SHIP_SPRTNUM, sprtShip) spriteAdd(SPIDER_SPRTEBASE, sprtEgg3) // @@ -617,7 +617,8 @@ repeat puts("\nEarth has been overrun") puts("\nby the Spiders from Mars\n") fin - hgrMode(FALSE) + hgrMode(hgrOFF) + //hgrDrawBuf(hgrPage1) // // Clear sprite lists // diff --git a/src/samplesrc/sfmsprt.pla b/src/samplesrc/sfmsprt.pla index 6f53a34..14e0f90 100644 --- a/src/samplesrc/sfmsprt.pla +++ b/src/samplesrc/sfmsprt.pla @@ -169,8 +169,8 @@ var sprtSplat1, sprtSplat2 var sprtWeb1, sprtWeb2, sprtWeb3 var sprtShip, sprtMissle, sprtDummy -hgrMode(TRUE) -spriteDrawBuf(hgrDrawBuf(0)) // So we can see the compile process +hgrMode(hgrPage1) +spriteDrawBuf(hgrDrawBuf(hgrPage1)) // So we can see the compile process sprtShip = spriteCompile(14, 14, 7, 13, @ship) sprtMissle = spriteCompile( 6, 8, 3, 0, @missle) sprtEgg3 = spriteCompile(14, 12, 7, 6, @egg3) @@ -185,7 +185,7 @@ sprtWeb3 = spriteCompile(20, 8, 10, 0, @web3) sprtSplat1 = spriteCompile(20, 13, 10, 6, @splat1) sprtSplat2 = spriteCompile(24, 17, 12, 8, @splat2) sprtDummy = spriteCompile( 7, 8, 0, 0, @dummy) -hgrMode(FALSE) +hgrMode(hgrOff) spriteSave("SHIP", sprtShip) spriteSave("MISSLE", sprtMissle) spriteSave("EGG3", sprtEgg3) diff --git a/src/samplesrc/tiletest.pla b/src/samplesrc/tiletest.pla index 0e4ff28..0c7cf00 100644 --- a/src/samplesrc/tiletest.pla +++ b/src/samplesrc/tiletest.pla @@ -1,13 +1,15 @@ include "inc/cmdsys.plh" +include "inc/hgrlib.plh" include "inc/hgrtile.plh" include "inc/hgrfont.plh" sysflags reshgr1 // Reserve HGR page 1 -tileMode(TRUE) +hgrMode(hgrPage1) +tileDrawBuf(hgrPage1) hgrPutStr(5, 1, "Hello HiRes Tile Demo") getc tileFromText(0, @hgrFont) getc -tileMode(FALSE) +hgrMode(hgrOff) done diff --git a/src/scripts/bounce.4th b/src/scripts/bounce.4th index 004a8b7..81dc06d 100644 --- a/src/scripts/bounce.4th +++ b/src/scripts/bounce.4th @@ -30,7 +30,7 @@ SRC" GRLIB.4TH" ; : BOUNCE - 1 GRMODE DROP + 0 GRMODE DROP 0 GRDRAWBUF 0 GRCLEAR BEGIN @@ -38,7 +38,7 @@ SRC" GRLIB.4TH" ?TERMINAL UNTIL KEY DROP - 0 GRMODE DROP + -1 GRMODE DROP ; BOUNCE diff --git a/src/scripts/hrbounce.4th b/src/scripts/hrbounce.4th index 4edd9f8..c3aa37b 100644 --- a/src/scripts/hrbounce.4th +++ b/src/scripts/hrbounce.4th @@ -34,7 +34,7 @@ SRC" HGRLIB.4TH" ; : BOUNCE - 1 HGRMODE DROP + 0 HGRMODE DROP 0 HGRDRAWBUF DROP 0 HGRSHOW DROP BEGIN @@ -42,7 +42,7 @@ SRC" HGRLIB.4TH" ?TERMINAL UNTIL KEY DROP - 0 HGRMODE DROP + -1 HGRMODE DROP ; BOUNCE