zep [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=1 GIFs and Postcarts <p><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/postcart300.gif" width=0 height=0 alt="" /><a href="https://www.lexaloffle.com/bbs/?pid=156452#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/kitty_loves_twisters.gif" width=256 height=256 alt="" /></a><a href="https://www.lexaloffle.com/bbs/?pid=156075#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/9551/squishy_77.gif" width=256 height=256 alt="" /></a><a href="https://www.lexaloffle.com/bbs/?pid=156347#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/43011/zx_0.gif" width=256 height=256 alt="" /></a></p> <p>// by <a href="https://www.lexaloffle.com/bbs/?uid=9551"> @kittenm4ster</a> and <a href="https://www.lexaloffle.com/bbs/?uid=43011"> @Minion</a></p> <p>The <a href="https://www.lexaloffle.com/bbs/superblog.php?mode=gifs">GIF Gallery</a> is a new corner of the BBS where GIFs &amp; postcarts can be shared as separate items and live forever&sup1; in their uncompressed glory. Each profile page has its own GIF section, and there is a separate gallery for just the postcart GIFs:<br /> <a href="https://www.lexaloffle.com/bbs/superblog.php?mode=gifs&amp;postcarts=1">https://www.lexaloffle.com/bbs/superblog.php?mode=gifs&amp;postcarts=1</a></p> <p>GIF posts don't show up in thread activity lists, so adding many separate GIFs is fine. I think it will be useful for things like tiny dev updates that are too small to be bloggy, gameplay captures, and archiving old tweetcarts. And of course some wee experimental ideas only really need to live as a gif rather than a whole cart. GIFs do show up in the <a href="https://www.lexaloffle.com/bbs/superblog.php">superblog feed</a>, and can be pinned to your profile page.</p> <p>Click <a href="https://www.lexaloffle.com/bbs/?add_gif=1">[here]</a> to add a GIF. You can capture from any lexaloffle fantasy machine using ctrl-8, ctrl-9, or shift-ctrl-8 in Picotron to select a more squareish region.</p> <h1>Postcarts</h1> <p>Postcarts are tiny programs (300 chars or less), and can live on social media (#postcart on <a href="https://mastodon.social/tags/postcart">mastodon</a> and <a href="https://bsky.app/search?q=postcart">bluesky</a>), and now also the BBS: just include a code snippet when <a href="https://www.lexaloffle.com/bbs/?add_gif=1">posting a gif</a> and the code size and postcart tag are automatically added:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/postcart300.gif" alt="" /> <p>wish you were here</p> <p>(300 chars)</p> <div> <div class=scrollable_with_touch style="width:100%; 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> ::_::⧗=256for x=0,⧗ do line(x,0,x-⧗,⧗,({12,7,8})[1+x\4%4])end memset(25088,119,7168)pal(0,7,1) ?&quot;\-f\^.⁘&gt;⁘&gt;⁘\0\0\0postcart\n\|j\-h300 chars&quot;,0,14,0 for n=0,799do x=n%40y=n\40 if(pget(x,y+10)&lt;1)?chr(16+((y/3+x/2-t()*4)%6)),7+x*3,26+y*3,4 if(n&lt;23)?chr(16+(n+t()*8)%8),8+n*5,20+n%2*82,6 end flip()goto _ </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>// Don't worry, that code is not really meant to be readable.</p> <p>I miss making <a href="https://twitter.com/search?q=%23tweetcart">tweetcarts</a>, but don't feel particularly excited to make them for twitter anymore. Postcarts are an attempt to offer something in the same spirit, but that is platform independent and relatively eternal&sup1;. After experimenting with a few sizes, I think 300 is fun to work with and a sweet spot in that neighborhood of round numbers. It is also nice that old tweetcarts can be reposted as-is to the BBS, and by sheer coincidence bluesky posts are 300 characters and use the same character counting as PICO-8 (🐱 is 1 char).</p> <p><a href="https://www.lexaloffle.com/bbs/?pid=156357#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/24137/terrplot_0.gif" width=256 height=256 alt="" /></a><a href="https://www.lexaloffle.com/bbs/?pid=156286#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/10258/tweet_2024-10-10_0.gif" width=256 height=256 alt="" /></a><a href="https://www.lexaloffle.com/bbs/?pid=156242#p"><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/rainbow_loop_1.gif" width=256 height=256 alt="" /></a></p> <p>// by <a href="https://www.lexaloffle.com/bbs/?uid=24137"> @luchak</a> and <a href="https://www.lexaloffle.com/bbs/?uid=10258"> <a href="https://www.lexaloffle.com/bbs/?uid=10258"> @AndyMakes</a></a></p> <p>Bluesky doesn't support uploading gifs directly but you can use something like <a href="https://cloudconvert.com/gif-to-mp4">cloudconvert</a> to generate an mp4. Mastodon does convert automatically from gif, but the default quality is quite bad. If you are new to bluesky or the fediverse, don't forget you can find other lexaloffle folk via the superblog offsite pages: <a href="https://www.lexaloffle.com/bbs/superblog.php?cat=-3&amp;suggest_follows=bluesky">https://www.lexaloffle.com/bbs/superblog.php?cat=-3&amp;suggest_follows=bluesky</a></p> <p>If you're new to the world of size coding, you might light to check out <a href="https://www.lexaloffle.com/bbs/?uid=16330"> @2darray</a>'s article on <a href="https://demoman.net/?a=optimizing-for-tweetcarts">tweetcart optimisations</a>, <a href="https://www.lexaloffle.com/bbs/?uid=43694"> @PrincessChooChoo</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=37886">Guide for Making Tweetcarts</a>, and <a href="https://www.lexaloffle.com/bbs/?uid=11047"> @TRASEVOL_DOG</a>'s <a href="https://trasevol.dog/2018/01/24/di20/">doodle insights on how to make a twister</a>. For more examples of what kind of programs are possible, check out <a href="https://www.lexaloffle.com/bbs/?uid=37618"> @Munro</a>'s cart-ized <a href="https://www.lexaloffle.com/bbs/?tid=39199">tweetcart collection</a>.</p> <h1>Physical Postcards</h1> <p>If you squint, postcarts and postcards are a really similar format! A nice picture on the front coupled with a short message that describes it / some short text.</p> <p>If the postcarts collection becomes large enough over time, I'd love to print a bunch of them to display at <a href="https://www.picopicocafe.com">Pico Pico Cafe</a> (the place PICO-8 was named after and developed inside). The postcards would be square with a screenshot on the front and code on the back, and can be viewable on a special machine that scans the code and runs it. So it would feel a bit like thumbing through vinyls and choosing one to put on a record player.</p> <p>If you would your postcart to be included in that collection, there is a checkbox for that while submitting. The more postcarts the merrier!</p> <h1>Thanks!</h1> <p>These projects were inspired by <a href="https://www.lexaloffle.com/bbs/?uid=10258"> <a href="https://www.lexaloffle.com/bbs/?uid=10258"> @AndyMakes</a></a>' <a href="https://twitter.com/wondervillenyc/status/1369020502832996364">tweetcart gallery</a> at <a href="https://www.wonderville.nyc/">Wonderville in Brooklyn</a>, <a href="https://www.lexaloffle.com/bbs/?uid=13953"> @Adam Atomic</a>'s OG <a href="https://www.lexaloffle.com/bbs/?tid=3726">tweetjam thread</a>, the amazing world of <a href="https://twitter.com/search?q=%23tweetcart&amp;amp;src=typed_query">tweetcarts</a> that many folks have created over the years, and <a href="https://www.lexaloffle.com/bbs/?uid=13822"> @Liquidream</a>'s excellent <a href="https://mastodon.gamedev.place/@Pico8TweetCarts">tweetcart archival account</a> on mastodon.</p> <hr /> <p>&sup1;by modern internet standards</p> https://www.lexaloffle.com/bbs/?tid=145008 https://www.lexaloffle.com/bbs/?tid=145008 Sat, 02 Nov 2024 11:01:48 UTC Jar Life <p> <table><tr><td> <a href="/bbs/?pid=155392#p"> <img src="/bbs/thumbs/pico8_jarlife-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=155392#p"> Jar Life</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=155392#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Controls</h2> <p>Z/C to jump<br /> X to bunch up / hoist / throw</p> <p>Save 4 creatures in each room to progress to the next level (not everyone needs to make it out alive!). Grab a key to open the door, but the player can not enter until 4 creatures have passed through. To restart at any time, press ENTER and choose &quot;restart level&quot;.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/jarlife-1_0.gif" alt="" /> <hr /> <p>Made for Ludum Dare 56. You can find the jam page (and play the compo version) here: <a href="https://ldjam.com/events/ludum-dare/56/jar-life">https://ldjam.com/events/ludum-dare/56/jar-life</a></p> <h2>Changes</h2> <p>jarlife-0: ldjam compo version</p> <p>jarlife-1: added 'x to retry' when there are no longer any creatures left to save, but less than 4 have exited and the player is still alive.</p> https://www.lexaloffle.com/bbs/?tid=144631 https://www.lexaloffle.com/bbs/?tid=144631 Sun, 06 Oct 2024 22:06:12 UTC BLORB <p> <table><tr><td> <a href="/bbs/?pid=155243#p"> <img src="/bbs/thumbs/pico8_blorb-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=155243#p"> BLORB (pico-1k)</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=155243#p"> [Click to Play]</a> </td></tr></table> </p> <h2>BLORB LIKES CANS. GET CANS!</h2> <ul> <li>DPAD / Cursors to Move</li> <li>Hold X to Grab / Retract</li> <li>Retract all the way back to the portal to collect a can. </li> <li>You only get 1 life ~ CTRL-R to restart if you crash (or open the menu with ENTER).</li> <li>There is no sound in space (I mean .. there is no space for sound)</li> </ul> <p>Good luck! </p> <p>This is a game made in 1024 bytes for <a href="https://itch.io/jam/pico-1k-2024">PICO-1k Jam 2024</a>, co-designed and pixelled by <a href="https://www.lexaloffle.com/bbs/?uid=11378"> @castpixel</a> (<a href="https://twitter.com/castpixel">twitter</a>). It is our third production as POD Design; you can find the first two <a href="https://www.lexaloffle.com/bbs/?pid=98017">here</a> and <a href="https://www.lexaloffle.com/bbs/?pid=76564">here</a>. BLORB is also up on <a href="https://castpixel.itch.io/blorb">itch</a> and has a <a href="https://itch.io/jam/pico-1k-2024/rate/3008293">PICO-1K entry page</a>. Thanks as always to <a href="https://www.lexaloffle.com/bbs/?uid=13822"> @Liquidream</a> for running this great jam, and <a href="https://www.lexaloffle.com/bbs/?uid=29645"> @thisismypassword</a> for the invaluable <a href="https://thisismypassport.github.io/shrinko8/">Shrinko8</a>!</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/blorb_1k.gif" alt="" /> <p>blorb.p8.rom as a hexdump because it looks good:</p> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <div> <div class=scrollable_with_touch style="width:100%; 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>0070786105BB0400679E73C731C1D945707074C8D9497742141C1A2597DCDEBC 45D01C52BC46707CF302C5EDC50B14D715E715A7B69670383682B208CEBB64EE AAE2F866B4BC29BD6AA31C8B8E7F868DABCE9AE89AE4C0F2BE2C4BDBF2B4666E 69B019386FC425F179A9CB8EEB268220BFEDBA859D8DE4B8A88CA28DBABC3090 0A30FEB599D6F969A35134138503D181DA02D72D8F6503D3DDDA92179AB16CA2 EA5E41A5247C878D577880DD7E6EE78047588DAA3AF0A14A48B8FB0ED5FEE45E B7679438AAA3A99DB5B5E8869D51F324499034F50171A521B0B7B03532353072 433C953D435C365DB6B1536D36FDEEC246323B508665D8471375BCBBDCF6ABE3 AB7B615FE7775655DC36CD76DA56ABAB6353132B9B03537511E52E595A991D6A E7E35051602508BA7AEA01B215B980602AEB3D3DE6798C9613531341D0DD3A96 0FA4F909B5C1F388A3491079D501C5875027E73DFC15AFBF168C67ED1D497084 03DAE484E2615F7FA04A0FEBBAA70E74C2EA7A6DF95DAB76E50DAF6A1F310B26 EBC601D3EB4DFC364F1DBEE1238E545B5530EAB93258AF82377BC0E5ADE8A9CB E01CEDA0174A373D91BD5138B5E699951BC3AFA0B8BF485FAD0D6E8BE3627820 085E69AE6EEF1C4E9B6065E2E82B0EF5E4CE5CD7A7DB4DD00C948FB1B138927B 6265280D16EB3A8FBA3A5C1A8BE381D1EED13C35355CD7611C44B393CDF31606 18F2D405E1B379E28289EC213AAD813C0E8766E50D740792A581F2020994AACB 5407868A8DD5AE09A6363265C431175D7F40163CEFD619A744F78C0DDC14ECDC D31EA528719A5CCB55575D75DA758D74437EC085D75E1645656F8385FAB8CB4E DD5C896F947C5C9958BA343B315F884D70C62DE585136755EB971D51574A14BA 56FD52385296A76C65CFB3725771E3EA9242DCD48E9A43B038D48DA9508EBE4D F938D58D071FBC939F3193094708BE0C2C07D97615EF88D814D76AEDD8616E29 5EEA06EBB11336A3A9209209D91C789DF524985F0E8281300876F2D6056D2310 FE2C18402164A091A5EA956866E281F0C67847E3A02DE34387D75DEFECD46E6E 627523D82BD774A9AA8963B3C4340B61335FCEB9DE8D56C096AD7A990D476B05 099FED7451311E6A636C647B4349B62550944F4517A49BDDCED68C11FA68A128 DACBC6F270A290CF52321061288ABC7FACE92B92224E8502EAC952ADC41BCE88 9A215116EF46CD905FD65548723D0D9D8E81E1313D820B3686E2D8D58A2D5D37 32578C0E559BF3C1DCFCC6EAD071D979238F55314C502EC52074B6546EECEECA 9544D18D1B6973C85CAA50309D85FA666639C45E91FDBFC1F08062573D657050 7DC05359A48620187246718360C08E07469A7CCD917ED540504CCD9BC9BC974C A08320494485866C612FEC5490ED960C5791F689CEC05E61925E49204EB4A722</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> <p>There are comments in the source code of blorb-1 (use the &quot;Code&quot; pulldown under the cart player above). For the minified 1024 byte version: &gt; LOAD BLORB-0</p> <h1>Technical Notes</h1> <p>As usual, to get this to fit in 1k some entertaining hackery and ugly code was required:</p> <ul> <li> <p>A single loop is used to draw the nebula, stars and to decode the gfx from a string. The nebula lines are sometimes drawn over stars, making them twinkle -- a happy accident.</p> </li> <li> <p>One more loop is used to draw both the spacejunk and the chain segments. So the chain can never be longer than the maximum number of rocks / aliens.</p> </li> <li> <p>The eye of each alien is just the last drawn foot duplicated 10 pixels higher.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/blorb_junk.gif" alt="" /> </li> <li> <p>A pixel under the player is sampled for colissions (colours 8~15). There are no &quot;Objects&quot; -- aliens only exist as drawn pixels.</p> </li> <li> <p>The same pixel is also tested when adding a new chain segment. If it is already the colour of the chain (4), the add() is skipped. So the shape of the segment character determines how frequently segments are added, and the retraction speed.</p> </li> <li> <p>The graphics are stored as a 320 character string, where each byte encodes 2 bytes in the spritesheet; bits 0xff are split into bits 0x3333. 44 is added to each encoded byte to get it to compress better. Less escape codes like \0 are needed in the string, and +44 happens to give a distribution of values that compress better with the surrounding code. Mistakes in the decoder produced many beautifully grotesque results like this one:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/blorb_corrupted.png" alt="" /> </li> <li> <p>The portal radius (pr) has many meanings: it is used for the chain colour so that it fades out as the portal opens and closes, and is used to determine the state of the game (large == playing, 0 == finished level, 0.1 == died). The player sprite colours are also set to the portal radius when colliding, so that it looks like it is getting sucked in and then eventually becomes hidden. Some alternative portals with varying byte costs:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/blorb_portals.gif" alt="" /> </li> </ul> https://www.lexaloffle.com/bbs/?tid=144570 https://www.lexaloffle.com/bbs/?tid=144570 Thu, 03 Oct 2024 16:57:02 UTC PICO-8 0.2.6 <p>Hey All! PICO-8 0.2.6b is up now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a> and web (<a href="https://pico-8-edu.com">Education Edition</a>). Note: you'll need to update to 0.2.6b to play new carts and SFX snippets created in 0.2.6!</p> <h1>Inverted Draw Operations</h1> <p>Thanks to <a href="https://www.lexaloffle.com/bbs/?uid=28958"> @p01</a> for nudging me about this one! Filled draw operations (circfill, ovalfill, rectfill) can now be drawn inside-out: every pixel outside the area is drawn instead of every inside pixel. This can be controlled in a way similar to setting the fill pattern per draw call: first <code>poke(0x5f34,0x2)</code> to enable inverted draws, and then set bits 0x1800 in the colour argument. Here is a snippet to blank out everything except a circle in the middle (that changes size):</p> <div> <div class=scrollable_with_touch style="width:100%; 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>poke(0x5f34,0x2) circfill(64,64,50+cos(t()/4)*10,0 | 0x1800)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/jelpi_circ_0.gif" width=384 height=384 alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/inv_draw_circs.gif" width=384 height=384 alt="" /></p> <p>And a short program that draws a tunnel:</p> <div> <div class=scrollable_with_touch style="width:100%; 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 _draw() cls() poke(0x5f34,0x2) -- hold ❎ to skip fill cc = circfill if (btn(❎)) cc = circ for z=7,1,-1 do local sx = cos(z/15+t()/4) * 50 local sy = sin(z/15+t()/4) * 50 cc(64+sx/z,64+sy/z,64/z, 7+z | 0x1800) end end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h1>High Memory Video Mapping</h1> <p>Before 0.2.6, display memory and spritesheets could be mapped to each other (at 0x0000, and 0x6000). They can now also be mapped to one of the four high 2k sections at 0x8000, 0xa000, 0xc000, and 0xe000, as long as they don't overlap with the map mapping which takes precedence. There is a nominal cpu cost when a mapped region changes between graphics and map, but otherwise changing mappings is &quot;free&quot; apart from the poke() call overhead.</p> <p>This was a previously rejected wishlist feature, but due to a <a href="https://www.lexaloffle.com/bbs/?pid=130832#p">bug</a> discovered (and rightly abused!) by <a href="https://www.lexaloffle.com/bbs/?uid=25119"> @StinkerB06</a>, it seemed proper to offer this as a substitute before that bug is &quot;fixed&quot; in a future version. Well played!</p> <p>Here's an example of moving the spritesheet to 0x8000 so that 0x0 can be used for something else. Just a reminder of a confusing gocha: remapping the spritesheet remaps the whole memory area 0x0..0x1fff. So once @0x5f54 is set to e.g. 0x80, even memory functions like memcpy, memset that operate on 0x0..0x1fff will be operate on 0x8000..0x9fff.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>-- copy spritesheet to 0x8000 memcpy(0x8000,0x0,0x2000) -- clear spritesheet at 0x0 to prove it is no longer used! memset(0x0,0,0x2000) -- remap spritesheet to 0x8000 poke(0x5f54,0x80) -- draw something to prove it worked spr(1, 50,50)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h1>Waveform Instruments</h1> <p>Waveform instruments work roughly the same as SFX instruments: they each take up one SFX slot worth of data (SFX 0..7), and can be triggered from a regular SFX. But instead of treating the 64 bytes of note data as a regular SFX, they are used to represent 64 8-bit samples of a short looping waveform. Click on the new toggle button at the top right of the SFX editor to draw a waveform, and optionally pitch it an octave down with the &quot;bass&quot; toggle button. Waveform instruments can be used from inside SFX instruments, and also observe the detune, reverb and dampen filters.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/waveform_editor.png" alt="" /> <p>Here are a couple of short demos (excuse the new WIP player -- it needs an initial tap to load it for browser compatibility). The first pattern shows some custom bass and lead instruments that are quite different from the built-in waveforms. Patterns 2&amp;3 are more subtle, but those two instruments are also quite tonally different from any of the standard ones.</p> <p> <iframe src="sfxp2.php?id=1_6" width="402" height="300" style="border:none; overflow:hidden" scrolling="no" allow="autoplay"></iframe><a style="cursor:pointer; font-size:8pt" onclick=' var el = document.getElementById("sfxcode_1_6"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("/bbs/sfxc/1_6.txt", function (retdata){ var el = document.getElementById("sfxcode_1_6"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [sfx] </a> <textarea rows=3 class=lexinput id="sfxcode_1_6" style="width:480px;background-color:#fed;display:none;overflow:hidden; font-size:4pt;"></textarea> </p> <p>I think that doodling custom waveforms is great fun and opens up a new world of possibilities, but of course that in itself does set off alarm bells in terms of fantasy console design. I've come to view them as a worthwhile source of complexity that feels playful rather than overwhelming, and without creating a discontinuous jump in the &quot;PICO-8 sound&quot;. Having said that, I'm sure I'll look back one day at earlier PICO-8 music with nostalgia for its particular simple charms. Here's a fitting tune by <a href="https://www.lexaloffle.com/bbs/?uid=44175"> @ridgek</a> to send off the old version!</p> <p> <table><tr><td> <a href="/bbs/?pid=137660#p"> <img src="/bbs/thumbs/pico8_fairwellfairfriend-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=137660#p"> Farewell, Fair Friend 🎈</a><br><br> by <a href="/bbs/?uid=44175"> ridgek</a> <br><br><br> <a href="/bbs/?pid=137660#p"> [Click to Play]</a> </td></tr></table> </p> <h1>Music Scale Snapping</h1> <p>A low-key (ha!) feature of PICO-8 since very early on is that holding CTRL while drawing frequencies snaps each note to the C minor pentatonic scale. This is useful for both sound effects and music -- you can't really go wrong walking up and down (or jumping around) those 5 notes.</p> <p>In 0.2.6, the scale that is snapped to while holding CTRL can now be customized in the music editor. There is a toggle button at the bottom right to switch between volume and scale snapping. Click on the keyboard to toggle scale selection mode. There are two buttons for transposing (&lt;&lt;, &gt;&gt;), 3 preset scales, and an invert button to get 3 more:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>Dim Diminished 7th // invert to get a whole-half scale Maj Major scale // invert to get pentatonic Who Whole tone scale // invert to get.. the other whole tone scale</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Changing the scale does nothing to alter the existing SFX -- it is applied only when holding CTRL and drawing frequencies.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/scale_snapping.png" alt="" /> <h2>A Little Music Theory</h2> <p>What is a scale anyway? Very roughly speaking, it is a selection of notes that are chosen to have a particular character or mood when used together. You might already be familiar with the scale formed by all of the white notes on a piano (or using keys qwertyu in PICO-8): C Major. Hit the <code>Maj</code> preset button to select this scale, and hold down CTRL to doodle a sound (spd:1) or melody (spd:16) in frequency mode.</p> <p>Inverting the major scale (hit <code>Inv</code>) gives an Eb minor pentatonic scale, which is another name for all of the black notes. Try doodling some shapes again, and see how different that sounds. I think pentatonic scales are the most useful for starting out with melodies and sound effects, with its bright, resonant sound. To get from Eb minor pentatonic back to the default C minor pentatonic scale, hit <code>&lt;&lt;</code> 3 times to transpose down 3 semitones. Examples of major and pentatonic scales are given in the first 2 patterns:</p> <p> <iframe src="sfxp2.php?id=1_7" width="402" height="300" style="border:none; overflow:hidden" scrolling="no" allow="autoplay"></iframe><a style="cursor:pointer; font-size:8pt" onclick=' var el = document.getElementById("sfxcode_1_7"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("/bbs/sfxc/1_7.txt", function (retdata){ var el = document.getElementById("sfxcode_1_7"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [sfx] </a> <textarea rows=3 class=lexinput id="sfxcode_1_7" style="width:480px;background-color:#fed;display:none;overflow:hidden; font-size:4pt;"></textarea> </p> <p>The other two scale presets also have their own distinctive character, with examples above in patterns 2..4. <code>Who</code> for a wholetone scale (every second semitone -- pattern 2), gives a floating ethereal feeling. Good for things like &quot;falling down a hole&quot; or &quot;found a secret level&quot;. <code>Dim</code> for a 4-note diminished 7th scale (every third semitone -- pattern 3) gives something more unresolved (&quot;entering a hidden chamber&quot;, or &quot;a boss appears&quot;). Inverting the diminished scale gives the whole-half diminished which has an even more mysterious quality that is more like &quot;that lever triggered something but we don't know what it is yet&quot;.</p> <p>These are oversimplified and silly examples, but I hope it gives you an idea of the kind of things you can explore with scales! If you'd like to know more, I highly recommend <a href="https://www.lexaloffle.com/bbs/?uid=11292"> @Gruber</a>'s <a href="https://www.youtube.com/watch?v=Zg483HJ6rtM&amp;amp;list=PLur95ujyAigsqZR1aNTrVGAvXD7EqywdS&amp;amp;index=11">tutorial series</a> that has a lot of handy music theory weaved in and also <a href="https://www.lexaloffle.com/bbs/?uid=49583"> @bikibird</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=53972">interactive music theory tutorials</a>.</p> <h1>Handheld Improvements</h1> <p>With the rise of handheld devices like the <a href="https://youtu.be/KTb6ik1Eb40?si=f2_pPYQOZdf9fUSC&amp;amp;t=2028">RGB30</a> and <a href="https://www.youtube.com/watch?v=0ztXYZReSRw">Miyoo Mini Plus</a>, there are many more handheld users of PICO-8 now (welcome aboard!). 0.2.6 has a few adjustments to make life easier:</p> <h3>Metadata Mending</h3> <p>When favouriting a bbs cart in 0.2.5g using the typical RGB30 / MM+ configuration, it was showing up as a local file with no metadata (blue cart icon instead of orange). Not a huge problem, but those carts can not show their full title, author and lose the ability to auto-update and find similar carts.</p> <p>0.2.6 fixes that bug, and also deals with those carts by pinging the bbs for metadata when they are opened. So to &quot;mend&quot; such a bbs cartridge that has a blue label in the favourites list, just open it once while wifi is enabled.</p> <h3>merge_joysticks</h3> <p>This is an option in config.txt, that treats the first n controllers as if they were a single merged controller. This is useful in situations where you want to use the built-in buttons on a handheld device, but then later plug in a controller (e.g. when you connect it to a TV), but want that controller to also be used for the same player. To set up PICO-8 for such a system, use <code>merge_joysticks 2</code> in config.txt.</p> <h3>Shutdown from Options</h3> <p>You can now close PICO-8 from the options menu while playing a game. This is handy for devices that do not have a 'kill app' option / button combination. Previously it was necessary to first exit to splore, then open a cartridge menu and use the options menu from there.</p> <h1>Miscellaneous</h1> <h3>Mac Universal Binaries</h3> <p>PICO-8 now ships with native support for Apple silicon, as well as intel versions bundled as a universal binary. The exporters produce executables in that same universal format. To do this, I had to bump the minimum required MacOS to 10.8. I know there are still a few of you out there using PICO-8 on older Macs that will otherwise become doorstops. I don't have a good solution for this yet, but later on I'll look at setting up a legacy build system for such machines if there is sufficient demand.</p> <h3>Menuitem Button Filtering</h3> <p>By default, pause menu items creating using menuitem() respond to any button press, including left and right. This is handy in some situations (toggle buttons) but annoying or dangerous in others (clear game data). menuitem() can now take a bit mask in the high bits of the first parameter, indicating which button presses to ignore. Bits 0x100 and 0x200 mean LEFT and RIGHT, so if you can ignore those button presses with:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>menuitem(0x301, &quot;option 1&quot;, my_callback)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h3>Improved Search</h3> <p>The search box in splore and on the bbs now returns more sensible results. Posts are sorted by number of stars, so if you type in &quot;celeste&quot;, the first two results will be the original Celeste and Celeste 2. Imagine that! As a side-effect hack, you can search for &quot; &quot; and get an all-time highest starred cartridges list.</p> <p>While working on search and scanning the BBS for preprocessor breakage, I made this collage of the 14 pages of featured cartridges that are now available (out of around 18k published carts). W00t! \o/</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/bbs_14pages_half.jpg" alt="" /> <h3>Preprocessor Removal</h3> <p>This is an internal change, but worth mentioning. 0.2.6 no longer uses a preprocessor at all (thanks to z8lua), so all of the code is running through a (modified) Lua 5.2 implementation as-is. Most of this happened in 0.2.5*, but there were a few leftover language features like short form print (using ?) and number parsing. 0.2.6 now also allows the use of &quot;do&quot; instead of &quot;then&quot; in if statements, which is something the preprocessor allowed (by accident!) and a number of early carts use it. There is a small amount of breakage of older carts that have things like unclosed or otherwise ill-formed comments that shouldn't be accepted. For those types of cases, I'm gradually working through older carts to make stealth fixes where needed. At this point the vast majority of existing carts should run as expected -- please do let me know if you see something weird that isn't a syntax error, which I can scan the BBS for automatically.</p> <h3>Socials</h3> <p>There are 2 new social usernames addable to your BBS profile: <a href="https://twitch.tv">twitch.tv</a>, and <a href="https://bsky.app">bluesky</a> which is now open for signups without an invite. My social network of choice is still the fediverse / mastodon, but I think bluesky has the potential to coexist and be a nice place in the future ~ especially if they end up supporting gifs.</p> <p>-&gt; <a href="https://www.lexaloffle.com/settings.php">Add social handles to your profile</a></p> <p>-&gt; <a href="https://www.lexaloffle.com/bbs/superblog.php?suggest_follows=bluesky">Find other lexaloffle users on bluesky / twitch</a></p> <h1>Changelog</h1> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> v0.2.6b</p> <p>Added: 2 more players worth of mappable keyboard controls in config.txt (button_keys)<br /> Changed: finished removing preprocessor; was causing e.g. &quot;function --[[oops]]f() end&quot;<br /> Changed: &quot;do&quot; can be used instead of &quot;then&quot; // a bunch of older carts were able to do this via preprocessor<br /> Changed: removed CTRL-O as a way to open the cpu profiler so that custom devkit carts can use it<br /> Fixed: When bbs carts folder is inside root_path, opening favourite while offline clobbers item metadata<br /> Fixed: Missing metadata for favourited carts; bbs is pinged to grab metadata and splore item is mended on play<br /> Fixed: save() / export() called from headless script on existing file only overwrites every second file<br /> Fixed: pasting music pattern data does not recreate sfx instruments that do not already exist in target cart<br /> Fixed: Format string when exporting .wav is unstable / insecure<br /> Fixed: bad block scope caused by nested short forms e.g. if (1)?&quot;foo&quot; // #dinkykong, /bbs/?tid=140066<br /> Fixed: &gt;&gt;&lt;=, &lt;&lt;&gt;= operators missing (from 0.2.5d)<br /> Fixed: atan2(1, 0x8000) returns 0.25 (should be 0.75)<br /> Fixed: audio crackling on Miyoo Mini Plus (regression in 0.2.6, but unreleased)</p> <p>v0.2.6</p> <p>Added: Custom waveform instruments<br /> Added: Configurable scales in music editor (for using ctrl to snap to scale)<br /> Added: Inverted draw operations<br /> Added: Video and spritesheet memory addresses can be mapped to 0x8000, 0xa000, 0xc000, or 0xe000<br /> Added: stat(111): same as stat(109) except returns a higher value on web to overfill audio and reduce crackle<br /> Added: menuitem(0x300|index, ...) ignores left and right button presses. 0x7000 to ignore X/O/MENU.<br /> Added: config.txt &quot;capture_timestamps 1&quot; to use timestamps as suffix in screen/video capture filenames<br /> Added: (Mac) Universal binaries, also generated when exporting<br /> Added: (Mac) Updated to SDL2 2.28.5 (-&gt; minimum MacOS version is now 10.7)<br /> Added: config.txt:merge_joysticks to map n controllers to a player (e.g. to plug a gamepad into a handheld)<br /> Added: config.txt:use_wget to use wget for downloads instead of libcurl (wget must be installed)<br /> Added: SHUTDOWN PICO-8 from the options menu while running a cartridge in -splore mode<br /> Added: Preserve window position and size when switching to and from fullscreen mode<br /> Changed: ADD(TBL, X, NIL) now behaves the same as ADD(TBL, X) (used to produce an out of bounds error)<br /> Improved: Moved internal globals out of top level to improve vm perf on carts with no _draw()<br /> Improved: Boot time and memory usage reduced on low end machines<br /> Fixed: 0x808 audio produces buzz on web browsers that mix at 48000MHz (ref: #rp8, #waterflakes)<br /> Fixed: When bbs carts folder is inside root_path, favourited carts show up as local files without titles<br /> Fixed: (from 0.2.5d) compound operators (a+=1) cost more than their expanded equivalents (a=a+1)<br /> Fixed: cstore out of range when storing to self while running a bbs cart causes segfault<br /> Fixed: tab complete on non-existant directory adds garbage to commandline<br /> Fixed: can not navigate songs patterns with -/+ when pattern is empty<br /> Fixed: backspace/del removing cart from favourites list even when inside the fold-out cartridge menu</p> <p></div></div></div></p> <hr /> <p>That's all for now -- I'll catch you in a couple of weeks with a <a href="https://www.picotron.net">new machine</a>!</p> https://www.lexaloffle.com/bbs/?tid=140421 https://www.lexaloffle.com/bbs/?tid=140421 Wed, 28 Feb 2024 13:33:08 UTC Elf Curling <p> <table><tr><td> <a href="/bbs/?pid=139154#p"> <img src="/bbs/thumbs/pico8_elf_curling-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=139154#p"> Elf Curling</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=139154#p"> [Click to Play]</a> </td></tr></table> </p> <p>A wee game for the the 2023 Holiday Bundle: <a href="https://www.lexaloffle.com/bbs/?tid=55407">https://www.lexaloffle.com/bbs/?tid=55407</a></p> <p>It is 2 player, but if you'd like to play around with both teams, you can enable 'hotseat' mode in the pause menu which allows using the same controls for both teams.</p> <p>The goal is to get as many curling stones inside or even barely touching the red (5 points) and blue (2 points) circles, counted at the end of the match. Each elf is assigned a fixed amount of time to do whatever they like, including jumping on stones, riding them around, and pushing around the opponents' curling stones or players.</p> <p>There are no points awarded for having elves in the circles at the end of the match -- it is just about the stones, for a maximum of 15 points. The last elf has the last-move advantage, but only 7 seconds instead of 10. The first 2 elves get 15 seconds each. Players can decide who goes first with a game of real-world rock paper scissors, and the first player to press X goes first.</p> <p>Controls: [O] (z on the keyboard) to jump, dpad/cursors to skate around.<br /> Both elves and stones start curling when they are spinning fast enough.</p> https://www.lexaloffle.com/bbs/?tid=55482 https://www.lexaloffle.com/bbs/?tid=55482 Mon, 25 Dec 2023 18:32:07 UTC Loom Valley <p> <table><tr><td> <a href="/bbs/?pid=135203#p"> <img src="/bbs/thumbs/pico8_lv-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=135203#p"> loom valley</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=135203#p"> [Click to Play]</a> </td></tr></table> </p> <p>X to accelerate -- try to stay on the ground to maintain speed!</p> <p>This is a 1022 byte cartridge made for the <a href="https://itch.io/jam/pico-1k-2023">pico-1k jam</a>, but while I was commenting it I found a bunch of unused junk, so now it is 999 bytes compressed :) (see the code in tab 1, minified by <a href="https://www.lexaloffle.com/bbs/?uid=29645"> @thisismypassword</a>'s excellent <a href="https://thisismypassport.github.io/shrinko8">Shrinko8</a> )</p> <p>pico1k entry page: <a href="https://itch.io/jam/pico-1k-2023/rate/2289420">https://itch.io/jam/pico-1k-2023/rate/2289420</a></p> https://www.lexaloffle.com/bbs/?tid=54397 https://www.lexaloffle.com/bbs/?tid=54397 Sun, 01 Oct 2023 10:54:00 UTC Fill Pattern Catalogue <p> <table><tr><td> <a href="/bbs/?pid=130531#p"> <img src="/bbs/thumbs/pico8_fillp_cat-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130531#p"> fill pattern catalogue</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=130531#p"> [Click to Play]</a> </td></tr></table> </p> <p>This is a little tool for viewing all possible 4x4 fill patterns, after removing duplicates which are the same pattern inverted, translated, rotated, or flipped in x/y/diagonally. There are 65536 possible raw fill patterns (1 &lt;&lt; 16), but only 433 unique patterns once &quot;equivalent&quot; ones have been discarded.</p> <p>To use a fill pattern that you like, prefix it with &quot;0x&quot; (it is a hexadecimal number) and pass it fillp():</p> <div> <div class=scrollable_with_touch style="width:100%; 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>fillp(0x95a6) circfill(64,64,40,0xacd) fillp() -- reset </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Press UP and DOWN to browse the catalogue, [X] to invert and [O] (z/c) to hide the info bar.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/fillp_cat2_3.gif" alt="" /> <p>I don't know if there is a <a href="https://en.wikipedia.org/wiki/Burnside%27s_lemma">more efficient</a> way to calculate groups (or the <a href="https://math.stackexchange.com/questions/2506511/applying-burnsides-lemma-to-translations">number of groups</a>) for these <a href="https://en.wikipedia.org/wiki/Equivalence_relation">equivalence relations</a>, but PICO-8 is more than fast enough to brute force it, so that's what this cartridge does! For each 16-bit fill pattern, its group id (the &quot;orbit&quot;) is calculated by applying every combination of transformation and returning the lowest result. If that value not already found in the list of patterns, it is added.</p> <p>I was able to take a few shortcuts though -- for example, calculating 90 degree rotations is not necessary, because for every orientation there is a combinations of flipping in x, y and through the diagonal (transpose) that is equivalent to that rotation.</p> https://www.lexaloffle.com/bbs/?tid=52986 https://www.lexaloffle.com/bbs/?tid=52986 Mon, 05 Jun 2023 09:02:44 UTC Picotron Playground (Part II) <p>Hey All! I've been trucking on some Picotron stuff a bit lately, and I've added a lot of it to the current build of Picotron Playground which you can play around with in your browser here:</p> <p><a href="https://www.lexaloffle.com/picotron.php?page=playground">https://www.lexaloffle.com/picotron.php?page=playground</a></p> <p>A quick recap for some context: <a href="https://www.picotron.net">Picotron</a> is a fantasy workstation that aims to be extremely <a href="/picotron.php?page=faq">hackable and flexible</a>. It is not quite in production yet, but an experimental web version <a href="https://www.lexaloffle.com/picotron.php?page=playground">is available</a> ~ that's what &quot;Picotron Playground&quot; is. The desktop version of Picotron, with built-in dev tools + HTML exporter are planned for <a href="https://www.lexaloffle.com/picotron.php?page=roadmap">later this year</a>.</p> <p>For more background, see also: <a href="https://www.lexaloffle.com/bbs/?tid=50923">Part I: The release thread</a></p> <h2>Code Editor</h2> <p>The code editor is now implemented as a GUI component that anyone can embed in their own programs. This will make it easier to create things like bespoke programming toys and scriptable level editing tools. Have a look at /demos/proggy.p64 to see how this works (although, that api might change a little later). It is still janky, but now janky in a more powerful way!</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/159_proggy_sand.png" alt="" /> <div> <div class=scrollable_with_touch style="width:100%; 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>cd /demos load proggy.p64 --&gt; CTRL-R</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Click a button to load each snippet, and type for live changes. For example try copying and pasting the 'paint' snippet into the bottom of 'decay' or 'sand'.</p> <p>Side note: proggy.p64 has multiple tabs open when you load it-- each of these is a running a separate process (edit /system/tools/code.lua). This way, tools can focus on having a single file open, and let the WM handle having multiple files open in a unified way.</p> <h2>Palette</h2> <p>The palette has changed a little since v7, and I think possibly this will be the finished Picotron system palette. 16 is a smidgen duller, 23~26 are slightly brighter, and 30 is now a much brighter magenta. I don't know if anyone has gone very deep into the palette yet, but here's the new version for reference:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="https://www.lexaloffle.com/dl/wip/picotron_pal_wip_v4.png" alt="" /> <p>It is possible to set RGB values for the palette in Picotron, but windowed applications will need to lean heavily on the default 32 colour palette, and I think it will often be used as a starting point for building other palettes.</p> <h2>Graphics API</h2> <p>The graphics pipeline design document now including a step-by-step summary of how a pixel is drawn (near the end): <a href="https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html">https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html</a></p> <h3>Indexed Display Palette</h3> <p>v.8 now includes an indexed display palette (64 bytes starting from 0x5480) similar to PICO-8's one. It defaults to an identity palette (0, 1, 2..) and so has no effect. The display palette provides an easier way to do palette swaps &amp; cycles etc at the end of each frame without having to mess around with the RGB display palette.</p> <h3>Separate Target Mask for Shapes</h3> <p>Shape drawing functions (circfill etc) now get their own separate target_mask at 0x550b that defaults to 0. The target mask is applied to whatever value is already in pixel to be drawn over, so 0 means &quot;don't care about what is already there&quot;. There are two reasons for this:</p> <p>The first is that the default behaviour when drawing colour 0 is now for it to be drawn solid, while sprites can at the same time be drawn with transparency for colour 0. This is much more intuitive and also matches PICO-8's behaviour.</p> <p>The second reason is that drawing horizontal spans can be optimized when not caring about what colour values are being drawn over: when target_mask is 0, each output value is only a function of the draw colour(s) and fill pattern. I've reduced the (fantasy) cpu cost in this case by 50% and can likely reduce it further later after optimising that code path.</p> <h3>Default Colour Table Stencil Bit Values</h3> <p>The behaviour of pal() and palt() have been changed to make it easier to set (and ignore) stencil bits:</p> <p><a href="https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html#Colour_Tables">https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html#Colour_Tables</a></p> <p>(near the end of that section)</p> <h3>Setting palette entries</h3> <p>Instead of poking, you can use pal(1, 0xrrggbb, 2) to set rgb palette entries.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>pal(1,0xff0000,2) -- too red circfill(200,100,50,1)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>It can also take a table of entries like PICO-8:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>pal({0xff0000,0x00ff00,0x0000ff},2) for i=1,3 do circfill(200 + i*50,100,20,i) end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>PODs</h2> <p>PODs (Picotron Object Data) are strings that store the contents of Lua values, sort of like JSON. They're used for many things internally, but none of them are very relevant to Picotron Playground (yet?). v.8 includes some improvements to the POD format, and the result is that it will eventually possible to store images, maps and other data very quickly, with reasonable compression built in -- straight from the Lua object to disk and back again. If you're curious, you can find some details here:</p> <p><a href="https://www.lexaloffle.com/dl/docs/picotron_pod.html">https://www.lexaloffle.com/dl/docs/picotron_pod.html</a></p> <p>Trivia: since the start of Lexaloffle I've been working with .pod files, generated by my in-house editing multitool called Poido (from &quot;Pointy Dough&quot; because it includes a low-poly modeller, but I use it mostly for bitmap editing and palette design). I thought that with Picotron I'd finally be free of pod files, but it turned out to be the most fitting name once again!</p> <p>One thing you can try: paste this POD into the code editor and hit enter a couple of times to get an embedded image (that as legal lua source code returns the scrawled star sprite that is being shown in the editor).</p> <div> <div class=scrollable_with_touch style="width:100%; 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>--[[pod_type=&quot;image&quot;]]unpod(&quot;b64:bHo0AO4AAAD8AAAAcXB4dQBAAAAEANABAAAAAwTw0B8d8C0uAwCwLD7wK17wKW7wKH4DAPEBJ57wJa7wJL7wI87wI97wIgMA_UEh7vAg-gHwCn6w-gLwCr5w-gPwCf4AMP4VcP4ogP4lsP4kwP4i4P4g8AH_HvAC-h3wBP4b8Ab_GPAJ-hbwCv4V8Az_FPAN-hPwDv4S8A-_EQQAABQAAAQA8CMN-gIwzvAN-gBgvvAN7oCu8AzuoJ7wC97QjvALvvACbvALjvAGXvAKfvAIXvAJfvAKXgkA8BEMXvAIPvAPTvAHPvARPvAHLvATLvAHHvAVDvAvDvD-gw==&quot;)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>It is a userdata object compressed (first with RLE encoding and then with lz4) and then re-encoded back into a text-friendly form as base-64. Whenever you copy an object in Picotron (like a sprite or section of map), it will be encoded like this for easy sharing between programs and other users.</p> <p>You might also notice some .info.pod files lying around -- these are used to store per-folder metadata but will eventually be hidden. Per-file metadata is stored within the pod format itself.</p> <h2>Other Stuff</h2> <ul> <li> <p>Proper CPU model -- infinite loops won't bring the system down, and each frame, the available CPU is shared around each process.</p> </li> <li> <p>64-bit pokes: you can use poke8 / peek8 and the new peek operator *</p> </li> <li> <p>aliasing can be implemented by mounting files -- &quot;ls&quot; is now aliased as &quot;dir&quot;</p> </li> <li> <p>see /demos/stencil.p64 for an example of using stencil bits</p> </li> <li>try out rnd_blend and/or stretch at the start of /demos/chonky.p64</li> </ul> https://www.lexaloffle.com/bbs/?tid=52692 https://www.lexaloffle.com/bbs/?tid=52692 Fri, 12 May 2023 10:53:12 UTC Time For Lunch <p> <table><tr><td> <a href="/bbs/?pid=129209#p"> <img src="/bbs/thumbs/pico8_tfl-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=129209#p"> Time For Lunch</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=129209#p"> [Click to Play]</a> </td></tr></table> </p> <p>Here's an orange and some sandwiches for The Wizard. Use the dpad (or cursors) to control the owl, and watch out for castle creatures. Also, take care of the basket ~~ if it hits a wall too hard, it might smash. Good luck!</p> <p>This is a short game made for Ludum Dare vol.53</p> <p><a href="https://ldjam.com/events/ludum-dare/53/$366108">https://ldjam.com/events/ludum-dare/53/$366108</a></p> https://www.lexaloffle.com/bbs/?tid=52576 https://www.lexaloffle.com/bbs/?tid=52576 Mon, 01 May 2023 00:34:00 UTC Lovebyte 2023 Intros <p>It's <a href="https://lovebyte.party/">Lovebyte</a> this weekend, and I made a couple of size-coded intros for it. First up is an invite to another <a href="https://en.wikipedia.org/wiki/Demoscene">demoscene</a> party: <a href="https://sessions.frontl1ne.net/">SESSIONS in C4 LAN 2023 SPRING</a>, taking place in Shizuoka / Japan end of April. This one is 512 bytes, around 100 of which are for the music (don't wait for the drop!): </p> <p> <table><tr><td> <a href="/bbs/?pid=125754#p"> <img src="/bbs/thumbs/pico8_sessions_2023-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125754#p"> sessions 2023 invitro</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=125754#p"> [Click to Play]</a> </td></tr></table> </p> <p>I also tried a bunch of 64 byte intros based on poking semi-structured patterns into ram that could double as audio and visual data. This is the one that I submitted to the 64 byte compo:</p> <p> <table><tr><td> <a href="/bbs/?pid=125754#p"> <img src="/bbs/thumbs/pico8_attack_on_venus-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125754#p"> attack_on_venus</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=125754#p"> [Click to Play]</a> </td></tr></table> </p> <div> <div class=scrollable_with_touch style="width:100%; 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>t=9::_::i=t^4 poke(i,51&amp;(t*(i&gt;&gt;9)*(i%64)/&hearts;)) t+=1/&hearts; sfx(i)goto _</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Here's a variation that has more of a horror feeling:</p> <p> <table><tr><td> <a href="/bbs/?pid=125754#p"> <img src="/bbs/thumbs/pico8_forest_horror-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125754#p"> forest_horror</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=125754#p"> [Click to Play]</a> </td></tr></table> </p> <div> <div class=scrollable_with_touch style="width:100%; 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>t=19::_::i=t^4 poke(i, 0xdb&amp;(t*(i&gt;&gt;7)*(i%64)/&hearts;)) t+=1/&hearts; sfx(i)goto _ </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>If you want to try these in a browser, you can copy and paste them into <a href="https://www.pico-8-edu.com">PICO-8 Education Edition</a>.</p> <p>I didn't have time to make 128 byte &amp; 256 byte entries, which happen to be the two compos that have their own dedicated fantasy console sections! But I'll definitely be back next year -- it's great to have a whole party focused on size-limited prods, and that is inspiring so many great pieces of work. There are more events happening tonight (Sunday, UTC) and you can catch them <a href="https://www.twitch.tv/lovebytedemoparty">live on twitch</a> or archived <a href="https://www.youtube.com/@Lovebytedemoparty">on youtube</a>. You can find a schedule on the <a href="https://lovebyte.party">lovebyte website</a>. Good luck to those taking part tonight! &lt;3</p> <p><object width="640" height="400"><param name="movie" value="https://www.youtube.com/v/jQgp5tHx3t4&hl=en&fs=1&rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="https://www.youtube.com/v/jQgp5tHx3t4&hl=en&fs=1&rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="640" height="400"></embed></object></p> https://www.lexaloffle.com/bbs/?tid=51606 https://www.lexaloffle.com/bbs/?tid=51606 Sun, 12 Feb 2023 13:21:08 UTC PICO-8 0.2.5g <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/pico8_025f.gif" width=384 height=384 alt="" /> <p>More bugfixin'</p> <p>PICO-8 <span style="text-decoration: line-through;">0.2.5f</span> 0.2.5g is up now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a> and web (<a href="https://pico-8-edu.com">Education Edition</a>).</p> <h3>v0.2.5g Changelog:</h3> <p>Fixed: tonum(&quot;123abc&quot;) returns 123 (should return nothing) // also breaks split(). regression in 0.2.5f<br /> Fixed: draw_tabs not listed by CONFIG command</p> <h3>v0.2.5f Changelog:</h3> <p>Added: CONFIG DRAW_TABS 1 to show tab characters in code editor (previously required editing config.txt)<br /> Changed: tokenizer recognises long comments / string using [=<em>[ ]=</em>] e.g. [==[ long string ]==]<br /> Changed: Nested long comments and strings no longer allowed<br /> Changed: x % 0 gives 0 (was x)<br /> Optimised: software blitter now faster when using PocketCHIP, windowed raspi or blit_method 1<br /> Fixed: infinite tokens exploit introduced in 0.2.5d (due to pre-processor changes)<br /> Fixed: &gt;&gt;&gt;= operator is a NOP (bug introduced in 0.2.5d)<br /> Fixed: (raspi 32-bit) window not visible under Gameforce Chi / EmuELEC -- bug introduced in 0.2.5e<br /> Fixed: s=&quot;x&quot;..&quot;=&quot; counts as 4 tokens instead of 5<br /> Fixed: Running a cartridge containing <em>meta</em> data prints a memory allocation warning to stdout<br /> Fixed: Code compressing to &gt;= 32k reports size as (compressed_size &amp; 0x7fff) resulting in corruped exports<br /> Fixed: stat(54) loops when left-most channel is looping (should return total played ticks on current pattern)<br /> Fixed: extcmd(&quot;audio_rec&quot;) maximum length is 2 minutes (meant to be 8 -- and now only applies to web)<br /> Fixed: Frog Home crashes because of (now unsupported) &quot;local x+=..&quot; form. // INSTALL_GAMES for fixed version<br /> Fixed: Starting P8SCII font height affects total line height even when no characters are printed in that font</p> https://www.lexaloffle.com/bbs/?tid=51465 https://www.lexaloffle.com/bbs/?tid=51465 Fri, 03 Feb 2023 20:29:16 UTC Picotron Playground <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/picotron_playground.gif" alt="" /> <p><strong>UPDATE: Part II Thread</strong> <a href="https://www.lexaloffle.com/bbs/?tid=52692">https://www.lexaloffle.com/bbs/?tid=52692</a></p> <p>A new year, a new fantasy machine! <a href="https://www.lexaloffle.com/picotron.php?page=playground">Picotron Playground</a> is an experimental web version of <a href="https://www.picotron.net">Picotron</a>'s WIP runtime and API, bundled with a terminal and code editor in order to make some toy programs. You can read more about the goals of Picotron and its specifications in the FAQ:</p> <p><a href="https://www.lexaloffle.com/picotron.php?page=faq">https://www.lexaloffle.com/picotron.php?page=faq</a></p> <p>Although I'm still mostly occupied with PICO-8 and Voxatron, I hope this will be a good way to chip away at the project and let future users try out the API in a low-stakes way before it is ready to go into production.</p> <p>Launch Picotron Playground here:</p> <p><a href="https://www.lexaloffle.com/picotron.php?page=playground">https://www.lexaloffle.com/picotron.php?page=playground</a></p> <p>Note: you'll need a US layout keyboard and <strong>there is no permanent storage</strong>, although the clipboard does work if you want to store some snippets. Please work on anything larger than toy programs at your own risk!</p> <h3>Running Demos</h3> <p>Demo programs will appear (and probably disappear!) over time to try out various API functionality. At the moment they are mostly simple graphics demos that can be loaded via the terminal:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>/$ cd /demos /demos$ ls /demos$ load dots</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>CTRL-R to run it.<br /> ESC ESC to get back into the editor<br /> CTRL-L clears the screen (important!)<br /> The &quot;reset&quot; command can be used to get the default palette back.</p> <h3>Using the API</h3> <p>The most interesting feature of Picotron's runtime is probably the gfx pipeline, which is documented here: <a href="https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html">https://www.lexaloffle.com/dl/docs/picotron_gfx_pipeline.html</a></p> <p>If you'd like a quick way to load sprites, try copying and pasting from PICO-8 gfx editor and pass that as a string to userdata():</p> <div> <div class=scrollable_with_touch style="width:100%; 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>my_sprite = userdata&quot;[gfx ... /gfx]&quot; spr(my_sprite, 100, 100) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>There are some more examples of how to manipulate userdata in the <a href="https://www.lexaloffle.com/picotron.php?page=faq">FAQ</a>.</p> <h3>Limitations</h3> <ul> <li>There's no audio yet.</li> <li>There is provisional cpu cycle counting, but it is incomplete and infinite loops will still crash your browser. You can get the cpu with stat(1), but it currently also includes cycles used by system processes. </li> <li>Some of PICO-8's more forgiving behaviors do not not exist [yet?], including being able to divide by zero, and automatically converting floats to ints.</li> <li>The code editor is still a bit janky. Sorry!</li> <li>btn() works but just for a placeholder P1 6-button layout.</li> </ul> <p>I think that's enough to poke around for now. If you have any questions please post them in this thread or ask me on <a href="https://tinyurl.com/zepfedi">mastodon</a> as there isn't a Picotron sub-forum yet. I hope you enjoy it!</p> https://www.lexaloffle.com/bbs/?tid=50923 https://www.lexaloffle.com/bbs/?tid=50923 Sat, 31 Dec 2022 15:33:43 UTC Wooden Toy Joinery <p> <table><tr><td> <a href="/bbs/?pid=123001#p"> <img src="/bbs/thumbs/pico8_wtj-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=123001#p"> Wooden Toy Joinery</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=123001#p"> [Click to Play]</a> </td></tr></table> </p> <p>Use the dpad to move head pieces around, join them to tiles (only some tiles join, and only on certain sides), and move your creation to the target area to complete each puzzle.</p> <p>A wee game for <a href="https://www.lexaloffle.com/bbs/?tid=50644">Twelve Days of PICO-8 Christmas 2022</a>. To get the full experience, play it from <a href="https://www.lexaloffle.com/bbs/?uid=14839"> @TheTomster</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=50644">menu cart</a>!</p> <p>Some scenes from other games in the collection:</p> <p><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/mittens_0.gif" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/freezing knights battle 3_0.gif" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/puffy coats_0.gif" alt="" /><img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/decigobloopbloop_0.gif" alt="" /></p> <p>Wooden Toy Joinery was a 3 day collaboration with my 9 year-old while visiting my folk's place in the south of New Zealand. Yesterday out of nowhere my Dad produced what looks to be one of the first BASIC programs I ever wrote (maybe.. 1985?). I didn't have access to a computer at the time, and this was before understanding what variables are. I suspect I was imitating a pick-a-path adventure code listing I'd seen, but applied to an action game.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/jumping_bug.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=50824 https://www.lexaloffle.com/bbs/?tid=50824 Sun, 25 Dec 2022 12:51:42 UTC PICO-8 0.2.5d <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/bunny_1.gif" alt="" /> <p>Hey all! Time for some more bugfixes and esoteric features / QOL improvements to finish off 0.2.5*. And thanks to some snippets from <a href="https://www.lexaloffle.com/bbs/?uid=14958"> @samhocevar</a>'s excellent <a href="https://github.com/samhocevar/z8lua">z8lua</a>, some cleaner code parsing. <a href="https://www.pico-8.com">PICO-8</a> 0.2.5d is now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a> and web (<a href="https://pico-8-edu.com">Education Edition</a>).</p> <h3>0.2.5e</h3> <p>0.2.5e fixes a bug in the loader that causes uppercase characters to not be loaded as punyfont (e.g. breaking _ENV).</p> <h3>0.2.5d</h3> <p>Added: tline(bits) to set number of bits used for fractional part of mx,my,mdx,mdy (13 by default)<br /> Added: ctrl+mousewheel to scroll code horizontally<br /> Added: current bbs cartridge id shown in window title (config.txt show_cart_id_in_title to disable)<br /> Added: poke(0x5f36, (@0x5f36)|0x80) to enable character wrap by default when printing<br /> Added: blit_method in config.txt // Can use a software blitter by default (slower but more reliable)<br /> Added: reminder when re-locating sprites that only the top half of map is altered by default<br /> Added: draw boot sound as note glyphs on startup when sound is off<br /> Changed: print() returns both max(cur_x), max(cur_y) and includes non-printed characters (e.g. tabs)<br /> Changed: extcmd(&quot;folder&quot;) and extcmd(&quot;set_title&quot;, &quot;foo&quot;) can now be used from bbs carts<br /> Changed: Indexing a string out of range returns nil (was &quot;&quot;)<br /> Changed: Replaced most of pre-processor with Lua parser modifications based on z8lua (fixes various edge cases)<br /> Changed: &quot;a[foo()] += 1&quot; only evaluates foo() once<br /> Changed: out-of-bound tile values can be drawn using map(), tline()<br /> Changed: extcmd(&quot;audio_rec&quot;) can record a maximum of 8 minutes (was no limit previously)<br /> Changed: Rate limits are now per-minute: 10MB of log writes, 64 different files, 10 extcmd(&quot;folder&quot;)'s)<br /> Fixed: Infinite tokens hack (was caused by now-replaced pre-processor)<br /> Fixed: Only 4 controllers mapped to 0x5f00+76<br /> Fixed: h toggles hexadecimal mode in gfx editor (should be ctrl-h -- h is to flip sprite horizontally)<br /> Fixed: out-of-bounds value doesn't respect custom map size<br /> Fixed: cutting or clearing a selection of sprites does not also clear the sprite flags<br /> Fixed: P8SCII repeat-character command fails on zero repetions; ?&quot;a*0bc&quot; should print &quot;ac&quot;, not &quot;abc&quot;<br /> Fixed: pxa code compression inefficient when &gt;= 32k matching triplets (typically &quot;000&quot;)<br /> Fixed: print() return value max(cur_x) returns 0 when max(cur_x &lt; 0)<br /> Fixed: holding menu button to force pause menu to open broken in binary exports<br /> Fixed: copying / pasting in commandline doesn't respect punyfont character encoding<br /> Fixed: (Manual) Steps 1 &amp; 2 on how to move sprites in the map are in the wrong order<br /> Fixed: Unhelpful / no error messages when the wrong format for HELP is used </p> <h3>EDIT: Note for Raspberry Pi Users</h3> <p>0.2.5d/e seem to have a serious issue with the blitter that causes PICO-8 to run, but with a hidden display (i.e. you can hear the boot sound, but not see anything). Unfortunately I won't be able to debug this for another couple of weeks as I'm out of my office -- but in the meantime you can get 0.2.5c from the downloads page under &quot;older versions&quot;. Run it with <code>pico8 -accept_future 1</code> if you want to load splore cartridges authored in 0.2.5d/e (and it will probably still work). Sorry about this!</p> https://www.lexaloffle.com/bbs/?tid=50632 https://www.lexaloffle.com/bbs/?tid=50632 Tue, 13 Dec 2022 15:16:59 UTC aajibi (512b intro) <p> <table><tr><td> <a href="/bbs/?pid=120267#p"> <img src="/bbs/thumbs/pico8_aajibi-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=120267#p"> aajibi (512b intro)</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=120267#p"> [Click to Play]</a> </td></tr></table> </p> <p>Turn on your subwoofer!</p> <p>This is a 512 byte intro I made for <a href="https://2022.inercia.pt/">inercia 2022</a>, a demoparty that took place in Lisbon over the weekend. It's the first time that I put the <a href="https://www.lexaloffle.com/bbs/?tid=41991">no longer secret</a> 0x808 audio channel to use, with around 200 bytes of the (compressed) code spent on generating the music.</p> <p>I was pleased to find that techniques used for golfing down visual effects' code size transfer quite well to audio. There are a lot of expressions in there that change meaning over time in a way that produces some kind of structured progression -- some planned, some not so planned. The whole thing is really a single effect, with a lot of janky math to roll out different audio and gfx layers at different times. I can't completely explain how it works in places, but feel free to ask about anything if you like!</p> <p>This version has commented code in tab 0, but it is probably not a good example to get started with audio synthesis. For anyone game to try using 0x808, here is a simpler example that generates a sine wave at middle C (256Hz)</p> <div> <div class=scrollable_with_touch style="width:100%; 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>x=0 function _update() -- write one more byte while there -- is still space in the audio buffer while(stat(108) &lt; stat(109)) do v = sin(x)*32 -- max vol:128 x += 256 / 5512 -- middle c poke(0,mid(0,v+128,255)) serial(0x808,0,1) end 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=50098 https://www.lexaloffle.com/bbs/?tid=50098 Mon, 07 Nov 2022 18:18:16 UTC PICO-8 0.2.5 <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/boat3b_1.gif" width=384 height=384 alt="" /> <p>Hey All!</p> <p><a href="https://www.pico-8.com">PICO-8</a> 0.2.5 is now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a> and web (<a href="https://pico-8-edu.com">Education Edition</a>).</p> <p>Edit: 0.2.5b is now up for Linux users who had trouble connecting to the BBS: <a href="https://www.lexaloffle.com/bbs/?pid=116441#p">https://www.lexaloffle.com/bbs/?pid=116441#p</a></p> <h2>Built-in Help</h2> <p>PICO-8 0.2.5 has built-in documentation on API functions and other topics. Type &quot;HELP&quot; at the prompt to see a list of topics in blue, and then e.g. &quot;HELP GFX&quot; to get more information about that thing.</p> <p>While in the code editor, you can also press CTRL-U to get help on whatever is under the cursor, including operators and Lua keywords.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>&gt; HELP FILLP</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/help_fillp.png" width=384 height=384 alt="" /> <h2>String Indexing</h2> <p>Single characters can now be grabbed from strings using a familiar str[i] style syntax that means something similar to sub(str, i, i). The index is rounded down to the closest integer, and can be negative to index from the end of the string.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>S=&quot;ABCDE&quot; S[2.6] -- &quot;B&quot; S[-2] -- &quot;D&quot; S[99] -- &quot;&quot;</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Strings in Lua are immutable, so this can only be used in an expression (on the right hand side of an assignment). e.g. s[2] = &quot;z&quot; is not allowed.</p> <p>rnd(str) is now also accepted and returns a random character from string str.<br /> // update: this might not be true from 0.2.5c: <a href="https://www.lexaloffle.com/bbs/?pid=116415#p">https://www.lexaloffle.com/bbs/?pid=116415#p</a></p> <p>I've reverted sub() to pre-0.2.4 behaviour, which means that sub(&quot;abcde&quot;,2,_) returns &quot;bcde&quot;. 0.2.4 was returning single characters when the 3rd parameter is non-numeric, which is now much better handled by str[i] style indexing. (Apologies if you were already using this behaviour!)</p> <h3>Editor Features</h3> <p>gfx_grid_lines in config.txt now takes a colour if you'd like super-visible grid lines in the sprite editor:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/blue_gridlines.png" width=384 height=384 alt="" /> <p>Map selections are now on a separate floating layer:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/floating_selection.gif" alt="" /> <p>Pressing cursor keys in the map when nothing is selected now moves the camera, as I noticed some new users struggling to find/understand the pan tool and instead instinctively reaching for the cursor keys.</p> <h2>PICO1K Tools</h2> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/pico1k_2022.png" width=512 height=194 alt="" /> <p>Some changes intended to be useful for <a href="https://itch.io/jam/pico-1k-2022">PICO1K Jam</a> starting in September:</p> <ul> <li> <p>ctrl-click on the compressed code capacity to get a realtime compressed size counter in bytes. This is the same size given with the INFO command, and when storing the cartridge as a tiny (code-only) binary rom with &quot;EXPORT -T FOO.P8.ROM&quot;</p> </li> <li> <p>&quot;EXPORT -T @CLIP&quot; can be used to get a hexdump of that same data written to clipboard. This is not very useful -- just a way to visualise exactly how much data is stored.</p> </li> <li>SAVE @URL saves 3 characters when there is no sprite data included by omitting the redundant &quot;&amp;g=&quot;.</li> </ul> <h2>Web-Exportable Audio</h2> <p>extcmd(&quot;audio_rec&quot;), extcmd(&quot;audio_end&quot;) can be used in web exports. The output file shows up as a downloadable .wav file. I'm hoping this will open the door for some cute sound generation tools.</p> <h2>Variable Width P8SCII Fonts</h2> <p>PICO-8 0.2.5 custom fonts can now specify how wide each character is when printed. This previously handled by doing things like injecting extra P8SCII commands into the output string, but this was cumbersome and meant that such fonts could not be shared as plain data. There were already pixel-wise cursor positioning commands in P8SCII, so I felt it makes sense to make this simpler. Also, I needed it for Picotron 8)</p> <p>To specify a 3-bit width adjustment and 1-bit y offset for character 16..255, the data at 0x5608..0x567f is used. These would otherwise be the bitmap data for characters 1..15 which are all control characters and thus never printed.</p> <p>Each 4-bit nibble in 0x5608..0x567f (low nibbles first) encodes the adjustments for one character:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>bits 0x7: adjust character width by 0,1,2,3,-4,-3,-2,-1 bit 0x8: when set, draw the character one pixel higher (useful for latin accents)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>An addition bit must be set at 0x5605 to enable size adjustments: poke(0x5605, 1). Otherwise the data at 0x5608..0x567f is ignored.</p> <p>To test this out, try loading the font snippet generation tool:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>&gt; LOAD #FONT_SNIPPET</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>And then paste the following after the comment starting with &quot;font attributes&quot;</p> <div> <div class=scrollable_with_touch style="width:100%; 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>POKE(0x5605,1) -- turn on adjustments POKE(0x5634,0x70) -- set nibble for i to 0x7</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You can now observe that the big &quot;i&quot; in &quot;quick&quot; near the top of the screen only has 1px of space to the right instead of 2px.</p> <p>Here's a helper function for setting the 4-bit nibble (val) for a given character (c):</p> <div> <div class=scrollable_with_touch style="width:100%; 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 ADJUST_CHAR(C, VAL) LOCAL ADDR = 0X5600 + ORD(C)\2 LOCAL SHFT = (ORD(C) &amp; 1) * 4 LOCAL MASK = 0XF &lt;&lt; SHFT POKE(ADDR, (PEEK(ADDR) &amp; ~MASK) | (VAL &lt;&lt; SHFT)) END</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>File Listings (for Dev Tool Carts)</h2> <p>Locally running programs can now use ls(path) to get a listing of any local directory. Entries that end with a &quot;/&quot; are directories. Use stat(124) to get the current path.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>PATH = STAT(124) -- E.G. /FOO/ FILES = LS(PATH) FOR F IN ALL(FILES) DO COLOR(F[-1] == &quot;/&quot; AND 14 OR 6) PRINT(F) 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>BBS cartridges are not able to access local file listings -- this is intended for developing tools to use locally. For example: a utility that makes it easier to browser cartridge data and copy between cartridges using reload() / cstore() which are able to read and write any local cartridge file using the 4th parameter.</p> <h2>Keyboard Scancode Remapper</h2> <p>If you're having trouble getting PICO-8 to detect some keys (especially numeric keypad keys / unusual laptop layouts), there is now a built-in tool for mapping those keypresses to something SDL2 understand. Run PICO-8 from commandline with -scancodes:</p> <p>pico8 -scancodes</p> <p>Or use some other tool to find out which scancodes the keys in question are producing, and then map them to something else in config.txt (look for map_scancodes)</p> <h2>Dynamic Libcurl Support (Linux)</h2> <p>The 32-bit and 64-bit linux builds now try to dynamically load libcurl by default in order to make bbs requests (e.g. download carts from splore). This will hopefully make installing on some platforms easier, including Steam Decks. When libcurl.so is not available, it drops down to the old wget behaviour (requires wget to be installed). If this works well, I'll also see about moving to the same scheme for raspi and mac builds.</p> <h2>More Doodlemud</h2> <p>Doodlemud is a toy multiplayer game designed to test the backend services that PICO-8's high score table (and future projects) will be based on. Try it here: <a href="https://www.doodlemud.com/#skatepark">https://www.doodlemud.com/#skatepark</a></p> <p>This version is running on a completely new backend, custom written from scratch as a self-contained program using libwebsockets. My first attempt was built out of opensource components (nchan, redis, openresty, nginx), but because of PICO-8's unusual requirements, this was making customisation, debugging and devops more complex that it needed to be. Sometimes just reinventing the wheel with a bespoke C program is still the right approach even in the world of web services. There are currently 5 nodes running which are selected based on the user's location when making a new room:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/130_kurage_map.png" alt="" /> <h2>Next Steps</h2> <p>It looks like PICO-8's 0.2.5 API is unlikely to change now (really, this time!), and the next task is to port the new additions to <a href="https://www.voxatron.com">Voxatron</a> for Voxatron 0.3.7. After that I'll continue working on the BBS functionality needed to log in from PICO-8 and submit high scores. If you're curious, you can see the current plan for the SCORESUB() function by typing HELP SCORESUB.</p> <p>That's all for now -- I hope you enjoy the update and as usual let me know here or in <a href="https://www.lexaloffle.com/bbs/?cat=7#sub=6">bugs/</a> if you find anything spooky going on.</p> <p>Full Changelog:<br /> <div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> v0.2.5</p> <p>Added: Help topics. Use help command, or ctrl-u in code editor to get help on whatever is at the cursor.<br /> Added: (html exports / bbs) downloadable .wav export using extcmd(&quot;audio_rec&quot;), extcmd(&quot;audio_end&quot;)<br /> Added: inext (to match next). -&gt; can do: for i,v in inext,tbl do ... end<br /> Added: floating selection layer in map editor (solves various bugs and undo / selection issues)<br /> Added: ~ can be used as xor instead of ^^ (same as Lua 5.3/5.4)<br /> Added: When running a program locally, ls() can now take a directory name; use stat(124) to get pwd<br /> Added: Variable width P8SCII fonts<br /> Added: ctrl-click on compressed capcity (bottom right) to get realtime updates of compressed size in bytes<br /> Added: export -t @clip to get a hexdump of compressed code section copied to clipboard<br /> Added: pico8 -scancodes and map_scancodes (config.txt) for manually mapping keys to alternative scancodes<br /> Added: sub(str,pos,pos) can be written as str[pos].<br /> Changed: host_framerate<em>control 1 (config.txt) now means &quot;let PICO-8 decide&quot;; is disabled for Mac/Win/Linux<br /> Changed: in map editor, pan with cursor keys when nothing is selected<br /> Changed: use scancodes for sfx navigation (US:-=</em>+) and spd change (US:,.&lt;&gt;) to avoid azerty collisions<br /> Changed: gfx_grid_lines in config.txt is taken to be a colour for the grid lines (16 for black)<br /> Changed: can ctrl-h in gfx editor to toggle hex mode (sprite index shown in hex; map vals shown)<br /> Changed: '-' allowed in filenames when not first character<br /> Changed: linux builds use libcurl.so for bbs requests, or drops down to wget on failure to dlopen<br /> Changed: increased maximum gif len for web exports to 30 seconds<br /> Changed: peek/poke can now read/write up to 32767 values (was 8192)<br /> Changed: web player default gif len is 16 seconds (was 8)<br /> Changed: sub(str, pos, nil) returns whole string (pre-0.2.4 behaviour). For single chars, can now use str[pos].<br /> Fixed: Windows reserved filenames (lpt1, com1 etc) are accepted<br /> Fixed: Nested coroutines unexpectedly end when interrupted by reaching end of frame<br /> Fixed: print() colour is remapped twice when set in parameter // pal(6,7) pal(7,8) print(&quot;white&quot;,6)<br /> Fixed: circ() breaks on 32-bit builds, with radius &gt; 1024<br /> Fixed: ctrl-c to copy commandline error message does not encode glyphs as unicode<br /> Fixed: LS command not resolving relative paths<br /> Fixed: twitter char count for chr(127) ○ should be 2 (was 1) and chr(149) ˇ should be 1 (was 2)<br /> Fixed: colour parameter not converted from string in rect, rectfill, pset (regression from 0.2.2)<br /> Fixed: ord(&quot;foo&quot;, 1, 0) returns &quot;too many ord results&quot; -- should return nothing<br /> Fixed: save @url includes ?g= when no gfx data (is redundant)<br /> Fixed: (web export) html pause button does not show up as btnp(6) / btn(6)<br /> Fixed: (web export) codo_textarea triggering Mac accent character selector even when cart doesn't use clipboard<br /> Fixed: save @url failing when encoded length is &gt; 2000 chars long instead of &gt; 2040 charss<br /> Fixed: can enter an illegal note (e-5) in sfx editor<br /> </div></div></div></p> https://www.lexaloffle.com/bbs/?tid=49075 https://www.lexaloffle.com/bbs/?tid=49075 Sun, 28 Aug 2022 10:32:51 UTC PICO-8 0.2.4c <p><a href="https://www.pico-8.com">PICO-8</a> 0.2.4c is now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a>.</p> <p>This is mostly a bug-fixing update; you can see the main 0.2.4 change notes in the <a href="https://www.lexaloffle.com/bbs/?tid=45538">0.2.4 thread</a>.</p> <h2>URL Cartridges</h2> <p>With the release of <a href="https://www.lexaloffle.com/bbs/?tid=47278">PICO-8 Education Edition</a>, it is now possible to encode cartridges into a 2040-character URL that runs it in a web version of PICO-8's editing tools. Only the code and graphics sections are stored.</p> <div> <div class=scrollable_with_touch style="width:100%; 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>&gt; SAVE @URL COPIED URL TO CLIPBOARD 265 / 2040 CHARS</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>Tiny Cartridges</h2> <p>When exporting cartridges to .p8.rom format (the raw 32k block of data that is encoded inside .p8.png argb data), 0.2.4c allows only the code section to be stored using the -t (for tiny) switch:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>&gt; EXPORT -T TINY.P8.ROM WRITING 154 BYTES (CODE ONLY)</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>You should get a file that is exactly as large as the compressed code size reported by INFO. When using LOAD, that file will be loaded into the code section, and the other sections reset to their default states.</p> <p>There isn't much practical use for tiny .P8.ROM files, but I think it is nice to be able to store a tiny program in its true tiny form on disk.</p> <p>On the subject of tiny cartridges, for those making <a href="https://twitter.com/search?q=%23tweetcart&amp;amp;src=typed_query">tweetcarts</a>, you can now ctrl-click on the character count to get a twitter-character count which counts most (but not all!) glyphs as 2 characters.</p> <h2>Metadata</h2> <p>This is another technical one. 0.2.4c introduces a new metadata section to the .p8 file format suggested by <a href="https://www.lexaloffle.com/bbs/?uid=47515"> @SquidLight</a> that can be used by external tool authors. Sections with a heading of <code>\n__meta:somestring__\n</code> are preserved by PICO-8, but not (yet?) utilised by PICO-8 itself. So tool authors can add data to .p8 files by choosing their own meta:label without needing to stuff it into comments, or risk losing data the next time the file is saved by PICO-8 or another tool.</p> <p>More details: <a href="https://www.lexaloffle.com/bbs/?tid=47063">https://www.lexaloffle.com/bbs/?tid=47063</a></p> <h2>Full Changelog</h2> <div> <div class=scrollable_with_touch style="width:100%; 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>v0.2.4c Added: save @url -- stores code + gfx as a URL if it can be encoded in 2040 characters Added: html exports store volume/mute and other settings Added: ctrl-g in sprite editor to toggle grid lines when zoomed in Added: IMPORT -L FOO.PNG to import a 128x128 png to the cartridge label Added: EXPORT -L FOO.PNG to export a 128x128 png of the cartridge label Added: EXPORT -T FOO.P8.ROM to export only code section (t for tiny) Added: ctrl-click on character count (bottom right) to see the twitter count (glyphs count as 2) Added: __meta:*__ section to .p8 format -- can be used by external tools to store custom data Added: extcmd(&quot;audio_rec&quot;) works from exported binaries, and with custom exported filenames Added: read_controllers_in_background in config.txt (0 by default) Changed: .p8.rom files that are 0x3d00 bytes or less are loaded into code section Changed: saved filenames can not include gylphs, or any of !&quot;#$%&amp;'()*+,-:;&lt;=&gt;?[\]^`{|}~ Fixed: can't drag and drop png into sprite editor Fixed: binary exports: ctrl-r causes crash when there is no whitespace at end of source code Fixed: Using -run switch to launch a cart that fails to run -&gt; get stuck in boot screen. Fixed: selection after ctrl-a reports length chars+1 Fixed: draw palette is not observed after changing colours using p8scii control characters Fixed: music playback does not follow cursor after first pattern change (regression in 0.2.4b) Fixed: transform_screen (config.txt) not observed by pause menus and other overlayed elements Fixed: Double-clicking sfx thumbnail (in sfx overview screen) only works after playing music Fixed: Pressing [a] to release looping sfx in sfx editor is broken Fixed: sfx(46)..sfx(56) return -1 immediately after playing music but before host OS has called audio mixer Fixed: Tokens counted as 2 instead of 1: ..= ^= &gt;&gt;&lt;= &lt;&lt;&gt;= Fixed: Negative number counted as 2 tokens instead of one when preceeded by: \ &amp; | ^^ &lt;&lt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;&lt; &lt;&lt;&gt; Fixed: tostr(tbl) / print(tbl) acts like tostr(tbl, 1) when tbl has a metatable Fixed: ?&quot;\tx&quot; does not advance to next tab stop Fixed: ?&quot;a\*5\nb&quot; does not repeat newline 5 times Fixed: exported label alpha is 0 for colour 0</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=47328 https://www.lexaloffle.com/bbs/?tid=47328 Sun, 10 Apr 2022 22:32:30 UTC PICO-8 Education Edition for Web <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/pico8_edu_release.gif" width=512 height=512 alt="" /> <p>\o/</p> <p>Say hi to the newest member of the <a href="https://www.pico-8.com">PICO-8</a> family! A free, web-based, account-less version of the console making it a more accessible way to learn how to program, push pixels and write chip tunes. It comes with a fully functional set of cartridge editing tools, and can load and save .p8 and .p8.png files to and from your local drive (as well as storing them to a temporary filesystem in the browser's cache).</p> <hr /> <p>Just run it from any browser that has a keyboard + mouse attached:</p> <p><a href="https://www.pico-8-edu.com">www.pico-8-edu.com</a></p> <hr /> <p>If you are new to <a href="https://www.pico-8-com">PICO-8</a> you can find a <a href="https://www.lexaloffle.com/pico-8.php?page=resources">manual and tutorials</a> on the <a href="https://www.pico-8.com">main site</a>, or click on the blue bunny for some tips. Here's a 2-minute GIF showing the creaton of a simple PICO-8 cartridge from scatch:</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/duck_dance.gif" width=256 height=256 alt="" /> <p>In addition to the standard 32k .p8.png cartridges, PICO-8 Education Edition also comes with a new cartridge format: the URL CARTRIDGE. GFX and CODE can be encoded as a URL string, as long as it fits within 2040 characters. Here's one I prepared earlier:</p> <p><a href="https://bit.ly/3uWP0YF">URL CART DEMO</a></p> <p>// EDIT: changed to a bit.ly url so that the BBS doesn't munge it!</p> <p>To generate a url cartridge, use <code>SAVE @URL</code> and you should see the address bar change. I'm hoping this will make it easier to pass snippets around, and will add a new dimension to code size golfing and <a href="https://twitter.com/search?q=%23tweetcart&amp;amp;src=typed_query">tweetcart</a>'ing. And of course, it is still possible to capture screenshots (ctrl-6) and gifs (ctrl-8, ctrl-9).</p> <p>Although exporters and SPLORE (the built-in cartridge browser) are not included, larger cartridges can also be shared either as .p8.png files or by first uploading to the <a href="https://www.lexaloffle.com/bbs/?cat=7">BBS</a> as usual (publicly listed or semi-private) and then giving students the cartridge id to load directly from their machine:</p> <div> <div class=scrollable_with_touch style="width:100%; 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>LOAD #MY_TUTORIAL_ID</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>I hope you enjoy it, and I'll be back soon with some 0.2.4c binaries to match the web version!</p> <p>-- zep</p> https://www.lexaloffle.com/bbs/?tid=47278 https://www.lexaloffle.com/bbs/?tid=47278 Wed, 06 Apr 2022 20:21:33 UTC PICO-8 0.2.4b <p>Hi All</p> <p><a href="https://www.pico-8.com">PICO-8</a> 0.2.4b is now up on <a href="https://www.lexaloffle.com/games.php?page=updates">lexaloffle</a>, <a href="https://www.humblebundle.com/home/library">Humble</a>, <a href="https://lexaloffle.itch.io/pico-8">itch.io</a>, and for <a href="https://lexaloffle.com/bbs/?tid=34009">PocketCHIP</a>.</p> <p>This is mostly a bug-fixing update; you can see the main 0.2.4 change notes in the <a href="https://www.lexaloffle.com/bbs/?tid=45538">0.2.4 thread</a>.</p> <p>There are a few handy editor features though; here's a demo of setting animation loops: press l to start and end, and then -,+ or q,w or a,z (for azerty keyboards) to switch frames. This also works at different sprite selection sizes (shift-click and drag a selection from the spritesheet). This gif also shows using ctrl-b to &quot;paste big&quot; multiple times.</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/jelpi_anim_demo3.gif" alt="" /> <p>Full 0.2.4b changelog:</p> <p>Added: l in sprite sheet navigator to set loop start / end points (then q,w or a,z to navigate)<br /> Added: ctrl-b in gfx editor to paste 2x2 original size (&quot;paste big&quot;)<br /> Added: DEL / backspace to clear selected region in gfx / map editors, and ctrl-x to cut<br /> Added: aggressive_backups option in config.txt (off by default)<br /> Added: transform_screen in config.txt to globally rotate / flip the video output<br /> Added: stat(57) (boolean) true when music triggered by music() is playing or about to start<br /> Changed: memset() faster than using peek4/poke4; now 2 cycles per byte at 8MHz (was 4)<br /> Changed: &quot;running at &lt; 30fps&quot; warning on boot now only for raspi builds, and w/ higher tolerance<br /> Changed: Controller inputs are accepted even when PICO-8 is not the foreground application<br /> Changed: Map can be located at 0x1000 .. 0x2f00 using poke(0x5f56, 0x10) .. poke(0x5f56,0x2f)<br /> Changed: Dotty text mode is now &quot;\^=&quot; (&quot;Stripey&quot;) instead of &quot;\^.&quot; // #gunayawuho #klax #impossible<br /> Fixed: (not confirmed) crash causing 0-byte .p8 when audio mixer is called during save / run<br /> Fixed: preprocessor not counting comments as white space; should allow: &quot;.. end--[[]]if ..&quot;<br /> Fixed: pal(nil) behaving the same way as pal(0); should be same as pal() // broke #rtype-2<br /> Fixed: note entry in sfx tracker is silent after running cartridge until pressing space to playback<br /> Fixed: sub(&quot;abc&quot;, 4, 4) returns &quot;c&quot; (regression in 0.2.4)<br /> Fixed: SPLORE cart update prompt does not appear when server replies too quickly (race condition)<br /> Fixed: SPLORE cart update prompt only checks version once per session (can't refresh until it shows up)<br /> Fixed: EXPORT command does not flatten includes when exporting to .p8.png / .p8.rom format<br /> Fixed: EXPORT command discards source code changes since last run or load<br /> Fixed: printing a one-off glyph using &quot;\^.&quot; terminates the whole string when last byte is a zero<br /> Fixed: Crash when loading a cart with fewer tabs, then creating a new tab and pasting.<br /> Fixed: . command runs at 30fps even for a 60fps cart (-&gt; _update60 is called twice, _draw once)<br /> Fixed: Custom menu items become broken after suspending a cart, entering a lua command, and then resuming<br /> Fixed: memset() with a non-zero value in shared memory region (0x1000..0x1fff) causes garbage corresponding mget() values<br /> Fixed: web player/exports: ctrl-r causes erroneous &quot;external changes reloaded&quot; message and code corruption</p> https://www.lexaloffle.com/bbs/?tid=46333 https://www.lexaloffle.com/bbs/?tid=46333 Thu, 27 Jan 2022 21:01:24 UTC Holiday Jumper <p> <table><tr><td> <a href="/bbs/?pid=103519#p"> <img src="/bbs/thumbs/pico8_jumper-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103519#p"> Holiday Jumper</a><br><br> by <a href="/bbs/?uid=1"> zep</a> <br><br><br> <a href="/bbs/?pid=103519#p"> [Click to Play]</a> </td></tr></table> </p> <p>Happy Holidays, everyone! This cartridge is my addition to the <a href="https://www.lexaloffle.com/bbs/?tid=45525">2021 PICO-8 Advent Calendar</a>, which you should also check out if you haven't already!</p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/holiday jumper_0.gif" alt="" /> <h3>Controls</h3> <ul> <li>LEFT/RIGHT: Slow down or speed up. It is vital to get the right speed for some jumps</li> <li>O (Z/C): Jump. You can get more height by going fast and/or holding the button longer.</li> <li>X: To restart after crashing.</li> </ul> <p>This game gets reasonably tricky; especially from level 3. But if you can reach the end, you'll get a simple ending along with your total time and number of restarts. The randomish elements in the game (you'll see what I mean) are actually deterministic, so it's possible to form strategies and optimise your time, if that's your cup of tea.</p> <p>Anyway, I hope you enjoy it even if only as a crashing-into-trees simulator.</p> <p>This cartridge was heavily inspired by <a href="https://en.wikipedia.org/wiki/SkyRoads_(video_game)">Skyroads</a> and <a href="https://www.lexaloffle.com/bbs/?uid=26764"> @jackson_allen</a>'s most excellent <a href="https://www.lexaloffle.com/bbs/?tid=30417">Christmas Sweater Generator</a></p> <img loading="lazy" style="margin-bottom:16px" border=0 src="/media/1/christmas sweater generator 1 0_0.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=45856 https://www.lexaloffle.com/bbs/?tid=45856 Sat, 25 Dec 2021 11:36:42 UTC