-- 256-colors rehashed -- i think this is as fast as -- i can get the code. -- you will notice that the -- loop only moves a section -- of memory per frame now. mode=0 p=0 cls() function _update60() p=1-p if mode==0 or mode==1 then sfx(0) -- confirm drawing fillp(23130) if(p>0)fillp(-23131) for i=0,15 do for j=0,7 do rectfill(i*8,j*8,i*8+7,j*8+7,i+j*16) end end if mode==0 then memcpy(0,24576,4096) mode=1 elseif mode==1 then memcpy(4096,24576,4096) mode=2 end else if p==0 then memcpy(24576,0,4096) else memcpy(24576,4096,4096) end end end
This is a puzzle. If you let it run for about 10-seconds, it DOES clear up and show you a near flawless 256-colors using memory swap of two half-screens - but it doesn't stay. After another 10-seconds it garbles, then fixes itself again. But does not stay.
I had hoped by removing the loop for redrawing the colors and writing a loop of memory moves only would speed it up, but apparently it still can't perfectly synchronize.
I noticed online (running in an internet window) it seems to run better with less flicker, so something good is happening there.
Can some Coding Wizard figure out how to get this to run flawlessly (in IDE and as EXE) each time with no period of it messing up ? I think this could be of use to others as it would mean more colors for opening logos to PICO-8 carts.
I'm using this method to get a new blue on the title screen of the game I'm currently testing out. It seems no matter how simple I try to make things it will always stutter a bit. I put in some code to detect when the game isn't running near 60fps to stop the effect which helps slightly. I too am curious about what can be done to keep things more consistent.
[Please log in to post a comment]