[Scummvm-cvs-logs] SF.net SVN: scummvm:[50045] scummvm/trunk/engines/sci
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sat Jun 19 11:46:05 CEST 2010
Revision: 50045
http://scummvm.svn.sourceforge.net/scummvm/?rev=50045&view=rev
Author: m_kiewitz
Date: 2010-06-19 09:46:04 +0000 (Sat, 19 Jun 2010)
Log Message:
-----------
SCI: implemented checking of keyboard driver in case of SCI1EGA/EARLY, also renamed SCI_EVENT_JOYSTICK to SCI_EVENT_DIRECTION
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kevent.cpp
scummvm/trunk/engines/sci/event.cpp
scummvm/trunk/engines/sci/event.h
Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp 2010-06-19 08:43:50 UTC (rev 50044)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp 2010-06-19 09:46:04 UTC (rev 50045)
@@ -203,12 +203,10 @@
}
if (mover >= 0) {
- // FIXME: changing point was actually inbetween SCI1EARLY, we need to find out when it happened
- // and then find some method of finding out those specific games
- if (getSciVersion() >= SCI_VERSION_1_MIDDLE)
- writeSelectorValue(segMan, obj, SELECTOR(type), SCI_EVENT_KEYBOARD | SCI_EVENT_JOYSTICK);
+ if (g_sci->getEventManager()->getUsesNewKeyboardDirectionType())
+ writeSelectorValue(segMan, obj, SELECTOR(type), SCI_EVENT_KEYBOARD | SCI_EVENT_DIRECTION);
else
- writeSelectorValue(segMan, obj, SELECTOR(type), SCI_EVENT_JOYSTICK);
+ writeSelectorValue(segMan, obj, SELECTOR(type), SCI_EVENT_DIRECTION);
writeSelectorValue(segMan, obj, SELECTOR(message), mover);
return make_reg(0, 1);
} else
Modified: scummvm/trunk/engines/sci/event.cpp
===================================================================
--- scummvm/trunk/engines/sci/event.cpp 2010-06-19 08:43:50 UTC (rev 50044)
+++ scummvm/trunk/engines/sci/event.cpp 2010-06-19 09:46:04 UTC (rev 50045)
@@ -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;
Modified: scummvm/trunk/engines/sci/event.h
===================================================================
--- scummvm/trunk/engines/sci/event.h 2010-06-19 08:43:50 UTC (rev 50044)
+++ scummvm/trunk/engines/sci/event.h 2010-06-19 09:46:04 UTC (rev 50045)
@@ -53,7 +53,7 @@
#define SCI_EVENT_MOUSE_PRESS (1<<0)
#define SCI_EVENT_MOUSE_RELEASE (1<<1)
#define SCI_EVENT_KEYBOARD (1<<2)
-#define SCI_EVENT_JOYSTICK (1<<6)
+#define SCI_EVENT_DIRECTION (1<<6)
#define SCI_EVENT_SAID (1<<7)
/*Fake values for other events*/
#define SCI_EVENT_ERROR (1<<10)
@@ -115,6 +115,7 @@
~EventManager();
SciEvent getSciEvent(unsigned int mask);
+ bool getUsesNewKeyboardDirectionType();
private:
SciEvent getScummVMEvent();
@@ -122,6 +123,8 @@
const bool _fontIsExtended;
int _modifierStates;
Common::List<SciEvent> _events;
+
+ bool _usesNewKeyboardDirectionType;
};
} // End of namespace Sci
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list