Skip to content

Commit 9680714

Browse files
CowSoftwaresnesrev
authored andcommitted
Overhaul MSYS2 compilation instruction and make the Switch instruction work. (#27)
### Description People seemed to be having issues compiling the game on MSYS2 so this PR fixes all of it. And I also overhauled the instruction to make it look prettier. This also updates the Switch compiling instructions to make it work. ### Will this Pull Request break anything? No. ### Suggested Testing Steps See if it compiles.
1 parent 6276860 commit 9680714

File tree

1 file changed

+26
-19
lines changed

1 file changed

+26
-19
lines changed

BUILDING.md

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Requirements
22
* A Super Metroid rom (Make sure to rename it to `sm.smc`)
33
* libsdl2-dev
4+
* Super Metroid repo `git clone --recursive https://github.com/snesrev/sm`
45

56
For Linux/MacOS you must install these for your desired OS:
67
* Ubuntu/Debian: `sudo apt install libsdl2-dev`
@@ -14,18 +15,26 @@
1415

1516
Dependencies and requirements:
1617

17-
Note: *Make sure you're using MINGW64, otherwise it won't work.*
1818
* The `libsdl2-dev` library
1919
* [MSYS2](https://www.msys2.org)
20+
21+
Note: *Make sure you're using MINGW64 and you're in `sm` folder in the terminal.*
2022

2123
1. Install MSYS2 on your machine.
22-
2. Clone the SM repository. `git clone https://github.com/snesrev/sm`
23-
3. Place the copy of your rom in the main directory.
24-
4. Install `libsdl2-dev` with `sdl2-config --cflags`
25-
5. After that it outputs `-IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main`, type `sdl2-config --libs`, it should output `-LC:/msys64/mingw64/lib -lmingw32 -mwindows -lSDL2main -lSDL2`
26-
6. Now install Make and GCC, type `pacman -S make && pacman -S mingw-w64-x86_64-gcc`
24+
2. Place the copy of your rom in the main directory.
25+
3. Install the necessary dependencies by inputting this command in the terminal.
2726

28-
NOTE: *Make sure you're in the `sm` directory.*
27+
```sh
28+
pacman -S mingw-w64-x86_64-SDL2 && pacman -S make && pacman -S mingw-w64-x86_64-gcc
29+
```
30+
4. Type `sdl2-config --cflags`, it should output:
31+
```sh
32+
-IC:/msys64/mingw64/include/SDL2 -Dmain=SDL_main
33+
```
34+
5. After that type `sdl2-config --libs`, should output:
35+
```sh
36+
-LC:/msys64/mingw64/lib -lmingw32 -mwindows -lSDL2main -lSDL2
37+
```
2938

3039
After you've done installing everything, cd to `sm` folder. Type `make`
3140
In order to speed up the compilation, type `make -j16`
@@ -53,7 +62,7 @@ Download VS installer. On installer prompt, make sure you're on "Workloads" and
5362

5463
# Linux/MacOS
5564

56-
Cd to your SM root folder and open the terminal and type:
65+
CD to your SM root folder and open the terminal and type:
5766
```sh
5867
make
5968
```
@@ -70,21 +79,19 @@ CC=clang make # specify compiler
7079
Dependencies and requirements:
7180

7281
* The `switch-sdl2` library
73-
* MSYS2
74-
* [DevKitPro](https://devkitpro.org/wiki/Getting_Started)
82+
* [DevKitPro](https://github.com/devkitPro/installer)
7583
* [Atmosphere](https://github.com/Atmosphere-NX/Atmosphere)
7684

77-
Note: *You must have MINGW64 open and affirm you're in the `sm` root folder.*
78-
79-
1. Make sure you've installed DevKitPro and Atmosphere.
80-
2. Type `(dkp-)pacman -S git switch-dev switch-sdl2 switch-tools` to install the Switch SDL2 deps.
81-
3. Now go to the `switch` folder inside MSYS2 `cd platform/switch/`
82-
4. Type `make` to build the game.
83-
5. Copy the `.ini`, `nro` and the `smc` file and put them in your Switch.
85+
1. Make sure you've installed Atmosphere on your Switch.
86+
2. Please download the DevKitPro version of MSYS2 through their installer, as the default MSYS2 causes issues with windows compiling.
87+
3. Now that you've installed DevKitPro, open up the location you've installed DevKitPro to, then find `mingw64.exe` inside `msys2` located in `devkitPro` folder.
88+
4. Type `pacman -S git switch-dev switch-sdl2 switch-tools` in the terminal to install the `switch-sdl2` library.
89+
5. CD to `switch` folder by typing `cd src/platfrom/switch` in the terminal on the `sm` root folder.
90+
6. type `make` to compile the Switch Port.
91+
7. Transfer the `.ini`, `nro`, `ncap` and your rom file to the Switch.
8492

85-
**OPTIONAL STEPS**
93+
**OPTIONAL STEP**
8694

8795
```sh
8896
make -j$(nproc) # To build using all cores
89-
nxlink -s zelda3.nro # To test the build directly onto the Switch
9097
```

0 commit comments

Comments
 (0)