DREAMWEB: Port 'locationpic', 'reexfrominv' to C++
This commit is contained in:
parent
3802b21183
commit
e322d6257d
8 changed files with 29 additions and 62 deletions
|
@ -577,6 +577,7 @@ generator = cpp(context, "DreamGen", blacklist = [
|
||||||
'loadtempcharset',
|
'loadtempcharset',
|
||||||
'loadtemptext',
|
'loadtemptext',
|
||||||
'loadtraveltext',
|
'loadtraveltext',
|
||||||
|
'locationpic',
|
||||||
'lockeddoorway',
|
'lockeddoorway',
|
||||||
'locklightoff',
|
'locklightoff',
|
||||||
'locklighton',
|
'locklighton',
|
||||||
|
@ -727,6 +728,7 @@ generator = cpp(context, "DreamGen", blacklist = [
|
||||||
'redes',
|
'redes',
|
||||||
'redrawmainscrn',
|
'redrawmainscrn',
|
||||||
'reelsonscreen',
|
'reelsonscreen',
|
||||||
|
'reexfrominv',
|
||||||
'reexfromopen',
|
'reexfromopen',
|
||||||
'reminders',
|
'reminders',
|
||||||
'removeemm',
|
'removeemm',
|
||||||
|
|
|
@ -284,16 +284,6 @@ findopen2a:
|
||||||
goto findopen1a;
|
goto findopen1a;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DreamGenContext::reExFromInv() {
|
|
||||||
STACK_CHECK;
|
|
||||||
findInvPos();
|
|
||||||
ax = es.word(bx);
|
|
||||||
data.byte(kCommandtype) = ah;
|
|
||||||
data.byte(kCommand) = al;
|
|
||||||
data.byte(kExamagain) = 1;
|
|
||||||
data.byte(kPointermode) = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void DreamGenContext::swapWithInv() {
|
void DreamGenContext::swapWithInv() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
al = data.byte(kItemframe);
|
al = data.byte(kItemframe);
|
||||||
|
@ -881,54 +871,6 @@ cantpurge2:
|
||||||
goto lookforpurge2;
|
goto lookforpurge2;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DreamGenContext::locationPic() {
|
|
||||||
STACK_CHECK;
|
|
||||||
getDestInfo();
|
|
||||||
al = es.byte(si);
|
|
||||||
push(es);
|
|
||||||
push(si);
|
|
||||||
di = 0;
|
|
||||||
_cmp(al, 6);
|
|
||||||
if (!flags.c())
|
|
||||||
goto secondlot;
|
|
||||||
ds = data.word(kTempgraphics);
|
|
||||||
_add(al, 4);
|
|
||||||
goto gotgraphic;
|
|
||||||
secondlot:
|
|
||||||
_sub(al, 6);
|
|
||||||
ds = data.word(kTempgraphics2);
|
|
||||||
gotgraphic:
|
|
||||||
_add(di, 104);
|
|
||||||
bx = 138+14;
|
|
||||||
ah = 0;
|
|
||||||
showFrame();
|
|
||||||
si = pop();
|
|
||||||
es = pop();
|
|
||||||
al = data.byte(kDestpos);
|
|
||||||
_cmp(al, data.byte(kReallocation));
|
|
||||||
if (!flags.z())
|
|
||||||
goto notinthisone;
|
|
||||||
al = 3;
|
|
||||||
di = 104;
|
|
||||||
bx = 140+14;
|
|
||||||
ds = data.word(kTempgraphics);
|
|
||||||
ah = 0;
|
|
||||||
showFrame();
|
|
||||||
notinthisone:
|
|
||||||
bl = data.byte(kDestpos);
|
|
||||||
bh = 0;
|
|
||||||
_add(bx, bx);
|
|
||||||
es = data.word(kTraveltext);
|
|
||||||
si = es.word(bx);
|
|
||||||
_add(si, (66*2));
|
|
||||||
di = 50;
|
|
||||||
bx = 20;
|
|
||||||
dl = 241;
|
|
||||||
al = 0;
|
|
||||||
ah = 0;
|
|
||||||
printDirect();
|
|
||||||
}
|
|
||||||
|
|
||||||
void DreamGenContext::getDestInfo() {
|
void DreamGenContext::getDestInfo() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
al = data.byte(kDestpos);
|
al = data.byte(kDestpos);
|
||||||
|
|
|
@ -461,7 +461,6 @@ public:
|
||||||
void getFreeAd();
|
void getFreeAd();
|
||||||
void dirFile();
|
void dirFile();
|
||||||
void pickupConts();
|
void pickupConts();
|
||||||
void reExFromInv();
|
|
||||||
void transferMap();
|
void transferMap();
|
||||||
void purgeAnItem();
|
void purgeAnItem();
|
||||||
void getSetAd();
|
void getSetAd();
|
||||||
|
@ -471,7 +470,6 @@ public:
|
||||||
void fillOpen();
|
void fillOpen();
|
||||||
void getEitherAd();
|
void getEitherAd();
|
||||||
void useOpened();
|
void useOpened();
|
||||||
void locationPic();
|
|
||||||
void swapWithOpen();
|
void swapWithOpen();
|
||||||
void dreamweb();
|
void dreamweb();
|
||||||
void findPathOfPoint();
|
void findPathOfPoint();
|
||||||
|
|
|
@ -34,7 +34,7 @@ void DreamGenContext::newPlace() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move to DreamBase once locationPic is moved
|
// TODO: Move to DreamBase once getDestInfo is moved
|
||||||
void DreamGenContext::selectLocation() {
|
void DreamGenContext::selectLocation() {
|
||||||
data.byte(kInmaparea) = 0;
|
data.byte(kInmaparea) = 0;
|
||||||
clearBeforeLoad();
|
clearBeforeLoad();
|
||||||
|
@ -270,6 +270,20 @@ void DreamBase::readCityPic() {
|
||||||
loadIntoTemp("DREAMWEB.G04");
|
loadIntoTemp("DREAMWEB.G04");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DreamGenContext::locationPic() {
|
||||||
|
getDestInfo();
|
||||||
|
byte destFlag = es.byte(si);
|
||||||
|
if (destFlag >= 6)
|
||||||
|
showFrame(tempGraphics2(), 104, 138 + 14, destFlag - 6, 0); // Second slot
|
||||||
|
else
|
||||||
|
showFrame(tempGraphics(), 104, 138 + 14, destFlag + 4, 0);
|
||||||
|
|
||||||
|
if (data.byte(kDestpos) == data.byte(kReallocation))
|
||||||
|
showFrame(tempGraphics(), 104, 140 + 14, 3, 0); // Currently in this location
|
||||||
|
|
||||||
|
uint16 offset = kTextstart + getSegment(data.word(kTraveltext)).word(data.byte(kDestpos) * 2);
|
||||||
|
const uint8 *string = getSegment(data.word(kTraveltext)).ptr(offset, 0);
|
||||||
|
DreamBase::printDirect(string, 50, 20, 241, 241 & 1);
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace DreamGen
|
} // End of namespace DreamGen
|
||||||
|
|
|
@ -826,4 +826,12 @@ void DreamGenContext::selectOpenOb() {
|
||||||
delPointer();
|
delPointer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DreamGenContext::reExFromInv() {
|
||||||
|
uint16 objectId = getSegment(data.word(kBuffers)).word(findInvPosCPP());
|
||||||
|
data.byte(kCommandtype) = objectId >> 8;
|
||||||
|
data.byte(kCommand) = objectId & 0x00FF;
|
||||||
|
data.byte(kExamagain) = 1;
|
||||||
|
data.byte(kPointermode) = 0;
|
||||||
|
}
|
||||||
|
|
||||||
} // End of namespace DreamGen
|
} // End of namespace DreamGen
|
||||||
|
|
|
@ -3700,4 +3700,5 @@ void DreamBase::incRyanPage() {
|
||||||
delPointer();
|
delPointer();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // End of namespace DreamGen
|
} // End of namespace DreamGen
|
||||||
|
|
|
@ -193,5 +193,7 @@
|
||||||
void outOfInv();
|
void outOfInv();
|
||||||
void selectOpenOb();
|
void selectOpenOb();
|
||||||
void selectLocation();
|
void selectLocation();
|
||||||
|
void reExFromInv();
|
||||||
|
void locationPic();
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -242,7 +242,7 @@ void DreamBase::playGuitar() {
|
||||||
putBackObStuff();
|
putBackObStuff();
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Move to DreamBase once selectLocation (in reality, locationPic) is moved
|
// TODO: Move to DreamBase once selectLocation (in reality, getDestInfo) is moved
|
||||||
void DreamGenContext::useElevator1() {
|
void DreamGenContext::useElevator1() {
|
||||||
showFirstUse();
|
showFirstUse();
|
||||||
selectLocation();
|
selectLocation();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue