From 5c9b0a8aa224c0ab0a8c7fda06c3ae9ce3379867 Mon Sep 17 00:00:00 2001 From: AndywinXp Date: Thu, 29 Dec 2022 14:55:58 +0100 Subject: [PATCH] SCUMM: GUI: Implement Atari ST cursors --- engines/scumm/cursor.cpp | 60 ++++++++++++++++++++++++++++++++++++++++ engines/scumm/scumm.cpp | 3 +- 2 files changed, 61 insertions(+), 2 deletions(-) diff --git a/engines/scumm/cursor.cpp b/engines/scumm/cursor.cpp index 476f48d64ce..d361a36ac19 100644 --- a/engines/scumm/cursor.cpp +++ b/engines/scumm/cursor.cpp @@ -136,6 +136,44 @@ static const byte amiga_snail_cursor[] = { 0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F,0x0F, }; +static const byte atari_main_cursor[] = { + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0x0F,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0x0F,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF, + 0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF, + 0xFF,0xFF,0x0F,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0x0F,0xFF,0xFF,0xFF, + 0x0F,0x0F,0x0F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FF,0xFF, +}; + #ifdef ENABLE_SCUMM_7_8 static const byte default_v7_cursor[] = { 0x01,0x01,0x01,0x01, 0x00,0x0F,0x00, 0x01,0x01,0x01,0x01, @@ -751,6 +789,20 @@ void ScummEngine_v2::setBuiltinCursor(int idx) { *dst++ = palette[((c0 >> (7 - j)) & 1) | (((c1 >> (7 - j)) & 1) << 1) | ((idx == 3) ? 4 : 0)]; } + } else if (_game.platform == Common::kPlatformAtariST) { + _cursor.width = 16; + _cursor.height = 16; + _cursor.hotspotX = 8; + _cursor.hotspotY = 8; + + memcpy(_grabbedCursor, atari_main_cursor, sizeof(atari_main_cursor)); + + for (i = 0; i < sizeof(_grabbedCursor); i++) { + if (_grabbedCursor[i] == 0x0F) { + _grabbedCursor[i] = color; + } + } + } else if (_game.platform == Common::kPlatformAmiga) { _cursor.width = 15; _cursor.height = 15; @@ -864,6 +916,14 @@ void ScummEngine_v2::setSnailCursor() { _cursor.hotspotX = 7; _cursor.hotspotY = 7; + } else if (_game.platform == Common::kPlatformAtariST) { + memcpy(_grabbedCursor, atari_snail_cursor, sizeof(atari_snail_cursor)); + + _cursor.width = 16; + _cursor.height = 16; + _cursor.hotspotX = 8; + _cursor.hotspotY = 8; + } else { memcpy(_grabbedCursor, c64_dos_snail_cursor, sizeof(c64_dos_snail_cursor)); diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index cdafe787402..ddc0932eefc 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -3165,8 +3165,7 @@ bool ScummEngine::isUsingOriginalGUI() { if (_game.id == GID_MONKEY2 && (_game.features & GF_DEMO)) return false; - if (_game.platform == Common::kPlatformPCEngine || - (_game.platform == Common::kPlatformAtariST && _game.version == 2)) + if (_game.platform == Common::kPlatformPCEngine) return false; if (_game.heversion != 0)