KYRA: Make all hex constants use uppercase letters.

Done with:
git ls-files "*.cpp" *".h" | xargs sed -i -e 's/0x\([0-9a-f]*\)/0x\U\1/g'
This commit is contained in:
Johannes Schickel 2013-01-09 06:00:35 +01:00
parent ff296175bc
commit 8d5b4b75d4
57 changed files with 835 additions and 835 deletions

View file

@ -193,7 +193,7 @@ bool CharacterGenerator::start(EoBCharacter *characters, uint8 ***faceShapes) {
} }
if (inputFlag & 0x8000) { if (inputFlag & 0x8000) {
inputFlag = (inputFlag & 0x0f) - 1; inputFlag = (inputFlag & 0x0F) - 1;
if (inputFlag == 4) { if (inputFlag == 4) {
loop = false; loop = false;
} else { } else {
@ -402,7 +402,7 @@ int CharacterGenerator::viewDeleteCharacter() {
} }
if (inputFlag & 0x8000) { if (inputFlag & 0x8000) {
inputFlag = (inputFlag & 0x0f) - 1; inputFlag = (inputFlag & 0x0F) - 1;
if (inputFlag == 4) { if (inputFlag == 4) {
res = 1; res = 1;
loop = false; loop = false;
@ -524,7 +524,7 @@ int CharacterGenerator::classMenu(int raceSex) {
while (res == -1 && !_vm->shouldQuit()) { while (res == -1 && !_vm->shouldQuit()) {
updateMagicShapes(); updateMagicShapes();
int in = getInput(0) & 0xff; int in = getInput(0) & 0xFF;
Common::Point mp = _vm->getMousePos(); Common::Point mp = _vm->getMousePos();
if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) { if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) {
@ -572,7 +572,7 @@ int CharacterGenerator::alignmentMenu(int cClass) {
while (res == -1 && !_vm->shouldQuit()) { while (res == -1 && !_vm->shouldQuit()) {
updateMagicShapes(); updateMagicShapes();
int in = getInput(0) & 0xff; int in = getInput(0) & 0xFF;
Common::Point mp = _vm->getMousePos(); Common::Point mp = _vm->getMousePos();
if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) { if (in == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_ESCAPE] || _vm->_gui->_menuLastInFlags == _vm->_keyMap[Common::KEYCODE_b]) {
@ -658,14 +658,14 @@ void CharacterGenerator::generateStats(int index) {
sv[i] = _chargenMaxStats[i]; sv[i] = _chargenMaxStats[i];
} }
c->strengthCur = c->strengthMax = sv[0] & 0xff; c->strengthCur = c->strengthMax = sv[0] & 0xFF;
c->strengthExtCur = c->strengthExtMax = sv[0] >> 8; c->strengthExtCur = c->strengthExtMax = sv[0] >> 8;
c->intelligenceCur = c->intelligenceMax = sv[1] & 0xff; c->intelligenceCur = c->intelligenceMax = sv[1] & 0xFF;
c->wisdomCur = c->wisdomMax = sv[2] & 0xff; c->wisdomCur = c->wisdomMax = sv[2] & 0xFF;
c->dexterityCur = c->dexterityMax = sv[3] & 0xff; c->dexterityCur = c->dexterityMax = sv[3] & 0xFF;
c->constitutionCur = c->constitutionMax = sv[4] & 0xff; c->constitutionCur = c->constitutionMax = sv[4] & 0xFF;
c->charismaCur = c->charismaMax = sv[5] & 0xff; c->charismaCur = c->charismaMax = sv[5] & 0xFF;
c->armorClass = 10 + _vm->getDexterityArmorClassModifier(sv[3] & 0xff); c->armorClass = 10 + _vm->getDexterityArmorClassModifier(sv[3] & 0xFF);
c->hitPointsCur = 0; c->hitPointsCur = 0;
for (int l = 0; l < 3; l++) { for (int l = 0; l < 3; l++) {
@ -817,7 +817,7 @@ void CharacterGenerator::faceSelectMenu() {
} else if (in == _vm->_keyMap[Common::KEYCODE_RETURN] || in == _vm->_keyMap[Common::KEYCODE_KP5]) { } else if (in == _vm->_keyMap[Common::KEYCODE_RETURN] || in == _vm->_keyMap[Common::KEYCODE_KP5]) {
in = 3; in = 3;
} else if (in & 0x8000) { } else if (in & 0x8000) {
in &= 0xff; in &= 0xFF;
} else { } else {
in = 0; in = 0;
} }
@ -1017,7 +1017,7 @@ int CharacterGenerator::modifyStat(int index, int8 *stat1, int8 *stat2) {
ci = -2; ci = -2;
} else if (inputFlag & 0x8000) { } else if (inputFlag & 0x8000) {
inputFlag = (inputFlag & 0x0f) - 1; inputFlag = (inputFlag & 0x0F) - 1;
if (index != inputFlag) { if (index != inputFlag) {
ci = inputFlag; ci = inputFlag;
loop = false; loop = false;
@ -1037,7 +1037,7 @@ int CharacterGenerator::modifyStat(int index, int8 *stat1, int8 *stat2) {
v2--; v2--;
} }
v1 = CLIP<uint8>(v1, _chargenMinStats[index], _chargenMaxStats[index] & 0xff); v1 = CLIP<uint8>(v1, _chargenMinStats[index], _chargenMaxStats[index] & 0xFF);
v2 = (v1 == 18 && _chargenMaxStats[index] >= 19) ? CLIP<uint8>(v2, 0, 100) : 0; v2 = (v1 == 18 && _chargenMaxStats[index] >= 19) ? CLIP<uint8>(v2, 0, 100) : 0;
if (s2) if (s2)
*s2 = v2; *s2 = v2;
@ -1614,7 +1614,7 @@ int TransferPartyWiz::selectCharactersMenu() {
bool update = false; bool update = false;
for (bool loop = true; loop && (!_vm->shouldQuit());) { for (bool loop = true; loop && (!_vm->shouldQuit());) {
int inputFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag) { if (inputFlag) {
@ -1827,7 +1827,7 @@ Item TransferPartyWiz::convertItem(Item eob1Item) {
itm2->flags = itm1->flags | 0x40; itm2->flags = itm1->flags | 0x40;
itm2->icon = itm1->icon; itm2->icon = itm1->icon;
itm2->type = itm1->type; itm2->type = itm1->type;
itm2->level = 0xff; itm2->level = 0xFF;
switch (itm2->type) { switch (itm2->type) {
case 35: case 35:
@ -1850,7 +1850,7 @@ Item TransferPartyWiz::convertItem(Item eob1Item) {
return 0; return 0;
} }
itm2->value = itm1->value; itm2->value = itm1->value;
itm2->flags = ((itm1->flags & 0x3f) + 3) | 0x40; itm2->flags = ((itm1->flags & 0x3F) + 3) | 0x40;
break; break;
case 18: case 18:
itm2->icon = 19; itm2->icon = 19;
@ -1860,7 +1860,7 @@ Item TransferPartyWiz::convertItem(Item eob1Item) {
break; break;
} }
switch ((_vm->_itemTypes[itm2->type].extraProperties & 0x7f) - 1) { switch ((_vm->_itemTypes[itm2->type].extraProperties & 0x7F) - 1) {
case 0: case 0:
case 1: case 1:
case 2: case 2:

View file

@ -136,7 +136,7 @@ void DarkMoonEngine::updateUsedCharacterHandItem(int charIndex, int slot) {
if (itm->type == 48 || itm->type == 62) { if (itm->type == 48 || itm->type == 62) {
if (itm->value == 5) if (itm->value == 5)
return; return;
int charges = itm->flags & 0x3f; int charges = itm->flags & 0x3F;
if (--charges) if (--charges)
--itm->flags; --itm->flags;
else else
@ -450,7 +450,7 @@ void DarkMoonEngine::characterLevelGain(int charIndex) {
int s = _numLevelsPerClass[c->cClass]; int s = _numLevelsPerClass[c->cClass];
for (int i = 0; i < s; i++) { for (int i = 0; i < s; i++) {
uint32 er = getRequiredExperience(c->cClass, i, c->level[i] + 1); uint32 er = getRequiredExperience(c->cClass, i, c->level[i] + 1);
if (er == 0xffffffff) if (er == 0xFFFFFFFF)
continue; continue;
increaseCharacterExperience(charIndex, er - c->experience[i] + 1); increaseCharacterExperience(charIndex, er - c->experience[i] + 1);

View file

@ -316,7 +316,7 @@ void EoBEngine::runNpcDialogue(int npcIndex) {
void EoBEngine::updateUsedCharacterHandItem(int charIndex, int slot) { void EoBEngine::updateUsedCharacterHandItem(int charIndex, int slot) {
EoBItem *itm = &_items[_characters[charIndex].inventory[slot]]; EoBItem *itm = &_items[_characters[charIndex].inventory[slot]];
if (itm->type == 48) { if (itm->type == 48) {
int charges = itm->flags & 0x3f; int charges = itm->flags & 0x3F;
if (--charges) if (--charges)
--itm->flags; --itm->flags;
else else
@ -359,7 +359,7 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
_screen->loadShapeSetBitmap("DOOR", 5, 3); _screen->loadShapeSetBitmap("DOOR", 5, 3);
_screen->_curPage = 2; _screen->_curPage = 2;
if (doorType1 != 0xff) { if (doorType1 != 0xFF) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType1 * 3 + i) << 2]; const uint8 *enc = &_doorShapeEncodeDefs[(doorType1 * 3 + i) << 2];
_doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0); _doorShapes[shapeId1 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
@ -370,7 +370,7 @@ void EoBEngine::loadDoorShapes(int doorType1, int shapeId1, int doorType2, int s
} }
} }
if (doorType2 != 0xff) { if (doorType2 != 0xFF) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
const uint8 *enc = &_doorShapeEncodeDefs[(doorType2 * 3 + i) << 2]; const uint8 *enc = &_doorShapeEncodeDefs[(doorType2 * 3 + i) << 2];
_doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0); _doorShapes[shapeId2 + i] = _screen->encodeShape(enc[0], enc[1], enc[2], enc[3], false, (_flags.gameID == GI_EOB1) ? _cgaMappingLevel[_cgaLevelMappingIndex[_currentLevel - 1]] : 0);
@ -460,7 +460,7 @@ void EoBEngine::turnUndeadAuto() {
int oc = _openBookChar; int oc = _openBookChar;
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
if (!testCharacter(i, 0x0d)) if (!testCharacter(i, 0x0D))
continue; continue;
EoBCharacter *c = &_characters[i]; EoBCharacter *c = &_characters[i];
@ -505,7 +505,7 @@ bool EoBEngine::checkPartyStatusExtra() {
_txt->printMessage(_menuStringsDefeat[0]); _txt->printMessage(_menuStringsDefeat[0]);
while (!shouldQuit()) { while (!shouldQuit()) {
removeInputTop(); removeInputTop();
if (checkInput(0, false, 0) & 0xff) if (checkInput(0, false, 0) & 0xFF)
break; break;
} }
_screen->copyPage(10, 0); _screen->copyPage(10, 0);

View file

@ -364,7 +364,7 @@ void EoBCoreEngine::initKeymap() {
} }
Common::Error EoBCoreEngine::init() { Common::Error EoBCoreEngine::init() {
// In EOB the timer proc is directly invoked via interrupt 0x1c, 18.2 times per second. // In EOB the timer proc is directly invoked via interrupt 0x1C, 18.2 times per second.
// This makes a tick length of 54.94. // This makes a tick length of 54.94.
_tickLength = 55; _tickLength = 55;
@ -488,8 +488,8 @@ Common::Error EoBCoreEngine::init() {
_monsterFlashOverlay = new uint8[16]; _monsterFlashOverlay = new uint8[16];
_monsterStoneOverlay = new uint8[16]; _monsterStoneOverlay = new uint8[16];
memset(_monsterFlashOverlay, (_configRenderMode == Common::kRenderCGA) ? 0xff : 0x0f, 16 * sizeof(uint8)); memset(_monsterFlashOverlay, (_configRenderMode == Common::kRenderCGA) ? 0xFF : 0x0F, 16 * sizeof(uint8));
memset(_monsterStoneOverlay, 0x0d, 16 * sizeof(uint8)); memset(_monsterStoneOverlay, 0x0D, 16 * sizeof(uint8));
_monsterFlashOverlay[0] = _monsterStoneOverlay[0] = 0; _monsterFlashOverlay[0] = _monsterStoneOverlay[0] = 0;
// Prevent autosave on game startup // Prevent autosave on game startup
@ -985,7 +985,7 @@ void EoBCoreEngine::recalcArmorClass(int index) {
int tp = _items[itm].type; int tp = _items[itm].type;
if (!(_itemTypes[tp].allowedClasses & _classModifierFlags[c->cClass]) || (_itemTypes[tp].extraProperties & 0x7f) || (i >= 1 && i <= 2 && tp != 27 && !(_flags.gameID == GI_EOB2 && tp == 57))) if (!(_itemTypes[tp].allowedClasses & _classModifierFlags[c->cClass]) || (_itemTypes[tp].extraProperties & 0x7F) || (i >= 1 && i <= 2 && tp != 27 && !(_flags.gameID == GI_EOB2 && tp == 57)))
continue; continue;
c->armorClass += _itemTypes[tp].armorClass; c->armorClass += _itemTypes[tp].armorClass;
@ -997,12 +997,12 @@ void EoBCoreEngine::recalcArmorClass(int index) {
int8 m2 = 0; int8 m2 = 0;
if (c->inventory[25]) { if (c->inventory[25]) {
if (!(_itemTypes[_items[c->inventory[25]].type].extraProperties & 0x7f)) if (!(_itemTypes[_items[c->inventory[25]].type].extraProperties & 0x7F))
m1 = _items[c->inventory[25]].value; m1 = _items[c->inventory[25]].value;
} }
if (c->inventory[26]) { if (c->inventory[26]) {
if (!(_itemTypes[_items[c->inventory[26]].type].extraProperties & 0x7f)) if (!(_itemTypes[_items[c->inventory[26]].type].extraProperties & 0x7F))
m2 = _items[c->inventory[26]].value; m2 = _items[c->inventory[26]].value;
} }
@ -1054,7 +1054,7 @@ int EoBCoreEngine::validateWeaponSlotItem(int index, int slot) {
if (!itm2) if (!itm2)
return 1; return 1;
int f = (_itemTypes[tp2].extraProperties & 0x7f); int f = (_itemTypes[tp2].extraProperties & 0x7F);
if (f <= 0 || f > 3) if (f <= 0 || f > 3)
return r; return r;
@ -1269,12 +1269,12 @@ void EoBCoreEngine::removeCharacterFromParty(int charIndex) {
if (i == 16 || !c->inventory[i]) if (i == 16 || !c->inventory[i])
continue; continue;
setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3ff].drawObjects, _currentBlock, c->inventory[i], _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3FF].drawObjects, _currentBlock, c->inventory[i], _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]);
c->inventory[i] = 0; c->inventory[i] = 0;
} }
while (c->inventory[16]) while (c->inventory[16])
setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3ff].drawObjects, _currentBlock, getQueuedItem(&c->inventory[16], 0, -1), _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]); setItemPosition((Item *)&_levelBlockProperties[_currentBlock & 0x3FF].drawObjects, _currentBlock, getQueuedItem(&c->inventory[16], 0, -1), _dropItemDirIndex[(_currentDirection << 2) + rollDice(1, 2, -1)]);
c->inventory[16] = 0; c->inventory[16] = 0;
@ -1320,7 +1320,7 @@ void EoBCoreEngine::increaseCharacterExperience(int charIndex, int32 points) {
_characters[charIndex].experience[i] += points; _characters[charIndex].experience[i] += points;
uint32 er = getRequiredExperience(cl, i, _characters[charIndex].level[i] + 1); uint32 er = getRequiredExperience(cl, i, _characters[charIndex].level[i] + 1);
if (er == 0xffffffff) if (er == 0xFFFFFFFF)
continue; continue;
if (_characters[charIndex].experience[i] >= er) if (_characters[charIndex].experience[i] >= er)
@ -1331,7 +1331,7 @@ void EoBCoreEngine::increaseCharacterExperience(int charIndex, int32 points) {
uint32 EoBCoreEngine::getRequiredExperience(int cClass, int levelIndex, int level) { uint32 EoBCoreEngine::getRequiredExperience(int cClass, int levelIndex, int level) {
cClass = getCharacterClassType(cClass, levelIndex); cClass = getCharacterClassType(cClass, levelIndex);
if (cClass == -1) if (cClass == -1)
return 0xffffffff; return 0xFFFFFFFF;
const uint32 *tbl = _expRequirementTables[cClass]; const uint32 *tbl = _expRequirementTables[cClass];
return tbl[level - 1]; return tbl[level - 1];
@ -1619,7 +1619,7 @@ void EoBCoreEngine::displayParchment(int id) {
removeInputTop(); removeInputTop();
while (!shouldQuit()) { while (!shouldQuit()) {
delay(_tickLength); delay(_tickLength);
if (checkInput(0, false, 0) & 0xff) if (checkInput(0, false, 0) & 0xFF)
break; break;
removeInputTop(); removeInputTop();
} }
@ -1652,7 +1652,7 @@ int EoBCoreEngine::countResurrectionCandidates() {
if (!inv) if (!inv)
continue; continue;
if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[inv].type].extraProperties & 0x7f) != 8)) || (_flags.gameID == GI_EOB2 && _items[inv].type != 33)) if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[inv].type].extraProperties & 0x7F) != 8)) || (_flags.gameID == GI_EOB2 && _items[inv].type != 33))
continue; continue;
_rrNames[_rrCount] = _npcPreset[_items[inv].value - 1].name; _rrNames[_rrCount] = _npcPreset[_items[inv].value - 1].name;
@ -1661,7 +1661,7 @@ int EoBCoreEngine::countResurrectionCandidates() {
} }
if (_itemInHand > 0) { if (_itemInHand > 0) {
if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[_itemInHand].type].extraProperties & 0x7f) == 8)) || (_flags.gameID == GI_EOB2 && _items[_itemInHand].type == 33)) { if ((_flags.gameID == GI_EOB1 && ((_itemTypes[_items[_itemInHand].type].extraProperties & 0x7F) == 8)) || (_flags.gameID == GI_EOB2 && _items[_itemInHand].type == 33)) {
_rrNames[_rrCount] = _npcPreset[_items[_itemInHand].value - 1].name; _rrNames[_rrCount] = _npcPreset[_items[_itemInHand].value - 1].name;
_rrId[_rrCount++] = -_items[_itemInHand].value; _rrId[_rrCount++] = -_items[_itemInHand].value;
} }
@ -1780,7 +1780,7 @@ void EoBCoreEngine::useSlotWeapon(int charIndex, int slotIndex, Item item) {
if (c->effectFlags & 0x40) if (c->effectFlags & 0x40)
removeCharacterEffect(10, charIndex, 1); // remove invisibility effect removeCharacterEffect(10, charIndex, 1); // remove invisibility effect
int ep = _itemTypes[tp].extraProperties & 0x7f; int ep = _itemTypes[tp].extraProperties & 0x7F;
int8 inflict = 0; int8 inflict = 0;
if (ep == 1) { if (ep == 1) {
@ -1823,14 +1823,14 @@ int EoBCoreEngine::closeDistanceAttack(int charIndex, Item item) {
if (r == -1) { if (r == -1) {
uint8 w = _specialWallTypes[_levelBlockProperties[d].walls[_sceneDrawVarDown]]; uint8 w = _specialWallTypes[_levelBlockProperties[d].walls[_sceneDrawVarDown]];
if (w == 0xff) { if (w == 0xFF) {
if (_flags.gameID == GI_EOB1) { if (_flags.gameID == GI_EOB1) {
_levelBlockProperties[d].walls[_sceneDrawVarDown]++; _levelBlockProperties[d].walls[_sceneDrawVarDown]++;
_levelBlockProperties[d].walls[_sceneDrawVarDown ^ 2]++; _levelBlockProperties[d].walls[_sceneDrawVarDown ^ 2]++;
} else { } else {
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (_specialWallTypes[_levelBlockProperties[d].walls[i]] == 0xff) if (_specialWallTypes[_levelBlockProperties[d].walls[i]] == 0xFF)
_levelBlockProperties[d].walls[i]++; _levelBlockProperties[d].walls[i]++;
} }
} }
@ -1921,7 +1921,7 @@ int EoBCoreEngine::projectileWeaponAttack(int charIndex, Item item) {
void EoBCoreEngine::inflictMonsterDamage(EoBMonsterInPlay *m, int damage, bool giveExperience) { void EoBCoreEngine::inflictMonsterDamage(EoBMonsterInPlay *m, int damage, bool giveExperience) {
m->hitPointsCur -= damage; m->hitPointsCur -= damage;
m->flags = (m->flags & 0xf7) | 1; m->flags = (m->flags & 0xF7) | 1;
if (_monsterProps[m->type].capsFlags & 0x2000) { if (_monsterProps[m->type].capsFlags & 0x2000) {
explodeMonster(m); explodeMonster(m);
@ -2027,7 +2027,7 @@ bool EoBCoreEngine::characterAttackHitTest(int charIndex, int monsterIndex, int
if (charIndex < 0) if (charIndex < 0)
return true; return true;
int p = item ? (_flags.gameID == GI_EOB1 ? _items[item].type : (_itemTypes[_items[item].type].extraProperties & 0x7f)) : 0; int p = item ? (_flags.gameID == GI_EOB1 ? _items[item].type : (_itemTypes[_items[item].type].extraProperties & 0x7F)) : 0;
if (_monsters[monsterIndex].flags & 0x20) if (_monsters[monsterIndex].flags & 0x20)
return true;// EOB 2 only ? return true;// EOB 2 only ?
@ -2206,7 +2206,7 @@ void EoBCoreEngine::statusAttack(int charIndex, int attackStatusFlags, const cha
c->flags |= attackStatusFlags; c->flags |= attackStatusFlags;
} }
if ((attackStatusFlags & 0x0c) && (_openBookChar == charIndex) && _updateFlags) { if ((attackStatusFlags & 0x0C) && (_openBookChar == charIndex) && _updateFlags) {
Button b; Button b;
clickedSpellbookAbort(&b); clickedSpellbookAbort(&b);
} }
@ -2312,7 +2312,7 @@ int EoBCoreEngine::getSaveThrowModifier(int hpModifier, int level, int type) {
} }
bool EoBCoreEngine::calcDamageCheckItemType(int itemType) { bool EoBCoreEngine::calcDamageCheckItemType(int itemType) {
itemType = _itemTypes[itemType].extraProperties & 0x7f; itemType = _itemTypes[itemType].extraProperties & 0x7F;
return (itemType == 2 || itemType == 3) ? true : false; return (itemType == 2 || itemType == 3) ? true : false;
} }

View file

@ -86,7 +86,7 @@ void EoBCoreEngine::gui_drawCharPortraitWithStats(int index) {
int txtCol1 = 12; int txtCol1 = 12;
int txtCol2 = 15; int txtCol2 = 15;
if ((_flags.gameID == GI_EOB1 && c->flags & 6) || (_flags.gameID == GI_EOB2 && c->flags & 0x0e)) { if ((_flags.gameID == GI_EOB1 && c->flags & 6) || (_flags.gameID == GI_EOB2 && c->flags & 0x0E)) {
txtCol1 = 8; txtCol1 = 8;
txtCol2 = 6; txtCol2 = 6;
} }
@ -285,7 +285,7 @@ void EoBCoreEngine::gui_drawWeaponSlot(int charIndex, int slot) {
else else
_screen->drawShape(_screen->_curPage, _itemIconShapes[85 + slot], x + 8, y, 0); _screen->drawShape(_screen->_curPage, _itemIconShapes[85 + slot], x + 8, y, 0);
if ((_characters[charIndex].disabledSlots & (1 << slot)) || !validateWeaponSlotItem(charIndex, slot) || (_characters[charIndex].hitPointsCur <= 0) || (_characters[charIndex].flags & 0x0c)) if ((_characters[charIndex].disabledSlots & (1 << slot)) || !validateWeaponSlotItem(charIndex, slot) || (_characters[charIndex].hitPointsCur <= 0) || (_characters[charIndex].flags & 0x0C))
_screen->drawShape(_screen->_curPage, _weaponSlotGrid, x, y, 0); _screen->drawShape(_screen->_curPage, _weaponSlotGrid, x, y, 0);
} }
@ -808,13 +808,13 @@ int EoBCoreEngine::clickedSceneDropPickupItem(Button *button) {
if (button->arg > 1) { if (button->arg > 1) {
block = calcNewBlockPosition(_currentBlock, _currentDirection); block = calcNewBlockPosition(_currentBlock, _currentDirection);
int f = _wllWallFlags[_levelBlockProperties[block].walls[_sceneDrawVarDown]]; int f = _wllWallFlags[_levelBlockProperties[block].walls[_sceneDrawVarDown]];
if (!(f & 0x0b)) if (!(f & 0x0B))
return 1; return 1;
} }
int d = _dropItemDirIndex[(_currentDirection << 2) + button->arg]; int d = _dropItemDirIndex[(_currentDirection << 2) + button->arg];
if (_itemInHand) { if (_itemInHand) {
setItemPosition((Item *)&_levelBlockProperties[block & 0x3ff].drawObjects, block, _itemInHand, d); setItemPosition((Item *)&_levelBlockProperties[block & 0x3FF].drawObjects, block, _itemInHand, d);
setHandItem(0); setHandItem(0);
runLevelScript(block, 4); runLevelScript(block, 4);
} else { } else {
@ -856,7 +856,7 @@ int EoBCoreEngine::clickedWeaponSlot(Button *button) {
static const uint8 sY[] = { 27, 27, 79, 79, 131, 131 }; static const uint8 sY[] = { 27, 27, 79, 79, 131, 131 };
int slot = sY[button->arg] > _mouseY ? 0 : 1; int slot = sY[button->arg] > _mouseY ? 0 : 1;
if ((_gui->_flagsMouseLeft & 0x7f) == 1) if ((_gui->_flagsMouseLeft & 0x7F) == 1)
gui_processWeaponSlotClickLeft(button->arg, slot); gui_processWeaponSlotClickLeft(button->arg, slot);
else else
gui_processWeaponSlotClickRight(button->arg, slot); gui_processWeaponSlotClickRight(button->arg, slot);
@ -1031,9 +1031,9 @@ int EoBCoreEngine::clickedSpellbookList(Button *button) {
} }
int EoBCoreEngine::clickedCastSpellOnCharacter(Button *button) { int EoBCoreEngine::clickedCastSpellOnCharacter(Button *button) {
_activeSpellCharId = button->arg & 0xff; _activeSpellCharId = button->arg & 0xFF;
if (_activeSpellCharId == 0xff) { if (_activeSpellCharId == 0xFF) {
printWarning(_magicStrings3[_flags.gameID == GI_EOB1 ? 2 : 1]); printWarning(_magicStrings3[_flags.gameID == GI_EOB1 ? 2 : 1]);
if (_castScrollSlot) { if (_castScrollSlot) {
gui_updateSlotAfterScrollUse(); gui_updateSlotAfterScrollUse();
@ -1215,7 +1215,7 @@ void EoBCoreEngine::gui_processWeaponSlotClickLeft(int charIndex, int slotIndex)
int ih = _itemInHand; int ih = _itemInHand;
int t = _items[ih].type; int t = _items[ih].type;
uint16 v = (ih) ? _itemTypes[t].invFlags : 0xffff; uint16 v = (ih) ? _itemTypes[t].invFlags : 0xFFFF;
if (v & _slotValidationFlags[slotIndex]) { if (v & _slotValidationFlags[slotIndex]) {
setHandItem(itm); setHandItem(itm);
@ -1227,7 +1227,7 @@ void EoBCoreEngine::gui_processWeaponSlotClickLeft(int charIndex, int slotIndex)
} }
void EoBCoreEngine::gui_processWeaponSlotClickRight(int charIndex, int slotIndex) { void EoBCoreEngine::gui_processWeaponSlotClickRight(int charIndex, int slotIndex) {
if (!testCharacter(charIndex, 0x0d)) if (!testCharacter(charIndex, 0x0D))
return; return;
Item itm = _characters[charIndex].inventory[slotIndex]; Item itm = _characters[charIndex].inventory[slotIndex];
@ -1244,7 +1244,7 @@ void EoBCoreEngine::gui_processWeaponSlotClickRight(int charIndex, int slotIndex
int8 tp = _items[itm].type; int8 tp = _items[itm].type;
int8 vl = _items[itm].value; int8 vl = _items[itm].value;
uint8 ep = _itemTypes[tp].extraProperties & 0x7f; uint8 ep = _itemTypes[tp].extraProperties & 0x7F;
switch (ep) { switch (ep) {
case 0: case 0:
@ -1376,7 +1376,7 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) {
_backupButtonList = 0; _backupButtonList = 0;
_progress = 0; _progress = 0;
_prcButtonUnk3 = 1; _prcButtonUnk3 = 1;
_cflag = 0xffff; _cflag = 0xFFFF;
_menuLineSpacing = 0; _menuLineSpacing = 0;
_menuLastInFlags = 0; _menuLastInFlags = 0;
@ -1385,8 +1385,8 @@ GUI_EoB::GUI_EoB(EoBCoreEngine *vm) : GUI(vm), _vm(vm), _screen(vm->_screen) {
_numPages = (_vm->game() == GI_EOB2) ? 8 : 5; _numPages = (_vm->game() == GI_EOB2) ? 8 : 5;
_numVisPages = (_vm->game() == GI_EOB2) ? 6 : 5; _numVisPages = (_vm->game() == GI_EOB2) ? 6 : 5;
_clericSpellAvltyFlags = (_vm->game() == GI_EOB2) ? 0xf7ffffff : 0x7bffff; _clericSpellAvltyFlags = (_vm->game() == GI_EOB2) ? 0xF7FFFFFF : 0x7BFFFF;
_paladinSpellAvltyFlags = (_vm->game() == GI_EOB2) ? 0xa9bbd1d : 0x800ff2; _paladinSpellAvltyFlags = (_vm->game() == GI_EOB2) ? 0xA9BBD1D : 0x800FF2;
_numAssignedSpellsOfType = new int8[72]; _numAssignedSpellsOfType = new int8[72];
memset(_numAssignedSpellsOfType, 0, 72); memset(_numAssignedSpellsOfType, 0, 72);
@ -1524,7 +1524,7 @@ void GUI_EoB::processButton(Button *button) {
int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8 mouseWheel) { int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8 mouseWheel) {
_progress = 0; _progress = 0;
uint16 in = inputFlags & 0xff; uint16 in = inputFlags & 0xFF;
uint16 buttonReleaseFlag = 0; uint16 buttonReleaseFlag = 0;
bool clickEvt = false; bool clickEvt = false;
//_vm->_processingButtons = true; //_vm->_processingButtons = true;
@ -1543,13 +1543,13 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
//////////////////////////// ////////////////////////////
if (!buttonList && !(inputFlags & 0x800)) if (!buttonList && !(inputFlags & 0x800))
return inputFlags & 0xff; return inputFlags & 0xFF;
//////////////////////////// ////////////////////////////
inputFlags = 0; inputFlags = 0;
clickEvt = true; clickEvt = true;
} else if (inputFlags & 0x8000) { } else if (inputFlags & 0x8000) {
inputFlags &= 0xff; inputFlags &= 0xFF;
} }
uint16 result = 0; uint16 result = 0;
@ -1582,7 +1582,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
_specialProcessButton = 0; _specialProcessButton = 0;
_prcButtonUnk3 = 1; _prcButtonUnk3 = 1;
_cflag = 0xffff; _cflag = 0xFFFF;
} }
int sd = 0; int sd = 0;
@ -1616,12 +1616,12 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
if (flgs2 & 1) if (flgs2 & 1)
flgs2 |= 8; flgs2 |= 8;
else else
flgs2 &= 0xfff7; flgs2 &= 0xFFF7;
if (flgs2 & 4) if (flgs2 & 4)
flgs2 |= 0x10; flgs2 |= 0x10;
else else
flgs2 &= 0xffef; flgs2 &= 0xFFEF;
uint16 vL = 0; uint16 vL = 0;
uint16 vR = 0; uint16 vR = 0;
@ -1640,8 +1640,8 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
v6 = 1; v6 = 1;
} }
} else if (_flagsModifier || clickEvt) { } else if (_flagsModifier || clickEvt) {
vL = flgs & 0xf00; vL = flgs & 0xF00;
vR = flgs & 0xf000; vR = flgs & 0xF000;
if (_prcButtonUnk3) { if (_prcButtonUnk3) {
if (sd != buttonList->dimTableIndex) { if (sd != buttonList->dimTableIndex) {
@ -1675,7 +1675,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
flgs2 |= 4; flgs2 |= 4;
vc = 1; vc = 1;
} else { } else {
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
} }
if (flgs & 0x100) { if (flgs & 0x100) {
@ -1702,7 +1702,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
flgs2 |= 4; flgs2 |= 4;
vc = 1; vc = 1;
} else { } else {
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
} }
if (!(flgs & 0x200)) if (!(flgs & 0x200))
@ -1730,12 +1730,12 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
if ((flgs & 2) && (flgs2 & 1)) if ((flgs & 2) && (flgs2 & 1))
flgs2 &= 0xfffe; flgs2 &= 0xFFFE;
break; break;
case 3: case 3:
if ((flgs & 4) || (!buttonList->data2Val1)) if ((flgs & 4) || (!buttonList->data2Val1))
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
else else
flgs2 |= 4; flgs2 |= 4;
@ -1745,7 +1745,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
if ((flgs & 2) && (flgs2 & 1)) if ((flgs & 2) && (flgs2 & 1))
flgs2 &= 0xfffe; flgs2 &= 0xFFFE;
break; break;
default: default:
@ -1761,7 +1761,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
if ((flgs & 4) && buttonList->data2Val1) if ((flgs & 4) && buttonList->data2Val1)
flgs2 |= 4; flgs2 |= 4;
else else
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
if (flgs & 0x1000) { if (flgs & 0x1000) {
v6 = 1; v6 = 1;
@ -1786,7 +1786,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
if ((flgs & 4) && buttonList->data2Val1) if ((flgs & 4) && buttonList->data2Val1)
flgs2 |= 4; flgs2 |= 4;
else else
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
if (!(flgs & 0x2000)) if (!(flgs & 0x2000))
break; break;
@ -1812,12 +1812,12 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
if ((flgs & 2) && (flgs2 & 1)) if ((flgs & 2) && (flgs2 & 1))
flgs2 &= 0xfffe; flgs2 &= 0xFFFE;
break; break;
case 3: case 3:
if ((flgs & 4) || (!buttonList->data2Val1)) if ((flgs & 4) || (!buttonList->data2Val1))
flgs2 &= 0xfffb; flgs2 &= 0xFFFB;
else else
flgs2 |= 4; flgs2 |= 4;
@ -1827,7 +1827,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
if ((flgs & 2) && (flgs2 & 1)) if ((flgs & 2) && (flgs2 & 1))
flgs2 &= 0xfffe; flgs2 &= 0xFFFE;
break; break;
default: default:
@ -1835,7 +1835,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
} }
} else { // if (_vm->_mouseX >= x2 && _vm->_mouseX <= (x2 + buttonList->width)....) } else { // if (_vm->_mouseX >= x2 && _vm->_mouseX <= (x2 + buttonList->width)....)
flgs2 &= 0xfff9; flgs2 &= 0xFFF9;
if ((flgs & 0x40) && (!(flgs & 0x80)) && _specialProcessButton && !v8) { if ((flgs & 0x40) && (!(flgs & 0x80)) && _specialProcessButton && !v8) {
static const uint16 flagsTable[] = { 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000 }; static const uint16 flagsTable[] = { 0x100, 0x200, 0x400, 0x800, 0x1000, 0x2000, 0x4000, 0x8000 };
@ -1859,7 +1859,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
} }
if ((flgs & 2) && (flgs2 & 1)) if ((flgs & 2) && (flgs2 & 1))
flgs2 &= 0xfffe; flgs2 &= 0xFFFE;
} // end if (_vm->_mouseX >= x2 && _vm->_mouseX <= (x2 + buttonList->width)....) } // end if (_vm->_mouseX >= x2 && _vm->_mouseX <= (x2 + buttonList->width)....)
} // end if (_prcButtonUnk3) } // end if (_prcButtonUnk3)
} // end if (_flagsModifier || clickEvt) } // end if (_flagsModifier || clickEvt)
@ -1896,7 +1896,7 @@ int GUI_EoB::processButtonList(Kyra::Button *buttonList, uint16 inputFlags, int8
}; };
if ((_flagsMouseLeft == 1 || _flagsMouseRight == 1) && !v18) if ((_flagsMouseLeft == 1 || _flagsMouseRight == 1) && !v18)
_cflag = 0xffff; _cflag = 0xFFFF;
if (!result) if (!result)
result = inputFlags; result = inputFlags;
@ -1938,7 +1938,7 @@ int GUI_EoB::simpleMenu_process(int sd, const char *const *strings, void *b, int
int x = (_screen->_curDim->sx + dm->sx) << 3; int x = (_screen->_curDim->sx + dm->sx) << 3;
int y = _screen->_curDim->sy + dm->sy; int y = _screen->_curDim->sy + dm->sy;
int inFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
Common::Point mousePos = _vm->getMousePos(); Common::Point mousePos = _vm->getMousePos();
@ -2051,7 +2051,7 @@ void GUI_EoB::runCampMenu() {
newMenu = -1; newMenu = -1;
} }
int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80ff; int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE]) if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE])
@ -2060,7 +2060,7 @@ void GUI_EoB::runCampMenu() {
inputFlag = 0x8000 + prevHighlightButton->index; inputFlag = 0x8000 + prevHighlightButton->index;
} }
Button *clickedButton = _vm->gui_getButton(buttonList, inputFlag & 0x7fff); Button *clickedButton = _vm->gui_getButton(buttonList, inputFlag & 0x7FFF);
if (clickedButton) { if (clickedButton) {
drawMenuButton(prevHighlightButton, false, false, true); drawMenuButton(prevHighlightButton, false, false, true);
@ -2140,8 +2140,8 @@ void GUI_EoB::runCampMenu() {
displayTextBox(44); displayTextBox(44);
// fall through // fall through
case 0x800c: case 0x800C:
case 0x800f: case 0x800F:
if (lastMenu == 1 || lastMenu == 2) if (lastMenu == 1 || lastMenu == 2)
newMenu = 0; newMenu = 0;
else if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE]) else if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE])
@ -2163,7 +2163,7 @@ void GUI_EoB::runCampMenu() {
newMenu = 1; newMenu = 1;
break; break;
case 0x800a: case 0x800A:
for (; i < 6; i++) { for (; i < 6; i++) {
if (_vm->testCharacter(i, 1)) if (_vm->testCharacter(i, 1))
cnt++; cnt++;
@ -2183,19 +2183,19 @@ void GUI_EoB::runCampMenu() {
newMenu = 0; newMenu = 0;
break; break;
case 0x800b: case 0x800B:
if (confirmDialogue(46)) if (confirmDialogue(46))
_vm->quitGame(); _vm->quitGame();
newMenu = 0; newMenu = 0;
break; break;
case 0x800d: case 0x800D:
_vm->_configSounds ^= true; _vm->_configSounds ^= true;
_vm->_configMusic = _vm->_configSounds ? 1 : 0; _vm->_configMusic = _vm->_configSounds ? 1 : 0;
newMenu = 2; newMenu = 2;
break; break;
case 0x800e: case 0x800E:
_vm->_configHpBarGraphs ^= true; _vm->_configHpBarGraphs ^= true;
newMenu = 2; newMenu = 2;
redrawPortraits = true; redrawPortraits = true;
@ -2290,7 +2290,7 @@ bool GUI_EoB::confirmDialogue2(int dim, int id, int deflt) {
else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + 14)) else if (_vm->posWithinRect(p.x, p.y, x[1], y, x[1] + 32, y + 14))
newHighlight = 1; newHighlight = 1;
int inputFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) { if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) {
@ -2351,7 +2351,7 @@ void GUI_EoB::messageDialogue(int dim, int id, int buttonTextCol) {
_screen->updateScreen(); _screen->updateScreen();
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) { for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
int inputFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == 199 || inputFlag == 201) { if (inputFlag == 199 || inputFlag == 201) {
@ -2392,7 +2392,7 @@ void GUI_EoB::messageDialogue2(int dim, int id, int buttonTextCol) {
_screen->updateScreen(); _screen->updateScreen();
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) { for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
int inputFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == 199 || inputFlag == 201) { if (inputFlag == 199 || inputFlag == 201) {
@ -2764,7 +2764,7 @@ int GUI_EoB::selectSaveSlotDialogue(int x, int y, int id) {
int slot = -1; int slot = -1;
for (bool runLoop = true; runLoop && !_vm->shouldQuit();) { for (bool runLoop = true; runLoop && !_vm->shouldQuit();) {
int inputFlag = _vm->checkInput(0, false, 0) & 0x8ff; int inputFlag = _vm->checkInput(0, false, 0) & 0x8FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) { if (inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) {
@ -3008,11 +3008,11 @@ void GUI_EoB::runMemorizePrayMenu(int charIndex, int spellType) {
lastHighLightText = newHighLightText; lastHighLightText = newHighLightText;
} }
int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80ff; int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP6] || inputFlag == _vm->_keyMap[Common::KEYCODE_RIGHT]) { if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP6] || inputFlag == _vm->_keyMap[Common::KEYCODE_RIGHT]) {
inputFlag = 0x801a + ((lastHighLightButton + 1) % _numVisPages); inputFlag = 0x801A + ((lastHighLightButton + 1) % _numVisPages);
} else if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP4] || inputFlag == _vm->_keyMap[Common::KEYCODE_LEFT]) { } else if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP4] || inputFlag == _vm->_keyMap[Common::KEYCODE_LEFT]) {
inputFlag = lastHighLightButton ? 0x8019 + lastHighLightButton : 0x8019 + _numVisPages; inputFlag = lastHighLightButton ? 0x8019 + lastHighLightButton : 0x8019 + _numVisPages;
} else if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE]) { } else if (inputFlag == _vm->_keyMap[Common::KEYCODE_ESCAPE]) {
@ -3027,7 +3027,7 @@ void GUI_EoB::runMemorizePrayMenu(int charIndex, int spellType) {
} }
if (inputFlag & 0x8000) { if (inputFlag & 0x8000) {
b = _vm->gui_getButton(buttonList, inputFlag & 0x7fff); b = _vm->gui_getButton(buttonList, inputFlag & 0x7FFF);
drawMenuButton(b, true, true, true); drawMenuButton(b, true, true, true);
_screen->updateScreen(); _screen->updateScreen();
_vm->_system->delayMillis(80); _vm->_system->delayMillis(80);
@ -3074,9 +3074,9 @@ void GUI_EoB::runMemorizePrayMenu(int charIndex, int spellType) {
runLoop = false; runLoop = false;
} else if (inputFlag & 0x8000) { } else if (inputFlag & 0x8000) {
newHighLightButton = inputFlag - 0x801a; newHighLightButton = inputFlag - 0x801A;
if (newHighLightButton == lastHighLightButton) if (newHighLightButton == lastHighLightButton)
drawMenuButton(_vm->gui_getButton(buttonList, inputFlag & 0x7fff), false, true, true); drawMenuButton(_vm->gui_getButton(buttonList, inputFlag & 0x7FFF), false, true, true);
} }
} }
@ -3553,7 +3553,7 @@ bool GUI_EoB::confirmDialogue(int id) {
lastHighlight = newHighlight; lastHighlight = newHighlight;
} }
int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80ff; int inputFlag = _vm->checkInput(buttonList, false, 0) & 0x80FF;
_vm->removeInputTop(); _vm->removeInputTop();
if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP5] || inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) { if (inputFlag == _vm->_keyMap[Common::KEYCODE_KP5] || inputFlag == _vm->_keyMap[Common::KEYCODE_SPACE] || inputFlag == _vm->_keyMap[Common::KEYCODE_RETURN]) {

View file

@ -521,7 +521,7 @@ void KyraEngine_HoF::bookPrintText(int dstPage, const uint8 *str, int x, int y,
Screen::FontId oldFont = _screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_BOOKFONT_FNT); Screen::FontId oldFont = _screen->setFont(_flags.lang == Common::JA_JPN ? Screen::FID_SJIS_FNT : Screen::FID_BOOKFONT_FNT);
_screen->_charWidth = -2; _screen->_charWidth = -2;
_screen->printText((const char *)str, x, y, color, (_flags.lang == Common::JA_JPN) ? 0xf6 : 0); _screen->printText((const char *)str, x, y, color, (_flags.lang == Common::JA_JPN) ? 0xF6 : 0);
_screen->_charWidth = 0; _screen->_charWidth = 0;
_screen->setFont(oldFont); _screen->setFont(oldFont);

View file

@ -120,7 +120,7 @@ void LoLEngine::gui_drawScroll() {
if (h) { if (h) {
_screen->copyRegion(201, 1, 17, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(201, 1, 17, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK);
_screen->copyRegion(208, 1, 89, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(208, 1, 89, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK);
_screen->fillRect(21, 15, 89, h + 15, _flags.use16ColorMode ? 0xbb : 206); _screen->fillRect(21, 15, 89, h + 15, _flags.use16ColorMode ? 0xBB : 206);
} }
_screen->copyRegion(112, 16, 12, h + 15, 87, 14, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(112, 16, 12, h + 15, 87, 14, 2, 2, Screen::CR_NO_P_CHECK);
@ -172,7 +172,7 @@ void LoLEngine::gui_displayCharInventory(int charNum) {
gui_drawAllCharPortraitsWithStats(); gui_drawAllCharPortraitsWithStats();
if (_flags.use16ColorMode) if (_flags.use16ColorMode)
_screen->fprintString("%s", 156, 8, 0xe1, 0, 1, l->name); _screen->fprintString("%s", 156, 8, 0xE1, 0, 1, l->name);
else else
_screen->fprintString("%s", 157, 9, 254, 0, 5, l->name); _screen->fprintString("%s", 157, 9, 254, 0, 5, l->name);
@ -182,7 +182,7 @@ void LoLEngine::gui_displayCharInventory(int charNum) {
gui_drawCharInventoryItem(i); gui_drawCharInventoryItem(i);
Screen::FontId of = _screen->setFont(Screen::FID_9_FNT); Screen::FontId of = _screen->setFont(Screen::FID_9_FNT);
_screen->fprintString("%s", 182, 103, _flags.use16ColorMode ? 0xbb : 172, 0, 5, getLangString(0x4033)); _screen->fprintString("%s", 182, 103, _flags.use16ColorMode ? 0xBB : 172, 0, 5, getLangString(0x4033));
_screen->setFont(of); _screen->setFont(of);
static const uint16 statusFlags[] = { 0x0080, 0x0000, 0x1000, 0x0002, 0x100, 0x0001, 0x0000, 0x0000 }; static const uint16 statusFlags[] = { 0x0080, 0x0000, 0x1000, 0x0002, 0x100, 0x0001, 0x0000, 0x0000 };
@ -206,7 +206,7 @@ void LoLEngine::gui_displayCharInventory(int charNum) {
int32 b = l->experiencePts[i] - _expRequirements[l->skillLevels[i] - 1]; int32 b = l->experiencePts[i] - _expRequirements[l->skillLevels[i] - 1];
int32 e = _expRequirements[l->skillLevels[i]] - _expRequirements[l->skillLevels[i] - 1]; int32 e = _expRequirements[l->skillLevels[i]] - _expRequirements[l->skillLevels[i] - 1];
while (e & 0xffff8000) { while (e & 0xFFFF8000) {
e >>= 1; e >>= 1;
c = b; c = b;
b >>= 1; b >>= 1;
@ -245,7 +245,7 @@ void LoLEngine::gui_printCharacterStats(int index, int redraw, int value) {
// protection // protection
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
y = (index + 2) << 3; y = (index + 2) << 3;
col = 0xa1; col = 0xA1;
if (redraw) if (redraw)
_screen->fprintString("%s", offs + 108, y, col, 0, 0, getLangString(0x4014 + index)); _screen->fprintString("%s", offs + 108, y, col, 0, 0, getLangString(0x4014 + index));
} else { } else {
@ -260,7 +260,7 @@ void LoLEngine::gui_printCharacterStats(int index, int redraw, int value) {
y = s * 10 + 62; y = s * 10 + 62;
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
y = (s + 8) << 3; y = (s + 8) << 3;
col = _characters[_selectedCharacter].flags & (0x200 << s) ? 0xe1 : 0x81; col = _characters[_selectedCharacter].flags & (0x200 << s) ? 0xE1 : 0x81;
if (redraw) if (redraw)
_screen->fprintString("%s", offs + 108, y, col, 0, 0, getLangString(0x4014 + index)); _screen->fprintString("%s", offs + 108, y, col, 0, 0, getLangString(0x4014 + index));
} else { } else {
@ -327,7 +327,7 @@ void LoLEngine::gui_drawCharInventoryItem(int itemIndex) {
uint8 x = *coords++; uint8 x = *coords++;
uint8 y = *coords; uint8 y = *coords;
if (y == 0xff) if (y == 0xFF)
return; return;
if (!_screen->_curPage) if (!_screen->_curPage)
@ -366,7 +366,7 @@ void LoLEngine::gui_drawCharPortraitWithStats(int charNum) {
gui_drawCharFaceShape(charNum, 0, 1, _screen->_curPage); gui_drawCharFaceShape(charNum, 0, 1, _screen->_curPage);
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
gui_drawLiveMagicBar(33, 32, _characters[charNum].magicPointsCur, 0, _characters[charNum].magicPointsMax, 5, 32, 0xaa, 0x44, 0); gui_drawLiveMagicBar(33, 32, _characters[charNum].magicPointsCur, 0, _characters[charNum].magicPointsMax, 5, 32, 0xAA, 0x44, 0);
gui_drawLiveMagicBar(39, 32, _characters[charNum].hitPointsCur, 0, _characters[charNum].hitPointsMax, 5, 32, 0x66, 0x44, 1); gui_drawLiveMagicBar(39, 32, _characters[charNum].hitPointsCur, 0, _characters[charNum].hitPointsMax, 5, 32, 0x66, 0x44, 1);
_screen->printText(getLangString(0x4253), 33, 1, 0x99, 0); _screen->printText(getLangString(0x4253), 33, 1, 0x99, 0);
_screen->printText(getLangString(0x4254), 39, 1, 0x55, 0); _screen->printText(getLangString(0x4254), 39, 1, 0x55, 0);
@ -493,7 +493,7 @@ void LoLEngine::gui_drawLiveMagicBar(int x, int y, int curPoints, int unk, int m
if (flag) { if (flag) {
t = maxPoints >> 1; t = maxPoints >> 1;
if (t > curPoints) if (t > curPoints)
col1 = _flags.use16ColorMode ? 0xbb : 144; col1 = _flags.use16ColorMode ? 0xBB : 144;
t = maxPoints >> 2; t = maxPoints >> 2;
if (t > curPoints) if (t > curPoints)
col1 = _flags.use16ColorMode ? 0x88 : 132; col1 = _flags.use16ColorMode ? 0x88 : 132;
@ -525,9 +525,9 @@ void LoLEngine::calcCharPortraitXpos() {
} }
void LoLEngine::gui_drawMoneyBox(int pageNum) { void LoLEngine::gui_drawMoneyBox(int pageNum) {
static const uint16 moneyX256[] = { 0x128, 0x134, 0x12b, 0x131, 0x12e}; static const uint16 moneyX256[] = { 0x128, 0x134, 0x12B, 0x131, 0x12E};
static const uint16 moneyY256[] = { 0x73, 0x73, 0x74, 0x74, 0x75}; static const uint16 moneyY256[] = { 0x73, 0x73, 0x74, 0x74, 0x75};
static const uint16 moneyX16[] = { 0x127, 0x133, 0x12a, 0x130, 0x12d}; static const uint16 moneyX16[] = { 0x127, 0x133, 0x12A, 0x130, 0x12D};
static const uint16 moneyY16[] = { 0x74, 0x74, 0x75, 0x75, 0x76}; static const uint16 moneyY16[] = { 0x74, 0x74, 0x75, 0x75, 0x76};
int backupPage = _screen->_curPage; int backupPage = _screen->_curPage;
@ -551,11 +551,11 @@ void LoLEngine::gui_drawMoneyBox(int pageNum) {
continue; continue;
uint8 h = _moneyColumnHeight[i] - 1; uint8 h = _moneyColumnHeight[i] - 1;
_screen->drawClippedLine(moneyX[i], moneyY[i], moneyX[i], moneyY[i] - h, _flags.use16ColorMode ? 1 : 0xd2); _screen->drawClippedLine(moneyX[i], moneyY[i], moneyX[i], moneyY[i] - h, _flags.use16ColorMode ? 1 : 0xD2);
_screen->drawClippedLine(moneyX[i] + 1, moneyY[i], moneyX[i] + 1, moneyY[i] - h, _flags.use16ColorMode ? 2 : 0xd1); _screen->drawClippedLine(moneyX[i] + 1, moneyY[i], moneyX[i] + 1, moneyY[i] - h, _flags.use16ColorMode ? 2 : 0xD1);
_screen->drawClippedLine(moneyX[i] + 2, moneyY[i], moneyX[i] + 2, moneyY[i] - h, _flags.use16ColorMode ? 3 : 0xd0); _screen->drawClippedLine(moneyX[i] + 2, moneyY[i], moneyX[i] + 2, moneyY[i] - h, _flags.use16ColorMode ? 3 : 0xD0);
_screen->drawClippedLine(moneyX[i] + 3, moneyY[i], moneyX[i] + 3, moneyY[i] - h, _flags.use16ColorMode ? 2 : 0xd1); _screen->drawClippedLine(moneyX[i] + 3, moneyY[i], moneyX[i] + 3, moneyY[i] - h, _flags.use16ColorMode ? 2 : 0xD1);
_screen->drawClippedLine(moneyX[i] + 4, moneyY[i], moneyX[i] + 4, moneyY[i] - h, _flags.use16ColorMode ? 1 : 0xd2); _screen->drawClippedLine(moneyX[i] + 4, moneyY[i], moneyX[i] + 4, moneyY[i] - h, _flags.use16ColorMode ? 1 : 0xD2);
} }
Screen::FontId backupFont = _screen->setFont(Screen::FID_6_FNT); Screen::FontId backupFont = _screen->setFont(Screen::FID_6_FNT);
@ -584,7 +584,7 @@ void LoLEngine::gui_drawCompass() {
_compassDirection = _currentDirection << 6; _compassDirection = _currentDirection << 6;
} }
int t = ((_compassDirection + 4) >> 3) & 0x1f; int t = ((_compassDirection + 4) >> 3) & 0x1F;
if (t == _compassDirectionIndex) if (t == _compassDirectionIndex)
return; return;
@ -744,13 +744,13 @@ void LoLEngine::gui_toggleFightButtons(bool disable) {
if (disable) if (disable)
_characters[i].flags |= 0x2000; _characters[i].flags |= 0x2000;
else else
_characters[i].flags &= 0xdfff; _characters[i].flags &= 0xDFFF;
if (disable && !textEnabled()) { if (disable && !textEnabled()) {
int u = _selectedCharacter; int u = _selectedCharacter;
_selectedCharacter = 99; _selectedCharacter = 99;
int f = _updateFlags; int f = _updateFlags;
_updateFlags &= 0xfffd; _updateFlags &= 0xFFFD;
gui_drawCharPortraitWithStats(i); gui_drawCharPortraitWithStats(i);
@ -774,7 +774,7 @@ void LoLEngine::gui_updateInput() {
if (inputFlag && _activeMagicMenu != -1 && !(inputFlag & 0x8800)) { if (inputFlag && _activeMagicMenu != -1 && !(inputFlag & 0x8800)) {
gui_enableDefaultPlayfieldButtons(); gui_enableDefaultPlayfieldButtons();
_characters[_activeMagicMenu].flags &= 0xffef; _characters[_activeMagicMenu].flags &= 0xFFEF;
gui_drawCharPortraitWithStats(_activeMagicMenu); gui_drawCharPortraitWithStats(_activeMagicMenu);
gui_triggerEvent(inputFlag); gui_triggerEvent(inputFlag);
_preserveEvents = false; _preserveEvents = false;
@ -875,7 +875,7 @@ void LoLEngine::gui_initCharInventorySpecialButtons(int charNum) {
const uint8 *s = &_charInvDefs[_charInvIndex[_characters[charNum].raceClassSex] * 22]; const uint8 *s = &_charInvDefs[_charInvIndex[_characters[charNum].raceClassSex] * 22];
for (int i = 0; i < 11; i++) { for (int i = 0; i < 11; i++) {
if (*s != 0xff) if (*s != 0xFF)
gui_initButton(33 + i, s[0], s[1], i); gui_initButton(33 + i, s[0], s[1], i);
s += 2; s += 2;
} }
@ -916,7 +916,7 @@ void LoLEngine::gui_initButton(int index, int x, int y, int val) {
*b = Button(); *b = Button();
b->nextButton = 0; b->nextButton = 0;
b->data0Val2 = b->data1Val2 = b->data2Val2 = 0xfe; b->data0Val2 = b->data1Val2 = b->data2Val2 = 0xFE;
b->data0Val3 = b->data1Val3 = b->data2Val3 = 0x01; b->data0Val3 = b->data1Val3 = b->data2Val3 = 0x01;
b->index = cnt; b->index = cnt;
@ -925,7 +925,7 @@ void LoLEngine::gui_initButton(int index, int x, int y, int val) {
b->dimTableIndex = _buttonData[index].screenDim; b->dimTableIndex = _buttonData[index].screenDim;
b->flags = _buttonData[index].buttonflags; b->flags = _buttonData[index].buttonflags;
b->arg = (val != -1) ? (uint8)(val & 0xff) : _buttonData[index].index; b->arg = (val != -1) ? (uint8)(val & 0xFF) : _buttonData[index].index;
if (index == 15) { if (index == 15) {
// magic sub menu // magic sub menu
@ -1100,17 +1100,17 @@ int LoLEngine::clickedMagicSubmenu(Button *button) {
gui_enableDefaultPlayfieldButtons(); gui_enableDefaultPlayfieldButtons();
if (checkMagic(c, _availableSpells[_selectedSpell], spellLevel)) { if (checkMagic(c, _availableSpells[_selectedSpell], spellLevel)) {
_characters[c].flags &= 0xffef; _characters[c].flags &= 0xFFEF;
gui_drawCharPortraitWithStats(c); gui_drawCharPortraitWithStats(c);
} else { } else {
_characters[c].flags |= 4; _characters[c].flags |= 4;
_characters[c].flags &= 0xffef; _characters[c].flags &= 0xFFEF;
if (castSpell(c, _availableSpells[_selectedSpell], spellLevel)) { if (castSpell(c, _availableSpells[_selectedSpell], spellLevel)) {
setCharacterUpdateEvent(c, 1, 8, 1); setCharacterUpdateEvent(c, 1, 8, 1);
increaseExperience(c, 2, spellLevel * spellLevel); increaseExperience(c, 2, spellLevel * spellLevel);
} else { } else {
_characters[c].flags &= 0xfffb; _characters[c].flags &= 0xFFFB;
gui_drawCharPortraitWithStats(c); gui_drawCharPortraitWithStats(c);
} }
} }
@ -1120,7 +1120,7 @@ int LoLEngine::clickedMagicSubmenu(Button *button) {
} }
int LoLEngine::clickedScreen(Button *button) { int LoLEngine::clickedScreen(Button *button) {
_characters[_activeMagicMenu].flags &= 0xffef; _characters[_activeMagicMenu].flags &= 0xFFEF;
gui_drawCharPortraitWithStats(_activeMagicMenu); gui_drawCharPortraitWithStats(_activeMagicMenu);
_activeMagicMenu = -1; _activeMagicMenu = -1;
@ -1178,12 +1178,12 @@ int LoLEngine::clickedPortraitEtcRight(Button *button) {
runItemScript(c, _itemInHand, 0x400, 0, 0); runItemScript(c, _itemInHand, 0x400, 0, 0);
runLevelScriptCustom(_currentBlock, 0x400, c, _itemInHand, 0, 0); runLevelScriptCustom(_currentBlock, 0x400, c, _itemInHand, 0, 0);
} else { } else {
_txt->printMessage(2, getLangString(0x402c), _characters[c].name); _txt->printMessage(2, getLangString(0x402C), _characters[c].name);
} }
return 1; return 1;
} }
_txt->printMessage(2, "%s", getLangString((flg & 8) ? 0x4029 : ((flg & 0x10) ? 0x402a : 0x402b))); _txt->printMessage(2, "%s", getLangString((flg & 8) ? 0x4029 : ((flg & 0x10) ? 0x402A : 0x402B)));
return 1; return 1;
} }
@ -1235,13 +1235,13 @@ int LoLEngine::clickedCharInventorySlot(Button *button) {
} }
int LoLEngine::clickedExitCharInventory(Button *button) { int LoLEngine::clickedExitCharInventory(Button *button) {
_updateFlags &= 0xfff3; _updateFlags &= 0xFFF3;
gui_enableDefaultPlayfieldButtons(); gui_enableDefaultPlayfieldButtons();
_weaponsDisabled = false; _weaponsDisabled = false;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (_charInventoryUnk & (1 << i)) if (_charInventoryUnk & (1 << i))
_characters[i].flags &= 0xf1ff; _characters[i].flags &= 0xF1FF;
} }
_screen->copyBlockToPage(2, 0, 0, 320, 200, _pageBuffer1); _screen->copyBlockToPage(2, 0, 0, 320, 200, _pageBuffer1);
@ -1315,7 +1315,7 @@ int LoLEngine::clickedScenePickupItem(Button *button) {
uint16 block = (p <= 128) ? calcNewBlockPosition(_currentBlock, _currentDirection) : _currentBlock; uint16 block = (p <= 128) ? calcNewBlockPosition(_currentBlock, _currentDirection) : _currentBlock;
int found = checkSceneForItems(&_levelBlockProperties[block].drawObjects, p & 0x7f); int found = checkSceneForItems(&_levelBlockProperties[block].drawObjects, p & 0x7F);
if (found != -1) { if (found != -1) {
removeLevelItem(found, block); removeLevelItem(found, block);
@ -1465,7 +1465,7 @@ int LoLEngine::clickedSpellTargetCharacter(Button *button) {
int t = button->arg; int t = button->arg;
_txt->printMessage(0, "%s.\r", _characters[t].name); _txt->printMessage(0, "%s.\r", _characters[t].name);
if ((_spellProperties[_activeSpell.spell].flags & 0xff) == 1) { if ((_spellProperties[_activeSpell.spell].flags & 0xFF) == 1) {
_activeSpell.target = t; _activeSpell.target = t;
castHealOnSingleCharacter(&_activeSpell); castHealOnSingleCharacter(&_activeSpell);
} }
@ -1504,7 +1504,7 @@ int LoLEngine::clickedSceneThrowItem(Button *button) {
uint16 y = 0; uint16 y = 0;
calcCoordinates(x, y, _currentBlock, 0x80, 0x80); calcCoordinates(x, y, _currentBlock, 0x80, 0x80);
if (launchObject(0, _itemInHand, x, y, 12, _currentDirection << 1, 6, _selectedCharacter, 0x3f)) { if (launchObject(0, _itemInHand, x, y, 12, _currentDirection << 1, 6, _selectedCharacter, 0x3F)) {
snd_playSoundEffect(18, -1); snd_playSoundEffect(18, -1);
setHandItem(0); setHandItem(0);
} }
@ -1520,7 +1520,7 @@ int LoLEngine::clickedOptions(Button *button) {
_updateFlags |= 4; _updateFlags |= 4;
Button b; Button b;
b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xFE;
b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01;
if (_weaponsDisabled) if (_weaponsDisabled)
@ -1540,7 +1540,7 @@ int LoLEngine::clickedOptions(Button *button) {
_gui->runMenu(_gui->_mainMenu); _gui->runMenu(_gui->_mainMenu);
_updateFlags &= 0xfffb; _updateFlags &= 0xFFFB;
setMouseCursorToItemInHand(); setMouseCursorToItemInHand();
resetLampStatus(); resetLampStatus();
gui_enableDefaultPlayfieldButtons(); gui_enableDefaultPlayfieldButtons();
@ -1564,7 +1564,7 @@ int LoLEngine::clickedRestParty(Button *button) {
gui_toggleButtonDisplayMode(_flags.isTalkie ? 77 : 75, 1); gui_toggleButtonDisplayMode(_flags.isTalkie ? 77 : 75, 1);
Button b; Button b;
b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xFE;
b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01;
if (_weaponsDisabled) if (_weaponsDisabled)
@ -1710,7 +1710,7 @@ int LoLEngine::clickedRestParty(Button *button) {
bool setframe = true; bool setframe = true;
if (_characters[i].flags & 0x1000) { if (_characters[i].flags & 0x1000) {
_characters[i].flags &= 0xefff; _characters[i].flags &= 0xEFFF;
if (_partyAwake) { if (_partyAwake) {
if (_characters[i].damageSuffered) { if (_characters[i].damageSuffered) {
@ -1733,7 +1733,7 @@ int LoLEngine::clickedRestParty(Button *button) {
setTemporaryFaceFrame(i, frm, upd, 1); setTemporaryFaceFrame(i, frm, upd, 1);
} }
_updateFlags &= 0xfffe; _updateFlags &= 0xFFFE;
_partyAwake = true; _partyAwake = true;
updateDrawPage2(); updateDrawPage2();
gui_drawScene(0); gui_drawScene(0);
@ -1742,7 +1742,7 @@ int LoLEngine::clickedRestParty(Button *button) {
} else { } else {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
_characters[i].flags &= 0xefff; _characters[i].flags &= 0xEFFF;
if (needPoisoningFlags) { if (needPoisoningFlags) {
setTemporaryFaceFrameForAllCharacters(0, 0, 0); setTemporaryFaceFrameForAllCharacters(0, 0, 0);
@ -1750,7 +1750,7 @@ int LoLEngine::clickedRestParty(Button *button) {
if (needPoisoningFlags & (1 << i)) if (needPoisoningFlags & (1 << i))
setTemporaryFaceFrame(i, 3, 8, 0); setTemporaryFaceFrame(i, 3, 8, 0);
} }
_txt->printMessage(0x8000, "%s", getLangString(0x405a)); _txt->printMessage(0x8000, "%s", getLangString(0x405A));
gui_drawAllCharPortraitsWithStats(); gui_drawAllCharPortraitsWithStats();
} else { } else {
@ -1773,10 +1773,10 @@ int LoLEngine::clickedCompass(Button *button) {
return 0; return 0;
if (_compassBroken) { if (_compassBroken) {
if (characterSays(0x425b, -1, true)) if (characterSays(0x425B, -1, true))
_txt->printMessage(4, "%s", getLangString(0x425b)); _txt->printMessage(4, "%s", getLangString(0x425B));
} else { } else {
_txt->printMessage(0, "%s", getLangString(0x402f + _currentDirection)); _txt->printMessage(0, "%s", getLangString(0x402F + _currentDirection));
} }
return 1; return 1;
@ -1813,8 +1813,8 @@ int LoLEngine::clickedLamp(Button *button) {
_lampOilStatus += 100; _lampOilStatus += 100;
} else { } else {
uint16 s = (_lampOilStatus >= 100) ? 0x4060 : ((!_lampOilStatus) ? 0x405c : (_lampOilStatus / 33) + 0x405d); uint16 s = (_lampOilStatus >= 100) ? 0x4060 : ((!_lampOilStatus) ? 0x405C : (_lampOilStatus / 33) + 0x405D);
_txt->printMessage(0, getLangString(0x405b), getLangString(s)); _txt->printMessage(0, getLangString(0x405B), getLangString(s));
} }
if (_brightness) if (_brightness)
@ -1836,7 +1836,7 @@ int LoLEngine::clickedStatusIcon(Button *button) {
if (str == 0 || str > 3) if (str == 0 || str > 3)
return 1; return 1;
_txt->printMessage(0x8002, "%s", getLangString(str == 1 ? 0x424c : (str == 2 ? 0x424e : 0x424d))); _txt->printMessage(0x8002, "%s", getLangString(str == 1 ? 0x424C : (str == 2 ? 0x424E : 0x424D)));
return 1; return 1;
} }
@ -2239,7 +2239,7 @@ int GUI_LoL::runMenu(Menu &menu) {
if (_currentMenu == &_gameOptions) { if (_currentMenu == &_gameOptions) {
char *s = (char *)_vm->_tempBuffer5120; char *s = (char *)_vm->_tempBuffer5120;
Common::strlcpy(s, _vm->getLangString(0x406f + _vm->_monsterDifficulty), 30); Common::strlcpy(s, _vm->getLangString(0x406F + _vm->_monsterDifficulty), 30);
_currentMenu->item[_vm->gameFlags().isTalkie ? 0 : 2].itemString = s; _currentMenu->item[_vm->gameFlags().isTalkie ? 0 : 2].itemString = s;
s += (strlen(s) + 1); s += (strlen(s) + 1);
@ -2252,7 +2252,7 @@ int GUI_LoL::runMenu(Menu &menu) {
s += (strlen(s) + 1); s += (strlen(s) + 1);
if (_vm->gameFlags().isTalkie) { if (_vm->gameFlags().isTalkie) {
Common::strlcpy(s, _vm->getLangString(0x42d6 + _vm->_lang), 30); Common::strlcpy(s, _vm->getLangString(0x42D6 + _vm->_lang), 30);
_currentMenu->item[3].itemString = s; _currentMenu->item[3].itemString = s;
s += (strlen(s) + 1); s += (strlen(s) + 1);
@ -2315,7 +2315,7 @@ int GUI_LoL::runMenu(Menu &menu) {
for (int ii = 0; ii < 3; ++ii) { for (int ii = 0; ii < 3; ++ii) {
Button *b = getButtonListData() + 1 + (i - 1) * 3 + ii; Button *b = getButtonListData() + 1 + (i - 1) * 3 + ii;
b->nextButton = 0; b->nextButton = 0;
b->data0Val2 = b->data1Val2 = b->data2Val2 = 0xfe; b->data0Val2 = b->data1Val2 = b->data2Val2 = 0xFE;
b->data0Val3 = b->data1Val3 = b->data2Val3 = 0x01; b->data0Val3 = b->data1Val3 = b->data2Val3 = 0x01;
b->index = ii; b->index = ii;
@ -2367,9 +2367,9 @@ int GUI_LoL::runMenu(Menu &menu) {
int mw = (d->w << 3) + 1; int mw = (d->w << 3) + 1;
int mh = d->h + 1; int mh = d->h + 1;
if (_vm->gameFlags().use16ColorMode) { if (_vm->gameFlags().use16ColorMode) {
_screen->drawShadedBox(mx, my, mx + mw + 1, my + mh + 1, 0xdd, 0xff); _screen->drawShadedBox(mx, my, mx + mw + 1, my + mh + 1, 0xDD, 0xFF);
_screen->drawLine(true, mx + mw + 1, my, mh + 1, 0xcc); _screen->drawLine(true, mx + mw + 1, my, mh + 1, 0xCC);
_screen->drawLine(false, mx, my + mh + 1, mw + 2, 0xcc); _screen->drawLine(false, mx, my + mh + 1, mw + 2, 0xCC);
} else { } else {
_screen->drawShadedBox(mx, my, mx + mw, my + mh, 227, 223); _screen->drawShadedBox(mx, my, mx + mw, my + mh, 227, 223);
} }
@ -2622,7 +2622,7 @@ int GUI_LoL::clickedMainMenu(Button *button) {
_newMenu = &_audioOptions; _newMenu = &_audioOptions;
break; break;
case 0x4006: case 0x4006:
_choiceMenu.menuNameId = 0x400a; _choiceMenu.menuNameId = 0x400A;
_newMenu = &_choiceMenu; _newMenu = &_choiceMenu;
break; break;
case 0x4005: case 0x4005:
@ -2677,7 +2677,7 @@ int GUI_LoL::clickedDeleteMenu(Button *button) {
return 1; return 1;
} }
_choiceMenu.menuNameId = 0x400b; _choiceMenu.menuNameId = 0x400B;
_newMenu = &_choiceMenu; _newMenu = &_choiceMenu;
int16 s = (int16)button->arg; int16 s = (int16)button->arg;
_menuResult = _deleteMenu.item[-s - 2].saveSlot + 1; _menuResult = _deleteMenu.item[-s - 2].saveSlot + 1;
@ -2689,7 +2689,7 @@ int GUI_LoL::clickedOptionsMenu(Button *button) {
updateMenuButton(button); updateMenuButton(button);
switch (button->arg) { switch (button->arg) {
case 0xfff9: case 0xFFF9:
_vm->_configMusic ^= 1; _vm->_configMusic ^= 1;
_vm->sound()->enableMusic(_vm->_configMusic); _vm->sound()->enableMusic(_vm->_configMusic);
@ -2698,23 +2698,23 @@ int GUI_LoL::clickedOptionsMenu(Button *button) {
else else
_vm->_sound->beginFadeOut(); _vm->_sound->beginFadeOut();
break; break;
case 0xfff8: case 0xFFF8:
_vm->_configSounds ^= true; _vm->_configSounds ^= true;
_vm->sound()->enableSFX(_vm->_configSounds); _vm->sound()->enableSFX(_vm->_configSounds);
break; break;
case 0xfff7: case 0xFFF7:
_vm->_monsterDifficulty = (_vm->_monsterDifficulty + 1) % 3; _vm->_monsterDifficulty = (_vm->_monsterDifficulty + 1) % 3;
break; break;
case 0xfff6: case 0xFFF6:
_vm->_smoothScrollingEnabled ^= true; _vm->_smoothScrollingEnabled ^= true;
break; break;
case 0xfff5: case 0xFFF5:
_vm->_floatingCursorsEnabled ^= true; _vm->_floatingCursorsEnabled ^= true;
break; break;
case 0xfff4: case 0xFFF4:
_vm->_lang = (_vm->_lang + 1) % 3; _vm->_lang = (_vm->_lang + 1) % 3;
break; break;
case 0xfff3: case 0xFFF3:
_vm->_configVoice ^= 3; _vm->_configVoice ^= 3;
break; break;
case 0x4072: { case 0x4072: {
@ -2793,7 +2793,7 @@ int GUI_LoL::clickedAudioMenu(Button *button) {
} while (1); } while (1);
} else if (button->arg == 5) { } else if (button->arg == 5) {
_vm->_lastSpeechId = -1; _vm->_lastSpeechId = -1;
_vm->snd_playCharacterSpeech(0x42e0, 0, 0); _vm->snd_playCharacterSpeech(0x42E0, 0, 0);
} }
} }

View file

@ -36,9 +36,9 @@ namespace Kyra {
menu.width = (dim->w << 3); \ menu.width = (dim->w << 3); \
menu.height = (dim->h); \ menu.height = (dim->h); \
if (_vm->gameFlags().use16ColorMode) { \ if (_vm->gameFlags().use16ColorMode) { \
menu.bkgdColor = 0xcc; \ menu.bkgdColor = 0xCC; \
menu.color1 = 0xff; \ menu.color1 = 0xFF; \
menu.color2 = 0xdd; \ menu.color2 = 0xDD; \
} else { \ } else { \
menu.bkgdColor = 225; \ menu.bkgdColor = 225; \
menu.color1 = 223; \ menu.color1 = 223; \
@ -49,7 +49,7 @@ namespace Kyra {
menu.numberOfItems = d; \ menu.numberOfItems = d; \
menu.titleX = (dim->sx << 3) + (dim->w << 2); \ menu.titleX = (dim->sx << 3) + (dim->w << 2); \
menu.titleY = 6; \ menu.titleY = 6; \
menu.textColor = _vm->gameFlags().use16ColorMode ? 0xe1 : 254; \ menu.textColor = _vm->gameFlags().use16ColorMode ? 0xE1 : 254; \
menu.scrollUpButtonX = e; \ menu.scrollUpButtonX = e; \
menu.scrollUpButtonY = f; \ menu.scrollUpButtonY = f; \
menu.scrollDownButtonX = g; \ menu.scrollDownButtonX = g; \
@ -65,13 +65,13 @@ namespace Kyra {
item.y = c; \ item.y = c; \
item.width = d; \ item.width = d; \
item.height = e; \ item.height = e; \
item.textColor = _vm->gameFlags().use16ColorMode ? 0xc1 : 204; \ item.textColor = _vm->gameFlags().use16ColorMode ? 0xC1 : 204; \
item.highlightColor = _vm->gameFlags().use16ColorMode ? 0xe1 : 254; \ item.highlightColor = _vm->gameFlags().use16ColorMode ? 0xE1 : 254; \
item.titleX = -1; \ item.titleX = -1; \
if (_vm->gameFlags().use16ColorMode) { \ if (_vm->gameFlags().use16ColorMode) { \
item.bkgdColor = 0xcc; \ item.bkgdColor = 0xCC; \
item.color1 = 0xff; \ item.color1 = 0xFF; \
item.color2 = 0xdd; \ item.color2 = 0xDD; \
} else { \ } else { \
item.bkgdColor = 225; \ item.bkgdColor = 225; \
item.color1 = 223; \ item.color1 = 223; \

View file

@ -107,7 +107,7 @@ bool KyraRpgEngine::clickedShape(int shapeIndex) {
uint16 s = _levelDecorationProperties[shapeIndex].shapeIndex[1]; uint16 s = _levelDecorationProperties[shapeIndex].shapeIndex[1];
if (s == 0xffff) if (s == 0xFFFF)
continue; continue;
int w = _flags.gameID == GI_LOL ? _levelDecorationShapes[s][3] : (_levelDecorationShapes[s][2] << 3); int w = _flags.gameID == GI_LOL ? _levelDecorationShapes[s][3] : (_levelDecorationShapes[s][2] << 3);

View file

@ -118,7 +118,7 @@ void EoBCoreEngine::setItemPosition(Item *itemQueue, int block, Item item, int p
EoBItem *itm = &_items[item]; EoBItem *itm = &_items[item];
itm->pos = pos; itm->pos = pos;
itm->block = block; itm->block = block;
itm->level = block < 0 ? 0xff : _currentLevel; itm->level = block < 0 ? 0xFF : _currentLevel;
if (!*itemQueue) { if (!*itemQueue) {
*itemQueue = itm->next = itm->prev = item; *itemQueue = itm->next = itm->prev = item;
@ -141,7 +141,7 @@ void EoBCoreEngine::createInventoryItem(EoBCharacter *c, Item itemIndex, int16 i
if (itemValue != -1) if (itemValue != -1)
_items[itemIndex].value = itemValue; _items[itemIndex].value = itemValue;
if (itemValue && ((_itemTypes[_items[itemIndex].type].extraProperties & 0x7f) < 4)) if (itemValue && ((_itemTypes[_items[itemIndex].type].extraProperties & 0x7F) < 4))
_items[itemIndex].flags |= 0x80; _items[itemIndex].flags |= 0x80;
if (c->inventory[preferedInventorySlot]) { if (c->inventory[preferedInventorySlot]) {
@ -208,7 +208,7 @@ int EoBCoreEngine::validateInventorySlotForItem(Item item, int charIndex, int sl
} }
int itm = _characters[charIndex].inventory[slot]; int itm = _characters[charIndex].inventory[slot];
int ex = _itemTypes[_items[itm].type].extraProperties & 0x7f; int ex = _itemTypes[_items[itm].type].extraProperties & 0x7F;
if (_items[itm].flags & 0x20 && (_flags.gameID == GI_EOB1 || slot < 2)) { if (_items[itm].flags & 0x20 && (_flags.gameID == GI_EOB1 || slot < 2)) {
if (_flags.gameID == GI_EOB2 && ex > 0 && ex < 4) if (_flags.gameID == GI_EOB2 && ex > 0 && ex < 4)
@ -216,7 +216,7 @@ int EoBCoreEngine::validateInventorySlotForItem(Item item, int charIndex, int sl
return 0; return 0;
} }
uint16 v = item ? _itemTypes[_items[item].type].invFlags : 0xffff; uint16 v = item ? _itemTypes[_items[item].type].invFlags : 0xFFFF;
if (v & _slotValidationFlags[slot]) if (v & _slotValidationFlags[slot])
return 1; return 1;
@ -359,7 +359,7 @@ void EoBCoreEngine::printFullItemName(Item item) {
EoBItem *itm = &_items[item]; EoBItem *itm = &_items[item];
const char *nameUnid = _itemNames[itm->nameUnid]; const char *nameUnid = _itemNames[itm->nameUnid];
const char *nameId = _itemNames[itm->nameId]; const char *nameId = _itemNames[itm->nameId];
uint8 f = _itemTypes[itm->type].extraProperties & 0x7f; uint8 f = _itemTypes[itm->type].extraProperties & 0x7F;
int8 v = itm->value; int8 v = itm->value;
const char *tstr2 = 0; const char *tstr2 = 0;

View file

@ -84,7 +84,7 @@ bool KyraEngine_HoF::dropItem(int unk1, Item item, int x, int y, int unk2) {
bool success = processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2); bool success = processItemDrop(_mainCharacter.sceneId, item, x, y, unk1, unk2);
if (!success) { if (!success) {
snd_playSoundEffect(0x0d); snd_playSoundEffect(0x0D);
if (countAllItems() >= 30) if (countAllItems() >= 30)
showMessageFromCCode(5, 0x84, 0); showMessageFromCCode(5, 0x84, 0);
} }
@ -205,7 +205,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
if (startX == dstX && startY == dstY) { if (startX == dstX && startY == dstY) {
if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) { if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
updateCharFacing(); updateCharFacing();
snd_playSoundEffect(0x2d); snd_playSoundEffect(0x2D);
removeHandItem(); removeHandItem();
objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF); objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
} else { } else {
@ -213,7 +213,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
_itemList[itemSlot].y = dstY; _itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item; _itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId; _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
snd_playSoundEffect(0x0c); snd_playSoundEffect(0x0C);
addItemToAnimList(itemSlot); addItemToAnimList(itemSlot);
} }
} else { } else {
@ -283,7 +283,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) { if (_layerFlagTable[_screen->getLayer(dstX, dstY)] && item != 13) {
updateCharFacing(); updateCharFacing();
snd_playSoundEffect(0x2d); snd_playSoundEffect(0x2D);
removeHandItem(); removeHandItem();
_screen->showMouse(); _screen->showMouse();
objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF); objectChat(getTableString(0xFF, _cCodeBuffer, 1), 0, 0x83, 0xFF);
@ -292,7 +292,7 @@ void KyraEngine_HoF::itemDropDown(int startX, int startY, int dstX, int dstY, in
_itemList[itemSlot].y = dstY; _itemList[itemSlot].y = dstY;
_itemList[itemSlot].id = item; _itemList[itemSlot].id = item;
_itemList[itemSlot].sceneId = _mainCharacter.sceneId; _itemList[itemSlot].sceneId = _mainCharacter.sceneId;
snd_playSoundEffect(0x0c); snd_playSoundEffect(0x0C);
addItemToAnimList(itemSlot); addItemToAnimList(itemSlot);
_screen->showMouse(); _screen->showMouse();
} }
@ -307,7 +307,7 @@ void KyraEngine_HoF::exchangeMouseItem(int itemPos) {
_itemInHand = itemId; _itemInHand = itemId;
addItemToAnimList(itemPos); addItemToAnimList(itemPos);
snd_playSoundEffect(0x0b); snd_playSoundEffect(0x0B);
setMouseCursor(_itemInHand); setMouseCursor(_itemInHand);
int str2 = 7; int str2 = 7;
@ -331,7 +331,7 @@ bool KyraEngine_HoF::pickUpItem(int x, int y) {
deleteItemAnimEntry(itemPos); deleteItemAnimEntry(itemPos);
int itemId = _itemList[itemPos].id; int itemId = _itemList[itemPos].id;
_itemList[itemPos].id = kItemNone; _itemList[itemPos].id = kItemNone;
snd_playSoundEffect(0x0b); snd_playSoundEffect(0x0B);
setMouseCursor(itemId); setMouseCursor(itemId);
int str2 = 7; int str2 = 7;

View file

@ -29,9 +29,9 @@ namespace Kyra {
int KyraEngine_LoK::findDuplicateItemShape(int shape) { int KyraEngine_LoK::findDuplicateItemShape(int shape) {
static const uint8 dupTable[] = { static const uint8 dupTable[] = {
0x48, 0x46, 0x49, 0x47, 0x4a, 0x46, 0x4b, 0x47, 0x48, 0x46, 0x49, 0x47, 0x4A, 0x46, 0x4B, 0x47,
0x4c, 0x46, 0x4d, 0x47, 0x5b, 0x5a, 0x5c, 0x5a, 0x4C, 0x46, 0x4D, 0x47, 0x5B, 0x5A, 0x5C, 0x5A,
0x5d, 0x5a, 0x5e, 0x5a, 0xFF, 0xFF 0x5D, 0x5A, 0x5E, 0x5A, 0xFF, 0xFF
}; };
int i = 0; int i = 0;

View file

@ -29,7 +29,7 @@ namespace Kyra {
LoLObject *LoLEngine::findObject(uint16 index) { LoLObject *LoLEngine::findObject(uint16 index) {
if (index & 0x8000) if (index & 0x8000)
return &_monsters[index & 0x7fff]; return &_monsters[index & 0x7FFF];
else else
return &_itemsInPlay[index]; return &_itemsInPlay[index];
} }
@ -221,7 +221,7 @@ Item LoLEngine::makeItem(int itemType, int curFrame, int flags) {
memset(&_itemsInPlay[slot], 0, sizeof(LoLItem)); memset(&_itemsInPlay[slot], 0, sizeof(LoLItem));
_itemsInPlay[slot].itemPropertyIndex = itemType; _itemsInPlay[slot].itemPropertyIndex = itemType;
_itemsInPlay[slot].shpCurFrame_flg = (curFrame & 0x1fff) | flags; _itemsInPlay[slot].shpCurFrame_flg = (curFrame & 0x1FFF) | flags;
_itemsInPlay[slot].level = -1; _itemsInPlay[slot].level = -1;
return slot; return slot;
@ -292,7 +292,7 @@ void LoLEngine::runItemScript(int charNum, Item item, int flags, int next, int r
memset(&scriptState, 0, sizeof(EMCState)); memset(&scriptState, 0, sizeof(EMCState));
uint8 func = item ? _itemProperties[_itemsInPlay[item].itemPropertyIndex].itemScriptFunc : 3; uint8 func = item ? _itemProperties[_itemsInPlay[item].itemPropertyIndex].itemScriptFunc : 3;
if (func == 0xff) if (func == 0xFF)
return; return;
_emc->init(&scriptState, &_itemScript); _emc->init(&scriptState, &_itemScript);
@ -351,8 +351,8 @@ bool LoLEngine::itemEquipped(int charNum, uint16 itemType) {
void LoLEngine::setItemPosition(Item item, uint16 x, uint16 y, int flyingHeight, int moveable) { void LoLEngine::setItemPosition(Item item, uint16 x, uint16 y, int flyingHeight, int moveable) {
if (!flyingHeight) { if (!flyingHeight) {
x = (x & 0xffc0) | 0x40; x = (x & 0xFFC0) | 0x40;
y = (y & 0xffc0) | 0x40; y = (y & 0xFFC0) | 0x40;
} }
uint16 block = calcBlockIndex(x, y); uint16 block = calcBlockIndex(x, y);
@ -364,7 +364,7 @@ void LoLEngine::setItemPosition(Item item, uint16 x, uint16 y, int flyingHeight,
if (moveable) if (moveable)
_itemsInPlay[item].shpCurFrame_flg |= 0x4000; _itemsInPlay[item].shpCurFrame_flg |= 0x4000;
else else
_itemsInPlay[item].shpCurFrame_flg &= 0xbfff; _itemsInPlay[item].shpCurFrame_flg &= 0xBFFF;
assignItemToBlock(&_levelBlockProperties[block].assignedObjects, item); assignItemToBlock(&_levelBlockProperties[block].assignedObjects, item);
@ -429,9 +429,9 @@ bool LoLEngine::launchObject(int objectType, Item item, int startX, int startY,
if (attackerId != -1) { if (attackerId != -1) {
if (attackerId & 0x8000) { if (attackerId & 0x8000) {
t->flags &= 0xfd; t->flags &= 0xFD;
} else { } else {
t->flags &= 0xfb; t->flags &= 0xFB;
increaseExperience(attackerId, 1, 2); increaseExperience(attackerId, 1, 2);
} }
} }
@ -455,8 +455,8 @@ void LoLEngine::endObjectFlight(FlyingObject *t, int x, int y, int collisionType
if (t->objectType == 0 || t->objectType == 1) { if (t->objectType == 0 || t->objectType == 1) {
objectFlightProcessHits(t, cx, cy, collisionType); objectFlightProcessHits(t, cx, cy, collisionType);
t->x = (cx & 0xffc0) | 0x40; t->x = (cx & 0xFFC0) | 0x40;
t->y = (cy & 0xffc0) | 0x40; t->y = (cy & 0xFFC0) | 0x40;
t->flyingHeight = 0; t->flyingHeight = 0;
updateObjectFlightPosition(t); updateObjectFlightPosition(t);
} }

View file

@ -180,7 +180,7 @@ Common::Error KyraRpgEngine::init() {
_vcnColTable = new uint8[128]; _vcnColTable = new uint8[128];
for (int i = 0; i < 128; i++) for (int i = 0; i < 128; i++)
_vcnColTable[i] = i & 0x0f; _vcnColTable[i] = i & 0x0F;
_doorShapes = new uint8*[6]; _doorShapes = new uint8*[6];
memset(_doorShapes, 0, 6 * sizeof(uint8 *)); memset(_doorShapes, 0, 6 * sizeof(uint8 *));
@ -209,9 +209,9 @@ void KyraRpgEngine::drawDialogueButtons() {
for (int i = 0; i < _dialogueNumButtons; i++) { for (int i = 0; i < _dialogueNumButtons; i++) {
int x = _dialogueButtonPosX[i]; int x = _dialogueButtonPosX[i];
if (gameFlags().use16ColorMode) { if (gameFlags().use16ColorMode) {
gui_drawBox(x, ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1, 74, 10, 0xee, 0xcc, -1); gui_drawBox(x, ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) & ~7) - 1, 74, 10, 0xEE, 0xCC, -1);
screen()->printText(_dialogueButtonString[i], (x + 37 - (screen()->getTextWidth(_dialogueButtonString[i])) / 2) & ~3, screen()->printText(_dialogueButtonString[i], (x + 37 - (screen()->getTextWidth(_dialogueButtonString[i])) / 2) & ~3,
((_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2) & ~7, _dialogueHighlightedButton == i ? 0xc1 : 0xe1, 0); ((_dialogueButtonYoffs + _dialogueButtonPosY[i]) + 2) & ~7, _dialogueHighlightedButton == i ? 0xC1 : 0xE1, 0);
} else { } else {
gui_drawBox(x, (_dialogueButtonYoffs + _dialogueButtonPosY[i]), _dialogueButtonWidth, guiSettings()->buttons.height, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill); gui_drawBox(x, (_dialogueButtonYoffs + _dialogueButtonPosY[i]), _dialogueButtonWidth, guiSettings()->buttons.height, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
screen()->printText(_dialogueButtonString[i], x + (_dialogueButtonWidth >> 1) - (screen()->getTextWidth(_dialogueButtonString[i])) / 2, screen()->printText(_dialogueButtonString[i], x + (_dialogueButtonWidth >> 1) - (screen()->getTextWidth(_dialogueButtonString[i])) / 2,

View file

@ -114,7 +114,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraRpgEngine(sy
_selectedSpell = 0; _selectedSpell = 0;
_updateCharNum = _portraitSpeechAnimMode = _textColorFlag = 0; _updateCharNum = _portraitSpeechAnimMode = _textColorFlag = 0;
_palUpdateTimer = _updatePortraitNext = 0; _palUpdateTimer = _updatePortraitNext = 0;
_lampStatusTimer = 0xffffffff; _lampStatusTimer = 0xFFFFFFFF;
_weaponsDisabled = false; _weaponsDisabled = false;
_charInventoryUnk = 0; _charInventoryUnk = 0;
@ -381,10 +381,10 @@ Common::Error LoLEngine::init() {
_screen->setAnimBlockPtr(10000); _screen->setAnimBlockPtr(10000);
_screen->setScreenDim(0); _screen->setScreenDim(0);
_pageBuffer1 = new uint8[0xfa00]; _pageBuffer1 = new uint8[0xFA00];
memset(_pageBuffer1, 0, 0xfa00); memset(_pageBuffer1, 0, 0xFA00);
_pageBuffer2 = new uint8[0xfa00]; _pageBuffer2 = new uint8[0xFA00];
memset(_pageBuffer2, 0, 0xfa00); memset(_pageBuffer2, 0, 0xFA00);
_itemsInPlay = new LoLItem[400]; _itemsInPlay = new LoLItem[400];
memset(_itemsInPlay, 0, sizeof(LoLItem) * 400); memset(_itemsInPlay, 0, sizeof(LoLItem) * 400);
@ -674,7 +674,7 @@ void LoLEngine::checkFloatingPointerRegions() {
uint8 *LoLEngine::getItemIconShapePtr(int index) { uint8 *LoLEngine::getItemIconShapePtr(int index) {
int ix = _itemProperties[_itemsInPlay[index].itemPropertyIndex].shpIndex; int ix = _itemProperties[_itemsInPlay[index].itemPropertyIndex].shpIndex;
if (_itemProperties[_itemsInPlay[index].itemPropertyIndex].flags & 0x200) if (_itemProperties[_itemsInPlay[index].itemPropertyIndex].flags & 0x200)
ix += (_itemsInPlay[index].shpCurFrame_flg & 0x1fff) - 1; ix += (_itemsInPlay[index].shpCurFrame_flg & 0x1FFF) - 1;
return _itemIconShapes[ix]; return _itemIconShapes[ix];
} }
@ -1029,7 +1029,7 @@ void LoLEngine::decodeSjis(const char *src, char *dst) {
uint8 cmd = 0; uint8 cmd = 0;
while ((cmd = *src++) != 0) { while ((cmd = *src++) != 0) {
if (cmd == 27) { if (cmd == 27) {
cmd = *src++ & 0x7f; cmd = *src++ & 0x7F;
memcpy(dst, src, cmd * 2); memcpy(dst, src, cmd * 2);
dst += cmd * 2; dst += cmd * 2;
src += cmd * 2; src += cmd * 2;
@ -1341,7 +1341,7 @@ int LoLEngine::calculateProtection(int index) {
int c = 0; int c = 0;
if (index & 0x8000) { if (index & 0x8000) {
// Monster // Monster
index &= 0x7fff; index &= 0x7FFF;
c = (_monsters[index].properties->itemProtection * _monsters[index].properties->fightingStats[2]) >> 8; c = (_monsters[index].properties->itemProtection * _monsters[index].properties->fightingStats[2]) >> 8;
} else { } else {
// Character // Character
@ -1490,7 +1490,7 @@ void LoLEngine::increaseCharacterHitpoints(int charNum, int points, bool ignoreD
points = 1; points = 1;
_characters[charNum].hitPointsCur = CLIP<int16>(_characters[charNum].hitPointsCur + points, 1, _characters[charNum].hitPointsMax); _characters[charNum].hitPointsCur = CLIP<int16>(_characters[charNum].hitPointsCur + points, 1, _characters[charNum].hitPointsMax);
_characters[charNum].flags &= 0xfff7; _characters[charNum].flags &= 0xFFF7;
} }
void LoLEngine::setupScreenDims() { void LoLEngine::setupScreenDims() {
@ -1561,10 +1561,10 @@ void LoLEngine::gui_specialSceneSuspendControls(int controlMode) {
void LoLEngine::gui_specialSceneRestoreControls(int restoreLamp) { void LoLEngine::gui_specialSceneRestoreControls(int restoreLamp) {
if (restoreLamp) { if (restoreLamp) {
_updateFlags &= 0xfffa; _updateFlags &= 0xFFFA;
resetLampStatus(); resetLampStatus();
} }
_updateFlags &= 0xfffe; _updateFlags &= 0xFFFE;
_specialSceneFlag = 0; _specialSceneFlag = 0;
checkFloatingPointerRegions(); checkFloatingPointerRegions();
} }
@ -1572,7 +1572,7 @@ void LoLEngine::gui_specialSceneRestoreControls(int restoreLamp) {
void LoLEngine::restoreAfterSceneWindowDialogue(int redraw) { void LoLEngine::restoreAfterSceneWindowDialogue(int redraw) {
gui_enableControls(); gui_enableControls();
_txt->setupField(false); _txt->setupField(false);
_updateFlags &= 0xffdf; _updateFlags &= 0xFFDF;
setDefaultButtonState(); setDefaultButtonState();
@ -1601,8 +1601,8 @@ void LoLEngine::initDialogueSequence(int controlMode, int pageNum) {
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
_screen->fillRect(0, 128, 319, 199, 0x44); _screen->fillRect(0, 128, 319, 199, 0x44);
gui_drawBox(0, 129, 320, 71, 0xee, 0xcc, -1); gui_drawBox(0, 129, 320, 71, 0xEE, 0xCC, -1);
gui_drawBox(1, 130, 318, 69, 0xee, 0xcc, 0x11); gui_drawBox(1, 130, 318, 69, 0xEE, 0xCC, 0x11);
} else { } else {
_screen->fillRect(0, 128, 319, 199, 1); _screen->fillRect(0, 128, 319, 199, 1);
gui_drawBox(0, 129, 320, 71, 136, 251, -1); gui_drawBox(0, 129, 320, 71, 136, 251, -1);
@ -1651,7 +1651,7 @@ void LoLEngine::restoreAfterDialogueSequence(int controlMode) {
if (_currentControlMode) { if (_currentControlMode) {
_screen->modifyScreenDim(4, 11, 124, 28, 45); _screen->modifyScreenDim(4, 11, 124, 28, 45);
_screen->modifyScreenDim(5, 85, 123, 233, 54); _screen->modifyScreenDim(5, 85, 123, 233, 54);
_updateFlags &= 0xfffd; _updateFlags &= 0xFFFD;
} else { } else {
const ScreenDim *d = _screen->getScreenDim(5); const ScreenDim *d = _screen->getScreenDim(5);
_screen->fillRect(d->sx, d->sy, d->sx + d->w - (_flags.use16ColorMode ? 3 : 2), d->sy + d->h - 2, d->unkA); _screen->fillRect(d->sx, d->sy, d->sx + d->w - (_flags.use16ColorMode ? 3 : 2), d->sy + d->h - 2, d->unkA);
@ -1714,14 +1714,14 @@ void LoLEngine::generateBrightnessPalette(const Palette &src, Palette &dst, int
brightness = (8 - brightness) << 5; brightness = (8 - brightness) << 5;
if (modifier >= 0 && modifier < 8 && (_flagsTable[31] & 0x08)) { if (modifier >= 0 && modifier < 8 && (_flagsTable[31] & 0x08)) {
brightness = 256 - ((((modifier & 0xfffe) << 5) * (256 - brightness)) >> 8); brightness = 256 - ((((modifier & 0xFFFE) << 5) * (256 - brightness)) >> 8);
if (brightness < 0) if (brightness < 0)
brightness = 0; brightness = 0;
} }
for (int i = 0; i < 384; i++) { for (int i = 0; i < 384; i++) {
uint16 c = (dst[i] * brightness) >> 8; uint16 c = (dst[i] * brightness) >> 8;
dst[i] = c & 0xff; dst[i] = c & 0xFF;
} }
} }
} }
@ -1731,9 +1731,9 @@ void LoLEngine::generateFlashPalette(const Palette &src, Palette &dst, int color
for (int i = 2; i < 128; i++) { for (int i = 2; i < 128; i++) {
for (int ii = 0; ii < 3; ii++) { for (int ii = 0; ii < 3; ii++) {
uint8 t = src[i * 3 + ii] & 0x3f; uint8 t = src[i * 3 + ii] & 0x3F;
if (colorFlags & (1 << ii)) if (colorFlags & (1 << ii))
t += ((0x3f - t) >> 1); t += ((0x3F - t) >> 1);
else else
t -= (t >> 1); t -= (t >> 1);
dst[i * 3 + ii] = t; dst[i * 3 + ii] = t;
@ -1755,7 +1755,7 @@ void LoLEngine::createTransparencyTables() {
0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00 0x88, 0x00, 0x99, 0x00, 0xAA, 0x00, 0xBB, 0x00, 0xCC, 0x00, 0xDD, 0x00, 0xEE, 0x00, 0xFF, 0x00
}; };
memset(tpal, 0xff, 768); memset(tpal, 0xFF, 768);
_res->loadFileToBuf("LOL.NOL", tpal, 48); _res->loadFileToBuf("LOL.NOL", tpal, 48);
for (int i = 15; i > -1; i--) { for (int i = 15; i > -1; i--) {
@ -1763,7 +1763,7 @@ void LoLEngine::createTransparencyTables() {
tpal[s] = tpal[i * 3]; tpal[s] = tpal[i * 3];
tpal[s + 1] = tpal[i * 3 + 1]; tpal[s + 1] = tpal[i * 3 + 1];
tpal[s + 2] = tpal[i * 3 + 2]; tpal[s + 2] = tpal[i * 3 + 2];
tpal[i * 3 + 2] = tpal[i * 3 + 1] = tpal[i * 3] = 0xff; tpal[i * 3 + 2] = tpal[i * 3 + 1] = tpal[i * 3] = 0xFF;
} }
_screen->createTransparencyTablesIntern(colTbl, 16, tpal, tpal, _transparencyTable1, _transparencyTable2, 80); _screen->createTransparencyTablesIntern(colTbl, 16, tpal, tpal, _transparencyTable1, _transparencyTable2, 80);
@ -1953,15 +1953,15 @@ void LoLEngine::giveItemToMonster(LoLMonster *monster, Item item) {
} }
const uint16 *LoLEngine::getCharacterOrMonsterStats(int id) { const uint16 *LoLEngine::getCharacterOrMonsterStats(int id) {
return (id & 0x8000) ? (const uint16 *)_monsters[id & 0x7fff].properties->fightingStats : _characters[id].defaultModifiers; return (id & 0x8000) ? (const uint16 *)_monsters[id & 0x7FFF].properties->fightingStats : _characters[id].defaultModifiers;
} }
uint16 *LoLEngine::getCharacterOrMonsterItemsMight(int id) { uint16 *LoLEngine::getCharacterOrMonsterItemsMight(int id) {
return (id & 0x8000) ? _monsters[id & 0x7fff].properties->itemsMight : _characters[id].itemsMight; return (id & 0x8000) ? _monsters[id & 0x7FFF].properties->itemsMight : _characters[id].itemsMight;
} }
uint16 *LoLEngine::getCharacterOrMonsterProtectionAgainstItems(int id) { uint16 *LoLEngine::getCharacterOrMonsterProtectionAgainstItems(int id) {
return (id & 0x8000) ? _monsters[id & 0x7fff].properties->protectionAgainstItems : _characters[id].protectionAgainstItems; return (id & 0x8000) ? _monsters[id & 0x7FFF].properties->protectionAgainstItems : _characters[id].protectionAgainstItems;
} }
void LoLEngine::delay(uint32 millis, bool doUpdate, bool) { void LoLEngine::delay(uint32 millis, bool doUpdate, bool) {
@ -2098,7 +2098,7 @@ int LoLEngine::processMagicSpark(int charNum, int spellLevel) {
uint16 target = getNearestMonsterFromCharacterForBlock(targetBlock, charNum); uint16 target = getNearestMonsterFromCharacterForBlock(targetBlock, charNum);
static const uint8 dmg[] = { 7, 15, 25, 60 }; static const uint8 dmg[] = { 7, 15, 25, 60 };
if (target != 0xffff) { if (target != 0xFFFF) {
inflictMagicalDamage(target, charNum, dmg[spellLevel], 5, 0); inflictMagicalDamage(target, charNum, dmg[spellLevel], 5, 0);
updateDrawPage2(); updateDrawPage2();
gui_drawScene(0); gui_drawScene(0);
@ -2116,8 +2116,8 @@ int LoLEngine::processMagicSpark(int charNum, int spellLevel) {
const uint16 height = mov->height(); const uint16 height = mov->height();
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
wX[i] = (_rnd.getRandomNumber(0x7fff) % 64) + ((176 - width) >> 1) + 80; wX[i] = (_rnd.getRandomNumber(0x7FFF) % 64) + ((176 - width) >> 1) + 80;
wY[i] = (_rnd.getRandomNumber(0x7fff) % 32) + ((120 - height) >> 1) - 16; wY[i] = (_rnd.getRandomNumber(0x7FFF) % 32) + ((120 - height) >> 1) - 16;
wFrames[i] = i << 1; wFrames[i] = i << 1;
} }
@ -2167,7 +2167,7 @@ int LoLEngine::processMagicHeal(int charNum, int spellLevel) {
tpal.copy(_screen->getPalette(1)); tpal.copy(_screen->getPalette(1));
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
tpal.fill(16, 240, 0xff); tpal.fill(16, 240, 0xFF);
uint8 *dst = tpal.getData(); uint8 *dst = tpal.getData();
for (int i = 1; i < 16; i++) { for (int i = 1; i < 16; i++) {
int s = ((i << 4) | i) * 3; int s = ((i << 4) | i) * 3;
@ -2250,7 +2250,7 @@ int LoLEngine::processMagicHeal(int charNum, int spellLevel) {
_screen->copyRegion(charNum * 77, 32, pX[charNum], pY, 77, 44, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(charNum * 77, 32, pX[charNum], pY, 77, 44, 2, 2, Screen::CR_NO_P_CHECK);
pts[charNum] &= 0xff; pts[charNum] &= 0xFF;
pts[charNum] += ((diff[charNum] << 8) / 16); pts[charNum] += ((diff[charNum] << 8) / 16);
increaseCharacterHitpoints(charNum, pts[charNum] / 256, true); increaseCharacterHitpoints(charNum, pts[charNum] / 256, true);
gui_drawCharPortraitWithStats(charNum); gui_drawCharPortraitWithStats(charNum);
@ -2333,8 +2333,8 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
tpal[i * 3 + 1] = v; tpal[i * 3 + 1] = v;
tpal[i * 3 + 2] = v << 1; tpal[i * 3 + 2] = v << 1;
if (tpal[i * 3 + 2] > 0x3f) if (tpal[i * 3 + 2] > 0x3F)
tpal[i * 3 + 2] = 0x3f; tpal[i * 3 + 2] = 0x3F;
} }
} }
@ -2395,7 +2395,7 @@ int LoLEngine::processMagicIce(int charNum, int spellLevel) {
int might = rollDice(iceDamageMin[spellLevel], iceDamageMax[spellLevel]) + iceDamageAdd[spellLevel]; int might = rollDice(iceDamageMin[spellLevel], iceDamageMax[spellLevel]) + iceDamageAdd[spellLevel];
int dmg = calcInflictableDamagePerItem(charNum, 0, might, 3, 2); int dmg = calcInflictableDamagePerItem(charNum, 0, might, 3, 2);
LoLMonster *m = &_monsters[o & 0x7fff]; LoLMonster *m = &_monsters[o & 0x7FFF];
if (m->hitPoints <= dmg) { if (m->hitPoints <= dmg) {
increaseExperience(charNum, 2, m->hitPoints); increaseExperience(charNum, 2, m->hitPoints);
o = m->nextAssignedObject; o = m->nextAssignedObject;
@ -2474,7 +2474,7 @@ int LoLEngine::processMagicFireball(int charNum, int spellLevel) {
while (o & 0x8000) { while (o & 0x8000) {
static const uint8 fireballDamage[] = { 20, 40, 80, 100 }; static const uint8 fireballDamage[] = { 20, 40, 80, 100 };
int dmg = calcInflictableDamagePerItem(charNum, o, fireballDamage[spellLevel], 4, 1); int dmg = calcInflictableDamagePerItem(charNum, o, fireballDamage[spellLevel], 4, 1);
LoLMonster *m = &_monsters[o & 0x7fff]; LoLMonster *m = &_monsters[o & 0x7FFF];
o = m->nextAssignedObject; o = m->nextAssignedObject;
_envSfxUseQueue = true; _envSfxUseQueue = true;
inflictDamage(m->id | 0x8000, dmg, charNum, 2, 4); inflictDamage(m->id | 0x8000, dmg, charNum, 2, 4);
@ -2524,8 +2524,8 @@ int LoLEngine::processMagicFireball(int charNum, int spellLevel) {
static const int8 finShpIndex2[] = { -1, 1, 2, 3, 4, -1 }; static const int8 finShpIndex2[] = { -1, 1, 2, 3, 4, -1 };
uint8 *shp = fb->finalize ? _fireballShapes[finShpIndex1[fb->finProgress]] : _fireballShapes[0]; uint8 *shp = fb->finalize ? _fireballShapes[finShpIndex1[fb->finProgress]] : _fireballShapes[0];
int fX = (((fb->progress * _fireBallCoords[fb->tblIndex & 0xff]) >> 16) + fb->destX) - ((fb->progress / 8 + shp[3] + fireBallWH) >> 1); int fX = (((fb->progress * _fireBallCoords[fb->tblIndex & 0xFF]) >> 16) + fb->destX) - ((fb->progress / 8 + shp[3] + fireBallWH) >> 1);
int fY = (((fb->progress * _fireBallCoords[(fb->tblIndex + 64) & 0xff]) >> 16) + fb->destY) - ((fb->progress / 8 + shp[2] + fireBallWH) >> 1); int fY = (((fb->progress * _fireBallCoords[(fb->tblIndex + 64) & 0xFF]) >> 16) + fb->destY) - ((fb->progress / 8 + shp[2] + fireBallWH) >> 1);
int sW = ((fb->progress / 8 + shp[3] + fireBallWH) << 8) / shp[3]; int sW = ((fb->progress / 8 + shp[3] + fireBallWH) << 8) / shp[3];
int sH = ((fb->progress / 8 + shp[2] + fireBallWH) << 8) / shp[2]; int sH = ((fb->progress / 8 + shp[2] + fireBallWH) << 8) / shp[2];
@ -2537,8 +2537,8 @@ int LoLEngine::processMagicFireball(int charNum, int spellLevel) {
if (finShpIndex2[fb->finProgress] != -1) { if (finShpIndex2[fb->finProgress] != -1) {
shp = _fireballShapes[finShpIndex2[fb->finProgress]]; shp = _fireballShapes[finShpIndex2[fb->finProgress]];
fX = (((fb->progress * _fireBallCoords[fb->tblIndex & 0xff]) >> 16) + fb->destX) - ((fb->progress / 8 + shp[3] + fireBallWH) >> 1); fX = (((fb->progress * _fireBallCoords[fb->tblIndex & 0xFF]) >> 16) + fb->destX) - ((fb->progress / 8 + shp[3] + fireBallWH) >> 1);
fY = (((fb->progress * _fireBallCoords[(fb->tblIndex + 64) & 0xff]) >> 16) + fb->destY) - ((fb->progress / 8 + shp[2] + fireBallWH) >> 1); fY = (((fb->progress * _fireBallCoords[(fb->tblIndex + 64) & 0xFF]) >> 16) + fb->destY) - ((fb->progress / 8 + shp[2] + fireBallWH) >> 1);
sW = ((fb->progress / 8 + shp[3] + fireBallWH) << 8) / shp[3]; sW = ((fb->progress / 8 + shp[3] + fireBallWH) << 8) / shp[3];
sH = ((fb->progress / 8 + shp[2] + fireBallWH) << 8) / shp[2]; sH = ((fb->progress / 8 + shp[2] + fireBallWH) << 8) / shp[2];
_screen->drawShape(_screen->_curPage, shp, fX, fY, 0, 4, sW, sH); _screen->drawShape(_screen->_curPage, shp, fX, fY, 0, 4, sW, sH);
@ -2639,7 +2639,7 @@ int LoLEngine::processMagicHandOfFate(int spellLevel) {
uint16 o = _levelBlockProperties[b1].assignedObjects; uint16 o = _levelBlockProperties[b1].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
uint16 o2 = o; uint16 o2 = o;
LoLMonster *m = &_monsters[o & 0x7fff]; LoLMonster *m = &_monsters[o & 0x7FFF];
o = findObject(o)->nextAssignedObject; o = findObject(o)->nextAssignedObject;
int nX = 0; int nX = 0;
int nY = 0; int nY = 0;
@ -2667,7 +2667,7 @@ int LoLEngine::processMagicHandOfFate(int spellLevel) {
// This might be a bug in the original code, but using // This might be a bug in the original code, but using
// the hand of fate spell won't give any experience points // the hand of fate spell won't give any experience points
int dmg = calcInflictableDamagePerItem(-1, t, damage[spellLevel - 2], 0x80, 1); int dmg = calcInflictableDamagePerItem(-1, t, damage[spellLevel - 2], 0x80, 1);
inflictDamage(t, dmg, 0xffff, 3, 0x80); inflictDamage(t, dmg, 0xFFFF, 3, 0x80);
} }
} }
@ -2783,7 +2783,7 @@ int LoLEngine::processMagicFog() {
uint16 o = _levelBlockProperties[calcNewBlockPosition(_currentBlock, _currentDirection)].assignedObjects; uint16 o = _levelBlockProperties[calcNewBlockPosition(_currentBlock, _currentDirection)].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
inflictMagicalDamage(o, -1, 15, 6, 0); inflictMagicalDamage(o, -1, 15, 6, 0);
o = _monsters[o & 0x7fff].nextAssignedObject; o = _monsters[o & 0x7FFF].nextAssignedObject;
} }
gui_drawScene(0); gui_drawScene(0);
@ -2808,7 +2808,7 @@ int LoLEngine::processMagicSwarm(int charNum, int damage) {
int t = 0; int t = 0;
uint16 o = _levelBlockProperties[calcNewBlockPosition(_currentBlock, _currentDirection)].assignedObjects; uint16 o = _levelBlockProperties[calcNewBlockPosition(_currentBlock, _currentDirection)].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
o &= 0x7fff; o &= 0x7FFF;
if (_monsters[o].mode != 13) { if (_monsters[o].mode != 13) {
destIds[t++] = o; destIds[t++] = o;
@ -2816,7 +2816,7 @@ int LoLEngine::processMagicSwarm(int charNum, int damage) {
_envSfxUseQueue = true; _envSfxUseQueue = true;
inflictMagicalDamage(o | 0x8000, charNum, damage, 0, 0); inflictMagicalDamage(o | 0x8000, charNum, damage, 0, 0);
_envSfxUseQueue = false; _envSfxUseQueue = false;
_monsters[o].flags &= 0xffef; _monsters[o].flags &= 0xFFEF;
} }
} }
o = _monsters[o].nextAssignedObject; o = _monsters[o].nextAssignedObject;
@ -2908,9 +2908,9 @@ int LoLEngine::processMagicVaelansCube() {
uint16 o = _levelBlockProperties[bl].assignedObjects; uint16 o = _levelBlockProperties[bl].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
LoLMonster *m = &_monsters[o & 0x7fff]; LoLMonster *m = &_monsters[o & 0x7FFF];
if (m->properties->flags & 0x1000) { if (m->properties->flags & 0x1000) {
inflictDamage(o, 100, 0xffff, 0, 0x80); inflictDamage(o, 100, 0xFFFF, 0, 0x80);
res = 1; res = 1;
} }
o = m->nextAssignedObject; o = m->nextAssignedObject;
@ -3036,7 +3036,7 @@ void LoLEngine::drinkBezelCup(int numUses, int charNum) {
uint16 step = 0; uint16 step = 0;
do { do {
step = (step & 0xff) + (hpDiff * 256) / (bezelAnimData[numUses * 3 + 1]); step = (step & 0xFF) + (hpDiff * 256) / (bezelAnimData[numUses * 3 + 1]);
increaseCharacterHitpoints(charNum, step / 256, true); increaseCharacterHitpoints(charNum, step / 256, true);
gui_drawCharPortraitWithStats(charNum); gui_drawCharPortraitWithStats(charNum);
@ -3073,7 +3073,7 @@ void LoLEngine::addSpellToScroll(int spell, int charNum) {
} }
if (_availableSpells[i] == spell) { if (_availableSpells[i] == spell) {
_txt->printMessage(2, "%s", getLangString(0x42d0)); _txt->printMessage(2, "%s", getLangString(0x42D0));
return; return;
} }
} }
@ -3101,7 +3101,7 @@ void LoLEngine::transferSpellToScollAnimation(int charNum, int spell, int slot)
_screen->copyRegion(201, 1, 17, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(201, 1, 17, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK);
_screen->copyRegion(208, 1, 89, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(208, 1, 89, 15, 6, h, 2, 2, Screen::CR_NO_P_CHECK);
int cp = _screen->setCurPage(2); int cp = _screen->setCurPage(2);
_screen->fillRect(21, 15, 89, h + 15, _flags.use16ColorMode ? 0xbb : 206); _screen->fillRect(21, 15, 89, h + 15, _flags.use16ColorMode ? 0xBB : 206);
_screen->copyRegion(112, 16, 12, h + 15, 87, 14, 2, 2, Screen::CR_NO_P_CHECK); _screen->copyRegion(112, 16, 12, h + 15, 87, 14, 2, 2, Screen::CR_NO_P_CHECK);
int y = 15; int y = 15;
@ -3289,7 +3289,7 @@ int LoLEngine::checkMagic(int charNum, int spellNum, int spellLevel) {
} }
int LoLEngine::getSpellTargetBlock(int currentBlock, int direction, int maxDistance, uint16 &targetBlock) { int LoLEngine::getSpellTargetBlock(int currentBlock, int direction, int maxDistance, uint16 &targetBlock) {
targetBlock = 0xffff; targetBlock = 0xFFFF;
uint16 c = calcNewBlockPosition(currentBlock, direction); uint16 c = calcNewBlockPosition(currentBlock, direction);
int i = 0; int i = 0;
@ -3321,9 +3321,9 @@ void LoLEngine::inflictMagicalDamageForBlock(int block, int attacker, int damage
uint16 o = _levelBlockProperties[block].assignedObjects; uint16 o = _levelBlockProperties[block].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
inflictDamage(o, calcInflictableDamagePerItem(attacker, o, damage, index, 2), attacker, 2, index); inflictDamage(o, calcInflictableDamagePerItem(attacker, o, damage, index, 2), attacker, 2, index);
if ((_monsters[o & 0x7fff].flags & 0x20) && (_currentLevel != 22)) if ((_monsters[o & 0x7FFF].flags & 0x20) && (_currentLevel != 22))
break; break;
o = _monsters[o & 0x7fff].nextAssignedObject; o = _monsters[o & 0x7FFF].nextAssignedObject;
} }
} }
@ -3336,7 +3336,7 @@ int LoLEngine::battleHitSkillTest(int16 attacker, int16 target, int skill) {
return 1; return 1;
if (target & 0x8000) { if (target & 0x8000) {
if (_monsters[target & 0x7fff].mode >= 13) if (_monsters[target & 0x7FFF].mode >= 13)
return 0; return 0;
} }
@ -3345,8 +3345,8 @@ int LoLEngine::battleHitSkillTest(int16 attacker, int16 target, int skill) {
int sk = 0; int sk = 0;
if (attacker & 0x8000) { if (attacker & 0x8000) {
hitChanceModifier = _monsters[target & 0x7fff].properties->fightingStats[0]; hitChanceModifier = _monsters[target & 0x7FFF].properties->fightingStats[0];
sk = 100 - _monsters[target & 0x7fff].properties->skillLevel; sk = 100 - _monsters[target & 0x7FFF].properties->skillLevel;
} else { } else {
hitChanceModifier = _characters[attacker].defaultModifiers[0]; hitChanceModifier = _characters[attacker].defaultModifiers[0];
int8 m = _characters[attacker].skillModifiers[skill]; int8 m = _characters[attacker].skillModifiers[skill];
@ -3356,8 +3356,8 @@ int LoLEngine::battleHitSkillTest(int16 attacker, int16 target, int skill) {
} }
if (target & 0x8000) { if (target & 0x8000) {
evadeChanceModifier = (_monsterModifiers[9 + _monsterDifficulty] * _monsters[target & 0x7fff].properties->fightingStats[3]) >> 8; evadeChanceModifier = (_monsterModifiers[9 + _monsterDifficulty] * _monsters[target & 0x7FFF].properties->fightingStats[3]) >> 8;
_monsters[target & 0x7fff].flags |= 0x10; _monsters[target & 0x7FFF].flags |= 0x10;
} else { } else {
evadeChanceModifier = _characters[target].defaultModifiers[3]; evadeChanceModifier = _characters[target].defaultModifiers[3];
} }
@ -3392,7 +3392,7 @@ int LoLEngine::inflictDamage(uint16 target, int damage, uint16 attacker, int ski
LoLCharacter *c = 0; LoLCharacter *c = 0;
if (target & 0x8000) { if (target & 0x8000) {
m = &_monsters[target & 0x7fff]; m = &_monsters[target & 0x7FFF];
if (m->mode >= 13) if (m->mode >= 13)
return 0; return 0;
@ -3482,7 +3482,7 @@ void LoLEngine::removeCharacterEffects(LoLCharacter *c, int first, int last) {
for (int i = first; i <= last; i++) { for (int i = first; i <= last; i++) {
switch (i - 1) { switch (i - 1) {
case 0: case 0:
c->flags &= 0xfffb; c->flags &= 0xFFFB;
c->weaponHit = 0; c->weaponHit = 0;
break; break;
@ -3491,19 +3491,19 @@ void LoLEngine::removeCharacterEffects(LoLCharacter *c, int first, int last) {
break; break;
case 2: case 2:
c->flags &= 0xffbf; c->flags &= 0xFFBF;
break; break;
case 3: case 3:
c->flags &= 0xff7f; c->flags &= 0xFF7F;
break; break;
case 4: case 4:
c->flags &= 0xfeff; c->flags &= 0xFEFF;
break; break;
case 6: case 6:
c->flags &= 0xefff; c->flags &= 0xEFFF;
break; break;
default: default:
@ -3557,7 +3557,7 @@ int LoLEngine::calcInflictableDamagePerItem(int16 attacker, int16 target, uint16
void LoLEngine::checkForPartyDeath() { void LoLEngine::checkForPartyDeath() {
Button b; Button b;
b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xFE;
b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -3596,7 +3596,7 @@ void LoLEngine::checkForPartyDeath() {
_gui->runMenu(_gui->_deathMenu); _gui->runMenu(_gui->_deathMenu);
setMouseCursorToItemInHand(); setMouseCursorToItemInHand();
_updateFlags &= 0xfffb; _updateFlags &= 0xFFFB;
resetLampStatus(); resetLampStatus();
gui_enableDefaultPlayfieldButtons(); gui_enableDefaultPlayfieldButtons();
@ -3613,7 +3613,7 @@ void LoLEngine::applyMonsterAttackSkill(LoLMonster *monster, int16 target, int16
switch (monster->properties->attackSkillType - 1) { switch (monster->properties->attackSkillType - 1) {
case 0: case 0:
t = removeCharacterItem(target, 0x7ff); t = removeCharacterItem(target, 0x7FF);
if (t) { if (t) {
giveItemToMonster(monster, t); giveItemToMonster(monster, t);
if (characterSays(0x4019, _characters[target].id, true)) if (characterSays(0x4019, _characters[target].id, true))
@ -3630,16 +3630,16 @@ void LoLEngine::applyMonsterAttackSkill(LoLMonster *monster, int16 target, int16
t = removeCharacterItem(target, 0x20); t = removeCharacterItem(target, 0x20);
if (t) { if (t) {
deleteItem(t); deleteItem(t);
if (characterSays(0x401b, _characters[target].id, true)) if (characterSays(0x401B, _characters[target].id, true))
_txt->printMessage(6, "%s", getLangString(0x401b)); _txt->printMessage(6, "%s", getLangString(0x401B));
} }
break; break;
case 3: case 3:
t = removeCharacterItem(target, 0x0f); t = removeCharacterItem(target, 0x0F);
if (t) { if (t) {
if (characterSays(0x401e, _characters[target].id, true)) if (characterSays(0x401E, _characters[target].id, true))
_txt->printMessage(6, getLangString(0x401e), _characters[target].name); _txt->printMessage(6, getLangString(0x401E), _characters[target].name);
setItemPosition(t, monster->x, monster->y, 0, 1); setItemPosition(t, monster->x, monster->y, 0, 1);
} }
break; break;
@ -3684,27 +3684,27 @@ void LoLEngine::applyMonsterDefenseSkill(LoLMonster *monster, int16 attacker, in
switch (monster->properties->defenseSkillType - 1) { switch (monster->properties->defenseSkillType - 1) {
case 0: case 0:
case 1: case 1:
if ((flags & 0x3f) == 2 || skill) if ((flags & 0x3F) == 2 || skill)
return; return;
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
itm = _characters[attacker].items[i]; itm = _characters[attacker].items[i];
if (!itm) if (!itm)
continue; continue;
if ((_itemProperties[_itemsInPlay[itm].itemPropertyIndex].protection & 0x3f) != flags) if ((_itemProperties[_itemsInPlay[itm].itemPropertyIndex].protection & 0x3F) != flags)
continue; continue;
removeCharacterItem(attacker, 0x7fff); removeCharacterItem(attacker, 0x7FFF);
if (monster->properties->defenseSkillType == 1) { if (monster->properties->defenseSkillType == 1) {
giveItemToMonster(monster, itm); giveItemToMonster(monster, itm);
if (characterSays(0x401c, _characters[attacker].id, true)) if (characterSays(0x401C, _characters[attacker].id, true))
_txt->printMessage(6, "%s", getLangString(0x401c)); _txt->printMessage(6, "%s", getLangString(0x401C));
} else { } else {
deleteItem(itm); deleteItem(itm);
if (characterSays(0x401d, _characters[attacker].id, true)) if (characterSays(0x401D, _characters[attacker].id, true))
_txt->printMessage(6, "%s", getLangString(0x401d)); _txt->printMessage(6, "%s", getLangString(0x401D));
} }
} }
break; break;
@ -3895,7 +3895,7 @@ void LoLEngine::launchMagicViper() {
void LoLEngine::breakIceWall(uint8 *pal1, uint8 *pal2) { void LoLEngine::breakIceWall(uint8 *pal1, uint8 *pal2) {
_screen->hideMouse(); _screen->hideMouse();
uint16 bl = calcNewBlockPosition(_currentBlock, _currentDirection); uint16 bl = calcNewBlockPosition(_currentBlock, _currentDirection);
_levelBlockProperties[bl].flags &= 0xef; _levelBlockProperties[bl].flags &= 0xEF;
_screen->copyPage(0, 2); _screen->copyPage(0, 2);
gui_drawScene(2); gui_drawScene(2);
_screen->copyPage(2, 10); _screen->copyPage(2, 10);
@ -3923,10 +3923,10 @@ uint16 LoLEngine::getNearestMonsterFromCharacterForBlock(uint16 block, int charN
uint16 cX = 0; uint16 cX = 0;
uint16 cY = 0; uint16 cY = 0;
uint16 id = 0xffff; uint16 id = 0xFFFF;
int minDist = 0x7fff; int minDist = 0x7FFF;
if (block == 0xffff) if (block == 0xFFFF)
return id; return id;
calcCoordinatesForSingleCharacter(charNum, cX, cY); calcCoordinatesForSingleCharacter(charNum, cX, cY);
@ -3934,7 +3934,7 @@ uint16 LoLEngine::getNearestMonsterFromCharacterForBlock(uint16 block, int charN
int o = _levelBlockProperties[block].assignedObjects; int o = _levelBlockProperties[block].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
LoLMonster *m = &_monsters[o & 0x7fff]; LoLMonster *m = &_monsters[o & 0x7FFF];
if (m->mode >= 13) { if (m->mode >= 13) {
o = m->nextAssignedObject; o = m->nextAssignedObject;
continue; continue;
@ -3953,8 +3953,8 @@ uint16 LoLEngine::getNearestMonsterFromCharacterForBlock(uint16 block, int charN
} }
uint16 LoLEngine::getNearestMonsterFromPos(int x, int y) { uint16 LoLEngine::getNearestMonsterFromPos(int x, int y) {
uint16 id = 0xffff; uint16 id = 0xFFFF;
int minDist = 0x7fff; int minDist = 0x7FFF;
for (int i = 0; i < 30; i++) { for (int i = 0; i < 30; i++) {
if (_monsters[i].mode > 13) if (_monsters[i].mode > 13)
@ -3971,8 +3971,8 @@ uint16 LoLEngine::getNearestMonsterFromPos(int x, int y) {
} }
uint16 LoLEngine::getNearestPartyMemberFromPos(int x, int y) { uint16 LoLEngine::getNearestPartyMemberFromPos(int x, int y) {
uint16 id = 0xffff; uint16 id = 0xFFFF;
int minDist = 0x7fff; int minDist = 0x7FFF;
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
if (!(_characters[i].flags & 1) || _characters[i].hitPointsCur <= 0) if (!(_characters[i].flags & 1) || _characters[i].hitPointsCur <= 0)
@ -4054,7 +4054,7 @@ void LoLEngine::displayAutomap() {
delayTimer = _system->getMillis() + 8 * _tickLength; delayTimer = _system->getMillis() + 8 * _tickLength;
} }
int f = checkInput(0) & 0xff; int f = checkInput(0) & 0xFF;
removeInputTop(); removeInputTop();
if (f) { if (f) {
@ -4094,7 +4094,7 @@ void LoLEngine::updateAutoMap(uint16 block) {
return; return;
_levelBlockProperties[block].flags |= 7; _levelBlockProperties[block].flags |= 7;
uint16 x = block & 0x1f; uint16 x = block & 0x1F;
uint16 y = block >> 5; uint16 y = block >> 5;
updateAutoMapIntern(block, x, y, -1, -1); updateAutoMapIntern(block, x, y, -1, -1);
@ -4112,7 +4112,7 @@ bool LoLEngine::updateAutoMapIntern(uint16 block, uint16 x, uint16 y, int16 xOff
x += xOffs; x += xOffs;
y += yOffs; y += yOffs;
if ((x & 0xffe0) || (y & 0xffe0)) if ((x & 0xFFE0) || (y & 0xFFE0))
return false; return false;
xOffs++; xOffs++;
@ -4122,7 +4122,7 @@ bool LoLEngine::updateAutoMapIntern(uint16 block, uint16 x, uint16 y, int16 xOff
uint16 b = block + blockPosTable[6 + xOffs]; uint16 b = block + blockPosTable[6 + xOffs];
if (fx != -1) { if (fx != -1) {
if (_wllAutomapData[_levelBlockProperties[b].walls[fx]] & 0xc0) if (_wllAutomapData[_levelBlockProperties[b].walls[fx]] & 0xC0)
return false; return false;
} }
@ -4130,13 +4130,13 @@ bool LoLEngine::updateAutoMapIntern(uint16 block, uint16 x, uint16 y, int16 xOff
b = block + blockPosTable[9 + yOffs]; b = block + blockPosTable[9 + yOffs];
if (fy != -1) { if (fy != -1) {
if (_wllAutomapData[_levelBlockProperties[b].walls[fy]] & 0xc0) if (_wllAutomapData[_levelBlockProperties[b].walls[fy]] & 0xC0)
return false; return false;
} }
b = block + blockPosTable[6 + xOffs] + blockPosTable[9 + yOffs]; b = block + blockPosTable[6 + xOffs] + blockPosTable[9 + yOffs];
if ((fx != -1) && (fy != -1) && (_wllAutomapData[_levelBlockProperties[b].walls[fx]] & 0xc0) && (_wllAutomapData[_levelBlockProperties[b].walls[fy]] & 0xc0)) if ((fx != -1) && (fy != -1) && (_wllAutomapData[_levelBlockProperties[b].walls[fx]] & 0xC0) && (_wllAutomapData[_levelBlockProperties[b].walls[fy]] & 0xC0))
return false; return false;
_levelBlockProperties[b].flags |= 7; _levelBlockProperties[b].flags |= 7;
@ -4147,8 +4147,8 @@ bool LoLEngine::updateAutoMapIntern(uint16 block, uint16 x, uint16 y, int16 xOff
void LoLEngine::loadMapLegendData(int level) { void LoLEngine::loadMapLegendData(int level) {
uint16 *legendData = (uint16 *)_tempBuffer5120; uint16 *legendData = (uint16 *)_tempBuffer5120;
for (int i = 0; i < 32; i++) { for (int i = 0; i < 32; i++) {
legendData[i * 6] = 0xffff; legendData[i * 6] = 0xFFFF;
legendData[i * 6 + 5] = 0xffff; legendData[i * 6 + 5] = 0xFFFF;
} }
Common::String file = Common::String::format("level%d.xxx", level); Common::String file = Common::String::format("level%d.xxx", level);
@ -4199,7 +4199,7 @@ void LoLEngine::drawMapPage(int pageNum) {
for (; bl < 1024; bl++) { for (; bl < 1024; bl++) {
uint8 *w = _levelBlockProperties[bl].walls; uint8 *w = _levelBlockProperties[bl].walls;
if ((_levelBlockProperties[bl].flags & 7) == 7 && (!(_wllAutomapData[w[0]] & 0xc0)) && (!(_wllAutomapData[w[2]] & 0xc0)) && (!(_wllAutomapData[w[1]] & 0xc0)) && (!(_wllAutomapData[w[3]] & 0xc0))) { if ((_levelBlockProperties[bl].flags & 7) == 7 && (!(_wllAutomapData[w[0]] & 0xC0)) && (!(_wllAutomapData[w[2]] & 0xC0)) && (!(_wllAutomapData[w[1]] & 0xC0)) && (!(_wllAutomapData[w[3]] & 0xC0))) {
uint16 b0 = calcNewBlockPosition(bl, 0); uint16 b0 = calcNewBlockPosition(bl, 0);
uint16 b2 = calcNewBlockPosition(bl, 2); uint16 b2 = calcNewBlockPosition(bl, 2);
uint16 b1 = calcNewBlockPosition(bl, 1); uint16 b1 = calcNewBlockPosition(bl, 1);
@ -4216,25 +4216,25 @@ void LoLEngine::drawMapPage(int pageNum) {
// draw north wall // draw north wall
drawMapBlockWall(b3, w31, sx, sy, 3); drawMapBlockWall(b3, w31, sx, sy, 3);
drawMapShape(w31, sx, sy, 3); drawMapShape(w31, sx, sy, 3);
if (_wllAutomapData[w31] & 0xc0) if (_wllAutomapData[w31] & 0xC0)
_screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy, _screen->_curPage, sx, sy, 1, 6, 0, _mapOverlay); _screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy, _screen->_curPage, sx, sy, 1, 6, 0, _mapOverlay);
// draw west wall // draw west wall
drawMapBlockWall(b1, w13, sx, sy, 1); drawMapBlockWall(b1, w13, sx, sy, 1);
drawMapShape(w13, sx, sy, 1); drawMapShape(w13, sx, sy, 1);
if (_wllAutomapData[w13] & 0xc0) if (_wllAutomapData[w13] & 0xC0)
_screen->copyBlockAndApplyOverlay(_screen->_curPage, sx + 6, sy, _screen->_curPage, sx + 6, sy, 1, 6, 0, _mapOverlay); _screen->copyBlockAndApplyOverlay(_screen->_curPage, sx + 6, sy, _screen->_curPage, sx + 6, sy, 1, 6, 0, _mapOverlay);
// draw east wall // draw east wall
drawMapBlockWall(b0, w02, sx, sy, 0); drawMapBlockWall(b0, w02, sx, sy, 0);
drawMapShape(w02, sx, sy, 0); drawMapShape(w02, sx, sy, 0);
if (_wllAutomapData[w02] & 0xc0) if (_wllAutomapData[w02] & 0xC0)
_screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy, _screen->_curPage, sx, sy, 7, 1, 0, _mapOverlay); _screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy, _screen->_curPage, sx, sy, 7, 1, 0, _mapOverlay);
//draw south wall //draw south wall
drawMapBlockWall(b2, w20, sx, sy, 2); drawMapBlockWall(b2, w20, sx, sy, 2);
drawMapShape(w20, sx, sy, 2); drawMapShape(w20, sx, sy, 2);
if (_wllAutomapData[w20] & 0xc0) if (_wllAutomapData[w20] & 0xC0)
_screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy + 5, _screen->_curPage, sx, sy + 5, 7, 1, 0, _mapOverlay); _screen->copyBlockAndApplyOverlay(_screen->_curPage, sx, sy + 5, _screen->_curPage, sx, sy + 5, 7, 1, 0, _mapOverlay);
} }
@ -4260,19 +4260,19 @@ void LoLEngine::drawMapPage(int pageNum) {
for (int ii = 0; ii < 32; ii++) { for (int ii = 0; ii < 32; ii++) {
uint16 *l = &legendData[ii * 6]; uint16 *l = &legendData[ii * 6];
if (l[0] == 0xffff) if (l[0] == 0xFFFF)
break; break;
uint16 cbl = l[0] + (l[1] << 5); uint16 cbl = l[0] + (l[1] << 5);
if ((_levelBlockProperties[cbl].flags & 7) != 7) if ((_levelBlockProperties[cbl].flags & 7) != 7)
continue; continue;
if (l[2] == 0xffff) if (l[2] == 0xFFFF)
continue; continue;
printMapText(l[2], 244 + xOffset, (tY << 3) + 22 + yOffset); printMapText(l[2], 244 + xOffset, (tY << 3) + 22 + yOffset);
if (l[5] == 0xffff) { if (l[5] == 0xFFFF) {
tY++; tY++;
continue; continue;
} }
@ -4343,7 +4343,7 @@ bool LoLEngine::automapProcessButtons(int inputFlag) {
void LoLEngine::automapForwardButton() { void LoLEngine::automapForwardButton() {
int i = _currentMapLevel + 1; int i = _currentMapLevel + 1;
while (!(_hasTempDataFlags & (1 << (i - 1)))) while (!(_hasTempDataFlags & (1 << (i - 1))))
i = (i + 1) & 0x1f; i = (i + 1) & 0x1F;
if (i == _currentMapLevel) if (i == _currentMapLevel)
return; return;
@ -4360,7 +4360,7 @@ void LoLEngine::automapForwardButton() {
void LoLEngine::automapBackButton() { void LoLEngine::automapBackButton() {
int i = _currentMapLevel - 1; int i = _currentMapLevel - 1;
while (!(_hasTempDataFlags & (1 << (i - 1)))) while (!(_hasTempDataFlags & (1 << (i - 1))))
i = (i - 1) & 0x1f; i = (i - 1) & 0x1F;
if (i == _currentMapLevel) if (i == _currentMapLevel)
return; return;
@ -4401,7 +4401,7 @@ void LoLEngine::redrawMapCursor() {
} }
void LoLEngine::drawMapBlockWall(uint16 block, uint8 wall, int x, int y, int direction) { void LoLEngine::drawMapBlockWall(uint16 block, uint8 wall, int x, int y, int direction) {
if (((1 << direction) & _levelBlockProperties[block].flags) || ((_wllAutomapData[wall] & 0x1f) != 13)) if (((1 << direction) & _levelBlockProperties[block].flags) || ((_wllAutomapData[wall] & 0x1F) != 13))
return; return;
int cp = _screen->_curPage; int cp = _screen->_curPage;
@ -4411,8 +4411,8 @@ void LoLEngine::drawMapBlockWall(uint16 block, uint8 wall, int x, int y, int dir
} }
void LoLEngine::drawMapShape(uint8 wall, int x, int y, int direction) { void LoLEngine::drawMapShape(uint8 wall, int x, int y, int direction) {
int l = _wllAutomapData[wall] & 0x1f; int l = _wllAutomapData[wall] & 0x1F;
if (l == 0x1f) if (l == 0x1F)
return; return;
_screen->drawShape(_screen->_curPage, _automapShapes[(l << 2) + direction], x + _mapCoords[10][direction] - 2, y + _mapCoords[11][direction] - 2, 0, 0); _screen->drawShape(_screen->_curPage, _automapShapes[(l << 2) + direction], x + _mapCoords[10][direction] - 2, y + _mapCoords[11][direction] - 2, 0, 0);
@ -4478,7 +4478,7 @@ int LoLEngine::mapGetStartPosY() {
} }
void LoLEngine::mapIncludeLegendData(int type) { void LoLEngine::mapIncludeLegendData(int type) {
type &= 0x7f; type &= 0x7F;
for (int i = 0; i < 11; i++) { for (int i = 0; i < 11; i++) {
if (_defaultLegendData[i].shapeIndex != type) if (_defaultLegendData[i].shapeIndex != type)
continue; continue;
@ -4499,7 +4499,7 @@ void LoLEngine::printMapText(uint16 stringId, int x, int y) {
void LoLEngine::printMapExitButtonText() { void LoLEngine::printMapExitButtonText() {
int cp = _screen->setCurPage(2); int cp = _screen->setCurPage(2);
Screen::FontId of = _screen->setFont(Screen::FID_9_FNT); Screen::FontId of = _screen->setFont(Screen::FID_9_FNT);
_screen->fprintString("%s", 295, 182, _flags.use16ColorMode ? 0xbb : 172, 0, 5, getLangString(0x4033)); _screen->fprintString("%s", 295, 182, _flags.use16ColorMode ? 0xBB : 172, 0, 5, getLangString(0x4033));
_screen->setFont(of); _screen->setFont(of);
_screen->setCurPage(cp); _screen->setCurPage(cp);
} }

View file

@ -308,7 +308,7 @@ void EoBCoreEngine::startSpell(int spell) {
EoBCharacter *c = &_characters[_activeSpellCharId]; EoBCharacter *c = &_characters[_activeSpellCharId];
snd_playSoundEffect(s->sound); snd_playSoundEffect(s->sound);
if (s->flags & 0xa0) if (s->flags & 0xA0)
sparkEffectDefensive(_activeSpellCharId); sparkEffectDefensive(_activeSpellCharId);
else if (s->flags & 0x40) else if (s->flags & 0x40)
sparkEffectDefensive(-1); sparkEffectDefensive(-1);
@ -623,7 +623,7 @@ bool EoBCoreEngine::turnUndeadHit(EoBMonsterInPlay *m, int hitChance, int caster
assert(_monsterProps[m->type].tuResist > 0); assert(_monsterProps[m->type].tuResist > 0);
uint8 e = _turnUndeadEffect[_monsterProps[m->type].tuResist * 14 + MIN(casterLevel, 14)]; uint8 e = _turnUndeadEffect[_monsterProps[m->type].tuResist * 14 + MIN(casterLevel, 14)];
if (e == 0xff) { if (e == 0xFF) {
calcAndInflictMonsterDamage(m, 0, 0, 500, 0x200, 5, 3); calcAndInflictMonsterDamage(m, 0, 0, 500, 0x200, 5, 3);
} else if (hitChance < e) { } else if (hitChance < e) {
return false; return false;
@ -711,7 +711,7 @@ Item EoBCoreEngine::createMagicWeaponItem(int flags, int icon, int value, int ty
void EoBCoreEngine::removeMagicWeaponItem(Item item) { void EoBCoreEngine::removeMagicWeaponItem(Item item) {
_itemTypes[_items[item].type].armorClass = -30; _itemTypes[_items[item].type].armorClass = -30;
_items[item].block = -2; _items[item].block = -2;
_items[item].level = 0xff; _items[item].level = 0xFF;
} }
void EoBCoreEngine::updateWallOfForceTimers() { void EoBCoreEngine::updateWallOfForceTimers() {
@ -841,7 +841,7 @@ bool EoBCoreEngine::spellCallback_end_magicMissile(void *obj) {
} }
void EoBCoreEngine::spellCallback_start_shockingGrasp() { void EoBCoreEngine::spellCallback_start_shockingGrasp() {
int t = createMagicWeaponType(0, 0, 0, 0x0f, 1, 8, getMageLevel(_openBookChar), 1); int t = createMagicWeaponType(0, 0, 0, 0x0F, 1, 8, getMageLevel(_openBookChar), 1);
Item i = (t != -1) ? createMagicWeaponItem(0x10, 82, 0, t) : -1; Item i = (t != -1) ? createMagicWeaponItem(0x10, 82, 0, t) : -1;
if (t == -1 || i == -1) { if (t == -1 || i == -1) {
if (_flags.gameID == GI_EOB2) if (_flags.gameID == GI_EOB2)
@ -948,7 +948,7 @@ bool EoBCoreEngine::spellCallback_end_lightningBolt(void *obj) {
} }
void EoBCoreEngine::spellCallback_start_vampiricTouch() { void EoBCoreEngine::spellCallback_start_vampiricTouch() {
int t = createMagicWeaponType(0, 0, 0, 0x0f, getMageLevel(_openBookChar) >> 1, 6, 0, 1); int t = createMagicWeaponType(0, 0, 0, 0x0F, getMageLevel(_openBookChar) >> 1, 6, 0, 1);
Item i = (t != -1) ? createMagicWeaponItem(0x18, 83, 0, t) : -1; Item i = (t != -1) ? createMagicWeaponItem(0x18, 83, 0, t) : -1;
if (t == -1 || i == -1) { if (t == -1 || i == -1) {
if (_flags.gameID == GI_EOB2) if (_flags.gameID == GI_EOB2)
@ -989,7 +989,7 @@ bool EoBCoreEngine::spellCallback_end_iceStorm(void *obj) {
if (res) { if (res) {
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
uint16 bl = fo->curBlock; uint16 bl = fo->curBlock;
fo->curBlock = (fo->curBlock + blockAdv[i]) & 0x3ff; fo->curBlock = (fo->curBlock + blockAdv[i]) & 0x3FF;
magicObjectDamageHit(fo, 1, 6, 0, getMageLevel(fo->attackerId)); magicObjectDamageHit(fo, 1, 6, 0, getMageLevel(fo->attackerId));
fo->curBlock = bl; fo->curBlock = bl;
} }
@ -1027,7 +1027,7 @@ void EoBCoreEngine::spellCallback_start_coneOfCold() {
_preventMonsterFlash = true; _preventMonsterFlash = true;
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
for (const int16 *m = findBlockMonsters((_currentBlock + tbl[i]) & 0x3ff, 4, _currentDirection, 1, 1); *m != -1; m++) for (const int16 *m = findBlockMonsters((_currentBlock + tbl[i]) & 0x3FF, 4, _currentDirection, 1, 1); *m != -1; m++)
calcAndInflictMonsterDamage(&_monsters[*m], cl, 4, cl, 0x41, 5, 0); calcAndInflictMonsterDamage(&_monsters[*m], cl, 4, cl, 0x41, 5, 0);
} }
@ -1054,7 +1054,7 @@ void EoBCoreEngine::spellCallback_start_wallOfForce() {
return; return;
} }
uint32 dur = 0xffffffff; uint32 dur = 0xFFFFFFFF;
int s = 0; int s = 0;
int i = 0; int i = 0;
@ -1158,7 +1158,7 @@ bool EoBCoreEngine::spellCallback_end_aid(void *obj) {
} }
void EoBCoreEngine::spellCallback_start_flameBlade() { void EoBCoreEngine::spellCallback_start_flameBlade() {
int t = createMagicWeaponType(0, 0, 0, 0x0f, 1, 4, 4, 1); int t = createMagicWeaponType(0, 0, 0, 0x0F, 1, 4, 4, 1);
Item i = (t != -1) ? createMagicWeaponItem(0, 84, 0, t) : -1; Item i = (t != -1) ? createMagicWeaponItem(0, 84, 0, t) : -1;
if (t == -1 || i == -1) { if (t == -1 || i == -1) {
if (_flags.gameID == GI_EOB2) if (_flags.gameID == GI_EOB2)

View file

@ -496,7 +496,7 @@ public:
void advSrcBitsBy1(); void advSrcBitsBy1();
void advSrcBitsByIndex(uint8 newIndex); void advSrcBitsByIndex(uint8 newIndex);
uint8 getKeyLower() const { return _key & 0xff; } uint8 getKeyLower() const { return _key & 0xFF; }
void setIndex(uint8 index) { _index = index; } void setIndex(uint8 index) { _index = index; }
uint16 getKeyMasked(uint8 newIndex); uint16 getKeyMasked(uint8 newIndex);
uint16 keyMaskedAlign(uint16 val); uint16 keyMaskedAlign(uint16 val);
@ -515,7 +515,7 @@ void FileExpanderSource::advSrcBitsBy1() {
_key >>= 1; _key >>= 1;
if (!--_bitsLeft) { if (!--_bitsLeft) {
if (_dataPtr < _endofBuffer) if (_dataPtr < _endofBuffer)
_key = ((*_dataPtr++) << 8) | (_key & 0xff); _key = ((*_dataPtr++) << 8) | (_key & 0xFF);
_bitsLeft = 8; _bitsLeft = 8;
} }
} }
@ -528,7 +528,7 @@ void FileExpanderSource::advSrcBitsByIndex(uint8 newIndex) {
_index = -_bitsLeft; _index = -_bitsLeft;
_bitsLeft = 8 - _index; _bitsLeft = 8 - _index;
if (_dataPtr < _endofBuffer) if (_dataPtr < _endofBuffer)
_key = (*_dataPtr++ << 8) | (_key & 0xff); _key = (*_dataPtr++ << 8) | (_key & 0xFF);
} }
_key >>= _index; _key >>= _index;
} }
@ -540,13 +540,13 @@ uint16 FileExpanderSource::getKeyMasked(uint8 newIndex) {
if (_index > 8) { if (_index > 8) {
newIndex = _index - 8; newIndex = _index - 8;
res = (_key & 0xff) & mskTable[8]; res = (_key & 0xFF) & mskTable[8];
advSrcBitsByIndex(8); advSrcBitsByIndex(8);
_index = newIndex; _index = newIndex;
res |= (((_key & 0xff) & mskTable[_index]) << 8); res |= (((_key & 0xFF) & mskTable[_index]) << 8);
advSrcBitsByIndex(_index); advSrcBitsByIndex(_index);
} else { } else {
res = (_key & 0xff) & mskTable[_index]; res = (_key & 0xFF) & mskTable[_index];
advSrcBitsByIndex(_index); advSrcBitsByIndex(_index);
} }
@ -568,10 +568,10 @@ void FileExpanderSource::copyBytes(uint8 *& dst) {
uint16 FileExpanderSource::keyMaskedAlign(uint16 val) { uint16 FileExpanderSource::keyMaskedAlign(uint16 val) {
val -= 0x101; val -= 0x101;
_index = (val & 0xff) >> 2; _index = (val & 0xFF) >> 2;
int16 b = ((_bitsLeft << 8) | _index) - 1; int16 b = ((_bitsLeft << 8) | _index) - 1;
_bitsLeft = b >> 8; _bitsLeft = b >> 8;
_index = b & 0xff; _index = b & 0xFF;
uint16 res = (((val & 3) + 4) << _index) + 0x101; uint16 res = (((val & 3) + 4) << _index) + 0x101;
return res + getKeyMasked(_index); return res + getKeyMasked(_index);
} }
@ -727,20 +727,20 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
cmd = ((int16 *)_tables[2])[_src->getKeyLower()]; cmd = ((int16 *)_tables[2])[_src->getKeyLower()];
_src->advSrcBitsByIndex(cmd < 0 ? calcCmdAndIndex(_tables[3], cmd) : _tables[0][cmd]); _src->advSrcBitsByIndex(cmd < 0 ? calcCmdAndIndex(_tables[3], cmd) : _tables[0][cmd]);
if (cmd == 0x11d) { if (cmd == 0x11D) {
cmd = 0x200; cmd = 0x200;
} else if (cmd > 0x108) { } else if (cmd > 0x108) {
cmd = _src->keyMaskedAlign(cmd); cmd = _src->keyMaskedAlign(cmd);
} }
if (!(cmd >> 8)) { if (!(cmd >> 8)) {
*d++ = cmd & 0xff; *d++ = cmd & 0xFF;
} else if (cmd != 0x100) { } else if (cmd != 0x100) {
cmd -= 0xfe; cmd -= 0xFE;
int16 offset = ((int16 *)_tables[4])[_src->getKeyLower()]; int16 offset = ((int16 *)_tables[4])[_src->getKeyLower()];
_src->advSrcBitsByIndex(offset < 0 ? calcCmdAndIndex(_tables[5], offset) : _tables[1][offset]); _src->advSrcBitsByIndex(offset < 0 ? calcCmdAndIndex(_tables[5], offset) : _tables[1][offset]);
if ((offset & 0xff) >= 4) { if ((offset & 0xFF) >= 4) {
uint8 newIndex = ((offset & 0xff) >> 1) - 1; uint8 newIndex = ((offset & 0xFF) >> 1) - 1;
offset = (((offset & 1) + 2) << newIndex); offset = (((offset & 1) + 2) << newIndex);
offset += _src->getKeyMasked(newIndex); offset += _src->getKeyMasked(newIndex);
} }
@ -775,7 +775,7 @@ bool FileExpander::process(uint8 *dst, const uint8 *src, uint32 outsize, uint32
void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt) { void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex2, int cnt) {
uint8 *tbl1 = _tables[srcIndex]; uint8 *tbl1 = _tables[srcIndex];
uint8 *tbl2 = _tables[dstIndex]; uint8 *tbl2 = _tables[dstIndex];
uint8 *tbl3 = dstIndex2 == 0xff ? 0 : _tables[dstIndex2]; uint8 *tbl3 = dstIndex2 == 0xFF ? 0 : _tables[dstIndex2];
if (!cnt) if (!cnt)
return; return;
@ -859,7 +859,7 @@ void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex
do { do {
s2[o] = cnt; s2[o] = cnt;
o += inc; o += inc;
} while (!(o & 0xf00)); } while (!(o & 0xF00));
} else if (t > 8) { } else if (t > 8) {
if (!bt) if (!bt)
@ -868,7 +868,7 @@ void FileExpander::generateTables(uint8 srcIndex, uint8 dstIndex, uint8 dstIndex
t -= 8; t -= 8;
uint8 shiftCnt = 1; uint8 shiftCnt = 1;
uint8 v = (*d) >> 8; uint8 v = (*d) >> 8;
s2 = &((uint16 *)tbl2)[*d & 0xff]; s2 = &((uint16 *)tbl2)[*d & 0xFF];
do { do {
if (!*s2) { if (!*s2) {
@ -897,7 +897,7 @@ uint8 FileExpander::calcCmdAndIndex(const uint8 *tbl, int16 &para) {
do { do {
newIndex++; newIndex++;
para = t[((~para) & 0xfffe) | (v & 1)]; para = t[((~para) & 0xFFFE) | (v & 1)];
v >>= 1; v >>= 1;
} while (para < 0); } while (para < 0);
@ -1020,7 +1020,7 @@ Common::Archive *InstallerLoader::load(Resource *owner, const Common::String &fi
pos = 0; pos = 0;
const uint32 kExecSize = 0x0bba; const uint32 kExecSize = 0x0BBA;
const uint32 kHeaderSize = 30; const uint32 kHeaderSize = 30;
const uint32 kHeaderSize2 = 46; const uint32 kHeaderSize2 = 46;

View file

@ -453,7 +453,7 @@ Common::Error EoBCoreEngine::saveGameStateIntern(int slot, const char *saveName,
out->write(l->wallsXorData, 4096); out->write(l->wallsXorData, 4096);
for (int ii = 0; ii < 1024; ii++) for (int ii = 0; ii < 1024; ii++)
out->writeByte(l->flags[ii] & 0xff); out->writeByte(l->flags[ii] & 0xFF);
EoBMonsterInPlay *lm = (EoBMonsterInPlay *)_lvlTempData[i]->monsters; EoBMonsterInPlay *lm = (EoBMonsterInPlay *)_lvlTempData[i]->monsters;
EoBFlyingObject *lf = (EoBFlyingObject *)_lvlTempData[i]->flyingObjects; EoBFlyingObject *lf = (EoBFlyingObject *)_lvlTempData[i]->flyingObjects;

View file

@ -41,7 +41,7 @@ Common::Error LoLEngine::loadGameState(int slot) {
SaveHeader header; SaveHeader header;
Common::InSaveFile *saveFile = openSaveForReading(fileName, header); Common::InSaveFile *saveFile = openSaveForReading(fileName, header);
if (!saveFile) { if (!saveFile) {
_txt->printMessage(2, "%s", getLangString(0x425d)); _txt->printMessage(2, "%s", getLangString(0x425D));
return Common::kNoError; return Common::kNoError;
} }
@ -437,7 +437,7 @@ Common::Error LoLEngine::saveGameStateIntern(int slot, const char *saveName, con
out->write(l->wallsXorData, 4096); out->write(l->wallsXorData, 4096);
for (int ii = 0; ii < 1024; ii++) for (int ii = 0; ii < 1024; ii++)
out->writeByte(l->flags[ii] & 0xff); out->writeByte(l->flags[ii] & 0xFF);
LoLMonster *lm = (LoLMonster *)_lvlTempData[i]->monsters; LoLMonster *lm = (LoLMonster *)_lvlTempData[i]->monsters;
FlyingObject *lf = (FlyingObject *)_lvlTempData[i]->flyingObjects; FlyingObject *lf = (FlyingObject *)_lvlTempData[i]->flyingObjects;

View file

@ -157,7 +157,7 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
_curGfxFile = (const char *)pos; _curGfxFile = (const char *)pos;
pos += slen; pos += slen;
if (*pos++ != 0xff && _flags.gameID == GI_EOB2) { if (*pos++ != 0xFF && _flags.gameID == GI_EOB2) {
tmpStr = Common::String::format(paletteFilePattern, (const char *)pos); tmpStr = Common::String::format(paletteFilePattern, (const char *)pos);
pos += 13; pos += 13;
} }
@ -174,7 +174,7 @@ Common::String EoBCoreEngine::initLevelData(int sub) {
if (_configRenderMode != Common::kRenderCGA) { if (_configRenderMode != Common::kRenderCGA) {
Palette backupPal(256); Palette backupPal(256);
backupPal.copy(_screen->getPalette(0), 224, 32, 224); backupPal.copy(_screen->getPalette(0), 224, 32, 224);
_screen->getPalette(0).fill(224, 32, 0x3f); _screen->getPalette(0).fill(224, 32, 0x3F);
uint8 *src = _screen->getPalette(0).getData(); uint8 *src = _screen->getPalette(0).getData();
_screen->createFadeTable(src, _screen->getFadeTable(0), 4, 75); // green _screen->createFadeTable(src, _screen->getFadeTable(0), 4, 75); // green
@ -271,7 +271,7 @@ void EoBCoreEngine::addLevelItems() {
for (int i = 0; i < 600; i++) { for (int i = 0; i < 600; i++) {
if (_items[i].level != _currentLevel || _items[i].block <= 0) if (_items[i].level != _currentLevel || _items[i].block <= 0)
continue; continue;
setItemPosition((Item *)&_levelBlockProperties[_items[i].block & 0x3ff].drawObjects, _items[i].block, i, _items[i].pos); setItemPosition((Item *)&_levelBlockProperties[_items[i].block & 0x3FF].drawObjects, _items[i].block, i, _items[i].pos);
} }
} }
@ -305,10 +305,10 @@ void EoBCoreEngine::loadVcnData(const char *file, const uint8 *cgaMapping) {
while (dst < _vcnBlocks + vcnSize) { while (dst < _vcnBlocks + vcnSize) {
const uint16 *table = _screen->getCGADitheringTable((tblSwitch++) & 1); const uint16 *table = _screen->getCGADitheringTable((tblSwitch++) & 1);
for (int ii = 0; ii < 2; ii++) { for (int ii = 0; ii < 2; ii++) {
*dst++ = (table[pos[0]] & 0x000f) | ((table[pos[0]] & 0x0f00) >> 4); *dst++ = (table[pos[0]] & 0x000F) | ((table[pos[0]] & 0x0F00) >> 4);
*dst++ = (table[pos[1]] & 0x000f) | ((table[pos[1]] & 0x0f00) >> 4); *dst++ = (table[pos[1]] & 0x000F) | ((table[pos[1]] & 0x0F00) >> 4);
*dst2++ = ((pos[0] & 0xf0 ? 0x30 : 0) | (pos[0] & 0x0f ? 0x03 : 0)) ^ 0x33; *dst2++ = ((pos[0] & 0xF0 ? 0x30 : 0) | (pos[0] & 0x0F ? 0x03 : 0)) ^ 0x33;
*dst2++ = ((pos[1] & 0xf0 ? 0x30 : 0) | (pos[1] & 0x0f ? 0x03 : 0)) ^ 0x33; *dst2++ = ((pos[1] & 0xF0 ? 0x30 : 0) | (pos[1] & 0x0F ? 0x03 : 0)) ^ 0x33;
pos += 2; pos += 2;
} }
} }
@ -379,8 +379,8 @@ void EoBCoreEngine::loadDecorations(const char *cpsFile, const char *decFile) {
LevelDecorationProperty *l = &_levelDecorationData[i]; LevelDecorationProperty *l = &_levelDecorationData[i];
for (int ii = 0; ii < 10; ii++) { for (int ii = 0; ii < 10; ii++) {
l->shapeIndex[ii] = s->readByte(); l->shapeIndex[ii] = s->readByte();
if (l->shapeIndex[ii] == 0xff) if (l->shapeIndex[ii] == 0xFF)
l->shapeIndex[ii] = 0xffff; l->shapeIndex[ii] = 0xFFFF;
} }
l->next = s->readByte(); l->next = s->readByte();
l->flags = s->readByte(); l->flags = s->readByte();
@ -427,7 +427,7 @@ void EoBCoreEngine::assignWallsAndDecorations(int wallIndex, int vmpIndex, int d
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
uint16 t = _levelDecorationProperties[_mappedDecorationsCount].shapeIndex[i]; uint16 t = _levelDecorationProperties[_mappedDecorationsCount].shapeIndex[i];
if (t == 0xffff) if (t == 0xFFFF)
continue; continue;
if (_levelDecorationShapes[t]) if (_levelDecorationShapes[t])
@ -479,7 +479,7 @@ void EoBCoreEngine::toggleWallState(int wall, int toggle) {
if (toggle) if (toggle)
_wllWallFlags[wall + i] |= 2; _wllWallFlags[wall + i] |= 2;
else else
_wllWallFlags[wall + i] &= 0xfd; _wllWallFlags[wall + i] &= 0xFD;
} }
} }
@ -593,7 +593,7 @@ void EoBCoreEngine::drawDecorations(int index) {
if ((i == 0) && (flg & 1 || ((flg & 2) && _wllProcessFlag))) if ((i == 0) && (flg & 1 || ((flg & 2) && _wllProcessFlag)))
ix = -ix; ix = -ix;
if (_levelDecorationProperties[l].shapeIndex[shpIx] == 0xffff) { if (_levelDecorationProperties[l].shapeIndex[shpIx] == 0xFFFF) {
l = _levelDecorationProperties[l].next; l = _levelDecorationProperties[l].next;
continue; continue;
} }
@ -708,7 +708,7 @@ int EoBCoreEngine::clickedNiche(uint16 block, uint16 direction) {
if (_dscItemShapeMap[_items[_itemInHand].icon] <= 14) { if (_dscItemShapeMap[_items[_itemInHand].icon] <= 14) {
_txt->printMessage(_pryDoorStrings[5]); _txt->printMessage(_pryDoorStrings[5]);
} else { } else {
setItemPosition((Item *)&_levelBlockProperties[block & 0x3ff].drawObjects, block, _itemInHand, 8); setItemPosition((Item *)&_levelBlockProperties[block & 0x3FF].drawObjects, block, _itemInHand, 8);
runLevelScript(block, 4); runLevelScript(block, 4);
setHandItem(0); setHandItem(0);
_sceneUpdateRequired = true; _sceneUpdateRequired = true;
@ -731,7 +731,7 @@ int EoBCoreEngine::clickedDoorPry(uint16 block, uint16 direction) {
int d = -1; int d = -1;
for (int i = 0; i < 6; i++) { for (int i = 0; i < 6; i++) {
if (!testCharacter(i, 0x0d)) if (!testCharacter(i, 0x0D))
continue; continue;
if (d >= 0) { if (d >= 0) {
int s1 = _characters[i].strengthCur + _characters[i].strengthExtCur; int s1 = _characters[i].strengthCur + _characters[i].strengthExtCur;
@ -776,7 +776,7 @@ int EoBCoreEngine::clickedDoorNoPry(uint16 block, uint16 direction) {
int EoBCoreEngine::specialWallAction(int block, int direction) { int EoBCoreEngine::specialWallAction(int block, int direction) {
direction ^= 2; direction ^= 2;
uint8 type = _specialWallTypes[_levelBlockProperties[block].walls[direction]]; uint8 type = _specialWallTypes[_levelBlockProperties[block].walls[direction]];
if (!type || !(_clickedSpecialFlag & (((_levelBlockProperties[block].flags & 0xf8) >> 3) | 0xe0))) if (!type || !(_clickedSpecialFlag & (((_levelBlockProperties[block].flags & 0xF8) >> 3) | 0xE0)))
return 0; return 0;
int res = 0; int res = 0;

View file

@ -193,7 +193,7 @@ int LoLEngine::assignLevelDecorationShapes(int index) {
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
uint16 t = _levelDecorationProperties[o].shapeIndex[i]; uint16 t = _levelDecorationProperties[o].shapeIndex[i];
if (t == 0xffff) if (t == 0xFFFF)
continue; continue;
uint16 pv = p1[t]; uint16 pv = p1[t];
@ -254,7 +254,7 @@ void LoLEngine::loadBlockProperties(const char *cmzFile) {
_levelBlockProperties[i].direction = 5; _levelBlockProperties[i].direction = 5;
if (_wllAutomapData[_levelBlockProperties[i].walls[0]] == 17) { if (_wllAutomapData[_levelBlockProperties[i].walls[0]] == 17) {
_levelBlockProperties[i].flags &= 0xef; _levelBlockProperties[i].flags &= 0xEF;
_levelBlockProperties[i].flags |= 0x20; _levelBlockProperties[i].flags |= 0x20;
} }
} }
@ -315,9 +315,9 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
if (_lastSpecialColor == 1) if (_lastSpecialColor == 1)
_lastSpecialColor = 0x44; _lastSpecialColor = 0x44;
else if (_lastSpecialColor == 0x66) else if (_lastSpecialColor == 0x66)
_lastSpecialColor = scumm_stricmp(file, "YVEL2") ? 0xcc : 0x44; _lastSpecialColor = scumm_stricmp(file, "YVEL2") ? 0xCC : 0x44;
else if (_lastSpecialColor == 0x6b) else if (_lastSpecialColor == 0x6B)
_lastSpecialColor = 0xcc; _lastSpecialColor = 0xCC;
else else
_lastSpecialColor = 0x44; _lastSpecialColor = 0x44;
} }
@ -431,17 +431,17 @@ void LoLEngine::loadLevelGraphics(const char *file, int specialColor, int weight
} }
for (int ii = l; ii < 256; ii++) for (int ii = l; ii < 256; ii++)
levelOverlay[ii] = ii & 0xff; levelOverlay[ii] = ii & 0xFF;
} }
uint8 *levelOverlay = _screen->getLevelOverlay(7); uint8 *levelOverlay = _screen->getLevelOverlay(7);
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
levelOverlay[i] = i & 0xff; levelOverlay[i] = i & 0xFF;
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
_screen->getLevelOverlay(6)[0xee] = 0xee; _screen->getLevelOverlay(6)[0xEE] = 0xEE;
if (_lastSpecialColor == 0x44) if (_lastSpecialColor == 0x44)
_screen->getLevelOverlay(5)[0xee] = 0xee; _screen->getLevelOverlay(5)[0xEE] = 0xEE;
for (int i = 0; i < 7; i++) for (int i = 0; i < 7; i++)
memcpy(_screen->getLevelOverlay(i), _screen->getLevelOverlay(i + 1), 256); memcpy(_screen->getLevelOverlay(i), _screen->getLevelOverlay(i + 1), 256);
@ -505,14 +505,14 @@ void LoLEngine::resetBlockProperties() {
for (int i = 0; i < 1024; i++) { for (int i = 0; i < 1024; i++) {
LevelBlockProperty *l = &_levelBlockProperties[i]; LevelBlockProperty *l = &_levelBlockProperties[i];
if (l->flags & 0x10) { if (l->flags & 0x10) {
l->flags &= 0xef; l->flags &= 0xEF;
if (testWallInvisibility(i, 0) && testWallInvisibility(i, 1)) if (testWallInvisibility(i, 0) && testWallInvisibility(i, 1))
l->flags |= 0x40; l->flags |= 0x40;
} else { } else {
if (l->flags & 0x40) if (l->flags & 0x40)
l->flags &= 0xbf; l->flags &= 0xBF;
else if (l->flags & 0x80) else if (l->flags & 0x80)
l->flags &= 0x7f; l->flags &= 0x7F;
} }
} }
} }
@ -574,7 +574,7 @@ void LoLEngine::updateLampStatus() {
setPaletteBrightness(_screen->getPalette(0), _brightness, newLampEffect); setPaletteBrightness(_screen->getPalette(0), _brightness, newLampEffect);
_lampStatusTimer = _system->getMillis() + (10 + rollDice(1, 30)) * _tickLength; _lampStatusTimer = _system->getMillis() + (10 + rollDice(1, 30)) * _tickLength;
} else { } else {
if ((_lampEffect & 0xfe) == (newLampEffect & 0xfe)) { if ((_lampEffect & 0xFE) == (newLampEffect & 0xFE)) {
if (_system->getMillis() <= _lampStatusTimer) { if (_system->getMillis() <= _lampStatusTimer) {
newLampEffect = _lampEffect; newLampEffect = _lampEffect;
} else { } else {
@ -702,7 +702,7 @@ void LoLEngine::moveParty(uint16 direction, int unk1, int unk2, int buttonShape)
runLevelScript(opos, 8); runLevelScript(opos, 8);
runLevelScript(npos, 2); runLevelScript(npos, 2);
if (_levelBlockProperties[npos].walls[0] == 0x1a) if (_levelBlockProperties[npos].walls[0] == 0x1A)
memset(_levelBlockProperties[npos].walls, 0, 4); memset(_levelBlockProperties[npos].walls, 0, 4);
} }
} }
@ -711,12 +711,12 @@ void LoLEngine::moveParty(uint16 direction, int unk1, int unk2, int buttonShape)
} }
uint16 LoLEngine::calcBlockIndex(uint16 x, uint16 y) { uint16 LoLEngine::calcBlockIndex(uint16 x, uint16 y) {
return (((y & 0xff00) >> 3) | (x >> 8)) & 0x3ff; return (((y & 0xFF00) >> 3) | (x >> 8)) & 0x3FF;
} }
void LoLEngine::calcCoordinates(uint16 &x, uint16 &y, int block, uint16 xOffs, uint16 yOffs) { void LoLEngine::calcCoordinates(uint16 &x, uint16 &y, int block, uint16 xOffs, uint16 yOffs) {
x = (block & 0x1f) << 8 | xOffs; x = (block & 0x1F) << 8 | xOffs;
y = ((block & 0xffe0) << 3) | yOffs; y = ((block & 0xFFE0) << 3) | yOffs;
} }
void LoLEngine::calcCoordinatesForSingleCharacter(int charNum, uint16 &x, uint16 &y) { void LoLEngine::calcCoordinatesForSingleCharacter(int charNum, uint16 &x, uint16 &y) {
@ -732,8 +732,8 @@ void LoLEngine::calcCoordinatesForSingleCharacter(int charNum, uint16 &x, uint16
calcCoordinatesAddDirectionOffset(x, y, _currentDirection); calcCoordinatesAddDirectionOffset(x, y, _currentDirection);
x |= (_partyPosX & 0xff00); x |= (_partyPosX & 0xFF00);
y |= (_partyPosY & 0xff00); y |= (_partyPosY & 0xFF00);
} }
void LoLEngine::calcCoordinatesAddDirectionOffset(uint16 &x, uint16 &y, int direction) { void LoLEngine::calcCoordinatesAddDirectionOffset(uint16 &x, uint16 &y, int direction) {
@ -777,7 +777,7 @@ void LoLEngine::notifyBlockNotPassable(int scrollFlag) {
movePartySmoothScrollBlocked(2); movePartySmoothScrollBlocked(2);
snd_stopSpeech(true); snd_stopSpeech(true);
_txt->printMessage(0x8002, "%s", getLangString(0x403f)); _txt->printMessage(0x8002, "%s", getLangString(0x403F));
snd_playSoundEffect(19, -1); snd_playSoundEffect(19, -1);
} }
@ -804,7 +804,7 @@ int LoLEngine::clickedNiche(uint16 block, uint16 direction) {
return 0; return 0;
uint16 x = 0x80; uint16 x = 0x80;
uint16 y = 0xff; uint16 y = 0xFF;
calcCoordinatesAddDirectionOffset(x, y, _currentDirection); calcCoordinatesAddDirectionOffset(x, y, _currentDirection);
calcCoordinates(x, y, block, x, y); calcCoordinates(x, y, block, x, y);
setItemPosition(_itemInHand, x, y, 8, 1); setItemPosition(_itemInHand, x, y, 8, 1);
@ -1180,7 +1180,7 @@ void LoLEngine::processGasExplosion(int soundId) {
memcpy(p2, p1, 768); memcpy(p2, p1, 768);
for (int i = 1; i < 128; i++) for (int i = 1; i < 128; i++)
p2[i * 3] = 0x3f; p2[i * 3] = 0x3F;
uint32 ctime = _system->getMillis(); uint32 ctime = _system->getMillis();
while (_screen->timedPaletteFadeStep(_screen->getPalette(0).getData(), p2, _system->getMillis() - ctime, 10)) while (_screen->timedPaletteFadeStep(_screen->getPalette(0).getData(), p2, _system->getMillis() - ctime, 10))
@ -1244,10 +1244,10 @@ void LoLEngine::setWallType(int block, int wall, int val) {
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
_levelBlockProperties[block].walls[i] = val; _levelBlockProperties[block].walls[i] = val;
if (_wllAutomapData[val] == 17) { if (_wllAutomapData[val] == 17) {
_levelBlockProperties[block].flags &= 0xef; _levelBlockProperties[block].flags &= 0xEF;
_levelBlockProperties[block].flags |= 0x20; _levelBlockProperties[block].flags |= 0x20;
} else { } else {
_levelBlockProperties[block].flags &= 0xdf; _levelBlockProperties[block].flags &= 0xDF;
} }
} else { } else {
_levelBlockProperties[block].walls[wall] = val; _levelBlockProperties[block].walls[wall] = val;
@ -1491,7 +1491,7 @@ void LoLEngine::drawDecorations(int index) {
ov = 0; ov = 0;
} }
ovl = _screen->getLevelOverlay(ov); ovl = _screen->getLevelOverlay(ov);
} else if (_levelDecorationProperties[l].shapeIndex[shpIx] != 0xffff) { } else if (_levelDecorationProperties[l].shapeIndex[shpIx] != 0xFFFF) {
scaleW = scaleH = 0x100; scaleW = scaleH = 0x100;
int ov = 7; int ov = 7;
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
@ -1504,7 +1504,7 @@ void LoLEngine::drawDecorations(int index) {
ovl = _screen->getLevelOverlay(ov); ovl = _screen->getLevelOverlay(ov);
} }
if (_levelDecorationProperties[l].shapeIndex[shpIx] != 0xffff) { if (_levelDecorationProperties[l].shapeIndex[shpIx] != 0xFFFF) {
shapeData = _levelDecorationShapes[_levelDecorationProperties[l].shapeIndex[shpIx]]; shapeData = _levelDecorationShapes[_levelDecorationProperties[l].shapeIndex[shpIx]];
if (shapeData) { if (shapeData) {
if (ix < 0) { if (ix < 0) {
@ -1538,10 +1538,10 @@ void LoLEngine::drawDecorations(int index) {
} }
void LoLEngine::drawBlockEffects(int index, int type) { void LoLEngine::drawBlockEffects(int index, int type) {
static const uint16 yOffs[] = { 0xff, 0xff, 0x80, 0x80 }; static const uint16 yOffs[] = { 0xFF, 0xFF, 0x80, 0x80 };
uint8 flg = _visibleBlocks[index]->flags; uint8 flg = _visibleBlocks[index]->flags;
// flags: 0x10 = ice wall, 0x20 = teleporter, 0x40 = blue slime spot, 0x80 = blood spot // flags: 0x10 = ice wall, 0x20 = teleporter, 0x40 = blue slime spot, 0x80 = blood spot
if (!(flg & 0xf0)) if (!(flg & 0xF0))
return; return;
type = (type == 0) ? 2 : 0; type = (type == 0) ? 2 : 0;
@ -1562,8 +1562,8 @@ void LoLEngine::drawBlockEffects(int index, int type) {
calcCoordinatesAddDirectionOffset(x, y, _currentDirection); calcCoordinatesAddDirectionOffset(x, y, _currentDirection);
x |= ((_visibleBlockIndex[index] & 0x1f) << 8); x |= ((_visibleBlockIndex[index] & 0x1F) << 8);
y |= ((_visibleBlockIndex[index] & 0xffe0) << 3); y |= ((_visibleBlockIndex[index] & 0xFFE0) << 3);
drawItemOrMonster(_effectShapes[type], ovl, x, y, 0, (type == 1) ? -20 : 0, drawFlag, -1, false); drawItemOrMonster(_effectShapes[type], ovl, x, y, 0, (type == 1) ? -20 : 0, drawFlag, -1, false);
} }

View file

@ -151,7 +151,7 @@ void KyraRpgEngine::generateBlockDrawingBuffer() {
memset(_blockDrawingBuffer, 0, 660 * sizeof(uint16)); memset(_blockDrawingBuffer, 0, 660 * sizeof(uint16));
_wllProcessFlag = ((_currentBlock >> 5) + (_currentBlock & 0x1f) + _currentDirection) & 1; _wllProcessFlag = ((_currentBlock >> 5) + (_currentBlock & 0x1F) + _currentDirection) & 1;
if (_wllProcessFlag) // floor and ceiling if (_wllProcessFlag) // floor and ceiling
generateVmpTileDataFlipped(0, 15, 1, -330, 22, 15); generateVmpTileDataFlipped(0, 15, 1, -330, 22, 15);
@ -318,7 +318,7 @@ bool KyraRpgEngine::hasWall(int index) {
void KyraRpgEngine::assignVisibleBlocks(int block, int direction) { void KyraRpgEngine::assignVisibleBlocks(int block, int direction) {
for (int i = 0; i < 18; i++) { for (int i = 0; i < 18; i++) {
uint16 t = (block + _dscBlockIndex[direction * 18 + i]) & 0x3ff; uint16 t = (block + _dscBlockIndex[direction * 18 + i]) & 0x3FF;
_visibleBlockIndex[i] = t; _visibleBlockIndex[i] = t;
_visibleBlocks[i] = &_levelBlockProperties[t]; _visibleBlocks[i] = &_levelBlockProperties[t];
@ -366,7 +366,7 @@ void KyraRpgEngine::drawVcnBlocks() {
if (vcnOffset & 0x4000) { if (vcnOffset & 0x4000) {
horizontalFlip = true; horizontalFlip = true;
vcnOffset &= 0x3fff; vcnOffset &= 0x3FFF;
} }
uint8 *src = 0; uint8 *src = 0;
@ -378,7 +378,7 @@ void KyraRpgEngine::drawVcnBlocks() {
vcnOffset = bdb[329]; vcnOffset = bdb[329];
if (vcnOffset & 0x4000) { if (vcnOffset & 0x4000) {
horizontalFlip = true; horizontalFlip = true;
vcnOffset &= 0x3fff; vcnOffset &= 0x3FFF;
} }
src = (_vcfBlocks ? _vcfBlocks : _vcnBlocks) + (vcnOffset << 5); src = (_vcfBlocks ? _vcfBlocks : _vcnBlocks) + (vcnOffset << 5);
@ -391,7 +391,7 @@ void KyraRpgEngine::drawVcnBlocks() {
src += 3; src += 3;
for (int blockX = 0; blockX < 4; blockX++) { for (int blockX = 0; blockX < 4; blockX++) {
uint8 bl = *src--; uint8 bl = *src--;
*d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift]; *d++ = _vcnColTable[((bl & 0x0F) + wllVcnOffset) | shift];
*d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift]; *d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
} }
src += 5; src += 5;
@ -402,7 +402,7 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int blockX = 0; blockX < 4; blockX++) { for (int blockX = 0; blockX < 4; blockX++) {
uint8 bl = *src++; uint8 bl = *src++;
*d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift]; *d++ = _vcnColTable[((bl >> 4) + wllVcnOffset) | shift];
*d++ = _vcnColTable[((bl & 0x0f) + wllVcnOffset) | shift]; *d++ = _vcnColTable[((bl & 0x0F) + wllVcnOffset) | shift];
} }
d += 168; d += 168;
} }
@ -414,7 +414,7 @@ void KyraRpgEngine::drawVcnBlocks() {
horizontalFlip = false; horizontalFlip = false;
if (vcnExtraOffsetWll & 0x4000) { if (vcnExtraOffsetWll & 0x4000) {
vcnExtraOffsetWll &= 0x3fff; vcnExtraOffsetWll &= 0x3FFF;
horizontalFlip = true; horizontalFlip = true;
} }
@ -429,11 +429,11 @@ void KyraRpgEngine::drawVcnBlocks() {
for (int blockX = 0; blockX < 4; blockX++) { for (int blockX = 0; blockX < 4; blockX++) {
uint8 bl = *src--; uint8 bl = *src--;
uint8 mask = _vcnTransitionMask ? *maskTable-- : 0; uint8 mask = _vcnTransitionMask ? *maskTable-- : 0;
uint8 h = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift]; uint8 h = _vcnColTable[((bl & 0x0F) + wllVcnRmdOffset) | shift];
uint8 l = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift]; uint8 l = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
if (_vcnTransitionMask) if (_vcnTransitionMask)
*d = (*d & (mask & 0x0f)) | h; *d = (*d & (mask & 0x0F)) | h;
else if (h) else if (h)
*d = h; *d = h;
d++; d++;
@ -454,7 +454,7 @@ void KyraRpgEngine::drawVcnBlocks() {
uint8 bl = *src++; uint8 bl = *src++;
uint8 mask = _vcnTransitionMask ? *maskTable++ : 0; uint8 mask = _vcnTransitionMask ? *maskTable++ : 0;
uint8 h = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift]; uint8 h = _vcnColTable[((bl >> 4) + wllVcnRmdOffset) | shift];
uint8 l = _vcnColTable[((bl & 0x0f) + wllVcnRmdOffset) | shift]; uint8 l = _vcnColTable[((bl & 0x0F) + wllVcnRmdOffset) | shift];
if (_vcnTransitionMask) if (_vcnTransitionMask)
*d = (*d & (mask >> 4)) | h; *d = (*d & (mask >> 4)) | h;
@ -463,7 +463,7 @@ void KyraRpgEngine::drawVcnBlocks() {
d++; d++;
if (_vcnTransitionMask) if (_vcnTransitionMask)
*d = (*d & (mask & 0x0f)) | l; *d = (*d & (mask & 0x0F)) | l;
else if (l) else if (l)
*d = l; *d = l;
d++; d++;
@ -482,7 +482,7 @@ void KyraRpgEngine::drawVcnBlocks() {
uint16 KyraRpgEngine::calcNewBlockPosition(uint16 curBlock, uint16 direction) { uint16 KyraRpgEngine::calcNewBlockPosition(uint16 curBlock, uint16 direction) {
static const int16 blockPosTable[] = { -32, 1, 32, -1 }; static const int16 blockPosTable[] = { -32, 1, 32, -1 };
return (curBlock + blockPosTable[direction]) & 0x3ff; return (curBlock + blockPosTable[direction]) & 0x3FF;
} }
int KyraRpgEngine::clickedWallShape(uint16 block, uint16 direction) { int KyraRpgEngine::clickedWallShape(uint16 block, uint16 direction) {

View file

@ -1490,7 +1490,7 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int
int scaleCounterV = 0; int scaleCounterV = 0;
const int drawFunc = flags & 0x0f; const int drawFunc = flags & 0x0F;
_dsProcessMargin = dsMarginFunc[drawFunc]; _dsProcessMargin = dsMarginFunc[drawFunc];
_dsScaleSkip = dsSkipFunc[drawFunc]; _dsScaleSkip = dsSkipFunc[drawFunc];
_dsProcessLine = dsLineFunc[drawFunc]; _dsProcessLine = dsLineFunc[drawFunc];
@ -1747,7 +1747,7 @@ int Screen::drawShapeMarginScaleUpwind(uint8 *&dst, const uint8 *&src, int &cnt)
_dsTmpWidth += cnt; _dsTmpWidth += cnt;
int i = (_dsOffscreenLeft - cnt) * _dsScaleW; int i = (_dsOffscreenLeft - cnt) * _dsScaleW;
int res = i & 0xff; int res = i & 0xFF;
i >>= 8; i >>= 8;
i -= _dsOffscreenScaleVal2; i -= _dsOffscreenScaleVal2;
dst += i; dst += i;
@ -1773,7 +1773,7 @@ int Screen::drawShapeMarginScaleDownwind(uint8 *&dst, const uint8 *&src, int &cn
_dsTmpWidth += cnt; _dsTmpWidth += cnt;
int i = (_dsOffscreenLeft - cnt) * _dsScaleW; int i = (_dsOffscreenLeft - cnt) * _dsScaleW;
int res = i & 0xff; int res = i & 0xFF;
i >>= 8; i >>= 8;
i -= _dsOffscreenScaleVal2; i -= _dsOffscreenScaleVal2;
dst -= i; dst -= i;
@ -1862,7 +1862,7 @@ void Screen::drawShapeProcessLineScaleUpwind(uint8 *&dst, const uint8 *&src, int
int r = c * _dsScaleW + scaleState; int r = c * _dsScaleW + scaleState;
dst += (r >> 8); dst += (r >> 8);
cnt -= (r >> 8); cnt -= (r >> 8);
scaleState = r & 0xff; scaleState = r & 0xFF;
} }
} else if (scaleState) { } else if (scaleState) {
(this->*_dsPlot)(dst++, c); (this->*_dsPlot)(dst++, c);
@ -1890,7 +1890,7 @@ void Screen::drawShapeProcessLineScaleDownwind(uint8 *&dst, const uint8 *&src, i
int r = c * _dsScaleW + scaleState; int r = c * _dsScaleW + scaleState;
dst -= (r >> 8); dst -= (r >> 8);
cnt -= (r >> 8); cnt -= (r >> 8);
scaleState = r & 0xff; scaleState = r & 0xFF;
} }
} else { } else {
(this->*_dsPlot)(dst--, c); (this->*_dsPlot)(dst--, c);
@ -1938,9 +1938,9 @@ void Screen::drawShapePlotType5(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType6(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType6(uint8 *dst, uint8 cmd) {
int t = _drawShapeVar4 + _drawShapeVar5; int t = _drawShapeVar4 + _drawShapeVar5;
if (t & 0xff00) { if (t & 0xFF00) {
cmd = dst[_drawShapeVar3]; cmd = dst[_drawShapeVar3];
t &= 0xff; t &= 0xFF;
} else { } else {
cmd = _dsTable2[cmd]; cmd = _dsTable2[cmd];
} }
@ -1951,7 +1951,7 @@ void Screen::drawShapePlotType6(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType8(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType8(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) if (_dsDrawLayer < t)
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
@ -1960,7 +1960,7 @@ void Screen::drawShapePlotType8(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType9(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType9(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) { if (_dsDrawLayer < t) {
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
} else { } else {
@ -1974,7 +1974,7 @@ void Screen::drawShapePlotType9(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType11_15(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType11_15(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) { if (_dsDrawLayer < t) {
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
@ -1990,7 +1990,7 @@ void Screen::drawShapePlotType11_15(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType12(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType12(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) { if (_dsDrawLayer < t) {
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
} else { } else {
@ -2002,7 +2002,7 @@ void Screen::drawShapePlotType12(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType13(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType13(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) { if (_dsDrawLayer < t) {
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
} else { } else {
@ -2017,14 +2017,14 @@ void Screen::drawShapePlotType13(uint8 *dst, uint8 cmd) {
void Screen::drawShapePlotType14(uint8 *dst, uint8 cmd) { void Screen::drawShapePlotType14(uint8 *dst, uint8 cmd) {
uint32 relOffs = dst - _dsDstPage; uint32 relOffs = dst - _dsDstPage;
int t = (_shapePages[0][relOffs] & 0x7f) & 0x87; int t = (_shapePages[0][relOffs] & 0x7F) & 0x87;
if (_dsDrawLayer < t) { if (_dsDrawLayer < t) {
cmd = _shapePages[1][relOffs]; cmd = _shapePages[1][relOffs];
} else { } else {
t = _drawShapeVar4 + _drawShapeVar5; t = _drawShapeVar4 + _drawShapeVar5;
if (t & 0xff00) { if (t & 0xFF00) {
cmd = dst[_drawShapeVar3]; cmd = dst[_drawShapeVar3];
t &= 0xff; t &= 0xFF;
} else { } else {
cmd = _dsTable2[cmd]; cmd = _dsTable2[cmd];
} }
@ -2118,7 +2118,7 @@ void Screen::decodeFrame1(const uint8 *src, uint8 *dst, uint32 size) {
uint8 nib = 0; uint8 nib = 0;
uint16 code = decodeEGAGetCode(src, nib); uint16 code = decodeEGAGetCode(src, nib);
uint8 last = code & 0xff; uint8 last = code & 0xFF;
uint8 *dstPrev = dst; uint8 *dstPrev = dst;
uint16 count = 1; uint16 count = 1;
@ -2131,7 +2131,7 @@ void Screen::decodeFrame1(const uint8 *src, uint8 *dst, uint32 size) {
uint8 cmd = code >> 8; uint8 cmd = code >> 8;
if (cmd--) { if (cmd--) {
code = (cmd << 8) | (code & 0xff); code = (cmd << 8) | (code & 0xFF);
uint8 *tmpDst = dst; uint8 *tmpDst = dst;
if (code < numPatterns) { if (code < numPatterns) {
@ -2159,7 +2159,7 @@ void Screen::decodeFrame1(const uint8 *src, uint8 *dst, uint32 size) {
count = countPrev; count = countPrev;
} else { } else {
*dst++ = last = (code & 0xff); *dst++ = last = (code & 0xFF);
if (numPatterns < 3840) { if (numPatterns < 3840) {
patterns[numPatterns].pos = dstPrev; patterns[numPatterns].pos = dstPrev;
@ -2180,7 +2180,7 @@ uint16 Screen::decodeEGAGetCode(const uint8 *&pos, uint8 &nib) {
res >>= 4; res >>= 4;
} else { } else {
pos++; pos++;
res &= 0xfff; res &= 0xFFF;
} }
return res; return res;
} }
@ -3643,7 +3643,7 @@ void Palette::loadVGAPalette(Common::ReadStream &stream, int startIndex, int col
uint8 *pos = _palData + startIndex * 3; uint8 *pos = _palData + startIndex * 3;
for (int i = 0 ; i < colors * 3; i++) for (int i = 0 ; i < colors * 3; i++)
*pos++ = stream.readByte() & 0x3f; *pos++ = stream.readByte() & 0x3F;
} }
void Palette::loadEGAPalette(Common::ReadStream &stream, int startIndex, int colors) { void Palette::loadEGAPalette(Common::ReadStream &stream, int startIndex, int colors) {

View file

@ -94,7 +94,7 @@ bool Screen_EoB::init() {
_egaDitheringTable = new uint8[256]; _egaDitheringTable = new uint8[256];
_egaDitheringTempPage = new uint8[SCREEN_W * 2 * SCREEN_H * 2]; _egaDitheringTempPage = new uint8[SCREEN_W * 2 * SCREEN_H * 2];
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
_egaDitheringTable[i] = i & 0x0f; _egaDitheringTable[i] = i & 0x0F;
} else if (_renderMode == Common::kRenderCGA) { } else if (_renderMode == Common::kRenderCGA) {
_cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp); _cgaMappingDefault = _vm->staticres()->loadRawData(kEoB1CgaMappingDefault, temp);
_cgaDitheringTables[0] = new uint16[256]; _cgaDitheringTables[0] = new uint16[256];
@ -105,7 +105,7 @@ bool Screen_EoB::init() {
_cgaScaleTable = new uint8[256]; _cgaScaleTable = new uint8[256];
memset(_cgaScaleTable, 0, 256 * sizeof(uint8)); memset(_cgaScaleTable, 0, 256 * sizeof(uint8));
for (int i = 0; i < 256; i++) for (int i = 0; i < 256; i++)
_cgaScaleTable[i] = ((i & 0xf0) >> 2) | (i & 0x03); _cgaScaleTable[i] = ((i & 0xF0) >> 2) | (i & 0x03);
} }
return true; return true;
@ -260,14 +260,14 @@ void Screen_EoB::convertPage(int srcPage, int dstPage, const uint8 *cgaMapping)
for (int height = SCREEN_H; height; height--) { for (int height = SCREEN_H; height; height--) {
const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1]; const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
for (int width = SCREEN_W / 2; width; width--) { for (int width = SCREEN_W / 2; width; width--) {
WRITE_LE_UINT16(d++, table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)]); WRITE_LE_UINT16(d++, table[((src[1] & 0x0F) << 4) | (src[0] & 0x0F)]);
src += 2; src += 2;
} }
} }
} else if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering) { } else if (_renderMode == Common::kRenderEGA && !_useHiResEGADithering) {
uint32 len = SCREEN_W * SCREEN_H; uint32 len = SCREEN_W * SCREEN_H;
while (len--) while (len--)
*dst++ = *src++ & 0x0f; *dst++ = *src++ & 0x0F;
} else { } else {
copyPage(srcPage, dstPage); copyPage(srcPage, dstPage);
} }
@ -321,9 +321,9 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 *dst = shp; uint8 *dst = shp;
*dst++ = 4; *dst++ = 4;
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
*dst++ = (w & 0xff); *dst++ = (w & 0xFF);
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
uint8 *dst2 = dst + (h * (w << 1)); uint8 *dst2 = dst + (h * (w << 1));
@ -334,8 +334,8 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1]; const uint16 *table = _cgaDitheringTables[(tblSwitch++) & 1];
while (w1--) { while (w1--) {
uint16 p0 = table[((src[1] & 0x0f) << 4) | (src[0] & 0x0f)]; uint16 p0 = table[((src[1] & 0x0F) << 4) | (src[0] & 0x0F)];
uint16 p1 = table[((src[3] & 0x0f) << 4) | (src[2] & 0x0f)]; uint16 p1 = table[((src[3] & 0x0F) << 4) | (src[2] & 0x0F)];
*dst++ = ((p0 & 0x0003) << 6) | ((p0 & 0x0300) >> 4) | ((p1 & 0x0003) << 2) | ((p1 & 0x0300) >> 8); *dst++ = ((p0 & 0x0003) << 6) | ((p0 & 0x0300) >> 4) | ((p1 & 0x0003) << 2) | ((p1 & 0x0300) >> 8);
@ -380,9 +380,9 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 *dst = shp; uint8 *dst = shp;
*dst++ = 8; *dst++ = 8;
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
*dst++ = (w & 0xff); *dst++ = (w & 0xFF);
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3); srcLineStart = getPagePtr(_curPage | 1) + y * 320 + (x << 3);
src = srcLineStart; src = srcLineStart;
@ -405,7 +405,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
*dst++ = 0; *dst++ = 0;
numZero -= 255; numZero -= 255;
} }
val = numZero & 0xff; val = numZero & 0xFF;
} }
*dst++ = val; *dst++ = val;
} while (src != lineEnd); } while (src != lineEnd);
@ -420,7 +420,7 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
if (_renderMode != Common::kRenderEGA || _useHiResEGADithering) { if (_renderMode != Common::kRenderEGA || _useHiResEGADithering) {
colorMap = new uint8[0x100]; colorMap = new uint8[0x100];
memset(colorMap, 0xff, 0x100); memset(colorMap, 0xFF, 0x100);
} }
shapesize = h * (w << 2) + 20; shapesize = h * (w << 2) + 20;
@ -429,12 +429,12 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint8 *dst = shp; uint8 *dst = shp;
*dst++ = 2; *dst++ = 2;
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
*dst++ = (w & 0xff); *dst++ = (w & 0xFF);
*dst++ = (h & 0xff); *dst++ = (h & 0xFF);
if (_renderMode != Common::kRenderEGA || _useHiResEGADithering) { if (_renderMode != Common::kRenderEGA || _useHiResEGADithering) {
memset(dst, 0xff, 0x10); memset(dst, 0xFF, 0x10);
} else { } else {
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
dst[i] = i; dst[i] = i;
@ -449,10 +449,10 @@ uint8 *Screen_EoB::encodeShape(uint16 x, uint16 y, uint16 w, uint16 h, bool enco
uint16 w1 = w << 3; uint16 w1 = w << 3;
while (w1--) { while (w1--) {
uint8 s = *src++; uint8 s = *src++;
uint8 c = s & 0x0f; uint8 c = s & 0x0F;
if (colorMap) { if (colorMap) {
c = colorMap[s]; c = colorMap[s];
if (c == 0xff) { if (c == 0xFF) {
if (col < 0x10) { if (col < 0x10) {
*pal++ = s; *pal++ = s;
c = colorMap[s] = col++; c = colorMap[s] = col++;
@ -662,7 +662,7 @@ void Screen_EoB::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y,
pal = ovl ? ovl : src; pal = ovl ? ovl : src;
src += 16; src += 16;
} else { } else {
static const uint8 cgaDefOvl[] = { 0x00, 0x55, 0xaa, 0xff }; static const uint8 cgaDefOvl[] = { 0x00, 0x55, 0xAA, 0xFF };
pal = ovl ? ovl : cgaDefOvl; pal = ovl ? ovl : cgaDefOvl;
for (int i = 0; i < 4; i++) for (int i = 0; i < 4; i++)
cgaPal[i] = pal[i] & 3; cgaPal[i] = pal[i] & 3;
@ -817,7 +817,7 @@ const uint8 *Screen_EoB::scaleShapeStep(const uint8 *shp) {
else else
i = -i; i = -i;
_dsScaleTrans = (i << 4) | (i & 0x0f); _dsScaleTrans = (i << 4) | (i & 0x0F);
for (int ii = 0; ii < 16; ii++) for (int ii = 0; ii < 16; ii++)
*d++ = *shp++; *d++ = *shp++;
} }
@ -1193,14 +1193,14 @@ void Screen_EoB::createFadeTable(uint8 *palData, uint8 *dst, uint8 rootColor, ui
for (uint8 i = 1; i; i++) { for (uint8 i = 1; i; i++) {
uint16 tmp = (uint16)((*src - r) * weight) << 1; uint16 tmp = (uint16)((*src - r) * weight) << 1;
tr = *src++ - ((tmp >> 8) & 0xff); tr = *src++ - ((tmp >> 8) & 0xFF);
tmp = (uint16)((*src - g) * weight) << 1; tmp = (uint16)((*src - g) * weight) << 1;
tg = *src++ - ((tmp >> 8) & 0xff); tg = *src++ - ((tmp >> 8) & 0xFF);
tmp = (uint16)((*src - b) * weight) << 1; tmp = (uint16)((*src - b) * weight) << 1;
tb = *src++ - ((tmp >> 8) & 0xff); tb = *src++ - ((tmp >> 8) & 0xFF);
uint8 *d = palData + 3; uint8 *d = palData + 3;
uint16 v = 0xffff; uint16 v = 0xFFFF;
uint8 col = rootColor; uint8 col = rootColor;
for (uint8 ii = 1; ii; ii++) { for (uint8 ii = 1; ii; ii++) {
@ -1261,7 +1261,7 @@ void Screen_EoB::ditherRect(const uint8 *src, uint8 *dst, int dstPitch, int srcW
if (in != colorKey) { if (in != colorKey) {
in = _egaDitheringTable[in]; in = _egaDitheringTable[in];
*dst++ = *dst2++ = in >> 4; *dst++ = *dst2++ = in >> 4;
*dst++ = *dst2++ = in & 0x0f; *dst++ = *dst2++ = in & 0x0F;
} else { } else {
dst[0] = dst[1] = dst2[0] = dst2[1] = colorKey; dst[0] = dst[1] = dst2[0] = dst2[1] = colorKey;
dst += 2; dst += 2;
@ -1297,9 +1297,9 @@ void Screen_EoB::drawShapeSetPixel(uint8 *dst, uint8 col) {
void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc) { void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc, uint32 transOffsetDst, uint32 transOffsetSrc) {
for (int i = 0; i < _dsDiv; i++) { for (int i = 0; i < _dsDiv; i++) {
shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6); shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6);
shpDst[1] = ((shpSrc[1] & 0x0f) << 4) | ((shpSrc[2] >> 2) & 0x0f); shpDst[1] = ((shpSrc[1] & 0x0F) << 4) | ((shpSrc[2] >> 2) & 0x0F);
shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6); shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6);
shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x0f) << 4) | ((shpSrc[transOffsetSrc + 2] >> 2) & 0x0f); shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x0F) << 4) | ((shpSrc[transOffsetSrc + 2] >> 2) & 0x0F);
shpSrc += 3; shpSrc += 3;
shpDst += 2; shpDst += 2;
} }
@ -1308,15 +1308,15 @@ void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc,
shpDst[0] = _cgaScaleTable[shpSrc[0]] << 2; shpDst[0] = _cgaScaleTable[shpSrc[0]] << 2;
shpDst[1] = 0; shpDst[1] = 0;
shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | 3; shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | 3;
shpDst[transOffsetDst + 1] = 0xff; shpDst[transOffsetDst + 1] = 0xFF;
shpSrc++; shpSrc++;
shpDst += 2; shpDst += 2;
} else if (_dsRem == 2) { } else if (_dsRem == 2) {
shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6); shpDst[0] = (_cgaScaleTable[shpSrc[0]] << 2) | (shpSrc[1] >> 6);
shpDst[1] = (shpSrc[1] & 0x3f) << 2; shpDst[1] = (shpSrc[1] & 0x3F) << 2;
shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6); shpDst[transOffsetDst] = (_cgaScaleTable[shpSrc[transOffsetSrc]] << 2) | (shpSrc[transOffsetSrc + 1] >> 6);
shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x3f) << 2) | 3; shpDst[transOffsetDst + 1] = ((shpSrc[transOffsetSrc + 1] & 0x3F) << 2) | 3;
shpSrc += 2; shpSrc += 2;
shpDst += 2; shpDst += 2;
} }
@ -1325,7 +1325,7 @@ void Screen_EoB::scaleShapeProcessLine2Bit(uint8 *&shpDst, const uint8 *&shpSrc,
void Screen_EoB::scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src) { void Screen_EoB::scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src) {
for (int i = 0; i < _dsDiv; i++) { for (int i = 0; i < _dsDiv; i++) {
*dst++ = *src++; *dst++ = *src++;
*dst++ = (READ_BE_UINT16(src) >> 4) & 0xff; *dst++ = (READ_BE_UINT16(src) >> 4) & 0xFF;
src += 2; src += 2;
} }
@ -1333,7 +1333,7 @@ void Screen_EoB::scaleShapeProcessLine4Bit(uint8 *&dst, const uint8 *&src) {
*dst++ = *src++; *dst++ = *src++;
*dst++ = _dsScaleTrans; *dst++ = _dsScaleTrans;
} else if (_dsRem == 2) { } else if (_dsRem == 2) {
*dst++ = (src[0] & 0xf0) | (src[1] >> 4); *dst++ = (src[0] & 0xF0) | (src[1] >> 4);
src += 2; src += 2;
*dst++ = _dsScaleTrans; *dst++ = _dsScaleTrans;
*dst++ = _dsScaleTrans; *dst++ = _dsScaleTrans;
@ -1362,7 +1362,7 @@ void Screen_EoB::generateEGADitheringTable(const Palette &pal) {
for (int ii = 256; ii; ii--) { for (int ii = 256; ii; ii--) {
const uint8 *palEntry = _egaMatchTable + (ii - 1) * 3; const uint8 *palEntry = _egaMatchTable + (ii - 1) * 3;
if (*palEntry == 0xff) if (*palEntry == 0xFF)
continue; continue;
int e_r = palEntry[0] - r; int e_r = palEntry[0] - r;
@ -1382,8 +1382,8 @@ void Screen_EoB::generateEGADitheringTable(const Palette &pal) {
void Screen_EoB::generateCGADitheringTables(const uint8 *mappingData) { void Screen_EoB::generateCGADitheringTables(const uint8 *mappingData) {
for (int i = 0; i < 256; i++) { for (int i = 0; i < 256; i++) {
_cgaDitheringTables[0][i] = (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0f]; _cgaDitheringTables[0][i] = (mappingData[(i >> 4) + 16] << 8) | mappingData[i & 0x0F];
_cgaDitheringTables[1][i] = (mappingData[i >> 4] << 8) | mappingData[(i & 0x0f) + 16]; _cgaDitheringTables[1][i] = (mappingData[i >> 4] << 8) | mappingData[(i & 0x0F) + 16];
} }
} }
@ -1509,42 +1509,42 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
if (_width == 6) { if (_width == 6) {
switch (c) { switch (c) {
case 0x81: case 0x81:
case 0x9a: case 0x9A:
c = 0x5d; c = 0x5D;
break; break;
case 0x84: case 0x84:
case 0x8e: case 0x8E:
c = 0x5b; c = 0x5B;
break; break;
case 0x94: case 0x94:
case 0x99: case 0x99:
c = 0x40; c = 0x40;
case 0xe1: case 0xE1:
// TODO: recheck this: no conversion for 'ß' ? // TODO: recheck this: no conversion for 'ß' ?
break; break;
} }
} else if (_width == 8) { } else if (_width == 8) {
switch (c) { switch (c) {
case 0x81: case 0x81:
case 0x9a: case 0x9A:
case 0x5d: case 0x5D:
c = 0x1d; c = 0x1D;
break; break;
case 0x84: case 0x84:
case 0x5b: case 0x5B:
c = 0x1e; c = 0x1E;
break; break;
case 0x94: case 0x94:
case 0x40: case 0x40:
c = 0x1f; c = 0x1F;
break; break;
case 0x8e: case 0x8E:
c = 0x1b; c = 0x1B;
break; break;
case 0x99: case 0x99:
c = 0x1c; c = 0x1C;
break; break;
case 0xe1: case 0xE1:
c = 0x19; c = 0x19;
break; break;
} }
@ -1564,8 +1564,8 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint16 cgaMask2 = cgaColorMask[color2 & 3]; uint16 cgaMask2 = cgaColorMask[color2 & 3];
if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA) { if (_renderMode == Common::kRenderCGA || _renderMode == Common::kRenderEGA) {
color1 &= 0x0f; color1 &= 0x0F;
color2 &= 0x0f; color2 &= 0x0F;
} }
int cH = _height; int cH = _height;
@ -1596,7 +1596,7 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
uint8 sh = 6; uint8 sh = 6;
for (int i = 0; i < _width; i++) { for (int i = 0; i < _width; i++) {
cDst |= ((dst[i] & 3) << sh); cDst |= ((dst[i] & 3) << sh);
sh = (sh - 2) & 0x0f; sh = (sh - 2) & 0x0F;
} }
uint16 out = (~(cmp1 | cmp2) & cDst) | (cmp1 & cgaMask1) | (cmp2 & cgaMask2); uint16 out = (~(cmp1 | cmp2) & cDst) | (cmp1 & cgaMask1) | (cmp2 & cgaMask2);
@ -1604,7 +1604,7 @@ void OldDOSFont::drawChar(uint16 c, byte *dst, int pitch) const {
sh = 6; sh = 6;
for (int i = 0; i < _width; i++) { for (int i = 0; i < _width; i++) {
*dst++ = (out >> sh) & 3; *dst++ = (out >> sh) & 3;
sh = (sh - 2) & 0x0f; sh = (sh - 2) & 0x0F;
} }
last = s; last = s;

View file

@ -34,16 +34,16 @@ void Screen_HoF::generateGrayOverlay(const Palette &srcPal, uint8 *grayOverlay,
for (int i = 0; i != lastColor; i++) { for (int i = 0; i != lastColor; i++) {
if (flag) { if (flag) {
int v = ((((srcPal[3 * i] & 0x3f) + (srcPal[3 * i + 1] & 0x3f) int v = ((((srcPal[3 * i] & 0x3F) + (srcPal[3 * i + 1] & 0x3F)
+ (srcPal[3 * i + 2] & 0x3f)) / 3) * factor) / 0x40; + (srcPal[3 * i + 2] & 0x3F)) / 3) * factor) / 0x40;
tmpPal[3 * i] = tmpPal[3 * i + 1] = tmpPal[3 * i + 2] = v & 0xff; tmpPal[3 * i] = tmpPal[3 * i + 1] = tmpPal[3 * i + 2] = v & 0xFF;
} else { } else {
int v = (((srcPal[3 * i] & 0x3f) * factor) / 0x40) + addR; int v = (((srcPal[3 * i] & 0x3F) * factor) / 0x40) + addR;
tmpPal[3 * i] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i] = (v > 0x3F) ? 0x3F : v & 0xFF;
v = (((srcPal[3 * i + 1] & 0x3f) * factor) / 0x40) + addG; v = (((srcPal[3 * i + 1] & 0x3F) * factor) / 0x40) + addG;
tmpPal[3 * i + 1] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i + 1] = (v > 0x3F) ? 0x3F : v & 0xFF;
v = (((srcPal[3 * i + 2] & 0x3f) * factor) / 0x40) + addB; v = (((srcPal[3 * i + 2] & 0x3F) * factor) / 0x40) + addB;
tmpPal[3 * i + 2] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i + 2] = (v > 0x3F) ? 0x3F : v & 0xFF;
} }
} }

View file

@ -133,12 +133,12 @@ void Screen_LoL::generateGrayOverlay(const Palette &srcPal, uint8 *grayOverlay,
Palette tmpPal(lastColor); Palette tmpPal(lastColor);
for (int i = 0; i != lastColor; i++) { for (int i = 0; i != lastColor; i++) {
int v = (((srcPal[3 * i] & 0x3f) * factor) / 0x40) + addR; int v = (((srcPal[3 * i] & 0x3F) * factor) / 0x40) + addR;
tmpPal[3 * i] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i] = (v > 0x3F) ? 0x3F : v & 0xFF;
v = (((srcPal[3 * i + 1] & 0x3f) * factor) / 0x40) + addG; v = (((srcPal[3 * i + 1] & 0x3F) * factor) / 0x40) + addG;
tmpPal[3 * i + 1] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i + 1] = (v > 0x3F) ? 0x3F : v & 0xFF;
v = (((srcPal[3 * i + 2] & 0x3f) * factor) / 0x40) + addB; v = (((srcPal[3 * i + 2] & 0x3F) * factor) / 0x40) + addB;
tmpPal[3 * i + 2] = (v > 0x3f) ? 0x3f : v & 0xff; tmpPal[3 * i + 2] = (v > 0x3F) ? 0x3F : v & 0xFF;
} }
for (int i = 0; i < lastColor; i++) for (int i = 0; i < lastColor; i++)
@ -149,7 +149,7 @@ void Screen_LoL::createTransparencyTablesIntern(const uint8 *ovl, int a, const u
Palette screenPal(256); Palette screenPal(256);
screenPal.copy(fxPal2, 0, 256); screenPal.copy(fxPal2, 0, 256);
memset(outTable1, 0xff, 256); memset(outTable1, 0xFF, 256);
for (int i = 0; i < a; i++) for (int i = 0; i < a; i++)
outTable1[ovl[i]] = i; outTable1[ovl[i]] = i;
@ -268,7 +268,7 @@ void Screen_LoL::fadeClearSceneWindow(int delay) {
void Screen_LoL::backupSceneWindow(int srcPageNum, int dstPageNum) { void Screen_LoL::backupSceneWindow(int srcPageNum, int dstPageNum) {
uint8 *src = getPagePtr(srcPageNum) + 112; uint8 *src = getPagePtr(srcPageNum) + 112;
uint8 *dst = getPagePtr(dstPageNum) + 0xa500; uint8 *dst = getPagePtr(dstPageNum) + 0xA500;
for (int h = 0; h < 120; h++) { for (int h = 0; h < 120; h++) {
for (int w = 0; w < 176; w++) for (int w = 0; w < 176; w++)
@ -278,7 +278,7 @@ void Screen_LoL::backupSceneWindow(int srcPageNum, int dstPageNum) {
} }
void Screen_LoL::restoreSceneWindow(int srcPageNum, int dstPageNum) { void Screen_LoL::restoreSceneWindow(int srcPageNum, int dstPageNum) {
uint8 *src = getPagePtr(srcPageNum) + 0xa500; uint8 *src = getPagePtr(srcPageNum) + 0xA500;
uint8 *dst = getPagePtr(dstPageNum) + 112; uint8 *dst = getPagePtr(dstPageNum) + 112;
for (int h = 0; h < 120; h++) { for (int h = 0; h < 120; h++) {
@ -292,7 +292,7 @@ void Screen_LoL::restoreSceneWindow(int srcPageNum, int dstPageNum) {
} }
void Screen_LoL::clearGuiShapeMemory(int pageNum) { void Screen_LoL::clearGuiShapeMemory(int pageNum) {
uint8 *dst = getPagePtr(pageNum) + 0x79b0; uint8 *dst = getPagePtr(pageNum) + 0x79B0;
for (int i = 0; i < 23; i++) { for (int i = 0; i < 23; i++) {
memset(dst, 0, 176); memset(dst, 0, 176);
dst += 320; dst += 320;
@ -300,7 +300,7 @@ void Screen_LoL::clearGuiShapeMemory(int pageNum) {
} }
void Screen_LoL::copyGuiShapeFromSceneBackupBuffer(int srcPageNum, int dstPageNum) { void Screen_LoL::copyGuiShapeFromSceneBackupBuffer(int srcPageNum, int dstPageNum) {
uint8 *src = getPagePtr(srcPageNum) + 0x79c3; uint8 *src = getPagePtr(srcPageNum) + 0x79C3;
uint8 *dst = getPagePtr(dstPageNum); uint8 *dst = getPagePtr(dstPageNum);
for (int i = 0; i < 23; i++) { for (int i = 0; i < 23; i++) {
@ -323,7 +323,7 @@ void Screen_LoL::copyGuiShapeFromSceneBackupBuffer(int srcPageNum, int dstPageN
void Screen_LoL::copyGuiShapeToSurface(int srcPageNum, int dstPageNum) { void Screen_LoL::copyGuiShapeToSurface(int srcPageNum, int dstPageNum) {
uint8 *src = getPagePtr(srcPageNum); uint8 *src = getPagePtr(srcPageNum);
uint8 *dst = getPagePtr(dstPageNum) + 0xe7c3; uint8 *dst = getPagePtr(dstPageNum) + 0xE7C3;
for (int i = 0; i < 23; i++) { for (int i = 0; i < 23; i++) {
uint8 v = *src++; uint8 v = *src++;
@ -342,8 +342,8 @@ void Screen_LoL::copyGuiShapeToSurface(int srcPageNum, int dstPageNum) {
} }
void Screen_LoL::smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x, int y) { void Screen_LoL::smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x, int y) {
uint8 *src = getPagePtr(srcPageNum) + 0xa500 + y * 176 + x; uint8 *src = getPagePtr(srcPageNum) + 0xA500 + y * 176 + x;
uint8 *dst = getPagePtr(dstPageNum) + 0xa500; uint8 *dst = getPagePtr(dstPageNum) + 0xA500;
x <<= 1; x <<= 1;
uint16 width = 176 - x; uint16 width = 176 - x;
@ -363,7 +363,7 @@ void Screen_LoL::smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x,
do { do {
scaleXc += scaleX; scaleXc += scaleX;
int numbytes = cntW + (scaleXc >> 16); int numbytes = cntW + (scaleXc >> 16);
scaleXc &= 0xffff; scaleXc &= 0xFFFF;
memset(dst, *src++, numbytes); memset(dst, *src++, numbytes);
dst += numbytes; dst += numbytes;
} while (--widthCnt); } while (--widthCnt);
@ -385,8 +385,8 @@ void Screen_LoL::smoothScrollZoomStepTop(int srcPageNum, int dstPageNum, int x,
} }
void Screen_LoL::smoothScrollZoomStepBottom(int srcPageNum, int dstPageNum, int x, int y) { void Screen_LoL::smoothScrollZoomStepBottom(int srcPageNum, int dstPageNum, int x, int y) {
uint8 *src = getPagePtr(srcPageNum) + 0xc4a0 + x; uint8 *src = getPagePtr(srcPageNum) + 0xC4A0 + x;
uint8 *dst = getPagePtr(dstPageNum) + 0xc4a0; uint8 *dst = getPagePtr(dstPageNum) + 0xC4A0;
x <<= 1; x <<= 1;
uint16 width = 176 - x; uint16 width = 176 - x;
@ -406,7 +406,7 @@ void Screen_LoL::smoothScrollZoomStepBottom(int srcPageNum, int dstPageNum, int
do { do {
scaleXc += scaleX; scaleXc += scaleX;
int numbytes = cntW + (scaleXc >> 16); int numbytes = cntW + (scaleXc >> 16);
scaleXc &= 0xffff; scaleXc &= 0xFFFF;
memset(dst, *src++, numbytes); memset(dst, *src++, numbytes);
dst += numbytes; dst += numbytes;
} while (--widthCnt); } while (--widthCnt);
@ -453,7 +453,7 @@ void Screen_LoL::smoothScrollHorizontalStep(int pageNum, int srcX, int dstX, int
void Screen_LoL::smoothScrollTurnStep1(int srcPage1Num, int srcPage2Num, int dstPageNum) { void Screen_LoL::smoothScrollTurnStep1(int srcPage1Num, int srcPage2Num, int dstPageNum) {
uint8 *s = getPagePtr(srcPage1Num) + 273; uint8 *s = getPagePtr(srcPage1Num) + 273;
uint8 *d = getPagePtr(dstPageNum) + 0xa500; uint8 *d = getPagePtr(dstPageNum) + 0xA500;
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++) {
uint8 a = *s++; uint8 a = *s++;
@ -472,7 +472,7 @@ void Screen_LoL::smoothScrollTurnStep1(int srcPage1Num, int srcPage2Num, int dst
} }
s = getPagePtr(srcPage2Num) + 112; s = getPagePtr(srcPage2Num) + 112;
d = getPagePtr(dstPageNum) + 0xa52c; d = getPagePtr(dstPageNum) + 0xA52C;
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++) {
for (int ii = 0; ii < 33; ii++) { for (int ii = 0; ii < 33; ii++) {
@ -490,7 +490,7 @@ void Screen_LoL::smoothScrollTurnStep1(int srcPage1Num, int srcPage2Num, int dst
void Screen_LoL::smoothScrollTurnStep2(int srcPage1Num, int srcPage2Num, int dstPageNum) { void Screen_LoL::smoothScrollTurnStep2(int srcPage1Num, int srcPage2Num, int dstPageNum) {
uint8 *s = getPagePtr(srcPage1Num) + 244; uint8 *s = getPagePtr(srcPage1Num) + 244;
uint8 *d = getPagePtr(dstPageNum) + 0xa500; uint8 *d = getPagePtr(dstPageNum) + 0xA500;
for (int k = 0; k < 2; k++) { for (int k = 0; k < 2; k++) {
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++) {
@ -505,13 +505,13 @@ void Screen_LoL::smoothScrollTurnStep2(int srcPage1Num, int srcPage2Num, int dst
} }
s = getPagePtr(srcPage2Num) + 112; s = getPagePtr(srcPage2Num) + 112;
d = getPagePtr(dstPageNum) + 0xa558; d = getPagePtr(dstPageNum) + 0xA558;
} }
} }
void Screen_LoL::smoothScrollTurnStep3(int srcPage1Num, int srcPage2Num, int dstPageNum) { void Screen_LoL::smoothScrollTurnStep3(int srcPage1Num, int srcPage2Num, int dstPageNum) {
uint8 *s = getPagePtr(srcPage1Num) + 189; uint8 *s = getPagePtr(srcPage1Num) + 189;
uint8 *d = getPagePtr(dstPageNum) + 0xa500; uint8 *d = getPagePtr(dstPageNum) + 0xA500;
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++) {
for (int ii = 0; ii < 33; ii++) { for (int ii = 0; ii < 33; ii++) {
@ -527,7 +527,7 @@ void Screen_LoL::smoothScrollTurnStep3(int srcPage1Num, int srcPage2Num, int dst
} }
s = getPagePtr(srcPage2Num) + 112; s = getPagePtr(srcPage2Num) + 112;
d = getPagePtr(dstPageNum) + 0xa584; d = getPagePtr(dstPageNum) + 0xA584;
for (int i = 0; i < 120; i++) { for (int i = 0; i < 120; i++) {
for (int ii = 0; ii < 14; ii++) { for (int ii = 0; ii < 14; ii++) {
@ -781,8 +781,8 @@ bool Screen_LoL::fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedT
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
if (elapsedTicks < totalTicks) { if (elapsedTicks < totalTicks) {
srcV = *src & 0x3f; srcV = *src & 0x3F;
dstV = *dst & 0x3f; dstV = *dst & 0x3F;
outV = srcV - dstV; outV = srcV - dstV;
if (outV) if (outV)
@ -794,7 +794,7 @@ bool Screen_LoL::fadeColor(int dstColorIndex, int srcColorIndex, uint32 elapsedT
res = false; res = false;
} }
tmpPalEntry[i] = outV & 0xff; tmpPalEntry[i] = outV & 0xFF;
src++; src++;
dst++; dst++;
p++; p++;

View file

@ -117,11 +117,11 @@ void Screen_v2::applyOverlay(int x, int y, int w, int h, int pageNum, const uint
} }
int Screen_v2::findLeastDifferentColor(const uint8 *paletteEntry, const Palette &pal, uint8 firstColor, uint16 numColors, bool skipSpecialColors) { int Screen_v2::findLeastDifferentColor(const uint8 *paletteEntry, const Palette &pal, uint8 firstColor, uint16 numColors, bool skipSpecialColors) {
int m = 0x7fff; int m = 0x7FFF;
int r = 0x101; int r = 0x101;
for (int i = 0; i < numColors; i++) { for (int i = 0; i < numColors; i++) {
if (skipSpecialColors && i >= 0xc0 && i <= 0xc3) if (skipSpecialColors && i >= 0xC0 && i <= 0xC3)
continue; continue;
int v = paletteEntry[0] - pal[(i + firstColor) * 3 + 0]; int v = paletteEntry[0] - pal[(i + firstColor) * 3 + 0];
@ -170,14 +170,14 @@ bool Screen_v2::timedPaletteFadeStep(uint8 *pal1, uint8 *pal2, uint32 elapsedTim
uint8 out = 0; uint8 out = 0;
if (elapsedTime < totalTime) { if (elapsedTime < totalTime) {
int32 d = ((pal2[i] & 0x3f) - (pal1[i] & 0x3f)); int32 d = ((pal2[i] & 0x3F) - (pal1[i] & 0x3F));
if (d) if (d)
res = true; res = true;
int32 val = ((((d << 8) / (int32)totalTime) * (int32)elapsedTime) >> 8); int32 val = ((((d << 8) / (int32)totalTime) * (int32)elapsedTime) >> 8);
out = ((pal1[i] & 0x3f) + (int8)val); out = ((pal1[i] & 0x3F) + (int8)val);
} else { } else {
out = p1[i] = (pal2[i] & 0x3f); out = p1[i] = (pal2[i] & 0x3F);
res = false; res = false;
} }
@ -311,13 +311,13 @@ void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
if (w1 == 1) { if (w1 == 1) {
memset(dt, *s, w2); memset(dt, *s, w2);
} else { } else {
t = ((((((w2 - w1 + 1) & 0xffff) << 8) / w1) + 0x100) & 0xffff) << 8; t = ((((((w2 - w1 + 1) & 0xFFFF) << 8) / w1) + 0x100) & 0xFFFF) << 8;
int bp = 0; int bp = 0;
for (int i = 0; i < w1; i++) { for (int i = 0; i < w1; i++) {
int cnt = (t >> 16); int cnt = (t >> 16);
bp += (t & 0xffff); bp += (t & 0xFFFF);
if (bp > 0xffff) { if (bp > 0xFFFF) {
bp -= 0xffff; bp -= 0xFFFF;
cnt++; cnt++;
} }
memset(dt, *s++, cnt); memset(dt, *s++, cnt);
@ -328,13 +328,13 @@ void Screen_v2::wsaFrameAnimationStep(int x1, int y1, int x2, int y2,
if (w2 == 1) { if (w2 == 1) {
*dt = *s; *dt = *s;
} else { } else {
t = (((((w1 - w2) & 0xffff) << 8) / w2) & 0xffff) << 8; t = (((((w1 - w2) & 0xFFFF) << 8) / w2) & 0xFFFF) << 8;
int bp = 0; int bp = 0;
for (int i = 0; i < w2; i++) { for (int i = 0; i < w2; i++) {
*dt++ = *s++; *dt++ = *s++;
bp += (t & 0xffff); bp += (t & 0xFFFF);
if (bp > 0xffff) { if (bp > 0xFFFF) {
bp -= 0xffff; bp -= 0xFFFF;
s++; s++;
} }
s += (t >> 16); s += (t >> 16);

View file

@ -175,7 +175,7 @@ void EoBInfProcessor::run(int func, int flags) {
uint16 f = _vm->_levelBlockProperties[func].flags; uint16 f = _vm->_levelBlockProperties[func].flags;
uint16 subFlags = ((f & 0xfff8) >> 3) | 0xe0; uint16 subFlags = ((f & 0xFFF8) >> 3) | 0xE0;
if (!(flags & subFlags)) if (!(flags & subFlags))
return; return;
@ -233,7 +233,7 @@ void EoBInfProcessor::reset() {
} }
const char *EoBInfProcessor::getString(uint16 index) { const char *EoBInfProcessor::getString(uint16 index) {
if (index == 0xffff) if (index == 0xFFFF)
return 0; return 0;
int8 *res = _scriptData + READ_LE_UINT16(_scriptData); int8 *res = _scriptData + READ_LE_UINT16(_scriptData);
@ -348,7 +348,7 @@ int EoBInfProcessor::oeob_movePartyOrObject(int8 *data) {
int8 *pos = data; int8 *pos = data;
int8 a = *pos++; int8 a = *pos++;
uint16 b = 0xffff; uint16 b = 0xFFFF;
uint16 c = 0; uint16 c = 0;
uint16 d = 0; uint16 d = 0;
@ -972,7 +972,7 @@ int EoBInfProcessor::oeob_eval_v2(int8 *data) {
case 9: case 9:
switch (*pos++) { switch (*pos++) {
case -36: case -36:
_stack[_stackIndex++] = _vm->_itemTypes[_vm->_items[_vm->_lastUsedItem].type].extraProperties & 0x7f; _stack[_stackIndex++] = _vm->_itemTypes[_vm->_items[_vm->_lastUsedItem].type].extraProperties & 0x7F;
break; break;
case -31: case -31:
_stack[_stackIndex++] = _vm->_items[_vm->_lastUsedItem].type; _stack[_stackIndex++] = _vm->_items[_vm->_lastUsedItem].type;
@ -1097,7 +1097,7 @@ int EoBInfProcessor::oeob_eval_v2(int8 *data) {
case 26: case 26:
a = 0; a = 0;
for (i = 0; i < 6; i++) { for (i = 0; i < 6; i++) {
if (_vm->testCharacter(i, 0x0f)) if (_vm->testCharacter(i, 0x0F))
a++; a++;
} }
_stack[_stackIndex++] = a; _stack[_stackIndex++] = a;
@ -1260,7 +1260,7 @@ int EoBInfProcessor::oeob_loadNewLevelOrMonsters(int8 *data) {
pos += 2; pos += 2;
uint8 dir = (uint8)*pos++; uint8 dir = (uint8)*pos++;
if (dir != 0xff) if (dir != 0xFF)
_vm->_currentDirection = dir; _vm->_currentDirection = dir;
for (int i = 0; i < 30; i++) for (int i = 0; i < 30; i++)
@ -1328,11 +1328,11 @@ int EoBInfProcessor::oeob_createItem_v1(int8 *data) {
uint8 itmPos = *pos++; uint8 itmPos = *pos++;
if (itm) { if (itm) {
if (block == 0xffff && !_vm->_itemInHand) { if (block == 0xFFFF && !_vm->_itemInHand) {
_vm->setHandItem(itm); _vm->setHandItem(itm);
debugC(5, kDebugLevelScript, " - create hand item '%d'", itm); debugC(5, kDebugLevelScript, " - create hand item '%d'", itm);
} else if (block != 0xffff) { } else if (block != 0xFFFF) {
_vm->setItemPosition((Item *)&_vm->_levelBlockProperties[block & 0x3ff].drawObjects, block, itm, itmPos); _vm->setItemPosition((Item *)&_vm->_levelBlockProperties[block & 0x3FF].drawObjects, block, itm, itmPos);
debugC(5, kDebugLevelScript, " - create item '%d' on block '0x%.04X', position '%d'", itm, block, itmPos); debugC(5, kDebugLevelScript, " - create item '%d' on block '0x%.04X', position '%d'", itm, block, itmPos);
} }
} }
@ -1363,19 +1363,19 @@ int EoBInfProcessor::oeob_createItem_v2(int8 *data) {
if (!itm) if (!itm)
return pos - data; return pos - data;
if (block == 0xffff) { if (block == 0xFFFF) {
if (!_vm->_itemInHand) { if (!_vm->_itemInHand) {
_vm->setHandItem(itm); _vm->setHandItem(itm);
debugC(5, kDebugLevelScript, " - create hand item '%d' (value '%d', flags '0x%X', icon number '%d')", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon); debugC(5, kDebugLevelScript, " - create hand item '%d' (value '%d', flags '0x%X', icon number '%d')", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon);
} else { } else {
_vm->setItemPosition((Item *)&_vm->_levelBlockProperties[_vm->_currentBlock & 0x3ff].drawObjects, _vm->_currentBlock, itm, _itemPos[_vm->rollDice(1, 2, -1)]); _vm->setItemPosition((Item *)&_vm->_levelBlockProperties[_vm->_currentBlock & 0x3FF].drawObjects, _vm->_currentBlock, itm, _itemPos[_vm->rollDice(1, 2, -1)]);
debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on current block", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon); debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on current block", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon);
} }
} else if (block == 0xfffe) { } else if (block == 0xFFFE) {
_vm->setItemPosition((Item *)&_vm->_levelBlockProperties[_vm->_currentBlock & 0x3ff].drawObjects, _vm->_currentBlock, itm, _itemPos[(_vm->_currentDirection << 2) + _vm->rollDice(1, 2, -1)]); _vm->setItemPosition((Item *)&_vm->_levelBlockProperties[_vm->_currentBlock & 0x3FF].drawObjects, _vm->_currentBlock, itm, _itemPos[(_vm->_currentDirection << 2) + _vm->rollDice(1, 2, -1)]);
debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on current block", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon); debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on current block", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon);
} else { } else {
_vm->setItemPosition((Item *)&_vm->_levelBlockProperties[block & 0x3ff].drawObjects, block, itm, itmPos); _vm->setItemPosition((Item *)&_vm->_levelBlockProperties[block & 0x3FF].drawObjects, block, itm, itmPos);
debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on block '0x%.04X', position '%d'", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon, block, itmPos); debugC(5, kDebugLevelScript, " - create item '%d' (value '%d', flags '0x%X', icon number '%d') on block '0x%.04X', position '%d'", itm, _vm->_items[itm].value, _vm->_items[itm].flags, _vm->_items[itm].icon, block, itmPos);
} }
@ -1530,7 +1530,7 @@ int EoBInfProcessor::oeob_dialogue(int8 *data) {
break; break;
case -40: case -40:
_dlgResult = _vm->runDialogue(READ_LE_UINT16(pos), READ_LE_UINT16(pos + 6) == 0xffff ? 2 : 3, getString(READ_LE_UINT16(pos + 2)), getString(READ_LE_UINT16(pos + 4)), getString(READ_LE_UINT16(pos + 6))); _dlgResult = _vm->runDialogue(READ_LE_UINT16(pos), READ_LE_UINT16(pos + 6) == 0xFFFF ? 2 : 3, getString(READ_LE_UINT16(pos + 2)), getString(READ_LE_UINT16(pos + 4)), getString(READ_LE_UINT16(pos + 6)));
pos += 8; pos += 8;
break; break;

View file

@ -253,7 +253,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
uint16 currentFrame = stackPos(3); uint16 currentFrame = stackPos(3);
uint16 lastFrame = stackPos(4); uint16 lastFrame = stackPos(4);
uint16 index = stackPos(5); uint16 index = stackPos(5);
uint16 copyParam = stackPos(6) | 0xc000; uint16 copyParam = stackPos(6) | 0xC000;
_screen->hideMouse(); _screen->hideMouse();
@ -278,7 +278,7 @@ int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
const int frameDelay = stackPos(2) * _tickLength; const int frameDelay = stackPos(2) * _tickLength;
const int index = stackPos(3); const int index = stackPos(3);
const bool doUpdate = (stackPos(4) != 0); const bool doUpdate = (stackPos(4) != 0);
const uint16 copyParam = stackPos(5) | 0xc000; const uint16 copyParam = stackPos(5) | 0xC000;
_screen->hideMouse(); _screen->hideMouse();
@ -319,8 +319,8 @@ int KyraEngine_HoF::o2_drawShape(EMCState *script) {
uint8 *shp = getShapePtr(stackPos(0) + 64); uint8 *shp = getShapePtr(stackPos(0) + 64);
int x = stackPos(1); int x = stackPos(1);
int y = stackPos(2); int y = stackPos(2);
uint8 dsFlag = stackPos(3) & 0xff; uint8 dsFlag = stackPos(3) & 0xFF;
uint8 modeFlag = stackPos(4) & 0xff; uint8 modeFlag = stackPos(4) & 0xFF;
if (modeFlag) { if (modeFlag) {
_screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0); _screen->drawShape(2, shp, x, y, 2, dsFlag ? 1 : 0);
@ -918,7 +918,7 @@ int KyraEngine_HoF::o2_useItemOnMainChar(EMCState *script) {
tmpScript.regs[0] = _mainCharacter.sceneId; tmpScript.regs[0] = _mainCharacter.sceneId;
int oldVocH = _vocHigh; int oldVocH = _vocHigh;
_vocHigh = 0x5a; _vocHigh = 0x5A;
while (_emc->isValid(&tmpScript)) while (_emc->isValid(&tmpScript))
_emc->run(&tmpScript); _emc->run(&tmpScript);
@ -955,7 +955,7 @@ int KyraEngine_HoF::o2_pressColorKey(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0)); debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_pressColorKey(%p) (%d)", (const void *)script, stackPos(0));
for (int i = 6; i; i--) for (int i = 6; i; i--)
_inputColorCode[i] = _inputColorCode[i - 1]; _inputColorCode[i] = _inputColorCode[i - 1];
_inputColorCode[0] = stackPos(0) & 0xff; _inputColorCode[0] = stackPos(0) & 0xFF;
for (int i = 0; i < 7; i++) { for (int i = 0; i < 7; i++) {
if (_presetColorCode[i] != _inputColorCode[6 - i]) if (_presetColorCode[i] != _inputColorCode[6 - i])
return _dbgPass; return _dbgPass;
@ -1023,8 +1023,8 @@ int KyraEngine_HoF::o2_getColorCodeValue(EMCState *script) {
int KyraEngine_HoF::o2_setColorCodeValue(EMCState *script) { int KyraEngine_HoF::o2_setColorCodeValue(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); debugC(3, kDebugLevelScriptFuncs, "KyraEngine_HoF::o2_setColorCodeValue(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
_presetColorCode[stackPos(0)] = stackPos(1) & 0xff; _presetColorCode[stackPos(0)] = stackPos(1) & 0xFF;
return stackPos(1) & 0xff; return stackPos(1) & 0xFF;
} }
int KyraEngine_HoF::o2_countItemInstances(EMCState *script) { int KyraEngine_HoF::o2_countItemInstances(EMCState *script) {
@ -1495,7 +1495,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
OpcodeUnImpl(); OpcodeUnImpl();
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o2_setCharacterAnimFrame); Opcode(o2_setCharacterAnimFrame);
// 0x0c // 0x0C
Opcode(o2_setCharacterFacingOverwrite); Opcode(o2_setCharacterFacingOverwrite);
Opcode(o2_trySceneChange); Opcode(o2_trySceneChange);
Opcode(o2_moveCharacter); Opcode(o2_moveCharacter);
@ -1515,7 +1515,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_wsaOpen); Opcode(o2_wsaOpen);
Opcode(o2_displayWsaSequentialFrames); Opcode(o2_displayWsaSequentialFrames);
Opcode(o2_displayWsaSequence); Opcode(o2_displayWsaSequence);
// 0x1c // 0x1C
Opcode(o2_addItemToInventory); Opcode(o2_addItemToInventory);
Opcode(o2_drawShape); Opcode(o2_drawShape);
Opcode(o2_addItemToCurScene); Opcode(o2_addItemToCurScene);
@ -1536,7 +1536,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o1_setGameFlag); Opcode(o1_setGameFlag);
Opcode(o1_setHandItem); Opcode(o1_setHandItem);
Opcode(o1_removeHandItem); Opcode(o1_removeHandItem);
// 0x2c // 0x2C
Opcode(o1_getMouseState); Opcode(o1_getMouseState);
Opcode(o1_hideMouse); Opcode(o1_hideMouse);
Opcode(o2_addSpecialExit); Opcode(o2_addSpecialExit);
@ -1556,7 +1556,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_setTimerDelay); Opcode(o2_setTimerDelay);
Opcode(o2_setScaleTableItem); Opcode(o2_setScaleTableItem);
Opcode(o2_setDrawLayerTableItem); Opcode(o2_setDrawLayerTableItem);
// 0x3c // 0x3C
Opcode(o2_setCharPalEntry); Opcode(o2_setCharPalEntry);
Opcode(o2_loadZShapes); Opcode(o2_loadZShapes);
Opcode(o2_drawSceneShape); Opcode(o2_drawSceneShape);
@ -1576,7 +1576,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_restoreInventoryGfx); Opcode(o2_restoreInventoryGfx);
Opcode(o2_setSceneAnimPos2); Opcode(o2_setSceneAnimPos2);
Opcode(o2_update); Opcode(o2_update);
// 0x4c // 0x4C
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o2_fadeScenePal); Opcode(o2_fadeScenePal);
Opcode(o2_dummy); Opcode(o2_dummy);
@ -1596,7 +1596,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o1_playSoundEffect); Opcode(o1_playSoundEffect);
Opcode(o2_setSceneAnimPos); Opcode(o2_setSceneAnimPos);
Opcode(o1_blockInWalkableRegion); Opcode(o1_blockInWalkableRegion);
// 0x5c // 0x5C
Opcode(o1_blockOutWalkableRegion); Opcode(o1_blockOutWalkableRegion);
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o2_setCauldronState); Opcode(o2_setCauldronState);
@ -1616,7 +1616,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o2_playFireflyScore); Opcode(o2_playFireflyScore);
Opcode(o2_waitForConfirmationClick); Opcode(o2_waitForConfirmationClick);
// 0x6c // 0x6C
Opcode(o2_encodeShape); Opcode(o2_encodeShape);
Opcode(o2_defineRoomEntrance); Opcode(o2_defineRoomEntrance);
Opcode(o2_runAnimationScript); Opcode(o2_runAnimationScript);
@ -1636,7 +1636,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_defineScene); Opcode(o2_defineScene);
Opcode(o2_addCauldronStateTableEntry); Opcode(o2_addCauldronStateTableEntry);
Opcode(o2_setCountDown); Opcode(o2_setCountDown);
// 0x7c // 0x7C
Opcode(o2_getCountDown); Opcode(o2_getCountDown);
Opcode(o2_dummy); Opcode(o2_dummy);
Opcode(o2_dummy); Opcode(o2_dummy);
@ -1656,7 +1656,7 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_removeItemFromScene); Opcode(o2_removeItemFromScene);
Opcode(o2_initObject); Opcode(o2_initObject);
Opcode(o2_npcChat); Opcode(o2_npcChat);
// 0x8c // 0x8C
Opcode(o2_deinitObject); Opcode(o2_deinitObject);
Opcode(o2_playTimSequence); Opcode(o2_playTimSequence);
Opcode(o2_makeBookOrCauldronAppear); Opcode(o2_makeBookOrCauldronAppear);
@ -1676,27 +1676,27 @@ void KyraEngine_HoF::setupOpcodeTable() {
Opcode(o2_customChatFinish); Opcode(o2_customChatFinish);
Opcode(o2_setupSceneAnimation); Opcode(o2_setupSceneAnimation);
Opcode(o2_stopSceneAnimation); Opcode(o2_stopSceneAnimation);
// 0x9c // 0x9C
Opcode(o2_disableTimer); Opcode(o2_disableTimer);
Opcode(o2_enableTimer); Opcode(o2_enableTimer);
Opcode(o2_setTimerCountdown); Opcode(o2_setTimerCountdown);
Opcode(o2_processPaletteIndex); Opcode(o2_processPaletteIndex);
// 0xa0 // 0xA0
Opcode(o2_updateTwoSceneAnims); Opcode(o2_updateTwoSceneAnims);
Opcode(o2_getRainbowRoomData); Opcode(o2_getRainbowRoomData);
Opcode(o2_drawSceneShapeEx); Opcode(o2_drawSceneShapeEx);
Opcode(o2_midiSoundFadeout); Opcode(o2_midiSoundFadeout);
// 0xa4 // 0xA4
Opcode(o2_getSfxDriver); Opcode(o2_getSfxDriver);
Opcode(o2_getVocSupport); Opcode(o2_getVocSupport);
Opcode(o2_getMusicDriver); Opcode(o2_getMusicDriver);
Opcode(o2_setVocHigh); Opcode(o2_setVocHigh);
// 0xa8 // 0xA8
Opcode(o2_getVocHigh); Opcode(o2_getVocHigh);
Opcode(o2_zanthiaChat); Opcode(o2_zanthiaChat);
Opcode(o2_isVoiceEnabled); Opcode(o2_isVoiceEnabled);
Opcode(o2_isVoicePlaying); Opcode(o2_isVoicePlaying);
// 0xac // 0xAC
Opcode(o2_stopVoicePlaying); Opcode(o2_stopVoicePlaying);
Opcode(o2_getGameLanguage); Opcode(o2_getGameLanguage);
Opcode(o2_demoFinale); Opcode(o2_demoFinale);

View file

@ -1774,7 +1774,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_blockInWalkableRegion); Opcode(o1_blockInWalkableRegion);
Opcode(o1_blockOutWalkableRegion); Opcode(o1_blockOutWalkableRegion);
Opcode(o1_walkPlayerToPoint); Opcode(o1_walkPlayerToPoint);
// 0x0c // 0x0C
Opcode(o1_dropItemInScene); Opcode(o1_dropItemInScene);
Opcode(o1_drawAnimShapeIntoScene); Opcode(o1_drawAnimShapeIntoScene);
Opcode(o1_setHandItem); Opcode(o1_setHandItem);
@ -1794,7 +1794,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_phaseInSameScene); Opcode(o1_phaseInSameScene);
Opcode(o1_setScenePhasingFlag); Opcode(o1_setScenePhasingFlag);
Opcode(o1_resetScenePhasingFlag); Opcode(o1_resetScenePhasingFlag);
// 0x1c // 0x1C
Opcode(o1_queryScenePhasingFlag); Opcode(o1_queryScenePhasingFlag);
Opcode(o1_sceneToDirection); Opcode(o1_sceneToDirection);
Opcode(o1_setBirthstoneGem); Opcode(o1_setBirthstoneGem);
@ -1814,7 +1814,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_openWSAFile); Opcode(o1_openWSAFile);
Opcode(o1_closeWSAFile); Opcode(o1_closeWSAFile);
Opcode(o1_runWSAFromBeginningToEnd); Opcode(o1_runWSAFromBeginningToEnd);
// 0x2c // 0x2C
Opcode(o1_displayWSAFrame); Opcode(o1_displayWSAFrame);
Opcode(o1_enterNewScene); Opcode(o1_enterNewScene);
Opcode(o1_setSpecialEnterXAndY); Opcode(o1_setSpecialEnterXAndY);
@ -1834,7 +1834,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_getCharacterY); Opcode(o1_getCharacterY);
Opcode(o1_setCharacterFacing); Opcode(o1_setCharacterFacing);
Opcode(o1_copyWSARegion); Opcode(o1_copyWSARegion);
// 0x3c // 0x3C
Opcode(o1_printText); Opcode(o1_printText);
Opcode(o1_getRand); Opcode(o1_getRand);
Opcode(o1_loadSoundFile); Opcode(o1_loadSoundFile);
@ -1854,7 +1854,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_placeCharacterInOtherScene); Opcode(o1_placeCharacterInOtherScene);
Opcode(o1_getKey); Opcode(o1_getKey);
Opcode(o1_specificItemInInventory); Opcode(o1_specificItemInInventory);
// 0x4c // 0x4C
Opcode(o1_popMobileNPCIntoScene); Opcode(o1_popMobileNPCIntoScene);
Opcode(o1_mobileCharacterInScene); Opcode(o1_mobileCharacterInScene);
Opcode(o1_hideMobileCharacter); Opcode(o1_hideMobileCharacter);
@ -1874,7 +1874,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_setCharacterMovementDelay); Opcode(o1_setCharacterMovementDelay);
Opcode(o1_getCharacterFacing); Opcode(o1_getCharacterFacing);
Opcode(o1_bkgdScrollSceneAndMasksRight); Opcode(o1_bkgdScrollSceneAndMasksRight);
// 0x5c // 0x5C
Opcode(o1_dispelMagicAnimation); Opcode(o1_dispelMagicAnimation);
Opcode(o1_findBrightestFireberry); Opcode(o1_findBrightestFireberry);
Opcode(o1_setFireberryGlowPalette); Opcode(o1_setFireberryGlowPalette);
@ -1894,7 +1894,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_addItemToInventory); Opcode(o1_addItemToInventory);
Opcode(o1_intPrint); Opcode(o1_intPrint);
Opcode(o1_shakeScreen); Opcode(o1_shakeScreen);
// 0x6c // 0x6C
Opcode(o1_createAmuletJewel); Opcode(o1_createAmuletJewel);
Opcode(o1_setSceneAnimCurrXY); Opcode(o1_setSceneAnimCurrXY);
Opcode(o1_poisonBrandonAndRemaps); Opcode(o1_poisonBrandonAndRemaps);
@ -1914,7 +1914,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_setMousePos); Opcode(o1_setMousePos);
Opcode(o1_getMouseState); Opcode(o1_getMouseState);
Opcode(o1_setEntranceMouseCursorTrack); Opcode(o1_setEntranceMouseCursorTrack);
// 0x7c // 0x7C
Opcode(o1_itemAppearsOnGround); Opcode(o1_itemAppearsOnGround);
Opcode(o1_setNoDrawShapesFlag); Opcode(o1_setNoDrawShapesFlag);
Opcode(o1_fadeEntirePalette); Opcode(o1_fadeEntirePalette);
@ -1934,7 +1934,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_getScaleDepthTableValue); Opcode(o1_getScaleDepthTableValue);
Opcode(o1_setScaleDepthTableValue); Opcode(o1_setScaleDepthTableValue);
Opcode(o1_message); Opcode(o1_message);
// 0x8c // 0x8C
Opcode(o1_checkClickOnNPC); Opcode(o1_checkClickOnNPC);
Opcode(o1_getFoyerItem); Opcode(o1_getFoyerItem);
Opcode(o1_setFoyerItem); Opcode(o1_setFoyerItem);
@ -1954,7 +1954,7 @@ void KyraEngine_LoK::setupOpcodeTable() {
Opcode(o1_fillRect); Opcode(o1_fillRect);
Opcode(o1_vocUnload); Opcode(o1_vocUnload);
Opcode(o1_vocLoad); Opcode(o1_vocLoad);
// 0x9c // 0x9C
Opcode(o1_dummy); Opcode(o1_dummy);
} }
#undef Opcode #undef Opcode

View file

@ -126,7 +126,7 @@ int LoLEngine::olol_moveParty(EMCState *script) {
mode = (mode - 6 - _currentDirection) & 3; mode = (mode - 6 - _currentDirection) & 3;
Button b; Button b;
b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xfe; b.data0Val2 = b.data1Val2 = b.data2Val2 = 0xFE;
b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01; b.data0Val3 = b.data1Val3 = b.data2Val3 = 0x01;
switch (mode) { switch (mode) {
@ -268,7 +268,7 @@ int LoLEngine::olol_makeItem(EMCState *script) {
int LoLEngine::olol_placeMoveLevelItem(EMCState *script) { int LoLEngine::olol_placeMoveLevelItem(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_placeMoveLevelItem(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5)); debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_placeMoveLevelItem(%p) (%d, %d, %d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3), stackPos(4), stackPos(5));
placeMoveLevelItem(stackPos(0), stackPos(1), stackPos(2), stackPos(3) & 0xff, stackPos(4) & 0xff, stackPos(5)); placeMoveLevelItem(stackPos(0), stackPos(1), stackPos(2), stackPos(3) & 0xFF, stackPos(4) & 0xFF, stackPos(5));
return 1; return 1;
} }
@ -321,7 +321,7 @@ int LoLEngine::olol_getItemPara(EMCState *script) {
case 14: case 14:
return p->unkB; return p->unkB;
case 15: case 15:
return i->shpCurFrame_flg & 0x1fff; return i->shpCurFrame_flg & 0x1FFF;
case 16: case 16:
return p->flags; return p->flags;
case 17: case 17:
@ -397,7 +397,7 @@ int LoLEngine::olol_setCharacterStat(EMCState *script) {
break; break;
case 1: case 1:
c->raceClassSex = e & 0x0f; c->raceClassSex = e & 0x0F;
break; break;
case 5: case 5:
@ -478,19 +478,19 @@ int LoLEngine::olol_loadDoorShapes(EMCState *script) {
_wllWallFlags[i + 3] |= 7; _wllWallFlags[i + 3] |= 7;
int t = i % 5; int t = i % 5;
if (t == 4) if (t == 4)
_wllWallFlags[i + 3] &= 0xf8; _wllWallFlags[i + 3] &= 0xF8;
if (t == 3) if (t == 3)
_wllWallFlags[i + 3] &= 0xfd; _wllWallFlags[i + 3] &= 0xFD;
} }
if (stackPos(3)) { if (stackPos(3)) {
for (int i = 3; i < 13; i++) for (int i = 3; i < 13; i++)
_wllWallFlags[i] &= 0xfd; _wllWallFlags[i] &= 0xFD;
} }
if (stackPos(4)) { if (stackPos(4)) {
for (int i = 13; i < 23; i++) for (int i = 13; i < 23; i++)
_wllWallFlags[i] &= 0xfd; _wllWallFlags[i] &= 0xFD;
} }
return 1; return 1;
@ -683,7 +683,7 @@ int LoLEngine::olol_setGlobalVar(EMCState *script) {
break; break;
case 2: case 2:
_currentLevel = b & 0xff; _currentLevel = b & 0xFF;
break; break;
case 3: case 3:
@ -691,7 +691,7 @@ int LoLEngine::olol_setGlobalVar(EMCState *script) {
break; break;
case 4: case 4:
_brightness = b & 0xff; _brightness = b & 0xFF;
break; break;
case 5: case 5:
@ -717,20 +717,20 @@ int LoLEngine::olol_setGlobalVar(EMCState *script) {
break; break;
case 9: case 9:
_lampOilStatus = b & 0xff; _lampOilStatus = b & 0xFF;
break; break;
case 10: case 10:
_sceneDefaultUpdate = b & 0xff; _sceneDefaultUpdate = b & 0xFF;
gui_toggleButtonDisplayMode(0, 0); gui_toggleButtonDisplayMode(0, 0);
break; break;
case 11: case 11:
_compassBroken = a & 0xff; _compassBroken = a & 0xFF;
break; break;
case 12: case 12:
_drainMagic = a & 0xff; _drainMagic = a & 0xFF;
break; break;
default: default:
@ -763,9 +763,9 @@ int LoLEngine::olol_checkEquippedItemScriptFlags(EMCState *script) {
int LoLEngine::olol_setDoorState(EMCState *script) { int LoLEngine::olol_setDoorState(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_setDoorState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1)); debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_setDoorState(%p) (%d, %d)", (const void *)script, stackPos(0), stackPos(1));
if (stackPos(1)) if (stackPos(1))
_levelBlockProperties[stackPos(0)].flags = (_levelBlockProperties[stackPos(0)].flags & 0xef) | 0x20; _levelBlockProperties[stackPos(0)].flags = (_levelBlockProperties[stackPos(0)].flags & 0xEF) | 0x20;
else else
_levelBlockProperties[stackPos(0)].flags &= 0xdf; _levelBlockProperties[stackPos(0)].flags &= 0xDF;
return 1; return 1;
} }
@ -784,7 +784,7 @@ int LoLEngine::olol_assignLevelDecorationShape(EMCState *script) {
int LoLEngine::olol_resetBlockShapeAssignment(EMCState *script) { int LoLEngine::olol_resetBlockShapeAssignment(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_resetBlockShapeAssignment(%p) (%d)", (const void *)script, stackPos(0)); debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_resetBlockShapeAssignment(%p) (%d)", (const void *)script, stackPos(0));
uint8 v = stackPos(0) & 0xff; uint8 v = stackPos(0) & 0xFF;
memset(_wllShapeMap + 3, v, 5); memset(_wllShapeMap + 3, v, 5);
memset(_wllShapeMap + 13, v, 5); memset(_wllShapeMap + 13, v, 5);
return 1; return 1;
@ -842,7 +842,7 @@ int LoLEngine::olol_initMonster(EMCState *script) {
l->destDirection = l->direction; l->destDirection = l->direction;
for (int ii = 0; ii < 4; ii++) for (int ii = 0; ii < 4; ii++)
l->equipmentShapes[ii] = stackPos(7 + ii) & 0xff; l->equipmentShapes[ii] = stackPos(7 + ii) & 0xFF;
checkSceneUpdateNeed(l->block); checkSceneUpdateNeed(l->block);
return i; return i;
@ -927,7 +927,7 @@ int LoLEngine::olol_loadMonsterProperties(EMCState *script) {
stackPos(35), stackPos(36), stackPos(37), stackPos(38), stackPos(39), stackPos(40), stackPos(41)); stackPos(35), stackPos(36), stackPos(37), stackPos(38), stackPos(39), stackPos(40), stackPos(41));
LoLMonsterProperty *l = &_monsterProperties[stackPos(0)]; LoLMonsterProperty *l = &_monsterProperties[stackPos(0)];
l->shapeIndex = stackPos(1) & 0xff; l->shapeIndex = stackPos(1) & 0xFF;
int shpWidthMax = 0; int shpWidthMax = 0;
@ -1079,7 +1079,7 @@ int LoLEngine::olol_addRemoveCharacter(EMCState *script) {
if (!(_characters[i].flags & 1) || _characters[i].id != id) if (!(_characters[i].flags & 1) || _characters[i].id != id)
continue; continue;
_characters[i].flags &= 0xfffe; _characters[i].flags &= 0xFFFE;
calcCharPortraitXpos(); calcCharPortraitXpos();
if (_selectedCharacter == i) if (_selectedCharacter == i)
@ -1192,7 +1192,7 @@ int LoLEngine::olol_changeMonsterStat(EMCState *script) {
if (stackPos(0) == -1) if (stackPos(0) == -1)
return 1; return 1;
LoLMonster *m = &_monsters[stackPos(0) & 0x7fff]; LoLMonster *m = &_monsters[stackPos(0) & 0x7FFF];
int16 d = stackPos(2); int16 d = stackPos(2);
uint16 x = 0; uint16 x = 0;
@ -1208,7 +1208,7 @@ int LoLEngine::olol_changeMonsterStat(EMCState *script) {
break; break;
case 2: case 2:
calcCoordinates(x, y, d, m->x & 0xff, m->y & 0xff); calcCoordinates(x, y, d, m->x & 0xFF, m->y & 0xFF);
if (!walkMonsterCheckDest(x, y, m, 7)) if (!walkMonsterCheckDest(x, y, m, 7))
placeMonster(m, x, y); placeMonster(m, x, y);
break; break;
@ -1233,7 +1233,7 @@ int LoLEngine::olol_getMonsterStat(EMCState *script) {
if (stackPos(0) == -1) if (stackPos(0) == -1)
return 0; return 0;
LoLMonster *m = &_monsters[stackPos(0) & 0x7fff]; LoLMonster *m = &_monsters[stackPos(0) & 0x7FFF];
int d = stackPos(1); int d = stackPos(1);
switch (d) { switch (d) {
@ -1318,8 +1318,8 @@ int LoLEngine::olol_drawExitButton(EMCState *script) {
int w = _screen->getTextWidth(str); int w = _screen->getTextWidth(str);
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
gui_drawBox(x - offs - w, y - 9, w + offs, 9, 0xee, 0xcc, 0x11); gui_drawBox(x - offs - w, y - 9, w + offs, 9, 0xEE, 0xCC, 0x11);
_screen->printText(str, x - (offs >> 1) - w, y - 7, 0xbb, 0); _screen->printText(str, x - (offs >> 1) - w, y - 7, 0xBB, 0);
} else { } else {
gui_drawBox(x - offs - w, y - 9, w + offs, 9, 136, 251, 252); gui_drawBox(x - offs - w, y - 9, w + offs, 9, 136, 251, 252);
_screen->printText(str, x - (offs >> 1) - w, y - 7, 144, 0); _screen->printText(str, x - (offs >> 1) - w, y - 7, 144, 0);
@ -1497,7 +1497,7 @@ int LoLEngine::olol_distanceAttack(EMCState *script) {
uint16 y = 0; uint16 y = 0;
calcCoordinates(x, y, stackPos(2), fX, fY); calcCoordinates(x, y, stackPos(2), fX, fY);
if (launchObject(stackPos(0), stackPos(1), x, y, stackPos(5), stackPos(6) << 1, stackPos(7), stackPos(8), 0x3f)) if (launchObject(stackPos(0), stackPos(1), x, y, stackPos(5), stackPos(6) << 1, stackPos(7), stackPos(8), 0x3F))
return 1; return 1;
deleteItem(stackPos(1)); deleteItem(stackPos(1));
@ -1532,7 +1532,7 @@ int LoLEngine::olol_moveBlockObjects(EMCState *script) {
// WORKAROUND for script bug // WORKAROUND for script bug
// Items would vanish when thrown towards the stairs // Items would vanish when thrown towards the stairs
// in white tower level 3. // in white tower level 3.
if (_currentLevel == 21 && level == 21 && destBlock == 0x3e0) { if (_currentLevel == 21 && level == 21 && destBlock == 0x3E0) {
level = 20; level = 20;
destBlock = 0x0247; destBlock = 0x0247;
} }
@ -1544,7 +1544,7 @@ int LoLEngine::olol_moveBlockObjects(EMCState *script) {
if (!includeMonsters) if (!includeMonsters)
continue; continue;
l &= 0x7fff; l &= 0x7FFF;
LoLMonster *m = &_monsters[l]; LoLMonster *m = &_monsters[l];
@ -1558,7 +1558,7 @@ int LoLEngine::olol_moveBlockObjects(EMCState *script) {
if (!(_itemsInPlay[l].shpCurFrame_flg & 0x4000) || !includeItems) if (!(_itemsInPlay[l].shpCurFrame_flg & 0x4000) || !includeItems)
continue; continue;
placeMoveLevelItem(l, level, destBlock, _itemsInPlay[l].x & 0xff, _itemsInPlay[l].y & 0xff, _itemsInPlay[l].flyingHeight); placeMoveLevelItem(l, level, destBlock, _itemsInPlay[l].x & 0xFF, _itemsInPlay[l].y & 0xFF, _itemsInPlay[l].flyingHeight);
res = 1; res = 1;
if (!runScript || level != _currentLevel) if (!runScript || level != _currentLevel)
@ -1617,7 +1617,7 @@ int LoLEngine::olol_dummy1(EMCState *script) {
int LoLEngine::olol_suspendMonster(EMCState *script) { int LoLEngine::olol_suspendMonster(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_suspendMonster(%p) (%d)", (const void *)script, stackPos(0)); debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_suspendMonster(%p) (%d)", (const void *)script, stackPos(0));
LoLMonster *m = &_monsters[stackPos(0) & 0x7fff]; LoLMonster *m = &_monsters[stackPos(0) & 0x7FFF];
setMonsterMode(m, 14); setMonsterMode(m, 14);
checkSceneUpdateNeed(m->block); checkSceneUpdateNeed(m->block);
placeMonster(m, 0, 0); placeMonster(m, 0, 0);
@ -1732,11 +1732,11 @@ int LoLEngine::olol_getItemOnPos(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_getItemOnPos(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3)); debugC(3, kDebugLevelScriptFuncs, "LoLEngine::olol_getItemOnPos(%p) (%d, %d, %d, %d)", (const void *)script, stackPos(0), stackPos(1), stackPos(2), stackPos(3));
int pX = stackPos(1); int pX = stackPos(1);
if (pX != -1) if (pX != -1)
pX &= 0xff; pX &= 0xFF;
int pY = stackPos(2); int pY = stackPos(2);
if (pY != -1) if (pY != -1)
pY &= 0xff; pY &= 0xFF;
int o = (stackPos(3) || _emcLastItem == -1) ? stackPos(0) : _emcLastItem; int o = (stackPos(3) || _emcLastItem == -1) ? stackPos(0) : _emcLastItem;
@ -1744,19 +1744,19 @@ int LoLEngine::olol_getItemOnPos(EMCState *script) {
while (_emcLastItem) { while (_emcLastItem) {
if (_emcLastItem & 0x8000) { if (_emcLastItem & 0x8000) {
o = _emcLastItem & 0x7fff; o = _emcLastItem & 0x7FFF;
_emcLastItem = _levelBlockProperties[o].assignedObjects; _emcLastItem = _levelBlockProperties[o].assignedObjects;
continue; continue;
} }
if (pX != -1 && (_itemsInPlay[_emcLastItem].x & 0xff) != pX) { if (pX != -1 && (_itemsInPlay[_emcLastItem].x & 0xFF) != pX) {
o = _emcLastItem & 0x7fff; o = _emcLastItem & 0x7FFF;
_emcLastItem = _levelBlockProperties[o].assignedObjects; _emcLastItem = _levelBlockProperties[o].assignedObjects;
continue; continue;
} }
if (pY != -1 && (_itemsInPlay[_emcLastItem].y & 0xff) != pY) { if (pY != -1 && (_itemsInPlay[_emcLastItem].y & 0xFF) != pY) {
o = _emcLastItem & 0x7fff; o = _emcLastItem & 0x7FFF;
_emcLastItem = _levelBlockProperties[o].assignedObjects; _emcLastItem = _levelBlockProperties[o].assignedObjects;
continue; continue;
} }
@ -1835,7 +1835,7 @@ int LoLEngine::olol_assignCustomSfx(EMCState *script) {
return 0; return 0;
uint16 t = READ_LE_UINT16(&_ingameSoundIndex[i << 1]); uint16 t = READ_LE_UINT16(&_ingameSoundIndex[i << 1]);
if (t == 0xffff) if (t == 0xFFFF)
return 0; return 0;
strcpy(_ingameSoundList[t], c); strcpy(_ingameSoundList[t], c);
@ -1848,7 +1848,7 @@ int LoLEngine::olol_findAssignedMonster(EMCState *script) {
uint16 o = stackPos(1) == -1 ? _levelBlockProperties[stackPos(0)].assignedObjects : findObject(stackPos(1))->nextAssignedObject; uint16 o = stackPos(1) == -1 ? _levelBlockProperties[stackPos(0)].assignedObjects : findObject(stackPos(1))->nextAssignedObject;
while (o) { while (o) {
if (o & 0x8000) if (o & 0x8000)
return o & 0x7fff; return o & 0x7FFF;
o = findObject(o)->nextAssignedObject; o = findObject(o)->nextAssignedObject;
} }
return -1; return -1;
@ -1861,8 +1861,8 @@ int LoLEngine::olol_checkBlockForMonster(EMCState *script) {
uint16 o = _levelBlockProperties[block].assignedObjects; uint16 o = _levelBlockProperties[block].assignedObjects;
while (o & 0x8000) { while (o & 0x8000) {
if (id == 0xffff || id == o) if (id == 0xFFFF || id == o)
return o & 0x7fff; return o & 0x7FFF;
o = findObject(o)->nextAssignedObject; o = findObject(o)->nextAssignedObject;
} }
return -1; return -1;
@ -2040,7 +2040,7 @@ int LoLEngine::olol_changeItemTypeOrFlag(EMCState *script) {
if (stackPos(1) == 4) if (stackPos(1) == 4)
i->itemPropertyIndex = val; i->itemPropertyIndex = val;
else if (stackPos(1) == 15) else if (stackPos(1) == 15)
i->shpCurFrame_flg = (i->shpCurFrame_flg & 0xe000) | (val & 0x1fff); i->shpCurFrame_flg = (i->shpCurFrame_flg & 0xE000) | (val & 0x1FFF);
else else
val = -1; val = -1;
@ -2129,7 +2129,7 @@ int LoLEngine::olol_paletteFlash(EMCState *script) {
uint8 *d = p2.getData(); uint8 *d = p2.getData();
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
d[i * 3] = 0x3f; d[i * 3] = 0x3F;
_screen->setScreenPalette(p2); _screen->setScreenPalette(p2);
_screen->updateScreen(); _screen->updateScreen();

View file

@ -1144,7 +1144,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_getCharacterFrameFromFacing); Opcode(o3_getCharacterFrameFromFacing);
// 0x0c // 0x0C
Opcode(o2_setCharacterFacingOverwrite); Opcode(o2_setCharacterFacingOverwrite);
Opcode(o2_trySceneChange); Opcode(o2_trySceneChange);
Opcode(o2_moveCharacter); Opcode(o2_moveCharacter);
@ -1164,7 +1164,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_showAlbum); Opcode(o3_showAlbum);
Opcode(o3_setInventorySlot); Opcode(o3_setInventorySlot);
Opcode(o3_getInventorySlot); Opcode(o3_getInventorySlot);
// 0x1c // 0x1C
Opcode(o3_addItemToInventory); Opcode(o3_addItemToInventory);
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o3_addItemToCurScene); Opcode(o3_addItemToCurScene);
@ -1184,7 +1184,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o1_setGameFlag); Opcode(o1_setGameFlag);
Opcode(o1_setHandItem); Opcode(o1_setHandItem);
Opcode(o1_removeHandItem); Opcode(o1_removeHandItem);
// 0x2c // 0x2C
Opcode(o1_getMouseState); Opcode(o1_getMouseState);
Opcode(o1_hideMouse); Opcode(o1_hideMouse);
Opcode(o2_addSpecialExit); Opcode(o2_addSpecialExit);
@ -1204,7 +1204,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_makeSecondChanceSave); Opcode(o3_makeSecondChanceSave);
Opcode(o3_setSceneFilename); Opcode(o3_setSceneFilename);
OpcodeUnImpl(); OpcodeUnImpl();
// 0x3c // 0x3C
Opcode(o3_removeItemsFromScene); Opcode(o3_removeItemsFromScene);
Opcode(o3_disguiseMalcolm); Opcode(o3_disguiseMalcolm);
Opcode(o3_drawSceneShape); Opcode(o3_drawSceneShape);
@ -1224,7 +1224,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_setSceneAnimPosAndFrame); Opcode(o3_setSceneAnimPosAndFrame);
Opcode(o2_update); Opcode(o2_update);
// 0x4c // 0x4C
Opcode(o3_removeItemInstances); Opcode(o3_removeItemInstances);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_disableInventory); Opcode(o3_disableInventory);
@ -1244,7 +1244,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_playSoundEffect); Opcode(o3_playSoundEffect);
Opcode(o3_getScore); Opcode(o3_getScore);
Opcode(o3_daggerWarning); Opcode(o3_daggerWarning);
// 0x5c // 0x5C
Opcode(o3_blockOutWalkableRegion); Opcode(o3_blockOutWalkableRegion);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_showSceneStringsMessage); Opcode(o3_showSceneStringsMessage);
@ -1264,7 +1264,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o2_waitForConfirmationClick); Opcode(o2_waitForConfirmationClick);
// 0x6c // 0x6C
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o2_defineRoomEntrance); Opcode(o2_defineRoomEntrance);
Opcode(o2_runAnimationScript); Opcode(o2_runAnimationScript);
@ -1284,7 +1284,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o2_defineScene); Opcode(o2_defineScene);
Opcode(o3_setConversationState); Opcode(o3_setConversationState);
OpcodeUnImpl(); OpcodeUnImpl();
// 0x7c // 0x7C
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o3_getConversationState); Opcode(o3_getConversationState);
Opcode(o3_dummy); Opcode(o3_dummy);
@ -1304,7 +1304,7 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dialogStartScript); Opcode(o3_dialogStartScript);
Opcode(o3_dummy); Opcode(o3_dummy);
// 0x8c // 0x8C
Opcode(o3_dialogEndScript); Opcode(o3_dialogEndScript);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
@ -1324,27 +1324,27 @@ void KyraEngine_MR::setupOpcodeTable() {
Opcode(o3_customChatFinish); Opcode(o3_customChatFinish);
Opcode(o3_setupSceneAnimObject); Opcode(o3_setupSceneAnimObject);
Opcode(o3_removeSceneAnimObject); Opcode(o3_removeSceneAnimObject);
// 0x9c // 0x9C
Opcode(o2_disableTimer); Opcode(o2_disableTimer);
Opcode(o2_enableTimer); Opcode(o2_enableTimer);
Opcode(o2_setTimerCountdown); Opcode(o2_setTimerCountdown);
OpcodeUnImpl(); OpcodeUnImpl();
// 0xa0 // 0xA0
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
Opcode(o3_dummy); Opcode(o3_dummy);
// 0xa4 // 0xA4
OpcodeUnImpl(); OpcodeUnImpl();
OpcodeUnImpl(); OpcodeUnImpl();
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o2_setVocHigh); Opcode(o2_setVocHigh);
// 0xa8 // 0xA8
Opcode(o2_getVocHigh); Opcode(o2_getVocHigh);
OpcodeUnImpl(); OpcodeUnImpl();
OpcodeUnImpl(); OpcodeUnImpl();
OpcodeUnImpl(); OpcodeUnImpl();
// 0xac // 0xAC
OpcodeUnImpl(); OpcodeUnImpl();
Opcode(o3_dummy); Opcode(o3_dummy);
OpcodeUnImpl(); OpcodeUnImpl();

View file

@ -393,14 +393,14 @@ void TIMInterpreter::displayText(uint16 textId, int16 flags, uint8 color) {
int y = 0; int y = 0;
if (_vm->gameFlags().use16ColorMode) { if (_vm->gameFlags().use16ColorMode) {
if (color == 0xda) if (color == 0xDA)
color = 0xa1; color = 0xA1;
else if (color == 0xf2) else if (color == 0xF2)
color = 0xe1; color = 0xE1;
else if (flags < 0) else if (flags < 0)
color = 0xe1; color = 0xE1;
else else
color = 0xc1; color = 0xC1;
} }
while (str[0]) { while (str[0]) {
@ -1083,7 +1083,7 @@ int TIMInterpreter_LoL::cmd_dialogueBox(const uint16 *param) {
int cnt = 0; int cnt = 0;
for (int i = 1; i < 4; i++) { for (int i = 1; i < 4; i++) {
if (param[i] != 0xffff) { if (param[i] != 0xFFFF) {
tmpStr[i-1] = getTableString(param[i]); tmpStr[i-1] = getTableString(param[i]);
cnt++; cnt++;
} else { } else {

View file

@ -867,7 +867,7 @@ void DarkMoonEngine::seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *da
int16 nextY = i ? items[i].y + items[i].size + (items[i].size >> 2) : dm->h; int16 nextY = i ? items[i].y + items[i].size + (items[i].size >> 2) : dm->h;
const char *posOld = pos; const char *posOld = pos;
pos = strchr(pos, 0x0d); pos = strchr(pos, 0x0D);
if (!pos) if (!pos)
pos = strchr(posOld, 0x00); pos = strchr(posOld, 0x00);
@ -893,7 +893,7 @@ void DarkMoonEngine::seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *da
items[i + 1].dataType = 0; items[i + 1].dataType = 0;
int l = pos - posOld; int l = pos - posOld;
if (items[i + 1].crlf != 0x0d) if (items[i + 1].crlf != 0x0D)
l++; l++;
delete[] items[i + 1].str; delete[] items[i + 1].str;
@ -1071,7 +1071,7 @@ void DarkmoonSequenceHelper::animCommand(int index, int del) {
uint32 end = 0; uint32 end = 0;
for (const DarkMoonAnimCommand *s = _config->animData[index]; s->command != 0xff && !_vm->skipFlag() && !_vm->shouldQuit(); s++) { for (const DarkMoonAnimCommand *s = _config->animData[index]; s->command != 0xFF && !_vm->skipFlag() && !_vm->shouldQuit(); s++) {
int palIndex = _config->mode == kFinale ? (s->pal + 1) : s->pal; int palIndex = _config->mode == kFinale ? (s->pal + 1) : s->pal;
int x = s->x1; int x = s->x1;
int y = s->y1; int y = s->y1;
@ -1187,7 +1187,7 @@ void DarkmoonSequenceHelper::animCommand(int index, int del) {
case 6: case 6:
// play sound effect // play sound effect
if (s->obj != 0xff) if (s->obj != 0xFF)
_vm->snd_playSoundEffect(s->obj); _vm->snd_playSoundEffect(s->obj);
break; break;

View file

@ -1061,7 +1061,7 @@ void EoBEngine::seq_playFinale() {
gui_drawBox(0, 0, 176, 175, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill); gui_drawBox(0, 0, 176, 175, guiSettings()->colors.frame1, guiSettings()->colors.frame2, guiSettings()->colors.fill);
_txt->printDialogueText(51, _moreStrings[0]); _txt->printDialogueText(51, _moreStrings[0]);
if (!checkScriptFlags(0x1ffe)) { if (!checkScriptFlags(0x1FFE)) {
_screen->fadeToBlack(); _screen->fadeToBlack();
return; return;
} }

View file

@ -444,8 +444,8 @@ SeqPlayer_HOF::SeqPlayer_HOF(KyraEngine_v1 *vm, Screen_v2 *screen, OSystem *syst
} else { } else {
const MainMenu::StaticData data = { const MainMenu::StaticData data = {
{ _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98], 0 }, { _sequenceStrings[97], _sequenceStrings[96], _sequenceStrings[95], _sequenceStrings[98], 0 },
{ 0x01, 0x04, 0x0C, 0x04, 0x00, 0xd7, 0xd6 }, { 0x01, 0x04, 0x0C, 0x04, 0x00, 0xD7, 0xD6 },
{ 0xd8, 0xda, 0xd9, 0xd8 }, { 0xD8, 0xDA, 0xD9, 0xD8 },
(_vm->gameFlags().lang == Common::JA_JPN) ? Screen::FID_SJIS_FNT : Screen::FID_8_FNT, 240 (_vm->gameFlags().lang == Common::JA_JPN) ? Screen::FID_SJIS_FNT : Screen::FID_8_FNT, 240
}; };
@ -1137,7 +1137,7 @@ void SeqPlayer_HOF::startNestedAnimation(int animSlot, int sequenceID) {
_animSlots[animSlot].y = s.y; _animSlots[animSlot].y = s.y;
_animSlots[animSlot].fadeInTransitionType = s.fadeInTransitionType; _animSlots[animSlot].fadeInTransitionType = s.fadeInTransitionType;
_animSlots[animSlot].fadeOutTransitionType = s.fadeOutTransitionType; _animSlots[animSlot].fadeOutTransitionType = s.fadeOutTransitionType;
_animSlots[animSlot].lastFrame = 0xffff; _animSlots[animSlot].lastFrame = 0xFFFF;
doNestedFrameTransition(s.fadeInTransitionType, animSlot); doNestedFrameTransition(s.fadeInTransitionType, animSlot);
@ -1258,7 +1258,7 @@ bool SeqPlayer_HOF::updateNestedAnimation(int animSlot) {
bool res = false; bool res = false;
if (currentFrame >= _animSlots[animSlot].endFrame) { if (currentFrame >= _animSlots[animSlot].endFrame) {
int sw = ((_animSlots[animSlot].flags & 0x1e) - 2); int sw = ((_animSlots[animSlot].flags & 0x1E) - 2);
switch (sw) { switch (sw) {
case 0: case 0:
res = true; res = true;
@ -1488,7 +1488,7 @@ void SeqPlayer_HOF::playHoFTalkieCredits() {
_screen->fadeFromBlack(); _screen->fadeFromBlack();
_screen->_charWidth = -2; _screen->_charWidth = -2;
uint8 *dataPtr = new uint8[0xafd]; uint8 *dataPtr = new uint8[0xAFD];
memcpy(dataPtr, talkieCredits, talkieCreditsSize); memcpy(dataPtr, talkieCredits, talkieCreditsSize);
_vm->staticres()->unloadId(k2SeqplayCredits); _vm->staticres()->unloadId(k2SeqplayCredits);
@ -1804,9 +1804,9 @@ int SeqPlayer_HOF::cbHOF_overview(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
_vm->sound()->playTrack(4); _vm->sound()->playTrack(4);
frameEnd = _system->getMillis() + 60 * _vm->tickLength(); frameEnd = _system->getMillis() + 60 * _vm->tickLength();
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xff; _textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
delayUntil(frameEnd); delayUntil(frameEnd);
@ -1889,9 +1889,9 @@ int SeqPlayer_HOF::cbHOF_library(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
assert(_screenHoF); assert(_screenHoF);
_screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false); _screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false);
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xff; _textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -1959,9 +1959,9 @@ int SeqPlayer_HOF::cbHOF_hand(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
assert(_screenHoF); assert(_screenHoF);
_screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false); _screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false);
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xff; _textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2032,9 +2032,9 @@ int SeqPlayer_HOF::cbHOF_point(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
case 0: case 0:
_vm->sound()->playTrack(7); _vm->sound()->playTrack(7);
_textColor[1] = 0xf7; _textColor[1] = 0xF7;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xff; _textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
assert(_screenHoF); assert(_screenHoF);
_screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false); _screenHoF->generateGrayOverlay(_screen->getPalette(0), _screen->getPalette(3).getData(), 0x24, 0, 0, 0, 0x100, false);
@ -2063,9 +2063,9 @@ int SeqPlayer_HOF::cbHOF_zanfaun(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
case 0: case 0:
_vm->sound()->playTrack(8); _vm->sound()->playTrack(8);
_textColor[1] = 0xfd; _textColor[1] = 0xFD;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xff; _textColorMap[1] = _textColor[0] = _screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 255) & 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2229,9 +2229,9 @@ int SeqPlayer_HOF::cbHOF_funters(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
case 0: case 0:
_vm->sound()->playTrack(3); _vm->sound()->playTrack(3);
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xff; _textColor[0] = _textColorMap[1] = 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
frameEnd = _system->getMillis() + 480 * _vm->tickLength(); frameEnd = _system->getMillis() + 480 * _vm->tickLength();
@ -2322,7 +2322,7 @@ int SeqPlayer_HOF::cbHOF_ferb(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
break; break;
case 0: case 0:
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 255; _textColor[0] = _textColorMap[1] = 255;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
@ -2404,9 +2404,9 @@ int SeqPlayer_HOF::cbHOF_fish(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
break; break;
case 0: case 0:
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xff; _textColor[0] = _textColorMap[1] = 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2494,9 +2494,9 @@ int SeqPlayer_HOF::cbHOF_fheep(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
break; break;
case 0: case 0:
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xff; _textColor[0] = _textColorMap[1] = 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2570,9 +2570,9 @@ int SeqPlayer_HOF::cbHOF_farmer(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
break; break;
case 0: case 0:
_textColor[1] = 1 + (_screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 254) & 0xff); _textColor[1] = 1 + (_screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 254) & 0xFF);
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColorMap[1] = _textColor[0] = 1 + (_screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 254) & 0xff); _textColorMap[1] = _textColor[0] = 1 + (_screen->findLeastDifferentColor(_textColorPresets + 3, _screen->getPalette(0), 1, 254) & 0xFF);
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
playSoundAndDisplaySubTitle(_vm->gameFlags().isTalkie ? 30 : 26); playSoundAndDisplaySubTitle(_vm->gameFlags().isTalkie ? 30 : 26);
break; break;
@ -2643,10 +2643,10 @@ int SeqPlayer_HOF::cbHOF_fuards(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
case 0: case 0:
for (int i = 0; i < 0x300; i++) for (int i = 0; i < 0x300; i++)
_screen->getPalette(0)[i] &= 0x3f; _screen->getPalette(0)[i] &= 0x3F;
_textColor[1] = 0xCf; _textColor[1] = 0xCf;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xfe; _textColor[0] = _textColorMap[1] = 0xFE;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2732,9 +2732,9 @@ int SeqPlayer_HOF::cbHOF_firates(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
break; break;
case 0: case 0:
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xff; _textColor[0] = _textColorMap[1] = 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
break; break;
@ -2819,9 +2819,9 @@ int SeqPlayer_HOF::cbHOF_frash(WSAMovie_v2 *wsaObj, int x, int y, int frm) {
case 0: case 0:
if (_callbackCurrentFrame == 1) { if (_callbackCurrentFrame == 1) {
_vm->sound()->playTrack(4); _vm->sound()->playTrack(4);
_textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xff; _textColor[1] = _screen->findLeastDifferentColor(_textColorPresets, _screen->getPalette(0), 1, 255) & 0xFF;
memset(_textColorMap, _textColor[1], 16); memset(_textColorMap, _textColor[1], 16);
_textColor[0] = _textColorMap[1] = 0xff; _textColor[0] = _textColorMap[1] = 0xFF;
_screen->setTextColorMap(_textColorMap); _screen->setTextColorMap(_textColorMap);
} }
_animDuration = 10; _animDuration = 10;
@ -3054,7 +3054,7 @@ int SeqPlayer_HOF::cbHOFDEMO_fisher(WSAMovie_v2 *wsaObj, int x, int y, int frm)
startNestedAnimation(1, kNestedSequenceHoFDemoDig); startNestedAnimation(1, kNestedSequenceHoFDemoDig);
} }
if (_scrollProgressCounter >= 0x18f && !_callbackCurrentFrame) if (_scrollProgressCounter >= 0x18F && !_callbackCurrentFrame)
return 0; return 0;
if (!_callbackCurrentFrame) { if (!_callbackCurrentFrame) {
@ -3067,15 +3067,15 @@ int SeqPlayer_HOF::cbHOFDEMO_fisher(WSAMovie_v2 *wsaObj, int x, int y, int frm)
updateDemoAdText(24, 144); updateDemoAdText(24, 144);
_callbackCurrentFrame++; _callbackCurrentFrame++;
if (_callbackCurrentFrame < 0x256 || _callbackCurrentFrame > 0x31c) { if (_callbackCurrentFrame < 0x256 || _callbackCurrentFrame > 0x31C) {
if (_callbackCurrentFrame < 0x174 || _callbackCurrentFrame > 0x1d7) { if (_callbackCurrentFrame < 0x174 || _callbackCurrentFrame > 0x1D7) {
if (_callbackCurrentFrame < 0x84 || _callbackCurrentFrame > 0xe7) { if (_callbackCurrentFrame < 0x84 || _callbackCurrentFrame > 0xE7) {
_scrollProgressCounter++; _scrollProgressCounter++;
} }
} }
} }
if (_callbackCurrentFrame > 0x31e) { if (_callbackCurrentFrame > 0x31E) {
closeNestedAnimation(0); closeNestedAnimation(0);
closeNestedAnimation(1); closeNestedAnimation(1);
setCountDown(0); setCountDown(0);
@ -3152,8 +3152,8 @@ int SeqPlayer_HOF::cbLOLDEMO_scene1(WSAMovie_v2 *wsaObj, int x, int y, int frm)
for (int i = 3; i < 768; i++) { for (int i = 3; i < 768; i++) {
tmpPal[i] = ((int)tmpPal[i] * 120) / 64; tmpPal[i] = ((int)tmpPal[i] * 120) / 64;
if (tmpPal[i] > 0x3f) if (tmpPal[i] > 0x3F)
tmpPal[i] = 0x3f; tmpPal[i] = 0x3F;
} }
playSoundAndDisplaySubTitle(_vm->_rnd.getRandomBit()); playSoundAndDisplaySubTitle(_vm->_rnd.getRandomBit());
@ -3293,8 +3293,8 @@ int SeqPlayer_HOF::cbLOLDEMO_scene6(WSAMovie_v2 *wsaObj, int x, int y, int frm)
for (int i = 3; i < 0x300; i++) { for (int i = 3; i < 0x300; i++) {
tmpPal[i] = ((int)tmpPal[i] * 120) / 64; tmpPal[i] = ((int)tmpPal[i] * 120) / 64;
if (tmpPal[i] > 0x3f) if (tmpPal[i] > 0x3F)
tmpPal[i] = 0x3f; tmpPal[i] = 0x3F;
} }
playSoundAndDisplaySubTitle(_vm->_rnd.getRandomBit()); playSoundAndDisplaySubTitle(_vm->_rnd.getRandomBit());
@ -3325,7 +3325,7 @@ int SeqPlayer_HOF::cbLOLDEMO_scene6(WSAMovie_v2 *wsaObj, int x, int y, int frm)
#undef CASE_ALT #undef CASE_ALT
const uint8 SeqPlayer_HOF::_textColorPresets[] = { 0x01, 0x01, 0x00, 0x3f, 0x3f, 0x3f }; const uint8 SeqPlayer_HOF::_textColorPresets[] = { 0x01, 0x01, 0x00, 0x3F, 0x3F, 0x3F };
void KyraEngine_HoF::seq_showStarcraftLogo() { void KyraEngine_HoF::seq_showStarcraftLogo() {
WSAMovie_v2 *ci = new WSAMovie_v2(this); WSAMovie_v2 *ci = new WSAMovie_v2(this);

View file

@ -1207,7 +1207,7 @@ struct CreditsLine {
void KyraEngine_LoK::seq_playCredits() { void KyraEngine_LoK::seq_playCredits() {
static const uint8 colorMap[] = { 0, 0, 0xC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; static const uint8 colorMap[] = { 0, 0, 0xC, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
static const char stringTerms[] = { 0x5, 0xd, 0x0}; static const char stringTerms[] = { 0x5, 0xD, 0x0};
typedef Common::List<CreditsLine> CreditsLineList; typedef Common::List<CreditsLine> CreditsLineList;
CreditsLineList lines; CreditsLineList lines;

View file

@ -716,7 +716,7 @@ void LoLEngine::showStarcraftLogo() {
_screen->fadeFromBlack(); _screen->fadeFromBlack();
int inputFlag = 0; int inputFlag = 0;
for (int i = 0; i < endframe; i++) { for (int i = 0; i < endframe; i++) {
inputFlag = checkInput(0) & 0xff; inputFlag = checkInput(0) & 0xFF;
if (shouldQuit() || inputFlag) if (shouldQuit() || inputFlag)
break; break;
ci->displayFrame(i, 2, 32, 80, 0, 0, 0); ci->displayFrame(i, 2, 32, 80, 0, 0, 0);
@ -728,7 +728,7 @@ void LoLEngine::showStarcraftLogo() {
if (!(shouldQuit() || inputFlag)) { if (!(shouldQuit() || inputFlag)) {
_sound->voicePlay("star2", &_speechHandle); _sound->voicePlay("star2", &_speechHandle);
while (_sound->voiceIsPlaying(&_speechHandle) && !(shouldQuit() || inputFlag)) { while (_sound->voiceIsPlaying(&_speechHandle) && !(shouldQuit() || inputFlag)) {
inputFlag = checkInput(0) & 0xff; inputFlag = checkInput(0) & 0xFF;
delay(_tickLength); delay(_tickLength);
} }
} }

View file

@ -165,7 +165,7 @@ public:
* *
* @param track sound effect id * @param track sound effect id
*/ */
virtual void playSoundEffect(uint8 track, uint8 volume = 0xff) = 0; virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF) = 0;
/** /**
* Stop playback of all sfx tracks. * Stop playback of all sfx tracks.
@ -319,7 +319,7 @@ public:
virtual void haltTrack(); virtual void haltTrack();
virtual bool isPlaying() const; virtual bool isPlaying() const;
virtual void playSoundEffect(uint8 track, uint8 volume = 0xff); virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF);
virtual void stopAllSoundEffects(); virtual void stopAllSoundEffects();

View file

@ -683,14 +683,14 @@ void AdLibDriver::adjustSfxData(uint8 *ptr, int volume) {
_sfxVelocity = ptr[3]; _sfxVelocity = ptr[3];
// Adjust the values. // Adjust the values.
if (volume != 0xff) { if (volume != 0xFF) {
if (_version >= 3) { if (_version >= 3) {
int newVal = ((((ptr[3]) + 63) * volume) >> 8) & 0xFF; int newVal = ((((ptr[3]) + 63) * volume) >> 8) & 0xFF;
ptr[3] = -newVal + 63; ptr[3] = -newVal + 63;
ptr[1] = ((ptr[1] * volume) >> 8) & 0xFF; ptr[1] = ((ptr[1] * volume) >> 8) & 0xFF;
} else { } else {
int newVal = ((_sfxVelocity << 2) ^ 0xff) * volume; int newVal = ((_sfxVelocity << 2) ^ 0xFF) * volume;
ptr[3] = (newVal >> 10) ^ 0x3f; ptr[3] = (newVal >> 10) ^ 0x3F;
ptr[1] = newVal >> 11; ptr[1] = newVal >> 11;
} }
} }
@ -2375,7 +2375,7 @@ void SoundAdLibPC::playTrack(uint8 track) {
_driver->setSyncJumpMask(0x000F); _driver->setSyncJumpMask(0x000F);
else else
_driver->setSyncJumpMask(0); _driver->setSyncJumpMask(0);
play(track, 0xff); play(track, 0xFF);
} }
} }
@ -2409,7 +2409,7 @@ void SoundAdLibPC::play(uint8 track, uint8 volume) {
} }
void SoundAdLibPC::beginFadeOut() { void SoundAdLibPC::beginFadeOut() {
play(_version > 2 ? 1 : 15, 0xff); play(_version > 2 ? 1 : 15, 0xFF);
} }
int SoundAdLibPC::checkTrigger() { int SoundAdLibPC::checkTrigger() {

View file

@ -79,7 +79,7 @@ public:
virtual void haltTrack(); virtual void haltTrack();
virtual bool isPlaying() const; virtual bool isPlaying() const;
virtual void playSoundEffect(uint8 track, uint8 volume = 0xff); virtual void playSoundEffect(uint8 track, uint8 volume = 0xFF);
virtual void beginFadeOut(); virtual void beginFadeOut();

View file

@ -271,8 +271,8 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
while (outSize > 0) { while (outSize > 0) {
input = _inBuffer[i++] << 2; input = _inBuffer[i++] << 2;
code = (input >> 8) & 0xff; code = (input >> 8) & 0xFF;
count = (input & 0xff) >> 2; count = (input & 0xFF) >> 2;
switch (code) { switch (code) {
case 2: case 2:
@ -294,7 +294,7 @@ int AUDStream::readChunk(int16 *buffer, const int maxSamples) {
for (; count >= 0; count--) { for (; count >= 0; count--) {
code = _inBuffer[i++]; code = _inBuffer[i++];
curSample += WSTable4Bit[code & 0x0f]; curSample += WSTable4Bit[code & 0x0F];
curSample = clip8BitSample(curSample); curSample = clip8BitSample(curSample);
_outBuffer[j++] = curSample; _outBuffer[j++] = curSample;

View file

@ -73,7 +73,7 @@ public:
void haltTrack(); void haltTrack();
bool isPlaying() const; bool isPlaying() const;
void playSoundEffect(uint8 track, uint8 volume = 0xff); void playSoundEffect(uint8 track, uint8 volume = 0xFF);
void stopAllSoundEffects(); void stopAllSoundEffects();
void beginFadeOut(); void beginFadeOut();
@ -129,7 +129,7 @@ public:
void playTrack(uint8 track); void playTrack(uint8 track);
void haltTrack(); void haltTrack();
void playSoundEffect(uint8 track, uint8 volume = 0xff); void playSoundEffect(uint8 track, uint8 volume = 0xFF);
void stopAllSoundEffects(); void stopAllSoundEffects();
void beginFadeOut(); void beginFadeOut();
@ -185,7 +185,7 @@ public:
void beginFadeOut(); void beginFadeOut();
int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; } int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; }
void playSoundEffect(uint8 track, uint8 volume = 0xff); void playSoundEffect(uint8 track, uint8 volume = 0xFF);
void updateVolumeSettings(); void updateVolumeSettings();
@ -221,7 +221,7 @@ public:
void beginFadeOut(); void beginFadeOut();
int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume = 255, uint8 priority = 255, bool isSfx = true); int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume = 255, uint8 priority = 255, bool isSfx = true);
void playSoundEffect(uint8 track, uint8 volume = 0xff); void playSoundEffect(uint8 track, uint8 volume = 0xFF);
void updateVolumeSettings(); void updateVolumeSettings();
@ -338,7 +338,7 @@ public:
void beginFadeOut(); void beginFadeOut();
int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; } int32 voicePlay(const char *file, Audio::SoundHandle *handle, uint8 volume, uint8 priority, bool isSfx) { return -1; }
void playSoundEffect(uint8 track, uint8 volume = 0xff); void playSoundEffect(uint8 track, uint8 volume = 0xFF);
protected: protected:
Audio::MaxTrax *_driver; Audio::MaxTrax *_driver;

View file

@ -60,7 +60,7 @@ bool LoLEngine::snd_playCharacterSpeech(int id, int8 speaker, int) {
Common::String pattern2 = Common::String::format("%02d", id & 0x4000 ? 0 : _curTlkFile); Common::String pattern2 = Common::String::format("%02d", id & 0x4000 ? 0 : _curTlkFile);
if (id & 0x4000) { if (id & 0x4000) {
pattern1 = Common::String::format("%03X", id & 0x3fff); pattern1 = Common::String::format("%03X", id & 0x3FFF);
} else if (id < 1000) { } else if (id < 1000) {
pattern1 = Common::String::format("%03d", id); pattern1 = Common::String::format("%03d", id);
} else { } else {
@ -164,7 +164,7 @@ void LoLEngine::snd_playSoundEffect(int track, int volume) {
if (track == -1 || track >= _ingameSoundListSize) if (track == -1 || track >= _ingameSoundListSize)
return; return;
volume &= 0xff; volume &= 0xFF;
int16 prIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2 + 1]); int16 prIndex = (int16)READ_LE_UINT16(&_ingameSoundIndex[track * 2 + 1]);
uint16 priority = (prIndex > 0) ? (prIndex * volume) >> 8 : -prIndex; uint16 priority = (prIndex > 0) ? (prIndex * volume) >> 8 : -prIndex;
@ -214,8 +214,8 @@ bool LoLEngine::snd_processEnvironmentalSoundEffect(int soundId, int block) {
uint16 cbl = _currentBlock; uint16 cbl = _currentBlock;
for (int i = 3; i > 0; i--) { for (int i = 3; i > 0; i--) {
int dir = calcMonsterDirection(cbl & 0x1f, cbl >> 5, block & 0x1f, block >> 5); int dir = calcMonsterDirection(cbl & 0x1F, cbl >> 5, block & 0x1F, block >> 5);
cbl = (cbl + blockShiftTable[dir]) & 0x3ff; cbl = (cbl + blockShiftTable[dir]) & 0x3FF;
if (cbl != block) { if (cbl != block) {
if (testWallFlag(cbl, 0, 1)) if (testWallFlag(cbl, 0, 1))
_environmentSfxVol >>= 1; _environmentSfxVol >>= 1;

View file

@ -174,8 +174,8 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) {
} }
} }
uint8 *fileBody = _sfxFileData + 0x01b8; uint8 *fileBody = _sfxFileData + 0x01B8;
int32 offset = (int32)READ_LE_UINT32(_sfxFileData + (track - 0x0b) * 4); int32 offset = (int32)READ_LE_UINT32(_sfxFileData + (track - 0x0B) * 4);
if (offset == -1) if (offset == -1)
return; return;
@ -214,10 +214,10 @@ void SoundTowns::playSoundEffect(uint8 track, uint8) {
sfx_WdTable_Number = READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset); sfx_WdTable_Number = READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset);
sfx_BtTable_Offset += (int16)READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset + 2); sfx_BtTable_Offset += (int16)READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset + 2);
*tgt++ = _sfxBTTable[((sfx_BtTable_Offset >> 2) & 0xff)]; *tgt++ = _sfxBTTable[((sfx_BtTable_Offset >> 2) & 0xFF)];
sfx_BtTable_Offset += (int16)READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset + 4); sfx_BtTable_Offset += (int16)READ_LE_UINT16(_sfxWDTable + sfx_WdTable_Offset + 4);
*tgt++ = _sfxBTTable[((sfx_BtTable_Offset >> 2) & 0xff)]; *tgt++ = _sfxBTTable[((sfx_BtTable_Offset >> 2) & 0xFF)];
} }
} }
@ -293,7 +293,7 @@ void SoundTowns::beginFadeOut() {
for (int ii = 0; ii < 6; ii++) for (int ii = 0; ii < 6; ii++)
_driver->chanVolume(ii, fadeVolCur[ii]); _driver->chanVolume(ii, fadeVolCur[ii]);
for (int ii = 0x40; ii < 0x46; ii++) for (int ii = 0x40; ii < 0x46; ii++)
_driver->chanVolume(ii, fadeVolCur[ii - 0x3a]); _driver->chanVolume(ii, fadeVolCur[ii - 0x3A]);
for (int ii = 0; ii < 6; ii++) { for (int ii = 0; ii < 6; ii++) {
fadeVolCur[ii] -= fadeVolStep[ii]; fadeVolCur[ii] -= fadeVolStep[ii];
@ -694,7 +694,7 @@ int32 SoundTownsPC98_v2::voicePlay(const char *file, Audio::SoundHandle *handle,
cmd = ~cmd; cmd = ~cmd;
} else { } else {
cmd |= 0x80; cmd |= 0x80;
if (cmd == 0xff) if (cmd == 0xFF)
cmd--; cmd--;
} }
if (cmd < 0x80) if (cmd < 0x80)

View file

@ -58,7 +58,7 @@ void EoBCoreEngine::releaseMonsterShapes(int first, int num) {
const uint8 *EoBCoreEngine::loadMonsterProperties(const uint8 *data) { const uint8 *EoBCoreEngine::loadMonsterProperties(const uint8 *data) {
uint8 cmd = *data++; uint8 cmd = *data++;
while (cmd != 0xff) { while (cmd != 0xFF) {
EoBMonsterProperty *d = &_monsterProps[cmd]; EoBMonsterProperty *d = &_monsterProps[cmd];
d->armorClass = (int8)*data++; d->armorClass = (int8)*data++;
d->hitChance = (int8)*data++; d->hitChance = (int8)*data++;
@ -90,7 +90,7 @@ const uint8 *EoBCoreEngine::loadMonsterProperties(const uint8 *data) {
d->sound2 = (int8)*data++; d->sound2 = (int8)*data++;
d->numRemoteAttacks = *data++; d->numRemoteAttacks = *data++;
if (*data++ != 0xff) { if (*data++ != 0xFF) {
d->remoteWeaponChangeMode = *data++; d->remoteWeaponChangeMode = *data++;
d->numRemoteWeapons = *data++; d->numRemoteWeapons = *data++;
@ -113,7 +113,7 @@ const uint8 *EoBCoreEngine::loadMonsterProperties(const uint8 *data) {
} }
const uint8 *EoBCoreEngine::loadActiveMonsterData(const uint8 *data, int level) { const uint8 *EoBCoreEngine::loadActiveMonsterData(const uint8 *data, int level) {
for (uint8 p = *data++; p != 0xff; p = *data++) { for (uint8 p = *data++; p != 0xFF; p = *data++) {
uint8 v = *data++; uint8 v = *data++;
_timer->setCountdown(0x20 + (p << 1), v); _timer->setCountdown(0x20 + (p << 1), v);
_timer->setCountdown(0x21 + (p << 1), v); _timer->setCountdown(0x21 + (p << 1), v);
@ -132,7 +132,7 @@ const uint8 *EoBCoreEngine::loadActiveMonsterData(const uint8 *data, int level)
memset(_monsters, 0, 30 * sizeof(EoBMonsterInPlay)); memset(_monsters, 0, 30 * sizeof(EoBMonsterInPlay));
for (int i = 0; i < 30; i++, data += 14) { for (int i = 0; i < 30; i++, data += 14) {
if (*data == 0xff) if (*data == 0xFF)
continue; continue;
initMonster(data[0], data[1], READ_LE_UINT16(&data[2]), data[4], (int8)data[5], data[6], data[7], data[8], data[9], READ_LE_UINT16(&data[10]), READ_LE_UINT16(&data[12])); initMonster(data[0], data[1], READ_LE_UINT16(&data[2]), data[4], (int8)data[5], data[6], data[7], data[8], data[9], READ_LE_UINT16(&data[10]), READ_LE_UINT16(&data[12]));
@ -174,7 +174,7 @@ void EoBCoreEngine::initMonster(int index, int unit, uint16 block, int pos, int
} }
void EoBCoreEngine::placeMonster(EoBMonsterInPlay *m, uint16 block, int dir) { void EoBCoreEngine::placeMonster(EoBMonsterInPlay *m, uint16 block, int dir) {
if (block != 0xffff) { if (block != 0xFFFF) {
checkSceneUpdateNeed(m->block); checkSceneUpdateNeed(m->block);
if (_levelBlockProperties[m->block].flags & 7) { if (_levelBlockProperties[m->block].flags & 7) {
_levelBlockProperties[m->block].flags--; _levelBlockProperties[m->block].flags--;
@ -201,11 +201,11 @@ void EoBCoreEngine::killMonster(EoBMonsterInPlay *m, bool giveExperience) {
if (m->randItem) { if (m->randItem) {
if (rollDice(1, 10, 0) == 1) if (rollDice(1, 10, 0) == 1)
setItemPosition((Item *)&_levelBlockProperties[m->block & 0x3ff].drawObjects, m->block, duplicateItem(m->randItem), pos); setItemPosition((Item *)&_levelBlockProperties[m->block & 0x3FF].drawObjects, m->block, duplicateItem(m->randItem), pos);
} }
if (m->fixedItem) if (m->fixedItem)
setItemPosition((Item *)&_levelBlockProperties[m->block & 0x3ff].drawObjects, m->block, duplicateItem(m->fixedItem), pos); setItemPosition((Item *)&_levelBlockProperties[m->block & 0x3FF].drawObjects, m->block, duplicateItem(m->fixedItem), pos);
if (giveExperience) if (giveExperience)
increasePartyExperience(_monsterProps[m->type].experience); increasePartyExperience(_monsterProps[m->type].experience);
@ -357,7 +357,7 @@ void EoBCoreEngine::flashMonsterShape(EoBMonsterInPlay *m) {
disableSysTimer(2); disableSysTimer(2);
_flashShapeTimer = 0; _flashShapeTimer = 0;
drawScene(1); drawScene(1);
m->flags &= 0xfd; m->flags &= 0xFD;
_flashShapeTimer = _system->getMillis() + _tickLength; _flashShapeTimer = _system->getMillis() + _tickLength;
enableSysTimer(2); enableSysTimer(2);
@ -536,7 +536,7 @@ void EoBCoreEngine::drawMonsters(int index) {
int h = shp[1]; int h = shp[1];
x = x - (w >> 1) + (d->idleAnimState >> 4); x = x - (w >> 1) + (d->idleAnimState >> 4);
y = y - h + (d->idleAnimState & 0x0f); y = y - h + (d->idleAnimState & 0x0F);
drawMonsterShape(shp, x, y, f >= 0 ? 0 : 1, d->flags, palIndex); drawMonsterShape(shp, x, y, f >= 0 ? 0 : 1, d->flags, palIndex);

View file

@ -66,7 +66,7 @@ void LoLEngine::loadMonsterShapes(const char *file, int monsterIndex, int animTy
of[2] = _screen->makeShapeCopy(p, s + 2); of[2] = _screen->makeShapeCopy(p, s + 2);
} }
} }
_monsterAnimType[monsterIndex] = animType & 0xff; _monsterAnimType[monsterIndex] = animType & 0xFF;
uint8 *palShape = _screen->makeShapeCopy(p, 16); uint8 *palShape = _screen->makeShapeCopy(p, 16);
@ -90,7 +90,7 @@ void LoLEngine::loadMonsterShapes(const char *file, int monsterIndex, int animTy
uint16 sz = MIN(_screen->getShapeSize(_monsterShapes[pos]) - 10, 256); uint16 sz = MIN(_screen->getShapeSize(_monsterShapes[pos]) - 10, 256);
memset(tmpPal2, 0, 256); memset(tmpPal2, 0, 256);
memcpy(tmpPal2, _monsterShapes[pos] + 10, sz); memcpy(tmpPal2, _monsterShapes[pos] + 10, sz);
memset(tmpPal3, 0xff, 256 * sizeof(uint16)); memset(tmpPal3, 0xFF, 256 * sizeof(uint16));
uint8 numCol = *tmpPal2; uint8 numCol = *tmpPal2;
for (int ii = 0; ii < numCol; ii++) { for (int ii = 0; ii < numCol; ii++) {
@ -104,7 +104,7 @@ void LoLEngine::loadMonsterShapes(const char *file, int monsterIndex, int animTy
memset(tmpPal2, 0, 256); memset(tmpPal2, 0, 256);
memcpy(tmpPal2, _monsterShapes[pos] + 10, sz); memcpy(tmpPal2, _monsterShapes[pos] + 10, sz);
for (int iii = 0; iii < numCol; iii++) { for (int iii = 0; iii < numCol; iii++) {
if (tmpPal3[iii] == 0xffff) if (tmpPal3[iii] == 0xFFFF)
continue; continue;
if (p[tmpPal3[iii] * 320 + ii + 1]) if (p[tmpPal3[iii] * 320 + ii + 1])
tmpPal2[1 + iii] = p[tmpPal3[iii] * 320 + ii + 1]; tmpPal2[1 + iii] = p[tmpPal3[iii] * 320 + ii + 1];
@ -159,7 +159,7 @@ int LoLEngine::deleteMonstersFromBlock(int block) {
continue; continue;
} }
LoLMonster *m = &_monsters[i & 0x7fff]; LoLMonster *m = &_monsters[i & 0x7FFF];
cnt++; cnt++;
setMonsterMode(m, 14); setMonsterMode(m, 14);
@ -215,8 +215,8 @@ bool LoLEngine::updateMonsterAdjustBlocks(LoLMonster *monster) {
if (monster->properties->flags & 8) if (monster->properties->flags & 8)
return true; return true;
uint16 x1 = (monster->x & 0xff00) | 0x80; uint16 x1 = (monster->x & 0xFF00) | 0x80;
uint16 y1 = (monster->y & 0xff00) | 0x80; uint16 y1 = (monster->y & 0xFF00) | 0x80;
int x2 = _partyPosX; int x2 = _partyPosX;
int y2 = _partyPosY; int y2 = _partyPosY;
@ -242,7 +242,7 @@ bool LoLEngine::updateMonsterAdjustBlocks(LoLMonster *monster) {
return false; return false;
for (int i = 0; i < 18; i++) for (int i = 0; i < 18; i++)
_visibleBlocks[i] = &_levelBlockProperties[(monster->block + _dscBlockIndex[dir + i]) & 0x3ff]; _visibleBlocks[i] = &_levelBlockProperties[(monster->block + _dscBlockIndex[dir + i]) & 0x3FF];
int16 fx1 = 0; int16 fx1 = 0;
int16 fx2 = 0; int16 fx2 = 0;
@ -277,8 +277,8 @@ void LoLEngine::placeMonster(LoLMonster *monster, uint16 x, uint16 y) {
_levelBlockProperties[monster->block].direction = 5; _levelBlockProperties[monster->block].direction = 5;
checkSceneUpdateNeed(monster->block); checkSceneUpdateNeed(monster->block);
// WORKAROUND: Some monsters in the white tower have sound id's of 0xff. This is definitely a bug, since the // WORKAROUND: Some monsters in the white tower have sound id's of 0xFF. This is definitely a bug, since the
// last valid track number is 249 and there is no specific handling for 0xff. Nonetheless this wouldn't // last valid track number is 249 and there is no specific handling for 0xFF. Nonetheless this wouldn't
// cause problems in the original code, because it just so happens that the invalid memory address points // cause problems in the original code, because it just so happens that the invalid memory address points
// to an entry in _ingameGMSoundIndex which just so happens to have a value of -1 // to an entry in _ingameGMSoundIndex which just so happens to have a value of -1
if (monster->properties->sounds[0] == 0 || monster->properties->sounds[0] == 255 || cont == false) if (monster->properties->sounds[0] == 0 || monster->properties->sounds[0] == 255 || cont == false)
@ -364,7 +364,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object
return 4; return 4;
if (x & 0x80) { if (x & 0x80) {
if (((x & 0xff) + objectWidth) & 0xff00) { if (((x & 0xFF) + objectWidth) & 0xFF00) {
xOffs = 1; xOffs = 1;
_objectLastDirection = 2; _objectLastDirection = 2;
x2 = x + objectWidth; x2 = x + objectWidth;
@ -380,7 +380,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object
flag = 1; flag = 1;
} }
} else { } else {
if (((x & 0xff) - objectWidth) & 0xff00) { if (((x & 0xFF) - objectWidth) & 0xFF00) {
xOffs = -1; xOffs = -1;
_objectLastDirection = 6; _objectLastDirection = 6;
x2 = x - objectWidth; x2 = x - objectWidth;
@ -398,7 +398,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object
} }
if (y & 0x80) { if (y & 0x80) {
if (((y & 0xff) + objectWidth) & 0xff00) { if (((y & 0xFF) + objectWidth) & 0xFF00) {
yOffs = 1; yOffs = 1;
_objectLastDirection = 4; _objectLastDirection = 4;
y2 = y + objectWidth; y2 = y + objectWidth;
@ -415,7 +415,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object
flag = 0; flag = 0;
} }
} else { } else {
if (((y & 0xff) - objectWidth) & 0xff00) { if (((y & 0xFF) - objectWidth) & 0xFF00) {
yOffs = -1; yOffs = -1;
_objectLastDirection = 0; _objectLastDirection = 0;
y2 = y - objectWidth; y2 = y - objectWidth;
@ -449,7 +449,7 @@ int LoLEngine::checkBlockBeforeObjectPlacement(uint16 x, uint16 y, uint16 object
int LoLEngine::testBlockPassability(int block, int x, int y, int objectWidth, int testFlag, int wallFlag) { int LoLEngine::testBlockPassability(int block, int x, int y, int objectWidth, int testFlag, int wallFlag) {
if (block == _currentBlock) if (block == _currentBlock)
testFlag &= 0xfffe; testFlag &= 0xFFFE;
if (testFlag & 1) { if (testFlag & 1) {
_monsterCurBlock = block; _monsterCurBlock = block;
@ -463,7 +463,7 @@ int LoLEngine::testBlockPassability(int block, int x, int y, int objectWidth, in
uint16 obj = _levelBlockProperties[block].assignedObjects; uint16 obj = _levelBlockProperties[block].assignedObjects;
while (obj & 0x8000) { while (obj & 0x8000) {
LoLMonster *monster = &_monsters[obj & 0x7fff]; LoLMonster *monster = &_monsters[obj & 0x7FFF];
if (monster->mode < 13) { if (monster->mode < 13) {
int r = checkDrawObjectSpace(x, y, monster->x, monster->y); int r = checkDrawObjectSpace(x, y, monster->x, monster->y);
@ -485,7 +485,7 @@ int LoLEngine::calcMonsterSkillLevel(int id, int a) {
if (!(id & 0x8000)) if (!(id & 0x8000))
r = (r * _monsterModifiers[3 + _monsterDifficulty]) >> 8; r = (r * _monsterModifiers[3 + _monsterDifficulty]) >> 8;
id &= 0x7fff; id &= 0x7FFF;
if (_characters[id].skillLevels[1] <= 3) if (_characters[id].skillLevels[1] <= 3)
return r; return r;
@ -530,7 +530,7 @@ void LoLEngine::drawBlockObjects(int blockArrayIndex) {
s = l->drawObjects; s = l->drawObjects;
while (s) { while (s) {
if (s & 0x8000) { if (s & 0x8000) {
s &= 0x7fff; s &= 0x7FFF;
if (blockArrayIndex < 15) if (blockArrayIndex < 15)
drawMonster(s); drawMonster(s);
s = _monsters[s].nextDrawObject; s = _monsters[s].nextDrawObject;
@ -607,7 +607,7 @@ void LoLEngine::drawBlockObjects(int blockArrayIndex) {
void LoLEngine::drawMonster(uint16 id) { void LoLEngine::drawMonster(uint16 id) {
LoLMonster *m = &_monsters[id]; LoLMonster *m = &_monsters[id];
int16 flg = _monsterDirFlags[(_currentDirection << 2) + m->facing]; int16 flg = _monsterDirFlags[(_currentDirection << 2) + m->facing];
int curFrm = getMonsterCurFrame(m, flg & 0xffef); int curFrm = getMonsterCurFrame(m, flg & 0xFFEF);
uint8 *shp = 0; uint8 *shp = 0;
if (curFrm == -1) { if (curFrm == -1) {
@ -622,7 +622,7 @@ void LoLEngine::drawMonster(uint16 id) {
if (m->properties->flags & 0x800) if (m->properties->flags & 0x800)
flg |= 0x20; flg |= 0x20;
uint8 *monsterPalette = d ? _monsterPalettes[(m->properties->shapeIndex << 4) + (curFrm & 0x0f)] + (shp[10] * (d - 1)) : 0; uint8 *monsterPalette = d ? _monsterPalettes[(m->properties->shapeIndex << 4) + (curFrm & 0x0F)] + (shp[10] * (d - 1)) : 0;
uint8 *brightnessOverlay = drawItemOrMonster(shp, monsterPalette, m->x + _monsterShiftOffs[m->shiftStep << 1], m->y + _monsterShiftOffs[(m->shiftStep << 1) + 1], 0, 0, flg | 1, -1, flip); uint8 *brightnessOverlay = drawItemOrMonster(shp, monsterPalette, m->x + _monsterShiftOffs[m->shiftStep << 1], m->y + _monsterShiftOffs[(m->shiftStep << 1) + 1], 0, 0, flg | 1, -1, flip);
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
@ -644,16 +644,16 @@ void LoLEngine::drawMonster(uint16 id) {
int dW = _screen->getShapeScaledWidth(shp, _dmScaleW) >> 1; int dW = _screen->getShapeScaledWidth(shp, _dmScaleW) >> 1;
int dH = _screen->getShapeScaledHeight(shp, _dmScaleH) >> 1; int dH = _screen->getShapeScaledHeight(shp, _dmScaleH) >> 1;
int bloodAmount = (m->mode == 13) ? (m->fightCurTick << 1) : (m->properties->hitPoints / (m->damageReceived & 0x7fff)); int bloodAmount = (m->mode == 13) ? (m->fightCurTick << 1) : (m->properties->hitPoints / (m->damageReceived & 0x7FFF));
shp = _gameShapes[6]; shp = _gameShapes[6];
int bloodType = m->properties->flags & 0xc000; int bloodType = m->properties->flags & 0xC000;
if (bloodType == 0x4000) if (bloodType == 0x4000)
bloodType = _flags.use16ColorMode ? 0xbb : 63; bloodType = _flags.use16ColorMode ? 0xBB : 63;
else if (bloodType == 0x8000) else if (bloodType == 0x8000)
bloodType = _flags.use16ColorMode ? 0x55 : 15; bloodType = _flags.use16ColorMode ? 0x55 : 15;
else if (bloodType == 0xc000) else if (bloodType == 0xC000)
bloodType = _flags.use16ColorMode ? 0x33 : 74; bloodType = _flags.use16ColorMode ? 0x33 : 74;
else else
bloodType = 0; bloodType = 0;
@ -796,7 +796,7 @@ void LoLEngine::redrawSceneItem() {
int t = (i << 7) + 1; int t = (i << 7) + 1;
while (s) { while (s) {
if (s & 0x8000) { if (s & 0x8000) {
s = _monsters[s & 0x7fff].nextDrawObject; s = _monsters[s & 0x7FFF].nextDrawObject;
} else { } else {
LoLItem *item = &_itemsInPlay[s]; LoLItem *item = &_itemsInPlay[s];
@ -934,7 +934,7 @@ uint8 *LoLEngine::drawItemOrMonster(uint8 *shape, uint8 *monsterPalette, int x,
uint8 tmpOvl[16]; uint8 tmpOvl[16];
if (flags & 0x80) { if (flags & 0x80) {
flags &= 0xff7f; flags &= 0xFF7F;
ovl2 = monsterPalette; ovl2 = monsterPalette;
monsterPalette = 0; monsterPalette = 0;
} else { } else {
@ -969,7 +969,7 @@ uint8 *LoLEngine::drawItemOrMonster(uint8 *shape, uint8 *monsterPalette, int x,
if (_flags.use16ColorMode) { if (_flags.use16ColorMode) {
if (_currentLevel != 22) if (_currentLevel != 22)
flg &= 0xdfff; flg &= 0xDFFF;
} else { } else {
if (_currentLevel == 22) { if (_currentLevel == 22) {
@ -1059,7 +1059,7 @@ void LoLEngine::updateMonster(LoLMonster *monster) {
if ((monster->mode != 11) && (monster->mode != 14)) { if ((monster->mode != 11) && (monster->mode != 14)) {
if (!(_rnd.getRandomNumber(255) & 3)) { if (!(_rnd.getRandomNumber(255) & 3)) {
monster->shiftStep = (monster->shiftStep + 1) & 0x0f; monster->shiftStep = (monster->shiftStep + 1) & 0x0F;
checkSceneUpdateNeed(monster->block); checkSceneUpdateNeed(monster->block);
} }
} }
@ -1137,7 +1137,7 @@ void LoLEngine::updateMonster(LoLMonster *monster) {
chasePartyWithCloseAttacks(monster); chasePartyWithCloseAttacks(monster);
} else { } else {
setMonsterMode(monster, 7); setMonsterMode(monster, 7);
monster->flags &= 0xfff7; monster->flags &= 0xFFF7;
} }
break; break;
@ -1164,13 +1164,13 @@ void LoLEngine::updateMonster(LoLMonster *monster) {
if (monster->damageReceived) { if (monster->damageReceived) {
if (monster->damageReceived & 0x8000) if (monster->damageReceived & 0x8000)
monster->damageReceived &= 0x7fff; monster->damageReceived &= 0x7FFF;
else else
monster->damageReceived = 0; monster->damageReceived = 0;
checkSceneUpdateNeed(monster->block); checkSceneUpdateNeed(monster->block);
} }
monster->flags &= 0xffef; monster->flags &= 0xFFEF;
} }
void LoLEngine::moveMonster(LoLMonster *monster) { void LoLEngine::moveMonster(LoLMonster *monster) {
@ -1239,13 +1239,13 @@ bool LoLEngine::chasePartyWithDistanceAttacks(LoLMonster *monster) {
int flyingObject = monster->properties->distWeapons[s]; int flyingObject = monster->properties->distWeapons[s];
if (flyingObject & 0xc000) { if (flyingObject & 0xC000) {
if (getBlockDistance(monster->block, _currentBlock) > 1) { if (getBlockDistance(monster->block, _currentBlock) > 1) {
int type = flyingObject & 0x4000 ? 0 : 1; int type = flyingObject & 0x4000 ? 0 : 1;
flyingObject = makeItem(flyingObject & 0x3fff, 0, 0); flyingObject = makeItem(flyingObject & 0x3FFF, 0, 0);
if (flyingObject) { if (flyingObject) {
if (!launchObject(type, flyingObject, monster->x, monster->y, 12, dir << 1, -1, monster->id | 0x8000, 0x3f)) if (!launchObject(type, flyingObject, monster->x, monster->y, 12, dir << 1, -1, monster->id | 0x8000, 0x3F))
deleteItem(flyingObject); deleteItem(flyingObject);
} }
} }
@ -1274,7 +1274,7 @@ bool LoLEngine::chasePartyWithDistanceAttacks(LoLMonster *monster) {
if (getBlockDistance(monster->block, _monsters[i].block) < 7) if (getBlockDistance(monster->block, _monsters[i].block) < 7)
setMonsterMode(monster, 7); setMonsterMode(monster, 7);
} }
_txt->printMessage(2, "%s", getLangString(0x401a)); _txt->printMessage(2, "%s", getLangString(0x401A));
} else if (flyingObject == 4) { } else if (flyingObject == 4) {
launchMagicViper(); launchMagicViper();
@ -1294,7 +1294,7 @@ bool LoLEngine::chasePartyWithDistanceAttacks(LoLMonster *monster) {
void LoLEngine::chasePartyWithCloseAttacks(LoLMonster *monster) { void LoLEngine::chasePartyWithCloseAttacks(LoLMonster *monster) {
if (!(monster->flags & 8)) { if (!(monster->flags & 8)) {
int dir = calcMonsterDirection(monster->x & 0xff00, monster->y & 0xff00, _partyPosX & 0xff00, _partyPosY & 0xff00); int dir = calcMonsterDirection(monster->x & 0xFF00, monster->y & 0xFF00, _partyPosX & 0xFF00, _partyPosY & 0xFF00);
int x1 = _partyPosX; int x1 = _partyPosX;
int y1 = _partyPosY; int y1 = _partyPosY;
@ -1396,11 +1396,11 @@ int LoLEngine::checkForPossibleDistanceAttack(uint16 monsterBlock, int direction
if (mdist > distance) if (mdist > distance)
return 5; return 5;
int dir = calcMonsterDirection(monsterBlock & 0x1f, monsterBlock >> 5, curBlock & 0x1f, curBlock >> 5); int dir = calcMonsterDirection(monsterBlock & 0x1F, monsterBlock >> 5, curBlock & 0x1F, curBlock >> 5);
if ((dir & 1) || (dir != (direction << 1))) if ((dir & 1) || (dir != (direction << 1)))
return 5; return 5;
if (((monsterBlock & 0x1f) != (curBlock & 0x1f)) && ((monsterBlock & 0xffe0) != (curBlock & 0xffe0))) if (((monsterBlock & 0x1F) != (curBlock & 0x1F)) && ((monsterBlock & 0xFFE0) != (curBlock & 0xFFE0)))
return 5; return 5;
if (distance < 0) if (distance < 0)
@ -1438,8 +1438,8 @@ void LoLEngine::getNextStepCoords(int16 srcX, int16 srcY, int &newX, int &newY,
static const int8 stepAdjustX[] = { 0, 32, 32, 32, 0, -32, -32, -32 }; static const int8 stepAdjustX[] = { 0, 32, 32, 32, 0, -32, -32, -32 };
static const int8 stepAdjustY[] = { -32, -32, 0, 32, 32, 32, 0, -32 }; static const int8 stepAdjustY[] = { -32, -32, 0, 32, 32, 32, 0, -32 };
newX = (srcX + stepAdjustX[direction]) & 0x1fff; newX = (srcX + stepAdjustX[direction]) & 0x1FFF;
newY = (srcY + stepAdjustY[direction]) & 0x1fff; newY = (srcY + stepAdjustY[direction]) & 0x1FFF;
} }
void LoLEngine::alignMonsterToParty(LoLMonster *monster) { void LoLEngine::alignMonsterToParty(LoLMonster *monster) {
@ -1447,7 +1447,7 @@ void LoLEngine::alignMonsterToParty(LoLMonster *monster) {
uint16 mx = monster->x; uint16 mx = monster->x;
uint16 my = monster->y; uint16 my = monster->y;
uint16 *pos = (mdir & 1) ? &my : &mx; uint16 *pos = (mdir & 1) ? &my : &mx;
bool centered = (*pos & 0x7f) == 0; bool centered = (*pos & 0x7F) == 0;
bool posFlag = true; bool posFlag = true;
if (monster->properties->maxWidth <= 63) { if (monster->properties->maxWidth <= 63) {
@ -1458,7 +1458,7 @@ void LoLEngine::alignMonsterToParty(LoLMonster *monster) {
r = true; r = true;
} else { } else {
uint16 id = _levelBlockProperties[monster->block].assignedObjects; uint16 id = _levelBlockProperties[monster->block].assignedObjects;
id = (id & 0x8000) ? (id & 0x7fff) : 0xffff; id = (id & 0x8000) ? (id & 0x7FFF) : 0xFFFF;
if (id != monster->id) { if (id != monster->id) {
r = true; r = true;
@ -1466,8 +1466,8 @@ void LoLEngine::alignMonsterToParty(LoLMonster *monster) {
for (int i = 0; i < 3; i++) { for (int i = 0; i < 3; i++) {
mdir = (mdir + 1) & 3; mdir = (mdir + 1) & 3;
id = _levelBlockProperties[calcNewBlockPosition(monster->block, mdir)].assignedObjects; id = _levelBlockProperties[calcNewBlockPosition(monster->block, mdir)].assignedObjects;
id = (id & 0x8000) ? (id & 0x7fff) : 0xffff; id = (id & 0x8000) ? (id & 0x7FFF) : 0xFFFF;
if (id != 0xffff) { if (id != 0xFFFF) {
r = true; r = true;
break; break;
} }

View file

@ -27,9 +27,9 @@
namespace Kyra { namespace Kyra {
int KyraRpgEngine::getBlockDistance(uint16 block1, uint16 block2) { int KyraRpgEngine::getBlockDistance(uint16 block1, uint16 block2) {
int b1x = block1 & 0x1f; int b1x = block1 & 0x1F;
int b1y = block1 >> 5; int b1y = block1 >> 5;
int b2x = block2 & 0x1f; int b2x = block2 & 0x1F;
int b2y = block2 >> 5; int b2y = block2 >> 5;
uint8 dy = ABS(b2y - b1y); uint8 dy = ABS(b2y - b1y);

View file

@ -1109,13 +1109,13 @@ const uint8 KyraEngine_LoK::_itemPosY[] = {
}; };
void GUI_LoK::initStaticResource() { void GUI_LoK::initStaticResource() {
GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0); GUI_V1_BUTTON(_scrollUpButton, 0x12, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0F, 0);
GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0f, 0); GUI_V1_BUTTON(_scrollDownButton, 0x13, 1, 1, 1, 0x483, 0, 0, 0, 0x18, 0x0F, 0);
GUI_V1_BUTTON(_menuButtonData[0], 0x0c, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[0], 0x0C, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[1], 0x0d, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[1], 0x0D, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[2], 0x0e, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[2], 0x0E, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[3], 0x0f, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[3], 0x0F, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[4], 0x10, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);
GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0); GUI_V1_BUTTON(_menuButtonData[5], 0x11, 1, 1, 1, 0x487, 0, 0, 0, 0, 0, 0);

View file

@ -1118,10 +1118,10 @@ void EoBEngine::initSpells() {
{ 0x0000, 0x000000, 0x00 }, // dummy { 0x0000, 0x000000, 0x00 }, // dummy
{ 0x0033, 0x000001, 0x00 }, // armor { 0x0033, 0x000001, 0x00 }, // armor
{ 0x0100, 0x000000, 0x21 }, // burning hands { 0x0100, 0x000000, 0x21 }, // burning hands
{ 0x004c, 0x000002, 0x00 }, // detect magic { 0x004C, 0x000002, 0x00 }, // detect magic
{ 0x0100, 0x000000, 0x01 }, // magic missile { 0x0100, 0x000000, 0x01 }, // magic missile
{ 0x0000, 0x000000, 0x00 }, // dummy { 0x0000, 0x000000, 0x00 }, // dummy
{ 0x008b, 0x000008, 0x00 }, // shield { 0x008B, 0x000008, 0x00 }, // shield
{ 0x0488, 0x000000, 0x03 }, // shocking grasp { 0x0488, 0x000000, 0x03 }, // shocking grasp
{ 0x0021, 0x000040, 0x00 }, // invisibility { 0x0021, 0x000040, 0x00 }, // invisibility
{ 0x0000, 0x000000, 0x00 }, // dummy { 0x0000, 0x000000, 0x00 }, // dummy
@ -1141,10 +1141,10 @@ void EoBEngine::initSpells() {
{ 0x0000, 0x000000, 0x00 }, // CLOUD KILL { 0x0000, 0x000000, 0x00 }, // CLOUD KILL
{ 0x0100, 0x000000, 0x41 }, // cone of cold { 0x0100, 0x000000, 0x41 }, // cone of cold
{ 0x0100, 0x000000, 0x00 }, // hold monster { 0x0100, 0x000000, 0x00 }, // hold monster
{ 0x005c, 0x000400, 0x00 }, // bless { 0x005C, 0x000400, 0x00 }, // bless
{ 0x0020, 0x000000, 0x00 }, // cure light wounds { 0x0020, 0x000000, 0x00 }, // cure light wounds
{ 0x0100, 0x000000, 0x01 }, // cause light wounds { 0x0100, 0x000000, 0x01 }, // cause light wounds
{ 0x004c, 0x000002, 0x00 }, // detect magic { 0x004C, 0x000002, 0x00 }, // detect magic
{ 0x0029, 0x000800, 0x00 }, // prot from evil { 0x0029, 0x000800, 0x00 }, // prot from evil
{ 0x0039, 0x000000, 0x00 }, // aid { 0x0039, 0x000000, 0x00 }, // aid
{ 0x2408, 0x000000, 0x21 }, // flame blade { 0x2408, 0x000000, 0x21 }, // flame blade
@ -1153,7 +1153,7 @@ void EoBEngine::initSpells() {
{ 0x0040, 0x000000, 0x00 }, // create food { 0x0040, 0x000000, 0x00 }, // create food
{ 0x1000, 0x000000, 0x00 }, // dispel magic { 0x1000, 0x000000, 0x00 }, // dispel magic
{ 0x0099, 0x004000, 0x00 }, // magical vestment { 0x0099, 0x004000, 0x00 }, // magical vestment
{ 0x004c, 0x008000, 0x00 }, // prayer { 0x004C, 0x008000, 0x00 }, // prayer
{ 0x0040, 0x000000, 0x00 }, // remove paralysis { 0x0040, 0x000000, 0x00 }, // remove paralysis
{ 0x0020, 0x000000, 0x00 }, // cure serious { 0x0020, 0x000000, 0x00 }, // cure serious
{ 0x0100, 0x000000, 0x01 }, // cause serious { 0x0100, 0x000000, 0x01 }, // cause serious

View file

@ -458,11 +458,11 @@ void LoLEngine::initStaticResource() {
} }
void GUI_LoL::initStaticData() { void GUI_LoL::initStaticData() {
GUI_V2_BUTTON(_scrollUpButton, 20, 96, 0, 1, 1, 1, 0x4487, 0, 0, 0, 25, 16, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0); GUI_V2_BUTTON(_scrollUpButton, 20, 96, 0, 1, 1, 1, 0x4487, 0, 0, 0, 25, 16, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0);
GUI_V2_BUTTON(_scrollDownButton, 21, 98, 0, 1, 1, 1, 0x4487, 0, 0, 0, 25, 16, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0); GUI_V2_BUTTON(_scrollDownButton, 21, 98, 0, 1, 1, 1, 0x4487, 0, 0, 0, 25, 16, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0);
for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i) for (uint i = 0; i < ARRAYSIZE(_menuButtons); ++i)
GUI_V2_BUTTON(_menuButtons[i], i, 0, 0, 0, 0, 0, 0x4487, 0, 0, 0, 0, 0, 0xfe, 0x01, 0xfe, 0x01, 0xfe, 0x01, 0); GUI_V2_BUTTON(_menuButtons[i], i, 0, 0, 0, 0, 0, 0x4487, 0, 0, 0, 0, 0, 0xFE, 0x01, 0xFE, 0x01, 0xFE, 0x01, 0);
if (_vm->gameFlags().isTalkie) if (_vm->gameFlags().isTalkie)
GUI_LOL_MENU(_mainMenu, 9, 0x4000, 0, 7, -1, -1, -1, -1); GUI_LOL_MENU(_mainMenu, 9, 0x4000, 0, 7, -1, -1, -1, -1);
@ -487,61 +487,61 @@ void GUI_LoL::initStaticData() {
for (int i = 0; i < _mainMenu.numberOfItems; ++i) for (int i = 0; i < _mainMenu.numberOfItems; ++i)
_mainMenu.item[i].callback = mainMenuFunctor; _mainMenu.item[i].callback = mainMenuFunctor;
GUI_LOL_MENU(_loadMenu, 10, 0x400e, 1, 5, 128, 20, 128, 118); GUI_LOL_MENU(_loadMenu, 10, 0x400E, 1, 5, 128, 20, 128, 118);
GUI_LOL_MENU_ITEM(_loadMenu.item[0], 0xfffe, 8, 39, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_loadMenu.item[0], 0xFFFE, 8, 39, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_loadMenu.item[1], 0xfffd, 8, 56, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_loadMenu.item[1], 0xFFFD, 8, 56, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_loadMenu.item[2], 0xfffc, 8, 73, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_loadMenu.item[2], 0xFFFC, 8, 73, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_loadMenu.item[3], 0xfffb, 8, 90, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_loadMenu.item[3], 0xFFFB, 8, 90, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_loadMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_loadMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
Button::Callback loadMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedLoadMenu); Button::Callback loadMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedLoadMenu);
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
_loadMenu.item[i].callback = loadMenuFunctor; _loadMenu.item[i].callback = loadMenuFunctor;
GUI_LOL_MENU(_saveMenu, 10, 0x400d, 1, 5, 128, 20, 128, 118); GUI_LOL_MENU(_saveMenu, 10, 0x400D, 1, 5, 128, 20, 128, 118);
GUI_LOL_MENU_ITEM(_saveMenu.item[0], 0xfffe, 8, 39, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_saveMenu.item[0], 0xFFFE, 8, 39, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_saveMenu.item[1], 0xfffd, 8, 56, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_saveMenu.item[1], 0xFFFD, 8, 56, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_saveMenu.item[2], 0xfffc, 8, 73, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_saveMenu.item[2], 0xFFFC, 8, 73, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_saveMenu.item[3], 0xfffb, 8, 90, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_saveMenu.item[3], 0xFFFB, 8, 90, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_saveMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_saveMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
Button::Callback saveMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedSaveMenu); Button::Callback saveMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedSaveMenu);
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
_saveMenu.item[i].callback = saveMenuFunctor; _saveMenu.item[i].callback = saveMenuFunctor;
GUI_LOL_MENU(_deleteMenu, 10, 0x400f, 1, 5, 128, 20, 128, 118); GUI_LOL_MENU(_deleteMenu, 10, 0x400F, 1, 5, 128, 20, 128, 118);
GUI_LOL_MENU_ITEM(_deleteMenu.item[0], 0xfffe, 8, 39, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_deleteMenu.item[0], 0xFFFE, 8, 39, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_deleteMenu.item[1], 0xfffd, 8, 56, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_deleteMenu.item[1], 0xFFFD, 8, 56, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_deleteMenu.item[2], 0xfffc, 8, 73, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_deleteMenu.item[2], 0xFFFC, 8, 73, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_deleteMenu.item[3], 0xfffb, 8, 90, 256, 15, 0, 0); GUI_LOL_MENU_ITEM(_deleteMenu.item[3], 0xFFFB, 8, 90, 256, 15, 0, 0);
GUI_LOL_MENU_ITEM(_deleteMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_deleteMenu.item[4], 0x4011, 168, 118, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
Button::Callback deleteMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedDeleteMenu); Button::Callback deleteMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedDeleteMenu);
for (int i = 0; i < 5; ++i) for (int i = 0; i < 5; ++i)
_deleteMenu.item[i].callback = deleteMenuFunctor; _deleteMenu.item[i].callback = deleteMenuFunctor;
GUI_LOL_MENU(_gameOptions, 17, 0x400c, 0, 6, -1, -1, -1, -1); GUI_LOL_MENU(_gameOptions, 17, 0x400C, 0, 6, -1, -1, -1, -1);
if (_vm->gameFlags().isTalkie) { if (_vm->gameFlags().isTalkie) {
GUI_LOL_MENU_ITEM(_gameOptions.item[0], 0xfff7, 120, 22, 80, 15, 0x406e, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[0], 0xFFF7, 120, 22, 80, 15, 0x406E, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[1], 0xfff6, 120, 39, 80, 15, 0x406c, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[1], 0xFFF6, 120, 39, 80, 15, 0x406C, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[2], 0xfff5, 120, 56, 80, 15, 0x406d, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[2], 0xFFF5, 120, 56, 80, 15, 0x406D, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[3], 0xfff4, 120, 73, 80, 15, 0x42d5, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[3], 0xFFF4, 120, 73, 80, 15, 0x42D5, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[4], 0xfff3, 120, 90, 80, 15, 0x42d2, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[4], 0xFFF3, 120, 90, 80, 15, 0x42D2, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[5], 0x4072, 104, 110, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_gameOptions.item[5], 0x4072, 104, 110, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
} else { } else {
GUI_LOL_MENU_ITEM(_gameOptions.item[0], 0xfff9, 120, 22, 80, 15, 0x406a, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[0], 0xFFF9, 120, 22, 80, 15, 0x406A, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[1], 0xfff8, 120, 39, 80, 15, 0x406b, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[1], 0xFFF8, 120, 39, 80, 15, 0x406B, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[2], 0xfff7, 120, 56, 80, 15, 0x406e, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[2], 0xFFF7, 120, 56, 80, 15, 0x406E, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[3], 0xfff6, 120, 73, 80, 15, 0x406c, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[3], 0xFFF6, 120, 73, 80, 15, 0x406C, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[4], 0xfff5, 120, 90, 80, 15, 0x406d, 0); GUI_LOL_MENU_ITEM(_gameOptions.item[4], 0xFFF5, 120, 90, 80, 15, 0x406D, 0);
GUI_LOL_MENU_ITEM(_gameOptions.item[5], 0x4072, 104, 110, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_gameOptions.item[5], 0x4072, 104, 110, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
} }
Button::Callback optionsMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedOptionsMenu); Button::Callback optionsMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedOptionsMenu);
for (int i = 0; i < _gameOptions.numberOfItems; ++i) for (int i = 0; i < _gameOptions.numberOfItems; ++i)
_gameOptions.item[i].callback = optionsMenuFunctor; _gameOptions.item[i].callback = optionsMenuFunctor;
GUI_LOL_MENU(_audioOptions, 18, 0x42d9, 2, 1, -1, -1, -1, -1); GUI_LOL_MENU(_audioOptions, 18, 0x42D9, 2, 1, -1, -1, -1, -1);
GUI_LOL_MENU_ITEM(_audioOptions.item[0], 0x4072, 152, 76, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]); GUI_LOL_MENU_ITEM(_audioOptions.item[0], 0x4072, 152, 76, 96, 15, 0, _vm->_keyMap[Common::KEYCODE_ESCAPE]);
GUI_LOL_MENU_ITEM(_audioOptions.item[1], 3, 128, 22, 114, 14, 0x42db, 0); GUI_LOL_MENU_ITEM(_audioOptions.item[1], 3, 128, 22, 114, 14, 0x42DB, 0);
GUI_LOL_MENU_ITEM(_audioOptions.item[2], 4, 128, 39, 114, 14, 0x42da, 0); GUI_LOL_MENU_ITEM(_audioOptions.item[2], 4, 128, 39, 114, 14, 0x42DA, 0);
GUI_LOL_MENU_ITEM(_audioOptions.item[3], 5, 128, 56, 114, 14, 0x42dc, 0); GUI_LOL_MENU_ITEM(_audioOptions.item[3], 5, 128, 56, 114, 14, 0x42DC, 0);
Button::Callback audioMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedAudioMenu); Button::Callback audioMenuFunctor = BUTTON_FUNCTOR(GUI_LoL, this, &GUI_LoL::clickedAudioMenu);
for (int i = 0; i < 4; ++i) for (int i = 0; i < 4; ++i)
_audioOptions.item[i].callback = audioMenuFunctor; _audioOptions.item[i].callback = audioMenuFunctor;

View file

@ -464,9 +464,9 @@ void KyraEngine_HoF::processDialogue(int dlgOffset, int vocH, int csEntry) {
nextTimSequence = READ_LE_UINT16(&_ingameTalkObjIndex[cmd]); nextTimSequence = READ_LE_UINT16(&_ingameTalkObjIndex[cmd]);
if (nextTimSequence == 10) { if (nextTimSequence == 10) {
if (queryGameFlag(0x3e)) if (queryGameFlag(0x3E))
nextTimSequence = 14; nextTimSequence = 14;
if (queryGameFlag(0x3f)) if (queryGameFlag(0x3F))
nextTimSequence = 15; nextTimSequence = 15;
if (queryGameFlag(0x40)) if (queryGameFlag(0x40))
nextTimSequence = 16; nextTimSequence = 16;

View file

@ -85,7 +85,7 @@ void TextDisplayer_LoL::setupField(bool mode) {
_screen->copyBlockToPage(3, 0, 0, 320, 200, _vm->_pageBuffer1); _screen->copyBlockToPage(3, 0, 0, 320, 200, _vm->_pageBuffer1);
_screen->setCurPage(cp); _screen->setCurPage(cp);
_vm->_updateFlags &= 0xfffd; _vm->_updateFlags &= 0xFFFD;
} }
} else { } else {
if (!mode) if (!mode)
@ -176,8 +176,8 @@ void TextDisplayer_LoL::printDialogueText(int dim, char *str, EMCState *script,
} }
void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) { void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) {
static const uint8 textColors256[] = { 0xfe, 0xa2, 0x84, 0x97, 0x9F }; static const uint8 textColors256[] = { 0xFE, 0xA2, 0x84, 0x97, 0x9F };
static const uint8 textColors16[] = { 0x33, 0xaa, 0x88, 0x55, 0x99 }; static const uint8 textColors16[] = { 0x33, 0xAA, 0x88, 0x55, 0x99 };
static const uint8 soundEffect[] = { 0x0B, 0x00, 0x2B, 0x1B, 0x00 }; static const uint8 soundEffect[] = { 0x0B, 0x00, 0x2B, 0x1B, 0x00 };
const uint8 *textColors = _vm->gameFlags().use16ColorMode ? textColors16 : textColors256; const uint8 *textColors = _vm->gameFlags().use16ColorMode ? textColors16 : textColors256;
@ -187,7 +187,7 @@ void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) {
else else
_vm->stopPortraitSpeechAnim(); _vm->stopPortraitSpeechAnim();
uint16 col = textColors[type & 0x7fff]; uint16 col = textColors[type & 0x7FFF];
int od = _screen->curDimIndex(); int od = _screen->curDimIndex();
@ -222,7 +222,7 @@ void TextDisplayer_LoL::printMessage(uint16 type, const char *str, ...) {
_vm->sound()->playSoundEffect(soundEffect[type]); _vm->sound()->playSoundEffect(soundEffect[type]);
} }
_vm->_textColorFlag = type & 0x7fff; _vm->_textColorFlag = type & 0x7FFF;
_vm->_fadeText = false; _vm->_fadeText = false;
} }

View file

@ -182,7 +182,7 @@ void TextDisplayer_rpg::displayText(char *str, ...) {
case 8: case 8:
printLine(_currentLine); printLine(_currentLine);
dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth); dv = _textDimData[sdx].column / (_screen->getFontWidth() + _screen->_charWidth);
dv = ((dv + 8) & 0xfff8) - 1; dv = ((dv + 8) & 0xFFF8) - 1;
if (dv >= charsPerLine) if (dv >= charsPerLine)
dv = 0; dv = 0;
_textDimData[sdx].column = (_screen->getFontWidth() + _screen->_charWidth) * dv; _textDimData[sdx].column = (_screen->getFontWidth() + _screen->_charWidth) * dv;
@ -266,7 +266,7 @@ void TextDisplayer_rpg::readNextPara() {
// versions depend on this code we'll have to look at this again. // versions depend on this code we'll have to look at this again.
#if 0 #if 0
if ((_vm->game() != GI_LOL) && (d & 0x80)) { if ((_vm->game() != GI_LOL) && (d & 0x80)) {
d &= 0x7f; d &= 0x7F;
c = d & 7; c = d & 7;
d = (d & 0x78) >> 3; d = (d & 0x78) >> 3;
uint8 l = d; uint8 l = d;
@ -394,14 +394,14 @@ void TextDisplayer_rpg::printLine(char *str) {
case 0x55: case 0x55:
col = 0x81; col = 0x81;
break; break;
case 0xaa: case 0xAA:
col = 0x21; col = 0x21;
break; break;
case 0x99: case 0x99:
col = 0xa1; col = 0xA1;
break; break;
case 0x33: case 0x33:
col = 0xe1; col = 0xE1;
break; break;
case 0x18: case 0x18:
col = 0x61; col = 0x61;
@ -561,8 +561,8 @@ void TextDisplayer_rpg::textPageBreak() {
} }
if (vm()->gameFlags().use16ColorMode) { if (vm()->gameFlags().use16ColorMode) {
vm()->gui_drawBox(x + 8, (y & ~7) - 1, 66, 10, 0xee, 0xcc, -1); vm()->gui_drawBox(x + 8, (y & ~7) - 1, 66, 10, 0xEE, 0xCC, -1);
_screen->printText(_pageBreakString, (x + 37 - (strlen(_pageBreakString) << 1) + 4) & ~3, (y + 2) & ~7, 0xc1, 0); _screen->printText(_pageBreakString, (x + 37 - (strlen(_pageBreakString) << 1) + 4) & ~3, (y + 2) & ~7, 0xC1, 0);
} else { } else {
vm()->gui_drawBox(x, y, w, vm()->guiSettings()->buttons.height, vm()->guiSettings()->colors.frame1, vm()->guiSettings()->colors.frame2, vm()->guiSettings()->colors.fill); vm()->gui_drawBox(x, y, w, vm()->guiSettings()->buttons.height, vm()->guiSettings()->colors.frame1, vm()->guiSettings()->colors.frame2, vm()->guiSettings()->colors.fill);
_screen->printText(_pageBreakString, x + (w >> 1) - (vm()->screen()->getTextWidth(_pageBreakString) >> 1), y + 2, vm()->_dialogueButtonLabelColor1, 0); _screen->printText(_pageBreakString, x + (w >> 1) - (vm()->screen()->getTextWidth(_pageBreakString) >> 1), y + 2, vm()->_dialogueButtonLabelColor1, 0);

View file

@ -57,7 +57,7 @@ void EoBCoreEngine::setupTimers() {
void EoBCoreEngine::setCharEventTimer(int charIndex, uint32 countdown, int evnt, int updateExistingTimer) { void EoBCoreEngine::setCharEventTimer(int charIndex, uint32 countdown, int evnt, int updateExistingTimer) {
uint32 ntime = _system->getMillis() + countdown * _tickLength; uint32 ntime = _system->getMillis() + countdown * _tickLength;
uint8 timerId = 0x30 | (charIndex & 0x0f); uint8 timerId = 0x30 | (charIndex & 0x0F);
EoBCharacter *c = &_characters[charIndex]; EoBCharacter *c = &_characters[charIndex];
if (!_timer->isEnabled(timerId)) { if (!_timer->isEnabled(timerId)) {
@ -118,7 +118,7 @@ void EoBCoreEngine::setupCharacterTimers() {
if (!testCharacter(i, 1)) if (!testCharacter(i, 1))
continue; continue;
uint32 nextTimer = 0xffffffff; uint32 nextTimer = 0xFFFFFFFF;
for (int ii = 0; ii < 10; ii++) { for (int ii = 0; ii < 10; ii++) {
if (c->timers[ii] && c->timers[ii] < nextTimer) if (c->timers[ii] && c->timers[ii] < nextTimer)
@ -126,7 +126,7 @@ void EoBCoreEngine::setupCharacterTimers() {
} }
uint32 ctime = _system->getMillis(); uint32 ctime = _system->getMillis();
if (nextTimer == 0xffffffff) if (nextTimer == 0xFFFFFFFF)
_timer->disable(0x30 | i); _timer->disable(0x30 | i);
else { else {
enableTimer(0x30 | i); enableTimer(0x30 | i);
@ -219,11 +219,11 @@ void EoBCoreEngine::timerProcessFlyingObjects(int timerNum) {
} }
void EoBCoreEngine::timerProcessMonsters(int timerNum) { void EoBCoreEngine::timerProcessMonsters(int timerNum) {
updateMonsters(timerNum & 0x0f); updateMonsters(timerNum & 0x0F);
} }
void EoBCoreEngine::timerSpecialCharacterUpdate(int timerNum) { void EoBCoreEngine::timerSpecialCharacterUpdate(int timerNum) {
int charIndex = timerNum & 0x0f; int charIndex = timerNum & 0x0F;
EoBCharacter *c = &_characters[charIndex]; EoBCharacter *c = &_characters[charIndex];
uint32 ctime = _system->getMillis(); uint32 ctime = _system->getMillis();
@ -309,13 +309,13 @@ void EoBCoreEngine::timerSpecialCharacterUpdate(int timerNum) {
_screen->setFont(of); _screen->setFont(of);
} }
uint32 nextTimer = 0xffffffff; uint32 nextTimer = 0xFFFFFFFF;
for (int i = 0; i < 10; i++) { for (int i = 0; i < 10; i++) {
if (c->timers[i] && c->timers[i] < nextTimer) if (c->timers[i] && c->timers[i] < nextTimer)
nextTimer = c->timers[i]; nextTimer = c->timers[i];
} }
if (nextTimer == 0xffffffff) if (nextTimer == 0xFFFFFFFF)
_timer->disable(timerNum); _timer->disable(timerNum);
else else
_timer->setCountdown(timerNum, (nextTimer - ctime) / _tickLength); _timer->setCountdown(timerNum, (nextTimer - ctime) / _tickLength);

View file

@ -49,7 +49,7 @@ void LoLEngine::setupTimers() {
} }
void LoLEngine::timerProcessMonsters(int timerNum) { void LoLEngine::timerProcessMonsters(int timerNum) {
for (int i = timerNum & 0x0f; i < 30; i += 2) for (int i = timerNum & 0x0F; i < 30; i += 2)
updateMonster(&_monsters[i]); updateMonster(&_monsters[i]);
} }
@ -77,7 +77,7 @@ void LoLEngine::timerSpecialCharacterUpdate(int timerNum) {
if (_characters[i].characterUpdateDelay[ii] > eventsLeft) if (_characters[i].characterUpdateDelay[ii] > eventsLeft)
eventsLeft = _characters[i].characterUpdateDelay[ii]; eventsLeft = _characters[i].characterUpdateDelay[ii];
} else { } else {
_characters[i].flags &= 0xfffb; _characters[i].flags &= 0xFFFB;
} }
gui_drawCharPortraitWithStats(i); gui_drawCharPortraitWithStats(i);
@ -89,7 +89,7 @@ void LoLEngine::timerSpecialCharacterUpdate(int timerNum) {
break; break;
case 2: case 2:
_characters[i].flags &= 0xffbf; _characters[i].flags &= 0xFFBF;
gui_drawCharPortraitWithStats(i); gui_drawCharPortraitWithStats(i);
break; break;
@ -104,7 +104,7 @@ void LoLEngine::timerSpecialCharacterUpdate(int timerNum) {
break; break;
case 4: case 4:
_characters[i].flags &= 0xfeff; _characters[i].flags &= 0xFEFF;
_txt->printMessage(0, getLangString(0x4027), _characters[i].name); _txt->printMessage(0, getLangString(0x4027), _characters[i].name);
gui_drawCharPortraitWithStats(i); gui_drawCharPortraitWithStats(i);
break; break;
@ -114,7 +114,7 @@ void LoLEngine::timerSpecialCharacterUpdate(int timerNum) {
break; break;
case 6: case 6:
_characters[i].flags &= 0xefff; _characters[i].flags &= 0xEFFF;
gui_drawCharPortraitWithStats(i); gui_drawCharPortraitWithStats(i);
break; break;
@ -146,7 +146,7 @@ void LoLEngine::timerProcessFlyingObjects(int timerNum) {
} }
void LoLEngine::timerRunSceneAnimScript(int timerNum) { void LoLEngine::timerRunSceneAnimScript(int timerNum) {
runLevelScript(0x401 + (timerNum & 0x0f), -1); runLevelScript(0x401 + (timerNum & 0x0F), -1);
} }
void LoLEngine::timerRegeneratePoints(int timerNum) { void LoLEngine::timerRegeneratePoints(int timerNum) {

View file

@ -126,8 +126,8 @@ void VQAMovie::decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsi
while (outsize > 0) { while (outsize > 0) {
input = *inbuf++ << 2; input = *inbuf++ << 2;
code = (input >> 8) & 0xff; code = (input >> 8) & 0xFF;
count = (input & 0xff) >> 2; count = (input & 0xFF) >> 2;
switch (code) { switch (code) {
case 2: case 2:
@ -149,7 +149,7 @@ void VQAMovie::decodeSND1(byte *inbuf, uint32 insize, byte *outbuf, uint32 outsi
for (; count >= 0; count--) { for (; count >= 0; count--) {
code = *inbuf++; code = *inbuf++;
curSample += WSTable4Bit[code & 0x0f]; curSample += WSTable4Bit[code & 0x0F];
curSample = CLIP<int16>(curSample, 0, 255); curSample = CLIP<int16>(curSample, 0, 255);
*outbuf++ = curSample; *outbuf++ = curSample;
@ -264,7 +264,7 @@ bool VQAMovie::open(const char *filename) {
_frameInfo = new uint32[_header.numFrames]; _frameInfo = new uint32[_header.numFrames];
_frame = new byte[_header.width * _header.height]; _frame = new byte[_header.width * _header.height];
_codeBookSize = 0xf00 * _header.blockW * _header.blockH; _codeBookSize = 0xF00 * _header.blockW * _header.blockH;
_codeBook = new byte[_codeBookSize]; _codeBook = new byte[_codeBookSize];
_partialCodeBook = new byte[_codeBookSize]; _partialCodeBook = new byte[_codeBookSize];
memset(_codeBook, 0, _codeBookSize); memset(_codeBook, 0, _codeBookSize);