Skip to content

Commit

Permalink
DREAMWEB: 'hangone' ported to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
digitall committed Dec 5, 2011
1 parent 5b9007f commit cc59b85
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 17 deletions.
1 change: 1 addition & 0 deletions devtools/tasmrecover/tasm-recover
Expand Up @@ -289,6 +289,7 @@ generator = cpp(context, "DreamGen", blacklist = [
'getyad',
'hangon',
'hangoncurs',
'hangone',
'hangonp',
'hangonw',
'initman',
Expand Down
13 changes: 0 additions & 13 deletions engines/dreamweb/dreamgen.cpp
Expand Up @@ -2423,19 +2423,6 @@ void DreamGenContext::bibleQuote() {
data.byte(kLasthardkey) = 0;
}

void DreamGenContext::hangOne() {
STACK_CHECK;
hangonloope:
push(cx);
vSync();
cx = pop();
_cmp(data.byte(kLasthardkey), 1);
if (flags.z())
return /* (hangonearly) */;
if (--cx)
goto hangonloope;
}

void DreamGenContext::intro() {
STACK_CHECK;
dx = 1035;
Expand Down
7 changes: 3 additions & 4 deletions engines/dreamweb/dreamgen.h
Expand Up @@ -585,7 +585,6 @@ class DreamGenContext : public Context {
void introMonks1();
void resetLocation();
void introMonks2();
void advisor();
void additionalText();
void useElevator5();
void useElevator4();
Expand Down Expand Up @@ -668,7 +667,7 @@ class DreamGenContext : public Context {
void lockLightOff();
void wearWatch();
void runIntroSeq();
void nextColon();
void advisor();
void attendant();
void monks2text();
void clearPalette();
Expand All @@ -677,6 +676,7 @@ class DreamGenContext : public Context {
void openHotelDoor();
void blank();
void drinker();
void nextColon();
void placeFreeObject();
void allPalette();
void adjustRight();
Expand Down Expand Up @@ -767,7 +767,6 @@ class DreamGenContext : public Context {
void quitSymbol();
void setTopRight();
void findSetObject();
void getPersonText();
void carParkDrip();
void useDiary();
void deleteExObject();
Expand Down Expand Up @@ -885,7 +884,7 @@ class DreamGenContext : public Context {
void clearReels();
void doSaveLoad();
void createName();
void hangOne();
void getPersonText();
void inToInv();
void parser();
void setMouse();
Expand Down
11 changes: 11 additions & 0 deletions engines/dreamweb/stubs.cpp
Expand Up @@ -3136,6 +3136,17 @@ void DreamGenContext::readKey() {
data.word(kBufferout) = bufOut;
}

void DreamGenContext::hangOne(uint16 delay) {
do {
vSync();
if (data.byte(kLasthardkey) == 1)
return; // "hangonearly"
} while (--delay);
}

void DreamGenContext::hangOne() {
hangOne(cx);
}

} /*namespace dreamgen */

2 changes: 2 additions & 0 deletions engines/dreamweb/stubs.h
Expand Up @@ -444,4 +444,6 @@
void loadCart();
void soundOnReels();
void readKey();
void hangOne(uint16 delay);
void hangOne();

1 comment on commit cc59b85

@tramboi
Copy link
Contributor

@tramboi tramboi commented on cc59b85 Dec 5, 2011

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a good idea to check quitRequested() too in those active loops to improve quit reactivity :)

Please sign in to comment.