Skip to content

Commit 71328d6

Browse files
committed
fixed HD info, added debug output
1 parent 78297e5 commit 71328d6

File tree

2 files changed

+31
-12
lines changed

2 files changed

+31
-12
lines changed

include/DMDUtil/DMD.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
#define DMDUTILCALLBACK
99
#endif
1010

11-
#define DMDUTIL_FRAME_BUFFER_SIZE 32
11+
#define DMDUTIL_FRAME_BUFFER_SIZE 64
1212
#define DMDUTIL_MIN_FRAMES_BEHIND 4
13-
#define DMDUTIL_MAX_FRAMES_BEHIND 16
13+
#define DMDUTIL_MAX_FRAMES_BEHIND 32
1414
#define DMDUTIL_MAX_NAME_SIZE 16
1515
#define DMDUTIL_MAX_PATH_SIZE 256
1616
#define DMDUTIL_MAX_TRANSITIONAL_FRAME_DURATION 25

src/DMD.cpp

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,20 @@ bool DMD::HasDisplay() const
300300
#endif
301301
}
302302

303-
bool DMD::HasHDDisplay() const { return (m_pZeDMD != nullptr && m_pZeDMD->GetWidth() == 256); }
303+
bool DMD::HasHDDisplay() const
304+
{
305+
if (m_pZeDMD != nullptr && m_pZeDMD->GetWidth() == 256) return true;
306+
307+
if (m_rgb24DMDs.size() > 0)
308+
{
309+
for (RGB24DMD* pRGB24DMD : m_rgb24DMDs)
310+
{
311+
if (pRGB24DMD->GetWidth() == 256) return true;
312+
}
313+
}
314+
315+
return false;
316+
}
304317

305318
void DMD::SetRomName(const char* name) { strcpy(m_romName, name ? name : ""); }
306319

@@ -450,8 +463,8 @@ void DMD::QueueUpdate(const std::shared_ptr<Update> dmdUpdate, bool buffered)
450463
m_updateBufferQueuePosition.store(updateBufferQueuePosition, std::memory_order_release);
451464
m_dmdFrameReady.store(true, std::memory_order_release);
452465

453-
// Log(DMDUtil_LogLevel_DEBUG, "Queued Frame: position=%d, mode=%d, depth=%d", updateBufferQueuePosition,
454-
// dmdUpdate->mode, dmdUpdate->depth);
466+
Log(DMDUtil_LogLevel_DEBUG, "Queued Frame: position=%d, mode=%d, depth=%d", updateBufferQueuePosition,
467+
dmdUpdate->mode, dmdUpdate->depth);
455468

456469
if (buffered)
457470
{
@@ -950,6 +963,7 @@ void DMD::SerumThread()
950963

951964
if (result != IDENTIFY_NO_FRAME)
952965
{
966+
Log(DMDUtil_LogLevel_DEBUG, "Got PUP scene %d, frame %d colorized", prevTriggerId, sceneCurrentFrame - 1);
953967
QueueSerumFrames(sceneUpdate);
954968
}
955969
}
@@ -1020,25 +1034,30 @@ void DMD::SerumThread()
10201034
}
10211035

10221036
if (m_altColorPath[0] == '\0') strcpy(m_altColorPath, Config::GetInstance()->GetAltColorPath());
1023-
uint8_t flags = FLAG_REQUEST_32P_FRAMES;
1037+
uint8_t flags = 0;
10241038
// At the moment, ZeDMD HD and RGB24DMD are the only devices supporting 64P frames. Not requesting 64P saves
10251039
// memory.
1026-
if (m_pZeDMD && m_pZeDMD->GetWidth() == 256)
1040+
if (m_pZeDMD)
10271041
{
1028-
flags |= FLAG_REQUEST_64P_FRAMES;
1042+
if (m_pZeDMD->GetWidth() == 256)
1043+
flags |= FLAG_REQUEST_64P_FRAMES;
1044+
else
1045+
flags = FLAG_REQUEST_32P_FRAMES;
10291046
}
1030-
else if (m_rgb24DMDs.size() > 0)
1047+
1048+
if (m_rgb24DMDs.size() > 0)
10311049
{
10321050
for (RGB24DMD* pRGB24DMD : m_rgb24DMDs)
10331051
{
10341052
if (pRGB24DMD->GetWidth() == 256)
1035-
{
10361053
flags |= FLAG_REQUEST_64P_FRAMES;
1037-
break;
1038-
}
1054+
else
1055+
flags |= FLAG_REQUEST_32P_FRAMES;
10391056
}
10401057
}
10411058

1059+
if (m_pPixelcadeDMD) flags |= FLAG_REQUEST_32P_FRAMES;
1060+
10421061
m_pSerum = (name[0] != '\0') ? Serum_Load(m_altColorPath, m_romName, flags) : nullptr;
10431062
if (m_pSerum)
10441063
{

0 commit comments

Comments
 (0)