[Scummvm-git-logs] scummvm master -> 6c1002aca5512631d1f7ba02c573c5a913e0df6d

mikrosk noreply at scummvm.org
Wed May 10 21:02:48 UTC 2023


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:
76d3706492 BACKENDS: ATARI: Add build scripts
aa8935e447 BACKENDS: ATARI: grabOverlay() uses accelerated blitting
6c1002aca5 GRAPHICS: ATARI: Fix special move16 case when w==15


Commit: 76d3706492ac2c0554807ec42caa05b094a0a7a5
    https://github.com/scummvm/scummvm/commit/76d3706492ac2c0554807ec42caa05b094a0a7a5
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-05-10T22:58:26+02:00

Commit Message:
BACKENDS: ATARI: Add build scripts

- consolidate public #define's (just ATARI)
- cpu compiler flags are specified in the script
- allow explicit move16, SV and SV Blitter features enabled/disabled

Provide two build scripts:

1. "Fat" one targeted at 040/060 machines (possibly with SuperVidel)

This one is optimized for 68020-60 (so it's still possible to try
highres engines on 68030 machines).

2. "Slim" one targeted at 030 machines (Falcon030+DFB/CT2 or TT030)

This one is optimized for 68030 and stripped from even more features:
"fancy" (highres) themes, move16 & SuperVidel routines and most
importantly the highres engines.

Changed paths:
  A backends/platform/atari/build-release.sh
  A backends/platform/atari/build-release030.sh
    backends/graphics/atari/atari-graphics-superblitter.h
    backends/graphics/atari/atari-graphics-supervidel.h
    backends/platform/atari/osystem_atari.cpp
    configure
    graphics/blit-atari.cpp
    graphics/blit.cpp
    graphics/module.mk
    graphics/surface.cpp


diff --git a/backends/graphics/atari/atari-graphics-superblitter.h b/backends/graphics/atari/atari-graphics-superblitter.h
index 8d7855b5ee8..14e771f1423 100644
--- a/backends/graphics/atari/atari-graphics-superblitter.h
+++ b/backends/graphics/atari/atari-graphics-superblitter.h
@@ -22,6 +22,8 @@
 #ifndef BACKENDS_GRAPHICS_ATARI_SUPERBLITTER_H
 #define BACKENDS_GRAPHICS_ATARI_SUPERBLITTER_H
 
+#ifdef USE_SUPERVIDEL
+
 #include <mint/cookie.h>
 #include <mint/falcon.h>
 
@@ -35,6 +37,16 @@ inline static bool hasSuperVidel() {
 
 static int superVidelFwVersion = hasSuperVidel() ? *SV_VERSION & 0x01ff : 0;
 
+#else
+
+constexpr bool hasSuperVidel() {
+	return false;
+}
+
+constexpr int superVidelFwVersion = 0;
+
+#endif	// USE_SUPERVIDEL
+
 void lockSuperBlitter();
 void unlockSuperBlitter();
 
diff --git a/backends/graphics/atari/atari-graphics-supervidel.h b/backends/graphics/atari/atari-graphics-supervidel.h
index 72391b1e4c4..a8607cd12f5 100644
--- a/backends/graphics/atari/atari-graphics-supervidel.h
+++ b/backends/graphics/atari/atari-graphics-supervidel.h
@@ -22,6 +22,8 @@
 #ifndef BACKENDS_GRAPHICS_ATARI_SUPERVIDEL_H
 #define BACKENDS_GRAPHICS_ATARI_SUPERVIDEL_H
 
+#ifdef USE_SUPERVIDEL
+
 #include "backends/graphics/atari/atari-graphics.h"
 
 #include <mint/osbind.h>
@@ -109,4 +111,6 @@ private:
 	}
 };
 
+#endif	// USE_SUPERVIDEL
+
 #endif
diff --git a/backends/platform/atari/build-release.sh b/backends/platform/atari/build-release.sh
new file mode 100755
index 00000000000..bdccd9ba66f
--- /dev/null
+++ b/backends/platform/atari/build-release.sh
@@ -0,0 +1,35 @@
+#!/bin/bash -eux
+# -e: Exit immediately if a command exits with a non-zero status.
+# -u: Treat unset variables as an error when substituting.
+# -x: Display expanded script commands
+
+mkdir -p build-release
+cd build-release
+
+export ASFLAGS="-m68020-60"
+export CXXFLAGS="-m68020-60 -DUSE_MOVE16 -DUSE_SUPERVIDEL -DUSE_SV_BLITTER"
+export LDFLAGS="-m68020-60"
+
+if [ ! -f config.log ]
+then
+../configure \
+	--backend=atari \
+	--host=m68k-atari-mint \
+	--enable-release \
+	--disable-mt32emu \
+	--disable-lua \
+	--disable-nuked-opl \
+	--disable-16bit \
+	--disable-scalers \
+	--disable-translation \
+	--disable-eventrecorder \
+	--disable-tts \
+	--disable-bink \
+	--opengl-mode=none \
+	--enable-verbose-build \
+	--enable-text-console
+fi
+
+make -j 16
+rm -rf dist-generic
+make dist-generic
diff --git a/backends/platform/atari/build-release030.sh b/backends/platform/atari/build-release030.sh
new file mode 100755
index 00000000000..bc082f17915
--- /dev/null
+++ b/backends/platform/atari/build-release030.sh
@@ -0,0 +1,36 @@
+#!/bin/bash -eux
+# -e: Exit immediately if a command exits with a non-zero status.
+# -u: Treat unset variables as an error when substituting.
+# -x: Display expanded script commands
+
+mkdir -p build-release030
+cd build-release030
+
+export ASFLAGS="-m68030"
+export CXXFLAGS="-m68030 -DDISABLE_FANCY_THEMES"
+export LDFLAGS="-m68030"
+
+if [ ! -f config.log ]
+then
+../configure \
+	--backend=atari \
+	--host=m68k-atari-mint \
+	--enable-release \
+	--disable-mt32emu \
+	--disable-lua \
+	--disable-nuked-opl \
+	--disable-16bit \
+	--disable-highres \
+	--disable-scalers \
+	--disable-translation \
+	--disable-eventrecorder \
+	--disable-tts \
+	--disable-bink \
+	--opengl-mode=none \
+	--enable-verbose-build \
+	--enable-text-console
+fi
+
+make -j 16
+rm -rf dist-generic
+make dist-generic
diff --git a/backends/platform/atari/osystem_atari.cpp b/backends/platform/atari/osystem_atari.cpp
index 05b26790a79..be1067a3973 100644
--- a/backends/platform/atari/osystem_atari.cpp
+++ b/backends/platform/atari/osystem_atari.cpp
@@ -128,9 +128,11 @@ void OSystem_Atari::initBackend() {
 
 	// AtariGraphicsManager needs _eventManager ready
 	AtariGraphicsManager *atariGraphicsManager;
+#ifdef USE_SUPERVIDEL
 	if (hasSuperVidel())
 		atariGraphicsManager = new AtariSuperVidelManager();
 	else
+#endif
 		atariGraphicsManager = new AtariVidelManager();
 	_graphicsManager = atariGraphicsManager;
 
diff --git a/configure b/configure
index edf022f580d..2c7551cef78 100755
--- a/configure
+++ b/configure
@@ -3970,15 +3970,10 @@ case $_backend in
 		;;
 	atari)
 		define_in_config_if_yes yes "ATARI"
-		define_in_config_if_yes yes "USE_SV_BLITTER"
-		append_var DEFINES "-DDISABLE_LAUNCHERDISPLAY_GRID"
-		#append_var DEFINES "-DDISABLE_FANCY_THEMES"
-		append_var DEFINES "-DDISABLE_SID"
-		append_var DEFINES "-DDISABLE_NES_APU"
-		#append_var DEFINES "-DDISABLE_DOSBOX_OPL"
-		append_var ASFLAGS "-m68030"
-		append_var CXXFLAGS "-m68020-60"
-		append_var LDFLAGS "-m68020-60"
+		append_var DEFINES  "-DDISABLE_LAUNCHERDISPLAY_GRID"
+		append_var DEFINES  "-DDISABLE_SID"
+		append_var DEFINES  "-DDISABLE_NES_APU"
+		#append_var DEFINES  "-DDISABLE_DOSBOX_OPL"
 		;;
 	dc)
 		append_var INCLUDES '-I$(srcdir)/backends/platform/dc'
diff --git a/graphics/blit-atari.cpp b/graphics/blit-atari.cpp
index 48c72932b9c..a6a295ac050 100644
--- a/graphics/blit-atari.cpp
+++ b/graphics/blit-atari.cpp
@@ -25,7 +25,6 @@
 #include <cstdlib>	// malloc
 #include <cstring>	// memcpy, memset
 #include <mint/cookie.h>
-#include <mint/falcon.h>
 
 #include <mint/trap14.h>
 #define ct60_vm(mode, value) (long)trap_14_wwl((short)0xc60e, (short)(mode), (long)(value))
@@ -55,6 +54,7 @@
 // bits 31:0 - data (write only)
 #define SV_BLITTER_FIFO           ((volatile long*)0x80010080)
 
+#ifdef USE_SV_BLITTER
 static bool isSuperBlitterLocked;
 
 static void syncSuperBlitter() {
@@ -68,25 +68,32 @@ static void syncSuperBlitter() {
 	// while busy blitting...
 	while (*SV_BLITTER_CONTROL & 1);
 }
+#endif
 
+#ifdef USE_MOVE16
 static inline bool hasMove16() {
 	long val;
 	static bool hasMove16 = Getcookie(C__CPU, &val) == C_FOUND && val >= 40;
 	return hasMove16;
 }
+#endif
 
 void lockSuperBlitter() {
+#ifdef USE_SV_BLITTER
 	assert(!isSuperBlitterLocked);
 
 	isSuperBlitterLocked = true;
+#endif
 }
 
 void unlockSuperBlitter() {
+#ifdef USE_SV_BLITTER
 	assert(isSuperBlitterLocked);
 
 	isSuperBlitterLocked = false;
 	if (hasSuperVidel())
 		syncSuperBlitter();
+#endif
 }
 
 // see atari-graphics.cpp
@@ -111,6 +118,7 @@ void Surface::create(int16 width, int16 height, const PixelFormat &f) {
 		: (w * format.bytesPerPixel + ALIGN - 1) & (-ALIGN);
 
 	if (width && height) {
+#ifdef USE_SV_BLITTER
 		if (hasSuperVidel()) {
 			pixels = (void *)ct60_vmalloc(height * pitch);
 
@@ -119,6 +127,9 @@ void Surface::create(int16 width, int16 height, const PixelFormat &f) {
 
 			assert((uintptr)pixels >= 0xA0000000);
 		} else {
+#else
+		{
+#endif
 			// align buffer to a 16-byte boundary for move16 or C2P conversion
 			void *pixelsUnaligned = ::malloc(sizeof(uintptr) + (height * pitch) + ALIGN - 1);
 
@@ -136,9 +147,12 @@ void Surface::create(int16 width, int16 height, const PixelFormat &f) {
 }
 
 void Surface::free() {
+#ifdef USE_SV_BLITTER
 	if (((uintptr)pixels & 0xFF000000) >= 0xA0000000)
 		ct60_vmfree(pixels);
-	else if (pixels)
+	else
+#endif
+	if (pixels)
 		::free((void *)*((uintptr *)pixels - 1));
 
 	pixels = nullptr;
@@ -154,6 +168,7 @@ void copyBlit(byte *dst, const byte *src,
 	if (dst == src)
 		return;
 
+#ifdef USE_SV_BLITTER
 	if (((uintptr)src & 0xFF000000) >= 0xA0000000 && ((uintptr)dst & 0xFF000000) >= 0xA0000000) {
 		if (superVidelFwVersion >= 9) {
 			*SV_BLITTER_FIFO = (long)src;				// SV_BLITTER_SRC1
@@ -181,7 +196,10 @@ void copyBlit(byte *dst, const byte *src,
 		}
 
 		syncSuperBlitter();
-	} else if (dstPitch == srcPitch && dstPitch == (w * bytesPerPixel)) {
+	} else
+#endif
+	if (dstPitch == srcPitch && dstPitch == (w * bytesPerPixel)) {
+#ifdef USE_MOVE16
 		if (hasMove16() && ((uintptr)src & (ALIGN - 1)) == 0 && ((uintptr)dst & (ALIGN - 1)) == 0) {
 			__asm__ volatile(
 			"	move.l	%2,d0\n"
@@ -241,9 +259,13 @@ void copyBlit(byte *dst, const byte *src,
 				: "d0", "d1", "cc" AND_MEMORY
 			);
 		} else {
+#else
+		{
+#endif
 			memcpy(dst, src, dstPitch * h);
 		}
 	} else {
+#ifdef USE_MOVE16
 		if (hasMove16() && ((uintptr)src & (ALIGN - 1)) == 0 && ((uintptr)dst & (ALIGN - 1)) == 0
 				&& (srcPitch & (ALIGN - 1)) == 0 && (dstPitch & (ALIGN - 1)) == 0) {
 			__asm__ volatile(
@@ -314,6 +336,9 @@ void copyBlit(byte *dst, const byte *src,
 				: "d0", "d1", "a0", "a1", "cc" AND_MEMORY
 			);
 		} else {
+#else
+		{
+#endif
 			for (uint i = 0; i < h; ++i) {
 				memcpy(dst, src, w * bytesPerPixel);
 				dst += dstPitch;
diff --git a/graphics/blit.cpp b/graphics/blit.cpp
index 59154005149..f1106c23b64 100644
--- a/graphics/blit.cpp
+++ b/graphics/blit.cpp
@@ -24,8 +24,8 @@
 
 namespace Graphics {
 
-// see graphics/blit-atari.cpp, Atari Falcon's SuperVidel addon allows accelerated blitting
-#ifndef USE_SV_BLITTER
+// see graphics/blit-atari.cpp
+#ifndef ATARI
 // Function to blit a rect
 void copyBlit(byte *dst, const byte *src,
 			   const uint dstPitch, const uint srcPitch,
diff --git a/graphics/module.mk b/graphics/module.mk
index 8bc02ee268e..f8528e1c923 100644
--- a/graphics/module.mk
+++ b/graphics/module.mk
@@ -65,7 +65,7 @@ MODULE_OBJS += \
 	scaler/downscalerARM.o
 endif
 
-ifdef USE_SV_BLITTER
+ifdef ATARI
 MODULE_OBJS += \
 	blit-atari.o
 endif
diff --git a/graphics/surface.cpp b/graphics/surface.cpp
index e3107c132a4..0464a31be3a 100644
--- a/graphics/surface.cpp
+++ b/graphics/surface.cpp
@@ -63,8 +63,8 @@ void Surface::drawThickLine(int x0, int y0, int x1, int y1, int penX, int penY,
 		error("Surface::drawThickLine: bytesPerPixel must be 1, 2, or 4");
 }
 
-// see graphics/blit-atari.cpp, Atari Falcon's SuperVidel addon allows accelerated blitting
-#ifndef USE_SV_BLITTER
+// see graphics/blit-atari.cpp
+#ifndef ATARI
 void Surface::create(int16 width, int16 height, const PixelFormat &f) {
 	assert(width >= 0 && height >= 0);
 	free();


Commit: aa8935e4470dcc977eae80cc36039e51033dea42
    https://github.com/scummvm/scummvm/commit/aa8935e4470dcc977eae80cc36039e51033dea42
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-05-10T22:59:56+02:00

Commit Message:
BACKENDS: ATARI: grabOverlay() uses accelerated blitting

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


diff --git a/backends/graphics/atari/atari-graphics.cpp b/backends/graphics/atari/atari-graphics.cpp
index 640e5d5e109..1907963226e 100644
--- a/backends/graphics/atari/atari-graphics.cpp
+++ b/backends/graphics/atari/atari-graphics.cpp
@@ -216,7 +216,7 @@ void AtariGraphicsManager::grabPalette(byte *colors, uint start, uint num) const
 }
 
 void AtariGraphicsManager::copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h) {
-	//debug("copyRectToScreen: %d, %d, %d, %d, %d", pitch, x, y, w, h);
+	//debug("copyRectToScreen: %d, %d, %d(%d), %d", x, y, w, pitch, h);
 
 	if (_currentState.mode != GraphicsMode::DirectRendering) {
 		_chunkySurface.copyRectToSurface(buf, pitch, x, y, w, h);
@@ -486,13 +486,20 @@ void AtariGraphicsManager::clearOverlay() {
 }
 
 void AtariGraphicsManager::grabOverlay(Graphics::Surface &surface) const {
-	debug("grabOverlay: %d, %d, %d", surface.pitch, surface.w, surface.h);
+	debug("grabOverlay: %d(%d), %d", surface.w, surface.pitch, surface.h);
 
-	memcpy(surface.getPixels(), _overlaySurface.getPixels(), surface.pitch * surface.h);
+	assert(surface.w >= _overlaySurface.w);
+	assert(surface.h >= _overlaySurface.h);
+	assert(surface.format.bytesPerPixel == _overlaySurface.format.bytesPerPixel);
+
+	const byte *src = (const byte *)_overlaySurface.getPixels();
+	byte *dst = (byte *)surface.getPixels();
+	Graphics::copyBlit(dst, src, surface.pitch,
+		_overlaySurface.pitch, _overlaySurface.w, _overlaySurface.h, _overlaySurface.format.bytesPerPixel);
 }
 
 void AtariGraphicsManager::copyRectToOverlay(const void *buf, int pitch, int x, int y, int w, int h) {
-	//debug("copyRectToOverlay: %d, %d, %d, %d, %d", pitch, x, y, w, h);
+	//debug("copyRectToOverlay: %d, %d, %d(%d), %d", x, y, w, pitch, h);
 
 	_overlaySurface.copyRectToSurface(buf, pitch, x, y, w, h);
 	_screen[OVERLAY_BUFFER]->addDirtyRect(Common::Rect(x, y, x + w, y + h));


Commit: 6c1002aca5512631d1f7ba02c573c5a913e0df6d
    https://github.com/scummvm/scummvm/commit/6c1002aca5512631d1f7ba02c573c5a913e0df6d
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-05-10T23:02:12+02:00

Commit Message:
GRAPHICS: ATARI: Fix special move16 case when w==15

Changed paths:
    graphics/blit-atari.cpp


diff --git a/graphics/blit-atari.cpp b/graphics/blit-atari.cpp
index a6a295ac050..5020082953a 100644
--- a/graphics/blit-atari.cpp
+++ b/graphics/blit-atari.cpp
@@ -274,7 +274,8 @@ void copyBlit(byte *dst, const byte *src,
 			"	moveq	#0x0f,d1\n"
 			"	and.l	d0,d1\n"
 			"	neg.l	d1\n"
-			"	lea		(4f,pc,d1.l*2),a1\n"
+			"	lea		(4f,pc,d1.l*2),a0\n"
+			"	move.l	a0,a1\n"
 
 			"	lsr.l	#4,d0\n"
 			"	beq.b	3f\n"




More information about the Scummvm-git-logs mailing list