Skip to content

Commit

Permalink
Update setup process for windows
Browse files Browse the repository at this point in the history
  • Loading branch information
TheOnlyZac committed Jul 4, 2024
1 parent 76f2358 commit 4ea01cf
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 23 deletions.
41 changes: 24 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,61 +55,68 @@ pip install -U -r requirements.txt

### Setup build environment

The `scripts` directory contains scripts for setting up the build environment on Windows and Linux, which automatically download and install the required runtime libraries. Follow the instruction for your platform below.
The project can be built on Windows (using WSL) or Linux. Follow the instructions below to set up the build environment.

#### Linux/WSL
<!--#### Linux/WSL-->

Setup wine:
1. Setup wine:
```bash
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install wine32
```

Install binutils:
2. Install MIPS assembler:
```bash
suto apt-get install binutils-mips-linux-gnu
sudo apt-get install binutils-mips-linux-gnu
```

Setup build environment:
3. Setup build environment:
```bash
cd scripts
./setup-progd-linux.sh
```

#### Windows
<!--#### Windows
*Note: Building on Windows is untested with the new build system, and may not work as expected. If you encounter issues, you can still build on Windows using WSL.*
*Prerequisites: [Chocolatey](https://chocolatey.org/install)*
Install 7zip:
1. Install 7zip:
```powershell
winget install 7zip
choco install 7zip
```
Setup build environment:
2. Setup build environment:
```powershell
.\scripts\setup-progd-windows.bat
```
```-->

### Setup binary splitting

To build the ELF , you will need to extract the original ELF file from your own legally obtained copy of the game. Mount the disk on your PC and copy the file `SCUS_971.98` from the root directory of the disc to the `disc` directory of this project.
To build the ELF, you will need to extract the original ELF file from your own legally obtained copy of the game. Mount the disk on your PC and copy the file `SCUS_971.98` from the root directory of the disc to the `disc` directory of this project.


## Building

The project can be compiled on Windows (using WSL) or Linux. It builds the executable `SCUS_971.98`.
The project can be built on Windows (using WSL) or Linux. It builds the executable `SCUS_971.98`.

First configure the project:
The configure.py script will automatically split the binary and generate the build files. Then you can build the project with Ninja.

```bash
python configure.py
ninja
```

Then build with Ninja:
If you update the config files, you will need to clean and reconfigure:

```bash
ninja
python configure.py --clean
```

To only clean and not reconfigure, run:

```bash
python configure.py --only-clean
```


Expand Down
18 changes: 12 additions & 6 deletions scripts/setup_prodg_windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ REM download_file: URL
REM downloads file using curl
:download_file
echo Downloading %~1...
curl -sS %~1 -o %TEMP%\%~nx1
set output_file=%TEMP%\progd.zip
curl -L %~1 -o %output_file%
if exist "%output_file%" (
echo File downloaded to %output_file%
) else (
call :die Failed to download file
)
goto :eof


Expand All @@ -33,17 +39,17 @@ echo
REM download required files (registry + SDK package)
call :download_file "https://github.com/TheOnlyZac/compilers/releases/download/ee-gcc2.95.2-SN-v2.73a/ee-gcc2.95.2-SN-v2.73a.zip"

REM apply environment variables from the registry file
echo Applying environment variables, please accept the UAC prompt
regedit %TEMP%\prodg_env.reg
::REM apply environment variables from the registry file
::echo Applying environment variables, please accept the UAC prompt
::regedit %TEMP%\prodg_env.reg

REM Extract the compiler to the project/tools directory
echo Extracting compiler to tools directory...
7z x -y %TEMP%\ee-gcc2.95.2-SN-v2.73a.zip -otools
7z x -y %TEMP%\progd.zip -otools

::echo Removing temporary files
echo Removing temporary files...
del %TEMP%\ee-gcc2.95.2-SN-v2.73a.zip
::del %TEMP%\ee-gcc2.95.2-SN-v2.73a.zip

echo Setup complete!
endlocal

0 comments on commit 4ea01cf

Please sign in to comment.