thisismypassword [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=29645 Assorted (unimportant) oddities in BBS version <p>(Applies to verison 0.1.12d rcsd)</p> <ol> <li> <p>Lua's 'tostring' function is exposed now. It converts things to strings differently than tostr, including printing a table's address in memory.</p> </li> <li>After doing &quot;install_demos()&quot; or &quot;install_games()&quot;, something seems to go majorly wrong with pico-8. All nils become... nulls?!<br /> You can see this by trying to print a non-existing global/table value which would normally print [nil], but now prints [(null)].<br /> What is the type of a null? It's a null, too! (No, not the string &quot;null&quot; - but a null object itself)<br /> (It's clearly not a legal lua value)</li> </ol> <p>You can see the above oddities via my <a href="https://www.lexaloffle.com/bbs/?tid=36381">https://www.lexaloffle.com/bbs/?tid=36381</a> cart, if you'd like.</p> https://www.lexaloffle.com/bbs/?tid=36385 https://www.lexaloffle.com/bbs/?tid=36385 Sat, 28 Dec 2019 02:32:04 UTC Pico-8 REPL/Interpreter <p> <table><tr><td> <a href="/bbs/?pid=71429#p"> <img src="/bbs/thumbs/pico8_pico_repl-17.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=71429#p"> Pico Interpreter (REPL)</a><br><br> by <a href="/bbs/?uid=29645"> thisismypassword</a> <br><br><br> <a href="/bbs/?pid=71429#p"> [Click to Play]</a> </td></tr></table> </p> <h1>What's this?</h1> <p>A REPL (Read-Eval-Print Loop) for pico-8, in pico-8!</p> <p>Supports executing most all lua &amp; pico-8 statements. (if statements, for loops, functions - you name it)</p> <p>While my code does its own parsing and execution of the statements, any functions you call are the real pico-8 functions.</p> <h2>What can I do with it?</h2> <p>Type expressions like <strong>1+3/5</strong> or <strong>sqrt(-2)</strong> to see the expected results. (Well - perhaps unexpected to some in the case of the sqrt)</p> <p>Type statements or programs like the one below to do whatever you wish. (That one prints all global functions)</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>for k, v in pairs(_env) do if (type(v) == &quot;function&quot;) ?k 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>Computations that produce lots of results are automatically paged, computations that do nothing indefinitely can be interrupted via escape (escape works in BBS or SPLORE only)</p> <p>The special variable &quot;_&quot; is set to the value of the last expression you've executed.</p> <p>The special variable &quot;_env&quot; points to the globals table (just like &quot;_ENV&quot; in standard lua/pico-8, just lower-case, making it easier to type)</p> <p>Pico-8's globals are not disturbed and are the same as in a blank Pico-8 cart.</p> <p>You can type &quot;@i=0&quot; to disable all text that &quot;interrupts&quot; the code while its executing, letting the code use up the entire screen. This also disables output paging, but pressing escape to stop execution still works.</p> <h2>What's the point of this? Pico-8 has a REPL already!</h2> <p>The main point of it is that I made it, everything else is up to you.</p> <p>But for example, you can easily take a look at whatever Pico version happens to be running in the BBS, and see how it differs from your own.</p> <h2>Can I use this to write Pico-8 carts?</h2> <p>No. All this allows you to do is to write and execute some code.</p> <p>You can't edit sprites/sfx/etc/etc, or export, or import, etc etc etc.</p> <p>Hopefully that's limited enough to avoid running afoul of any legal concerns.</p> <h2>What are the caveats?</h2> <p>As said, all evaluation other than execution of global functions is implemented by me and may have bugs (feel free to report those), or subtle inconsistencies with real pico8/lua behaviour.</p> <p>No bugs or missing features are currently known.</p> <h2>How do I copy code into the interpreter?</h2> <p>BBS now supports copy/paste, so it's easy - just use Ctrl+V to paste and Ctrl+X/C to cut/copy.</p> <p>Well - cut/copy is currently a bit janky on the BBS - you have to press it twice to get it on the clipboard.</p> <p>Outside the BBS, Ctrl+V still works, but Ctrl+X/C will only work once 0.1.12d hits (most likely).</p> <p>The below hidden section is here for historical reasons, to show how one could have laboriously pasted into the BBS without paste support.</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> <ol> <li>Open your browser's console. (Press Ctrl+Shift+I or F12, then switch to Console tab)</li> <li>Paste &quot;pico8_gpio = new TextEncoder().encode(``)&quot; into the browser's console</li> <li>Between the two backquotes (`), paste the code you want to transfer to the cart.</li> <li>Press enter, the first 128 bytes will now be transferred - you should see them appear in the cart.</li> <li>Paste &quot;pico8_gpio = pico8_gpio.slice(0x80)&quot; into the browser's console.</li> <li>Press enter, the next 128 bytes will be transferred.</li> <li>Goto step 5 until all the code is transferred.</li> </ol> <p></div></div></div></p> <h2>Anything else of interest?</h2> <p>There are some special @-prefixed identifiers which act like special variables:</p> <ul> <li>@interrupt (or @i) : set this to 0 to disable anything that might interfere with the running code (e.g. prompts while running code, override of print function, etc.) (default: 1)</li> <li>@code (or @c) : a table of the most recently input code (item 1 is the previous code, item 2 is the one before it, and so on. item 0 is the current code). You can use this to store the code you've typed somewhere, e.g. <span style=" display:inline-block; background-color:#eee; padding:2px; margin: 4px; padding-left: 8px; padding-right: 8px; color:#222">printh(@c[1], &quot;@clip&quot;)</li> <li>@max_items (or @mi) : the maximal number of items shown when printing a table. -1 means show all. (default: 10)</li> <li>@colors (or @cl) : a table of the colors used, customization! color meaning: {output, errors, interrupts, prompt, input, input errors, comments, constants, keywords, punctuation, pico functions}</li> </ul> <p>As well as some special @-prefixed functions:</p> <ul> <li>@exec (or @x) : a function that takes a string, and executes the string as if it were written in the repl's command line.</li> <li>@eval (or @v) : a function that takes a string, and evaluates the string as a lua expression (with the full power of the repl), returning its result.</li> </ul> <p>And even some special @-prefixed identifiers which perform an action upon access:</p> <ul> <li>@reset (or @rst) : completely resets the cart</li> <li>@run : if _draw/_update/etc were defined, runs them as if from the pico mainloop (not fully compatible)</li> </ul> <p>And some shortcuts:</p> <ul> <li>Ctrl+X/C/V - cut/copy/paste, as already mentioned.</li> <li>Ctrl+B - insert a line-break. (in lieu of shift+enter...)</li> <li>Ctrl+A/E - move cursor to start/end of line (in lieu of home/end...)</li> </ul> <h2>Changelog</h2> <p>That's not a question.<br /> I mean:</p> <h4>v17:</h4> <ul> <li>Fixed editing of large inputs</li> </ul> <h4>v16:</h4> <ul> <li>Added @exec &amp; @eval</li> </ul> <h4>v15:</h4> <ul> <li>Fully working trailing-nil handling. (Thanks to JWinslow23 &amp; sparr for ideas in the discord)</li> </ul> <h4>v14:</h4> <ul> <li>Ctrl+A/E as a poor linuxman's home/end</li> </ul> <h4>v13:</h4> <ul> <li>More trailing-nil handling fixes.</li> </ul> <h4>v12:</h4> <ul> <li>Ctrl+B inserts a line break.</li> <li>Added @reset &amp; @run</li> <li>Minor syntax fixies. (Around pico-8's questionably-parsed syntax)</li> </ul> <h4>v11:</h4> <ul> <li>Fix time()/t() not working correctly.</li> </ul> <h4>v10:</h4> <ul> <li>Supported copying/pasting in BBS. (Now that it's supported by pico)</li> <li>Fixed syntax highlighting in long lines.</li> <li>Fixed some... &quot;security holes&quot; in the repl. (__pairs, global overrides)</li> </ul> <h4>v9:</h4> <ul> <li>Syntax highlighting! (Customizable, too - see @cl)</li> </ul> <h4>v8:</h4> <ul> <li>Added @c to allow programmatically accessing code.</li> <li>Added table printing ({1,2,3} instead of &lt;table&gt;)</li> <li>Some minor syntax fixies</li> </ul> <h4>v7:</h4> <ul> <li>Allow escape to bring up the pause menu when not used to cancel input.</li> </ul> <h4>v6:</h4> <ul> <li>Added paste support</li> <li>2 minor syntax bugfixes</li> </ul> <h4>v5:</h4> <ul> <li>Support goto and tailcalls</li> <li>Fix recursion.</li> </ul> <h4>v4:</h4> <ul> <li>Fix expressions like 'type(nil)'</li> </ul> <h4>v3:</h4> <ul> <li>Support comments, bracket-string literals and all string literal escapes</li> <li>Support dots/colons in function name</li> </ul> <h4>v2:</h4> <ul> <li>Added &quot;@i=0&quot; command to disable &quot;interruptions&quot; while executing code.</li> <li>Fixed nasty glitch that would cause code to sometimes appear to be failing by spamming errors.</li> <li>Fixed paging of 20*k+1 output lines</li> </ul> <h4>v1:</h4> <ul> <li>Original version, support for almost all pico-8/lua syntax.</li> </ul> https://www.lexaloffle.com/bbs/?tid=36381 https://www.lexaloffle.com/bbs/?tid=36381 Thu, 26 Dec 2019 23:09:43 UTC Fairchild Channel F Emulator <p> <table><tr><td> <a href="/bbs/?pid=64568#p"> <img src="/bbs/thumbs/pico8_fairchild001-8.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=64568#p"> Fairchild Channel F Emulator</a><br><br> by <a href="/bbs/?uid=29645"> thisismypassword</a> <br><br><br> <a href="/bbs/?pid=64568#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong>Update 1</strong> - full speed &amp; better sound.<br /> <strong>Update 2</strong> - fix missing mouse cursor.</p> <h2>What is this?</h2> <p>An emulator for the Fairchild Channel F, the first console to use programmable ROMs and a microprocessor.<br /> The console was released in 1975, so don't expect much in the way of graphics, gameplay, or usability.<br /> See <a href="https://en.wikipedia.org/wiki/Fairchild_Channel_F">Wikipedia</a> for more info.</p> <h2>And what's that game running?</h2> <p>That's a homebrewed (i.e. - NOT original) game made by Blackbird and e5frog. You can find it <a href="http://channelf.se/veswiki/index.php?title=Homebrew:Pac-Man">here</a>.<br /> Any sound glitches are due to the emulator, not the game, by the way. (See below)</p> <p>It pushes the capabilities of the console to its limits, so its quality is considerably higher than that of the other games for the console.<br /> It's also anachronistic - the original Pac-Man wasn't released until 1980.</p> <h2>And how do I play other games?</h2> <p>In order to play other games, you first need the console's BIOS files and the ROM for the other game you want to play. (Having these is up to you and they cannot be shared)</p> <p>If you have those, the easiest way to plug them into the emulator is to go to the below webpage which has the emulator together with a convenient UI to upload carts straight to pico-8. (Via the gpio pins, if you're wondering)</p> <p><a href="https://f8p8emu.netlify.com/">Load Other Carts Here</a></p> <p>A less easy way is to bring this convenient UI over to the this webpage, by pressing Ctrl+Shift+I (or perhaps F12) to open developer tools and copy/pasting the contents of the following javascript file into the console (Note that it's not a good idea to copy/paste unknown javascript into the console in general):</p> <p><a href="https://pastebin.com/QLDGyT56">Link to Javascript</a></p> <p>By the way, a BIOS is needed since the &quot;BIOS&quot; included with the emulator is a homebrewed one which is only good enough for running a few games which don't use it much.</p> <p>If you wish to copy the BIOS and ROM to the cart yourself - e.g. via cstore, they should be copied sequentially: BIOS SL31253 or SL90025 to location 0x0, BIOS SL31254 to location 0x400, and the cart to location 0x800. (Just like the Fairchild's own memory layout)</p> <h2>What are the controls?</h2> <p>In &quot;1P&quot; mode (default), the controls are:</p> <ul> <li>arrow keys = move</li> <li>Z = push</li> <li>S/F = rotate left/right</li> <li>E/D = push/pull</li> <li>left shift = hold to control player 2 instead of player 1</li> </ul> <p>In &quot;2P&quot; mode, the controls are:</p> <ul> <li>arrow keys = move</li> <li>N + arrow keys = rotate/push/pull</li> <li>S/F/E/D = player 2 move</li> <li>left shift + S/F/E/D = player 2 rotate/push/pull</li> </ul> <p>In both modes, additional controls are:</p> <ul> <li>X + left/down/up/right = press console key 1/2/3/4. (can also use the mouse)</li> <li>X + Z = switch between 1P/2P modes. (can also use the mouse; only affects the controls)</li> </ul> <h2>What's working well?</h2> <p>All functionality is working and most likely bug-free, so all original and homebrew games work well, including the carts with extra memory.<br /> (Exception: no support for the homebrewed multicart, which is too large for pico8 anyway)</p> <p>Thanks to some optimizations, games now usually run at full speed.</p> <h2>What's not working well?</h2> <p>Sound has occasional glitches (either due to pico8's sound limitations or my implementation).</p> <p>Keys sometime need to be pressed for a few moments to work in some games. This might be due to the original console's controls being slow to press.</p> <h2>What's the point of this?</h2> <p>Proving that emulators for non-trivial systems are possible to do in pico-8.<br /> And just for the fun of creating and/or playing an emulator!</p> https://www.lexaloffle.com/bbs/?tid=34262 https://www.lexaloffle.com/bbs/?tid=34262 Sat, 18 May 2019 21:25:44 UTC Nil Quest - Easy Mode <p> <table><tr><td> <a href="/bbs/?pid=60357#p"> <img src="/bbs/thumbs/pico8_nilquesteasymode-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=60357#p"> nilquesteasymode</a><br><br> by <a href="/bbs/?uid=29645"> thisismypassword</a> <br><br><br> <a href="/bbs/?pid=60357#p"> [Click to Play]</a> </td></tr></table> </p> <p><a href="https://pastecode.xyz/view/02bb45dd">Looking for the Code button? Click here!</a></p> <p><strong><span style="text-decoration: underline;">Controls:</span></strong></p> <p>Up/Down/Left/Right - move North/South/West/East<br /> Z - Interact (Use / Pick up)<br /> X - Use Item</p> <p><strong><span style="text-decoration: underline;">The Story:</span></strong></p> <p>As part of the coming of age ceremony of your village, you are tasked with defeating the vile dragon atop the mountains north of town.</p> <p>Your quest may be more complex than most as you were born blind, deaf, and without the sense of touch.</p> <p>However, don't let that dissuade you! Where your senses fail you, perhaps your sense will prevail!<br /> And so - your quest begins!</p> <p><strong><span style="text-decoration: underline;">Easy Mode?</span></strong></p> <p>That's right! The original proved too hard to get started with, so this version contains some concessions to make that easier. The meat of the game is the same, so if you already beat the original, you won't find anything new here.</p> <p>Just like the original, this version is completely safe-contained and requires only some programming knowledge to complete.</p> <p>And unlike the original - for the first time ever - this version introduces startling 1x1x1bpp graphics!</p> <p><strong><span style="text-decoration: underline;">Did I win?</span></strong></p> <p>If you have to ask, <strong>no</strong>. The victory screen is <strong>very</strong> explicit about it.</p> <p><a href="https://pastecode.xyz/view/02bb45dd">Looking for the Code button? Click here!</a></p> https://www.lexaloffle.com/bbs/?tid=32714 https://www.lexaloffle.com/bbs/?tid=32714 Tue, 25 Dec 2018 22:24:07 UTC Nil Quest <p> <table><tr><td> <a href="/bbs/?pid=59191#p"> <img src="/bbs/thumbs/pico59190.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59191#p"> Nil Quest</a><br><br> by <a href="/bbs/?uid=29645"> thisismypassword</a> <br><br><br> <a href="/bbs/?pid=59191#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong><span style="text-decoration: underline;">Controls:</span></strong></p> <p>Up/Down/Left/Right - move North/South/West/East<br /> Z - Interact (Use / Pick up)<br /> X - Use Item</p> <p><strong><span style="text-decoration: underline;">The Story:</span></strong></p> <p>As part of the coming of age ceremony of your village, you are tasked with defeating the vile dragon atop the mountains north of town.</p> <p>Your quest may be more complex than most as you were born blind, deaf, without the sense of touch, and without the ability to feel pain.</p> <p>However, don't let that dissuade you! Where your senses fail you, perhaps your sense will prevail!<br /> And so - your quest begins!</p> <p>(<a href="https://pastecode.xyz/view/fcc51a0e">Code</a>)</p> https://www.lexaloffle.com/bbs/?tid=32290 https://www.lexaloffle.com/bbs/?tid=32290 Mon, 19 Nov 2018 17:16:47 UTC AES En/decryption <p> <table><tr><td> <a href="/bbs/?pid=59188#p"> <img src="/bbs/thumbs/pico59186.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59188#p"> AES En/decryption</a><br><br> by <a href="/bbs/?uid=29645"> thisismypassword</a> <br><br><br> <a href="/bbs/?pid=59188#p"> [Click to Play]</a> </td></tr></table> </p> <p>An implementation of standard-ish encryption using AES-256-CTR, PBKDF2 &amp; SHA-256-HMAC</p> <p><span style="text-decoration: underline;"><strong>FAQ:</strong></span></p> <p><strong>Q:</strong> What is the point of this? Is anybody expected to waste this metric ton of tokens on an encryption/decryption algorithm that's way too slow to run in pico-8?<br /> <strong>A:</strong> That's not a question.</p> <p><strong>Q:</strong> Did you implement it from scratch? Are you aware that's that a really bad idea in cryptography, as your implementation is no doubt riddled with bugs and inefficiencies?<br /> <strong>A:</strong> That's not a question.</p> <p><strong>Q:</strong> What's the password for the demo? Shouldn't the demo showcase successful decryption instead of a failure?!<br /> <strong>A:</strong> That's not a question.</p> <p><strong>Q:</strong> #<br /> <strong>A:</strong> 59190</p> <p>A(cknowledgement): Demo uses <a href="https://www.lexaloffle.com/bbs/?pid=28610&amp;amp;tid=27669">print9</a> by qbicfeet for preddier text.</p> https://www.lexaloffle.com/bbs/?tid=32288 https://www.lexaloffle.com/bbs/?tid=32288 Mon, 19 Nov 2018 17:11:21 UTC