Skip to content

NSMBW code mod based on adding features and removing hardcodes from the original game.

License

Notifications You must be signed in to change notification settings

Developers-Collective/NSMBWerPlus

Repository files navigation

NSMBWer+

Introduction

This fork of the NSMBWer repo is a heavily modified version that aims to keep it up to date with current NSMBW modding while keeping everything from Vanilla intact. Most notably, this version uses Abood's more sprites mod to implement every custom sprite and actor from Newer while keeping the ones they replaced.

Licensing

Like in the original repo, the source code and tools are released under the MIT license. See the LICENSE file in this repository for full details.

Copyright (c) 2010-2024 Newer Team, Ryguy

Requirements

For running NSMBWer+:

  • A New Super Mario Bros. Wii game disc (any region or revision)
  • A Wii with Riivolution and CleanRip installed
    • Around 100 MB of free space will be needed for the storage device used
  • Alternatively, Dolphin Emulator may be used
    • The latest Release or Development version must be used. Any Release or Development version before 5.0-15520 is unsupported

For compiling NSMBWer+ (only if editing code):

  • Windows or OS that runs Wine
  • devkitPPC
  • Python 3.x
  • Python libraries: PyYAML, pyelftools
  • NXP 'CodeWarrior Special Edition' for MPC55xx/MPC56xx v2.10
    • If this direct link doesn't work, the original page is available on the Internet Archive.
    • The installer does not work with Wine; you may use extractCW.sh from the root of the repo in the same directory as the installer to extract the necessary files instead (requires cabextract).
    • You only need the Command Line Tools component in the custom install configuration.
    • After installing it, you need license.dat from the installation root, and the DLL and EXE files inside PowerPC_EABI_Tools/Command_Line_Tools.

Full setup instructions are included at the bottom of this readme.

What's Here

Kamek

All the NSMBWer+ code is inside the Kamek folder in this repository but, technically, Kamek is really just a simple build system for calling the tools to compile/assemble each source file and putting together an output file you can inject into your game.

Unlike most typical build systems, though, there's a bunch of features specific to game hacks like NSMBWer+:

  • Kamek is configured through a game-specific project file; each project pulls in various modules, which can each contain C++ and assembly source files, and hooks
  • Hooks are different types of patches that are used to inject things into the game: patch static code/data in RAM, overwrite pointers with a reference to a symbol exported from Kamek code, inject branch instructions, ...
  • Memory addresses in the linker script and used by hooks are automatically converted to match all supported game versions - Kamek uses the original version of the PAL/European NSMBW release as a reference.
  • The compiled output is converted to a specific format expected by the NSMBWer+ loader.
Loader

This is the in-game half of Kamek - it's a simple loader that links the custom code generated by Kamek into the game after the rels.

This can be compiled by running compile.bat and is remade to load earlier than the Newer loader. Thankfully, since it works perfectly fine, and supports every variation of NSMBW that was released for the Wii, there's not too much of a reason to deal with this. It's mostly here on the offchance something needs to be changed.

Riivolution

A build is inside this folder, including all necessary game files, an XML and the related folders. If you want to create a mod, starting with this is suggested. Keep in mind this build doesn't include the custom music or tilesets from Newer, but they can be added.

Reggie! Patches

A patch for the Reggie! Next level editor is included here. Original Reggie! and Reggie! Updated are not supported due to a bug that prevents custom sprites from being used in those editors.

Installation

Running NSMBWer+

If Running NSMBWer+ on a Real Wii

  • Install the Homebrew channel along with Riivolution, if you haven't already.

  • Copy the contents of the Riivolution folder onto your storage device.

  • Insert your New Super Mario Bros. Wii disc and launch Riivolution, make sure the NSMBWer+ option is set to Enabled, and all other hacks are disabled. Press Launch and NSMBWer+ will load.

  • NOTE: Running NSMBWer+ in a USB Loader is not supported. Do not expect it to work. Attempting to "patch" NSMBWer+ into a dump of NSMBW (whether it is accquired legally or illegally) will not work due to the extensive changes done to the game.

If Running NSMBWer+ on Dolphin Emulator

  • Install the Homebrew channel and CleanRip on your Wii, if you haven't already. Once CleanRip is installed follow this guide to dump your game disc into a format Dolphin can read.

  • Move your game dump into the folder Dolphin will look for games in. Open Dolphin's User folder and copy the contents of the Riivolution folder onto the Load\Riivolution folder.

  • Right click New Super Mario Bros. Wii and make sure the NSMBWer+ option is set to Enabled, and all other hacks are disabled. Press Launch and NSMBWer+ will load.

Troubleshooting

My Wii/Dolphin Emulator is freezing/crashing on startup!
  • Open the Riivolution xml file and remove line 18 (savefile redirect). This savefile redirect is known to crash certain Wiis and on rare occasions Dolphin Emulator. This redirect is present to prevent corruption of retail game save files due to changes made to the save format. You may follow this guide to rename the save file to prevent corruption of retail saves.

Compiling Code (only if editing code)

Setup

  • First install Python 3. If on Windows, ensure it is added to PATH upon installation. Next, run:

    • On Windows: py -3 -m pip install pyyaml pyelftools

    • On other OSs: python3 -m pip install pyyaml pyelftools

  • Install DevkitPro's devkitPPC. Their official instructions for this are found here.

  • The last dependency is NXP 'CodeWarrior Special Edition' for MPC55xx/MPC56xx v2.10. You will also need Wine if you are running an OS other than Windows.

    • NOTE: the installer is known to fail with Wine. You may extract the files from it with extractCW.sh on the root of the repo (which requires cabextract, available from most package managers).

    • CodeWarrior's tools are by default installed to:

    C:\Program Files (x86)\Freescale\CW for MPC55xx and MPC56xx 2.10\PowerPC_EABI_Tools\Command_Line_Tools

    • Copy the files inside to Kamek/tools/cw - Kamek assumes they are there.

Usage

There is a script in the Kamek folder that invokes makeGame.py, named makeNSMBWer.

On Windows, run the batch versions - you can just double-click them.

On macOS, Linux, or other Unix-like systems, use the bash versions. Open a terminal in the same directory and run it like:

./makeNSMBWer

The resulting output is placed in a folder called Build_NSMBWerProject. These files go in /NewerRes on the game disc (this folder is included in the Riivolution patch).

Changes From NewerSMBW:

  • Sprite slot expansion, with all Newer sprites being ported to it.
  • Crash fixes.
  • Hammer suit adjustments.
  • 2-Castle hardcode fixes from AnotherSMBW.
  • Added more effects to effect spawner.
  • Support for Yoshi Drums in music slots 200+.
  • Load custom music from the default BRSTM folder.
  • Ported fixes from RoadrunnerWMC's NSMBW-Updated project.
  • Several vanilla sprites that have their behaviors modified have settings added for compatibility with vanilla levels.
  • Unused actors in the original game have been assigned sprite slots.

Credits

  • Newer Team - original NewerSMBW Code
  • Nin0 & NSMLW Team - Programming Assistance, General Assistance, Numerous bits of code, original NSMBWer
  • Bupcraft, Lurker, Kirblue, SupaNES, King Pixel & Others - Bug Reporting
  • Abood - More Sprites code
  • CLF78 - Original NSMBWer, Korean/Taiwanese support, additional More Sprites code
  • Luminyx - Programming assistance
  • Danster64 - original NSMBWer
  • RoadrunnerWMC - Reggie! Next spritedata, NSMBW Updated code, Korean/Taiwanese support
  • G4L - Fixed NewerSMBW models
  • RedStoneMatt/Asu-Chan - Programming assistance, code loader
  • Grop - Newer sprite fixes

About

NSMBW code mod based on adding features and removing hardcodes from the original game.

Resources

License

Stars

Watchers

Forks