2020-11-25 16:28:01 +00:00
# Instructions
2024-12-25 13:59:28 +00:00
Install instructions for each supported operating system can be found in their respective directories under `docs/install/` .
Lines to those can be found under each heading.
This file only contains a short introduction to each supported system.
If you run into trouble, ask for help on Discord (see [README.md ](README.md )).
2020-11-25 16:28:01 +00:00
2024-12-25 13:59:28 +00:00
After completing the install instructions for your OS, proceed to [Building pokeemerald-expansion ](#building-pokeemerald-expansion ).
2020-11-25 16:28:01 +00:00
2020-11-27 01:21:16 +00:00
## Windows
2024-12-25 13:59:28 +00:00
**Windows needs one of the systems to build the project**
2020-11-27 01:21:16 +00:00
2024-09-11 04:36:13 +01:00
**A note of caution**: As Windows 7 and Windows 8 are officially unsupported by Microsoft, some maintainers are unwilling to maintain the Windows 7/8 instructions. Thus, these instructions may break in the future with fixes taking longer than fixes to the Windows 10/11 instructions.
2020-11-27 01:21:16 +00:00
2024-12-25 13:59:28 +00:00
On Windows, the project can be built using the following systems:
- WSL2, fastest
- WSL1, 7 times slower than WSL2
- Msys2, 20 times slower than WSL2 (**NOTE**: Currently broken on pret upstream)
- Cygwin, 30 timer slower than WSL2 (**NOTE**: Currently broken on pret upstream)
2022-09-11 19:14:49 +01:00
2024-12-25 13:59:28 +00:00
**NOTE**: Only WSL systems are recommended.
2020-11-25 16:28:01 +00:00
2024-12-25 13:59:28 +00:00
[WSL Install instructions ](docs/install/windows/WSL.md )
2020-11-25 16:28:01 +00:00
2024-12-25 13:59:28 +00:00
[Msys2 Install instructions ](docs/install/windows/MSYS2.md )
2020-11-27 01:21:16 +00:00
2024-12-25 13:59:28 +00:00
[Cygwin Install instructions ](docs/install/windows/CYGWIN.md )
2020-11-25 16:28:01 +00:00
## Linux
2024-12-25 13:59:28 +00:00
The project can be built on any Linux distribution.
Distributions with instructions:
- [Ubuntu ](docs/install/linux/UBUNTU.md )
- [Debian ](docs/install/linux/DEBIAN.md )
- [Arch Linux ](docs/install/linux/ARCH_LINUX.md )
- [NixOS ](docs/install/linux/NIXOS.md )
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
Other distributions have to infer what to do from [general instructions ](docs/install/linux/OTHERS.md ).
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
## Mac
Some extra considerations exist to get the testing system working.
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
[Mac instructions ](docs/install/mac/MAC_OS.md )
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
## ChromeOS
Only tested on x86_64 based systems.
2022-04-01 23:22:36 +01:00
2024-12-25 13:59:28 +00:00
[Chrome OS instructions ](docs/install/chromeos/CHROME_OS.md )
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
# Building pokeemerald-expansion
Follow these steps to build `pokeemerald-expansion` .
1. Navigate to the directory you want to keep the project in, be aware of any system specific limitations.
2. Download `pokeemerald-expansion` with `git`
2024-01-15 20:07:43 +00:00
```console
2024-12-25 13:59:28 +00:00
git clone https://github.com/rh-hideout/pokeemerald-expansion
2024-01-15 20:07:43 +00:00
```
2024-12-25 13:59:28 +00:00
3. Navigate to the newly downloaded project.
2024-01-15 20:07:43 +00:00
2024-12-25 13:59:28 +00:00
```console
cd pokeemerald-expansion
2020-12-23 23:02:30 +00:00
```
2024-12-25 13:59:28 +00:00
4. Build the project.
2020-12-23 23:02:30 +00:00
2024-12-25 13:59:28 +00:00
```console
make
2020-12-23 23:02:30 +00:00
```
2024-12-25 13:59:28 +00:00
5. If everything worked correctly, something very similar to this should be seen.
2020-12-23 23:02:30 +00:00
2024-12-25 13:59:28 +00:00
```console
arm-none-eabi-ld: warning: ../../pokeemerald.elf has a LOAD segment with RWX permissions
Memory region Used Size Region Size %age Used
EWRAM: 243354 B 256 KB 92.83%
IWRAM: 30492 B 32 KB 93.05%
ROM: 26072244 B 32 MB 77.70%
cd build/modern & & arm-none-eabi-ld -T ../../ld_script_modern.ld --print-memory-usage -o ../../pokeemerald.elf < objs > < libs > | cat
tools/gbafix/gbafix pokeemerald.elf -t"POKEMON EMER" -cBPEE -m01 -r0 --silent
arm-none-eabi-objcopy -O binary pokeemerald.elf pokeemerald.gba
tools/gbafix/gbafix pokeemerald.gba -p --silent
```
And the build ROM will be in the directory as `pokeemerald.gba` .
2018-06-16 23:49:53 +01:00
2020-05-21 15:29:48 +01:00
# Building guidance
2019-08-04 20:35:38 +01:00
## Parallel builds
2018-06-16 23:49:53 +01:00
2019-08-04 20:35:38 +01:00
See [the GNU docs ](https://www.gnu.org/software/make/manual/html_node/Parallel.html ) and [this Stack Exchange thread ](https://unix.stackexchange.com/questions/208568 ) for more information.
2018-08-12 02:06:27 +01:00
2020-12-23 23:02:30 +00:00
To speed up building, first get the value of `nproc` by running the following command:
2020-11-25 16:28:01 +00:00
```bash
nproc
```
Builds can then be sped up by running the following command:
```bash
make -j< output of nproc >
```
Replace `<output of nproc>` with the number that the `nproc` command returned.
2018-06-16 23:49:53 +01:00
2019-08-04 20:35:38 +01:00
`nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)).
2018-06-16 23:49:53 +01:00
2024-01-15 20:07:43 +00:00
### Other toolchains
2022-07-08 06:34:38 +01:00
2024-01-15 20:07:43 +00:00
To build using a toolchain other than devkitARM, override the `TOOLCHAIN` environment variable with the path to your toolchain, which must contain the subdirectory `bin` .
2022-07-08 06:34:38 +01:00
```bash
2024-01-15 20:07:43 +00:00
make TOOLCHAIN="/path/to/toolchain/here"
2022-07-08 06:34:38 +01:00
```
2024-01-15 20:07:43 +00:00
The following is an example:
2022-07-08 06:34:38 +01:00
```bash
2024-01-15 20:07:43 +00:00
make TOOLCHAIN="/usr/local/arm-none-eabi"
2022-07-08 06:34:38 +01:00
```
2024-01-15 20:07:43 +00:00
To compile the `modern` target with this toolchain, the subdirectories `lib` , `include` , and `arm-none-eabi` must also be present.
2022-07-08 06:34:38 +01:00
2024-01-15 20:07:43 +00:00
### Building with debug info
2018-08-12 02:13:37 +01:00
2024-01-15 20:07:43 +00:00
To build **pokeemerald.elf** with debug symbols under a modern toolchain:
2020-11-25 16:28:01 +00:00
```bash
2024-01-15 20:07:43 +00:00
make DINFO=1
2020-11-25 16:28:01 +00:00
```
2022-05-13 03:05:44 +01:00
2020-08-28 23:10:58 +01:00
# Useful additional tools
* [porymap ](https://github.com/huderlem/porymap ) for viewing and editing maps
* [poryscript ](https://github.com/huderlem/poryscript ) for scripting ([VS Code extension](https://marketplace.visualstudio.com/items?itemName=karathan.poryscript))
2024-02-08 14:32:48 +00:00
* [Tilemap Studio ](https://github.com/Rangi42/tilemap-studio ) for viewing and editing tilemaps