From d7e647a945c8125c58f1c23cd8b31d70c447dee4 Mon Sep 17 00:00:00 2001 From: disillusionment Date: Sun, 29 Oct 2023 21:38:17 -0700 Subject: [PATCH 1/2] Update patches.hpp Restore support for 32bit x86 Dwarf Fortress/dfhack --- patches.hpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/patches.hpp b/patches.hpp index bfd134c..ead46ba 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1473,6 +1473,21 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) static patchdef p_render_lower_levels = { 0x100eca2e0, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } }; + + #elif defined(__i386__) // restores support for 32bit Dwarf Fortress/dfhack + #define A_RENDER_MAP 0x08c868d0 + #define A_RENDER_UPDOWN 0x08a0bd10 + #define NO_DISPLAY_PATCH + + static patchdef p_dwarfmode_render = { 0x412da2, 5 }; + + static patchdef p_advmode_render[] = { + { 0x083e9662, 5+7+5 }, { 0x083e971a, 5+7+5 }, { 0x083e9dd4, 5+7+5 }, { 0x083ea1d0, 5+7+5 } + }; + + static patchdef p_render_lower_levels = { + 0x08f7e350, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; #else #define A_RENDER_MAP 0xeca570 #define A_RENDER_UPDOWN 0xc8a1a0 From 6ed039b0a40de10c26836f4a96bd19c7c5920510 Mon Sep 17 00:00:00 2001 From: disillusionment Date: Tue, 31 Oct 2023 08:16:55 -0700 Subject: [PATCH 2/2] Update patches.hpp Replaced assembly patch with 32 bit version --- patches.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/patches.hpp b/patches.hpp index ead46ba..b52412f 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1486,7 +1486,7 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) }; static patchdef p_render_lower_levels = { - 0x08f7e350, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + 0x08f7e350, 13, true, { 0x36,0x8b,0x84,0x24,0x14,0x00,0x00,0x00, 0x3e,0xc6,0x00,0x00, 0xC3 } }; #else #define A_RENDER_MAP 0xeca570