The 2sf Generic Sequence Driver of DOOM Ripping guide by unknownfile Revision 2 (corrected some typos) DOOMの標準ドライバ用・2sfリッピングの手引 by unknownfile 第2版 (誤字を修正) This guide comes with the basic materials. I will discuss them later on. この手引はツール類を同梱しています。これについては後で再検討します。 You only need three other things to use this package. Do not ask me for them. It is up to you to look for them. このパッケージを使うためには以下の3つが必要です。入手方法について質問しないこと。 -Yoshi's Island DS.nds (European version) -A SDAT file (sound_data.sdat in most games) -Visual C++ 2005 ・ヨッシーアイランドDS(欧州版)のROMイメージ ・SDATファイル (ほとんどのゲームに含まれているsound_data.sdat) ・Visual C++ 2005 Please note that this guide only covers the sequence player and not the STRM player used by games such as Kaitou Wario the Seven / Wario Master of Disguise. hcs has added support to in_cube for such files. 注:この手引ではシーケンスのみを扱い、怪盗ワリオ・ザ・セブン(Wario Master of Disguise) などで使われているSTRM形式は扱いません。hcs氏のin_cubeがそういう形式に対応しています。 To those reading this through exite.co.jp or another automatic translator, please be advised that some of this guide might have been inaccurately translated. I would write a Japanese version but my Japanese skills aren't good. excite.co.jpなどの機械翻訳を使って読んでいる人は、訳が不正確である可能性に留意してください。 日本語版を書こうかとも思いましたが、筆者の日本語力はろくなものではありません。 STEP 1: RIPPING THE SDAT ステップ1:SDATを抽出 Open the command prompt and navigate to the base directory. Type: コマンドプロンプトを開いて作業ディレクトリに移動してください。 以下のコマンドを実行。 ndstool -x target.nds -d target where target is the NDS ROM you wish to rip. target.ndsは吸い出し対象のNDS ROMイメージです。 This will produce a folder containing the files from the ROM image. Open it and look for files such as SOUND_DATA.SDAT or maybe others, then copy them into the directory containing the main package. これによりROMイメージから抽出されたファイルが入ったフォルダができます。 その中からSOUND_DATA.SDATあるいは似たような名前のファイルを見つけ、 この手引の中身と同じ場所にコピーしてください。 Now, extract the Yoshi's Island DS ROM using the included deextract.bat. You should rename it to x.nds for the batch file to use for easy use later on. 次に、deextract.batを使ってヨッシーアイランドDSのROMを展開します。 バッチがそういう記述になっているのでx.ndsにリネームしておいてください。 This will create a folder called data. Look for sound_data.sdat in this folder, and replace it with the one you obtained from the target ROM. Run pack.bat and this will create modcrap.nds. dataというフォルダが作られるのでsound_data.sdatを見つけてください。 これを先ほど目的のROMから取り出したものに置き換えます。 pack.batを実行するとmodcrap.ndsが作られます。 Last but not least, run sdattool in order to find out the structure of the sequence bank. The command is: ここが大事なのですが、sdattoolを実行してシーケンスバンクの構造を調べます。 コマンドは以下。 sdattool sound_data.sdat This will create a "sound_data" folder, open it and look at the file sound_data.smap. Under the table SEQ, make note of the sequence numbers. For example, number 0 is the first in the bank, and number 10 is last in the bank. Keep these numbers for future reference. これによりsound_dataフォルダが作られます。まずsound_data.smapを見つけてください。 シーケンスのテーブルについている番号に着目してください。例えば、バンクの先頭が0で 末尾が10といった具合です。この数字を後で使います。 STEP 2: CREATING THE SAVESTATE ステップ2:セーブステートを作成 Open up the Desmume source package, and look at armcpu.c. You will find this: Desmumeのソースを展開し、armcpu.cを見てください。以下のような部分があります。 // #define GENERIC_DRIVER_TIME #ifdef GENERIC_DRIVER_TIME // Yoshi's Island DS - Generic driver rips if (NDS_ARM9.R[15] == 0x201513C) { if (saved==1) { MessageBox(NULL,"you did it right","yay",MB_OK); //DumpLog(armcpu); NDS_ARM9.R[1]=3; ARM9_Kill(0xC18); // Main thread savestate_save("BASE.DST"); } saved++; } #endif Uncomment the #define and compile the source package. You need DirectX and the zlib libraries installed in order to do this. If you have trouble compiling, check the Desmume site for stuff. #defineのコメントを外して全体をコンパイルします。 これにはDirectXとzlibライブラリがインストールされている必要があります。 うまくコンパイルできない場合はDesmumeのサイトを参照してください。 Now, run modcrap.nds in the compiled Desmume.exe. When you get to the opening sequence, hit enter (Start). This will direct the game's attention to the title screen, where it will display the message box, and will freeze everything but the main audio thread. コンパイルしたDesmume.exeでmodcrap.ndsを走らせ、オープニングが始まったら Enter(STARTボタン)を押します。これで本来ならタイトル画面が出るところですが、 メッセージボックスが出てオーディオ処理以外がフリーズします。 You have created the savestate. Comment out the define in armcpu.c, as it will cause trouble later on if you don't. これでセーブステートができているはずです。 後で困らないようにarmcpu.cのdefineをまたコメントにしておきます。 STEP 3: CLEANING THE CRAP DATA AND MAKING THE 2SF SET ステップ3:ゴミを除いて2sfセットを作成 Comment out the lines used to create the savestate, and open main.c. Near the top you will find the commented define: セーブステート作成のためにいじった行を再度コメントアウトしたら、 今度はmain.cを開きます。先頭付近にコメントアウトされたdefineがあるはずです。 //#define USE_TRACER 1 Uncomment this and look for: このコメントを外し、以下の部分を見つけます。 unsigned int bottom_trace_value=0x0; // lowest value in a SDAT unsigned int top_trace_value=0x200; // highest value in a SDAT unsigned int cur_trace_value=0; // this is filled in by the ripper unsigned int trace_register=1; // send all sequence values to general purpose register 1 Replace bottom_trace_value with the lowest possible sequence in the sequence bank, and top_trace_value with the highest possible sequence. Leave cur_trace_value and trace_register alone unless you want the ripping process to screw up. bottom_trace_valueを先ほどの小さいほうの値を入れ、top_trace_valueに大きいほうの値を入れます。 cur_trace_valueとtrace_registerは変更するとうまくいきません。 Compile Desmume and load modcrap.nds. The code tracer will run, and after a while, it will produce a file called clean.nds. Copy this and base.dst over to the package directory. Desmumeをコンパイルしてmodcrap.ndsを読み込みます。code tracerが走って、 ちょっと待つとclean.ndsというファイルができます。これとbase.dstを この手引の中身と同じ場所にコピーします。 Go to the command prompt and type: コマンドプロンプトで以下を実行。 dst2bin -z base.dst This will create a file called base.dst_zlib.bin. これでbase.dst_zlib.binが作られます。 Now type: 次に以下を実行。 2sftool clean.nds base.dst_zlib.bin my2sflib.2sflib where "my2sflib" should be the name of the game you're ripping. This will create the 2sflib. 「my2sflib」は目的のゲーム名にでもするといいでしょう。 これで2sflibが作られます。 Now type: さらに以下を実行。 dst2bin -mini 236 minvalue maxvalue my2sflib.2sflib where minvalue and maxvalue are the sequence bank values. このminvalueとmaxvalueには先ほどの値を入れます。 This will create the mini2sf files. これでmini2sfができます。 You're done. 完了。 ABOUT THE AUTHOR 筆者について Nobody cares. You can find this guide on the internet at unknown.hcs64.com. どうでもいいよね。この手引はインターネット上ではunknown.hcs64.comにあります。