summaryrefslogtreecommitdiff
path: root/tools/script_disassembler/script_disassembler.py
diff options
context:
space:
mode:
authoroctorock <79596758+octorock@users.noreply.github.com>2021-03-04 21:11:00 +0100
committeroctorock <79596758+octorock@users.noreply.github.com>2021-03-06 14:53:33 +0100
commite94df6de4adbd708b888d8bfef1649f5b0f5a711 (patch)
treecb867379a12181ba3108b3c718a3666586911cf5 /tools/script_disassembler/script_disassembler.py
parent223cf98a5181a5eeed412b5c3570f4d369ed3735 (diff)
Move all scripts to data/scripts.s
Diffstat (limited to 'tools/script_disassembler/script_disassembler.py')
-rw-r--r--tools/script_disassembler/script_disassembler.py40
1 files changed, 20 insertions, 20 deletions
diff --git a/tools/script_disassembler/script_disassembler.py b/tools/script_disassembler/script_disassembler.py
index bb0dbce3..5066ce01 100644
--- a/tools/script_disassembler/script_disassembler.py
+++ b/tools/script_disassembler/script_disassembler.py
@@ -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')