diff options
-rw-r--r-- | scumm/gfx.cpp | 2 | ||||
-rw-r--r-- | scumm/intern.h | 28 | ||||
-rw-r--r-- | scumm/script_v2.cpp | 22 | ||||
-rw-r--r-- | scumm/script_v5.cpp | 2 |
4 files changed, 24 insertions, 30 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 08c4a0d304..fe078c0311 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -39,7 +39,7 @@ // Note: This is purely experimental, NOT WORKING COMPLETLY and very buggy. // Please do not make reports about problems with it - this is only in CVS // to get it fixed and so that really interested parties can experiment it. -// It is NOT FIT FOR GENERAL USAGE!. You have been warned. +// It is NOT FIT FOR GENERAL USAGE! You have been warned. // // Doing this correctly will be quite some more complicated. Basically, with smooth // scrolling, the virtual screen strips don't match the display screen strips. diff --git a/scumm/intern.h b/scumm/intern.h index 2c729ba213..0d7a5798ed 100644 --- a/scumm/intern.h +++ b/scumm/intern.h @@ -44,7 +44,7 @@ protected: virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); - void decodeParseString(); + virtual void decodeParseString(); int getWordVararg(int *ptr); /* Version 5 script opcodes */ @@ -172,9 +172,6 @@ protected: }; class Scumm_v2 : public Scumm_v3 { -public: - Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} - protected: void readIndexFile(); void loadCharset(int no); @@ -188,11 +185,18 @@ protected: const OpcodeEntryV2 *_opcodesV2; - virtual void setupScummVars(); +public: + Scumm_v2(GameDetector *detector, OSystem *syst) : Scumm_v3(detector, syst) {} +protected: virtual void setupOpcodes(); virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); + + virtual void setupScummVars(); + + virtual void decodeParseString(); + virtual void ifStateCommon(byte type); virtual void ifNotStateCommon(byte type); virtual void setStateCommon(byte type); @@ -225,7 +229,6 @@ protected: void o2_ifNotState02(); void o2_ifState01(); void o2_ifNotState01(); - void o2_printEgo(); void o2_actorSet(); void o2_waitForActor(); void o2_waitForSentence(); @@ -296,18 +299,16 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); virtual void setupScummVars(); - int popRoomAndObj(int *room); - - void shuffleArray(int num, int minIdx, int maxIdx); - virtual void decodeParseString(int a, int b); + int getStackList(int *args, uint maxnum); + int popRoomAndObj(int *room); + void shuffleArray(int num, int minIdx, int maxIdx); /* Version 6 script opcodes */ void o6_setBlastObjectWindow(); @@ -509,20 +510,19 @@ public: protected: virtual void setupOpcodes(); - virtual void executeOpcode(int i); virtual const char *getOpcodeDesc(int i); virtual void setupScummVars(); + virtual void decodeParseString(int m, int n); + virtual uint fetchScriptWord(); virtual int fetchScriptWordSigned(); virtual int readVar(uint var); virtual void writeVar(uint var, int value); - virtual void decodeParseString(int m, int n); - /* Version 8 script opcodes */ void o8_mod(); void o8_wait(); diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index a216533c4e..3248150bb8 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -303,7 +303,7 @@ void Scumm_v2::setupOpcodes() { OPCODE(o5_getActorMoving), OPCODE(o2_setState02), /* D8 */ - OPCODE(o2_printEgo), + OPCODE(o5_printEgo), OPCODE(o2_doSentence), OPCODE(o5_add), OPCODE(o2_setBitVar), @@ -832,14 +832,11 @@ void Scumm_v2::o2_doSentence() { } } -void Scumm_v2::o2_printEgo() { - //_actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; - //_messagePtr = _scriptPointer; - - char buffer[256]; // FIXME - char *ptr = buffer; - char c; - while ((c = *_scriptPointer++)) { +void Scumm_v2::decodeParseString() { + byte buffer[256]; // FIXME + byte *ptr = buffer; + byte c; + while ((c = fetchScriptByte())) { if (c & 0x80) { *ptr++ = c & 0x7f; *ptr++ = ' '; @@ -852,17 +849,14 @@ void Scumm_v2::o2_printEgo() { *ptr++ = c; if (c > 3) { *ptr++ = 0; - *ptr++ = *_scriptPointer++; + *ptr++ = fetchScriptByte(); } } else *ptr++ = c; } *ptr = 0; - printf("o2_printEgo(%s)\n", buffer); - - //_messagePtr = addMessageToStack(_messagePtr); - //_scriptPointer = _messagePtr; + printf("TODO: Scumm_v2::decodeParseString(\"%s\")\n", buffer); } void Scumm_v2::o2_ifClassOfIs() { diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp index 04f0b20ef2..ffe19eba34 100644 --- a/scumm/script_v5.cpp +++ b/scumm/script_v5.cpp @@ -1440,7 +1440,7 @@ void Scumm_v5::o5_print() { } void Scumm_v5::o5_printEgo() { - _actorToPrintStrFor = (unsigned char)_vars[VAR_EGO]; + _actorToPrintStrFor = (byte)_vars[VAR_EGO]; decodeParseString(); } |