Add var to track current subroutine been used.

Add work around to display one section of Simon the Sorcerer 1 introduction in lower half of screen.

svn-id: r11870
This commit is contained in:
Travis Howell 2003-12-23 08:59:30 +00:00
parent f681946192
commit 35be4ef554
3 changed files with 32 additions and 9 deletions

View File

@ -314,6 +314,7 @@ SimonEngine::SimonEngine(GameDetector *detector, OSystem *syst)
_subroutine_list = 0;
_subroutine_list_org = 0;
_subroutine = 0;
_dx_surface_pitch = 0;
@ -1237,16 +1238,20 @@ void SimonEngine::playSting(uint a) {
Subroutine *SimonEngine::getSubroutineByID(uint subroutine_id) {
Subroutine *cur;
_subroutine = subroutine_id;
for (cur = _subroutine_list; cur; cur = cur->next) {
if (cur->id == subroutine_id)
if (cur->id == subroutine_id) {
return cur;
}
}
loadTablesIntoMem(subroutine_id);
for (cur = _subroutine_list; cur; cur = cur->next) {
if (cur->id == subroutine_id)
if (cur->id == subroutine_id) {
return cur;
}
}
debug(1,"getSubroutineByID: subroutine %d not found", subroutine_id);
@ -2335,7 +2340,7 @@ void SimonEngine::o_set_video_mode(uint mode, uint vga_res) {
}
void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
uint num;
uint num, num_lines;
VgaPointersEntry *vpe;
byte *bb, *b;
uint16 c;
@ -2403,7 +2408,7 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
if (_game & GF_SIMON2) {
if (!_dx_use_3_or_4_for_lock) {
uint num_lines = _video_palette_mode == 4 ? 134 : 200;
num_lines = _video_palette_mode == 4 ? 134 : 200;
_vga_var8 = num_lines;
dx_copy_from_attached_to_2(0, 0, 320, num_lines);
dx_copy_from_attached_to_3(num_lines);
@ -2411,7 +2416,12 @@ void SimonEngine::set_video_mode_internal(uint mode, uint vga_res_id) {
}
_dx_use_3_or_4_for_lock = false;
} else {
uint num_lines = _video_palette_mode == 4 ? 134 : 200;
// Allow one section of Simon the Sorcerer 1 introduction to be displayed
// in lower half of screen
if (_subroutine == 2926)
num_lines = 200;
else
num_lines = _video_palette_mode == 4 ? 134 : 200;
_vga_var8 = num_lines;
dx_copy_from_attached_to_2(0, 0, 320, num_lines);
dx_copy_from_attached_to_3(num_lines);

View File

@ -163,6 +163,7 @@ protected:
uint _tablesheap_curpos_new;
Subroutine *_subroutine_list, *_subroutine_list_org;
uint _subroutine;
uint _dx_surface_pitch;
@ -275,7 +276,6 @@ protected:
uint _invoke_timer_callback;
uint _vga_sprite_changed;
byte *_vga_buf_free_start, *_vga_buf_end, *_vga_buf_start;

View File

@ -731,8 +731,16 @@ void SimonEngine::vc_10_draw() {
state.surf_pitch = _dx_surface_pitch;
{
uint offs = ((vlut[0] - _video_windows[16]) * 2 + state.x) * 8;
uint offs2 = (vlut[1] - _video_windows[17] + state.y);
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) {
offs = ((vlut[0]) * 2 + state.x) * 8;
offs2 = (vlut[1] + state.y);
} else {
offs = ((vlut[0] - _video_windows[16]) * 2 + state.x) * 8;
offs2 = (vlut[1] - _video_windows[17] + state.y);
}
state.surf2_addr += offs + offs2 * state.surf2_pitch;
state.surf_addr += offs + offs2 * state.surf_pitch;
@ -1766,7 +1774,12 @@ void SimonEngine::vc_62_palette_thing() {
_vc_ptr = vc_ptr_org;
}
dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200);
// Allow one section of Simon the Sorcerer 1 introduction to be displayed
// in lower half of screen
if (!(_game & GF_SIMON2) && _subroutine == 2926)
dx_clear_surfaces(200);
else
dx_clear_surfaces(_video_palette_mode == 4 ? 134 : 200);
}
if (_game & GF_SIMON2) {
if (_next_music_to_play != -1)