diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..10760875f --- /dev/null +++ b/.gitignore @@ -0,0 +1,20 @@ +# linux backup files +*~ + +# compiled binaries +output/* + +# this one is important, track it +!output/Memory.xml + +# a file generated by cmake +library/config.h + +# any build folders +build*/ + +#except for the real one +!build/ + +#ignore Kdevelop stuff +.kdev4 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 96e541827..058d5014c 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -37,6 +37,11 @@ TARGET_LINK_LIBRARIES(dfsuspend dfhack) ADD_EXECUTABLE(dfitemdump dfitemdump.cpp) TARGET_LINK_LIBRARIES(dfitemdump dfhack) +# hotkeynotedump - dumps the hotkeys and notes for the loaded map +# Author: belal +ADD_EXECUTABLE(dfhotkeynotedump hotkeynotedump.cpp) +TARGET_LINK_LIBRARIES(dfhotkeynotedump dfhack) + IF(UNIX) # veinlook - look at the map... sort of ADD_EXECUTABLE(dfveinlook veinlook.cpp) @@ -53,7 +58,6 @@ dfattachtest dfbuildingsdump dfcreaturedump dfitemdump -dfdigger dfexpbench dfmaterialtest dfposition diff --git a/examples/hotkeynotedump.cpp b/examples/hotkeynotedump.cpp new file mode 100644 index 000000000..9685e33d5 --- /dev/null +++ b/examples/hotkeynotedump.cpp @@ -0,0 +1,61 @@ +// Hotkey and Note Dump +// Or Hot Keynote Dump? :P +#include +#include +#include +#include +using namespace std; + +#include +#include +#include + + +int main (void) +{ + vector creaturestypes; + DFHack::API DF("Memory.xml"); + if(!DF.Attach()) + { + cerr << "DF not found" << endl; + return 1; + } + + DFHack::memory_info mem = DF.getMemoryInfo(); + // get stone matgloss mapping + uint32_t numNotes; + if(!DF.InitReadNotes(numNotes)) + { + cerr << "Can't get notes" << endl; + return 1; + } + if(!DF.InitReadHotkeys()) + { + cerr << "Can't get hotkeys" << endl; + return 1; + } + cout << "Notes" << endl; + for(uint32_t i = 0; i < numNotes; i++) + { + DFHack::t_note temp; + DF.ReadNote(i,temp); + cout << "x: " << temp.x << "\ty: " << temp.y << "\tz: " << temp.z << + "\tsymbol: " << temp.symbol << "\tfg: " << temp.foreground << "\tbg: " << temp.background << + "\ttext: " << temp.name << endl; + } + cout << "Hotkeys" << endl; + DFHack::t_hotkey hotkeys[NUM_HOTKEYS]; + DF.ReadHotkeys(hotkeys); + for(uint32_t i =0;i< NUM_HOTKEYS;i++) + { + cout << "x: " << hotkeys[i].x << "\ty: " << hotkeys[i].y << "\tz: " << hotkeys[i].z << + "\ttext: " << hotkeys[i].name << endl; + } + DF.FinishReadNotes(); + DF.Detach(); + #ifndef LINUX_BUILD + cout << "Done. Press any key to continue" << endl; + cin.ignore(); + #endif + return 0; +} \ No newline at end of file diff --git a/examples/veinlook.cpp b/examples/veinlook.cpp index a77f284c1..7084f1092 100644 --- a/examples/veinlook.cpp +++ b/examples/veinlook.cpp @@ -1,7 +1,9 @@ #include #include // for memset #include +#include #include +#include #include #include using namespace std; @@ -16,6 +18,7 @@ using namespace DFHack; #include string error; +API * pDF = 0; static void finish(int sig); @@ -181,15 +184,52 @@ int pickColor(int tiletype) case FIRE: return COLOR_RED; } + } -string getGCCClassName (Process * p, uint32_t vptr) +/* +address = absolute address of dump start +length = length in bytes +*/ +void hexdump (DFHack::API& DF, uint32_t address, uint32_t length, int filenum) { - int typeinfo = p->readDWord(vptr - 4); - int typestring = p->readDWord(typeinfo + 4); - return p->readCString(typestring); + uint32_t reallength; + uint32_t lines; + lines = (length / 16) + 1; + reallength = lines * 16; + char *buf = new char[reallength]; + ofstream myfile; + + string name = "hexdump"; + name += filenum; + name+= ".txt"; + + myfile.open (name.c_str()); + + DF.ReadRaw(address, reallength, (uint8_t *) buf); + for (int i = 0; i < lines; i++) + { + // leading offset + myfile << "0x" << hex << setw(4) << i*16 << " "; + // groups + for(int j = 0; j < 4; j++) + { + // bytes + for(int k = 0; k < 4; k++) + { + int idx = i * 16 + j * 4 + k; + + myfile << hex << setw(2) << int(static_cast(buf[idx])) << " "; + } + myfile << " "; + } + myfile << endl; + } + delete buf; + myfile.close(); } + main(int argc, char *argv[]) { /* initialize your non-curses data structures here */ @@ -241,17 +281,23 @@ main(int argc, char *argv[]) // init the API DFHack::API DF("Memory.xml"); - + pDF = &DF; // attach if(!DF.Attach()) { error = "Can't find DF."; + pDF = 0; finish(0); } Process* p = DF.getProcess(); // init the map - DF.InitMap(); + if(!DF.InitMap()) + { + error = "Can't find a map to look at."; + pDF = 0; + finish(0); + } DF.getSize(x_max_a,y_max_a,z_max_a); x_max = x_max_a; @@ -262,6 +308,7 @@ main(int argc, char *argv[]) if(!DF.ReadStoneMatgloss(stonetypes)) { error = "Can't read stone types."; + pDF = 0; finish(0); } @@ -269,19 +316,27 @@ main(int argc, char *argv[]) if(!DF.ReadGeology( layerassign )) { error = "Can't read local geology."; + pDF = 0; finish(0); } + // FIXME: could fail on small forts int cursorX = x_max/2 - 1; int cursorY = y_max/2 - 1; int cursorZ = z_max/2 - 1; - // FIXME: could fail on small forts + bool dig = false; + bool dump = false; int vein = 0; + int filenum = 0; + uint32_t blockaddr = 0; // walk the map! for (;;) { + dig = false; + dump = false; + DF.Resume(); int c = getch(); /* refresh, accept single keystroke of input */ clrscr(); /* process the command keystroke */ @@ -308,6 +363,12 @@ main(int argc, char *argv[]) case '+': vein ++; break; + case 'd': + dig = true; + break; + case 'o': + dump = true; + break; case '-': vein --; break; @@ -318,13 +379,15 @@ main(int argc, char *argv[]) cursorY = max(cursorY, 0); cursorZ = max(cursorZ, 0); - cursorX = min(cursorX, x_max - 3); - cursorY = min(cursorY, y_max - 3); - cursorZ = min(cursorZ, z_max - 3); + cursorX = min(cursorX, x_max - 1); + cursorY = min(cursorY, y_max - 1); + cursorZ = min(cursorZ, z_max - 1); DF.Suspend(); - for(int i = 0; i < 3; i++) - for(int j = 0; j < 3; j++) + for(int i = -1; i <= 1; i++) + { + for(int j = -1; j <= 1; j++) + { if(DF.isValidBlock(cursorX+i,cursorY+j,cursorZ)) { // read data @@ -334,26 +397,45 @@ main(int argc, char *argv[]) { for(int y = 0; y < 16; y++) { + if(dig) + { + if(tileTypeTable[tiletypes[x][y]].c == WALL && tileTypeTable[tiletypes[x][y]].m == VEIN + || tileTypeTable[tiletypes[x][y]].c == TREE_OK || tileTypeTable[tiletypes[x][y]].c == TREE_DEAD) + { + designations[x][y].bits.dig = designation_default; + } + } int color = COLOR_BLACK; color = pickColor(tiletypes[x][y]); if(designations[x][y].bits.hidden) { - puttile(x+i*16,y+j*16,tiletypes[x][y], color); + puttile(x+(i+1)*16,y+(j+1)*16,tiletypes[x][y], color); } else { attron(A_STANDOUT); - puttile(x+i*16,y+j*16,tiletypes[x][y], color); + puttile(x+(i+1)*16,y+(j+1)*16,tiletypes[x][y], color); attroff(A_STANDOUT); } } } - if(i == 1 && j == 1) + + if(i == 0 && j == 0) { + blockaddr = DF.getBlockPtr(cursorX+i,cursorY+j,cursorZ); + if(dump) + { + hexdump(DF,blockaddr,0x1DB8,filenum); + filenum++; + } + if(dig) + DF.WriteDesignations(cursorX+i,cursorY+j,cursorZ, (uint32_t *) designations); veinVector.clear(); DF.ReadVeins(cursorX+i,cursorY+j,cursorZ,veinVector); } } + } + } gotoxy(0,48); cprintf("arrow keys, PGUP, PGDN = navigate"); gotoxy(0,49); @@ -361,13 +443,15 @@ main(int argc, char *argv[]) gotoxy(0,50); if(vein == veinVector.size()) vein = veinVector.size() - 1; if(vein < -1) vein = -1; - cprintf("X %d/%d, Y %d/%d, Z %d/%d. Vein %d of %d",cursorX + 1,x_max,cursorY + 1,y_max,cursorZ + 1,z_max,vein+1,veinVector.size()); + cprintf("X %d/%d, Y %d/%d, Z %d/%d. Vein %d of %d",cursorX+1,x_max,cursorY+1,y_max,cursorZ,z_max,vein+1,veinVector.size()); if(!veinVector.empty()) { if(vein != -1 && vein < veinVector.size()) { - string str = getGCCClassName(p, veinVector[vein].vtable); - if(str == "34block_square_event_frozen_liquidst") + //string str = getGCCClassName(p, veinVector[vein].vtable); + string className = p->readClassName(veinVector[vein].vtable); + //string str = "34block_square_event_frozen_liquidst"; + if(className == "block_square_event_frozen_liquid") { t_frozenliquidvein frozen; uint32_t size = sizeof(t_frozenliquidvein); @@ -386,7 +470,7 @@ main(int argc, char *argv[]) } } } - else if (str == "28block_square_event_mineralst") + else if (className == "block_square_event_mineral") { //iterate through vein rows for(uint32_t j = 0;j<16;j++) @@ -402,19 +486,29 @@ main(int argc, char *argv[]) } } } + gotoxy(0,52); + cprintf("%s",stonetypes[veinVector[vein].type].name); } gotoxy(0,51); - cprintf("%s, address 0x%x",str.c_str(),veinVector[vein].address_of); + cprintf("%s, address 0x%x",className.c_str(),veinVector[vein].address_of); } } - DF.Resume(); + gotoxy (0,53); + cprintf("block address 0x%x",blockaddr); wrefresh(stdscr); } + pDF = 0; finish(0); } static void finish(int sig) { + // ugly + if(pDF) + { + pDF->ForceResume(); + pDF->Detach(); + } endwin(); if(!error.empty()) { diff --git a/library/DFHackAPI.cpp b/library/DFHackAPI.cpp index ecab52de3..1739b20e1 100644 --- a/library/DFHackAPI.cpp +++ b/library/DFHackAPI.cpp @@ -83,6 +83,15 @@ public: uint32_t item_material_offset; + uint32_t note_foreground_offset; + uint32_t note_background_offset; + uint32_t note_name_offset; + uint32_t note_xyz_offset; + uint32_t hotkey_start; + uint32_t hotkey_mode_offset; + uint32_t hotkey_xyz_offset; + uint32_t hotkey_size; + uint32_t dwarf_lang_table_offset; ProcessEnumerator* pm; @@ -98,6 +107,8 @@ public: bool cursorWindowInited; bool viewSizeInited; bool itemsInited; + bool notesInited; + bool hotkeyInited; bool nameTablesInited; @@ -107,6 +118,7 @@ public: DfVector *p_bld; DfVector *p_veg; DfVector *p_itm; + DfVector *p_notes; }; API::API (const string path_to_xml) @@ -122,6 +134,8 @@ API::API (const string path_to_xml) d->cursorWindowInited = false; d->viewSizeInited = false; d->itemsInited = false; + d->notesInited = false; + d->hotkeyInited = false; d->pm = NULL; } @@ -207,9 +221,18 @@ bool API::DestroyMap() bool API::isValidBlock (uint32_t x, uint32_t y, uint32_t z) { + if (x < 0 || x >= d->x_block_count || y < 0 || y >= d->y_block_count || z < 0 || z >= d->z_block_count) + return false; return d->block[x*d->y_block_count*d->z_block_count + y*d->z_block_count + z] != 0; } +uint32_t API::getBlockPtr (uint32_t x, uint32_t y, uint32_t z) +{ + if (x < 0 || x >= d->x_block_count || y < 0 || y >= d->y_block_count || z < 0 || z >= d->z_block_count) + return 0; + return d->block[x*d->y_block_count*d->z_block_count + y*d->z_block_count + z]; +} + // 256 * sizeof(uint16_t) bool API::ReadTileTypes (uint32_t x, uint32_t y, uint32_t z, uint16_t *buffer) { @@ -837,7 +860,7 @@ bool API::InitReadCreatures( uint32_t &numcreatures ) && d->creature_labors_offset && d->creature_happiness_offset && d->creature_traits_offset - // && d->creature_likes_offset + // && d->creature_likes_offset ) { d->p_cre = new DfVector (d->p->readVector (creatures, 4)); @@ -853,7 +876,81 @@ bool API::InitReadCreatures( uint32_t &numcreatures ) return false; } } - +bool API::InitReadNotes( uint32_t &numnotes ) +{ + memory_info * minfo = d->offset_descriptor; + int notes = d->offset_descriptor->getAddress ("notes"); + d->note_foreground_offset = minfo->getOffset ("note_foreground"); + d->note_background_offset = minfo->getOffset ("note_background"); + d->note_name_offset = minfo->getOffset ("note_name"); + d->note_xyz_offset = minfo->getOffset ("note_xyz"); + + if (notes + && d->note_foreground_offset + && d->note_background_offset + && d->note_name_offset + && d->note_xyz_offset + ) + { + d->p_notes = new DfVector (d->p->readVector (notes, 4)); + //InitReadNameTables(); + d->notesInited = true; + numnotes = d->p_notes->getSize(); + return true; + } + else + { + d->notesInited = false; + numnotes = 0; + return false; + } +} +bool API::ReadNote (const int32_t &index, t_note & note) +{ + if(!d->notesInited) + return false; + // read pointer from vector at position + uint32_t temp = * (uint32_t *) d->p_notes->at (index); + note.symbol = g_pProcess->readByte(temp); + note.foreground = g_pProcess->readWord(temp + d->note_foreground_offset); + note.background = g_pProcess->readWord(temp + d->note_background_offset); + d->p->readSTLString (temp + d->note_name_offset, note.name, 128); + g_pProcess->read (temp + d->note_xyz_offset, 3*sizeof (uint16_t), (uint8_t *) ¬e.x); + return true; +} +bool API::InitReadHotkeys( ) +{ + memory_info * minfo = d->offset_descriptor; + d->hotkey_start = minfo->getAddress("hotkey_start"); + d->hotkey_mode_offset = minfo->getOffset ("hotkey_mode"); + d->hotkey_xyz_offset = minfo->getOffset("hotkey_xyz"); + d->hotkey_size = minfo->getHexValue("hotkey_size"); + + if (d->hotkey_start && d->hotkey_mode_offset && d->hotkey_size) + { + d->hotkeyInited = true; + return true; + } + else + { + d->hotkeyInited = false; + return false; + } +} +bool API::ReadHotkeys(t_hotkey hotkeys[]) +{ + if (!d->hotkeyInited) + return false; + uint32_t currHotkey = d->hotkey_start; + for(uint32_t i = 0 ; i < NUM_HOTKEYS ;i++) + { + d->p->readSTLString(currHotkey,hotkeys[i].name,10); + hotkeys[i].mode = g_pProcess->readWord(currHotkey+d->hotkey_mode_offset); + g_pProcess->read (currHotkey + d->hotkey_xyz_offset, 3*sizeof (int32_t), (uint8_t *) &hotkeys[i].x); + currHotkey+=d->hotkey_size; + } + return true; +} // returns index of creature actually read or -1 if no creature can be found int32_t API::ReadCreatureInBox (int32_t index, t_creature & furball, const uint16_t &x1, const uint16_t &y1, const uint16_t &z1, @@ -1087,6 +1184,13 @@ void API::FinishReadCreatures() d->creaturesInited = false; //FinishReadNameTables(); } +void API::FinishReadNotes() +{ + delete d->p_notes; + d->p_notes = NULL; + d->notesInited = false; + //FinishReadNameTables(); +} bool API::Attach() { diff --git a/library/DFHackAPI.h b/library/DFHackAPI.h index 21e3999cc..f41647261 100644 --- a/library/DFHackAPI.h +++ b/library/DFHackAPI.h @@ -128,6 +128,10 @@ namespace DFHack * Return false/0 on failure, buffer allocated by client app, 256 items long */ bool isValidBlock(uint32_t blockx, uint32_t blocky, uint32_t blockz); + /** + * Get the address of a block or 0 if block is not valid + */ + uint32_t getBlockPtr (uint32_t x, uint32_t y, uint32_t z); bool ReadTileTypes(uint32_t blockx, uint32_t blocky, uint32_t blockz, uint16_t *buffer); // 256 * sizeof(uint16_t) bool WriteTileTypes(uint32_t blockx, uint32_t blocky, uint32_t blockz, uint16_t *buffer); // 256 * sizeof(uint16_t) @@ -171,6 +175,13 @@ namespace DFHack void WriteRaw (const uint32_t &offset, const uint32_t &size, uint8_t *source); bool InitViewAndCursor(); + + bool InitReadNotes( uint32_t & numnotes ); + bool ReadNote(const int32_t &index, t_note & note); + void FinishReadNotes(); + + bool InitReadHotkeys( ); + bool ReadHotkeys(t_hotkey hotkeys[]); bool getViewCoords (int32_t &x, int32_t &y, int32_t &z); bool setViewCoords (const int32_t &x, const int32_t &y, const int32_t &z); diff --git a/library/DFProcess-linux-SHM.cpp b/library/DFProcess-linux-SHM.cpp index 3c729f790..5821e129c 100644 --- a/library/DFProcess-linux-SHM.cpp +++ b/library/DFProcess-linux-SHM.cpp @@ -636,4 +636,14 @@ void SHMProcess::writeSTLString(const uint32_t address, const std::string writeS full_barrier ((shm_write_small *)d->my_shm)->pingpong = DFPP_WRITE_STL_STRING; d->waitWhile(DFPP_WRITE_STL_STRING); +} + +string SHMProcess::readClassName (uint32_t vptr) +{ + int typeinfo = readDWord(vptr - 0x4); + int typestring = readDWord(typeinfo + 0x4); + string raw = readCString(typestring); + size_t start = raw.find_first_of("abcdefghijklmnopqrstuvwxyz");// trim numbers + size_t end = raw.length(); + return raw.substr(start,end-start - 2); // trim the 'st' from the end } \ No newline at end of file diff --git a/library/DFProcess-linux-wine.cpp b/library/DFProcess-linux-wine.cpp index 24cc71cc8..f4b6d670e 100644 --- a/library/DFProcess-linux-wine.cpp +++ b/library/DFProcess-linux-wine.cpp @@ -581,4 +581,13 @@ const string WineProcess::readSTLString (uint32_t offset) string ret = temp; delete temp; return ret; +} + +string WineProcess::readClassName (uint32_t vptr) +{ + int rtti = readDWord(vptr - 0x4); + int typeinfo = readDWord(rtti + 0xC); + string raw = readCString(typeinfo + 0xC); // skips the .?AV + raw.resize(raw.length() - 4);// trim st@@ from end + return raw; } \ No newline at end of file diff --git a/library/DFProcess-linux.cpp b/library/DFProcess-linux.cpp index 5bda864a6..7801520ba 100644 --- a/library/DFProcess-linux.cpp +++ b/library/DFProcess-linux.cpp @@ -526,4 +526,14 @@ const string NormalProcess::readSTLString (uint32_t offset) string ret(temp); delete temp; return ret; +} + +string NormalProcess::readClassName (uint32_t vptr) +{ + int typeinfo = readDWord(vptr - 0x4); + int typestring = readDWord(typeinfo + 0x4); + string raw = readCString(typestring); + size_t start = raw.find_first_of("abcdefghijklmnopqrstuvwxyz");// trim numbers + size_t end = raw.length(); + return raw.substr(start,end-start - 2); // trim the 'st' from the end } \ No newline at end of file diff --git a/library/DFProcess-windows-SHM.cpp b/library/DFProcess-windows-SHM.cpp index bccca900c..ec10171dd 100644 --- a/library/DFProcess-windows-SHM.cpp +++ b/library/DFProcess-windows-SHM.cpp @@ -723,4 +723,13 @@ void SHMProcess::writeSTLString(const uint32_t address, const std::string writeS full_barrier ((shm_write_small *)d->my_shm)->pingpong = DFPP_WRITE_STL_STRING; d->waitWhile(DFPP_WRITE_STL_STRING); +} + +string SHMProcess::readClassName (uint32_t vptr) +{ + int rtti = readDWord(vptr - 0x4); + int typeinfo = readDWord(rtti + 0xC); + string raw = readCString(typeinfo + 0xC); // skips the .?AV + raw.resize(raw.length() - 4);// trim st@@ from end + return raw; } \ No newline at end of file diff --git a/library/DFProcess-windows.cpp b/library/DFProcess-windows.cpp index f1780f474..21b4a5b67 100644 --- a/library/DFProcess-windows.cpp +++ b/library/DFProcess-windows.cpp @@ -463,4 +463,13 @@ const string NormalProcess::readSTLString (uint32_t offset) string ret = temp; delete temp; return ret; +} + +string NormalProcess::readClassName (uint32_t vptr) +{ + int rtti = readDWord(vptr - 0x4); + int typeinfo = readDWord(rtti + 0xC); + string raw = readCString(typeinfo + 0xC); // skips the .?AV + raw.resize(raw.length() - 4);// trim st@@ from end + return raw; } \ No newline at end of file diff --git a/library/DFProcess.h b/library/DFProcess.h index 19acbbecd..a48f0d7b3 100644 --- a/library/DFProcess.h +++ b/library/DFProcess.h @@ -96,6 +96,8 @@ namespace DFHack virtual void writeSTLString(const uint32_t address, const std::string writeString) = 0; // read a vector from memory virtual DfVector readVector (uint32_t offset, uint32_t item_size) = 0; + // get class name of an object with rtti/type info + virtual string readClassName(uint32_t vptr) = 0; virtual const std::string readCString (uint32_t offset) = 0; @@ -152,6 +154,8 @@ namespace DFHack void writeSTLString(const uint32_t address, const std::string writeString){}; // read a vector from memory DfVector readVector (uint32_t offset, uint32_t item_size); + // get class name of an object with rtti/type info + string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); @@ -203,6 +207,8 @@ namespace DFHack void writeSTLString(const uint32_t address, const std::string writeString); // read a vector from memory DfVector readVector (uint32_t offset, uint32_t item_size); + // get class name of an object with rtti/type info + string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); @@ -254,6 +260,8 @@ namespace DFHack void writeSTLString(const uint32_t address, const std::string writeString){}; // read a vector from memory DfVector readVector (uint32_t offset, uint32_t item_size); + // get class name of an object with rtti/type info + string readClassName(uint32_t vptr); const std::string readCString (uint32_t offset); diff --git a/library/DFProcessEnumerator-windows.cpp b/library/DFProcessEnumerator-windows.cpp index ac11d2ea2..f08aec558 100644 --- a/library/DFProcessEnumerator-windows.cpp +++ b/library/DFProcessEnumerator-windows.cpp @@ -73,11 +73,11 @@ bool ProcessEnumerator::findProcessess() if(p->isIdentified()) { d->processes.push_back(p); - return true; + return true; } else { - delete p; +//FIXME delete p; p = 0; } } @@ -102,8 +102,8 @@ bool ProcessEnumerator::findProcessess() } else { - delete q; - q = 0; + //FIXME delete q; + q = 0; } } if(d->processes.size()) @@ -134,7 +134,7 @@ void ProcessEnumerator::purge() { for(uint32_t i = 0;i < d->processes.size();i++) { - delete d->processes[i]; + //FIXME delete d->processes[i]; } d->processes.clear(); } diff --git a/library/DFTypes.h b/library/DFTypes.h index 08d49d624..50e36d898 100644 --- a/library/DFTypes.h +++ b/library/DFTypes.h @@ -753,5 +753,26 @@ struct t_viewscreen //There is more info in these objects, but I don't know what it is yet }; +struct t_note +{ + char symbol; + uint16_t foreground; + uint16_t background; + char name[128]; + uint16_t x; + uint16_t y; + uint16_t z; +}; + +#define NUM_HOTKEYS 16 +struct t_hotkey +{ + char name[10]; + int16_t mode; + int32_t x; + int32_t y; + int32_t z; +}; + }// namespace DFHack #endif // TYPES_H_INCLUDED diff --git a/library/integers.h b/library/integers.h index a9270330c..6cc2396c4 100644 --- a/library/integers.h +++ b/library/integers.h @@ -13,4 +13,4 @@ You can turn off the include by defining SKIP_DFHACK_STDINT #else #include "stdint_win.h" #endif -#endif +#endif diff --git a/output/Memory.xml b/output/Memory.xml index f9bfd9c11..91c4d9e71 100644 --- a/output/Memory.xml +++ b/output/Memory.xml @@ -800,6 +800,18 @@
0xcdc3dc
0xcdc3b8
0x1676f14
+ +
0x012FDBAC
+ 0x2 + 0x4 + 0x8 + 0x24 + +
0x012FDBE4
+ 0x1C + 0x20 + 0x2C + @@ -811,6 +823,9 @@
0xcdf5a0
0xd0d64c
0xd0d628
+ +
0x013E853C
+
0x013E8574
@@ -1114,6 +1129,9 @@
0x014243C4
0x0178C994
+
0x014240A4
+
0x014240DC
+ @@ -1502,6 +1520,18 @@
0x9374E88
0xC + +
0x0931EA64
+ 0x2 + 0x4 + 0x8 + 0xC + +
0x0931EA8C
+ 0x4 + 0x8 + 0x14 + @@ -1603,6 +1633,8 @@
0x88073d4
0x9510050
+ +
0x092AB244
@@ -1643,6 +1675,10 @@
0x08F97A84
+ +
0x08F41644
+
0x08F4166C
+
@@ -1900,6 +1936,9 @@
0x878caa4
0x8f4e940
+
0x08F4E7C4
+
0x08F4E7EC
+ diff --git a/shmserver/df-hacked b/precompiled/linux/df-hacked similarity index 89% rename from shmserver/df-hacked rename to precompiled/linux/df-hacked index bf56b33e2..f9c3a3351 100755 --- a/shmserver/df-hacked +++ b/precompiled/linux/df-hacked @@ -9,6 +9,5 @@ if [ $? -eq 0 ]; then mv libs/libSDL* unused_libs/ fi export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"./libs" # Update library search path. -export LD_PRELOAD="./libs/dfconnect.so" # Hack DF! +export LD_PRELOAD="./libs/libdfconnect.so" # Hack DF! ./dwarfort.exe $* # Go, go, go! :) - diff --git a/precompiled/libdfconnect.so b/precompiled/linux/libdfconnect.so similarity index 100% rename from precompiled/libdfconnect.so rename to precompiled/linux/libdfconnect.so diff --git a/precompiled/SDL.dll b/precompiled/windows/SDL.dll similarity index 100% rename from precompiled/SDL.dll rename to precompiled/windows/SDL.dll diff --git a/shmserver/dfconnect.so b/shmserver/dfconnect.so deleted file mode 100755 index ee1579718..000000000 Binary files a/shmserver/dfconnect.so and /dev/null differ diff --git a/shmserver/shms-proto.cpp b/shmserver/shms-proto.cpp index 25b5810c9..ded5a4959 100644 --- a/shmserver/shms-proto.cpp +++ b/shmserver/shms-proto.cpp @@ -158,7 +158,7 @@ void SHM_Act (void) case DFPP_CL_ERROR: case DFPP_RUNNING: - fprintf(stderr, "no. of waits: %d\n", numwaits); + //fprintf(stderr, "no. of waits: %d\n", numwaits); //MessageBox(0,"Broke out of loop properly","FUN", MB_OK); break;