[Scummvm-git-logs] scummvm master -> 42a93efd8c2cf4223bdc3e7bbd33d468f41a4ae7

mikrosk noreply at scummvm.org
Wed Nov 13 20:48:38 UTC 2024


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

Summary:
90f8152171 BACKENDS: ATARI: Super flag may go to ./configure
16dcfb7a69 BACKENDS: ATARI: Fix _checkUnalignedPitch
b39fa830e9 BACKENDS: ATARI: Optimize 4bpp C2P routine
8bbc31aa6d BACKENDS: ATARI: Bugfixes
259f3495e7 CONFIGURE: Allow unaligned access also on m68k
42a93efd8c BACKENDS: ATARI: Update readme.txt


Commit: 90f8152171f258d54599039e490eebfa37899514
    https://github.com/scummvm/scummvm/commit/90f8152171f258d54599039e490eebfa37899514
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
BACKENDS: ATARI: Super flag may go to ./configure

Changed paths:
    backends/platform/atari/build-release.sh
    backends/platform/atari/build-release030.sh
    configure


diff --git a/backends/platform/atari/build-release.sh b/backends/platform/atari/build-release.sh
index 4f6d14e075a..2cb132152e7 100755
--- a/backends/platform/atari/build-release.sh
+++ b/backends/platform/atari/build-release.sh
@@ -11,7 +11,7 @@ FASTCALL=false
 
 export ASFLAGS="-m68020-60"
 export CXXFLAGS="-m68020-60 -DUSE_MOVE16 -DUSE_SUPERVIDEL -DUSE_SV_BLITTER"
-export LDFLAGS="-m68020-60 -Wl,--msuper-memory"
+export LDFLAGS="-m68020-60"
 export PKG_CONFIG_LIBDIR="$(${PLATFORM}-gcc -print-sysroot)/usr/lib/m68020-60/pkgconfig"
 
 if $FASTCALL
diff --git a/backends/platform/atari/build-release030.sh b/backends/platform/atari/build-release030.sh
index d08b1b943fb..41a62354dcf 100755
--- a/backends/platform/atari/build-release030.sh
+++ b/backends/platform/atari/build-release030.sh
@@ -11,7 +11,7 @@ FASTCALL=false
 
 export ASFLAGS="-m68030"
 export CXXFLAGS="-m68030 -DDISABLE_FANCY_THEMES"
-export LDFLAGS="-m68030 -Wl,--msuper-memory"
+export LDFLAGS="-m68030"
 export PKG_CONFIG_LIBDIR="$(${PLATFORM}-gcc -print-sysroot)/usr/lib/m68020-60/pkgconfig"
 
 if $FASTCALL
diff --git a/configure b/configure
index e7bc2ad48d7..d40e7eb4178 100755
--- a/configure
+++ b/configure
@@ -3665,6 +3665,8 @@ if test -n "$_host"; then
 				#append_var DEFINES  "-DDISABLE_TEXT_CONSOLE"
 			fi
 
+			append_var LDFLAGS "-Wl,--msuper-memory"
+
 			_seq_midi=no
 			_timidity=no
 			;;


Commit: 16dcfb7a695e382036dcac5eb144e02c9f44b1ff
    https://github.com/scummvm/scummvm/commit/16dcfb7a695e382036dcac5eb144e02c9f44b1ff
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
BACKENDS: ATARI: Fix _checkUnalignedPitch

It wasn't set / checked properly after the refactor.

Changed paths:
    backends/graphics/atari/atari-cursor.cpp
    backends/graphics/atari/atari-graphics.cpp


diff --git a/backends/graphics/atari/atari-cursor.cpp b/backends/graphics/atari/atari-cursor.cpp
index ec178b19a47..be95b91c8a0 100644
--- a/backends/graphics/atari/atari-cursor.cpp
+++ b/backends/graphics/atari/atari-cursor.cpp
@@ -92,8 +92,7 @@ void Cursor::setSurface(const void *buf, int w, int h, int hotspotX, int hotspot
 }
 
 void Cursor::setPalette(const byte *colors, uint start, uint num) {
-	if (colors)
-		memcpy(&_palette[start * 3], colors, num * 3);
+	memcpy(&_palette[start * 3], colors, num * 3);
 
 	_surfaceChanged = true;
 }
diff --git a/backends/graphics/atari/atari-graphics.cpp b/backends/graphics/atari/atari-graphics.cpp
index 0ef2662311e..85dfb3f418d 100644
--- a/backends/graphics/atari/atari-graphics.cpp
+++ b/backends/graphics/atari/atari-graphics.cpp
@@ -412,6 +412,7 @@ OSystem::TransactionError AtariGraphicsManager::endGFXTransaction() {
 		return OSystem::kTransactionSuccess;
 	} else if (_overlayVisible) {
 		// that's it, really. updateScreen() will take care of everything.
+		_checkUnalignedPitch = true;
 		_ignoreHideOverlay = false;
 		_overlayVisible = false;
 		// if being in the overlay, reset everything (same as hideOverlay() does)
@@ -574,6 +575,8 @@ void AtariGraphicsManager::updateScreen() {
 				|| engineId == "teenagent"
 				|| engineId == "tsage") {
 				g_unalignedPitch = true;
+			} else {
+				g_unalignedPitch = false;
 			}
 		}
 
@@ -830,9 +833,6 @@ void AtariGraphicsManager::hideOverlay() {
 	_workScreen = _oldWorkScreen;
 	_oldWorkScreen = nullptr;
 
-	// FIXME: perhaps there's a better way but this will do for now
-	_checkUnalignedPitch = true;
-
 	_overlayVisible = false;
 
 	assert(_pendingState.change == GraphicsState::kNone);
@@ -1003,12 +1003,9 @@ void AtariGraphicsManager::setMouseCursor(const void *buf, uint w, uint h, int h
 void AtariGraphicsManager::setCursorPalette(const byte *colors, uint start, uint num) {
 	debug("setCursorPalette: %d, %d", start, num);
 
-	_workScreen->cursor.setPalette(colors, start, num);
-
-	if (!isOverlayVisible() && _currentState.mode == GraphicsMode::TripleBuffering) {
-		// avoid copying the same (shared) palette two more times...
-		_screen[BACK_BUFFER2]->cursor.setPalette(nullptr, 0, 0);
-		_screen[FRONT_BUFFER]->cursor.setPalette(nullptr, 0, 0);
+	if (isOverlayVisible()) {
+		// cursor palette is supported only in the overlay
+		_workScreen->cursor.setPalette(colors, start, num);
 	}
 }
 


Commit: b39fa830e90beb8e9f139648525f78168224f558
    https://github.com/scummvm/scummvm/commit/b39fa830e90beb8e9f139648525f78168224f558
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
BACKENDS: ATARI: Optimize 4bpp C2P routine

The AND'ing is not needed, as the pixels are guaranteed to be in range
0 - 15.

Changed paths:
    backends/graphics/atari/atari-c2p-asm.S


diff --git a/backends/graphics/atari/atari-c2p-asm.S b/backends/graphics/atari/atari-c2p-asm.S
index 14135025c7a..bab5460f58e 100644
--- a/backends/graphics/atari/atari-c2p-asm.S
+++ b/backends/graphics/atari/atari-c2p-asm.S
@@ -712,7 +712,7 @@ SYM(asm_c2p1x1_4):
 #endif
 	movem.l	d2-d7/a2-a6,-(sp)
 	move.l	d0,a2
-	move.l	#0x0f0f0f0f,d4
+	move.l	#0x33333333,d4
 	move.l	#0x00ff00ff,d5
 	move.l	#0x55555555,d6
 
@@ -720,10 +720,6 @@ SYM(asm_c2p1x1_4):
 	move.l	(a0)+,d2
 	move.l	(a0)+,d1
 	move.l	(a0)+,d3
-	and.l	d4,d0
-	and.l	d4,d2
-	and.l	d4,d1
-	and.l	d4,d3
 	lsl.l	#4,d0
 	lsl.l	#4,d1
 	or.l	d2,d0
@@ -735,16 +731,12 @@ c2p1x1_4_pix16:
 	move.l	(a0)+,d2
 	move.l	(a0)+,d1
 	move.l	(a0)+,d3
-	and.l	d4,d0
-	and.l	d4,d2
-	move.l	a5,(a1)+
-	and.l	d4,d1
-	and.l	d4,d3
-	move.l	a6,(a1)+
 	lsl.l	#4,d0
 	lsl.l	#4,d1
+	move.l	a5,(a1)+
 	or.l	d2,d0
 	or.l	d3,d1
+	move.l	a6,(a1)+
 
 c2p1x1_4_start:
 
@@ -785,7 +777,7 @@ c2p1x1_4_start:
 	move.l	d1,d7
 	lsr.l	#2,d7
 	eor.l	d0,d7
-	and.l	#0x33333333,d7
+	and.l	d4,d7
 	eor.l	d7,d0
 	lsl.l	#2,d7
 	eor.l	d7,d1
@@ -847,7 +839,7 @@ SYM(asm_c2p1x1_4_rect):
 	sub.l	d0,d2
 	move.l	d2,chunky_offset
 
-	move.l	#0x0f0f0f0f,d4
+	move.l	#0x33333333,d4
 	move.l	#0x00ff00ff,d5
 	move.l	#0x55555555,d6
 
@@ -855,10 +847,6 @@ SYM(asm_c2p1x1_4_rect):
 	move.l	(a0)+,d2
 	move.l	(a0)+,d1
 	move.l	(a0)+,d3
-	and.l	d4,d0
-	and.l	d4,d2
-	and.l	d4,d1
-	and.l	d4,d3
 	lsl.l	#4,d0
 	lsl.l	#4,d1
 	or.l	d2,d0
@@ -870,16 +858,12 @@ c2p1x1_4_rect_pix16:
 	move.l	(a0)+,d2
 	move.l	(a0)+,d1
 	move.l	(a0)+,d3
-	and.l	d4,d0
-	and.l	d4,d2
-	move.l	a5,(a1)+
-	and.l	d4,d1
-	and.l	d4,d3
-	move.l	a6,(a1)+
 	lsl.l	#4,d0
 	lsl.l	#4,d1
+	move.l	a5,(a1)+
 	or.l	d2,d0
 	or.l	d3,d1
+	move.l	a6,(a1)+
 
 	cmp.l	a1,a7					| end of dst line?
 	bne.s	c2p1x1_4_rect_start
@@ -926,7 +910,7 @@ c2p1x1_4_rect_start:
 	move.l	d1,d7
 	lsr.l	#2,d7
 	eor.l	d0,d7
-	and.l	#0x33333333,d7
+	and.l	d4,d7
 	eor.l	d7,d0
 	lsl.l	#2,d7
 	eor.l	d7,d1
@@ -941,7 +925,7 @@ c2p1x1_4_rect_start:
 	move.l	d0,a6
 
 	cmp.l	a0,a2					| end of src line?
-	bne	c2p1x1_4_rect_pix16
+	bne.s	c2p1x1_4_rect_pix16
 
 	cmp.l	(chunky_end,pc),a2
 	beq.s	c2p1x1_4_rect_done
@@ -949,7 +933,7 @@ c2p1x1_4_rect_start:
 	add.l	(chunky_offset,pc),a0
 	add.l	(chunky_pitch,pc),a2
 
-	bra	c2p1x1_4_rect_pix16
+	bra.s	c2p1x1_4_rect_pix16
 
 c2p1x1_4_rect_done:
 	move.l	a5,(a1)+


Commit: 8bbc31aa6d2a44d17930ce4bc7028af62cffc44b
    https://github.com/scummvm/scummvm/commit/8bbc31aa6d2a44d17930ce4bc7028af62cffc44b
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
BACKENDS: ATARI: Bugfixes

- optimize fillScreen(): Eco Quest calls it way too often with 1x1 rects

- don't disable Cursor::isChanged() flags on !isVisible(), that leads to
  skipping of _surface creation in some cases

- handle properly any number of parameters between beginGFXTransaction
  and endGFXTransaction

- clear the work buffer when exiting a game to avoid showing it when
  next game shows an error upon startup

Changed paths:
    backends/graphics/atari/atari-cursor.cpp
    backends/graphics/atari/atari-graphics.cpp
    backends/graphics/atari/atari-graphics.h


diff --git a/backends/graphics/atari/atari-cursor.cpp b/backends/graphics/atari/atari-cursor.cpp
index be95b91c8a0..1de6e72a504 100644
--- a/backends/graphics/atari/atari-cursor.cpp
+++ b/backends/graphics/atari/atari-cursor.cpp
@@ -211,10 +211,8 @@ bool Cursor::restoreBackground(const Graphics::Surface &srcSurface, bool force)
 }
 
 bool Cursor::draw(bool directRendering, bool force) {
-	if (!isVisible() || (!force && !isChanged())) {
-		 _visibilityChanged = _positionChanged = _surfaceChanged = false;
+	if (!isVisible() || (!force && !isChanged()))
 		return false;
-	}
 
 	Graphics::Surface &dstSurface = *_parentScreen->offsettedSurf;
 	const int dstBitsPerPixel     = _manager->getBitsPerPixel(dstSurface.format);
diff --git a/backends/graphics/atari/atari-graphics.cpp b/backends/graphics/atari/atari-graphics.cpp
index 85dfb3f418d..010bd38d70e 100644
--- a/backends/graphics/atari/atari-graphics.cpp
+++ b/backends/graphics/atari/atari-graphics.cpp
@@ -315,14 +315,16 @@ bool AtariGraphicsManager::hasFeature(OSystem::Feature f) const {
 void AtariGraphicsManager::setFeatureState(OSystem::Feature f, bool enable) {
 	if (!hasFeature(f))
 		return;
+
+	// flags must be set to _currentState and _pendingScreenChange here
 	
 	switch (f) {
 	case OSystem::Feature::kFeatureAspectRatioCorrection:
 		//debug("setFeatureState(kFeatureAspectRatioCorrection): %d", enable);
-		_pendingState.aspectRatioCorrection = enable;
-
-		if (_currentState.aspectRatioCorrection != _pendingState.aspectRatioCorrection)
-			_pendingState.change |= GraphicsState::kAspectRatioCorrection;
+		if (_aspectRatioCorrection != enable) {
+			_aspectRatioCorrection = enable;
+			_pendingScreenChange |= kPendingAspectRatioCorrection;
+		}
 		break;
 	default:
 		break;
@@ -333,7 +335,7 @@ bool AtariGraphicsManager::getFeatureState(OSystem::Feature f) const {
 	switch (f) {
 	case OSystem::Feature::kFeatureAspectRatioCorrection:
 		//debug("getFeatureState(kFeatureAspectRatioCorrection): %d", _aspectRatioCorrection);
-		return _currentState.aspectRatioCorrection;
+		return _aspectRatioCorrection;
 	case OSystem::Feature::kFeatureCursorPalette:
 		//debug("getFeatureState(kFeatureCursorPalette): %d", isOverlayVisible());
 		//return isOverlayVisible();
@@ -348,9 +350,6 @@ bool AtariGraphicsManager::setGraphicsMode(int mode, uint flags) {
 
 	_pendingState.mode = (GraphicsMode)mode;
 
-	if (_currentState.mode != _pendingState.mode)
-		_pendingState.change |= GraphicsState::kScreenAddress;
-
 	// this doesn't seem to be checked anywhere
 	return true;
 }
@@ -358,23 +357,16 @@ bool AtariGraphicsManager::setGraphicsMode(int mode, uint flags) {
 void AtariGraphicsManager::initSize(uint width, uint height, const Graphics::PixelFormat *format) {
 	debug("initSize: %d, %d, %d", width, height, format ? format->bytesPerPixel : 1);
 
-	_pendingState.width = width;
+	_pendingState.width  = width;
 	_pendingState.height = height;
 	_pendingState.format = format ? *format : PIXELFORMAT_CLUT8;
-
-	if ((_pendingState.width > 0 && _pendingState.height > 0)
-		&& (_currentState.width != _pendingState.width || _currentState.height != _pendingState.height)) {
-		_pendingState.change |= GraphicsState::kVideoMode;
-	}
 }
 
 void AtariGraphicsManager::beginGFXTransaction() {
 	debug("beginGFXTransaction");
 
-	// these serve as a flag whether we are launching a game; if not, they will be always zeroed
-	_pendingState.width = 0;
-	_pendingState.height = 0;
-	_pendingState.change &= ~GraphicsState::kVideoMode;
+	_pendingState = GraphicsState();
+	_pendingScreenChange &= ~kPendingTransaction;
 }
 
 OSystem::TransactionError AtariGraphicsManager::endGFXTransaction() {
@@ -382,58 +374,71 @@ OSystem::TransactionError AtariGraphicsManager::endGFXTransaction() {
 
 	int error = OSystem::TransactionError::kTransactionSuccess;
 
-	if (_pendingState.mode < GraphicsMode::DirectRendering || _pendingState.mode > GraphicsMode::TripleBuffering)
-		error |= OSystem::TransactionError::kTransactionModeSwitchFailed;
-
-	if (_pendingState.format != PIXELFORMAT_CLUT8)
-		error |= OSystem::TransactionError::kTransactionFormatNotSupported;
+	if (_pendingState.mode != GraphicsMode::Unknown) {
+		if (_pendingState.mode < GraphicsMode::DirectRendering || _pendingState.mode > GraphicsMode::TripleBuffering) {
+			error |= OSystem::TransactionError::kTransactionModeSwitchFailed;
+		} else if (_currentState.mode != _pendingState.mode) {
+			_pendingScreenChange |= kPendingScreenAddress;
+		}
+	}
 
 	if (_pendingState.width > 0 && _pendingState.height > 0) {
-		if (_pendingState.width > getMaximumScreenWidth() || _pendingState.height > getMaximumScreenHeight())
+		if (_pendingState.width > getMaximumScreenWidth() || _pendingState.height > getMaximumScreenHeight()) {
 			error |= OSystem::TransactionError::kTransactionSizeChangeFailed;
-
-		if (_pendingState.width % 16 != 0 && !hasSuperVidel()) {
+		} else if (_pendingState.width % 16 != 0 && !hasSuperVidel()) {
 			warning("Requested width not divisible by 16, please report");
 			error |= OSystem::TransactionError::kTransactionSizeChangeFailed;
+		} else if (_currentState.width != _pendingState.width || _currentState.height != _pendingState.height) {
+			_pendingScreenChange |= kPendingVideoMode;
 		}
 	}
 
+	if (_pendingState.format.bytesPerPixel != 0
+		&& _pendingState.format != PIXELFORMAT_CLUT8)
+		error |= OSystem::TransactionError::kTransactionFormatNotSupported;
+
 	if (error != OSystem::TransactionError::kTransactionSuccess) {
 		warning("endGFXTransaction failed: %02x", (int)error);
-		// all our errors are fatal as we don't support rollback so make sure that
-		// initGraphicsAny() fails (note: setupGraphics() doesn't check errors at all)
-		error |= OSystem::TransactionError::kTransactionSizeChangeFailed;
+		_pendingScreenChange &= ~kPendingTransaction;
 		return static_cast<OSystem::TransactionError>(error);
 	}
 
-	// don't exit overlay unless there is real video mode to be set
-	if (_pendingState.width == 0 || _pendingState.height == 0) {
+	if (_pendingScreenChange & kPendingScreenAddress)
+		_currentState.mode = _pendingState.mode;
+
+	if ((_pendingScreenChange & kPendingVideoMode)
+		|| (_overlayVisible && _pendingState.width > 0 && _pendingState.height > 0 && _pendingState.format == PIXELFORMAT_CLUT8)) {
+		_currentState.width  = _pendingState.width;
+		_currentState.height = _pendingState.height;
+		_currentState.format = _pendingState.format;
+
+		if (_overlayVisible) {
+			// that's it, really. updateScreen() will take care of everything.
+			_checkUnalignedPitch = true;
+			_ignoreHideOverlay = false;
+			_overlayVisible = false;
+			// if being in the overlay, reset everything (same as hideOverlay() does)
+			_pendingScreenChange |= kPendingAll;
+		}
+	} else if (_overlayVisible) {
+		// don't exit overlay unless there is real video mode to be set
 		_ignoreHideOverlay = true;
+		_pendingScreenChange &= ~kPendingTransaction;
 		return OSystem::kTransactionSuccess;
-	} else if (_overlayVisible) {
-		// that's it, really. updateScreen() will take care of everything.
-		_checkUnalignedPitch = true;
-		_ignoreHideOverlay = false;
-		_overlayVisible = false;
-		// if being in the overlay, reset everything (same as hideOverlay() does)
-		_pendingState.change |= GraphicsState::kAll;
 	}
 
-	_chunkySurface.init(_pendingState.width, _pendingState.height, _pendingState.width,
-		_chunkySurface.getPixels(), _pendingState.format);
-
-	_screen[FRONT_BUFFER]->reset(_pendingState.width, _pendingState.height, 8, true);
-	_screen[BACK_BUFFER1]->reset(_pendingState.width, _pendingState.height, 8, true);
-	_screen[BACK_BUFFER2]->reset(_pendingState.width, _pendingState.height, 8, true);
-	_workScreen = _screen[_pendingState.mode <= GraphicsMode::SingleBuffering ? FRONT_BUFFER : BACK_BUFFER1];
+	if (_pendingScreenChange & (kPendingScreenAddress | kPendingVideoMode)) {
+		_chunkySurface.init(_currentState.width, _currentState.height, _currentState.width,
+			_chunkySurface.getPixels(), _currentState.format);
 
-	_palette.clear();
-	_pendingState.change |= GraphicsState::kPalette;
+		_screen[FRONT_BUFFER]->reset(_currentState.width, _currentState.height, 8, true);
+		_screen[BACK_BUFFER1]->reset(_currentState.width, _currentState.height, 8, true);
+		_screen[BACK_BUFFER2]->reset(_currentState.width, _currentState.height, 8, true);
+		_workScreen = _screen[_currentState.mode <= GraphicsMode::SingleBuffering ? FRONT_BUFFER : BACK_BUFFER1];
 
-	// no point of setting this in updateScreen(), it would only complicate code
-	_currentState = _pendingState;
-	// currently there is no use for this
-	_currentState.change = GraphicsState::kNone;
+		_palette.clear();
+		_pendingScreenChange |= kPendingPalette;
+	}
 
 	// apply new screen changes
 	updateScreen();
@@ -462,7 +467,7 @@ void AtariGraphicsManager::setPalette(const byte *colors, uint start, uint num)
 		}
 	}
 
-	_pendingState.change |= GraphicsState::kPalette;
+	_pendingScreenChange |= kPendingPalette;
 }
 
 void AtariGraphicsManager::grabPalette(byte *colors, uint start, uint num) const {
@@ -522,28 +527,31 @@ void AtariGraphicsManager::unlockScreen() {
 		_screen[BACK_BUFFER2]->addDirtyRect(dstSurface, rect, directRendering);
 		_screen[FRONT_BUFFER]->addDirtyRect(dstSurface, rect, directRendering);
 	}
-
-	// doc says:
-	// Unlock the screen framebuffer, and mark it as dirty, i.e. during the
-	// next updateScreen() call, the whole screen will be updated.
-	//
-	// ... so no updateScreen() from here (otherwise Eco Quest's intro is crawling!)
 }
 
 void AtariGraphicsManager::fillScreen(uint32 col) {
-	debug("fillScreen: %d", col);
+	//debug("fillScreen: %d", col);
 
 	Graphics::Surface *screen = lockScreen();
+
 	screen->fillRect(Common::Rect(screen->w, screen->h), col);
+
 	unlockScreen();
 }
 
 void AtariGraphicsManager::fillScreen(const Common::Rect &r, uint32 col) {
-	debug("fillScreen: %dx%d %d", r.width(), r.height(), col);
+	//debug("fillScreen: %dx%d %d", r.width(), r.height(), col);
 
 	Graphics::Surface *screen = lockScreen();
-	if (screen)
+
+	if (r.width() == 1 && r.height() == 1) {
+		// handle special case for e.g. Eco Quest's intro
+		byte *ptr = (byte *)screen->getBasePtr(r.left, r.top);
+		*ptr = col;
+	} else {
 		screen->fillRect(r, col);
+	}
+
 	unlockScreen();
 }
 
@@ -614,10 +622,6 @@ void AtariGraphicsManager::updateScreen() {
 
 	_workScreen->clearDirtyRects();
 
-	if (!_overlayPending && (_pendingState.width == 0 || _pendingState.height == 0)) {
-		return;
-	}
-
 	if (screenUpdated
 		&& !isOverlayVisible()
 		&& _currentState.mode == GraphicsMode::TripleBuffering) {
@@ -658,30 +662,32 @@ void AtariGraphicsManager::updateScreen() {
 		// FRONT_BUFFER is displayed and still contains previously finished frame
 	}
 
-	const GraphicsState oldPendingState = _pendingState;
+	const int oldPendingScreenChange = _pendingScreenChange;
+	const bool oldAspectRatioCorrection = _aspectRatioCorrection;
 	if (_overlayPending) {
 		debug("Forcing overlay pending state");
-		_pendingState.change = GraphicsState::kAll;
+		_aspectRatioCorrection = false;
+		_pendingScreenChange = kPendingAll;
 	}
 
 	bool doShrinkVidelVisibleArea = false;
 	bool doSuperVidelReset = false;
-	if (_pendingState.change & GraphicsState::kAspectRatioCorrection) {
+	if (_pendingScreenChange & kPendingAspectRatioCorrection) {
 		assert(_workScreen->mode != -1);
 
-		if (_pendingState.aspectRatioCorrection && _currentState.height == 200 && !isOverlayVisible()) {
+		if (_aspectRatioCorrection && _currentState.height == 200 && !isOverlayVisible()) {
 			// apply machine-specific aspect ratio correction
 			if (!_vgaMonitor) {
 				_workScreen->mode &= ~PAL;
 				// 60 Hz
 				_workScreen->mode |= NTSC;
-				_pendingState.change |= GraphicsState::kVideoMode;
+				_pendingScreenChange |= kPendingVideoMode;
 			} else {
 				Screen *screen = _screen[FRONT_BUFFER];
 				s_aspectRatioCorrectionYOffset = (screen->surf.h - 2*MAX_V_SHAKE - screen->offsettedSurf->h) / 2;
-				_pendingState.change |= GraphicsState::kShakeScreen;
+				_pendingScreenChange |= kPendingShakeScreen;
 
-				if (_pendingState.change & GraphicsState::kVideoMode)
+				if (_pendingScreenChange & kPendingVideoMode)
 					doShrinkVidelVisibleArea = true;
 				else
 					s_shrinkVidelVisibleArea = true;
@@ -692,22 +698,22 @@ void AtariGraphicsManager::updateScreen() {
 				_workScreen->mode &= ~NTSC;
 				// 50 Hz
 				_workScreen->mode |= PAL;
-				_pendingState.change |= GraphicsState::kVideoMode;
+				_pendingScreenChange |= kPendingVideoMode;
 			} else {
 				s_aspectRatioCorrectionYOffset = 0;
 				s_shrinkVidelVisibleArea = false;
 
 				if (hasSuperVidel())
 					doSuperVidelReset = true;
-				_pendingState.change |= GraphicsState::kVideoMode;
+				_pendingScreenChange |= kPendingVideoMode;
 			}
 		}
 
-		_pendingState.change &= ~GraphicsState::kAspectRatioCorrection;
+		_pendingScreenChange &= ~kPendingAspectRatioCorrection;
 	}
 
 #ifdef SCREEN_ACTIVE
-	if (_pendingState.change & GraphicsState::kVideoMode) {
+	if (_pendingScreenChange & kPendingVideoMode) {
 		if (_workScreen->rez != -1) {
 			// unfortunately this reinitializes VDI, too
 			Setscreen(SCR_NOCHANGE, SCR_NOCHANGE, _workScreen->rez);
@@ -740,26 +746,26 @@ void AtariGraphicsManager::updateScreen() {
 		s_shrinkVidelVisibleArea = doShrinkVidelVisibleArea;
 
 		// keep kVideoMode for resetting the palette later
-		_pendingState.change &= ~(GraphicsState::kScreenAddress | GraphicsState::kShakeScreen);
+		_pendingScreenChange &= ~(kPendingScreenAddress | kPendingShakeScreen);
 	}
 
-	if (_pendingState.change & GraphicsState::kScreenAddress) {
+	if (_pendingScreenChange & kPendingScreenAddress) {
 		// takes effect in the nearest VBL interrupt but we always wait for Vsync() in this case
 		Vsync();
 		assert(s_screenSurf == nullptr);
 
 		s_screenSurf = isOverlayVisible() ? &_screen[OVERLAY_BUFFER]->surf : &_screen[FRONT_BUFFER]->surf;
-		_pendingState.change &= ~GraphicsState::kScreenAddress;
+		_pendingScreenChange &= ~kPendingScreenAddress;
 	}
 
-	if (_pendingState.change & GraphicsState::kShakeScreen) {
+	if (_pendingScreenChange & kPendingShakeScreen) {
 		// takes effect in the nearest VBL interrupt
 		if (!s_screenSurf)
 			s_screenSurf = isOverlayVisible() ? &_screen[OVERLAY_BUFFER]->surf : &_screen[FRONT_BUFFER]->surf;
-		_pendingState.change &= ~GraphicsState::kShakeScreen;
+		_pendingScreenChange &= ~kPendingShakeScreen;
 	}
 
-	if (_pendingState.change & (GraphicsState::kVideoMode | GraphicsState::kPalette)) {
+	if (_pendingScreenChange & (kPendingVideoMode | kPendingPalette)) {
 		if (!_tt) {
 			// takes effect in the nearest VBL interrupt
 			VsetRGB(0, isOverlayVisible() ? getOverlayPaletteSize() : 256, _workScreen->palette->falcon);
@@ -768,12 +774,13 @@ void AtariGraphicsManager::updateScreen() {
 			// don't cripple framerate only for a palette change)
 			EsetPalette(0, isOverlayVisible() ? getOverlayPaletteSize() : 256, _workScreen->palette->tt);
 		}
-		_pendingState.change &= ~(GraphicsState::kVideoMode | GraphicsState::kPalette);
+		_pendingScreenChange &= ~(kPendingVideoMode | kPendingPalette);
 	}
 #endif
 
 	if (_overlayPending) {
-		_pendingState = oldPendingState;
+		_aspectRatioCorrection = oldAspectRatioCorrection;
+		_pendingScreenChange = oldPendingScreenChange;
 		_overlayPending = false;
 	}
 
@@ -791,7 +798,7 @@ void AtariGraphicsManager::setShakePos(int shakeXOffset, int shakeYOffset) {
 		s_shakeYOffset = shakeYOffset;
 	}
 
-	_pendingState.change |= GraphicsState::kShakeScreen;
+	_pendingScreenChange |= kPendingShakeScreen;
 }
 
 void AtariGraphicsManager::showOverlay(bool inGUI) {
@@ -812,7 +819,7 @@ void AtariGraphicsManager::showOverlay(bool inGUI) {
 
 	_overlayVisible = true;
 
-	assert(_pendingState.change == GraphicsState::kNone);
+	assert(_pendingScreenChange == kPendingNone);
 	_overlayPending = true;
 	updateScreen();
 }
@@ -835,8 +842,8 @@ void AtariGraphicsManager::hideOverlay() {
 
 	_overlayVisible = false;
 
-	assert(_pendingState.change == GraphicsState::kNone);
-	_pendingState.change = GraphicsState::kAll;
+	assert(_pendingScreenChange == kPendingNone);
+	_pendingScreenChange = kPendingAll;
 	updateScreen();
 }
 
@@ -1023,6 +1030,12 @@ bool AtariGraphicsManager::notifyEvent(const Common::Event &event) {
 	case Common::EVENT_RETURN_TO_LAUNCHER:
 	case Common::EVENT_QUIT:
 		if (isOverlayVisible()) {
+			// clear work screen: this is needed if *next* game shows an error upon startup
+			Graphics::Surface &surf = _currentState.mode == GraphicsMode::DirectRendering
+				? *_screen[FRONT_BUFFER]->offsettedSurf
+				: _chunkySurface;
+			surf.fillRect(Common::Rect(surf.w, surf.h), 0);
+
 			_ignoreHideOverlay = true;
 			return false;
 		}
@@ -1032,15 +1045,10 @@ bool AtariGraphicsManager::notifyEvent(const Common::Event &event) {
 		switch ((CustomEventAction) event.customType) {
 		case kActionToggleAspectRatioCorrection:
 			if (hasFeature(OSystem::Feature::kFeatureAspectRatioCorrection)) {
-				_pendingState.aspectRatioCorrection = !_pendingState.aspectRatioCorrection;
-
-				if (_currentState.aspectRatioCorrection != _pendingState.aspectRatioCorrection) {
-					_pendingState.change |= GraphicsState::kAspectRatioCorrection;
+				_aspectRatioCorrection = !_aspectRatioCorrection;
+				_pendingScreenChange |= kPendingAspectRatioCorrection;
 
-					// would be updated in updateScreen() anyway
-					_currentState.aspectRatioCorrection = _pendingState.aspectRatioCorrection;
-					updateScreen();
-				}
+				updateScreen();
 				return true;
 			}
 			break;
diff --git a/backends/graphics/atari/atari-graphics.h b/backends/graphics/atari/atari-graphics.h
index 36c6066d678..8fc77943337 100644
--- a/backends/graphics/atari/atari-graphics.h
+++ b/backends/graphics/atari/atari-graphics.h
@@ -177,26 +177,36 @@ private:
 	bool _checkUnalignedPitch = false;
 
 	struct GraphicsState {
-		GraphicsMode mode = GraphicsMode::Unknown;
-		int width = 0;
-		int height = 0;
+		GraphicsState()
+			: mode(GraphicsMode::Unknown)
+			, width(0)
+			, height(0)
+			, format(Graphics::PixelFormat()) {
+		}
+
+		GraphicsMode mode;
+		int width;
+		int height;
 		Graphics::PixelFormat format;
-		bool aspectRatioCorrection = false;
-
-		enum PendingScreenChange {
-			kNone					= 0,
-			kVideoMode				= 1<<0,
-			kScreenAddress			= 1<<1,
-			kPalette				= 1<<2,
-			kAspectRatioCorrection	= 1<<3,
-			kShakeScreen            = 1<<4,
-			kAll					= kVideoMode | kScreenAddress | kPalette | kAspectRatioCorrection | kShakeScreen,
-		};
-		int change = kNone;
 	};
 	GraphicsState _pendingState;
 	GraphicsState _currentState;
 
+	// feature flags
+	bool _aspectRatioCorrection = false;
+
+	enum PendingScreenChange {
+		kPendingNone                  = 0,
+		kPendingVideoMode             = 1<<0,
+		kPendingScreenAddress         = 1<<1,
+		kPendingAspectRatioCorrection = 1<<2,
+		kPendingPalette               = 1<<3,
+		kPendingShakeScreen           = 1<<4,
+		kPendingTransaction           = kPendingVideoMode | kPendingScreenAddress | kPendingAspectRatioCorrection,
+		kPendingAll                   = kPendingTransaction | kPendingPalette | kPendingShakeScreen
+	};
+	int _pendingScreenChange = kPendingNone;
+
 	enum {
 		FRONT_BUFFER,
 		BACK_BUFFER1,


Commit: 259f3495e77802cbd87018951c35f787d52c163b
    https://github.com/scummvm/scummvm/commit/259f3495e77802cbd87018951c35f787d52c163b
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
CONFIGURE: Allow unaligned access also on m68k

Unaligned access throws an exception on the 68000, 68010 and 68010. None
of these CPUs are (at least officially) supported.

Changed paths:
    configure


diff --git a/configure b/configure
index d40e7eb4178..5392ed472c3 100755
--- a/configure
+++ b/configure
@@ -2689,7 +2689,7 @@ esac
 # for the smaller sizes.
 echo_n "Alignment required... "
 case $_host_cpu in
-	i[3-6]86 | amd64 | x86_64 | powerpc* | ppc*)
+	i[3-6]86 | amd64 | x86_64 | powerpc* | ppc* | m68k)
 		# Unaligned access should work
 		_need_memalign=no
 		;;


Commit: 42a93efd8c2cf4223bdc3e7bbd33d468f41a4ae7
    https://github.com/scummvm/scummvm/commit/42a93efd8c2cf4223bdc3e7bbd33d468f41a4ae7
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2024-11-13T21:41:01+01:00

Commit Message:
BACKENDS: ATARI: Update readme.txt

Clarify usage of DOS/FLAC SOMI talkie.

Changed paths:
    backends/platform/atari/readme.txt


diff --git a/backends/platform/atari/readme.txt b/backends/platform/atari/readme.txt
index 7d82e22a38e..e0e0d94d886 100644
--- a/backends/platform/atari/readme.txt
+++ b/backends/platform/atari/readme.txt
@@ -470,12 +470,14 @@ Known issues
 - aspect ratio correction has no effect on TT because is not possible to alter
   its vertical screen refresh frequency.
 
-- the talkie version of MI1 needs to be merged from two sources: first generate
-  the DOS version and then additionally also the flac version. Then convert all
-  *.flac files into *.wav and replace monkey.sof (flac) with monster.sou (DOS).
-  And of course, don't forget to set the extra path in Game options to the
-  folder where *.wav files are located! For MI2 just use the DOS version, there
-  are no CD tracks available. :(
+- the talkie version of SOMI needs to be merged from two sources:
+  - the DOS version (install.bat) to obtain file "monster.sou"
+  - the FLAC version (install_flac.bat) to obtain folders "cd_music_flac" and
+    "se_music_flac" (these *.flac files then have to be converted to *.wav
+    manually)
+  - files "monkey.000" and "monkey.001" can be taken from either version
+  - point the extra path to the folder with *.wav files (or copy its content
+    where monkey.00? files are located)
 
 - following engines have been explicitly disabled:
   - Cine (2 games)
@@ -497,12 +499,6 @@ Known issues
     - this prevents adding the 15 MB ultima.dat to the release archive
     - https://wiki.scummvm.org/index.php?title=Ultima
 
-- Indy4 (the adventure) may have a bug in the screen when you K.O. the bouncer.
-  I was able to get a freeze when he fell to the ground but currently I am
-  unable to reproduce it. It may be related to the intensive mouse clicking
-  during that scene so feel free to use keypad for the fight and report whether
-  it has improved the situation.
-
 - When using FreeMiNT, ScummVM requires a recent kernel (>= 2021), otherwise
   keyboard handling won't work properly.
 




More information about the Scummvm-git-logs mailing list