[Scummvm-cvs-logs] scummvm master -> 21d3062d52bd5b10d30bdde412329ab4f4d0b8dd

tramboi bertrand_augereau at yahoo.fr
Thu Nov 17 17:08:13 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:
21d3062d52 DREAMWEB: 'loadpalfromiff' ported to C++


Commit: 21d3062d52bd5b10d30bdde412329ab4f4d0b8dd
    https://github.com/scummvm/scummvm/commit/21d3062d52bd5b10d30bdde412329ab4f4d0b8dd
Author: Bertrand Augereau (bertrand_augereau at yahoo.fr)
Date: 2011-11-17T08:05:52-08:00

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

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



diff --git a/devtools/tasmrecover/tasm-recover b/devtools/tasmrecover/tasm-recover
index 709efab..dd271de 100755
--- a/devtools/tasmrecover/tasm-recover
+++ b/devtools/tasmrecover/tasm-recover
@@ -67,6 +67,7 @@ generator = cpp(context, "DreamGen", blacklist = [
 	'eraseoldobs',
 	'oldtonames',
 	'namestoold',
+	'loadpalfromiff',
 	'clearsprites',
 	'makesprite',
 	'showframe',
diff --git a/engines/dreamweb/dreamgen.cpp b/engines/dreamweb/dreamgen.cpp
index 073e7c2..11bfc07 100644
--- a/engines/dreamweb/dreamgen.cpp
+++ b/engines/dreamweb/dreamgen.cpp
@@ -2232,45 +2232,6 @@ bigroom:
 	_add(data.byte(kMapysize), 8);
 }
 
-void DreamGenContext::loadpalfromiff() {
-	STACK_CHECK;
-	dx = 2481;
-	openfile();
-	cx = 2000;
-	ds = data.word(kMapstore);
-	dx = 0;
-	readfromfile();
-	closefile();
-	es = data.word(kBuffers);
-	di = (0+(228*13)+32+60+(32*32)+(11*10*3)+768+768);
-	ds = data.word(kMapstore);
-	si = 0x30;
-	cx = 768;
-palloop:
-	_lodsb();
-	_shr(al, 1);
-	_shr(al, 1);
-	_cmp(data.byte(kBrightness), 1);
-	if (!flags.z())
-		goto nought;
-	_cmp(al, 0);
-	if (flags.z())
-		goto nought;
-	ah = al;
-	_shr(ah, 1);
-	_add(al, ah);
-	_shr(ah, 1);
-	_add(al, ah);
-	_cmp(al, 64);
-	if (flags.c())
-		goto nought;
-	al = 63;
-nought:
-	_stosb();
-	if (--cx)
-		goto palloop;
-}
-
 void DreamGenContext::createpanel() {
 	STACK_CHECK;
 	di = 0;
@@ -15699,7 +15660,6 @@ void DreamGenContext::__dispatch_call(uint16 addr) {
 		case addr_reconstruct: reconstruct(); break;
 		case addr_deleverything: deleverything(); break;
 		case addr_showpcx: showpcx(); break;
-		case addr_loadpalfromiff: loadpalfromiff(); break;
 		case addr_setmode: setmode(); break;
 		case addr_createpanel: createpanel(); break;
 		case addr_createpanel2: createpanel2(); break;
diff --git a/engines/dreamweb/dreamgen.h b/engines/dreamweb/dreamgen.h
index f031fd6..4f1eeac 100644
--- a/engines/dreamweb/dreamgen.h
+++ b/engines/dreamweb/dreamgen.h
@@ -511,7 +511,6 @@ public:
 	static const uint16 addr_createpanel2 = 0xc200;
 	static const uint16 addr_createpanel = 0xc1fc;
 	static const uint16 addr_setmode = 0xc1dc;
-	static const uint16 addr_loadpalfromiff = 0xc1d8;
 	static const uint16 addr_showpcx = 0xc1cc;
 	static const uint16 addr_deleverything = 0xc1c0;
 	static const uint16 addr_reconstruct = 0xc1ac;
@@ -1792,7 +1791,7 @@ public:
 	void fadescreenups();
 	//void checkdest();
 	//void hangon();
-	void loadpalfromiff();
+	//void loadpalfromiff();
 	//void facerightway();
 	void startup1();
 	void hotelcontrol();
diff --git a/engines/dreamweb/stubs.h b/engines/dreamweb/stubs.h
index 8769716..2906833 100644
--- a/engines/dreamweb/stubs.h
+++ b/engines/dreamweb/stubs.h
@@ -64,6 +64,7 @@
 	uint8 kernchars(uint8 firstChar, uint8 secondChar, uint8 width);
 	void oldtonames();
 	void namestoold();
+	void loadpalfromiff();
 	void getroomdata();
 	Room *getroomdata(uint8 room);
 	void readheader();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 53db811..11ba45f 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -464,5 +464,29 @@ bool DreamGenContext::pixelcheckset(const ObjPos *pos, uint8 x, uint8 y) {
 	return *ptr != 0;
 }
 
+void DreamGenContext::loadpalfromiff() {
+	dx = kPalettescreen;
+	openfile();
+	cx = 2000;
+	ds = data.word(kMapstore);
+	dx = 0;
+	readfromfile();
+	closefile();
+
+	const uint8 *src = segRef(data.word(kMapstore)).ptr(0x30, 0);
+	uint8 *dst = mainPalette();
+	for (size_t i = 0; i < 256*3; ++i) {
+		uint8 c = src[i] / 4;
+		if (data.byte(kBrightness) == 1) {
+			if (c) {
+				c = c + c / 2 + c / 4;
+				if (c > 63)
+					c = 63;
+			}
+		}
+		dst[i] = c;
+	}
+}
+
 } /*namespace dreamgen */
 






More information about the Scummvm-git-logs mailing list