From 2676397fd9a195bf1b7d6f533f280a34952730d8 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Tue, 17 Mar 2015 14:59:06 -0700 Subject: [PATCH] some cleanup --- Lua/actor change.lua | 2 +- Lua/actor names.lua | 8 ++++---- Lua/test chests.lua | 25 ++++++++++++------------- 3 files changed, 17 insertions(+), 18 deletions(-) diff --git a/Lua/actor change.lua b/Lua/actor change.lua index fb47781..13d11fe 100755 --- a/Lua/actor change.lua +++ b/Lua/actor change.lua @@ -176,5 +176,5 @@ while true do end old_ctrl = ctrl - emu.yield() + emu.frameadvance() end diff --git a/Lua/actor names.lua b/Lua/actor names.lua index e3b12a9..76c3ee4 100755 --- a/Lua/actor names.lua +++ b/Lua/actor names.lua @@ -5,7 +5,7 @@ local unset="unset" return { [0x000]="Link", [0x001]="Wall Punch / Ground Pound Effect", - [0x002]="Store Item", -- TODO: double check + [0x002]="Store Item", [0x003]="?", [0x004]="Flame Prop", -- also ice? [0x005]="Wooden Door", @@ -45,7 +45,7 @@ return { [0x027]="? STT Flip", [0x028]="Environmental Noise", [0x029]=unset, - [0x02A]="Trading Post Owner", -- Storefront? + [0x02A]="Trading Post Owner", -- Storefront? also bomb shop owner [0x02B]=unset, [0x02C]=unset, [0x02D]="Death Armos", @@ -383,7 +383,7 @@ return { [0x179]="Drifting Ice Platform", [0x17A]="Deku Palace Guard", [0x17B]="3 Bugs", - [0x17C]="? En_Fall", -- considering the filename and number of places it's in, could this affect voiding out? or what if it means the moon can fall in this area? + [0x17C]="Moon / Moon Stuff", [0x17D]="Postman (Home)", [0x17E]="Deku Shrine Closing Door", [0x17F]="Deku Butler", @@ -548,7 +548,7 @@ return { [0x21E]="Pirate Guard", -- or is Gerudo Guard better? [0x21F]="Romani", [0x220]="Cremia", - [0x221]="Lower Carnival Platform", -- "String of Flags" + [0x221]="Carnival Platform", -- "String of Flags" [0x222]="Elevator (GBT)", [0x223]="Owl Statue", [0x224]="Mikau", diff --git a/Lua/test chests.lua b/Lua/test chests.lua index f7367ac..2d86c31 100755 --- a/Lua/test chests.lua +++ b/Lua/test chests.lua @@ -2,24 +2,23 @@ local hash = gameinfo.getromhash() local versions = { - ['D6133ACE5AFAA0882CF214CF88DABA39E266C078'] = 'US10', + ['D6133ACE5AFAA0882CF214CF88DABA39E266C078'] = "US10", + ['5FB2301AACBF85278AF30DCA3E4194AD48599E36'] = "JP10", } local version = versions[hash] -local JP = version ~= 'US10' - -local index = 84 +local index = 0 +local fn = 'lua chest test' local start, ours, text -if not JP then - -- US 1.0 +if version == 'US10' then start = 0x779884 -- the get item table ours = 0x779896 -- the chest we're standing in front of text = 0x3FCE10 -- ascii text buffer -else +elseif version == 'JP10' then start = 0x7797E4 -- the get item table ours = 0x7797F6 -- the chest we're standing in front of - text = 0x3FD660 -- ascii text buffer (not quite but close enough) + text = 0x3FD660 -- no such thing in JP but we need something end function draw_index() @@ -61,7 +60,6 @@ function read_ascii(addr, len) return str end -local fn = 'lua chest test' client.unpause() savestate.save(fn) for off=index*6, 185*6, 6 do @@ -73,14 +71,15 @@ for off=index*6, 185*6, 6 do joypad.set({A=true}, 1) advance() joypad.set({A=false}, 1) + local good = false for i=1, 9*20 do - if JP and ( - (index >= 85 and index <= 88) - ) then break end -- crashes + if version == 'JP10' and (index >= 85 and index <= 88) then + break -- crashes + end advance() if mainmemory.readbyte(text + 0xA) == 0xFF then - if not JP then + if version == 'US10' then local begin = text + 0xC print(off/6 + 1, read_ascii(begin)) good = true