Moved the "songlib" command to console.cpp and removed the non-working "set_vismap" command - we can view the different maps with "show_map", but it doesn't make much sense to redirect the game's graphics output to another screen map on demand

svn-id: r41048
This commit is contained in:
Filippos Karapetis 2009-05-30 20:45:57 +00:00
parent 9423c75dae
commit dcecdc7b94
4 changed files with 23 additions and 46 deletions

View File

@ -35,6 +35,7 @@
#include "sci/gfx/gfx_gui.h" // for sciw_set_status_bar
#include "sci/gfx/gfx_state_internal.h"
#include "sci/gfx/gfx_widgets.h" // for gfxw_find_port
#include "sci/sfx/songlib.h" // for songlib_t
#include "sci/vocabulary.h"
#include "common/savefile.h"
@ -89,6 +90,7 @@ Console::Console(SciEngine *vm) : GUI::Debugger() {
DCmd_Register("segment_info", WRAP_METHOD(Console, cmdSegmentInfo));
DCmd_Register("segment_kill", WRAP_METHOD(Console, cmdKillSegment));
DCmd_Register("show_map", WRAP_METHOD(Console, cmdShowMap));
DCmd_Register("songlib", WRAP_METHOD(Console, cmdSongLib));
DCmd_Register("gc", WRAP_METHOD(Console, cmdInvokeGC));
DCmd_Register("gc_objects", WRAP_METHOD(Console, cmdGCObjects));
DCmd_Register("exit", WRAP_METHOD(Console, cmdExit));
@ -345,8 +347,7 @@ bool Console::cmdSci0Palette(int argc, const char **argv) {
}
sci0_palette = atoi(argv[1]);
// TODO: the current room has to be changed to reset the palette of the views
game_init_graphics(g_EngineState);
cmdRedrawScreen(argc, argv);
return false;
}
@ -1137,6 +1138,25 @@ bool Console::cmdShowMap(int argc, const char **argv) {
return false;
}
bool Console::cmdSongLib(int argc, const char **argv) {
DebugPrintf("Song library:\n");
song_t *seeker = *(g_EngineState->_sound._songlib.lib);
do {
DebugPrintf(" %p", (void *)seeker);
if (seeker) {
DebugPrintf("[%04lx,p=%d,s=%d]->", seeker->handle, seeker->priority, seeker->status);
seeker = seeker->next;
}
DebugPrintf("\n");
} while (seeker);
DebugPrintf("\n");
return true;
}
bool Console::cmdInvokeGC(int argc, const char **argv) {
DebugPrintf("Performing garbage collection...\n");
run_gc(g_EngineState);

View File

@ -80,6 +80,7 @@ private:
bool cmdSegmentInfo(int argc, const char **argv);
bool cmdKillSegment(int argc, const char **argv);
bool cmdShowMap(int argc, const char **argv);
bool cmdSongLib(int argc, const char **argv);
bool cmdInvokeGC(int argc, const char **argv);
bool cmdGCObjects(int argc, const char **argv);
bool cmdExit(int argc, const char **argv);

View File

@ -338,14 +338,6 @@ static int show_node(EngineState *s, reg_t addr) {
int objinfo(EngineState *s, reg_t pos);
void song_lib_dump(const songlib_t &songlib, int line);
static int c_songlib_print(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
song_lib_dump(s->_sound._songlib, __LINE__);
return 0;
}
static int c_vr(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
reg_t reg = cmdParams[0].reg;
reg_t reg_end = cmdParams.size() > 1 ? cmdParams[1].reg : NULL_REG;
@ -1111,21 +1103,6 @@ static int c_backtrace(EngineState *s, const Common::Array<cmd_param_t> &cmdPara
return 0;
}
static int c_visible_map(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
if (!s) {
sciprintf("Not in debug state\n");
return 1;
}
// TODO
#if 0
if (cmdParams[0].val <= 3)
s->pic_visible_map = cmdParams[0].val;
c_redraw_screen(s);
#endif
return 0;
}
static int c_gfx_priority(EngineState *s, const Common::Array<cmd_param_t> &cmdParams) {
if (!_debugstate_valid) {
sciprintf("Not in debug state\n");
@ -2038,8 +2015,6 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t *
con_hook_command(c_sret, "sret", "", "Steps forward until ret is called\n on the current execution stack\n level.");
con_hook_command(c_resource_id, "resource_id", "i", "Identifies a resource number by\n"
" splitting it up in resource type\n and resource number.");
con_hook_command(c_visible_map, "set_vismap", "i", "Sets the visible map.\n Default is 0 (visual).\n"
" Other useful values are:\n 1: Priority\n 2: Control\n 3: Auxiliary\n");
con_hook_command(c_bpx, "bpx", "s", "Sets a breakpoint on the execution of\n the specified method.\n\n EXAMPLE:\n"
" bpx ego::doit\n\n May also be used to set a breakpoint\n that applies whenever an object\n"
" of a specific type is touched:\n bpx foo::\n");
@ -2087,8 +2062,6 @@ void script_debug(EngineState *s, reg_t *pc, StackPtr *sp, StackPtr *pp, reg_t *
"Steps until the global variable with the\n"
"specified index is modified.\n\nSEE ALSO\n\n"
" s.1, snk.1, so.1, bpx.1");
con_hook_command(c_songlib_print, "songlib_print", "",
"");
con_hook_command(c_type, "type", "!a",
"Determines the type of a value\n\n"
"SEE ALSO\n\n addresses.3, vo.1");

View File

@ -196,21 +196,4 @@ void song_lib_set_restore_behavior(const songlib_t &songlib, song_handle_t handl
seeker->restore_behavior = action;
}
void song_lib_dump(const songlib_t &songlib, int line) {
song_t *seeker = *(songlib.lib);
fprintf(debug_stream, "L%d:", line);
do {
fprintf(debug_stream, " %p", (void *)seeker);
if (seeker) {
fprintf(debug_stream, "[%04lx,p=%d,s=%d]->", seeker->handle, seeker->priority, seeker->status);
seeker = seeker->next;
}
fprintf(debug_stream, "\n");
} while (seeker);
fprintf(debug_stream, "\n");
}
} // End of namespace Sci