kittenm4ster [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=9551 This one weird trick will make your platformer better! <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(0x5f5c, 255) -- disable btnp repeat</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>lol ur welcome</p> <p>love,<br /> kittenm4ster</p> https://www.lexaloffle.com/bbs/?tid=55127 https://www.lexaloffle.com/bbs/?tid=55127 Fri, 24 Nov 2023 19:53:06 UTC u can eat a butt <p> <table><tr><td> <a href="/bbs/?pid=137708#p"> <img src="/bbs/thumbs/pico8_buttworm-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=137708#p"> buttworm</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=137708#p"> [Click to Play]</a> </td></tr></table> </p> <p>This software product was made for <a href="https://itch.io/jam/picostevemo">https://itch.io/jam/picostevemo</a> and is based on the 2001 science fiction horror novel Dreamcatcher by American writer Stephen King.</p> https://www.lexaloffle.com/bbs/?tid=55097 https://www.lexaloffle.com/bbs/?tid=55097 Tue, 21 Nov 2023 04:20:51 UTC binary table serializer and deserializer <p>I think table serialization is a pretty well-known token-saving technique but I hadn't seen anyone post one like this that just operates via <code>peek</code> and <code>poke</code> rather than using strings, so I thought I'd share my table serializer and deserializer here (originally written for <a href="https://www.lexaloffle.com/bbs/?tid=54289"><em>PIZZA PANDA</em></a>) in case this is useful to anyone.</p> <p>The serializer writes binary data directly to memory so you can use the output however you want, e.g. you can use the <a href="https://www.lexaloffle.com/bbs/?tid=38692">&quot;storing binary data as strings&quot;</a> technique to store it as a string, but you could also just store it anywhere in the cart's data.</p> <p>The deserializer (the part you need to include in your final cart) is 170 tokens and it similarly reads bytes directly from memory.</p> <p>The serialized format is pretty efficient and uses data types which are more specific than Lua itself, in order to save storage space; each one of the following is a separate &quot;type&quot;:</p> <ul> <li>8-bit integer</li> <li>16-bit integer</li> <li>full &quot;number&quot; (32 bits)</li> <li>boolean true</li> <li>boolean false</li> <li>string</li> <li>empty table</li> <li>array</li> <li>table</li> </ul> <p>This way if your table has a bunch of little 8-bit integers in it, you're not storing a bunch of whole 32-bit numbers for no reason.</p> <p>The serialized format has the following limitations in order to keep the deserializer small:</p> <ul> <li>max 255 properties in a table</li> <li>max 255 characters in a string</li> <li>no &quot;function&quot; type support</li> </ul> <h2>Serialize Table</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>function serialize_table(addr, t, isarray) poke(addr, count_props(t)) addr += 1 if isarray then for v in all(t) do addr = serialize_value(addr, v) end else for k, v in pairs(t) do addr = serialize_value(addr, k) addr = serialize_value(addr, v) end end return addr end function serialize_value(addr, v) if type(v) == &quot;number&quot; then if v &amp; 0x00ff == v then poke(addr, 0) addr += 1 poke(addr, v) return addr + 1 elseif v &amp; 0xffff == v then poke(addr, 1) addr += 1 poke2(addr, v) return addr + 2 else poke(addr, 2) addr += 1 poke4(addr, v) return addr + 4 end elseif type(v) == &quot;boolean&quot; and v == true then poke(addr, 3) return addr + 1 elseif type(v) == &quot;boolean&quot; and v == false then poke(addr, 4) return addr + 1 elseif type(v) == &quot;string&quot; then poke(addr, 5) addr += 1 local len = #v assert(len &lt;= 255, &quot;string must be &lt;= 255 chrs&quot;) poke(addr, len) addr += 1 for i = 1, len do poke(addr, ord(v[i])) addr += 1 end return addr elseif type(v) == &quot;table&quot; then if is_empty(v) then poke(addr, 6) return addr + 1 elseif is_array(v) then poke(addr, 7) return serialize_table(addr + 1, v, true) else poke(addr, 8) return serialize_table(addr + 1, v) end end end function count_props(t) local propcount = 0 for k, v in pairs(t) do propcount += 1 end return propcount end function is_array(t) return #t == count_props(t) end function is_empty(t) for k, v in pairs(t) do return false end return true end</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h2>Deserialize Table</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>-- 170 tokens -- limitations: -- * max 255 properties in a table -- * max 255 characters in a string -- * no &quot;function&quot; type support function deserialize_table(addr, isarray) local t, propcount, k, v = {}, @addr addr += 1 for i = 1, propcount do if isarray then k = i else k, addr = deserialize_value(addr) end v, addr = deserialize_value(addr) t[k] = v end return t, addr end function deserialize_value(addr) local vtype, v = @addr addr += 1 if vtype == 0 then -- 8-bit integer return @addr, addr + 1 elseif vtype == 1 then -- 16-bit integer return %addr, addr + 2 elseif vtype == 2 then -- number return $addr, addr + 4 elseif vtype == 3 then -- boolean true return true, addr elseif vtype == 4 then -- boolean false return false, addr elseif vtype == 5 then -- string local len = @addr addr += 1 v = &quot;&quot; for i = 1, len do v ..= chr(@addr) addr += 1 end return v, addr elseif vtype == 6 then -- empty table return {}, addr elseif vtype == 7 then -- array return deserialize_table(addr, true) elseif vtype == 8 then -- table return deserialize_table(addr) 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> <p>btw if you want to see more context for how I used this in an actual project, here is the source code of that project: <a href="https://github.com/andmatand/pizza-panda">https://github.com/andmatand/pizza-panda</a></p> <p>also here is a quick example:</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>-- step 1. do something like this in your build cart t1 = { -- put lots of stuff in here } -- this returns the address right after the end of what -- was stored so you can store multiple tables in a row addr = serialize_table(0x2000, t1) t2 = { -- another table } addr = serialize_table(addr, t2) -- etc. -- step 2. do something like this in your final published cart t1, addr = deserialize_table(0x2000) t2 = deserialize_table(addr)</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=55070 https://www.lexaloffle.com/bbs/?tid=55070 Fri, 17 Nov 2023 23:25:51 UTC PIZZA PANDA <p> <table><tr><td> <a href="/bbs/?pid=134926#p"> <img src="/bbs/thumbs/pico8_pizza_panda-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=134926#p"> PIZZA PANDA</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=134926#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Straight out of the Bamboo Forest!</h2> <p>Meet <em>PIZZA PANDA</em>, a fluffy little fast-driving bear, as he beeps, bounces, and barrels his way through 20+ levels in search of the lost pizza slices. He'll have to zigzag through city streets to beat the clock, delivering the freshly reconstructed pizzas straight into the mouths of hungry citizens.</p> <p>But that's not all! Puzzling hats, helpless rats, and meddlesome cats also await <em>PIZZA PANDA</em> and his trusty red automobile. It's non-stop action all the way to the top of the winner's podium!</p> <h3>Controls</h3> <ul> <li>Jump: 🅾️</li> <li>Honk/Start Level: ❎</li> <li>Move Left/Right: ⬅️/➡️</li> </ul> <p>(open the pause menu to restart a level or return to the overworld)</p> <h3>Source Code</h3> <p>I had to minify the source all to heck in the final cart and use a bunch of data serialization and compression, but I've posted the original files here for the curious: <a href="https://github.com/andmatand/pizza-panda">https://github.com/andmatand/pizza-panda</a></p> https://www.lexaloffle.com/bbs/?tid=54289 https://www.lexaloffle.com/bbs/?tid=54289 Tue, 26 Sep 2023 19:54:44 UTC keyboard navigation in music editor breaks when on empty pattern <p>I'm pretty sure I remember this working correctly in a previous version but as of version 0.2.5g if you navigate left/right through patterns in the music editor using the -/= keys on the keyboard, if you get to an empty pattern, the keys no longer work and I haven't been able to find any way to regain control of moving through patterns except by using the mouse.</p> https://www.lexaloffle.com/bbs/?tid=52586 https://www.lexaloffle.com/bbs/?tid=52586 Mon, 01 May 2023 18:45:36 UTC 0.2.2 menuitems always respond to L/R?? <p>as of 0.2.2, all menuitems now have their functions called when left/right are pushed while the menuitem is selected?? It took me an embarrassingly long time to realize this... (probably due largely to <a href="https://www.lexaloffle.com/bbs/?tid=42392">a bug where the menu doesn't actually close but the items are still triggered, even if the function does not return true</a> which helped to obscure this behavior)</p> <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> it seems like this change to menuitem's functionality was intended to be extra functionality and only improve the capabilities of menuitems, but the problem is that the new functionality is always activated, even it's not needed or wanted, so if the user accidentally presses left or right (which is very easy to do with a joystick or with the mobile D-pad UI, and this is how I noticed it!) the menuitem's function gets triggered, and the only way to prevent that (i.e. in order to maintain the old behavior where left/right do not trigger the function) is to use up more tokens in the menuitem's function to check which button was pressed!</p> <p>it seems backwards from most of the nice feature changes we've had in recent releases which tend to result in added convenience and token <em>efficiency</em> :D</p> <p>I know I'm responding very late to this change :D but it seems like it would have been preferable if the new functionality was only activated if an extra param was given to menuitem or something like that...because it is very frustrating for a user to accidentally trigger &quot;restart level&quot; for instance when they were just intending to move down the list of items using a joystick!</p> https://www.lexaloffle.com/bbs/?tid=52196 https://www.lexaloffle.com/bbs/?tid=52196 Tue, 28 Mar 2023 04:29:40 UTC Regioni d'Italia <p> <table><tr><td> <a href="/bbs/?pid=125516#p"> <img src="/bbs/thumbs/pico8_regioni-8.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125516#p"> regioni</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=125516#p"> [Click to Play]</a> </td></tr></table> </p> <p>solo un piccolo cart per aiutarmi a imparare</p> <p>aprire il menu per attivare la modalit&agrave; &quot;quiz&quot;</p> <p>bird sprite adapted from <a href="https://www.lexaloffle.com/bbs/?uid=11600"> @SirTimofFrost</a>'s <a href="https://www.lexaloffle.com/bbs/?tid=34245">picobirds</a> :&gt;</p> https://www.lexaloffle.com/bbs/?tid=51547 https://www.lexaloffle.com/bbs/?tid=51547 Wed, 08 Feb 2023 06:59:33 UTC exit early from print delay? <p>Does anyone know if there is a way to exit early when a print command is running with the <code>\^d</code> p8scii special command that adds delay frames in between each character?</p> <p>I'm in token crunch mode and realizing this new special command could be extremely handy for easy RPG-style printing delay with zero code in certain situations, but if there was a way to exit early, it would be even more useful!</p> <p>And if this is not currently possible, consider it a feature request :p</p> https://www.lexaloffle.com/bbs/?tid=47607 https://www.lexaloffle.com/bbs/?tid=47607 Sat, 30 Apr 2022 18:25:59 UTC Cassino <p> <table><tr><td> <a href="/bbs/?pid=108913#p"> <img src="/bbs/thumbs/pico8_cassino-6.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=108913#p"> cassino</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=108913#p"> [Click to Play]</a> </td></tr></table> </p> <p>I've been playing a bunch of <a href="https://en.wikipedia.org/wiki/Cassino_(card_game)">Cassino</a> lately in real life, so just for fun I thought I'd try making a simple PICO-8 version of it where you play against an AI.</p> <p>The suits are all just built-in PICO-8 glyphs so note that the stars are spades.</p> <p>If you've never played Cassino before, it's a really fun two-player card game (it can technically be played with more than 2 players but it doesn't work nearly as well) with an uncommon &quot;fishing&quot; mechanic and I highly recommend trying it with a real human!</p> <p>TODO:</p> <ul> <li>multiple rounds with alternating deals until someone reaches 21 points</li> <li>SFX</li> <li>title screen/better cart label?</li> <li>instructions?</li> <li>option to disable points for sweeps?</li> </ul> https://www.lexaloffle.com/bbs/?tid=47040 https://www.lexaloffle.com/bbs/?tid=47040 Sat, 19 Mar 2022 23:13:08 UTC feature request: option to allow gamepad input when not focused <p>Feature Request:</p> <p>a config.txt option to allow PICO-8 to respond to gamepad input even when the window is not in focus</p> <p>I imagine this option would be disabled by default, but it would come in handy for a workflow which is very common for me, wherein both PICO-8 and an external text editor are open side by side (and sometimes also a terminal window for viewing printh output) and I want to be able to control something in the game with my gamepad, but then also be able to type in a different window using my keyboard, without having to switch windows as frequently. Obviously in this out-of-focus situation PICO-8 would have to ignore keyboard input, but still respond to gamepad input.</p> <p>love,<br /> kittenm4ster</p> https://www.lexaloffle.com/bbs/?tid=44784 https://www.lexaloffle.com/bbs/?tid=44784 Mon, 27 Sep 2021 04:36:40 UTC line-drawing wraparound bug in v0.2.2 <ol> <li>Run the cart at this link: <a href="https://www.lexaloffle.com/bbs/?tid=41062">https://www.lexaloffle.com/bbs/?tid=41062</a></li> <li>Pick up the hen with the web</li> <li>Slam into the right side of the screen repeatedly</li> </ol> <p>observe that part of the lines which make up the web are visible on the left (opposite) side of the screen</p> <p>This happens in v0.2.2 of the BBS player, the native version, and the HTML export from the native version. It does not happen in the previous version.</p> https://www.lexaloffle.com/bbs/?tid=41781 https://www.lexaloffle.com/bbs/?tid=41781 Fri, 26 Feb 2021 19:16:51 UTC Spider-Bat: Horticultural Hero <p> <table><tr><td> <a href="/bbs/?pid=86117#p"> <img src="/bbs/thumbs/pico8_spiderbat-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=86117#p"> Spider-Bat: Horticultural Hero</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=86117#p"> [Click to Play]</a> </td></tr></table> </p> <p>This was made in two weeks for <a href="https://itch.io/jam/toy-box-jam-2020">Toy Box Jam 2020</a>, a jam in which we had to make something using only premade graphics/sfx/music assets.</p> https://www.lexaloffle.com/bbs/?tid=41062 https://www.lexaloffle.com/bbs/?tid=41062 Mon, 04 Jan 2021 00:50:10 UTC splore/binary export: cstore file doesn't correctly overlay onto cart ROM <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> it looks like if you do a cstore from a cart in splore or an exported binary, what it saves to the .lexaloffle/pico-8/cstore folder is only those regions of cart ROM that were cstored, and then next time you launch it from splore (or next time you run the exported binary), only those regions of the ROM are copied to base RAM; everything else is blank</p> <p>I'm guessing the cstore file is intended be <em>overlayed</em> on top of the original ROM contents when copying from cart ROM to cart RAM (and that's why it only saves the changed parts?), but it looks like there was a mistake in implementation and the cstore file contents actually are the <em>only</em> thing copied to base RAM?</p> <p>I can't reproduce the behavior when using a p8 or p8.png file; this happens only with splore or from an exported binary</p> <p>To reproduce:</p> <ol> <li>load a cart from the splore or launch a binary export of a cart that contains data and calls cstore specifying a partial section of cart memory, e.g. cstore(0, 0, 0x2000) (which is what my jigsaw puzzle cart does but I'm about to change it to write the entire ROM as a workaround ;p)</li> <li>exit splore or close the binary export</li> <li>relaunch the cart</li> <li>see that now all data regions of cart ROM are &quot;permanently&quot; empty, except for the spritesheet</li> </ol> https://www.lexaloffle.com/bbs/?tid=40761 https://www.lexaloffle.com/bbs/?tid=40761 Fri, 11 Dec 2020 21:03:58 UTC Jigsaw Puzzle Pack Pro: Xmas Edition <p> <table><tr><td> <a href="/bbs/?pid=85091#p"> <img src="/bbs/thumbs/pico8_jigsaw_xmas-5.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=85091#p"> Jigsaw Puzzle Pack Pro: Xmas Edition</a><br><br> by <a href="/bbs/?uid=9551"> kittenm4ster</a> <br><br><br> <a href="/bbs/?pid=85091#p"> [Click to Play]</a> </td></tr></table> </p> <p>~ ~ ~<br /> The classic holiday pastime of jigsaw puzzles, now in the cozy confines of your PICO-8 fantasy console!<br /> ~ ~ ~</p> <p>Like all &quot;Pro&quot; versions of Jigsaw Puzzle Pack sold by KITTENM4STERSOFT, this version allows any PNG image (up to 128x128 px) to be transformed into a custom puzzle via convenient drag-and-drop!</p> <h3>Features</h3> <ul> <li>4 Pixel Art Puzzles (+1 custom) In 1 Cartridge!</li> <li>Drag-and-drop Custom Puzzles!</li> <li>Auto-Save!</li> <li>Devkit Mouse support!</li> <li>Traditional Background Music!</li> <li>RandoCut technology for random cuts every time!</li> </ul> <h3>Controls</h3> <p>D-Pad: move cursor<br /> [O]: Pick up/drop<br /> [X]: (Hold) move faster</p> <h4>When Mouse Is Enabled (in pause menu)</h4> <ul> <li>click to pick up/drop or click-and-drag</li> <li>player 2 D-pad (ESDF) moves camera</li> <li>scroll wheel scrolls up and down (just for the heck of it)</li> </ul> <h3>Credits</h3> <h4>Images</h4> <ol> <li>&quot;Snowman&quot; by <a href="https://twitter.com/baubitt">Aubrianne Anderson</a>, CC4-BY-NC-SA</li> <li><a href="https://twitter.com/MarcoValeKaz/status/1033506793123659776">Untitled (VW Van)</a> copyright <a href="https://twitter.com/MarcoValeKaz">Marco Vale</a>, used with permission</li> <li><a href="https://www.lexaloffle.com/bbs/?tid=34058">Untitled (picnic)</a> by zep, CC4-BY-NC-SA</li> <li>John Berger from <a href="https://www.deviantart.com/pixellerjeremy/art/Portraits-2-729437661">&quot;Portraits 2&quot;</a> by <a href="https://twitter.com/pixellerjeremy">PixellerJeremy</a>, CC4-BY-NC-SA</li> </ol> <h4>Fonts</h4> <ul> <li><a href="https://jotson.itch.io/gravity-pixel-font">Gravity Bold 8</a> by <a href="https://twitter.com/yafd">John Watson</a>, modified by kittenm4ster</li> <li><a href="https://caffinate.itch.io/abaddon">Abaddon Bold</a> by <a href="https://twitter.com/caffi_nate">Nathan Scott</a>, license CC BY 3.0</li> </ul> <h4>Music</h4> <p>&quot;The Christmas Song&quot; written in 1945 by Robert Wells and Mel Torm&eacute;, arranged by kittenm4ster</p> <h4>Libraries</h4> <p>This puzzle pack was made possible by <a href="https://www.lexaloffle.com/bbs/?tid=34058">PX9 Image Compression</a> and <a href="https://www.lexaloffle.com/bbs/?tid=38692">Storing Binary Data as Strings</a></p> <h4>Everything Else</h4> <p>Everything else is by kittenm4ster and licensed CC4-BY-NC-SA</p> https://www.lexaloffle.com/bbs/?tid=40679 https://www.lexaloffle.com/bbs/?tid=40679 Fri, 11 Dec 2020 06:34:57 UTC sfx(-1, -2) doesn't stop sound if triggered by menuitem <p>I seem to have found a weird bug. Normally sfx(-1, -2) will stop sfx on all channels, but if it is triggered by a menuitem callback, it doesn't work; in that case only explicitly stopping sfx on each channel works</p> <p>to reproduce, enter some notes on sfx 8 (so you can hear when playback stops), then use this code and compare the behavior of the two menu items:</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 stop_all_sfx_short() sfx(-1, -2) end function stop_all_sfx_long() for i = 0, 3 do sfx(-1, i) end end function _init() menuitem(1, 'stop sfx (-2)', stop_all_sfx_short) menuitem(2, 'stop sfx (long)', stop_all_sfx_long) sfx(8) end function _update() end function _draw() 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=40554 https://www.lexaloffle.com/bbs/?tid=40554 Wed, 25 Nov 2020 21:37:28 UTC print(number, x, y) displays hex in v0.2.1 <p>In the web player here on the BBS which currently says it's version 0.2.1, it appears print() now displays numbers as hex:</p> <img style="margin-bottom:16px" border=0 src="/media/9551/Screenshot from 2020-07-03 17-14-03.png" alt="" /> <p>EDIT: oh wow I didn't realize v0.2.1 was out for real and not just in the BBS web version; I downloaded it and tried running the same cart (#xmasfish) and figured out how to reproduce it so I have corrected the title and description since my first report wrongly said the issue was with tostr()</p> <p>as you can see here, it only displays as hex when x,y arguments are given to print():</p> <img style="margin-bottom:16px" border=0 src="/media/9551/PICO-8_000.png" alt="" /> https://www.lexaloffle.com/bbs/?tid=38667 https://www.lexaloffle.com/bbs/?tid=38667 Sat, 04 Jul 2020 00:17:50 UTC btnp with _update60 stops working after resume (0.2.0i) <p>btnp seems to completely stop working iff _update60 is used instead of the normal _update</p> <p>to reproduce:</p> <ol> <li>run the program below</li> <li>press Esc</li> <li>type some sort of statement (for some reason the bug only occurs if you type something before typing resume) e.g. ?&quot;hello&quot;</li> <li>type resume</li> <li>push or hold down the button (O)</li> </ol> <p>expected: &quot;pushed&quot; will appear onscreen<br /> actual: &quot;pushed&quot; no longer appears onscreen</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 _update60() pushed = btnp(4) end function _draw() cls() if pushed then print(&quot;pushed&quot;, 52, 60, 8) 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=38124 https://www.lexaloffle.com/bbs/?tid=38124 Mon, 25 May 2020 18:44:54 UTC sprite editor: shift + q/w moves too far when zoomed <p>shift + q/w can be used to move up/down in the spritesheet, but when zoomed, the number of sprites it moves by seems to be greater than it should be, i.e. different from how normal q/w (left/right) works when zoomed.</p> <p>(version 0.2.0i)</p> https://www.lexaloffle.com/bbs/?tid=37869 https://www.lexaloffle.com/bbs/?tid=37869 Sun, 10 May 2020 22:34:48 UTC coroutine problem with 0.2.0d (breaks Alfonzo's Bowling Challenge) <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> seems like something in 0.2.0d (I don't know if it's present in earlier bugfixes of 0.2.0) is wonky with coroutines not updating sometimes or something?? different unpredictable problems are actually happening almost every time I run it; check this out (the dialogue is updated in a coroutine):</p> <img style="margin-bottom:16px" border=0 src="/media/9551/alfonzo_0.gif" alt="" /> <p>so far it seems like most of the time it seems to lead to crashing because variables that are declared inside coroutines are attempted to be referenced by code in the main thread but the variable hasn't been defined yet, which seems to also point to the culprit being coroutines mysteriously not updating every frame like they should (the _update60 method in this cart calls coresume on both of the coroutines every frame; there is one for the dialogue and one for controlling the presentation of the &quot;pins&quot; in each level--both of those are the things that seem to be breaking)</p> <p>EDIT: okay I've done a bit more testing and there is definitely an issue where a coroutine just starts updating suuuper slowly (seems likely the same issue as is visible in the GIF above) and basically yields in the middle of itself where I don't have any yield statement. For reference, here is some code inside a coroutine where I added debug printh statements:</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> repeat printh('offset.y:' .. offset.y) printh('vy:' .. vy) if offset.y &gt;= maxtargetoffset then vy = -abs(vy) end printh('one') if targetzipy then if vy &lt; 0 and offset.y &lt; targetzipy then vy -= .1 end elseif offset.y &lt;= 0 then vy = abs(vy) end printh('two') offset.y += vy printh('three') for _, t in pairs(targets) do if not t.isknocked then t.y += vy end end printh('four') while playercount == 0 do yield() end yield() until state ~= state_play or all_offscreen(targets) </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 here is the console output:</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>vy:0.09 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 one done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 two done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines resuming coroutine 1 resuming coroutine 2 done updating coroutines</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 see it's yielding all by itself in the middle of those lines for some reason?? (i.e. the &quot;offset.y:whatever&quot;, &quot;vy:0.09&quot;, &quot;one&quot;, &quot;two&quot;, &quot;three&quot;, &quot;four&quot; should all be next to each other in the console but they are interrupted by several frames)</p> https://www.lexaloffle.com/bbs/?tid=37595 https://www.lexaloffle.com/bbs/?tid=37595 Sun, 26 Apr 2020 04:39:31 UTC SFX editor clipboard breaks after moving SFX in pattern editor <p>after moving (via cut/paste) some SFX in the new super-cool pattern editor view, it seems sometimes it breaks the SFX editor's copy/paste in that when I highlight a few notes, copy them, and try to paste them, it keeps saying a message like &quot;pasted 2 sfx&quot; (instead of &quot;notes&quot;) and has no apparent effect (at least not that I can see from within the SFX editor). I haven't found any way to fix it besides reloading the cart.</p> <p>EDIT: actually I just saw it happen even without using the pattern editor...copy/paste just mysteriously stops working sometimes. it looks like entering some notes makes it start working again though?</p> https://www.lexaloffle.com/bbs/?tid=37564 https://www.lexaloffle.com/bbs/?tid=37564 Fri, 24 Apr 2020 18:09:18 UTC