Skip to content

Commit

Permalink
fixed rgb565 mode with ZeDMD
Browse files Browse the repository at this point in the history
  • Loading branch information
mkalkbrenner committed Feb 16, 2024
1 parent 463aa09 commit 766956a
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 10 deletions.
2 changes: 1 addition & 1 deletion platforms/android/arm64-v8a/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

if [[ $(uname) == "Linux" ]]; then
Expand Down
2 changes: 1 addition & 1 deletion platforms/ios/arm64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(sysctl -n hw.ncpu)
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux/aarch64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(nproc)
Expand Down
2 changes: 1 addition & 1 deletion platforms/linux/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(nproc)
Expand Down
2 changes: 1 addition & 1 deletion platforms/macos/arm64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(sysctl -n hw.ncpu)
Expand Down
2 changes: 1 addition & 1 deletion platforms/macos/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(sysctl -n hw.ncpu)
Expand Down
2 changes: 1 addition & 1 deletion platforms/tvos/arm64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

NUM_PROCS=$(sysctl -n hw.ncpu)
Expand Down
2 changes: 1 addition & 1 deletion platforms/win/x64/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

echo "Building libraries..."
Expand Down
2 changes: 1 addition & 1 deletion platforms/win/x86/external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

set -e

LIBZEDMD_SHA=f7cab7910a347d744584274117f541182cd216d8
LIBZEDMD_SHA=7d2b0fc39475940b61b0126f3ff308dd193fe2a8
LIBSERUM_SHA=b69d2b436bc93570a2e7e78d0946cd3c43f7aed5

echo "Building libraries..."
Expand Down
25 changes: 24 additions & 1 deletion src/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "DMDUtil/DMDUtil.h"
#include "DMDUtil/LevelDMD.h"
#include "DMDUtil/RGB24DMD.h"
#include <string.h>

void DMDUTILCALLBACK LogCallback(const char* format, va_list args)
{
Expand Down Expand Up @@ -156,9 +157,31 @@ int main(int argc, const char* argv[])
pDmd->UpdateRGB16Data(image16, 128, 32);
std::this_thread::sleep_for(std::chrono::milliseconds(ms));

ms -= 50;
ms -= 60;
}

FILE* fileptr;
uint16_t size = width * height * 2;
uint8_t* buffer = (uint8_t*)malloc(size * sizeof(uint8_t));
uint16_t* rgb565 = (uint16_t*)malloc(size / 2 * sizeof(uint16_t));
char filename[128];

for (int i = 1; i <= 100; i++)
{
snprintf(filename, 87, "external/libzedmd-7d2b0fc39475940b61b0126f3ff308dd193fe2a8/test/rgb565_%dx%d/%04d.raw", width, height, i);
printf("Render raw: %s\n", filename);
fileptr = fopen(filename, "rb");
fread(buffer, size, 1, fileptr);
fclose(fileptr);

memcpy(rgb565, buffer, size);
pDmd->UpdateRGB16Data(rgb565, 128, 32);
std::this_thread::sleep_for(std::chrono::milliseconds(80));
}

free(buffer);
free(rgb565);

printf("Finished rendering\n");

free(pImage2);
Expand Down

0 comments on commit 766956a

Please sign in to comment.