# 《宝可梦 火红／叶绿》：生成一致 ROM 的 Game Boy Advance 反编译重建

> 为 Game Boy Advance 英文版《宝可梦 火红／叶绿》重建可构建的 C 源码，游戏脚本和数据以汇编指令形式保存。默认的 agbcc 构建可生成六个 ROM 镜像，涵盖两款游戏的 1.0 与 1.1 版本及两个标为 switch 的变体，并分别按各自的 SHA-1 清单校验。图像和音频源文件已提交在仓库中，因此文档所述的构建流程不读取原 ROM。

- 类型：案例
- 目标：游戏
- 类别：独立重建案例
- 关联：独立重建项目
- 来源复核于：2026-10-18
- 收录于：2026-10-18
- 原始资源：<https://github.com/pret/pokefirered>
- 一手来源：<https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/README.md>
- 目录页面：<https://awesomerea.org/zh/resources/pokemon-firered-leafgreen-decomp-case/>
- 记录 JSON：<https://awesomerea.org/resources/pokemon-firered-leafgreen-decomp-case/record.json>
- 英文版：[English](https://awesomerea.org/resources/pokemon-firered-leafgreen-decomp-case/index.md)

## 使用条件与局限

- **前提条件：**文档所述的构建不读取原 ROM：图像、音频采样和地图数据以 PNG、WAV／AIF 和 JSON 文件提交在仓库中，由附带工具转换。六份 .sha1 清单列出目标镜像（例如 pokefirered.gba 的 SHA-1 为 41cb23d8dccc8ebd7c649cd8fbb58eeace6e2fdc），README 链接各镜像的 No-Intro 条目。贡献者辅助脚本 compare.sh 只在存在 baserom.gba 时对其与产物做十六进制差异比较。
- **前提条件：**INSTALL.md 涵盖 Windows（推荐 WSL1，也可用 msys2 或 Cygwin）、macOS 和 Linux。在 Debian／Ubuntu 上需 build-essential、binutils-arm-none-eabi、git 和 libpng-dev；一致性构建还需先构建 pret/agbcc 并安装到仓库中。make modern 及对应的 *_modern 目标使用 devkitARM 的 arm-none-eabi-gcc，TOOLCHAIN 变量可指定其他 ARM 工具链。
- **范围：**README 将其描述为英文版火红与叶绿的反编译项目，可构建六个 ROM 镜像：两款游戏的原版与 rev1 版，以及名为 _switch 的变体（config.mk 以修订版 10 构建）。INSTALL.md 说明 make、make leafgreen 及 rev1 目标；Makefile 另有 _switch 目标。大部分代码为 C，启动代码、m4a 音频库的一部分及 GameCube 多重启动库仍为汇编，三个多重启动程序以预编译 .gba 二进制形式收录。产物是 GBA ROM，不是原生 PC 移植。
- **测试证据：**make compare 及各 compare_* 目标将构建出的镜像与对应 .sha1 清单比对；config.mk 注明比对只适用于非现代编译器构建。CI 比对全部六个镜像，并另外构建现代目标。docs/bugs_and_glitches.md 列出原游戏中的缺陷，可选的 BUGFIX 和 UBFIX 定义会修改这些行为，因此此类构建有意偏离原版。这些检查确认所列镜像的字节一致性。
- **许可：**仓库没有顶层许可证文件，GitHub 也未识别出许可证；许可证文件只覆盖部分附带工具，agbcc 的 GCC 源码附 GPL v2。原游戏的代码、图像和音频仍受其权利人约束。

## 一手来源

1. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/README.md>
2. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/INSTALL.md>
3. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/config.mk>
4. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/Makefile>
5. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/firered.sha1>
6. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/leafgreen.sha1>
7. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/firered_rev1.sha1>
8. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/leafgreen_rev1.sha1>
9. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/firered_switch.sha1>
10. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/leafgreen_switch.sha1>
11. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/compare.sh>
12. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/.github/workflows/build.yml>
13. <https://github.com/pret/pokefirered/blob/037335f4c725d7c9aecdac87066f2002b4bd7e14/docs/bugs_and_glitches.md>
14. <https://github.com/pret/pokefirered/tree/037335f4c725d7c9aecdac87066f2002b4bd7e14/tools>
15. <https://github.com/pret/agbcc/blob/da598c1d918402c42c0c0d7128ba14567f3175e9/gcc/COPYING>

## 同分区更多条目：游戏

- [《宝可梦 心金／魂银》：校验一致的进行中 DS 反汇编项目](https://awesomerea.org/zh/resources/pokemon-heartgold-soulsilver-disassembly-case/index.md) · 案例
- [《宝可梦 白金》：校验一致的 Nintendo DS 反编译重建](https://awesomerea.org/zh/resources/pokemon-platinum-decomp-case/index.md) · 案例
- [pw：Pokéwalker 固件的一致性反编译重建](https://awesomerea.org/zh/resources/pokewalker-matching-decomp-case/index.md) · 案例
- [Ratchet & Clank：记录了代理流程的 PS2 一致性反编译](https://awesomerea.org/zh/resources/rac1-matching-decomp-case/index.md) · 案例
- [re4：Resident Evil 4 GameCube 调试版的字节一致反编译](https://awesomerea.org/zh/resources/re4-gamecube-debug-decomp-case/index.md) · 案例
- [sead：Nintendo 第一方 C++ 标准库的反编译重建](https://awesomerea.org/zh/resources/sead-nintendo-library-decomp-case/index.md) · 案例

## 关于此条目

说明已依据一手来源复核。
原创说明采用 MIT 许可；外部项目、论文与素材保留各自的权利和许可。
