[Scummvm-cvs-logs] scummvm master -> 428beb7f34e1a64a10f24c4259731351e30e3d93

tramboi bertrand_augereau at yahoo.fr
Sun Nov 20 12:47:54 CET 2011


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
428beb7f34 DREAMWEB: 'randomaccess' ported to C++


Commit: 428beb7f34e1a64a10f24c4259731351e30e3d93
    https://github.com/scummvm/scummvm/commit/428beb7f34e1a64a10f24c4259731351e30e3d93
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-11-20T05:45:37-08:00

Commit Message:
DREAMWEB: 'randomaccess' ported to C++

Changed paths:
    devtools/tasmrecover/tasm-recover
    engines/dreamweb/dreamgen.cpp
    engines/dreamweb/dreamgen.h
    engines/dreamweb/monitor.cpp
    engines/dreamweb/stubs.h



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 49b4afd..4952bba 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -250,6 +250,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'showcurrentfile',
 	'input',
 	'monprint',
+	'randomaccess',
 	'accesslighton',
 	'accesslightoff',
 	], skip_output = [
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 2a9b64a..88917ec 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 fd3fc3f..ea86f82 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 f8ad127..a5eb067 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 893fa68..f587227 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();
+
 






More information about the Scummvm-git-logs mailing list