DREAMWEB: Port 'isryanholding' to C++
This commit is contained in:
parent
70fd1b6043
commit
12cac260c9
6 changed files with 24 additions and 46 deletions
|
@ -500,6 +500,7 @@ generator = cpp(context, "DreamGen", blacklist = [
|
||||||
'isitdescribed',
|
'isitdescribed',
|
||||||
'isitright',
|
'isitright',
|
||||||
'isitworn',
|
'isitworn',
|
||||||
|
'isryanholding',
|
||||||
'issetobonmap',
|
'issetobonmap',
|
||||||
'keeper',
|
'keeper',
|
||||||
'kernchars',
|
'kernchars',
|
||||||
|
|
|
@ -2937,44 +2937,6 @@ doselob:
|
||||||
useRoutine();
|
useRoutine();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DreamGenContext::isRyanHolding() {
|
|
||||||
STACK_CHECK;
|
|
||||||
_sub(al, 'A');
|
|
||||||
_sub(ah, 'A');
|
|
||||||
_sub(cl, 'A');
|
|
||||||
_sub(ch, 'A');
|
|
||||||
es = data.word(kExtras);
|
|
||||||
bx = (0+2080+30000);
|
|
||||||
dl = 0;
|
|
||||||
searchinv:
|
|
||||||
_cmp(es.byte(bx+2), 4);
|
|
||||||
if (!flags.z())
|
|
||||||
goto nofindininv;
|
|
||||||
_cmp(al, es.byte(bx+12));
|
|
||||||
if (!flags.z())
|
|
||||||
goto nofindininv;
|
|
||||||
_cmp(ah, es.byte(bx+13));
|
|
||||||
if (!flags.z())
|
|
||||||
goto nofindininv;
|
|
||||||
_cmp(cl, es.byte(bx+14));
|
|
||||||
if (!flags.z())
|
|
||||||
goto nofindininv;
|
|
||||||
_cmp(ch, es.byte(bx+15));
|
|
||||||
if (!flags.z())
|
|
||||||
goto nofindininv;
|
|
||||||
al = dl;
|
|
||||||
_cmp(al, (114));
|
|
||||||
return;
|
|
||||||
nofindininv:
|
|
||||||
_add(bx, 16);
|
|
||||||
_inc(dl);
|
|
||||||
_cmp(dl, (114));
|
|
||||||
if (!flags.z())
|
|
||||||
goto searchinv;
|
|
||||||
al = dl;
|
|
||||||
_cmp(al, (114));
|
|
||||||
}
|
|
||||||
|
|
||||||
void DreamGenContext::checkInside() {
|
void DreamGenContext::checkInside() {
|
||||||
STACK_CHECK;
|
STACK_CHECK;
|
||||||
es = data.word(kExtras);
|
es = data.word(kExtras);
|
||||||
|
|
|
@ -480,7 +480,6 @@ public:
|
||||||
void clearBuffers();
|
void clearBuffers();
|
||||||
void getObTextStart();
|
void getObTextStart();
|
||||||
void checkObjectSize();
|
void checkObjectSize();
|
||||||
void isRyanHolding();
|
|
||||||
void fillOpen();
|
void fillOpen();
|
||||||
void useCashCard();
|
void useCashCard();
|
||||||
void moneyPoke();
|
void moneyPoke();
|
||||||
|
|
|
@ -1774,6 +1774,26 @@ uint16 DreamGenContext::findExObject(const char *id) {
|
||||||
return kNumexobjects;
|
return kNumexobjects;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DreamGenContext::isRyanHolding() {
|
||||||
|
char id[5];
|
||||||
|
id[0] = al;
|
||||||
|
id[1] = ah;
|
||||||
|
id[2] = cl;
|
||||||
|
id[3] = ch;
|
||||||
|
id[4] = '\0';
|
||||||
|
flags._z = isRyanHolding(id);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DreamGenContext::isRyanHolding(const char *id) {
|
||||||
|
for (uint16 index = 0; index < kNumexobjects; index++) {
|
||||||
|
DynObject *object = getExAd(index);
|
||||||
|
if (object->mapad[0] == 4 && objectMatches(object, id))
|
||||||
|
return (index == kNumexobjects);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool DreamBase::isItDescribed(const ObjPos *pos) {
|
bool DreamBase::isItDescribed(const ObjPos *pos) {
|
||||||
uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
|
uint16 offset = getSegment(data.word(kSetdesc)).word(kSettextdat + pos->index * 2);
|
||||||
uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset);
|
uint8 result = getSegment(data.word(kSetdesc)).byte(kSettext + offset);
|
||||||
|
|
|
@ -383,6 +383,8 @@
|
||||||
uint16 findSetObject(const char *id);
|
uint16 findSetObject(const char *id);
|
||||||
void findExObject();
|
void findExObject();
|
||||||
uint16 findExObject(const char *id);
|
uint16 findExObject(const char *id);
|
||||||
|
void isRyanHolding();
|
||||||
|
bool isRyanHolding(const char *id);
|
||||||
void describeOb();
|
void describeOb();
|
||||||
void getOpenedSize();
|
void getOpenedSize();
|
||||||
byte getOpenedSizeCPP();
|
byte getOpenedSizeCPP();
|
||||||
|
|
|
@ -625,13 +625,7 @@ void DreamGenContext::sLabDoorB() {
|
||||||
data.byte(kWatchspeed) = 1;
|
data.byte(kWatchspeed) = 1;
|
||||||
data.byte(kSpeedcount) = 1;
|
data.byte(kSpeedcount) = 1;
|
||||||
} else {
|
} else {
|
||||||
al = 'S';
|
if (isRyanHolding("SHLD")) {
|
||||||
ah = 'H';
|
|
||||||
cl = 'L';
|
|
||||||
ch = 'D';
|
|
||||||
isRyanHolding();
|
|
||||||
|
|
||||||
if (flags.z()) {
|
|
||||||
// No crystal
|
// No crystal
|
||||||
showPuzText(44, 200);
|
showPuzText(44, 200);
|
||||||
putBackObStuff();
|
putBackObStuff();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue