diff options
author | Bertrand Augereau | 2011-09-06 22:10:02 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-09-06 22:10:02 +0200 |
commit | b94cce639d6466cb24ab19cca5b1964648b02567 (patch) | |
tree | 7dcdbf9bfb44f485b7ccf8a8705a6c9e68c23575 /engines | |
parent | d9d366dbc9c2535949bb9b70ab472e73564c8f0d (diff) | |
download | scummvm-rg350-b94cce639d6466cb24ab19cca5b1964648b02567.tar.gz scummvm-rg350-b94cce639d6466cb24ab19cca5b1964648b02567.tar.bz2 scummvm-rg350-b94cce639d6466cb24ab19cca5b1964648b02567.zip |
DREAMWEB: 'hangon' and 'hangonp' ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 59 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 8 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 52 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 5 | ||||
-rw-r--r-- | engines/dreamweb/use.cpp | 6 |
5 files changed, 58 insertions, 72 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 958476512d..068f3fcff3 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -15242,53 +15242,6 @@ void DreamGenContext::allpointer() { dumppointer(); } -void DreamGenContext::hangonp() { - STACK_CHECK; - push(cx); - _add(cx, cx); - ax = pop(); - _add(cx, ax); - data.word(kMaintimer) = 0; - al = data.byte(kPointerframe); - ah = data.byte(kPickup); - push(ax); - data.byte(kPointermode) = 3; - data.byte(kPickup) = 0; - push(cx); - data.byte(kCommandtype) = 255; - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - cx = pop(); -hangloop: - push(cx); - delpointer(); - readmouse(); - animpointer(); - showpointer(); - vsync(); - dumppointer(); - cx = pop(); - ax = data.word(kMousebutton); - _cmp(ax, 0); - if (flags.z()) - goto notpressed; - _cmp(ax, data.word(kOldbutton)); - if (!flags.z()) - goto getoutofit; -notpressed: - if (--cx) - goto hangloop; -getoutofit: - delpointer(); - ax = pop(); - data.byte(kPointerframe) = al; - data.byte(kPickup) = ah; - data.byte(kPointermode) = 0; -} - void DreamGenContext::hangonw() { STACK_CHECK; hangloopw: @@ -15415,16 +15368,6 @@ void DreamGenContext::randomnum2() { ds = pop(); } -void DreamGenContext::hangon() { - STACK_CHECK; -hangonloop: - push(cx); - vsync(); - cx = pop(); - if (--cx) - goto hangonloop; -} - void DreamGenContext::loadtraveltext() { STACK_CHECK; dx = 2234; @@ -17521,7 +17464,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_worktoscreenm: worktoscreenm(); break; case addr_blank: blank(); break; case addr_allpointer: allpointer(); break; - case addr_hangonp: hangonp(); break; case addr_hangonw: hangonw(); break; case addr_hangoncurs: hangoncurs(); break; case addr_getunderzoom: getunderzoom(); break; @@ -17533,7 +17475,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_readkey: readkey(); break; case addr_randomnum1: randomnum1(); break; case addr_randomnum2: randomnum2(); break; - case addr_hangon: hangon(); break; case addr_loadtraveltext: loadtraveltext(); break; case addr_loadintotemp: loadintotemp(); break; case addr_loadintotemp2: loadintotemp2(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index 34c2ed9c5c..6db6f73048 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -74,7 +74,6 @@ public: static const uint16 addr_loadintotemp2 = 0xcb1c; static const uint16 addr_loadintotemp = 0xcb18; static const uint16 addr_loadtraveltext = 0xcb14; - static const uint16 addr_hangon = 0xcb10; static const uint16 addr_randomnum2 = 0xcb08; static const uint16 addr_randomnum1 = 0xcb04; static const uint16 addr_readkey = 0xcafc; @@ -86,7 +85,6 @@ public: static const uint16 addr_getunderzoom = 0xcab4; static const uint16 addr_hangoncurs = 0xcab0; static const uint16 addr_hangonw = 0xcaac; - static const uint16 addr_hangonp = 0xcaa8; static const uint16 addr_allpointer = 0xcaa4; static const uint16 addr_blank = 0xcaa0; static const uint16 addr_worktoscreenm = 0xca9c; @@ -1713,7 +1711,7 @@ public: void initialinv(); void quitsymbol(); //void modifychar(); - void hangon(); + //void initman(); void settopright(); void findsetobject(); void singlekey(); @@ -1832,7 +1830,7 @@ public: void read(); void fadescreenups(); //void checkdest(); - //void initman(); + //void hangon(); void loadpalfromiff(); //void facerightway(); void startup1(); @@ -1959,7 +1957,7 @@ public: void parser(); void hangonw(); void intro(); - void hangonp(); + //void hangonp(); void fadescreendowns(); void openhoteldoor2(); void getridoftempsp(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index a481bb2979..60bd317a2b 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -145,8 +145,7 @@ void DreamGenContext::dreamweb() { // "endofgame" clearbeforeload(); fadescreendowns(); - cx = 200; - hangon(); + hangon(200); endgame(); quickquit2(); return; @@ -186,8 +185,7 @@ void DreamGenContext::dreamweb() { clearbeforeload(); showgun(); fadescreendown(); - cx = 100; - hangon(); + hangon(100); } } @@ -1855,5 +1853,51 @@ void DreamGenContext::fillryan() { showryanpage(); } +void DreamGenContext::hangon() { + hangon(cx); +} + +void DreamGenContext::hangon(uint16 frameCount) { + while (frameCount) { + vsync(); + --frameCount; + } +} + +void DreamGenContext::hangonp() { + hangonp(cx); +} + +void DreamGenContext::hangonp(uint16 count) { + data.word(kMaintimer) = 0; + uint8 pointerFrame = data.byte(kPointerframe); + uint8 pickup = data.byte(kPickup); + data.byte(kPointermode) = 3; + data.byte(kPickup) = 0; + data.byte(kCommandtype) = 255; + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + for (size_t i = 0; i < count * 3; ++i) { + delpointer(); + readmouse(); + animpointer(); + showpointer(); + vsync(); + dumppointer(); + if (data.word(kMousebutton) == 0) + continue; + if (data.word(kMousebutton) != data.word(kOldbutton)) + break; + } + + delpointer(); + data.byte(kPointerframe) = pointerFrame; + data.byte(kPickup) = pickup; + data.byte(kPointermode) = 0; +} + } /*namespace dreamgen */ diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index fc92e5744f..943d890afa 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -231,4 +231,9 @@ void findallryan(uint8 *inv); void fillryan(); void useroutine(); + void hangon(); + void hangon(uint16 frameCount); + void hangonp(); + void hangonp(uint16 count); + diff --git a/engines/dreamweb/use.cpp b/engines/dreamweb/use.cpp index 237c8d4fad..194aed461d 100644 --- a/engines/dreamweb/use.cpp +++ b/engines/dreamweb/use.cpp @@ -144,8 +144,7 @@ void DreamGenContext::useroutine() { al = es.byte(si); if (al != 0) { usetext(); - cx = 400; - hangonp(); + hangonp(400); putbackobstuff(); return; } @@ -159,8 +158,7 @@ void DreamGenContext::useroutine() { obicons(); printmessage(33, 100, 63, 241, true); worktoscreenm(); - cx = 50; - hangonp(); + hangonp(50); putbackobstuff(); data.byte(kCommandtype) = 255; } |