Skip to content

Commit

Permalink
Merge branch 'pret:main' into Pokedex_Menu_Text
Browse files Browse the repository at this point in the history
  • Loading branch information
h2o-DS authored Jan 27, 2025
2 parents 2c706fb + fb9560e commit 922ee32
Show file tree
Hide file tree
Showing 1,318 changed files with 20,239 additions and 26,638 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ IncludeBlocks: Regroup
IncludeCategories:
- Regex: '((<.+>)|("nitro/.*\.h"))'
Priority: 1
- Regex: '"(consts|constants)/.*\.h"'
- Regex: '"(consts|constants|generated)/.*\.h"'
Priority: 2
- Regex: '"(struct_(decls|defs))/.*\.h"'
Priority: 3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
with:
style: 'file' # Use repository .clang-format file
tidy-checks: '-*' # Disable clang-tidy checks
version: '18'
version: '19'
files-changed-only: false # Github returns error code 406 if more than 300 files are changed in a PR
ignore: '.github|lib|subprojects|tools'
file-annotations: false
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
/subprojects/SDATTool/
/subprojects/knarc/
/subprojects/narc/
/subprojects/metang/
/subprojects/rapidjson-*/

# CLion folders
.idea/
Expand Down
149 changes: 94 additions & 55 deletions INSTALL.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,33 @@
# Installation Instructions

<!--toc:start-->
- [Installation Instructions](#installation-instructions)
- [0. Preliminaries](#0-preliminaries)
- [1. Setting Up Your Development Environment](#1-setting-up-your-development-environment)
- [Windows with MSYS2](#windows-with-msys2)
- [Windows Subsystem for Linux](#windows-subsystem-for-linux)
- [New Installs](#new-installs)
- [Existing Installs](#existing-installs)
- [Install Build Dependencies](#install-build-dependencies)
- [MacOS](#macos)
- [Linux](#linux)
- [Ubuntu (and other Debian derivatives)](#ubuntu-and-other-debian-derivatives)
- [Arch Linux (and derivatives)](#arch-linux-and-derivatives)
- [Fedora (and derivatives)](#fedora-and-derivatives)
- [Docker](#docker)
- [2. Downloading the Repository](#2-downloading-the-repository)
- [3. Specifying a Compiler License](#3-specifying-a-compiler-license)
- [Windows (including WSL 1)](#windows-including-wsl-1)
- [Unix Systems](#unix-systems)
- [4. Building the Repository](#4-building-the-repository)
- [5. Debugger Support](#5-debugger-support)
- [Troubleshooting FAQ](#troubleshooting-faq)
- [My Build is Failing After Merging from Main](#my-build-is-failing-after-merging-from-main)
<!--toc:end-->

This document details the steps necessary to build a copy of Pokémon Platinum
(EN-US) using this repository.

## 0. Preliminaries
## Table of Contents

- [1. Setting Up Your Development Environment](#1-setting-up-your-development-environment)
- [Windows Subsystem for Linux](#windows-subsystem-for-linux)
- [New Installs](#new-installs)
- [Existing Installs](#existing-installs)
- [Install Build Dependencies](#install-build-dependencies)
- [Windows with MSYS2](#windows-with-msys2)
- [MacOS](#macos)
- [Linux](#linux)
- [Ubuntu (and other Debian derivatives)](#ubuntu-and-other-debian-derivatives)
- [Arch Linux (and derivatives)](#arch-linux-and-derivatives)
- [Fedora (and derivatives)](#fedora-and-derivatives)
- [Docker](#docker)
- [2. Downloading the Repository](#2-downloading-the-repository)
- [3. Specifying a Compiler License](#3-specifying-a-compiler-license)
- [Windows (including WSL 1)](#windows-including-wsl-1)
- [Unix Systems](#unix-systems)
- [4. Building the Repository](#4-building-the-repository)
- [5. Debugger Support](#5-debugger-support)
- [Troubleshooting FAQ](#troubleshooting-faq)
- [My Build is Failing After Merging from Main](#my-build-is-failing-after-merging-from-main)

## 1. Setting Up Your Development Environment

### Windows with MSYS2

1. Download the MSYS2 installer from [the official website](https://www.msys2.org/)
and install it on your system.

2. Once the installation is complete, a terminal should automatically pop up.
To update your package registry, enter the following command:

```bash
pacman -Syu
```

Press 'Y' when prompted to confirm the update. This process may take a few
minutes. Once completed, the terminal will automatically close.

3. Re-open an MSYS terminal (the pink icon) from your Start Menu, then enter
the following commands to install necessary build dependencies:

```bash
echo 'export PATH=${PATH}:/mingw64/bin' >> ~/.bashrc
source ~/.bashrc
pacman -S git meson gcc flex bison base-devel mingw-w64-x86_64-arm-none-eabi-{binutils,gcc}
```

Press 'Y' when prompted to confirm the installation.

4. [Download the repository](#2-downloading-the-repository).

### Windows Subsystem for Linux

> [!IMPORTANT]
Expand Down Expand Up @@ -175,6 +143,42 @@ with the path reported by `pip` above:
3. [Download the repository](#2-downloading-the-repository).
### Windows with MSYS2
> [!CAUTION]
> `MSYS2 is known to currently produce a non-matching ROM; proceed at your own
> risk, and heavily prefer to build using Windows Subsystem for Linux, if at all
> possible.
If you are unable to run Windows Subsystem for Linux due to performance reasons
or lacking virtualization requirements, then MSYS2 may be an option for you.
1. Download the MSYS2 installer from [the official website](https://www.msys2.org/)
and install it on your system.
2. Once the installation is complete, a terminal should automatically pop up.
To update your package registry, enter the following command:
```bash
pacman -Syu
```
Press 'Y' when prompted to confirm the update. This process may take a few
minutes. Once completed, the terminal will automatically close.
3. Re-open an MSYS terminal (the pink icon) from your Start Menu, then enter
the following commands to install necessary build dependencies:
```bash
echo 'export PATH=${PATH}:/mingw64/bin' >> ~/.bashrc
source ~/.bashrc
pacman -S git meson gcc flex bison base-devel mingw-w64-x86_64-arm-none-eabi-{binutils,gcc}
```
Press 'Y' when prompted to confirm the installation.
4. [Download the repository](#2-downloading-the-repository).
### MacOS
1. Apple bundles a number of the requisite utilities into Xcode Command Line Tools;
Expand Down Expand Up @@ -209,7 +213,7 @@ GNU `coreutils` installed to run the build scripts:
> Precise packages to be installed will vary by Linux distribution and
> package registry. A handful of common distributions are listed below for
> convenience.
>
> [!IMPORTANT]
> This project requires `meson` version `1.5.0` or higher. If the version of
> `meson` provided by your package manager is out of date, then follow
Expand Down Expand Up @@ -261,6 +265,11 @@ sudo yum install git flex bison gcc make arm-none-eabi-bintuils-cs arm-none-eabi
### Docker
> [!CAUTION]
> The Docker build method is currently unmaintained and unsupported. Proceed at
> your own risk, and know that you may not receive much support from repository
> maintainers.
A `Dockerfile` is provided with the repository should you choose to build the
project as a container. If you do not have `docker` installed on your machine
and wish to make use of this feature, follow the instructions [here](https://docs.docker.com/desktop/).
Expand Down Expand Up @@ -375,3 +384,33 @@ make update
```
And then try rebuilding.
### Meson Replies With `ERROR: Unknown compiler(s)`
Example error message:
```
meson.build:1:0: ERROR: Unknown compiler(s): [['/mnt/c/pokeplatinum/tools/cw/mwrap', 'mwccarm']]
```
Meson provides some basic logging for its configuration process in
`build/meson-logs/meson-log.txt`. In that file, you should see some entries that
begin with `Detecting compiler via: ...`, which will give some insight into the
root of the error. For example:
```
Detecting compiler via: `/mnt/c/pokeplatinum/tools/cw/mwrap mwccarm --version` -> 1
stderr:
wine: '/home/<USER>/.wine' is a 64-bit installation, it cannot be used with a 32-bit wineserver.
-----------
meson.build:1:0: ERROR: Unknown compiler(s): [['/mnt/c/pokeplatinum/tools/cw/mwrap', 'mwccarm']]
```
In this instance, the user has installed 64-bit `wine`. Ensure that you have
installed 32-bit `wine`, then rebuild _after_ removing the prefix directory
using the following command:
```
rm -rf ~/.wine
```
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,15 @@ ifneq (,$(findstring Darwin,$(UNAME_S)))
NATIVE := native_macos.ini
CROSS := cross_unix.ini
else
ifneq (,$(findstring BSD, $(UNAME_S)))
NATIVE := native_unix.ini
CROSS := cross_unix.ini
else
NATIVE := native.ini
CROSS := cross.ini
endif
endif
endif

export LM_LICENSE_FILE ?= $(WRAP)/license.dat
export NINJA_STATUS := [%p %f/%t]
Expand Down
6 changes: 4 additions & 2 deletions asm/macros/btlcmd.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
#include "constants/battle.h"
#include "constants/items.h"
#include "constants/species.h"
#include "generated/abilities.h"
#include "generated/items.h"
#include "generated/moves.h"
#include "generated/pokemon_types.h"
#include "gmm/message_bank_battle_strings.h"
#include "battle/btlcmd.h"

.include "consts/abilities.inc"
.include "consts/battle.inc"
.include "consts/battle_subscripts.inc"
.include "consts/btlcmd.inc"
.include "consts/game_records.inc"
.include "consts/gender.inc"
.include "consts/items.inc"
.include "consts/moves.inc"
.include "consts/pokemon.inc"

Expand Down
10 changes: 5 additions & 5 deletions asm/macros/scrcmd.inc
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
#include "generated/items.h"
#include "generated/moves.h"
#include "generated/species.h"
#include "generated/catching_show_points_category.h"
.include "macros/movement.inc"
.include "consts/badges.inc"
.include "consts/catching_show.inc"
.include "consts/game_records.inc"
.include "consts/items.inc"
.include "consts/journal.inc"
.include "consts/map.inc"
.include "consts/moves.inc"
.include "consts/poketch.inc"
.include "consts/scrcmd.inc"
.include "consts/sdat.inc"
.include "consts/species.inc"

#include "res/trainers/trdata.naix"

Expand Down Expand Up @@ -2797,7 +2797,7 @@
.short 517
.endm

.macro ScrCmd_206
.macro StartGreatMarshLookout
.short 518
.endm

Expand Down
5 changes: 3 additions & 2 deletions asm/trainer_ai/trainer_ai_script.s
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
#include "constants/battle.h"
#include "constants/items.h"
#include "constants/battle/trainer_ai.h"
#include "generated/abilities.h"
#include "generated/moves.h"
#include "generated/pokemon_types.h"

.include "consts/abilities.inc"
.include "consts/battle.inc"
.include "consts/gender.inc"
.include "consts/items.inc"
.include "consts/moves.inc"
.include "consts/pokemon.inc"
.include "consts/trainer_ai.inc"
Expand Down
Loading

0 comments on commit 922ee32

Please sign in to comment.