Skip to content

Instantly share code, notes, and snippets.

@camthesaxman
camthesaxman / shadertoy.c
Last active September 28, 2023 20:10
Native application to render ShaderToy (www.shadertoy.com) shaders
/**
* Native application to render ShaderToy (www.shadertoy.com) shaders
*
* Requirements:
* GLFW - https://www.glfw.org/
* libplum - https://github.com/aaaaaa123456789/libplum
* libavcodec, libavformat, libavutil, libswscale (optional, for video capture) - https://ffmpeg.org/
* portaudio (optional, for sound support)
*/
#ifdef _WIN32
@camthesaxman
camthesaxman / linux_tweaks.md
Last active June 27, 2023 21:37
Misc. Linux Tweaks

This is a collection of various Linux system tweaks I've accumulated over the years.

Better UI font rendering on screens.

Freetype, since version 2.7 in 2016, enables the v40 interpreter by default, which does less hinting. While more accurate, fonts no longer snap to the pixel grid and appear smudgy. We can enable the old interpreter that has sharper font rendering by using the FREETYPE_PROPERTIES environment variable. Put this in a .sh script within /etc/profile.d to enable globally

export FREETYPE_PROPERTIES="truetype:interpreter-version=35"

The DejaVu and Ubuntu fonts work very well with this setting and are a good choice for your GUI.

Dealing with limited memory

@camthesaxman
camthesaxman / smb1-anims.md
Last active June 10, 2022 13:13
Super Monkey Ball 1 Animation File Formats

Super Monkey Ball 1 Animation File Formats

This document describes the format of the four files used for character animation in Super Monkey Ball: motlabel.bin, motdat.lz, motskl.bin, and motinfo.lz.

Types used in this document:

Name Description
u8 1-byte unsigned value
u16 2-byte unsigned value
@camthesaxman
camthesaxman / Makefile
Created March 3, 2022 01:03
Kernel Module to fix wrong button mapping of PowerA wired Nintendo Switch controller
obj-m += powera_switch_fix.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean
@camthesaxman
camthesaxman / gist:b1d541a251b679296983fcebc0ee5293
Last active January 2, 2022 17:47
random Super Monkey Ball gecko codes
For the NTSC-U version of SMB1
Giant monkey and ball (2x size)
041b7b7c 3f800000
04205ed4 40000000
Tiny monkey and ball (0.25x size)
041b7b7c 3e000000
04205ed4 3e800000
@camthesaxman
camthesaxman / win98.html
Last active June 16, 2023 15:45
Windows 98 Simulator
<html>
<head>
<title>Windows 98</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://unpkg.com/98.css">
<style>
/* Disable image filtering */
img {
image-rendering: optimizeSpeed; /* STOP SMOOTHING, GIVE ME SPEED */
@camthesaxman
camthesaxman / doldisasm.py
Last active April 22, 2024 21:42
GameCube .dol disassembler
#!/usr/bin/env python
#
# GameCube .dol file disassembler
# Usage: doldisasm.py DOL_FILE > assembly_file.s
#
from capstone import *
from capstone.ppc import *
import sys
@camthesaxman
camthesaxman / pretdiff.py
Last active June 10, 2018 23:33
pokeruby/pokeemerald diffing tool
#!/usr/bin/python
import BaseHTTPServer
import SocketServer
import difflib
import os
pageHeader = '''
<html>
<head>
@camthesaxman
camthesaxman / irixswextract.c
Created March 17, 2018 19:32
tool to extract IRIX software packages
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
struct Archive
/*
* tilesplit
* Simple tool to split a PNG into a tileset + tilemap.
*/
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>