DREAMWEB: 'enterSymbol' ported to C++

This commit is contained in:
Bertrand Augereau 2011-12-03 20:10:15 +01:00
parent ee0f3bcaad
commit 156d3a997e
5 changed files with 61 additions and 87 deletions

View File

@ -160,6 +160,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'eden',
'endpaltostart',
'entercode',
'entersymbol',
'eraseoldobs',
'examineob',
'examineobtext',

View File

@ -9077,75 +9077,6 @@ void DreamGenContext::dumpKeypad() {
multiDump();
}
void DreamGenContext::enterSymbol() {
STACK_CHECK;
data.byte(kManisoffscreen) = 1;
getRidOfReels();
dx = 2007;
loadIntoTemp();
data.byte(kSymboltopx) = 24;
data.byte(kSymboltopdir) = 0;
data.byte(kSymbolbotx) = 24;
data.byte(kSymbolbotdir) = 0;
redrawMainScrn();
showSymbol();
underTextLine();
workToScreenM();
data.byte(kGetback) = 0;
symbolloop:
delPointer();
updateSymbolTop();
updateSymbolBot();
showSymbol();
readMouse();
showPointer();
vSync();
dumpPointer();
dumpTextLine();
dumpSymbol();
bx = offset_symbollist;
checkCoords();
_cmp(data.byte(kGetback), 0);
if (flags.z())
goto symbolloop;
_cmp(data.byte(kSymbolbotnum), 3);
if (!flags.z())
goto symbolwrong;
_cmp(data.byte(kSymboltopnum), 5);
if (!flags.z())
goto symbolwrong;
al = 43;
removeSetObject();
al = 46;
placeSetObject();
ah = data.byte(kRoomnum);
_add(ah, 12);
al = 0;
turnAnyPathOn();
data.byte(kManisoffscreen) = 0;
redrawMainScrn();
getRidOfTemp();
restoreReels();
workToScreenM();
al = 13;
playChannel1();
return;
symbolwrong:
al = 46;
removeSetObject();
al = 43;
placeSetObject();
ah = data.byte(kRoomnum);
_add(ah, 12);
al = 0;
turnAnyPathOff();
data.byte(kManisoffscreen) = 0;
redrawMainScrn();
getRidOfTemp();
restoreReels();
workToScreenM();
}
void DreamGenContext::quitSymbol() {
STACK_CHECK;
_cmp(data.byte(kSymboltopx), 24);

View File

@ -57,7 +57,6 @@ public:
static const uint16 offset_gameerror1 = 0x0a7d;
static const uint16 offset_gameerror3 = 0x0b12;
static const uint16 offset_gameerror7 = 0x0c13;
static const uint16 offset_symbollist = 0x09c1;
static const uint16 offset_speechfilename = 0x0ec9;
static const uint16 offset_discopslist = 0x0a53;
static const uint16 offset_atmospherelist = 0x0edc;
@ -756,7 +755,6 @@ public:
void discOps();
void middlePanel();
void monitorLogo();
void enterSymbol();
void dirFile();
void pickupConts();
void lockLightOff();
@ -834,7 +832,7 @@ public:
void priest();
void printmessage2();
void loadNews();
void rollEm();
void wearShades();
void hangOnPQ();
void findOpenPos();
void describeOb();
@ -848,7 +846,7 @@ public:
void getBack1();
void fadeFromWhite();
void useWindow();
void wearShades();
void rollEm();
void delEverything();
void fadeScreenDown();
void poolGuard();

View File

@ -1711,20 +1711,6 @@ void DreamGenContext::checkCoords() {
checkCoords(destList);
break;
}
case offset_symbollist: {
RectWithCallback symbolList[] = {
{ kSymbolx+40,kSymbolx+64,kSymboly+2,kSymboly+16,&DreamGenContext::quitSymbol },
{ kSymbolx,kSymbolx+52,kSymboly+20,kSymboly+50,&DreamGenContext::setTopLeft },
{ kSymbolx+52,kSymbolx+104,kSymboly+20,kSymboly+50,&DreamGenContext::setTopRight },
{ kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamGenContext::setBotLeft },
{ kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamGenContext::setBotRight },
{ 0,320,0,200,&DreamGenContext::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(symbolList);
break;
}
case offset_diarylist: {
RectWithCallback diaryList[] = {
{ kDiaryx+94,kDiaryx+110,kDiaryy+97,kDiaryy+113,&DreamGenContext::diaryKeyN },
@ -2082,6 +2068,63 @@ uint8 *DreamGenContext::getObTextStartCPP() {
return result;
}
void DreamGenContext::enterSymbol() {
data.byte(kManisoffscreen) = 1;
getRidOfReels();
loadIntoTemp("DREAMWEB.G12");
data.byte(kSymboltopx) = 24;
data.byte(kSymboltopdir) = 0;
data.byte(kSymbolbotx) = 24;
data.byte(kSymbolbotdir) = 0;
redrawMainScrn();
showSymbol();
underTextLine();
workToScreenM();
data.byte(kGetback) = 0;
do {
delPointer();
updateSymbolTop();
updateSymbolBot();
showSymbol();
readMouse();
showPointer();
vSync();
dumpPointer();
dumpTextLine();
dumpSymbol();
RectWithCallback symbolList[] = {
{ kSymbolx+40,kSymbolx+64,kSymboly+2,kSymboly+16,&DreamGenContext::quitSymbol },
{ kSymbolx,kSymbolx+52,kSymboly+20,kSymboly+50,&DreamGenContext::setTopLeft },
{ kSymbolx+52,kSymbolx+104,kSymboly+20,kSymboly+50,&DreamGenContext::setTopRight },
{ kSymbolx,kSymbolx+52,kSymboly+50,kSymboly+80,&DreamGenContext::setBotLeft },
{ kSymbolx+52,kSymbolx+104,kSymboly+50,kSymboly+80,&DreamGenContext::setBotRight },
{ 0,320,0,200,&DreamGenContext::blank },
{ 0xFFFF,0,0,0,0 }
};
checkCoords(symbolList);
} while (data.byte(kGetback) == 0);
if ((data.byte(kSymbolbotnum) == 3) && (data.byte(kSymboltopnum) == 5)) {
removeSetObject(43);
placeSetObject(46);
turnAnyPathOn(0, data.byte(kRoomnum) + 12);
data.byte(kManisoffscreen) = 0;
redrawMainScrn();
getRidOfTemp();
restoreReels();
workToScreenM();
playChannel1(13);
} else {
removeSetObject(46);
placeSetObject(43);
turnAnyPathOff(0, data.byte(kRoomnum) + 12);
data.byte(kManisoffscreen) = 0;
redrawMainScrn();
getRidOfTemp();
restoreReels();
workToScreenM();
}
}
void DreamGenContext::zoomOnOff() {
if (data.word(kWatchingtime) != 0) {
blank();

View File

@ -364,6 +364,7 @@
void loadRoomData(const Room &room, bool skipDat);
void restoreAll();
void restoreReels();
void enterSymbol();
void viewFolder();
void checkFolderCoords();
void loadFolder();