From fa25a167a98b3ae9a6f9c9e366290ba1b6813b0a Mon Sep 17 00:00:00 2001 From: notaz Date: Thu, 11 Sep 2014 04:21:26 +0300 Subject: [PATCH] fix rgb order --- Makefile | 2 +- vdp1_to_png.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index d73cb81..219e9e0 100644 --- a/Makefile +++ b/Makefile @@ -10,4 +10,4 @@ all: $(TARGETS) vdp1_to_png: LDLIBS += -lpng clean: - $(RM) $(TARGET) + $(RM) $(TARGETS) diff --git a/vdp1_to_png.c b/vdp1_to_png.c index 6b62437..3d1da46 100644 --- a/vdp1_to_png.c +++ b/vdp1_to_png.c @@ -33,9 +33,9 @@ static int writepng(const char *fname, const unsigned short *src) row_pointers[i] = dst; for (j = 0; j < WIDTH; j++, src++, dst += 3) { unsigned short v = (*src >> 8) | (*src << 8); - dst[0] = (v & 0x7c00) >> 7; - dst[1] = (v & 0x03e0) >> 2; - dst[2] = (v & 0x001f) << 3; + dst[0] = (v & 0x001f) << 3; // r + dst[1] = (v & 0x03e0) >> 2; // g + dst[2] = (v & 0x7c00) >> 7; // b } } -- 2.39.5