'fixed' o_blastText and updated a comment

svn-id: r25396
This commit is contained in:
Gregory Montoir 2007-02-05 22:47:22 +00:00
parent 7082e58289
commit 15e2af8e9d
4 changed files with 18 additions and 9 deletions

View file

@ -961,6 +961,8 @@ protected:
virtual void executeOpcode(byte i); virtual void executeOpcode(byte i);
virtual const char *getOpcodeDesc(byte i); virtual const char *getOpcodeDesc(byte i);
virtual void printString(int m, const byte *msg);
virtual void scummLoop_handleSaveLoad(); virtual void scummLoop_handleSaveLoad();
virtual void setupScummVars(); virtual void setupScummVars();

View file

@ -499,12 +499,8 @@ void ScummEngine_v8::decodeParseString(int m, int n) {
_string[m].no_talk_anim = true; _string[m].no_talk_anim = true;
break; break;
case 0xD1: // SO_PRINT_STRING case 0xD1: // SO_PRINT_STRING
if (m == 5) printString(m, _scriptPointer);
enqueueText(_scriptPointer, _string[m].xpos, _string[m].ypos, _string[m].color, _string[m].charset, _string[m].center);
else
printString(m, _scriptPointer);
_scriptPointer += resStrLen(_scriptPointer) + 1; _scriptPointer += resStrLen(_scriptPointer) + 1;
break; break;
case 0xD2: // SO_PRINT_WRAP Set print wordwrap case 0xD2: // SO_PRINT_WRAP Set print wordwrap
//debug(0, "decodeParseString: SO_PRINT_WRAP"); //debug(0, "decodeParseString: SO_PRINT_WRAP");
@ -671,8 +667,10 @@ void ScummEngine_v8::o8_arrayOps() {
} }
void ScummEngine_v8::o8_blastText() { void ScummEngine_v8::o8_blastText() {
// FIXME // Original V8 interpreter uses StringSlot 2 for o_blastText and 4 for o_printDebug.
decodeParseString(5, 0); // Since slot 2 is already mapped to printDebug for V6 (see ScummEngine::printString()),
// we just "swap" the slots, and use slot 4 here.
decodeParseString(4, 0);
} }
void ScummEngine_v8::o8_cursorCommand() { void ScummEngine_v8::o8_cursorCommand() {

View file

@ -1175,7 +1175,7 @@ protected:
virtual void initCharset(int charset); virtual void initCharset(int charset);
void printString(int m, const byte *msg); virtual void printString(int m, const byte *msg);
virtual bool handleNextCharsetCode(Actor *a, int *c); virtual bool handleNextCharsetCode(Actor *a, int *c);
void CHARSET_1(); void CHARSET_1();

View file

@ -64,12 +64,21 @@ void ScummEngine::printString(int m, const byte *msg) {
} }
} }
#ifndef DISABLE_SCUMM_7_8
void ScummEngine_v8::printString(int m, const byte *msg) {
if (m == 4) {
const StringTab &st = _string[m];
enqueueText(msg, st.xpos, st.ypos, st.color, st.charset, st.center);
} else {
ScummEngine::printString(m, msg);
}
}
#endif
void ScummEngine::debugMessage(const byte *msg) { void ScummEngine::debugMessage(const byte *msg) {
byte buffer[500]; byte buffer[500];
convertMessageToString(msg, buffer, sizeof(buffer)); convertMessageToString(msg, buffer, sizeof(buffer));
// if ((_game.id == GID_CMI) && _debugMode) { // In CMI, debugMessage is used for printDebug output
if ((buffer[0] != 0xFF) && _debugMode) { if ((buffer[0] != 0xFF) && _debugMode) {
debug(0, "DEBUG: %s", buffer); debug(0, "DEBUG: %s", buffer);
return; return;