shiftalow [Lexaloffle Blog Feed]https://www.lexaloffle.com/bbs/?uid=32759 DBG() [Displays any timing debugging value] <p> <table><tr><td> <a href="/bbs/?pid=132923#p"> <img src="/bbs/thumbs/pico8_knutil_dbg-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132923#p"> knutil_dbg</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=132923#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>DBG()</code> Displays any timing value in real time.</p> <ul> <li>Executed with arguments, it stacks values for display.</li> <li>You need to specify 'd?' at the timing you want to display.</li> <li>When the stacked value display is complete, it is reset.</li> <li>This function consumes 71 Token.</li> </ul> <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 _update() dbg('Debug Test!',time()) end function _draw() dbg('d?') -- 'Debug Test! [time value]' 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>This function will be included in the next version(0.14.0) of <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.<br /> If you want to stop processing and investigate detailed values, consider <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a>.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=53711 https://www.lexaloffle.com/bbs/?tid=53711 Thu, 10 Aug 2023 13:40:57 UTC AMID() [Returns the median positive and negative] <p> <table><tr><td> <a href="/bbs/?pid=132902#p"> <img src="/bbs/thumbs/pico8_knutil_amid-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132902#p"> knutil_amid</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=132902#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>AMID()</code> Returns the median of a given positive and negative number.</p> <ul> <li>It is used in controlling the camera and parameters that can swing either + or -.</li> <li>This function consumes 10 Token.</li> </ul> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>x,y=0,0 w,h=16,8 -- range of movement(*2+1) while 1 do cls(12) camera(-64,-64) rectfill(w,h,-w,-h,0) ?'⬆️⬇️⬅️➡️ key to move',-60,-60 x+=tonum(btn(1))-tonum(btn(0)) x=amid(w,x) y+=tonum(btn(3))-tonum(btn(2)) y=amid(h,y) pset(x,y,8) ?x..' '..y,-w,h+1,7 flip() 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>This function will be included in the next version(0.14.0) of <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.<br /> If you want to determine that two values are within range, consider <a href="https://www.lexaloffle.com/bbs/?tid=35802">INRNG()</a>.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=53703 https://www.lexaloffle.com/bbs/?tid=53703 Wed, 09 Aug 2023 14:42:22 UTC HTD() [Split a continuous string of hexadecimal numbers] <p> <table><tr><td> <a href="/bbs/?pid=132863#p"> <img src="/bbs/thumbs/pico8_knutil_htd-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132863#p"> knutil_htd</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=132863#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>HTD()</code> Split a continuous string of hexadecimal numbers into a table.</p> <ul> <li>the number of supported delimited bits is 4,8,12,16 bits (1~4 nibbles).</li> <li>characters that cannot be converted to numbers are ignored. <ul> <li>the result of the api's <code>tonum('0x'..v)</code> of the api.</li> </ul></li> <li>depending on the delimiter, a missing last character will result in a lower digit by the number of missing characters.</li> <li>This function consumes 30 Token.</li> </ul> <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> local a=htd('12a30f',1) -- a={1,2,10,3,0,15} local b=htd('12a30f',3) -- b={297,783} </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Perhaps consider <a href="https://www.lexaloffle.com/bbs/?tid=50425">BUNPACK()</a> if you want to separate NUMBER every few bits.</p> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=53696 https://www.lexaloffle.com/bbs/?tid=53696 Tue, 08 Aug 2023 10:18:29 UTC ECPALT() [set transparency from palette table] <p> <table><tr><td> <a href="/bbs/?pid=132688#p"> <img src="/bbs/thumbs/pico8_knutil_ecpalt-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=132688#p"> knutil_ecpalt</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=132688#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>ECPALT()</code> set transparency from palette table.</p> <ul> <li>Transparency is reset at each function execution.</li> <li>If the value of the &quot;color id key&quot; in the palette table is 0, the palette becomes transparent.</li> <li>The palette that was made black by <code>MKPAL()</code> can be used as transparent as it is.</li> <li>The format is redundant due to the specification to match <code>MKPAL()</code>.</li> <li>This function consumes 20 Token.</li> </ul> <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>-- Make 6, 7, and 13 transparent. ecpalt({[6]=0,[7]=0,[13]=0}) spr(1,16,32,2,2) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function will be included in the next version(0.14.0) of <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=53623 https://www.lexaloffle.com/bbs/?tid=53623 Mon, 07 Aug 2023 15:57:25 UTC MKPAL() [Create a color swap table] <p> <table><tr><td> <a href="/bbs/?pid=130356#p"> <img src="/bbs/thumbs/pico8_knutil_mkpal-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130356#p"> knutil_mkpal</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=130356#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>MKPAL()</code> Create a color swap table for use in <code>PAL()</code>.</p> <ul> <li>This is useful for creating several color patterns.</li> <li>It is not an error if the number of elements in the swap table does not match.</li> <li>This function consumes 44 Token.</li> </ul> <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>-- Color swap to darken &quot;blue, white, and green&quot;. local p=mkpal({12,7,11},{13,6,3}) -- mkpal('c7b','d63') is also the same. pal(p) spr(1,16,32,2,2) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function will be included in the next version(0.14.0) of <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52934 https://www.lexaloffle.com/bbs/?tid=52934 Mon, 07 Aug 2023 06:15:14 UTC Reset P8SCII cursor movement by newline code <p>Horizontal alignment is reset when a <strong>line break</strong> or <strong>tab</strong> is inserted in p8scii.</p> <p>The example below expects the first line to start at the beginning of the first line after a line break.<br /> Also, the tab position seems to reset the shift cursor.</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>cls() ?&quot;\+jjtest p8scii\ntest p8scii (𝘹ADJUST:j)&quot;,0,0 ?&quot;\+ljtest p8scii\ntest p8scii (𝘹ADJUST:l)&quot;,0,16 ?&quot;\-jtest\-j p8scii (𝘹ADJUST:j)&quot;,0,64 ?&quot;\-ltest\-l p8scii (𝘹ADJUST:l)&quot;,0,72 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p> <table><tr><td> <a href="/bbs/?pid=130237#p"> <img src="/bbs/thumbs/pico8_p8scii_nl_adjust_bug-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130237#p"> p8scii_nl_adjust_bug</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=130237#p"> [Click to Play]</a> </td></tr></table> </p> https://www.lexaloffle.com/bbs/?tid=52893 https://www.lexaloffle.com/bbs/?tid=52893 Sun, 28 May 2023 06:18:31 UTC OPRINT() [Printing with outline] <p> <table><tr><td> <a href="/bbs/?pid=130214#p"> <img src="/bbs/thumbs/pico8_knutil_oprint-3.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130214#p"> knutil_oprint</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=130214#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>OPRINT()</code> Adds outlines to text and prints them.</p> <ul> <li>enclosure is not possible if tabs or newlines are included. (in pico8_v0.2.5.g)</li> <li>operation cannot be guaranteed if p8scii for decoration is included.</li> <li>Custom decorations other than outlines can be made by specifying a comma-separated p8scii as an argument.</li> <li>This function consumes 33 Token.</li> </ul> <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>-- Split a pair of data and further split it into colors and names. oprint('outline print',10,6,7,13) -- text, x, y, foreground-color, outline-color [, custom decoration] </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is an inheritance of OUTLINE contained in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.3</strong></p> <ul> <li>add custom decoration argument.</li> </ul> <p><strong>v0.2</strong></p> <ul> <li>remove color()</li> </ul> <p><strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52886 https://www.lexaloffle.com/bbs/?tid=52886 Sat, 27 May 2023 15:02:46 UTC 5*5px custom font 「傾きかな」(Katamuki kana) <p>When you see the default kana font, you might think that you could create something a little better.<br /> But then you realize that it was a kind of provocation for creators (or designers).</p> <h2>Why the tilt?</h2> <p>Hiragana can be quite difficult to express in 5x5px.<br /> One answer to this problem is a slanted design.<br /> This allowed us to secure a space, albeit a small one, per character.</p> <h3>x4 size</h3> <img style="margin-bottom:16px" border=0 src="/media/32759/custom_font_5_8_6_x4.png" alt="" /> <h3>Original size</h3> <img style="margin-bottom:16px" border=0 src="/media/32759/custom_font_5_8_6.png" alt="" /> <h3>Preview gif</h3> <img style="margin-bottom:16px" border=0 src="/media/32759/knutil_5.gif" alt="" /> <h3>Text conversion scripts for SpreadSheet custom scripts</h3> <p>This script converts &quot;Kana/Kana&quot; text to &quot;Katamuki kana&quot; specification in a spreadsheet.<br /> Register it in a custom script and execute <code>p8Katamukikana([Cell-ID])</code> on the cell you want to convert.</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 p8Katamukikana(text) { const kanamap = { 'が': 'か゛', 'ぎ': 'き゛','ぐ': 'く゛','げ': 'け゛','ご': 'こ゛', 'ざ': 'さ゛', 'じ': 'し゛','ず': 'す゛','ぜ': 'せ゛','ぞ': 'そ゛', 'だ': 'た゛', 'ぢ': 'ち゛','づ': 'つ゛','で': 'て゛','ど': 'と゛', 'ば': 'は゛', 'び': 'ひ゛','ぶ': 'ふ゛','べ': 'へ゛','ぼ': 'ほ゛', 'ぱ': 'は゜', 'ぴ': 'ひ゜','ぷ': 'ふ゜','ぺ': 'へ゜','ぽ': 'ほ゜', 'ガ': 'カ゛', 'ギ': 'キ゛','グ': 'ク゛','ゲ': 'け゛','ゴ': 'コ゛', 'ザ': 'サ゛', 'ジ': 'シ゛','ズ': 'ス゛','ゼ': 'セ゛','ゾ': 'ソ゛', 'ダ': 'タ゛', 'ヂ': 'チ゛','ヅ': 'ツ゛','デ': 'テ゛','ド': 'ト゛', 'バ': 'ハ゛', 'ビ': 'ヒ゛','ブ': 'フ゛','ベ': 'ヘ゛','ボ': 'ホ゛', 'パ': 'ハ゜', 'ピ': 'ヒ゜','プ': 'フ゜','ペ': 'ヘ゜','ポ': 'ホ゜', 'ぁ': '&hellip;', 'ぃ': '➡️','ぅ': '★','ぇ': '⧗','ぉ': '⬆️', 'ァ': 'ˇ', 'ィ': '&and;','ゥ': '❎','ェ': '▤','ォ': '▥', 'ゔ': 'う゛', 'ヴ': 'ウ゛','ぅ゙': 'ぅ゛','ゥ゙': 'ゥ゛', 'ー': '-', '-': '-', '~': '~', } var result = '' for (var i = 0; i &lt; text.length; i++) { result += kanamap[text.charAt(i)] || text.charAt(i); } return result; }</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <img style="margin-bottom:16px" border=0 src="/media/32759/スクリーンショット 2023-05-29 143859.png" alt="" /> <h3>Notes</h3> <p>chrcode 144-153 are used as discarded kana.(ぁぃぅぇぉァィゥェォ)</p> <p>It is quite difficult to maintain hiragana visibility at small sizes. As a desperate measure, I tilted the characters and crammed them into that area.<br /> <code>Katamuki = tilt</code></p> https://www.lexaloffle.com/bbs/?tid=52858 https://www.lexaloffle.com/bbs/?tid=52858 Thu, 25 May 2023 14:08:03 UTC MSPLIT() [Multi-layer split] <p> <table><tr><td> <a href="/bbs/?pid=130014#p"> <img src="/bbs/thumbs/pico8_knutil_msplit-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=130014#p"> knutil_msplit</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=130014#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>MSPLIT()</code> Converts a string into a table by splitting it with multiple delimiters.</p> <ul> <li>The default delimiter is &quot; &quot; for ease of data entry and readability(according to one's own preference).</li> <li>the default delimiters and numeric conversion flags should be modified according to your project.</li> <li>This function consumes 36 Token.</li> </ul> <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>-- Split a pair of data and further split it into colors and names. local value=msplit( '10-yellow 11-green 8-red 12-blue' ,' ','-' ) for i,v in pairs(value) do local col,name=unpack(v) ?name,i*32-24,48,col 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>If you want to check the type at once, consider using a <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a>.<br /> This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52825 https://www.lexaloffle.com/bbs/?tid=52825 Mon, 22 May 2023 08:40:56 UTC TOHEX() [Hexadecimal conversion with aligned digits] <p> <table><tr><td> <a href="/bbs/?pid=129956#p"> <img src="/bbs/thumbs/pico8_knutil_tohex-1.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=129956#p"> knutil_tohex</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=129956#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>TOHEX()</code> Converts to a hexadecimal string filled with zeros.</p> <ul> <li>If the number of digits is not specified, specify 0.</li> <li>The maximum number of digits specified is 4.</li> <li>This function consumes 40 Token.</li> </ul> <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>?tohex(32) -- 20 ?tohex(32,3) -- 020 ?tohex('0x32',1) -- 32 </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52809 https://www.lexaloffle.com/bbs/?tid=52809 Sat, 20 May 2023 10:56:52 UTC TONORM() [Normalize argument string values] <p> <table><tr><td> <a href="/bbs/?pid=129901#p"> <img src="/bbs/thumbs/pico8_knutil_tonorm-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=129901#p"> knutil_tonorm</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=129901#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><code>TONORM()</code> normalize argument values (strings) to the correct type.</p> <ul> <li>Mainly converts from strings to values of the correct type. <ul> <li>Especially used to initialize multiple values from a long string, see <strong><a href="https://www.lexaloffle.com/bbs/?tid=36325">HTBL()</a></strong>.</li> </ul></li> <li>Hexadecimal numbers are converted to decimal numbers.</li> <li>This function consumes 28 Token.</li> </ul> <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> ?tonorm('true') -- true (The type is 'boolean') ?tonorm('nil') -- [nil] (The type is 'nil') </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.<br /> If you want to check the type at once, consider using a <a href="https://www.lexaloffle.com/bbs/?tid=32830">DMP()</a>.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52789 https://www.lexaloffle.com/bbs/?tid=52789 Fri, 19 May 2023 08:17:10 UTC EXRECT() [Extended function rectangle object] <p> <table><tr><td> <a href="/bbs/?pid=128952#p"> <img src="/bbs/thumbs/pico8_knutil_exrect-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=128952#p"> knutil_exrect</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=128952#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p><strong>EXRECT()</strong> creates a rectangle object with extended functionality.</p> <ul> <li>The created rectangle object can be drawn and its inclusions and overlaps can be checked.</li> <li>Drawing and update functions return their own objects, so they can be written in succession.</li> <li>This function consumes 388 Token.(include <strong><a href="https://www.lexaloffle.com/bbs/?tid=46985">comb()</a></strong> and <strong><a href="https://www.lexaloffle.com/bbs/?tid=41798">cat()</a></strong> functions)</li> </ul> <img style="margin-bottom:16px" border=0 src="/media/32759/exrect_0.gif" alt="" /> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>r = exrect('10 80 16 24') -- generate a rectangle object from a string. x:10, y:10, width:16, height:24 r.rf(6).rs(7) -- draw &quot;r&quot; with rectfill, and then draw it again with rect. ?r.con(13,80) -- true ?r.con(9,80) -- false ?r.con(exrect'12 82 8 8') -- true ?r.con(exrect'9 82 8 8') -- false ?r.hov(exrect'12 82 8 8') -- true ?r.hov(exrect'9 82 8 8') -- true --Check the code for further applications! </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52503 https://www.lexaloffle.com/bbs/?tid=52503 Mon, 24 Apr 2023 10:24:33 UTC Double-clicking resets the search word. <p>In the code editor's search function, if you enter a search word and then double-click on the text, the search word is reset and you cannot use <code>ctrl + G</code>( or <code>ctrl + H</code>) to search for the next word.</p> <img style="margin-bottom:16px" border=0 src="/media/32759/instantplay_5.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=52186 https://www.lexaloffle.com/bbs/?tid=52186 Mon, 27 Mar 2023 10:05:25 UTC P8 One-off characters Capture(P8SCII Art Converter) <p> <table><tr><td> <a href="/bbs/?pid=127257#p"> <img src="/bbs/thumbs/pico8_p8ooccapture-7.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=127257#p"> p8ooccapture</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=127257#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>Capture the string for &quot;One-off character&quot; used in P8SCII from the sprite sheet and copy it to the clipboard.</p> <img style="margin-bottom:16px" border=0 src="/media/32759/p8ooccapture p8_3.gif" alt="" /> <ul> <li>Simply print() the copied string to draw an image like spr().</li> <li>No decoder implementation is required.</li> </ul> <h1>!! Uses mouse control which does not work with BBS.</h1> <h1>Please download and use it. !!</h1> <p><strong>Type on your console</strong></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>&gt; load #p8ooccapture</pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>Note: Turn on &quot;PUNY FONT MODE&quot; when pasting into the code.<br /> Depending on the character, sound may be made or the display of raw characters may be corrupted.</p> <p>I have made one in the past with fillp and rectfill for equivalent purposes(<a href="https://www.lexaloffle.com/bbs/?tid=32807">FILLPatDraw</a>), and I believe P8OOCPrint will be lighter and faster performing than this.</p> <h2>Control method</h2> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"></p> <div> <div class=scrollable_with_touch style="width:100%; max-width:800px; overflow:auto; margin-bottom:12px"> <table style="width:100%" cellspacing=0 cellpadding=0> <tr><td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> <td background=/gfx/code_bg0.png> <div style="font-family : courier; color: #000000; display:absolute; padding-left:10px; padding-top:4px; padding-bottom:4px; "> <pre>mouse moving: move cursor ctrl/cmd key + mouse moving: grid movement left button drag: capture size change ctrl/cmd + left button drag: change multiple selections right button drag (space-bar): scroll screen ctrl/cmd + right button drag (space-bar): screen grid scrolling mouse wheel: zoom in/out of screen ctrl/cmd + c key one-off character captured in full color ctrl/cmd + shift + c key capture one-off character in silhouette enter open the pause menu - copy code: the sample code for drawing is in this. - custom font: encoding using custom fonts. custom font setup code is also copied to clipboard when captured. **when printing a capture, it is recommended to specify coordinates.** </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p></div></div></div></p> <h3>Printed samples of One-off characters</h3> <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>--** Add [\^.] to the copied CHARACTER and print(). **-- ?&quot;\^.\0\14\14&gt;&gt;&gt;\0\0&quot; -- Tilted Heart ?&quot;\^.\0\0「\0B&lt;\0\0&quot; -- Smiling mouth ?&quot;\^.ヲュ◜◝◝○?゜&quot; -- Tilted crystal </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <h3>Update history</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.6.0</strong></p> <ul> <li>fix: changed some escape characters to one-character notation.(more compression)</li> <li>fix: avoided a bug that caused an error if the coordinates of the click start were not taken.</li> </ul> <p><strong>v0.5.0</strong></p> <ul> <li>add: the functionto encode using custom fonts. set in the pause menu.</li> <li>add: [ui] display horizontal and vertical numbers for multiple selections.</li> <li>fix: avoided notation of adjacent control characters and numbers.</li> </ul> <p><strong>v0.4.0</strong></p> <ul> <li>add: support for repeating instructions <code>&quot;\*x&quot;</code> for duplicate patterns.</li> <li>add: delete whitespace before line break.</li> <li>add: [ui]color-coded sprite sheet range.</li> <li>add: [ui]compressor initialization with message.</li> <li>add: [ui]displays a guide cursor for range selection and multiple selections.</li> <li>add: [ui]adjust the scroll range of the sprite sheet.</li> <li>fix: [ui]adjustment of range and multiple selections.</li> <li>fix: [ui]hide ui during selection operation.</li> <li>fix: changed position display to 0-padding.</li> <li>del: eliminated compression of inverted fills.</li> </ul> <p><strong>v0.3.0</strong></p> <ul> <li>add: support for single-character expressions by matching against default font patterns.</li> <li>fix: substitution to split character codes 0~15 and numeric characters.</li> <li>add: the most frequent patterns are selected as shortened characters. (default font supported)</li> <li>add: instruction to turn off P8SCII's border background.</li> </ul> <p><strong>v0.2.0</strong></p> <ul> <li>add: supports grid movement.</li> <li>add: sprite capture size change.</li> <li>add: captures of multiple sprites at once.</li> <li>add: support for drag-and-drop import of sprites.</li> <li>add: copy of code for simple drawing to menu.</li> <li>fix: conversion method of control codes &quot;\0 \14 \15&quot;.</li> <li>fix: add double quotation marks to the capture code</li> </ul> <p><strong>v0.1.0</strong></p> <ul> <li>first release.<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=52069 https://www.lexaloffle.com/bbs/?tid=52069 Fri, 17 Mar 2023 06:50:17 UTC STRDSUM() [Summation by String] <p> <table><tr><td> <a href="/bbs/?pid=125166#p"> <img src="/bbs/thumbs/pico8_strdsum-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=125166#p"> strdsum</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=125166#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>STRDSUM() sums two numerable strings.</p> <ul> <li>The number of digits it can handle exceeds the 32-bit limit. (Probably as long as the system will allow.)</li> <li>Match the string length to the longer of the two arguments.</li> <li>Negative values and values after the decimal point cannot be handled.(Insert a period in the output result.)</li> <li>This function consumes 63 Token.</li> </ul> <p><strong>This code may cause errors in versions prior to 0.2.5c.</strong></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>?strdsum('32768','32768') -- 65536 ?strdsum('500','000500') -- 001000 ?strdsum('900109','123456') -- 1023565 </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=51451 https://www.lexaloffle.com/bbs/?tid=51451 Thu, 02 Feb 2023 12:58:33 UTC Binary export cart startup failure on M1Mac <p>Hello <a href="https://www.lexaloffle.com/bbs/?uid=1"> @zep</a> </p> <p>One of my game players reported this.<br /> It seems that Pico8 games downloaded from Steam sometimes fail to start when a controller is connected.</p> <h3>Target game in which the bug occurred.</h3> <p><a href="https://store.steampowered.com/app/1448220/KONSAIRI/">https://store.steampowered.com/app/1448220/KONSAIRI/</a></p> <h3>Running environment</h3> <ul> <li>Apple silicon Mac.</li> <li>Gamepad &quot;Sony PlayStation&reg; DualSense&trade; Wireless Controller&quot; ----<a href="https://www.apple.com/jp/shop/product/HPNG2J/A/sony-playstation-dualsense%E2%84%A2%E3%83%AF%E3%82%A4%E3%83%A4%E3%83%AC%E3%82%B9%E3%82%B3%E3%83%B3%E3%83%88%E3%83%AD%E3%83%BC%E3%83%A9">STORE PAGE</a>.</li> <li>Using Steam's controller linkage function (Bluetooth).</li> <li>Exported cart pico8 version 0.2.2c (also occurs in 0.2.5e)</li> </ul> <h3>Crash report</h3> <p><a href="https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing">https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing</a></p> <p>Thank you for your cooperation.</p> https://www.lexaloffle.com/bbs/?tid=50998 https://www.lexaloffle.com/bbs/?tid=50998 Mon, 09 Jan 2023 08:37:41 UTC The pause menu is not shown in the screenshot.(v0.2.5c) <p>In the screenshot, the pause menu does not appear.</p> <p>But in the case of GIF output, the pause menu seems to appear.<br /> (version 0.2.5c)</p> <img style="margin-bottom:16px" border=0 src="/media/32759/instantload_3.gif" alt="" /> https://www.lexaloffle.com/bbs/?tid=32409 https://www.lexaloffle.com/bbs/?tid=32409 Fri, 09 Dec 2022 12:06:06 UTC BPACK() [Pack with bit value. (different bit widths supported)] <p> <table><tr><td> <a href="/bbs/?pid=59572#p"> <img src="/bbs/thumbs/pico8_knutil_bpack-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59572#p"> knutil_bpack</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=59572#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>BPACK() pack the value of the bit specification with bit width.</p> <ul> <li>By packs in the direction of low bits when multiple bit values are specified.</li> <li>By setting [number s] to a negative value, bit pack can be started from the decimal point.</li> <li>If there are fewer bit-width elements relative to the value to be packed, the bit-width elements are rotated.</li> <li>This function consumes 37 Token.</li> </ul> <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> v=bpack({8,4},0,0xff,0xb) ?tostr(v,1) -- 0x00ff.b000 (bit-left-shift:0) v=bpack({8,4},8,0xff,0xb) ?tostr(v,1) -- 0xffb0.0000 (bit-left-shift:8) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=32418 https://www.lexaloffle.com/bbs/?tid=32418 Thu, 01 Dec 2022 13:18:51 UTC BUNPACK() [The bit value slice and unpack] <p> <table><tr><td> <a href="/bbs/?pid=121616#p"> <img src="/bbs/thumbs/pico8_knutil_bunpack-2.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=121616#p"> knutil_bunpack</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=121616#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>BUNPACK() slice the value with bit width.</p> <ul> <li>By specifying the argument after [number w], a value of up to 32 bits can be sliced.</li> <li>By setting [number s] to a negative value, bit slice can be started from the decimal point.</li> <li>This function consumes 30 Token.</li> </ul> <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> a,b=bunpack(0xf8,4,4,4) -- Value, First bit-shift, bit-width, ...[bit-width] ?a -- 15 (0xf) ?b -- 8 (0x8) </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=50425 https://www.lexaloffle.com/bbs/?tid=50425 Wed, 30 Nov 2022 12:12:38 UTC TBFILL() [Table fill, Multi-dimensional table support] <p> <table><tr><td> <a href="/bbs/?pid=59934#p"> <img src="/bbs/thumbs/pico8_knutil_tbfill-0.png" style="height:256px"></a> </td><td width=10></td><td valign=top> <a href="/bbs/?pid=59934#p"> knutil_tbfill</a><br><br> by <a href="/bbs/?uid=32759"> shiftalow</a> <br><br><br> <a href="/bbs/?pid=59934#p"> [Click to Play]</a> </td></tr></table> </p> <h2>Feature Overview</h2> <p>TBFILL() Create a table by specifying an index number.</p> <ul> <li>Create the table with the specified minimum and maximum indices and fill it with the value of the first argument.</li> <li>Multi-dimensional tables can be created by adding minimum and maximum arguments.</li> <li>This function consumes 30 Token.</li> </ul> <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>-- one-dimensional table t=tbfill('yes',1,3) ?t[1]..' '..t[2]..' '..t[3]..&quot;\n\n&quot; -- two-dimensional table t=tbfill('yes',1,2,1,3) t[2][2]='no' ?t[1][1]..' '..t[1][2]..' '..t[1][3] ?t[2][1]..' '..t[2][2]..' '..t[2][3] </pre></div></td> <td background=/gfx/code_bg1.png width=16><div style="width:16px;display:block"></div></td> </tr></table></div></div> <p>This function is included in the <a href="https://www.lexaloffle.com/bbs/?tid=32411">KNUTIL</a> library.</p> <h3>release note</h3> <p><div><div><input type="button" value=" Show " onClick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display != '') { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = ''; this.innerText = ''; this.value = ' Hide '; } else { this.parentNode.parentNode.getElementsByTagName('div')[1].getElementsByTagName('div')[0].style.display = 'none'; this.innerText = ''; this.value = ' Show '; }"></div><div><div style="display: none;"><br /> <strong>v0.3</strong></p> <ul> <li>changed to specify elements for table start and end, variable length arguments supported</li> </ul> <p><strong>v0.2</strong></p> <ul> <li>defaults to 1 or specifies the start of the table</li> </ul> <p><strong>v0.1</strong></p> <ul> <li>first release<br /> </div></div></div></li> </ul> https://www.lexaloffle.com/bbs/?tid=32541 https://www.lexaloffle.com/bbs/?tid=32541 Mon, 12 Sep 2022 09:27:07 UTC