diff options
author | Max Horn | 2003-04-28 14:46:55 +0000 |
---|---|---|
committer | Max Horn | 2003-04-28 14:46:55 +0000 |
commit | 1062e67122b791054794edecf0acec6d52af5a58 (patch) | |
tree | fdf7c56cdc6909d39afbb4c7aaaf692f81fbd1bd | |
parent | ab622ba5552d69cc5ea775fc513669a68e07e18b (diff) | |
download | scummvm-rg350-1062e67122b791054794edecf0acec6d52af5a58.tar.gz scummvm-rg350-1062e67122b791054794edecf0acec6d52af5a58.tar.bz2 scummvm-rg350-1062e67122b791054794edecf0acec6d52af5a58.zip |
added two missing opcodes (well one is just a stub, but anyway :-)
svn-id: r7180
-rw-r--r-- | scumm/intern.h | 12 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 28 |
2 files changed, 31 insertions, 9 deletions
diff --git a/scumm/intern.h b/scumm/intern.h index 586e5a3f9e..dc3a4d30d6 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -92,9 +92,11 @@ protected: void o5_getObjectOwner(); void o5_getObjectState(); void o5_getRandomNr(); - void o5_isScriptRunning(); + void o5_getStringWidth(); void o5_getVerbEntrypoint(); void o5_ifClassOfIs(); + void o5_ifNotState(); + void o5_ifState(); void o5_increment(); void o5_isActorInBox(); void o5_isEqual(); @@ -102,8 +104,7 @@ protected: void o5_isGreaterEqual(); void o5_isLess(); void o5_isNotEqual(); - void o5_ifState(); - void o5_ifNotState(); + void o5_isScriptRunning(); void o5_isSoundRunning(); void o5_jumpRelative(); void o5_lessOrEqual(); @@ -114,10 +115,12 @@ protected: void o5_move(); void o5_multiply(); void o5_notEqualZero(); + void o5_oldRoomEffect(); void o5_or(); void o5_overRide(); void o5_panCameraTo(); void o5_pickupObject(); + void o5_pickupObjectOld(); void o5_print(); void o5_printEgo(); void o5_pseudoRoom(); @@ -127,6 +130,7 @@ protected: void o5_quitPauseRestart(); void o5_resourceRoutines(); void o5_roomOps(); + void o5_saveLoadVars(); void o5_saveRestoreVerbs(); void o5_setCameraAt(); void o5_setClass(); @@ -151,8 +155,6 @@ protected: void o5_walkActorTo(); void o5_walkActorToActor(); void o5_walkActorToObject(); - void o5_oldRoomEffect(); - void o5_pickupObjectOld(); }; // FIXME - maybe we should move the opcodes from v5 to v3, and change the inheritance diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index f74f84563d..37c97c6acc 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -161,7 +161,7 @@ void Scumm_v5::setupOpcodes() { OPCODE(o5_loadRoomWithEgo), OPCODE(o5_pickupObject), OPCODE(o5_getClosestObjActor), - OPCODE(o5_dummy), + OPCODE(o5_getStringWidth), /* 68 */ OPCODE(o5_isScriptRunning), OPCODE(o5_setOwnerOf), @@ -241,7 +241,7 @@ void Scumm_v5::setupOpcodes() { OPCODE(o5_loadRoomWithEgo), OPCODE(o5_pickupObject), OPCODE(o5_setVarRange), - OPCODE(o5_dummy), + OPCODE(o5_saveLoadVars), /* A8 */ OPCODE(o5_notEqualZero), OPCODE(o5_setOwnerOf), @@ -321,7 +321,7 @@ void Scumm_v5::setupOpcodes() { OPCODE(o5_loadRoomWithEgo), OPCODE(o5_pickupObject), OPCODE(o5_getClosestObjActor), - OPCODE(o5_dummy), + OPCODE(o5_getStringWidth), /* E8 */ OPCODE(o5_isScriptRunning), OPCODE(o5_setOwnerOf), @@ -792,8 +792,26 @@ void Scumm_v5::o5_drawObject() { putState(obj, state); } +void Scumm_v5::o5_getStringWidth() { + // TODO - not sure if this is correct... needs testing + int a = getVarOrDirectByte(0x80); + byte *ptr = getResourceAddress(rtString, a); + int width = 0; + + if (ptr) + width = _charset->getStringWidth(0, ptr); + + setResult(width); + warning("o5_getStringWidth, result %d\n", width); +} + +void Scumm_v5::o5_saveLoadVars() { + // TODO + error("o5_saveLoadVars not yet implemented"); +} + void Scumm_v5::o5_dummy() { - /* nothing */ + warning("o5_dummy invoked (opcode %d)", _opcode); } void Scumm_v5::o5_expression() { @@ -1811,6 +1829,8 @@ void Scumm_v5::o5_roomOps() { checkRange(16, 1, a, "o5_roomOps: 16: color cycle out of range (%d)"); _colorCycle[a - 1].delay = (b != 0) ? 0x4000 / (b * 0x4C) : 0; break; + default: + error("o5_roomOps: unknown subopcode %d\n", _opcode & 0x1F); } } |