From ac8a55a11f3912d2cc4ddc345fcb8a612817a8bb Mon Sep 17 00:00:00 2001 From: "Admiral H. Curtiss" Date: Sun, 2 Nov 2014 04:56:15 +0100 Subject: [PATCH] Write out ARM9 in debug mode to ease identification of issues. --- Program.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Program.cs b/Program.cs index 12401bb..3e43a9e 100644 --- a/Program.cs +++ b/Program.cs @@ -88,6 +88,8 @@ namespace WfcPatcher { Console.WriteLine( "ARM9 old cmp size: 0x" + compressedSize.ToString( "X6" ) ); Console.WriteLine( "ARM9 old filesize: 0x" + len.ToString( "X6" ) ); Console.WriteLine( "ARM9 old diff: 0x" + additionalCompressedSize.ToString( "X6" ) ); + + System.IO.File.WriteAllBytes( "arm9-raw.bin", data ); #endif blz blz = new blz(); @@ -100,6 +102,9 @@ namespace WfcPatcher { if ( maybeDecData.Length == decompressedSize ) { compressed = true; decData = maybeDecData; +#if DEBUG + System.IO.File.WriteAllBytes( "arm9-dec.bin", decData ); +#endif } } catch ( Exception ) { compressed = false; @@ -124,6 +129,9 @@ namespace WfcPatcher { if ( arm9diff < 0 ) { // still too big, remove debug strings decData = RemoveDebugStrings( decData ); +#if DEBUG + System.IO.File.WriteAllBytes( "arm9-dec-without-debug.bin", decData ); +#endif data = blz.BLZ_Encode( decData, 0 ); newCompressedSize = (uint)data.Length; @@ -131,6 +139,9 @@ namespace WfcPatcher { if ( arm9diff < 0 ) { Console.WriteLine( "WARNING: Recompressed ARM9 is " + -arm9diff + " bytes bigger than original!" ); Console.WriteLine( " Patched game may be corrupted!" ); +#if DEBUG + System.IO.File.WriteAllBytes( "arm9-too-big-recomp.bin", data ); +#endif } } }