Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Data Structures | Macros | Typedefs | Functions | Variables
gen_asset_list.cpp File Reference
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <filesystem>
#include <fstream>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
#include <unordered_map>
#include <vector>

Data Structures

struct  Pos
 

Macros

#define BSWAP32(x)   ((((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000U))
 
#define BSWAP16(x)   ((((x) >> 8) & 0xff) | (((x) << 8) & 0xff00))
 

Typedefs

typedef uint8_t u8
 
typedef uint64_t u64
 

Functions

size_t findCutPos (const string &s)
 
pair< size_t, u64hashString (const string &inp)
 
template<class F >
void rollingHashes (const string &str, size_t chunkSize, F &&f)
 
bool stringMatches (const string &base, size_t pos, const string &target)
 
string mio0_decompress (uint32_t *src)
 
string readFile (const string &p, bool allowMissing=false)
 
pair< int, intgetPngSize (const string &fname)
 
string exec (const string &cmd)
 
string compileAsset (const string &fname)
 
tuple< string, string, vector< string > > compileSoundData (const string &lang)
 
int main ()
 

Variables

const charOUTPUT_FILE = "assets.json"
 
const size_t CHUNK_SIZE = 16
 
const vector< string > LANGS = {"jp", "us", "eu"}
 
const u64 C = 12318461241ULL
 

Macro Definition Documentation

◆ BSWAP16

#define BSWAP16 (   x)    ((((x) >> 8) & 0xff) | (((x) << 8) & 0xff00))

◆ BSWAP32

#define BSWAP32 (   x)    ((((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000U))

Typedef Documentation

◆ u64

typedef uint64_t u64

◆ u8

typedef uint8_t u8

Function Documentation

◆ compileAsset()

string compileAsset ( const string &  fname)

◆ compileSoundData()

tuple<string, string, vector<string> > compileSoundData ( const string &  lang)

◆ exec()

string exec ( const string &  cmd)

◆ findCutPos()

size_t findCutPos ( const string &  s)

◆ getPngSize()

pair<int, int> getPngSize ( const string &  fname)

◆ hashString()

pair<size_t, u64> hashString ( const string &  inp)

◆ main()

int main ( )

◆ mio0_decompress()

string mio0_decompress ( uint32_t *  src)

◆ readFile()

string readFile ( const string &  p,
bool  allowMissing = false 
)

◆ rollingHashes()

template<class F >
void rollingHashes ( const string &  str,
size_t  chunkSize,
F &&  f 
)

◆ stringMatches()

bool stringMatches ( const string &  base,
size_t  pos,
const string &  target 
)

Variable Documentation

◆ C

const u64 C = 12318461241ULL

◆ CHUNK_SIZE

const size_t CHUNK_SIZE = 16

◆ LANGS

const vector<string> LANGS = {"jp", "us", "eu"}

◆ OUTPUT_FILE

const char* OUTPUT_FILE = "assets.json"