→ このドキュメントを日本語で表示するには、ここをクリックしてください…
Note: This repository is incomplete (as is this translation effort)!
This repository is a comment-annotated fork of the Pret collective’s split disassembly of Pokémon Red, with accompanying detailed documentation explaining some of the codebase’s core functions. The research present here was authored by @pokemium and is in the process of being translated by @andidavies92.
Please note that the target ROM is the English-language version of Pokémon Red.
As mentioned above, this repository contains the Pokémon Red disassembly and adds detailed explanations in Japanese, which will gradually be translated into English, as in this README. The original research effort provides the following:
- Comments added to the source code in Japanese.
- The comments are in a standardised format in order to maximise readability when used in conjunction with relevant VS Code extensions.
- Formal documentation for data formats and concepts unique to Pokémon Red.
These additions provide much-needed extra detailed information to the original repository.
This documentation assumes you already have some knowledge of:
- Low-level compilation steps, i.e. assemblers, linkers, etc.
- Game Boy hardware specifications, such as its Z80-like ISA (instruction set architecture), interrupts, MBCs (memory bank controllers), banking, and so on.
- RGBDS (Rednex Game Boy Development System).
It’s also recommended to use Visual Studio Code along with this RGBDS-tailored extension when wanting to read the code in an editor.
Click on any of these topics to read more about them:
- 2bpp graphics format
- Binary-coded decimal
- Boulders
- Button input
- Cartridge
- Conditional-visibility object
- Diploma
- Events
- Following NPCs
- Glossary
- Gym badges
- Hidden objects
- Intro sequence
- List data structure
- List menus
- Macros
- Map
- Menus
- PC
- pic data format
- Pokédex
- Pokémon data structure
- Pre-registering functions (“predef”)
- rgbgfx graphics converter
- ROM banks
- Saving
- Simulated button presses
- Sprites
- Text
- Tiles
- Title screen
- Trainer data structure
- Warps
- Wild Pokémon
Directory/file | Contents |
---|---|
audio/ | Code pertaining to music and sound effects. |
constants/ | Abstracted constants that are referenced throughout the codebase. |
data/ | Tabular game data loaded into memory on demand. |
engine/ | The core gameplay mechanics are implemented here. |
gfx/ | Sprite graphics, blocksets, tilesets and tilemaps live here. |
home/ | Initialisation code and utilities. |
macros/ | Macro definitions that can be called-on anywhere in the codebase. |
maps/ | Data for all explorable areas of the game, both inside and outside. |
pic/ | Graphics data for Pokémon and trainers. |
scripts/ | Higher-level scripts used to define events in the game. |
text/ | All the text data for the game is stored here. |
tools/ | Various utility scripts (in C and Python) for things like graphics data encoding. |
audio.asm | All audio data and subroutines get included here, as well as some extra definitions. |
charmap.asm | Unicode string to tile mappings, so that text can be defined as string literals. |
constants.asm | Includes for all constant definitions. |
home.asm | Initialisation code and utility subroutines. |
hram.asm | Defines what data gets placed in high RAM. |
macros.asm | Includes for all macro definitions. |
main.asm | Entry point for the game. |
pokered.link | Linker script that specifies which address and in which bank each section is located. |
sram.asm | Defines what data is to be saved to the cartridge’s SRAM and where it’s located. |
text.asm | Dialogue text is defined here and all other text is loaded via includes. |
vram.asm | Video RAM vectors defining the address spaces for graphics data to be loaded into. |
wram.asm | Memory layout for where pieces of data get stored in work RAM. |