Setting Up and Compiling the Newer Sources

Here are 5 tutorials to set up and compile the NewerSMBW source code, along with a few questions regarding the NewerSMBW source code. If you get "permission denied" or "read-only filesystem" errors, see this here. The estimated time to set up and compile the NewerSMBW source code may take between 30 minutes and 2 hours, depending on your knowledge with the terminal, internet connection speed, etc.

Steps for Mac OS X
Credits and Release Information Original tutorial by Tempus, heavily edited by 9211tr, updated/working as of 2019. This has been tested on Mac OS X 10.15 Catalina. It should also work on Mac OS X 10.9 (Mavericks) up to 10.14 (Mojave) or any version higher than 10.15 Catalina.

Installing GCC
Install Xcode via the Mac App Store (if you're on an older Mac OS X version {below 10.15 Catalina}, you may have to go online and download the latest version of Xcode for whichever older Mac OS X version you have). Open Xcode once it's finished installing, read all the license agreements that pops up and agree to it.

Installing CMake, GNU "SED", and GNU "WGET"
Open the terminal (if you haven't already) and type: Install the package manager, "Homebrew", go to its website: https://brew.sh/, and copy the install command and paste and enter it in the terminal, then once it's finished installing, type:

Installing devkitPPC
Open the terminal (if you haven't already) and type: Afterwards, in the terminal, type: Or you can manually download devkitPPC here: https://github.com/devkitPro/buildscripts/releases And manually extract the devkitPPC  file to the   directory.

Installing PyElfTools/PyYAML
Open the terminal (if you haven't already) and type: NOTE: If you get an  fatal error (usually if you're on Mac OS X 10.15 Catalina), you may have to install the libyaml package and remove the   PyYAML   reference file. In the terminal, type: (where  is the name of the PyYAML   file, for example, " ").

Downloading the Newer Sources
Open the terminal (if you haven't already) and type: Or you can manually download the Newer Sources here: https://github.com/Treeki/NewerSMBW/tree/no-translations And download the  file and extract it to the   directory.

Downloading and Patching Clang/LLVM (rev. 184655)
Open the terminal (if you haven't already) and type:

Compiling Clang/LLVM (rev. 184655)
Open the terminal (if you haven't already) and type:

NOTE: If you get an error saying  and/or , you might want to type these commands: to fix the errors. More information about these errors here.

Additionally, if you get an  fatal error, you'll need to do modifications to 3 of the LLVM compiler-rt source files to fix this error. Open the terminal (if you haven't already) and type:

1st: Open  with the text editor and replace this text:   with

2nd: Open  with the text editor and: Remove the text, then replace this text   with

Afterwards, replace this text  with

3rd: Open  with the text editor and: Replace this text  with

Afterwards, replace this text  with

More information about this error here.

Compiling Newer
At any time, open the terminal (if you haven't already) and type:

Finishing
This will output a number of  files into the   folder. You'll need to rename them to their NewerSMBW readable names, so open the terminal (if you haven't already) and type:  Once you're done with that, at any time, simply type in the terminal:   and then go into the   folder in the   folder, then plop the renamed   files into the   folder in the Newer pack, and you should be sailing! If you want to automate the process further, take a look at the  file in the   folder in the text editor. Change the commands at the top to match the ones in the code block in the  section, and change the directory paths below to output directly to your test folder destination. You can integrate the script with WIT (Wiimm's ISO Tools), Dolphin Emulator, or with RiiFS to get ultra speedy testing runs.

Steps for Debian/Ubuntu Linux
Credits and Release Information Original tutorial by Grop, and heavily edited by 9211tr + slightly edited by RedStoneMatt, updated/working as of 2019. Debian 9.11.0 (or earlier) / Ubuntu 17.04 (or earlier) is needed, versions above that use GLIBC 2.25 (or higher), and that's incompatible with LLVM (as it results in compiliation errors when compiling LLVM). This method works on both a real computer and a virtual machine.

Keep in mind that you'll need to use the 64-bit (x86-64 or AMD64) version of Debian/Ubuntu Linux, since some of the necessary tools/programs needed for compiling NewerSMBW are no longer compatible with the 32-bit (i386 or i686) version.

Preparing apt-get
If you're on Ubuntu 17.04 ONLY, you'll need to do some changes to the apt-get sources to prevent errors (more information here). Open the terminal (if you haven't already) and type:

Go to line #2 of the file (using the arrow keys) and paste this code: Then exit and save your changes.

Afterwards, in the terminal, type:  and restart your Ubuntu Linux machine.

If you get an error saying  when trying to run , just simply type this command:   and the error should be gone.

Installing GCC
Open the terminal (if you haven't already) and type:

Installing CMake
Open the terminal (if you haven't already) and type:

Installing Subversion (SVN)
Open the terminal (if you haven't already) and type:

Installing devkitPPC
Open the terminal (if you haven't already) and type: Afterwards, in the terminal, type: Or you can manually download devkitPPC here: https://github.com/devkitPro/buildscripts/releases And manually extract the devkitPPC  file to the   directory.

Installing PyElfTools/PyYAML
Open the terminal (if you haven't already) and type:

Downloading the Newer Sources
Open the terminal (if you haven't already) and type: Or you can manually download the Newer Sources here: https://github.com/Treeki/NewerSMBW/tree/no-translations And download the  file and extract it to the   directory.

Downloading and Patching Clang/LLVM (rev. 184655)
Open the terminal (if you haven't already) and type:

Compiling Clang/LLVM (rev. 184655)
Open the terminal (if you haven't already) and type:

Compiling Newer
At any time, open the terminal (if you haven't already) and type: NOTE: If you're on Ubuntu, make sure to use  instead, as   doesn't work on Ubuntu.

Finishing
This will output a number of  files into the   folder. You'll need to rename them to their NewerSMBW readable names, so open the terminal (if you haven't already) and type:  Once you're done with that, at any time, simply type in the terminal (and again, if you're on Ubuntu, make sure to use   instead, as   doesn't work on Ubuntu):   and then go into the   folder in the   folder, then plop the renamed   files into the   folder in the Newer pack, and you should be sailing! If you want to automate the process further, take a look at the  file in the   folder in the text editor. Change the commands at the top to match the ones in the code block in the  section, and change the directory paths below to output directly to your test folder destination. You can integrate the script with WIT (Wiimm's ISO Tools), Dolphin Emulator, or with RiiFS to get ultra speedy testing runs.

Windows 10 (NSMASR and NSMBWer)
Credits and Release Information Tutorial by Nin0, updated/working as of 2020 NSMASR and NSMBWer by CLF78 and Danster64 This has been tested on Windows 10 Pro version 1903 64-bit

Requirements
- Python 3: https://www.python.org/downloads/

- as there are some programs which need Python 2 and some which need Python 3 when it comes to Mario Bros. Wii modding, you might want to have a look at pylauncher: https://bitbucket.org/vinay.sajip/pylauncher/downloads/

- pip: https://pip.pypa.io/en/stable/installing/ (might be pre-installed together with python)

- devkitPPC: https://wii.leseratte10.de/devkitPro/devkitPPC/r19%20(2009)/

- either NSMASR: https://github.com/H1dd3nM1nd/NSMASR-Code or NSMBWer: https://github.com/Danster64/NSMBWer



Step 2: create a necessary folder and eventually copy a file into it, which for unknown reasons doesn't get copied automatically


If there is no processed folder, create it: And copy the file ... ... into the newly created folder, if it exists. In older versions it wasn't copied into the folder automatically so it had to be done manually. CLF78 said he copied the stuff inside the soundPlayer.yaml file into another one so the problem might not occur in later versions of the code.

Step 3: edit the "- Build -.bat" script to automatically move the compiled code to your dolphin game folder or stop it from moving the files after compiling


Open the following file: You can either edit the path marked in the first picture to your own dolphin game path or change the part marked in the second picture to "end" to stop the script from trying to move your compiled code.

Compiling NSMASR and NSMBWer
Start the following script: If you use multiple Python versions make sure that the batch script uses Python 3. If you have pylauncher and your standard Python version is 2 you can simply change each "python" in the batch script with "py -3".

Additional information
Both NSMASR and NSMBWer have there own files for Riivolution and are not compatible with the files from Newer (e.g. objects, layouts, etc. ...).

For NSMASR have a look at: https://github.com/H1dd3nM1nd/NSMASR

and for NSMBWer at: https://github.com/Danster64/NSMBWer/tree/master/Other%20Stuff

Windows 10 WSL subsystem
Credits and Release Information Tutorial by 9211tr, updated/working as of 2019

Requirements
- Windows 10 Anniversary Update BUILD 14393.0, Version 1607 (or higher).

- The 64-bit (x64 or x86-64) version of Windows 10 + an x64-based processor on your computer, as the WSL subsystem requires this in order for it to enable, install, and work. It WILL NOT work on the 32-bit (x32 or x86) version of Windows 10 and/or an x86-based processor on your computer.

- An internet connection.

- At least 22 GB of free disk space.

HINT: To tell if your Windows 10 PC is 64-bit (and is running Anniversary Update BUILD 14393.0 Version 1607 or higher, and on an x64-based processor), go to the  -->   -->   -->

If your PC is below build 14393.0 Version 1607, then I'd suggest you update your computer to the newest build.

Step 1
Go to  -->   -->   -->   Set it to

Step 2
Go to the Cortana Menu (the circle icon near the Start Menu icon), or if you're on a newer build of Windows 10, the search box near the Start Menu icon. Type  Check the box that says   and click OK. Once you're done enabling the WSL subsystem, restart your computer.

Step 3
After restarting, we'll need to install the WSL subsystem (the WSL subsystem installation may take about 10 minutes to complete):

Method 1: Windows Store (installs a much improved version of the WSL subsystem, recommended)
NOTE: You need the Windows 10 Fall Creators Update, build 16215.0 or higher, in order to use this method, or it won't work.

Go to: https://aka.ms/wslstore, and the Microsoft Store should appear:

You'll get to choose 6 (or probably more, if you're reading this in the future) different Linux distros for the WSL subsystem. Choose Ubuntu (not any other distro), in order for everything to work out properly, but don't download that distro, since that distro is Ubuntu 18.04 LTS (this is important and as I said before: Ubuntu 17.04 {or earlier} is needed, versions above that use GLIBC 2.25 {or higher}, and that's incompatible with LLVM {as it results in compiliation errors when compiling LLVM}).

Scroll down and click, look for and choose the Ubuntu 16.04 LTS distro. If it does not show up, go here. Once you select the Ubuntu 16.04 LTS distro, hit  to download it. When it's finished downloading, hit  (you can also choose to pin it to the Start Menu if you like):

After hitting, it'll say that it's installing.

Method 2: Command-line (installs a legacy version of the WSL subsystem)
NOTE: This method is not recommended as it installs a legacy version of the WSL subsystem, but if you're not using the Windows 10 Fall Creators Update, build 16215.0 or higher, then this is the only method that will work.

Go to the Cortana Menu, or if you're on a newer build of Windows 10, the search box near the Start Menu icon. Type  to install the WSL subsystem. If you get an error after typing, saying   either: <ul style="list-style-type:square;"> <li>You go to the Cortana Menu, or if you're on a newer build of Windows 10, the search box. Type instead  and hopefully, you shouldn't have any errors.</li>

<li>You have the Windows 10 Fall Creators Update, build 16215.0 or higher installed, and should instead use the Windows Store method.</li> </ul>

Read the license agreement, and if you accept it, type  (for "Yes", to accept), and it will install.

Step 4
Once it's done installing, it will ask you for what the username should be called, just type  in all lowercase, and for the password (IF PROMPTED), that's all up to you.

Now type  to exit out of the WSL subsystem. If you get an error saying that the  username already exists, then close the WSL subsystem by hitting Ctrl-C on the keyboard, don't enter in a username.

Go to the Cortana Menu, or if you're on a newer build of Windows 10, the search box near the Start Menu icon. Type  to launch the WSL subsystem. Normally, if the  username already exists, it will instead use that username, but if it still prompts you to enter in the username, then you have no choice but to use a different username.

Type the commands:

Go to the Cortana Menu, or if you're on a newer build of Windows 10, the search box near the Start Menu icon. Type  to launch the WSL subsystem, then type

Step 1
Type in: And it'll prompt you on what you want to do, type  or simply   and hit ENTER on your keyboard, and it should start installing, and just wait for it to complete, so find something to do in the meantime, unless if you have the patience to watch the screen until the script is finished running. The script installs everything automatically, so there's no need for you to install anything manually.

Step 2
Once the installation is finished, it'll do a TEST compile on the NewerSMBW sources (to see if everything was installed properly) and once that's finished and no syntax errors (or whatever errors) occurred, you're all done. To compile NewerSMBW at any time, simply type in the commands: The  option isn't required, but with the   option, your compiled NewerSMBW   files will be automatically renamed to their NewerSMBW readable names.

Step 3
You'll need to go into the folder of where the WSL subsystem files are located. If you installed the WSL subsystem via the Windows Store method, then the folder is: If you installed it via the Command-line method, then the folder is:

Go to the, or if you used the   option:   folder. You should see all the DLCode/DLRelocs/System  files for US(NTSC)/EU(PAL)/JP(JPN) v1 and v2, if no syntax errors (or whatever errors occurred) when compiling the NewerSMBW sources.

Then drag the  files to your   folder in your NewerSMBW game patch folder and test your mods out! If you want to automate the process further, take a look at the  file in the   folder in the text editor. Change the commands at the top to match the ones in the code block in Step 2 of this tutorial, and change the directory paths below to output directly to your test folder destination. You can integrate the script with WIT (Wiimm's ISO Tools), Dolphin Emulator, or with RiiFS to get ultra speedy testing runs.

NOTE:</b> If you haven't used the  option, you'll need to manually rename the   files to their NewerSMBW readable names before you drag them to the   folder.

1: How do I resolve the "permission denied" and "read-only filesystem" errors whenever I type a command in the terminal?
Type  for every command in the tutorial, and enter password when prompted. Even better, you can simply type  in the terminal to circumvent all   commands, so you won't have to type   everytime. If you're on Ubuntu Linux or Mac OS X,  doesn't work, so you'll need to type   instead.

NOTE:</b> If no text is shown when typing the password, it does not mean it's not working, the text is hidden so in case if anyone is watching the computer screen behind your back, they won't see your password.

If you're on Mac OS X and still getting "permission denied" errors, even after typing, this is due to Apple's System Integrity Protection (SIP) in Mac OS X 10.11 El Captain and later. You'll need to enter into recovery mode to disable it. To enter recovery mode: 1:</b> If you have multiple internal hard drive partitions/volumes alongside your Mac OS X partition/volume, you'll need to go into System Preferences (the gear icon in the dock, which is at the bottom of the screen), and click Startup Disk. 2:</b> Click the lock to make changes and select the disk where your Mac OS X partition/volume is, then restart your Mac. 3:</b> As soon when your Mac starts up, hold down Command-R on the keyboard until the Apple logo shows up, to enter recovery mode. 4:</b> In recovery mode, go to  -->. In the terminal, type, then restart your Mac to exit out of recovery mode.

If you're on Mac OS X and also are getting a "read-only filesystem" error, this is due to Mac OS X 10.15 Catalina having a separate read-only volume (for the  directory and critical system files) alongside the writable, user data volume. You'll need to disable Apple's System Integrity Protection (SIP), first, following the steps above. Afterwards, open the terminal (if you haven't already) and type, to make the   directory writable again.

This change will automatically be reverted when you restart your Mac. For it to be permanent (at least whenever you start the terminal), when the terminal is open (and you've clicked on the terminal window), go to  -->   -->   -->. Under the Startup section in the terminal preferences window, check the box that says  and. In the text box, type the command, and exit the terminal preferences window. Now everytime you start up the terminal, you'll always be able to modify the  directory.

2: (Windows 10 WSL Subsystem Only) Can I uninstall the NewerSMBW sources?
Yes, run the script via the command:  And type   or simply   and it'll remove it, among the other tools/compilers/etc.

NOTE:</b> This will remove everything in the NewerSMBW sources folder, so make sure you backup any source files/etc. from the NewerSMBW sources folder before uninstalling it.

3: (Windows 10 WSL Subsystem Only) Can I reinstall the NewerSMBW sources?
Uninstall it, FIRST (see question #2), and then install it back again.

4: Can I have multiple folders for the NewerSMBW sources?
NOTE:</b> If you're on Ubuntu or Mac OS X, make sure to use  instead, as   doesn't work on Ubuntu or Mac OS X. Also if you're on Mac OS X, make sure to use , for the GNU "SED" (stream editor application) instead, not  , because   on Mac OS X is a script editor application, not the GNU "SED" (stream editor application).

Yes, copy the existing folder by typing the commands:  Or if you need an unmodified and fresh copy, you can simply redownload it by typing these commands:   (where   is the folder name of the copy of the NewerSMBW sources folder). NOTE:</b> Do not have  as   or your current NewerSMBW sources will be OVERWRITTEN.

Copying the file (for Debian/Ubuntu Linux and Mac OS X Only)
Type these commands in the terminal:

Copying the file (for Windows 10 WSL Subsystem Only)
Type this command in the WSL subsystem:  (where   is the file name of the copy of the   file).

Then you'll need to modify the copy of the file with a text editor that supports the Unix (LF) line feed format (I would recommend PSPad if you don't have one), then replace the text  with   and save the changes.

Now in the WSL subsystem, type: If you want to compile the NewerSMBW sources easily, type: