From: notaz Date: Thu, 11 Sep 2014 01:21:26 +0000 (+0300) Subject: fix rgb order X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fa25a167a98b3ae9a6f9c9e366290ba1b6813b0a;p=saturn.git fix rgb order --- 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 } }