2
2
3
3
i like to muck around in the memory of these games.
4
4
5
- those who are more interested in the ROM will find [ the binary template repo] [ bt ]
5
+ those who are more interested in the ROM may find [ the binary template repo] [ bt ]
6
6
more resourceful.
7
7
8
- [ bt ] : https: //github.com/EntranceJew/zelda-binary-templates
8
+ [ bt ] : //github.com/EntranceJew/zelda-binary-templates
9
9
10
- # Majora's Mask
10
+ ## Lua Scripts
11
+
12
+ this repo contains a ton of Lua scripts
13
+ written for [ the latest version of Bizhawk.] [ bizhawk ]
14
+ all the scripts you'll want to use are in the root Lua directory,
15
+ and their dependencies are in further subdirectories.
16
+ that means, if you want to use a script,
17
+ you ** must** preserve the directory structure.
18
+ you ** cannot,** say, extract one file from [ this repo's archive] [ arch ]
19
+ and expect it to work.
20
+ [ bizhawk ] : //github.com/tasvideos/bizhawk
21
+ [ arch ] : //github.com/notwa/mm/archive/master.zip
22
+
23
+ a summary of each script is available in [ the Lua README.md file,] [ luarm ]
24
+ and another for [ the library files] [ librm ] that the scripts use.
25
+
26
+ [ luarm ] : /Lua/README.md
27
+ [ librm ] : /Lua/lib/README.md
28
+
29
+ of these, you probably came for ` cheat menu.lua `
30
+ this script will bind your L button to open an on-screen menu
31
+ allowing you to control many aspects of the game.
32
+
33
+ ![ cheat menu.lua in action] ( /img/M_US10.2016-10-02%2019.02.17.png )
34
+
35
+ of immediate interest are the classic levitation and run-fast cheats,
36
+ but also the menu of warps to any area and any entrance in the game.
37
+ you can also change your Z-Targeting method to Hold in the 2nd
38
+ page of the Progress menu, in case you forgot to change it in-game.
39
+
40
+ ## Assembly Hacks
41
+
42
+ i have written a handful of ROM and RAM hacks for Majora's Mask and Ocarina of Time.
43
+ these have all been written in the custom assembler syntax of
44
+ [ _ lips,_ a MIPS assembler written in Lua.] [ lips ]
45
+ _ lips_ is included in this repository; you do not need to acquire it separately.
46
+ [ lips ] : //github.com/notwa/lips
47
+
48
+ you only need to run ` Lua/inject.lua ` in Bizhawk
49
+ to run the * RAM hacks* — that is, modifications that act
50
+ directly on the game's RAM while it runs; not modifying the ROM.
51
+
52
+ for the * ROM hacks,* you will need to set up a lot more.
53
+ you will need:
54
+
55
+ * ** bash 4.3** to run the shell scripts responsible for
56
+ automatically running all the following software.
57
+
58
+ * ** Python 3.4** to run the scripts responsible for
59
+ splitting the ROM into files, and merging those files into a single ROM again.
60
+
61
+ * ** LuaJIT 2.0** to run the * lips* assembler responsible for
62
+ turning the assembly files into executable binary code.
63
+ you might manage to use the * Lua 5.1* interpreter,
64
+ but this is not strictly supported.
65
+
66
+ * ** gcc 4.9** * or* ** clang 3.6** to compile the programs responsible for
67
+ (de)compressing the * Yaz* archive files, and for computing checksums.
68
+
69
+ the versions listed above are rough estimates, and newer versions of software
70
+ are likely to work fine.
71
+
72
+ if you're on Windows, and you're not afraid of the (\* nix) console,
73
+ you can set up [ cygwin] ( //cygwin.com )
74
+ to install binaries of bash, python, and gcc.
75
+ then all that's left is to compile LuaJIT yourself.
76
+
77
+ last, but not least, you will need the approriate ROM for the ROM hack.
78
+ you will probably need to change the hard-coded paths to the ROMs.
79
+ * (note to self: change scripts to take the required ROM as their first argument)*
80
+
81
+ finally, you just run the appropriate shell scripts
82
+ for the ROM hacks you want to produce. for example:
83
+ ```
84
+ $ cd asm
85
+ $ ./mm-bq
86
+ zelda@srd44
87
+ 00-07-31 17:04:16
88
+ uncompressed 0031 V00B3C000
89
+ ratio: 59%
90
+ compressed 0031 V00B3C000
91
+ ratio: 59%
92
+ compressed 1552 V02EE7040
93
+ ratio: 1%
94
+ bootcode: 6105
95
+ crcs: 5CF5359C A893E696
96
+ ```
97
+
98
+ ### blah
99
+
100
+ to compile the C programs, you might need to pass ` -std=gnu11 ` . basically:
101
+ ```
102
+ gcc -std=gnu11 -Wall -Ofast z64yaz0.c -o z64yaz0
103
+ gcc -std=gnu11 -Wall -Ofast z64crc.c -o z64crc
104
+ ```
105
+
106
+ in the future, it'd be nice to only depend on LuaJIT to build ROMs.
107
+
108
+ cygwin's newline mangling will be the death of me.
109
+
110
+ # Miscellaneous notes on Majora's Mask
11
111
12
112
for brevity, all addresses written here are given for the original US version.
13
113
refer to the spreadsheets or Lua tables for their equivalent in other versions.
@@ -33,19 +133,19 @@ some sheets have been put together to dump data in. some of them can be used to
33
133
* spoilers:* no desirable results besides light arrows, if it were even possible.
34
134
_ potential crashes are not taken account for._
35
135
36
- [ eventflags ] : https: //docs.google.com/spreadsheets/d/181V9dR5vBROdCVB4FkljG5oz2O4gGU5OTAkoPQX9X10/edit?usp=sharing
37
- [ gs_addrs ] : https: //docs.google.com/spreadsheets/d/1HD8yZM1Jza3O8zO28n3k_Rjwdx58RSMA03915l51oDA/edit?usp=sharing
38
- [ noice ] : /Lua/addrs/M/common.lua
39
- [ gim ] : https: //docs.google.com/spreadsheets/d/17LsLbF6aRePVRxisui8azPtDBfPmjugWIf91wPuXTsY
40
- [ ed ] : https: //docs.google.com/spreadsheets/d/1e9kDyAW0gxXHFWS-GNEtVIo-rp39wQJJOtf3B0ehhqY
136
+ [ eventflags ] : //docs.google.com/spreadsheets/d/181V9dR5vBROdCVB4FkljG5oz2O4gGU5OTAkoPQX9X10/edit?usp=sharing
137
+ [ gs_addrs ] : //docs.google.com/spreadsheets/d/1HD8yZM1Jza3O8zO28n3k_Rjwdx58RSMA03915l51oDA/edit?usp=sharing
138
+ [ noice ] : /Lua/lib/ addrs/M/common.lua
139
+ [ gim ] : //docs.google.com/spreadsheets/d/17LsLbF6aRePVRxisui8azPtDBfPmjugWIf91wPuXTsY
140
+ [ ed ] : //docs.google.com/spreadsheets/d/1e9kDyAW0gxXHFWS-GNEtVIo-rp39wQJJOtf3B0ehhqY
41
141
[ calc ] : /Lua/exit%20calculator.lua
42
- [ csv ] : https: //eaguru.guru/t/_exits.csv
142
+ [ csv ] : //eaguru.guru/t/_exits.csv
43
143
44
144
## save files
45
145
46
146
save contents are mostly documented by [ the save file binary templates.] [ savebt ]
47
147
48
- [ savebt ] : https: //github.com/EntranceJew/zelda-binary-templates/tree/master/filetypes/Save
148
+ [ savebt ] : //github.com/EntranceJew/zelda-binary-templates/tree/master/filetypes/Save
49
149
50
150
in the versions of the game with owl saves,
51
151
regular saves are 0x100C in size, and owl saves are 0x3CA0.
@@ -56,16 +156,16 @@ each slot has one backup copy of itself, though they don't seem to be used?
56
156
if a slot is corrupted, it will show up as empty in the menu.
57
157
58
158
the checksum is a 16-bit sum of all bytes up to that point, allowing overflows.
59
- i've written [ a checksum-fixing program] [ chksum ] in python for bizhawk savefiles.
159
+ i've written [ a checksum-fixing program] [ chksum ] in Python for Bizhawk savefiles.
60
160
i've also written an [ 010] [ 010 ] Editor [ script] [ chksum2 ]
61
161
and its [ OoT variant] [ chksumOoT ]
62
162
for properly formed save files, such as those made by nemu64.
63
163
64
164
owl saves always have 0x24 added to their checksum for some reason.
65
165
66
166
[ chksum ] : /chksum.py
67
- [ chksum2 ] : https: //github.com/EntranceJew/zelda-binary-templates/blob/master/scripts/FixSaveMM.1sc
68
- [ chksumOoT ] : https: //github.com/EntranceJew/zelda-binary-templates/blob/master/scripts/FixSaveOoT.1sc
167
+ [ chksum2 ] : //github.com/EntranceJew/zelda-binary-templates/blob/master/scripts/FixSaveMM.1sc
168
+ [ chksumOoT ] : //github.com/EntranceJew/zelda-binary-templates/blob/master/scripts/FixSaveOoT.1sc
69
169
[ 010 ] : http://www.sweetscape.com/010editor/
70
170
71
171
bizhawk save files, at the time of writing, have the first file offset to 0x20800.
@@ -84,14 +184,14 @@ xxd -r $x > "$s"
84
184
revend "$s"
85
185
```
86
186
87
- ## save files (for download)
187
+ ## MM Save Files
88
188
89
189
because no one likes first cycle.
90
190
91
191
sometime i'll bother checking what the bombers/lottery codes are for these.
92
192
93
- * [ Bizhawk US 1.0 race file] ( https: //eaguru.guru/t/MM%20US%20Race%20File%20for%20Bizhawk.zip )
94
- * [ mupen64plus US 1.0 race file] ( https: //eaguru.guru/t/Legend%20of%20Zelda%2C%20The%20-%20Majora%27s%20Mask%20%28U%29%20%5B%21%5D.zip)
193
+ * [ Bizhawk US 1.0 race file] ( //eaguru.guru/t/MM%20US%20Race%20File%20for%20Bizhawk.zip )
194
+ * [ mupen64plus US 1.0 race file] ( //eaguru.guru/t/Legend%20of%20Zelda%2C%20The%20-%20Majora%27s%20Mask%20%28U%29%20%5B%21%5D.zip )
95
195
96
196
## bitfields
97
197
@@ -114,8 +214,8 @@ they appear in a different order than in save files, however.
114
214
803E898C corresponds to offset 0xC.
115
215
803E8994 corresponds to offset 0x10.
116
216
117
- ### link 's status
217
+ ### Link 's status
118
218
119
- here's [ an incomplete document on some of link 's bitfields] [ linkfields ] for JP 1.0.
219
+ here's [ an incomplete document on some of Link 's bitfields] [ linkfields ] for JP 1.0.
120
220
121
221
[ linkfields] : /mm-bitflags.txt
0 commit comments