• Welcome to Smashboards, the world's largest Super Smash Brothers community! Over 250,000 Smash Bros. fans from around the world have come to discuss these great games in over 19 million posts!

    You are currently viewing our boards as a visitor. Click here to sign up right now and start on your path in the Smash community!

Official Melee Code Manager (v4.4.1) - Easily Add Mods to Your Game!

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Do you like awesome custom codes? Do you like Melee? Do you like awesome custom codes in your Melee? Then this is the program for you!​

This is the best way to view, add, and/or remove all of your code based mods in Melee, and set up your game’s default gameplay settings (game mode, stock count, etc., so they all finally stay remembered after restarting the game!). Supports DOL mods (including injection mods) as well as Gecko codes. Everything is done in a very easy-to-use interface, which simply presents you with a list of available mods, and allows you to install or uninstall them from your game with just a single click.

Cool stuff for average users:
  • Easiest and fastest way to add code-based mods to your game
  • Use DOL mods instead of Gecko codes, to make your game run more efficiently
  • No need to understand hex editing or ASM coding
  • Easily adjust your game’s default settings (stock mode, items/stages, etc.)
  • Provides visual ‘fill-meters’ to show how much space is available for custom code
  • No need to extract/import the DOL from your game to update it
  • Eliminates the old problem of mods' custom code overlapping one another
  • Mod conflict detection feature identifies mods that may be incompatible with one another
  • Avoid dealing with Nintendont/DIOS MIOS Gecko/.GCT code loader problems
Cool stuff for developers:
  • Easily create and add injection mods without needing to calculate branches
  • Easily create and add static overwrites of any length
  • Large game projects can be much more modular and manageable
  • Automatic, efficient usage of available [user-defined] ‘free space’ used for custom code
  • Relocates all custom code after editing if it uses more or less space
  • Troubleshoot problems easier by quickly swapping out suspected mods
  • Can use RAM addresses for DOL mods instead of searching for DOL offsets
  • Easily convert Gecko codes to DOL mods using the above functionality
  • New "Custom Branch Syntaxes" for easily making function calls (info below)
  • Use "Standalone Functions" to reduce redundant code usage in the DOL
  • Automatically looks up DOL ‘original’ code when adding a new mod via the GUI
  • ASM to Hex converter and RAM Address to-from DOL Offset converter built-in
  • Plus more converters and other useful tools in the Tools tab

Take a look!

4.0 Mod Library tab.PNG


Dark green are mods that are currently installed, while light green are mods selected to be installed once you hit ‘Save’, and those in red are mods that will be uninstalled upon saving.

The ASM of injection mods is automatically aligned directly after one-another to optimize the DOL’s free space. If updates or changes are made to the mods, the locations in the DOL of their custom code will be adjusted accordingly the next time you save.

You can give this program a DOL file, or an entire ISO (disc image file).

4.0 Default Game Settings tab.PNG


4.0 Mod Construction.PNG


Before getting to the download, if this is your first time using this, please read the important info below first.

This will typically work best if you start using it with a fresh, unmodified DOL or ISO. If you already have codes installed in your game, that’s OK, it will automatically detect those too as long as they’re included in the “Mods Library”, which is the folder of text files that contains all of the mods. The Mods Library included in the download comes with many mods by default, and I will add more over time. However, if mods that you'd like to use aren't included (or if you'd like to create new ones), you can easily add them using the interface in the Mod Construction tab. More info and details on this can be found in the post below this one.

Codes in your game that are not added to the library may be overwritten when you use this program to modify your ISO. There are two simple solutions to this: 1) Add the code to the library as mentioned above, or 2) edit the “settings.py” file to ignore the DOL sections where those other, non-library codes reside (notes can be found in that file which go into more depth on how to do this). In any case, I recommend backing up your game just in case, or more specifically, your DOL file (the game's executable file that holds these codes), before using this program. There's a clearly visible button labeled "Export DOL", which you can use to do this easily. Also, if you need one, the download comes with copies of the original DOLs for each game version.

Note that because of the issues mentioned above, this won't work for versions of 20XX HP prior to v5.0. MCM didn't exist when Achilles first started 20XX, so the main problem is that a lot of the older versions of 20XX's changes are not included in any MCM library, and are just manually edited into the DOL independently. Thus, they're at risk of being overwritten when attempting to make changes. However, starting with 20XX v5.0, the entire code set has been collected into a complete Code Library, which you can find on the 20XX HP GitHub page.

Gecko Codes are supported, but cannot be copied/pasted into the library text files exactly as-is, and must be slightly modified from the format commonly seen in .gct files. You can look at a few examples in the library to compare. Or you can use the Mod Construction tab to input them, which will do this for you and save them to the library in the required format. Or you may convert them to DOL mods, which is a form that's more efficient for the game to run. Please see the post below this one on how to do this conversion. The Gecko codehandler used by MCM is from Dolphin build 5.0-11297. (Or, you may rename/remove the ./lib/codehandler.bin file and revert to using the older, simpler, modified version of the one posted and discussed here.)

Important note on making changes to mods: If you need to change the injection point that a mod uses or the location of a static overwrite, then you must first uninstall the mod from your game. This is necessary in order to prevent changes that are no longer used from the old version of the mod to be permanently included in your game. (Naturally, this is because if you change the places that a mod targets, the program has no reason to look at or modify code from the old areas.)

Custom debug menus can be used, but being able to use them to control other mods will depend on the method you’re using. Control that does not target the mod itself, such as setting a flag that the mod will independently use on its own, or working by only modifying the game’s code (e.g. toggling an injection mod’s branch back to the game’s original code, as long as you save/restore the branch) will work as normal. However, targeting the mod’s custom code with a normal branch will not work because its location is variable. Instead, you can target them as you would a standalone function. Check out the second post in ’Standalone Functions and Special Branch Syntaxes’ for details.

These programs take quite a bit of time. If you'd like to give back or show how much support there is out there for these, please consider donating!
You can do so via Paypal:
Or you can follow me on Patreon to support my main Melee projects.

Version 4.4.1:
- Fixed "settings.py" configurations not taking effect​
- The configuration file "settings.py" is now located in the "lib" folder​
- The Gecko "codehandler.bin" file is now located in the "bin" folder​
- Fixed disassembly of hex code with mixed-in special syntaxes​
- Fixed the "Info" button in Mod Constrution tab for mods with Standalone Functions​
- Fixed warnings of duplicate and differing u32.float/float.u32/log.timestamp SFs​
- Added 'Lagless FoD' and 'Boot to Match' codes​

Version 4.4:
- Support for alternate mod/library syntax: the ASM Mod Folder Structure (AMFS)*​
- New Mods Library Selection interface to easily swap between multiple library directories​
- New punkpc and general Melee-related PPC .include libraries, from Punkline​
- Improvements/fixes to the Mod Construction tab's undo history functionality​
- Directories for '.include' imports are now always given to the assembler**​
- Uses a new Gecko codehandler via the "codehandler.bin" file (from Dolphin build 5.0-11297)​
- Improvements to the ASM <-> Hex Converter window:​
- Fixed cases of giving incorrect line numbers for warnings/errors​
- Window resizing improved (now only the text entry fields change size)​
- Added a button to show assembly context for .include file imports​
- Added a label to display assembly times for performance testing​
- Warnings during assembly that contain no actual errors no longer block final assembly​
- Made some changes to add the crash printout code, "Enable OSReport Print on Crash":​
- The Tournament Mode Region has been partitioned into two parts (P1 and P2)​
- Default region for the Gecko codehandler is now "Tournament Mode Region, P1"​
- Crash printout code added to library, now that Aux Code Regions isn't needed​
- Aux Code Regions are now disabled by default​
- Crash printout code is always selected by default (can be disabled in settings.py)​
- Added an extra check during injection/SF code space allocations to ensure 4 byte alignment​
- Summary tab's "Mods Installed" now counts SF-only modules that had functions installed​
- Fixed a hang when selecting a Mods Library from a drive that no longer exists​
- Hitting Enter in the ISO/DOL field now loads that path instead of prompting for a file​
- YouTube is now an acceptable domain for mod 'web links'​
- The Debug Mode region is now disabled by default​
- Added a few more mods to the default Mods Library​
- Refactoring and code clean-up for GitHub repo​

*I'll probably be making a guide detailing the benefits and usage of this later.
**These are given via the -I argument. Previously, include directories were only included if a .include statement was found in the custom code.

Version 4.3 (64-bit):
- Added a feature for special branch syntax offsets; e.g. 'bl <GeckoCodehandler>+0xA4'​
- Fixed installation detection of mods that use a special branch syntax (broke in 4.2)​
- Mod Web Links feature added (GUI can link to a Smashboards thread and/or Git repo)​
- .imports now scan a hierarchy of directories as well as the executable root folder *​
- 'Create GCT File' was renamed to 'Create INI', which is what it was actually creating​
- Added a new 'Create GCT' feature, which creates a binary gecko codelist file​
- Improved checking/handling of Gecko codes in cases where Gecko codes are disabled​
- The 'View DOL Hex' feature now shows current program data instead of saved file data​
- Improved undo/redo history states and tracking in the Mod Construction tab​
- 'Import Gecko Code' feature (specifically for C2 codes) is no longer case-sensitive​
- The update button on the Mod Construction tab now works for Standalone Functions​
- Avoids loading custom code regions that are not compatible with the current DOL​
- Button added to choose a Mods Library folder when no Mod Library is found/chosen​
- The prompt to choose a Mods Library directory now defaults to closest existing folder​
- Hovering over the button to choose a Mods Library now shows the current library​
- Improved mod detection in cases where multiple regions cover some of the same area​
- Improved tab/scroll-position re-setting when re-scanning Mods Library​
- Eliminated redundant error messages from bad Gecko code imports​
- Fixed disassembly of unconditional branches (b, bl, ba, bla). Output normalized​
- Fixed an audio initialization error occurring when no audio driver is installed​
- Fixed an audio initialization error occurring after no Mod Library was found​
- Fixed character conversion in Menu Text to Hex feature for '耐' and '待' characters​
- Fixed a bug that could cause a Mods Library panel to temporarily appear on other tabs​
- The ASM <-> Hex Converter window's spawn position now always over the main window​
- Added 4 bytes to all revisions of 'Tournament Mode Region' ends (overwrites last blr)​
- Added around 40 mods to the default mods library​
- Small improvements to assembly/disassembly performance​
- Added support for [REDACTED. TOP-SECRET]. Edit: Declassified; it was for 20XX 5.0​

* The priority for .import directives is as follows:
1) The current working directory (this is usually the MCM root folder)​
2) Directory of the mod's code file (particularly useful if the mod has its own folder)​
3) The current Mods Library's ".include" directory (this is a new folder)​
4) The MCM root folder's ".include" directory (this is a new folder)​

Version 4.2 (64-bit | 32-bit):
-The Mods Library folder you're loading from can now be changed within the program​
- Added a new feature to the Mod Construction tab: "Import Gecko Code"​
- Now able to create a GCT file from selected mods​
- Improved error message reporting related to resolving special syntaxes​
- Can now Shift-Click 'Select All'/'Deselect All' buttons to apply to the entire library​
- Folders starting with . (such as ".git") are now excluded from Mods Library parsing​
- Last instruction of injection code no longer replaced if it ends with a special syntax​
- Modules consisting of only SFs are no longer detected as installed if they're not used​
- Additions to the ASM <-> HEX Converter:​
- Fixed disassembly of branch values (incorrect in v4.1.1)​
- Code length display​
- Scrollbars​
- Proper window resizing rather than a fixed size​
- Disassembly of '.word' is converted to '.long' for hex input that is 4 bytes long​
- Fixed some obscure bugs that could occur when parsing <<RAM>> symbols​
- Fixed resolving of multiple <<RAM>> syntaxes mixed with assembled hex code​
- Fixed usage of the assembly OR operator, '|', in custom code​
- Fixed 'check if writing to custom code regions' for mods written with RAM addresses​
- Fixed preservation of whitespace preceding comments during mod parsing​
- Drastically improved speed of folder-opening functions; e.g. 'Open Mods Library Folder'​
- Added '-d' command line argument for Debug Mode, to log debug/error messages​
- A good amount of refactoring, code clean-up, and small efficiency improvements​

Version 4.1.1:
- Updated the "Menu Text to Hex" tool, to include all Hiragana, Katagana, and Kanji characters​
- Greatly improved assembly performance (no longer using pyiiasmh to interface with EABI libraries)​
- Trying out disabling the linker during assembly (ba = 00000000); discuss. Might later re-enable​
- Added a new special syntax that can be used when writing codes, 'RAM symbols' (described in spoiler below)​
- Added a warning if any mods appear to be installed to disabled regions, with a prompt to enable them​
- Added a "Mod Search" button to the Mod Construction tab (same function as pressing CTRL-F) *​
- Comments on lines containing special branch syntaxes are now preserved​
- Fixed a performance regression regarding assembling unconditional branches that don't set any flags​
- Fixed a small GUI/highlighting related bug on the Item Switch window's "Item Frequency" dropdown​
- Improvements/additions to the Summary tab:​
- Added a context menu option to toggle whether it's sorting by offset (Advanced/Simple View) **​
- Added a context-menu option to toggle showing DOL Offsets or RAM Addresses​
- Added standalone function names to the Mods Summary tree when switched to Advanced View​
- 'View in...' features on a child item in the Mods Summary tree (in Simple View) now refers to parent item​
- 'View in...' features added to Standalone Functions tree when selecting a mod listing​
- Audio output simplified (moved from pygame to pyaudio)​
- Removed warning of audio problems if no audio driver/device is available​

* Used to search for Mods in your Mods Library by name. It was already previously available by pressing CTRL-F (since v4.0), but I figure it was mostly only known to those who noticed its introduction in the change logs, or by word of mouth.
** Switches between Simple View and Advanced View (Sorting by Offset) modes. Again, this feature previously existed (by clicking on the DOL Offset/RAM Address header), but was probably not widely known-about.

Version 4.0 ( 64-bit | 32-bit ):
- Support expanded to other GameCube and Wii games!*​
- Supports 20XXHP 4.07++**​
- The game's vanilla Debug Mode can now be used alongside Gecko codes​
- The Gecko codehandler and codelist can now be stored in user-defined regions***​
- Free-space code regions updated slightly:​
- Start area of Aux Code Regions changed to 0x407540 (NTSC 1.02)​
- Aux Code Regions end point moved to 0x4088B0​
- "20XXHP 4.07 Regions" added (do not use with other regions selected)​
- Conflict with CrazyHand resolved (via AuxCodeRegions end point change above)​
- Free Space indicator divided into two; one for standard codes, one for Gecko​
- Gecko codehandler and codelist wrapper excluded from free space indicators​
- Code Free Space Indicators show exact used and available free space on mouse-over​
- CMD windows no longer briefly appear during mod parsing or ASM assembly/disassembly​
- Finally completely revamped the Summary tab:​
- See each and every change done to the DOL, as well as their locations​
- See how much free space each mod or individual change uses​
- Left-click the DOL Offset header to sort changes in order of offset​
- Right-click the DOL Offset header to view locations as RAM Addresses​
- New features: "Create Installed Mods List", and "Install Mods List"​
- Convenient 'View DOL Hex' button added​
- Mod Search Feature! Press CTRL-F in Mods Library tab to search for mods by name​
- All hex inputs in the Tools tab now automatically remove spaces & line breaks​
- Mod Construction tab improvements:​
- The offsets shown can now be toggled between DOL Offsets or RAM Addresses​
- Undo/redo functionality added​
- Much more intelligent 'Unsaved' status detection​
- Fixed mods misunderstanding their installation status​
- Mouse-wheel scrolling over module list added​
- "New Hex" scroll position now preserved when switching between code change modules​
- GUI elements now properly fill space when expanding the window​
- Custom code length display added to static overwrites​
- Tools tab GUI elements now properly fill space when expanding the window​
- Code Offset Converter updated:​
- Now can also be used with RAM Addresses (outputs in same form as input)​
- Fixed an issue reducing quickSearch=False (option in settings) match effectiveness​
- The available input fields now based on the DOLs present in the Original DOLs folder​
- RAM Address Converter input fields now based on the DOLs in the Original DOLs folder​
- ToolTip module updated; fixes multi-monitor issues​
- Original DOL files no longer hash-checked before use (for hex restoration, etc.)​
- Code-Space Options button now brings the window to the front if it's already open​
- settings.py file changed. But MCM 4.x will still be backwards compatible with MCM 3.x files​
- Mod Library parsing features/improvements:​
- Folders/subfolders/files within the Mods Library that start with "!" are now ignored​
- Folders/subfolders/files starting with "+" are parsed exclusively (others ignored)​
- Pseudo-ops (assembly directives) can now be used within raw ASM code​
- empty lines (those with only line breaks) are now preserved in mod descriptions​
- Duplicate mod detection added. Previously could have caused problems when saving​
- Errors are now output to "Error Log.txt"​
- "Restore Original DOL" feature added (Reverts the currently loaded DOL to vanilla)​
- Region details tooltip added to total region size labels in Code-Space Options window​
- "Save As..." button now always available​
- Improved logic for installing SFs; should add stability for recursive SF calls​
- Fixed: Mods that share many SFs no longer need to be ordered in the Mods Library​
- Fixed cases of some injection mods not being detected as installed​
- Fixed branching to standalone functions from long static overwrites​
- Fixed an obscure case where a conflict being detected could break an installed mod​
- Other fixes and behavior improvements​
- Lots of logic improvements and code refactoring, so we'll still need some testing​
*To use MCM with other games, see the spoiler regarding that in the second post of this thread.
**Use the "20XX 4.07++ Codes.txt" file from the GitHub, but rename the Sheik/Zelda CPU Disable Transformations mods so that they're not seen as duplicates. You don't need to use the settings.py file from there; just use the 20XX Regions that comes with this new MCM version.
***Using the Tournament Mode Region for the codelist grants over 260% more space for Gecko codes!

Version 3.2 ( 64-bit | 32-bit ):
- New option: "Update Default Game Settings Only". Compatible with 20XX!​
- A new text to hex converter for Melee's unique menu texts in the Tools tab*
- Rumble options (per-player defaults) added to the Default Game Settings tab!​
- Simplified/cleaned-up default game settings code (now much easier to add more options)​
- Conflict detection feature now works between mods and the game's default game settings​
- Fixed a parsing bug for some long static overwrites created by the GUI​
- Fixed a bug stopping an automatic rescan of enabled codes after changing program options​
- Fixed installation false-positives occurring on some codes using static overwrites​
- Fixed the Code Offset Conversion input (was broken in just v3.1)​
- Improved some messages & dialog boxes to the user​
- 32-bit build also available!​

*The dictionary for this converter resides in the settings.py file, so you may modify it if you want to figure out more characters.

Version 3.1:
- Standalone function definitions can be shared across specific, or all, game versions​
- Standalone functions can now be the only thing in a mod; i.e. "Function Modules"​
- Scanning for mods is faster​
- Fixed an uncommon, odd GUI bug causing mods to render incorrectly​
- Fixed small bug on Mod Construction tab dealing with PAL code updates​
- Mods can now be filtered out from parsing by use of a '!' in first few lines (example)​
- Further mod organization, and new mods added to library (& a few duplicates removed)​
- Will now assume mods are disabled if a static overwrite occurs in reserved regions​
- Message for conflicting mod detection fixed to accurately report range ends​
- Minor aesthetic fixes (folder tab icon disappearances)​
- Fixed notes incorrectly stating that some gecko codes were unavailable​
- Tooltip message added to explain the update button in the Mod Construction tab​
- Summary tab now displays totals for how much space mods and standalone functions use​
- Pressing CTRL-s on the Mods Library or General Settings tab saves your codes to the DOL​
- Pressing CTRL-s on the Mod Construction tab saves the selected mod to your library​
- If a mod is saved to a new file, Library is rescanned to include it​
- "Open this File" button now works on empty Mods Library tabs​
- Better validation of "Offset" input field in Mod Construction tab code changes​
- The Share/Save functions will now attempt to retrieve missing Original Hex values​
- Scroll position and tab selection are now preserved when rescanning Mods Library​
- Now remembers last opened file type for the next time you want to open an ISO or DOL​
- Added a check for mods writing a static overwrite or injection point to regions used for custom code​
- much code cleanup, and testing, bringing this out of the 3.0 "beta"​

Version 3.0 (considered beta, since there are so many new changes):
- New nested tab interface for far-greater, user-customizable mod organization​
- Mods can now be stored in library as ASM rather than just hex​
- New "Mod Construction" tab, for better in-program mod editing and creation​
- Mod Construction tab supports viewing/editing ASM with notes/comments​
- Rewrote core code-saving logic to be more stable/concise/efficient​
- Catches and warns you about mods that conflict with (overwrite) one another​
- Rewrote checking for installed mods; should eliminate false-positives​
- Improved error checking when saving codes to a DOL/ISO​
- Improved support for Gecko codes (for 04 and C2 types)​
- Now remembers and defaults to the directory of the last file loaded​
- Processing/saving mods that include special branch syntaxes is much faster​
- Standalone Functions now only need to be included with one mod​
- Custom Branch Syntaxes can now be used with static overwrites​
- Fixed parsing bug where branching to 0x8 would be mistaken as a RAM address​
- Free space region ( 0x15CC, 0x1698 ) changted to ( 0x15F0, 0x1698 )​
- Regions for custom code are now defined differently in the settings.py file​
- More regions defined for injecting custom code (Tournament Mode, etc.)​
- Regions defined in settings.py now have separate toggles within the GUI​
- If new regions are added to settings.py, they will show up in GUI as well​
- Empty lines now usable in descriptions​
- Fixed (hopefully) all branch Hex -> ASM converter (disassembly) issues​
- Improved disassembly performance (speed)​
- Fixed a bug that caused ASM not aligned to 8 bytes to fail assembly​
- Now zeroes-out unused areas of the free space regions upon saving​
- New "Summary" tab, which shows mod totals and lists installed mods​
- Mods parser now picks up comments preceded with "#" in descriptions, etc.​
- "##" now used in Mods Library files to exclude comments from the parser​
- "Save As..." button/functionality added​
- Progress indication added for save operations​
- Can now just hit 'Enter' in the "ISO / DOL" text field to load that file​
- Fixed 'Hitbox Displays Do Not Interpolate' (had bad formatting in library)​
- Gecko codehandler moved to the settings.py file, for user modifications​
- Better behavior on Gecko codes use (warns about overwriting required regions)​
- New option to ignore hash-check on hex restoration (vanillaDolSafetyOverride)​
- Fixed alignment for injection code saved directly after the Gecko codehandler​
- Removed Herobrine​

Version 2.1 (x64 | (x86):
- 32-bit build now available!​
- Fixed a parsing bug that would occur with mods that use several standalone functions​
- Fixed ASM compiling bug relating to using standalone functions with custom branch syntaxes​
- Added measures to prevent enabled/disabled mods with the same injection points from conflicting​
- Scrollwheel support!​
- Added 'CTRL-A' (Select All) support for text entry fields​
- Slightly improved ASM > Hex conversion efficiency​
- Number Conversion Tool: 'L' character removed from negative 32-bit floats​
- Font size now adapts to user's system's font size setting (tested on Win7)​
- Increasing/decreasing font size is now an option in the settings file​

Version 2.0 (from the original release of this program):
- Added support for standalone functions (can be shared by multiple mods)​
- New convenient calling/branching syntax for functions (e.g. "bl 0x800948a8")​
- The 'Offset' value can now optionally be given as a RAM address instead​
- Program renamed, from "DRGN's DOL Manager" to "Melee Code Manager"​
- Can now add/remove & manage Gecko codes in the DOL (thx to R&D by Dan Salvato)​
- Added the Tools tab with the following tools:​
- Interface to easily add new codes to the library (formats them for you)​
- Can add new codes in the form of assembly without needing to convert first​
- ASM <-> Hex Converter (available separately from the above functionality)​
- Number converter, RAM address converter, and code offset converter​
- Text to Hex (ASCII) converter​
- Drag-and-drop now works with the program icon (previously only available on GUI)​
- Before overwriting/changing a game's DOL, now asks if you'd like to back it up​
- Now uses '#' rather than '*' for comments in Mods Library (the code text files)​
- Fixed an alignment problem occurring with free space in non-v1.02 game versions​
- Better error handling in case of a problem while applying a mod to a game​
- Better parsing of mods library (attempts to explain errors if encountered)​
- New, more convenient syntax for long static overwrites (and can be any length)​
- Recognizes .GCM files now rather than .GCN :p
- Fixed the audio causing a crash when no audio drivers were detected​
- Increased custom code free space by 0xF64 (thx to R&D by achilles)​
- Free space regions exposed to user via settings file (can set to ignore regions)​
- Injection Mods show how much space they use (by byte; separate from the meter)​
- Reorganized the mods in the text files by their purpose​
- Converted a lot of Gecko codes to DOL mods and added them to the library​

In the future, I don't see why a program couldn't use packs (even could be a standard zip) that include any combination of game files, textures, audio, and/or ASM. For example, the 'Debug Menu Replaces Tournament Mode' combined with the graphics for it, or a mod pack for a stage, where you might need the stage file as well as a few code changes separate from it, and perhaps music. There could be a program that could install all parts of it, as one unit, directly to your ISO in one step. Adding a custom debug menu builder to this would also likely be possible.

- - -​

Shout-outs and special thanks to @ Achilles1515 Achilles1515 and Michael Ashby Michael Ashby for their support!

And also thanks to @shuall, @_glook, @Jorgasms, @SinsOfApathy, and others, who each stopped their busy hacking to answer questions or give suggestions during my initial design stages. And to @Punkline, for lots of testing/bug reporting/documenting and other feedback.
I plan to put this on Github at some point, but feel free to PM me for the source code for now.
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
All of the game mods are kept in a set of text files in the “Mods Library” folder that comes with the download. You can have any number of text files in this folder, or if you wanted, you could have all of your mods in just one file. Each text file that you create in the Mods Library folder will appear as its own tab within the program. It will also accept nested folders (as seen and explained a bit more here). If you'd like to add to the public library distribution, you can find and submit pull requests to the repository below:


Be sure that you've tested any codes before submitting them, and please try to avoid adding duplicates. (Note that you can press CTRL-F when on the Mods Library tab, which will bring up a search feature.)

Below is some more advanced documentation on the program, if you find yourself wanting to do more.
Let me know if anything is unclear or if you have any questions!

-- Replace the DOL files in the "Original DOLs" folder with vanilla DOLs for whatever game you want to work on (one for each revision you want to work on). These original DOLs are used by the program to reference original game code, and are required for various functions, such as region restoration (e.g. for some mod uninstallations), and pulling original code when creating new mods. Follow the same naming convention as you see for the default files that come with this program.

-- Define what code regions in the DOL are OK for the program to use (overwrite) for custom code in the settings.py file (found in the "lib" folder). You can open that file in a standard text editor, and you should be able to see the format they're expected to be in. Learning what areas are safe to overwrite in a DOL varies by game. You might be able to find this information on other forums dedicated to the game, or by looking at other codes/mods written for it. If the codes you want to apply are only static overwrites, you don't need to define any. However, all other kinds of mod require some free space. Know that any region(s) that you have selected in the "Code-Space Options" window will be zeroed out before saving codes. So be sure to uncheck any that are not meant for the game or DOL that you're working on.

-- Add your mods for that game to the Mods Library folder. If you have mods for a different game in there, they will most likely simply be detected as uninstalled for the game you're working on, but this is not guaranteed (you could test this for your case, or just remove all other mods just in case). Here are some useful tips on working with the Mods Library:
- Adding a "!" at the start of a folder or file name will cause it to be ignored by the program.​
- Adding a "+" at the start will have it processed exclusively (all other files/folders will be ignored).​
- Use the default library that comes with the program as an example; you'll notice that each file will appear in the program as its own tab, and that folders can also be added (recursively!).​

I'll most likely be adding more details to this section; so let me know what's unclear or needs more explanation.
All mods that load up in the program are stored in text files, contained within the "Mods Library" folder. Each text file can have any number of mods, and will load as its own tab in the program. Subfolders can also be added, so you can organize your own mods in any way you wish. The spoiler below this one, "Adding New Mods Manually", explains the format that mods are written in. However, to make things easier and prevent simple errors, the Mod Construction tab in the program offers a full UI you can use to handle writing this formatting for you. Head to that tab and click on the button titled ‘Add New Mod to Library’. This will create a new mod where you can add any number of static overwrites, injection mods, and/or standalone functions that you’d like. This also has a few built-in features for added convenience. The only field that’s really mandatory here, besides some number of code changes, is the title. Including the author is encouraged of course, and a description is nice if the title isn’t completely self-explanatory.

One of the really nice features here is that for “Offset”, instead of the DOL file offset, you may optionally use the actual RAM address instead. You just need to write it with the preceding “80” part included (e.g. “80054321” or “0x80054321”). This also works if you’re writing the mod directly into the library’s text files yourself, as the conversion is done during parsing. Another feature is present when adding injection mods: once you’ve filled in the “Offset” field, you’ll notice that the “Original Hex at Injection Site” field will automatically be filled in for you. This also works with static overwrites, however for them, there must be input in both the "Offset" and “New Hex” fields. Then press the refresh button (small button with a green arrow) to update the byte count and auto-fill the Original Hex field. This is because static overwrites can be any length, and so it needs to know how many bytes to count for the original hex.

Code in the "New Hex" fields can be raw hex code or assembly. If it's assembly, it will automatically be compiled any time you save the mod to your game. However, it's also necessary to compile when parsing the library (when opening the program or re-scanning for mods), which can take a while if there are many codes saved in the library in assembly form. So I recommend keeping it as assembly while you're working on it, and then converting it to hex when it's finished. However, comments are allowed, by preceding them with a '#', so you could always store the code in both forms, with one of them commented out.

You may want to hit the "Share Mod" button before submitting, which shows you what will be generated, and allows you to make sure that the code compiles correctly. It also allows you to easily come here and share the mod on the boards if you’d like. And then of course you have the ‘Submit Mod’ button, which will save the mod to a text file of your choice in the Mods Library.
If you copy a mod from somewhere and would like to add it to your Mods Library, or want to write a new one without the Add New Mod interface, you can manually add it to one of the text files in the Mods Library folder.

The format is fairly simple, and most apparent by just looking at existing examples, but you’ll find some not so obvious details here. The first thing to notice is that mods are all separated from one another by a “-==-” string; this isn’t simply cosmetic, it’s what the program uses to tell individual mods apart from one another (lines, indents, or spaces before/after it do not matter). Next, you have the header, which starts with the title, followed by any number of lines for a description, then the author enclosed in [] brackets. e.g.:

Code:
Extended Name Entry
English alphabet name tags can be up to 8 characters in length.
Press X Button to shift between upper and lowercase characters.
[Dan Salvato]
Title is mandatory. Including the author is encouraged of course, and a description is nice if the title isn’t completely self-explanatory, but is completely optional. However, the brackets for the author must be written, even if all they include is “??”, or something else in cases where you don’t know the author.

An optional feature, that follows the description, is the addition of web links. You can add URLs in angle brackets (like as commonly used in Discord), like so:
Code:
Invisible ceiling glitch fix
<https://smashboards.com/threads/bug-fixes.471624/post-22930938>
[tauKhan]
These will automatically show up in the GUI as clickable buttons on the mod:
1661995756346.png

You can add as many web links/buttons to a mod as you like (each in their own set of brackets), but to prevent any malicious use, the domains are currently restricted to SmashBoards, GitHub, and YouTube.

Following those I typically have this line:
Code:
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
This is the only line that’s fully cosmetic, provided for readability for those looking through these codes in the text files; it’s ignored by the program’s parser, so you don’t need to include it if you don’t want to.

Next, we get to the mod’s code changes. There can be any number of static overwrites, injection mods, or “standalone” functions (and can come in any order). Static overwrites are the kind of mod that simply change one or more bytes from one set to another (i.e. no branches or anything fancy like that). The change can be any length, and can be written like this, for short ones:

Code:
NTSC 1.02 ----- 0x8023cdd4 --- 7C7E01AE -> 7c7e032e
or, for long overwrites, like this:

Code:
NTSC 1.02 ----- 0x804d4d90 ---

82690000 82730000
82580000 81440000
82680000 82720000
82570000 81900000
82670000 82710000
82560000 81950000
82660000 82700000

->

4a000000 54000000
39000000 2e000000
49000000 53000000
38000000 81900000
48000000 52000000
37000000 81950000
47000000 51000000
The first line starts with the game revision (region and game version) that the following changes will be for. This is followed by the offset in the file for where to make the change (or RAM address instead as you see here), then the game's original hex is the next bit, followed by an arrow and the new custom code.

Even in the first 1-liner example, you’re not limited to just 4 bytes. The number of bytes, and the line, could be as long as you want. However, the second format is convenient to help with readability in the text files.

Also, you can add comments/notes anywhere in the text files by using a “#”. Anything after it on that line will not be read. For example:

Code:
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
1.00 ------ 0x125818 ---- 901F2230 -> 60000000 # (stw r0,8752(r31) -> nop) this is commented out
1.01 ------ 0x125BC8 ---- 901F2230 -> 60000000 # (stw r0,8752(r31) -> nop)
# This is a comment, which will not be read by the program.
# Check out the line below! It’s cool, isn’t it?!
1.02 ------ 0x125EA4 ---- 901F2230 -> 60000000 # (stw r0,8752(r31) -> nop)
PAL ------- 0x126648 ---- 901F2230 -> 60000000 # (stw r0,8752(r31) -> nop)
Comments of this kind that are near code changes like above will still appear in the "New Hex" field when you're viewing the mod in the Mod Construction tab. To completely hide things so that they only exist in the text file, you can use '##' to comment it out.

Next up, Injection Mods. These branch out of the game's normal execution to go to and run your custom code. They follow this form:

Code:
PAL ------ 0x80136CB4 --- 94650008 -> Branch

3DC0FF00 61CEFFFF
7C007000 40820060
39E5E181 89EF0000
2C0F0001 40820010
3C60FF00 6063BE0C
3C001900 2C0F0002
40820010 3C60FF00
60638DD5 3C002E00
2C0F0003 40820010
3C60FF00 6063F7E1
3C008300 2C0F0004
40820010 3C60FF00
60637D77 3C00C800
6000FFFF 94650008
60000000 48000000
You might be wondering about that branch back at the end. Well, as long as the opcode for that last instruction is 48, 49, 4A, 4B, or 00, then that instruction will simply be replaced with a branch that goes directly back to after the injection site that you defined (i.e. the code offset, or 0x80136CB8 in the case above).

Note that “lines” are usually considered to be 8 bytes. But these long sections of code are later just combined by MCM, so there’s nothing really special about the line breaks or spaces. Meaning that to save space (and scrolling) you could also write the above example with more hex per line if you’d like, like so:

Code:
PAL ------ 0x80136CB4 --- 94650008 -> Branch

3DC0FF00 61CEFFFF 7C007000 40820060 39E5E181 89EF0000
2C0F0001 40820010 3C60FF00 6063BE0C 3C001900 2C0F0002
40820010 3C60FF00 60638DD5 3C002E00 2C0F0003 40820010
3C60FF00 6063F7E1 3C008300 2C0F0004 40820010 3C60FF00
60637D77 3C00C800 6000FFFF 94650008 60000000 48000000
This is true for the hex in long static overwrites too.


Finally, you can add standalone functions like so:

Code:
<nameOfFunction>
01234567 01234567 # Gibberish example code
01234567 01234567
01234567 01234567
01234567 01234567
For an explanation of standalone code and how it’s used, see the section below, “Standalone Functions and Special Branch Syntaxes”.
Unlike Injection Mods, which automatically return to the code's injection site, Standalone Functions will not end by branching back to a specific place, so their code can be easily accessed and shared by multiple mods. These can be blocks of code functions or tables of raw data that you want to store in the DOL and later reference. This avoids having to hardcode RAM addresses for the code or having to add it to the DOL multiple times for/alongside each mod that requires it. This can add up to saving quite a bit of space in the DOL, especially as mods continue to become more numerous and complex.

Here’s an example:

Code:
Title of Mod
Description Text! This mod does nothing!
[DRGN]
Revision ---- DOL Offset ---- Hex to Replace ---------- ASM Code -
1.02 ------ 0x28059C ---- 7C0802A6 -> Branch

01234567 01234567 # Do stuff
01234567 01234567
01234567 01234567
bl <yourFunction> # branches to the "yourFunction" code block
01234567
01234567 01234567
01234567 01234567
01234567 48000000

1.02 ------ 0x66f40 ---- 7C0802A6 -> Branch

01234567 01234567 # More gibberish example code
01234567 01234567
01234567 00000000

<yourFunction>
3DC0FF00 61CEFFFF 7C007000 40820060 39E5E181 89EF0000
2C0F0001 40820010 3C60FF00 6063BE0C 3C001900 2C0F0002
3DC0FF00 61CEFFFF 7C007000 40820060 39E5E181 89EF0000
2C0F0001 40820010 3C60FF00 6063BE0C 3C001900 2C0F0002
40820010 3C60FF00 60638DD5 3C002E00 2C0F0003 40820010
3C60FF00 6063F7E1 3C008300 2C0F0004 40820010 3C60FF00
60637D77 3C00C800 6000FFFF 94650008 60000000 48000000
Now, any number of other installed mods that want to use yourFunction (you can name these as you like, just avoid special characters) could be added to the game, and yet the yourFunction block of code will always be added to the DOL just once. (You can check the exact location where anything is changed or added to the DOL, including SFs, in the Summary tab).


There is also another special branch syntax that you can use, which allows you to go directly to any place in RAM, such as to one of the game's vanilla functions. For example:

Code:
7C0802A6 90010008
9421FFF0 7FE4FB78
7FC3F378
bl 0x800948A8
38210010 80010008
7C0803A6 4E800020
This branches right to the game's standard function for giving an item to a player. When using this, you don't even need to first update the link register. So you could replace all of these commands in your usual code:

Code:
lis r4,0x8009
ori r4,r4,0x48a8
mtlr r4
blrl
with just "bl 0x800948a8".

These special branching syntaxes (whether using a <name> for your own functions, or RAM address for native game functions) should compile for any branch commands that use a target. But of course, it will only work for things that would logically work in the first place. For example, "b <nameOfFunction>" (note that that's not bl) will successfully create a branch to the custom function, but remember that there is no branch-back automatically included at the end of standalone functions, so in most cases, this wouldn't make much sense as the function wouldn't know where to return to (unless you write it to always go to the same place, regardless of what called it).

You can find some real-world examples of these in a few mods by @Punkline:
You can also very easily define different standalone functions to be used for specific versions of the game. For example:

<Func1> NTSC 1.02​
[some code]​
or​

<Func1> PAL 1.00​
[some variation of the code for PAL]​

While in your code you would still be calling the same function, and you don't need to specify which variation to use; for example, "bl <Func1>" is all that would need to be in your code. The appropriate function will be selected for that game version during mod(s) installation.
This feature takes further advantage of Standalone Functions. SFs are assigned to addresses in RAM which are dynamically determined (i.e. they can change) when MCM installs mods and saves ASM/Hex to the DOL. (You can also always look at the Summary tab if you'd like to know where a particular piece of data was stored.) So this pointer symbol syntax allows you to use a symbol (basically a variable name), in this case, a standalone function's name, in place of that dynamic RAM address.

So, for example, you could write:

.long <<functionName>>​
lis r0, <<functionName>>@h​
ori r31, r0, <<functionName>>@l​

which would become (assuming a function located at 0x80123456):

.long 0x80123456​
lis r0, 0x80123456@h​
ori r31, r0, 0x80123456@l​

And would then assemble as usual to:

80123456 3C008012​
601F3456​
The explanation below explains converting a Gecko code to a DOL mod, such as what you would find in one of MCM's Mod Library text files. However, this will allow you to understand how you can convert going the other way too, from DOL mod to Gecko code.

Most often, you’ll just need to be able to identify static overwrite (04 type codes), and injection mod (C2 type) portions within the code.

Here’s an example:

CSS Hands Default to HMN Button (with bug fixes) (1.02) [achilles]
044DC47C C0200000
C2261A6C 00000005
89FF0005 2C0F0002
40820014 3DE08026
61EF1B6C 7DE903A6
4E800420 1C130024
60000000 00000000

Here, you first have a 04 type (a static overwrite), which targets RAM address 0x804DC47C. To elaborate, the first two characters are called the OpCode (short for operation code), and the following 6 characters are an address relative to the base RAM address that is being used to run the game, which is 0x80000000. The 4 bytes of hex that follows this, C0200000, will replace whatever code is in RAM at that address. For some cases this may not be possible, particularly if the RAM address that needs to be changed does not exist in the DOL. For that, an injection would need to be written to make the change instead.

Next, you have the C2 code type, which is basically just a wrapper for a standard injection mod. What this means is that it runs a certain snippet of code when the game's code execution reaches a specific point. (This is one reason why standard injection mods are more efficient than Gecko codes: because you don't have all of this extra overhead, including the Gecko codehandler, in order to run the same bit of code.) Removing the opcode characters, "C2", and adding the base address of 0x80000000, we see that the injection point for this code is the RAM address 0x80261A6C. The number in the next 4 bytes, 5 in this case, is the number of lines this applies to, which is the rest of the code lines in this case. (Keep in mind that this is in hex! So if you see something like 10, for example, that's actually 16 lines.) With this info you can easily create a mod in the "Mod Construction" tab of MCM, which will write out the rest of the syntax for you; just plug in the values from the code above to get this:


Adding a New Mod.PNG

The small button with the green arrow primarily does two things: for static overwrites, once an offset and new code values are given, you can use it to look up the 'original hex' value for you; and for injection mods, you can use it to look up the 'original hex' as well as update the byte count (the "(0x__ bytes)" label), which displays how long the injection code is.

The Share button toward the top of the mod will open a window that allows you to preview and/or copy the text that will be generated for this mod. The Info button next to it shows extra details on the mod.

There are some other code types you might run into out there. Many should be able to be transitioned into some combination of static overwrites and injection mods (keep in mind that static overwrites can be any length). Here's some documentation on them that may help you to convert other types:

Gecko Codetype Documentation - Full list of the opcodes and commands/features of Gecko code​
WiiBrew Assembler Tutorial - Information about the standard assembly instruction set​
Assembly Guides, Resources, & Q/A - Our thread on more general resources​

If you need help, feel free to post.
 
Last edited:

TerryJ

Smash Journeyman
Joined
Apr 12, 2010
Messages
488
Location
BEST COAST, WA
NNID
1337-1337-1337
3DS FC
1337-1337-1337
This whole thread is intense. And your post count is 1337. Well done.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Woke up from a thunderstorm and saw this post. Big smile on my face. Back to sleep soundly now.

I plan on trying this out tomorrow with some "loose end" codes for 20XX 4.0 and only configuring it to use some experimental space I just freed up by deleting vanilla tournament mode code (about 0xA000 in length). You're truly a wizard, DRGN. Thanks for all you do.
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Yo, I tried adding Dan Salvatos new rumble code using this to the BEAST dol, I can get one part of it to work but it ends up replacing part of @ Achilles1515 Achilles1515 costume replacement code as well as the boot to CSS code (game starts at the opening movie).

The way I went about to add the code was editing the Gecko Codes.txt and adding this to the end of the file.
Dpad up/down toggles rumble on CSS
[Dan Salvato]
1.02
C22608D8 00000019
887F0007 2C030000
40820070 7C972378
57800739 40820010
5780077B 40820034
4800009C 7EE3BB78
38800000 38A0000E
38C00000 38ED9950
3D808037 618C8430
7D8903A6 4E800421
38800001 48000008
38800000 7EE3BB78
3D808015 618CED4C
7D8903A6 4E800421
38800001 989F0007
3C80C040 909F0014
C03F0014 C0428E0C
C01F000C EC01002A
D01F000C FC600850
FC030840 41810008
EC6300B2 D07F0014
4180001C C0828258
FC032040 41810010
38800000 909F0014
989F0007 889F0004
60000000 00000000

-==-

Rumble when character is selected
[Dan Salvato]
1.02
C2260C3C 00000008
7E639B78 800D8840
7C801A14 88841CC0
2C040000 41820024
38800000 38A0000E
38C00000 38ED9950
3D808037 618C8430
7D8903A6 4E800421
880DB655 00000000
C2260A58 00000008
7E639B78 800D8840
7C801A14 88841CC0
2C040000 41820024
38800000 38A0000E
38C00000 38ED9950
3D808037 618C8430
7D8903A6 4E800421
38000005 00000000

-==-

Ignore Nametag Rumble Setting
[Dan Salvato]
1.02
04167810 60000000


I can get the first one to work, but like I said it replaces part of some other features I have and the middle one just crashes the game whilst the last one doesn't seem to work.

The Boot CSS on startup code still shows up as "added" in the manager, but doesn't work in-game. The alt. costume code isn't in the .txts at all, so I'm guessing the reason why it's partly overwritten?

I also don't get why the last two codes don't work while the first one does, any suggestions? :p
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Yeah, like I said, the Gecko Codes implementation is still experimental. You'll likely need to convert those to DOL mods, which is much easier now using the helper built-in to this program. Check out the spoilers 'Adding New Mods' and 'Converting Gecko Codes' in the second post.

At quick glance, those should be pretty easy to convert. But let me know if you have any problems and I can convert them later today. And if you convert any codes, please add them to the Mods Library files in the second post so others can copy/paste them to use too. :)
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Loving this, but for me the scroll wheel doesn't scroll.
That's not a bug or anything, but because I actually haven't added that functionality. The tkinter GUI framework is pretty low-level, so that sort of stuff has to be hooked up manually (I even need to hook up CTRL-A/"select all" for text fields, which I know how to do, but haven't done for this yet).

It's probably not that difficult, but I haven't looked to see how to incorporate the scroll wheel yet. I've added it to my todo list for the next version though. The other thing that will help a lot is reorganizing the tabs. Instead of having 'Static Overwrite' & 'Injection Mods', I think it should have tabs like 'Character Mods', 'Stage Mods', 'CSS', etc. There could be sub-tabs in those too for more organization.
 
D

Deleted member

Guest
Keep up the good work. This is a god send for casual modders like myself. Very much appreciated! :kirbymelee:
 

xXadevs2000Xx

Smash Apprentice
Joined
Oct 3, 2015
Messages
122
Can I ask, is there any dol mod or anything similar that removes the extended grapple with Samus or her ability to bomb jump after grapple in midair? (I know these are from PAL, that's the point)
 

Aerros11

Smash Journeyman
Joined
Sep 5, 2009
Messages
284
This is kind of a hidden gem for new modders. Had to refer two dudes already to this thread. Should be a staple on the 1st page.

Bump
 
Last edited:

Aerros11

Smash Journeyman
Joined
Sep 5, 2009
Messages
284
[FEEDBACK]

DRGN DRGN , I've added a few new codes to the downloaded mods folder on my PC. However, I first like to test the codes to see if they work before wanting to "Share Mod". But by the time I'm done testing the code, the "Share Mod" option is long gone because I end up closing out the sole window that allows this. So what I'm saying is that I think there should be a share mod button next to the "(details)" button >....>'|l
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
[FEEDBACK]

DRGN DRGN , I've added a few new codes to the downloaded mods folder on my PC. However, I first like to test the codes to see if they work before wanting to "Share Mod". But by the time I'm done testing the code, the "Share Mod" option is long gone because I end up closing out the sole window that allows this. So what I'm saying is that I think there should be a share mod button next to the "(details)" button >....>'|l
Yeah. Makes sense. I first used that "Share Mod" feature as a quick way to test the New Mod form while working on it, but also thought it might be useful to users, so I left it in as a feature. I also thought about a button on the main mods lists to edit mods, so you don't have to look through the mods library to find and edit the code there. Something like that could also double as a Share Mod feature. I'm not sure about the placement for the button though, since the 'Pending Save/Removal' text shows up next to the "(details)" button. Might be kinda cramped to put another button there, but I could try it.


Doq Doq Achilles1515 Achilles1515 @flieskiller, or anyone else that feels like adding their input,

Do you guys have any thoughts on going forward with ASM Mods, considering the possibility of having some kind of universal mod library and implementation system, like MCM, but for all mod types (textures, ASM, music, file replacements, etc.), or Projekt Neko? I ask because for something like that to work, collaboration would be needed to standardize the submitting/archiving of mods.
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
Yo, I think MCM may be responsible for making my game crash when hovering over GnW's icon in Teams (Occured when adding Dan Salvatos Rumble d-pad code). My friend also got a random crash when using some attack with Mewtwo (don't remember which), which wasn't in the gecko code he implemented. It also didn't occur when converting it manually.

Any idea on what's poppin' DRGN DRGN ? :p
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
What? My program? A bug? Blasphemy!

lol, j/k. It might be that you have more than one mod using the same injection point. In many cases (i.e. simpler mods that only use one injection point) that probably wouldn't cause a crash on its own (essentially, simply one of the mods just wouldn't work), but if you have a mod with multiple injections and some parts of it are overridden by another mod, then you would have problems. If you find this is the case, you could change one of the mods to use different injection points. Although you kinda need to know what you're doing with that, because they can't go just anywhere. Another explanation of course could be that the mod itself has a problem. It's even possible a mod can put the game into a state where, although it doesn't crash, it changes something so that later when you try to do something specific (that finally deals with the change made earlier), it crashes.

Best way to test if it's a particular mod that has a problem is to put the single mod into an unmodified copy of the game and see if everything works right. Of if you have two mods you suspect might be conflicting, you could take an unmodified copy and put in only those two. There are certainly many variations of some mods, and that can even cause MCM to be confused sometimes if you have all of those variations in the library, while maybe only one of them is actually enabled. So that's something else you could look out for. I forgot, I had a idea I was going to try implementing to reduce the chances of that from happening, but I haven't gotten around to it because of other projects. I could also add the ability for the program to keep track of what injection points are used.

Because the same functions are used to "install/uninstall" all mods, and those functions are successful for [as far as I can tell] all other mods, then when starting to troubleshoot I lean towards problems being with the mods themselves, or with something like an injection point conflict mentioned above.

I didn't do ASM or DOL for PN because MCM exists.

dat clarification
Yeah. I feared that might've been kinda confusing. What I meant is this: We have thoughts of a program that can install/uninstall any mod, beyond just ASM mods, right? Like character costumes, stages, menus, etc. It could then also do "packages", which would cover many aspects of a mod or some other thing together, such as a stage + music, or the "Debug Mode replaces Tournament Mode" ASM + its respective graphical change in the menu. If we have a library of all mods, the program could browse them and show all the mods to a user through a nice, easy to use interface, with descriptions/previews/credits even. However, for that to work, we'd need a standardized format for mods to be in, right? So I have two questions atm.

1) Would the prospect of this generate enough motivation for archivers to overcome the colossal collection & standardization undertaking? i.e. would people actually do that?

2) If the answer to 1 is yes, then what format should things, like the ASM, be in? For ASM, I of course propose the format MCM uses, because that was the best (most succinct, easy to read for humans, easy to parse) solution I could come up with. But we'd also need to consider standard formats for everything else too, for the program to be able to easily read it all.
 
Last edited:

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Yo, I think MCM may be responsible for making my game crash when hovering over GnW's icon in Teams (Occured when adding Dan Salvatos Rumble d-pad code). My friend also got a random crash when using some attack with Mewtwo (don't remember which), which wasn't in the gecko code he implemented. It also didn't occur when converting it manually.

Any idea on what's poppin' DRGN DRGN ? :p
If you're still using that alt costume code from like...January, then that is probably the problem. (GnW issue).
 

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
If you're still using that alt costume code from like...January, then that is probably the problem. (GnW issue).
I'm pretty sure the crash doesn't occur on older versions, only seen it happen after using the MCM. What updates have you made to the costume code since last time btw?

Also, DRGN DRGN I'll test around and see if I can replicate it on a vanilla build.
 

Aerros11

Smash Journeyman
Joined
Sep 5, 2009
Messages
284
I'm pretty sure the crash doesn't occur on older versions, only seen it happen after using the MCM. What updates have you made to the costume code since last time btw?

Also, DRGN DRGN I'll test around and see if I can replicate it on a vanilla build.
You should list what mods you have active..
Also, state which smash version you're using (1.00-1.02?)
 
Last edited:

Doq

Smash Lord
Joined
Dec 28, 2012
Messages
1,037
Location
The Lab, Sweet Home, OR
Yeah. I feared that might've been kinda confusing. What I meant is this: We have thoughts of a program that can install/uninstall any mod, beyond just ASM mods, right? Like character costumes, stages, menus, etc. It could then also do "packages", which would cover many aspects of a mod or some other thing together, such as a stage + music, or the "Debug Mode replaces Tournament Mode" ASM + its respective graphical change in the menu. If we have a library of all mods, the program could browse them and show all the mods to a user through a nice, easy to use interface, with descriptions/previews/credits even. However, for that to work, we'd need a standardized format for mods to be in, right? So I have two questions atm.

1) Would the prospect of this generate enough motivation for archivers to overcome the colossal collection & standardization undertaking? i.e. would people actually do that?

2) If the answer to 1 is yes, then what format should things, like the ASM, be in? For ASM, I of course propose the format MCM uses, because that was the best (most succinct, easy to read for humans, easy to parse) solution I could come up with. But we'd also need to consider standard formats for everything else too, for the program to be able to easily read it all.
1. With PN I was just going to grab every file in existence and upload it to my server on http://meleelib.refugesmash.ml/
The only issue arising from that is that anything that looks suspicious gets 403'd, and then implement an upload form for modders.

2. ASM is weird, because it's modifying a file. For everything else that is raw file replacement I'd go with the above.
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Will this work for PAL, or is there some kind of converter for NTSC codes to convert to PAL?
The program supports PAL, but it's still up to the individual mods for whether they're each written for PAL. If you look at the screenshots in the OP, you'll see to the bottom-left of each mod it says "Available for" followed by the game versions that the mod has been made for. Most mods and development is for v1.02 (NTSC).

It is possible to convert them, but it takes some understanding of the codes, so you might need to do some research. Most often, the only thing that's different between codes for different versions is the offset for the injection point. The injection point is where a branch command is added to the game to leave the game's normal code and begin executing custom code that is placed elsewhere. So if an injection point for a mod is at offset 0x0123 in a v1.02 DOL, you need to find the equivalent offset for a PAL DOL. There is a tool to help with this exact thing on the Tools tab, where it says "Code Offset Conversion".
 
Last edited:

Benny P

Smash Journeyman
Joined
Dec 10, 2014
Messages
465
Location
Coming Soon
The program supports PAL, but it's still up to the individual mods for whether they're each written for PAL. If you look at the screenshots in the OP, you'll see to the bottom-left of each mod it says "Available for" followed by the game versions that the mod has been made for. Most mods and development is for v1.02 (NTSC).

It is possible to convert them, but it takes some understanding of the codes, so you might need to do some research. Most often, the only thing that's different between codes for different versions is the offset for the injection point. The injection point is where a branch command is added to the game to leave the game's normal code and begin executing custom code that is placed elsewhere. So if an injection point for a mod is at offset 0x0123 in a v1.02 DOL, you need to find the equivalent offset for a PAL DOL. There is a tool to help with this exact thing on the Tools tab, where it says "Code Offset Conversion".

If you dont mind me asking, could i request the "Losing animation win pose" as a PAL code? I'm really bad at melee hacking, at most have replaced mostly character skins, so im not very good
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
If you dont mind me asking, could i request the "Losing animation win pose" as a PAL code? I'm really bad at melee hacking, at most have replaced mostly character skins, so im not very good
Do you have the original code?
 

Doq

Smash Lord
Joined
Dec 28, 2012
Messages
1,037
Location
The Lab, Sweet Home, OR

Anutim

Smash Apprentice
Joined
Oct 22, 2013
Messages
185
DRGN DRGN Achilles1515 Achilles1515

Regarding what I posted earlier... I'm an idiot. This bug is nothing new, just something that hadn't been found until the latest version. Managed to track down an earlier version I had lying around and same problem occurs there.

Achilles you mentioned it may be related to your older code, think you could perhaps help me with updating to the newer one?
 
Last edited:

omegagmaster

Smash Cadet
Joined
Dec 20, 2015
Messages
44
Hi,

I'm having trouble using this program. I have a Mac and I'm trying to run this program using Wine. The reason I use wine is because I can successfully run GCRebuilder with it without any difficulty. The only problem is that when I try and start up the program with Wine, it simply does not run. I also tried using WineBottler to make it into a Mac application but instead crashes on startup.

Here is the log for Wine when I try and run the application:

Code:
err:process:create_process L"Z:\\Users\\theTrueomegaGmaster\\Desktop\\Melee Hacking\\Melee Code Manager - v2.0\\Melee Code Manager.exe" not supported on this installation (x86_64 binary)
wine: Bad EXE format for Z:\Users\theTrueomegaGmaster\Desktop\Melee Hacking\Melee Code Manager - v2.0\Melee Code Manager.exe.
 

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Is your system 32-bit or 64-bit?

Others have had problems running this with Wine also (don't know whether they were running 64-bit). Maybe it's something specific with the python compiler, cx_freeze.

There are still several options though, even if you can't get a hold of a Windows computer. You could run a Windows VM (Virtual Machine), which is just like running a game emulator (like Dolphin) on your system. Then you can just run the Melee Code Manager inside that. Or you could "dual-boot" your Mac OS with a Windows OS, so you can boot up your machine into either operating system whenever you want. The latter will give you a bit better performance, since it's not emulating an OS in an OS, so it would be a good choice if your computer is older. And the former might take a little more setting up. Either way, there are lots of guides on Google you can look through for either method.

All of this would also be handy if you're trying to get any other Windows software going, like DAT Texture Wizard.

@Ceeb_116 Hype Man Hype Man @Uchihadark7
 

omegagmaster

Smash Cadet
Joined
Dec 20, 2015
Messages
44
If it helps I'm running 64-bit. Maybe there winetricks or something for python...? Anyways I have a dual boot for Windows but I dislike using it, because
A) it's slower than the computer normally is
B) for some strange reason text generated from programs like Crazy Hand is extremely small

Not trying to start a platform war or anything at all. But if there's no other solution I'll just use the dual boot...
 

omegagmaster

Smash Cadet
Joined
Dec 20, 2015
Messages
44
Could this be happening because I don't have Python? I just realized I don't have it and I was wondering if installing it would help solve the problem.

Edit: I realized Wine had something called Winetricks. I searched for Python in them and installed the Python-related Winetricks. Sadly, it still did not fix the problem. How was the .exe coded? In the log it says "Bad EXE format"

Edit 2: Problem resolved! I learned about something called "Parallel Desktop" and it turns out you can use a Bootcamp as a virtual machine, so now I can successfully run Melee Code Manager! ;)
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Can you help me with adding the neutral spawn points code from 20XX please
Sorry; forgot about this post.

Found the code here. Using the directions in the second post of this thread, under the spoiler: "Converting Gecko codes", I ported it to this, which you can copy/paste to your library (any of the text files in your Mods Library folder, whichever one you feel is most appropriate. Or you can also create a new text file instead.):

-==-


20XX Neutral Spawn for Singles and Doubles
Removes port based starting spawn point advantages.
Works for Battlefield, FD, Dreamland, Yoshi's Story, Kong Jungle 64 Pokemon Stadium, and Fountain of Dreams (FoD for singles only).
[Achilles, Jorgasms]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x80263058 --- 38840001 -> Branch

39E00000 3A000000
3E408048 625307FD
91F206D8 91F206DC
8A3207C8 625206D7
2C110001 4182004C
39EF0001 8E930024
2C140003 4182000C
9A130004 3A100001
2C0F0004 41A0FFE4
48000130 39E00000
3A0000FF 3E408048
62520801 39EF0001
9E120024 2C0F0004
41A0FFF4 4800010C
3E208048 623106DC
39EF0001 3A520001
8E930024 89D30008
2C140003 41A2FFC0
2C0E0000 40820010
3A000000 8A910000
48000024 2C0E0001
40820010 3A000001
8E910001 48000010
3A000002 8E910002
48000004 3A940001
2C140003 40A0FF80
9A910000 9A120000
2C0F0004 41A0FF94
39E00000 3E208048
623106DB 3AA00000
39EF0001 8E910001
2C140001 40800008
48000010 3AB50001
2C150003 40A0FF40
2C0F0003 41A0FFDC
39E00000 3A310127
39C000FF 3A8000FF
39EF0001 8E110024
2C0E00FF 40820010
7E128378 39C00000
4800002C 7C109000
4082000C 39C00003
4800001C 2C1400FF
40820010 39C00001
3A800000 48000008
39C00002 99D1FFFC
2C0F0004 41A0FFB4
38840001 00000000


1.02 ----- 0x801C0A48 --- 7D8803A6 -> Branch

3DE0801B 61EFFFA8
7C0F6000 418200BC
3DC08048 A1CE0686
3DE08049 61EFED70
81EF0000 2C0E001F
4082001C 3E00C242
3E204242 3E404230
3A600000 960F0598
4800002C 2C0E001C
40820040 3E00C23A
62106666 3E20423D
62318E70 3E404214
3A600000 960F0854
48000004 924F0004
962F0040 924F0004
962F0040 926F0004
960F0040 926F0004
2C0E0020 40820014
3A000041 9E0F0650
3A0000C1 9A0F0040
2C0E0008 40820024
3E004270 3E20C270
3A400000 39EF4748
960F4748 924F0004
962F0040 924F0004
7D8803A6 00000000

Not tested yet, but I believe it should work.
 
Last edited:

Dinowaffles

Smash Cadet
Joined
Jun 4, 2015
Messages
53
Sorry; forgot about this post.

Found the code here. Using the directions in the second post of this thread, under the spoiler: "Converting Gecko codes", I ported it to this, which you can copy/paste to your library (any of the text files in your Mods Library folder, whichever one you feel is most appropriate. Or you can also create a new text file instead.):

-==-


20XX Neutral Spawn for Singles and Doubles
Removes port based starting spawn point advantages.
Works for Battlefield, FD, Dreamland, Yoshi's Story, Kong Jungle 64 Pokemon Stadium, and Fountain of Dreams (FoD for singles only).
[Achilles, Jorgasms]
Version -- DOL Offset ------ Hex to Replace ---------- ASM Code
1.02 ----- 0x80263058 --- 38840001 -> Branch

39E00000 3A000000
3E408048 625307FD
91F206D8 91F206DC
8A3207C8 625206D7
2C110001 4182004C
39EF0001 8E930024
2C140003 4182000C
9A130004 3A100001
2C0F0004 41A0FFE4
48000130 39E00000
3A0000FF 3E408048
62520801 39EF0001
9E120024 2C0F0004
41A0FFF4 4800010C
3E208048 623106DC
39EF0001 3A520001
8E930024 89D30008
2C140003 41A2FFC0
2C0E0000 40820010
3A000000 8A910000
48000024 2C0E0001
40820010 3A000001
8E910001 48000010
3A000002 8E910002
48000004 3A940001
2C140003 40A0FF80
9A910000 9A120000
2C0F0004 41A0FF94
39E00000 3E208048
623106DB 3AA00000
39EF0001 8E910001
2C140001 40800008
48000010 3AB50001
2C150003 40A0FF40
2C0F0003 41A0FFDC
39E00000 3A310127
39C000FF 3A8000FF
39EF0001 8E110024
2C0E00FF 40820010
7E128378 39C00000
4800002C 7C109000
4082000C 39C00003
4800001C 2C1400FF
40820010 39C00001
3A800000 48000008
39C00002 99D1FFFC
2C0F0004 41A0FFB4
38840001 00000000


1.02 ----- 0x801C0A48 --- 7D8803A6 -> Branch

3DE0801B 61EFFFA8
7C0F6000 418200BC
3DC08048 A1CE0686
3DE08049 61EFED70
81EF0000 2C0E001F
4082001C 3E00C242
3E204242 3E404230
3A600000 960F0598
4800002C 2C0E001C
40820040 3E00C23A
62106666 3E20423D
62318E70 3E404214
3A600000 960F0854
48000004 924F0004
962F0040 924F0004
962F0040 926F0004
960F0040 926F0004
2C0E0020 40820014
3A000041 9E0F0650
3A0000C1 9A0F0040
2C0E0008 40820024
3E004270 3E20C270
3A400000 39EF4748
960F4748 924F0004
962F0040 924F0004
7D8803A6 00000000

Not tested yet, but I believe it should work.
Just tested it and it works! Thank you so much.
 

Achilles1515

Smash Master
Joined
Jun 18, 2007
Messages
3,211
Location
Cincinnati / Columbus OH
Was just thinking...it would be cool if you could attach your actual ASM code text/notes to specific codes within the program. You can...kinda do this now, but it just doesn't look good and is unreasonable for longer codes.

Capture.PNG


ASM comments are started with the number sign, but anything after a number sign using the above method does not show the comments.

Some sort of dedicated window to keep this info would be nice. Or next to the "(Details)" button, there could be an "(ASM Notes)" button. So if you ever wanted to modify a code, you wouldn't have to pull up the most recent ASM from a separate file - it would just be attached to that code injection within the program.

Other things:

This is what my Tools page looks like, even if I make it fullscreen. Again, probably because I have my text set to Medium.
Capture.PNG



If you type in a negative number as your decimal, the 32-bit float has an "L" attached to the end of it. Not sure if intentional.

In the ASM to Hex converter, can you allow these:

lwz r0,0(sp) = lwz r0,0(r1)
lwz r0,0(rtoc) = lwz r0,0(r2)

The ASM <> WiiRD converter allows the use of (sp) and (rtoc) so I am always still using that program for my conversions.

I feel like I had more comments but maybe not. This whole program is a godsend.
 
Last edited:

DRGN

Technowizard
Moderator
Premium
Joined
Aug 20, 2005
Messages
2,175
Location
Sacramento, CA
Was just thinking...it would be cool if you could attach your actual ASM code text/notes to specific codes within the program. You can...kinda do this now, but it just doesn't look good and is unreasonable for longer codes.

View attachment 96498

ASM comments are started with the number sign, but anything after a number sign using the above method does not show the comments.

Some sort of dedicated window to keep this info would be nice. Or next to the "(Details)" button, there could be an "(ASM Notes)" button. So if you ever wanted to modify a code, you wouldn't have to pull up the most recent ASM from a separate file - it would just be attached to that code injection within the program.

Other things:

This is what my Tools page looks like, even if I make it fullscreen. Again, probably because I have my text set to Medium.
View attachment 96499


If you type in a negative number as your decimal, the 32-bit float has an "L" attached to the end of it. Not sure if intentional.

In the ASM to Hex converter, can you allow these:

lwz r0,0(sp) = lwz r0,0(r1)
lwz r0,0(rtoc) = lwz r0,0(r2)

The ASM <> WiiRD converter allows the use of (sp) and (rtoc) so I am always still using that program for my conversions.

I feel like I had more comments but maybe not. This whole program is a godsend.
Thanks, Achilles. That's a good idea about the ASM notes. In the library files, we could have an optional section that could go with any code, specifically for such notes. We just need to come up with some standard syntax for how the codes & notes would be written. For example, after everything else for a particular code, there could be a line that says something like "ASM Notes:" or "Source Code:", and then the program would take everything after that line and bring it up when you click the "(ASM Notes)" button. Ideally it would probably be better if there was a button like "(Edit Code)", which would present you with the source code (with commenting included of course), allow you to change it, and then you could hit 'save', and it would convert the ASM to hex and update the code with that. But of course there are still ASM commands that aren't supported.

lol wow. That font size issue....

Yeah, I've since noticed the L that gets appended to negative floats. It'll be removed in the next update.

Those commands seem equivalent to me in the converter. Both "lwz r0,0(sp)" and "lwz r0,0(r1)" convert to "80010000". And both "lwz r0,0(rtoc)" and "lwz r0,0(r2)" convert to "80020000". Do you mean going from hex to ASM, i.e. you want "80010000" to convert to "lwz r0,0(sp)" rather than "lwz r0,0(r1)"?
 

Kekker

Smash Cadet
Joined
Feb 9, 2015
Messages
34
How would I add codes for Kirby's throws? I know the hex addresses in the Start.dol, but I don't know what I should be changing them to.

I wanted to change two things:
1) make f/b throw uninterruptible, as they are in SD Remix. The mash timer is at 0xDADC0 in v1.00, and 0xDB20C in v1.02. I tried changing EC 01 00 28 (the timer) to 60 00 00 00 (to nop the timer), but instead of being inescapable the two throws just never grab the other character in the first place.

2) let Kirby have his jumps after u/f/b throw. The address is 0x79FB0 in v1.00, and 0x7A24C in v1.02. I again tried changing 98 7E 19 68 (the jump delete thing) to 60 00 00 00 (to nop the deleted jumps), and again I got some weird behavior. Kirby reacts to jumping out of the throw now, but it's not really a jump. Kirby goes through the jump animation, then keeps floating upwards instead of coming back down. He floats to the blast zone and crashes the game.

What should I be changing the code to? The nop function clearly isn't working.

All of my testing was done in v1.02. I had found the addresses for v1.00 and did a search in the v1.02 Start.dol to find the addresses there.



EDIT: So upon further research of the inescapable throws, I have found that EC 01 00 28 translates to

fsubs f0,f1,f0

in PPC code. In other words, the value of f0 (I'm assuming the escape trigger) is subtracted from f1 (I'm assuming the mash logging thing) and then stored back into f0.

So I tried changing that to an fadds function, but that only made the timing different(?) for the escape. I THINK the mash/escape threshold is >0, so f1 would be incremented with every mash input to the point where f1 - f0 >= threshold (which would read f0), which is why that didn't work. I think.

I also looked at SD Remix's Start.dol (Kirby throws are inescapable in SDR), and they just nop'd (EC010028 -> 60000000) the timer (EC010028 -> 60000000) and it works perfectly, which makes me wonder if there's some bug that they fixed to make the timer just disappear. They did nop a lot more in the .dol than I have, and almost everything is 0'd until offset 0x2700 or something.

Still very confused, any help is appreciated.
 
Last edited:
Top Bottom