Skip to content

Instantly share code, notes, and snippets.

Avatar
🙀
🐛

Andrew Ekstedt magical

🙀
🐛
  • Oregon
View GitHub Profile
@magical
magical / 0_cc2key.txt
Last active Oct 18, 2020
Notes on CC2's checksum scheme
View 0_cc2key.txt
Notes on CC2's checksum scheme
==============================
Background
----------
The "KEY " chunk in C2M files stores a 128-bit hash. This
was originally part of a scheme to prevent users from playing
levels not made with the official editor, but was ripped out
before the public release.[1]
View extractgarc.go
// Usage: extractgarc garcfile outdir
// Extract and decompress all files in garcfile to outdir.
package main
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
View Grafikkomprimierung_PKMN_RGBY.xml
<?xml version="1.0" encoding="UTF-8" ?>
<mediawiki version="0.1" xml:lang="de">
<page>
<title>Grafikkomprimierung PKMN RGBY</title>
<revision>
<timestamp>2006-05-21T08:40:04Z</timestamp>
<contributor><username>Tauwasser</username></contributor>
<minor/>
<comment>/* Genereller Vorgang */</comment>
<text>Die Grafikkompression in Pokémon Rot, Grün, Blau und Gelb ist eine Kombination aus unkomprimierten Daten und einem RLE-Befehl, der nur 0-Bits schreibt.
View Search.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#include <pthread.h>
#include <time.h>
// Tiles
#define FLOOR 0x00
#define WALL 0x01
@magical
magical / headbutt.py
Created Aug 3, 2019
hg/ss headbutt data dumper (circa 2012)
View headbutt.py
# coding: utf-8
from struct import pack, unpack
from narc import parse_narc
from cStringIO import StringIO
from warnings import warn
"""
@magical
magical / safari.py
Created Aug 3, 2019
hg/ss safari data parser (circa 2010)
View safari.py
#!/usr/bin/env python3
import sys
from struct import pack, unpack
pokename = {
1: "Bulbasaur", 2: "Ivysaur", 3: "Venusaur", 4: "Charmander", 5: "Charmeleon", 6: "Charizard", 7: "Squirtle", 8: "Wartortle", 9: "Blastoise", 10: "Caterpie", 11: "Metapod", 12: "Butterfree", 13: "Weedle", 14: "Kakuna", 15: "Beedrill", 16: "Pidgey", 17: "Pidgeotto", 18: "Pidgeot", 19: "Rattata", 20: "Raticate", 21: "Spearow", 22: "Fearow", 23: "Ekans", 24: "Arbok", 25: "Pikachu", 26: "Raichu", 27: "Sandshrew", 28: "Sandslash", 29: "Nidoran(f)", 30: "Nidorina", 31: "Nidoqueen", 32: "Nidoran(m)", 33: "Nidorino", 34: "Nidoking", 35: "Clefairy", 36: "Clefable", 37: "Vulpix", 38: "Ninetales", 39: "Jigglypuff", 40: "Wigglytuff", 41: "Zubat", 42: "Golbat", 43: "Oddish", 44: "Gloom", 45: "Vileplume", 46: "Paras", 47: "Parasect", 48: "Venonat", 49: "Venomoth", 50: "Diglett", 51: "Dugtrio", 52: "Meowth", 53: "Persian", 54: "Psyduck", 55: "Golduck", 56: "Mankey", 57: "Primeape", 58: "Growlithe", 59: "Arcanine", 60: "Poliwag", 61: "Poliwhirl"
View simd.p4.cpp
#include "simd.p4.h"
// July 13, 2017: mjb -- changed rbx register to r8
// The convention is that rbx needs to be saved by the callee (i.e., pushed and popped),
// but rcx, rdx, r8, and r9 do not
// This fixed the bug that showed up in cs 475/575 project #5 in SQ 2017
void
SimdMul( float *a, float *b, float *c, int len )
@magical
magical / matrix-irc.md
Created Mar 1, 2019
HOWTO connect to IRC with matrix (draft)
View matrix-irc.md

HOWTO connect to IRC with matrix

This guide explains how to connect to freenode channels via matrix, using riot.im.

  1. matrix.org runs a public freenode bridge.

  2. channels follow the pattern #freenode_#channel:matrix.org, so if you wanted to join #python on freenode, you'd type '#freenode_#python:matrix.org' into the join channel box in riot.im.

View flim.lily
\header {
title = "Flim"
composer = "Aphex Twin"
arranger = "The Bad Plus"
}
melody = \relative c'' {
d4 f a ais
d, f a ais
c, ees g d'