Log In  
Follow
arnaught

Cart #imgviewer-0 | 2025-03-02 | Embed ▽ | License: CC4-BY-NC-SA
5

This is a cart to view png or qoi images in Picotron. It uses @pancelor's import png library. It's basically a different frontend for import png.

You can zoom in/out an image with scroll wheel, and pan across the image by dragging.

You can copy the image as a sprite to clipboard by pressing Ctrl+C.

You can open png and qoi images (as well as pal and hex pallets) by dropping them on the window (or, default_app png /path/to/imgviewer.p64 to set image viewer as the default app for pngs).

The statusbar shows the size, viewport position (coordinate of top left pixel), zoom, and loading progress.

The image used in the label preview is

[ Continue Reading.. ]

5
0 comments



Cart #calendarwidget-3 | 2025-05-13 | Embed ▽ | License: CC4-BY-NC-SA
3

A simple calendar widget. Install to tooltray with drag-and-drop.

Displays the current month's calendar, and highlights the current day.

Click the block (top left) to toggle the window's transparency. (When started on the tooltray, it will automatically be transparent)

The date is calculated in local time by default. Switch to UTC by clicking the house (local) indicator.

Using my DateToUnix function: https://www.lexaloffle.com/bbs/?tid=146596 (Hey, I finally found a use for it!)

Changelog

v1.0.1 (2025-03-01):

  • Fix text centering

v1.0.2 (2025-03-09):

  • Fixed day of week being wrong after daylight savings starts

v1.1.0 (2025-05-13):

  • Settings override file (/appdata/bbs/calendarwidget/settings.lua) to change colors, format, and week start
3
6 comments



Cart #clockwidget-0 | 2025-03-01 | Embed ▽ | License: CC4-BY-NC-SA
2

A simple analog clock widget. Install to tooltray with drag-and-drop.

Time is 12 hour by default. Switch to 24 hour by clicking the digital display, or the am/pm indicator.

Time is local time by default. Switch to UTC by clicking the house (local) indicator.

Right click to close widget on desktop.

2
0 comments



Cart #ball-2 | 2025-02-22 | Embed ▽ | License: CC4-BY-NC-SA
5

A bouncy ball for your Picotron desktop!

Open the cart and a ball will drop on your desktop! Pick it up, and throw it around. It will bounce and roll on your open windows!

When you're done with the ball, right click it to close it.

Using rspr by @fletch_pico to get the ball rolling (literally!) - https://www.lexaloffle.com/bbs/?tid=141706

If you spawn multiple balls, they won't interact with each other. I have the window background set to be transparent (using poke(0x547d, 0xff)), but this seems to cause the window to be excluded from /ram/shared/windows.pod.

Video Showcase: https://www.youtube.com/watch?v=x22LJ8qvKN4

5
1 comment



Cart #inlineimg-0 | 2025-02-20 | Embed ▽ | License: CC4-BY-NC-SA
5

You can print inline images (one off characters) using an escape code (\^:<character>). For example, \^:447cb67c3e7f0106 will print a cat.

The format is 8 bytes in hexadecimal representing a row, and each bit representing a column, for a 8x8 monochrome image. However, writing it out by hand is obviously a pain. I found some editors for Pico8 (https://www.lexaloffle.com/bbs/?tid=50298), but I couldn't find one for Picotron. So I made one.

There is a 8x8 grid of tiles, representing the image. Clicking a tile inverts it. The escape code and character preview are shown at the bottom of the window.

Ctrl+V to paste an image from clipboard and load it into the editor
Ctrl+C to copy the image in hexadecimal format

[ Continue Reading.. ]

5
3 comments



Cart #balloonrun-0 | 2025-02-19 | Embed ▽ | License: CC4-BY-NC-SA
3

I made this as my submission for Pico 1k Jam 2024, but I never actually posted it on the BBS.

Move with Left+Right, Jump with Z (O). Try and dodge the parachuting enemies. See how long you can last!

Additional Links:

3
0 comments



The date() function returns a formatted date.

It takes three arguments

  1. format, the format to use for display (See: Programming in Lua 22.1 - Date and Time). Starting the format with ! makes it UTC, otherwise it will be local time.
  2. t, the timestamp either as a string (in the default UTC YYYY-mm-dd HH:MM:SS) or Unix timestamp (seconds since 1970-01-01 00:00:00)
  3. delta, an amount of seconds to add to the timestamp.

date() gets the current time in UTC, and is used to generate timestamps in Picotron (for modified and created times).

date("%Y-%m-%d %H:%M:%S", timestamp) converts timestamp to local time. (So you can store timestamps in UTC and later display them in local time)

date(nil, nil, -86400 * 10) subtracts 10 days from the current time.

Since timestamps are in YYYY-mm-dd HH:MM:SS format, they can be compared directly as strings.

[ Continue Reading.. ]

1
3 comments



Cart #conway_pvp-0 | 2025-01-15 | Embed ▽ | License: CC4-BY-NC-SA
4

This is a version of Conway's Game of Life with PVP support! It's inspired by/based on this DougDoug stream: A Crew VS. Z Crew in Conway's Game of Life.

The rules are very similar to regular Conway's Game of Life.

  1. Any living cell with < 2 living neighbors dies (underpopulation)
  2. Any living cell with 2 or 3 living neighbors lives
  3. Any living cell with > 3 living neighbors dies (overpopulation)
  4. Any dead cell with exactly 3 live neighbors lives (reproduction)

However, there are two colors, red and blue. For rules (2) and (4), when the cell lives, it will match the color of its adjacent cells. If there are more red adjacent cells, it will become red. If there are more blue adjacent cells, it will become blue. If there are an equal number of red and blue adjacent cells, it will randomly choose one.

[ Continue Reading.. ]

4
0 comments



Typically, when using an external editor, I do cp -f cart.p64 src and then work on src externally. Every time I make a change, I need to load src before running. Then, I can put it back in the cart by doing cp -f src cart.p64.

The suggested way of using external editors in the docs is to have the code externally, and simply include it from inside the cart. This will automatically use the latest external change, but it makes it harder to switch back to editing inside Picotron, as you need to change parts of your code to put everything back in the cart.

I made a quick utility to make loading an external folders easier.

extload is a modified version of /system/util/load.lua that loads a folder for external editing. It saves the path of the folder in /ram/extcart.pod and loads extrunner instead of the actual folder. (It also loads the workspaces from the folder, though this is a little janky.)

extrunner is a dummy cart that cds into the external folder (from /ram/extcart.pod), loads the graphics and sfx (by including /system/lib/resources.lua), and runs it (by including main.lua).

[ Continue Reading.. ]

1
6 comments



I made a simple ini parsing/dumping function. load_ini() converts an ini string to a table, and dump_ini() converts a lua table to an ini string.

This could be useful for projects that have a configuration file. Using an ini might be better for user configs since ini supports comments.

The ini format is simple. Section headings are marked with [section] and items are stored as key=value. Subsections are separated with a dot. Inline comments are not supported, but comments at the start of the line are.

Strings don't have to be quoted, but you should quote them.

Example:

[heading]
a=1
b=2

[heading.sub]
c="hello"
d="world"

[heading.array]
1=4
2=5
3=6

This will convert to:

{
  heading = {
    a = 1,
    b = 2,
    sub = {
      c = "hello",
      d = "world"
    },
    array = { 4, 5, 6 }
  }
}

With the way I wrote it, it can handle anything that can be parsed with unpod(). This may be useful for writing some things (such as arrays) more compactly. The following is equivalent to the above example:

[heading]

[ [size=16][color=#ffaabb] [ Continue Reading.. ] [/color][/size] ](/bbs/?pid=160480#p)
1
1 comment



Cart #trashman-3 | 2025-03-01 | Embed ▽ | License: CC4-BY-NC-SA
5

This is a trash manager for Picotron that loosely follows the XDG Trash Specification. You can use it to delete and and later restore files from trash.

Full usage instructions are in the README (also available from "Help" inside the cart), but basically you can drag/drop files to move them to trash. Left click a file in trash to restore it, right click a file in trash to permanently delete it.

You can also use Trash Manager as a CLI utility.
trash [files] to move files to trash
trash --list [search] or trash --search [search] to list/search trash
trash --restore [files]
trash --restore-all to restore all files

[ Continue Reading.. ]

5
1 comment



Cart #snowglobe2024-0 | 2024-12-18 | Embed ▽ | License: CC4-BY-NC-SA
4

A little snowglobe application. Shake the window to make the snow fall. More shaking causes more snow to fall! (If you don't want to shake the window, you can also use the scroll wheel.)

Uses the same shaking detection as in #8ball. I drew the scene Pixelorama, and imported it using #importpng.

4
0 comments



PUSH (Picotron Upgraded SHell) is a modified version of terminal.lua I made that allows you to add modifications from lua modules. You can place modules in /appdata/system/terminal/ and PUSH will load them.

Without any modules, PUSH changes very little (cd with no arguments acts as cd /), but modules let you add more functionality.

In the repo, I have a list of examples of the sort of things you can do with PUSH, including changing the prompt, adding and overriding commands, and adding shortcuts.

cd.lua is my favorite module so far, I think. It adds replaces the default cd command and adds fish-style directory history.

https://github.com/Rayquaza01/picotron-upgraded-shell

This is very WIP, so if you have any trouble or suggestions for how to improve PUSH, let me know!

Changelog

2025.2.18:

  • Add in changes from 0.1.1e terminal.lua
  • Disable barecd when pwd is in bbs:// (fstat in bbs:// seems to always return folder, even when it doesn't exist)
0 comments



Cart #prt-0 | 2024-11-05 | Embed ▽ | License: CC4-BY-NC-SA
5

This is a tool that lets you remotely control Picotron from the host and vice-versa.

You can run commands in Picotron by running prt <COMMAND> from the host

This is useful when working with an external editor. You can load and run the updated source code from the external editor, and build/extract the cartridge.

You can also run host commands from inside of Picotron with the host command (included in the cart at /exports/appdata/system/util/host.lua). You can even use pipelines!

Full usage and installation instructions are included in the repo: https://github.com/Rayquaza01/picotron-remote-terminal

There is an issue I know about where if the cart is running for a while, it will start dropping commands seemingly at random. Not sure exactly what causes this, but restarting the cart seems to fix it.

5
8 comments



This isn't a Picotron specific thing, but you can use ANSI escape codes inside printh to make your logs colorful, which can be helpful with debugging.

To set the color, typically you do \033[38;5;<COLOR>m or \033[38;2;<RED>;<GREEN>;<BLUE>m. This sets the foreground color to a color from this chart or an RGB color code (if your terminal supports truecolor).

This just works in Picotron, but you have to do \27 instead of \033. (This is the escape code for ESC, which is 27 in decimal and 033 in octal.)

However, writing ANSI codes by hand is a pain, so I wrote a function to make inserting these codes easier, using a bbcode-like syntax.

Foreground color can be set with [fg=1][/fg] or [fg=#ff0000][/fg]
Background color can be set with [bg=1][/bg] or [bg=#ff0000][/bg]
Bold can be set with `&lsqb;b]

[ Continue Reading.. ]

5
0 comments



Cart #fzf-2 | 2024-10-21 | Embed ▽ | No License
5

I built a fuzzy finder. You can quickly search for and open files (anything supported by /system/util/open.lua, so folders, lua files, text files, pods, etc.) Additionally, it can follow .loc files to their destination before opening (which open doesn't currently support), and it can execute .p64 files instead of opening them!

The full code and documentation is available here: https://github.com/Rayquaza01/fuzzy-finder-picotron/

This uses swarn/fzy-lua (MIT License) and mergesort.lua from TheAlgorithms/Lua (MIT License)

Changelog

v1.1 - Oct 21, 2024

[ Continue Reading.. ]

5
2 comments



I figured out how to get the Pico8 special characters (the ones you get when typing capitals) in Picotron. The special characters start at U+0080 and go all the way up to U+0099. All unknown characters seem to display the same.

I don't know of a convenient way to type these into picotron, but if you copy paste the list below, you can save them to a text file for reference. It's a little annoying because none of them are actually printable characters. UTF-8 doesn't seem to like having them bare, so when you copy paste, it will actually be U+00C2 U+0080 instead of just U+0080.

A: €
B: 
C: ‚
D: ƒ
E: „
F: …
G: †
H: ‡
I: ˆ
J: ‰
K: Š
L: ‹
M: Œ
N: 
O: Ž
P: 
Q: 
R: ‘
S: ’
T: “	
U: ”
V: •
W: –
X: —
Y: ˜
Z: ™
Unknown: Â
6
1 comment



Cart #magic8ball-0 | 2024-03-24 | Embed ▽ | License: CC4-BY-NC-SA
8

This Picotron cartridge can predict the future! Simply ask it any yes or no question, shake the window, and you'll get your answer!

(I hear you can also press z to get an answer, but that seems less fun than shaking the window.)


This was a fun little project to make. I finally figured out how to edit the cartridge's metadata! (Though I'm still not sure how to do it on a fullscreen cartridge).

I wanted to put a sound effect when shaking the window, but I have no idea how to work the instrument editor lol.

8
3 comments



Some linux distros include code in the default .bashrc that chain loads files from ~/.bashrc.d. This is useful for keeping your config organized. (I like keeping my aliases in a separate file, for instance.)

I've made a snippet that does this for Picotron. Add this to your /appdata/system/startup.lua, and it will chain load any .lua files in the folder /appdata/system/startup.

startup_folder = "/appdata/system/startup"
if fstat(startup_folder) == "folder" then
	for file in all(ls(startup_folder)) do
		filename = startup_folder .. "/" .. file
		if fstat(filename) == "file" and file:find("%.lua$") then
			create_process(filename)
		end
	end
end
6
1 comment



Cart #pipes-0 | 2024-03-19 | Embed ▽ | License: CC4-BY-NC-SA
10

I made a pipes screensaver, inspired by the classic 3D Pipes Screensaver.

A pipe of a random color is created on the somewhere on the edge of the screen. It will expand outwards from its starting point, choosing to go straight, left, or right. The pipe will stop when it goes out of bounds, and a new pipe will be created.

I am not saving information about the pipes manually. I just draw the current pipe, and never cls. All the old pipes stay on screen and the new ones are drawn above. Previously, I saved all of the pipe connections and colors in a 30*17*6 table which was redrawn every frame, but then I realized that I could get rid of that by just removing cls. So instead of storing and drawing up to 3060 sprites every frame, instead I only store and draw one.

[ Continue Reading.. ]

10
0 comments





Top    Load More Posts ->