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()
@Mai-Lapyst
Mai-Lapyst / icicle-kit.log
Created September 11, 2022 21:56
Renode Icicle-kit CPU bug
This file has been truncated, but you can view the full file.
23:38:15.7814 [INFO] Loaded monitor commands from: /opt/renode/scripts/monitor.py
23:38:16.0726 [INFO] Including script: /opt/renode/scripts/single-node/icicle-kit.resc
23:38:16.4892 [INFO] System bus created.
23:38:20.3750 [INFO] sysbus: Loading segment of 108052 bytes length at 0x20220000.
23:38:20.3819 [INFO] sysbus: Loading segment of 2848 bytes length at 0x2023A640.
23:38:20.3820 [INFO] sysbus: Loading segment of 68048 bytes length at 0x2023AF40.
23:38:20.3827 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x20240000, 0x2024B90F>.
23:38:20.3827 [INFO] sysbus: Loading segment of 81920 bytes length at 0x2023AF40.
23:38:20.3829 [WARNING] sysbus: Tried to access bytes at non-existing peripheral in range <0x20240000, 0x2024EF3F>.
23:38:20.3934 [INFO] e51: Setting PC value to 0x20220000.
@Mai-Lapyst
Mai-Lapyst / SimpleCat.java
Created March 10, 2021 17:28
simple cat like java application; used to test graalvm --static builds
import java.io.*;
import java.nio.*;
import java.nio.charset.*;
import java.nio.file.*;
public class SimpleCat {
public static void main(String[] args) {
Path file = FileSystems.getDefault().getPath(args[0]);
Charset charset = Charset.forName("US-ASCII");
try (BufferedReader reader = Files.newBufferedReader(file, charset)) {
@Mai-Lapyst
Mai-Lapyst / pointer_aritmetic_1.c
Last active August 26, 2020 07:18
Example what different types of pointer does with the underlaying addresses
#include <stdio.h>
#include <stdint.h>
#include <stdlib.h>
struct myStruct {
uint32_t a;
uint32_t b;
uint32_t c;
uint32_t d;
};