I had difficulty finding much information regarding these topics, I want everyone to be able to see at a glance that this does indeed work, thanks again my friend!
Install the version corresponding to your Operating System (64 or 32 bits).
Accept the defaults in installation program of MSYS2 once you finish the installation you will have shortcuts for MSYS2, MinGW32 and MinGW64. MSYS2 is used to compiling POSIX binaries for Linux from Windows.
MinGW32 & MinGW64 compile Native Windows binaries using a linux toolchain (gcc, bash, etc.)
Launch MSYS2 shell and execute the command: pacman -Syuu several times until you get the message: "there is nothing to do".
In order to compile the Switch binary you must first confirm all works fine compiling a binary for Windows. So do the next steps:
Install prerequisites
In a MinGW64 shell (or MinGW32 if you have a Windows 32 bit edition, why?). Be sure the prompt shows MINGW64 or MINGW32 if not you started the wrong shell, close it and open the right one.
Please execute the next command, several times until you get the message "there is nothing to do", you can be asked to restarts the MINGW64 environment few times: pacman -Syuu
Pay attention to the space before " -lstdc++". then run the commands:
Code:
cd ..
make
Last, you can compile the Widows executable using make and the build options you choose, by example:
Code:
cd ..
make BETTERCAMERA=1 NODRAWINGDISTANCE=1 TEXTURE_FIX=1 EXT_OPTIONS_MENU=1 -j9
If all go through you get an .exe file on build subfolder of sm64ex.
Troubleshooting
If you get the error gcc: command not found or make: gcc: No such file or directory you do not install all needed packages or run the wrong Shell, be sure of running «MINGW32» or «MINGW64» and what that is pointed on the prompt in purple.
If the ROM is missing or wrong format/version you get the error Failed to open baserom.us.z64! Verify the correct ROM at the c:\msys64\home\<username>\sm64ex.folder.
If you get the error make: *** No targets specified and no makefile found. Stop. You are on the wrong folder the last make command should be run from c:\msys64\home\<username>\sm64ex folder.
Be sure of get the responses Target: i686-w64-mingw32 or Target: x86_64-w64-mingw32 when you run the command gcc -v if else other is shown on screen you install the wrong gcc package or run MSYS shell, remember the process should be run on «MINGW32» or «MINGW64» shells.
Nintendo Switch compilation.
After all works fine and a Windows binary is created, you can run extra steps for make a Switch NRO file
First you need to install DevKitPro.
You need to edit the pacman.conf on c:\msys64\etc\
And add the next lines at end of it:
Code:
[dkp-libs]
Server = https://downloads.devkitpro.org/packages
[dkp-windows]
Server = https://downloads.devkitpro.org/packages/windows
By last run the next commands in order to make the NRO file, PLEASE DO NOT FORGET TO COPY THE EXE FILE GENERATED FOR WINDOWS TO OTHER PATH, it will be deleted on the next step.
You can use any build options you want, one example:
Code:
make TARGET_SWITCH=1 BETTERCAMERA=1 NODRAWINGDISTANCE=1 TEXTURE_FIX=1 -j9
BUILD OPTIONS
Build option
Default
Possible values
Description
VERSION
us
us, eu, jp, sh
Which ROM to use. The selected ROM has to be in the repo folder with the name baserom.$VERSION.z64. sh is currently broken.
TARGET_BITS
32, 64,
TARGET_BITS=n appends some compiler flags for an n-bit build. If the value is empty, the option does nothing, assuming your native toolchain will set everything up by itself. Use this only if you're having trouble otherwise.
If 1, build for Windows. Usually set automatically if building on Windows.
OSX_BUILD
0
0, 1
If 1, build for OSX.
WINDOWS_CONSOLE
0
0, 1
If 1, append -mconsole to Windows CFLAGS, making a console window appear while the game is running. Can be useful for debugging purposes.
DEBUG
0
0, 1
If 1, build with debug symbols and default optimization level. Otherwise build with -O2.
RENDER_API
GL
GL, GL_LEGACY, D3D11, D3D12
Select rendering backend to use.
GL corresponds to OpenGL 2.1 (gfx_opengl.c),
GL_LEGACY corresponds to OpenGL 1.3 (gfx_opengl_legacy.c).
Direct3D backends will also force WINDOW_API to DXGI.
WINDOW_API
SDL2
SDL2, DXGI
Select windowing backend. GL renderers force SDL2 and D3D renderers force DXGI for now, so you don't need to specify this.
AUDIO_API
SDL2
SDL2
Select audio backend. There's only one right now.
CONTROLLER_API
SDL2
SDL2
Specify list of controller backends to use. There's only one right now.
BETTERCAMERA
0
0, 1
If 1, build with analog camera support (uses Puppycam).
NODRAWINGDISTANCE
0
0, 1
If 1, build with disabled draw distance (every object is active at all times). May affect gameplay.
TEXTURE_FIX
0
0, 1
If 1, enable various texture-related bugfixes (e.g. fixes the smoke texture).
EXT_OPTIONS_MENU
1
0, 1
If 1, enable Options menu. Accessed from the Pause menu by pressing R.
EXTERNAL_DATA
0
0, 1
If 1, load textures and soundbanks from external files. Allows you to use texture packs. The default data is copied to a res folder next to the produced executable. (En Switch va en la carpeta raíz), para PC no lo genera
DISCORDRPC
0
0, 1
If 1, enable Discord Rich Presence support. Only works on x86_64.
TEXTSAVES
0
0, 1
If 1, use INI-based save format instead of binary EEPROM dumps. Experimental.
Optional Steps
If you want a Banner for the NRO file, you need to put a file called nx_icon.jpg on the sm64ex folder and BEFORE run the last make command you edit the Makefile file and replace the next lines
Code:
# add `--icon=$(APP_ICON)` to this when we get a suitable icon
%.nro: %.stripped %.nacp
@elf2nro $< $@ --nacp=$*.nacp
@echo built ... $(notdir $@)
By these:
Code:
# add `--icon=$(APP_ICON)` to this when we get a suitable icon
%.nro: %.stripped %.nacp
@elf2nro $< $@ --nacp=$*.nacp --icon=$(APP_ICON)
@echo built ... $(notdir $@)
After the NRO file is created, you can use SAK Switch Army Knife to make a NSP forwarder installable on the HOS.
Retrospective from a noob here, now that I have compiled a fully working .nro after the best part of two weeks trying!
First, for anyone using the EXTERNAL_DATA build flag, you must copy the res folder containing the base.zip with the .nro, else the game will crash on boot. May be obvious to anyone who isn’t a noob like me!
@impeeza - thank you so much for the write up on page 17, it holds up perfectly given how long ago it was originally written and has everything you need to know if you have no prior experience in this stuff, thanks again!
Also, a question - What can I put in the res folder that is compatible with this build? I have the Render96 HD texture pack working, but without the models too, the game just looks like N64 era Mario in a modern game?!
I have the .pak texture packs from a previous .nsp installation of NX, but can’t seem to get them to work with my sm64ex build. Any help is gratefully appreciated!
Big thanks to @fgsfds as well for yet another fantastic port! I think I’ve inadvertently collected most if not all of them now!
Retrospective from a noob here, now that I have compiled a fully working .nro after the best part of two weeks trying!
First, for anyone using the EXTERNAL_DATA build flag, you must copy the res folder containing the base.zip with the .nro, else the game will crash on boot. May be obvious to anyone who isn’t a noob like me!
@impeeza - thank you so much for the write up on page 17, it holds up perfectly given how long ago it was originally written and has everything you need to know if you have no prior experience in this stuff, thanks again!
Also, a question - What can I put in the res folder that is compatible with this build? I have the Render96 HD texture pack working, but without the models too, the game just looks like N64 era Mario in a modern game?!
I have the .pak texture packs from a previous .nsp installation of NX, but can’t seem to get them to work with my sm64ex build. Any help is gratefully appreciated!
Big thanks to @fgsfds as well for yet another fantastic port! I think I’ve inadvertently collected most if not all of them now!
if those are models, you probably have to compile them with the project. that's how it is with the pc version. btw, there's a packs folder in dynos, but I do not know what a pak file is.
if those are models, you probably have to compile them with the project. that's how it is with the pc version. btw, there's a packs folder in dynos, but I do not know what a pak file is.
Think it’s an outdated format for textures. There’s a bunch of tools out there to unpack them to turn them into something readable, but none of them work.
I’m guessing you mean drop them in the appropriate folders (e.g. ‘actors’) once the repo is downloaded, prior to running make?
Think it’s an outdated format for textures. There’s a bunch of tools out there to unpack them to turn them into something readable, but none of them work.
I’m guessing you mean drop them in the appropriate folders (e.g. ‘actors’) once the repo is downloaded, prior to running make?
well, the render96ex version requires you to compile with the added models, then you can modify the models, but textures just need to be added to the res folder afaik. it could be gfx, but I don't remember. textures don't need to be compiled with them on, at least with render96ex. I may have had a problem recompiling the nx version, but I don't remember if it was a specific version or even that at all. I'm thinking I had some issues with a switch version of something.
well, the render96ex version requires you to compile with the added models, then you can modify the models, but textures just need to be added to the res folder afaik. it could be gfx, but I don't remember. textures don't need to be compiled with them on, at least with render96ex. I may have had a problem recompiling the nx version, but I don't remember if it was a specific version or even that at all. I'm thinking I had some issues with a switch version of something.
That sounds about right. I managed to compile Render96ex for PC but ran into issues trying to get the Switch version to work. I’ll probably take another stab at it now I know a little bit more about what I’m doing xD
The working file structure is sdmc/switch/sm64/res/gfx so well remembered if it’s been a while since you looked at it
That sounds about right. I managed to compile Render96ex for PC but ran into issues trying to get the Switch version to work. I’ll probably take another stab at it now I know a little bit more about what I’m doing xD
The working file structure is sdmc/switch/sm64/res/gfx so well remembered if it’s been a while since you looked at it
I think it was the nx version, but the render96ex or something mentioned that the switch compile is broken. even if you use the one suggested at the bottom, it doesn't work. however, apparently, it was just a guess as to if it worked. it doesn't with the nx version. I think @impeeza or @binkinator confirmed it. he said he could build it last year, but now it no longer works.
I think it was the nx version, but the render96ex or something mentioned that the switch compile is broken. even if you use the one suggested at the bottom, it doesn't work. however, apparently, it was just a guess as to if it worked. it doesn't with the nx version. I think @impeeza or @binkinator confirmed it. he said he could build it last year, but now it no longer works.
I’ve made good progress since the last messages. I found some HD models for Mario and Bowser that work very well. I’ve also been playing around with early versions (1.3) of the Render96 model pack to what works and what doesn’t.
The PC version won’t compile, but I attribute that to age and lack of updates. The Switch version compiles and appears to load the models, but…
Errbody Purple!
So two questions, 1) what tf is going on? And 2) what are the options for HD models on fgsfdsfgs fork? My goal is to get it looking as good as the .nsp version of sm64nx if that is at all helpful.
I’ve made good progress since the last messages. I found some HD models for Mario and Bowser that work very well. I’ve also been playing around with early versions (1.3) of the Render96 model pack to what works and what doesn’t.
The PC version won’t compile, but I attribute that to age and lack of updates. The Switch version compiles and appears to load the models, but…
Errbody Purple! View attachment 371551
So two questions, 1) what tf is going on? And 2) what are the options for HD models on fgsfdsfgs fork? My goal is to get it looking as good as the .nsp version of sm64nx if that is at all helpful.
Had that happen one time. Just need to make sure all the HD Textures are in it. Once had a LOT of Purple Items, and Characters. LOL. Just wishing could Compile it into a NSP like those other Builds
It's a good time to be a first generation Pokemon fan. But when was it not a good time to be one? In recent weeks we've seen a native LOVE2D recreation of Pokemon Red...
If you've been waiting for an excuse to replay Super Mario Sunshine and happen to have up to nine friends, do I have some good news for you. Released earlier today...
Images for the rumoured Zelda-themed limited edition Switch 2 for The Legend of Zelda's 40th Anniversary have started to leak online.
The leak shows only the...
Hoenn to the ROM hacking scene is like Kanto to the official games. It's everywhere. At this point you've probably played through Pokemon Emerald with a party of...
After being announced last year, the fan-made remake Gamma Emerald has finally gotten its first early access release. A complete rebuild of fan-favourite Pokemon...
The golden age of emulation on the Switch continues as a native Dolphin port was released by @Nagaa earlier today. Included in this port, we're looking at cover art...
With the latest entry to the Fire Emblem series, Fortune's Weave, set to launch in September, Nintendo have today announced a new Nintendo Direct to put it soundly in...
Harbour Masters were cutting it close with this one, promising a release of their Banjo Kazooie PC port "Lighthouse" by the end of this month. And they did not...
So I got pretty lucky on this one. Having ordered the physical version of Oblivion Remastered on Switch 2, I had it delivered earlier today, beating out the official...
Though we knew all the way back in May that this was coming, the exact numbers remained a mystery for prospective Nintendo gamers in the UK. If you happen to have...
Images for the rumoured Zelda-themed limited edition Switch 2 for The Legend of Zelda's 40th Anniversary have started to leak online.
The leak shows only the...
Though we knew all the way back in May that this was coming, the exact numbers remained a mystery for prospective Nintendo gamers in the UK. If you happen to have...
After being announced last year, the fan-made remake Gamma Emerald has finally gotten its first early access release. A complete rebuild of fan-favourite Pokemon...
With the latest entry to the Fire Emblem series, Fortune's Weave, set to launch in September, Nintendo have today announced a new Nintendo Direct to put it soundly in...
Over the past week, rumors have started swirling as Redditors (probably correctly) deduced the title of the upcoming Elder Scrolls game, which will apparently be...
It's a good time to be a first generation Pokemon fan. But when was it not a good time to be one? In recent weeks we've seen a native LOVE2D recreation of Pokemon Red...
So I got pretty lucky on this one. Having ordered the physical version of Oblivion Remastered on Switch 2, I had it delivered earlier today, beating out the official...
GBAtemp is and always has been an independent community. Since 2002 our staff have voluntarily kept the site running, added new forums, features, provided constant...
Hoenn to the ROM hacking scene is like Kanto to the official games. It's everywhere. At this point you've probably played through Pokemon Emerald with a party of...
Over the weekend, SQUARE ENIX and Disney & Pixar Games shared the release window for the highly anticipated action-RPG Kingdom Hearts IV. A new trailer also...