Created
November 20, 2019 22:55
-
-
Save HumanGamer/b629ce878f61a53c0e90a2939bd0fbef to your computer and use it in GitHub Desktop.
Scripts for building Pokemon Ruby from pret through WSL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set distro=Debian | |
pushd %~dp0 | |
if "%1"=="initwsl" ( | |
echo Configuring WSL... | |
wsl -d %distro% -u root -e bash -l -i -c "sudo ln -s /proc/self/mounts /etc/mtab" | |
wsl -d %distro% -u root -e bash -l -i -c "apt update && apt -y install wget xz-utils libxml2 gnupg build-essential libpng-dev" | |
wsl -d %distro% -u root -e bash -l -i -c "wget -O - https://gist.githubusercontent.com/HumanGamer/457f1718628edb02212fc21546c53c26/raw/c48211bd9b03274f50320faeb9ea2223907b515a/configure-pret.sh | bash" | |
echo Done | |
) else if "%1"=="setup" ( | |
if exist "game/tools/agbcc" ( | |
echo Error: Already setup | |
) else ( | |
echo Cloning Repositories... | |
git clone --recursive https://github.com/pret/pokeruby game | |
git clone --recursive https://github.com/pret/agbcc | |
echo Done | |
rem agbcc stuff | |
cd agbcc | |
echo Compiling agbcc... | |
wsl -d %distro% -e bash -l -i -c "./build.sh" | |
echo Done | |
echo Configuring agbcc... | |
wsl -d %distro% -e bash -l -i -c "./install.sh ../game" | |
echo Done | |
) | |
) else if "%1"=="build" ( | |
if exist "game" ( | |
cd game | |
echo Building Pokemon Ruby v1.2... | |
wsl -d %distro% -e bash -l -i -c "make-max ruby_rev2" | |
echo Done | |
echo Copying to Output Folder... | |
if not exist "..\output\" mkdir ..\output | |
copy pokeruby_rev2.gba ..\output\ | |
echo Done | |
) else ( | |
echo Please run poke setup before continuing. | |
) | |
) else if "%1"=="launch" ( | |
if exist "output/pokeruby_rev2.gba" ( | |
echo Launching pokeruby_rev2.gba | |
start visualboyadvance-m output/pokeruby_rev2.gba | |
) else ( | |
echo Error: Game hasn't been built. | |
echo Please build the game before attempting to run it. | |
) | |
) else if "%1"=="all" ( | |
cd %~dp0 | |
call poke.bat setup | |
cd %~dp0 | |
call poke.bat build | |
cd %~dp0 | |
call poke.bat launch | |
) else ( | |
echo Usage poke ^<setup/build/launch/all^> | |
) | |
popd |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment