From b53d538d763f2f517dc7789346b969dffd54ca9c Mon Sep 17 00:00:00 2001 From: Themaister Date: Sun, 27 Jun 2010 18:24:26 +0200 Subject: [PATCH] Update Makefile, uses correct pixel format. --- Makefile | 2 +- gl.c | 4 ++-- ssnes.c | 12 ++---------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 515634dfc4..670ad4415f 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ uninstall: $(TARGET) rm -rf $(PREFIX)/bin/$(TARGET) clean: - rm -rf $(OBJ) + rm -rf *.o hqflt/*.o rm -rf $(TARGET) .PHONY: all install uninstall clean diff --git a/gl.c b/gl.c index ac9fe6d676..8b7adf46d9 100644 --- a/gl.c +++ b/gl.c @@ -144,7 +144,7 @@ static bool gl_frame(void *data, const uint16_t* frame, int width, int height) glPixelStorei(GL_UNPACK_ROW_LENGTH, width); - glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_RGBA, GL_UNSIGNED_SHORT_1_5_5_5_REV, frame); + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, width, height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, frame); glLoadIdentity(); glColor3f(1,1,1); @@ -221,7 +221,7 @@ static void* gl_init(video_info_t *video, const input_driver_t **input) glBindTexture(GL_TEXTURE_2D, texture); glPixelStorei(GL_UNPACK_ROW_LENGTH, 256 * video->input_scale); glTexImage2D(GL_TEXTURE_2D, - 0, GL_RGB, 256 * video->input_scale, 256 * video->input_scale, 0, GL_RGBA, + 0, GL_RGB, 256 * video->input_scale, 256 * video->input_scale, 0, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, gl_buffer); *input = &input_glfw; diff --git a/ssnes.c b/ssnes.c index 053b83d0dd..02a428343d 100644 --- a/ssnes.c +++ b/ssnes.c @@ -150,8 +150,6 @@ static void uninit_video_input(void) driver.input->free(driver.input_data); } -// Temporary hack. Needs to do some color space switching for some unknown reason. Worked in 0.064 without hack at least. -#define USE_HACK 1 static inline void process_frame (uint16_t * restrict out, const uint16_t * restrict in, unsigned width, unsigned height) { for ( int y = 0; y < height; y++ ) @@ -159,18 +157,12 @@ static inline void process_frame (uint16_t * restrict out, const uint16_t * rest const uint16_t *src = in + y * 1024; uint16_t *dst = out + y * width; -#if USE_HACK - for ( int x = 0; x < width; x++ ) - { - uint16_t color = src[x]; - *dst++ = ((color >> 10) & 0x1f) | (color & 0x3e0) | ((color & 0x1f) << 10); - } -#else memcpy(dst, src, width * sizeof(uint16_t)); -#endif } } +// libsnes: 0.065 +// Format received is 16-bit 0RRRRRGGGGGBBBBB static void video_frame(const uint16_t *data, unsigned width, unsigned height) { if ( !video_active )