Permalink
Browse files

fill bits hack only for emscripten

  • Loading branch information...
1 parent 638cf41 commit 2ff0f946529ae8a03eaacb148bdb453b2ccc3301 @mental committed Jun 1, 2014
Showing with 7 additions and 4 deletions.
  1. +1 −4 src/retrograph.c
  2. +6 −0 src/retrograph.h
View
@@ -279,9 +279,6 @@ void retrograph_write(retrograph_vdu_t vdu, retrograph_addr_t start_address,
}
}
-// set all unused bits to 1, in case output treated as RGBA
-#define FILL_BITS ~(RETROGRAPH_RED_MASK | RETROGRAPH_GREEN_MASK | RETROGRAPH_BLUE_MASK | RETROGRAPH_ALPHA_MASK);
-
static void update_palette_cache(retrograph_vdu_t vdu) {
int i;
for (i = 0; i < 32; i++) {
@@ -300,7 +297,7 @@ static void update_palette_cache(retrograph_vdu_t vdu) {
vdu->palette_cache[i] = (r << RETROGRAPH_RED_SHIFT)
| (g << RETROGRAPH_GREEN_SHIFT)
| (b << RETROGRAPH_BLUE_SHIFT)
- | FILL_BITS;
+ | RETROGRAPH_FILL_BITS;
}
}
View
@@ -43,6 +43,12 @@ typedef uint32_t retrograph_pixel_t;
#define RETROGRAPH_BLUE_MASK (0xff << RETROGRAPH_BLUE_SHIFT)
#define RETROGRAPH_ALPHA_MASK 0x00
+#ifdef EMSCRIPTEN
+#define RETROGRAPH_FILL_BITS ~(RETROGRAPH_RED_MASK | RETROGRAPH_GREEN_MASK | RETROGRAPH_BLUE_MASK | RETROGRAPH_ALPHA_MASK)
+#else
+#define RETROGRAPH_FILL_BITS 0
+#endif
+
typedef struct retrograph_vdu_tag *retrograph_vdu_t;
typedef uint16_t retrograph_addr_t;

0 comments on commit 2ff0f94

Please sign in to comment.