Update Makefile, uses correct pixel format.
This commit is contained in:
parent
50cdc30e1f
commit
b53d538d76
2
Makefile
2
Makefile
|
@ -46,7 +46,7 @@ uninstall: $(TARGET)
|
||||||
rm -rf $(PREFIX)/bin/$(TARGET)
|
rm -rf $(PREFIX)/bin/$(TARGET)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -rf $(OBJ)
|
rm -rf *.o hqflt/*.o
|
||||||
rm -rf $(TARGET)
|
rm -rf $(TARGET)
|
||||||
|
|
||||||
.PHONY: all install uninstall clean
|
.PHONY: all install uninstall clean
|
||||||
|
|
4
gl.c
4
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);
|
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();
|
glLoadIdentity();
|
||||||
glColor3f(1,1,1);
|
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);
|
glBindTexture(GL_TEXTURE_2D, texture);
|
||||||
glPixelStorei(GL_UNPACK_ROW_LENGTH, 256 * video->input_scale);
|
glPixelStorei(GL_UNPACK_ROW_LENGTH, 256 * video->input_scale);
|
||||||
glTexImage2D(GL_TEXTURE_2D,
|
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);
|
GL_UNSIGNED_SHORT_1_5_5_5_REV, gl_buffer);
|
||||||
|
|
||||||
*input = &input_glfw;
|
*input = &input_glfw;
|
||||||
|
|
12
ssnes.c
12
ssnes.c
|
@ -150,8 +150,6 @@ static void uninit_video_input(void)
|
||||||
driver.input->free(driver.input_data);
|
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)
|
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++ )
|
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;
|
const uint16_t *src = in + y * 1024;
|
||||||
uint16_t *dst = out + y * width;
|
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));
|
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)
|
static void video_frame(const uint16_t *data, unsigned width, unsigned height)
|
||||||
{
|
{
|
||||||
if ( !video_active )
|
if ( !video_active )
|
||||||
|
|
Loading…
Reference in New Issue