Skip to content

Commit

Permalink
Add CS1 patch to fix expected texture size for Thor Master Quartz so …
Browse files Browse the repository at this point in the history
…it can be HD-texture'd.
  • Loading branch information
AdmiralCurtiss committed Jun 1, 2020
1 parent 028e474 commit a66b48a
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 6 deletions.
4 changes: 4 additions & 0 deletions SenLib/Sen1/Sen1ExecutablePatchEnglish.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ public long GetAddressJumpR2NotebookOpen() {
public long GetAddressJumpR2NotebookSettings() {
return 0x6dfaf0;
}

public long GetRomAddressThorMasterQuartzTextureIdTypo() {
return 0x73adba;
}
}
}
3 changes: 3 additions & 0 deletions SenLib/Sen1/Sen1ExecutablePatchInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,8 @@ public interface Sen1ExecutablePatchInterface {

// address of conditional jump statement for not displaying the R2 option in the settings when turbo is enabled
long GetAddressJumpR2NotebookSettings();

// address of extra character in the middle of texture ID string of Thor MQ, for the HQ texture pack
long GetRomAddressThorMasterQuartzTextureIdTypo();
}
}
4 changes: 4 additions & 0 deletions SenLib/Sen1/Sen1ExecutablePatchJapanese.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,9 @@ public long GetAddressJumpR2NotebookOpen() {
public long GetAddressJumpR2NotebookSettings() {
return 0x6de1a0;
}

public long GetRomAddressThorMasterQuartzTextureIdTypo() {
return 0x738f6a;
}
}
}
7 changes: 7 additions & 0 deletions SenLib/Sen1/Sen1ExecutablePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,12 @@ public static void PatchJumpR2NotebookSettings(Stream binary, Sen1ExecutablePatc
}
}

public static void PatchThorMasterQuartzString(Stream binary, Sen1ExecutablePatchInterface patchInfo) {
binary.Position = patchInfo.GetRomAddressThorMasterQuartzTextureIdTypo();
long p = binary.Position;
byte[] tmp = binary.ReadUInt8Array(4);
binary.Position = p;
binary.Write(tmp, 1, 3);
}
}
}
27 changes: 21 additions & 6 deletions SenPatcherGui/Sen1Form.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions SenPatcherGui/Sen1Form.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private void buttonPatch_Click(object sender, EventArgs e) {
bool removeTurboSkip = checkBoxBattleAutoSkip.Checked;
bool allowR2NotebookShortcut = checkBoxAllowR2InTurboMode.Checked;
int turboKey = comboBoxTurboModeKey.SelectedIndex;
bool fixTextureIds = checkBoxFixHdTextureId.Checked;

if (removeTurboSkip) {
Sen1ExecutablePatches.PatchJumpBattleAnimationAutoSkip(ms, PatchInfo, true);
Expand All @@ -84,6 +85,9 @@ private void buttonPatch_Click(object sender, EventArgs e) {
Sen1ExecutablePatches.PatchButtonBattleResultsAutoSkip(ms, PatchInfo, (byte)turboKey);
Sen1ExecutablePatches.PatchButtonTurboMode(ms, PatchInfo, (byte)turboKey);
}
if (fixTextureIds) {
Sen1ExecutablePatches.PatchThorMasterQuartzString(ms, PatchInfo);
}

// write patched file
using (var fs = new FileStream(Path, FileMode.Create, FileAccess.Write)) {
Expand Down

0 comments on commit a66b48a

Please sign in to comment.