aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorFilippos Karapetis2009-05-30 20:45:57 +0000
committerFilippos Karapetis2009-05-30 20:45:57 +0000
commitdcecdc7b94de30f8859cadf7ecf24529e4c711c7 (patch)
treec9ed968df900e02aaa30f3a45826a4dc2ad53bf3 /engines/sci
parent9423c75dae4a4957384adf6b85719da7a06e93c0 (diff)
downloadscummvm-rg350-dcecdc7b94de30f8859cadf7ecf24529e4c711c7.tar.gz
scummvm-rg350-dcecdc7b94de30f8859cadf7ecf24529e4c711c7.tar.bz2
scummvm-rg350-dcecdc7b94de30f8859cadf7ecf24529e4c711c7.zip
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
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp24
-rw-r--r--engines/sci/console.h1
-rw-r--r--engines/sci/engine/scriptdebug.cpp27
-rw-r--r--engines/sci/sfx/songlib.cpp17
4 files changed, 23 insertions, 46 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index cda003f7ab..95075c0eb7 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -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);
diff --git a/engines/sci/console.h b/engines/sci/console.h
index b209d34fa6..3e79e7d11d 100644
--- a/engines/sci/console.h
+++ b/engines/sci/console.h
@@ -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);
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index 2550bac45b..2549e5a7cd 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -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");
diff --git a/engines/sci/sfx/songlib.cpp b/engines/sci/sfx/songlib.cpp
index 9a11a60818..e1185aa039 100644
--- a/engines/sci/sfx/songlib.cpp
+++ b/engines/sci/sfx/songlib.cpp
@@ -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