Skip to content

Instantly share code, notes, and snippets.

View sethmlarson's full-sized avatar
🛡️

Seth Larson sethmlarson

🛡️
View GitHub Profile
# License: MIT
import sys
import mmap
import hashlib
import struct
# MD5 hashes from https://datomatic.no-intro.org
# Headerless, as header is changed from non-AC releases.
known_roms = {
@sethmlarson
sethmlarson / dat2bin.cpp
Last active March 4, 2026 19:00
Convert .dat files from "Sonic Mega Collection" on GameCube to .md Genesis ROMs
#include <fstream>
#include <string>
int processdata(unsigned char *InData, unsigned char *OutData, int filedatasize) // OutData=0 to get size
{
int CurrIn = 0x4; //Skip size
int CurrOut = 0;
while (CurrIn < filedatasize)
{
int Code = InData[CurrIn++];
@sethmlarson
sethmlarson / sugarcookie.py
Created December 31, 2025 18:05
Script for cutting spritesheets like cookies using Python and Pillow
#!/usr/bin/env python
# /// script
# requires-python = ">=3.13"
# dependencies = [
# "Pillow",
# "tqdm"
# ]
# ///
# License: MIT
# Copyright 2025, Seth Larson
@sethmlarson
sethmlarson / lan-party-calculator.py
Created March 24, 2026 03:36
LAN Party Calculator for Mario Kart, Kirby Air Riders, and F-Zero
# LAN Party Calculator for Mario Kart, Kirby Air Riders, and F-Zero
# Code License: MIT, Copyright 2026 Seth Larson
# Data License: CC-BY-SA 4.0, Wikipedia
import dataclasses
import enum
import math
from dataclasses import dataclass
from textwrap import dedent as d