Some linux 31.22 offsets, slight tweaks to Materials

develop
Petr Mrázek 2011-03-25 02:31:27 +01:00
parent 754647fe96
commit 4c030e7cc1
4 changed files with 164 additions and 18 deletions

@ -2074,8 +2074,8 @@
</Group>
</Group>
<Group name="geology">
<Offset name="geoblock_vector_from_wdata" value="0x190" /> maybe
<Offset name="ptr2_region_array_from_wdata" value="0x1C0" /> maybe
<Offset name="geoblock_vector_from_wdata" value="0x190" />
<Offset name="ptr2_region_array_from_wdata" value="0x1C0" />
<Address name="geoblock_vector" valid="false" />
<Address name="ptr2_region_array" valid="false" />
</Group>
@ -2123,7 +2123,6 @@
<Offset name="temperature1" value="0x1580" />
<Offset name="temperature2" value="0x1780" />
<Offset name="biome_stuffs" value="0x1d80" />
-->
</Group>
</Group>
</Offsets>
@ -2653,6 +2652,97 @@
</Group>
</Offsets>
</Version>
<Version name="v0.31.22 linux" os="linux" base="v0.31.19 linux" rebase="0x12A80">
<MD5 value="c7319be110759209bd736071fb367960" />
<Offsets>
<Group name="Position">
<Address name="cursor_xyz" value="0x8c3dfc0" />
<Address name="window_dims" value="0x8c3e4c8" />
<Address name="window_x" value="0x8dfabf8" />
<Address name="window_y" value="0x8dfabfc" />
<Address name="window_z" value="0x8dfac00" />
</Group>
<Group name="Maps">
<Address name="world_data" value="0x944bc14"/>
<Address name="world_size_x" valid="false" />
<Address name="world_size_y" valid="false" />
<Offset name="world_size_x_from_wdata" value="0x5c" />
<Offset name="world_size_y_from_wdata" value="0x5e" />
<Group name="block">
<Offset name="mystery_offset" value="0x28" />
<Offset name="vegetation_vector" value="0x58" />
<Offset name="type" value="0x6e" />
<Offset name="designation" value="0x270" />
<Offset name="occupancy" value="0x670" />
<Offset name="pathfinding" value="0xd70" />
<Offset name="temperature1" value="0x1570" />
<Offset name="temperature2" value="0x1770" />
<Offset name="biome_stuffs" value="0x1d70" />
</Group>
<Group name="features">
<Group name="global">
<Address name="vector" valid="false" />
<Offset name="vector_from_wdata" value="0x12C" />
</Group>
<Group name="local">
<Address name="start_ptr" valid="false" />
<Offset name="start_ptr_from_wdata" value="0x198" />
</Group>
</Group>
<Group name="geology">
<Address name="geoblock_vector" valid="false" />
<Address name="ptr2_region_array" valid="false" />
<Offset name="geoblock_vector_from_wdata" value="0x138" />
<Offset name="ptr2_region_array_from_wdata" value="0x15C" />
</Group>
</Group>
<Group name="Materials">
<Address name="inorganics" value="0x944c320" />
<Address name="organics_all" value="0x944c338" />
<Address name="organics_plants" value="0x944c344" />
<Address name="organics_trees" value="0x944c35c" />
<Address name="creature_type_vector" value="0x944c3d4" />
one of those:
0x944c3c8
0x944c3d4
<Group name="creature">
<Offset name="tile_color" value="0x38" />
<Offset name="extract_vector" value="0x1f74" />
<!--
<Group name="caste">
<Offset name="attributes" /> NOT SET!
<Offset name="bodypart_vector" /> NOT SET!
<Offset name="color_modifiers" /> NOT SET!
</Group>
<Group name="caste_bodyparts">
<Offset name="category" /> NOT SET!
<Offset name="id" /> NOT SET!
<Offset name="layers_vector" /> NOT SET!
<Offset name="plural_vector" /> NOT SET!
<Offset name="singular_vector" /> NOT SET!
</Group>
<Group name="caste_color_mods">
<Offset name="enddate" /> NOT SET!
<Offset name="part" /> NOT SET!
<Offset name="startdate" /> NOT SET!
</Group>
-->
</Group>
<Group name="descriptors">
<Address name="colors_vector" value="0x94506c8 0x93cdff4" />
<Address name="all_colors_vector" value="0x94506E0 0x93ce00c" />
</Group>
</Group>
<Group name="Translations" valid="true">
<!-- maybe swapped -->
<Address name="language_vector" value="0x944c564"/>
<Address name="translation_vector" value="0x944c57c"/>
</Group>
</Offsets>
</Version>
</DFHack>

@ -26,12 +26,34 @@ distribution.
#include "dfhack/VersionInfo.h"
#include "dfhack/DFError.h"
#include "dfhack/DFProcess.h"
#include <algorithm>
//Inital amount of space in levels vector (since we usually know the number, efficient!)
#define NUM_RESERVE_LVLS 20
#define NUM_RESERVE_MOODS 6
using namespace DFHack;
//FIXME: put those in some shared file
template<template <typename> class P = std::less >
struct compare_pair_first
{
template<class T1, class T2>
bool operator()(const std::pair<T1, T2>& left, const std::pair<T1, T2>& right)
{
return P<T1>()(left.first, right.first);
}
};
template<template <typename> class P = std::less >
struct compare_pair_second
{
template<class T1, class T2>
bool operator()(const std::pair<T1, T2>& left, const std::pair<T1, T2>& right)
{
return P<T2>()(left.second, right.second);
}
};
/*
* Common data types
*/
@ -421,31 +443,59 @@ std::string OffsetGroup::PrintOffsets(int indentation)
uint32_Iter iter;
ostringstream ss;
indentr i(indentation);
typedef pair <uint32_t, pair< string, nullableUint32 > > horrible;
vector < horrible > addrsorter;
for(iter = OGd->addresses.begin(); iter != OGd->addresses.end(); iter++)
{
ss << i << "<Address name=\"" << (*iter).first << "\"";
if((*iter).second.first)
ss << " value=\"" << hex << "0x" << (*iter).second.second << "\"";
ss << " />";
if((*iter).second.first == IS_INVALID)
ss << " INVALID!";
if(!(*iter).second.first)
ss << " MISSING!";
addrsorter.push_back( make_pair( 0, *iter ) );
else
{
addrsorter.push_back( make_pair( (*iter).second.second, *iter ) );
}
}
std::sort(addrsorter.begin(), addrsorter.end(), compare_pair_first<>());
for(int idx = 0; idx < addrsorter.size();idx++)
{
horrible & h = addrsorter[idx];
ss << i << "<Address name=\"" << h.second.first << "\"";
if(h.second.second.first)
ss << " value=\"" << hex << "0x" << h.first << "\"";
if(h.second.second.first == IS_INVALID)
ss << " valid=\"false\"";
ss << " />";
if(h.second.second.first == NOT_SET)
ss << " NOT SET!";
ss << endl;
}
typedef pair <int32_t, pair< string, nullableInt32 > > terrible;
vector < terrible > offsorter;
int32_Iter iter2;
for(iter2 = OGd->offsets.begin(); iter2 != OGd->offsets.end(); iter2++)
{
ss << i << "<Offset name=\"" << (*iter2).first << "\"";
if((*iter2).second.first)
ss << " value=\"" << hex << "0x" << (*iter2).second.second << "\"";
ss << " />";
if((*iter2).second.first == IS_INVALID)
ss << " INVALID!";
if(!(*iter2).second.first)
ss << " MISSING!";
offsorter.push_back( make_pair( 0, *iter2 ) );
else
{
offsorter.push_back( make_pair( (*iter2).second.second, *iter2 ) );
}
}
std::sort(offsorter.begin(), offsorter.end(), compare_pair_first<>());
for(int idx = 0; idx < offsorter.size();idx++)
{
terrible & h = offsorter[idx];
ss << i << "<Offset name=\"" << h.second.first << "\"";
if(h.second.second.first)
ss << " value=\"" << hex << "0x" << h.first << "\"";
if(h.second.second.first == IS_INVALID)
ss << " valid=\"false\"";
ss << " />";
if(h.second.second.first == NOT_SET)
ss << " NOT SET!";
ss << endl;
}
for(iter = OGd->hexvals.begin(); iter != OGd->hexvals.end(); iter++)
{
ss << i << "<HexValue name=\"" << (*iter).first << "\"";

@ -95,6 +95,8 @@ namespace DFHack
t_attrib musicality;
t_attrib kinesthetic_sense;
};
#define NUM_CREAT_ATTRIBS 17
/**
* \ingroup grp_materials
*/

@ -440,7 +440,11 @@ bool Materials::ReadCreatureTypesEx (void)
p->readSTLString (p_bodypart[k] + bodypart_category_offset, part.category, sizeof(part.category));
caste.bodypart.push_back(part);
}
p->read(caste_start + caste_attributes_offset, sizeof(t_attrib) * (6+11), (uint8_t *)&caste.strength);
p->read(caste_start + caste_attributes_offset, sizeof(t_attrib) * NUM_CREAT_ATTRIBS, (uint8_t *)&caste.strength);
}
else
{
memset(&caste.strength, 0, sizeof(t_attrib) * NUM_CREAT_ATTRIBS);
}
mat.castes.push_back(caste);
}