This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import math | |
import os | |
import sys | |
from PIL import Image | |
from subprocess import call | |
if sys.version > '3': | |
buffer = memoryview |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include "rg_etc1.h" | |
//requires rg_etc1.cpp and rg_etc1.h from https://code.google.com/p/rg-etc1/source/browse/#svn%2Ftrunk | |
typedef unsigned char u8; | |
typedef unsigned short u16; | |
typedef unsigned int u32; | |
typedef unsigned long long u64; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import math | |
import os | |
import sys | |
if sys.version > '3': | |
buffer = memoryview | |
def getWord(b, k, n=4): | |
return sum(list(map(lambda c: b[k+c]<<(c*8),range(n)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import struct | |
import math | |
import os | |
import sys | |
from PIL import Image | |
tileOrder=[0,1,8,9,2,3,10,11,16,17,24,25,18,19,26,27,4,5,12,13,6,7,14,15,20,21,28,29,22,23,30,31,32,33,40,41,34,35,42,43,48,49,56,57,50,51,58,59,36,37,44,45,38,39,46,47,52,53,60,61,54,55,62,63] | |
def parseTile(im, l, x, y): | |
global tileOrder | |
for k in range(8*8): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
#include <math.h> | |
#include <string.h> | |
#include <ctr/types.h> | |
#include <ctr/srv.h> | |
#include <ctr/APT.h> | |
#include <ctr/GSP.h> | |
#include <ctr/GX.h> | |
#include <ctr/GPU.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; make sure you update aemstro_as for this (27/05/14) | |
; setup constants | |
.const 5, 0.0, 0.0, -0.99, 1.0 | |
; setup outmap | |
.out o0, result.position | |
.out o1, result.color | |
.out o2, result.texcoord0 | |
.out o3, result.texcoord1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; make sure you update aemstro_as for this (12/13/14) | |
; setup constants | |
.const c20, 1.0, 0.0, 0.5, 1.0 | |
.const c21, 0.25, 0.0, 0.5, 1.0 | |
.const c22, 0.0, 0.0, -0.5, 1.0 | |
.const c23, 0.5, 0.0, -0.5, 1.0 | |
.const c24, 0.0, 0.5, -0.5, 1.0 | |
.const c25, 0.5, 0.5, -0.5, 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import wave | |
import struct | |
# bit0 is a single period sine wave at 1024Hz with a given amplitude | |
# bit1 is the same but with ~2.7 times the amplitude | |
bits = [[0x00, 0x09, 0x12, 0x1A, 0x21, 0x27, 0x2C, 0x2F, 0x30, 0x2F, 0x2C, 0x27, 0x21, 0x1A, 0x12, 0x09, 0x00, 0xF6, 0xED, 0xE5, 0xDE, 0xD8, 0xD3, 0xD0, 0xD0, 0xD0, 0xD3, 0xD8, 0xDE, 0xE5, 0xED, 0xF6], [0x00, 0x18, 0x30, 0x46, 0x59, 0x69, 0x75, 0x7C, 0x7F, 0x7C, 0x75, 0x69, 0x59, 0x46, 0x30, 0x18, 0x00, 0xE7, 0xCF, 0xB9, 0xA6, 0x96, 0x8A, 0x83, 0x81, 0x83, 0x8A, 0x96, 0xA6, 0xB9, 0xCF, 0xE7]] | |
bits[0] = [b^0x80 for b in bits[0]] | |
bits[1] = [b^0x80 for b in bits[1]] | |
bits[0] = struct.pack('%sB' % len(bits[0]), *bits[0]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import struct | |
import ctypes | |
import compress | |
#compress.py from https://github.com/magical/nlzss/blob/master/compress.py | |
#slightly modified padding | |
def getWord(b, k, n=4): | |
return sum(list(map(lambda c: b[k+c]<<(c*8),range(n)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void _aptExit() | |
{ | |
Handle _srvHandle; | |
Handle* srvHandle = &_srvHandle; | |
Handle aptLockHandle = 0; | |
Handle aptuHandle=0x00; | |
_initSrv(srvHandle); | |
_aptSessionInit(); |
OlderNewer