From ab6459897d781f0fdae9809c3e182814f6222d04 Mon Sep 17 00:00:00 2001 From: "Travis J. Gutjahr" <33809229+Squirrelies@users.noreply.github.com> Date: Wed, 20 Feb 2019 07:43:05 -0600 Subject: [PATCH] Updated for latest patch. Moved poison logic to keep fine/caution/danger text color. --- RE2REmakeSRT/GameHashes.cs | 3 +++ RE2REmakeSRT/GameMemory.cs | 20 ++++++++++++++++++++ RE2REmakeSRT/MainUI.cs | 8 +++----- RE2REmakeSRT/Properties/AssemblyInfo.cs | 4 ++-- RE2REmakeSRT/REmake2VersionDetector.cs | 4 ++++ RE2REmakeSRT/REmake2VersionEnumeration.cs | 1 + 6 files changed, 33 insertions(+), 7 deletions(-) diff --git a/RE2REmakeSRT/GameHashes.cs b/RE2REmakeSRT/GameHashes.cs index 62a8f84..20fa6af 100644 --- a/RE2REmakeSRT/GameHashes.cs +++ b/RE2REmakeSRT/GameHashes.cs @@ -14,6 +14,9 @@ public static class GameHashes // Personally observed upon release. Ghost Survivors DLC. public static readonly byte[] Stock_1p10 = new byte[32] { 0xDF, 0x24, 0xE7, 0x07, 0x3E, 0x38, 0x1C, 0x37, 0xCE, 0xA5, 0x21, 0x95, 0x74, 0xEF, 0x3A, 0x81, 0x60, 0x3B, 0x9F, 0x3F, 0xE0, 0xCA, 0x5C, 0x3A, 0x05, 0x89, 0x95, 0x68, 0x5D, 0x72, 0x90, 0xD0 }; + // Personally observed upon release. Bug fix patch. + public static readonly byte[] Stock_1p11 = new byte[32] { 0x57, 0x1D, 0xEE, 0x3F, 0x37, 0xF6, 0xE7, 0x86, 0x1A, 0xF1, 0xA4, 0xAD, 0xB8, 0x15, 0xF6, 0xF1, 0x53, 0x37, 0xBA, 0x48, 0x73, 0xE4, 0xD6, 0x99, 0xCA, 0x71, 0x32, 0x85, 0xEA, 0x8D, 0x95, 0x4D }; + // Reported by T710MA on Speedrun.com (https://pbs.twimg.com/media/DzHTNaQUYAEsFFI.jpg:large). Unsure if region modified by Capcom or user-modified. public static readonly byte[] Unknown_1 = new byte[32] { 0xD0, 0xA2, 0xB8, 0x74, 0xA1, 0x47, 0x41, 0x08, 0xE7, 0x21, 0x25, 0x58, 0x9F, 0x79, 0xA5, 0x1A, 0x66, 0xC8, 0xCB, 0x05, 0x6B, 0xA3, 0xD5, 0x46, 0x28, 0xDA, 0xED, 0xAE, 0x1D, 0x7E, 0xA5, 0xEB }; } diff --git a/RE2REmakeSRT/GameMemory.cs b/RE2REmakeSRT/GameMemory.cs index 3f55065..3b5dee6 100644 --- a/RE2REmakeSRT/GameMemory.cs +++ b/RE2REmakeSRT/GameMemory.cs @@ -110,6 +110,26 @@ public GameMemory(int pid) PointerInventoryEntries[i] = new MultilevelPointer(memoryAccess, BaseAddress + 0x070AFE10, 0x50, 0x98, 0x10, 0x20 + (i * 0x08), 0x18); } + break; + } + case REmake2VersionEnumeration.Stock_1p11: // NEW + { + PointerIGT = new MultilevelPointer(memoryAccess, BaseAddress + 0x070B0910, 0x2E0, 0x218, 0x610, 0x710, 0x60); + PointerRank = new MultilevelPointer(memoryAccess, BaseAddress + 0x0708A9D8); + PointerPlayerHP = new MultilevelPointer(memoryAccess, BaseAddress + 0x070B0840, 0x50, 0x20); + PointerPlayerPoison = new MultilevelPointer(memoryAccess, BaseAddress + 0x070B0840, 0x50, 0x20, 0xF8); + + PointerEnemyEntries = new MultilevelPointer[32]; + for (int i = 0; i < PointerEnemyEntries.Length; ++i) + PointerEnemyEntries[i] = new MultilevelPointer(memoryAccess, BaseAddress + 0x070838A8, 0x80 + (i * 0x08), 0x88, 0x18, 0x1A0); + + if (!Program.programSpecialOptions.Flags.HasFlag(ProgramFlags.NoInventory)) + { + PointerInventoryEntries = new MultilevelPointer[20]; + for (int i = 0; i < PointerInventoryEntries.Length; ++i) + PointerInventoryEntries[i] = new MultilevelPointer(memoryAccess, BaseAddress + 0x070B0840, 0x50, 0x98, 0x10, 0x20 + (i * 0x08), 0x18); + } + break; } default: diff --git a/RE2REmakeSRT/MainUI.cs b/RE2REmakeSRT/MainUI.cs index 20d329c..0bb0b83 100644 --- a/RE2REmakeSRT/MainUI.cs +++ b/RE2REmakeSRT/MainUI.cs @@ -184,11 +184,6 @@ private void playerHealthStatus_Paint(object sender, PaintEventArgs e) e.Graphics.DrawString("DEAD", healthFont, Brushes.Red, 15, 37, stdStringFormat); playerHealthStatus.ThreadSafeSetHealthImage(Properties.Resources.EMPTY, "EMPTY"); } - else if (Program.gameMem.PlayerPoisoned) - { - e.Graphics.DrawString(Program.gameMem.PlayerCurrentHealth.ToString(), healthFont, Brushes.MediumPurple, 15, 37, stdStringFormat); - playerHealthStatus.ThreadSafeSetHealthImage(Properties.Resources.POISON, "POISON"); - } else if (Program.gameMem.PlayerCurrentHealth >= 801) // Fine (Green) { e.Graphics.DrawString(Program.gameMem.PlayerCurrentHealth.ToString(), healthFont, Brushes.LawnGreen, 15, 37, stdStringFormat); @@ -204,6 +199,9 @@ private void playerHealthStatus_Paint(object sender, PaintEventArgs e) e.Graphics.DrawString(Program.gameMem.PlayerCurrentHealth.ToString(), healthFont, Brushes.Red, 15, 37, stdStringFormat); playerHealthStatus.ThreadSafeSetHealthImage(Properties.Resources.DANGER, "DANGER"); } + + if (Program.gameMem.PlayerPoisoned) + playerHealthStatus.ThreadSafeSetHealthImage(Properties.Resources.POISON, "POISON"); } private void playerInfoPanel_Paint(object sender, PaintEventArgs e) diff --git a/RE2REmakeSRT/Properties/AssemblyInfo.cs b/RE2REmakeSRT/Properties/AssemblyInfo.cs index 89e4c70..0e0b2af 100644 --- a/RE2REmakeSRT/Properties/AssemblyInfo.cs +++ b/RE2REmakeSRT/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.2.3.0")] -[assembly: AssemblyFileVersion("1.2.3.0")] +[assembly: AssemblyVersion("1.2.4.0")] +[assembly: AssemblyFileVersion("1.2.4.0")] diff --git a/RE2REmakeSRT/REmake2VersionDetector.cs b/RE2REmakeSRT/REmake2VersionDetector.cs index 5aa9687..516fca1 100644 --- a/RE2REmakeSRT/REmake2VersionDetector.cs +++ b/RE2REmakeSRT/REmake2VersionDetector.cs @@ -42,6 +42,10 @@ public static REmake2VersionEnumeration GetVersion(int pid) { return REmake2VersionEnumeration.Stock_1p10; } + else if (processHash.SequenceEqual(GameHashes.Stock_1p11)) + { + return REmake2VersionEnumeration.Stock_1p11; + } else { // Either a version we've never encountered before or this game was modified. diff --git a/RE2REmakeSRT/REmake2VersionEnumeration.cs b/RE2REmakeSRT/REmake2VersionEnumeration.cs index ccb2363..65a5a82 100644 --- a/RE2REmakeSRT/REmake2VersionEnumeration.cs +++ b/RE2REmakeSRT/REmake2VersionEnumeration.cs @@ -6,6 +6,7 @@ public enum REmake2VersionEnumeration : byte Stock_1p00 = 0x01, // 1.00 Stock_1p01 = 0x02, // 1.01 Stock_1p10, // 1.10 (Ghost Survivors DLC) + Stock_1p11, Demo = 0xFF // Unsupported. } }