Skip to content

Commit 9f97a73

Browse files
authored
Support new cROMc format, color rotation fixes (#86)
1 parent 11f2a92 commit 9f97a73

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

CMakeLists.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,10 @@ message(STATUS "POST_BUILD_COPY_EXT_LIBS: ${POST_BUILD_COPY_EXT_LIBS}")
1717
message(STATUS "ENABLE_SANITIZERS: ${ENABLE_SANITIZERS}")
1818

1919
if(PLATFORM STREQUAL "macos")
20-
set(CMAKE_OSX_DEPLOYMENT_TARGET 14.0)
20+
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
21+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
22+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address -g")
23+
endif()
2124
elseif(PLATFORM STREQUAL "ios" OR PLATFORM STREQUAL "ios-simulator")
2225
set(CMAKE_SYSTEM_NAME iOS)
2326
if (PLATFORM STREQUAL "ios-simulator")

include/DMDUtil/DMDUtil.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#pragma once
22

33
#define DMDUTIL_VERSION_MAJOR 0 // X Digits
4-
#define DMDUTIL_VERSION_MINOR 10 // Max 2 Digits
4+
#define DMDUTIL_VERSION_MINOR 11 // Max 2 Digits
55
#define DMDUTIL_VERSION_PATCH 0 // Max 2 Digits
66

77
#define _DMDUTIL_STR(x) #x

platforms/config.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
set -e
44

5-
LIBZEDMD_SHA=ab59ccf67bdded2fe88a3f14368a2b4d7fe8a4c6
6-
LIBSERUM_SHA=ecf1fb6e9e0464593646150ca82ef6d5f177a113
5+
LIBZEDMD_SHA=41c84011247dd55650b711e8680ae7088a86b822
6+
LIBSERUM_SHA=1fe1713322252463386aa4b68159f10d0fae881b
77
LIBPUPDMD_SHA=124f45e5ddd59ceb339591de88fcca72f8c54612
88

99
if [ -z "${BUILD_TYPE}" ]; then

src/DMD.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,7 +1014,7 @@ void DMD::SerumThread()
10141014
{
10151015
uint32_t result = Serum_Colorize(m_pUpdateBufferQueue[bufferPositionMod]->data);
10161016

1017-
if (result != IDENTIFY_NO_FRAME)
1017+
if (result != IDENTIFY_NO_FRAME && result != IDENTIFY_SAME_FRAME)
10181018
{
10191019
// Log(DMDUtil_LogLevel_DEBUG, "Serum: frameID=%lu, rotation=%lu, flags=%lu", m_pSerum->frameID,
10201020
// m_pSerum->rotationtimer, m_pSerum->flags);
@@ -1024,7 +1024,11 @@ void DMD::SerumThread()
10241024
QueueSerumFrames(lastDmdUpdate, flags & FLAG_REQUEST_32P_FRAMES, flags & FLAG_REQUEST_64P_FRAMES);
10251025

10261026
if (result > 0 && ((result & 0xffff) < 2048))
1027+
{
10271028
nextRotation = now + m_pSerum->rotationtimer;
1029+
if (result & 0x40000) Log(DMDUtil_LogLevel_DEBUG, "Serum: starting scene rotation, timer=%lu",
1030+
m_pSerum->rotationtimer);
1031+
}
10281032
else
10291033
nextRotation = 0;
10301034

@@ -1058,11 +1062,11 @@ void DMD::SerumThread()
10581062

10591063
if (m_pSerum)
10601064
{
1061-
if (nextRotation > 0 && m_pSerum->rotationtimer > 0 && lastDmdUpdate && now > nextRotation)
1065+
if (nextRotation > 0 && m_pSerum->rotationtimer > 0 && lastDmdUpdate && now >= nextRotation)
10621066
{
10631067
uint32_t result = Serum_Rotate();
10641068

1065-
// Log(DMDUtil_LogLevel_DEBUG, "Serum: rotation=%lu, flags=%lu", m_pSerum->rotationtimer, result >> 16);
1069+
Log(DMDUtil_LogLevel_DEBUG, "Serum: rotation=%lu, flags=%lu", m_pSerum->rotationtimer, result >> 16);
10661070

10671071
QueueSerumFrames(lastDmdUpdate, result & 0x10000, result & 0x20000);
10681072

0 commit comments

Comments
 (0)