From 4bb05d015a4a878b21e7ed3c4b02088e813bc929 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Thu, 8 Apr 2010 19:48:06 +0200 Subject: [PATCH] Support for v0.31.02 --- examples/spatterdump.cpp | 50 ++++++++++++++++++++++++++++++++++++++++ output/Memory.xml | 16 +++++++++---- 2 files changed, 62 insertions(+), 4 deletions(-) diff --git a/examples/spatterdump.cpp b/examples/spatterdump.cpp index 6190eba24..a6e0fb3d6 100644 --- a/examples/spatterdump.cpp +++ b/examples/spatterdump.cpp @@ -24,6 +24,56 @@ using namespace std; using namespace DFHack; +typedef uint32_t _DWORD; +int get_material_vector(uint32_t vein_8, uint16_t vein_4, int WORLD_) +{ + int result; // eax@2 + int v4; // ecx@11 + int v5; // eax@12 + + if ( (uint16_t)(vein_4 - 0x1A3) > 0xC7u ) + { + if ( ((int16_t)vein_4 < 19 || (int16_t)vein_4 > 0xDAu) + && (uint16_t)(vein_4 - 219) > 0xC7u ) + { + if ( vein_4 ) + { + if ( vein_4 > 0x292u ) + result = 0; + else + result = *(_DWORD *)(WORLD_ + 4 * (int16_t)vein_4 + 0x5DF44); + } + else + { + if ( (signed int)vein_8 >= 0 + && (v4 = *(_DWORD *)(WORLD_ + 0x54B88), vein_8 < (*(_DWORD *)(WORLD_ + 0x54B8C) - v4) >> 2) + && (v5 = *(_DWORD *)(v4 + 4 * vein_8)) != 0 ) + result = v5 + 0x178; + else + result = *(_DWORD *)(WORLD_ + 0x5DF44); + } + } + else + { + /* + result = sub_4D47A0(vein_8, vein_4, WORLD_ + 0x54C84); + if ( !result ) + result = *(_DWORD *)(WORLD_ + 0x5DF90); + */ + } + } + else + { + /* + result = sub_41F430(WORLD_ + 0x54B94, vein_4); + if ( !result ) + result = *(_DWORD *)(WORLD_ + 0x5E5D0); + */ + } + return result; +} + + char shades[10] = {'#','$','O','=','+','|','-','^','.',' '}; int main (int numargs, const char ** args) { diff --git a/output/Memory.xml b/output/Memory.xml index 7cdbb2459..718358ea2 100644 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -2980,6 +2980,8 @@ map_data_1b60_offset 0x1B9c 0x830 0x073C + 0x0754 + 0x1F4 @@ -2992,11 +2994,16 @@ map_data_1b60_offset 0x1B9c -
0x16afcec
+ + this is an array of 4B pointers to material templates and length 0x292 + base_type_array = WORLD + 0x5DF44 +
0x016b90cc
0x16afcec
+ inorganics vector = WORLD + 0x54B7C = 0x16AFD04
0x16afd04
+ 0x178
0x16afd1C
@@ -3026,8 +3033,6 @@ map_data_1b60_offset 0x1B9c
0x016AFE58
- this is an array of 4B pointers to material templates and length 0x292 -
0x016b90cc
Constructions ============= @@ -3127,7 +3132,10 @@ map_data_1b60_offset 0x1B9c
0x09048d18
--> - + + 23dfe141c7ea4e63ebb3c618a12b48ec + 0x4BBDF378 + .-"""-. ' \ |,. ,-. | _________________________