From ea1e055e8765f1d5d91cc650f878c9a326336dd0 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 10 Jan 2016 12:54:16 -0800 Subject: [PATCH] use a table of versions to asms --- Lua/inject.lua | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Lua/inject.lua b/Lua/inject.lua index eb1eb14..3ae32c0 100644 --- a/Lua/inject.lua +++ b/Lua/inject.lua @@ -130,16 +130,18 @@ function inject(fn) end end -if oot then - if version == 'O EUDB MQ' then - inject('print.asm') - else - inject('spawn oot.asm') - end +local asms = { + ['O US10'] = 'spawn oot.asm', + ['O JP10'] = 'spawn oot.asm', + ['O EUDB MQ'] = 'print.asm', + + ['M US10'] = 'spawn mm.asm', + ['M JP10'] = 'spawn mm early.asm', +} + +local asm = asms[version] +if asm then + inject(asm) else - if version == 'M JP10' or version == 'M JP11' then - inject('spawn mm early.asm') - else - inject('spawn mm.asm') - end + print('no appropriate assembly found for this game') end