Don't build SHM on 64bit, makes no sense

Added origin to mapblock40d
develop
Petr Mrázek 2010-03-05 01:26:39 +01:00
parent c86464502c
commit 8e8d320a0b
5 changed files with 22 additions and 14 deletions

@ -337,6 +337,7 @@ main(int argc, char *argv[])
int filenum = 0;
bool dirtybit = false;
uint32_t blockaddr = 0;
uint32_t blockaddr2 = 0;
// walk the map!
for (;;)
{
@ -437,6 +438,7 @@ main(int argc, char *argv[])
if(i == 0 && j == 0)
{
blockaddr = DF.getBlockPtr(cursorX+i,cursorY+j,cursorZ);
blockaddr2 = Block.origin;
if(dump)
{
hexdump(DF,blockaddr,0x1E00/*0x1DB8*/,filenum);
@ -516,7 +518,7 @@ main(int argc, char *argv[])
}
}
gotoxy (0,52);
cprintf("block address 0x%x",blockaddr);
cprintf("block address 0x%x 0x%x",blockaddr, blockaddr2);
gotoxy (0,53);
cprintf("dirty bit: %d",dirtybit);
gotoxy (0,54);

@ -316,6 +316,7 @@ bool API::ReadBlock40d(uint32_t x, uint32_t y, uint32_t z, mapblock40d * buffer)
g_pProcess->read (addr + d->occupancy_offset, sizeof (buffer->occupancy), (uint8_t *) buffer->occupancy);
g_pProcess->read (addr + d->designation_offset, sizeof (buffer->designaton), (uint8_t *) buffer->designaton);
g_pProcess->read (addr + d->biome_stuffs, sizeof (buffer->biome_indices), (uint8_t *) buffer->biome_indices);
buffer->origin = addr;
uint32_t addr_of_struct = g_pProcess->readDWord(addr);
buffer->dirty_dword = g_pProcess->readDWord(addr_of_struct);
return true;

@ -769,7 +769,9 @@ typedef struct
int16_t tiletypes [16][16];
DFHack::t_designation designaton [16][16];
DFHack::t_occupancy occupancy [16][16];
uint8_t biome_indices [7];
// really a '7', but I use 8 to make it neater :)
uint8_t biome_indices [8];
uint32_t origin; // the address where it came from
uint32_t dirty_dword; // bit 1 set means that the block is to be included in job checks
} mapblock40d;

@ -38,15 +38,16 @@ SET_SOURCE_FILES_PROPERTIES( ${PROJECT_HDRS} PROPERTIES HEADER_FILE_ONLY TRUE )
LIST(APPEND PROJECT_SRCS ${PROJECT_HDRS})
IF(UNIX)
add_definitions(-DLINUX_BUILD)
SET(PROJECT_LIBS rt)
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden")
ADD_LIBRARY(dfconnect SHARED ${PROJECT_SRCS})
TARGET_LINK_LIBRARIES(dfconnect ${PROJECT_LIBS})
ELSE(UNIX)
# SET(PROJECT_LIBS psapi)
ADD_LIBRARY(SDL SHARED ${PROJECT_SRCS})
TARGET_LINK_LIBRARIES(SDL ${PROJECT_LIBS})
ENDIF(UNIX)
IF(CMAKE_SIZEOF_VOID_P EQUAL 4)
IF(UNIX)
add_definitions(-DLINUX_BUILD)
SET(PROJECT_LIBS rt)
SET(CMAKE_CXX_FLAGS "-fvisibility=hidden")
ADD_LIBRARY(dfconnect SHARED ${PROJECT_SRCS})
TARGET_LINK_LIBRARIES(dfconnect ${PROJECT_LIBS})
ELSE(UNIX)
# SET(PROJECT_LIBS psapi)
ADD_LIBRARY(SDL SHARED ${PROJECT_SRCS})
TARGET_LINK_LIBRARIES(SDL ${PROJECT_LIBS})
ENDIF(UNIX)
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4)

@ -77,6 +77,8 @@ void ReadBlockByCoords (void * data)
memcpy(&(SHMBLOCK->occupancy), block + offsets.occupancy_offset, sizeof(SHMBLOCK->occupancy));
memcpy(&(SHMBLOCK->biome_indices), block + offsets.biome_stuffs, sizeof(SHMBLOCK->biome_indices));
SHMBLOCK->dirty_dword = *block->ptr_to_dirty;
SHMBLOCK->origin = reinterpret_cast<uint32_t>(block);
SHMHDR->error = false;
}
else