I like pixeled graphics and chiptune sound game.
I just released a pico-8 game on Steam!
https://store.steampowered.com/app/1448220
And More Tools!
[Animation tool]
https://bitchunk.itch.io/spranim-kit
[Music scales and Play the Piano]
https://bitchunk.itch.io/mu-scalelab
Feature Overview
DBG()
Displays any timing value in real time.
- Executed with arguments, it stacks values for display.
- You need to specify 'd?' at the timing you want to display.
- When the stacked value display is complete, it is reset.
- This function consumes 71 Token.
function _update() dbg('Debug Test!',time()) end function _draw() dbg('d?') -- 'Debug Test! [time value]' end |
This function will be included in the next version(0.14.0) of KNUTIL library.
If you want to stop processing and investigate detailed values, consider DMP().
release note
Feature Overview
AMID()
Returns the median of a given positive and negative number.
- It is used in controlling the camera and parameters that can swing either + or -.
- This function consumes 10 Token.
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 |
This function will be included in the next version(0.14.0) of KNUTIL library.
If you want to determine that two values are within range, consider INRNG().
release note
Feature Overview
HTD()
Split a continuous string of hexadecimal numbers into a table.
- the number of supported delimited bits is 4,8,12,16 bits (1~4 nibbles).
- characters that cannot be converted to numbers are ignored.
- the result of the api's
tonum('0x'..v)
of the api.
- the result of the api's
- depending on the delimiter, a missing last character will result in a lower digit by the number of missing characters.
- This function consumes 30 Token.
local a=htd('12a30f',1) -- a={1,2,10,3,0,15} local b=htd('12a30f',3) -- b={297,783} |
Perhaps consider BUNPACK() if you want to separate NUMBER every few bits.
This function is included in the KNUTIL library.
release note
Feature Overview
ECPALT()
set transparency from palette table.
- Transparency is reset at each function execution.
- If the value of the "color id key" in the palette table is 0, the palette becomes transparent.
- The palette that was made black by
MKPAL()
can be used as transparent as it is. - The format is redundant due to the specification to match
MKPAL()
. - This function consumes 20 Token.
-- Make 6, 7, and 13 transparent. ecpalt({[6]=0,[7]=0,[13]=0}) spr(1,16,32,2,2) |
This function will be included in the next version(0.14.0) of KNUTIL library.
release note
Feature Overview
MKPAL()
Create a color swap table for use in PAL()
.
- This is useful for creating several color patterns.
- It is not an error if the number of elements in the swap table does not match.
- This function consumes 44 Token.
-- Color swap to darken "blue, white, and green". local p=mkpal({12,7,11},{13,6,3}) -- mkpal('c7b','d63') is also the same. pal(p) spr(1,16,32,2,2) |
This function will be included in the next version(0.14.0) of KNUTIL library.
release note
Horizontal alignment is reset when a line break or tab is inserted in p8scii.
The example below expects the first line to start at the beginning of the first line after a line break.
Also, the tab position seems to reset the shift cursor.
cls() ?"\+jjtest p8scii\ntest p8scii (𝘹ADJUST:j)",0,0 ?"\+ljtest p8scii\ntest p8scii (𝘹ADJUST:l)",0,16 ?"\-jtest\-j p8scii (𝘹ADJUST:j)",0,64 ?"\-ltest\-l p8scii (𝘹ADJUST:l)",0,72 |
Feature Overview
OPRINT()
Adds outlines to text and prints them.
- enclosure is not possible if tabs or newlines are included. (in pico8_v0.2.5.g)
- operation cannot be guaranteed if p8scii for decoration is included.
- Custom decorations other than outlines can be made by specifying a comma-separated p8scii as an argument.
- This function consumes 33 Token.
-- 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] |
This function is an inheritance of OUTLINE contained in the KNUTIL library.
release note
When you see the default kana font, you might think that you could create something a little better.
But then you realize that it was a kind of provocation for creators (or designers).
Why the tilt?
Hiragana can be quite difficult to express in 5x5px.
One answer to this problem is a slanted design.
This allowed us to secure a space, albeit a small one, per character.
x4 size

Original size

Preview gif

Text conversion scripts for SpreadSheet custom scripts
This script converts "Kana/Kana" text to "Katamuki kana" specification in a spreadsheet.
Register it in a custom script and execute p8Katamukikana([Cell-ID])
on the cell you want to convert.
function p8Katamukikana(text) { const kanamap = { 'が': 'か゛', 'ぎ': 'き゛','ぐ': 'く゛','げ': 'け゛','ご': 'こ゛', 'ざ': 'さ゛', 'じ': 'し゛','ず': 'す゛','ぜ': 'せ゛','ぞ': 'そ゛', 'だ': 'た゛', 'ぢ': 'ち゛','づ': 'つ゛','で': 'て゛','ど': 'と゛', 'ば': 'は゛', 'び': 'ひ゛','ぶ': 'ふ゛','べ': 'へ゛','ぼ': 'ほ゛', 'ぱ': 'は゜', 'ぴ': 'ひ゜','ぷ': 'ふ゜','ぺ': 'へ゜','ぽ': 'ほ゜', 'ガ': 'カ゛', 'ギ': 'キ゛','グ': 'ク゛','ゲ': 'け゛','ゴ': 'コ゛', 'ザ': 'サ゛', 'ジ': 'シ゛','ズ': 'ス゛','ゼ': 'セ゛','ゾ': 'ソ゛', 'ダ': 'タ゛', 'ヂ': 'チ゛','ヅ': 'ツ゛','デ': 'テ゛','ド': 'ト゛', 'バ': 'ハ゛', 'ビ': 'ヒ゛','ブ': 'フ゛','ベ': 'ヘ゛','ボ': 'ホ゛', 'パ': 'ハ゜', 'ピ': 'ヒ゜','プ': 'フ゜','ペ': 'ヘ゜','ポ': 'ホ゜', 'ぁ': '…', 'ぃ': '➡️','ぅ': '★','ぇ': '⧗','ぉ': '⬆️', 'ァ': 'ˇ', 'ィ': '∧','ゥ': '❎','ェ': '▤','ォ': '▥', 'ゔ': 'う゛', 'ヴ': 'ウ゛','ぅ゙': 'ぅ゛','ゥ゙': 'ゥ゛', 'ー': '-', '-': '-', '~': '~', } var result = '' for (var i = 0; i < text.length; i++) { result += kanamap[text.charAt(i)] || text.charAt(i); } return result; } |

Notes
chrcode 144-153 are used as discarded kana.(ぁぃぅぇぉァィゥェォ)
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.
Katamuki = tilt
Feature Overview
MSPLIT()
Converts a string into a table by splitting it with multiple delimiters.
- The default delimiter is " " for ease of data entry and readability(according to one's own preference).
- the default delimiters and numeric conversion flags should be modified according to your project.
- This function consumes 36 Token.
-- 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 |
If you want to check the type at once, consider using a DMP().
This function is included in the KNUTIL library.
release note
Feature Overview
TOHEX()
Converts to a hexadecimal string filled with zeros.
- If the number of digits is not specified, specify 0.
- The maximum number of digits specified is 4.
- This function consumes 40 Token.
?tohex(32) -- 20 ?tohex(32,3) -- 020 ?tohex('0x32',1) -- 32 |
This function is included in the KNUTIL library.
release note
Feature Overview
TONORM()
normalize argument values (strings) to the correct type.
- Mainly converts from strings to values of the correct type.
- Especially used to initialize multiple values from a long string, see HTBL().
- Hexadecimal numbers are converted to decimal numbers.
- This function consumes 28 Token.
?tonorm('true') -- true (The type is 'boolean') ?tonorm('nil') -- [nil] (The type is 'nil') |
This function is included in the KNUTIL library.
If you want to check the type at once, consider using a DMP().
release note
Feature Overview
EXRECT() creates a rectangle object with extended functionality.
- The created rectangle object can be drawn and its inclusions and overlaps can be checked.
- Drawing and update functions return their own objects, so they can be written in succession.
- This function consumes 388 Token.(include comb() and cat() functions)

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 "r" 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! |
This function is included in the KNUTIL library.
release note
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 ctrl + G
( or ctrl + H
) to search for the next word.

Feature Overview
Capture the string for "One-off character" used in P8SCII from the sprite sheet and copy it to the clipboard.

- Simply print() the copied string to draw an image like spr().
- No decoder implementation is required.
!! Uses mouse control which does not work with BBS.
Please download and use it. !!
Type on your console
> load #p8ooccapture |
Note: Turn on "PUNY FONT MODE" when pasting into the code.
Depending on the character, sound may be made or the display of raw characters may be corrupted.
I have made one in the past with fillp and rectfill for equivalent purposes(FILLPatDraw), and I believe P8OOCPrint will be lighter and faster performing than this.
Control method
Printed samples of One-off characters
--** Add [\^.] to the copied CHARACTER and print(). **-- ?"\^.\0\14\14>>>\0\0" -- Tilted Heart ?"\^.\0\0「\0B<\0\0" -- Smiling mouth ?"\^.ヲュ◜◝◝○?゜" -- Tilted crystal |
Update history
Feature Overview
STRDSUM() sums two numerable strings.
- The number of digits it can handle exceeds the 32-bit limit. (Probably as long as the system will allow.)
- Match the string length to the longer of the two arguments.
- Negative values and values after the decimal point cannot be handled.(Insert a period in the output result.)
- This function consumes 63 Token.
This code may cause errors in versions prior to 0.2.5c.
?strdsum('32768','32768') -- 65536 ?strdsum('500','000500') -- 001000 ?strdsum('900109','123456') -- 1023565 |
Hello @zep
One of my game players reported this.
It seems that Pico8 games downloaded from Steam sometimes fail to start when a controller is connected.
Target game in which the bug occurred.
https://store.steampowered.com/app/1448220/KONSAIRI/
Running environment
- Apple silicon Mac.
- Gamepad "Sony PlayStation® DualSense™ Wireless Controller" ----STORE PAGE.
- Using Steam's controller linkage function (Bluetooth).
- Exported cart pico8 version 0.2.2c (also occurs in 0.2.5e)
Crash report
https://docs.google.com/document/d/1u615ThHWhl_YEK8agfgb5EENnyzfXKkhnk_ach4XDgA/edit?usp=sharing
Thank you for your cooperation.
In the screenshot, the pause menu does not appear.
But in the case of GIF output, the pause menu seems to appear.
(version 0.2.5c)

Feature Overview
BPACK() pack the value of the bit specification with bit width.
- By packs in the direction of low bits when multiple bit values are specified.
- By setting [number s] to a negative value, bit pack can be started from the decimal point.
- If there are fewer bit-width elements relative to the value to be packed, the bit-width elements are rotated.
- This function consumes 37 Token.
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) |
This function is included in the KNUTIL library.
release note
Feature Overview
BUNPACK() slice the value with bit width.
- By specifying the argument after [number w], a value of up to 32 bits can be sliced.
- By setting [number s] to a negative value, bit slice can be started from the decimal point.
- This function consumes 30 Token.
a,b=bunpack(0xf8,4,4,4) -- Value, First bit-shift, bit-width, ...[bit-width] ?a -- 15 (0xf) ?b -- 8 (0x8) |
This function is included in the KNUTIL library.
release note
Feature Overview
TBFILL() Create a table by specifying an index number.
- Create the table with the specified minimum and maximum indices and fill it with the value of the first argument.
- Multi-dimensional tables can be created by adding minimum and maximum arguments.
- This function consumes 30 Token.
-- one-dimensional table t=tbfill('yes',1,3) ?t[1]..' '..t[2]..' '..t[3].."\n\n" -- 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] |
This function is included in the KNUTIL library.
release note
View Older Posts