Super Mario 64 Source
A Super Mario 64 decompilation, brought to you by a bunch of clever folks.
Functions | Variables
seq_decoder Namespace Reference

Functions

def print_hword (x)
 
def emit_cmd (key, op, cmd)
 
def emit_env_cmd (op, cmd)
 
def is_arg_command (cmd_args)
 
def gen_label (ind, tp)
 
def gen_mnemonic (tp, b)
 
def decode_one (state)
 
def decode_rec (state, initial)
 
def main ()
 

Variables

dictionary commands = {}
 
dictionary commands_layer_base
 
bool print_end_padding = False
 
dictionary cmds = commands['layer_large']
 
list eu = []
 
list non_eu = []
 
dictionary mn = cmds[op][0]
 
 filename = sys.argv[1]
 
 parts = filename.split('/seq_')
 
 lang = parts[0][-2:]
 
 seq_num = int(parts[1].split('.')[0], 16)
 
 data = f.read()
 
 file
 
list output = [None] * len(data)
 
list output_instate = [None] * len(data)
 
list label_name = [None] * len(data)
 
list script_start = [False] * len(data)
 
bool hit_eof = False
 
list errors = []
 
list seq_writes = []
 
bool force_large_notes = True
 
list decode_list = []
 

Function Documentation

◆ decode_one()

def seq_decoder.decode_one (   state)

◆ decode_rec()

def seq_decoder.decode_rec (   state,
  initial 
)

◆ emit_cmd()

def seq_decoder.emit_cmd (   key,
  op,
  cmd 
)

◆ emit_env_cmd()

def seq_decoder.emit_env_cmd (   op,
  cmd 
)

◆ gen_label()

def seq_decoder.gen_label (   ind,
  tp 
)

◆ gen_mnemonic()

def seq_decoder.gen_mnemonic (   tp,
  b 
)

◆ is_arg_command()

def seq_decoder.is_arg_command (   cmd_args)

◆ main()

def seq_decoder.main ( )

◆ print_hword()

def seq_decoder.print_hword (   x)

Variable Documentation

◆ cmds

dictionary seq_decoder.cmds = commands['layer_large']

◆ commands

dictionary seq_decoder.commands = {}

◆ commands_layer_base

dictionary seq_decoder.commands_layer_base
Initial value:
1 = {
2  # non-arg commands
3  0xc0: ['delay', 'var'],
4  0xc1: ['setshortnotevelocity', 'u8'],
5  0xc2: ['transpose', 'u8'],
6  0xc3: ['setshortnotedefaultplaypercentage', 'var'],
7  0xc4: ['somethingon'], # ?? (something to do with decay behavior)
8  0xc5: ['somethingoff'], # ??
9  0xc6: ['setinstr', 'u8'],
10  0xc7: ['portamento', 'hex8', 'u8', 'u8'],
11  0xc8: ['disableportamento'],
12  0xc9: ['setshortnoteduration', 'u8'],
13  0xca: ['setpan', 'u8'],
14  0xf7: ['loopend'],
15  0xf8: ['loop', 'u8'],
16  0xfb: ['jump', 'addr'],
17  0xfc: ['call', 'addr'],
18  0xff: ['end'],
19  # arg commands
20  0xd0: ['setshortnotevelocityfromtable', 'arg'],
21  0xe0: ['setshortnotedurationfromtable', 'arg'],
22 }

◆ data

seq_decoder.data = f.read()

◆ decode_list

list seq_decoder.decode_list = []

◆ errors

list seq_decoder.errors = []

◆ eu

list seq_decoder.eu = []

◆ file

seq_decoder.file

◆ filename

seq_decoder.filename = sys.argv[1]

◆ force_large_notes

bool seq_decoder.force_large_notes = True

◆ hit_eof

bool seq_decoder.hit_eof = False

◆ label_name

list seq_decoder.label_name = [None] * len(data)

◆ lang

string seq_decoder.lang = parts[0][-2:]

◆ mn

dictionary seq_decoder.mn = cmds[op][0]

◆ non_eu

list seq_decoder.non_eu = []

◆ output

list seq_decoder.output = [None] * len(data)

◆ output_instate

list seq_decoder.output_instate = [None] * len(data)

◆ parts

seq_decoder.parts = filename.split('/seq_')

◆ print_end_padding

bool seq_decoder.print_end_padding = False

◆ script_start

list seq_decoder.script_start = [False] * len(data)

◆ seq_num

int seq_decoder.seq_num = int(parts[1].split('.')[0], 16)

◆ seq_writes

list seq_decoder.seq_writes = []