Linux d19 support

develop
Petr Mrázek 2010-03-05 22:19:27 +01:00
parent 798ce9fb0a
commit 96512a7e1d
5 changed files with 231 additions and 1021 deletions

@ -52,6 +52,10 @@ TARGET_LINK_LIBRARIES(dffindnameindexes dfhack)
ADD_EXECUTABLE(dfsettlementdump settlementdump.cpp)
TARGET_LINK_LIBRARIES(dfsettlementdump dfhack)
# veccheck - read vector values at address
ADD_EXECUTABLE(dfvecc veccheck.cpp)
TARGET_LINK_LIBRARIES(dfvecc dfhack)
IF(UNIX)
# veinlook - look at the map... sort of
ADD_EXECUTABLE(dfveinlook veinlook.cpp)

@ -0,0 +1,46 @@
// Just show some position data
#include <iostream>
#include <climits>
#include <integers.h>
#include <vector>
#include <sstream>
#include <ctime>
using namespace std;
#include <DFTypes.h>
#include <DFHackAPI.h>
#include <DFProcess.h>
int main (int numargs, const char ** args)
{
uint32_t addr;
if (numargs == 2)
{
istringstream input (args[1],istringstream::in);
input >> std::hex >> addr;
}
DFHack::API DF("Memory.xml");
if(!DF.Attach())
{
cerr << "DF not found" << endl;
}
else
{
DFHack::Process* p = DF.getProcess();
#ifdef LINUX_BUILD
cout << "start 0x" << hex << p->readDWord(addr+0x0) << endl;
cout << "end 0x" << hex << p->readDWord(addr+0x4) << endl;
cout << "cap 0x" << hex << p->readDWord(addr+0x8) << endl;
#else
cout << "start 0x" << hex << p->readDWord(addr+0x4) << endl;
cout << "end 0x" << hex << p->readDWord(addr+0x8) << endl;
cout << "cap 0x" << hex << p->readDWord(addr+0xC) << endl;
#endif
}
#ifndef LINUX_BUILD
cout << "Done. Press any key to continue" << endl;
cin.ignore();
#endif
return 0;
}

@ -425,21 +425,16 @@ try_again:
// store it in the vector
ices.push_back (fv);
}
//#define ___FIND_THEM
#ifdef ___FIND_THEM
else if(g_pProcess->readClassName(type) == "block_square_event_frozen_liquid")
{
d->vein_ice_vptr = type;
cout << "block_square_event_frozen_liquid : 0x" << hex << type << endl;
goto try_again;
}
else if(g_pProcess->readClassName(type) == "block_square_event_mineral")
{
d->vein_mineral_vptr = type;
cout << "block_square_event_mineral : 0x" << hex << type << endl;
goto try_again;
}
#endif
}
return true;
}

@ -367,7 +367,8 @@ bool memory_info::resolveObjectToClassID(const uint32_t address, int32_t & class
}
}
string classname = g_pProcess->readClassName(vtable);
setClass(classname.c_str(),vtable);
t_class * c = setClass(classname.c_str(),vtable);
classid = c->assign;
return true;
}
@ -601,21 +602,4 @@ string memory_info::getLabor (const uint32_t laborIdx)
return d->labors[laborIdx];
}
throw Error::MissingMemoryDefinition("labor", laborIdx);
}
// Reset everything
/*
0xDEADC0DE
void memory_info::flush()
{
d->base = 0;
d->addresses.clear();
d->offsets.clear();
d->strings.clear();
d->hexvals.clear();
d->classes.clear();
d->classindex = 0;
d->version = "";
d->OS = OS_BAD;
}
*/
}

File diff suppressed because it is too large Load Diff