From 11a7993085d30f113fc7a8cc85c4202717be21e8 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 18 Nov 2011 03:26:21 +0100 Subject: KYRA: Add some assert for debugging purposes. --- engines/kyra/kyra_v1.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index c950612a42..bf0c23bf69 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -183,6 +183,7 @@ Common::Error KyraEngine_v1::init() { assert(_staticres); if (!_staticres->init()) error("_staticres->init() failed"); + assert(screen()); if (!screen()->init()) error("screen()->init() failed"); _timer = new TimerManager(this, _system); -- cgit v1.2.3 From cfac223cee7cc8136fdf43dea1465a1b060a803b Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Fri, 18 Nov 2011 03:47:51 +0100 Subject: KYRA: "Fix" bug #3166235 "KYRA: Crash on startup on OS X due to invalid PAK file". Now we can show such errors in the debugger, since we initialize and the screen resolution and the debugger before initializing the resource manager. This allows our error function to open up the debugger and show the error at least. A better feedback to the user might be desirable, but it is not really feasible with our current possibilites for error reporting. --- engines/kyra/kyra_v1.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index bf0c23bf69..dbdcda22d5 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -85,8 +85,9 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) void KyraEngine_v1::pauseEngineIntern(bool pause) { Engine::pauseEngineIntern(pause); if (_sound) - _sound->pause(pause); - _timer->pause(pause); + _sound->pause(pause); + if (_timer) + _timer->pause(pause); } Common::Error KyraEngine_v1::init() { -- cgit v1.2.3 From 540d081a6fd4daa31f746ddf30ccc91fb88ea04b Mon Sep 17 00:00:00 2001 From: athrxx Date: Sun, 11 Dec 2011 01:57:03 +0100 Subject: KYRA: (EOB) - initial code base commit --- engines/kyra/kyra_v1.cpp | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index dbdcda22d5..f5ef0d09ac 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -211,7 +211,7 @@ Common::Error KyraEngine_v1::init() { } KyraEngine_v1::~KyraEngine_v1() { - for (Common::Array::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i) + for (Common::Array::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i) delete *i; _opcodes.clear(); _keyMap.clear(); @@ -354,14 +354,14 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) } void KyraEngine_v1::setupKeyMap() { - struct KeyMapEntry { + struct KeyCodeMapEntry { Common::KeyCode kcScummVM; int16 kcDOS; int16 kcPC98; }; #define KC(x) Common::KEYCODE_##x - static const KeyMapEntry keys[] = { + static const KeyCodeMapEntry keys[] = { { KC(SPACE), 61, 53 }, { KC(RETURN), 43, 29 }, { KC(UP), 96, 68 }, @@ -377,13 +377,48 @@ void KyraEngine_v1::setupKeyMap() { { KC(KP7), 91, 67 }, { KC(PAGEUP), 101, 69 }, { KC(KP9), 101, 69 }, + { KC(END), 93, 0/*unknown*/ }, + { KC(KP1), 93, 0/*unknown*/ }, + { KC(PAGEDOWN), 103, 0/*unknown*/ }, + { KC(KP3), 103, 0/*unknown*/ }, { KC(F1), 112, 99 }, { KC(F2), 113, 100 }, { KC(F3), 114, 101 }, + { KC(F4), 115, 102 }, + { KC(F5), 116, 103 }, + { KC(F6), 117, 104 }, + { KC(a), 31, 31 }, + { KC(b), 50, 50 }, + { KC(c), 48, 48 }, + { KC(d), 33, 33 }, + { KC(e), 19, 19 }, + { KC(f), 34, 34 }, + { KC(i), 24, 24 }, + { KC(k), 38, 38 }, + { KC(m), 52, 52 }, + { KC(n), 51, 51 }, { KC(o), 25, 25 }, + { KC(p), 26, 26 }, { KC(r), 20, 20 }, + { KC(s), 32, 32 }, + { KC(w), 18, 18 }, + { KC(y), 22, 22 }, + { KC(z), 46, 46 }, + { KC(1), 2, 0/*unknown*/ }, + { KC(2), 3, 0/*unknown*/ }, + { KC(3), 4, 0/*unknown*/ }, + { KC(4), 5, 0/*unknown*/ }, + { KC(5), 6, 0/*unknown*/ }, + { KC(6), 7, 0/*unknown*/ }, + { KC(7), 8, 0/*unknown*/ }, { KC(SLASH), 55, 55 }, { KC(ESCAPE), 110, 1 }, + { KC(MINUS), 12, 0/*unknown*/ }, + { KC(KP_MINUS), 105, 0/*unknown*/ }, + { KC(PLUS), 13, 0/*unknown*/ }, + { KC(KP_PLUS), 106, 0/*unknown*/ }, + { KC(COMMA), 53, 0/*unknown*/ }, + { KC(PERIOD), 54, 0/*unknown*/ } }; #undef KC -- cgit v1.2.3 From 6853452bcbed083aa84638f11e4ce04ca189f0a1 Mon Sep 17 00:00:00 2001 From: athrxx Date: Fri, 17 Jun 2011 17:35:00 +0200 Subject: KYRA: (EOB) - fix shift key input --- engines/kyra/kyra_v1.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index f5ef0d09ac..c1b9f2a453 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -285,10 +285,13 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) } } else { KeyMap::const_iterator keycode = _keyMap.find(event.kbd.keycode); - if (keycode != _keyMap.end()) + if (keycode != _keyMap.end()) { keys = keycode->_value; - else + if (event.kbd.flags & Common::KBD_SHIFT) + keys |= 0x100; + } else { keys = 0; + } // When we got an keypress, which we might need to handle, // break the event loop and pass it to GUI code. -- cgit v1.2.3 From 97e5036bf0022f1b5e2ce5a9fe3a11d5f3216b50 Mon Sep 17 00:00:00 2001 From: athrxx Date: Thu, 23 Jun 2011 22:42:12 +0200 Subject: KYRA: (EOB) - more work on ingame menus --- engines/kyra/kyra_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index c1b9f2a453..72cc5bc396 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -345,7 +345,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) _eventList.erase(_eventList.begin()); } - GUI *guiInstance = gui(); + GUI_v1 *guiInstance = gui(); if (guiInstance) { if (keys) return guiInstance->processButtonList(buttonList, keys | eventFlag, mouseWheel); -- cgit v1.2.3 From 76bfcf834d73a9578164842ed5ab8e1eff2814e8 Mon Sep 17 00:00:00 2001 From: athrxx Date: Wed, 16 Nov 2011 19:16:19 +0100 Subject: KYRA: (EOB) - some refactoring --- engines/kyra/kyra_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 72cc5bc396..c1b9f2a453 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -345,7 +345,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) _eventList.erase(_eventList.begin()); } - GUI_v1 *guiInstance = gui(); + GUI *guiInstance = gui(); if (guiInstance) { if (keys) return guiInstance->processButtonList(buttonList, keys | eventFlag, mouseWheel); -- cgit v1.2.3 From 692f9ee6d524752bf1b1d169f81f68309901187a Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 12 Dec 2011 19:05:29 +0100 Subject: KYRA: whitespace cleanup --- engines/kyra/kyra_v1.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index c1b9f2a453..b818243a08 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -406,7 +406,7 @@ void KyraEngine_v1::setupKeyMap() { { KC(s), 32, 32 }, { KC(w), 18, 18 }, { KC(y), 22, 22 }, - { KC(z), 46, 46 }, + { KC(z), 46, 46 }, { KC(1), 2, 0/*unknown*/ }, { KC(2), 3, 0/*unknown*/ }, { KC(3), 4, 0/*unknown*/ }, -- cgit v1.2.3 From 9b51b138db7ccc8dbc55ca200f1a4aff688f6d89 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Mon, 26 Dec 2011 21:19:29 +0100 Subject: KYRA: Some formatting fixes. --- engines/kyra/kyra_v1.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index b818243a08..e60913ca6e 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -211,7 +211,7 @@ Common::Error KyraEngine_v1::init() { } KyraEngine_v1::~KyraEngine_v1() { - for (Common::Array::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i) + for (Common::Array::iterator i = _opcodes.begin(); i != _opcodes.end(); ++i) delete *i; _opcodes.clear(); _keyMap.clear(); @@ -262,7 +262,7 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode >= Common::KEYCODE_1 && event.kbd.keycode <= Common::KEYCODE_9 && - (event.kbd.hasFlags(Common::KBD_CTRL) || event.kbd.hasFlags(Common::KBD_ALT)) && mainLoop) { + (event.kbd.hasFlags(Common::KBD_CTRL) || event.kbd.hasFlags(Common::KBD_ALT)) && mainLoop) { int saveLoadSlot = 9 - (event.kbd.keycode - Common::KEYCODE_0) + 990; if (event.kbd.hasFlags(Common::KBD_CTRL)) { @@ -440,10 +440,10 @@ void KyraEngine_v1::updateInput() { switch (event.type) { case Common::EVENT_KEYDOWN: if (event.kbd.keycode == Common::KEYCODE_PERIOD || event.kbd.keycode == Common::KEYCODE_ESCAPE || - event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_RETURN || - event.kbd.keycode == Common::KEYCODE_UP || event.kbd.keycode == Common::KEYCODE_RIGHT || - event.kbd.keycode == Common::KEYCODE_DOWN || event.kbd.keycode == Common::KEYCODE_LEFT) - _eventList.push_back(Event(event, true)); + event.kbd.keycode == Common::KEYCODE_SPACE || event.kbd.keycode == Common::KEYCODE_RETURN || + event.kbd.keycode == Common::KEYCODE_UP || event.kbd.keycode == Common::KEYCODE_RIGHT || + event.kbd.keycode == Common::KEYCODE_DOWN || event.kbd.keycode == Common::KEYCODE_LEFT) + _eventList.push_back(Event(event, true)); else if (event.kbd.keycode == Common::KEYCODE_q && event.kbd.hasFlags(Common::KBD_CTRL)) quitGame(); else @@ -574,11 +574,11 @@ void KyraEngine_v1::readSettings() { bool subtitles = ConfMan.getBool("subtitles"); if (!speechMute && subtitles) - _configVoice = 2; // Voice & Text + _configVoice = 2; // Voice & Text else if (!speechMute && !subtitles) - _configVoice = 1; // Voice only + _configVoice = 1; // Voice only else - _configVoice = 0; // Text only + _configVoice = 0; // Text only setWalkspeed(_configWalkspeed); } @@ -593,15 +593,15 @@ void KyraEngine_v1::writeSettings() { ConfMan.setBool("sfx_mute", _configSounds == 0); switch (_configVoice) { - case 0: // Text only + case 0: // Text only speechMute = true; subtitles = true; break; - case 1: // Voice only + case 1: // Voice only speechMute = false; subtitles = false; break; - default: // Voice & Text + default: // Voice & Text speechMute = false; subtitles = true; } -- cgit v1.2.3 From 4fd0e9e94ba5a4e4b11a9e993f69350f70564227 Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 3 Jan 2012 08:38:14 +0100 Subject: KYRA: (EOB) - improve keyboard control for spell book cursor with non QWERTZ keyboards --- engines/kyra/kyra_v1.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index e60913ca6e..7167d41550 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -420,8 +420,18 @@ void KyraEngine_v1::setupKeyMap() { { KC(KP_MINUS), 105, 0/*unknown*/ }, { KC(PLUS), 13, 0/*unknown*/ }, { KC(KP_PLUS), 106, 0/*unknown*/ }, + + // Multiple mappings for the keys to the right of the 'M' key, + // since these are different for QWERTZ, QWERTY and AZERTY keyboards. + // QWERTZ { KC(COMMA), 53, 0/*unknown*/ }, - { KC(PERIOD), 54, 0/*unknown*/ } + { KC(PERIOD), 54, 0/*unknown*/ }, + // AZERTY + { KC(SEMICOLON), 53, 0/*unknown*/ }, + { KC(COLON), 54, 0/*unknown*/ }, + // QWERTY + { KC(LESS), 53, 0/*unknown*/ }, + { KC(GREATER), 54, 0/*unknown*/ } }; #undef KC -- cgit v1.2.3 From 86a817beb5eef248c5f5e28f18133db802a59c2e Mon Sep 17 00:00:00 2001 From: athrxx Date: Mon, 13 Feb 2012 18:39:50 +0100 Subject: KYRA: (EOB) - start work on CGA and EGA graphics modes --- engines/kyra/kyra_v1.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 7167d41550..0f7da7673b 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -42,6 +42,8 @@ KyraEngine_v1::KyraEngine_v1(OSystem *system, const GameFlags &flags) _emc = 0; _debugger = 0; + _configRenderMode = Common::kRenderDefault; + if (_flags.platform == Common::kPlatformAmiga) _gameSpeed = 50; else @@ -163,6 +165,9 @@ Common::Error KyraEngine_v1::init() { if (_sound) _sound->updateVolumeSettings(); + if (ConfMan.hasKey("render_mode")) + _configRenderMode = Common::parseRenderMode(ConfMan.get("render_mode")); + _res = new Resource(this); assert(_res); _res->reset(); -- cgit v1.2.3 From 66da4777d476c6a9fc2a13351e3b30afc748fd94 Mon Sep 17 00:00:00 2001 From: athrxx Date: Tue, 21 Feb 2012 21:14:28 +0100 Subject: KYRA: (EOB) - implement EGA mode (hi res dithering) for EOB II (also fix various thing connected to CGA/EGA modes) --- engines/kyra/kyra_v1.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 0f7da7673b..7c67af2f13 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -230,7 +230,7 @@ KyraEngine_v1::~KyraEngine_v1() { delete _debugger; } -Common::Point KyraEngine_v1::getMousePos() const { +Common::Point KyraEngine_v1::getMousePos() { Common::Point mouse = _eventMan->getMousePos(); if (_flags.useHiResOverlay) { @@ -238,6 +238,9 @@ Common::Point KyraEngine_v1::getMousePos() const { mouse.y >>= 1; } + mouse.x /= screen()->getPageScaleFactor(0); + mouse.y /= screen()->getPageScaleFactor(0); + return mouse; } @@ -313,6 +316,8 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) _mouseX >>= 1; _mouseY >>= 1; } + _mouseX /= screen()->getPageScaleFactor(0); + _mouseY /= screen()->getPageScaleFactor(0); keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800)); breakLoop = true; } break; @@ -325,6 +330,8 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) _mouseX >>= 1; _mouseY >>= 1; } + _mouseX /= screen()->getPageScaleFactor(0); + _mouseY /= screen()->getPageScaleFactor(0); keys = (event.type == Common::EVENT_RBUTTONDOWN ? 201 : (202 | 0x800)); breakLoop = true; } break; -- cgit v1.2.3 From ecd1a9f9435c5fc5d502d75dd256394b5f3283f3 Mon Sep 17 00:00:00 2001 From: athrxx Date: Thu, 23 Feb 2012 21:36:14 +0100 Subject: KYRA: (EOB) - cleanup CGA/EGA code a bit --- engines/kyra/kyra_v1.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'engines/kyra/kyra_v1.cpp') diff --git a/engines/kyra/kyra_v1.cpp b/engines/kyra/kyra_v1.cpp index 7c67af2f13..2672618c67 100644 --- a/engines/kyra/kyra_v1.cpp +++ b/engines/kyra/kyra_v1.cpp @@ -233,19 +233,16 @@ KyraEngine_v1::~KyraEngine_v1() { Common::Point KyraEngine_v1::getMousePos() { Common::Point mouse = _eventMan->getMousePos(); - if (_flags.useHiResOverlay) { + if (_flags.useHiRes) { mouse.x >>= 1; mouse.y >>= 1; } - mouse.x /= screen()->getPageScaleFactor(0); - mouse.y /= screen()->getPageScaleFactor(0); - return mouse; } void KyraEngine_v1::setMousePos(int x, int y) { - if (_flags.useHiResOverlay) { + if (_flags.useHiRes) { x <<= 1; y <<= 1; } @@ -312,12 +309,10 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) case Common::EVENT_LBUTTONUP: { _mouseX = event.mouse.x; _mouseY = event.mouse.y; - if (_flags.useHiResOverlay) { + if (_flags.useHiRes) { _mouseX >>= 1; _mouseY >>= 1; } - _mouseX /= screen()->getPageScaleFactor(0); - _mouseY /= screen()->getPageScaleFactor(0); keys = (event.type == Common::EVENT_LBUTTONDOWN ? 199 : (200 | 0x800)); breakLoop = true; } break; @@ -326,12 +321,10 @@ int KyraEngine_v1::checkInput(Button *buttonList, bool mainLoop, int eventFlag) case Common::EVENT_RBUTTONUP: { _mouseX = event.mouse.x; _mouseY = event.mouse.y; - if (_flags.useHiResOverlay) { + if (_flags.useHiRes) { _mouseX >>= 1; _mouseY >>= 1; } - _mouseX /= screen()->getPageScaleFactor(0); - _mouseY /= screen()->getPageScaleFactor(0); keys = (event.type == Common::EVENT_RBUTTONDOWN ? 201 : (202 | 0x800)); breakLoop = true; } break; -- cgit v1.2.3