Reading the repo
Reading the repo
Assembly instructions
Decompilation of Pokémon Platinum
Saved setup from 9 h ago
Will it work on macOS?
INSTALL.mdThis document details the steps necessary to build a copy of Pokémon Platinum (EN-US) using this repository.
It's recommended to use WSL2 rather than WSL1 as your development environment. If you still want to use WSL1, go here.
These instructions will enable you to build pokeplatinum using the more up-to-date WSL2 and develop on it with VSCode on Windows while it is stored in the Linux filesystem.
In your start menu, search for Windows PowerShell. Open the Windows PowerShell app as administrator by right-clicking on it and selecting Run as administrator.
Even if you're on an admin Windows profile, you always have to run it as admin.
Install a new distro:
wsl --install -d Ubuntu
If this is your first time installing a WSL distro, then your computer will prompt you to restart once finished. Do so, then open PowerShell as administrator again.
You can add --name with a name on the end to the command to pick what name you'd like.
By default it would be called Ubuntu.
Check that Ubuntu (or whatever name you gave it) is installed in the list:
wsl -l -v
If the new distro you just made is not version 2, convert to version 2:
wsl --set-version Ubuntu 2
Once the new distro is set up, enter it:
wsl -d Ubuntu
Right now, you'll probably see your file system begin with /mnt/c/. That's the Windows file system.
Go to the Linux filesystem:
cd ~
Install the pokeplatinum dependencies:
sudo dpkg --add-architecture i386 && sudo apt update
sudo apt install bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config wget python3 xz-utils nasm libc6:i386 libpng-dev
Once that is done successfully, go to Downloading the Repository and continue from there.
With VSCode, you can modify files stored in Linux just like modifying files stored in Windows.
Once you have cloned the pokeplatinum repo in your Linux filesystem and ensured that it is capable of building successfully, open VSCode in Windows (assuming you have downloaded it already).
Go to extensions and find the WSL extension. Install it and make sure it's enabled.
Back to your PowerShell terminal where you're running WSL2, run this command in the pokeplatinum directory to open it in VSCode on Windows:
code .
The first-time setup should automatically download the necessary extensions to develop against the Linux filesystem.
You should now have pokeplatinum in Linux loaded in VSCode on Windows, standing by and ready for work!
Follow these instructions if you do not have an existing install of WSL.
Open Windows PowerShell as Administrator. Paste (Right Click or Shift+Insert) the following command:
wsl --install -d Ubuntu
Once the process finishes, you will be prompted to restart your machine. Accept.
After rebooting, reopen PowerShell and run the following command to downgrade WSL to version 1:
wsl --set-version Ubuntu 1
WSL version 1 is preferred for most WSL users due to its increased performance when accessing files in the Windows file system.
Open Ubuntu from your Start menu.
Ubuntu will set up its own installation when it runs for the first time. Once
finished, it will ask for a username and password as input.
[!NOTE] When typing the password, there will be no visible response; this is normal, and the terminal is still reading your input.
Update Ubuntu's package registry:
sudo apt update && sudo apt upgrade
Follow these instructions if you have an existing install of WSL, specifically
Ubuntu.
Older versions of Ubuntu (e.g., 20.04) ship with an outdated version of
Python, which is not supported. To remedy this, you can upgrade your existing
install to a more recent version of Ubuntu:
Run the following inside Ubuntu:
sudo apt upgrade && sudo apt full-upgrade
Open PowerShell and run the following commands to restart Ubuntu:
wsl -t Ubuntu
wsl -d Ubuntu
Re-open Ubuntu and run the following to start a system upgrade:
sudo do-release-upgrade
This process may take a long time.
Once Ubuntu is done upgrading, update Ubuntu's package registry:
sudo apt update && sudo apt upgrade
Run the following to install build dependencies from the Ubuntu package
registry:
sudo apt install bison flex g++ gcc-arm-none-eabi git lib32z1 make ninja-build pkg-config python3 p7zip libpng-dev
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.
Download the MSYS2 installer from the official website and install it on your system.
Once the installation is complete, a terminal should automatically pop up. To update your package registry, enter the following command:
pacman -Syu
Press 'Y' when prompted to confirm the update. This process may take a few minutes. Once completed, the terminal will automatically close.
Re-open an MSYS terminal (the pink icon) from your Start Menu, then enter the following commands to install necessary build dependencies:
echo 'export PATH=${PATH}:/mingw64/bin' >> ~/.bashrc
source ~/.bashrc
pacman -S bison flex gcc git make ninja python mingw-w64-ucrt-x86_64-arm-none-eabi-gcc p7zip mingw-w64-x86_64-libpng
Press 'Y' when prompted to confirm the installation.
Apple bundles a number of the requisite utilities into Xcode Command Line Tools; to install these, run:
xcode-select --install
Install Homebrew.
Run the following commands to install additional dependencies:
brew update
brew install gcc@14 ninja libpng pkg-config arm-none-eabi-gcc xz
brew install --cask wine-stable
You may need to authorize the Wine installation to satisfy macOS security requirements. To do this, open the Applications folder in Finder and locate the Wine Stable application. Control-Click on this icon to open the context menu, then Control-Click on Open and grant the requested permissions.
If your macOS installation is Monterey (12) or earlier, then you may also need
GNU coreutils installed to run the build scripts:
brew install coreutils
[!TIP] You can run a persistent Wine server in the background to speed up builds.
To do this, open the Wine Stable application from your Applications folder. In the terminal window that opens, run the following command:
wineserver -pWhen trying to build the repository, the first invocation of
makemay hang on compiling a file. If that happens, hit Control+C to interrupt the build, and runmakeagain.If you need to stop the Wine server, run the following command:
wineserver -k
[!NOTE] Precise packages to be installed will vary by Linux distribution and package registry. A handful of common distributions are listed below for convenience.
Once you have installed all of the listed dependencies, proceed to downloading the repository.
Enable 32-bit installations using dpkg:
sudo dpkg --add-architecture i386 && sudo apt update
Install the following packages via apt:
sudo apt install bison flex g++ gcc-arm-none-eabi git make ninja-build pkg-config wget python3 xz-utils nasm libc6:i386 libpng-dev
Enable the multilib repository.
Install dependencies via pacman:
sudo pacman -S arm-none-eabi-gcc bison flex gcc git make ninja python wget xz lib32-glibc libpng
sudo dnf install arm-none-eabi-gcc-cs bison flex gcc-c++ git make ninja-build python3 wget2 xz glibc32 libpng
From your terminal, navigate to the path in which you will store the repository. Users of WSL 1 should ensure that their target is on the Windows file drive.
git clone https://github.com/pret/pokeplatinum
cd pokeplatinum
To build the ROM, run:
make
or to skip the checksum if you want to modify the code:
make rom
If everything works, then the following ROM should be built:
sha1: 0862ec35b24de5c7e2dcb88c9eea0873110d755cOptionally, the repository can be configured to build a "revision 0"
ROM
(sha1: ce81046eda7d232513069519cb2085349896dec7). This revision matches the
original retail version that was shipped in North America; it contains an error
in the GTS code where the game will not display the level range of a wanted
Pokémon. This error was patched as part of a second shipment of cartridges for
the North American release; it is not present in any other localization.
To build this revision, instead of the above command, run the following:
ROM_REVISION=0 make
If you need further assistance, feel free to ask a question in the #pokeplatinum
channel of the pret Discord (see README.md for contact information) or open
an issue.
This step is optional, but useful. pokeplatinum ships with support for GDB
debugging and a target to build a debug-enabled ROM:
make debug
For convenience, a template launch.json configuration for VS Code is provided
in the .vscode folder of the repository.
Due to the nature of the Nintendo DS, use of standard builds of GDB for debugging
is insufficient. A fork of binutils-gdb which supports the overlay system
employed by the console is available here.
For installation instructions, refer to the README.md.
It is likely that your subprojects are out of date; update them with the following command:
make update
And then try rebuilding.
Then run bash setup.sh. It stops at the first error and is safe to run again. Servers and tests aren't started; it lists them at the end. Read it first.
Needs Git: xcode-select --install
git clone https://github.com/pret/pokeplatinum.git cd pokeplatinum
C/C++ compiler, Meson
xcode-select --install brew install meson ninja
meson setup build meson compile -C build
No reports for macOS yet.
Opens a chat with this manual already filled in, for macOS. It uses your own account; gitmanual sends nothing.