[Scummvm-cvs-logs] scummvm master -> ab41e41b0f5aed647cc7b4fc9727711b260e978f

tramboi bertrand_augereau at yahoo.fr
Tue Nov 22 16:14:51 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:
ab41e41b0f DREAMWEB: 'playchannel0' and 'playchannel1' ported to C++


Commit: ab41e41b0f5aed647cc7b4fc9727711b260e978f
    https://github.com/scummvm/scummvm/commit/ab41e41b0f5aed647cc7b4fc9727711b260e978f
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-11-22T06:36:46-08:00

Commit Message:
DREAMWEB: 'playchannel0' and 'playchannel1' ported to C++

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 647b080..2b4fbb2 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -266,6 +266,8 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'powerlightoff',
 	'accesslighton',
 	'accesslightoff',
+	'playchannel0',
+	'playchannel1',
 	'createpanel',
 	'createpanel2',
 	], skip_output = [
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index d685617..65f002b 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -11831,98 +11831,6 @@ soundfail:
 	deallocatemem();
 }
 
-void DreamGenContext::playchannel0() {
-	STACK_CHECK;
-	_cmp(data.byte(kSoundint), 255);
-	if (flags.z())
-		return /* (dontbother4) */;
-	push(es);
-	push(ds);
-	push(bx);
-	push(cx);
-	push(di);
-	push(si);
-	data.byte(kCh0playing) = al;
-	es = data.word(kSounddata);
-	_cmp(al, 12);
-	if (flags.c())
-		goto notsecondbank;
-	es = data.word(kSounddata2);
-	_sub(al, 12);
-notsecondbank:
-	data.byte(kCh0repeat) = ah;
-	ah = 0;
-	_add(ax, ax);
-	bx = ax;
-	_add(ax, ax);
-	_add(bx, ax);
-	al = es.byte(bx);
-	ah = 0;
-	data.word(kCh0emmpage) = ax;
-	ax = es.word(bx+1);
-	data.word(kCh0offset) = ax;
-	ax = es.word(bx+3);
-	data.word(kCh0blockstocopy) = ax;
-	_cmp(data.byte(kCh0repeat), 0);
-	if (flags.z())
-		goto nosetloop;
-	ax = data.word(kCh0emmpage);
-	data.word(kCh0oldemmpage) = ax;
-	ax = data.word(kCh0offset);
-	data.word(kCh0oldoffset) = ax;
-	ax = data.word(kCh0blockstocopy);
-	data.word(kCh0oldblockstocopy) = ax;
-nosetloop:
-	si = pop();
-	di = pop();
-	cx = pop();
-	bx = pop();
-	ds = pop();
-	es = pop();
-}
-
-void DreamGenContext::playchannel1() {
-	STACK_CHECK;
-	_cmp(data.byte(kSoundint), 255);
-	if (flags.z())
-		return /* (dontbother5) */;
-	_cmp(data.byte(kCh1playing), 7);
-	if (flags.z())
-		return /* (dontbother5) */;
-	push(es);
-	push(ds);
-	push(bx);
-	push(cx);
-	push(di);
-	push(si);
-	data.byte(kCh1playing) = al;
-	es = data.word(kSounddata);
-	_cmp(al, 12);
-	if (flags.c())
-		goto notsecondbank1;
-	es = data.word(kSounddata2);
-	_sub(al, 12);
-notsecondbank1:
-	ah = 0;
-	_add(ax, ax);
-	bx = ax;
-	_add(ax, ax);
-	_add(bx, ax);
-	al = es.byte(bx);
-	ah = 0;
-	data.word(kCh1emmpage) = ax;
-	ax = es.word(bx+1);
-	data.word(kCh1offset) = ax;
-	ax = es.word(bx+3);
-	data.word(kCh1blockstocopy) = ax;
-	si = pop();
-	di = pop();
-	cx = pop();
-	bx = pop();
-	ds = pop();
-	es = pop();
-}
-
 void DreamGenContext::volumeadjust() {
 	STACK_CHECK;
 	al = data.byte(kVolumedirection);
@@ -15109,8 +15017,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_interupttest: interupttest(); break;
 		case addr_soundend: soundend(); break;
 		case addr_out22c: out22c(); break;
-		case addr_playchannel0: playchannel0(); break;
-		case addr_playchannel1: playchannel1(); break;
 		case addr_volumeadjust: volumeadjust(); break;
 		case addr_channel0only: channel0only(); break;
 		case addr_channel1only: channel1only(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index 468e0a2..6317361 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -129,8 +129,6 @@ public:
 	static const uint16 addr_channel1only = 0xc91c;
 	static const uint16 addr_channel0only = 0xc918;
 	static const uint16 addr_volumeadjust = 0xc908;
-	static const uint16 addr_playchannel1 = 0xc900;
-	static const uint16 addr_playchannel0 = 0xc8fc;
 	static const uint16 addr_out22c = 0xc8f8;
 	static const uint16 addr_soundend = 0xc8f4;
 	static const uint16 addr_interupttest = 0xc8f0;
@@ -1516,8 +1514,8 @@ public:
 	void rollendcredits();
 	void intro1text();
 	void transfertoex();
-	void playchannel1();
-	void playchannel0();
+	//void playchannel1();
+	//void playchannel0();
 	//void usemon();
 	void steady();
 	//void pixelcheckset();
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 5ee27e1..668e388 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -2203,14 +2203,60 @@ Frame * DreamGenContext::tempGraphics3() {
 	return (Frame *)segRef(data.word(kTempgraphics3)).ptr(0, 0);
 }
 
-void DreamGenContext::playchannel0(uint8 index) {
-	al = index;
-	playchannel0();
+void DreamGenContext::playchannel0(uint8 index, uint8 repeat) {
+	if (data.byte(kSoundint) == 255)
+		return;
+	push(es);
+	push(bx);
+	data.byte(kCh0playing) = index;
+	if (index >= 12) {
+		es = data.word(kSounddata2);
+		index -= 12;
+	} else
+		es = data.word(kSounddata);
+
+	data.byte(kCh0repeat) = repeat;
+	bx = index * 6;
+	data.word(kCh0emmpage) = es.byte(bx);
+	data.word(kCh0offset) = es.word(bx+1);
+	data.word(kCh0blockstocopy) = es.word(bx+3);
+	if (repeat) {
+		data.word(kCh0oldemmpage) = data.word(kCh0emmpage);
+		data.word(kCh0oldoffset) = data.word(kCh0offset);
+		data.word(kCh0oldblockstocopy) = data.word(kCh0blockstocopy);
+	}
+	bx = pop();
+	es = pop();
+}
+
+void DreamGenContext::playchannel0() {
+	playchannel0(al, ah);
 }
 
 void DreamGenContext::playchannel1(uint8 index) {
-	al = index;
-	playchannel1();
+	if (data.byte(kSoundint) == 255)
+		return;
+	if (data.byte(kCh1playing) == 7)
+		return;
+	push(es);
+	push(bx);
+	data.byte(kCh1playing) = index;
+	if (index >= 12) {
+		es = data.word(kSounddata2);
+		index -= 12;
+	} else
+		es = data.word(kSounddata);
+
+	bx = index * 6;
+	data.word(kCh1emmpage) = es.byte(bx);
+	data.word(kCh1offset) = es.word(bx+1);
+	data.word(kCh1blockstocopy) = es.word(bx+3);
+	bx = pop();
+	es = pop();
+}
+
+void DreamGenContext::playchannel1() {
+	playchannel1(al);
 }
 
 } /*namespace dreamgen */
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index ba44970..f9bd62d 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -322,7 +322,9 @@
 	void turnonpower();
 	void powerlighton();
 	void powerlightoff();
-	void playchannel0(uint8 index);
+	void playchannel0();
+	void playchannel0(uint8 index, uint8 repeat);
+	void playchannel1();
 	void playchannel1(uint8 index);
 	void showmainops();
 	void createpanel();






More information about the Scummvm-git-logs mailing list