From 0c26194a3f0b7634e4cb7f254d88f9e2c1018d32 Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Sat, 30 May 2026 00:46:42 +0200 Subject: [PATCH 1/4] revert to a state from earlier --- src/serum-decode.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/serum-decode.cpp b/src/serum-decode.cpp index 47f42a6..cd7c4fc 100644 --- a/src/serum-decode.cpp +++ b/src/serum-decode.cpp @@ -4729,16 +4729,9 @@ static uint32_t Serum_ColorizeWithMetadatav2Internal(uint8_t* frame, monochromePaletteMode = CaptureMonochromePaletteFromFrameV2(lastfound); monochromeMode = false; } - if (g_serumData.triggerIDs[lastfound][0] > 0xff98) - g_serumData.triggerIDs[lastfound][0] = 0xffffffff; - } else { - if (monochromeMode) - g_serumData.triggerIDs[lastfound][0] = MONOCHROME_TRIGGER_ID; - else if (monochromePaletteMode) - g_serumData.triggerIDs[lastfound][0] = MONOCHROME_PALETTE_TRIGGER_ID; - else - g_serumData.triggerIDs[lastfound][0] = 0xffffffff; } + if (g_serumData.triggerIDs[lastfound][0] > 0xff98) + g_serumData.triggerIDs[lastfound][0] = 0xffffffff; if (!monochromeMode && g_serumData.sceneGenerator->isActive() && !sceneFrameRequested && From 0be4949d39e97a6b1c45472644f2afa855d8c87b Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Sat, 30 May 2026 01:46:27 +0200 Subject: [PATCH 2/4] redo comment as behaviour has changed. --- src/serum-decode.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/serum-decode.cpp b/src/serum-decode.cpp index cd7c4fc..3e46261 100644 --- a/src/serum-decode.cpp +++ b/src/serum-decode.cpp @@ -4716,11 +4716,14 @@ static uint32_t Serum_ColorizeWithMetadatav2Internal(uint8_t* frame, if (showStatusMessages) ignoreUnknownFramesTimeout = 0x2000; } if (frameID != IDENTIFY_NO_FRAME && !showStatusMessages) { - // Ignore any triggers for full black frames as they appear in-game and in - // monochrome settings mode and we don't know what authors did with them - // (accidentally). Black frames in-game should be shown. In monochrome - // settings mode, they should not end the monochrome mode. - if (!IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight)) { + // Black frames can distort a monochrome stream. Example: flashing text in + // a WPC settings menu. This could trigger a random black frame in the + // project, if this black frame doesn't have the appropriate monochrome + // trigger, it would end the monochrome stream and stay stuck on a black + // frame until a frame in the project is detected again. The code below + // takes care of that. + if (!IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight) || + (!monochromeMode && !monochromePaletteMode)) { monochromeMode = (g_serumData.triggerIDs[lastfound][0] == MONOCHROME_TRIGGER_ID); monochromePaletteMode = false; From def5b12caa01f95fdffbefbe46faf785c7d61d41 Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Sat, 30 May 2026 01:58:35 +0200 Subject: [PATCH 3/4] reverse the order, checking monochrome state first is quicker --- src/serum-decode.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/serum-decode.cpp b/src/serum-decode.cpp index 3e46261..1a1f1cf 100644 --- a/src/serum-decode.cpp +++ b/src/serum-decode.cpp @@ -4722,8 +4722,8 @@ static uint32_t Serum_ColorizeWithMetadatav2Internal(uint8_t* frame, // trigger, it would end the monochrome stream and stay stuck on a black // frame until a frame in the project is detected again. The code below // takes care of that. - if (!IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight) || - (!monochromeMode && !monochromePaletteMode)) { + if ((!monochromeMode && !monochromePaletteMode) || + !IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight)) { monochromeMode = (g_serumData.triggerIDs[lastfound][0] == MONOCHROME_TRIGGER_ID); monochromePaletteMode = false; From ffeb0e878ff069d3572e18b02395b79341c212fe Mon Sep 17 00:00:00 2001 From: Jan Vos Date: Sat, 30 May 2026 13:02:13 +0200 Subject: [PATCH 4/4] same black frame/monochrome logic for v1 --- src/serum-decode.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/src/serum-decode.cpp b/src/serum-decode.cpp index 1a1f1cf..f88aacd 100644 --- a/src/serum-decode.cpp +++ b/src/serum-decode.cpp @@ -4402,25 +4402,22 @@ uint32_t Serum_ColorizeWithMetadatav1(uint8_t* frame) { if (showStatusMessages) ignoreUnknownFramesTimeout = 0x2000; } if (frameID != IDENTIFY_NO_FRAME && !showStatusMessages) { - // Ignore any triggers for full black frames as they appear in-game and in - // monochrome settings mode and we don't know what authors did with them - // (accidentally). Black frames in-game should be shown. In monochrome - // settings mode, they should not end the monochrome mode. - if (!IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight)) { + // Black frames can distort a monochrome stream. Example: flashing text in + // a WPC settings menu. This could trigger a random black frame in the + // project, if this black frame doesn't have the appropriate monochrome + // trigger, it would end the monochrome stream and stay stuck on a black + // frame until a frame in the project is detected again. The code below + // takes care of that. + if ((!monochromeMode && !monochromePaletteMode) || + !IsFullBlackFrame(frame, g_serumData.fwidth * g_serumData.fheight)) { monochromeMode = (g_serumData.triggerIDs[lastfound][0] == MONOCHROME_TRIGGER_ID); monochromePaletteMode = false; - if (g_serumData.triggerIDs[lastfound][0] > 0xff98) - g_serumData.triggerIDs[lastfound][0] = 0xffffffff; - } else { - if (monochromeMode) - g_serumData.triggerIDs[lastfound][0] = MONOCHROME_TRIGGER_ID; - else if (monochromePaletteMode) - g_serumData.triggerIDs[lastfound][0] = MONOCHROME_PALETTE_TRIGGER_ID; - else - g_serumData.triggerIDs[lastfound][0] = 0xffffffff; } + if (g_serumData.triggerIDs[lastfound][0] > 0xff98) + g_serumData.triggerIDs[lastfound][0] = 0xffffffff; + lastframe_found = now; if (maxFramesToSkip) { framesSkippedCounter = 0;