diff --git a/Makefile b/Makefile index 4eb3a52..1a51eb7 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,6 @@ VTF2PNG:=vtf2png SFZ2N64:=sfz2n64 $(SKELATOOL64): - chmod +x skelatool64/setup_dependencies.sh skelatool64/setup_dependencies.sh @@ -559,7 +558,6 @@ $(BASE_TARGET_NAME).z64: $(CODESEGMENT)_no_debug.o $(OBJECTS) $(DATA_OBJECTS) $( $(LD) -L. -T $(CP_LD_SCRIPT)_no_debug.ld -Map $(BASE_TARGET_NAME)_no_debug.map -o $(BASE_TARGET_NAME).elf $(OBJCOPY) --pad-to=0x100000 --gap-fill=0xFF $(BASE_TARGET_NAME).elf $(BASE_TARGET_NAME).z64 -O binary makemask $(BASE_TARGET_NAME).z64 - chmod +x tools/romfix64.sh sh tools/romfix64.sh $(BASE_TARGET_NAME).z64 # with debugger @@ -579,7 +577,6 @@ $(BASE_TARGET_NAME)_debug.z64: $(CODESEGMENT)_debug.o $(OBJECTS) $(DATA_OBJECTS) $(LD) -L. -T $(CP_LD_SCRIPT)_debug.ld -Map $(BASE_TARGET_NAME)_debug.map -o $(BASE_TARGET_NAME)_debug.elf $(OBJCOPY) --pad-to=0x100000 --gap-fill=0xFF $(BASE_TARGET_NAME)_debug.elf $(BASE_TARGET_NAME)_debug.z64 -O binary makemask $(BASE_TARGET_NAME)_debug.z64 - chmod +x tools/romfix64.sh sh tools/romfix64.sh $(BASE_TARGET_NAME).z64 clean: diff --git a/README.md b/README.md index b557efa..45644e0 100644 --- a/README.md +++ b/README.md @@ -36,78 +36,32 @@ Updates are constantly being made to the game, so we recommend checking out the ## How to build -First, you will need to setup [Modern SDK](https://crashoveride95.github.io/n64hbrew/modernsdk/startoff.html). - -After installing modern sdk you will want to also install - -```sh -sudo apt install libnustd -``` - -Next, you will need to install the latest version of Blender 3.6 LTS (please don't use e.g. 4.x, only 3.6.x will work correctly). Then set the environment variable `BLENDER_3_6` to be the absolute path where the Blender 3.6 executable is located on your system. - -```sh -sudo snap install blender --channel=3.6lts/stable --classic -``` - -e.g. add this to your ~/.bashrc if you used snap (or you can use `which blender` to find the path of Blender 3.6) - -```bash -export BLENDER_3_6="/snap/bin/blender" -``` - -
- -You will need to install Python `vpk`: - -```sh -sudo apt install pipx -pipx ensurepath -pipx install vpk -``` - -
- Clone the Portal64 repo or download the zip. ```sh -sudo apt install git +sudo apt install git -y git clone https://github.com/lambertjamesd/portal64.git cd portal64 ``` -Setup and install dependencies for `skelatool64` +Setup and install dependencies. +The following commands allow the scripts to run on the system, then it runs the setup. + +As always it is good practice look over scripts from the internet before running them on your system. ```sh -echo "deb [trusted=yes] https://lambertjamesd.github.io/apt/ ./" \ - | sudo tee /etc/apt/sources.list.d/lambertjamesd.list -sudo apt update -sudo apt install vtf2png sfz2n64 mpg123 sox imagemagick unzip -`` -``` -Install ffmpeg 4.3.1 -``` -sudo snap install ffmpeg # version 4.3.1 + +sudo chmod +x skelatool64/setup_dependencies.sh +sudo chmod +x tools/romfix64.sh +sudo chmod +x setup.sh +./setup.sh ``` +Alternatively, you could just follow the manual setup instructions [here](./documentation/manual_setup.md). -
-Install lua5.4 (You may need to remove other installed versions first, skelatool64 needs to be built with luac 5.4!) -```sh -sudo apt install lua5.4 liblua5.4-dev liblua5.4-0 -``` -
+After setup, You need to add the following files from where Portal is installed to the folder `vpk/` OR create a symbolic link to the `Portal` folder there (see [vpk/add_vpk_here.md](./vpk/add_vpk_here.md) for more details!). -You will need to install nodejs. You can use apt for this - -```sh -sudo apt install nodejs -``` - -
- -You then need to add the following files from where Portal is installed to the folder `vpk/` OR create a symbolic link to the `Portal` folder there (see [vpk/add_vpk_here.md](./vpk/add_vpk_here.md) for more details!). You can add multiple languages if desired. ``` @@ -158,12 +112,15 @@ make clean # Build (default build with english audio) make +``` You can also prepare to build the ROM with additional audio languages, like this (multiple commands per build possible): - ``` make french_audio + make german_audio + make russian_audio + make spanish_audio ``` You still have run `make` after this. diff --git a/documentation/manual_setup.md b/documentation/manual_setup.md new file mode 100644 index 0000000..89b2079 --- /dev/null +++ b/documentation/manual_setup.md @@ -0,0 +1,70 @@ +## How to build + +First, you will need to setup [Modern SDK](https://crashoveride95.github.io/n64hbrew/modernsdk/startoff.html). + +After installing modern sdk you will want to also install + +```sh +sudo apt install libnustd +``` + +Next, you will need to install the latest version of Blender 3.6 LTS (please don't use e.g. 4.x, only 3.6.x will work correctly). Then set the environment variable `BLENDER_3_6` to be the absolute path where the Blender 3.6 executable is located on your system. + +```sh +sudo snap install blender --channel=3.6lts/stable --classic +``` + +e.g. add this to your ~/.bashrc if you used snap (or you can use `which blender` to find the path of Blender 3.6) + +```bash +export BLENDER_3_6="/snap/bin/blender" +``` + +
+ +You will need to install Python `vpk`: + +```sh +sudo apt install pipx +pipx ensurepath +pipx install vpk +``` + +
+ +Clone the Portal64 repo or download the zip. + +```sh +sudo apt install git +git clone https://github.com/lambertjamesd/portal64.git +cd portal64 +``` +Setup and install dependencies for `skelatool64` + +```sh +echo "deb [trusted=yes] https://lambertjamesd.github.io/apt/ ./" \ + | sudo tee /etc/apt/sources.list.d/lambertjamesd.list +sudo apt update +sudo apt install vtf2png sfz2n64 mpg123 sox imagemagick unzip +`` +``` +Install ffmpeg 4.3.1 +``` +sudo snap install ffmpeg # version 4.3.1 + +``` + +
+ +Install lua5.4 (You may need to remove other installed versions first, skelatool64 needs to be built with luac 5.4!) + +```sh +sudo apt install lua5.4 liblua5.4-dev liblua5.4-0 +``` +
+ +You will need to install nodejs. You can use apt for this + +```sh +sudo apt install nodejs +``` diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..cb18f36 --- /dev/null +++ b/setup.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Add repositories to system sources +echo "deb [trusted=yes] https://crashoveride95.github.io/apt/ ./" | sudo tee /etc/apt/sources.list.d/n64sdk.list +echo "deb [trusted=yes] https://lambertjamesd.github.io/apt/ ./" | sudo tee /etc/apt/sources.list.d/lambertjamesd.list + +# Update system package lists +sudo dpkg --add-architecture i386 +sudo apt update + +# Install various packages +sudo apt install binutils-mips-n64 gcc-mips-n64 git imagemagick liblua5.4-0 liblua5.4-dev libnustd lua5.4 make makemask mpg123 newlib-mips-n64 nodejs n64sdk root-compatibility-environment sfz2n64 sox unzip vtf2png -y + +# Ubuntu WSL needs these for some reason. +sudo apt-get update && sudo apt-get install libnustd libxfixes3 libxi6 libxkbcommon0 libxxf86vm1 libgl1-mesa-glx -y + +# Install Blender and FFmpeg specific versions via snap +sudo snap install blender --channel=3.6lts/stable --classic +sudo snap install ffmpeg + +# Append environment variables to .bashrc +echo 'export N64_LIBGCCDIR=/opt/crashsdk/lib/gcc/mips64-elf/12.2.0' >> ~/.bashrc +echo 'export BLENDER_3_6=/snap/bin/blender' >> ~/.bashrc +echo 'export PATH=$PATH:/opt/crashsdk/bin' >> ~/.bashrc +echo 'export ROOT=/etc/n64' >> ~/.bashrc + +# Install pipx packages +sudo apt install pipx -y +pipx ensurepath --force +pipx install vpk + +# Source the updated .bashrc to apply changes in the current terminal +source ~/.bashrc + +echo "Setup is almost complete. Add the files from the Portal folder to portal64/vpk" + +read -p "When complete, press Enter to finish setup." + +# Displaying 'Setup complete' message after user input +echo "Setup complete. Please restart the terminal if paths are not updated."