[Scummvm-git-logs] scummvm master -> 264f67cb83ee041131a9f3423c107f2705cf13c0
mikrosk
noreply at scummvm.org
Wed May 7 15:45:20 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
264f67cb83 BACKENDS: ATARI: Fix a crash
Commit: 264f67cb83ee041131a9f3423c107f2705cf13c0
https://github.com/scummvm/scummvm/commit/264f67cb83ee041131a9f3423c107f2705cf13c0
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2025-05-07T17:45:03+02:00
Commit Message:
BACKENDS: ATARI: Fix a crash
If error() was called in (Atari)GraphicsManager's c-tor, its d-tor
wouldn't be called, leaving the VBL handler uninitialised.
Changed paths:
backends/graphics/atari/atari-graphics.cpp
graphics/blit/blit-atari.cpp
diff --git a/backends/graphics/atari/atari-graphics.cpp b/backends/graphics/atari/atari-graphics.cpp
index 097fb6a35d3..45d14ee257f 100644
--- a/backends/graphics/atari/atari-graphics.cpp
+++ b/backends/graphics/atari/atari-graphics.cpp
@@ -291,10 +291,6 @@ AtariGraphicsManager::AtariGraphicsManager()
}
s_oldPhysbase = Physbase();
- if (!Supexec(InstallVblHandler)) {
- error("VBL handler was not installed");
- }
-
g_system->getEventManager()->getEventDispatcher()->registerObserver(this, 10, false);
}
@@ -406,6 +402,19 @@ void AtariGraphicsManager::beginGFXTransaction() {
OSystem::TransactionError AtariGraphicsManager::endGFXTransaction() {
atari_debug("endGFXTransaction");
+ {
+ // this can't be done in the c-tor because if the c-tor called error(),
+ // its d-tor wouldn't be called => the vbl handler wouldn't be uninstalled
+ // (for the same reason we don't do any resolution changes in the c-tor)
+ static bool vblHandlerInstalled;
+ if (!vblHandlerInstalled) {
+ if (!Supexec(InstallVblHandler)) {
+ error("VBL handler was not installed");
+ }
+ vblHandlerInstalled = true;
+ }
+ }
+
_pendingState.inTransaction = false;
_ignoreCursorChanges = false;
diff --git a/graphics/blit/blit-atari.cpp b/graphics/blit/blit-atari.cpp
index cf8257c5aa7..67ba3371b9e 100644
--- a/graphics/blit/blit-atari.cpp
+++ b/graphics/blit/blit-atari.cpp
@@ -122,8 +122,8 @@ void Surface::create(int16 width, int16 height, const PixelFormat &f) {
if (!pixels)
error("Not enough memory to allocate a surface");
- else if (pixels <= (void *)0xA0000000)
- warning("SuperVidel surface allocated in regular memory");
+
+ assert(pixels >= (void *)0xA0000000);
} else {
#else
{
@@ -131,8 +131,8 @@ void Surface::create(int16 width, int16 height, const PixelFormat &f) {
pixels = ::calloc(height * pitch, f.bytesPerPixel);
if (!pixels)
error("Not enough memory to allocate a surface");
- else
- assert(((uintptr)pixels & (ALIGN - 1)) == 0);
+
+ assert(((uintptr)pixels & (ALIGN - 1)) == 0);
}
}
}
More information about the Scummvm-git-logs
mailing list