dw817 [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=15232 Speedrun Playback + Record Tool vA <p> <table><tr><td> <a href="/bbs/?pid=105249#p"> <img src="/bbs/thumbs/pico8_playback_a-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105249#p"> playback_a</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=105249#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS CART</strong></span> in immediate mode, type <code>load #playback_a</code></p> <hr /> <p><span style="color: #80ffff;"><strong>VVhat's new ?</strong></span><br /> (01-17-22)<br /> βœ… New BTN() can now be called with no arguments, returns numeric of all buttons, thanks to <a href="https://www.lexaloffle.com/bbs/?uid=42184"> @SmellyFishstiks</a>.<br /> βœ… Beefed up the documentation and usage instructions.</p> <hr /> <p>First off, I did not make the game. This is JELPI, written by <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a>, a demo game which is included when you purchase Pico-8.</p> <p>What I have written are two primary functions. One to record keystrokes as you play the game and transfer them to the clipboard as new source code - and the other is to simply play them back as you have listed.</p> <p>The <code>btn()</code> function is 436-characters or 141 tokens so it's not that big. The other functions of <code>record()</code> and <code>playback()</code> are quite small, each about 46-characters. That + typing at the top of your code: <code>_b0=btn</code> and you are done. Nothing else is needed.</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> _b0=btn function record() _bm=1_bp=1_bt=0_bd=&quot;&quot; end function playback() _bm=2_bp=1_bt=0 end function btn(p)local b=_b0()if _bm==1then if b!=_bl then if _bd&gt;&quot;&quot;then _bd=_bd.._bt..&quot;,&quot;else _bd=&quot;&quot;_bt=0_bp=1end _bl=b _bd=_bd..b..&quot;,&quot;_bt=0else _bt+=1end if _b0()==15then printh(&quot;btnpb={&quot;..sub(_bd,1,#_bd-1)..&quot;}\n&quot;,&quot;@clip&quot;)stop()end return _b0(p)elseif _bm==2then if _bt&gt;0then _bt-=1else _bs=btnpb[_bp]_bt=btnpb[_bp+1]_bp+=2if _bt==nil then _bm=0end end if p==nil then return _bs elseif band(_bs,2^p)&gt;0then return true else return false end else return _b0(p)end end . . . (( The beginning of your code, _init() or what have you )) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>When you choose RECORD, you can play the game as normal with no changes to your sourcecode. Every keystroke is recorded through a new version of BTN() as you can see. To stop recording at any time by press all 4-arrow keys at the same time, this will also stop the cart and return back to the editor. Then you can choose a line of your source code and press CTRL+V to paste the new button set you just used to play your game. It might appear like this:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> btnpb={0,84,2,109,18,31,2,29,0,74,2,49,0,49,2,29,0,14,1,84,0,19,2,14,0,44,2,9,18,3,22,19,6,9,38,24,6,14,2,24,0,39,1,169,17,23,0,79,2,184,0,34,2,9,18,31,2,89,0,79,16,15,0,84,1,69,0,4,16,11,18,3,2,14,0,49,2,164,18,51,2,109,18,19,2,59,0,104,1,29,0,54,2,4,0,139,2,9,22,23,38,39,6,4,2,9,0,59,2,139,34,159,0,4,16,3,18,31,0,49,1,9,17,71,1,24,0,24,16,23,0,34,1,34,0,49,1,29,0,49,1,14,0,79,1,19,0,79,16,19,17,3,1,9,0,39,1,54,0,34,2,114,18,15,2,154,18,27,2,104,18,39,2,4,0,14,1,39,0,24,2,14,0,79,2,14,0,39,16,15,0,89,2,54,18,27,2,14,0,44,2,209,18,39,2,79,0,9,1,74,0,29,2,9,0,44,16,15,0,59,2,94,18,27,2,74,0,49,16,23,0,59,2,124,18,51,2,49,18,15,2,39,0,24,1,24,17,27,1,9,0,59,2,9,18,27,2,9,0,19,1,9,0,69,15} </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Then select PLAYBACK after the <code>btnpb=</code> definition and run your cart again. You will see all of your keystrokes played back exactly as you did them with exact timing and everything. When the end of your keystrokes is reached, game input returns to normal and you can continue playing your game right where it was left off.</p> <p>There is slight compression in here in that it counts the number of cycles you repeat a keystroke or series of keystrokes. So it doesn't just record 30-numbers for 30-frames of data, that would make the data too big. In fact to play this entire demo game of JELPI above from beginning to end took only 265-numbers or true 687-characters of space.</p> <p>There are more details and instructions in the cart listed above, examine them for additional assistance.</p> <p>And that's it ! Choose RECORD first and play the game as well as you can. When done recording press all 4-arrow keys together. Return to your code and Press CTRL+V to paste the new <code>btnpb</code> (button playback) string. Then select the PLAYBACK function instead of record, run the code, and sit back and watch it.</p> <p>If you want to, paste your own Pico-8 cart playing back your own movements for the game, to show everyone else how well you can play it.</p> <p>If greater compression over raw numbers is desired, (6-bit characters for instance), I can certainly write that for you and increase the btn() function in size slightly with higher compression in the data table.</p> <p><strong>Thanks to <a href="https://www.lexaloffle.com/bbs/?uid=62117"> @Cadaeib65</a> for getting my brain spinning on this.</strong></p> <p>Hope This Helps !</p> https://www.lexaloffle.com/bbs/?tid=46214 https://www.lexaloffle.com/bbs/?tid=46214 Mon, 17 Jan 2022 21:47:46 UTC Free Roaming Directory <p> <table><tr><td> <a href="/bbs/?pid=105036#p"> <img src="/bbs/thumbs/pico8_freeroamingdirectory-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=105036#p"> freeroamingdirectory</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=105036#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS CART</strong></span> in immediate mode, type: <code>load #freeroamingdirectory</code></p> <p>big thanks to <a href="https://www.lexaloffle.com/bbs/?uid=47764"> @b0b89</a> and <a href="https://www.lexaloffle.com/bbs/?uid=41031"> @merwok</a> for information in ls() its use in Pico-8.</p> <img style="" border=0 src="/media/15232/frd 01-13-22_0.gif" alt="" /> <p>What this program does is give you a real directory of where you are when you run it. It will not work online because you must save the cart first. It is for use in the Pico-8 OS only.</p> <p>Use arrow keys to navigate. Press πŸ…ΎοΈ to select that file, print it out, and exit.</p> <p>NOTE ! You must save this cart as a new filename if loaded Online, from Splore, or loaded from # in order for a directory to appear.</p> <p>Because of the limitations of the language, unfortunately, you cannot change directories.</p> <p>I am hoping in time this will change opening up the <code>cd</code> command so you can roam other directories besides just the one it is running in - and to allow viewing all files, not just <code>p8</code> <code>p8l</code> and <code>png.p8</code> but true <code>.png</code> <code>.jpg</code> <code>.bmp</code> <code>.gif</code> and <code>txt</code> as well as recognizing directories inside that directory.</p> https://www.lexaloffle.com/bbs/?tid=46159 https://www.lexaloffle.com/bbs/?tid=46159 Thu, 13 Jan 2022 21:13:11 UTC To Infinity ... <p> <table><tr><td> <a href="/bbs/?pid=104689#p"> <img src="/bbs/thumbs/pico8_to_infinity-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=104689#p"> to_infinity</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=104689#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS CART</strong></span> in immediate mode, type: <code>load #to_infinity</code></p> <img style="" border=0 src="/media/15232/to-infinity.png" alt="" /> <p><span style="color: #80ffff;">Written using 5 Pico-8 commands, see code.</span></p> <p>Back when i was writing S2 (scenario rpgmaker 2), I wanted to have that cool neat zoom effect like you get on the SNES and more modern RPGs when you enter combat, you know, where the screen would blur and rotate and zoom forward.</p> <p>At the time I was working in GFA for windows 3.1 and was told it could not be done, that it would require me to grab every pixel on the screen, calculate their point outward, then redraw them.</p> <p>And yeah the first time I attempted that it was terribly slow and not even that pretty.</p> <p>But then i got to thinking about blitter objects. You could copy from one blitter plane to another and could even stretch them - so why not make use of a single stretched plane to get that zoom effect I wanted ?</p> <p>While not perfect it is still pretty impressive for what it can do using zero variables - and since we now have extended memory to work with in Pico-8, it's overdue that I share with you the method on how I did it so quickly and easily those many years ago from today by making use of that extended memory.</p> <p>Have your screen in whatever state you want it in, then call my <code>toinfinity()</code> routine to have it in one step zoom the screen outward with distortion.</p> <p>And that's it! No need to set-up anything or any arrays. In use it does not affect sprites, mapper, or sound, even if changed already in the program.</p> <p>It =does= use up memory locations <code>E000-FFFF</code> temporarily, but that's about it.</p> <p>Let me know what you think!</p> https://www.lexaloffle.com/bbs/?tid=46100 https://www.lexaloffle.com/bbs/?tid=46100 Sun, 09 Jan 2022 21:38:36 UTC Play OGG/WAV + open webpages in Pico-8 code <p> <table><tr><td> <a href="/bbs/?pid=104586#p"> <img src="/bbs/thumbs/pico8_clipmaster-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=104586#p"> clipmaster</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=104586#p"> [Click to Play]</a> </td></tr></table> </p> <p><strong><span style="color: #80ffff;">I'm going to keep a running total</span></strong> of what gets blocked in Pico-8 or cannot be accessed and - as access is desirable, I'll put it as a task to add to Clipmaster so it can be run in Pico-8. So not now but this thread will get updated and often.</p> <p>The two commands <code>import()</code> and <code>export()</code> do not even work online.</p> <p>The command, <code>ls</code> and <code>dir</code> (same command) do not do anything in code, I remember a time they used to work, however. I could add that to Clipmaster, give you a proper directory with extensions, file sizes, etc.</p> <p>There is no <code>sortarray()</code> command. Blitz has a very fast and robust internal sort routine. This could be added to Pico-8.</p> <p>** There are no large integers, not easily. So, yeah Blitz could dip down and give us quadruple floating point accuracy or internal 64-digit integers. I know we need this ! :D</p> <p>There is no <code>loadtext()</code> or <code>savetext()</code> This would be quite easy to add to Pico-8.</p> <p>There is no <code>deletefile()</code> command. While not very useful as you can only use <code>printh()</code> to save to new text files, it would be useful if it would check and only have it work for <code>.txt</code> files.</p> <p>There is no <code>inputh()</code> where you can read from a text file directly to a variable or array. This would be useful to have and could be done.</p> <p>... many ideas ... should keep me busy for a-while.</p> <p>Having seen other Pico-8 carts making use of external programs that are not pico-8 got me to thinking:</p> <p>&quot;Can this be done with Blitz ?&quot;</p> <p>Yes it can. Having decided to use the clipboard as my driver, I can do all kinds of interesting things, not just audio. And it doesn't even need to be in the same directory as your Pico-8 program. Although when you bundle your program as a final EXE, you can consider doing so.</p> <p>To download my Clipmaster, required for this example, use the following address from Google Drive:</p> <p><a href="https://drive.google.com/file/d/1wUFty36AAHdKVNwHfMMYHKUOL25xKtXJ/view?usp=sharing">https://drive.google.com/file/d/1wUFty36AAHdKVNwHfMMYHKUOL25xKtXJ/view?usp=sharing</a></p> <p>Click the down-facing arrow in the top-right-hand corner of the screen, don't clip Zip Extractor. Use 7zip to unpack if need be. Nice Freeware for unpacking ZIP files.</p> <p><a href="https://www.7-zip.org/a/7z2107-x64.exe">https://www.7-zip.org/a/7z2107-x64.exe</a></p> <p>Run the program from there. <code>Clipmaster 01-08-22.exe</code></p> <p>With the EXE running, In this particular cart, press πŸ…ΎοΈ to play a unique sound effect that is impossible for regular pico-8 to play. And press ❎ to jump to my main website, all controlled inside Pico-8. See the source.</p> <p>While it's still pretty primitive, it does open the option for useful items such as, in this case, playing audio sound effects such as WAV and OGG, even music, and a webpage launcher.</p> <p>Likely there can be many more tasks and things that could be added to it, send me some suggestions and I'll see what can be coded, with your credits for the suggestion if included. :)</p> <p>With the EXE running, In this particular cart, press πŸ…ΎοΈ to play a unique sound effect that is impossible for regular pico-8 to play. And press ❎ to jump to my main website, all controlled inside Pico-8. See the source.</p> <p>From there, as long as you are running the cart in immediate mode, from EXE, or from Splore, it should work just fine. You can test it Online but must press CTRL+V each time, rather defeating the purpose of it. In immediate, EXE, or Splore, you won't need to though.</p> <p>If there's interest, I should be able to add channel ability so you could fade music in on a channel and fade it out just as neatly. <code>printh(&quot;@mus fi 01 logo.ogg&quot;,&quot;@clip&quot;)</code> which would fade in the music <code>logo.ogg</code> and record its ID on channel 01. So to fade it out you could use <code>printh(&quot;@mus fo 01&quot;,&quot;@clip&quot;)</code></p> <p>Once you have Clipmaster running, to shut it down select it and press the Q key to exit.</p> <p>This is exciting territory for me. I will be working here especially determining how BLITZ can assist with data files, load/save/update/delete. I'll limit the system to work only with .TXT and .PNG, nonetheless this opens interesting data opportunities that Pico-8 cannot follow.</p> <p>As always if you have any questions or comments, please feel free to add them below.</p> https://www.lexaloffle.com/bbs/?tid=46071 https://www.lexaloffle.com/bbs/?tid=46071 Sun, 09 Jan 2022 00:46:17 UTC Remapping The Razer Kishi <img style="" border=0 src="/media/15232/kishi.png" alt="" /> <p>Alright so my new Razer Kishi finally arrived.</p> <p>Basically it is a clamp that fits on the left and right side of your cellphone. And it does work with Pico-8 from Firefox, sort of. The arrow keys are the rolling joystick at the top, which is not what I want. I want it to work with the arrow keys beneath that.</p> <p>Is there some way I can remap these keys in Pico-8 from Firefox so they use the standard 4-way arrows ?</p> https://www.lexaloffle.com/bbs/?tid=46054 https://www.lexaloffle.com/bbs/?tid=46054 Fri, 07 Jan 2022 23:32:14 UTC 32 From 16 Colors <p>Fellow Piconians:</p> <ul> <li>While I think I made a fairly effective attempt at getting 256-colors displayed in Pico-8, there is still the flicker.</li> </ul> <p><a href="https://www.lexaloffle.com/bbs/?pid=102333">https://www.lexaloffle.com/bbs/?pid=102333</a></p> <img style="" border=0 src="/media/15232/207_32colors-128x128.png" alt="" /> <p>I've been thinking about the 32-colors available for Pico-8 where you can only display 16 at a time, and was wondering how I would even begin to approach something like taking a 24-bit image and converting it to 16-colors using a palette of 32.</p> <p>It would need to do the following.</p> <ul> <li>Take a 128x128 24-bit image and convert it to 32-colors, I can do this in Blitz.</li> </ul> <p>The hard part which I'm not sure how to approach:</p> <ul> <li>From those 32-colors, determine which of a limited 16 to use and recode the image so it is just using those 16-colors, possibly some from the extended palette, some possibly not, but chosen based upon the closest to the original color set.</li> </ul> <p>It's no so difficult to convert an image to a fixed palette, but to be able to truncate that palette set based upon the proximity of colors in a smaller set, my brain just can't wrap around that.</p> <p>Any ideas ?</p> https://www.lexaloffle.com/bbs/?tid=45944 https://www.lexaloffle.com/bbs/?tid=45944 Sat, 01 Jan 2022 05:52:09 UTC Carry Over Undesired Fill Pattern (Solved) <p>I was experimenting with fill patterns and then went back to the sprite editor to notice something quite out of place. It was drawing pixels according to the fill pattern and would let me fill in the tile completely !</p> <img style="" border=0 src="/media/15232/cx8 12-31-21_0.png" alt="" /> <img style="" border=0 src="/media/15232/cx8 12-31-21_1.png" alt="" /> <p>Try pasting this in immediate mode:</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> fillp(0b0011010101101000) circfill(64,64,20, 0x4e) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Then go to the sprite editor and try drawing pixels.</p> <p>This is not at all desirable behavior for the sprite editor, <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a>, and it should disregard any patterns you were working with.</p> https://www.lexaloffle.com/bbs/?tid=45935 https://www.lexaloffle.com/bbs/?tid=45935 Sat, 01 Jan 2022 01:27:14 UTC One Off Grid Editor (Keyboard) <p> <table><tr><td> <a href="/bbs/?pid=103933#p"> <img src="/bbs/thumbs/pico8_oneoffgrid-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103933#p"> oneoffgrid</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=103933#p"> [Click to Play]</a> </td></tr></table> <strong><span style="color: #ff80ff;">TO LOAD THIS CART</span></strong> in immediate mode type, <code>load #oneoffgrid</code><br /> <strong><span style="color: #80ffff;">VVhat's new ?</span></strong><br /> (12-31-21)<br /> βœ… changed the edit sprites so they are more visible.<br /> βœ… shaved off 5-extra chars through some code rewrite.</p> <hr /> <p> <table><tr><td> <a href="/bbs/?pid=103933#p"> <img src="/bbs/thumbs/pico8_oneoffgrid-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103933#p"> oneoffgrid</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=103933#p"> [Click to Play]</a> </td></tr></table> <br /> <strong>OLD BOX-GRID VERSION</strong><br /> <strong><span style="color: #ff80ff;">TO LOAD THIS CART</span></strong> in immediate mode type, <code>load #oneoffgrid-0</code></p> <hr /> <p>Since the recent additions to Pico-8, you can now use PRINT to draw 1-bit pixeled images in a command set called P8SCII which you can find more information about HERE:</p> <p><a href="https://www.lexaloffle.com/dl/docs/pico-8_manual.html#One_off_characters">https://www.lexaloffle.com/dl/docs/pico-8_manual.html#One_off_characters</a></p> <p>One such way is to use 16-characters of 2-digit hexadecimal to each row in an 8x8 pixel format.</p> <p>This Tweet&sup2; and tool at 441-characters or 225 tokens will let you draw one and then copy it directly to the clipboard so you can in immediate mode in Pico-8, press CTRL+V to see it there or directly in your code. This should make it easier to include 1-color sprites for future Tweet carts at a cost of only 22 normal ASCII characters.</p> <p>The one I wrote here does not use the mouse. Instead it uses the arrow keys for navigation and πŸ…ΎοΈ to plot/unplot a pixel and ❎ to save to clipboard and continue.</p> <p>If you want to see your work instantly after saving to clipboard and you are running my program in the Pico-8 system, press the ESC key to exit to immediate mode, then press CTRL+V and ENTER to see what you just drew.</p> <p>Want to start with an image every time ? Load up the cart, go to the sprites and edit the first sprite #0 there with black 0 and white 7 pixels. Then every time you run that image will appear in the edit frame. Useful if for instance you want to start with all white pixels every time.</p> <p>I would also like to acknowledge and give credit to <a href="https://www.lexaloffle.com/bbs/?uid=16423"> @Krystman</a>, <a href="https://www.lexaloffle.com/bbs/?uid=50382"> @CoffeeBat</a>, and <a href="https://www.lexaloffle.com/bbs/?uid=40394"> @brettski</a> who went before me exploring this command and concept.</p> <p><span style="color: #80ffff;">Which grid do you prefer or do you have a suggestion of your own for this tool ?</span></p> <p>Any questions or comments, please be sure to enter them below.</p> https://www.lexaloffle.com/bbs/?tid=45929 https://www.lexaloffle.com/bbs/?tid=45929 Fri, 31 Dec 2021 18:39:48 UTC Pico-8 On RetroArch For Android <img style="" border=0 src="/media/15232/retroarch logo.png" alt="" /> <p>I am just now getting into Retroarch for my cellphone, Galaxy A01 Rev 3.0, and understanding how to configure it for different gaming systems like NES and PS1.</p> <p>One of the systems it supports is Pico-8, apparently an early version.</p> <p>Yet I'm not seeing any way to port modern Pico-8 to it, 0.2.4.</p> <p>Is there a way ?</p> https://www.lexaloffle.com/bbs/?tid=45866 https://www.lexaloffle.com/bbs/?tid=45866 Sun, 26 Dec 2021 22:24:20 UTC Replace System Font In Print <p> <table><tr><td> <a href="/bbs/?pid=103215#p"> <img src="/bbs/thumbs/pico8_newfont2021-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103215#p"> newfont2021</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=103215#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS PICO-8 CART</strong></span> in immediate mode, type: <code>load #newfont2021</code></p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> color(8) ?&quot;Now is the time&quot; color(9) ?&quot;for all good men&quot; color(10) ?&quot;to come to the&quot; color(11) ?&quot;country.&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>After some very thorough digging I did manage to find a few Piconians making use of the new ability to change the system font to another, yet none of the explanations seemed really simple to follow.</p> <p>So once I finally understood - I thought I would toss my hat into the ring to show an easier way to replace the default 5x3 font with a new 8x8 font - which is included. See the source for details.</p> <p>And it's not using <code>SPR()</code> or <code>SSPR()</code> but <code>PRINT</code>, so it really is a true font replacement ! And you have the ability to plot it in color or make use of the new P8SCII codes on it if you so choose.</p> <p><a href="https://pico-8.fandom.com/wiki/P8SCII">https://pico-8.fandom.com/wiki/P8SCII</a></p> <p>To type in lowercase for PRINT, use CTRL+P, a notice saying <code>PUNY FONT</code> will appear and then you must hold SHIFT to type back in uppercase. Press CTRL+P again to leave Puny Font mode - and you are back.</p> <p>Hope This Helps !</p> https://www.lexaloffle.com/bbs/?tid=45783 https://www.lexaloffle.com/bbs/?tid=45783 Mon, 20 Dec 2021 22:59:58 UTC Running FLIP() In Tac-08 On The RG-350 <img style="" border=0 src="/media/15232/rg-350.png" alt="" /> <p>If you have ever used Tac-08, an early Pico-8 emulator for the RG-350 handheld gaming device, you will be painfully aware that certain commands do not work. These especially, <code>flip()</code> <code>memcpy()</code> <code>reload()</code> and <code>cstore()</code></p> <p>While you can still use <code>cartdata()</code> and <code>dset()</code> for permanently saved data, many programmers including myself have difficulty coding with the absence of <code>flip()</code>.</p> <p>Thanks to <a href="https://www.lexaloffle.com/bbs/?uid=24137"> @luchak</a>'s guidance, I can see now how to use <code>yield()</code> in its place. And as near as I can tell, it's perfect and remarkably simple to prepare. Let's take this example program:</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> function main() cls() repeat pset(rnd(128),rnd(128),rnd(16)) _flip() until forever end function _init() _flip=yield _main=cocreate(main) end function _update() coresume(_main) end </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <hr /> <p>Let's go through it.</p> <p>You have <code>_init()</code> create a new command called <code>_flip</code> which is the same thing as <code>yield</code> You also create the pointer to a looped process, in this case our main program. And NO it doesn't matter if you call '_flip' outside of the <code>main()</code> function, inside a WHILE/END, REPEAT/UNTIL, or FOR/END, however you still must initialize the main program.</p> <p>The <code>_update()</code> only has one programming line, to resume and loop our main routine. This is needed to get it started. Anytime you <code>_flip()</code> it will exit from wherever it is, come here to do a single screen update, then jump right back exactly where you left it, even if it's a different function or loop entirely.</p> <hr /> <p>And there you have it ! To change existing carts, load one up that uses <code>flip()</code> and change it to <code>_flip()</code> making the necessary changes in the code with the addition of <code>_init()</code> and <code>_update()</code> Then it will run correctly in Tac-08.</p> <p>To do a global replace of <code>flip()</code> to <code>_flip()</code> you can edit it in NOTEPAD and select [E]dit, [R]eplace.</p> <p>Type <code>flip()</code> in the <code>Find what</code> field and <code>_flip()</code> in the <code>Replace with</code> field. Select Replace [A]ll.</p> <p>If that's too much work, you can load the cart in Pico-8, then in the editor, press CTRL+F, type in the search term: <code>flip()</code> followed by ENTER and replace all occurances with <code>_flip()</code> Press CTRL+H to find the next match and continue manually making changes until you return back to the top of the code where <code>_flip()</code> already exists.</p> <p>Here is an example game I wrote some time ago that earlier did <span style="color: #ff8080;">not</span> run on the Tac-08 but <span style="color: #00ffff;">now</span> does with the new <code>_flip()</code> in place ! And verified. I just checked, this cart I wrote now runs perfectly on the RG-350. It had 6 <code>flip()</code> in it originally. All have been changed now to <code>_flip()</code></p> <p> <table><tr><td> <a href="/bbs/?pid=103132#p"> <img src="/bbs/thumbs/pico8_dowawewete-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103132#p"> dowawewete</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=103132#p"> [Click to Play]</a> </td></tr></table> </p> <p>It is indeed a wonderful thing to be able to open existing carts that earlier would not run on Tac-08 and now making use of new <code>_flip()</code> - they can run well and for the very first time ! Making the RG-350 portable gaming console that much more valuable an asset to Pico-8 gamers and programmers worldwide.</p> <p><span style="color: #80ffff;"><strong>HOPE THIS HELPS !</strong></span></p> https://www.lexaloffle.com/bbs/?tid=45761 https://www.lexaloffle.com/bbs/?tid=45761 Sun, 19 Dec 2021 22:58:36 UTC Flipping Out <p> <table><tr><td> <a href="/bbs/?pid=103074#p"> <img src="/bbs/thumbs/pico8_flippingout-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=103074#p"> flippingout</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=103074#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS PICO-8 CART</strong></span> in immediate mode, type: <code>load #flippingout</code></p> <p>I am having great difficulty coding the game I am working on using conventional _update() method - to keep track of all the elements, some of which need to lock the controls and flow for a tight loop, others of which open up the main system again.</p> <p>For instance, I want to have a scene where you might animate something from point A to point B. Play a sound while that animation is taking place, wait until the sound is completed, then animate point B to C. I wrote some sample code. While my game has little to do with this demo, the loop constructs are very similar and just as complex.</p> <p>Watching the demo, it all looks pretty simple and yes it can be if you use FOR/NEXT and FLIP().</p> <p>Yet how would you write something like this using only _update() with no FLIP() whatsoever ? To get the exact same results in timing, motion, and pauses - that is beyond my understanding.</p> <p><span style="color: #808080;">... heading out for a few hours, will definitely return to see how you yourself would code this using _update() notation.</span></p> https://www.lexaloffle.com/bbs/?tid=45746 https://www.lexaloffle.com/bbs/?tid=45746 Sat, 18 Dec 2021 22:56:34 UTC 40 Christmas Pictures <p> <table><tr><td> <a href="/bbs/?pid=102941#p"> <img src="/bbs/thumbs/pico8_magic8bitdither-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102941#p"> magic8bitdither</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=102941#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS PICO-8 CART</strong></span> in immediate mode, type out: <code>load #magic8bitdither</code></p> <p><strong><span style="color: #80ffff;"> (12-30-21) VVhat's new ?</span></strong></p> <p>βœ… Clean-up of code.<br /> βœ… Took the older hollow pictures and replaced them with new better looking ones.<br /> βœ… Increased number to 40-pictures. My goal is 50, I'm not there yet !<br /> βœ… Press πŸ…ΎοΈ or ❎ to hide/reveal information.</p> <p>Make it a game for your friends. Hide information panel and go through the 40-pics, see if they can correctly identify each by reveal and hide.</p> <p><span style="color: #80ffff;">OLDER NOTES</span></p> <p>As Christmas is rapidly approaching I thought I would take one of my older holiday programs and rewrite it from scratch and greatly improve upon the original code using near 8-bit compression instead of earlier 6-bit.</p> <p>It takes a text file and converts it to 128x128 dithered pixel image, the largest being 610-string text characters in size.</p> <p>It also includes the compressor just in case you want to use it yourself for your own creations.</p> <p>In running the program use the LEFT and RIGHT arrow keys to navigate. That's it !</p> <p>Examine the source-code to see how it is done.</p> <p>If you are interested in my first iteration of this, you can find it HERE:</p> <p><a href="https://www.lexaloffle.com/bbs/?pid=70218">https://www.lexaloffle.com/bbs/?pid=70218</a></p> <p>I've had a few people asking me in private Email as I have listed it, when am I going to finish the game I'm writing in Pico-8 ? The big project.</p> <p>That's the problem. I see games as finite. They are here. Enjoyable. And once won, then what ?</p> <p>It is much more interesting for me to write tools to assist others in their game development. Nonetheless I am back - and am working on the game. I hope to have it completely finished by the end of the year - which is rapidly upcoming. I will let you know.</p> <p>So have a very merry and a cool yule ! πŸŽ„</p> https://www.lexaloffle.com/bbs/?tid=45737 https://www.lexaloffle.com/bbs/?tid=45737 Fri, 17 Dec 2021 00:10:05 UTC Recover from system crash <p>I just had my computer crash as I was testing code. I had not saved it for an hour but was running it quite often. Before my computer crashed I had just run the program 1-minute prior.</p> <p>Found my code despite not having saved for an hour.</p> <p>At first I couldn't find it searching <code>\backup\</code> for <code>DI</code> which is the beginning two characters of my code.</p> <p>So then I searched by date and FOUND it. The filename is encoded inside <code>\backup\</code> using the following notation:</p> <p><code>1111 22 33 4 555555 6 7.. 8</code></p> <ol> <li>The first 4-digits are the YEAR.</li> <li>The next 2-digits are the MONTH.</li> <li>The next 2-digits are the DAY (01-31).</li> <li>There is a single underline character.</li> <li>Then - I'm not sure, it appears to be a 6-digit ID code. It is definitely not the hour and minutes. The higher the ID # though then the more recent copy you saved.</li> <li>There is another underline.</li> <li>Then the remaining characters are the name of your project that you saved initially.</li> <li>The extension is <code>.p8</code></li> </ol> <p>. . .</p> <p>So there you have it ! As long as you have saved your program once and run it once <code>\backup\</code> will save a copy every time you RUN or execute your program.</p> <p>Even if you have not saved your program, every time you run it your project name will be <code>&quot;untitled&quot;</code> so you can still recover it provided you have it RUN or executed it at least once.</p> <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> may I suggest that you also auto-save your program every 5-minutes or the minutes between auto-saves can be entered into configuration.</p> <p>While it seems unlikely I suppose if <code>\backup\</code> does achieve a size of 1 gigabyte or larger, ZEP, you might inform the user when a new save is made so they can manually trim the folder themselves.</p> <p>Hope This Helps !</p> https://www.lexaloffle.com/bbs/?tid=45735 https://www.lexaloffle.com/bbs/?tid=45735 Thu, 16 Dec 2021 20:42:25 UTC Autofire O X + Swap O X <p> <table><tr><td> <a href="/bbs/?pid=102886#p"> <img src="/bbs/thumbs/pico8_autofire-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102886#p"> autofire</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=102886#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS CART IN PICO-8,</strong></span> type in immediate mode: <code>load #autofire</code></p> <p><span style="color: #80ffff;"><strong>VVhat's new ?<br /> (01-07-22)<br /> βœ… Added menu to reload after selecting an option instead of closing like earlier.</strong></span></p> <p>There have been many Pico-8 game players wanting to have autofire ability, mostly for shooters and auto-selection RPG choices, and in some cases players want to be able to swap the O and X buttons.</p> <p>Well this program has a foundation that is about as simple as you can get.</p> <p>In it you use 6-single key variables, ⬅️ ➑️ ⬆️ ⬇️ πŸ…ΎοΈ ❎ which can be easily typed in Pico-8 source-code by holding down the shift key and pressing any of L R U D O X which will appear as a special non-ASCII character.</p> <p>If any of these variables are TRUE, then that means the player is holding down the button for the corresponding switch.</p> <p>However, if you pause for the MENU with P or ENTER you will see 3-new options.</p> <p><code>AUTOFIRE πŸ…ΎοΈ ON</code><br /> <code>AUTOFIRE ❎ ON</code><br /> <code>SWAP πŸ…ΎοΈ AND ❎</code></p> <p>In selecting the first or second options, you will now have variable πŸ…ΎοΈ or ❎ stagger its shots. And of course in selecting one or the other it does not automatically turn autofire on both buttons. You get to select which, none, first, second, or both.</p> <p>The last option is pretty self-explanatory. It will swap reading the πŸ…ΎοΈ AND ❎ buttons thus later if selected and you press the πŸ…ΎοΈ button, the ❎ variable will become true and vice-versa.</p> <p>Feel free to examine the code and see what is happening here. The code in _UPDATE() is about as simple as it can get it. In _INIT() call function initbuttons().</p> <p>In your main program when you are ready to read keystrokes, call the function getkeys().</p> <div> <div style="max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre> function _update() n=1 cls() getkeys() if ⬅️ then n=2 x=x-1 end if ➑️ then n=3 x=x+1 end if ⬆️ then n=4 y=y-1 end if ⬇️ then n=5 y=y+1 end if πŸ…ΎοΈ then n=6 end if ❎ then n=7 end spr(n,x,y) 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>Where you type each of the special arrows above by holding down the SHIFT key and L, R, U, and D respectively.</p> <p>And that's it ! The rest is handled automatically.</p> <p>It is my wish that future Pico-8 will have these options automatically available for any cart, and can be optionally turned on or off to appear in menus and to select your autofire rate, currently defined in _init().</p> <p>Hope This Helps !</p> https://www.lexaloffle.com/bbs/?tid=45728 https://www.lexaloffle.com/bbs/?tid=45728 Thu, 16 Dec 2021 02:19:33 UTC Suppress Warnings <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a>, could you PLEASE remove or give an option to remove the warning message that appears only in this newest 0.2.4 version of Pico-8 that states the following everytime I boot or type REBOOT:</p> <img style="" border=0 src="/media/15232/warning-slow.png" alt="" /> <p><span style="color: #ff8080;">WARNING: RUNNING BELOW 30FPS</span></p> <p>Remember we can always press CTRL+P during runtime to see if frames-per-second is lagging in our code.</p> <p>Thank you.</p> https://www.lexaloffle.com/bbs/?tid=45723 https://www.lexaloffle.com/bbs/?tid=45723 Wed, 15 Dec 2021 23:51:19 UTC TWEET: Color Paint <p> <table><tr><td> <a href="/bbs/?pid=102523#p"> <img src="/bbs/thumbs/pico8_tweetpaint-4.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102523#p"> tweetpaint</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=102523#p"> [Click to Play]</a> </td></tr></table> <span style="color: #ff80ff;"><strong>TO LOAD THIS PICO-8 CART,</strong></span> in immediate mode, type: <code>load #tweetpaint</code></p> <p><span style="color: #80ffff;">VVhat's new ?<br /> βœ… (12-21-21) Always have white cursor, suggested by </span><a href="https://www.lexaloffle.com/bbs/?uid=61259"> @fsdsdsffs</a></p> <p> <table><tr><td width=32> <img src="https://www.lexaloffle.com/bbs/gfxc/15232_2.png" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_15232_2"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/15232_2.txt", function (retdata){ var el = document.getElementById("gfxcode_15232_2"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_15232_2" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> <br /> What with the Christmas holidays coming up there's a good chance a bunch of you may be stuck in line in some grocery store or shopping mall so - having seen all the little paint programs rolling around, thought I would write up my own for you to test your art skills in as you're waiting to make your purchases.</p> <p>It's super-small too at 245-characters or 132-tokens.</p> <p>Tweets I am understanding allow up to 280-characters so this definitely qualifies as a tweet and can be posted on Twitter if so desired.</p> <p>How to use. Very simple. Use the mouse or your finger to draw. It does not use the right-click, only the left click so it should run neatly on your cellphone, tablet, or gaming device that recognizes touch-screen and Pico-8. To select a new color either hover your mouse to the right or touch your finger to the right to see the color choices.</p> <p>Click or press your finger on the new color and you are ready to draw again. Color black is also available if you want to erase some of your work.</p> <p>To clear the screen and start over merely bring up the menu and select &quot;RESET CART&quot; or if you have a keyboard, press CTRL+R keys together.</p> <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> ! Could you please add two commands like PICTOBBS(H,V,X,Y) and SPRTOBBS(H,V,X,Y) where H+V determine the starting coordinates in your sprites and X+Y determine the size across and down and converts the image area to a true clipboard paste-able pic like:</p> <p>{gfx}080800030000003e3000038373000032300003c3a300383b3e300004000000000000{/gfx}</p> <p>Also the ability while running a Pico-8 cart in the BBS to be able to do the same from a side icon like so:</p> <img style="" border=0 src="/media/15232/178_new-button.png" alt="" /> <p>This would be excellent for art programs to show drawn screens and to grab screenshots of existing carts, especially if they crash or if someone has won the game and wants to show their final score. Thanks !</p> <p><span style="color: #ff80ff;">Also Piconians, if this is not running properly</span> on your system, please let me know as it runs fine here in Pico-8 version 0.2.4.</p> <p>And there you have it. Enjoy !</p> https://www.lexaloffle.com/bbs/?tid=45684 https://www.lexaloffle.com/bbs/?tid=45684 Mon, 13 Dec 2021 01:41:20 UTC Merry Christmas 2021 with 256-Colors <p> <table><tr><td> <a href="/bbs/?pid=102333#p"> <img src="/bbs/thumbs/pico8_trucolor256-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102333#p"> trucolor256</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=102333#p"> [Click to Play]</a> </td></tr></table> <strong><span style="color: #ff80ff;">TO LOAD THIS PICO-8 CART </span></strong>in immediate mode type, <code>load #trucolor256</code></p> <p><strong><span style="color: #80ffff;">VVhat's new ?</span></strong></p> <p><strong>12/16/21</strong><br /> βœ… Changed code so it will load any image, 3-bytes per pixel or 4-bytes per pixel such as images that include transparent layers. Thanks to <a href="https://www.lexaloffle.com/bbs/?uid=45958"> @jo560hs</a> for catching this error.<br /> βœ… Set the code to exit if you choose WEBSITE. No need for it to keep running.</p> <p> <table><tr><td> <a href="/bbs/?pid=102333#p"> <img src="/bbs/thumbs/pico8_mayasurama-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=102333#p"> mayasurama</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=102333#p"> [Click to Play]</a> </td></tr></table> </p> <p> <table><tr><td width=32> <img src="https://www.lexaloffle.com/bbs/gfxc/15232_0.png" width=32 height=32> </td> <td valign=bottom> <a style="cursor:pointer;font-size:8pt" onclick=' var el = document.getElementById("gfxcode_15232_0"); if (el.style.display == "none") el.style.display = ""; else el.style.display = "none"; microAjax("https://www.lexaloffle.com/bbs/gfxc/15232_0.txt", function (retdata){ var el = document.getElementById("gfxcode_15232_0"); el.innerHTML = retdata; el.focus(); el.select(); } ); '> [8x8]</a> </td></tr> <tr><td colspan=2> <textarea rows=3 class=lexinput id="gfxcode_15232_0" style="width:640px;background-color:#fed;display:none;overflow:hidden; font-size:6pt;"></textarea> </td> </tr> </table> From the lab of dw817 here is me wishing Happy Holidays to all of you. :)</p> <p>Not only do you get a nice Christmas greeting in 256-colors, (you might need to squint a bit to remove the flicker), you can create your own 256-color pictures to add to your own Pico-8 games with the EXE tool I've included as well as some sample pictures to try on your own.</p> <p><img style="" border=0 src="/media/15232/pic1.png" alt="" /> <img style="" border=0 src="/media/15232/181_pic2.png" alt="" /> <img style="" border=0 src="/media/15232/pic6.png" alt="" /> <img style="" border=0 src="/media/15232/pic7.png" alt="" /></p> <p>You can also import any PNGs or JPGs of any proportion or image size from your own collection or from the internet, my program will accept them all the same.</p> <p>Once the filebox appears and you decide you want JPG, Press TAB and the down arrow key to change to view JPG images.</p> <p><a href="https://www.mediafire.com/file/i4ki5m561d1nkom/To256+(12-10-21).zip">https://www.mediafire.com/file/i4ki5m561d1nkom/To256+(12-10-21).zip</a></p> <p>To record your results you can save to the clipboard replacing the single line that contains your picture or save an entirely new Pico-8 program that features just the image you've put in it. No need to paste.</p> <p>If you choose clipboard, once the code is run, go back to your Pico-8 code and press the following keys:</p> <p>CTRL+P CTRL+V CTRL+P</p> <p>Make certain you press CTRL+P twice. Once before and after CTRL+V. Then the image will be pasted properly.</p> <p>Also this affects none of your sprites, mapper, SFX, or music. They are all untouched once the picture has been seen. This demo shows a box appear in the center at the end which is from the sprite worksheet to show nothing is affected.</p> <p>The playback routine is also pretty small too at 186-tokens, and outside of the picture, no other code is needed.</p> <p><span style="color: #ff80ff;">If you get flicker,</span> and you are using Firefox, shut it down completely and bring it back up. Apparently the timer is getting garbled somehow. I have received no flicker at all running it in the P8 system, however.</p> <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> ! Please add ability to play carts at 120fps =or= allow someone to plot 2-pixels in the same space merging the colors with the original. Doing so should remove the last of the flicker in this particular code.</p> <p>If this cart becomes popular I'll consider adding to the converter the ability to edit the image in true-256 color fashion where you can fill in regions to match other colors so the direct conversion looks better as well as fine-tune editing - useful for real photographs which will almost always give trouble converting to 256-colors.</p> <p>And there you have it !</p> <p>As always if you have any questions, comments, or kerosene, please direct them below.</p> <p><strong><span style="color: #80ffff;">Merry Christmas !</span></strong></p> https://www.lexaloffle.com/bbs/?tid=45648 https://www.lexaloffle.com/bbs/?tid=45648 Fri, 10 Dec 2021 22:26:31 UTC Graphic Redirect (Solution) <p>I'm hoping I am just not understanding the code rather than there is a problem here with the new ability to redirect drawing memory positions.</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> cls() poke(0x5f55,0x80) for i=0,127 do for j=0,127 do pset(j,i,rnd()*16) end end poke(0x5f55,0x60) memcpy(0x6000,0x8000,0x2000) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>See HERE in BASE RAM Memory layout:</p> <p><a href="https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Base_RAM_Memory_Layout">https://www.lexaloffle.com/dl/docs/pico-8_manual.html#Base_RAM_Memory_Layout</a></p> <p>If it's not a problem in the language, then what am I doing wrong here ?</p> <p>. . .</p> <p><span style="color: #80ffff;">From the comments below it's clear I can only choose from 2-different memory locations. Maybe future Pico-8 will allow upper memory location to draw in. Just trying to find a use for that whopping extra 32768 bytes. :)</span></p> https://www.lexaloffle.com/bbs/?tid=45601 https://www.lexaloffle.com/bbs/?tid=45601 Mon, 06 Dec 2021 23:08:11 UTC Big Integers <p> <table><tr><td> <a href="/bbs/?pid=101378#p"> <img src="/bbs/thumbs/pico8_big_integer-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=101378#p"> big_integer</a><br><br> by <a href="/bbs/?uid=15232"> dw817</a> <br><br><br> <a href="/bbs/?pid=101378#p"> [Click to Play]</a> </td></tr></table> </p> <p><a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> has added the ability to have long-integer access in numbers in these last few releases of Pico-8. While I would've preferred it to be a string of any length with any number of decimal places, this is the next best thing.</p> <p>In this code I have written 4-functions to ease the use of this new 32-bit format.</p> <p>They are:</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> stringadd() stringsub() stringmul() stringdiv() </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>They are as simple to use as having the following code for multiplication:</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> a=&quot;32845&quot; b=&quot;40211&quot; print(stringmul(a,b)) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The results will be:<br /> 34829090</p> <p>Addition is easy too:</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> a=&quot;12345678&quot; b=&quot;87654321&quot; print(stringadd(a,b)) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The results will be 8 9's.<br /> 99999999</p> <p>Negative numbers also work in this example of integer division:</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> a=&quot;758632&quot; b=&quot;-2&quot; print(stringdiv(a,b)) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>The results will be:<br /> -379316</p> <p>Run the program above to see further instructions and usage - and press (X) to go to the calculator and see how effectively it works in all 4 operands of add, subtract, multiply, and divide.</p> <p>Press (O) in the calculator to save off your current calculation to the clipboard.</p> <p>If you only want to add and subtract numbers up to and including 64-digits, you might be interested in my earlier outing on number crunching found HERE:</p> <p><a href="https://www.lexaloffle.com/bbs/?tid=35715">https://www.lexaloffle.com/bbs/?tid=35715</a></p> <p>Hope This Helps !</p> <p>On a side note what I'm really hoping is ZEP in the future will make a function so you can do instant complex calculations like:</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> valu=calculate(&quot;7.238/(4123747.98685*-89.34)^sin(&quot;..lva..&quot;)*1.3867&quot;,xx,yy) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Where xx is the number of digits to work with and yy is the number of decimal places to work with. LVA also being a normal floating point variable or string variable, both would be accepted. And it could only do calculations, no other function so it's safe to use.</p> <p>Anyways, if you have any questions or comments about usage and/or would like to write improvements to my code above - I'm always welcome to learn new things, feel free to address them below.</p> https://www.lexaloffle.com/bbs/?tid=45549 https://www.lexaloffle.com/bbs/?tid=45549 Fri, 03 Dec 2021 22:36:55 UTC