static bool ProcCommandLine() { if (ArgsDic.ContainsKey("--lint")) {//コマンドラインLint Program.IsCommandLine = true; Environment.Exit(ToolFELintForm.CommandLineLint()); return(true); } if (ArgsDic.ContainsKey("--rebuild")) {//コマンドラインrebuild Program.IsCommandLine = true; Environment.Exit(ToolROMRebuildForm.ComandLineRebuild()); return(true); } if (ArgsDic.ContainsKey("--pointercalc")) {//ポインタ変換 Program.IsCommandLine = true; Environment.Exit(PointerToolForm.ComandLineSearch()); return(true); } if (ArgsDic.ContainsKey("--translate")) {//ROM翻訳の実行 Program.IsCommandLine = true; Environment.Exit(ToolTranslateROMForm.CommandLineTranslate()); return(true); } if (ArgsDic.ContainsKey("--makeups")) {//UPSの作成 Program.IsCommandLine = true; Environment.Exit(ToolUPSPatchSimpleForm.CommandLineMakeUPS()); return(true); } if (ArgsDic.ContainsKey("--songexchange")) {//曲交換 Program.IsCommandLine = true; Environment.Exit(SongExchangeForm.CommandLineImport()); return(true); } #if DEBUG //デバッグの場合はテストを実行 DebugTESTRunner(); if (ArgsDic.ContainsKey("--translate_batch")) {//翻訳を自動実行 DevTranslateForm.CommandLineTranslateOnly(); } if (ArgsDic.ContainsKey("--testonly")) { //フルテストの場合、終了する. Environment.Exit(0); return(true); } #endif return(false); }
public static int CommandLineImport() { U.echo("CommandLineImport"); string fromrom = U.at(Program.ArgsDic, "--fromrom"); if (fromrom == "") { fromrom = U.at(Program.ArgsDic, "--target"); } if (!File.Exists(fromrom)) { U.echo("曲を取り出すROMを「--fromrom」で指定してください。"); return(-2); } SongExchangeForm f = (SongExchangeForm)InputFormRef.JumpFormLow <SongExchangeForm>(); f.LoadSongListAtOtherROM(fromrom); uint tosong = U.atoi0x(U.at(Program.ArgsDic, "--tosong")); if (tosong <= 0) { U.echo("曲をインポートする場所を「--tosong」で指定してください。"); return(-2); } U.SelectedIndexSafety(f.SongTable, tosong); uint fromsong = U.atoi0x(U.at(Program.ArgsDic, "--fromsong")); if (fromsong <= 0) { U.echo("曲をエクスポートする場所を「--fromsong」で指定してください。"); return(-2); } U.SelectedIndexSafety(f.OtherROMSongTable, fromsong); f.ConvertButton_Click(null, null); //インポートに成功したら保存する. if (Program.ROM.Modified) { MainFormUtil.SaveForce(f); } else { U.echo("曲のインポートに失敗しました。"); return(-1); } return(0); }
public static uint GetSoundTablePointer() { uint p = Program.ROM.RomInfo.sound_table_pointer(); uint a = Program.ROM.u32(p); if (U.isSafetyPointer(a)) { return(p); } p = SongExchangeForm.FindSongTablePointer(Program.ROM.Data); if (U.isSafetyOffset(p)) { a = Program.ROM.u32(p); if (U.isSafetyPointer(a)) { return(p); } } return(0); }