[Scummvm-cvs-logs] CVS: scummvm/simon items.cpp,1.118,1.119 simon.cpp,1.492,1.493 simon.h,1.135,1.136 vga.cpp,1.125,1.126 vga.h,1.8,1.9

kirben kirben at users.sourceforge.net
Fri May 6 05:24:56 CEST 2005


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

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

Rename sprite field.
Cleanup.


Index: items.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/items.cpp,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- items.cpp	6 May 2005 11:37:33 -0000	1.118
+++ items.cpp	6 May 2005 12:23:16 -0000	1.119
@@ -527,27 +527,24 @@
 			break;
 
 		case 98:{									/* start vga */
-				if (!(_game & GF_SIMON2)) {
-					uint vga_sprite_id = getVarOrWord();
-					uint b = getVarOrByte();
-					uint x = getVarOrWord();
-					uint y = getVarOrWord();
-					uint base_color = getVarOrWord();
-					start_vga_code(b, vga_sprite_id / 100, vga_sprite_id, x, y, base_color);
+				uint vga_res, vgaSpriteId, paletteMode, x, y, base_color;
+				if (_game & GF_SIMON2) {
+					vga_res = getVarOrWord();
+					vgaSpriteId = getVarOrWord();
 				} else {
-					uint vga_res = getVarOrWord();
-					uint vga_sprite_id = getVarOrWord();
-					uint b = getVarOrByte();
-					uint x = getVarOrWord();
-					uint y = getVarOrWord();
-					uint base_color = getVarOrWord();
-					start_vga_code(b, vga_res, vga_sprite_id, x, y, base_color);
+					vgaSpriteId = getVarOrWord();
+					vga_res = vgaSpriteId / 100;
 				}
+				paletteMode = getVarOrByte();
+				x = getVarOrWord();
+				y = getVarOrWord();
+				base_color = getVarOrWord();
+				start_vga_code(paletteMode, vga_res, vgaSpriteId, x, y, base_color);
 			}
 			break;
 
 		case 99:{									/* kill sprite */
-				if (!(_game & GF_SIMON2)) {
+				if (_game & GF_SIMON1) {
 					o_kill_sprite_simon1(getVarOrWord());
 				} else {
 					uint a = getVarOrWord();
@@ -974,20 +971,20 @@
 			break;
 
 		case 179:{									/* conversation responses */
-				uint vga_sprite_id = getVarOrByte();				/* and room descriptions */
+				uint vgaSpriteId = getVarOrByte();				/* and room descriptions */
 				uint color = getVarOrByte();
 				uint string_id = getVarOrByte();
 				uint speech_id = 0;
 
 				const char *string_ptr = (const char *)getStringPtrByID(_stringIdArray3[string_id]);
-				TextLocation *tl = getTextLocation(vga_sprite_id);
+				TextLocation *tl = getTextLocation(vgaSpriteId);
 				if (_game & GF_TALKIE) 
 					speech_id = _speechIdArray4[string_id];
 
 				if (_speech && speech_id != 0)
-					talk_with_speech(speech_id, vga_sprite_id);
+					talk_with_speech(speech_id, vgaSpriteId);
 				if (string_ptr != NULL && _subtitles)
-					talk_with_text(vga_sprite_id, color, string_ptr, tl->x, tl->y, tl->width);
+					talk_with_text(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width);
 			}
 			break;
 
@@ -1052,7 +1049,7 @@
 			break;
 
 		case 188:									/* string2 is */
-			if (!(_game & GF_SIMON2))
+			if (_game & GF_SIMON1)
 				goto invalid_opcode;
 			{
 				uint i = getVarOrByte();
@@ -1062,7 +1059,7 @@
 			break;
 
 		case 189:{									/* clear_op189_flag */
-				if (!(_game & GF_SIMON2))
+				if (_game & GF_SIMON1)
 					goto invalid_opcode;
 				_op189Flags = 0;
 			}
@@ -1070,7 +1067,7 @@
 
 		case 190:{
 				uint i;
-				if (!(_game & GF_SIMON2))
+				if (_game & GF_SIMON1)
 					goto invalid_opcode;
 				i = getVarOrByte();
 				if (!(_op189Flags & (1 << i)))
@@ -1214,7 +1211,7 @@
 }
 
 void SimonEngine::o_inventory_descriptions() {
-	uint vga_sprite_id = getVarOrByte();
+	uint vgaSpriteId = getVarOrByte();
 	uint color = getVarOrByte();
 	const char *string_ptr = NULL;
 	TextLocation *tl = NULL;
@@ -1223,7 +1220,7 @@
 	Child2 *child = (Child2 *)findChildOfType(getNextItemPtr(), 2);
 	if (child != NULL && child->avail_props & 1) {
 		string_ptr = (const char *)getStringPtrByID(child->array[0]);
-		tl = getTextLocation(vga_sprite_id);
+		tl = getTextLocation(vgaSpriteId);
 	}
 
 	if ((_game & GF_SIMON2) && (_game & GF_TALKIE)) {
@@ -1275,16 +1272,16 @@
 			}
 
 			if (_speech)
-				talk_with_speech(speech_id, vga_sprite_id);
+				talk_with_speech(speech_id, vgaSpriteId);
 		}
 
 	} else if (_game & GF_TALKIE) {
 		if (child != NULL && child->avail_props & 0x200) {
 			uint offs = getOffsetOfChild2Param(child, 0x200);
-			talk_with_speech(child->array[offs], vga_sprite_id);
+			talk_with_speech(child->array[offs], vgaSpriteId);
 		} else if (child != NULL && child->avail_props & 0x100) {
 			uint offs = getOffsetOfChild2Param(child, 0x100);
-			talk_with_speech(child->array[offs] + 3550, vga_sprite_id);
+			talk_with_speech(child->array[offs] + 3550, vgaSpriteId);
 		}
 	}
 
@@ -1294,7 +1291,7 @@
 			string_ptr = buf;
 		}
 		if (string_ptr != NULL)
-			talk_with_text(vga_sprite_id, color, string_ptr, tl->x, tl->y, tl->width);
+			talk_with_text(vgaSpriteId, color, string_ptr, tl->x, tl->y, tl->width);
 	}
 }
 

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.492
retrieving revision 1.493
diff -u -d -r1.492 -r1.493
--- simon.cpp	6 May 2005 11:37:33 -0000	1.492
+++ simon.cpp	6 May 2005 12:23:17 -0000	1.493
@@ -2257,7 +2257,7 @@
 }
 
 void SimonEngine::o_print_str() {
-	uint vga_sprite_id = getVarOrByte();
+	uint vgaSpriteId = getVarOrByte();
 	uint color = getVarOrByte();
 	uint string_id = getNextStringID();
 	const byte *string_ptr = NULL;
@@ -2270,15 +2270,15 @@
 	if (_game & GF_TALKIE)
 		speech_id = (uint16)getNextWord();
 
-	tl = getTextLocation(vga_sprite_id);
+	tl = getTextLocation(vgaSpriteId);
 
 	if (_speech && speech_id != 0)
-		talk_with_speech(speech_id, vga_sprite_id);
+		talk_with_speech(speech_id, vgaSpriteId);
 	if ((_game & GF_SIMON2) && (_game & GF_TALKIE) && speech_id == 0)
-		o_kill_sprite_simon2(2, vga_sprite_id + 2);
+		o_kill_sprite_simon2(2, vgaSpriteId + 2);
 
 	if (string_ptr != NULL && (speech_id == 0 || _subtitles))
-		talk_with_text(vga_sprite_id, color, (const char *)string_ptr, tl->x, tl->y, tl->width);
+		talk_with_text(vgaSpriteId, color, (const char *)string_ptr, tl->x, tl->y, tl->width);
 
 }
 
@@ -2746,9 +2746,9 @@
 		params[3] = READ_BE_UINT16(&vsp->y);
 
 		if (_game & GF_SIMON2) {
-			*(byte *)(&params[4]) = (byte)vsp->unk4;
+			*(byte *)(&params[4]) = (byte)vsp->flags;
 		} else {
-			params[4] = READ_BE_UINT16(&vsp->unk4);
+			params[4] = READ_BE_UINT16(&vsp->flags);
 		}
 
 		_vcPtr = (const byte *)params;
@@ -2820,12 +2820,12 @@
 
 		if (vsp->image)
 			fprintf(_dumpFile, "id:%5d image:%3d base-color:%3d x:%3d y:%3d flags:%x\n",
-							vsp->id, vsp->image, vsp->base_color, vsp->x, vsp->y, vsp->unk4);
+							vsp->id, vsp->image, vsp->base_color, vsp->x, vsp->y, vsp->flags);
 		params[0] = READ_BE_UINT16(&vsp->image);
 		params[1] = READ_BE_UINT16(&vsp->base_color);
 		params[2] = READ_BE_UINT16(&vsp->x);
 		params[3] = READ_BE_UINT16(&vsp->y);
-		params[4] = READ_BE_UINT16(&vsp->unk4);
+		params[4] = READ_BE_UINT16(&vsp->flags);
 		_vcPtr = (const byte *)params;
 		vc_10_draw();
 
@@ -3341,7 +3341,7 @@
 	fcs->mode = 0;
 }
 
-void SimonEngine::start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint x, uint y, uint base_color) {
+void SimonEngine::start_vga_code(uint paletteMode, uint vga_res, uint vgaSpriteId, uint x, uint y, uint base_color) {
 	VgaSprite *vsp;
 	VgaPointersEntry *vpe;
 	byte *p, *pp;
@@ -3349,7 +3349,7 @@
 
 	_lockWord |= 0x40;
 
-	if (has_vga_sprite_with_id(vga_sprite_id, vga_res)) {
+	if (has_vga_sprite_with_id(vgaSpriteId, vga_res)) {
 		_lockWord &= ~0x40;
 		return;
 	}
@@ -3358,17 +3358,17 @@
 	while (vsp->id != 0)
 		vsp++;
 
-	vsp->paletteMode = b;
+	vsp->paletteMode = paletteMode;
 	vsp->priority = 0;
-	vsp->unk4 = 0;
+	vsp->flags = 0;
 
 	vsp->y = y;
 	vsp->x = x;
 	vsp->image = 0;
 	vsp->base_color = base_color;
-	vsp->id = vga_sprite_id;
-	if (!(_game & GF_SIMON2))
-		vsp->unk7 = vga_res = vga_sprite_id / 100;
+	vsp->id = vgaSpriteId;
+	if (_game & GF_SIMON1)
+		vsp->unk7 = vga_res = vgaSpriteId / 100;
 	else
 		vsp->unk7 = vga_res;
 
@@ -3389,12 +3389,12 @@
 	p = pp + READ_BE_UINT16(&((VgaFile1Header2 *) p)->id_table);
 
 	for (;;) {
-		if (READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->id) == vga_sprite_id) {
+		if (READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->id) == vgaSpriteId) {
 
 			if (_startVgaScript)
-				dump_vga_script(pp + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), vga_res, vga_sprite_id);
+				dump_vga_script(pp + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), vga_res, vgaSpriteId);
 
-			add_vga_timer(VGA_DELAY_BASE, pp + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vga_sprite_id, vga_res);
+			add_vga_timer(VGA_DELAY_BASE, pp + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vgaSpriteId, vga_res);
 			break;
 		}
 		p += sizeof(VgaFile1Struct0x6);
@@ -3407,7 +3407,7 @@
 	_lockWord &= ~0x40;
 }
 
-void SimonEngine::talk_with_speech(uint speech_id, uint vga_sprite_id) {
+void SimonEngine::talk_with_speech(uint speech_id, uint vgaSpriteId) {
 	if (!(_game & GF_SIMON2)) {
 		if (speech_id == 9999) {
 			if (_subtitles)
@@ -3425,9 +3425,9 @@
 				o_wait_for_vga(204);
 				o_kill_sprite_simon1(204);
 			}
-			o_kill_sprite_simon1(vga_sprite_id + 201);
+			o_kill_sprite_simon1(vgaSpriteId + 201);
 			_sound->playVoice(speech_id);
-			start_vga_code(4, 2, vga_sprite_id + 201, 0, 0, 0);
+			start_vga_code(4, 2, vgaSpriteId + 201, 0, 0, 0);
 		}
 	} else {
 		if (speech_id == 0xFFFF) {
@@ -3450,14 +3450,14 @@
 				o_kill_sprite_simon2(2,5);
 			}
 
-			o_kill_sprite_simon2(2, vga_sprite_id + 2);
+			o_kill_sprite_simon2(2, vgaSpriteId + 2);
 			_sound->playVoice(speech_id);
-			start_vga_code(4, 2, vga_sprite_id + 2, 0, 0, 0);
+			start_vga_code(4, 2, vgaSpriteId + 2, 0, 0, 0);
 		}
 	}
 }
 
-void SimonEngine::talk_with_text(uint vga_sprite_id, uint color, const char *string, int16 x, int16 y, int16 width) {
+void SimonEngine::talk_with_text(uint vgaSpriteId, uint color, const char *string, int16 x, int16 y, int16 width) {
 	char convertedString[320];
 	char *convertedString2 = convertedString;
 	int16 height, len_div_3;
@@ -3517,15 +3517,15 @@
 	*(convertedString2 - 1) = '\0';
 
 	if (_game & GF_SIMON2)
-		o_kill_sprite_simon2(2, vga_sprite_id);
+		o_kill_sprite_simon2(2, vgaSpriteId);
 	else
-		o_kill_sprite_simon1(vga_sprite_id + 199);
+		o_kill_sprite_simon1(vgaSpriteId + 199);
 
 	color = color * 3 + 192;
 	if (_game & GF_AMIGA)
-		render_string_amiga(vga_sprite_id, color, width, height, convertedString);
+		render_string_amiga(vgaSpriteId, color, width, height, convertedString);
 	else
-		render_string(vga_sprite_id, color, width, height, convertedString);
+		render_string(vgaSpriteId, color, width, height, convertedString);
 		
 	int b = 4;
 	if (!(_bitArray[8] & 0x20))
@@ -3537,9 +3537,9 @@
 		y = 2;
 
 	if (_game & GF_SIMON2)
-		start_vga_code(b, 2, vga_sprite_id, x, y, 12);
+		start_vga_code(b, 2, vgaSpriteId, x, y, 12);
 	else
-		start_vga_code(b, 2, vga_sprite_id + 199, x, y, 12);
+		start_vga_code(b, 2, vgaSpriteId + 199, x, y, 12);
 }
 
 // Thanks to Stuart Caie for providing the original

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -d -r1.135 -r1.136
--- simon.h	6 May 2005 11:37:33 -0000	1.135
+++ simon.h	6 May 2005 12:23:18 -0000	1.136
@@ -79,7 +79,7 @@
 	uint16 image;
 	uint16 base_color;
 	uint16 x, y;									/* actually signed numbers */
-	uint16 unk4;
+	uint16 flags;
 	uint16 priority;
 	uint16 paletteMode, unk7;
 	VgaSprite() { memset(this, 0, sizeof(*this)); }
@@ -588,7 +588,7 @@
 	void ensureVgaResLoadedC(uint vga_res);
 	void ensureVgaResLoaded(uint vga_res);
 
-	void start_vga_code(uint b, uint vga_res, uint vga_sprite_id, uint x, uint y, uint base_color);
+	void start_vga_code(uint paletteMode, uint vga_res, uint vga_sprite_id, uint x, uint y, uint base_color);
 	void o_unk26_helper(uint a, uint b, uint c, uint d, uint e, uint f, uint g, uint h);
 	void talk_with_speech(uint speech_id, uint vga_sprite_id);
 	void talk_with_text(uint vga_sprite_id, uint color, const char *string_ptr, int16 x, int16 y, int16 width);

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.125
retrieving revision 1.126
diff -u -d -r1.125 -r1.126
--- vga.cpp	6 May 2005 11:37:33 -0000	1.125
+++ vga.cpp	6 May 2005 12:23:18 -0000	1.126
@@ -122,7 +122,7 @@
 			}
 		}
 
-		if (!(_game & GF_SIMON2)) {
+		if (_game & GF_SIMON1) {
 			opcode = READ_BE_UINT16(_vcPtr);
 			_vcPtr += 2;
 		} else {
@@ -269,21 +269,21 @@
 }
 
 void SimonEngine::vc_3_new_sprite() {
-	uint16 a, f, base_color, x, y, vga_sprite_id;
+	uint16 paletteMode, vga_res, base_color, x, y, vgaSpriteId;
 	uint16 res;
 	VgaSprite *vsp;
 	VgaPointersEntry *vpe;
 	byte *p, *pp;
 	byte *old_file_1;
 
-	a = vc_read_next_word();			/* 0 */
+	paletteMode = vc_read_next_word();		/* 0 */
 
 	if (_game & GF_SIMON2) {
-		f = vc_read_next_word();		/* 0 */
-		vga_sprite_id = vc_read_next_word();	/* 2 */
+		vga_res = vc_read_next_word();		/* 0 */
+		vgaSpriteId = vc_read_next_word();	/* 2 */
 	} else {
-		vga_sprite_id = vc_read_next_word();	/* 2 */
-		f = vga_sprite_id / 100;
+		vgaSpriteId = vc_read_next_word();	/* 2 */
+		vga_res = vgaSpriteId / 100;
 	}
 
 	x = vc_read_next_word();			/* 4 */
@@ -291,7 +291,7 @@
 	base_color = vc_read_next_word();		/* 8 */
 
 	/* 2nd param ignored with simon1 */
-	if (has_vga_sprite_with_id(vga_sprite_id, f))
+	if (has_vga_sprite_with_id(vgaSpriteId, vga_res))
 		return;
 
 	vsp = _vgaSprites;
@@ -299,14 +299,14 @@
 		vsp++;
 
 	vsp->base_color = base_color;
-	vsp->paletteMode = a;
+	vsp->paletteMode = paletteMode;
 	vsp->priority = 0;
-	vsp->unk4 = 0;
+	vsp->flags = 0;
 	vsp->image = 0;
 	vsp->x = x;
 	vsp->y = y;
-	vsp->id = vga_sprite_id;
-	vsp->unk7 = res = f;
+	vsp->id = vgaSpriteId;
+	vsp->unk7 = res = vga_res;
 
 	old_file_1 = _curVgaFile1;
 	for (;;) {
@@ -326,7 +326,7 @@
 	p = pp + READ_BE_UINT16(&((VgaFile1Header *) pp)->hdr2_start);
 	p = pp + READ_BE_UINT16(&((VgaFile1Header2 *) p)->id_table);
 
-	while (READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->id) != vga_sprite_id)
+	while (READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->id) != vgaSpriteId)
 		p += sizeof(VgaFile1Struct0x6);
 
 #ifdef DUMP_FILE_NR
@@ -350,9 +350,9 @@
 #endif
 
 	if (_startVgaScript)
-		dump_vga_script(_curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), res, vga_sprite_id);
+		dump_vga_script(_curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6*)p)->script_offs), res, vgaSpriteId);
 
-	add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vga_sprite_id, res);
+	add_vga_timer(VGA_DELAY_BASE, _curVgaFile1 + READ_BE_UINT16(&((VgaFile1Struct0x6 *) p)->script_offs), vgaSpriteId, res);
 	_curVgaFile1 = old_file_1;
 }
 
@@ -612,9 +612,9 @@
 	state.y = (int16)vc_read_next_word();
 
 	if (!(_game & GF_SIMON2)) {
-		state.e = vc_read_next_word();
+		state.flags = vc_read_next_word();
 	} else {
-		state.e = vc_read_next_byte();
+		state.flags = vc_read_next_byte();
 	}
 
 	if (state.image < 0)
@@ -634,12 +634,12 @@
 		dump_single_bitmap(_vgaCurFileId, state.image, state.depack_src, width * 16, height,
 											 state.base_color);
 
-	if (flags & 0x80 && !(state.e & 0x10)) {
-		if (state.e & 1) {
-			state.e &= ~1;
-			state.e |= 0x10;
+	if (flags & 0x80 && !(state.flags & 0x10)) {
+		if (state.flags & 1) {
+			state.flags &= ~1;
+			state.flags |= 0x10;
 		} else {
-			state.e |= 0x8;
+			state.flags |= 0x8;
 		}
 	}
 
@@ -672,9 +672,9 @@
 		return;
 	}
 
-	if (state.e & 0x10) {
+	if (state.flags & 0x10) {
 		state.depack_src = vc_10_depack_swap(state.depack_src, width, height);
-	} else if (state.e & 1) {
+	} else if (state.flags & 1) {
 		state.depack_src = vc_10_no_depack_swap(state.depack_src, width, height);
 	}
 
@@ -736,7 +736,7 @@
 		uint offs, offs2;
 		// Allow one section of Simon the Sorcerer 1 introduction to be displayed
 		// in lower half of screen
-		if (!(_game & GF_SIMON2) && _subroutine == 2926) {
+		if ((_game & GF_SIMON1) && _subroutine == 2926) {
 			offs = ((vlut[0]) * 2 + state.x) * 8;
 			offs2 = (vlut[1] + state.y);
 		} else {
@@ -748,7 +748,7 @@
 		state.surf_addr += offs + offs2 * state.surf_pitch;
 	}
 
-	if (state.e & 0x20) {
+	if (state.flags & 0x20) {
 		byte *mask, *src, *dst;
 		byte h;
 		uint w;
@@ -766,7 +766,7 @@
 			dst = state.surf_addr + w * 2;	/* edi */
 
 			h = state.draw_height;
-			if (!(_game & GF_SIMON2) && vc_get_bit(88)) {
+			if ((_game & GF_SIMON1) && vc_get_bit(88)) {
 				/* transparency */
 				do {
 					if (mask[0] & 0xF0) {
@@ -801,13 +801,13 @@
 		byte *dst;
 		uint h, i;
 
-		if (!(state.e & 8)) {
+		if (!(state.flags & 8)) {
 			src = state.depack_src + (width * state.y_skip << 4) + (state.x_skip << 3);
 			dst = state.surf_addr;
 
 			state.draw_width *= 2;
 
-			if (state.e & 2) {
+			if (state.flags & 2) {
 				/* no transparency */
 				h = state.draw_height;
 				do {
@@ -834,7 +834,7 @@
 			 * aaaaabbb bbcccccd ddddeeee efffffgg ggghhhhh
 			 */
 
-			if (state.e & 2) {
+			if (state.flags & 2) {
 				/* no transparency */
 				do {
 					uint count = state.draw_width >> 2;
@@ -907,12 +907,12 @@
 		}
 		/* vc_10_helper_4 */
 	} else {
-		if (_game & GF_SIMON2 && state.e & 0x4 && _bitArray[10] & 0x800) {
+		if (_game & GF_SIMON2 && state.flags & 0x4 && _bitArray[10] & 0x800) {
 			state.surf_addr = state.surf2_addr;
 			state.surf_pitch = state.surf2_pitch;
 		}
 
-		if (state.e & 0x8) {
+		if (state.flags & 0x8) {
 			uint w, h;
 			byte *src, *dst, *dst_org;
 
@@ -922,7 +922,7 @@
 
 			vc_10_skip_cols(&state);
 
-			if (state.e & 2) {
+			if (state.flags & 2) {
 				dst_org = state.surf_addr;
 				w = 0;
 				do {
@@ -940,7 +940,7 @@
 				} while (++w != state.draw_width);
 			} else {
 				dst_org = state.surf_addr;
-				if (state.e & 0x40) {		/* reached */
+				if (state.flags & 0x40) {		/* reached */
 					dst_org += vc_read_var(252);
 				}
 				w = 0;
@@ -973,7 +973,7 @@
 			src = state.depack_src + (width * state.y_skip) * 8;
 			dst = state.surf_addr;
 			state.x_skip <<= 2;
-			if (state.e & 2) {
+			if (state.flags & 2) {
 				do {
 					for (count = 0; count != state.draw_width; count++) {
 						dst[count * 2] = (src[count + state.x_skip] >> 4) | state.base_color;
@@ -1016,7 +1016,7 @@
 	VgaSprite *vsp = find_cur_sprite();
 	uint num;
 
-	if (!(_game & GF_SIMON2)) {
+	if (_game & GF_SIMON1) {
 		num = vc_read_var_or_word();
 	} else {
 		num = vc_read_next_byte() * _vgaBaseDelay;
@@ -1192,10 +1192,10 @@
 
 	vsp->x += (int16)vc_read_next_word();
 	vsp->y += (int16)vc_read_next_word();
-	if (!(_game & GF_SIMON2)) {
-		vsp->unk4 = vc_read_next_word();
+	if (_game & GF_SIMON1) {
+		vsp->flags = vc_read_next_word();
 	} else {
-		vsp->unk4 = vc_read_next_byte();
+		vsp->flags = vc_read_next_byte();
 	}
 
 	_vgaSpriteChanged++;
@@ -1319,7 +1319,7 @@
 	uint vga_res = vc_read_next_word();
 	uint mode = vc_read_next_word();
 
-	if (!(_game & GF_SIMON2)) {
+	if (_game & GF_SIMON1) {
 		if (mode == 16) {
 			_copyPartialMode = 2;
 		} else {
@@ -1352,7 +1352,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 == 0xF && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_vgaVar2 != 0) {
@@ -1381,7 +1381,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 == 0xF && !(_bitArray[5] & 1)) {
 		int16 tmp;
 
 		if (_vgaVar2 != 0) {
@@ -1500,17 +1500,17 @@
 void SimonEngine::vc_52_play_sound() {
 	uint16 sound_id = vc_read_next_word();
 
-	if (_game == GAME_SIMON1DOS) {
-			playSting(sound_id);
-	} else if (!(_game & GF_SIMON2)) {
-		_sound->playEffects(sound_id);
-	} else {
+	if (_game & GF_SIMON2) {
 		if (sound_id >= 0x8000) {
 			sound_id = -sound_id;
 			_sound->playAmbient(sound_id);
 		} else {
 			_sound->playEffects(sound_id);
 		}
+	} else if (_game & GF_TALKIE) {
+		_sound->playEffects(sound_id);
+	} else {
+		playSting(sound_id);
 	}
 }
 
@@ -1609,9 +1609,7 @@
 
 	vfs = _vgaSleepStructs;
 	while (vfs->ident != 0) {
-		if (vfs->sprite_id == _vgaCurSpriteId
-				&& (vfs->cur_vga_file == _vgaCurFileId || !(_game & GF_SIMON2))
-			) {
+		if ((_game & GF_SIMON1) || (vfs->sprite_id == _vgaCurSpriteId && vfs->cur_vga_file == _vgaCurFileId)) {
 			while (vfs->ident != 0) {
 				memcpy(vfs, vfs + 1, sizeof(VgaSleepStruct));
 				vfs++;
@@ -1627,9 +1625,7 @@
 
 		vte = _vgaTimerList;
 		while (vte->delay != 0) {
-			if (vte->sprite_id == _vgaCurSpriteId
-					&& (vte->cur_vga_file == _vgaCurFileId || !(_game & GF_SIMON2))
-				) {
+			if ((_game & GF_SIMON1) || (vte->sprite_id == _vgaCurSpriteId && vte->cur_vga_file == _vgaCurFileId)) {
 				delete_vga_timer(vte);
 				break;
 			}
@@ -1661,7 +1657,7 @@
 
 	vsp->x += vc_read_next_word();
 	vsp->y += vc_read_next_word();
-	vsp->unk4 = 36;
+	vsp->flags = 0x24;
 
 	_vgaSpriteChanged++;
 }
@@ -1709,7 +1705,7 @@
 					params[1] = READ_BE_UINT16(&vsp->base_color);
 					params[2] = READ_BE_UINT16(&vsp->x);
 					params[3] = READ_BE_UINT16(&vsp->y);
-					params[4] = READ_BE_UINT16(&vsp->unk4);
+					params[4] = READ_BE_UINT16(&vsp->flags);
 					_vcPtr = (byte *)params;
 					vc_10_draw();
 

Index: vga.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- vga.h	23 Apr 2005 14:00:51 -0000	1.8
+++ vga.h	6 May 2005 12:23:19 -0000	1.9
@@ -66,7 +66,7 @@
 
 struct VC10_state {
 	int image;
-	uint16 e;
+	uint16 flags;
 	int x, y;
 
 	byte base_color;





More information about the Scummvm-git-logs mailing list