Library that injects distribution event pokémon and reads (some) metadata and pokémon front sprites from the Gen 1 and Gen 2 Pokémon games
Go to file
2026-02-10 21:57:35 +01:00
docs Initial import 2024-06-11 21:45:59 +02:00
examples Add setMoney example executable 2026-02-10 21:04:48 +01:00
include Support reading and writing the trainers' money from the save file. 2026-01-14 18:49:37 +01:00
src Fix crash with Gen1GameReader::setTrainerMoney 2026-02-10 21:57:35 +01:00
CREDITS.md Try again formatting the titles 2024-06-11 21:59:03 +02:00
LICENSE Update LICENSE 2024-06-11 21:47:38 +02:00
Makefile Support reading and writing the trainers' money from the save file. 2026-01-14 18:49:37 +01:00
README.md V0.3 (#7) 2025-02-17 12:38:21 +01:00

Introduction

This project implements functionality to read stats, front sprites, Trainers' party/PC boxes and other various properties either directly from the ROM/cartridge or from a save file of Gen 1 and Gen 2 Pokémon games. It also has support and data to inject the Distribution event pokémon into gen 1 and gen 2 pokémon save files.

I'm happy to accept pull requests if the community wants to do them.

Features

  • Decode front sprites from Gen 1 and Gen 2 Pokémon games
  • Decode party icons in Gen 1 and 2 games
  • Read Trainers' party and PC boxes from Gen 1 and 2
  • Inject Pokémon from past distribution events into your Gen 1/Gen 2 game save
  • Inject other pokémon into your Gen 1/Gen 2 game save
  • Supports all localizations

Dependencies

This library only depends on libc. I specifically wanted to avoid the bloat of libstdc++ or any other library. This choice is to keep this library small and portable.

The library was developed on Linux. I haven't tried building it on Windows or WSL yet, so let me know how that goes :)

Build

To build it, you can do this:

#Build with 12 threads (Change the thread number to what you want):

make -j 12

Usage

You can add the library to your project and use either the Gen1GameReader or Gen2GameReader alongside an instance of the BufferBasedRomReader and BufferBasedSaveManager.

There are also a few standalone example applications that are being built while building this project.

The most interesting one of those for most will probably be the addDistributionPoke application:

It gives you a menu in the terminal to select a distribution event pokémon into your save file.

Goal

This project was built as a stepping stone for PokeMe64: This project injects Distribution pokémon into a cartridge using the N64 transfer pak. That's why the initial feature set of libpokemegb is what it is.

I also hope that if someone else wants to work on something similar, that he/she finds the functionality they want or inspiration to implement it themselves. I tried to document the resources I used during development in the code.

Future potential improvements

  • Add support for gen 3
  • Possibly other additions if the community wants them?