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

bluegr noreply at scummvm.org
Tue Jun 24 10:57:39 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:
e626504e49 COMMON: add EventType user range and update AsylumEventType


Commit: e626504e498a0e1c4c535bf8fd5b45c3ad3e77e5
    https://github.com/scummvm/scummvm/commit/e626504e498a0e1c4c535bf8fd5b45c3ad3e77e5
Author: William Bonnaventure (william.bonnaventure at gmail.com)
Date: 2025-06-24T13:57:36+03:00

Commit Message:
COMMON: add EventType user range and update AsylumEventType

This was the root cause of a black screen with ASYLUM engine
on PSP2. A casting was made in AsylumEvent() that expects
at least 16bits, but before this patch the cast would change the
event type value thus breaking the ASYLUM engine.

Changed paths:
    common/events.h
    engines/asylum/eventhandler.h


diff --git a/common/events.h b/common/events.h
index 82ac0f0e098..c39cb67e6b3 100644
--- a/common/events.h
+++ b/common/events.h
@@ -115,7 +115,18 @@ enum EventType {
 
 	/** ScummVM has gained or lost focus. */
 	EVENT_FOCUS_GAINED = 36,
-	EVENT_FOCUS_LOST = 37
+	EVENT_FOCUS_LOST = 37,
+
+	/**
+	 * We reserve some event ids for custom events.
+	 * 
+	 * This is used for example by Asylum and Bagel engines.
+	 * Your custom event ids must be in this range.
+	 * This also prevents compiler from using a too short datatype
+	 *  for storing this enum on some platforms.
+	 */
+	EVENT_USER_FIRST_AVAILABLE = 1000,
+	EVENT_USER_LAST_AVAILABLE = 9999
 };
 
 const int16 JOYAXIS_MIN = -32768;
diff --git a/engines/asylum/eventhandler.h b/engines/asylum/eventhandler.h
index b67a6cc3109..f1c954580d8 100644
--- a/engines/asylum/eventhandler.h
+++ b/engines/asylum/eventhandler.h
@@ -28,7 +28,7 @@
 namespace Asylum {
 
 enum AsylumEventType {
-	EVENT_ASYLUM_MIDI     = 953,
+	EVENT_ASYLUM_MIDI     = 1053,
 	EVENT_ASYLUM_CHANGECD = 5120,
 	EVENT_ASYLUM_INIT     = 5122,
 	EVENT_ASYLUM_UPDATE   = 5121,
@@ -37,7 +37,7 @@ enum AsylumEventType {
 	EVENT_ASYLUM_SUBTITLE = 5125,
 	EVENT_ASYLUM_MUSIC    = 5376,
 
-	EVENT_ASYLUM_ACTIVATE = 0xFFF0
+	EVENT_ASYLUM_ACTIVATE = 6000
 };
 
 struct AsylumEvent : public Common::Event {




More information about the Scummvm-git-logs mailing list