diff --git a/COMPILE b/COMPILE index cc3a5670b..b37080dcd 100644 --- a/COMPILE +++ b/COMPILE @@ -99,10 +99,6 @@ There are others, but they aren't really that useful. Have fun. --------------------------------------------------------------------------------- -**Deprecated*Deprecated*Deprecated*Deprecated*Deprecated*Deprecated*Deprecated** --------------------------------------------------------------------------------- - Building the shared memory hook library (SHM) --------------------------------------------- @@ -110,7 +106,7 @@ Unlike the rest of DFHack, The SHM needs special treatment when it comes to compilation. Because it shares the memory space with DF itself, it has to be built with the same tools as DF and use the same C and C++/STL libraries. -For DF 40d15 - 40d19_2 on Windows, use MSVC 2008. You can get the Express +For DF 31.01 - 31.10 on Windows, use MSVC 2008. You can get the Express edition for free from Microsoft. Windows dependencies can be determined by a tool like depends.exe (google it). @@ -124,24 +120,24 @@ $export LD_DEBUG=versions $./df Example of (a part of a) relevant output from a working SHM installation: - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libpthread.so.0 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GCC_3.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.1' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBCXX_3.4.9' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] - 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.2' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] - 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libpthread.so.0 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GCC_3.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.0' in file ./libs/libgcc_s.so.1 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.1' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libm.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBCXX_3.4.9' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./dwarfort.exe [0] + 24472: checking for version `CXXABI_1.3' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBCXX_3.4' in file ./libs/libstdc++.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBC_2.1.3' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBC_2.2' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBC_2.3.4' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] + 24472: checking for version `GLIBC_2.0' in file /opt/lib32/lib/libc.so.6 [0] required by file ./libs/libdfconnect.so [0] libdfconnect is the SHM. Both are compiled against the same C++ library and share the same CXXABI version. diff --git a/README b/README index cc6e7c9ef..5a574482c 100644 --- a/README +++ b/README @@ -33,10 +33,10 @@ OSX is also not supported due to lack of developers with a Mac. Currently supported Dwarf Fortress versions: * Windows 0.31.01 - 0.31.03 legacy - 0.31.04 - 0.31.08 SDL + 0.31.04 - 0.31.10 SDL * Linux - 0.31.04 - 0.31.08 native. + 0.31.04 - 0.31.10 native. There are missing offsets but Map tools should be OK. Linux support is a bit lacking, I'm working on it. All supported Windows versions running in wine can be used with DFHack. @@ -119,7 +119,7 @@ External : linked as dynamic loaded libraries (.dll, .so, etc.) If you want to add dependencies, think twice about it. All internal dependencies for core dfhack should be either public domain or require attribution at most. -Internal dependencies for tools can be either that, or any Free Software +External dependencies for tools can be either that, or any Free Software licenses. ** Current internal dependencies ** @@ -132,7 +132,7 @@ argstream: Allows reading terminal application arguments. GPL! ** Current external dependencies ** wide-character ncurses : used for the veinlook tool on Linux. -python 2.6 : required for building and using the python bindings. +x11 libraries : used for sending key events on linux ** Build-time dependencies ** cmake: you need cmake to generate the build system and some configuration diff --git a/library/include/dfhack/modules/Position.h b/library/include/dfhack/modules/Position.h index 06fc23336..376208df2 100644 --- a/library/include/dfhack/modules/Position.h +++ b/library/include/dfhack/modules/Position.h @@ -17,6 +17,16 @@ namespace DFHack int32_t z; }; + struct t_screen + { + uint8_t symbol; + uint8_t foreground; + uint8_t background; + uint8_t bright; + uint8_t gtile; + uint8_t grayscale; + }; + class DFContextShared; class DFHACK_EXPORT Position : public Module { @@ -44,6 +54,11 @@ namespace DFHack */ bool getWindowSize(int32_t & width, int32_t & height); + /* + * Screen tiles + */ + bool getScreenTiles(int32_t width, int32_t height, t_screen screen[]); + private: struct Private; Private *d; diff --git a/library/modules/Position.cpp b/library/modules/Position.cpp index 0b76be94e..ab3fccba3 100644 --- a/library/modules/Position.cpp +++ b/library/modules/Position.cpp @@ -170,32 +170,33 @@ bool Position::getWindowSize (int32_t &width, int32_t &height) return true; } -/* + bool Position::getScreenTiles (int32_t width, int32_t height, t_screen screen[]) { if(!d->Inited) return false; + if(!d->StartedScreen) return false; + uint32_t screen_addr; d->owner->read (d->screen_tiles_ptr_offset, sizeof(uint32_t), (uint8_t *) screen_addr); - uint8_t* tiles = new uint8_t[width*height*4 + 80 + width*height*4]; + uint8_t* tiles = new uint8_t[width*height*4/* + 80 + width*height*4*/]; - d->owner->read (screen_addr, (width*height*4 + 80 + width*height*4), (uint8_t *) tiles); + d->owner->read (screen_addr, (width*height*4/* + 80 + width*height*4*/), (uint8_t *) tiles); for(int32_t iy=0; iy0x70 - 0x64 - 0x68 0x51C - 0xACC 0x654 + 0xACC - Body Parts - ========== - 0x0 - 0x1C - 0x44 - 0x78 - 0x90 + Color Mods + ========== + 0x70 + 0x64 + 0x68 + + Body Parts + ========== + 0x0 + 0x1C + 0x44 + 0x78 + 0x90 Materials ========= @@ -1777,48 +1780,38 @@ map_data_1b60_offset 0x1B9c Creature offsets ================ - 0x0 - 0x6c - 0x3c * - 0x44 * - 0x90 - 0x8C * - 0x90 * - 0x110 - 0xA6 * - 0x114 - 0XB4 * - 0X1F4 - 0X21C - - 0x18C * - 0x19C * - 0x1A0 * - 0x464 - 0x390 from chmod - 0x394 the skill that will be increased at the end of the mood (or not) - 0x604 - 0x6D4 - 0x774 - 0x0740 - 0x0758 - 0x834 + 0x0 VERIFIED + 0x3c CHMOD + 0x40 CHMOD + 0x44 CHMOD + 0x90 BAD!! + 0x8C CHMOD + 0x90 CHMOD + 0xA4 VERIFY + 0xA6 CHMOD + 0xA8 CHMOD + 0xB4 VERIFY! + 0X144 CHMOD + 0x18C VERIFY! + 0x19C VERIFY! + 0x1A0 VERIFY! + 0x464 BAD! + 0x258 CHMOD + 0x394 VERIFY! + the skill that will be increased at the end of the mood (or not) + 0x604 BAD! + 0x6D4 BAD! + 0x51C CHMOD + 0x0500 CHMOD + 0x0758 BAD! + 0x5AC CHMOD Souls ===== 0x0 - 0x1F4 - 0x224 - 0x88 - - Castes - ====== - 0x70 - 0x64 - 0x68 - 0x51C - 0xACC - 0x654 + 0x1C4 CHMOD + 0x1DC CHMOD + 0x88 BAD! Body Parts ========== @@ -1856,6 +1849,14 @@ map_data_1b60_offset 0x1B9c 0x20 VERIFIED 0x36 LOOKS OK + Castes + ====== + 0x70 + 0x64 + 0x68 + 0x51C + 0xACC + 0x654