Lunos

Random Uruguayan User

Male
Montevideo (Uruguay)
Seen 6 Minutes Ago
Posted 6 Minutes Ago
2,906 posts
13.8 Years
Explained as simply as possible and straight to the point. You guys know me.
The reason why I'm writing this is because I learned how to build rgbds from the source sometime ago and I never wrote a tutorial about that.
Cygwin is lame compared to WSL, so I hope this tutorial replaces the other one I wrote.

1) Enable WSL.
To do this, you have 2 different options, pick whichever you prefer.
Keep in mind that you'll have to restart your PC afterward.
  • Open the Windows Command Prompt as Administrator and type
    dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all
  • Open the Windows Features window (Win+R and type
    optionalfeatures
    )
    and select "Windows Subsystem for Linux"

2) WSL is just a shell, it's worthless without a Linux distro, so go and install one.
I personally recommend Ubuntu 18.04 or 20.04.
You can do it either from the Windows Store, or alternatively by downloading them from the Ubuntu Wiki.

.appx packages can be installed by double clicking on them, but if you're like me and are prone to disable things you don't use in your Windows installation, like for example the Windows Store, you can uncompress the folder and run ubuntu.exe instead.

3) Once you're done with the basic setup, type
sudo apt update && sudo apt upgrade
to update your repository.

4) Now that we have WSL installed and a Linux distro going, it's time to download all the packages we'll need to compile Pokered/crystal.
sudo apt install make gcc git bison pkg-config libpng-dev
If for some reason that doesn't work for you, then use:
sudo apt-get install make gcc git bison pkg-config libpng-dev
5) This is rather optional, but I suggest you to make a folder for your disassembly and/or decomp work.
My go to is to make a folder in
C:\Users\YOUR_USERNAME
called "Decomps" or something like that.
You can do this either from the Windows File Explorer normally, or you can do
cd /mnt/c/Users/YOUR_USERNAME
and
mkdir Decomps
.

6) Let's move to that folder. Assuming we just did
cd /mnt/c/Users/YOUR_USERNAME
and then
mkdir Decomps
, we'll type
cd Decomps
.

7) Let's clone rgbds and either pokered or pokecrystal. To do so:
git clone https://github.com/gbdev/rgbds
git clone https://github.com/pret/pokered
8) Now's time to build rgbds.
cd rgbds
make -jN
sudo make install
Note: "N" stands for the number of CPU Threads you want to assign to the compiler. The more threads, the faster it'll go.

9) And now we'll just go to the folder of pokered or pokecrystal, and build a ROM normally.
cd ../pokered
make -jN
Note: "N" stands for the number of CPU Threads you want to assign to the compiler. The more threads, the faster it'll go.

And that's pretty much it.