summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL.md156
-rw-r--r--src/field_fadetransition.c8
2 files changed, 71 insertions, 93 deletions
diff --git a/INSTALL.md b/INSTALL.md
index 0e5b29015..9b8003726 100644
--- a/INSTALL.md
+++ b/INSTALL.md
@@ -1,149 +1,125 @@
-# Linux
+# Prerequisites
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
+| Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, and 1703)
+| ----- | ----- | ------------------------- | ------------------ | ---------------------------------------------------------
+| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | MSYS2 (see below)
-Then run the following commands.
+[xcode]: https://developer.apple.com/library/archive/technotes/tn2339/_index.html#//apple_ref/doc/uid/DTS40014588-CH1-DOWNLOADING_COMMAND_LINE_TOOLS_IS_NOT_AVAILABLE_IN_XCODE_FOR_MACOS_10_9__HOW_CAN_I_INSTALL_THEM_ON_MY_MACHINE_
+[wsl2]: https://docs.microsoft.com/windows/wsl/wsl2-install
+[wsl]: https://docs.microsoft.com/windows/wsl/install-win10
- export DEVKITPRO=/opt/devkitPro
- echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc
- export DEVKITARM=$DEVKITPRO/devkitARM
- echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc
+The [prerelease version of the Linux subsystem](https://docs.microsoft.com/windows/wsl/install-legacy) available in the 1607 and 1703 releases of Windows 10 is obsolete so consider uninstalling it.
- git clone https://github.com/pret/pokeruby
- git clone https://github.com/pret/agbcc
+Make sure that the `build-essential`, `git`, and `libpng-dev` packages are installed. The `build-essential` package includes the `make`, `gcc-core`, and `g++` packages so they do not have to be obtained separately. MSYS2 does not include `libpng-dev` so it must be built from source.
- cd agbcc
- ./build.sh
- ./install.sh ../pokeruby
+On Linux and Mac OS X, using `(dkp-)pacman`, install `gba-dev`. This will give you devkitARM and all its extensions.
- cd ../pokeruby
-
-To build **pokeruby.gba**:
-
- make -j4
+Install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. For Windows versions without the Linux subsystem, the devkitPro [graphical installer](https://github.com/devkitPro/installer/releases) includes a preconfigured MSYS2 environment, thus the steps below are not required.
+ export DEVKITPRO=/opt/devkitpro
+ echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc
+ export DEVKITARM=$DEVKITPRO/devkitARM
+ echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc
-# Mac
-
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM).
-
-Then in **Terminal**, run the following commands.
+### Platform-specific notes
+#### Mac OS X
+It is highly recommended that you use the [Homebrew](https://brew.sh) package manager. Suggested packages include `gcc`, `libpng`, `coreutils`, `git`, `make`, and `md5sha1sum`. Note that `make` will be aliased as `gmake` in Terminal, and `gcc` as `gcc-${VM}` where `${VM}` is the GCC major version (currently 9).
- xcode-select --install
+# Installation
- export DEVKITPRO=${HOME}/devkitPro
- echo "export DEVKITPRO=${DEVKITPRO}" >> ~/.bashrc
- export DEVKITARM=${DEVKITPRO}/devkitARM
- echo "export DEVKITARM=${DEVKITARM}" >> ~/.bashrc
+To set up the repository:
git clone https://github.com/pret/pokeruby
git clone https://github.com/pret/agbcc
- cd agbcc
+ cd ./agbcc
./build.sh
./install.sh ../pokeruby
cd ../pokeruby
-To build **pokeruby.gba**:
+To build **pokeruby.gba** and confirm it matches the official ROM image:
- make -j4
+ make
+To build Pokémon Sapphire:
-# Windows
+ make sapphire
-Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM) to the default directory (C:/devkitpro).
+The above two commands will build the English v1.0 version of the respective title. To build the 1.1 and 1.2 revisions, use the appropriate `_rev` target. For example, to build Ruby 1.2, run:
-Then download [**Cygwin**](http://cygwin.com/install.html): **setup-x86_64.exe** for 64-bit Windows, **setup-x86.exe** for 32-bit.
+ make ruby_rev2
-Run the Cygwin setup and leave the default settings. At "Select Packages", set the view to "Full" and choose to install the following:
+## Notes
-- `make`
-- `git`
-- `gcc-core`
-- `gcc-g++`
-- `libpng-devel`
+* If the base tools are not found on macOS in new Terminal sessions after the first successful build, run `echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile` once to prevent the issue from occurring again. Verify that the `devkitarm-rules` package is installed as well; if not, install it by running `sudo dkp-pacman -S devkitarm-rules`.
-In the **Cygwin terminal**, enter these commands:
+* If the repository was previously set up using Cygwin, delete the `.exe` files in the subfolders of the `tools` folder except for `agbcc` and try building again. [Learn the differences between MSYS2 and Cygwin.](https://github.com/msys2/msys2/wiki/How-does-MSYS2-differ-from-Cygwin)
- export DEVKITPRO=/cygdrive/c/devkitpro
- echo export DEVKITPRO=$DEVKITPRO >> ~/.bashrc
- export DEVKITARM=$DEVKITPRO/devkitARM
- echo export DEVKITARM=$DEVKITARM >> ~/.bashrc
+## Notes about the German language ROMs
+This repository also supports the German versions of Ruby and Sapphire. However, due to major differences in scripts, text, and graphics, a special configuration needs to be set up before compilation and torn down after.
- git clone https://github.com/pret/pokeruby
- git clone https://github.com/pret/agbcc
+To set up the repository:
- cd agbcc
- ./build.sh
- ./install.sh ../pokeruby
+ make clean
+ sh de_before.sh
- cd ../pokeruby
-
-To build **pokeruby.gba**:
-
- make -j4
+To compile the German ROMs:
+ make ruby_de
+ make sapphire_de
-# Compiling Sapphire and later revisions
+To compile the leaked Debug ROM (German):
-When you simply enter `make` and don't specify a target, then Pokémon Ruby 1.0 will be built. However, Sapphire can also be built, along with revisions 1 and 2 of both Ruby and Sapphire. Here is a listing of each ROM that can be made, along with the command to make the ROM.
+ make ruby_de_debug
-Version | Command
--------------|---------------------
-Ruby 1.0 | `make ruby`
-Ruby 1.1 | `make ruby_rev1`
-Ruby 1.2 | `make ruby_rev2`
-Sapphire 1.0 | `make sapphire`
-Sapphire 1.1 | `make sapphire_rev1`
-Sapphire 1.2 | `make sapphire_rev2`
+To restore the repository (**MUST BE DONE BEFORE ATTEMPTING TO BUILD ANY ENGLISH LANGUAGE ROM**):
+ make clean
+ sh de_after.sh
-# Faster builds
+# Guidance
-After the first build, subsequent builds are faster. You can further speed up the build:
+To build **pokeruby.gba** with your changes:
-## Parallel build
+ make COMPARE=0
-This significantly speeds up the build on modern machines.
+## Parallel builds
-By default `make` only runs a single thread. You can tell `make` to run on multiple threads with `make -j`. See the manfile for usage (`man make`).
+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.
-The optimal value for `-j` is the number of logical cores on your machine. You can run `nproc` to see the exact number.
+To speed up building, run:
- $ nproc
- 8
+ make -j$(nproc)
-If you have 8 cores, run:
+`nproc` is not available on macOS. The alternative is `sysctl -n hw.ncpu` ([relevant Stack Overflow thread](https://stackoverflow.com/questions/1715580)).
- make -j8
+## Building without dependency scanning
-`-j` on its own will spawn a new thread for each job. A clean build will have thousands of jobs, which will be slower than not using -j at all.
-
-## Disable the dependency scanning
-
-If you've only changed `.c` or `.s` files, you can turn off the dependency scanning temporarily. Changes to any other files will be ignored, and the build will either fail or not reflect those changes.
+If only `.c` or `.s` files were changed, turn off the dependency scanning temporarily. Changes to any other files will be ignored and the build will either fail or not reflect those changes.
make NODEP=1
-# Using present-day toolchains
+## Building with devkitARM's C compiler
+
+This project supports the `arm-none-eabi-gcc` compiler included with devkitARM. To build this target, simply run:
-`agbcc` is based on GCC 2.95.1, which is primitive by today's standards and compiles inoptimal instructions. You can overcome this by swapping in a more modern compiler. Makefile rules have been set up for you to do this, all you need to do is run
+ make modern
- make MODERN=1
+## Building with other toolchains
-or
+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`.
- make modern
+ make TOOLCHAIN="/path/to/toolchain/here"
-You can build Sapphire and other Ruby revisions by appending `_modern` to the target name:
+The following is an example:
- make sapphire_rev1_modern
+ make TOOLCHAIN="/usr/local/arm-none-eabi"
-Bear in mind that the resulting ROM will not match vanilla Ruby and may exhibit undefined, buggy behavior. We are trying to resolve this as much as possible, so please report anything you find.
+To compile the `modern` target with this toolchain, the subdirectories `lib`, `include`, and `arm-none-eabi` must also be present.
-If you don't want to use devkitARM, you can install your own ARM toolchain consisting of GNU binutils, GCC, and newlib targeting arm-none-eabi. You can pass the root directory of your toolchain to the variable `TOOLCHAIN` when running `make` for any target. **If you opt to do this, the assumption is that you know what you are doing already!**
+## Building with debug info
-# Debug symbols
+To build **pokeruby.elf** with enhanced debug info, use the `DINFO` variable.
-You can compile the ROM with helpful debug symbols by passing `DINFO=1` to make. Note that this WILL NOT result in a matching build even with the default compiler. You can suppress the `pokeruby.gba: FAILED` error by additionally passing `COMPARE=0`.
+ make DINFO=1
diff --git a/src/field_fadetransition.c b/src/field_fadetransition.c
index 670d8c54b..b4edd5588 100644
--- a/src/field_fadetransition.c
+++ b/src/field_fadetransition.c
@@ -511,16 +511,18 @@ void sub_80810DC(void)
#if DEBUG
-NAKED
void debug_sub_80888D8()
{
- asm("\
+ debug_sub_8052E04();
+ sub_8080E88();
+ ScriptContext2_Enable();
+/* asm("\
PUSH {LR}\n\
BL debug_sub_8052E04\n\
BL sub_8080E88\n\
BL ScriptContext2_Enable\n\
POP {R0}\n\
- BX R0");
+ BX R0");*/
}
#endif