Skip to content

Instantly share code, notes, and snippets.

View magical's full-sized avatar
πŸ™€
πŸ›

Andrew Ekstedt magical

πŸ™€
πŸ›
View GitHub Profile
#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 / safari.py
Created August 3, 2019 04:15
hg/ss safari data parser (circa 2010)
#!/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"
@magical
magical / headbutt.py
Created August 3, 2019 04:22
hg/ss headbutt data dumper (circa 2012)
# coding: utf-8
from struct import pack, unpack
from narc import parse_narc
from cStringIO import StringIO
from warnings import warn
"""
#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
<?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.
// Usage: extractgarc garcfile outdir
// Extract and decompress all files in garcfile to outdir.
package main
import (
"fmt"
"io"
"log"
"os"
"path/filepath"
@magical
magical / 0_cc2key.txt
Last active October 18, 2020 08:44
Notes on CC2's checksum scheme
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]
@magical
magical / flakes.png
Last active December 13, 2020 07:15
snowflakes
flakes.png
pokemon β”‚ version_group β”‚ pokemon_id β”‚ version_group_id β”‚ level β”‚ order
────────────────┼───────────────────┼────────────┼──────────────────┼───────┼──────────────
ivysaur β”‚ gold-silver β”‚ 2 β”‚ 3 β”‚ 15 β”‚ {4,NULL}
venusaur β”‚ gold-silver β”‚ 3 β”‚ 3 β”‚ 15 β”‚ {5,NULL}
muk β”‚ gold-silver β”‚ 89 β”‚ 3 β”‚ 45 β”‚ {NULL,NULL}
ledian β”‚ gold-silver β”‚ 166 β”‚ 3 β”‚ 24 β”‚ {3,4,NULL}
wooper β”‚ gold-silver β”‚ 194 β”‚ 3 β”‚ 51 β”‚ {3,NULL}
quagsire β”‚ gold-silver β”‚ 195 β”‚ 3 β”‚ 59 β”‚ {3,NULL}
qwilfish β”‚ gold-silver β”‚ 211 β”‚ 3 β”‚ 10 β”‚ {3,NULL}
ivysaur β”‚ crystal β”‚ 2 β”‚ 4 β”‚ 15 β”‚ {4,NULL}
@magical
magical / form_differences_2021.txt
Last active March 31, 2021 05:16
Form differences (Gen 8)
Venusaur: ability, exp, height, pokeathlon, stats, weight
Charizard: ability, exp, pokeathlon, stats, type, weight
Blastoise: ability, exp, pokeathlon, stats, weight
Beedrill: ability, exp, height, items, pokeathlon, stats, weight
Pidgeot: ability, exp, height, pokeathlon, stats, weight
Rattata: ability, items, pokeathlon, type, weight, moves (egg, machine, tutor)
Raticate: ability, height, items, pokeathlon, stats, type, weight, moves (machine, tutor)
Pichu: pokeathlon
Pikachu: exp, items, pokeathlon, stats, moves (egg, form-change, tutor)
Raichu: ability, height, items, pokeathlon, stats, type, weight, moves (level-up, machine, tutor)