microsoft / pxt-brainpad

Microsoft MakeCode editor for the GHI Brainpad
https://makecode.brainpad.com/
Other
3 stars 11 forks source link

use new pixel format #59

Closed mmoskal closed 6 years ago

mmoskal commented 6 years ago

The new pixel format in images should be now exactly what you guys expect. I think you just need to do the following, but please test.

CC @pelikhan

diff --git a/source/BrainPadDisplay.cpp b/source/BrainPadDisplay.cpp
index ea28e88..c8fb835 100644
--- a/source/BrainPadDisplay.cpp
+++ b/source/BrainPadDisplay.cpp
@@ -69,14 +69,6 @@ void BrainPadDisplay::flush() {
 }

 void BrainPadDisplay::writeScreenBuffer(uint8_t* buffer) {
-    for (int x = 0; x < 128; x++) {
-        for (int y = 0; y < 64; y++) {
-            int offset = y * 16 + x / 8;
-            int mask = 0x80 >> (x & 7);
-
-            drawNativePixel(x, y, (buffer[offset] & mask) > 0);
-        }
-    }
-
+    memcpy(vram + 1, buffer, vramSize - 1);
     flush();
 }
pelikhan commented 6 years ago

wait on https://github.com/Microsoft/pxt-brainpad/issues/61

Arke64 commented 6 years ago

Updated in v0.0.15 https://github.com/ghi-electronics/codal-brainpad/releases/tag/v0.0.15

v0.0.16 https://github.com/ghi-electronics/codal-brainpad/releases/tag/v0.0.16

pelikhan commented 6 years ago

https://github.com/Microsoft/pxt-brainpad/pull/77