[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.533,1.534 vga.cpp,1.148,1.149

kirben kirben at users.sourceforge.net
Fri Nov 11 01:06:02 CET 2005


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3500/simon

Modified Files:
	simon.cpp vga.cpp 
Log Message:

Cleanup.


Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.533
retrieving revision 1.534
diff -u -d -r1.533 -r1.534
--- simon.cpp	11 Nov 2005 08:49:58 -0000	1.533
+++ simon.cpp	11 Nov 2005 09:05:19 -0000	1.534
@@ -1979,8 +1979,8 @@
 		ha->unk3 = 1;
 
 		// Simon1 specific
-		o_kill_sprite_simon1(0x80);
-		loadSprite(0, 1, 0x80, 0, 0, 0xE);
+		o_kill_sprite_simon1(128);
+		loadSprite(0, 1, 128, 0, 0, 14);
 	} else {
 		ha->x = 227;
 		ha->y = 162;
@@ -2021,9 +2021,9 @@
 	_lockWord |= 0x8000;
 
 	if (_game & GF_SIMON2)
-		color = 0xec;
+		color = 236;
 	else
-		color = 0xe1;
+		color = 225;
 
 	uint limit = (_game & GF_SIMON2) ? 200 : 134;
 
@@ -2057,7 +2057,7 @@
 
 				x_ = (ha->width / 2) - 4 + ha->x - (_scrollX * 8);
 
-				if (x_ >= 0x137)
+				if (x_ >= 311)
 					continue;
 
 				dst = dx_lock_attached();
@@ -2877,7 +2877,7 @@
 
 	_scrollX += _scrollFlag;
 
-	vc_write_var(0xfB, _scrollX);
+	vc_write_var(251, _scrollX);
 
 	_scrollFlag = 0;
 }
@@ -3105,7 +3105,7 @@
 		p = (const uint16 *)_pathFindArray[20 - i];
 		if (!p)
 			continue;
-		for (j = 0; readUint16Wrapper(&p[0]) != end; j++, p += 2) {	// 0xE703 = byteswapped 999
+		for (j = 0; readUint16Wrapper(&p[0]) != end; j++, p += 2) {
 			x_diff = abs((int)(readUint16Wrapper(&p[0]) - x));
 			y_diff = abs((int)(readUint16Wrapper(&p[1]) - 12 - y));
 
@@ -3166,7 +3166,7 @@
 
 // ok
 void SimonEngine::fcs_unk_5(FillOrCopyStruct *fcs, uint fcs_index) {
-	o_kill_sprite_simon1(0x80);
+	o_kill_sprite_simon1(128);
 }
 
 void SimonEngine::delete_hitarea_by_index(uint index) {
@@ -3201,7 +3201,7 @@
 		dx_copy_rgn_from_3_to_2(fcs->y + fcs->height * 8 + ((fcs == _windowArray[2]) ? 1 : 0), (fcs->x + fcs->width) * 8, fcs->y, fcs->x * 8);
 	} else {
 		if (_vgaVar6 && _windowArray[2] == fcs) {
-			fcs = _windowArray[0x18 / 4];
+			fcs = _windowArray[6];
 			_vgaVar6 = 0;
 		}
 

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.148
retrieving revision 1.149
diff -u -d -r1.148 -r1.149
--- vga.cpp	11 Nov 2005 02:56:36 -0000	1.148
+++ vga.cpp	11 Nov 2005 09:05:19 -0000	1.149
@@ -655,6 +655,7 @@
 void SimonEngine::vc10_draw() {
 	byte *p2;
 	uint width, height;
+	uint maxWidth, maxHeight;
 	byte flags;
 	const uint16 *vlut;
 	VC10_state state;
@@ -665,7 +666,11 @@
 	if (state.image == 0)
 		return;
 
-	state.palette = (_vcPtr[1] << 4);
+	if (_game == GAME_FEEBLEFILES) {
+		state.palette = (_vcPtr[0] * 16);
+	} else {
+		state.palette = (_vcPtr[1] * 16);
+	}
 	_vcPtr += 2;
 	state.x = (int16)vc_read_next_word();
 
@@ -674,7 +679,7 @@
 	}
 	state.y = (int16)vc_read_next_word();
 
-	if (!(_game & GF_SIMON2)) {
+	if (_game & GF_SIMON1) {
 		state.flags = vc_read_next_word();
 	} else {
 		state.flags = vc_read_next_byte();
@@ -693,7 +698,7 @@
 		flags = p2[5];
 	} else {
 		state.depack_src = _curVgaFile2 + READ_BE_UINT32(p2);
-		width = READ_BE_UINT16(p2 + 6) >> 4;
+		width = READ_BE_UINT16(p2 + 6) / 16;
 		height = p2[5];
 		flags = p2[4];
 	}
@@ -717,8 +722,8 @@
 		}
 	}
 
-	uint maxWidth = (_game == GAME_FEEBLEFILES) ? 641 : 21;
-	if (_game & GF_SIMON2 && width >= maxWidth) {
+	maxWidth = (_game == GAME_FEEBLEFILES) ? 640 : 20;
+	if (_game & GF_SIMON2 && width > maxWidth) {
 		const byte *src;
 		byte *dst;
 		uint w;
@@ -747,15 +752,17 @@
 		return;
 	}
 
-	if (state.flags & 0x10) {
-		state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
-	} else if (state.flags & 1) {
-		state.depack_src = vc10_flip(state.depack_src, width, height);
+	if (_game != GAME_FEEBLEFILES) {
+		if (state.flags & 0x10) {
+			state.depack_src = vc10_uncompressFlip(state.depack_src, width, height);
+		} else if (state.flags & 1) {
+			state.depack_src = vc10_flip(state.depack_src, width, height);
+		}
 	}
 
 	vlut = &_video_windows[_windowNum * 4];
 
-	state.draw_width = width << 1;	/* cl */
+	state.draw_width = width * 2;	/* cl */
 	state.draw_height = height;	/* ch */
 
 	state.x_skip = 0;							/* colums to skip = bh */
@@ -771,7 +778,8 @@
 	}
 	state.x = cur;
 
-	cur += state.draw_width - (vlut[2] << 1);
+	maxWidth = (_game == GAME_FEEBLEFILES) ? 640 : (vlut[2] * 2);
+	cur += state.draw_width - maxWidth;
 	if (cur > 0) {
 		do {
 			if (!--state.draw_width)
@@ -789,7 +797,8 @@
 	}
 	state.y = cur;
 
-	cur += state.draw_height - vlut[3];
+	maxHeight = (_game == GAME_FEEBLEFILES) ? 480 : vlut[3];
+	cur += state.draw_height - maxHeight;
 	if (cur > 0) {
 		do {
 			if (!--state.draw_height)
@@ -799,7 +808,7 @@
 
 	assert(state.draw_width != 0 && state.draw_height != 0);
 
-	state.draw_width <<= 2;
+	state.draw_width *= 4;
 
 	state.surf2_addr = dx_lock_2();
 	state.surf2_pitch = _dxSurfacePitch;
@@ -828,7 +837,7 @@
 		byte h;
 		uint w;
 
-		state.x_skip <<= 2;
+		state.x_skip *= 4;
 		state.dl = width;
 		state.dh = height;
 
@@ -877,7 +886,7 @@
 		uint h, i;
 
 		if (!(state.flags & 8)) {
-			src = state.depack_src + (width * state.y_skip << 4) + (state.x_skip << 3);
+			src = state.depack_src + (width * state.y_skip * 16) + (state.x_skip * 8);
 			dst = state.surf_addr;
 
 			state.draw_width *= 2;
@@ -912,7 +921,7 @@
 			if (state.flags & 2) {
 				/* no transparency */
 				do {
-					uint count = state.draw_width >> 2;
+					uint count = state.draw_width / 4;
 
 					dst = dst_org;
 					do {
@@ -938,7 +947,7 @@
 			} else {
 				/* transparency */
 				do {
-					uint count = state.draw_width >> 2;
+					uint count = state.draw_width / 4;
 
 					dst = dst_org;
 					do {
@@ -991,7 +1000,7 @@
 			uint w, h;
 			byte *src, *dst, *dst_org;
 
-			state.x_skip <<= 2;				/* reached */
+			state.x_skip *= 4;				/* reached */
 			state.dl = width;
 			state.dh = height;
 
@@ -1006,7 +1015,7 @@
 
 					h = 0;
 					do {
-						dst[0] = (*src >> 4) | state.palette;
+						dst[0] = (*src / 16) | state.palette;
 						dst[1] = (*src & 15) | state.palette;
 						dst += _screenWidth;
 						src++;
@@ -1027,7 +1036,7 @@
 
 					h = 0;
 					do {
-						color = (*src >> 4);
+						color = (*src / 16);
 						if (color)
 							dst[0] = color | state.palette;
 						color = (*src & 15);
@@ -1047,11 +1056,11 @@
 
 			src = state.depack_src + (width * state.y_skip) * 8;
 			dst = state.surf_addr;
-			state.x_skip <<= 2;
+			state.x_skip *= 4;
 			if (state.flags & 2) {
 				do {
 					for (count = 0; count != state.draw_width; count++) {
-						dst[count * 2] = (src[count + state.x_skip] >> 4) | state.palette;
+						dst[count * 2] = (src[count + state.x_skip] / 16) | state.palette;
 						dst[count * 2 + 1] = (src[count + state.x_skip] & 15) | state.palette;
 					}
 					dst += _screenWidth;
@@ -1061,7 +1070,7 @@
 				do {
 					for (count = 0; count != state.draw_width; count++) {
 						byte color;
-						color = (src[count + state.x_skip] >> 4);
+						color = (src[count + state.x_skip] / 16);
 						if (color)
 							dst[count * 2] = color | state.palette;
 						color = (src[count + state.x_skip] & 15);
@@ -1206,7 +1215,7 @@
 void SimonEngine::vc22_setSpritePalette() {
 	uint a = vc_read_next_word();
 	uint b = vc_read_next_word();
-	uint num = a == 0 ? 0x20 : 0x10;
+	uint num = a == 0 ? 32 : 16;
 	uint palSize = 96;
 	byte *palptr, *src;
 
@@ -1215,13 +1224,13 @@
 		palSize = 768;
 	}
 
-	palptr = &_palette[(a << 6)];
+	palptr = &_palette[(a * 64)];
 	src = _curVgaFile1 + 6 + b * palSize;
 
 	do {
-		palptr[0] = src[0] << 2;
-		palptr[1] = src[1] << 2;
-		palptr[2] = src[2] << 2;
+		palptr[0] = src[0] * 4;
+		palptr[1] = src[1] * 4;
+		palptr[2] = src[2] * 4;
 		palptr[3] = 0;
 
 		palptr += 4;
@@ -1312,7 +1321,7 @@
 
 	vsp = _vgaSprites;
 	while (vsp->id) {
-		if ((_game & GF_SIMON1) && vsp->id == 0x80) {
+		if ((_game & GF_SIMON1) && vsp->id == 128) {
 			memcpy(&bak, vsp, sizeof(VgaSprite));
 		}
 		vsp->id = 0;
@@ -1330,7 +1339,7 @@
 
 	vte = _vgaTimerList;
 	while (vte->delay) {
-		if ((_game & GF_SIMON1) && vsp->id == 0x80) {
+		if ((_game & GF_SIMON1) && vsp->id == 128) {
 			vte++;
 		} else {
 			vte2 = vte;
@@ -1341,7 +1350,7 @@
 		}
 	}
 
-	vc_write_var(0xFE, 0);
+	vc_write_var(254, 0);
 
 	_lockWord &= ~8;
 }
@@ -1434,7 +1443,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) + vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
+	if ((_game & GF_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1463,7 +1472,7 @@
 	uint var = vc_read_next_word();
 	int16 value = vc_read_var(var) - vc_read_next_word();
 
-	if ((_game & GF_SIMON2) && var == 0xF && !(_bitArray[5] & 1)) {
+	if ((_game & GF_SIMON2) && var == 15 && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_scrollCount != 0) {
@@ -1550,8 +1559,8 @@
 		p += step;
 		y1 = readUint16Wrapper(p) - y2;
 
-		vp[0] = y1 >> 1;
-		vp[1] = y1 - (y1 >> 1);
+		vp[0] = y1 / 2;
+		vp[1] = y1 - (y1 / 2);
 
 		vp += 2;
 	} while (--c);





More information about the Scummvm-git-logs mailing list