From 9b9faf2fec9d026e916556f263410533b989e8f9 Mon Sep 17 00:00:00 2001 From: thurin Date: Wed, 19 Feb 2020 17:49:11 -0700 Subject: [PATCH 1/5] combine nshcat and indivisible 04702 and 04703 patches with new 04703 Mac patch --- patches.hpp | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/patches.hpp b/patches.hpp index 5697bc5..66ae6d0 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1311,7 +1311,88 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) 0x10a2f30, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } }; #endif +#elif defined(DF_04702) + #ifdef WIN32 + #define A_LOAD_MULTI_PDIM 0x140c1e5d0 + #define A_RENDER_MAP 0x1409d72d0 + #define A_RENDER_UPDOWN 0x1406ef250 + + static patchdef p_display = { 0x140478aab, 5 }; + + static patchdef p_dwarfmode_render = { 0x14042c88a, 5 }; + + static patchdef p_advmode_render[] = { + { 0x14037180a, 5+7+5 }, { 0x140371871, 5+7+5 }, { 0x1403718d7, 5+7+5 }, { 0x140371e02, 5+7+5 } + }; + + static patchdef p_render_lower_levels = { + 0x140d72de0, 9, true, { 0x48, 0x8b, 0x44, 0x24, 0x28, 0xc6, 0x00, 0x00, 0xc3 } + }; + #elif defined(__APPLE__) + #error Mac OSX not currently supported for 0.47.02 + #else + #define A_RENDER_MAP 0xec8270 + #define A_RENDER_UPDOWN 0xc87720 + #define NO_DISPLAY_PATCH + static patchdef p_dwarfmode_render = { 0x774035, 5 }; + + static patchdef p_advmode_render[] = { + { 0x740142, 5+5+5 }, { 0x74076a, 5+5+5 }, { 0x7407a9, 5+5+5 }, { 0x740802, 5+5+5 } + }; + + static patchdef p_render_lower_levels = { + 0x1154050, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; + #endif +#elif defined(DF_04703) + #ifdef WIN32 + #define A_LOAD_MULTI_PDIM 0x140c1f2c0 + #define A_RENDER_MAP 0x1409d7fa0 + #define A_RENDER_UPDOWN 0x1406efeb0 + + static patchdef p_display = { 0x1404796ab, 5 }; + + static patchdef p_dwarfmode_render = { 0x14042d48a, 5 }; + + static patchdef p_advmode_render[] = { + { 0x1403723fa, 5+7+5 }, { 0x140372461, 5+7+5 }, { 0x1403724c7, 5+7+5 }, { 0x1403729f2, 5+7+5 } + }; + + static patchdef p_render_lower_levels = { + 0x140d74290, 9, true, { 0x48, 0x8b, 0x44, 0x24, 0x28, 0xc6, 0x00, 0x00, 0xc3 } + }; + #elif defined(__APPLE__) + #define A_LOAD_MULTI_PDIM 0x101371660 + #define A_RENDER_MAP 0x100c1c890 + #define A_RENDER_UPDOWN 0x100973f90 + + static patchdef p_display = { 0x101303bdb, 5 }; + + static patchdef p_dwarfmode_render = { 0x10054036a, 5 }; + + static patchdef p_advmode_render[] = { + { 0x1004db7bf, 5+3+5 }, { 0x1004db860, 5+7+5 }, { 0x1004dbdda, 5+3+5 }, { 0x1004dc0ea, 5+3+5 } + }; + + static patchdef p_render_lower_levels = { + 0x100ec6c70, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; + #else + #define A_RENDER_MAP 0xec8f40 + #define A_RENDER_UPDOWN 0xc88f90 + #define NO_DISPLAY_PATCH + + static patchdef p_dwarfmode_render = { 0x774755, 5 }; + + static patchdef p_advmode_render[] = { + { 0x740882, 5+5+5 }, { 0x740eaa, 5+5+5 }, { 0x740ee9, 5+5+5 }, { 0x740f42, 5+5+5 } + }; + + static patchdef p_render_lower_levels = { + 0x1155720, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; + #endif #else #error Unsupported DF version #endif From d97cc5954867c14a086ac9a1cfe8bde2f9515521 Mon Sep 17 00:00:00 2001 From: thurin Date: Sun, 1 Mar 2020 02:13:15 -0700 Subject: [PATCH 2/5] 04704 osx WIP --- patches.hpp | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/patches.hpp b/patches.hpp index 66ae6d0..d6ef529 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1393,6 +1393,55 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) 0x1155720, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } }; #endif + #elif defined(DF_04704) + #ifdef WIN32 + #define A_LOAD_MULTI_PDIM 0x140c1f2c0 + #define A_RENDER_MAP 0x1409d7fa0 + #define A_RENDER_UPDOWN 0x1406efeb0 + + static patchdef p_display = { 0x1404796ab, 5 }; + + static patchdef p_dwarfmode_render = { 0x14042d48a, 5 }; + + static patchdef p_advmode_render[] = { + { 0x1403723fa, 5+7+5 }, { 0x140372461, 5+7+5 }, { 0x1403724c7, 5+7+5 }, { 0x1403729f2, 5+7+5 } + }; + + static patchdef p_render_lower_levels = { + 0x140d74290, 9, true, { 0x48, 0x8b, 0x44, 0x24, 0x28, 0xc6, 0x00, 0x00, 0xc3 } + }; + #elif defined(__APPLE__) + #define A_LOAD_MULTI_PDIM 0x101373670 + #define A_RENDER_MAP 0x100c1e120 + #define A_RENDER_UPDOWN 0x100975820 + + static patchdef p_display = { 0x101305beb, 5 }; + + static patchdef p_dwarfmode_render = { 0x10054180a, 5 }; + + static patchdef p_advmode_render[] = { + { 0x1004dcb2f, 5+3+5 }, { 0x1004dcbd0, 5+7+5 }, { 0x1004dd14a, 5+3+5 }, { 0x1004dd45a, 5+3+5 } + }; + + static patchdef p_render_lower_levels = { + 0x100ec89c0, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; + #else + #define A_RENDER_MAP 0xec8f40 + #define A_RENDER_UPDOWN 0xc88f90 + #define NO_DISPLAY_PATCH + + static patchdef p_dwarfmode_render = { 0x774755, 5 }; + + static patchdef p_advmode_render[] = { + { 0x740882, 5+5+5 }, { 0x740eaa, 5+5+5 }, { 0x740ee9, 5+5+5 }, { 0x740f42, 5+5+5 } + }; + + static patchdef p_render_lower_levels = { + 0x1155720, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + }; + #endif + #else #error Unsupported DF version #endif From 1e94a0dfdb4f5947e9fd3da14a83cfbe65c26f08 Mon Sep 17 00:00:00 2001 From: thurin Date: Sun, 1 Mar 2020 02:29:42 -0700 Subject: [PATCH 3/5] 04704 linux WIP --- patches.hpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/patches.hpp b/patches.hpp index d6ef529..b6baf3e 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1427,18 +1427,17 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) 0x100ec89c0, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } }; #else - #define A_RENDER_MAP 0xec8f40 - #define A_RENDER_UPDOWN 0xc88f90 + #define A_RENDER_MAP 0xec9420 + #define A_RENDER_UPDOWN 0xc895f0 #define NO_DISPLAY_PATCH - static patchdef p_dwarfmode_render = { 0x774755, 5 }; - + static patchdef p_dwarfmode_render = { 0x774cf5, 5 }; static patchdef p_advmode_render[] = { - { 0x740882, 5+5+5 }, { 0x740eaa, 5+5+5 }, { 0x740ee9, 5+5+5 }, { 0x740f42, 5+5+5 } + { 0x740fb2, 5+5+5 }, { 0x7415da, 5+5+5 }, { 0x741619, 5+5+5 }, { 0x741672, 5+5+5 } }; static patchdef p_render_lower_levels = { - 0x1155720, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } + 0x1156420, 5, true, { 0x41, 0xc6, 0x00, 0x00, 0xc3 } }; #endif From 38cae372fb6272e455342b37c0f67366e96b34e9 Mon Sep 17 00:00:00 2001 From: thurin Date: Sun, 1 Mar 2020 03:15:28 -0700 Subject: [PATCH 4/5] 04704 windows WIP --- patches.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/patches.hpp b/patches.hpp index b6baf3e..dab3db4 100644 --- a/patches.hpp +++ b/patches.hpp @@ -1395,20 +1395,20 @@ static void apply_patch(MemoryPatcher *mp, patchdef &p) #endif #elif defined(DF_04704) #ifdef WIN32 - #define A_LOAD_MULTI_PDIM 0x140c1f2c0 - #define A_RENDER_MAP 0x1409d7fa0 - #define A_RENDER_UPDOWN 0x1406efeb0 + #define A_LOAD_MULTI_PDIM 0x140c1f670 + #define A_RENDER_MAP 0x1409d8200 + #define A_RENDER_UPDOWN 0x1406f0090 - static patchdef p_display = { 0x1404796ab, 5 }; + static patchdef p_display = { 0x140479beb, 5 }; - static patchdef p_dwarfmode_render = { 0x14042d48a, 5 }; + static patchdef p_dwarfmode_render = { 0x14042d93a, 5 }; static patchdef p_advmode_render[] = { - { 0x1403723fa, 5+7+5 }, { 0x140372461, 5+7+5 }, { 0x1403724c7, 5+7+5 }, { 0x1403729f2, 5+7+5 } + { 0x14037283a, 5+7+5 }, { 0x1403728a1, 5+7+5 }, { 0x140372907, 5+7+5 }, { 0x140372e32, 5+7+5 } }; static patchdef p_render_lower_levels = { - 0x140d74290, 9, true, { 0x48, 0x8b, 0x44, 0x24, 0x28, 0xc6, 0x00, 0x00, 0xc3 } + 0x140d747c0, 9, true, { 0x48, 0x8b, 0x44, 0x24, 0x28, 0xc6, 0x00, 0x00, 0xc3 } }; #elif defined(__APPLE__) #define A_LOAD_MULTI_PDIM 0x101373670 From 1463d16b3642c2c5b88cb5b7d909a8f3b3f70350 Mon Sep 17 00:00:00 2001 From: thurin Date: Mon, 10 Aug 2020 17:11:41 -0600 Subject: [PATCH 5/5] update for new dfhack item and building enums --- legacy/renderer_legacy.hpp | 4 ++-- tileupdate_map.hpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/legacy/renderer_legacy.hpp b/legacy/renderer_legacy.hpp index c734c7b..7cc45cd 100644 --- a/legacy/renderer_legacy.hpp +++ b/legacy/renderer_legacy.hpp @@ -257,7 +257,7 @@ static void write_tile_arrays_legacy(df::renderer *r, int x, int y, GLfloat *fg, { override_group &og = *it; - auto ilist = world->items.other[og.other_id]; + auto ilist = world->items.other[(df::enums::items_other_id::items_other_id) og.other_id]; for (auto it2 = ilist.begin(); it2 != ilist.end(); it2++) { df::item *item = *it2; @@ -286,7 +286,7 @@ static void write_tile_arrays_legacy(df::renderer *r, int x, int y, GLfloat *fg, { override_group &og = *it; - auto ilist = world->buildings.other[og.other_id]; + auto ilist = world->buildings.other[(df::enums::buildings_other_id::buildings_other_id) og.other_id]; for (auto it2 = ilist.begin(); it2 != ilist.end(); it2++) { df::building *bld = *it2; diff --git a/tileupdate_map.hpp b/tileupdate_map.hpp index bff7dfa..e7e0206 100644 --- a/tileupdate_map.hpp +++ b/tileupdate_map.hpp @@ -159,7 +159,7 @@ static void write_tile_arrays_map(renderer_cool *r, int x, int y, GLfloat *fg, G { override_group &og = *it; - auto &ilist = world->items.other[og.other_id]; + auto &ilist = world->items.other[(df::enums::items_other_id::items_other_id) og.other_id]; for (auto it2 = ilist.begin(); it2 != ilist.end(); it2++) { df::item *item = *it2; @@ -202,7 +202,7 @@ static void write_tile_arrays_map(renderer_cool *r, int x, int y, GLfloat *fg, G { override_group &og = *it; - auto &ilist = world->buildings.other[og.other_id]; + auto &ilist = world->buildings.other[(df::enums::buildings_other_id::buildings_other_id) og.other_id]; for (auto it2 = ilist.begin(); it2 != ilist.end(); it2++) { df::building *bld = *it2;