[Scummvm-git-logs] scummvm master -> 0ca53d1a052a9c7a0e82cb1208774d54f149e516
AndywinXp
noreply at scummvm.org
Sat Feb 11 10:36:11 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ca59d016e5 SCUMM: MI1 (SegaCD): Improve input handling during dialogs
0ca53d1a05 SCUMM: MI1 (SegaCD): Fix a part of bug #10447
Commit: ca59d016e50a9aba594db3acc27faf59c2df5d27
https://github.com/scummvm/scummvm/commit/ca59d016e50a9aba594db3acc27faf59c2df5d27
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-02-11T11:32:48+01:00
Commit Message:
SCUMM: MI1 (SegaCD): Improve input handling during dialogs
We allow ENTER to be used to confirm the dialog choice, swap the left and right
arrow keys, and correctly map the numpad keys (so that joypad now actually work!)
Changed paths:
engines/scumm/input.cpp
diff --git a/engines/scumm/input.cpp b/engines/scumm/input.cpp
index 90c6fa5f0bb..aa3f5398251 100644
--- a/engines/scumm/input.cpp
+++ b/engines/scumm/input.cpp
@@ -1353,12 +1353,17 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
// because that's what MI2 looks for in its "instant win" cheat.
_mouseAndKeyboardStat = lastKeyHit.keycode + 154;
- } else if (lastKeyHit.keycode >= Common::KEYCODE_UP &&
- lastKeyHit.keycode <= Common::KEYCODE_LEFT) {
- if (_game.id == GID_MONKEY && _game.platform == Common::kPlatformSegaCD) {
+ } else if (lastKeyHit.keycode >= Common::KEYCODE_UP && lastKeyHit.keycode <= Common::KEYCODE_LEFT) {
+ if (isSegaCD) {
// Map arrow keys to number keys in the SEGA version of MI to support
// scrolling to conversation choices. See bug report #2013 for details.
_mouseAndKeyboardStat = lastKeyHit.keycode - Common::KEYCODE_UP + 54;
+ debug(5, "dir %d", _mouseAndKeyboardStat);
+ // Left and right are swapped
+ if (lastKeyHit.keycode == Common::KEYCODE_LEFT || lastKeyHit.keycode == Common::KEYCODE_RIGHT) {
+ _mouseAndKeyboardStat += lastKeyHit.keycode == Common::KEYCODE_LEFT ? -1 : 1;
+ }
+
} else if (isUsingOriginalGUI() || (_game.id == GID_LOOM && _game.platform == Common::kPlatformPCEngine)) {
// Map arrow keys to number keys in games which use the original menu screen.
switch (lastKeyHit.keycode) {
@@ -1386,6 +1391,24 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
_mouseAndKeyboardStat = lastKeyHit.ascii;
}
+ } else if (isSegaCD && lastKeyHit.keycode >= Common::KEYCODE_KP0 && lastKeyHit.keycode <= Common::KEYCODE_KP9) {
+ switch (lastKeyHit.keycode) {
+ case Common::KEYCODE_KP8: // Up:
+ _mouseAndKeyboardStat = 54;
+ break;
+ case Common::KEYCODE_KP2: // Down:
+ _mouseAndKeyboardStat = 55;
+ break;
+ case Common::KEYCODE_KP4: // Left (swapped):
+ _mouseAndKeyboardStat = 56;
+ break;
+ case Common::KEYCODE_KP6: // Right (swapped):
+ _mouseAndKeyboardStat = 57;
+ break;
+ default:
+ break;
+ }
+
} else {
// Map the DEL key when using the original GUI; used when writing the savegame name.
if (isUsingOriginalGUI() && lastKeyHit.keycode == Common::KEYCODE_DELETE)
@@ -1400,9 +1423,9 @@ void ScummEngine::processKeyboard(Common::KeyState lastKeyHit) {
// scripts, we have to do this manually for the other games. We don't want to do this for (later)
// HE games, since they can sometimes have scripts that accept Enter and Tab keys.
if (_game.heversion < 71) {
- if (_mouseAndKeyboardStat == Common::KEYCODE_RETURN && _cursor.state > 0 && _game.version <= 6) {
+ if (_mouseAndKeyboardStat == Common::KEYCODE_RETURN && (_cursor.state > 0 || isSegaCD) && _game.version <= 6) {
_mouseAndKeyboardStat = MBS_LEFT_CLICK;
- } else if (_mouseAndKeyboardStat == Common::KEYCODE_TAB && _cursor.state > 0 && _game.version >= 4 && _game.version <= 6) {
+ } else if (_mouseAndKeyboardStat == Common::KEYCODE_TAB && (_cursor.state > 0 || isSegaCD) && _game.version >= 4 && _game.version <= 6) {
_mouseAndKeyboardStat = MBS_RIGHT_CLICK;
}
}
Commit: 0ca53d1a052a9c7a0e82cb1208774d54f149e516
https://github.com/scummvm/scummvm/commit/0ca53d1a052a9c7a0e82cb1208774d54f149e516
Author: AndywinXp (andywinxp at gmail.com)
Date: 2023-02-11T11:36:01+01:00
Commit Message:
SCUMM: MI1 (SegaCD): Fix a part of bug #10447
This gives the JAP text a black background, like the original, and corrects the
line spacing when string wrapping occurs. The only thing remaining should be
fixing the string wrapping method, which seems to be different from the v5 one.
Changed paths:
engines/scumm/charset.cpp
engines/scumm/string.cpp
diff --git a/engines/scumm/charset.cpp b/engines/scumm/charset.cpp
index b0089e8d7da..d7225d23f5b 100644
--- a/engines/scumm/charset.cpp
+++ b/engines/scumm/charset.cpp
@@ -725,7 +725,11 @@ void CharsetRendererPC::drawBits1(Graphics::Surface &dest, int x, int y, const b
dst[1] = _shadowColor;
}
dst[0] = col;
+ } else if (!(bits & revBitMask(x % 8)) && (y < height - 1) &&
+ _vm->_useCJKMode && _vm->_game.platform == Common::kPlatformSegaCD) {
+ dst[0] = 0;
}
+
dst += dest.format.bytesPerPixel;
dst2 += dest.format.bytesPerPixel;
}
diff --git a/engines/scumm/string.cpp b/engines/scumm/string.cpp
index 8a09341d9af..ed2807cadf7 100644
--- a/engines/scumm/string.cpp
+++ b/engines/scumm/string.cpp
@@ -566,6 +566,10 @@ bool ScummEngine::newLine() {
_useCJKMode = false;
_nextTop += _charset->getFontHeight();
_useCJKMode = useCJK;
+
+ if (_useCJKMode && _game.platform == Common::kPlatformSegaCD) {
+ _nextTop -= 1;
+ }
}
if (_game.version > 3) {
// FIXME: is this really needed?
More information about the Scummvm-git-logs
mailing list