operands = {}
operands['00'] = 0
operands['01'] = 0
operands['02'] = 0
operands['03'] = 0
operands['04'] = 0
operands['05'] = 0
operands['06'] = 0
operands['07'] = 0
operands['08'] = 0
operands['09'] = 0
operands['0A'] = 0
operands['0B'] = 0
operands['0C'] = 0
operands['0D'] = 0
operands['0E'] = 0
operands['0F'] = 0
operands['70'] = 0
operands['71'] = 0
operands['72'] = 0
operands['73'] = 0
operands['74'] = 0
operands['75'] = 0
operands['76'] = 0
operands['77'] = 0
operands['78'] = 0
operands['79'] = 0
operands['7A'] = 0
operands['7B'] = 0
operands['7C'] = 0
operands['7D'] = 0
operands['7E'] = 0
operands['7F'] = 0
operands['BA'] = 2
operands['BB'] = 2
operands['BC'] = 2
operands['BD'] = 2
operands['C5'] = 1
operands['C8'] = 2
operands['C9'] = 2
operands['CA'] = 2
operands['CB'] = 2
operands['CC'] = 0
operands['CD'] = 2
operands['CE'] = 2
operands['CF'] = 2
operands['D0'] = 2
operands['D1'] = 3
operands['D2'] = 4
operands['D3'] = 3
operands['D4'] = 3
operands['D5'] = 3
operands['D6'] = 3
operands['D7'] = 3
operands['D8'] = 3 #guess
operands['D9'] = 3 #guess
operands['DA'] = 3 #guess
operands['DB'] = 0
operands['DC'] = 3 #guess
operands['DD'] = 3 #guess
operands['DE'] = 3
operands['DF'] = 3
operands['E0'] = 5
operands['E1'] = 5
operands['E3'] = 5
operands['EC'] = 0
operands['ED'] = 0
operands['EE'] = 0
operands['EF'] = 0
operands['F0'] = 2
operands['F2'] = 0
operands['F3'] = 4
operands['F5'] = 0
operands['F6'] = 0
operands['F7'] = 0
operands['F8'] = 0
operands['F9'] = 0
operands['FA'] = 0
operands['FB'] = 0
operands['FC'] = 0
operands['FD'] = 0
operands['FE'] = 0
operands['FF'] = 0

opcodes = {}
opcodes['00'] = "Player Hold"
opcodes['01'] = "Player Move Up"
opcodes['02'] = "Player Move Right"
opcodes['03'] = "Player Move Down"
opcodes['04'] = "Player move Left"
opcodes['05'] = "Player Bounce in Place"
opcodes['06'] = "Player Bounce in Place"
opcodes['07'] = "<Unknown>"
opcodes['08'] = "<Unknown>"
opcodes['09'] = "Player Show"
opcodes['0A'] = "Player Hide"
opcodes['0B'] = "<Unknown>"
opcodes['0C'] = "<Unknown>"
opcodes['0D'] = "<Unknown>"
opcodes['0E'] = "<Unknown>"
opcodes['0F'] = "<Unknown>"
#10-6F handled manually, all the same
opcodes['70'] = "Very short pause"
opcodes['71'] = "Short pause"
opcodes['72'] = "Medium pause"
opcodes['73'] = "Long pause"
opcodes['74'] = "Very long pause"
opcodes['75'] = "Extremely long pause"
opcodes['76'] = "<Unknown>"
opcodes['77'] = "<Unknown>"
opcodes['78'] = "<Unknown>"
opcodes['79'] = "'The Crash Event'"
opcodes['7A'] = "Naming Character"
opcodes['7B'] = "*YOU DIDNT MEAN TO USE THIS*"
opcodes['7C'] = "<Unknown>"
opcodes['7D'] = "<Unknown>"
opcodes['7E'] = "<Unknown>"
opcodes['7F'] = "*YOU DIDNT MEAN TO USE THIS*"
#80-9F handled manually, all the same
opcodes['A0'] = "(Message) {0}"
opcodes['A1'] = "Run Shop {0}"
opcodes['A2'] = "{0}"
opcodes['A3'] = "{0}"
opcodes['A4'] = "{0}"
opcodes['A5'] = "{0}"
opcodes['A6'] = "Set Flag {0}"
opcodes['A7'] = "Clear Flag {0}"
opcodes['A8'] = "Adjust Character HP by {0}"
opcodes['A9'] = "Adjust Character MP by {0}"
opcodes['AA'] = "Add Item {0}"
opcodes['AB'] = "Remove Item {0}"
opcodes['AC'] = "Add Magic {0}"
opcodes['AD'] = "Run Inn {0}"
opcodes['AE'] = "Blur Screen {0}"
opcodes['AF'] = "Add {0} Gil"
opcodes['B0'] = "Subtract {0} Gil "
opcodes['B1'] = "Set Player Sprite {0}"
opcodes['B2'] = "Pause for {0} cycles"
opcodes['B3'] = "Pause for {0}0 cycles"
opcodes['B4'] = "Play Background Music {0}"
opcodes['B5'] = "Play Sound Effect {0}"
opcodes['B6'] = "Play Movie {0}"
opcodes['B7'] = "Add/Remove character {0}"
opcodes['B8'] = "Toggle Additive Tint by {0}"
opcodes['B9'] = "Toggle Subtracitve Tint by {0}"
opcodes['BA'] = "Clear Character {0} Curable status to {1}"
opcodes['BB'] = "Set Character {0}  Curable status to {1}"
opcodes['BC'] = "Toggle Character {0}  Curable status to {1}"
opcodes['BD'] = "Start Event Battle {0}"
opcodes['BE'] = "Rumble effect of {0} magnitude"
opcodes['BF'] = "Sprite effect {0}"
opcodes['C0'] = "Circle Mask {0}"
opcodes['C1'] = "<Unknown>"
opcodes['C2'] = "Map {0}"
opcodes['C3'] = "Fade in Speed {0}"
opcodes['C4'] = "Fade out Speed {0}"
opcodes['C5'] = "<unknown>"
opcodes['C6'] = "Add job {0}"
opcodes['C7'] = "Play next {0} bytes simultaneously"
opcodes['C8'] = "Display Message/Text/Dialogue {0} {1}"
opcodes['C9'] = "Play Music {0} {1}"
opcodes['CA'] = "{0} {1}"
opcodes['CB'] = "{0} {1}"
opcodes['CC'] = "Noop"
opcodes['CD'] = "Run event index {1}{0}"
opcodes['CE'] = "Play next {1} bytes {0} times"
opcodes['CF'] = "Play next {1} bytes simultaneously {0} times"
opcodes['D0'] = "(Music) {0} {1}"
opcodes['D1'] = "(Timer?) {0} {1} {2}"
opcodes['D2'] = "(Map) {0} {1} {2} {3}"
opcodes['D3'] = "Sprite {0} set map position {1}, {2}"
opcodes['D4'] = "(Music) {0} {1} {2}"
opcodes['D5'] = "(Sound) {0} {1} {2}"
opcodes['D6'] = "(Map) {0} {1} {2}"
opcodes['D7'] = "(Timer?) {0} {1} {2}"
opcodes['D8'] = "Unknown"
opcodes['D9'] = "Unknown"
opcodes['DA'] = "Unknown"
opcodes['DB'] = "Restore Player status"
opcodes['DC'] = "Unknown"
opcodes['DD'] = "Unknown"
opcodes['DE'] = "Noop"
opcodes['DF'] = "Noop"
opcodes['E0'] = "Unknown"
opcodes['E1'] = "Return from cutscene? {0} {1} {2} {3} {4}"
opcodes['E2'] = "Unknown"
opcodes['E3'] = "Inter-map cutscene? {0} {1} {2} {3} {4}"
opcodes['E4'] = "Unknown"
opcodes['E5'] = "Unknown"
opcodes['E6'] = "Unknown"
opcodes['E7'] = "Unknown"
opcodes['E8'] = "Unknown"
opcodes['E9'] = "Unknown"
opcodes['EA'] = "Unknown"
opcodes['EB'] = "Unknown"
opcodes['EC'] = "Noop"
opcodes['ED'] = "Noop"
opcodes['EE'] = "Noop"
opcodes['EF'] = "Noop"
opcodes['F0'] = "Yes/No Dialogue box (message is {0} {1})"
opcodes['F1'] = "Unknown"
opcodes['F2'] = "Noop"
opcodes['F3'] = "Set Map Tiles {0} {1} {2} {3}"
opcodes['F4'] = "Unknown"
opcodes['F5'] = "Noop"
opcodes['F6'] = "Noop"
opcodes['F7'] = "Noop"
opcodes['F8'] = "Noop"
opcodes['F9'] = "Noop"
opcodes['FA'] = "Noop"
opcodes['FB'] = "Noop"
opcodes['FC'] = "Noop"
opcodes['FD'] = "Noop"
opcodes['FE'] = "Noop"
opcodes['FF'] = "End Event"

jobs = {}
jobs['00'] = "Knight"
jobs['01'] = "Monk"
jobs['02'] = "Thief"
jobs['03'] = "Dragoon"
jobs['04'] = "Ninja"
jobs['05'] = "Samurai"
jobs['06'] = "Berserker"
jobs['07'] = "Hunter"
jobs['08'] = "Mystic Knight"
jobs['09'] = "White Mage"
jobs['0A'] = "Black Mage"
jobs['0B'] = "Time Mage"
jobs['0C'] = "Summoner"
jobs['0D'] = "Blue Mage"
jobs['0E'] = "Red Mage"
jobs['0F'] = "Mediator"
jobs['10'] = "Chemist"
jobs['11'] = "Geomancer"
jobs['12'] = "Bard"
jobs['13'] = "Dancer"
jobs['14'] = "Mimic"

shops = {}
shops['00'] = "Tule Weapon"
shops['01'] = "Tule Armor"
shops['02'] = "Tule Inn"
shops['03'] = "Tule Magic"
shops['04'] = "Carwen Weapon"
shops['05'] = "Carwen Armor"
shops['06'] = "Carwen Inn"
shops['07'] = "Carwen Magic"
shops['08'] = "Worus Weapon"
shops['09'] = "Worus Armor"
shops['0A'] = "Worus Magic"
shops['0B'] = "Karnak Weapon 1"
shops['0C'] = "Karnak Weapon 2"
shops['0D'] = "Karnak Armor"
shops['0E'] = "Common World 1 Inn"
shops['0F'] = "Karnak Magic 1"
shops['10'] = "Karnak Magic 2"
shops['11'] = "Karnak Magic 3"
shops['12'] = "Crescent Weapon"
shops['13'] = "Crescent Armor"
shops['14'] = "0 Magic"
shops['15'] = "Istory Rare"
shops['16'] = "0 Armor"
shops['17'] = "0 Inn"
shops['18'] = "Jacole Weapon"
shops['19'] = "Jacole Armor"
shops['1A'] = "Common World 2 Inn 1"
shops['1B'] = "Lix G"
shops['1C'] = "Lix Armor"
shops['1D'] = "Lix Magic"
shops['1E'] = "Rugor Weapon"
shops['1F'] = "Rugor Armor"
shops['20'] = "Common World 2 Inn 2"
shops['21'] = "Bal/Kelb Weapon"
shops['22'] = "Bal/Kelb Armor"
shops['23'] = "Kelb Weapon"
shops['24'] = "Kelb Armor"
shops['25'] = "Common World 2 Magic 1"
shops['26'] = "Common World 2 Magic 2"
shops['27'] = "Common World 2 Magic 3"
shops['28'] = "Surgate Weapon"
shops['29'] = "Surgate Armor"
shops['2A'] = "Mua Weapon"
shops['2B'] = "Mua Armor"
shops['2C'] = "Mua Magic 1"
shops['2D'] = "Mua Magic 2"
shops['2E'] = "Mua Magic 3"
shops['2F'] = "0 Weapon"
shops['30'] = "0 Armor"
shops['31'] = "Lix Inn"
shops['32'] = "Dwarf Magic (unused)"
shops['33'] = "Dwarf Weapon"
shops['34'] = "Dwarf Armor"
shops['35'] = "0 Inn"
shops['36'] = "Mirage Weapon"
shops['37'] = "Mirage Weapon 2 (I think)"
shops['38'] = "Mirage Armor"
shops['39'] = "Mirage Rare"
shops['3A'] = "Mirage Magic 1"
shops['3B'] = "Mirage Magic 2"
shops['3C'] = "Mirage Inn 1"
shops['3D'] = "Mirage Inn 2"
shops['3E'] = "Karnak Weapon (pre arrest)"
shops['3F'] = "Karnak Armor (pre arrest)"

sprite_actions = {}
sprite_actions['00'] = 'Hold'
sprite_actions['01'] = 'Move Up'
sprite_actions['02'] = 'Move Right'
sprite_actions['03'] = 'Move Down'
sprite_actions['04'] = 'Move Left'
sprite_actions['05'] = 'Bounce'
sprite_actions['06'] = 'Bounce'
sprite_actions['09'] = 'Show'
sprite_actions['0A'] = 'Hide'

poses = {}
poses['10'] = "face up, left hand forward"
poses['11'] = "face up, right hand forward"
poses['12'] = "face right, standing"
poses['13'] = "face right, down hand backward"
poses['14'] = "face down, left hand forward"
poses['15'] = "face down, right hand forward"
poses['16'] = "face left, standing"
poses['17'] = "face left, down hand backward"
poses['18'] = "face down, left hand forward"
poses['19'] = "face up, left hand forward"
poses['1A'] = "face left, standing"
poses['1B'] = "face left, walking, right hand forward"
poses['1C'] = "face down, walking, right hand forward"
poses['1D'] = "face up, walking, right hand forward"
poses['1E'] = "face right, standing"
poses['1F'] = "face right, walking, right hand forward"
poses['20'] = "face down, left hand raised out"
poses['21'] = "face down, left hand raised in"
poses['22'] = "face down, left hand on head"
poses['23'] = "face down, right hand raised out"
poses['24'] = "face down, right hand raised in"
poses['25'] = "face down, right hand raised on head"
poses['26'] = "face up, right hand raised out"
poses['27'] = "face up, right hand raised in"
poses['28'] = "face up, right hand raised out"
poses['29'] = "face up, right hand raised in"
poses['2A'] = "face left, left hand raised"
poses['2B'] = "face left, left hand out"
poses['2C'] = "face right, right hand raised"
poses['2D'] = "face right, right hand out"
poses['2E'] = "face down, head lowered"
poses['2F'] = "face up, head lowered"
poses['30'] = "face left, head lowered"
poses['31'] = "face right, head lowered"
poses['32'] = "collapsed, facing left"
poses['33'] = "collapsed, facing right"
poses['34'] = "face down, splayed, looking left"
poses['35'] = "face down, splayed, looking right"
poses['36'] = "face down, eyes closed mouth open"
poses['37'] = "face down, eyes closed mouth open smiling"
poses['38'] = "face down, squatting"
poses['39'] = "face down, both arms raised"
poses['3A'] = "face down, surprised"
poses['3B'] = "nothing"
poses['3C'] = "face down, mouth open, shrugging"
poses['3D'] = "face up, both arms raised out"
poses['3E'] = "face up, both arms raised in"
poses['3F'] = "face down, looking left, eyes lowered"
poses['40'] = "face down, looking right, eyes lowered"
poses['41'] = "face up, sprite becomes symmetrical (maybe shrugging?)"
poses['42'] = "garbage"
poses['43'] = "face down, looking right, pointing finger right"
poses['44'] = "face down, head lowered, left hand forward"
poses['45'] = "face down, looking left, pointing finger left"
poses['46'] = "garbage"
poses['47'] = "face down, left hand up in"
poses['48'] = "garbage"
poses['49'] = "face down, right hand up in"
poses['4A'] = "garbage"
poses['4B'] = "garbage"
poses['4C'] = "garbage"
poses['4D'] = "garbage"
poses['4E'] = "garbage"
poses['4F'] = "garbage"

sounds = {}
sounds['00'] = 'Fists (critical)'
sounds['01'] = 'Fists'
sounds['02'] = 'Void, Image'
sounds['03'] = 'Katana'
sounds['04'] = 'Jump'
sounds['05'] = 'Rod, Staff'
sounds['06'] = 'Crickets'
sounds['07'] = 'Quicksand'
sounds['08'] = 'Reset'
sounds['09'] = 'Full Moon, Rising Sun'
sounds['0A'] = 'Bouncing'
sounds['0B'] = 'Waves'
sounds['0C'] = 'Fire'
sounds['0D'] = 'Ice'
sounds['0E'] = 'Bolt'
sounds['0F'] = 'Sleep, Venom'
sounds['10'] = 'Bio'
sounds['11'] = 'Ice 3'
sounds['12'] = 'Throw, GilToss'
sounds['13'] = 'Cure'
sounds['14'] = 'Scan'
sounds['15'] = 'Holy (spheres)'
sounds['16'] = 'Knife'
sounds['17'] = 'Sword'
sounds['18'] = 'Holy (beam)'
sounds['19'] = 'Fire2'
sounds['1A'] = 'Doom'
sounds['1B'] = 'Drain, Psych'
sounds['1C'] = 'Ice 2'
sounds['1D'] = 'Flare (part 1)'
sounds['1E'] = 'Earth Wall'
sounds['1F'] = 'Barrier'
sounds['20'] = 'Spear'
sounds['21'] = 'Bell'
sounds['22'] = 'AquaRake'
sounds['23'] = 'GuardOff, DarkShock'
sounds['24'] = 'Float, Aero'
sounds['25'] = 'Magic Hammer'
sounds['26'] = 'Atomic Ray'
sounds['27'] = 'Aero2'
sounds['28'] = 'Aero3'
sounds['29'] = 'GblnPnch'
sounds['2A'] = '?'
sounds['2B'] = 'L3 Flare'
sounds['2C'] = 'FrogSong, TinySong, MoonFlut'
sounds['2D'] = 'Demi, Qrter'
sounds['2E'] = 'Fat chocobo'
sounds['2F'] = 'Song'
sounds['30'] = 'Whip'
sounds['31'] = 'Charm'
sounds['32'] = 'Dimen magic'
sounds['33'] = 'Toad, Size'
sounds['34'] = 'Shell'
sounds['35'] = 'Condemn, Darkness'
sounds['36'] = 'Fire3'
sounds['37'] = 'DeathClaw'
sounds['38'] = 'Purchase'
sounds['39'] = 'Slow'
sounds['3A'] = 'Quick'
sounds['3B'] = 'Trap floor'
sounds['3C'] = 'Exdeath destroyed 1'
sounds['3D'] = 'Sudden stop'
sounds['3E'] = 'Axe, Hammer'
sounds['3F'] = 'Jump attack'
sounds['40'] = 'Exit'
sounds['41'] = 'Katana (critical)'
sounds['42'] = 'Collision'
sounds['43'] = 'Gate opens'
sounds['44'] = 'Bolt of Judgement'
sounds['45'] = 'True Edge'
sounds['46'] = 'Meteor'
sounds['47'] = 'Break, Demon\'s Eye'
sounds['48'] = 'Black magic, BuildUp'
sounds['49'] = 'Miss'
sounds['4A'] = 'Tsunami'
sounds['4B'] = 'Block (shield)'
sounds['4C'] = 'X-Zone'
sounds['4D'] = '?'
sounds['4E'] = '?'
sounds['4F'] = 'Armor'
sounds['50'] = 'White magic'
sounds['51'] = 'Slap'
sounds['52'] = '0 damage'
sounds['53'] = 'Bersk'
sounds['54'] = 'Flee'
sounds['55'] = 'Time Slip'
sounds['56'] = 'Exploder'
sounds['57'] = 'Mighty Guard, Zombie Powder?'
sounds['58'] = '?'
sounds['59'] = 'Specialty (monster)'
sounds['5A'] = 'Entangle'
sounds['5B'] = 'Save'
sounds['5C'] = 'Blue magic'
sounds['5D'] = 'Dragon cry'
sounds['5E'] = 'Dragon whimper'
sounds['5F'] = 'Wall'
sounds['60'] = 'Syldra cry'
sounds['61'] = 'Kick'
sounds['62'] = 'Syldra pain'
sounds['63'] = 'Squirrel'
sounds['64'] = 'Awoken'
sounds['65'] = 'Revive'
sounds['66'] = 'Fire beast'
sounds['67'] = 'Surge Beam'
sounds['68'] = 'Find item'
sounds['69'] = 'Airship'
sounds['6A'] = 'Poison gas'
sounds['6B'] = 'MgcSwd'
sounds['6C'] = 'Emission'
sounds['6D'] = 'Momonga'
sounds['6E'] = 'Mind Blast'
sounds['6F'] = 'Encounter'
sounds['70'] = '?'
sounds['71'] = 'Fire sword'
sounds['72'] = 'Ice sword'
sounds['73'] = 'Summon magic'
sounds['74'] = 'Terminate'
sounds['75'] = 'Whispering Wind'
sounds['76'] = 'Hell Fire'
sounds['77'] = 'Fire of Resurrection'
sounds['78'] = 'Thunder Storm'
sounds['79'] = 'Image (white magic)'
sounds['7A'] = 'Heal'
sounds['7B'] = 'Mute'
sounds['7C'] = 'Latch On'
sounds['7D'] = 'Diamond Dust'
sounds['7E'] = '?'
sounds['7F'] = 'Teleport'
sounds['80'] = '?'
sounds['81'] = 'Crystal shatters'
sounds['82'] = 'Wave'
sounds['83'] = '?'
sounds['84'] = 'Exdeath destroyed 2'
sounds['85'] = 'Falling'
sounds['86'] = '?'
sounds['87'] = '?'
sounds['88'] = 'Titan steps'
sounds['89'] = 'Rope toss'
sounds['8A'] = 'Mysidian Rabbit'
sounds['8B'] = 'Engine'
sounds['8C'] = 'Engine shutdown'
sounds['8D'] = 'Delta Attack'
sounds['8E'] = 'Treasure chest'
sounds['8F'] = 'Sandworm'
sounds['90'] = '?'
sounds['91'] = '?'
sounds['92'] = 'Branch Spear, Branch Arrow'
sounds['93'] = 'Evil appears'
sounds['94'] = 'Poisoned'
sounds['95'] = 'Bee Swarm'
sounds['96'] = 'Evil disappears'
sounds['97'] = 'Falcon'
sounds['98'] = 'Thread'
sounds['99'] = 'Mucus'
sounds['9A'] = '?'
sounds['9B'] = '?'
sounds['9C'] = 'Earth Shaker'
sounds['9D'] = '?'
sounds['9E'] = '?'
sounds['9F'] = 'Teleporter breaks'
sounds['A0'] = 'Wind Slash, Gale Cut'
sounds['A1'] = 'Gust'
sounds['A2'] = 'Breath Wing'
sounds['A3'] = '?'
sounds['A4'] = '?'
sounds['A5'] = 'Will-o-Wisp'
sounds['A6'] = 'Poison Mist'
sounds['A7'] = 'Grand Cross'
sounds['A8'] = '?'
sounds['A9'] = 'Spore'
sounds['AA'] = 'Zombie Powder'
sounds['AB'] = 'Hurricane, Maelstrom'
sounds['AC'] = '?'
sounds['AD'] = '?'
sounds['AE'] = 'The Void'
sounds['AF'] = 'Comet'
sounds['B0'] = 'DrgnSwd'

music = {}
music['00'] = 'Ahead on Our way'
music['01'] = 'The Fierce Battle'
music['02'] = 'A Presentiment'
music['03'] = 'Go Go Boco!'
music['04'] = 'Pirates Ahoy!'
music['05'] = 'Tenderness in the Air'
music['06'] = 'Fate in Haze'
music['07'] = 'Critter Tripper Fritter!'
music['08'] = 'The Prelude'
music['09'] = 'The Last Battle'
music['0A'] = 'Requiem'
music['0B'] = 'Reminiscence'
music['0C'] = 'Cursed Earths'
music['0D'] = 'Lenna\'s Theme'
music['0E'] = 'Victory\'s Fanfare'
music['0F'] = 'Deception'
music['10'] = 'Nostalgia'
music['11'] = '(Nothing)'
music['12'] = 'Exdeath\'s Castle'
music['13'] = 'My Home, Sweet Home'
music['14'] = 'Waltz Suomi'
music['15'] = 'Sealed Away'
music['16'] = 'The Four Warriors of Dawn'
music['17'] = 'Danger!'
music['18'] = 'The Fired Powered Ship'
music['19'] = 'As I Feel, You Feel'
music['1A'] = 'Mambo de Chocobo'
music['1B'] = 'Music Box'
music['1C'] = 'Intension of the Earth'
music['1D'] = 'The Dragon Spreads its Wings'
music['1E'] = 'Beyond the Deep Blue Sea'
music['1F'] = 'Prelude of Empty Skies'
music['20'] = 'Searching the Light'
music['21'] = 'Harvest'
music['22'] = 'Battle with Gilgamesh'
music['23'] = 'Four Valiant Hearts'
music['24'] = 'The Book of Sealings'
music['25'] = 'What?'
music['26'] = 'Hurry! Hurry!'
music['27'] = 'Unknown Lands'
music['28'] = 'The Airship'
music['29'] = 'Fanfare 1 (short)'
music['2A'] = 'Fanfare 2 (long)'
music['2B'] = 'The Battle'
music['2C'] = 'Walking the Snowy Mountains'
music['2D'] = 'The Evil Lord Exdeath'
music['2E'] = 'The Castle in Dawn'
music['2F'] = 'I\'m a Dancer'
music['30'] = 'The Day Will Come'
music['31'] = 'Run!'
music['32'] = 'The Ancient Library'
music['33'] = 'Royal Palace'
music['34'] = 'Good Night!'
music['35'] = 'Piano Lesson 1'
music['36'] = 'Piano Lesson 2'
music['37'] = 'Piano Lesson 3'
music['38'] = 'Piano Lesson 4'
music['39'] = 'Piano Lesson 5'
music['3A'] = 'Piano Lesson 6'
music['3B'] = 'Piano Lesson 7'
music['3C'] = 'Piano Lesson 8'
music['3D'] = 'Musica Machina'
music['3E'] = '(Exdeath destroyed)'
music['3F'] = 'The Land Unknown'
music['40'] = 'The Decisive Battle'
music['41'] = 'The Silent Beyond'
music['42'] = 'Dear Friends'
music['43'] = 'Final Fantasy'
music['44'] = 'A New Origin'
music['45'] = '(Night scene)'
music['46'] = '(Waves against the shore)'
music['47'] = '(Meteor landing)'

status = {}
status['01'] = "Blind"
status['02'] = "Zombie"
status['04'] = "Poison"
status['08'] = "Float"
status['10'] = "Mini"
status['20'] = "Toad"
status['40'] = "Stone"
status['80'] = "Wounded"

character = {}
character['00'] = "Butz"
character['01'] = "Lenna"
character['02'] = "Galuf"
character['03'] = "Faris"
character['04'] = "Cara"

magic = {}
magic['00'] = 'Fire'
magic['01'] = 'Ice'
magic['02'] = 'Bolt'
magic['03'] = 'Venom'
magic['04'] = 'Mute'
magic['05'] = 'Sleep'
magic['06'] = 'Fire2'
magic['07'] = 'Ice 2'
magic['08'] = 'Bolt2'
magic['09'] = 'Drain'
magic['0A'] = 'Break'
magic['0B'] = 'Bio'
magic['0C'] = 'Fire3'
magic['0D'] = 'Ice 3'
magic['0E'] = 'Bolt3'
magic['0F'] = 'Holy'
magic['10'] = 'Flare'
magic['11'] = 'Psych'
magic['12'] = 'Cure'
magic['13'] = 'Scan'
magic['14'] = 'Antidote'
magic['15'] = 'Mute'
magic['16'] = 'Armor'
magic['17'] = 'Size'
magic['18'] = 'Cure2'
magic['19'] = 'Life'
magic['1A'] = 'Charm'
magic['1B'] = 'Image'
magic['1C'] = 'Shell'
magic['1D'] = 'Heal'
magic['1E'] = 'Cure3'
magic['1F'] = 'Wall'
magic['20'] = 'Berserk'
magic['21'] = 'Life2'
magic['22'] = 'Holy'
magic['23'] = 'Dispel'
magic['24'] = 'Fire'
magic['25'] = 'Ice'
magic['26'] = 'Bolt'
magic['27'] = 'Venom'
magic['28'] = 'Sleep'
magic['29'] = 'Toad'
magic['2A'] = 'Fire2'
magic['2B'] = 'Ice2'
magic['2C'] = 'Bolt2'
magic['2D'] = 'Drain'
magic['2E'] = 'Break'
magic['2F'] = 'Bio'
magic['30'] = 'Fire3'
magic['31'] = 'Ice3'
magic['32'] = 'Bolt3'
magic['33'] = 'Flare'
magic['34'] = 'Doom'
magic['35'] = 'Psych'
magic['36'] = 'Drag'
magic['37'] = 'Slow'
magic['38'] = 'Regen'
magic['39'] = 'Void'
magic['3A'] = 'Haste'
magic['3B'] = 'Float'
magic['3C'] = 'Demi'
magic['3D'] = 'Stop'
magic['3E'] = 'Exit'
magic['3F'] = 'Comet'
magic['40'] = 'Slow2'
magic['41'] = 'Reset'
magic['42'] = 'Qrter'
magic['43'] = 'Hast2'
magic['44'] = 'Old'
magic['45'] = 'Meteo'
magic['46'] = 'Quick'
magic['47'] = 'XZone'
magic['48'] = 'Chocob'
magic['49'] = 'Sylph'
magic['4A'] = 'Remora'
magic['4B'] = 'Shiva'
magic['4C'] = 'Ramuh'
magic['4D'] = 'Ifrit'
magic['4E'] = 'Titan'
magic['4F'] = 'Golem'
magic['50'] = 'Shoat'
magic['51'] = 'Crbnkl'
magic['52'] = 'Syldra'
magic['53'] = 'Odin'
magic['54'] = 'Phenix'
magic['55'] = 'Levia'
magic['56'] = 'Bahmut'
magic['57'] = 'Power Song'
magic['58'] = 'Speed Song'
magic['59'] = 'Vitality Song'
magic['5A'] = 'Magic Song'
magic['5B'] = 'Hero Song'
magic['5C'] = 'Requiem'
magic['5D'] = 'Love Song'
magic['5E'] = 'Charm Song'
magic['5F'] = 'Chocobo Kick'
magic['60'] = 'Whispering Wind'
magic['61'] = 'Latch On'
magic['62'] = 'Diamond Dust'
magic['63'] = 'Bolt of Judgement'
magic['64'] = 'Hellfire'
magic['65'] = 'Rage of the Earth'
magic['66'] = 'Earth Wall'
magic['67'] = 'Demon\'s Eye'
magic['68'] = 'Ruby Light'
magic['69'] = 'Thunder Storm'
magic['6A'] = 'True Edge'
magic['6B'] = 'Fire of Resurrection (always targets monsters)'
magic['6C'] = 'Big Wave'
magic['6D'] = 'Mega Flare '
magic['6E'] = 'Fat Chocobo'
magic['6F'] = 'Gungnir'
magic['70'] = 'Fire of Resurrection (resurrection)'
magic['71'] = 'Dragon Sword 1 (HP)'
magic['72'] = 'Dragon Sword 2 (MP)'
magic['73'] = 'Egg Chop'
magic['74'] = 'ItemMagic05 (Silver Harp)'
magic['75'] = 'ItemMagic06 (Dream Harp)'
magic['76'] = 'ItemMagic07 (Lamia Harp)'
magic['77'] = 'ItemMagic08 (Apollo Harp)'
magic['78'] = 'ItemMagic09 (weapons: No effect when used in item menu)'
magic['79'] = 'Mystery Waltz'
magic['7A'] = 'Jitterbug Duet'
magic['7B'] = 'Tempting Tango'
magic['7C'] = 'Magic Barrier (MKnight ability)'
magic['7D'] = '"Sword Dance" (element guard)'
magic['7E'] = 'Ice Aura (element guard)'
magic['7F'] = 'Entangle (whip effect)'
magic['80'] = 'Fight'
magic['81'] = 'Specialty'
magic['82'] = 'Condemn'
magic['83'] = 'Roulette '
magic['84'] = 'Aqua Rake'
magic['85'] = 'L.5 Doom'
magic['86'] = 'L.4 Quarter'
magic['87'] = 'L.2 Old'
magic['88'] = 'L.3 Flare'
magic['89'] = 'Frog Song'
magic['8A'] = 'Tiny Song'
magic['8B'] = 'Flash'
magic['8C'] = 'Time Slip'
magic['8D'] = 'Moon Flute'
magic['8E'] = 'Death Claw'
magic['8F'] = 'Aero'
magic['90'] = 'Aero2'
magic['91'] = 'Aero3'
magic['92'] = 'Emission'
magic['93'] = 'Goblin Punch'
magic['94'] = 'Dark Shock'
magic['95'] = 'Guard Off'
magic['96'] = 'Fusion'
magic['97'] = 'Mind Blast'
magic['98'] = 'Vampire'
magic['99'] = 'Magic Hammer'
magic['9A'] = 'Big Guard'
magic['9B'] = 'Exploder'
magic['9C'] = '????'
magic['9D'] = 'Blowfish'
magic['9E'] = 'White Wind'
magic['9F'] = 'Missile'
magic['A0'] = 'Kurururu!'
magic['A1'] = 'Level Down'
magic['A2'] = 'Escape'
magic['A3'] = 'Stalker Attack'
magic['A4'] = 'Byblos Attack'
magic['A5'] = '"No Clue"'
magic['A6'] = 'Grand Cross'
magic['A7'] = 'Delta Attack'
magic['A8'] = 'Interceptor Rocket'
magic['A9'] = 'Barrier Change'
magic['AA'] = '"Regeneration" (Nothing)'
magic['AB'] = 'Wind Slash'
magic['AC'] = 'No-Damage Magic'
magic['AD'] = 'Targeting'
magic['AE'] = 'Gravity 100'
magic['AF'] = 'Darkness'
magic['B0'] = 'Reaper\'s Sword'
magic['B1'] = 'Punishment'
magic['B2'] = 'Blaster'
magic['B3'] = 'Beak'
magic['B4'] = 'Hug'
magic['B5'] = 'Spore'
magic['B6'] = 'Poison Breath'
magic['B7'] = 'Dance of the Dead'
magic['B8'] = 'Zombie Powder'
magic['B9'] = 'Zombie Breath'
magic['BA'] = 'Spirit'
magic['BB'] = 'Allure'
magic['BC'] = 'Entangle'
magic['BD'] = 'Rainbow Wind'
magic['BE'] = 'Strange Dance'
magic['BF'] = 'Electromagnetic Field'
magic['C0'] = 'White Hole'
magic['C1'] = 'Needle'
magic['C2'] = 'Maelstrom'
magic['C3'] = 'Bone'
magic['C4'] = 'Tailscrew'
magic['C5'] = 'Stomach Acid'
magic['C6'] = 'Rocket Punch'
magic['C7'] = 'Mustard Bomb'
magic['C8'] = 'Almagest'
magic['C9'] = 'Quicksand'
magic['CA'] = 'Atomic Ray'
magic['CB'] = 'Mini Blaze'
magic['CC'] = 'Snowstorm'
magic['CD'] = 'Blaze'
magic['CE'] = 'Electric Shock'
magic['CF'] = 'Earth Shaker'
magic['D0'] = 'True Edge'
magic['D1'] = 'Tidal Wave'
magic['D2'] = 'Mega Flare'
magic['D3'] = 'Sonic Wave'
magic['D4'] = 'Thread'
magic['D5'] = 'Mucus'
magic['D6'] = 'Quake'
magic['D7'] = 'Fight (strong)'
magic['D8'] = 'Medicine'
magic['D9'] = 'Image'
magic['DA'] = 'Breath Wing'
magic['DB'] = 'Flame'
magic['DC'] = 'Thunder'
magic['DD'] = 'Surge Beam'
magic['DE'] = '"Explosion" (Fight) (Ramuh, Shoat)'
magic['DF'] = 'Remedy'
magic['E0'] = 'Valiant Attack'
magic['E1'] = 'Giga Flare'
magic['E2'] = 'Circle'
magic['E3'] = 'Wormhole'
magic['E4'] = 'Possess'
magic['E5'] = 'Dynamo'
magic['E6'] = 'Magnet'
magic['E7'] = 'Reverse Polarity'
magic['E8'] = 'Jump'
magic['E9'] = 'X-Zone'
magic['EA'] = 'Hurricane'
magic['EB'] = 'Demon\'s Eye'
magic['EC'] = '(Pull)'
magic['ED'] = '(?) (Sandworm)'
magic['EE'] = '(Hide monster)'
magic['EF'] = '(End battle)'
magic['F0'] = 'Nothing'
magic['F1'] = 'Nothing'
magic['F2'] = 'Nothing'
magic['F3'] = 'Nothing'
magic['F4'] = 'Nothing'
magic['F5'] = 'Nothing'
magic['F6'] = 'Nothing'
magic['F7'] = 'Nothing'
magic['F8'] = 'Nothing'
magic['F9'] = 'Nothing'
magic['FA'] = 'Nothing'
magic['FB'] = 'Nothing'
magic['FC'] = 'Nothing'
magic['FD'] = 'Nothing'
magic['FE'] = 'Nothing'
magic['FF'] = 'Nothing'

items = {}
items['00'] = '(Nothing)'
items['01'] = 'Empty'
items['02'] = 'Knife'
items['03'] = 'Dagger'
items['04'] = 'Mythril Dagger'
items['05'] = 'Kunai'
items['06'] = 'Mage Masher'
items['07'] = 'Guardian'
items['08'] = 'Kodachi'
items['09'] = 'Orihalcon'
items['0A'] = 'Air Lancet'
items['0B'] = 'Assassin Dagger'
items['0C'] = 'Hardened Dagger'
items['0D'] = 'Broad Sword'
items['0E'] = 'Regal Cutlass'
items['0F'] = 'Mythril Sword'
items['10'] = 'Coral Sword'
items['11'] = 'Ancient Sword'
items['12'] = 'Epee'
items['13'] = 'Slumber Sword'
items['14'] = 'Defender'
items['15'] = 'Excalibur'
items['16'] = 'Ragnarok'
items['17'] = 'Javelin'
items['18'] = 'Spear'
items['19'] = 'Mythril Spear'
items['1A'] = 'Trident'
items['1B'] = 'Wind Spear'
items['1C'] = 'Partisan'
items['1D'] = 'Gungnir'
items['1E'] = 'Double Lance'
items['1F'] = 'Holy Spear'
items['20'] = 'Dragoon Spear'
items['21'] = 'Battle Axe'
items['22'] = 'Mythril Hammer'
items['23'] = 'Ogre Axe'
items['24'] = 'War Hammer'
items['25'] = 'Venom Axe'
items['26'] = 'Earth Hammer'
items['27'] = 'Rune Axe'
items['28'] = 'Thor\'s Hammer'
items['29'] = 'Katana'
items['2A'] = 'AirBlade'
items['2B'] = 'Kotetsu Sword'
items['2C'] = 'Bizen Sword'
items['2D'] = 'Forged Sword'
items['2E'] = 'Murasame'
items['2F'] = 'Masamune'
items['30'] = 'Tempest Sword'
items['31'] = 'Rod'
items['32'] = 'Fire Rod'
items['33'] = 'Ice Rod'
items['34'] = 'Thunder Rod'
items['35'] = 'Venom Rod'
items['36'] = 'Lillith Rod'
items['37'] = 'Wizard Rod'
items['38'] = 'Staff'
items['39'] = 'Mythril Staff'
items['3A'] = 'Power Staff'
items['3B'] = 'Healing Staff'
items['3C'] = 'Light Staff'
items['3D'] = 'Sage Staff'
items['3E'] = 'Staff of Judgement'
items['3F'] = 'Fire Bow'
items['40'] = 'Ice Bow'
items['41'] = 'Thunder Bow'
items['42'] = 'Darkness Bow'
items['43'] = 'Killer Bow'
items['44'] = 'Elven Bow'
items['45'] = 'Yoichi Bow'
items['46'] = 'Artemis\' Bow'
items['47'] = 'Silver Harp'
items['48'] = 'Dream Harp'
items['49'] = 'Lamia Harp'
items['4A'] = 'Apollo Harp'
items['4B'] = 'Whip'
items['4C'] = 'Chain Whip'
items['4D'] = 'Thunder Whip'
items['4E'] = 'Flame Whip'
items['4F'] = 'Dragon Whip'
items['50'] = 'Giyaman\'s Bell'
items['51'] = 'Earth Bell'
items['52'] = 'Rune Bell'
items['53'] = 'Tinker Bell'
items['54'] = 'Sabre (dummy)'
items['55'] = 'Drain Sword'
items['56'] = 'Rune Edge'
items['57'] = 'Flame Tongue'
items['58'] = 'Ice Brand'
items['59'] = 'Full Moon'
items['5A'] = 'Shuriken'
items['5B'] = 'Pinwheel'
items['5C'] = 'Excailber'
items['5D'] = 'Beastkiller'
items['5E'] = 'Flail'
items['5F'] = 'Morning Star'
items['60'] = 'Wonder Rod'
items['61'] = 'Brave Blade'
items['62'] = 'Soot'
items['63'] = 'Chicken Knife'
items['64'] = 'Rising Sun'
items['65'] = 'Silver Bow'
items['66'] = 'Gale Bow'
items['67'] = 'Anti-Magic Bow'
items['68'] = 'Aviskiller'
items['69'] = 'Doom Axe'
items['6A'] = 'Giant\'s Axe'
items['6B'] = 'Man Eater'
items['6C'] = 'Thief\'s Knife'
items['6D'] = 'Dancing Dagger'
items['6E'] = 'Enhancer'
items['6F'] = 'Left Hand'
items['70'] = 'Right Hand'
items['71'] = 'Item0000 (dummy)'
items['72'] = 'Item0000 (dummy)'
items['73'] = 'Item0000 (dummy)'
items['74'] = 'Item0000 (dummy)'
items['75'] = 'Item0000 (dummy)'
items['76'] = 'Item0000 (dummy)'
items['77'] = 'Item0000 (dummy)'
items['78'] = 'Item0000 (dummy)'
items['79'] = 'Item0000 (dummy)'
items['7A'] = 'Item0000 (dummy)'
items['7B'] = 'Item0000 (dummy)'
items['7C'] = 'Item0000 (dummy)'
items['7D'] = 'Item0000 (dummy)'
items['7E'] = 'Item0000 (dummy)'
items['7F'] = 'Item0000 (dummy)'
items['80'] = '(Nothing)'
items['81'] = 'Leather Shield'
items['82'] = 'Bronze Shield'
items['83'] = 'Iron Shield'
items['84'] = 'Mythril Shield'
items['85'] = 'Gold Shield'
items['86'] = 'Aegis Shield'
items['87'] = 'Diamond Shield'
items['88'] = 'Crystal Shield'
items['89'] = 'Leather Helmet'
items['8A'] = 'Bronze Helmet'
items['8B'] = 'Iron Helmet'
items['8C'] = 'Mythril Helmet'
items['8D'] = 'Gold Helmet'
items['8E'] = 'Diamond Helmet'
items['8F'] = 'Crystal Helmet'
items['90'] = 'Plumed Hat'
items['91'] = 'Tricorn'
items['92'] = 'Magus Hat'
items['93'] = 'Circlet'
items['94'] = 'Gold Hairpin'
items['95'] = 'Ribbon'
items['96'] = 'Bandana'
items['97'] = 'Green Beret'
items['98'] = 'Dark Hood'
items['99'] = 'Lamia\'s Tiara'
items['9A'] = 'Leather Clothes'
items['9B'] = 'Bronze Armor'
items['9C'] = 'Iron Armor'
items['9D'] = 'Mythril Armor'
items['9E'] = 'Gold Armor'
items['9F'] = 'Diamond Armor'
items['A0'] = 'Crystal Armor'
items['A1'] = 'Copper Armor'
items['A2'] = 'Training Suit'
items['A3'] = 'Silver Armor'
items['A4'] = 'Stealth Robe'
items['A5'] = 'Diamnd Plate'
items['A6'] = 'Dark Suit'
items['A7'] = 'Cotton Suit'
items['A8'] = 'Silk Robe'
items['A9'] = 'Gaia Gear'
items['AA'] = 'Bard\'s Clothes'
items['AB'] = 'Lumina Suit'
items['AC'] = 'Black Suit'
items['AD'] = 'White Suit'
items['AE'] = 'Mirage Vest'
items['AF'] = 'Guard Ring'
items['B0'] = 'Thief Glove'
items['B1'] = 'Giant\'s Glove'
items['B2'] = 'Elf Cape'
items['B3'] = 'Cursed Ring'
items['B4'] = 'Glasses'
items['B5'] = 'Running Shoes'
items['B6'] = 'Mythril Glove'
items['B7'] = 'Silver Ring'
items['B8'] = 'Diamond Ring'
items['B9'] = 'Strength Suit'
items['BA'] = 'Power Ring'
items['BB'] = 'Angel Suit'
items['BC'] = 'Angel Ring'
items['BD'] = 'Flame Ring'
items['BE'] = 'Coral Ring'
items['BF'] = 'Bone Mail'
items['C0'] = 'Leather Shoes'
items['C1'] = 'Kaiser Knuckles'
items['C2'] = 'Gauntlet'
items['C3'] = 'Tiger Mask'
items['C4'] = 'Flame Shield'
items['C5'] = 'Corna Jar'
items['C6'] = 'Genji Shield'
items['C7'] = 'Genji Helmet'
items['C8'] = 'Genji Armor'
items['C9'] = 'Genji Glove'
items['CA'] = 'Wall Ring'
items['CB'] = 'Coronet'
items['CC'] = 'Thornlet'
items['CD'] = 'Ice Shield'
items['CE'] = 'Cursed Shield'
items['CF'] = 'Rainbow Suit'
items['D0'] = 'Red Shoes'
items['D1'] = 'Item0000 (dummy)'
items['D2'] = 'Item0000 (dummy)'
items['D3'] = 'Item0000 (dummy)'
items['D4'] = 'Item0000 (dummy)'
items['D5'] = 'Item0000 (dummy)'
items['D6'] = 'Item0000 (dummy)'
items['D7'] = 'Item0000 (dummy)'
items['D8'] = 'Item0000 (dummy)'
items['D9'] = 'Item0000 (dummy)'
items['DA'] = 'Item0000 (dummy)'
items['DB'] = 'Item0000 (dummy)'
items['DC'] = 'Item0000 (dummy)'
items['DD'] = 'Item0000 (dummy)'
items['DE'] = 'Item0000 (dummy)'
items['DF'] = 'Item0000 (dummy)'
items['E0'] = 'Potion'
items['E1'] = 'Hi-Potion'
items['E2'] = 'Ether'
items['E3'] = 'Elixir'
items['E4'] = 'Phoenix Down'
items['E5'] = 'Maiden\'s Kiss'
items['E6'] = 'Revivify'
items['E7'] = 'Turtle Shell'
items['E8'] = 'Antidote'
items['E9'] = 'Eyedrop'
items['EA'] = 'Dragon Fang'
items['EB'] = 'Dark Matter'
items['EC'] = 'Soft'
items['ED'] = 'Luck Mallet'
items['EE'] = '"Dummy"'
items['EF'] = 'Magic Lamp'
items['F0'] = 'Tent'
items['F1'] = 'Cabin'
items['F2'] = 'Giant Drink'
items['F3'] = 'Power Drink'
items['F4'] = 'Speed Drink'
items['F5'] = 'Protect Drink'
items['F6'] = 'Hero Drink'
items['F7'] = 'Dragon Crest'
items['F8'] = 'Omega Medal'
items['F9'] = 'Ramuh'
items['FA'] = 'Shoat'
items['FB'] = 'Golem'
items['FC'] = 'Flame Scroll'
items['FD'] = 'Water Scroll'
items['FE'] = 'Thunder Scroll'
items['FF'] = '"by RPGe"'

bitset = {}
bitset[0] = '01'
bitset[1] = '02'
bitset[2] = '04'
bitset[3] = '08'
bitset[4] = '10'
bitset[5] = '20'
bitset[6] = '40'
bitset[7] = '80'
