From 7db0be3675ad6817ab477846b719dd8791b12813 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sat, 7 Mar 2015 07:38:44 -0800 Subject: [PATCH] refactor --- Lua/addrs.lua | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/Lua/addrs.lua b/Lua/addrs.lua index e057327..2993322 100755 --- a/Lua/addrs.lua +++ b/Lua/addrs.lua @@ -1,19 +1,23 @@ -require "boilerplate" - local versions = { - ['D6133ACE5AFAA0882CF214CF88DABA39E266C078'] = require "A US10", - ['2F0744F2422B0421697A74B305CB1EF27041AB11'] = require "A USDE", - ['9743AA026E9269B339EB0E3044CD5830A440C1FD'] = require "A USGC", - ['C04599CDAFEE1C84A7AF9A71DF68F139179ADA84'] = require "A EU10", - ['BB4E4757D10727C7584C59C1F2E5F44196E9C293'] = require "A EU11", - ['B38B71D2961DFFB523020A67F4807A4B704E347A'] = require "A EUDB", - ['A849A65E56D57D4DD98B550524150F898DF90A9F'] = require "A EUGC", - ['5FB2301AACBF85278AF30DCA3E4194AD48599E36'] = require "A JP10", - ['41FDB879AB422EC158B4EAFEA69087F255EA8589'] = require "A JP11", - ['1438FD501E3E5B25461770AF88C02AB1E41D3A7E'] = require "A JPGC", + ['D6133ACE5AFAA0882CF214CF88DABA39E266C078'] = "US10", + ['2F0744F2422B0421697A74B305CB1EF27041AB11'] = "USDE", + ['9743AA026E9269B339EB0E3044CD5830A440C1FD'] = "USGC", + ['C04599CDAFEE1C84A7AF9A71DF68F139179ADA84'] = "EU10", + ['BB4E4757D10727C7584C59C1F2E5F44196E9C293'] = "EU11", + ['B38B71D2961DFFB523020A67F4807A4B704E347A'] = "EUDB", + ['A849A65E56D57D4DD98B550524150F898DF90A9F'] = "EUGC", + ['5FB2301AACBF85278AF30DCA3E4194AD48599E36'] = "JP10", + ['41FDB879AB422EC158B4EAFEA69087F255EA8589'] = "JP11", + ['1438FD501E3E5B25461770AF88C02AB1E41D3A7E'] = "JPGC", } -local hash = gameinfo.getromhash() -local addrs = versions[hash] +local hash, version, addrs +--while version == nil do +-- emu.yield() -- wait until a known ROM is loaded (doesn't work) + hash = gameinfo.getromhash() + version = versions[hash] +--end + +addrs = require("A "..version) return addrs