[Scummvm-git-logs] scummvm master -> fbd2197d629328c28ce39d0ac5ab8a87e5e51ea6

bluegr noreply at scummvm.org
Mon Aug 26 06:09:48 UTC 2024


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
e6c87b326b ADL: Draw Apple II checkerboard cursor
2aa94e2339 ADL: Make the checker cursor an option
fbd2197d62 ADL: Fix uninitialized variable


Commit: e6c87b326b39fac5cecd07ddcbe17455ed657d15
    https://github.com/scummvm/scummvm/commit/e6c87b326b39fac5cecd07ddcbe17455ed657d15
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-08-26T09:09:44+03:00

Commit Message:
ADL: Draw Apple II checkerboard cursor

Based on Apple II emulators, the original drew the blinking cursor as a
checkerboard pattern, not as a block. If the cursor was placed on top of
a character, it would switch between checkerboard and that character,
not invert it.

Changed paths:
    engines/adl/display_a2.h


diff --git a/engines/adl/display_a2.h b/engines/adl/display_a2.h
index 6ac75c5f739..b58a706be33 100644
--- a/engines/adl/display_a2.h
+++ b/engines/adl/display_a2.h
@@ -68,13 +68,19 @@ protected:
 		static uint16 getBits(const Display_A2 *display, uint y, uint x) {
 			const uint charPos = (y >> 3) * kTextWidth + x;
 			byte m = display->_textBuf[charPos];
+			byte b;
 
-			if (display->_showCursor && charPos == display->_cursorPos)
-				m = (m & 0x3f) | 0x40;
+			if (display->_showCursor && charPos == display->_cursorPos && display->_blink) {
+				byte cursor[] = {
+					0x00, 0x00, 0x2a, 0x14,
+					0x2a, 0x14, 0x2a, 0x00
+				};
 
-			byte b = _font[m & 0x3f][y % 8];
+				b = cursor[y % 8];
+			} else
+				b = _font[m & 0x3f][y % 8];
 
-			if (!(m & 0x80) && (!(m & 0x40) || display->_blink))
+			if (!(m & 0x80))
 				b = ~b;
 
 			return b & 0x7f;


Commit: 2aa94e2339db63e3e4487d2b3db48a4547a4f7cd
    https://github.com/scummvm/scummvm/commit/2aa94e2339db63e3e4487d2b3db48a4547a4f7cd
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-08-26T09:09:44+03:00

Commit Message:
ADL: Make the checker cursor an option

It was explained to me that earlier Apple II models used the block
cursor, and only later ones used the checeked cursor. I try to never
underestimate the power of nostalgia, so let's have both.

Changed paths:
    engines/adl/detection.cpp
    engines/adl/detection.h
    engines/adl/display_a2.cpp
    engines/adl/display_a2.h
    engines/adl/metaengine.cpp


diff --git a/engines/adl/detection.cpp b/engines/adl/detection.cpp
index eec55187cf5..4044bfab5da 100644
--- a/engines/adl/detection.cpp
+++ b/engines/adl/detection.cpp
@@ -37,8 +37,8 @@ static const DebugChannelDef debugFlagList[] = {
 	DEBUG_CHANNEL_END
 };
 
-#define DEFAULT_OPTIONS GUIO5(GAMEOPTION_NTSC, GAMEOPTION_COLOR_DEFAULT_ON, GAMEOPTION_MONO_TEXT, GAMEOPTION_SCANLINES, GUIO_NOMIDI)
-#define MH_OPTIONS GUIO5(GAMEOPTION_NTSC, GAMEOPTION_COLOR_DEFAULT_OFF, GAMEOPTION_MONO_TEXT, GAMEOPTION_SCANLINES, GUIO_NOMIDI)
+#define DEFAULT_OPTIONS GUIO6(GAMEOPTION_NTSC, GAMEOPTION_COLOR_DEFAULT_ON, GAMEOPTION_MONO_TEXT, GAMEOPTION_SCANLINES, GAMEOPTION_APPLE2E_CURSOR, GUIO_NOMIDI)
+#define MH_OPTIONS GUIO6(GAMEOPTION_NTSC, GAMEOPTION_COLOR_DEFAULT_OFF, GAMEOPTION_MONO_TEXT, GAMEOPTION_SCANLINES, GAMEOPTION_APPLE2E_CURSOR, GUIO_NOMIDI)
 
 static const PlainGameDescriptor adlGames[] = {
 	{ "hires0", "Hi-Res Adventure #0: Mission Asteroid" },
diff --git a/engines/adl/detection.h b/engines/adl/detection.h
index f06f437e244..0026d3b23a1 100644
--- a/engines/adl/detection.h
+++ b/engines/adl/detection.h
@@ -83,6 +83,7 @@ struct AdlGameDescription {
 #define GAMEOPTION_COLOR_DEFAULT_ON  GUIO_GAMEOPTIONS3
 #define GAMEOPTION_NTSC              GUIO_GAMEOPTIONS4
 #define GAMEOPTION_MONO_TEXT         GUIO_GAMEOPTIONS5
+#define GAMEOPTION_APPLE2E_CURSOR    GUIO_GAMEOPTIONS6
 
 } // End of namespace Adl
 
diff --git a/engines/adl/display_a2.cpp b/engines/adl/display_a2.cpp
index a5cccfc4248..9b23b824fc5 100644
--- a/engines/adl/display_a2.cpp
+++ b/engines/adl/display_a2.cpp
@@ -492,6 +492,7 @@ Display_A2::Display_A2() :
 		_enableColor(false),
 		_enableScanlines(false),
 		_enableMonoText(false),
+		_enableApple2eCursor(false),
 		_blink(false) { }
 
 Display_A2::~Display_A2() {
@@ -506,6 +507,7 @@ void Display_A2::init() {
 	_enableColor = ConfMan.getBool("color");
 	_enableScanlines = ConfMan.getBool("scanlines");
 	_enableMonoText = ConfMan.getBool("monotext");
+	_enableApple2eCursor = ConfMan.getBool("apple2e_cursor");
 }
 
 void Display_A2::loadFrameBuffer(Common::ReadStream &stream, byte *dst) const {
diff --git a/engines/adl/display_a2.h b/engines/adl/display_a2.h
index b58a706be33..b6bb32cf594 100644
--- a/engines/adl/display_a2.h
+++ b/engines/adl/display_a2.h
@@ -70,17 +70,23 @@ protected:
 			byte m = display->_textBuf[charPos];
 			byte b;
 
-			if (display->_showCursor && charPos == display->_cursorPos && display->_blink) {
-				byte cursor[] = {
-					0x00, 0x00, 0x2a, 0x14,
-					0x2a, 0x14, 0x2a, 0x00
-				};
-
-				b = cursor[y % 8];
+			if (display->_showCursor && charPos == display->_cursorPos) {
+				if (display->_enableApple2eCursor) {
+					if (display->_blink) {
+						byte cursor[] = {
+							0x00, 0x00, 0x2a, 0x14,
+							0x2a, 0x14, 0x2a, 0x00
+						};
+
+						b = cursor[y % 8];
+					} else
+						b = _font[m & 0x3f][y % 8];
+				} else
+					m = (m & 0x3f) | 0x40;
 			} else
 				b = _font[m & 0x3f][y % 8];
 
-			if (!(m & 0x80))
+			if (!(m & 0x80) && (!(m & 0x40) || display->_blink))
 				b = ~b;
 
 			return b & 0x7f;
@@ -117,6 +123,7 @@ protected:
 	bool _enableColor;
 	bool _enableScanlines;
 	bool _enableMonoText;
+	bool _enableApple2eCursor;
 	bool _blink;
 
 private:
diff --git a/engines/adl/metaengine.cpp b/engines/adl/metaengine.cpp
index 269793b287a..70bc03c4bbc 100644
--- a/engines/adl/metaengine.cpp
+++ b/engines/adl/metaengine.cpp
@@ -98,6 +98,18 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 
+	{
+		GAMEOPTION_APPLE2E_CURSOR,
+		{
+			_s("Use checkered cursor"),
+			_s("Use the checkered cursor from later Apple II models"),
+			"apple2e_cursor",
+			false,
+			0,
+			0
+		}
+	},
+
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 


Commit: fbd2197d629328c28ce39d0ac5ab8a87e5e51ea6
    https://github.com/scummvm/scummvm/commit/fbd2197d629328c28ce39d0ac5ab8a87e5e51ea6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2024-08-26T09:09:44+03:00

Commit Message:
ADL: Fix uninitialized variable

Changed paths:
    engines/adl/display_a2.h


diff --git a/engines/adl/display_a2.h b/engines/adl/display_a2.h
index b6bb32cf594..2b8f3c3612e 100644
--- a/engines/adl/display_a2.h
+++ b/engines/adl/display_a2.h
@@ -68,10 +68,12 @@ protected:
 		static uint16 getBits(const Display_A2 *display, uint y, uint x) {
 			const uint charPos = (y >> 3) * kTextWidth + x;
 			byte m = display->_textBuf[charPos];
-			byte b;
+			byte b = _font[m & 0x3f][y % 8];
 
 			if (display->_showCursor && charPos == display->_cursorPos) {
-				if (display->_enableApple2eCursor) {
+				if (!display->_enableApple2eCursor) {
+					m = (m & 0x3f) | 0x40;
+				} else {
 					if (display->_blink) {
 						byte cursor[] = {
 							0x00, 0x00, 0x2a, 0x14,
@@ -79,12 +81,9 @@ protected:
 						};
 
 						b = cursor[y % 8];
-					} else
-						b = _font[m & 0x3f][y % 8];
-				} else
-					m = (m & 0x3f) | 0x40;
-			} else
-				b = _font[m & 0x3f][y % 8];
+					}
+				}
+			}
 
 			if (!(m & 0x80) && (!(m & 0x40) || display->_blink))
 				b = ~b;




More information about the Scummvm-git-logs mailing list