aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authortwinaphex2012-12-04 14:16:34 +0100
committernotaz2012-12-10 23:20:59 +0200
commit46aa5b98890412bca8487b28809df3ece137dba9 (patch)
tree6f10a0188824158704b09be75bd868a0afd0ba66 /frontend
parentf9f60dae01fe8a8262d52950893c2674c4545f4a (diff)
downloadpcsx_rearmed-46aa5b98890412bca8487b28809df3ece137dba9.tar.gz
pcsx_rearmed-46aa5b98890412bca8487b28809df3ece137dba9.tar.bz2
pcsx_rearmed-46aa5b98890412bca8487b28809df3ece137dba9.zip
libretro: make RGB565 support into compile-time option
all libretro frontends should support this no matter what
Diffstat (limited to 'frontend')
-rw-r--r--frontend/libretro.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/frontend/libretro.c b/frontend/libretro.c
index 15041bc..49e346b 100644
--- a/frontend/libretro.c
+++ b/frontend/libretro.c
@@ -30,7 +30,6 @@ static retro_audio_sample_batch_t audio_batch_cb;
static void *vout_buf;
static int samples_sent, samples_to_send;
static int plugins_opened;
-static int native_rgb565;
/* memory card data */
extern char Mcd1Data[MCD_SIZE];
@@ -51,6 +50,7 @@ static void vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp)
{
}
+#ifdef FRONTEND_SUPPORTS_RGB565
static void convert(void *buf, size_t bytes)
{
unsigned int i, v, *p = buf;
@@ -60,6 +60,7 @@ static void convert(void *buf, size_t bytes)
p[i] = (v & 0x001f001f) | ((v >> 1) & 0x7fe07fe0);
}
}
+#endif
static void vout_flip(const void *vram, int stride, int bgr24, int w, int h)
{
@@ -90,8 +91,9 @@ static void vout_flip(const void *vram, int stride, int bgr24, int w, int h)
}
out:
- if (!native_rgb565)
- convert(vout_buf, w * h * 2);
+#ifndef FRONTEND_SUPPORTS_RGB565
+ convert(vout_buf, w * h * 2);
+#endif
video_cb(vout_buf, w, h, w * 2);
pl_rearmed_cbs.flip_cnt++;
}
@@ -237,11 +239,12 @@ void retro_cheat_set(unsigned index, bool enabled, const char *code)
bool retro_load_game(const struct retro_game_info *info)
{
+#ifdef FRONTEND_SUPPORTS_RGB565
enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
if (environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
- native_rgb565 = 1;
fprintf(stderr, "RGB565 supported, using it\n");
}
+#endif
if (plugins_opened) {
ClosePlugins();
@@ -402,4 +405,3 @@ void retro_deinit(void)
free(vout_buf);
vout_buf = NULL;
}
-