06.18.09
Posted in Personal, Programming at 8:27 pm by Michael
In my scant free time, I’ve taken to reverse engineering the memory of video games in Project 64, thus discovering new cheat codes. Some of these are very interesting, particularly in games with centralized environments (e.g. a system of time around which everything revolves). Majora’s Mask has a centralized time system and transformations, which makes it particularly ripe for experimentation.
Caveats: This is the whole list of cheats I have in Project 64, so many were built into the emulator’s default list of cheats (most of them begin with “E8″, since I use “80″ and “81″ to patch memory addresses and in fact have no idea what the format of these nonstandard “E8/E9″ codes are). Also, not all of them work and a few will freeze the emulator pretty deterministically.
The stop/speed up/reverse time cheats are particularly interesting (the easiest to find, too). Try stopping or reversing time in clock town for a very interesting effect. You can also use the “Jump to Day” and “Jump to Night” cheats to warp in time without using the song or losing your progress. Turns out that you can also go past the time the moon is supposed to hit, but this screws some things up. Most of the “change animation” cheats are kind of funny, and reveal a bit about the underlying design of the character meshes, but some will freeze the game when the animation ends (presumably the length is defined somewhere in memory when the animation normally begins, but the cheat doesn’t set it, so it runs off the end and segfaults).
“Normal Sized Giant”, “Act Like a Pig”, and “Always Wearing Bunny Hood” all work reasonably well so long as the appropriate mask is assigned to a C button (although they tend to prevent you from taking off transformation masks). You can, of course, modify the value of this code to represent other masks.
I have no idea if any of these will work on a real Gameshark/Pro Action Replay, and though I have both the shark and the game, I’m hesitant to try on my old N64. Use at your own risk.
You should be able to copy and paste this right into your Project64 cheat file.
[E97955C6-BC338D38-C:50]
Name=ZELDA MAJORA’S MASK
Cheat0=”Infinite\Rupees”,E974BEDE 5C37
Cheat1=”Infinite\Health”,E974BEDA 5C37
Cheat2=”Infinite\Max & Double Magic Meter”,E874BEDF 59BA,E974BEE8 5A59
Cheat3=”Infinite\Items”,E874BE47 59BB,E874BE4A 59BB,E874BE49 59BB,E874BE50 59BB,E874BE4F 59BB,E874BE4E 59BB,E874BE54 59BB,E874BE4D 59BB,E874BE53 59BB
Cheat3_N=This is Infinite use of Bombs,Bombchus,Deku Sticks,Deku Nuts,Magic Beans,& Powder Kegs. But you must also put it’s Have on to work.
Cheat4=”Have\All Masks”,E974BE30 8F91,E974BE2E 9895,E974BE34 998C,E974BE32 9398,E974BE38 919C,E974BE36 A18B,E974BE3C 8D8D,E974BE3A 888F,E974BE40 8786,E974BE3E 9C99,E974BE44 9496,E974BE42 A285
Cheat5=”Use all C Buttons”,E974FDC0 595A,E974FDBE 595A
Cheat6=”Event Item\Modifier 1″,E874BE1B 59??
Cheat7=”Event Item\Modifier 2″,E874BE1D 59??
Cheat8=”Event Item\Modifier 3″,E874BE27 59??
Cheat9=”Jump to Dawn”,811E6B5C 4000,801E6B6B 01??,801E6B6F 01??
Cheat10=”Have Bottle\Modifier 1″,E874BE26 59??
Cheat11=”Have Bottle\Modifier 2″,E874BE25 59??
Cheat12=”Have Bottle\Modifier 3″,E874BE2C 59??
Cheat13=”Have Bottle\Modifier 4″,E874BE2B 59??
Cheat14=”Have Bottle\Modifier 5″,E874BE2A 59??
Cheat15=”Have\Great Fairy’s Sword”,E874BE28 596A
Cheat16=”Have\QuestStatus Items”,E874C363 5955,E974C362 481F
Cheat17=”Have\Have Ocarina of Time”,E874BE18 595A
Cheat18=”Have\Hero’s Bow”,E874BE17 5959
Cheat19=”Have\Fire Arrow”,E874BE16 595C
Cheat20=”Have\Ice Arrow”,E874BE15 595B
Cheat21=”Have\Light Arrow”,E874BE1C 5956
Cheat22=”Have\Bombs”,E874BE1A 5958
Cheat23=”Have\Bombchu”,E874BE19 5957
Cheat24=”Have\Deku Sticks”,E874BE20 5962
Cheat25=”Have\Deku Nuts”,E874BE1F 5961
Cheat26=”Have\Magic Beans”,E874BE1E 5964
Cheat27=”Have\Powder Kegs”,E874BE24 595E
Cheat28=”Have\Pictograph”,E874BE23 595D
Cheat29=”Have\Lens of Truth”,E874BE22 5960
Cheat30=”Have\Hookshot”,E874BE21 595F
Cheat31=”Have Bottle\Modifier 6″,E874BE29 59??
Cheat32=”Reverse Time”,801E6B64 FFFF,801E6B65 FFFF,801E6B66 FFFF,801E6B67 FCFC
Cheat33=”Replace Sword With”,E874BEF4 59??
Cheat33_O=$A4 Fire Arrow w/ Bow,$A3 Ice Arrow w/ Bow,$9E Light Arrow w/ Bow,$9D Kokiri Sword,$A0 Razor Sword,$9F Guilded Sword,$AA Deity Link’s Sword
Cheat34=”Play As”,E874BEC8 59??
Cheat35=”Infinite\Hearts Options”,E974BEDC ????
Cheat35_O=$5A9A Max Hearts,$59BB 6 Hearts,$599B 4 Hearts
Cheat35_N=If you need to clear the Infinite Max Hearts from the screen just choose the 6 or 4 Heart Options, take off the cheat & then make a save.
Cheat36=”Press L To Levitate”,D03DDFDB 0020,E993C510 9923
Cheat38=”Warp Modifier”,E891322E 595A,E893BF8B 5959,E993BF8E ????
Cheat38_O=$596A Mayors Residence,$5962 Magic Hags Potion Shop,$5964 Romani Ranch Barn,$5963 Mama’s House,$5960 Honey & Darlings Shop,$5965 Final Boss Arena,$596F Beneath the Graveyard (left entrance),$597F Beneath the Graveyard (right entrance),$598A Southern Swamp (Reg Entrance),$599F Southern Swamp (from tour house),$59C0 Southern Swamp (from Woodfall),$59BF Southern Swamp (from Deku Palace),$59D2 Path to Ikana Canyon,$59F0 Southern Swamp (from Deku Place 2),$59EF Southern Swamp (From Potion Shop),$59FF Boat Cruise (picture taking),$591D Southern Swamp (From Woods of Mystery),$5920 Southern Swamp (From Spider House),$591F Southern Swamp (From Ikana Canyon),$5950 Southern Swamp (From Owl Warp),$5F5A Curiosity Shop,$5F92 Ikana Canyon Entrance,$665A Lens of Truth Cave (get it),$775A Stone Tower Temple (Upside down),$7761 Stone Tower Temple (Boss Room Entrance),$7756 Treasure Chest Shop,$7755 Treausre Chest Shop (counter),$7760 Clock Tower (w/ skull kid, silent),$776A Stone Tower Temple (endless fall),$BB66 Romani Ranch,$EB66 Zora Shop,$0B66 Snowhead (Path to temple, warp in),$2B66 East Clock Down
Cheat38_N=Put this code on and it will now take where you wanted to go, turn it back off or it will infinite loop entering all the time.
Cheat6_O=$82 Moon’s Tear,$81 Land Title Deed,$84 Swap Title Deed,$83 Mountain Title Deed,$7E Ocean Title Deed,$7D Room Key,$80 Special Delivery To Mama,$7F Letter To Kafei,$8A Pendant Of Memories
Cheat7_O=$82 Moon’s Tear,$81 Land Title Deed,$84 Swap Title Deed,$83 Mountain Title Deed,$7E Ocean Title Deed,$7D Room Key,$80 Special Delivery To Mama,$7F Letter To Kafei,$8A Pendant Of Memories
Cheat8_O=$82 Moon’s Tear,$81 Land Title Deed,$84 Swap Title Deed,$83 Mountain Title Deed,$7E Ocean Title Deed,$7D Room Key,$80 Special Delivery To Mama,$7F Letter To Kafei,$8A Pendant Of Memories
Cheat10_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat11_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat12_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat13_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat14_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat31_O=$6C Empty Bottle,$6B Red Potion,$66 Green Potion,$65 Blue Potion,$68 Fairy,$67 Deku Princess,$72 Milk,$71 Milk (1/2),$74 Fish,$73 Bug,$6E Blue Fire,$6D Poe,$70 Big Poe,$6F Spring Water,$7A Hot Spring Water,$79 Zora Egg,$7C Gold Dust,$7B Magical Mushroom,$76 Sea Horse,$75 Chateau Romani,$78 Japanese Bottle?,$77 Empty Japanese Bottle?
Cheat33_N=Only put the Deity Link’s Sword on, if using The Play As Fierce Deity Link Code, if not it will turn Fierce Deity Link into a crazed slashing Machine. You have been warned.
Cheat34_O=$5A Fierce Deity Link,$59 Goron Link,$5C Zora Link,$5B Deku Link,$56 Normal Link
Cheat36_N=Press L To Levitate & Let go to land
Cheat37=”Beta World 1″,D03DDFDB 0000,E874BEA6 59??
Cheat37_O=$5A Mama’s House,$59 Fearful Spider House,$5C Beneaf the Graveyard,$5B Southern Swamp Mr Tingle Entry,$58 Outside Tourist Information Southern Swamp,$62 Outside Magic Hag’s Potion Shop,$64 Southern Swamp Woods Of Mystery Entry,$76 Counter Of The Tresure Chest Shop,$80 Woodfall Temple non Beta,$8C Spider Hand,$85 Statue outside Gorman Track,$88 Statue outside Lair Of The Temples Boss,$92 Path to Romani Ranch non Beta,$A4 outside The Royal Palace of the Deku Kingdom,$9E Ledge in The Royal Palace of the Deku Kingdom,$A0 inside The Royal Palace of the Deku Kingdom 1,$C9 Green Blobs,$C6 Cave Portal to Last Boss Field,$CF Waterfall Sothern Swamp,$E4 Giant Turtle In the Temple non beta,$E3 Room of Miau & Tijo Zora Great Hall,$E6 Recieving Gorans Mask non Beta,$E5 ?,$E8 Hungry Goran in the Snow,$FC Statue in Stone Tower,$F8 Stone Tower non Beta,$11 Recieving Deku Mask non Beta,$31 Giant Lizards in a Cave,$34 Cave with Steaming Water,$4F Vamps House In Ikana Canyon
Cheat37_N=Put on the code on load up,After the Nintendo logo you will be in that place of Choice.you can also choose another place & then press F1 (reset) to go to that place this is for beta interest only it will not assist you in playing the game.
Cheat39=”Stop Time”,801E6B64 FFFF,801E6B65 FFFF,801E6B66 FFFF,801E6B67 FDFD
Cheat40=”Speed Up Time”,801E6B64 0000,801E6B65 0000,801E6B66 0000,801E6B67 0A0A
Cheat41=”Jump to Night”,811E6B5C FF60,801E6B6B 01??,801E6B6F 01??
Cheat42=”Greatly Speed Up Time”,801E6B64 0000,801E6B65 0000,801E6B66 0000,801E6B67 5050
Cheat43=”Greatly Reverse Time”,801E6B64 FFFF,801E6B65 FFFF,801E6B66 FFFF,801E6B67 B0B0
Cheat41_O=$01 First Day,$02 Second Day,$03 Final Day,$04 New Day,$05 ??
Cheat9_O=$01 First Day,$02 Second Day,$03 Final Day,$04 New Day,$05 ??
Cheat44=”Infinite Swimming (Try to jump out of the water)”,803F7CC2 0002
Cheat45=”Disable A Button”,801F2D50 0080
Cheat46=”No Continuing Magic Use”,801EAA79 0000
Cheat47=”Always Wearing Bunny Hood”,803F73A3 0004
Cheat48=”Gasping for Air”,803F7CC2 0004
Cheat49=”Change Ocarina Sound”,D01ECD93 000A,801E6B70 00??,D21ECD93 000A,801E6B70 0004
Cheat50=”Freeze Enemies”,803F7CBF 0050
Cheat51=”Ghostwalk”,803F7CBF 0080
Cheat52=”Ineffective Weapons”,813F6844 0001
Cheat53=”Electrify (not really working yet)”,803F6849 003F,813F684A 7934,813F684C 0000,813F684E 0000,813DDFD4 8010,813DDFDA 8010,813DFE54 0101,813F6848 803F,813F7764 0258
Cheat54=”Play As (Change Delayed, Actions Immediate)”,801E6B70 00??
Cheat49_O=$33 Singing,$81 Chimes,$85 Monkey,$8D Bass Guitar,$A9 Bahs,$FD Overdriven Guitar
Cheat55=”Change Idle Animation (Don’t move)”,803F739B 00??
Cheat55_O=$00 FD Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link
Cheat34_N=Also see 1E6B70
Cheat56=”Normal-sized Giant”,803F73A3 0014
Cheat56_N=Equip the Giant’s Mask to a slot first.
Cheat57=”Swim (sort of)”,801C00A5 008B,801C00A6 00A7,801C00A7 0023,801E50E5 00BF,801E50E6 0033,801E50E7 0034,803F739B 0002,803F5DDD 004D,803F7306 0050,803F7395 0004,803F7399 0004,813F749A DF00,813F74A8 4200
Cheat58=”Always Wearing Stone Mask”,803F73A3 0010
Cheat59=”Change A Button Text to Swim”,813F4BBA 0025,813F4BBC 0025,80250C51 0016,80250C52 00FF,80250C53 006E,80250C54 0024
Cheat54_O=$00 FD Link,$01 Goron Link,$02 Zora Link,$03 Deku Link,$04 Normal Link
Cheat60=”Infinite Water Walking”,803F4BBA 001F,803F4BBB 001F,803F4BBC 001F,803F4BBD 001F
Cheat61=”Put Away Sword”,811EAA68 FFFF
Cheat62=”Change Animation”,813F749A ????
Cheat62_O=,$E300 Gesticulating Wildly,$D0B0 Mask of Scents,$DE40 Walking,$DF28 Idle,$E000 Treading,$E3D8 Swimming,$D228 Bremen March,$D0C8 Putting on Mask,$E2E0 Taking off Mask,$E270 Spinning,$DCD8 Hopping,$CF98 Kamaro Dance,$E208 Rolling,$DFC8 Climbing,$DDB8 Ocarina Playing,$DC00 Sliding,$CF50 Floating Up,$CF58 Floating Down,$D0D8 Waving Goodbye,$E010 Horseback Riding,$D788 Swinging Sword (Start),$D790 Swinging Sword (End)
Cheat63=”Act Like a Pig”,803F73A3 0013,813F749A D0B0
Permalink
04.08.09
Posted in Programming at 11:38 am by Michael
I was seeking problems to be solved using graph theory concepts for instruction of my class and found one on an online IQ test. This is similar to the “7 Bridges of Königsberg” Problem:
“If a doughnut shaped house has two doors to the outside and three doors to the inner courtyard, then it’s possible to end up back at your starting place by walking through all five doors of the house without ever walking through the same door twice.”
To present this in graph theory language, we’re looking for an Eulerian circuit across a graph with 3 vertices and 5 edges. This means the exact same thing as the problem above.
Think of each of those 3 vertices as a “state”. One of them is “inside of the house”. Another is “inside of the courtyard” and the third is “outside”.
Every time we enter a part of the house, we must also leave it. So for us to start on the inside, go outside, and end up back inside when we finally finish, for example, we’ll need to cross an even number of doors. This would be true even if we could somehow go from the inner courtyard directly outside.
This turns out to be a requirement of every “state” we pass through: it must be entered and it must be left. If we weren’t concerned with ending up in the starting location, we could make two exceptions to this: the starting state, which one does not require a door to initially enter, and the ending state, from which one does not leave. Ordinarily, these could tolerate an odd number of doors. But since we want to start and end in the same location, we don’t even have that luxury: if we don’t enter once and don’t leave once, we skip two doors and we’re back to an even number.
In the language of graph theory, we call the number of adjacent edges to a vertex the degree of that vertex. What we can then say is that an Eulerian circuit - a path that crosses every edge once and ends at the same vertex it began - requires every vertex in the graph to have an even degree.
In other words, all “areas” within the house must have an even number of doors for such a path to exist. So what is the degree of each vertex? (how many doors lead in and out of each area?)
Two doors exist between the inside and the outside and three exist between the inside and the courtyard.
One of the vertices has an odd degree, thus no Eulerian circuit exists and it is not possible to cross each door once and end up back where you started.
There’s also a bit more relaxed traversal called an “Eulerian path”, which removes the restriction that we must end in the starting location. That would indeed be possible: start in the courtyard, walk through the three doors, leaving you in the inside, and walk the two doors from the inside to the outside. This starts you in the courtyard and ends inside of the house.
Let’s say that we’ve been hired as a contractor by the owners of the doughnut shaped house, who wish to exercise every morning by taking an Eulerian circuit around the house. How could we rectify this?
The answer is to either build another door between the inside and the courtyard or to knock one down.
Whichever is cheaper to do, I suppose.
Permalink