Add screen_tiles_pointer for Memory.xml and fix reading screen tiles in Position module.

develop
Mikko Juola 2010-08-16 14:50:12 +03:00
parent ac78452228
commit 35a58cdf0c
2 changed files with 6 additions and 5 deletions

@ -1721,6 +1721,7 @@ map_data_1b60_offset 0x1B9c
<Entry version="v0.31.12" os="windows" id="0.31.12" base="0.31.11">
<String name="md5">f0459165a426a9f2dd8d957e9fa7f01d</String>
<HexValue name="pe_timestamp">0x4C4C32E7</HexValue>
<Address name="screen_tiles_pointer">0x18313D0</Address>
</Entry>
.-"""-.
' \

@ -177,7 +177,7 @@ bool Position::getScreenTiles (int32_t width, int32_t height, t_screen screen[])
if(!d->StartedScreen) return false;
uint32_t screen_addr;
d->owner->read (d->screen_tiles_ptr_offset, sizeof(uint32_t), (uint8_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*/];
@ -187,10 +187,10 @@ bool Position::getScreenTiles (int32_t width, int32_t height, t_screen screen[])
{
for(int32_t ix=0; ix<width; ix++)
{
screen[ix + iy*width].symbol = tiles[iy + ix*height*4 +0];
screen[ix + iy*width].foreground = tiles[iy + ix*height*4 +1];
screen[ix + iy*width].background = tiles[iy + ix*height*4 +2];
screen[ix + iy*width].bright = tiles[iy + ix*height*4 +3];
screen[ix + iy*width].symbol = tiles[(iy + ix*height)*4 +0];
screen[ix + iy*width].foreground = tiles[(iy + ix*height)*4 +1];
screen[ix + iy*width].background = tiles[(iy + ix*height)*4 +2];
screen[ix + iy*width].bright = tiles[(iy + ix*height)*4 +3];
//screen[ix + iy*width].gtile = tiles[width*height*4 + 80 + iy + ix*height +0];
//screen[ix + iy*width].grayscale = tiles[width*height*4 + 80 + iy + ix*height +1];
}