Log In  

pico 8 does these pretty glitches when running a cart
i was wondering is there a way to rerun the cart like that from the code
i tried different options but it never makes the glitches
what does actually happen when i press cmd+r?

P#139980 2024-01-11 09:32 ( Edited 2024-01-11 09:35)

1

These glitches are very reminiscent of what you might see onscreen on old hardware when powering them down (like the NES for example).
On those hardware, the CPU is still running for a few frames while the RAM data is decaying before it stops running. This is not predictable behavior nor desirable behavior, and can even corrupt the memory of your saves on the cartridge, if any, so it's usually left out of emulators.
Pico 8 is another story: it's purposefully adding these glitches in for the virtual console to feel more real. (not the saves destroyed part obviously)
Here are different effect I can see :

  • partial palette corruption
  • short bursts of video mode change (128x64 for example)
  • partial sprite sheet corruption
    This one is not trivial : you can't have all the identical tiles corrupted in the same way just from video memory. My guess is the corruption is done first and then the game runs and displays a last frame with the corrupted spritesheet.
  • half the lines shifted by one pixel.

I guess all of these effects could be coded in a pico 8 cart.

P#139985 2024-01-11 11:08
1

Thank you @RealShadowCaster!!!
I thought actually that these glitches are artificial and not really happening because of the reboot.
Thanks for description of what is happening in there! I guess i'll try to do something like that myself.

P#139987 2024-01-11 13:51

I believe you can restart a cart in your code using a call to run(), but these glitches are not replicated.

You can cause some pretty interesting things to happen by peppering random junk into memory space,

--warning: this will corrupt save data and current execution of the cart
for i=0x0,0x7fff,rnd(0xf) do
 poke(i, rnd(0xf))
end

It'll likely break your gameplay (and user/save data!) but could be used prior to a run() call if everything's about to be reset.

P#139995 2024-01-11 17:01 ( Edited 2024-01-11 21:58)

When you call cartdata, your save is mapped to the 256 bytes between 0x5e00 and 0x5eff. @kozm0naut 's code is guaranteed to write random bytes to it since the steps are at most 14.999... . It can also hang the game, if the random step is 0.0
1+flr(rnd(0xf)) makes a little more sense but is as bad for the save.

P#140010 2024-01-11 21:52

That's right @RealShadowCaster, I have added a warning to the snippet above. You could also choose to focus strictly on the graphics buffer (0x6000-0x7fff) and maybe hit the draw state (0x5f00-0x5f3f) as well which shouldn't cause save corruption.

P#140016 2024-01-11 22:04

Upon further digging/testing, it actually looks like calling extcmd() with an argument of "reset" will result in the full console reset effect including the cosmetic glitches.

P#140065 2024-01-13 07:27

oh my!!! that is so great! thank you so much for finding it out @kozm0naut!!!
And actually all the rest information was also very helpful, because i'm new with coding and i didn't know how to call memory addresses with a for loop! So thank you for all that as well!

P#140068 2024-01-13 11:59
1

So far so good)
Thank you so much guys!πŸ™πŸ™πŸ™
@RealShadowCaster @kozm0naut
Still have some issues, but I’m so exited that it actually worked just the way I wanted!)

P#140104 2024-01-14 13:55 ( Edited 2024-01-14 13:56)

Haha, very nice! I have played around with your carts before, I really like your art style!

P#140117 2024-01-14 19:53

Hey @peter Mosevich, seems I can't @ you because of the space in your pseudo.
Awsome glitches :)
If someone is using the Peter pseudo, sorry for the poke.
@kozm0naut, nice find. Since you've experimented with it, dou you know the limitations of extcmd() when called from BBS ?
I'm particularly interested by label and folder, but if you have some general insight, I'd love to learn. There's nothing much on the wiki about it.

P#140119 2024-01-14 21:06 ( Edited 2024-01-14 21:07)

Thank you @kozm0naut! I really appreciate it😊

P#140156 2024-01-15 12:00

Oh DamnπŸ˜…πŸ˜…πŸ˜… @RealShadowCaster
I wonder if I can change my profile name now))
Btw, somehow the glitches look even cooler in the browser version

P#140157 2024-01-15 12:04

[Please log in to post a comment]