Skip to content

Instantly share code, notes, and snippets.

@Mai-Lapyst
Mai-Lapyst / pico8jstocart.py
Created December 26, 2022 17:31 — forked from eevee/pico8jstocart.py
Python script to convert exported JavaScript back into a PICO-8 cartridge
import os.path
import re
import sys
# LZ-ish decompression scheme borrowed from picolove:
# https://github.com/gamax92/picolove/blob/master/cart.lua
compression_map = b"\n 0123456789abcdefghijklmnopqrstuvwxyz!#%(){}[]<>+=/*:;.,~_"
def decompress(code):
lua = bytearray()