From 8cc0b7163cd6b5beb08568aef7caf02836b4b317 Mon Sep 17 00:00:00 2001 From: James Brown Date: Wed, 14 Jan 2004 10:02:33 +0000 Subject: Move SCUMM debugger init later on. With this _numVariables is set, so theoretically the Debugger's scumm_vars[] array should work again. Although it doesn't, for some reason I have yet to look into. svn-id: r12377 --- scumm/debugger.cpp | 2 +- scumm/scummvm.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/scumm/debugger.cpp b/scumm/debugger.cpp index 17fffe8f84..065474be20 100644 --- a/scumm/debugger.cpp +++ b/scumm/debugger.cpp @@ -70,7 +70,7 @@ ScummDebugger::ScummDebugger(ScummEngine *s) DVar_Register("scumm_room", &_vm->_currentRoom, DVAR_INT, 0); DVar_Register("scumm_roomresource", &_vm->_roomResource, DVAR_INT, 0); DVar_Register("scumm_vars", &_vm->_scummVars, DVAR_INTARRAY, _vm->_numVariables); - + printf("Registered debugger\n"); DVar_Register("scumm_gamename", &_vm->_targetName, DVAR_STRING, 0); DVar_Register("scumm_exename", &_vm->_gameName, DVAR_STRING, 0); DVar_Register("scumm_gameid", &_vm->_gameId, DVAR_INT, 0); diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index d4dc2c25cc..c1966c9794 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -709,9 +709,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS // Setup GDI object gdi._numStrips = _screenWidth / 8; - // Create debugger - _debugger = new ScummDebugger(this); - _sound = new Sound(this); #ifndef __GP32__ //ph0x FIXME, "quick dirty hack" @@ -981,6 +978,11 @@ void ScummEngine::launch() { } _sound->setupSound(); + // Create debugger + if (!_debugger) + _debugger = new ScummDebugger(this); + + // If requested, load a save game instead of running the boot script if (_saveLoadFlag != 2 || !loadState(_saveLoadSlot, _saveLoadCompatible)) { if (_gameId == GID_MANIAC && _version == 1 && _demoMode) -- cgit v1.2.3