LILLIPUT: Rename debug channel in order to doublecheck all function, some more renaming and bugfixing, fix some GCC warnings
This commit is contained in:
parent
23dc740de4
commit
355f598560
8 changed files with 337 additions and 329 deletions
|
@ -110,7 +110,9 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
|
|||
_system = syst;
|
||||
DebugMan.addDebugChannel(kDebugEngine, "Engine", "Engine debug level");
|
||||
DebugMan.addDebugChannel(kDebugScript, "Script", "Script debug level");
|
||||
DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound debug level");
|
||||
DebugMan.addDebugChannel(kDebugSound, "Sound", "Sound debug level");
|
||||
DebugMan.addDebugChannel(kDebugEngineTBC, "EngineTBC", "Engine debug level");
|
||||
DebugMan.addDebugChannel(kDebugScriptTBC, "ScriptTBC", "Script debug level");
|
||||
|
||||
_console = new LilliputConsole(this);
|
||||
_rnd = 0;
|
||||
|
@ -134,8 +136,7 @@ LilliputEngine::LilliputEngine(OSystem *syst, const LilliputGameDescription *gd)
|
|||
_byte12FCE = 0;
|
||||
_byte129A0 = 0xFF;
|
||||
_numCharactersToDisplay = 0;
|
||||
_nextDisplayCharacterX = 0;
|
||||
_nextDisplayCharacterY = 0;
|
||||
_nextDisplayCharacterPos = Common::Point(0, 0);
|
||||
_byte12A04 = 0;
|
||||
_byte12A05 = 10;
|
||||
_byte12A06 = 2;
|
||||
|
@ -299,10 +300,10 @@ Common::Platform LilliputEngine::getPlatform() const {
|
|||
return _platform;
|
||||
}
|
||||
|
||||
void LilliputEngine::displayCharacter(int index, int x, int y, int flags) {
|
||||
debugC(2, kDebugEngine, "displayCharacter(%d, %d, %d, %d)", index, x, y, flags);
|
||||
void LilliputEngine::displayCharacter(int index, Common::Point pos, int flags) {
|
||||
debugC(2, kDebugEngineTBC, "displayCharacter(%d, %d - %d, %d)", index, pos.x, pos.y, flags);
|
||||
|
||||
byte *buf = _buffer1_45k + (y << 8) + x;
|
||||
byte *buf = _buffer1_45k + (pos.y << 8) + pos.x;
|
||||
|
||||
byte *src = _bufferMen;
|
||||
if (index < 0) {
|
||||
|
@ -340,7 +341,7 @@ void LilliputEngine::displayCharacter(int index, int x, int y, int flags) {
|
|||
|
||||
// display mouse cursor, if any
|
||||
void LilliputEngine::displayFunction1(byte *buf, int var1, Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "displayFunction1(buf, %d, %d, %d)", var1, pos.x, pos.y);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction1(buf, %d, %d, %d)", var1, pos.x, pos.y);
|
||||
|
||||
int index1 = ((var1 & 0xFF) << 8) + (var1 >> 8);
|
||||
byte *newBuf = &buf[index1];
|
||||
|
@ -361,14 +362,14 @@ void LilliputEngine::displayFunction1(byte *buf, int var1, Common::Point pos) {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction1a(byte *buf, Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "displayFunction1a(buf, %d, %d)", pos.x, pos.y);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction1a(buf, %d, %d)", pos.x, pos.y);
|
||||
|
||||
displayFunction1(buf, 0, pos);
|
||||
}
|
||||
|
||||
// save area under mouse cursor
|
||||
void LilliputEngine::displayFunction2(byte *buf, Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "displayFunction2(buf, %d, %d)", pos.x, pos.y);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction2(buf, %d, %d)", pos.x, pos.y);
|
||||
|
||||
int tmpVal = ((pos.y & 0xFF) << 8) + (pos.y >> 8);
|
||||
int index2 = pos.x + tmpVal + (tmpVal >> 2);
|
||||
|
@ -383,7 +384,7 @@ void LilliputEngine::displayFunction2(byte *buf, Common::Point pos) {
|
|||
|
||||
// Fill 16x16 rect
|
||||
void LilliputEngine::displayFunction3(int var1, int var2, int var4) {
|
||||
debugC(2, kDebugEngine, "displayFunction3(%d, %d, %d)", var1, var2, var4);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction3(%d, %d, %d)", var1, var2, var4);
|
||||
|
||||
int tmpVal = ((var4 >> 8) + (var4 & 0xFF));
|
||||
int index = var2 + tmpVal + (tmpVal >> 2);
|
||||
|
@ -398,7 +399,7 @@ void LilliputEngine::displayFunction3(int var1, int var2, int var4) {
|
|||
|
||||
// display mouse cursor
|
||||
void LilliputEngine::displayFunction4() {
|
||||
debugC(2, kDebugEngine, "displayFunction4()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction4()");
|
||||
|
||||
if ((_skipDisplayFlag1 != 1) && (_skipDisplayFlag2 != 1)) {
|
||||
_skipDisplayFlag2 = 1;
|
||||
|
@ -413,7 +414,7 @@ void LilliputEngine::displayFunction4() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction5() {
|
||||
debugC(2, kDebugEngine, "displayFunction5()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction5()");
|
||||
|
||||
if ((_skipDisplayFlag1 != 0) && (_skipDisplayFlag2 != 1)) {
|
||||
_skipDisplayFlag2 = 1;
|
||||
|
@ -425,7 +426,7 @@ void LilliputEngine::displayFunction5() {
|
|||
|
||||
// save game area
|
||||
void LilliputEngine::displayFunction6() {
|
||||
debugC(2, kDebugEngine, "displayFunction6()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction6()");
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -441,7 +442,7 @@ void LilliputEngine::displayFunction6() {
|
|||
|
||||
// save speech zone
|
||||
void LilliputEngine::displayFunction7() {
|
||||
debugC(2, kDebugEngine, "displayFunction7()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction7()");
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -456,7 +457,7 @@ void LilliputEngine::displayFunction7() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayInterfaceHotspots() {
|
||||
debugC(2, kDebugEngine, "displayInterfaceHotspots()");
|
||||
debugC(2, kDebugEngineTBC, "displayInterfaceHotspots()");
|
||||
|
||||
if (_displayMap == 1)
|
||||
return;
|
||||
|
@ -474,7 +475,7 @@ void LilliputEngine::displayInterfaceHotspots() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction9() {
|
||||
debugC(2, kDebugEngine, "displayFunction9()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction9()");
|
||||
|
||||
memcpy(_buffer2_45k, _buffer3_45k, 45056);
|
||||
|
||||
|
@ -495,7 +496,7 @@ void LilliputEngine::displayFunction9() {
|
|||
|
||||
// Display dialog bubble
|
||||
void LilliputEngine::displayFunction10() {
|
||||
debugC(2, kDebugEngine, "displayFunction10()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction10()");
|
||||
static const byte _array15976[16] = {244, 248, 250, 250, 252, 252, 252, 252, 252, 252, 252, 252, 250, 250, 248, 244};
|
||||
|
||||
displayFunction5();
|
||||
|
@ -518,7 +519,7 @@ void LilliputEngine::displayFunction10() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex) {
|
||||
debugC(2, kDebugEngine, "sub15A4C()");
|
||||
debugC(2, kDebugEngineTBC, "sub15A4C()");
|
||||
|
||||
int var3 = 0;
|
||||
int var1;
|
||||
|
@ -550,7 +551,7 @@ void LilliputEngine::sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex) {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction11(byte *buf) {
|
||||
debugC(2, kDebugEngine, "displayFunction11(%s)", buf);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction11(%s)", buf);
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -583,7 +584,7 @@ void LilliputEngine::displayFunction11(byte *buf) {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction12() {
|
||||
debugC(1, kDebugEngine, "displayFunction12()");
|
||||
debugC(1, kDebugEngineTBC, "displayFunction12()");
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -605,7 +606,7 @@ void LilliputEngine::displayFunction12() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction13(byte *buf, int var1, int var2, int var3) {
|
||||
debugC(1, kDebugEngine, "displayFunction13(buf, %d, %d, %d)", var1, var2, var3);
|
||||
debugC(1, kDebugEngineTBC, "displayFunction13(buf, %d, %d, %d)", var1, var2, var3);
|
||||
|
||||
byte tmpByte1 = ((7 + (var2 >> 8) - (var2 & 0xFF)) << 4) & 0xFF;
|
||||
byte tmpByte2 = ((4 + (var2 >> 8) + (var2 & 0xFF) - (var3 >> 7) ) << 3) & 0xFF;
|
||||
|
@ -624,7 +625,7 @@ void LilliputEngine::displayFunction13(byte *buf, int var1, int var2, int var3)
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction14() {
|
||||
debugC(2, kDebugEngine, "displayFunction14()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction14()");
|
||||
|
||||
if (_displayMap == 1)
|
||||
return;
|
||||
|
@ -646,7 +647,7 @@ void LilliputEngine::displayFunction14() {
|
|||
}
|
||||
|
||||
void LilliputEngine::restoreMapPoints() {
|
||||
debugC(2, kDebugEngine, "restoreMapPoints()");
|
||||
debugC(2, kDebugEngineTBC, "restoreMapPoints()");
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -659,7 +660,7 @@ void LilliputEngine::restoreMapPoints() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayCharactersOnMap() {
|
||||
debugC(2, kDebugEngine, "displayCharactersOnMap()");
|
||||
debugC(2, kDebugEngineTBC, "displayCharactersOnMap()");
|
||||
|
||||
sub16217();
|
||||
displayFunction5();
|
||||
|
@ -679,7 +680,7 @@ void LilliputEngine::displayCharactersOnMap() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16217() {
|
||||
debugC(2, kDebugEngine, "sub16217()");
|
||||
debugC(2, kDebugEngineTBC, "sub16217()");
|
||||
|
||||
_numCharactersToDisplay = 0;
|
||||
int index = _numCharacters - 1;
|
||||
|
@ -739,21 +740,19 @@ void LilliputEngine::sub16217() {
|
|||
}
|
||||
|
||||
void LilliputEngine::setNextDisplayCharacter(int var1) {
|
||||
debugC(2, kDebugEngine, "setNextDisplayCharacter(%d)", var1);
|
||||
debugC(2, kDebugEngineTBC, "setNextDisplayCharacter(%d)", var1);
|
||||
|
||||
byte charNum = var1 & 0xFF;
|
||||
if ( charNum < _numCharactersToDisplay) {
|
||||
int index = _charactersToDisplay[charNum];
|
||||
_nextDisplayCharacterX = _characterRelativePositionX[index];
|
||||
_nextDisplayCharacterY = _characterRelativePositionY[index];
|
||||
_nextDisplayCharacterPos = Common::Point(_characterRelativePositionX[index], _characterRelativePositionY[index]);
|
||||
} else {
|
||||
_nextDisplayCharacterX = 0xFF;
|
||||
_nextDisplayCharacterY = 0xFF;
|
||||
_nextDisplayCharacterPos = Common::Point(-1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
void LilliputEngine::displayFunction15() {
|
||||
debugC(2, kDebugEngine, "displayFunction15()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction15()");
|
||||
|
||||
sub16217();
|
||||
_currentDisplayCharacter = 0;
|
||||
|
@ -773,7 +772,7 @@ void LilliputEngine::displayFunction15() {
|
|||
var1 += _scriptHandler->_byte12A04;
|
||||
displayFunction13(_buffer1_45k, var1, tmpVal, 1 << 8);
|
||||
}
|
||||
renderCharacters(map, j, i);
|
||||
renderCharacters(map, Common::Point(j, i));
|
||||
|
||||
if (map[2] != 0xFF) {
|
||||
int var1 = map[2];
|
||||
|
@ -788,7 +787,7 @@ void LilliputEngine::displayFunction15() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction16() {
|
||||
debugC(2, kDebugEngine, "displayFunction16()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction16()");
|
||||
|
||||
if (_displayMap == 1) {
|
||||
bool forceReturnFl = false;
|
||||
|
@ -828,7 +827,7 @@ void LilliputEngine::sub1863B() {
|
|||
}
|
||||
|
||||
void LilliputEngine::paletteFadeOut() {
|
||||
debugC(2, kDebugEngine, "paletteFadeOut()");
|
||||
debugC(2, kDebugEngineTBC, "paletteFadeOut()");
|
||||
|
||||
sub1863B();
|
||||
byte palette[768];
|
||||
|
@ -843,7 +842,7 @@ void LilliputEngine::paletteFadeOut() {
|
|||
}
|
||||
|
||||
void LilliputEngine::paletteFadeIn() {
|
||||
debugC(2, kDebugEngine, "paletteFadeIn()");
|
||||
debugC(2, kDebugEngineTBC, "paletteFadeIn()");
|
||||
|
||||
byte palette[768];
|
||||
for (int fade = 8; fade <= 256; fade += 8) {
|
||||
|
@ -857,7 +856,7 @@ void LilliputEngine::paletteFadeIn() {
|
|||
}
|
||||
|
||||
int LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) {
|
||||
debugC(2, kDebugEngine, "sub16DD5(%d, %d, %d, %d)", x1, y1, x2, y2);
|
||||
debugC(2, kDebugEngineTBC, "sub16DD5(%d, %d, %d, %d)", x1, y1, x2, y2);
|
||||
|
||||
byte *isoMap = _bufferIsoMap + (x1 << 8) + (y1 << 2) + 1;
|
||||
|
||||
|
@ -923,7 +922,7 @@ int LilliputEngine::sub16DD5(int x1, int y1, int x2, int y2) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub15F75() {
|
||||
debugC(2, kDebugEngine, "sub15F75()");
|
||||
debugC(2, kDebugEngineTBC, "sub15F75()");
|
||||
|
||||
_byte129A0 = 0xFF;
|
||||
_savedMousePosDivided = Common::Point(-1, -1);
|
||||
|
@ -938,7 +937,7 @@ void LilliputEngine::sub15F75() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub130B6() {
|
||||
debugC(2, kDebugEngine, "sub130B6()");
|
||||
debugC(2, kDebugEngineTBC, "sub130B6()");
|
||||
|
||||
for (int index = 0; index < _word12F68_ERULES; index++) {
|
||||
if (_scriptHandler->_array122E9[index] == 3)
|
||||
|
@ -947,7 +946,7 @@ void LilliputEngine::sub130B6() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub15F31(bool &forceReturnFl) {
|
||||
debugC(2, kDebugEngine, "sub15F31()");
|
||||
debugC(2, kDebugEngineTBC, "sub15F31()");
|
||||
|
||||
forceReturnFl = false;
|
||||
if (_displayMap != 1)
|
||||
|
@ -974,7 +973,7 @@ void LilliputEngine::sub15F31(bool &forceReturnFl) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16CA0() {
|
||||
debugC(2, kDebugEngine, "sub16CA0()");
|
||||
debugC(2, kDebugEngineTBC, "sub16CA0()");
|
||||
|
||||
for (int index = _numCharacters - 1; index >= 0; index--) {
|
||||
if (_rulesBuffer2_11[index] & 1)
|
||||
|
@ -1065,7 +1064,7 @@ void LilliputEngine::sub16CA0() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction17() {
|
||||
debugC(2, kDebugEngine, "displayFunction17()");
|
||||
debugC(2, kDebugEngineTBC, "displayFunction17()");
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -1077,7 +1076,7 @@ void LilliputEngine::displayFunction17() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayFunction18(int var1, int var2, int var3, int var4) {
|
||||
debugC(2, kDebugEngine, "displayFunction18(%d, %d, %d, %d)", var1, var2, var3, var4);
|
||||
debugC(2, kDebugEngineTBC, "displayFunction18(%d, %d, %d, %d)", var1, var2, var3, var4);
|
||||
|
||||
displayFunction5();
|
||||
|
||||
|
@ -1109,7 +1108,7 @@ void LilliputEngine::displayFunction18(int var1, int var2, int var3, int var4) {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayString(byte *buf, int var2, int var4) {
|
||||
debugC(2, kDebugEngine, "displayString(buf, %d, %d)", var2, var4);
|
||||
debugC(2, kDebugEngineTBC, "displayString(buf, %d, %d)", var2, var4);
|
||||
|
||||
int index = var2;
|
||||
int tmpVar4 = (var4 >> 8) + ((var4 & 0xFF) << 8);
|
||||
|
@ -1124,7 +1123,7 @@ void LilliputEngine::displayString(byte *buf, int var2, int var4) {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayChar(int index, int var1) {
|
||||
debugC(2, kDebugEngine, "displayChar(%d, %d)", index, var1);
|
||||
debugC(2, kDebugEngineTBC, "displayChar(%d, %d)", index, var1);
|
||||
|
||||
int indexVga = index;
|
||||
int indexChar = var1 << 5;
|
||||
|
@ -1139,7 +1138,7 @@ void LilliputEngine::displayChar(int index, int var1) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sortCharacters() {
|
||||
debugC(2, kDebugEngine, "sortCharacters()");
|
||||
debugC(2, kDebugEngineTBC, "sortCharacters()");
|
||||
|
||||
if (_numCharactersToDisplay <= 1)
|
||||
return;
|
||||
|
@ -1183,7 +1182,7 @@ void LilliputEngine::sortCharacters() {
|
|||
|
||||
// Move view port to x/y
|
||||
void LilliputEngine::scrollToViewportCharacterTarget() {
|
||||
debugC(2, kDebugEngine, "scrollToViewportCharacterTarget()");
|
||||
debugC(2, kDebugEngineTBC, "scrollToViewportCharacterTarget()");
|
||||
|
||||
if (_scriptHandler->_viewportCharacterTarget == 0xFFFF)
|
||||
return;
|
||||
|
@ -1220,7 +1219,7 @@ void LilliputEngine::scrollToViewportCharacterTarget() {
|
|||
}
|
||||
|
||||
void LilliputEngine::viewportScrollTo(Common::Point goalPos) {
|
||||
debugC(2, kDebugEngine, "viewportScrollTo(%d, %d)", goalPos.x, goalPos.y);
|
||||
debugC(2, kDebugEngineTBC, "viewportScrollTo(%d, %d)", goalPos.x, goalPos.y);
|
||||
|
||||
if (goalPos == _scriptHandler->_viewportPos)
|
||||
return;
|
||||
|
@ -1259,10 +1258,10 @@ void LilliputEngine::viewportScrollTo(Common::Point goalPos) {
|
|||
_soundHandler->contentFct5();
|
||||
}
|
||||
|
||||
void LilliputEngine::renderCharacters(byte *buf, byte x, byte y) {
|
||||
debugC(2, kDebugEngine, "renderCharacters(buf, %d, %d)", x, y);
|
||||
void LilliputEngine::renderCharacters(byte *buf, Common::Point pos) {
|
||||
debugC(2, kDebugEngineTBC, "renderCharacters(buf, %d - %d)", pos.x, pos.y);
|
||||
|
||||
if ((_nextDisplayCharacterX != x) || (_nextDisplayCharacterY != y))
|
||||
if (_nextDisplayCharacterPos != pos)
|
||||
return;
|
||||
|
||||
_byte16552 = 0;
|
||||
|
@ -1295,18 +1294,18 @@ void LilliputEngine::renderCharacters(byte *buf, byte x, byte y) {
|
|||
frame = -frame;
|
||||
}
|
||||
|
||||
displayCharacter(frame, displayX, displayY, flag);
|
||||
displayCharacter(frame, Common::Point(displayX, displayY), flag);
|
||||
}
|
||||
}
|
||||
|
||||
++_currentDisplayCharacter;
|
||||
setNextDisplayCharacter(_currentDisplayCharacter);
|
||||
|
||||
renderCharacters(buf, x, y);
|
||||
renderCharacters(buf, pos);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub1546F(byte displayX, byte displayY) {
|
||||
debugC(2, kDebugEngine, "sub1546F(%d, %d)", displayX, displayY);
|
||||
debugC(2, kDebugEngineTBC, "sub1546F(%d, %d)", displayX, displayY);
|
||||
|
||||
int orgX = displayX + 8;
|
||||
int orgY = displayY;
|
||||
|
@ -1331,7 +1330,7 @@ void LilliputEngine::sub1546F(byte displayX, byte displayY) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub15498(byte x, byte y, int var2) {
|
||||
debugC(2, kDebugEngine, "sub15498(%d, %d, %d)", x, y, var2);
|
||||
debugC(2, kDebugEngineTBC, "sub15498(%d, %d, %d)", x, y, var2);
|
||||
|
||||
int index = x + ((var2 & 0xFF) << 8) + (var2 >> 8);
|
||||
for (int i = 1 + y - var2; i > 0; i--) {
|
||||
|
@ -1341,7 +1340,7 @@ void LilliputEngine::sub15498(byte x, byte y, int var2) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub189DE() {
|
||||
debugC(2, kDebugEngine, "sub189DE()");
|
||||
debugC(2, kDebugEngineTBC, "sub189DE()");
|
||||
|
||||
if (_byte1881D != 0) {
|
||||
--_byte1881D;
|
||||
|
@ -1353,7 +1352,7 @@ void LilliputEngine::sub189DE() {
|
|||
}
|
||||
|
||||
int LilliputEngine::getDirection(Common::Point param1, Common::Point param2) {
|
||||
debugC(2, kDebugEngine, "getDirection(%d - %d, %d - %d)", param1.x, param1.y, param2.x, param2.y);
|
||||
debugC(2, kDebugEngineTBC, "getDirection(%d - %d, %d - %d)", param1.x, param1.y, param2.x, param2.y);
|
||||
|
||||
static const char _directionsArray[8] = {0, 2, 0, 1, 3, 2, 3, 1};
|
||||
|
||||
|
@ -1381,7 +1380,7 @@ int LilliputEngine::getDirection(Common::Point param1, Common::Point param2) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub16799(int index, int param1) {
|
||||
debugC(2, kDebugEngine, "sub16799(%d, %d)", index, param1);
|
||||
debugC(2, kDebugEngineTBC, "sub16799(%d, %d)", index, param1);
|
||||
|
||||
Common::Point var3 = Common::Point(_array109E9PosX[index], _array10A11PosY[index]);
|
||||
|
||||
|
@ -1411,7 +1410,7 @@ byte LilliputEngine::sub16799(int index, int param1) {
|
|||
|
||||
//TODO rename arrays
|
||||
void LilliputEngine::sub167EF(int index) {
|
||||
debugC(2, kDebugEngine, "sub167EF(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub167EF(%d)", index);
|
||||
|
||||
int word167EB = findHotspot(Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index]));
|
||||
int word167ED = findHotspot(Common::Point(_array10999PosX[index], _array109C1PosY[index]));
|
||||
|
@ -1455,8 +1454,8 @@ void LilliputEngine::sub167EF(int index) {
|
|||
return;
|
||||
}
|
||||
|
||||
int var4h = (_rectYMinMax[index] >> 8);
|
||||
int var4l = (_rectYMinMax[index] & 0xFF);
|
||||
var4h = (_rectYMinMax[index] >> 8);
|
||||
var4l = (_rectYMinMax[index] & 0xFF);
|
||||
|
||||
if (var4h != var4l) {
|
||||
if (_array10A11PosY[index] == var4h)
|
||||
|
@ -1483,7 +1482,7 @@ void LilliputEngine::sub167EF(int index) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub1693A(int index) {
|
||||
debugC(2, kDebugEngine, "sub1693A(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub1693A(%d)", index);
|
||||
|
||||
static const uint16 _array1692F[4] = {4, 0xFF00, 0x100, 0xFFFC};
|
||||
|
||||
|
@ -1531,7 +1530,7 @@ void LilliputEngine::sub1693A(int index) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub16A76(int indexb, int indexs) {
|
||||
debugC(2, kDebugEngine, "sub16A76(%d, %d)", indexb, indexs);
|
||||
debugC(2, kDebugEngineTBC, "sub16A76(%d, %d)", indexb, indexs);
|
||||
|
||||
static const char _array16A6C[4] = {1, 0, 0, -1};
|
||||
static const char _array16A70[4] = {0, -1, 1, 0};
|
||||
|
@ -1561,7 +1560,7 @@ byte LilliputEngine::sub16A76(int indexb, int indexs) {
|
|||
}
|
||||
|
||||
int LilliputEngine::findHotspot(Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "findHotspot(%d, %d)", pos.x, pos.y);
|
||||
debugC(2, kDebugEngineTBC, "findHotspot(%d, %d)", pos.x, pos.y);
|
||||
|
||||
for (int i = 0; i < _rulesChunk12_size; i++) {
|
||||
if ((pos.x >= (_rectXMinMax[i] >> 8)) && (pos.x <= (_rectXMinMax[i] & 0xFF)) && (pos.y >= (_rectYMinMax[i] >> 8)) && (pos.y <= (_rectYMinMax[i] & 0xFF)))
|
||||
|
@ -1571,7 +1570,7 @@ int LilliputEngine::findHotspot(Common::Point pos) {
|
|||
}
|
||||
|
||||
int LilliputEngine::reverseFindHotspot(Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "reverseFindHotspot(%d, %d)", pos.x, pos.y);
|
||||
debugC(2, kDebugEngineTBC, "reverseFindHotspot(%d, %d)", pos.x, pos.y);
|
||||
|
||||
for (int i = _rulesChunk12_size - 1; i >= 0 ; i--) {
|
||||
if ((pos.x >= (_rectXMinMax[i] >> 8)) && (pos.x <= (_rectXMinMax[i] & 0xFF)) && (pos.y >= (_rectYMinMax[i] >> 8)) && (pos.y<= (_rectYMinMax[i] & 0xFF)))
|
||||
|
@ -1582,7 +1581,7 @@ int LilliputEngine::reverseFindHotspot(Common::Point pos) {
|
|||
|
||||
|
||||
void LilliputEngine::sub16A08(int index) {
|
||||
debugC(2, kDebugEngine, "sub16A08(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub16A08(%d)", index);
|
||||
|
||||
static const byte _array169F8[4] = {1, 0, 0, 0xFF};
|
||||
static const byte _array169FC[4] = {0, 0xFF, 1, 0};
|
||||
|
@ -1612,7 +1611,7 @@ void LilliputEngine::sub16A08(int index) {
|
|||
}
|
||||
|
||||
void LilliputEngine::addCharToBuf(byte character) {
|
||||
debugC(2, kDebugEngine, "addCharToBuf(%c)", character);
|
||||
debugC(2, kDebugEngineTBC, "addCharToBuf(%c)", character);
|
||||
|
||||
_displayStringBuf[_displayStringIndex] = character;
|
||||
if (_displayStringIndex < 158)
|
||||
|
@ -1620,7 +1619,7 @@ void LilliputEngine::addCharToBuf(byte character) {
|
|||
}
|
||||
|
||||
void LilliputEngine::prepareGoldAmount(int param1) {
|
||||
debugC(2, kDebugEngine, "prepareGoldAmount(%d)", param1);
|
||||
debugC(2, kDebugEngineTBC, "prepareGoldAmount(%d)", param1);
|
||||
|
||||
static const int _array18AE3[6] = {10000, 1000, 100, 10, 1};
|
||||
|
||||
|
@ -1648,7 +1647,7 @@ void LilliputEngine::prepareGoldAmount(int param1) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16626() {
|
||||
debugC(2, kDebugEngine, "sub16626()");
|
||||
debugC(2, kDebugEngineTBC, "sub16626()");
|
||||
|
||||
int index = _numCharacters - 1;
|
||||
byte result;
|
||||
|
@ -1716,7 +1715,7 @@ void LilliputEngine::sub16626() {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub166EA(int index) {
|
||||
debugC(2, kDebugEngine, "sub166EA(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166EA(%d)", index);
|
||||
|
||||
_scriptHandler->_array12811[index] = 0x10;
|
||||
_scriptHandler->_characterScriptEnabled[index] = 1;
|
||||
|
@ -1724,7 +1723,7 @@ byte LilliputEngine::sub166EA(int index) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub166F7(int index, Common::Point var1, int tmpVal) {
|
||||
debugC(2, kDebugEngine, "sub166F7(%d, %d - %d, %d)", index, var1.x, var1.y, tmpVal);
|
||||
debugC(2, kDebugEngineTBC, "sub166F7(%d, %d - %d, %d)", index, var1.x, var1.y, tmpVal);
|
||||
|
||||
byte a2 = var1.y;
|
||||
if (a2 != 0) {
|
||||
|
@ -1743,7 +1742,7 @@ byte LilliputEngine::sub166F7(int index, Common::Point var1, int tmpVal) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub166DD(int index, int var1) {
|
||||
debugC(2, kDebugEngine, "sub166DD(%d, %d)", index, var1);
|
||||
debugC(2, kDebugEngineTBC, "sub166DD(%d, %d)", index, var1);
|
||||
|
||||
_characterDirectionArray[index] = (var1 >> 8) & 3;
|
||||
sub16685(index, var1 & 0xFF);
|
||||
|
@ -1751,14 +1750,14 @@ byte LilliputEngine::sub166DD(int index, int var1) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub16722(int index, byte var1) {
|
||||
debugC(2, kDebugEngine, "sub16722(%d, %d)", index, var1);
|
||||
debugC(2, kDebugEngineTBC, "sub16722(%d, %d)", index, var1);
|
||||
|
||||
_rulesBuffer2_10[index] = var1;
|
||||
return 2;
|
||||
}
|
||||
|
||||
byte LilliputEngine::sub16729(int index) {
|
||||
debugC(2, kDebugEngine, "sub16729(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub16729(%d)", index);
|
||||
|
||||
int arg1 = index | 0xFF00;
|
||||
Common::Point pos1 = Common::Point(_scriptHandler->_array16123PosX[index], _scriptHandler->_array1614BPosY[index]);
|
||||
|
@ -1768,7 +1767,7 @@ byte LilliputEngine::sub16729(int index) {
|
|||
}
|
||||
|
||||
byte LilliputEngine::sub1675D(int index, int var1) {
|
||||
debugC(2, kDebugEngine, "sub1675D(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub1675D(%d)", index);
|
||||
|
||||
int var2 = _scriptHandler->_array10A39[index];
|
||||
int var1h = _scriptHandler->_array16123PosX[var2];
|
||||
|
@ -1790,7 +1789,7 @@ byte LilliputEngine::sub1675D(int index, int var1) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16EBC() {
|
||||
debugC(2, kDebugEngine, "sub16EBC()");
|
||||
debugC(2, kDebugEngineTBC, "sub16EBC()");
|
||||
|
||||
int index2 = 3;
|
||||
|
||||
|
@ -1808,7 +1807,7 @@ void LilliputEngine::sub16EBC() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub12F37() {
|
||||
debugC(2, kDebugEngine, "sub12F37()");
|
||||
debugC(2, kDebugEngineTBC, "sub12F37()");
|
||||
|
||||
int index1 = _byte12A04 + 2;
|
||||
int index2 = 0;
|
||||
|
@ -1837,7 +1836,7 @@ void LilliputEngine::sub130EE() {
|
|||
// warning("sub13156");
|
||||
|
||||
if (_mouseButton == 0)
|
||||
// TODO: check _mouse_byte1299F
|
||||
// TODO: check _mouse_clicked
|
||||
return;
|
||||
|
||||
int button = _mouseButton;
|
||||
|
@ -1854,29 +1853,24 @@ void LilliputEngine::sub130EE() {
|
|||
if (forceReturnFl)
|
||||
return;
|
||||
|
||||
int posX = _mousePos.x - 64;
|
||||
int posY = _mousePos.y - 16;
|
||||
Common::Point pos = Common::Point(_mousePos.x - 64, _mousePos.y - 16);
|
||||
|
||||
if ((posX < 0) || (posX > 255))
|
||||
return;
|
||||
|
||||
if ((posY < 0) || (posY > 176))
|
||||
if ((pos.x < 0) || (pos.x > 255) || (pos.y < 0) || (pos.y > 176))
|
||||
return;
|
||||
|
||||
forceReturnFl = false;
|
||||
sub131B2(posX, posY, forceReturnFl);
|
||||
sub131B2(pos, forceReturnFl);
|
||||
if (forceReturnFl)
|
||||
return;
|
||||
|
||||
sub131FC(posX, posY);
|
||||
sub131FC(pos);
|
||||
}
|
||||
|
||||
// TODO use Common::Point
|
||||
void LilliputEngine::sub131FC(int var2, int var4) {
|
||||
debugC(2, kDebugEngine, "sub131FC(%d, %d)", var2, var4);
|
||||
void LilliputEngine::sub131FC(Common::Point pos) {
|
||||
debugC(2, kDebugEngine, "sub131FC(%d, %d)", pos.x, pos.y);
|
||||
|
||||
int x = var2 - 8;
|
||||
int y = var4 - 4;
|
||||
int x = pos.x - 8;
|
||||
int y = pos.y - 4;
|
||||
|
||||
x = (x >> 4) - 7;
|
||||
y = (y >> 3) - 4;
|
||||
|
@ -1892,13 +1886,13 @@ void LilliputEngine::sub131FC(int var2, int var4) {
|
|||
}
|
||||
}
|
||||
|
||||
void LilliputEngine::sub131B2(int var2, int var4, bool &forceReturnFl) {
|
||||
debugC(2, kDebugEngine, "sub131B2(%d, %d)", var2, var4);
|
||||
void LilliputEngine::sub131B2(Common::Point pos, bool &forceReturnFl) {
|
||||
debugC(2, kDebugEngine, "sub131B2(%d, %d)", pos.x, pos.y);
|
||||
|
||||
forceReturnFl = false;
|
||||
|
||||
for (int i = 0; i < _numCharacters; i++) {
|
||||
if ((var2 >= _characterDisplayX[i]) && (var2 <= _characterDisplayX[i] + 17) && (var4 >= _characterDisplayY[i]) && (var4 <= _characterDisplayY[i] + 17) && (i != _word10804)) {
|
||||
if ((pos.x >= _characterDisplayX[i]) && (pos.x <= _characterDisplayX[i] + 17) && (pos.y >= _characterDisplayY[i]) && (pos.y <= _characterDisplayY[i] + 17) && (i != _word10804)) {
|
||||
_byte129A0 = i;
|
||||
_byte16F07_menuId = 4;
|
||||
if (_byte12FCE == 1)
|
||||
|
@ -1912,7 +1906,7 @@ void LilliputEngine::sub131B2(int var2, int var4, bool &forceReturnFl) {
|
|||
}
|
||||
|
||||
void LilliputEngine::checkInterfaceHotspots(bool &forceReturnFl) {
|
||||
debugC(2, kDebugEngine, "checkInterfaceHotspots()");
|
||||
debugC(2, kDebugEngineTBC, "checkInterfaceHotspots()");
|
||||
|
||||
forceReturnFl = false;
|
||||
for (int index = _word12F68_ERULES - 1; index >= 0; index--) {
|
||||
|
@ -1925,7 +1919,7 @@ void LilliputEngine::checkInterfaceHotspots(bool &forceReturnFl) {
|
|||
}
|
||||
|
||||
int LilliputEngine::sub13240(Common::Point mousePos, int var3, int var4) {
|
||||
debugC(2, kDebugEngine, "sub13240(%d, %d, %d, %d)", mousePos.x, mousePos.y, var3, var4);
|
||||
debugC(2, kDebugEngineTBC, "sub13240(%d, %d, %d, %d)", mousePos.x, mousePos.y, var3, var4);
|
||||
|
||||
if ((mousePos.x < var3) || (mousePos.y < var4))
|
||||
return -1;
|
||||
|
@ -1940,7 +1934,7 @@ int LilliputEngine::sub13240(Common::Point mousePos, int var3, int var4) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub1305C(byte index, byte button) {
|
||||
debugC(2, kDebugEngine, "sub1305C(%d, %d)", index, button);
|
||||
debugC(2, kDebugEngineTBC, "sub1305C(%d, %d)", index, button);
|
||||
|
||||
if (_scriptHandler->_array122E9[index] < 2)
|
||||
return;
|
||||
|
@ -1975,14 +1969,14 @@ void LilliputEngine::sub1305C(byte index, byte button) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16685(int idx, int var1) {
|
||||
debugC(2, kDebugEngine, "sub16685(%d, %d)", idx, var1);
|
||||
debugC(2, kDebugEngineTBC, "sub16685(%d, %d)", idx, var1);
|
||||
|
||||
int index = (idx << 5) + (var1 & 0xFF);
|
||||
_scriptHandler->_array10AB1[idx] = _rulesBuffer2_16[index];
|
||||
}
|
||||
|
||||
byte LilliputEngine::sub16675(int idx, int var1) {
|
||||
debugC(2, kDebugEngine, "sub16675(%d, %d)", idx, var1);
|
||||
debugC(2, kDebugEngineTBC, "sub16675(%d, %d)", idx, var1);
|
||||
|
||||
sub16685(idx, var1);
|
||||
int index = (var1 & 0xFF);
|
||||
|
@ -2027,69 +2021,69 @@ byte LilliputEngine::sub16675(int idx, int var1) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16B63(int index) {
|
||||
debugC(2, kDebugEngine, "sub16B63(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub16B63(%d)", index);
|
||||
|
||||
static const byte nextDirection[4] = {1, 3, 0, 2};
|
||||
_characterDirectionArray[index] = nextDirection[_characterDirectionArray[index]];
|
||||
}
|
||||
|
||||
void LilliputEngine::sub16B76(int index) {
|
||||
debugC(2, kDebugEngine, "sub16B76(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub16B76(%d)", index);
|
||||
|
||||
static const byte nextDirection[4] = {2, 0, 3, 1};
|
||||
_characterDirectionArray[index] = nextDirection[_characterDirectionArray[index]];
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166C0(int index) {
|
||||
debugC(2, kDebugEngine, "sub166C0(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166C0(%d)", index);
|
||||
|
||||
_characterPositionAltitude[index] += 1;
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166C6(int index) {
|
||||
debugC(2, kDebugEngine, "sub166C6(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166C6(%d)", index);
|
||||
|
||||
_characterPositionAltitude[index] += 2;
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166CC(int index) {
|
||||
debugC(2, kDebugEngine, "sub166CC(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166CC(%d)", index);
|
||||
|
||||
_characterPositionAltitude[index] -= 1;
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166D2(int index) {
|
||||
debugC(2, kDebugEngine, "sub166D2(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166D2(%d)", index);
|
||||
|
||||
_characterPositionAltitude[index] -= 2;
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166B1(int index) {
|
||||
debugC(2, kDebugEngine, "sub166B1(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166B1(%d)", index);
|
||||
|
||||
sub16B31(index, 2);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166B6(int index) {
|
||||
debugC(2, kDebugEngine, "sub166B6(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166B6(%d)", index);
|
||||
|
||||
sub16B31(index, 4);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166BB(int index) {
|
||||
debugC(2, kDebugEngine, "sub166BB(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166BB(%d)", index);
|
||||
|
||||
sub16B31(index, 0xFE);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub166D8(int index) {
|
||||
debugC(2, kDebugEngine, "sub166D8(%d)", index);
|
||||
debugC(2, kDebugEngineTBC, "sub166D8(%d)", index);
|
||||
|
||||
sub16B31(index, 3);
|
||||
}
|
||||
|
||||
void LilliputEngine::sub16B31(int index, int val) {
|
||||
debugC(2, kDebugEngine, "sub16B31(%d, %d)", index, val);
|
||||
debugC(2, kDebugEngineTBC, "sub16B31(%d, %d)", index, val);
|
||||
|
||||
int newX = _characterPositionX[index];
|
||||
int newY = _characterPositionY[index];
|
||||
|
@ -2111,7 +2105,7 @@ void LilliputEngine::sub16B31(int index, int val) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub16B8F(int index, int x, int y, int flag) {
|
||||
debugC(2, kDebugEngine, "sub16B8F(%d, %d, %d)", index, x, y);
|
||||
debugC(2, kDebugEngineTBC, "sub16B8F(%d, %d, %d)", index, x, y);
|
||||
|
||||
int diffX = x >> 3;
|
||||
if (((diffX & 0xFF) == _scriptHandler->_array16123PosX[index]) && ((y >> 3) == _scriptHandler->_array1614BPosY[index])) {
|
||||
|
@ -2146,7 +2140,7 @@ void LilliputEngine::sub16B8F(int index, int x, int y, int flag) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub17224(int var1, int var4) {
|
||||
debugC(2, kDebugEngine, "sub17224(%d, %d)", var1, var4);
|
||||
debugC(2, kDebugEngineTBC, "sub17224(%d, %d)", var1, var4);
|
||||
|
||||
byte type = (var1 >> 8);
|
||||
if (type == 0) {
|
||||
|
@ -2169,7 +2163,7 @@ void LilliputEngine::sub17224(int var1, int var4) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub17264(int index, int var4) {
|
||||
debugC(2, kDebugEngine, "sub17264(%d, %d)", index, var4);
|
||||
debugC(2, kDebugEngineTBC, "sub17264(%d, %d)", index, var4);
|
||||
|
||||
if (_array11D49[index] != 0xFFFF) {
|
||||
_array1289F[index] = var4;
|
||||
|
@ -2180,7 +2174,7 @@ void LilliputEngine::sub17264(int index, int var4) {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub171CF() {
|
||||
debugC(2, kDebugEngine, "sub171CF()");
|
||||
debugC(2, kDebugEngineTBC, "sub171CF()");
|
||||
|
||||
for (int i = 0; i < _numCharacters; i++) {
|
||||
if (_array1289F[i] != 0xFFFF) {
|
||||
|
@ -2204,7 +2198,7 @@ void LilliputEngine::sub171CF() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub12FE5() {
|
||||
debugC(2, kDebugEngine, "sub12FE5()");
|
||||
debugC(2, kDebugEngineTBC, "sub12FE5()");
|
||||
|
||||
if (_byte12A04 != 1)
|
||||
return;
|
||||
|
@ -2226,7 +2220,7 @@ void LilliputEngine::sub12FE5() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayHeroismIndicator() {
|
||||
debugC(2, kDebugEngine, "displayHeroismIndicator()");
|
||||
debugC(2, kDebugEngineTBC, "displayHeroismIndicator()");
|
||||
|
||||
if (_scriptHandler->_savedBuffer215Ptr == NULL)
|
||||
return;
|
||||
|
@ -2275,7 +2269,7 @@ void LilliputEngine::displayHeroismIndicator() {
|
|||
}
|
||||
|
||||
void LilliputEngine::pollEvent() {
|
||||
debugC(2, kDebugEngine, "pollEvent()");
|
||||
debugC(2, kDebugEngineTBC, "pollEvent()");
|
||||
|
||||
Common::Event event;
|
||||
while (_system->getEventManager()->pollEvent(event)) {
|
||||
|
@ -2548,7 +2542,7 @@ void LilliputEngine::loadRules() {
|
|||
}
|
||||
|
||||
void LilliputEngine::displayVGAFile(Common::String fileName) {
|
||||
debugC(1, kDebugEngine, "displayVGAFile(%s)", fileName.c_str());
|
||||
debugC(1, kDebugEngineTBC, "displayVGAFile(%s)", fileName.c_str());
|
||||
|
||||
displayFunction4();
|
||||
|
||||
|
@ -2585,7 +2579,7 @@ void LilliputEngine::initPalette() {
|
|||
}
|
||||
|
||||
void LilliputEngine::sub170EE(int index) {
|
||||
debugC(1, kDebugEngine, "sub170EE(%d)", index);
|
||||
debugC(1, kDebugEngineTBC, "sub170EE(%d)", index);
|
||||
|
||||
_currentScriptCharacter = index;
|
||||
|
||||
|
@ -2602,7 +2596,7 @@ void LilliputEngine::sub130DD() {
|
|||
}
|
||||
|
||||
void LilliputEngine::handleMenu() {
|
||||
debugC(1, kDebugEngine, "handleMenu()");
|
||||
debugC(1, kDebugEngineTBC, "handleMenu()");
|
||||
|
||||
if (_byte16F07_menuId == 0)
|
||||
return;
|
||||
|
@ -2611,9 +2605,9 @@ void LilliputEngine::handleMenu() {
|
|||
return;
|
||||
|
||||
sub170EE(_word10804);
|
||||
debugC(1, kDebugScript, "========================== Menu Script ==============================");
|
||||
debugC(1, kDebugScriptTBC, "========================== Menu Script ==============================");
|
||||
_scriptHandler->runMenuScript(ScriptStream(_menuScript, _menuScript_size));
|
||||
debugC(1, kDebugScript, "========================== End of Menu Script==============================");
|
||||
debugC(1, kDebugScriptTBC, "========================== End of Menu Script==============================");
|
||||
_savedMousePosDivided = Common::Point(-1, -1);
|
||||
_byte129A0 = 0xFF;
|
||||
|
||||
|
@ -2624,7 +2618,7 @@ void LilliputEngine::handleMenu() {
|
|||
}
|
||||
|
||||
void LilliputEngine::handleGameScripts() {
|
||||
debugC(1, kDebugEngine, "handleGameScripts()");
|
||||
debugC(1, kDebugEngineTBC, "handleGameScripts()");
|
||||
|
||||
int index = _word17081_nextIndex;
|
||||
int i;
|
||||
|
@ -2654,23 +2648,23 @@ void LilliputEngine::handleGameScripts() {
|
|||
/*
|
||||
for (int i = 0; i < _gameScriptIndexSize; i++) {
|
||||
assert(tmpVal < _gameScriptIndexSize);
|
||||
debugC(1, kDebugEngine, "================= Game Script %d ==================", i);
|
||||
debugC(1, kDebugEngineTBC, "================= Game Script %d ==================", i);
|
||||
ScriptStream script = ScriptStream(&_arrayGameScripts[_arrayGameScriptIndex[i]], _arrayGameScriptIndex[i + 1] - _arrayGameScriptIndex[i]);
|
||||
_scriptHandler->disasmScript(script);
|
||||
debugC(1, kDebugEngine, "============= End Game Script %d ==================", i);
|
||||
debugC(1, kDebugEngineTBC, "============= End Game Script %d ==================", i);
|
||||
}
|
||||
|
||||
while(1);*/
|
||||
|
||||
assert(tmpVal < _gameScriptIndexSize);
|
||||
debugC(1, kDebugEngine, "================= Game Script %d for character %d ==================", tmpVal, index);
|
||||
debugC(1, kDebugEngineTBC, "================= Game Script %d for character %d ==================", tmpVal, index);
|
||||
_scriptHandler->runScript(ScriptStream(&_arrayGameScripts[_arrayGameScriptIndex[tmpVal]], _arrayGameScriptIndex[tmpVal + 1] - _arrayGameScriptIndex[tmpVal]));
|
||||
debugC(1, kDebugEngine, "============= End Game Script %d for character %d ==================", tmpVal, index);
|
||||
debugC(1, kDebugEngineTBC, "============= End Game Script %d for character %d ==================", tmpVal, index);
|
||||
|
||||
|
||||
//warning("dump char stat");
|
||||
i = index;
|
||||
debugC(3, kDebugEngine, "char %d, pos %d %d, state %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), _scriptHandler->_characterScriptEnabled[i]);
|
||||
debugC(3, kDebugEngineTBC, "char %d, pos %d %d, state %d, script enabled %d", i, _characterPositionX[i], _characterPositionY[i], *getCharacterVariablesPtr(i * 32 + 0), _scriptHandler->_characterScriptEnabled[i]);
|
||||
}
|
||||
|
||||
Common::Error LilliputEngine::run() {
|
||||
|
@ -2684,6 +2678,7 @@ Common::Error LilliputEngine::run() {
|
|||
|
||||
// Setup mixer
|
||||
syncSoundSettings();
|
||||
//TODO: Init sound/music player
|
||||
|
||||
initPalette();
|
||||
|
||||
|
@ -2695,14 +2690,15 @@ Common::Error LilliputEngine::run() {
|
|||
_bufferIsoMap = loadRaw("ISOMAP.DTA");
|
||||
|
||||
loadRules();
|
||||
// Hack: int8 should be installed at this point, but it's crashing during the
|
||||
// rendering when the title screens are displayed
|
||||
//_int8installed = true;
|
||||
|
||||
_lastTime = _system->getMillis();
|
||||
|
||||
|
||||
|
||||
//TODO: Init sound/music player
|
||||
_scriptHandler->runScript(ScriptStream(_initScript, _initScript_size));
|
||||
|
||||
// Hack, see above
|
||||
_int8installed = true;
|
||||
|
||||
while(!_shouldQuit) {
|
||||
|
@ -2732,7 +2728,7 @@ void LilliputEngine::initialize() {
|
|||
}
|
||||
|
||||
byte *LilliputEngine::getCharacterVariablesPtr(int16 index) {
|
||||
debugC(1, kDebugEngine, "getCharacterVariablesPtr(%d)", index);
|
||||
debugC(1, kDebugEngineTBC, "getCharacterVariablesPtr(%d)", index);
|
||||
|
||||
assert((index > -3120) && (index < 1400));
|
||||
if (index >= 0)
|
||||
|
|
|
@ -61,7 +61,9 @@ enum GameType {
|
|||
enum LilliputDebugChannels {
|
||||
kDebugEngine = 1 << 0,
|
||||
kDebugScript = 1 << 1,
|
||||
kDebugSound = 1 << 2
|
||||
kDebugSound = 1 << 2,
|
||||
kDebugEngineTBC = 1 << 3,
|
||||
kDebugScriptTBC = 1 << 4
|
||||
};
|
||||
|
||||
struct LilliputGameDescription;
|
||||
|
@ -90,8 +92,7 @@ public:
|
|||
struct18560 _arr18560[4];
|
||||
byte _byte1714E;
|
||||
byte _byte184F4;
|
||||
byte _nextDisplayCharacterX;
|
||||
byte _nextDisplayCharacterY;
|
||||
Common::Point _nextDisplayCharacterPos;
|
||||
byte _sound_byte16F06;
|
||||
byte _byte16F09;
|
||||
byte _keyboard_nextIndex;
|
||||
|
@ -239,7 +240,7 @@ public:
|
|||
void displayFunction17();
|
||||
void displayFunction18(int var1, int var2, int var3, int var4);
|
||||
|
||||
void displayCharacter(int index, int x, int y, int flags);
|
||||
void displayCharacter(int index, Common::Point pos, int flags);
|
||||
void displayString(byte *buf, int var2, int var4);
|
||||
void displayChar(int index, int var1);
|
||||
void sub130B6();
|
||||
|
@ -263,7 +264,7 @@ public:
|
|||
byte sub166EA(int index);
|
||||
void sub167EF(int index);
|
||||
|
||||
void renderCharacters(byte *buf, byte x, byte y);
|
||||
void renderCharacters(byte *buf, Common::Point pos);
|
||||
|
||||
byte sub16799(int param1, int index);
|
||||
int getDirection(Common::Point param1, Common::Point param2);
|
||||
|
@ -285,8 +286,8 @@ public:
|
|||
void sub1305C(byte index, byte var2);
|
||||
void checkInterfaceHotspots(bool &forceReturnFl);
|
||||
int sub13240(Common::Point mousePos, int var3, int var4);
|
||||
void sub131B2(int var2, int var4, bool &forceReturnFl);
|
||||
void sub131FC(int var2, int var4);
|
||||
void sub131B2(Common::Point pos, bool &forceReturnFl);
|
||||
void sub131FC(Common::Point pos);
|
||||
void sub1546F(byte displayX, byte displayY);
|
||||
void sub15498(byte x, byte y, int var2);
|
||||
void sub15A4C(int &vgaIndex, byte *srcBuf, int &bufIndex);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -40,7 +40,7 @@ enum KValueType {
|
|||
kCompareOperation,
|
||||
kComputeOperation,
|
||||
kGetValue1,
|
||||
kgetPosFromScript,
|
||||
kgetPosFromScript
|
||||
};
|
||||
|
||||
|
||||
|
@ -115,6 +115,9 @@ private:
|
|||
int _word16F00;
|
||||
int _word18776;
|
||||
int _word18821;
|
||||
int _word129A3;
|
||||
|
||||
char _array129A5[4];
|
||||
|
||||
int handleOpcode(ScriptStream *script);
|
||||
byte handleOpcodeType1(int curWord);
|
||||
|
|
|
@ -33,6 +33,11 @@ LilliputSound::LilliputSound(LilliputEngine *vm) : _vm(vm) {
|
|||
LilliputSound::~LilliputSound() {
|
||||
}
|
||||
|
||||
// Used during initialisation
|
||||
void LilliputSound::contentFct0() {
|
||||
debugC(1, kDebugSound, "contentFct0()");
|
||||
}
|
||||
|
||||
void LilliputSound::contentFct1() {
|
||||
debugC(1, kDebugSound, "contentFct1()");
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
LilliputSound(LilliputEngine *vm);
|
||||
~LilliputSound();
|
||||
|
||||
void contentFct0();
|
||||
void contentFct1();
|
||||
void contentFct2();
|
||||
void contentFct3();
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
namespace Lilliput {
|
||||
|
||||
ScriptStream::ScriptStream(byte *buf, int size) : Common::MemoryReadStream(buf, size) {
|
||||
ScriptStream::ScriptStream(byte *buf, int bufSize) : Common::MemoryReadStream(buf, bufSize) {
|
||||
_orgPtr = buf;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ class ScriptStream : public Common::MemoryReadStream {
|
|||
private:
|
||||
byte *_orgPtr;
|
||||
public:
|
||||
ScriptStream(byte *buf, int size);
|
||||
ScriptStream(byte *buf, int bufSize);
|
||||
virtual ~ScriptStream();
|
||||
|
||||
void writeUint16LE(int value, int relativePos = 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue