[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.394,1.395 vga.cpp,1.104,1.105

Travis Howell kirben at users.sourceforge.net
Mon Dec 22 22:36:02 CET 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv5249/simon

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

simon2dos/talkie used different expire_vga_timers() code.
Solves several bugs.
Using simon1 timer_proc() seciton as work out for speed issue at the moment.


Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.394
retrieving revision 1.395
diff -u -d -r1.394 -r1.395
--- simon.cpp	22 Dec 2003 11:08:35 -0000	1.394
+++ simon.cpp	23 Dec 2003 06:35:17 -0000	1.395
@@ -229,7 +229,7 @@
 	_game = (byte)detector->_game.features;
 
 	if (_game & GF_SIMON2) {
-		VGA_DELAY_BASE = 5;
+		VGA_DELAY_BASE = 1;
 		TABLE_INDEX_BASE = 1580 / 4;
 		TEXT_INDEX_BASE = 1500 / 4;
 		NUM_VIDEO_OP_CODES = 75;
@@ -2490,51 +2490,28 @@
 }
 
 void SimonEngine::expire_vga_timers() {
-	if (_game & GF_SIMON2) {
-		VgaTimerEntry *vte = _vga_timer_list;
+	VgaTimerEntry *vte = _vga_timer_list;
 
-		_vga_tick_counter++;
+	_vga_tick_counter++;
 
-		while (vte->delay) {
-			// not quite ok, good enough
-			if ((int16)(vte->delay -= 5) <= 0) {
-				uint16 cur_file = vte->cur_vga_file;
-				uint16 cur_unk = vte->sprite_id;
-				byte *script_ptr = vte->script_pointer;
+	while (vte->delay) {
+		if (!--vte->delay) {
+			uint16 cur_file = vte->cur_vga_file;
+			uint16 cur_unk = vte->sprite_id;
+			byte *script_ptr = vte->script_pointer;
 
-				_next_vga_timer_to_process = vte + 1;
-				delete_vga_timer(vte);
+			_next_vga_timer_to_process = vte + 1;
+			delete_vga_timer(vte);
 
-				if (script_ptr == NULL) {
-					// special scroll timer
-					scroll_timeout();
-				} else {
-					vc_resume_sprite(script_ptr, cur_file, cur_unk);
-				}
-				vte = _next_vga_timer_to_process;
+			if ((_game & GF_SIMON2) && script_ptr == NULL) {
+				// special scroll timer
+				scroll_timeout();
 			} else {
-				vte++;
-			}
-		}
-	} else {
-		VgaTimerEntry *vte = _vga_timer_list;
-
-		_vga_tick_counter++;
-
-		while (vte->delay) {
-			if (!--vte->delay) {
-				uint16 cur_file = vte->cur_vga_file;
-				uint16 cur_unk = vte->sprite_id;
-				byte *script_ptr = vte->script_pointer;
-
-				_next_vga_timer_to_process = vte + 1;
-				delete_vga_timer(vte);
-
 				vc_resume_sprite(script_ptr, cur_file, cur_unk);
-				vte = _next_vga_timer_to_process;
-			} else {
-				vte++;
 			}
+			vte = _next_vga_timer_to_process;
+		} else {
+			vte++;
 		}
 	}
 }
@@ -2558,7 +2535,7 @@
 		}
 	}
 
-	add_vga_timer(10, NULL, 0, 0);
+	add_vga_timer(2, NULL, 0, 0);
 }
 
 void SimonEngine::vc_resume_sprite(byte *code_ptr, uint16 cur_file, uint16 cur_sprite) {
@@ -3133,7 +3110,7 @@
 	_lock_word |= 2;
 
 	if (!(_lock_word & 0x10)) {
-		if (!(_game & GF_SIMON2)) {
+		//if (!(_game & GF_SIMON2)) {
 			expire_vga_timers();
 			expire_vga_timers();
 			_sync_flag_2 ^= 1;
@@ -3141,12 +3118,14 @@
 			if (!_cepe_flag)
 				expire_vga_timers();
 
+/*
 		} else {
 			_sync_flag_2 ^= 1;
 			if (!_sync_flag_2)
 				expire_vga_timers();
 
 		}
+*/
 
 		if (_lock_counter != 0 && !_sync_flag_2) {
 			_lock_word &= ~2;

Index: vga.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/vga.cpp,v
retrieving revision 1.104
retrieving revision 1.105
diff -u -d -r1.104 -r1.105
--- vga.cpp	22 Dec 2003 11:08:35 -0000	1.104
+++ vga.cpp	23 Dec 2003 06:35:17 -0000	1.105
@@ -1409,7 +1409,7 @@
 			tmp = _vga_var1 - _x_scroll;
 			if (tmp < 20)
 				_vga_var2 = tmp;
-			add_vga_timer(10, NULL, 0, 0);	/* special timer */
+			add_vga_timer(2, NULL, 0, 0);	/* special timer */
 		}
 	}
 no_scroll:;
@@ -1438,7 +1438,7 @@
 			tmp = _vga_var1 - _x_scroll;
 			if (_x_scroll < 20)
 				_vga_var2 = -_x_scroll;
-			add_vga_timer(10, NULL, 0, 0);	/* special timer */
+			add_vga_timer(2, NULL, 0, 0);	/* special timer */
 		}
 	}
 no_scroll:;





More information about the Scummvm-git-logs mailing list