2017-12-12 23:50:39 +00:00
# Instructions
2020-09-15 12:36:11 +00:00
These instructions explain how to set up the tools required to build **pokecrystal** , including [**rgbds** ](https://github.com/gbdev/rgbds ), which assembles the source files into a ROM.
2016-01-31 23:36:18 +00:00
2017-12-12 23:50:39 +00:00
If you run into trouble, ask for help on IRC or Discord (see [README.md ](README.md )).
2016-03-16 21:57:03 +00:00
2016-01-31 23:36:18 +00:00
2018-08-30 01:14:39 +00:00
## Windows 10
2014-07-24 03:42:04 +00:00
2018-09-02 01:45:00 +00:00
Download and install [**Windows Subsystem for Linux** ](https://docs.microsoft.com/en-us/windows/wsl/install-win10 ). Then open the **WSL terminal** .
2014-07-24 03:42:04 +00:00
2020-10-30 15:28:48 +00:00
Update WSL's software before continuing. If you chose Debian, Ubuntu, or another distribution that uses `apt-get` , then enter this command:
```bash
apt-get update & & apt-get upgrade
```
2018-09-02 01:45:00 +00:00
WSL has its own file system that's not accessible from Windows, but Windows files *are* accessible from WSL. So you're going to want to install pokecrystal within Windows. You'll have to change the **current working directory** every time you open WSL.
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
For example, if you want to store pokecrystal in **C:\Users\\*\<user>*\Desktop** , enter this command:
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
```bash
2018-08-30 01:14:39 +00:00
cd /mnt/c/Users/< user > /Desktop
```
2018-09-02 01:45:00 +00:00
(The Windows `C:\` drive is called `/mnt/c/` in WSL. Replace *\<user>* in the example path with your username.)
2018-08-30 01:14:39 +00:00
2020-10-30 03:23:57 +00:00
If this works, then follow [the instructions for **Linux** ](#linux ) below for whatever distribution you installed for WSL.
2018-08-30 01:14:39 +00:00
2020-10-30 03:23:57 +00:00
Otherwise, continue reading below for [the older Windows instructions ](#windows ).
2014-11-12 15:30:37 +00:00
2018-08-30 01:14:39 +00:00
## Windows
Download [**Cygwin** ](http://cygwin.com/install.html ): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit.
2018-09-02 01:45:00 +00:00
Run setup and leave the default settings. At the "**Select Packages**" step, choose to install the following, all of which are in the "**Devel**" category:
2018-08-30 01:14:39 +00:00
- `make`
- `git`
- `gcc-core`
2019-04-29 20:01:56 +00:00
Double click on the text that says "**Skip**" next to each package to select the most recent version to install.
2018-08-30 01:14:39 +00:00
2021-05-09 16:26:28 +00:00
Then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/windows ) for Windows with Cygwin to install **rgbds 0.5.1** .
2018-08-30 01:14:39 +00:00
2021-05-09 16:26:28 +00:00
**Note:** If you already have an older rgbds, you will need to update to 0.5.1. Ignore this if you have never installed rgbds before. If a version newer than 0.5.1 does not work, try downloading 0.5.1.
2018-09-02 01:45:00 +00:00
2018-09-02 03:53:39 +00:00
Now open the **Cygwin terminal** and enter the following commands.
2018-09-02 01:45:00 +00:00
Cygwin has its own file system that's within Windows, at **C:\cygwin64\home\\*\<user>** *. If you don't want to store pokecrystal there, you'll have to change the **current working directory** every time you open Cygwin.
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
For example, if you want to store pokecrystal in **C:\Users\\*\<user>*\Desktop** :
```bash
cd /cygdrive/c/Users/< user > /Desktop
```
(The Windows `C:\` drive is called `/cygdrive/c/` in Cygwin. Replace *\<user>* in the example path with your username.)
2018-09-02 03:53:39 +00:00
Now you're ready to [build **pokecrystal** ](#build-pokecrystal ).
2018-08-30 01:14:39 +00:00
2012-06-02 20:27:24 +00:00
2020-10-30 03:23:57 +00:00
## macOS
2018-09-02 01:45:00 +00:00
2020-02-25 13:59:06 +00:00
Install [**Homebrew** ](https://brew.sh/ ). Follow the official instructions.
2014-03-08 15:46:13 +00:00
2020-10-30 15:28:48 +00:00
Open **Terminal** and prepare to enter commands.
2012-06-02 20:27:24 +00:00
2021-05-09 16:26:28 +00:00
Then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/macos ) for macOS to install **rgbds 0.5.1** .
2018-09-02 01:45:00 +00:00
2018-09-02 03:53:39 +00:00
Now you're ready to [build **pokecrystal** ](#build-pokecrystal ).
2018-09-02 01:45:00 +00:00
2014-03-08 15:46:13 +00:00
2018-08-30 01:14:39 +00:00
## Linux
2017-12-12 23:50:39 +00:00
2018-09-02 03:53:39 +00:00
Open **Terminal** and enter the following commands, depending on which distro you're using.
2018-09-02 01:45:00 +00:00
2018-09-02 03:53:39 +00:00
### Debian or Ubuntu
2018-09-02 01:45:00 +00:00
To install the software required for **pokecrystal** :
2018-08-30 01:14:39 +00:00
```bash
2018-09-02 01:45:00 +00:00
sudo apt-get install make gcc git
```
2014-03-08 15:46:13 +00:00
2021-05-09 16:26:28 +00:00
Then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/source ) to build **rgbds 0.5.1** from source.
2018-08-30 01:14:39 +00:00
2018-09-02 03:53:39 +00:00
### OpenSUSE
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
To install the software required for **pokecrystal** :
2018-08-30 01:14:39 +00:00
```bash
2018-09-02 01:45:00 +00:00
sudo zypper install make gcc git
```
2018-08-30 01:14:39 +00:00
2021-05-09 16:26:28 +00:00
Then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/source ) to build **rgbds 0.5.1** from source.
2018-08-30 01:14:39 +00:00
2018-09-02 03:53:39 +00:00
### Arch Linux
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
To install the software required for **pokecrystal** :
2018-08-30 01:14:39 +00:00
```bash
2020-08-07 04:40:27 +00:00
sudo pacman -S make gcc git rgbds
2018-09-02 01:45:00 +00:00
```
2012-06-02 20:27:24 +00:00
2021-05-09 16:26:28 +00:00
Then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/arch ) for Arch Linux to install **rgbds 0.5.1** .
2018-09-02 01:45:00 +00:00
2021-05-09 16:26:28 +00:00
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/source ) to build **rgbds 0.5.1** from source.
2018-08-30 01:14:39 +00:00
2018-09-02 03:53:39 +00:00
### Termux
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
To install the software required for **pokecrystal** :
2018-08-30 01:14:39 +00:00
```bash
2018-09-02 01:45:00 +00:00
sudo apt install make clang git sed
```
To install **rgbds** :
```bash
sudo apt install rgbds
2018-08-30 01:14:39 +00:00
```
2021-05-09 16:26:28 +00:00
If you want to compile and install **rgbds** yourself instead, then follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/source ) to build **rgbds 0.5.1** from source.
2020-10-30 15:28:48 +00:00
2018-09-02 03:53:39 +00:00
### Other distros
2018-08-30 01:14:39 +00:00
2018-09-02 01:45:00 +00:00
If your distro is not listed here, try to find the required software in its repositories:
2017-09-24 05:34:44 +00:00
- `make`
2018-08-30 01:14:39 +00:00
- `gcc` (or `clang` )
2017-09-24 05:34:44 +00:00
- `git`
2018-08-30 01:14:39 +00:00
- `rgbds`
2016-01-31 23:27:32 +00:00
2021-05-09 16:26:28 +00:00
If `rgbds` is not available, you'll need to follow the [**rgbds** instructions ](https://rgbds.gbdev.io/install/source ) to build **rgbds 0.5.1** from source.
2017-09-24 05:34:44 +00:00
2018-09-02 03:53:39 +00:00
Now you're ready to [build **pokecrystal** ](#build-pokecrystal ).
## Build pokecrystal
2018-09-02 01:45:00 +00:00
2018-09-02 03:53:39 +00:00
To download the **pokecrystal** source files:
2012-06-02 20:27:24 +00:00
2015-10-22 05:15:07 +00:00
```bash
2017-04-28 04:38:14 +00:00
git clone https://github.com/pret/pokecrystal
2015-10-22 05:15:07 +00:00
cd pokecrystal
```
2013-08-03 18:57:10 +00:00
2015-10-22 05:15:07 +00:00
To build **pokecrystal.gbc** :
2014-03-08 15:46:13 +00:00
2015-10-22 05:15:07 +00:00
```bash
make
```
2018-09-02 01:45:00 +00:00
To build **pokecrystal11.gbc** :
```bash
make crystal11
```
2021-04-19 20:31:37 +00:00
### Build with a local rgbds version
2021-05-09 16:26:28 +00:00
If you have different projects that require different versions of `rgbds` , it might not be convenient to install rgbds 0.5.1 globally. Instead, you can put its files in a directory within pokecrystal, such as `pokecrystal/rgbds-0.5.1/` . Then specify it when you run `make` :
2021-04-19 20:31:37 +00:00
```bash
2021-05-09 16:26:28 +00:00
make RGBDS=rgbds-0.5.1/
2021-04-19 20:31:37 +00:00
```
```bash
2021-05-09 16:26:28 +00:00
make RGBDS=rgbds-0.5.1/ crystal11
2021-04-19 20:31:37 +00:00
```