Main debug output can now be controlled by 'o' and 'v' keys

svn-id: r5631
This commit is contained in:
Travis Howell 2002-11-20 06:33:12 +00:00
parent 493485763b
commit 9162f9cc64
4 changed files with 22 additions and 22 deletions

View file

@ -37,9 +37,8 @@ int SimonState::runScript()
bool flag, condition;
do {
#ifdef DUMP_CONTINOUS_MAINSCRIPT
if (_mainscript_toggle)
dumpOpcode(_code_ptr);
#endif
opcode = getByte();
if (opcode == 0xFF)
@ -1219,9 +1218,8 @@ int SimonState::startSubroutine(Subroutine *sub)
SubroutineLine *sl;
byte *old_code_ptr;
#ifdef DUMP_START_MAINSCRIPT
if (_mainscript_toggle)
dumpSubroutine(sub);
#endif
old_code_ptr = _code_ptr;
@ -1239,9 +1237,8 @@ int SimonState::startSubroutine(Subroutine *sub)
else
_code_ptr += 8;
#ifdef DUMP_CONTINOUS_MAINSCRIPT
if (_mainscript_toggle)
fprintf(_dump_file, "; %d\n", sub->id);
#endif
result = runScript();
if (result != 0) {
/* result -10 means restart subroutine */

View file

@ -4553,6 +4553,9 @@ void SimonState::go()
_last_music_played = (uint) - 1;
_vga_base_delay = 1;
_mainscript_toggle = false;
_vgascript_toggle = false;
if (_voice_type != FORMAT_NONE) {
_vk_t_toggle = false;
} else {
@ -4598,7 +4601,11 @@ void SimonState::delay(uint amount)
while (_system->poll_event(&event)) {
switch (event.event_code) {
case OSystem::EVENT_KEYDOWN:
if (event.kbd.keycode == 't') {
if (event.kbd.keycode == 'o') {
_mainscript_toggle ^= 1;
} else if (event.kbd.keycode == 'v') {
_vgascript_toggle ^= 1;
} else if (event.kbd.keycode == 't') {
_vk_t_toggle ^= 1;
} else if (event.kbd.keycode == ']' || event.kbd.keycode == '+') {
midi.set_volume(midi.get_volume() + 16);

View file

@ -28,12 +28,8 @@
#include "sound/mixer.h"
/* Various other settings */
//#define DUMP_CONTINOUS_MAINSCRIPT
//#define DUMP_START_MAINSCRIPT
//#define DUMP_CONTINOUS_VGASCRIPT
//#define DRAW_IMAGES_DEBUG
//#define DRAW_THREE_STARS
//#define DUMP_START_VGASCRIPT
//#define DUMP_FILE_NR 8
//#define DUMP_BITMAPS_FILE_NR 8
//#define DUMP_DRAWN_BITMAPS
@ -196,6 +192,8 @@ public:
bool _dx_use_3_or_4_for_lock;
bool _mouse_pos_changed;
bool _mainscript_toggle;
bool _vgascript_toggle;
bool _vk_t_toggle;
byte _mouse_cursor;
bool _vga_var9;

View file

@ -113,7 +113,7 @@ void SimonState::run_vga_script()
for (;;) {
uint opcode;
#ifdef DUMP_CONTINOUS_VGASCRIPT
if (_vgascript_toggle) {
if ((void *)_vc_ptr != (void *)&vc_get_out_of_code) {
// if (_vga_cur_sprite_id==62 && _vga_cur_file_id==68 ||
// _vga_cur_sprite_id==1 && _vga_cur_file_id==2) {
@ -122,7 +122,7 @@ void SimonState::run_vga_script()
dump_video_script(_vc_ptr, true);
// }
}
#endif
}
if (!(_game & GAME_SIMON2)) {
opcode = READ_BE_UINT16_UNALIGNED(_vc_ptr);
@ -196,9 +196,8 @@ void SimonState::vc_skip_next_instruction()
_vc_ptr += opcode_param_len_simon1[opcode];
}
#ifdef DUMP_CONTINOUS_VGASCRIPT
if (_vgascript_toggle)
fprintf(_dump_file, "; skipped\n");
#endif
}
void SimonState::o_read_vgares_23()
@ -1654,9 +1653,8 @@ void SimonState::vc_56_no_op()
if (_game & GAME_SIMON2) {
uint num = vc_read_var_or_word() * _vga_base_delay;
#ifdef DUMP_CONTINOUS_VGASCRIPT
if (_vgascript_toggle)
fprintf(_dump_file, "; sleep_ex = %d\n", num + gss->VGA_DELAY_BASE);
#endif
add_vga_timer(num + gss->VGA_DELAY_BASE, _vc_ptr, _vga_cur_sprite_id, _vga_cur_file_id);
_vc_ptr = (byte *)&vc_get_out_of_code;