Skip to content

Instantly share code, notes, and snippets.

View bbbradsmith's full-sized avatar
🦎

Brad Smith bbbradsmith

🦎
View GitHub Profile
@bbbradsmith
bbbradsmith / a8_to_tga.py
Created July 16, 2018 06:01
Microsoft screensaver sample A8 to TGA decoder
# decodes the A8 files in
# Microsoft Windows NT 4.0 SDK (1996)
# MSTOOLS\SAMPLES\OPENGL\SCRSAVE\MAZE
#
# based on MSTOOLS\SAMPLES\OPENGL\SCRSAVE\COMMON\SSA8.C
import struct
def a8decompress(d):
# defines
@bbbradsmith
bbbradsmith / nsfe_to_nsf2.py
Last active November 5, 2022 09:12
Utility to convert NSFe music files into the backward compatible NSF2 with metadata format.
#!/usr/bin/env python3
import sys
assert sys.version_info[0] >= 3, "Python 3 required."
#
# nsfe_to_nsf2.py
# Brad Smith, 2018-08-24
#
# This converts an NSFe file to a preliminary "NSF2 with metadata" format.
#
@bbbradsmith
bbbradsmith / nsf2_strip.py
Created August 25, 2018 20:15
Utility to strip metadata from NSF2 files.
#!/usr/bin/env python3
import sys
assert sys.version_info[0] >= 3, "Python 3 required."
#
# nsf2_strip.py
# Brad Smith, 2018-08-25
#
# This strips metadata from NSF2 files.
#
-- Karnov Inspector lua script for FCEUX
-- rainwarrior 2018 #Karnovember
-- http://rainwarrior.ca
-- Press H for help
VERSION = "v1.0"
-- Modes and input handling to toggle them
@bbbradsmith
bbbradsmith / nes_blocky.py
Last active June 24, 2023 02:04
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 / avecta.py
Last active December 13, 2018 08:53
Avecta (Atari ST) data dumper
# Avecta I: Ebora is an Atari ST game published in STart Magazine, September 1989
#
# Information here:
# https://www.atarimagazines.com/startv4n2/avecta.html
#
# This program parses its data files, and generates maps from it.
# The file formats can be deduced from the program.
# Some of the data is described in comments.
import PIL.Image
@bbbradsmith
bbbradsmith / makeflop.md
Last active April 21, 2019 21:03
Simple file operations for a FAT12 floppy disk image. (Moved to GitHub)
@bbbradsmith
bbbradsmith / circlemap.py
Last active June 19, 2022 10:04
Example renderings of the chaotic Circle Map. - Details: https://www.patreon.com/posts/24826459
#!/usr/bin/env python3
#
# circlemap.py
# Brad Smith, 2019
# http://rainwarrior.ca
#
# Example renderings of the chaotic Circle Map.
# http://mathworld.wolfram.com/CircleMap.html
import sys
@bbbradsmith
bbbradsmith / blades_of_steel_ppudata.py
Created March 6, 2019 09:02
Blades of Steel PPU data (CHR/nametable) decoder and encoder
#!/usr/bin/env python3
#
# Python script for decoding or re-encoding PPU data
# (CHR or nametable) bundles from Blades of Steel.
#
# See bottom of this file for example usage.
#
rom_filename = "Blades of Steel (U).nes"
@bbbradsmith
bbbradsmith / aspetra_dump.py
Last active May 4, 2021 02:20
Aspetra (DOS) data file formats and python dump script
#!/usr/bin/env python3
#
# Python script for dumping data from Aspetra.
# Prerequisite: PIL
#
# Brad Smith, 2019
# http://rainwarrior.ca
#
# 2021-05-03 - Monster 0 is valid, object 157 disables monsters.