Skip to content

Commit

Permalink
pixelcade: fix rendering RGB24 and partial 128x16 frames
Browse files Browse the repository at this point in the history
  • Loading branch information
jsm174 committed May 10, 2024
1 parent 9f6efa9 commit e628ae9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/DMD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,7 @@ void DMD::PixelcadeDMDThread()
if (m_pUpdateBufferQueue[bufferPosition]->hasData || m_pUpdateBufferQueue[bufferPosition]->hasSegData)
{
uint16_t width = m_pUpdateBufferQueue[bufferPosition]->width;
uint8_t height = m_pUpdateBufferQueue[bufferPosition]->height;
uint16_t height = m_pUpdateBufferQueue[bufferPosition]->height;
int length = width * height;
uint8_t depth = m_pUpdateBufferQueue[bufferPosition]->depth;

Expand All @@ -776,7 +776,7 @@ void DMD::PixelcadeDMDThread()

uint8_t scaledBuffer[128 * 32 * 3];
if (width == 128 && height == 32)
memcpy(scaledBuffer, m_pUpdateBufferQueue[bufferPosition]->segData, 128 * 32 * 3);
memcpy(scaledBuffer, rgb24Data, 128 * 32 * 3);
else if (width == 128 && height == 16)
FrameUtil::Helper::Center(scaledBuffer, 128, 32, rgb24Data, 128, 16, 24);
else if (width == 192 && height == 64)
Expand All @@ -786,7 +786,7 @@ void DMD::PixelcadeDMDThread()
else
continue;

for (int i = 0; i < length; i++)
for (int i = 0; i < 128 * 32; i++)
{
int pos = i * 3;
uint32_t r = scaledBuffer[pos];
Expand Down Expand Up @@ -885,7 +885,7 @@ void DMD::PixelcadeDMDThread()

if (update)
{
for (int i = 0; i < length; i++)
for (int i = 0; i < 128 * 32; i++)
{
int pos = renderBuffer[i] * 3;
uint32_t r = palette[pos];
Expand Down Expand Up @@ -1389,7 +1389,7 @@ void DMD::PupDMDThread()
m_pUpdateBufferQueue[bufferPosition]->mode == Mode::Data && m_pUpdateBufferQueue[bufferPosition]->depth != 24)
{
uint16_t width = m_pUpdateBufferQueue[bufferPosition]->width;
uint8_t height = m_pUpdateBufferQueue[bufferPosition]->height;
uint16_t height = m_pUpdateBufferQueue[bufferPosition]->height;
int length = width * height;

if (memcmp(renderBuffer, m_pUpdateBufferQueue[bufferPosition]->data, length) != 0)
Expand Down

0 comments on commit e628ae9

Please sign in to comment.