From 0821ae2bd7c2267da632631fa1ddf1d430af8aeb Mon Sep 17 00:00:00 2001 From: Kistaro Windrider Date: Sun, 18 Dec 2022 02:24:42 +0000 Subject: [PATCH] Replace multiple pal calls with a single pal-table call, or some pokes. (#5) Reviewed-on: https://git.chromaticdragon.app/pyrex/chameleonic/pulls/5 Co-authored-by: Kistaro Windrider Co-committed-by: Kistaro Windrider --- chameleonic.p8 | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/chameleonic.p8 b/chameleonic.p8 index 993918b..c4b8259 100644 --- a/chameleonic.p8 +++ b/chameleonic.p8 @@ -663,16 +663,18 @@ function player:draw() local setpal=function() -- base colors - pal(13,TAIL) - pal(14,TAIL) - pal(15,TAIL) - pal(4,BODY) - pal(5,BODY) - pal(12,BODY) - pal(2,HEAD) - pal(3,HEAD) - pal(9,IRIS) - pal(10,PUPIL) + pal{ + [2]=HEAD, + [3]=HEAD, + [4]=BODY, + [5]=BODY, + [9]=IRIS, + [10]=PUPIL, + [12]=BODY, + [13]=TAIL, + [14]=TAIL, + [15]=TAIL, + } -- vanish colors local vanish=split"13,15,14,5,4,12,2,3,9,10" @@ -681,7 +683,9 @@ function player:draw() end if self.fall_frame>3 then - for i=0,15 do pal(i,1) end + local zc=@0x5f00&0xf0 + for i=0x5f00,0x5f0c,4 do poke4(i,0x0101.0101) end + poke(0x5f00,zc|0x01) end end