Big chunk of windows 31.18 offsets.

develop
Petr Mrázek 2010-11-17 04:48:06 +01:00
parent e41a5c6300
commit 1a93c73737
4 changed files with 143 additions and 4 deletions

@ -1784,6 +1784,92 @@
<Offset name="item_improvement_vector" value="0x90" /> <Offset name="item_improvement_vector" value="0x90" />
</Group> </Group>
</Offsets> </Offsets>
</Version>
<Version name="v0.31.18 SDL" os="windows" base="v0.31.16 SDL" rebase="0x492D0">
<PETimeStamp value="0x4CE2841D" />
<MD5 value="b7be6b9db369d6adb72319dcf780f9f5" />
<Offsets>
<Address name="WORLD" valid="false" />
<Group name="Buildings">
<Address name="buildings_vector" value="0x16a1be0" />
<Address name="custom_workshop_vector" value="0x16eaca0" />
<!--
<Offset name="building_custom_workshop_type" value="0x11c" /> INVALID!
<Offset name="custom_workshop_name" value="0x4" /> INVALID!
<Offset name="custom_workshop_type" value="0x20" /> INVALID!
-->
</Group>
<Group name="Position" valid="false">
<Address name="cursor_xyz" value="0xb127f0" valid="true" />
<Address name="window_dims" value="0xb1307c" valid="true" />
<Address name="window_x" value="0xe8dee4" valid="true" />
<Address name="window_y" value="0xebbfb8" valid="true" />
<Address name="window_z" value="0xebbf94" valid="true" />
</Group>
<Group name="GUI" valid="false">
<Address name="pause_state" value="0x14c9be1" valid="true" />
</Group>
<Group name="Maps">
<Group name="features">
<Group name="global">
<Address name="vector" value="0x16e4c30" />
</Group>
<Group name="local">
<Address name="start_ptr" value="0x16e4cc4" />
</Group>
</Group>
<Group name="geology">
<Address name="geoblock_vector" value="0x16E4C50" />
<Address name="ptr2_region_array" value="0x16E4C80" />
</Group>
</Group>
<Group name="Creatures" valid="false" >
0x016a12c0 vector
</Group>
<Group name="Materials" valid="false" >
<Address name="creature_type_vector" value="0x16E533C" valid="true" /> MAYBE... THE DETAILS WILL BE DIFFERENT
<Address name="inorganics" value="0x16e527C" valid="true" />
<!--<Address name="inorganics_gems?" value="0x16e528C" valid="true" />--> WTF IS THIS, I DON'T EVEN...
<Address name="organics_all" value="0x16e529C" valid="true" />
<Address name="organics_plants" value="0x16e52AC" valid="true" />
<Address name="organics_trees" value="0x16e52CC" valid="true" />
</Group>
<Group name="Constructions">
<Address name="vector" value="0x168d930"/>
</Group>
<Group name="Translations">
<Address name="language_vector" value="0x016e553c"/>
<Address name="translation_vector" value="0x016e551c"/>
</Group>
<!--
<Group name="Vegetation" valid="false">
<Address name="vector"/>
<Offset name="tree_desc_offset" valid="true"/>
</Group>
-->
<Group name="Items" valid="false">
<!-- most of those seem completely unused! -->
<Address name="items_vector" />
List of offsets in the VTable :
<Offset name="item_type_accessor" />
<Offset name="item_subtype_accessor" />
<Offset name="item_subindex_accessor" />
<Offset name="item_index_accessor" />
<Offset name="item_quality_accessor" />
<Offset name="item_improvement_vector" />
<Offset name="item_improvement_subindex" />
<Offset name="item_improvement_index" />
<Offset name="item_improvement_quality" />
<Offset name="item_type_accessor" /> (in the vtable)
</Group>
<Group name="World" valid="false">
<Address name="current_tick" description="Current time of the year" />
<Address name="current_year" description="Current year" />
<Address name="current_weather" description="5x5 array of bytes for surrounding biomes. For each: 0=clear, 1=raining, 2=snowing." />
</Group>
</Offsets>
</Version> </Version>
.-"""-. .-"""-.
' \ ' \

@ -180,6 +180,18 @@ void OffsetGroup::setOffset (const string & key, const string & value, const INV
else throw Error::MissingMemoryDefinition("offset", getFullName() + key); else throw Error::MissingMemoryDefinition("offset", getFullName() + key);
} }
void OffsetGroup::setOffsetValidity (const string & key, const INVAL_TYPE inval)
{
if(inval != NOT_SET)
{
int32_Iter it = OGd->offsets.find(key);
if(it != OGd->offsets.end())
{
(*it).second.first = inval;
}
else throw Error::MissingMemoryDefinition("offset", getFullName() + key);
}
}
void OffsetGroup::setAddress (const string & key, const string & value, const INVAL_TYPE inval) void OffsetGroup::setAddress (const string & key, const string & value, const INVAL_TYPE inval)
{ {
@ -194,6 +206,19 @@ void OffsetGroup::setAddress (const string & key, const string & value, const IN
else throw Error::MissingMemoryDefinition("address", getFullName() + key); else throw Error::MissingMemoryDefinition("address", getFullName() + key);
} }
void OffsetGroup::setAddressValidity (const string & key, const INVAL_TYPE inval)
{
if(inval != NOT_SET)
{
uint32_Iter it = OGd->addresses.find(key);
if(it != OGd->addresses.end())
{
(*it).second.first = inval;
}
else throw Error::MissingMemoryDefinition("address", getFullName() + key);
}
}
void OffsetGroup::setHexValue (const string & key, const string & value, const INVAL_TYPE inval) void OffsetGroup::setHexValue (const string & key, const string & value, const INVAL_TYPE inval)
{ {
@ -207,6 +232,18 @@ void OffsetGroup::setHexValue (const string & key, const string & value, const I
else throw Error::MissingMemoryDefinition("hexvalue", getFullName() + key); else throw Error::MissingMemoryDefinition("hexvalue", getFullName() + key);
} }
void OffsetGroup::setHexValueValidity (const string & key, const INVAL_TYPE inval)
{
if(inval != NOT_SET)
{
uint32_Iter it = OGd->hexvals.find(key);
if(it != OGd->hexvals.end())
{
(*it).second.first = inval;
}
else throw Error::MissingMemoryDefinition("hexvalue", getFullName() + key);
}
}
void OffsetGroup::setString (const string & key, const string & value, const INVAL_TYPE inval) void OffsetGroup::setString (const string & key, const string & value, const INVAL_TYPE inval)
{ {
@ -220,6 +257,18 @@ void OffsetGroup::setString (const string & key, const string & value, const INV
else throw Error::MissingMemoryDefinition("string", getFullName() + key); else throw Error::MissingMemoryDefinition("string", getFullName() + key);
} }
void OffsetGroup::setStringValidity (const string & key, const INVAL_TYPE inval)
{
if(inval != NOT_SET)
{
strings_Iter it = OGd->strings.find(key);
if(it != OGd->strings.end())
{
(*it).second.first = inval;
}
else throw Error::MissingMemoryDefinition("string", getFullName() + key);
}
}
// Get named address // Get named address
uint32_t OffsetGroup::getAddress (const string & key) uint32_t OffsetGroup::getAddress (const string & key)

@ -292,7 +292,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
} }
else else
{ {
// ERROR, missing attribute currentGroup->setAddressValidity(cstr_name, child_inval);
} }
} }
else if(type == "offset") else if(type == "offset")
@ -309,7 +309,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
} }
else else
{ {
// ERROR, missing attribute currentGroup->setOffsetValidity(cstr_name, child_inval);
} }
} }
else if(type == "string") else if(type == "string")
@ -326,7 +326,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
} }
else else
{ {
// ERROR, missing attribute currentGroup->setStringValidity(cstr_name, child_inval);
} }
} }
else if(type == "hexvalue") else if(type == "hexvalue")
@ -343,7 +343,7 @@ void VersionInfoFactory::ParseOffsets(TiXmlElement * parent, VersionInfo* target
} }
else else
{ {
// ERROR, missing attribute currentGroup->setHexValueValidity(cstr_name, child_inval);
} }
} }

@ -76,9 +76,13 @@ namespace DFHack
OffsetGroup * getGroup ( const std::string & name ); OffsetGroup * getGroup ( const std::string & name );
void setOffset (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); void setOffset (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID);
void setOffsetValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID);
void setAddress (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); void setAddress (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID);
void setAddressValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID);
void setHexValue (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); void setHexValue (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID);
void setHexValueValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID);
void setString (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID); void setString (const std::string& key, const std::string& value, const DFHack::INVAL_TYPE inval = IS_VALID);
void setStringValidity(const std::string& key, const DFHack::INVAL_TYPE inval = IS_VALID);
std::string PrintOffsets(int indentation); std::string PrintOffsets(int indentation);
std::string getName(); std::string getName();
std::string getFullName(); std::string getFullName();