![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <unistd.h>#include <assert.h>#include <math.h>#include <string.h>#include <stdio.h>#include <stdlib.h>#include <stdarg.h>Data Structures | |
| struct | ChunkHeader |
| struct | Chunk |
| struct | CommonChunk |
| struct | Marker |
| struct | Loop |
| struct | InstrumentChunk |
| struct | SoundDataChunk |
| struct | CodeChunk |
| struct | ALADPCMloop |
Macros | |
| #define | bswap16(x) __builtin_bswap16(x) |
| #define | bswap32(x) __builtin_bswap32(x) |
| #define | BSWAP16(x) x = __builtin_bswap16(x) |
| #define | BSWAP32(x) x = __builtin_bswap32(x) |
| #define | BSWAP16_MANY(x, n) for (s32 _i = 0; _i < n; _i++) BSWAP16((x)[_i]) |
| #define | NORETURN __attribute__((noreturn)) |
| #define | UNUSED __attribute__((unused)) |
| #define | checked_fread(a, b, c, d) if (fread(a, b, c, d) != c) fail_parse("error parsing file") |
Typedefs | |
| typedef signed char | s8 |
| Bruteforcing decoder for converting ADPCM-encoded AIFC into AIFF, in a way that roundtrips with vadpcm_enc. More... | |
| typedef short | s16 |
| typedef int | s32 |
| typedef unsigned char | u8 |
| typedef unsigned short | u16 |
| typedef unsigned int | u32 |
| typedef unsigned long long | u64 |
| typedef float | f32 |
Functions | |
| NORETURN void | fail_parse (const char *fmt,...) |
| s32 | myrand () |
| s16 | qsample (s32 x, s32 scale) |
| s16 | clamp_to_s16 (s32 x) |
| s32 | toi4 (s32 x) |
| s32 | readaifccodebook (FILE *fhandle, s32 ****table, s16 *order, s16 *npredictors) |
| ALADPCMloop * | readlooppoints (FILE *ifile, s16 *nloops) |
| s32 | inner_product (s32 length, s32 *v1, s32 *v2) |
| void | my_decodeframe (u8 *frame, s32 *state, s32 order, s32 ***coefTable) |
| void | my_encodeframe (u8 *out, s16 *inBuffer, s32 *state, s32 ***coefTable, s32 order, s32 npredictors) |
| void | permute (s16 *out, s32 *in, s32 scale) |
| void | write_header (FILE *ofile, const char *id, s32 size) |
| int | main (int argc, char **argv) |
Variables | |
| static char | usage [] = "input.aifc output.aiff" |
| static const char * | progname |
| static const char * | infilename |
| #define bswap16 | ( | x | ) | __builtin_bswap16(x) |
| #define BSWAP16 | ( | x | ) | x = __builtin_bswap16(x) |
| #define bswap32 | ( | x | ) | __builtin_bswap32(x) |
| #define BSWAP32 | ( | x | ) | x = __builtin_bswap32(x) |
| #define checked_fread | ( | a, | |
| b, | |||
| c, | |||
| d | |||
| ) | if (fread(a, b, c, d) != c) fail_parse("error parsing file") |
| #define NORETURN __attribute__((noreturn)) |
| #define UNUSED __attribute__((unused)) |
Bruteforcing decoder for converting ADPCM-encoded AIFC into AIFF, in a way that roundtrips with vadpcm_enc.
| void my_encodeframe | ( | u8 * | out, |
| s16 * | inBuffer, | ||
| s32 * | state, | ||
| s32 *** | coefTable, | ||
| s32 | order, | ||
| s32 | npredictors | ||
| ) |
| s32 myrand | ( | ) |
| ALADPCMloop* readlooppoints | ( | FILE * | ifile, |
| s16 * | nloops | ||
| ) |
|
static |
1.8.13