From b2eaa867eb9ea5b67de6b563a40c1bf568589cbe Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Fri, 3 Jan 2020 07:57:26 -0800 Subject: [PATCH] Add explicit undrawList calls --- src/inc/hgrsprite.plh | 2 ++ src/libsrc/apple/hgrsprite.pla | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/inc/hgrsprite.plh b/src/inc/hgrsprite.plh index d2daed0..803e590 100644 --- a/src/inc/hgrsprite.plh +++ b/src/inc/hgrsprite.plh @@ -9,6 +9,8 @@ import hgrsprite predef spriteUnDrawXor(sprtptr)#0 predef spritePos(x, y, sprtptr)#0 predef spritePosIndex(x, y, i)#0 + predef spriteUnDrawList#0 + predef spriteUnDrawXorList#0 predef spriteDrawList#0 predef spriteDrawXorList#0 predef spriteAdd(i, sprtptr)#1 diff --git a/src/libsrc/apple/hgrsprite.pla b/src/libsrc/apple/hgrsprite.pla index 84f2980..2e11a89 100644 --- a/src/libsrc/apple/hgrsprite.pla +++ b/src/libsrc/apple/hgrsprite.pla @@ -260,6 +260,18 @@ export def spritePosIndex(x, y, i)#0 drawList[i]=>s_xpos = x - drawList[i]->s_xcenter fin end +export def spriteUnDrawList#0 + byte i + var undrawptr + + undrawptr = undrawList[drawpage] + for i = 15 downto 0 + if undrawptr=>[i] + spriteUnDraw(undrawptr=>[i]) + undrawptr=>[i] = 0 + fin + next +end export def spriteDrawList#0 byte i var undrawptr @@ -277,6 +289,18 @@ export def spriteDrawList#0 next memcpy(undrawptr, @drawList, 16*2) end +export def spriteUnDrawXorList#0 + byte i + var undrawptr + + undrawptr = undrawList[drawpage] + for i = 0 to 15 + if undrawptr=>[i] + spriteUnDrawXor(undrawptr=>[i]) + undrawptr=>[i] = 0 + fin + next +end export def spriteDrawXorList#0 byte i var undrawptr