aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/event.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-19 09:46:04 +0000
committerMartin Kiewitz2010-06-19 09:46:04 +0000
commita7fa0649dfc71c79f496a86986413f35c8d36966 (patch)
tree550679e4c14e607949bdd47062ebbd57152e2cfb /engines/sci/event.cpp
parent4fb3059edcfdcfc6ab64cd0c4437e1cbb289d00e (diff)
downloadscummvm-rg350-a7fa0649dfc71c79f496a86986413f35c8d36966.tar.gz
scummvm-rg350-a7fa0649dfc71c79f496a86986413f35c8d36966.tar.bz2
scummvm-rg350-a7fa0649dfc71c79f496a86986413f35c8d36966.zip
SCI: implemented checking of keyboard driver in case of SCI1EGA/EARLY, also renamed SCI_EVENT_JOYSTICK to SCI_EVENT_DIRECTION
svn-id: r50045
Diffstat (limited to 'engines/sci/event.cpp')
-rw-r--r--engines/sci/event.cpp34
1 files changed, 34 insertions, 0 deletions
diff --git a/engines/sci/event.cpp b/engines/sci/event.cpp
index eff7984d39..6c9e95a804 100644
--- a/engines/sci/event.cpp
+++ b/engines/sci/event.cpp
@@ -25,6 +25,7 @@
#include "common/system.h"
#include "common/events.h"
+#include "common/file.h"
#include "sci/sci.h"
#include "sci/event.h"
@@ -35,11 +36,44 @@
namespace Sci {
EventManager::EventManager(bool fontIsExtended) : _fontIsExtended(fontIsExtended), _modifierStates(0) {
+
+ if (getSciVersion() >= SCI_VERSION_1_MIDDLE) {
+ _usesNewKeyboardDirectionType = true;
+ } else if (getSciVersion() <= SCI_VERSION_01) {
+ _usesNewKeyboardDirectionType = false;
+ } else {
+ // they changed this somewhere inbetween SCI1EGA/EARLY, so we need to check the size of the keyboard driver
+ _usesNewKeyboardDirectionType = false;
+
+ Common::File keyboardDriver;
+ if (keyboardDriver.open("IBMKBD.DRV")) {
+ switch (keyboardDriver.size()) {
+ case 442: // SCI0 (PQ2)
+ case 446: // SCI0 (SQ3)
+ case 449: // SCI1EGA (QfG2)
+ break;
+ case 537: // SCI1 (SQ4)
+ case 564: // SCI1.1 (LB2)
+ case 758: // SCI1.1 (LB2cd)
+ case 760: // SCI1.1 (Pepper)
+ _usesNewKeyboardDirectionType = true;
+ break;
+ default:
+ error("Unsupported IBMKBD.DRV size (%d)", keyboardDriver.size());
+ }
+ } else {
+ // We just default to OFF here in case the keyboard driver could not be found
+ warning("IBMKBD.DRV not found to distinguish usage of direction type");
+ }
+ }
}
EventManager::~EventManager() {
}
+bool EventManager::getUsesNewKeyboardDirectionType() {
+ return _usesNewKeyboardDirectionType;
+}
struct ScancodeRow {
int offset;