aboutsummaryrefslogtreecommitdiff
path: root/engines/kyra
diff options
context:
space:
mode:
authorNorbert Lange2009-08-24 17:51:47 +0000
committerNorbert Lange2009-08-24 17:51:47 +0000
commit917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5 (patch)
treee652563203a00f8acecfaafbf93c64dbfbd13f25 /engines/kyra
parent5f87d5090cfcb34cda3c1f5d430e0865344d7366 (diff)
parentdd7868acc2512c9761d892e67a4837f4dc38bdc0 (diff)
downloadscummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.tar.gz
scummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.tar.bz2
scummvm-rg350-917d4b78b36d6c5a5c25a03e7ee6a1c1b6a85fd5.zip
Merge with trunk
svn-id: r43701
Diffstat (limited to 'engines/kyra')
-rw-r--r--engines/kyra/animator_lok.cpp7
-rw-r--r--engines/kyra/animator_lok.h1
-rw-r--r--engines/kyra/gui.cpp16
-rw-r--r--engines/kyra/gui_lok.cpp1
-rw-r--r--engines/kyra/kyra_v1.cpp5
-rw-r--r--engines/kyra/lol.cpp1
-rw-r--r--engines/kyra/lol.h4
-rw-r--r--engines/kyra/screen.cpp31
-rw-r--r--engines/kyra/screen.h2
-rw-r--r--engines/kyra/script_hof.cpp34
-rw-r--r--engines/kyra/script_lok.cpp104
-rw-r--r--engines/kyra/script_mr.cpp12
-rw-r--r--engines/kyra/sequences_lok.cpp1
-rw-r--r--engines/kyra/sequences_lol.cpp121
-rw-r--r--engines/kyra/staticres.cpp11
-rw-r--r--engines/kyra/text_lok.cpp1
16 files changed, 175 insertions, 177 deletions
diff --git a/engines/kyra/animator_lok.cpp b/engines/kyra/animator_lok.cpp
index a05eabe3e1..04c31a1422 100644
--- a/engines/kyra/animator_lok.cpp
+++ b/engines/kyra/animator_lok.cpp
@@ -37,7 +37,6 @@ Animator_LoK::Animator_LoK(KyraEngine_LoK *vm, OSystem *system) {
_vm = vm;
_screen = vm->screen();
_initOk = false;
- _updateScreen = false;
_system = system;
_screenObjects = _actors = _items = _sprites = _objectQueue = 0;
_noDrawShapesFlag = 0;
@@ -382,15 +381,11 @@ void Animator_LoK::copyChangedObjectsForward(int refreshFlag) {
_screen->copyRegion(xpos << 3, ypos, xpos << 3, ypos, width << 3, height, 2, 0);
curObject->refreshFlag = 0;
- _updateScreen = true;
}
}
}
- if (_updateScreen) {
- _screen->updateScreen();
- _updateScreen = false;
- }
+ _screen->updateScreen();
}
void Animator_LoK::updateAllObjectShapes() {
diff --git a/engines/kyra/animator_lok.h b/engines/kyra/animator_lok.h
index ba5882c710..618a210082 100644
--- a/engines/kyra/animator_lok.h
+++ b/engines/kyra/animator_lok.h
@@ -95,7 +95,6 @@ public:
int16 fetchAnimHeight(const uint8 *shape, int16 mult);
int _noDrawShapesFlag;
- bool _updateScreen;
uint16 _brandonDrawFrame;
int _brandonScaleX;
int _brandonScaleY;
diff --git a/engines/kyra/gui.cpp b/engines/kyra/gui.cpp
index cc1add9ce7..e49085103a 100644
--- a/engines/kyra/gui.cpp
+++ b/engines/kyra/gui.cpp
@@ -232,10 +232,11 @@ void GUI::processHighlights(Menu &menu) {
menu.highlightedItem = i;
redrawHighlight(menu);
- _screen->updateScreen();
}
}
}
+
+ _screen->updateScreen();
}
void GUI::redrawText(const Menu &menu) {
@@ -424,7 +425,8 @@ void GUI::checkTextfieldInput() {
Common::Point pos = _vm->getMousePos();
_vm->_mouseX = pos.x;
_vm->_mouseY = pos.y;
- _screen->updateScreen();
+
+ _vm->_system->updateScreen();
_lastScreenUpdate = now;
} break;
@@ -490,14 +492,24 @@ bool MainMenu::getInput() {
Common::Event event;
Common::EventManager *eventMan = _vm->getEventManager();
+ bool updateScreen = false;
+
while (eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONUP:
return true;
+
+ case Common::EVENT_MOUSEMOVE:
+ updateScreen = true;
+ break;
+
default:
break;
}
}
+
+ if (updateScreen)
+ _system->updateScreen();
return false;
}
diff --git a/engines/kyra/gui_lok.cpp b/engines/kyra/gui_lok.cpp
index e9c71f511d..3c5fbe4f1c 100644
--- a/engines/kyra/gui_lok.cpp
+++ b/engines/kyra/gui_lok.cpp
@@ -522,7 +522,6 @@ int GUI_LoK::buttonMenuCallback(Button *caller) {
if (_menuRestoreScreen) {
restorePalette();
_screen->loadPageFromDisk("SEENPAGE.TMP", 0);
- _vm->_animator->_updateScreen = true;
} else {
_screen->deletePageFromDisk(0);
}
diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp
index 9ee6935384..cf2b360d79 100644
--- a/engines/kyra/kyra_v1.cpp
+++ b/engines/kyra/kyra_v1.cpp
@@ -439,11 +439,8 @@ void KyraEngine_v1::updateInput() {
}
}
- // TODO: Check whether we should really call Screen::updateScreen here.
- // We might simply want to call OSystem::updateScreen instead, since Screen::updateScreen
- // copies changed screen parts to the screen buffer, which might not be desired.
if (updateScreen)
- screen()->updateScreen();
+ _system->updateScreen();
}
void KyraEngine_v1::removeInputTop() {
diff --git a/engines/kyra/lol.cpp b/engines/kyra/lol.cpp
index 816e244531..eb313821af 100644
--- a/engines/kyra/lol.cpp
+++ b/engines/kyra/lol.cpp
@@ -65,6 +65,7 @@ LoLEngine::LoLEngine(OSystem *system, const GameFlags &flags) : KyraEngine_v1(sy
case Common::JA_JPN:
_lang = 0;
+ break;
default:
warning("unsupported language, switching back to English");
diff --git a/engines/kyra/lol.h b/engines/kyra/lol.h
index 1c89a7a1eb..7a112cfd8f 100644
--- a/engines/kyra/lol.h
+++ b/engines/kyra/lol.h
@@ -366,6 +366,10 @@ private:
static const CharacterPrev _charPreviews[];
+ // PC98 specific data
+ static const uint16 _charPosXPC98[];
+ static const uint8 _charNamesPC98[][11];
+
WSAMovie_v2 *_chargenWSA;
static const uint8 _chargenFrameTableTalkie[];
static const uint8 _chargenFrameTableFloppy[];
diff --git a/engines/kyra/screen.cpp b/engines/kyra/screen.cpp
index f5570acd72..6542b15183 100644
--- a/engines/kyra/screen.cpp
+++ b/engines/kyra/screen.cpp
@@ -51,6 +51,7 @@ Screen::Screen(KyraEngine_v1 *vm, OSystem *system)
memset(_fonts, 0, sizeof(_fonts));
_currentFont = FID_8_FNT;
+ _paletteChanged = true;
}
Screen::~Screen() {
@@ -206,6 +207,9 @@ void Screen::setResolution() {
}
void Screen::updateScreen() {
+ bool needRealUpdate = _forceFullUpdate || !_dirtyRects.empty() || _paletteChanged;
+ _paletteChanged = false;
+
if (_useOverlays)
updateDirtyRectsOvl();
else if (_isAmiga && _interfacePaletteEnabled)
@@ -214,13 +218,16 @@ void Screen::updateScreen() {
updateDirtyRects();
if (_debugEnabled) {
+ needRealUpdate = true;
+
if (!_useOverlays)
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 320, 0, SCREEN_W, SCREEN_H);
else
_system->copyRectToScreen(getPagePtr(2), SCREEN_W, 640, 0, SCREEN_W, SCREEN_H);
}
- _system->updateScreen();
+ if (needRealUpdate)
+ _system->updateScreen();
}
void Screen::updateDirtyRects() {
@@ -330,6 +337,7 @@ void Screen::updateDirtyRectsOvl() {
_system->copyRectToScreen(dst, 640, it->left<<1, it->top<<1, it->width()<<1, it->height()<<1);
}
}
+
_forceFullUpdate = false;
_dirtyRects.clear();
}
@@ -562,6 +570,12 @@ void Screen::setPagePixel(int pageNum, int x, int y, uint8 color) {
assert(x >= 0 && x < SCREEN_W && y >= 0 && y < SCREEN_H);
if (pageNum == 0 || pageNum == 1)
addDirtyRect(x, y, 1, 1);
+
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
_pagePtrs[pageNum][y * SCREEN_W + x] = color;
}
@@ -703,6 +717,7 @@ void Screen::setScreenPalette(const Palette &pal) {
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 0, pal.getNumColors());
}
@@ -738,6 +753,7 @@ void Screen::setInterfacePalette(const Palette &pal, uint8 r, uint8 g, uint8 b)
screenPal[4 * i + 3] = 0;
}
+ _paletteChanged = true;
_system->setPalette(screenPal, 32, pal.getNumColors());
}
@@ -954,6 +970,11 @@ void Screen::fillRect(int x1, int y1, int x2, int y2, uint8 color, int pageNum,
clearOverlayRect(pageNum, x1, y1, x2-x1+1, y2-y1+1);
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (xored) {
for (; y1 <= y2; ++y1) {
for (int x = x1; x <= x2; ++x)
@@ -1035,6 +1056,11 @@ void Screen::drawClippedLine(int x1, int y1, int x2, int y2, int color) {
void Screen::drawLine(bool vertical, int x, int y, int length, int color) {
uint8 *ptr = getPagePtr(_curPage) + y * SCREEN_W + x;
+ if (_use16ColorMode) {
+ color &= 0x0F;
+ color |= (color << 4);
+ }
+
if (vertical) {
assert((y + length) <= SCREEN_H);
int currLine = 0;
@@ -2974,6 +3000,9 @@ byte *Screen::getOverlayPtr(int page) {
if (_vm->gameFlags().gameID == GI_KYRA2) {
if (page == 12 || page == 13)
return _sjisOverlayPtrs[3];
+ } else if (_vm->gameFlags().gameID == GI_LOL) {
+ if (page == 4 || page == 5)
+ return _sjisOverlayPtrs[3];
}
return 0;
diff --git a/engines/kyra/screen.h b/engines/kyra/screen.h
index 73a29ee2c7..7553a0132b 100644
--- a/engines/kyra/screen.h
+++ b/engines/kyra/screen.h
@@ -308,7 +308,6 @@ public:
virtual bool init();
virtual void setResolution();
-
void updateScreen();
// debug functions
@@ -508,6 +507,7 @@ protected:
};
bool _forceFullUpdate;
+ bool _paletteChanged;
Common::List<Common::Rect> _dirtyRects;
void addDirtyRect(int x, int y, int w, int h);
diff --git a/engines/kyra/script_hof.cpp b/engines/kyra/script_hof.cpp
index 1b8c1d32b3..a811952801 100644
--- a/engines/kyra/script_hof.cpp
+++ b/engines/kyra/script_hof.cpp
@@ -186,20 +186,14 @@ int KyraEngine_HoF::o2_displayWsaFrame(EMCState *script) {
int backUp = stackPos(8);
_screen->hideMouse();
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(frame, dstPage, x, y, copyParam | 0xC000, 0, 0);
_screen->updateScreen();
if (backUp)
memcpy(_gamePlayBuffer, _screen->getCPagePtr(3), 46080);
- while (_system->getMillis() < endTime) {
- if (doUpdate)
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(endTime, false, doUpdate != 0);
_screen->showMouse();
return 0;
}
@@ -224,34 +218,22 @@ int KyraEngine_HoF::o2_displayWsaSequentialFramesLooping(EMCState *script) {
while (curTime < maxTimes) {
if (startFrame < endFrame) {
for (int i = startFrame; i <= endFrame; ++i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10)
- delay(10);
- } while (_system->getMillis() < endTime);
+ delayUntil(endTime, false, true);
}
}
} else {
for (int i = startFrame; i >= endFrame; --i) {
- uint32 endTime = _system->getMillis() + waitTime * _tickLength;
+ const uint32 endTime = _system->getMillis() + waitTime * _tickLength;
_wsaSlots[slot]->displayFrame(i, 0, x, y, 0xC000 | copyFlags, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
-
- do {
- update();
-
- if (endTime - _system->getMillis() >= 10 && !skipFlag())
- delay(10);
- } while (_system->getMillis() < endTime && !skipFlag());
+ delayUntil(endTime, false, true);
}
}
}
@@ -282,7 +264,7 @@ int KyraEngine_HoF::o2_displayWsaSequentialFrames(EMCState *script) {
_screen->hideMouse();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
_screen->updateScreen();
@@ -310,7 +292,7 @@ int KyraEngine_HoF::o2_displayWsaSequence(EMCState *script) {
const int lastFrame = _wsaSlots[index]->frames();
while (currentFrame <= lastFrame) {
- uint32 endTime = _system->getMillis() + frameDelay;
+ const uint32 endTime = _system->getMillis() + frameDelay;
_wsaSlots[index]->displayFrame(currentFrame++, 0, stackPos(0), stackPos(1), copyParam, 0, 0);
if (!skipFlag()) {
if (doUpdate)
diff --git a/engines/kyra/script_lok.cpp b/engines/kyra/script_lok.cpp
index a778a2066b..0a96db8277 100644
--- a/engines/kyra/script_lok.cpp
+++ b/engines/kyra/script_lok.cpp
@@ -429,22 +429,13 @@ int KyraEngine_LoK::o1_runWSAFromBeginningToEnd(EMCState *script) {
int wsaFrame = 0;
while (running) {
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+
_movieObjects[wsaIndex]->displayFrame(wsaFrame++, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
if (wsaFrame >= _movieObjects[wsaIndex]->frames())
running = false;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- if (worldUpdate) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- } else {
- _screen->updateScreen();
- }
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, worldUpdate != 0);
}
_screen->showMouse();
@@ -460,18 +451,9 @@ int KyraEngine_LoK::o1_displayWSAFrame(EMCState *script) {
int waitTime = stackPos(3);
int wsaIndex = stackPos(4);
_screen->hideMouse();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
}
@@ -501,15 +483,9 @@ int KyraEngine_LoK::o1_runWSAFrames(EMCState *script) {
int wsaIndex = stackPos(5);
_screen->hideMouse();
for (; startFrame <= endFrame; ++startFrame) {
- uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
+ const uint32 nextRun = _system->getMillis() + delayTime * _tickLength;
_movieObjects[wsaIndex]->displayFrame(startFrame, 0, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- while (_system->getMillis() < nextRun) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextRun - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextRun, false, true);
}
_screen->showMouse();
return 0;
@@ -597,7 +573,6 @@ int KyraEngine_LoK::o1_setCustomPaletteRange(EMCState *script) {
int KyraEngine_LoK::o1_loadPageFromDisk(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_LoK::o1_loadPageFromDisk(%p) ('%s', %d)", (const void *)script, stackPosString(0), stackPos(1));
_screen->loadPageFromDisk(stackPosString(0), stackPos(1));
- _animator->_updateScreen = true;
return 0;
}
@@ -665,7 +640,6 @@ int KyraEngine_LoK::o1_copyWSARegion(EMCState *script) {
int srcPage = stackPos(4);
int dstPage = stackPos(5);
_screen->copyRegion(xpos, ypos, xpos, ypos, width, height, srcPage, dstPage);
- _animator->_updateScreen = true;
return 0;
}
@@ -693,18 +667,9 @@ int KyraEngine_LoK::o1_displayWSAFrameOnHidPage(EMCState *script) {
int wsaIndex = stackPos(4);
_screen->hideMouse();
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 2, xpos, ypos, 0, 0, 0);
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
_screen->showMouse();
return 0;
@@ -776,37 +741,17 @@ int KyraEngine_LoK::o1_displayWSASequentialFrames(EMCState *script) {
if (endFrame >= startFrame) {
int frame = startFrame;
while (endFrame >= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
++frame;
}
} else {
int frame = startFrame;
while (endFrame <= frame) {
- uint32 continueTime = waitTime * _tickLength + _system->getMillis();
+ const uint32 continueTime = waitTime * _tickLength + _system->getMillis();
_movieObjects[wsaIndex]->displayFrame(frame, 0, xpos, ypos, 0, 0, 0);
- if (waitTime)
- _animator->_updateScreen = true;
- while (_system->getMillis() < continueTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (skipFlag())
- break;
-
- if (continueTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(continueTime, false, true);
--frame;
}
}
@@ -1060,16 +1005,7 @@ int KyraEngine_LoK::o1_walkCharacterToPoint(EMCState *script) {
setCharacterPosition(character, 0);
++curPos;
- nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis();
- while (_system->getMillis() < nextFrame) {
- _sprites->updateSceneAnims();
- updateMousePointer();
- _timer->update();
- _animator->updateAllObjectShapes();
- updateTextFade();
- if ((nextFrame - _system->getMillis()) >= 10)
- delay(10);
- }
+ delayUntil(nextFrame = _timer->getDelay(5 + character) * _tickLength + _system->getMillis(), true, true);
}
return 0;
}
@@ -1318,9 +1254,8 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
assert(_amuleteAnim);
_screen->hideMouse();
snd_playSoundEffect(0x70);
- uint32 nextTime = 0;
for (int i = 0; _amuleteAnim[i] != 0xFF; ++i) {
- nextTime = _system->getMillis() + 5 * _tickLength;
+ const uint32 nextTime = _system->getMillis() + 5 * _tickLength;
uint8 code = _amuleteAnim[i];
if (code == 3 || code == 7)
@@ -1333,14 +1268,7 @@ int KyraEngine_LoK::o1_makeAmuletAppear(EMCState *script) {
snd_playSoundEffect(0x73);
amulet->displayFrame(code, 0, 224, 152, 0, 0, 0);
- _animator->_updateScreen = true;
-
- while (_system->getMillis() < nextTime) {
- _sprites->updateSceneAnims();
- _animator->updateAllObjectShapes();
- if (nextTime - _system->getMillis() >= 10)
- delay(10);
- }
+ delayUntil(nextTime, false, true);
}
_screen->showMouse();
}
diff --git a/engines/kyra/script_mr.cpp b/engines/kyra/script_mr.cpp
index 819bf838ca..9943fe419d 100644
--- a/engines/kyra/script_mr.cpp
+++ b/engines/kyra/script_mr.cpp
@@ -266,7 +266,7 @@ int KyraEngine_MR::o3_wipeDownMouseItem(EMCState *script) {
for (int curY = y, height = 20; height > 0; height -= 2, curY += 2) {
restoreGfxRect32x32(x, y);
_screen->setNewShapeHeight(shape, height);
- uint32 waitTime = _system->getMillis() + _tickLength;
+ const uint32 waitTime = _system->getMillis() + _tickLength;
_screen->drawShape(0, shape, x, curY, 0, 0);
_screen->updateScreen();
delayUntil(waitTime);
@@ -1131,15 +1131,7 @@ int KyraEngine_MR::o3d_updateAnim(EMCState *script) {
int KyraEngine_MR::o3d_delay(EMCState *script) {
debugC(3, kDebugLevelScriptFuncs, "KyraEngine_MR::o3d_delay(%p) (%d)", (const void *)script, stackPos(0));
- const uint32 endTime = _system->getMillis() + stackPos(0) * _tickLength;
- while (_system->getMillis() < endTime) {
- if (_chatText)
- updateWithText();
- else
- update();
-
- _system->delayMillis(10);
- }
+ delayUntil(_system->getMillis() + stackPos(0) * _tickLength, false, true);
return 0;
}
diff --git a/engines/kyra/sequences_lok.cpp b/engines/kyra/sequences_lok.cpp
index 26c09bcf43..16c9b75f3a 100644
--- a/engines/kyra/sequences_lok.cpp
+++ b/engines/kyra/sequences_lok.cpp
@@ -1952,7 +1952,6 @@ void KyraEngine_LoK::updateKyragemFading() {
}
_screen->setScreenPalette(_screen->getPalette(0));
- _animator->_updateScreen = true;
switch (_kyragemFadingState.nextOperation) {
case 0:
diff --git a/engines/kyra/sequences_lol.cpp b/engines/kyra/sequences_lol.cpp
index c1ceba34e9..3b061e5062 100644
--- a/engines/kyra/sequences_lol.cpp
+++ b/engines/kyra/sequences_lol.cpp
@@ -289,18 +289,56 @@ int LoLEngine::chooseCharacter() {
_screen->setFont(Screen::FID_9_FNT);
_screen->_curPage = 2;
- for (int i = 0; i < 4; ++i)
- _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->fillRect(68, 167, 310, 199, 17);
+ _screen->drawClippedLine(68, 166, 311, 166, 238);
+ _screen->drawClippedLine(68, 166, 68, 199, 238);
+ _screen->drawClippedLine(311, 166, 311, 199, 238);
- for (int i = 0; i < 4; ++i) {
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
- _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
- }
+ _screen->_curPage = 4;
+ _screen->fillRect(17, 29, 94, 97, 17);
+ _screen->_curPage = 2;
+
+ for (int i = 0; i < 4; ++i) {
+ _screen->printText((const char *)_charNamesPC98[i], _charPosXPC98[i], 168, 0xC1, 0x00);
+
+ // Since our SJIS font does not support ASCII digits currently, we have to use the
+ // digits from the SJIS range, which looks different to the original.
+ for (int j = 0; j < 3; ++j) {
+ uint8 buffer[5];
+ snprintf((char *)buffer, 5, "%2d", _charPreviews[i].attrib[j]);
+
+ buffer[3] = buffer[1] - '0' + 0x4F;
+ buffer[2] = 0x82;
+ if (buffer[0] != ' ') {
+ buffer[1] = buffer[0] - '0' + 0x4F;
+ buffer[0] = 0x82;
+ } else {
+ buffer[1] = 0x40;
+ buffer[0] = 0x81;
+ }
+ buffer[4] = 0x00;
+
+ _screen->printText((const char *)buffer, _charPosXPC98[i] + 16, 176 + j * 8, 0x81, 0x00);
+ }
+ }
- _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
- _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
- _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ _screen->printText(_tim->getCTableEntry(51), 72, 176, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(53), 72, 184, 0x81, 0x00);
+ _screen->printText(_tim->getCTableEntry(55), 72, 192, 0x81, 0x00);
+ } else {
+ for (int i = 0; i < 4; ++i) {
+ _screen->fprintStringIntro("%s", _charPreviews[i].x + 16, _charPreviews[i].y + 36, 0xC0, 0x00, 0x9C, 0x120, _charPreviews[i].name);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 48, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[0]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 56, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[1]);
+ _screen->fprintStringIntro("%d", _charPreviews[i].x + 21, _charPreviews[i].y + 64, 0x98, 0x00, 0x9C, 0x220, _charPreviews[i].attrib[2]);
+ }
+
+ _screen->fprintStringIntro("%s", 36, 173, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(51));
+ _screen->fprintStringIntro("%s", 36, 181, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(53));
+ _screen->fprintStringIntro("%s", 36, 189, 0x98, 0x00, 0x9C, 0x20, _tim->getCTableEntry(55));
+ }
_screen->copyRegion(0, 0, 0, 0, 320, 200, 2, 0, Screen::CR_NO_P_CHECK);
_screen->_curPage = 0;
@@ -337,6 +375,8 @@ int LoLEngine::chooseCharacter() {
} else {
break;
}
+
+ delay(10);
}
if (shouldQuit())
@@ -363,11 +403,13 @@ void LoLEngine::kingSelectionIntro() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 38;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(58));
- _screen->fprintStringIntro("%s", 8, y + 20, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(59));
- _screen->fprintStringIntro("%s", 8, y + 30, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(60));
- _screen->fprintStringIntro("%s", 8, y + 40, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(61));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(57 + i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 8, y + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(57 + i));
+ }
_sound->voicePlay("KING01", &_speechHandle);
@@ -405,8 +447,13 @@ void LoLEngine::kingSelectionReminder() {
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
int y = 48;
- _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
- _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ if (_flags.platform == Common::kPlatformPC98) {
+ _screen->printText(_tim->getCTableEntry(62), 16, 32, 0xC1, 0x00);
+ _screen->printText(_tim->getCTableEntry(63), 16, 40, 0xC1, 0x00);
+ } else {
+ _screen->fprintStringIntro("%s", 8, y, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(62));
+ _screen->fprintStringIntro("%s", 8, y + 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(63));
+ }
_sound->voicePlay("KING02", &_speechHandle);
@@ -540,13 +587,17 @@ int LoLEngine::selectionCharInfo(int character) {
static const uint8 charSelectInfoIdx[] = { 0x1D, 0x22, 0x27, 0x2C };
const int idx = charSelectInfoIdx[character];
- _screen->fprintStringIntro("%s", 50, 127, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+0));
- _screen->fprintStringIntro("%s", 50, 137, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+1));
- _screen->fprintStringIntro("%s", 50, 147, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+2));
- _screen->fprintStringIntro("%s", 50, 157, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+3));
- _screen->fprintStringIntro("%s", 50, 167, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+4));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(idx+i), 60, 128 + i * 8, 0x41, 0x00);
+
+ _screen->printText(_tim->getCTableEntry(69), 112, 168, 0x01, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 50, 127 + i * 10, 0x53, 0x00, 0xCF, 0x20, _tim->getCTableEntry(idx+i));
- _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ _screen->fprintStringIntro("%s", 100, 168, 0x32, 0x00, 0xCF, 0x20, _tim->getCTableEntry(69));
+ }
selectionCharInfoIntro(vocFilename);
if (_charSelectionInfoResult == -1) {
@@ -568,11 +619,13 @@ int LoLEngine::selectionCharInfo(int character) {
_screen->copyRegion(48, 127, 48, 160, 272, 35, 4, 0, Screen::CR_NO_P_CHECK);
_screen->copyRegion(0, 0, 0, 0, 112, 120, 4, 0, Screen::CR_NO_P_CHECK);
- _screen->fprintStringIntro("%s", 3, 28, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64));
- _screen->fprintStringIntro("%s", 3, 38, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(65));
- _screen->fprintStringIntro("%s", 3, 48, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(66));
- _screen->fprintStringIntro("%s", 3, 58, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(67));
- _screen->fprintStringIntro("%s", 3, 68, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(68));
+ if (_flags.platform == Common::kPlatformPC98) {
+ for (int i = 0; i < 5; ++i)
+ _screen->printText(_tim->getCTableEntry(64+i), 16, 32 + i * 8, 0xC1, 0x00);
+ } else {
+ for (int i = 0; i < 5; ++i)
+ _screen->fprintStringIntro("%s", 3, 28 + i * 10, 0x32, 0x00, 0x9C, 0x20, _tim->getCTableEntry(64+i));
+ }
resetSkipFlag();
kingSelectionOutro();
@@ -875,20 +928,15 @@ void HistoryPlayer::play() {
while (sound->voiceIsPlaying() && !_vm->shouldQuit() && !_vm->skipFlag())
_vm->delay(10);
- if (_vm->skipFlag()) {
+ if (_vm->skipFlag())
sound->voiceStop();
- _vm->resetSkipFlag();
- }
++voiceFilename[4];
}
-
- if (_vm->skipFlag())
- _vm->resetSkipFlag();
}
if (_vm->skipFlag())
- _vm->resetSkipFlag();
+ _vm->_eventList.clear();
pal.fill(0, 256, 63);
if (_fireWsa->opened())
@@ -899,6 +947,9 @@ void HistoryPlayer::play() {
_screen->clearPage(0);
pal.fill(0, 256, 0);
_screen->fadePalette(pal, 0x3C);
+
+ if (_vm->skipFlag())
+ _vm->_eventList.clear();
}
void HistoryPlayer::loadWsa(const char *filename) {
diff --git a/engines/kyra/staticres.cpp b/engines/kyra/staticres.cpp
index d4882a12af..be73df47f7 100644
--- a/engines/kyra/staticres.cpp
+++ b/engines/kyra/staticres.cpp
@@ -3208,6 +3208,17 @@ const LoLEngine::CharacterPrev LoLEngine::_charPreviews[] = {
{ "Conrad", 0x10F, 0x7F, { 0x0A, 0x0C, 0x0A } }
};
+const uint16 LoLEngine::_charPosXPC98[] = {
+ 92, 152, 212, 268
+};
+
+const uint8 LoLEngine::_charNamesPC98[][11] = {
+ { 0x83, 0x41, 0x83, 0x4E, 0x83, 0x56, 0x83, 0x46, 0x83, 0x8B, 0x00 },
+ { 0x83, 0x7D, 0x83, 0x43, 0x83, 0x50, 0x83, 0x8B, 0x00, 0x00, 0x00 },
+ { 0x83, 0x4C, 0x81, 0x5B, 0x83, 0x89, 0x83, 0x93, 0x00, 0x00, 0x00 },
+ { 0x83, 0x52, 0x83, 0x93, 0x83, 0x89, 0x83, 0x62, 0x83, 0x68, 0x00 }
+};
+
const uint8 LoLEngine::_chargenFrameTableTalkie[] = {
0x00, 0x01, 0x02, 0x03, 0x04,
0x05, 0x04, 0x03, 0x02, 0x01,
diff --git a/engines/kyra/text_lok.cpp b/engines/kyra/text_lok.cpp
index d2128b7037..178966196c 100644
--- a/engines/kyra/text_lok.cpp
+++ b/engines/kyra/text_lok.cpp
@@ -97,7 +97,6 @@ void KyraEngine_LoK::waitForChatToFinish(int vocFile, int16 chatDuration, const
currPage = _screen->_curPage;
_screen->_curPage = 2;
_text->printCharacterText(chatStr, charNum, _characterList[charNum].x1);
- _animator->_updateScreen = true;
_screen->_curPage = currPage;
}