aboutsummaryrefslogtreecommitdiff
path: root/simon
diff options
context:
space:
mode:
authorTravis Howell2003-12-23 06:35:17 +0000
committerTravis Howell2003-12-23 06:35:17 +0000
commit10bdda505c1f166de4997fdb06fb58c375eae4eb (patch)
tree86be64116e0b5da1258356fc2bb42b30ccdf0d31 /simon
parenta1831ee4fb19f9ad2f02005ad8e4425e26ea8cc1 (diff)
downloadscummvm-rg350-10bdda505c1f166de4997fdb06fb58c375eae4eb.tar.gz
scummvm-rg350-10bdda505c1f166de4997fdb06fb58c375eae4eb.tar.bz2
scummvm-rg350-10bdda505c1f166de4997fdb06fb58c375eae4eb.zip
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. svn-id: r11867
Diffstat (limited to 'simon')
-rw-r--r--simon/simon.cpp61
-rw-r--r--simon/vga.cpp4
2 files changed, 22 insertions, 43 deletions
diff --git a/simon/simon.cpp b/simon/simon.cpp
index ab503d808e..d690a0d041 100644
--- a/simon/simon.cpp
+++ b/simon/simon.cpp
@@ -229,7 +229,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_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::delete_vga_timer(VgaTimerEntry * vte) {
}
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 @@ void SimonEngine::scroll_timeout() {
}
}
- 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 @@ void SimonEngine::timer_proc1() {
_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 @@ void SimonEngine::timer_proc1() {
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;
diff --git a/simon/vga.cpp b/simon/vga.cpp
index d7f46ef896..095cf199e9 100644
--- a/simon/vga.cpp
+++ b/simon/vga.cpp
@@ -1409,7 +1409,7 @@ void SimonEngine::vc_40_var_add() {
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 @@ void SimonEngine::vc_41_var_sub() {
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:;