![]() |
Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
|
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "libmio0.h"
#include "libsm64.h"
#include "utils.h"
Data Structures | |
struct | ptr_t |
Macros | |
#define | IN_START_ADDR 0x000D0000 |
#define | OUT_START_ADDR 0x00800000 |
#define | OPCODE(IBUF_) ((IBUF_)[0] & 0xFC) |
#define | RS(IBUF_) ( (((IBUF_)[0] & 0x3) < 3) | (((IBUF_)[1] & 0xE0) > 5) ) |
#define | RT(IBUF_) ((IBUF_)[1] & 0x1F) |
#define | MAX_PTRS 128 |
#define | COMPRESSED_LENGTH 2 |
Functions | |
static int | find_ptr (unsigned int ptr, ptr_t table[], int count) |
static int | find_mio0 (unsigned char *buf, unsigned int length, ptr_t table[]) |
static void | find_pointers (unsigned char *buf, unsigned int length, ptr_t table[], int count) |
static unsigned int | la2int (unsigned char *buf, unsigned int lui, unsigned int addiu) |
static void | find_asm_pointers (unsigned char *buf, ptr_t table[], int count) |
static void | sm64_adjust_pointers (unsigned char *buf, unsigned int length, ptr_t table[], int count) |
static void | sm64_adjust_asm (unsigned char *buf, ptr_t table[], int count) |
static void | sm64_calc_checksums (unsigned char *buf, unsigned int cksum[]) |
rom_type | sm64_rom_type (unsigned char *buf, unsigned int length) |
rom_version | sm64_rom_version (unsigned char *buf) |
void | sm64_decompress_mio0 (const sm64_config *config, unsigned char *in_buf, unsigned int in_length, unsigned char *out_buf) |
void | sm64_update_checksums (unsigned char *buf) |
#define COMPRESSED_LENGTH 2 |
#define IN_START_ADDR 0x000D0000 |
#define MAX_PTRS 128 |
#define OPCODE | ( | IBUF_ | ) | ((IBUF_)[0] & 0xFC) |
#define OUT_START_ADDR 0x00800000 |
#define RS | ( | IBUF_ | ) | ( (((IBUF_)[0] & 0x3) < 3) | (((IBUF_)[1] & 0xE0) > 5) ) |
#define RT | ( | IBUF_ | ) | ((IBUF_)[1] & 0x1F) |
|
static |
|
static |
void sm64_decompress_mio0 | ( | const sm64_config * | config, |
unsigned char * | in_buf, | ||
unsigned int | in_length, | ||
unsigned char * | out_buf | ||
) |
rom_version sm64_rom_version | ( | unsigned char * | buf | ) |