-- 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.
Still hurts my eyes to look at, so still unusable.
The best suggestion I've heard was to add to PICO-8 a simple memory location that when poked, blends the next frame on top of the previous one.
@dw817 I meant as a feature request to add to PICO-8. It doesn't exist yet :)
Oh darnit, but yeah, whatta good idea. I can definitely see that, run at 60fps, play back at 30fps with color merges.
I have a list of suggestions I'm working on HERE. Will definitely add yours now:
@dw817 i kind of like how there is tiny glithes, but my eyes dont(.
also i used fillp(-23131) pattern in my game, i hope its ok.
Hi @ioil13.
I have since succeeded this method:
https://www.lexaloffle.com/bbs/?pid=102333
And yes, you are welcome to any of my code with my thanks. :)
Sorry if this comes in a little late, @Xii. But someone after my own heart:
[Please log in to post a comment]