Skip to content

Instantly share code, notes, and snippets.

@iamgreaser
iamgreaser / update-timer-combined.py
Created January 27, 2018 04:12
MegaZeux autotimer for speedruns for Zeux 2,3,4,5
#!/usr/bin/env python3 --
# vim: set sts=4 sw=4 et :
'''
update-timer-combined.py
Autotimer for the 4 original MegaZeux games
by GreaseMonkey, 2018 - Public Domain
Dependencies:
sudo pip3 install inotify_simple
@iamgreaser
iamgreaser / backtrack.scm
Created January 6, 2018 03:12
Prolog-style backtracking in Scheme using continuations
;; vim: set sts=2 sw=2 et lisp sm :
(define *bt-chain* '())
(define (bt-fork starter . remains)
(call/cc (lambda (ret)
(set! *bt-chain*
(append
(map (lambda (x)
`(,ret . ,x))
#!/usr/bin/env python3 --
# vim: set ts=8 sw=8 noet :
"""
lzify: pure LZSS pack/depack routines
by GreaseMonkey, 2018 - Public Domain
Usage:
python3 lzify.py infile.tar outfile.tar.lzified
@iamgreaser
iamgreaser / update-timer.py
Created December 7, 2017 09:05
My split timer for Zeux 2
#!/usr/bin/env python3 --
TIMERFILE = "/home/ben/timer.txt"
import math
import time
import inotify_simple
IFlags = inotify_simple.flags
@iamgreaser
iamgreaser / .cl
Created November 14, 2017 08:26
macros are fun
;;;;
;;;; BEFORE
;;;;
(defclass op-code ()
((name :accessor op-code-name
:initarg :name
:initform (error "must provide a name for a given op-code"))
(type :accessor op-code-type
:initarg :type
@iamgreaser
iamgreaser / gist:b1ebe6debc439b45c5fba074c3e34052
Last active April 15, 2021 19:30
THUG2 LZSS compression scheme (as used by the *.prx files)
THUG2 LZSS compression scheme (as used by the *.prx files)
Documented by GreaseMonkey in 2017
Document version V1
I release this document into the public domain.
AWWW YEAAAAH! Datz RIGHT b0!Z! We got a ... yeah whatever I'm not doing the
ASCII art required for that kind of introduction.
Well, they could've packed it a bit better, but hey, it took 50 minutes to
crack so I'm not complaining, and it is at least a decent compression scheme.
@iamgreaser
iamgreaser / thps-format-psx.md
Last active August 13, 2022 23:30
`*.psx` - Apocalypse / THPS / Spiderman / whatever model format

*.psx - Apocalypse / THPS / Spiderman / whatever model format

Documented by GreaseMonkey

Document version v2

I release this document into the public domain.

This information aims to cover the format used as per the PS1 and PC versions of THPS2.

@iamgreaser
iamgreaser / psxviewer.c
Created August 19, 2017 00:31
THPS2 model viewer - quick release 1
/*
THPS2 level viewer
quick release 1
by GreaseMonkey, 2017 - Public Domain
takes two args
first arg is the main model (e.g. skhan.psx, skhan_o.psx)
second arg is the texture lib (e.g. skhan_l.psx)
needs SDL2 and OpenGL
@iamgreaser
iamgreaser / thps2ps1-filenames-but1.txt
Last active August 13, 2022 23:30
THPS2 PS1 (almost) complete filename list (UPDATE: found the last one!)
This file contains all 1531 filenames in the original PS1 version of Tony Hawk's Pro Skater 2,
EXCEPT for one filename. These were all obtained from the PAL version.
*** UPDATED: FOUND. It's "loading.bmp". ***
The missing filename is index 0965 and it's a BMP file.
I'm bruteforcing the filename, it's not an easy one to guess as it's a relic from THPS1.
This will take quite a few hours to get through the alphabet. I'm on "af??????.bmp" right now.
Have fun.
@iamgreaser
iamgreaser / fuckedbin2unfuckedbin.c
Created July 3, 2017 06:47
fuckedbin2unfuckedbin.c - a tool for unfucking fucked PSX bin images
// modified by GreaseMonkey for the purpose of unfucking bins made by hitmen's iso2raw
//
// this is a mashup of hitmen's iso2raw.c
// and nocash's psx-spx pseudocode: http://nocash.emubase.de/psx-spx.htm
// mashup applied by GreaseMonkey
/*
PSX Images need to be Mode2/XA 2352, which fortunatly can be represented by
traditional bin/cue images. However, mkisofs generates plain 2048bytes/sector
images - this tool converts them into the proper format that can be burned.