Coder Social home page Coder Social logo

pokemon-diamond-tetris's Introduction

pokemon-diamond-tetris

これは何?

こちらのブログ記事で公開したセーブデータを作成するために使用したプログラムのソースコードです。 ビルドするとポケモンのバイナリデータが生成されます。生成されたバイナリをゲーム内で所定のアドレスに書き込み、NPCASEを使って起動することでテトリスをプレイできます。

ビルドの方法

前提条件

ビルドには Docker, VS Code および Remote Development 拡張機能を利用します。

ディレクトリをコンテナ内で開く

次の手順に従いディレクトリをコンテナ内で開きます。

  1. 本リポジトリをダウンロードまたはクローンし、ディレクトリをVSCodeで開く。
  2. キーボードの [F1] をおしてコマンドパレットを開く。
  3. "Dev Containers: Reopen in Container" を検索して [Enter] を押して実行する。

ビルドする

ビルドをするには次のようにターミナルからmakeコマンドを実行します。

  1. VSCodeのメニューの Terminal > New Terminal からターミナルを開く。
  2. カレントディレクトリ(/workspaces/pokemon-diamond-tetris)で make コマンドを実行する。

makeコマンドが終了するとout ディレクトリ下に必要なポケモンのデータが生成されています。

出力されたファイルの使い方

テトリスをプレイするにはゲーム内で以下の2つの作業が必要です。

  • 出力されたファイルを所定の位置に書き込む。
  • NPCのイベントIDを書き換える。

ここからの作業はマサゴタウンのポケモンセンター2Fで行うこととします。

出力されたファイルを所定の位置に書き込む

out ディレクトリ下には eggsloader_egg.bin, npcase_egg00.bin, npcase_egg01.bin, tetris_egg00.bin, ..., tetris_egg14.bin の18個のファイルがあるはずです。各バイナリファイルはボックス内のポケモン1匹分のデータです。このバイナリをASEなりなんなりでパソコンのボックスに書き込みます。配置は以下の通りです。

ファイル名 ボックス番号 ボクス内の位置 1 メモリ上のアドレス (from base address 2)
eggsloader_egg.bin 1 1 +0xc318
tetris_egg00.bin 1 2 +0xc3a0
tetris_egg01.bin 1 3 +0xc428
...
tetris_egg14.bin 1 16 +0xcb10
npcase_egg00.bin 18 28 +0x1e060
npcase_egg01.bin 18 29 +0x1e0e8

NPCのイベントIDを書き換える

アドレスbase + 0x00024EF4にはNPCのイベントIDが格納されています。このアドレスの値を0x973Bに書き換えます。

テトリスのプレイ方法

もとの記事を御覧ください。

対応バージョン

ADAJN0J08(ダイヤモンド日本語初期版)のみ動作を確認しています。

Footnotes

  1. 左上が1,その右隣が2,...,一番右下を30とします。

  2. baseはセーブデータの起点になるアドレスで、ソフトを起動時にランダムに決められる。ダイヤモンド日本語版では0x02108818にその値が格納されている。

pokemon-diamond-tetris's People

Contributors

user40 avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

devreesejorik

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.