aboutsummaryrefslogtreecommitdiff
path: root/sword2/mem_view.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-10-26 15:42:49 +0000
committerTorbjörn Andersson2003-10-26 15:42:49 +0000
commit7c4cc25cec714073d947e6451b4bf76cd53624ef (patch)
tree79a4c235fb9b62e0f49e069d87645f99022b2859 /sword2/mem_view.cpp
parent2a139049d621479da4898fcb22c742c52d17eac3 (diff)
downloadscummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.gz
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.tar.bz2
scummvm-rg350-7c4cc25cec714073d947e6451b4bf76cd53624ef.zip
Enable the debug console. Actually, what I've done is to adapt the debug
console from the SCUMM engine. I decided that would be easier than to clean up the original console code. Unfortunately there's a bunch of code that I just copied - a pretty lousy form of code-reusal. It'd be nice if the console could be made part of the Engine class, or something like that. Most of the debug commands seem to be working. Some aren't relevant for ScummVM, and some are a bit obscure so I'm not quite sure what they're supposed to be doing. svn-id: r10978
Diffstat (limited to 'sword2/mem_view.cpp')
-rw-r--r--sword2/mem_view.cpp32
1 files changed, 4 insertions, 28 deletions
diff --git a/sword2/mem_view.cpp b/sword2/mem_view.cpp
index cd4fec02ad..561b2b4ed1 100644
--- a/sword2/mem_view.cpp
+++ b/sword2/mem_view.cpp
@@ -33,8 +33,6 @@ char buf[50];
void MemoryManager::displayMemory(void) {
int pass, found_end, k, j, free = 0;
_standardHeader *file_header;
- int scrolls = 0;
- _keyboardEvent ke;
char inf[][20] = {
{ "M_null " },
@@ -69,7 +67,7 @@ void MemoryManager::displayMemory(void) {
pass = 1; // also illegal
if (!pass && found_end) { // && file_header->fileType < 10)
- Print_to_console("%d %s, size 0x%.5x (%dk %d%%), res %d %s %s, A%d, C%d",
+ Debug_Printf("%d %s, size 0x%.5x (%dk %d%%), res %d %s %s, A%d, C%d\n",
j, inf[_memList[j].state],
_memList[j].size,
_memList[j].size / 1024,
@@ -80,9 +78,9 @@ void MemoryManager::displayMemory(void) {
res_man.fetchAge(_memList[j].uid),
res_man.fetchCount(_memList[j].uid));
} else
- Print_to_console(" %d is an illegal resource", _memList[j].uid);
+ Debug_Printf(" %d is an illegal resource\n", _memList[j].uid);
} else {
- Print_to_console("%d %s, size 0x%.5x (%dk %d%%), %s",
+ Debug_Printf("%d %s, size 0x%.5x (%dk %d%%), %s\n",
j, inf[_memList[j].state], _memList[j].size,
_memList[j].size / 1024,
(_memList[j].size * 100) / _totalFreeMemory,
@@ -93,31 +91,9 @@ void MemoryManager::displayMemory(void) {
free += _memList[j].size;
j = _memList[j].child;
-
- scrolls++;
-
- Build_display();
-
- if (scrolls == 18) {
- Temp_print_to_console("- Press ESC to stop or any other key to continue");
- Build_display();
-
- do {
- g_display->updateDisplay();
- } while (!KeyWaiting());
-
- ReadKey(&ke); //kill the key we just pressed
- if (ke.keycode == 27) //ESC
- break;
-
- // clear the Press Esc message ready for the new line
- Clear_console_line();
- scrolls = 0;
- }
} while (j != -1);
- Scroll_console();
- Print_to_console("(total memory block 0x%.8x %dk %dMB) %d / %d%% free",
+ Debug_Printf("(total memory block 0x%.8x %dk %dMB) %d / %d%% free\n",
_totalFreeMemory, _totalFreeMemory / 1024,
_totalFreeMemory / (1000 * 1024), free,
(free * 100) / _totalFreeMemory);