aboutsummaryrefslogtreecommitdiff
path: root/engines/dreamweb
diff options
context:
space:
mode:
authorBertrand Augereau2011-11-20 14:25:32 +0100
committerBertrand Augereau2011-11-20 14:45:37 +0100
commit428beb7f34e1a64a10f24c4259731351e30e3d93 (patch)
tree1d94a82c930ee4751a973f0ce015cd7b468f3a22 /engines/dreamweb
parent7190f1374e1a905af91a7cda10f8ef1771263698 (diff)
downloadscummvm-rg350-428beb7f34e1a64a10f24c4259731351e30e3d93.tar.gz
scummvm-rg350-428beb7f34e1a64a10f24c4259731351e30e3d93.tar.bz2
scummvm-rg350-428beb7f34e1a64a10f24c4259731351e30e3d93.zip
DREAMWEB: 'randomaccess' ported to C++
Diffstat (limited to 'engines/dreamweb')
-rw-r--r--engines/dreamweb/dreamgen.cpp23
-rw-r--r--engines/dreamweb/dreamgen.h3
-rw-r--r--engines/dreamweb/monitor.cpp17
-rw-r--r--engines/dreamweb/stubs.h3
4 files changed, 21 insertions, 25 deletions
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 2a9b64a757..88917ec7a5 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -6096,28 +6096,6 @@ powerloop:
powerlighton();
}
-void DreamGenContext::randomaccess() {
- STACK_CHECK;
-accessloop:
- push(cx);
- vsync();
- vsync();
- randomnum1();
- _and(al, 15);
- _cmp(al, 10);
- if (flags.c())
- goto off;
- accesslighton();
- goto chosenaccess;
-off:
- accesslightoff();
-chosenaccess:
- cx = pop();
- if (--cx)
- goto accessloop;
- accesslightoff();
-}
-
void DreamGenContext::powerlighton() {
STACK_CHECK;
di = 257+4;
@@ -15196,7 +15174,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
case addr_loadcart: loadcart(); break;
case addr_lookininterface: lookininterface(); break;
case addr_turnonpower: turnonpower(); break;
- case addr_randomaccess: randomaccess(); break;
case addr_powerlighton: powerlighton(); break;
case addr_powerlightoff: powerlightoff(); break;
case addr_locklighton: locklighton(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index fd3fc3fd41..ea86f82c6a 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -362,7 +362,6 @@ public:
static const uint16 addr_locklighton = 0xc518;
static const uint16 addr_powerlightoff = 0xc50c;
static const uint16 addr_powerlighton = 0xc508;
- static const uint16 addr_randomaccess = 0xc504;
static const uint16 addr_turnonpower = 0xc500;
static const uint16 addr_lookininterface = 0xc4fc;
static const uint16 addr_loadcart = 0xc4f8;
@@ -1837,7 +1836,7 @@ public:
void openforsave();
void closefile();
//void delcurs();
- void randomaccess();
+ //void randomaccess();
//void calcfrframe();
//void checkifex();
//void findobname();
diff --git a/engines/dreamweb/monitor.cpp b/engines/dreamweb/monitor.cpp
index f8ad1270d5..a5eb06773d 100644
--- a/engines/dreamweb/monitor.cpp
+++ b/engines/dreamweb/monitor.cpp
@@ -215,5 +215,22 @@ void DreamGenContext::accesslightoff() {
multidump(74, 182, 12, 8);
}
+void DreamGenContext::randomaccess() {
+ randomaccess(cx);
+}
+
+void DreamGenContext::randomaccess(uint16 count) {
+ for (uint16 i = 0; i < count; ++i) {
+ vsync();
+ vsync();
+ uint16 v = engine->randomNumber() & 15;
+ if (v < 10)
+ accesslightoff();
+ else
+ accesslighton();
+ }
+ accesslightoff();
+}
+
} /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 893fa68889..f587227541 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -310,4 +310,7 @@
Frame *tempGraphics3();
void accesslighton();
void accesslightoff();
+ void randomaccess(uint16 count);
+ void randomaccess();
+