Skip to content

Instantly share code, notes, and snippets.

@magical
Created June 17, 2010 19:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save magical/442592 to your computer and use it in GitHub Desktop.
Save magical/442592 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3.1
movenames = [None,
'Pound', 'Karate Chop', 'DoubleSlap', 'Comet Punch', 'Mega Punch', 'Pay Day', 'Fire Punch', 'Ice Punch', 'ThunderPunch', 'Scratch',
'ViceGrip', 'Guillotine', 'Razor Wind', 'Swords Dance', 'Cut', 'Gust', 'Wing Attack', 'Whirlwind', 'Fly', 'Bind',
'Slam', 'Vine Whip', 'Stomp', 'Double Kick', 'Mega Kick', 'Jump Kick', 'Rolling Kick', 'Sand-Attack', 'Headbutt', 'Horn Attack',
'Fury Attack', 'Horn Drill', 'Tackle', 'Body Slam', 'Wrap', 'Take Down', 'Thrash', 'Double-Edge', 'Tail Whip', 'Poison Sting',
'Twineedle', 'Pin Missile', 'Leer', 'Bite', 'Growl', 'Roar', 'Sing', 'Supersonic', 'SonicBoom', 'Disable',
'Acid', 'Ember', 'Flamethrower', 'Mist', 'Water Gun', 'Hydro Pump', 'Surf', 'Ice Beam', 'Blizzard', 'Psybeam',
'BubbleBeam', 'Aurora Beam', 'Hyper Beam', 'Peck', 'Drill Peck', 'Submission', 'Low Kick', 'Counter', 'Seismic Toss', 'Strength',
'Absorb', 'Mega Drain', 'Leech Seed', 'Growth', 'Razor Leaf', 'SolarBeam', 'PoisonPowder', 'Stun Spore', 'Sleep Powder', 'Petal Dance',
'String Shot', 'Dragon Rage', 'Fire Spin', 'ThunderShock', 'Thunderbolt', 'Thunder Wave', 'Thunder', 'Rock Throw', 'Earthquake', 'Fissure',
'Dig', 'Toxic', 'Confusion', 'Psychic', 'Hypnosis', 'Meditate', 'Agility', 'Quick Attack', 'Rage', 'Teleport',
'Night Shade', 'Mimic', 'Screech', 'Double Team', 'Recover', 'Harden', 'Minimize', 'SmokeScreen', 'Confuse Ray', 'Withdraw',
'Defense Curl', 'Barrier', 'Light Screen', 'Haze', 'Reflect', 'Focus Energy', 'Bide', 'Metronome', 'Mirror Move', 'Selfdestruct',
'Egg Bomb', 'Lick', 'Smog', 'Sludge', 'Bone Club', 'Fire Blast', 'Waterfall', 'Clamp', 'Swift', 'Skull Bash',
'Spike Cannon', 'Constrict', 'Amnesia', 'Kinesis', 'Softboiled', 'Hi Jump Kick', 'Glare', 'Dream Eater', 'Poison Gas', 'Barrage',
'Leech Life', 'Lovely Kiss', 'Sky Attack', 'Transform', 'Bubble', 'Dizzy Punch', 'Spore', 'Flash', 'Psywave', 'Splash',
'Acid Armor', 'Crabhammer', 'Explosion', 'Fury Swipes', 'Bonemerang', 'Rest', 'Rock Slide', 'Hyper Fang', 'Sharpen', 'Conversion',
'Tri Attack', 'Super Fang', 'Slash', 'Substitute', 'Struggle', 'Sketch', 'Triple Kick', 'Thief', 'Spider Web', 'Mind Reader',
'Nightmare', 'Flame Wheel', 'Snore', 'Curse', 'Flail', 'Conversion 2', 'Aeroblast', 'Cotton Spore', 'Reversal', 'Spite',
'Powder Snow', 'Protect', 'Mach Punch', 'Scary Face', 'Faint Attack', 'Sweet Kiss', 'Belly Drum', 'Sludge Bomb', 'Mud-Slap', 'Octazooka',
'Spikes', 'Zap Cannon', 'Foresight', 'Destiny Bond', 'Perish Song', 'Icy Wind', 'Detect', 'Bone Rush', 'Lock-On', 'Outrage',
'Sandstorm', 'Giga Drain', 'Endure', 'Charm', 'Rollout', 'False Swipe', 'Swagger', 'Milk Drink', 'Spark', 'Fury Cutter',
'Steel Wing', 'Mean Look', 'Attract', 'Sleep Talk', 'Heal Bell', 'Return', 'Present', 'Frustration', 'Safeguard', 'Pain Split',
'Sacred Fire', 'Magnitude', 'DynamicPunch', 'Megahorn', 'DragonBreath', 'Baton Pass', 'Encore', 'Pursuit', 'Rapid Spin', 'Sweet Scent',
'Iron Tail', 'Metal Claw', 'Vital Throw', 'Morning Sun', 'Synthesis', 'Moonlight', 'Hidden Power', 'Cross Chop', 'Twister', 'Rain Dance',
'Sunny Day', 'Crunch', 'Mirror Coat', 'Psych Up', 'ExtremeSpeed', 'AncientPower', 'Shadow Ball', 'Future Sight', 'Rock Smash', 'Whirlpool',
'Beat Up'
]
def pointer(bank, offset):
return (bank << 14) | (offset & 0x3fff)
from array import array
base = 0x239fe
bank = (base >> 14)
f = open("gold.gbc", "rb")
f.seek(base)
pointers = array("H", f.read(2 * 251))
#pointers = [ pointer(bank, o) for o in pointers ]
def readmoves(f):
moves = []
while 1:
m = ord(f.read(1))
if m == 0xff:
break
moves.append(m)
return moves
for i, o in enumerate(pointers):
p = pointer(bank, o)
#print(hex(o), hex(p))
f.seek(p)
moves = readmoves(f)
if moves:
print(i+1, [movenames[m] for m in moves])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment