[Scummvm-git-logs] scummvm master -> d3ba1c49ee5c21d5934cf6ad8297f0bd028f983e
mikrosk
noreply at scummvm.org
Mon Apr 3 18:23:22 UTC 2023
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
4e4aea1463 BACKENDS: ATARI: Don't call clock() and usleep()
64c864b5d3 BACKENDS: ATARI: Add "data" folder to search set
611752e55f BACKENDS: ATARI: Update mouse even if not visible
d3ba1c49ee ATARI: Add DISABLE_TEXT_CONSOLE for release builds
Commit: 4e4aea146391fe96c5cf027a3b838b42c580c8e5
https://github.com/scummvm/scummvm/commit/4e4aea146391fe96c5cf027a3b838b42c580c8e5
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-03T20:19:04+02:00
Commit Message:
BACKENDS: ATARI: Don't call clock() and usleep()
Avoiding overhead when accessing system functions / variables.
Changed paths:
A backends/platform/atari/atari_200hz.S
backends/platform/atari/module.mk
backends/platform/atari/osystem_atari.cpp
backends/platform/atari/osystem_atari.h
diff --git a/backends/platform/atari/atari_200hz.S b/backends/platform/atari/atari_200hz.S
new file mode 100644
index 00000000000..94adc452dd4
--- /dev/null
+++ b/backends/platform/atari/atari_200hz.S
@@ -0,0 +1,63 @@
+/* ScummVM - Graphic Adventure Engine
+*
+ * ScummVM is the legal property of its developers, whose names
+ * are too numerous to list here. Please refer to the COPYRIGHT
+ * file distributed with this source distribution.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+ .globl _atari_200hz_init
+ .globl _atari_200hz_shutdown
+
+ .globl _counter_200hz
+
+ .text
+
+_atari_200hz_init:
+ move sr,-(sp)
+ or #0x700,sr
+
+ move.l 0x114.w,old_200hz
+ move.l #my_200hz,0x114.w
+
+ move (sp)+,sr
+ rts
+
+_atari_200hz_shutdown:
+ move sr,-(sp)
+ or #0x700,sr
+
+ move.l old_200hz,0x114.w
+
+ move (sp)+,sr
+ rts
+
+ .ascii "XBRA"
+ .ascii "SCUM"
+old_200hz:
+ dc.l 0
+my_200hz:
+ addq.l #1,_counter_200hz
+
+ move.l old_200hz,-(sp)
+ rts
+
+
+ .bss
+ .even
+
+_counter_200hz:
+ ds.l 1
diff --git a/backends/platform/atari/module.mk b/backends/platform/atari/module.mk
index d3982a71a11..4983ee8dd43 100644
--- a/backends/platform/atari/module.mk
+++ b/backends/platform/atari/module.mk
@@ -2,6 +2,7 @@ MODULE := backends/platform/atari
MODULE_OBJS := \
osystem_atari.o \
+ atari_200hz.o \
atari_ikbd.o \
native_features.o
diff --git a/backends/platform/atari/osystem_atari.cpp b/backends/platform/atari/osystem_atari.cpp
index 0107288fb24..382c9b55acf 100644
--- a/backends/platform/atari/osystem_atari.cpp
+++ b/backends/platform/atari/osystem_atari.cpp
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <time.h>
-#include <unistd.h>
#include <mint/cookie.h>
#include <mint/osbind.h>
@@ -61,6 +60,10 @@
extern "C" void atari_ikbd_init();
extern "C" void atari_ikbd_shutdown();
+extern "C" void atari_200hz_init();
+extern "C" void atari_200hz_shutdown();
+extern "C" volatile uint32 counter_200hz;
+
extern void nf_init(void);
extern void nf_print(const char* msg);
@@ -76,14 +79,20 @@ OSystem_Atari::~OSystem_Atari() {
_video_initialized = false;
}
+ if (_200hz_initialized) {
+ Supexec(atari_200hz_shutdown);
+ _200hz_initialized = false;
+ }
+
if (_ikbd_initialized) {
Supexec(atari_ikbd_shutdown);
_ikbd_initialized = false;
}
}
-static void ikbd_and_video_restore() {
+static void critical_restore() {
Supexec(asm_screen_falcon_restore);
+ Supexec(atari_200hz_shutdown);
Supexec(atari_ikbd_shutdown);
}
@@ -111,8 +120,6 @@ void OSystem_Atari::initBackend() {
nf_init();
- _startTime = clock();
-
_timerManager = new DefaultTimerManager();
_savefileManager = new DefaultSaveFileManager("saves");
@@ -136,10 +143,15 @@ void OSystem_Atari::initBackend() {
Supexec(atari_ikbd_init);
_ikbd_initialized = true;
+ Supexec(atari_200hz_init);
+ _200hz_initialized = true;
+
Supexec(asm_screen_falcon_save);
_video_initialized = true;
- Setexc(VEC_PROCTERM, ikbd_and_video_restore);
+ (void)Setexc(VEC_PROCTERM, critical_restore);
+
+ _startTime = counter_200hz;
BaseBackend::initBackend();
}
@@ -150,11 +162,12 @@ Common::MutexInternal *OSystem_Atari::createMutex() {
uint32 OSystem_Atari::getMillis(bool skipRecord) {
// CLOCKS_PER_SEC is 200, so no need to use floats
- return 1000 * (clock() - _startTime) / CLOCKS_PER_SEC;
+ return 1000 * (counter_200hz - _startTime) / CLOCKS_PER_SEC;
}
void OSystem_Atari::delayMillis(uint msecs) {
- usleep(msecs * 1000);
+ const uint32 threshold = getMillis() + msecs;
+ while (getMillis() < threshold);
}
void OSystem_Atari::getTimeAndDate(TimeDate &td, bool skipRecord) const {
diff --git a/backends/platform/atari/osystem_atari.h b/backends/platform/atari/osystem_atari.h
index 2f999057128..619067e4564 100644
--- a/backends/platform/atari/osystem_atari.h
+++ b/backends/platform/atari/osystem_atari.h
@@ -52,6 +52,7 @@ private:
long _startTime;
bool _video_initialized = false;
+ bool _200hz_initialized = false;
bool _ikbd_initialized = false;
};
Commit: 64c864b5d3ccce739c57c508b9981611ee9a4df1
https://github.com/scummvm/scummvm/commit/64c864b5d3ccce739c57c508b9981611ee9a4df1
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-03T20:19:46+02:00
Commit Message:
BACKENDS: ATARI: Add "data" folder to search set
"make dist-generic" doesn't automatically look for files in "data"
folder. Commit be98f2a8 is somewhat related to this problem but only
for debugging purposes.
As relative "data" clashes with game's relative "data" (e.g. Full
Throttle demo), do the right thing and add it as absolute path.
Changed paths:
backends/platform/atari/osystem_atari.cpp
diff --git a/backends/platform/atari/osystem_atari.cpp b/backends/platform/atari/osystem_atari.cpp
index 382c9b55acf..04385b4eaa5 100644
--- a/backends/platform/atari/osystem_atari.cpp
+++ b/backends/platform/atari/osystem_atari.cpp
@@ -224,12 +224,21 @@ void OSystem_Atari::logMessage(LogMessageType::Type type, const char *message) {
}
void OSystem_Atari::addSysArchivesToSearchSet(Common::SearchSet &s, int priority) {
+ {
+ Common::FSDirectory currentDirectory{ getFilesystemFactory()->makeCurrentDirectoryFileNode()->getPath() };
+ Common::FSNode dataNode = currentDirectory.getSubDirectory("data")->getFSNode();
+ if (dataNode.exists() && dataNode.isDirectory() && dataNode.isReadable()) {
+ s.addDirectory(dataNode.getPath(), dataNode, priority);
+ }
+ }
#ifdef DATA_PATH
- // Add the global DATA_PATH to the directory search list
- // See also OSystem_SDL::addSysArchivesToSearchSet()
- Common::FSNode dataNode(DATA_PATH);
- if (dataNode.exists() && dataNode.isDirectory()) {
- s.add(DATA_PATH, new Common::FSDirectory(dataNode, 4), priority);
+ {
+ // Add the global DATA_PATH to the directory search list
+ // See also OSystem_SDL::addSysArchivesToSearchSet()
+ Common::FSNode dataNode(DATA_PATH);
+ if (dataNode.exists() && dataNode.isDirectory() && dataNode.isReadable()) {
+ s.add(DATA_PATH, new Common::FSDirectory(dataNode, 4), priority);
+ }
}
#endif
}
Commit: 611752e55f0ceb73514f1d8d1dd9991253d60107
https://github.com/scummvm/scummvm/commit/611752e55f0ceb73514f1d8d1dd9991253d60107
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-03T20:19:46+02:00
Commit Message:
BACKENDS: ATARI: Update mouse even if not visible
Toonstruck, Discworld and others manage their own cursor and are
interested only in *mouse* position, not in *cursor* drawing. And
indeed, atari backend doesn't go further than rectangle drawing.
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 1aa8cd29c6b..6d81878bb81 100644
--- a/backends/graphics/atari/atari-graphics.cpp
+++ b/backends/graphics/atari/atari-graphics.cpp
@@ -856,9 +856,6 @@ void AtariGraphicsManager::Cursor::update(const Graphics::Surface &screen, bool
}
void AtariGraphicsManager::Cursor::updatePosition(int deltaX, int deltaY, const Graphics::Surface &screen) {
- if (!visible)
- return;
-
x += deltaX;
y += deltaY;
Commit: d3ba1c49ee5c21d5934cf6ad8297f0bd028f983e
https://github.com/scummvm/scummvm/commit/d3ba1c49ee5c21d5934cf6ad8297f0bd028f983e
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-03T20:19:46+02:00
Commit Message:
ATARI: Add DISABLE_TEXT_CONSOLE for release builds
Saves about 900 KB and relaxes a few games like Toonstruck (11.17% CPU
utilisation) or Bear Stormin' (1.26%).
Not the same as --disable-text-console (USE_TEXT_CONSOLE_FOR_DEBUGGER),
this one is better enabled as it saves a few KBs from Debugger class.
Compile as:
./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 && make -j 16 && rm -rf dist-generic; make dist-generic
Changed paths:
configure
diff --git a/configure b/configure
index 3f4ee0dcd6a..bef5fde02d5 100755
--- a/configure
+++ b/configure
@@ -3673,6 +3673,7 @@ if test -n "$_host"; then
if test "$_release_build" = "yes"; then
# --enable-release
append_var DEFINES "-DNDEBUG"
+ append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
append_var CXXFLAGS "-I$HOME/gnu-tools/m68000/m68k-atari-mint/sys-root/opt/mintlib-dlmalloc/include"
append_var LDFLAGS "-L$HOME/gnu-tools/m68000/m68k-atari-mint/sys-root/opt/mintlib-dlmalloc/lib/m68020-60"
fi
@@ -3974,6 +3975,7 @@ case $_backend in
#append_var DEFINES "-DDISABLE_SID"
#append_var DEFINES "-DDISABLE_NES_APU"
#append_var DEFINES "-DDISABLE_DOSBOX_OPL"
+ #append_var DEFINES "-DDISABLE_TEXT_CONSOLE"
append_var ASFLAGS "-m68030"
append_var CXXFLAGS "-m68020-60"
append_var LDFLAGS "-m68020-60"
More information about the Scummvm-git-logs
mailing list