From f9ca074bc4bcfad82ac120b23414c348b3bbe6e7 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Wed, 24 Apr 2019 21:11:49 +0100 Subject: [PATCH 1/8] Update README.md --- README.md | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 4407948f7..73fbac2ef 100644 --- a/README.md +++ b/README.md @@ -4,35 +4,34 @@ This is a disassembly of Pokémon Emerald. -It builds the following rom: +It builds the following ROM: -* pokeemerald.gba `sha1: f3ae088181bf583e55daf962a92bb46f4f1d07b7` +* **pokeemerald.gba** `sha1: f3ae088181bf583e55daf962a92bb46f4f1d07b7` To set up the repository, see [INSTALL.md](INSTALL.md). ## See also -* Disassembly of [**Pokémon Red/Blue**][pokered] -* Disassembly of [**Pokémon Yellow**][pokeyellow] -* Disassembly of [**Pokémon Gold**][pokegold] -* Disassembly of [**Pokémon Crystal**][pokecrystal] -* Disassembly of [**Pokémon Pinball**][pokepinball] -* Disassembly of [**Pokémon TCG**][poketcg] -* Disassembly of [**Pokémon Ruby**][pokeruby] -* Disassembly of [**Pokémon Fire Red**][pokefirered] -* Discord: [**pret**][Discord] -* irc: **irc.freenode.net** [**#pret**][irc] +Other disassembly and/or decompilation projects: +* [**Pokémon Red and Blue**](https://github.com/pret/pokered) +* [**Pokémon Gold and Silver (Space World '97 demo)**](https://github.com/pret/pokegold-spaceworld) +* [**Pokémon Yellow**](https://github.com/pret/pokeyellow) +* [**Pokémon Trading Card Game**](https://github.com/pret/poketcg) +* [**Pokémon Pinball**](https://github.com/pret/pokepinball) +* [**Pokémon Stadium**](https://github.com/pret/pokestadium) +* [**Pokémon Gold and Silver**](https://github.com/pret/pokegold) +* [**Pokémon Crystal**](https://github.com/pret/pokecrystal) +* [**Pokémon Ruby and Sapphire**](https://github.com/pret/pokeruby) +* [**Pokémon Pinball: Ruby & Sapphire**](https://github.com/pret/pokepinballrs) +* [**Pokémon FireRed and LeafGreen**](https://github.com/pret/pokefirered) +* [**Pokémon Mystery Dungeon: Red Rescue Team**](https://github.com/pret/pmd-red) + + +## Contacts + +You can find us on [Discord](https://discord.gg/6EuWgX9) and [IRC](https://kiwiirc.com/client/irc.freenode.net/?#pret). + -[pokered]: https://github.com/pret/pokered -[pokeyellow]: https://github.com/pret/pokeyellow -[pokegold]: https://github.com/pret/pokegold -[pokecrystal]: https://github.com/pret/pokecrystal -[pokepinball]: https://github.com/pret/pokepinball -[poketcg]: https://github.com/pret/poketcg -[pokeruby]: https://github.com/pret/pokeruby -[pokefirered]: https://github.com/pret/pokefirered -[Discord]: https://discord.gg/6EuWgX9 -[irc]: https://kiwiirc.com/client/irc.freenode.net/?#pret [travis]: https://travis-ci.org/pret/pokeemerald [travis-badge]: https://travis-ci.org/pret/pokeemerald.svg?branch=master From c135320406f2d1bdafea9f4bc90931bd4d1730f3 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Wed, 24 Apr 2019 21:13:09 +0100 Subject: [PATCH 2/8] Overhaul INSTALL.md --- INSTALL.md | 111 +++++++++++++++-------------------------------------- 1 file changed, 30 insertions(+), 81 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index fcdd8b655..253c55aab 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,103 +1,52 @@ -Follow the OS-specific instructions below. +## Prerequisites -# Linux +**Linux:** none -Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM). +**macOS:** [Xcode Command Line Tools package](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_) -Make sure that there is an environment variable called DEVKITARM with the path of the directory before the "bin" directory containing "arm-none-eabi-as", "arm-none-eabi-cpp", "arm-none-eabi-ld" and "arm-none-eabi-objcopy". +**Windows 10 (1709+):** [Windows Subsystem for Linux](https://docs.microsoft.com/windows/wsl/install-win10) -Then get the compiler from https://github.com/pret/agbcc and run the following commands. +**Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, 1703):** Choose one of the following two options. -``` -./build.sh -./install.sh PATH_OF_POKEEMERALD_DIRECTORY -``` +* Get [Cygwin](https://cygwin.com/install.html) and [include](https://cygwin.com/cygwin-ug-net/setup-net.html#setup-packages) the `make`, `git`, `gcc-core`, `gcc-g++`, and `libpng-devel` packages. +* Get [MSYS2](https://www.msys2.org/) and the [pokeruby-tools](https://github.com/pret/pokeruby-tools). -Then in the pokeemerald directory, build the tools. +If you are on Windows 10 1607 or 1703 and use [the prerelease version of the Linux subsystem](https://docs.microsoft.com/windows/wsl/install-legacy), consider uninstalling it. -``` -./build_tools.sh -``` +---- -Finally, build the rom. +Install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and, except for MSYS2, add its environment variables. To set up devkitPro in MSYS2, use the [graphical installer](https://github.com/devkitPro/installer/releases). -``` -make -``` - -# Windows - -Install [**devkitARM**](http://devkitpro.org/wiki/Getting_Started/devkitARM). - -Then get the compiled tools from https://github.com/pret/pokeruby-tools. Copy the `tools/` folder over the `tools/` folder in your pokeemerald directory. - -You can then build pokeemerald using `make` in the MSYS environment provided with devkitARM. - -# Mac - -Installing pokeemerald on a Mac requires macOS >= 10.12 (Sierra or higher). - -Download a [devkitPRO pacman](https://github.com/devkitPro/pacman/releases/tag/v1.0.0) - -Run the following commands in Terminal: + export DEVKITPRO=/opt/devkitpro + echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc + export DEVKITARM=$DEVKITPRO/devkitARM + echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc -``` -xcode-select --install +## Installation -sudo dkp-pacman -S devkitARM +To set up the repository: -export DEVKITPRO=/opt/devkitpro -echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc -export DEVKITARM=$DEVKITPRO/devkitARM -echo "export DEVKITARM=$DEVKITARM" >> ~/.bashrc -echo "if [ -f ~/.bashrc ]; then . ~/.bashrc; fi" >> ~/.bash_profile + git clone https://github.com/pret/pokeemerald + git clone https://github.com/pret/agbcc -git clone https://github.com/pret/pokeemerald -git clone https://github.com/pret/agbcc + cd ./agbcc + ./build.sh + ./install.sh ../pokeemerald -cd agbcc/ -./build.sh -./install.sh ../pokeemerald + cd ../pokeemerald + ./build_tools.sh -cd ../pokeemerald -./build_tools.sh -``` +To build **pokeemerald.gba**: -And build the ROM with `make`. + make -j$(nproc) -If the step `./build.sh` in the above list of commands fails with the error `Makefile:1: /opt/devkitpro/devkitARM/base_tools: No such file or directory`, then try installing the pacman package `devkitarm-rules` by executing the command +To confirm it matches the official ROM image while building, do this instead: -``` -sudo dkp-pacman -S devkitarm-rules -``` + make compare -j$(nproc) -Executing `./build.sh` again should now succeed. +**Note:** 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. -# Faster builds - -After the first build, subsequent builds are faster. You can further speed up the build: - -## Parallel build - -This significantly speeds up the build on modern machines. - -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`). - -The optimal value for `-j` is the number of logical cores on your machine. You can run `nproc` to see the exact number. - -``` -$ nproc -8 -``` - -If you have 8 cores, run: `make -j8` - -`-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. - -`make NODEP=1` + make -j$(nproc) NODEP=1 +**Note 2:** If the build command is not recognized on Linux, including the Linux environment used within Windows, run `nproc` and replace `$(nproc)` with the returned value (e.g.: `make -j4`). Because `nproc` is not available on macOS, the alternative is `sysctl -n hw.ncpu`. From 9600c6c1b41ca5f57354a6be05f849db712a3676 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sat, 15 Jun 2019 23:45:19 +0100 Subject: [PATCH 3/8] Update INSTALL.md --- INSTALL.md | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 253c55aab..a75c201c1 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -1,21 +1,19 @@ ## Prerequisites -**Linux:** none +| Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, 1703) +| ----- | ----- | ------------------------- | ------------------ | --------------------------------------------------------- +| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | [MSYS2][msys2] (includes devkitPro) -**macOS:** [Xcode Command Line Tools package](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_) +[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 +[msys2]: https://www.msys2.org/ -**Windows 10 (1709+):** [Windows Subsystem for Linux](https://docs.microsoft.com/windows/wsl/install-win10) +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. -**Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, 1703):** Choose one of the following two options. +Make sure that the `make`, `git`, `gcc-core`, `gcc-g++`, and `libpng-devel` packages are installed. -* Get [Cygwin](https://cygwin.com/install.html) and [include](https://cygwin.com/cygwin-ug-net/setup-net.html#setup-packages) the `make`, `git`, `gcc-core`, `gcc-g++`, and `libpng-devel` packages. -* Get [MSYS2](https://www.msys2.org/) and the [pokeruby-tools](https://github.com/pret/pokeruby-tools). - -If you are on Windows 10 1607 or 1703 and use [the prerelease version of the Linux subsystem](https://docs.microsoft.com/windows/wsl/install-legacy), consider uninstalling it. - ----- - -Install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and, except for MSYS2, add its environment variables. To set up devkitPro in MSYS2, use the [graphical installer](https://github.com/devkitPro/installer/releases). +If you are *not* using MSYS2, install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. export DEVKITPRO=/opt/devkitpro echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc @@ -45,8 +43,10 @@ To confirm it matches the official ROM image while building, do this instead: make compare -j$(nproc) -**Note:** 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. +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 -j$(nproc) NODEP=1 -**Note 2:** If the build command is not recognized on Linux, including the Linux environment used within Windows, run `nproc` and replace `$(nproc)` with the returned value (e.g.: `make -j4`). Because `nproc` is not available on macOS, the alternative is `sysctl -n hw.ncpu`. +**Note:** If the build command is not recognized on Linux, including the Linux environment used within Windows, run `nproc` and replace `$(nproc)` with the returned value (e.g.: `make -j4`). Because `nproc` is not available on macOS, the alternative is `sysctl -n hw.ncpu`. + +**Note 2:** 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. From 28ee89884af4ed76593f25125e9ac356d177126a Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 16 Jun 2019 00:41:35 +0100 Subject: [PATCH 4/8] Add LF normalization for .sh files --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index b095aa2cd..4e8417c0c 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ *.pal text eol=crlf - +*.sh text eol=lf *.s text eol=lf *.txt text eol=lf Makefile text eol=lf From f787a257e0cca6c72dd34de02921d1fbea9b3cc2 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 16 Jun 2019 16:55:01 +0100 Subject: [PATCH 5/8] Clarify required packages and add Cygwin migration --- INSTALL.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index a75c201c1..5a275f6ed 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -11,7 +11,7 @@ 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. -Make sure that the `make`, `git`, `gcc-core`, `gcc-g++`, and `libpng-devel` packages are installed. +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. If you are *not* using MSYS2, install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. @@ -35,6 +35,8 @@ To set up the repository: cd ../pokeemerald ./build_tools.sh +If the repository was previously set up using Cygwin, delete the `.exe` files in the subfolders of the `tools` folder except for `agbcc` and run the `build_tools.sh` script again. + To build **pokeemerald.gba**: make -j$(nproc) From c7f140bd8c78f7bf9de1ad7cd877a171ac701261 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 16 Jun 2019 17:33:53 +0100 Subject: [PATCH 6/8] devkitPro includes MSYS2, not vice-versa --- INSTALL.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/INSTALL.md b/INSTALL.md index 5a275f6ed..fc9b9d411 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -2,18 +2,17 @@ | Linux | macOS | Windows 10 (build 18917+) | Windows 10 (1709+) | Windows Vista, 7, 8, 8.1, and 10 (1507, 1511, 1607, 1703) | ----- | ----- | ------------------------- | ------------------ | --------------------------------------------------------- -| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | [MSYS2][msys2] (includes devkitPro) +| none | [Xcode Command Line Tools package][xcode] | [Windows Subsystem for Linux 2][wsl2] | [Windows Subsystem for Linux][wsl] | MSYS2 (see below) [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 -[msys2]: https://www.msys2.org/ 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. 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. -If you are *not* using MSYS2, install the **devkitARM** toolchain of [devkitPro](https://devkitpro.org/wiki/Getting_Started) and add its environment variables. +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 MSYS2 environment, thus the steps below are not required. export DEVKITPRO=/opt/devkitpro echo "export DEVKITPRO=$DEVKITPRO" >> ~/.bashrc From 5847d4f03cd2f8beef4dc4773fc541e47e3ede12 Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 16 Jun 2019 17:36:45 +0100 Subject: [PATCH 7/8] ...and said MSYS2 is ready to be used --- INSTALL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL.md b/INSTALL.md index fc9b9d411..501017c35 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -12,7 +12,7 @@ The [prerelease version of the Linux subsystem](https://docs.microsoft.com/windo 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. -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 MSYS2 environment, thus the steps below are not required. +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 From 89da828794d036e33ef313ab95868c8be6bb039f Mon Sep 17 00:00:00 2001 From: SatoMew Date: Sun, 16 Jun 2019 22:26:10 +0100 Subject: [PATCH 8/8] Another update for README.md --- README.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 73fbac2ef..5d4edab85 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,14 @@ [![Build Status][travis-badge]][travis] -This is a disassembly of Pokémon Emerald. +[travis]: https://travis-ci.org/pret/pokeemerald +[travis-badge]: https://travis-ci.org/pret/pokeemerald.svg?branch=master + +This is a decompilation of Pokémon Emerald. It builds the following ROM: -* **pokeemerald.gba** `sha1: f3ae088181bf583e55daf962a92bb46f4f1d07b7` +* [**pokeemerald.gba**](https://datomatic.no-intro.org/index.php?page=show_record&s=23&n=1961) `sha1: f3ae088181bf583e55daf962a92bb46f4f1d07b7` To set up the repository, see [INSTALL.md](INSTALL.md). @@ -31,7 +34,3 @@ Other disassembly and/or decompilation projects: ## Contacts You can find us on [Discord](https://discord.gg/6EuWgX9) and [IRC](https://kiwiirc.com/client/irc.freenode.net/?#pret). - - -[travis]: https://travis-ci.org/pret/pokeemerald -[travis-badge]: https://travis-ci.org/pret/pokeemerald.svg?branch=master