diff options
| author | coco875 <59367621+coco875@users.noreply.github.com> | 2024-02-22 16:33:46 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-22 08:33:46 -0700 |
| commit | 4c4cb36b4d0a12543c17067fe7349937ca72a0c1 (patch) | |
| tree | a04f69ed043d566ca59f73e49025a387edb2cf6b /docs | |
| parent | 49ab41f0c5e39c9d28b1f1ce14d681748f0c7b3f (diff) | |
add compatibilty for Windows build (#564)
* Add Windows Support
* Modify readme instructions for windows building
* Remove unused files
* Modified extract_assets.py, new_extract_assets.py, and build.py to work on windows
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/basics/BUILD_WINDOWS.md | 101 | ||||
| -rw-r--r-- | docs/basics/compiling.md | 13 |
2 files changed, 9 insertions, 105 deletions
diff --git a/docs/basics/BUILD_WINDOWS.md b/docs/basics/BUILD_WINDOWS.md deleted file mode 100644 index cb7fdafe8..000000000 --- a/docs/basics/BUILD_WINDOWS.md +++ /dev/null @@ -1,101 +0,0 @@ -@page buildwindows Compiling for Windows -## Compiling mk64 Decomp In Windows - -***This method is not recommended nor supported. However, it is the only solution to build in W7/W8. WSL is the path of least resistance, use that not this*** - -> Building decomp using msys on Windows is a journey.. A journey akin to crawling over broken glass in the dark. -- leogames - -The extraneous and convoluted process to building mk64 decomp on Windows begins with disabling your anti-virus program or adding an exception to the mk64 decomp folder and the msys2 installation folder. -Please note that this action may impact the security of your system. Prior to proceeding, make sure to understand the increased security risks that may result from this step. Nobody except you, is responsible and liable for your system and its security. - -### Preamble -Any misteps may require a complete uninstall of `MSYS2 MinGW x64` and restarting from the very beginning. -It is unknown if `MSYS MinGW x32` is supported (most likely not). - -### Step 1: Download MSYS2 MinGW x64 - -https://www.msys2.org/ - -Follow the initial instructions to update the base packages. Ignore installing any extra packages in-case they conflict with the below steps. - -MinGW is a separate program from Msys2. However, it must be wrapped right into msys2. -Compiling recomp requires steps using<br>`MSYS2 MSYS` *and* `MSYS2 MinGW x64`. The instructions will clearly differentiate which terminal program to launch and run in the section titles. - -##### *Why flip-flop between both?* -Compiling the recomp executable that generates the source files for compiling the compiler requires capstone. A disassembly, analysis, and reverse-engineering framework. Capstone is only available on `MSYS2 MinGW x64`. It is not available on `MSYS2 MSYS`. However, compiling the compiler itself requires -`MSYS2 MSYS` because it contains an equivallent dependency for `mman`. A memory mapping library. `MSYS2 MinGW x64` does not contain an equivallent dependancy. - - -### Step 2: Install Dependancies in MSYS2 MinGW x64 -``` -pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-capstone pkgconf make python3 git -``` - -### Step 3: Install Dependencies in MSYS2 MSYS -``` -pacman -S gcc -``` - -### Step 3.5: Rename include in recomp.cpp -For some reason on Windows capstone is inside of a capstone folder. -``` -#include <capstone/capstone.h> -``` - - -### Step 4: Get Binutils -Download and install the mips64 tool chain: -https://github.com/N64-tools/mips64-gcc-toolchain - -Merge the inner folders (bin, share, etc.) with the respective folders in `C:\msys64\mingw64\` - -### Step 5: Compiling recomp.exe in MSYS2 MinGW x64 -In `MSYS2 MinGW x64` run in `mk64/tools/ido5.3_recomp/`: -``` -g++ recomp.cpp -o recomp -g -lcapstone -Dugen53 -``` - -### Step 6: Generate Recomp Source Files in MSYS2 MinGW x64 - -Generate the .c files which will compile into the recomp binaries. -mk64 requires the following compiler binaries: `as1, cc, cfe, copt, ugen, ujoin, uld, umerge, uopt` - -In `MSYS2 MinGW x64` run in the directory `mk64/tools/ido5.3_recomp/`: -``` -./recomp ../ido5.3_compiler/usr/lib/as1 > as1_c.c -./recomp ../ido5.3_compiler/usr/lib/cc > cc_c.c -./recomp ../ido5.3_compiler/usr/lib/cfe > cfe_c.c -./recomp ../ido5.3_compiler/usr/lib/copt > copt_c.c -./recomp ../ido5.3_compiler/usr/lib/ugen > ugen_c.c -./recomp ../ido5.3_compiler/usr/lib/ujoin > ujoin_c.c -./recomp ../ido5.3_compiler/usr/lib/uld > uld_c.c -./recomp ../ido5.3_compiler/usr/lib/umerge > umerge_c.c -./recomp ../ido5.3_compiler/usr/lib/uopt > uopt_c.c -``` -If you get an assertion failed error. Then the directory to the compiler is incorrect. -The binary for cc is in `/ido5.3_compiler/usr/bin/` so do: -``` -./recomp ../ido5.3_compiler/usr/bin/cc > cc_c.c -``` -### Step 7: Compiling the recomp compiler in MSYS2 MSYS -In `MSYS2 MSYS` run in the directory `mk64/tools/ido5.3_recomp/`: -``` -gcc libc_impl.c as1_c.c -o as1 -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c cc_c.c -o cc -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c cfe_c.c -o cfe -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c copt_c.c -o copt -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c ugen_c.c -o ugen -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c ujoin_c.c -o ujoin -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c uld_c.c -o uld -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c umerge_c.c -o umerge -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -gcc libc_impl.c uopt_c.c -o uopt -g -fno-strict-aliasing -lm -no-pie -DIDO53 -O2 -``` -`-O2` is an optional optimization flag. - -### Step 8: Compile mk64 in MSYS2 MinGW x64 -In `/mk64/` run: -``` -make -j# -``` -Replace # with your number of CPU cores for quicker compilation. diff --git a/docs/basics/compiling.md b/docs/basics/compiling.md index 59ade96da..f8495f980 100644 --- a/docs/basics/compiling.md +++ b/docs/basics/compiling.md @@ -27,9 +27,16 @@ Review the [n64decomp/sm64](https://github.com/n64decomp/sm64) readme for instru # Windows -Not recommended. Use WSL unless this is your only option. +*N64 decomp does not mesh well with Windows. However, this process has been refined to be as painless as possible. WSL is a great alternative if issues arise.* -[Instructions here](buildwindows.html) +### Requirements +- Clone the repo or download the zip on your computer +- Dowload toolchain from [here](https://github.com/coco875/mk64-tools/releases/download/v0.0.6/mips-tools-chain-windows.zip) + +### Setup +1. copy from mips-tools-chain-windows.zip the folder `mingw64` into tools folder in the repo +2. Open a terminal (cmd or powershell) in the repo folder and run `"tools\mingw64\w64devkit.exe"` and after `make` +3. Wait for the build to finish and Enjoy! # macOS @@ -55,7 +62,6 @@ docker run --rm -v .:/mk64 mk64 For example: ```bash -docker run --rm -v .:/mk64 mk64 make -C tools docker run --rm -v .:/mk64 mk64 make ``` @@ -65,7 +71,6 @@ Place a US version of Mario Kart 64 called `baserom.us.z64` into the project fol Run the following commands after pulling: ```bash -make -C tools make -j ``` |
