Enable debug keys and warnings only if debug mode selected.

Fix fast mode

svn-id: r5851
This commit is contained in:
Travis Howell 2002-12-06 02:14:37 +00:00
parent bc36f7144a
commit 710a311c0e
5 changed files with 38 additions and 24 deletions

2
README
View File

@ -315,6 +315,7 @@ simon games.
Common:
Ctrl-z OR Alt-x - quit
Keyboard Arrow Keys - simulate mouse movement
Ctrl-f - runs in fast mode.
Ctrl-Alt 1-7 - Switch between graphics filters
Ctrl-Alt 1 - Switch beetwen bilinear and non-linear filtering [OpenGL backend]
Ctrl-Alt 2 - Don't fit the game in the whole screen (black borders) [OpenGL backend]
@ -323,7 +324,6 @@ simon games.
Scumm:
Ctrl 0-9 and Alt 0-9 - load and save game state
Ctrl-f - runs in fast mode.
Ctrl-g - runs in really REALLY fast mode.
Ctrl-d - starts the debugger.
Ctrl-s - shows memory consumption.

View File

@ -751,7 +751,8 @@ int SimonState::runScript()
break;
case 134:{
warning("stopMidiMusic: not implemented");
if (_debugMode)
warning("stopMidiMusic: not implemented");
/* dummy proc */
}
break;
@ -1513,7 +1514,8 @@ void SimonState::o_unk_127()
uint b = getVarOrWord();
uint c = getVarOrByte();
warning("o_unk_127(%d,%d,%d) not implemented properly", a, b, c);
if (_debugMode)
warning("o_unk_127(%d,%d,%d) not implemented properly", a, b, c);
//FIXME simon 2 attempts to use music track 93 in ending sequences
// which doesn't exist so prevent that happening

View File

@ -138,6 +138,7 @@ SimonState::SimonState(GameDetector *detector, OSystem *syst)
"Features of the game that depend on sound synchronization will most likely break");
midi.set_volume(detector->_music_volume);
set_volume(detector->_sfx_volume);
_debugMode = detector->_debugMode;
_effects_paused = false;
_ambient_paused = false;
@ -821,7 +822,8 @@ void SimonState::loadTablesIntoMem(uint subr_id)
}
}
warning("loadTablesIntoMem: didn't find %d", subr_id);
if (_debugMode)
warning("loadTablesIntoMem: didn't find %d", subr_id);
}
Subroutine *SimonState::getSubroutineByID(uint subroutine_id)
@ -840,7 +842,8 @@ Subroutine *SimonState::getSubroutineByID(uint subroutine_id)
return cur;
}
warning("getSubroutineByID: subroutine %d not found", subroutine_id);
if (_debugMode)
warning("getSubroutineByID: subroutine %d not found", subroutine_id);
return NULL;
}
@ -1938,7 +1941,8 @@ void SimonState::set_video_mode_internal(uint mode, uint vga_res_id)
uint16 c;
byte *vc_ptr_org;
//warning("Set video mode internal: %d, %d", mode, vga_res_id);
if (_debugMode)
warning("Set video mode internal: %d, %d", mode, vga_res_id);
_video_palette_mode = mode;
_lock_word |= 0x20;
@ -2500,7 +2504,6 @@ void SimonState::o_wait_for_vga(uint a)
}
}
// warning("waiting on %d done", a);
_system->show_mouse(true);
}
@ -3369,7 +3372,8 @@ void SimonState::video_toggle_colors(HitArea * ha, byte a, byte b, byte c, byte
h = ha->height;
if (!(h > 0 && w > 0 && ha->x + w <= 320 && ha->y + h <= 200)) {
warning("Invalid coordinates in video_toggle_colors (%d,%d,%d,%d)", ha->x, ha->y, ha->width,
if (_debugMode)
warning("Invalid coordinates in video_toggle_colors (%d,%d,%d,%d)", ha->x, ha->y, ha->width,
ha->height);
_lock_word &= ~0x8000;
return;
@ -4409,7 +4413,8 @@ void SimonState::dx_update_screen_and_palette()
void SimonState::realizePalette()
{
if (_palette_color_count & 0x8000) {
warning("realizePalette subroutine unimplemented");
if (_debugMode)
warning("realizePalette subroutine unimplemented");
_palette_color_count = 0;
} else {
_video_var_9 = false;
@ -4510,13 +4515,8 @@ void SimonState::delay(uint amount)
while (_system->poll_event(&event)) {
switch (event.event_code) {
case OSystem::EVENT_KEYDOWN:
if (event.kbd.ascii == 'r') {
_start_mainscript ^= 1;
} else if (event.kbd.ascii == 'o') {
_continous_mainscript ^= 1;
} else if (event.kbd.ascii == 'v') {
_continous_vgascript ^= 1;
} else if (event.kbd.ascii == 't') {
if (event.kbd.ascii == 't') {
_vk_t_toggle ^= 1;
} else if (event.kbd.ascii == '+') {
midi.set_volume(midi.get_volume() + 16);
@ -4528,10 +4528,16 @@ void SimonState::delay(uint amount)
_sound->effectsPause(_effects_paused ^= 1);
} else if (event.kbd.ascii == 'b') {
_sound->ambientPause(_ambient_paused ^= 1);
} else if (event.kbd.flags == OSystem::KBD_CTRL) {
if (event.kbd.ascii == 'f') {
} else if (event.kbd.flags==OSystem::KBD_CTRL) {
if (event.kbd.keycode == 'f')
_fast_mode ^= 1;
}
} else if (_debugMode) {
if (event.kbd.ascii == 'r') {
_start_mainscript ^= 1;
} else if (event.kbd.ascii == 'o') {
_continous_mainscript ^= 1;
} else if (event.kbd.ascii == 'v')
_continous_vgascript ^= 1;
}
_key_pressed = (byte)event.kbd.ascii;
break;

View File

@ -174,6 +174,7 @@ public:
bool _dx_use_3_or_4_for_lock;
bool _mouse_pos_changed;
bool _debugMode;
bool _start_mainscript;
bool _continous_mainscript;
bool _continous_vgascript;

View File

@ -894,7 +894,8 @@ void SimonState::vc_10_draw()
if (_game & GAME_SIMON2 && state.e & 0x4 && _bit_array[10] & 0x800) {
state.surf_addr = state.surf2_addr;
state.surf_pitch = state.surf2_pitch;
warning("vc_10_draw: (state.e&0x4)");
if (_debugMode)
warning("vc_10_draw: (state.e&0x4)");
}
if (state.e & 0x8) {
@ -1166,7 +1167,8 @@ void SimonState::vc_23_set_pri()
VgaSprite bak;
if (vsp->id == 0) {
warning("tried to set pri for unknown id %d", _vga_cur_sprite_id);
if (_debugMode)
warning("tried to set pri for unknown id %d", _vga_cur_sprite_id);
return;
}
@ -1204,7 +1206,8 @@ void SimonState::vc_24_set_image_xy()
vsp->image = vc_read_var_or_word();
if (vsp->id == 0) {
warning("Trying to set XY of nonexistent sprite '%d'", _vga_cur_sprite_id);
if (_debugMode)
warning("Trying to set XY of nonexistent sprite '%d'", _vga_cur_sprite_id);
}
vsp->x += (int16)vc_read_next_word();
@ -1783,7 +1786,8 @@ void SimonState::vc_62_palette_thing()
vc_29_stop_all_sounds();
if ((_game & GAME_SIMON2) && (!_video_var_3)) {
warning("vc_62_palette_thing: music stuff?");
if (_debugMode)
warning("vc_62_palette_thing: music stuff?");
}
_video_var_3 = true;
@ -1897,7 +1901,8 @@ void SimonState::vc_69()
uint16 a = vc_read_next_word();
uint16 b = vc_read_next_word();
warning("vc_69(%d,%d): music stuff?", a, b);
if (_debugMode)
warning("vc_69(%d,%d): music stuff?", a, b);
}
void SimonState::vc_70()