DREAMWEB: Remove getdestinfo() and access the roomPics array directly in locationPic()

This commit is contained in:
Filippos Karapetis 2011-12-25 21:00:30 +02:00
parent 6dbc930b18
commit e27a5931c8
4 changed files with 21 additions and 47 deletions

View File

@ -50,6 +50,7 @@ p = parser(skip_binary_data = [
'volumetabname',
'commandline',
'openchangesize',
'roompics',
# keypad.asm
'keypadlist',
'symbollist',
@ -474,6 +475,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getbackfromops',
'getbacktoops',
'getblockofpixel',
'getdestinfo',
'getdimension',
'getexpos',
'getflagunderp',

View File

@ -475,25 +475,6 @@ void DreamGenContext::transferConToEx() {
ds.byte(si+2) = 255;
}
void DreamGenContext::getDestInfo() {
STACK_CHECK;
al = data.byte(kDestpos);
ah = 0;
push(ax);
dx = data;
es = dx;
si = 537;
_add(si, ax);
cl = es.byte(si);
ax = pop();
push(cx);
dx = data;
es = dx;
si = 553;
_add(si, ax);
ax = pop();
}
void DreamGenContext::dirCom() {
STACK_CHECK;
cx = 30;
@ -767,7 +748,7 @@ void DreamGenContext::parser() {
al = '=';
_stosb();
ds = cs;
si = 571;
si = 556;
notspace1:
_lodsw();
_cmp(al, 32);
@ -952,9 +933,9 @@ void DreamGenContext::__start() {
//0x0200: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00,
//0x0210: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x03, 0x02, 0x04, 0x01, 0x0a,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0220: .... .... .... ....
0x09, 0x08, 0x06, 0x0b, 0x04, 0x07, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0230: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0240: .... .... .... ....
@ -968,11 +949,9 @@ void DreamGenContext::__start() {
//0x0280: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
//0x0290: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
//0x02a0: .... .... .... ....
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff,
//0x02b0: .... .... .... ....
0xff, 0x00, 0x00, 0x00, };
0xff, 0xff, 0x00, 0x00, 0x00, };
ds.assign(src, src + sizeof(src));
dreamweb();
}

View File

@ -346,13 +346,12 @@ static const uint16 kRoomssample = 420;
static const uint16 kBasicsample = 421;
static const uint16 kCurrentfile = 462;
static const uint16 kRoomscango = 537;
static const uint16 kRoompics = 553;
static const uint16 kOplist = 568;
static const uint16 kInputline = 571;
static const uint16 kPresslist = 699;
static const uint16 kQuitrequested = 705;
static const uint16 kSubtitles = 706;
static const uint16 kForeignrelease = 707;
static const uint16 kOplist = 553;
static const uint16 kInputline = 556;
static const uint16 kPresslist = 684;
static const uint16 kQuitrequested = 690;
static const uint16 kSubtitles = 691;
static const uint16 kForeignrelease = 692;
static const uint16 kBlocktextdat = (0);
static const uint16 kPersonframes = (0);
static const uint16 kDebuglevel1 = (0);
@ -469,7 +468,6 @@ public:
void getEitherAd();
void dreamweb();
void findPathOfPoint();
void getDestInfo();
void read();
void searchForString();
void searchForFiles();

View File

@ -142,11 +142,13 @@ void DreamBase::putUnderCentre() {
}
void DreamBase::locationPic() {
byte destFlag = data.byte(553 + data.byte(kDestpos));
if (destFlag >= 6)
showFrame(tempGraphics2(), 104, 138 + 14, destFlag - 6, 0); // Second slot
const int roomPics[] = { 5, 0, 3, 2, 4, 1, 10, 9, 8, 6, 11, 4, 7, 7, 0 };
byte picture = roomPics[data.byte(kDestpos)];
if (picture >= 6)
showFrame(tempGraphics2(), 104, 138 + 14, picture - 6, 0); // Second slot
else
showFrame(tempGraphics(), 104, 138 + 14, destFlag + 4, 0);
showFrame(tempGraphics(), 104, 138 + 14, picture + 4, 0);
if (data.byte(kDestpos) == data.byte(kReallocation))
showFrame(tempGraphics(), 104, 140 + 14, 3, 0); // Currently in this location
@ -156,8 +158,6 @@ void DreamBase::locationPic() {
DreamBase::printDirect(string, 50, 20, 241, 241 & 1);
}
// TODO: put Getdestinfo here
void DreamBase::showArrows() {
showFrame(tempGraphics(), 116 - 12, 16, 0, 0);
showFrame(tempGraphics(), 226 + 12, 16, 1, 0);
@ -177,9 +177,7 @@ void DreamGenContext::nextDest() {
data.byte(kDestpos)++;
if (data.byte(kDestpos) == 15)
data.byte(kDestpos) = 0; // last destination
getDestInfo();
} while (al == 0);
} while (!data.byte(kRoomscango + data.byte(kDestpos)));
data.byte(kNewtextline) = 1;
delTextLine();
@ -208,9 +206,7 @@ void DreamGenContext::lastDest() {
data.byte(kDestpos)--;
if (data.byte(kDestpos) == 0xFF)
data.byte(kDestpos) = 15; // first destination
getDestInfo();
} while (al == 0);
} while (!data.byte(kRoomscango + data.byte(kDestpos)));
data.byte(kNewtextline) = 1;
delTextLine();
@ -235,7 +231,6 @@ void DreamGenContext::destSelect() {
if (!(data.word(kMousebutton) & 1) || data.word(kOldbutton) == 1)
return; // notrav
getDestInfo();
data.byte(kNewlocation) = data.byte(kDestpos);
}