Log In  
Follow
ChristopherD

iOS developer/graphic artist living and working in Tokyo.
Come and go into Pico-8 as inspiration strikes.
For "relaxing with programming as a hobby" it's proven to be my favorite tool so far.

SHOW MORE

Introducing Pirouette

Pirouette is an animated, explorable, generative art toy. So named for the dancing, twirling shapes the algorithm generates, I was inspired to make this after seeing a RISC assembly version that debuted recently.
https://youtu.be/VxGOBxy6oAY?feature=shared

A note from the creator of that implementation pointed me to a message board with a version running in Sinclair BASIC, whose author says he's not sure where he obtained the original algorithm. My hunt continues. Other ports to BBC BASIC, Owlet, and Processing (Java edition) are available at the board posting.
https://stardot.org.uk/forums/viewtopic.php?f=54&t=25833

The port

This Pico-8 implementation tries its best to present the beauty of the 20-line (!) original within the 16-color limits of our beloved fantasy console. I tried to match a 15-color (need black for background) palette from Pico-8's 32-color extended colors to the original 32-bit color gamut and was happy (and a little surprised) to see expected shapes and swirls emerging from the void.
(that said, I think there is room for further palette tweaking)

Beyond the port

This implementation introduces controls for exploring the universe.

  • Arrow keys will reposition the camera (do think of it as moving a camera, not moving the universe)
  • Hold X button (keyboard "X") to control space and time.
  • Hold O button (keyboard "Z") to control universe complexity and shift quantum phase.
  • X and O simultaneously to freeze/thaw the quantum state.
  • Open the pause menu to reset the known universe.

Enjoy your explorations

Cart #pirouette-2 | 2023-10-10 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
23

Note: high universe complexity consumes significant CPU (displayed in the upper left of the UI)

P#135646 2023-10-10 23:36

SHOW MORE

Cart #one_bit_wonder-0 | 2023-07-22 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
5

Because this needs drag-and-drop, the above web-embed is only to make the cart easy to download.
Source code available at GitHub: https://github.com/ChristopherDrum/1bitwonder

What is it?

This cart takes 4 1-bit images and combines them into a single image, where each "layer" of the image is encoded by its pixel color. Set your pal() to the image you want, then spr() as normal; that's it. Bit-planes made simple.

I've seen any number of 1-bit graphics games lately (especially with the Porklike sub-genre) and this could possibly quadruple the available space for sprites in games like that. Expand the environment and enemy types, maybe?

In action

Here's four pieces of classic MacPaint artwork being extracted one-by-one via pal() calls, plus the composite from which the images are being pulled. Here's the composite to make it more clear what this program generates.


(original artwork by Susan Kare, Bert Monroy, Martin Melin, and Brian Thomas)

-->
Alternately you could cut a full-screen (or whatever size) image into slices and put those slices into 1/4 the data space. (this is what I did for Mystery House)

Usage

Upon launch, One Bit Wonder is ready to receive images. Drag in up to four (4) 128x128 pixel 1-bit images. They will be automatically added to a compressed image and previewed for you, using the same pal() method of image extraction you would use in your own code. After you've added your images...

  • Save out the palette code (which really doesn't change much, your artwork depending)
  • Export the spritesheet

Controls

  • Left/right arrows : cycle through the loaded images, including the full composite.
  • z : Save out a .txt file that includes the palettes and transparency palettes for your images.
  • x : Clear out everything and start a new composite (don't forget to export your composite spritesheet first!)

The composite is cstore() to the cart. Exit the program and run export your_filename.png as usual to export the spritesheet. You could also, of course, copy/paste from this cart's spritesheet into your target cart.

Note

  • Images must be black background with one-color artwork.
  • Images must be 128x128 (but you don't have to USE the whole space; I only used the upper 1/4 for Mystery House).
  • The palettes generated will respect the original color of the line-art.
  • Remember, the palettes generated are just a baseline; replace the values with other colors as needed.
  • You don't have to use the transparency palettes. Draw a full-screen image in any two colors, for example.
  • The example shows four full-screen images, but you could split an image into four parts and stack those into the storage space of just one of those. Slice and dice as needed.

Background

While working on Mystery House (Remodeled), I needed image compression to fit everything into 64K. Most of the problem was solved with a custom illustration program I wrote called Versawriter-8.

However, there was still the matter of some sprites (game logos, etc) and detailed objects that weren't a great fit for Versawriter-8's vector-based drawing. For those elements I used the spritesheet, but I didn't have the luxury of using the entire spritesheet ROM area. At most, I could only use 1/4 of it, from address 0x0000 to 0x0800.

Looking into Pico-8 discussions on image compression I saw a lot of talk about RLE and LZW compression, trying to minimize the token count of a decoder. I wanted a "back to basics" solution, so this gave me the opportunity to build something I'd been toying around with in my head for a while with an almost-free decompression method.

Last thoughts

Pico-8 color is 4-bit, so here I've compressed one image per bit. But we could do different combinations. Two, 2-bit images, or a 3-bit image and 1-bit image, or a 2-bit plus two 1-bit. I might spend some time making this little tool a bit more robust to a variety of source images and image sizes.

Personally I made an lspr() function which accepts normal sspr() parameters plus the "layer" number for the sprite, which does the pal() setup for the request.

P#131252 2023-07-22 02:47 ( Edited 2023-07-22 05:05)

SHOW MORE

Cart #versawriter8-0 | 2023-07-19 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
9

NOTE: This is a desktop app. The tools that make it interesting and its user interface (mouse/keyboard) make a web version not so useful. I've embedded it here in the spirit of general availability to Pico-8 users via splore.

Versawriter-8

Recently I released Mystery House (Remodeled), a ground-up rebuild of the first graphic adventure game. As part of the creation process, I wanted to redo the graphics using a workflow similar to the one that Roberta Williams did back in the day. Versawriter-8 was built so I could build Mystery House.

Everything in Mystery House (Remodeled) was drawn in Pico-8 using this tool. There are 45 unique "full screen" images, plus a couple of dozen objects, stored in about 10K using this tool and compression method.

What is (was) a Versawriter?

Roberta and Ken Williams used a device called a Versawriter on the Apple 2 to trace hand-drawn illustrations into Apple 2 hi-res graphics format. Ken wrote custom software for it that would "record" Roberta's tracing, then that was stored in a vector graphics compressed format. In this compressed format, only each point is recorded, and a line is drawn to connect it to the previous point. At run-time the computer would "play back" the recording and redraw the image. This allowed the limited storage of the floppy disk to hold all of the images needed for the game. This process would go on, conceptually, to become the AGI graphics format of the old Sierra games (i.e. don't store bitmaps, store instructions for drawing)

How to Use Versawriter-8

Versawriter-8 is quite simple in its scope and usage. You start in Draw mode.

In Draw mode

  • Left-click to add points. Each consecutive click adds a point to the "island" (a series of continguous points)
  • Right-click to end drawing the current "island"
  • Left-click anywhere to start adding a new "island" to the drawing
  • Drag a .png file (up to 128x88) into the draw area to use as a tracing template (you have control over positioning, draw color contrast, and more)

Space switches to Edit Mode where you can fine tune your drawing a bit, and maybe save some bytes.

In Edit Mode

  • Left-click-and-hold on a point to drag it around to a new position.
  • Left-click-and-hold on a line to drag that "island" to a new position (only contiguous points).
  • Right-click on a point to delete it
  • Right-click on an "island" to delete it.

When you're done, C key will copy the current image in its compressed string format to the clipboard.
A string copied to the clipboard can also be pasted in. Remember, Pico-8 needs permission to read the clipboard first, so CTRL-V to grant access, then V to paste it in.

The format of a compressed string

Every point is stored as an x,y pair, with no delimiter between them (because they MUST be in pairs). We add 93 to X and Y (to shift their chr() values outside any P8SCII special characters) and that chr() is encoded in the string. Every "island" (a continguous series of connected points) is separated by chr(255).

Because image compression is the raison d'etre of this program, the total bytes/points/island count are always shown in the user interface. The byte count can be controlled by: fewer points, fewer islands. Try to think about how to draw efficiently. With practice you'll see how you can remove points without affecting the image quality, thanks to the low resolution of the screen.

To draw a compressed string

Feed the generated string to a routine like the one below to draw it (flip() if necessary). This one is 77 tokens. If you don't need offset or arbitrary color, it goes down to 53 tokens.

function draw_image(pic_str, offset, c)
    local offset = offset or {0,0}
    local c = c or 7

    local islands = split(pic_str, chr(255))
    for i in all(islands) do
        line()
        for p = 1, #i, 2 do
            local x, y = ord(i[p])-93, ord(i[p+1])-93
            x += offset[1]
            y += offset[2]
            line(x,y,c)
        end
        line()
    end
end

The User Interface

Complete Tool List

  • Drag-and-drop .png file (128x88 max) to use as a tracing template
  • space : toggle between Draw mode and Edit mode
  • n : clear the current document and start a new one
  • x : clear the tracing template
  • c : copy image string to clipboard
  • v : paste clipboard string into canvas (Pico-8 requires CTRL-V first)
  • p : toggle point display on/off
  • l : toggle line display on/off
  • t : toggle template display on/off
  • r : toggle template "tracing mode" (monochromatic)
  • - : cycle through point color (for UI only)
  • = : cycle through line color (for UI only)
  • s : save your work to local cart (bottom-right light goes GREEN)
  • a : restore your saved work from local cart
  • arrow keys : nudge template position (in Draw mode); nudge all points (in Edit mode)

Self Assessment

Current Limitations

As the current version was built for my specific needs on a specific project, the main limitation of the program is in the draw area you can work in. It is specifically tailored to build Apple 2 hi-res graphics proportions, meaning a maximum draw area of 128x88, which leaves room for 6 lines of text below it; seemed reasonable at the time.

Additionally you cannot encode any color into the drawing. It is one-color only, but in your personal draw routine you could assign colors to drawings or even points within the drawing. You could draw multiple images on top of each other in different colors, to work around this limitation if you wanted.

Next Steps

I can think of four primary features that would make this more generally useful

  • Set pen color for lines
  • Allow flood fill
  • Full screen image editing
  • Better Edit mode (append points to existing island? group islands?)

Source code on GitHub

https://github.com/ChristopherDrum/versawriter8

P#132123 2023-07-19 06:46 ( Edited 2023-07-19 10:10)

SHOW MORE

Cart #mysteryhouse-2 | 2023-07-13 | Code ▽ | Embed ▽ | License: CC4-BY-NC-SA
11

The "first graphic adventure" (according to itself), and the title that launched the game development careers of Roberta and Ken Williams (and launched Sierra On-Line), is now available on the Pico-8. Do YOU have what it takes to become "a guru wizard?"

All text, graphics, and bugs of the game that launched the game development careers of Ken and Roberta Williams have been lovingly ported to your favorite virtual console. Yes, the entire 140K original has been crunched down to a single 60K cart, including save state, with all new hand-drawn images (see "Tools Used" below). The construction of the game is essentially broken down into engine and data, meaning it could be modified or remixed or rebuilt into a new game (detailed blog posts are in the works).

**NOTE: this is a text adventure, and so it requires a keyboard. Not a mobile-friendly game, I'm sorry to say.

**UPDATE: added a link to an in-depth analysis of the mechanisms that drove the original game

Screenshots

Tools Used

This conversion of the public domain classic was made possible by three factors:

  1. The analysis and data dump provided by Inspecting the Foundation of Mystery House by J. Aycock and K. Biittner for the Journal of Contemporary Archaeology, 2019
  2. The creation of a companion art program built just to make this game, Versawriter-8. This allows the game to hold graphics data in a "vector" format similar to the original, and provides tracing tools which mimic the workflow of the original creators with a Versawriter on the Apple 2.
  3. The creation of another companion program, 1 Bit Wonder, which leverages a simple approach to image compression with 0-token (?) decompression.*

Further details on Versawriter-8 and 1 Bit Wonder will be posted in the coming days.
For now, here's a screenshot of each in action.

Want to Know More?

Uncompressed data, un-minified source code, notes, and more are at
https://github.com/ChristopherDrum/mystery_house_remodeled/

The custom drawing program, Versawriter-8, used to do the graphics is available now
https://www.lexaloffle.com/bbs/?tid=53461

The custom sprite compressor, One Bit Wonder, is available now
https://www.lexaloffle.com/bbs/?tid=53207

An itch.io page is also available at
https://christopherdrum.itch.io/mystery-house

Want to Know WAY TOO MUCH More?

Here's a very lengthy blog post about how the original game worked, as discovered while porting the game. This presents a kind of "software archaeology" analysis of the game. There's not too much specific to the Pico-8 except to discuss some of the ways that "classic bugs" were translated to the Pico-8 environment.
https://christopherdrum.itch.io/mystery-house/devlog/545148/mystery-house-excavated

*if PAL and SSPR draw calls are already part of your graphics routine, it may actually be zero additional tokens.

P#131742 2023-07-13 00:35 ( Edited 2023-07-22 03:04)

SHOW MORE

@zep
As .png files are a supported graphic format with the IMPORT and EXPORT commands, I think it makes sense to list .png image files in the working directory when using the LS and DIR commands. I'm working on a graphic utility tool and it's a bit of a drag to not be able to list the very same images that I'm allowed to import and export by name.

P#129868 2023-05-18 06:34

SHOW MORE

Their DevTerm got middling reviews, if I recall correctly. This one has an all-metal body and maybe will fulfill the promises that the PocketCHIP couldn't keep? Pico-8 (and fantasy consoles in general) is explicitly noted as one of the use cases.

At any rate, I know there's a subsection of Pico-8 users looking for "the perfect portable device." I'll be curious to see reviews on this.

https://www.clockworkpi.com/uconsole

P#119574 2022-10-26 01:35

SHOW MORE

I've asked this question before, but it was lumped in with other export-related stuff; so I'm breaking this out into a standalone post. macOS and Windows exported binary applications trigger security/virus warnings that scare off potential users of my software. As recommended by Pico-8 docs I am "distribut(ing) the outputted zip files as-is to ensure users on other operating systems can run them."

On Windows:
The executable on first launch triggers Windows Defender on Windows 7 and 10 (reported so far). I tried codesigning the .exe with signtool to no avail. Is there a way to fix this?

On macOS:
Like Windows, the unsigned app triggers a security warning. Has anyone successfully fixed this, perhaps with an Apple developer account and re-codesigning?

I don't mind signing up and paying for Microsoft and Apple developer accounts if it will resolve the problem, but I don't want to pay just to find out it doesn't help. Hoping the community has experience I can leverage before making any financial commitments.

P#109546 2022-04-02 00:13

SHOW MORE

Here's an example of trying to add a continuous underscore to the #font_snippet alternate font. Printing works fine with \014\f7 but the font gets clipped by 1px on the right with \014\#1\f7
(color is irrelevant; the inclusion of \#(number) triggers it.

EDIT: see below for the fix.

P#107518 2022-02-23 04:14 ( Edited 2022-02-23 04:35)

SHOW MORE

According to documentation
PRINT returns the right-most x position that occurred while printing

One can make a valid case that certain print control codes may result in unusual return values, but this one doesn't feel right to me.

x = print('\^iabcde')
print(x)
y = print('\^d2abcde')
print(y)

results in

The speed of the print output shouldn't affect our ability to receive the final x position, IMHO.

P#106380 2022-02-05 08:36

SHOW MORE

Your Pico-8 just got a big graphics upgrade

With game graphics drawn "from the limitless imagery of your imagination" (according to an old Infocom advertisement), a world of classic text adventures is now playable on the Pico-8.

Status Line implements the z-machine v3/v4 specifications, allowing you to play .z3 and .z4 text adventures like Zork, Hitchhiker's Guide to the Galaxy, Trinity, A Mind Forever Voyaging and more. There are those who continue to keep the Infocom flame alive, and their games will work as well.

Features

  • Can play every game in the "z3" and "z4" format
  • Custom font with multi-font display, includes mixed plain/bold/italic
  • Supports game sizes up to 256K
  • Supports simple sound effects (used by many z4 games)
  • Save/restore games in progress
  • Multiple color themes to recreate a "classic feel"
  • Player-selectable text scroll speed
  • Player-selectable cursor style, because why not
  • Choose 24 or 12-hour clock for time-based games

Status Line Available Now at itch.io

Details, where to find games to play, future work, etc. can be found on the project page at https://christopherdrum.itch.io/statusline.
Source code now on github: https://github.com/ChristopherDrum/status-line

Special Feature: Status Line Classics

I've modified a handful of original Infocom games, from original source code, to look and play great on the Pico-8. Lots of UX changes, text layout/formatting changes, etc. to accomodate the Pico-8's tiny, cozy screen. Source and playable .z4 files are available at github: https://github.com/ChristopherDrum/status-line-classics

Update - v2.0 Released (Mar. 22, 2022)

This update adds .z4 game support, multi-font display, better core engine, slightly faster core performance, more compact input cursor, some deep bug fixes, and more. Status Line Classics v1.0 is released in conjunction with this update to give the Pico-8 community best-in-class adaptations of Infocom classics for our beloved machine. Extended notes and full changelog are here:
https://christopherdrum.itch.io/statusline/devlog/349264/status-line-v20-released-z4-support-multi-font-display-custom-infocom-classics-and-the-resurrection-of-bureaucracy

Update - v1.2 Released (Feb. 13, 2022)

This update focuses on lowering memory usage, general performance improvements, and improved text layout handling. This puts the project in good shape for z4 game support in the near future. Write-up of the changes and the full changelog are here:
https://christopherdrum.itch.io/statusline/devlog/343409/status-line-v12-released

Update - v1.1 Released

v1.1 was uploaded today to the product page on itch.io. Most changes handle various typographic inconsistencies and strive to give a more clean, consistent presentation. Additional color schemes, player-selectable cursor style, and more are also added. Write-up of the changes and the full changelog are here:
https://christopherdrum.itch.io/statusline/devlog/330128/status-line-11-released

P#103711 2021-12-29 01:20 ( Edited 2022-03-22 03:37)

SHOW MORE

I can't find any posts talking about this, which may just mean I'm terrible at finding thing in the BBS.

At any rate, I'm doing Windows, macOS(OS X), and Linux executable exports. I've noticed a few things, and I need to know if this is "just how things are," "that sounds broken," or "that is something we can fix."

On Windows:

  • The executable on first launch triggers Windows Defender. I tried codesigning the .exe with signtool to no avail. Is there a way to fix this?
  • On first launch, the exe runs full-screen. I don't want this for my release as it relies on file system interaction via drag-and-drop. Can we default to windowed mode?

On macOS:

  • Like Windows, the unsigned app triggers a security warning. Has anyone successfully done a codesign to fix this?
  • Also, the full-screen mode occurred for one person, but not for another. Does having Pico-8 installed affect how this launches? (person with Pico-8 was windowed mode on first launch; person without Pico-8 was full-screen on first launch)

On Linux:

  • The executable had no icon, but a separate .png file was in the .zip file. Is this normal?
  • The full-screen mode issue occurred on my Linux machine, yet I do have Pico-8 installed.

I thank the community in advance for any assistance in these matters.

P#103671 2021-12-28 13:42 ( Edited 2021-12-28 13:44)

SHOW MORE

Your Pico-8 has something to say.

The power of MIT's Artificial Intelligence Lab (circa 1966) has been brought to the Pico-8. The software that once took on the Turing Test is now yours to command. Marvel as the illusion of a living computer breaks down within seconds!

ELIZA's creator, Joseph Weizenbaum, once wrote, "I had not realized ... that extremely short exposures to a relatively simple computer program could induce powerful delusional thinking in quite normal people." Maybe you'll be powerfully deluded as well!

Features of this release:

  • An interesting archaelogical look at early AI
  • User-scriptable! (see blog for info)
  • Reproduces precisely a famous ELIZA conversation
  • Not based on the simplified BASIC version; this is the real deal!

While this release implements the most famous ELIZA script called "DOCTOR," I have endeavored to make it simple to create your own script. With Pico-8's 2MiB of RAM and the light footprint of the engine itself, it is theoretically possible to create much more advanced chatbots than could have been achieved in 1966.

More information and downloads available on itch.io now.
https://christopherdrum.itch.io/eliza8

Full blog post on how the script works, so you can write your own is also posted.
https://christopherdrum.itch.io/eliza8/devlog/255329/customizing-eliza8-scripts

P#92317 2021-05-21 22:03

SHOW MORE

Is there any way to do the following?

t = {
  "key 1" = "foofoo",
  "key 2" = "barbar"
}

We can't use quoted keys when defining a table, but we can use them when adding elements.

t = {}
t["key 1"] = "foofoo"
t["key 2"] = "barbar"

Is this "just how things are?" because it would really be beneficial to be able to do it all inline and build out a complex table structure without having to isolate out special cases and insert them as a separate sequence of setter calls.

(the example above uses spaces in the key intentionally, where it might be a substring paired with its substitution or maybe I just want to make it very clear in the definition that some of the keys represent specific words, like vocabulary words; don't get me wrong, I know lots of workarounds, but sometimes the workarounds are a drag, especially when it looks like we're so close to just having a simple way of doing things)

--EDIT
Clarification here. The first example fails to compile with a "missing {" error when trying to use inline quoted keys. @fred72 shows below that wrapping those in square brackets allows for using the quoted key without resorting to the second method shown.

P#91621 2021-05-07 03:00 ( Edited 2021-05-07 07:55)

SHOW MORE

(this "bug" may actually be "a feature"... not sure)

In the following code, a simultaneous btn+key method is used.
I am using Player 2 "X" key for this example.

In keyconfig, set Player 2 "X" to be a key, like "\"
You should find that you can hold "\" to get a yellow line drawn on screen.
While holding that BTN down, type "c" and you should see a red circle flash on screen.

Back in keyconfig, set Player 2 "X" to be "Alt"
(I'm on Windows; I think the Mac Option key has the same behavior)

When running this sample program, hold down Player 2 "X" and the line appears as before.
Type "c" and nothing happens.

I can understand not allowing "Ctrl" (for example) but I can't think of any "would interfere with expected system operations" reason why "Alt" would have its use restricted in this way.

function _init()
   poke(0x5f2d,1)
end

function _update()
   cls()
   if btn(5,1) then
      line(0,0,127,127,10)
      if stat(30) then
         local key = stat(31)
         if (key == 'c') circfill(63,63,20,8)
         flip()
      end
   end
end
P#89660 2021-03-27 03:01

SHOW MORE

According to the manual

:: Special Commands
These commands all start with "\^" and take between none and 2 parameters (P0, P1)

   s set tab stop width to P0 pixels (used by "\t")

However, it appears to me that it isn't in pixels, but rather by characters.

This code snippet

?"1234567890"
?"----------"
for i = 1,9 do
?"\^s"..tostr(i).."1\t2\t3\t4\t5"
end

yields this output

Additionally, if \t is the first character in the string, it seems to be ignored.

?"\t1234567890"

outputs exactly as if no tab were included.

P#89606 2021-03-26 10:30

SHOW MORE

For characters in the Japanese kana range, it seems we must type ctrl + alpha
to get a kana to input. However, ctrl is also used to activate some Pico-8 things like "save" and such.

With poke(0x5f30,1)
we can suppress "ENTER" from bringing up the Pico-8 menu in-game.
Is there a poke I'm failing to see that will suppress Pico-8 from having its "save" function activated every time the user enters ctrl + s to type キ (for example)?

(on another note, backtik-surrounded text to format "code snippet within a line" doesn't seem to work right?)

P#88278 2021-02-28 02:41 ( Edited 2021-02-28 02:47)

SHOW MORE

Your Pico-8 just got down to business.

The full-featured, high-precision spreadsheet application for the Pico-8 that nobody asked for has finally arrived! PicoCalc is a feature-complete1 clone of the 1979 classic VisiCalc, which introduced the world to an entirely new category of business application. Steve Jobs said of VisiCalc, it's "what really drove -- propelled -- the Apple ][ to the success it achieved."

PicoCalc does everything* VisiCalc can do, with some enhancements over the Apple ][ classic:

  • 18.18 integer/fractional precision vs. VisiCalc's 12.
    Handles numbers as big as 999999999999999999.999999999999999999
  • Granular error reporting!
    Get informed of division by zero, number overflow, and more.
  • Multi-color representation of active/inactive cursor, locked titles, truncated values, and error messages
  • Save and load your work
  • Full arrow-key support (LOL)

To use it effectively, you do need to know how to use VisiCalc.
Here's a manual to help you along.

More information and download available on itch.io now.
https://christopherdrum.itch.io/picocalc

*OK, I ran out of tokens and only got 99.5% in; still thinking how to hit 100%

Updated to 1.0.1

Available now. Writeup of bug fixes at itch.io.
https://christopherdrum.itch.io/picocalc/devlog/226707/picocalc-updated-to-101

P#88099 2021-02-24 12:41 ( Edited 2021-02-28 07:09)

SHOW MORE

In the new v0.2.2, it seems that "tall" mode for print rendering does not render the final row of pixels.
See in this shot the difference between "tall" and "wide"

Haven’t tried it in “non-inverse” mode yet.
Discovered by using Zep’s “pinball everything” example.

P#87602 2021-02-13 23:41 ( Edited 2021-02-14 00:29)

SHOW MORE

I have a number of functions which, before doing any real work, need to do the exact same pre-processing routine of the passed parameters. As such, they all start like this...

local p1, p2, error = preprocess(param1, param2)
if (error) return error --early return

Is there a way to use metatables to inject this kind of default behavior into functions, without having to copy/paste that boilerplate code each time?

P#87370 2021-02-08 02:01

SHOW MORE

Hit a strange bug tonight in trying to compare some values.
Ultimately, I was being told that 0 != 0 (apparently).
In digging in further, I can reproduce the problem in one line.

> print(8.5333-3.7667-4.7667)
-0

I understand that there can be rounding issues, but -0 is not such a useful return value I think.

Edit: Another strange occurrence
I'm doing time profiling on functions in my code. Call time() at the beginning and end of a test and subtract the results.

In the test, I received 37.4667 - 35.6333 = 1.8333

but if I just ask Pico-8 to compute that in the console I get the proper 1.8334

P#74960 2020-04-19 09:45 ( Edited 2020-04-19 11:42)

View Older Posts
Follow Lexaloffle:          
Generated 2024-03-19 10:16:12 | 0.123s | Q:46