mirror of
https://github.com/AdmiralCurtiss/WfcPatcher.git
synced 2026-09-07 10:45:48 -05:00
Clean up command line output and use a sensible out filename.
This commit is contained in:
10
Program.cs
10
Program.cs
@@ -18,9 +18,10 @@ namespace WfcPatcher {
|
||||
}
|
||||
|
||||
static void PatchFile( string filename ) {
|
||||
Console.WriteLine( "Reading & Copying ROM..." );
|
||||
Console.WriteLine( "Reading and copying " + filename + "..." );
|
||||
var ndsSrc = new System.IO.FileStream( filename, System.IO.FileMode.Open );
|
||||
var nds = new System.IO.FileStream( filename + ".wfc.nds", System.IO.FileMode.Create );
|
||||
string newFilename = System.IO.Path.Combine( System.IO.Path.GetDirectoryName( filename ), System.IO.Path.GetFileNameWithoutExtension( filename ) ) + " (AltWfc)" + System.IO.Path.GetExtension( filename );
|
||||
var nds = new System.IO.FileStream( newFilename, System.IO.FileMode.Create );
|
||||
Util.CopyStream( ndsSrc, nds, (int)ndsSrc.Length );
|
||||
ndsSrc.Close();
|
||||
|
||||
@@ -37,6 +38,8 @@ namespace WfcPatcher {
|
||||
PatchOverlay( nds, arm9overlayoff, arm9overlaylen );
|
||||
PatchOverlay( nds, arm7overlayoff, arm7overlaylen );
|
||||
|
||||
Console.WriteLine();
|
||||
|
||||
nds.Close();
|
||||
}
|
||||
|
||||
@@ -83,6 +86,7 @@ namespace WfcPatcher {
|
||||
if ( ReplaceInData( decData ) ) {
|
||||
// if something was replaced, put it back into the ROM
|
||||
if ( compressed ) {
|
||||
Console.WriteLine( "Replacing and recompressing overlay " + id + "..." );
|
||||
|
||||
uint newCompressedSize = 0;
|
||||
data = blz.BLZ_Encode( decData, 0 );
|
||||
@@ -93,6 +97,8 @@ namespace WfcPatcher {
|
||||
nds.Write( newCompressedSizeBytes, 0, 3 );
|
||||
|
||||
} else {
|
||||
Console.WriteLine( "Replacing overlay " + id + "..." );
|
||||
|
||||
data = decData;
|
||||
}
|
||||
|
||||
|
||||
10
blz.cs
10
blz.cs
@@ -161,7 +161,7 @@ namespace WfcPatcher {
|
||||
uint pak_len, raw_len, len, pos, inc_len, hdr_len, enc_len, dec_len;
|
||||
byte flags = 0, mask;
|
||||
|
||||
Console.Write( "- decoding" );
|
||||
//Console.Write( "- decoding" );
|
||||
|
||||
pak_len = (uint)pak_buffer.Length;
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace WfcPatcher {
|
||||
raw_len = dec_len;
|
||||
|
||||
fileWasNotCompressed = true;
|
||||
Console.WriteLine();
|
||||
//Console.WriteLine();
|
||||
return pak_buffer;
|
||||
} else {
|
||||
if ( pak_len < 8 ) throw new Exception( "File has a bad header" );
|
||||
@@ -250,7 +250,7 @@ namespace WfcPatcher {
|
||||
|
||||
//Save( filename + ".dec", raw_buffer, raw_len );
|
||||
|
||||
Console.WriteLine();
|
||||
//Console.WriteLine();
|
||||
|
||||
return raw_buffer;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ namespace WfcPatcher {
|
||||
byte[] pak_buffer, new_buffer;
|
||||
uint raw_len, pak_len, new_len;
|
||||
|
||||
Console.Write("- encoding");
|
||||
//Console.Write("- encoding");
|
||||
|
||||
raw_len = (uint)raw_buffer.Length;
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace WfcPatcher {
|
||||
pak_buffer = retbuf;
|
||||
}
|
||||
|
||||
Console.WriteLine();
|
||||
//Console.WriteLine();
|
||||
|
||||
return pak_buffer;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user