diff options
author | Bertrand Augereau | 2011-08-25 07:50:35 +0200 |
---|---|---|
committer | Bertrand Augereau | 2011-08-25 07:58:05 +0200 |
commit | 24afa11b352ac4012e25426c3a3858e192fb1299 (patch) | |
tree | 4526ce7f7aca43d7db257730d8629ace1a497f4b /engines | |
parent | 0baa0afb38e018a2d80db759f584fd184fb7478d (diff) | |
download | scummvm-rg350-24afa11b352ac4012e25426c3a3858e192fb1299.tar.gz scummvm-rg350-24afa11b352ac4012e25426c3a3858e192fb1299.tar.bz2 scummvm-rg350-24afa11b352ac4012e25426c3a3858e192fb1299.zip |
DREAMWEB: All readmouse flavours ported to C++
Diffstat (limited to 'engines')
-rw-r--r-- | engines/dreamweb/dreamgen.cpp | 73 | ||||
-rw-r--r-- | engines/dreamweb/dreamgen.h | 37 | ||||
-rw-r--r-- | engines/dreamweb/stubs.cpp | 53 | ||||
-rw-r--r-- | engines/dreamweb/stubs.h | 5 |
4 files changed, 73 insertions, 95 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp index 01de5fc7a8..aab390748d 100644 --- a/engines/dreamweb/dreamgen.cpp +++ b/engines/dreamweb/dreamgen.cpp @@ -16352,74 +16352,6 @@ _tmp1: multiget(); } -void DreamGenContext::readmouse() { - STACK_CHECK; - ax = data.word(kMousebutton); - data.word(kOldbutton) = ax; - ax = data.word(kMousex); - data.word(kOldx) = ax; - ax = data.word(kMousey); - data.word(kOldy) = ax; - mousecall(); - data.word(kMousex) = cx; - data.word(kMousey) = dx; - data.word(kMousebutton) = bx; -} - -void DreamGenContext::readmouse1() { - STACK_CHECK; - ax = data.word(kMousex); - data.word(kOldx) = ax; - ax = data.word(kMousey); - data.word(kOldy) = ax; - mousecall(); - data.word(kMousex) = cx; - data.word(kMousey) = dx; - data.word(kMousebutton1) = bx; -} - -void DreamGenContext::readmouse2() { - STACK_CHECK; - ax = data.word(kMousex); - data.word(kOldx) = ax; - ax = data.word(kMousey); - data.word(kOldy) = ax; - mousecall(); - data.word(kMousex) = cx; - data.word(kMousey) = dx; - data.word(kMousebutton2) = bx; -} - -void DreamGenContext::readmouse3() { - STACK_CHECK; - ax = data.word(kMousex); - data.word(kOldx) = ax; - ax = data.word(kMousey); - data.word(kOldy) = ax; - mousecall(); - data.word(kMousex) = cx; - data.word(kMousey) = dx; - data.word(kMousebutton3) = bx; -} - -void DreamGenContext::readmouse4() { - STACK_CHECK; - ax = data.word(kMousebutton); - data.word(kOldbutton) = ax; - ax = data.word(kMousex); - data.word(kOldx) = ax; - ax = data.word(kMousey); - data.word(kOldy) = ax; - mousecall(); - data.word(kMousex) = cx; - data.word(kMousey) = dx; - ax = data.word(kMousebutton1); - _or(ax, data.word(kMousebutton2)); - _or(ax, data.word(kMousebutton3)); - _or(bx, ax); - data.word(kMousebutton) = bx; -} - void DreamGenContext::readkey() { STACK_CHECK; bx = data.word(kBufferout); @@ -18615,12 +18547,7 @@ void DreamGenContext::__dispatch_call(uint16 addr) { case addr_putunderzoom: putunderzoom(); break; case addr_undertextline: undertextline(); break; case addr_setmouse: setmouse(); break; - case addr_readmouse: readmouse(); break; case addr_mousecall: mousecall(); break; - case addr_readmouse1: readmouse1(); break; - case addr_readmouse2: readmouse2(); break; - case addr_readmouse3: readmouse3(); break; - case addr_readmouse4: readmouse4(); break; case addr_readkey: readkey(); break; case addr_randomnum1: randomnum1(); break; case addr_randomnum2: randomnum2(); break; diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h index d92ce478d1..2af08a486f 100644 --- a/engines/dreamweb/dreamgen.h +++ b/engines/dreamweb/dreamgen.h @@ -78,12 +78,7 @@ public: static const uint16 addr_randomnum2 = 0xcb08; static const uint16 addr_randomnum1 = 0xcb04; static const uint16 addr_readkey = 0xcafc; - static const uint16 addr_readmouse4 = 0xcaf8; - static const uint16 addr_readmouse3 = 0xcaf4; - static const uint16 addr_readmouse2 = 0xcaf0; - static const uint16 addr_readmouse1 = 0xcaec; static const uint16 addr_mousecall = 0xcae8; - static const uint16 addr_readmouse = 0xcae4; static const uint16 addr_setmouse = 0xcae0; static const uint16 addr_undertextline = 0xcad0; static const uint16 addr_putunderzoom = 0xcabc; @@ -1337,7 +1332,7 @@ public: //void commandonly(); void titles(); void deallocatemem(); - void checkforemm(); + void mainscreen(); void watchreel(); void showfolder(); void turnanypathoff(); @@ -1363,7 +1358,6 @@ public: void usecashcard(); void usewall(); void opentomb(); - //void findobname(); //void makename(); void buttonfour(); void dosometalk(); @@ -1445,6 +1439,7 @@ public: void showbyte(); void useslab(); void dumpzoom(); + //void aboutturn(); void usealtar(); void createpanel2(); void turnonpower(); @@ -1604,7 +1599,7 @@ public: //void showpointer(); void usecooker(); void loadmenu(); - //void aboutturn(); + void checkforemm(); void checkifpathison(); //void finalframe(); void receptionist(); @@ -1624,7 +1619,7 @@ public: void putundermenu(); void checkifex(); void intromagic2(); - void mainscreen(); + void intromagic3(); void edeninbath(); void intromagic1(); void showdiarypage(); @@ -1643,6 +1638,7 @@ public: void talk(); void usedryer(); void dumpeverything(); + //void readmouse2(); //void zoom(); void outofinv(); void viewfolder(); @@ -1654,7 +1650,7 @@ public: void obicons(); void mansatstill(); void channel1only(); - void playguitar(); + void checkbasemem(); void lastfolder(); void transfermap(); //void showreelframe(); @@ -1690,7 +1686,7 @@ public: void makeheader(); void setkeyboardint(); void priest(); - void readmouse(); + //void readmouse(); void powerlighton(); void savefilewrite(); void printmessage2(); @@ -1711,7 +1707,7 @@ public: void wheelsound(); void actualsave(); void autolook(); - void checkbasemem(); + void playguitar(); void transfertext(); void searchforsame(); void showmainops(); @@ -1892,11 +1888,11 @@ public: void usegun(); void autoappear(); void findnextcolon(); - void readmouse4(); + //void readmouse4(); void openryan(); - void readmouse1(); - void readmouse3(); - void readmouse2(); + void callhotellift(); + void showman(); + void usefullcart(); void newplace(); //void movemap(); void loadsample(); @@ -1932,13 +1928,12 @@ public: void keeper(); void afternewroom(); void getexad(); - void aide(); void openforsave(); void closefile(); void delcurs(); void randomaccess(); void splitintolines(); - void intromagic3(); + //void findobname(); void initialmoncols(); void checkforshake(); void usebuttona(); @@ -1966,15 +1961,15 @@ public: //void channel0tran(); void buttonpress(); //void parseblaster(); - void callhotellift(); + //void readmouse1(); void makemainscreen(); void intromonks2(); void usewinch(); void setbotright(); - void showman(); + //void readmouse3(); void showfirstuse(); void setupemm(); - void usefullcart(); + void aide(); //void getmapad(); void getlocation(); void geteitherad(); diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp index 5f058a5190..9b85cbb9f4 100644 --- a/engines/dreamweb/stubs.cpp +++ b/engines/dreamweb/stubs.cpp @@ -290,7 +290,58 @@ void DreamGenContext::mousecall() { cx = x; dx = y; bx = state; - flags._c = false; +} + +void DreamGenContext::readmouse() { + data.word(kOldbutton) = data.word(kMousebutton); + data.word(kOldx) = data.word(kMousex); + data.word(kOldy) = data.word(kMousey); + uint16 x, y, state; + engine->mouseCall(&x, &y, &state); + data.word(kMousex) = x; + data.word(kMousey) = y; + data.word(kMousebutton) = state; +} + +void DreamGenContext::readmouse1() { + data.word(kOldx) = data.word(kMousex); + data.word(kOldy) = data.word(kMousey); + uint16 x, y, state; + engine->mouseCall(&x, &y, &state); + data.word(kMousex) = x; + data.word(kMousey) = y; + data.word(kMousebutton1) = state; +} + +void DreamGenContext::readmouse2() { + data.word(kOldx) = data.word(kMousex); + data.word(kOldy) = data.word(kMousey); + uint16 x, y, state; + engine->mouseCall(&x, &y, &state); + data.word(kMousex) = x; + data.word(kMousey) = y; + data.word(kMousebutton2) = state; +} + +void DreamGenContext::readmouse3() { + data.word(kOldx) = data.word(kMousex); + data.word(kOldy) = data.word(kMousey); + uint16 x, y, state; + engine->mouseCall(&x, &y, &state); + data.word(kMousex) = x; + data.word(kMousey) = y; + data.word(kMousebutton3) = state; +} + +void DreamGenContext::readmouse4() { + data.word(kOldbutton) = data.word(kMousebutton); + data.word(kOldx) = data.word(kMousex); + data.word(kOldy) = data.word(kMousey); + uint16 x, y, state; + engine->mouseCall(&x, &y, &state); + data.word(kMousex) = x; + data.word(kMousey) = y; + data.word(kMousebutton) = state | data.word(kMousebutton1) | data.word(kMousebutton2) | data.word(kMousebutton3); } void DreamGenContext::setmouse() { diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h index 0409c3a9cd..df6401323e 100644 --- a/engines/dreamweb/stubs.h +++ b/engines/dreamweb/stubs.h @@ -185,4 +185,9 @@ void animpointer(); void checkcoords(); void checkcoords(const RectWithCallback *rectWithCallbacks); + void readmouse(); + void readmouse1(); + void readmouse2(); + void readmouse3(); + void readmouse4(); |