Coder Social home page Coder Social logo

notwa / mm Goto Github PK

View Code? Open in Web Editor NEW
34.0 5.0 5.0 749 KB

Majora's Mask scripts, with some Ocarina of Time on the side.

Lua 75.89% Python 9.45% Assembly 9.45% Shell 1.48% C 3.74%
ocarina-of-time majoras-mask romhacking bizhawk mips-assembly n64

mm's Introduction

Zelda 64 Resources

i like to muck around in the memory of these games.

those who are more interested in the ROM may find the binary template repo more resourceful.

there is also a great deal of general documentation and notes on the wikis hosted at CloudModding.

Lua Scripts

this repo contains a ton of Lua scripts written for version 2.4.2 of Bizhawk. all the scripts you'll want to use are in the root Lua directory, and their dependencies are in further subdirectories. that means, if you want to use a script, you must preserve the directory structure. you cannot, say, extract one file from this repo's archive and expect it to work.

a summary of each script is available in the Lua README.md file, and another for the library files that the scripts use.

of these, you probably came for cheat menu.lua. this script will bind your L button to open an on-screen menu allowing you to control many aspects of the game.

cheat menu.lua in action

of immediate interest are the classic levitation and run-fast cheats, but also the menu of warps to any area and any entrance in the game. you can also change your Z-Targeting method to Hold in the 2nd page of the Progress menu, in case you forgot to change it in-game.

Assembly Hacks

i have written a handful of ROM and RAM hacks for Majora's Mask and Ocarina of Time. these have all been written in the custom assembler syntax of lips, a MIPS assembler written in Lua. lips is included in this repository; you do not need to acquire it separately.

you only need to run Lua/inject.lua in Bizhawk to run the RAM hacks โ€” that is, modifications that act directly on the game's RAM while it runs; not modifying the ROM.

for the ROM hacks, you will need to set up a lot more. you will need:

  • bash 4.3 to run the shell scripts responsible for automatically running all the following software.

  • Python 3.4 to run the scripts responsible for splitting the ROM into files, and merging those files into a single ROM again.

  • LuaJIT 2.0 to run the lips assembler responsible for turning the assembly files into executable binary code. you might manage to use the Lua 5.1 interpreter, but this is not strictly supported.

  • gcc 4.9 or clang 3.6 to compile the programs responsible for (de)compressing the Yaz archive files, and for computing checksums.

the versions listed above are rough estimates, and newer versions of software are likely to work fine.

if you're on Windows, and you're not afraid of the (*nix) console, you can set up msys2 to install binaries of bash, python, and gcc. then all that's left is to compile LuaJIT yourself, or you can grab a 64-bit binary built by myself.

last, but not least, you will need the appropriate ROM for the ROM hack. you will probably need to change the hard-coded paths to the ROMs. (note to self: change scripts to take the required ROM as their first argument)

finally, you just run the appropriate shell scripts for the ROM hacks you want to produce. for example:

$ cd asm
$ ./mm-bq
zelda@srd44
00-07-31 17:04:16
uncompressed 0031 V00B3C000
ratio: 59%
compressed 0031 V00B3C000
ratio: 59%
compressed 1552 V02EE7040
ratio: 1%
bootcode: 6105
crcs: 5CF5359C A893E696

blah

to compile the C programs, you might need to pass -std=gnu11. basically:

gcc -std=gnu11 -Wall -Ofast z64yaz0.c -o z64yaz0
gcc -std=gnu11 -Wall -Ofast z64crc.c -o z64crc

in the future, it'd be nice to only depend on LuaJIT to build ROMs.

cygwin's newline mangling will be the death of me.

Spreadsheets

some sheets have been put together to dump data in. some of them can be used to predict the result of glitches.

mm's People

Contributors

notwa avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

mm's Issues

cheat menu doesn't work in Bizhawk 2.4.0

this probably would've been an easy fix if it weren't for Bizhawk's useless stack traces (or lack thereof). i'm guessing, though, that the API for either text-rendering or input-polling has changed recently. or perhaps it just never worked with NLua.

i'm leaving this here so that people know that it isn't working, although these days, i'd instead recommend using something much more thorough and portable like the kz trainer.

inject.lua with OoT on BizHawk 2.3.0

Hey there. I would really like to get the actor spawn assembly inject to work on OoT NTSC 1.0, but I'm running into various issues. Using the scripts as is, I'm getting a:
NLua.Exceptions.LuaScriptException: ./lib/lips\Expression.lua:229: cannot assign undeclared global 'err'

while trying to load the inject.lua on the newest BizHawk release. I fixed that one by declaring the err variable locally instead. In the newest BizHawk release you can choose between 2 Lua cores, Lua and NLua. The NLua one produces an additional error, complaining about this pattern in line 158 in the Expression.lua file:
'$[0-9A-Fa-f]+'

I had to use the Lua core to get around it. Afterwards I hit an error from the Preproc.lua file complaining about the comment in line 28 in the spawn oot.asm. After removing that one it will finally execute. However in every BizHawk release post 1.13.1 (so starting with 2.0) this either only produces a garbled display where it normally shows the actor id or an immediate crash, which leads me to assume that the injection goes very wrong. On 1.13.1 and prior it works as expected.

I would love to use your actor spawn functionality in one of my projects where I don't wanna patch the ROM itself and using the newest BizHawk release for it would come in handy. I should note that the cheat menu.lua seems to work everywhere.

Thanks in advance if you look into it and have a good week :D

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.