diff options
author | Filippos Karapetis | 2009-07-04 16:30:20 +0000 |
---|---|---|
committer | Filippos Karapetis | 2009-07-04 16:30:20 +0000 |
commit | b093511239401c5d64d6b21c0b875d5be6e5f239 (patch) | |
tree | 935c78d3b317f14074f39acc9e21e87bca1762cb /engines/sci/engine | |
parent | c5522b37660644666c2842045cf64f1254cc3e17 (diff) | |
download | scummvm-rg350-b093511239401c5d64d6b21c0b875d5be6e5f239.tar.gz scummvm-rg350-b093511239401c5d64d6b21c0b875d5be6e5f239.tar.bz2 scummvm-rg350-b093511239401c5d64d6b21c0b875d5be6e5f239.zip |
- Merged the "early" and "late" SCI1 versions - these are functionally equivalent, and the code that does the version check is unreliable (e.g. it sets SQ1 VGA to SCI1 "late" and EcoQuest 1 to SCI1 "early")
- Cleanup of the vocabulary setting functions
- Cleanup of the cursor manipulation code
svn-id: r42097
Diffstat (limited to 'engines/sci/engine')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 13 | ||||
-rw-r--r-- | engines/sci/engine/kgraphics.cpp | 13 | ||||
-rw-r--r-- | engines/sci/engine/script.cpp | 3 |
3 files changed, 17 insertions, 12 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index b68c42296a..ab6fb36085 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -386,6 +386,7 @@ void Kernel::loadSelectorNames(bool isOldSci0) { Common::String tmp((const char *)r->data + offset + 2, len); _selectorNames.push_back(tmp); + //printf("%s\n", tmp.c_str()); // debug // Early SCI versions used the LSB in the selector ID as a read/write // toggle. To compensate for that, we add every selector name twice. @@ -751,6 +752,11 @@ void Kernel::setDefaultKernelNames() { offset = 4; } } + + if (_resmgr->_sciVersion == SCI_VERSION_1_1) { + // KQ6CD calls unimplemented function 0x26 + _kernelNames[0x26] = "Dummy"; + } } #ifdef ENABLE_SCI32 @@ -788,14 +794,9 @@ bool Kernel::loadKernelNames() { case SCI_VERSION_01: case SCI_VERSION_01_VGA: case SCI_VERSION_01_VGA_ODD: - case SCI_VERSION_1_EARLY: - case SCI_VERSION_1_LATE: + case SCI_VERSION_1: case SCI_VERSION_1_1: setDefaultKernelNames(); - if (_resmgr->_sciVersion == SCI_VERSION_1_1) { - // KQ6CD calls unimplemented function 0x26 - _kernelNames[0x26] = "Dummy"; - } break; #ifdef ENABLE_SCI32 case SCI_VERSION_32: diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp index 6e737597d6..9d19f3f0c9 100644 --- a/engines/sci/engine/kgraphics.cpp +++ b/engines/sci/engine/kgraphics.cpp @@ -304,7 +304,9 @@ static gfx_color_t graph_map_color(EngineState *s, int color, int priority, int reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) { switch (argc) { case 1 : - if (s->_version < SCI_VERSION_1_1) { + if (s->_version < SCI_VERSION_1) { + GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, argv[0].toSint16())); + } else if (s->_version == SCI_VERSION_1) { if (argv[0].toSint16() <= 1) { // Newer (SCI1.1) semantics: show/hide cursor CursorMan.showMouse(argv[0].toSint16() != 0); @@ -312,13 +314,16 @@ reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) { // Pre-SCI1.1: set cursor according to the first parameter GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, argv[0].toSint16())); } - } else { + } else if (s->_version >= SCI_VERSION_1_1) { // SCI1.1: Show/hide cursor CursorMan.showMouse(argv[0].toSint16() != 0); } break; case 2 : - if (s->_version < SCI_VERSION_1_1) { + if (s->_version < SCI_VERSION_1) { + GFX_ASSERT(gfxop_set_pointer_cursor(s->gfx_state, + argv[1].toSint16() == 0 ? GFXOP_NO_POINTER : argv[0].toSint16())); + } else if (s->_version == SCI_VERSION_1) { // Pre-SCI1.1: set cursor according to the first parameter, and toggle its // visibility based on the second parameter // Some late SCI1 games actually use the SCI1.1 version of this call (EcoQuest 1 @@ -337,7 +342,7 @@ reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) { GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, Common::Point(argv[0].toUint16(), argv[1].toUint16()))); } - } else { + } else if (s->_version >= SCI_VERSION_1_1) { // SCI1.1 and newer: set pointer position GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, Common::Point(argv[0].toUint16(), argv[1].toUint16()))); diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index 3260be6b36..ca5379a4c0 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -97,8 +97,7 @@ void script_adjust_opcode_formats(int res_version) { break; case SCI_VERSION_01_VGA: case SCI_VERSION_01_VGA_ODD: - case SCI_VERSION_1_EARLY: - case SCI_VERSION_1_LATE: + case SCI_VERSION_1: case SCI_VERSION_1_1: g_opcode_formats[op_lofsa][0] = Script_Offset; g_opcode_formats[op_lofss][0] = Script_Offset; |