jobe [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=30542 Code within an if clause consumes cycles even if the conditional isn't met <p>I have this bit of code:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> if f==1635 then sspr(0,32,128,64,64,64) sspr(0,32,128,64,-64,64,128,64,true,false) sspr(0,32,128,64,-64,0,128,64,true,true) sspr(0,32,128,64,64,0,128,64,false,true) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>which causes the CPU load in a demo I'm working on to go over 1.0, even when f!=1635. If I comment out the sspr functions, the demo runs at 60fps. Is this speculative execution as planned, or is this a bug?</p> <p>EDIT: I was able to drop the CPU load back under 1.0 by doing it as a separate function, like this:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>function drawthese() sspr(0,32,128,64,64,64) sspr(0,32,128,64,-64,64,128,64,true,false) sspr(0,32,128,64,-64,0,128,64,true,true) sspr(0,32,128,64,64,0,128,64,false,true) end ... if f==1635 then drawthese() end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> https://www.lexaloffle.com/bbs/?tid=33640 https://www.lexaloffle.com/bbs/?tid=33640 Fri, 15 Mar 2019 11:31:45 UTC Techno-utopian Edict <p> <table><tr><td> <a href="/bbs/?pid=62464#p"> <img src="/bbs/thumbs/pico8_techno_utopian_edict-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=62464#p"> Techno-utopian Edict</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=62464#p"> [Click to Play]</a> </td></tr></table> </p> <p>Demo for the demo competition at the Instanssi 2019 demoparty, held in Jyv&auml;skyl&auml;, Finland in march 2019. Won first place.</p> <p>Again, it <em>might</em> run correctly in a browser but there might also be some sync issues (specifically in Chrome, in my experience). The cart runs just fine in PICO-8 itself, of course.</p> <p>UPDATE: Now fixed for 0.1.12! Which means it won't run correctly in older versions anymore, since it depends on time() for sync.</p> https://www.lexaloffle.com/bbs/?tid=33486 https://www.lexaloffle.com/bbs/?tid=33486 Sun, 03 Mar 2019 18:30:59 UTC Rock for Metal <p> <table><tr><td> <a href="/bbs/?pid=55718#p"> <img src="/bbs/thumbs/pico8_rockformetal-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=55718#p"> Rock For Metal</a><br><br> by <a href="/bbs/?uid=30542"> jobe</a> <br><br><br> <a href="/bbs/?pid=55718#p"> [Click to Play]</a> </td></tr></table> </p> <p>A demo by Jumalauta. Participated in the demo compo at the JML 18 years anniversary demoparty, won first place.</p> <p>Might not work properly with Chrome, there may be some sync errors and glitches. Should work consistently with Edge. Cart works just fine in the PICO-8 application itself, of course.</p> <p>UPDATE: Now fixed for 0.1.12! Which means it won't run correctly in older versions anymore, since it depends on time() for sync.</p> https://www.lexaloffle.com/bbs/?tid=31747 https://www.lexaloffle.com/bbs/?tid=31747 Sun, 26 Aug 2018 11:16:11 UTC