diff options
author | Max Horn | 2002-12-23 15:46:53 +0000 |
---|---|---|
committer | Max Horn | 2002-12-23 15:46:53 +0000 |
commit | f86eaeaff9ae16c345f78fd240915e7109d98e19 (patch) | |
tree | e4b5c6db17122d6010ee0d95cae73e4200c98d38 | |
parent | cc5872924e8fea9e24af57a1891de230c26494cf (diff) | |
download | scummvm-rg350-f86eaeaff9ae16c345f78fd240915e7109d98e19.tar.gz scummvm-rg350-f86eaeaff9ae16c345f78fd240915e7109d98e19.tar.bz2 scummvm-rg350-f86eaeaff9ae16c345f78fd240915e7109d98e19.zip |
more V8 mods; cleanup
svn-id: r6070
-rw-r--r-- | scumm/actor.cpp | 3 | ||||
-rw-r--r-- | scumm/intern.h | 22 | ||||
-rw-r--r-- | scumm/script_v6.cpp | 66 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 107 | ||||
-rw-r--r-- | scumm/vars.cpp | 31 |
5 files changed, 149 insertions, 80 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp index e8dd5f8644..563d64dc54 100644 --- a/scumm/actor.cpp +++ b/scumm/actor.cpp @@ -1214,7 +1214,8 @@ void Actor::startWalkAnim(int cmd, int angle) * Note: walk scripts aren't required to make the game * work as usual */ -#if 0 +#if 1 + printf("ignoreTurns = %d\n", ignoreTurns); if (walk_script != 0) { int16 args[16]; args[0] = number; diff --git a/scumm/intern.h b/scumm/intern.h index 27c0fa78f7..55ce15583f 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -209,7 +209,7 @@ protected: int popRoomAndObj(int *room); - void decodeParseString2(int a, int b); + void decodeParseString(int a, int b); int getStackList(int16 *args, uint maxnum); /* Version 6 script opcodes */ @@ -313,7 +313,7 @@ protected: void o6_createBoxMatrix(); void o6_resourceRoutines(); void o6_roomOps(); - void o6_actorSet(); + void o6_actorOps(); void o6_verbOps(); void o6_getActorFromXY(); void o6_findObject(); @@ -396,6 +396,8 @@ protected: virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); + virtual void setupScummVars(); + virtual uint fetchScriptWord(); virtual int fetchScriptWordSigned(); @@ -405,12 +407,24 @@ protected: void o8_mod(); void o8_wait(); + + void o8_dim(); + void o8_dim2(); + void o8_arrayAssign(); + void o8_printLine(); + void o8_printCursor(); + void o8_printDebug(); + void o8_printSystem(); + void o8_cursorCommand(); void o8_resourceRoutines(); void o8_roomOps(); - void o8_actorSet(); - void o8_cameraStuff(); + void o8_actorOps(); + void o8_cameraOps(); void o8_verbOps(); + + void o8_system(); + void o8_kludge(); }; diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp index b45d7b48c5..60e05252e4 100644 --- a/scumm/script_v6.cpp +++ b/scumm/script_v6.cpp @@ -168,8 +168,8 @@ void Scumm_v6::setupOpcodes() OPCODE(o6_drawBlastObject), /* 64 */ OPCODE(o6_setBlastObjectWindow), - OPCODE(o6_stopObjectCode), - OPCODE(o6_stopObjectCode), + OPCODE(o6_stopObjectCode), // FIXME - are 0x65 and 0x66 really the same? + OPCODE(o6_stopObjectCode), // FIXME - are 0x65 and 0x66 really the same? OPCODE(o6_endCutscene), /* 68 */ OPCODE(o6_cutscene), @@ -238,7 +238,7 @@ void Scumm_v6::setupOpcodes() OPCODE(o6_resourceRoutines), /* 9C */ OPCODE(o6_roomOps), - OPCODE(o6_actorSet), + OPCODE(o6_actorOps), OPCODE(o6_verbOps), OPCODE(o6_getActorFromXY), /* A0 */ @@ -377,19 +377,6 @@ const char *Scumm_v6::getOpcodeDesc(int i) return _opcodesV6[i].desc; } -void Scumm_v6::o6_setBlastObjectWindow() -{ // Set BOMP processing window - int a, b, c, d; - - d = pop(); - c = pop(); - b = pop(); - a = pop(); - - warning("o6_bompWindow(%d, %d, %d, %d)", a, b, c, d); - // sub_274EF(a, b, c, d); -} - int Scumm_v6::popRoomAndObj(int *room) { int obj; @@ -1023,15 +1010,7 @@ void Scumm_v6::o6_setCameraAt() void Scumm_v6::o6_loadRoom() { - int room; - /* Begin: Autosave - _saveLoadSlot = 0; - sprintf(_saveLoadName, "Autosave", _saveLoadSlot); - _saveLoadFlag = 1; - _saveLoadCompatible = false; - End: Autosave */ - - room = pop(); + int room = pop(); startScene(room, 0, 0); _fullRedraw = 1; } @@ -1617,7 +1596,7 @@ void Scumm_v6::o6_roomOps() } } -void Scumm_v6::o6_actorSet() +void Scumm_v6::o6_actorOps() { Actor *a; int i, j, k; @@ -1630,7 +1609,7 @@ void Scumm_v6::o6_actorSet() return; } - a = derefActorSafe(_curActor, "o6_actorSet"); + a = derefActorSafe(_curActor, "o6_actorOps"); if (!a) return; @@ -1778,7 +1757,7 @@ void Scumm_v6::o6_actorSet() a->talk_script = pop(); break; default: - error("o6_actorset: default case %d", b); + error("o6_actorOps: default case %d", b); } } @@ -2222,33 +2201,33 @@ void Scumm_v6::o6_stopSentence() void Scumm_v6::o6_print_0() { _actorToPrintStrFor = 0xFF; - decodeParseString2(0, 0); + decodeParseString(0, 0); } void Scumm_v6::o6_print_1() { - decodeParseString2(1, 0); + decodeParseString(1, 0); } void Scumm_v6::o6_print_2() { - decodeParseString2(2, 0); + decodeParseString(2, 0); } void Scumm_v6::o6_print_3() { - decodeParseString2(3, 0); + decodeParseString(3, 0); } void Scumm_v6::o6_printActor() { - decodeParseString2(0, 1); + decodeParseString(0, 1); } void Scumm_v6::o6_printEgo() { push(_vars[VAR_EGO]); - decodeParseString2(0, 1); + decodeParseString(0, 1); } void Scumm_v6::o6_talkActor() @@ -2444,6 +2423,21 @@ void Scumm_v6::o6_drawBlastObject() enqueueObject(a, b, c, d, e, 0xFF, 0xFF, 1, 0); } +// Set BOMP processing window +void Scumm_v6::o6_setBlastObjectWindow() +{ + // TODO - implement this + int a, b, c, d; + + d = pop(); + c = pop(); + b = pop(); + a = pop(); + + warning("o6_bompWindow(%d, %d, %d, %d)", a, b, c, d); + // sub_274EF(a, b, c, d); +} + void Scumm_v6::o6_miscOps() { int16 args[30]; @@ -2891,7 +2885,7 @@ void Scumm_v6::o6_unknownCD() { warning("o6_unknownCD: stub(%d, %d, %d, %d)", a, b, c, d); } -void Scumm_v6::decodeParseString2(int m, int n) +void Scumm_v6::decodeParseString(int m, int n) { byte b; @@ -2922,7 +2916,7 @@ void Scumm_v6::decodeParseString2(int m, int n) _string[m].no_talk_anim = false; break; case 73: - error("decodeParseString2: case 73"); + error("decodeParseString: case 73"); break; case 74: _string[m].no_talk_anim = true; diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 94b8b01345..c4a2b4354c 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -176,23 +176,23 @@ void Scumm_v8::setupOpcodes() OPCODE(o6_wordVarInc), OPCODE(o6_wordVarDec), /* 70 */ - OPCODE(o6_dim), + OPCODE(o8_dim), OPCODE(o6_wordArrayWrite), OPCODE(o6_wordArrayInc), OPCODE(o6_wordArrayDec), /* 74 */ - OPCODE(o6_dim2), + OPCODE(o8_dim2), OPCODE(o6_wordArrayIndexedWrite), - OPCODE(o8_unknown), + OPCODE(o8_arrayAssign), OPCODE(o8_unknown), /* 78 */ OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_startScript), + OPCODE(o6_startScriptQuick), + OPCODE(o6_stopObjectCode), /* 7C */ OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_jumpToScript), // FIXME - is this right? "O_CHAIN_SCRIPT" OPCODE(o8_unknown), OPCODE(o8_unknown), /* 80 */ @@ -207,7 +207,7 @@ void Scumm_v8::setupOpcodes() OPCODE(o8_unknown), /* 88 */ OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_setClass), OPCODE(o8_unknown), OPCODE(o8_unknown), /* 8C */ @@ -219,11 +219,11 @@ void Scumm_v8::setupOpcodes() OPCODE(o8_unknown), OPCODE(o8_unknown), OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_printLine), /* 94 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_printCursor), + OPCODE(o8_printDebug), + OPCODE(o8_printSystem), OPCODE(o8_unknown), /* 98 */ OPCODE(o8_unknown), @@ -232,18 +232,18 @@ void Scumm_v8::setupOpcodes() OPCODE(o8_unknown), /* 9C */ OPCODE(o8_cursorCommand), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_loadRoom), + OPCODE(o6_loadRoomWithEgo), // FIXME - this is a pure guess + OPCODE(o6_walkActorToObj), /* A0 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_walkActorTo), + OPCODE(o6_putActorInRoom), + OPCODE(o6_putActorAtObject), + OPCODE(o6_faceActor), /* A4 */ - OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_animateActor), + OPCODE(o6_doSentence), + OPCODE(o6_pickupObject), OPCODE(o8_unknown), /* A8 */ OPCODE(o8_unknown), @@ -251,15 +251,15 @@ void Scumm_v8::setupOpcodes() OPCODE(o8_resourceRoutines), OPCODE(o8_roomOps), /* AC */ - OPCODE(o8_actorSet), - OPCODE(o8_cameraStuff), + OPCODE(o8_actorOps), + OPCODE(o8_cameraOps), OPCODE(o8_verbOps), OPCODE(o8_unknown), /* B0 */ OPCODE(o8_unknown), OPCODE(o8_unknown), OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_system), /* B4 */ OPCODE(o8_unknown), OPCODE(o8_unknown), @@ -268,7 +268,7 @@ void Scumm_v8::setupOpcodes() /* B8 */ OPCODE(o8_unknown), OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o8_kludge), OPCODE(o8_unknown), /* BC */ OPCODE(o8_unknown), @@ -292,18 +292,18 @@ void Scumm_v8::setupOpcodes() OPCODE(o8_unknown), /* CC */ OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_isAnyOf), OPCODE(o6_getRandomNumber), OPCODE(o6_getRandomNumberRange), /* D0 */ OPCODE(o8_unknown), OPCODE(o8_unknown), OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_isScriptRunning), /* D4 */ OPCODE(o8_unknown), - OPCODE(o8_unknown), - OPCODE(o8_unknown), + OPCODE(o6_isSoundRunning), + OPCODE(o6_abs), OPCODE(o8_unknown), /* D8 */ OPCODE(o8_unknown), @@ -422,6 +422,34 @@ void Scumm_v8::o8_wait() } } +void Scumm_v8::o8_dim() +{ +} + +void Scumm_v8::o8_dim2() +{ +} + +void Scumm_v8::o8_arrayAssign() +{ +} + +void Scumm_v8::o8_printLine() +{ +} + +void Scumm_v8::o8_printCursor() +{ +} + +void Scumm_v8::o8_printDebug() +{ +} + +void Scumm_v8::o8_printSystem() +{ +} + void Scumm_v8::o8_cursorCommand() { // TODO @@ -498,13 +526,13 @@ void Scumm_v8::o8_roomOps() } } -void Scumm_v8::o8_actorSet() +void Scumm_v8::o8_actorOps() { // TODO byte subOp = fetchScriptByte(); Actor *a; - a = derefActorSafe(_curActor, "o8_actorSet"); + a = derefActorSafe(_curActor, "o8_actorOps"); if (!a) return; @@ -548,11 +576,11 @@ void Scumm_v8::o8_actorSet() case 0x88: // SO_ACTOR_FREQUENCY Set frequency of actor speech case 0x89: // SO_ACTOR_PAN default: - error("o8_actorset: default case %d", subOp); + error("o8_actorOps: default case %d", subOp); } } -void Scumm_v8::o8_cameraStuff() +void Scumm_v8::o8_cameraOps() { // TODO byte subOp = fetchScriptByte(); @@ -560,7 +588,7 @@ void Scumm_v8::o8_cameraStuff() case 0x32: // SO_CAMERA_PAUSE case 0x33: // SO_CAMERA_RESUME default: - error("o8_cameraStuff: default case %d", subOp); + error("o8_cameraOps: default case %d", subOp); } } @@ -592,6 +620,15 @@ void Scumm_v8::o8_verbOps() } } + +void Scumm_v8::o8_system() +{ +} + +void Scumm_v8::o8_kludge() +{ +} + /* From http://scummrev.mixnmojo.com/specs/CMIOpcodes.shtml diff --git a/scumm/vars.cpp b/scumm/vars.cpp index 481b896fce..506dbcbd15 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -142,14 +142,10 @@ void Scumm_v7::setupScummVars() VAR_NEW_ROOM = 35; VAR_WALKTO_OBJ = 36; - VAR_CAMERA_DEST_X = 38; - VAR_CAMERA_DEST_Y = 39; - VAR_CAMERA_FOLLOWED_ACTOR = 40; - VAR_SCROLL_SCRIPT = 50; VAR_ENTRY_SCRIPT = 51; VAR_ENTRY_SCRIPT2 = 52; @@ -207,3 +203,30 @@ void Scumm_v7::setupScummVars() VAR_V6_EMSSPACE = 32; VAR_STRING2DRAW = 130; } + +void Scumm_v8::setupScummVars() +{ + VAR_MOUSE_X = 3; + VAR_MOUSE_Y = 4; + VAR_VIRT_MOUSE_X = 5; + VAR_VIRT_MOUSE_Y = 6; + + VAR_CAMERA_POS_X = 9; + VAR_CAMERA_POS_Y = 10; + VAR_CAMERA_DEST_X = 11; + VAR_CAMERA_DEST_Y = 12; + + VAR_ROOM = 31; + + VAR_ENTRY_SCRIPT = 51; + VAR_ENTRY_SCRIPT2 = 52; + VAR_EXIT_SCRIPT = 53; + VAR_EXIT_SCRIPT2 = 54; + VAR_SENTENCE_SCRIPT = 56; + VAR_HOOK_SCRIPT = 57; + VAR_CUTSCENE_START_SCRIPT = 58; + VAR_CUTSCENE_END_SCRIPT = 59; + + VAR_PAUSE_KEY = 64; // ??? + VAR_SAVELOADDIALOG_KEY = 65; // ??? +} |