is there some way to compress data in programs?

4

Raichu 2026-03-14 13:13

well, everyone should know that the Lowres NX console only offers you 32KB of ram to use and code. is there any way to compress major data down to have more space to code? or something like an “expansion pack” in the code to push the capabilities and load more data at will? i would love to know.


wryhode 2026-03-14 13:27

unfortunately you cant compress the code itself BUT data in the rom can be compressed during creation and uncompressed at runtime. look into run length encoding or lz4 for speed or maybe more modern algorithms for better compression ratios. iirc someone has done it before but i couldnt find the post :shrug:


Pablo 2026-03-15 01:18 (Edited)

Here is my RLE compressor: https://pastebin.com/DEudhZZq


And here is a loader for NX...

' loads an RLE hex string s$ to memory address a 

sub loadrle(s$, a)
    d = 0
    for i=1 to len(s$) step 4
        n = val("0x" + mid$(s$, i, 2))
        v = val("0x" + mid$(s$, i+2, 2))

        fill a + d, n, v
        d = d + n
    next i
end sub

Attached an example below:

Original RLE
Character data size: 8192 bytes 2725 bytes
BG data size: 4104 bytes 1933 bytes

Jigglypuff_RLE.nx | Open in app
2026-03-15 01:18
Jigglypuff.nx | Open in app
2026-03-15 01:18

nathanielbabiak 2026-03-17 04:28 (Edited)

https://lowresnx.inutilis.com/topic.php?id=2347


Log in to reply.