Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed SharpTune.exe
Binary file not shown.
9 changes: 9 additions & 0 deletions SharpTune/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
using System.Text;
using EcuMapTools;
using SharpTuneCore;
using System.Runtime.InteropServices;

namespace SharpTune
{
public static class Program
{
// defines for commandline output
[DllImport("kernel32.dll")]
static extern bool AttachConsole(int dwProcessId);
private const int ATTACH_PARENT_PROCESS = -1;

private static SharpTuner sharpTuner;
/// <summary>
/// Entry point. Runs the utility with or without exception handling, depending on whether a debugger is attached.
Expand All @@ -45,6 +51,9 @@ public static int Main(string[] args)
{
try
{
// redirect console output to parent process;
// must be before any calls to Console.WriteLine()
AttachConsole(ATTACH_PARENT_PROCESS);
result = Run(args);
}
catch (Exception exception)
Expand Down
4 changes: 2 additions & 2 deletions SharpTune/RomMod/Mod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,8 @@ public Mod(string modPath, string build)
FilePath = modPath;
isResource = false;
reader = new SRecordReader(modPath);
TryReadPatches();
TryReversePatches();
//TryReadPatches();
//TryReversePatches();
}

public bool TryDefinition(AvailableDevices ad, string defPath)
Expand Down
2 changes: 1 addition & 1 deletion SharpTune/RomMod/ModDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ public bool TryReadDefString(Blob metadata, out string metaString, ref int offse
}

char[] splitter = { '\0' };
string tempstring = System.Text.Encoding.ASCII.GetString(tempbytelist.ToArray());
string tempstring = System.Text.Encoding.UTF8.GetString(tempbytelist.ToArray());
metaString = tempstring.Split(splitter)[0];
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions SharpTune/RomMod/RomMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ public static bool TryHewBuild(AvailableDevices ad, string patchPath, string rom
return false;
}
}

// use baseline'd patch to create new mod
mod = new Mod(mod.ModIdent + ".patch");
File.Copy(romPath, "oem.bin", true);
Trace.WriteLine("Attempting to test patches");
if (!mod.TryCheckApplyMod(romPath, romPath, true, false)) //&& !mod.TryCheckApplyMod(romPath, romPath, false, false)) ;
Expand Down