mirror of
https://github.com/zeldaret/tmc
synced 2026-05-24 23:22:08 -04:00
Move all scripts to data/scripts.s
This commit is contained in:
@@ -72,11 +72,11 @@ commands = [
|
||||
{'fun': 'sub_0807E280'},
|
||||
{'fun': 'sub_0807E2A8', 'params': 's'},
|
||||
{'fun': 'sub_0807E2E4', 'params': ''},
|
||||
{'fun': 'sub_0807E30C'},
|
||||
{'fun': 'sub_0807E30C', 'params': ''},
|
||||
{'fun': 'sub_0807E390'},
|
||||
{'fun': 'sub_0807E3BC'},
|
||||
{'fun': 'sub_0807E3E8'},
|
||||
{'fun': 'sub_0807E40C'},
|
||||
{'fun': 'sub_0807E40C', 'params': 's'},
|
||||
{'fun': 'sub_0807E42C'},
|
||||
{'fun': 'sub_0807E48C'},
|
||||
{'fun': 'sub_0807E4CC'},
|
||||
@@ -92,14 +92,14 @@ commands = [
|
||||
{'fun': 'sub_0807E628'},
|
||||
{'fun': 'sub_0807E634'},
|
||||
{'fun': 'sub_0807E644'},
|
||||
{'fun': 'sub_0807E650'},
|
||||
{'fun': 'sub_0807E650', 'params': 's'},
|
||||
{'fun': 'sub_0807E65C'},
|
||||
{'fun': 'sub_0807E668'},
|
||||
{'fun': 'sub_0807E674'},
|
||||
{'fun': 'sub_0807E680', 'params': 's'},
|
||||
{'fun': 'sub_0807E690'},
|
||||
{'fun': 'sub_0807E6AC', 'params': 'w'},
|
||||
{'fun': 'sub_0807E6DC'},
|
||||
{'fun': 'sub_0807E6DC', 'params': ''},
|
||||
{'fun': 'sub_0807E700'},
|
||||
{'fun': 'sub_0807E72C'},
|
||||
{'fun': 'sub_0807E75C'},
|
||||
@@ -128,25 +128,25 @@ commands = [
|
||||
{'fun': 'sub_0807E914'},
|
||||
{'fun': 'sub_0807E924'},
|
||||
{'fun': 'sub_0807E930', 'params': 's'},
|
||||
{'fun': 'sub_0807E944'},
|
||||
{'fun': 'sub_0807E944', 'params': ''},
|
||||
{'fun': 'sub_0807E974'},
|
||||
{'fun': 'sub_0807E9D4', 'params': ''},
|
||||
{'fun': 'sub_0807E9DC', 'params': ''},
|
||||
{'fun': 'sub_0807E9E4'},
|
||||
{'fun': 'sub_0807E9F0'},
|
||||
{'fun': 'sub_0807EA4C'},
|
||||
{'fun': 'sub_0807E9F0', 'params': ''},
|
||||
{'fun': 'sub_0807EA4C', 'params': ''},
|
||||
{'fun': 'sub_0807EA88'},
|
||||
{'fun': 'sub_0807EA94', 'params': ''},
|
||||
{'fun': 'sub_0807EAB4'},
|
||||
{'fun': 'sub_0807EAB4', 'params': 's'},
|
||||
{'fun': 'sub_0807EAC0'},
|
||||
{'fun': 'sub_0807EAD0', 'params': 'ss'},
|
||||
{'fun': 'sub_0807EAF0'},
|
||||
{'fun': 'sub_0807EB18'},
|
||||
{'fun': 'sub_0807EB28', 'params': 's'},
|
||||
{'fun': 'sub_0807EB38'},
|
||||
{'fun': 'sub_0807EB44'},
|
||||
{'fun': 'sub_0807EB44', 'params': 's'},
|
||||
{'fun': 'sub_0807EB4C'},
|
||||
{'fun': 'sub_0807EB74'},
|
||||
{'fun': 'sub_0807EB74', 'params': ''},
|
||||
{'fun': 'sub_0807EB8C', 'params': ''},
|
||||
{'fun': 'sub_0807EBA8'},
|
||||
{'fun': 'sub_0807EBB0'},
|
||||
@@ -160,9 +160,9 @@ commands = [
|
||||
{'fun': 'sub_0807EC64'},
|
||||
{'fun': 'sub_0807EC94'},
|
||||
{'fun': 'sub_0807ECC4'},
|
||||
{'fun': 'sub_0807ECF4'},
|
||||
{'fun': 'sub_0807ECF4', 'params': 's'},
|
||||
{'fun': 'sub_0807ED24'},
|
||||
{'fun': 'sub_0807EDD4'},
|
||||
{'fun': 'sub_0807EDD4', 'params': 'ss'},
|
||||
{'fun': 'sub_0807EE04'},
|
||||
{'fun': 'sub_0807EE30', 'params': ''},
|
||||
{'fun': 'sub_0807EEB4'},
|
||||
@@ -177,14 +177,14 @@ commands = [
|
||||
{'fun': 'sub_0807EFF4'},
|
||||
{'fun': 'sub_0807F004'},
|
||||
{'fun': 'sub_0807F010'},
|
||||
{'fun': 'sub_0807F034'},
|
||||
{'fun': 'sub_0807F034', 'params': 's'},
|
||||
{'fun': 'sub_0807F050'},
|
||||
{'fun': 'sub_0807F060'},
|
||||
{'fun': 'sub_0807F078'},
|
||||
{'fun': 'sub_0807F088'},
|
||||
{'fun': 'sub_0807F098'},
|
||||
{'fun': 'sub_0807F098', 'params': ''},
|
||||
{'fun': 'sub_0807F0A4'},
|
||||
{'fun': 'sub_0807F0B4'},
|
||||
{'fun': 'sub_0807F0B4', 'params': 's'},
|
||||
{'fun': 'sub_0807F0C8'}
|
||||
]
|
||||
|
||||
@@ -212,13 +212,13 @@ parameters = {
|
||||
'length': 2,
|
||||
'param': 'a,b',
|
||||
'expr': ' .short \\a\n .short \\b',
|
||||
'read': lambda ctx: ','.join(barray_to_u16_hex(ctx.data[ctx.ptr+2:ctx.ptr+6]))
|
||||
'read': lambda ctx: ', '.join(barray_to_u16_hex(ctx.data[ctx.ptr+2:ctx.ptr+6]))
|
||||
},
|
||||
'ww': {
|
||||
'length': 4,
|
||||
'param': 'a,b',
|
||||
'expr': ' .word \\a\n .word \\b',
|
||||
'read': lambda ctx: ','.join(barray_to_u32_hex(ctx.data[ctx.ptr+2:ctx.ptr+10]))
|
||||
'read': lambda ctx: ', '.join(barray_to_u32_hex(ctx.data[ctx.ptr+2:ctx.ptr+10]))
|
||||
},
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ def ExecuteScriptCommandSet(ctx: Context):
|
||||
raise Exception('Parameter configuration ' + command['params'] + ' not defined')
|
||||
params = parameters[command['params']]
|
||||
if unk_06-1 != params['length']:
|
||||
raise Exception('Call with ' + (unk_06-1) +' length, while length of ' + params['length']+' defined')
|
||||
raise Exception(f'Call {command["fun"]} with ' + str(unk_06-1) +' length, while length of ' + str(params['length'])+' defined')
|
||||
|
||||
|
||||
print(command['fun'] + ' ' + params['read'](ctx))
|
||||
@@ -270,7 +270,7 @@ def disassemble_script(input_data):
|
||||
|
||||
# Print rest (did not manage to get there)
|
||||
|
||||
print(',\n'.join(barray_to_u16_hex(ctx.data[ctx.ptr:])))
|
||||
print('\n'.join(['.short ' + x for x in barray_to_u16_hex(ctx.data[ctx.ptr:])]))
|
||||
|
||||
|
||||
def generate_macros():
|
||||
@@ -279,7 +279,7 @@ def generate_macros():
|
||||
|
||||
print('.macro SCRIPT_START name')
|
||||
print(' .globl \\name')
|
||||
print(' .section .rodata')
|
||||
print(' .section .text')
|
||||
print('\\name:')
|
||||
print('.endm')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user