Skip to content

Instantly share code, notes, and snippets.

View bbbradsmith's full-sized avatar
🦎

Brad Smith bbbradsmith

🦎
View GitHub Profile
@bbbradsmith
bbbradsmith / itunes_m4a_strip.py
Last active May 22, 2025 04:37
Removes iTunes fingerprinting and metadata from M4A files
#!/usr/bin/env python3
#
# iTunes M4A Strip
#
# Brad Smith, 2024
# https://rainwarrior.ca
#
# This program will search for all M4A files under the current directory,
# remove all unnecessary metadata, keeping only the AAC music data,
# then restoring only the desired tags from the original metadata.
@bbbradsmith
bbbradsmith / Sakanakao Twitch History.md
Last active March 4, 2025 22:58
Sakanakao's twitch stream history

Games streamed on Twitch by Sakanakao

2 player streaming partners:

This list is probably a little bit incomplete. It is presented in reverse chronological order. Not all streams have been preserved, and a few are partial or just clips. Other short clips of my streams may be found at my channel's clips page.

@bbbradsmith
bbbradsmith / autothumbs.py
Last active January 7, 2025 10:22
Generates movie thumbnail images automatically
#!/usr/bin/env python3
#
# Automatic Movie Thumbnail Generator
#
# Scans a folder, and generates a thumbnail image for every movie found.
# Uses a grid layout that attempts to maximize utilized space while
# fitting under a given maximum image size, and having at least as many
# frames as requested.
#
@bbbradsmith
bbbradsmith / TerranigmaCompressor.py
Created February 7, 2022 11:53
Compressor and decompressor for Terranigma (SNES)
# Terranigma data compressor and decompressor
# Brad Smith, 2022-02-07
# https://rainwarrior.ca
#
# Format reference:
# https://www.terranigma.be/index.php/Compression
import sys
def usage():
@bbbradsmith
bbbradsmith / serrator.py
Last active August 1, 2024 01:48
Serrator - Adventure game progressive drawing simulator
#!/usr/bin/env python3
# serrator
#
# Explanation: https://www.patreon.com/posts/serrator-game-109214047
#
# Inspired by the way the background images in Sierra games drew in progressively.
# Usually too fast to really see, but on a very slow computer, or artificially slowed,
# the draw-in process was quite fascinating to watch:
# https://twitter.com/PixelArtSierra
@bbbradsmith
bbbradsmith / simcity_decompress.py
Last active July 23, 2024 05:14
SimCity SNES decompressor
# This is a decompressor for data in the Sim City (Japan) ROM for Super Famicom
#
# This extracts the complete character set from the game, used for the popup dialogs,
# and also all of the text used in these dialogs.
# The five SNES versions in various languages can also be dumped by this script, see below.
#
# The decompressor is for a Nintendo compression format that was apparently used in several games,
# and has been known by some as LC_LZ5. It might be useful for other games besides SimCity.
import PIL.Image
@bbbradsmith
bbbradsmith / nes_blocky.py
Last active May 8, 2024 17:32
NES blocky graphics converter - Details: https://www.patreon.com/posts/22735126
#!/usr/bin/env python3
# nes_blocky.py
# Brad Smith, 2018
# http://rainwarrior.ca
#
# Finds .NES ROM files in the current folder,
# and generates "blocky" pixellated versions of each,
# if the game does not use CHR-RAM.
@bbbradsmith
bbbradsmith / bat.yml
Last active March 25, 2024 14:38
Github Actions example workflow for building a batch file
# Action name and trigger conditions.
# workflow_dispatch means: this can be manually re-triggered, and not just by push/pr.
name: Batch File Continuous Integration
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:
@bbbradsmith
bbbradsmith / approximate_spacing.py
Last active October 16, 2023 20:59
Approximating smooth motion in discrete steps
# Problem:
# Making an NES game, want smooth motion but don't want to store sub-pixel precision.
# Solution:
# Approximate smooth motion in discrete steps.
#
# Investigate a few methods, and compare them by smoothness.
# Use standard deviation as a measure of smoothness.
# (Lower deviation total is better.)
#
# Result:
@bbbradsmith
bbbradsmith / abyss_boat_pak_dump.py
Created September 29, 2023 03:57
Unpacks PAK files from the game Abyss Boat by Leaf
# dumps PAK files from the game Abyss Boat by Leaf
import os
import struct
def printable(d):
s = ""
for c in d: s += chr(c) if (c >= 0x20 and c <= 126) else '.'
return s