aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorTravis Howell2004-08-26 14:28:42 +0000
committerTravis Howell2004-08-26 14:28:42 +0000
commitf6eae9d1a1beeca56667ad40047a1cbac7b91f83 (patch)
treec855faf31d65b452dbe85fadf162227fbef82a83 /scumm
parent5805529c2c1d33df8fcf1800a20a4f2f57e98dde (diff)
downloadscummvm-rg350-f6eae9d1a1beeca56667ad40047a1cbac7b91f83.tar.gz
scummvm-rg350-f6eae9d1a1beeca56667ad40047a1cbac7b91f83.tar.bz2
scummvm-rg350-f6eae9d1a1beeca56667ad40047a1cbac7b91f83.zip
Update akos error messages
Add proper timer opcodes Up some debug msgs. svn-id: r14779
Diffstat (limited to 'scumm')
-rw-r--r--scumm/akos.cpp4
-rw-r--r--scumm/script.cpp4
-rw-r--r--scumm/script_v72he.cpp29
-rw-r--r--scumm/script_v7he.cpp6
-rw-r--r--scumm/scumm.cpp1
-rw-r--r--scumm/scumm.h1
6 files changed, 27 insertions, 18 deletions
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index d224ebed9b..38879636a3 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -309,7 +309,7 @@ byte AkosRenderer::drawLimb(const CostumeData &cost, int limb) {
result |= codec16(xmoveCur, ymoveCur);
break;
default:
- error("akos_drawCostumeChannel: invalid codec %d", codec);
+ error("akos_drawLimb: invalid codec %d", codec);
}
} else {
extra = p[2];
@@ -343,7 +343,7 @@ byte AkosRenderer::drawLimb(const CostumeData &cost, int limb) {
result |= codec16(xmoveCur, ymoveCur);
break;
default:
- error("akos_drawCostumeChannel: invalid codec %d", codec);
+ error("akos_drawLimb: invalid codec %d", codec);
}
}
}
diff --git a/scumm/script.cpp b/scumm/script.cpp
index 4de7d38bca..8282074d88 100644
--- a/scumm/script.cpp
+++ b/scumm/script.cpp
@@ -657,7 +657,7 @@ void ScummEngine::setResult(int value) {
void ScummEngine::push(int a) {
assert(_scummStackPos >= 0 && _scummStackPos < ARRAYSIZE(_vmStack));
- //debug(9, "push %d", a);
+ debug(9, "push %d", a);
_vmStack[_scummStackPos++] = a;
}
@@ -666,7 +666,7 @@ int ScummEngine::pop() {
error("No items on stack to pop() for %s (0x%X) at [%d-%d]", getOpcodeDesc(_opcode), _opcode, _roomResource, vm.slot[_currentScript].number);
}
--_scummStackPos;
- //debug(9, "pop %d", _vmStack[_scummStackPos]);
+ debug(9, "pop %d", _vmStack[_scummStackPos]);
return _vmStack[_scummStackPos];
}
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index f0194a5cfc..1932298b24 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -605,21 +605,28 @@ void ScummEngine_v72he::o72_objectY() {
}
void ScummEngine_v72he::o72_getTimer() {
- int b = pop();
- int a = fetchScriptByte();
- warning("o72_getTimer stub (%d, %d)", b, a);
- if (a == 10)
- push(1);
- else
+ int timer = pop();
+ int cmd = fetchScriptByte();
+
+ if (cmd == 10) {
+ checkRange(3, 1, timer, "o72_getTimer: Timer %d out of range(%d)");
+ int diff = _system->get_msecs() - _timers[timer];
+ push(diff);
+ } else {
push(0);
+ }
}
void ScummEngine_v72he::o72_setTimer() {
- int b = pop();
- int a = fetchScriptByte();
- if (a != 158)
- error("TIMER command %d?", a);
- warning("o72_setTimer stub (%d, %d)", b, a);
+ int timer = pop();
+ int cmd = fetchScriptByte();
+
+ if (cmd == 158) {
+ checkRange(3, 1, timer, "o72_setTimer: Timer %d out of range(%d)");
+ _timers[timer] = _system->get_msecs();
+ } else {
+ error("TIMER command %d?", cmd);
+ }
}
void ScummEngine_v72he::o72_wordArrayDec() {
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 0d3720c073..7b361eb3c2 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -655,7 +655,7 @@ void ScummEngine_v7he::o7_resourceRoutines() {
case 122:
case 123:
case 203:
- debug(1,"stub queueload (%d) resource %d", op, pop());
+ debug(5,"stub queueload (%d) resource %d", op, pop());
break;
case 159:
resid = pop();
@@ -675,11 +675,11 @@ void ScummEngine_v7he::o7_resourceRoutines() {
break;
case 233:
resid = pop();
- debug(1,"stub o7_resourceRoutines lock object %d", resid);
+ debug(5,"stub o7_resourceRoutines lock object %d", resid);
break;
case 235:
resid = pop();
- debug(1,"stub o7_resourceRoutines unlock object %d", resid);
+ debug(5,"stub o7_resourceRoutines unlock object %d", resid);
break;
default:
error("o7_resourceRoutines: default case %d", op);
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index f89a27efad..8913fe7448 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -654,6 +654,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_heSndTimer = 0;
_heSndLoop = 0;
_heSndSoundFreq = 0;
+ memset(_timers, 0, sizeof(_timers));
//
// Init all VARS to 0xFF
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 15ed727924..5f1c0abfd6 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1036,6 +1036,7 @@ public:
byte *_shadowPalette;
int _heSndSoundFreq, _heSndOffset, _heSndTimer, _heSndSoundId, _heSndLoop;
bool _skipDrawObject;
+ int _timers[4];
protected:
int _shadowPaletteSize;