mirror of
https://github.com/libretro/RetroArch
synced 2025-03-26 11:37:30 +00:00
Fix 15->16 bit conversions.
This commit is contained in:
parent
eeebc2d06b
commit
d66e039536
14
dynamic.c
14
dynamic.c
@ -101,7 +101,7 @@ unsigned (*psnes_get_memory_size)(unsigned);
|
|||||||
void (*psnes_unload_cartridge)(void);
|
void (*psnes_unload_cartridge)(void);
|
||||||
void (*psnes_term)(void);
|
void (*psnes_term)(void);
|
||||||
|
|
||||||
#ifdef NEED_DYNAMIC
|
#if defined(NEED_DYNAMIC) || defined(GEKKO) || defined(__CELLOS_LV2__) || defined(XENON)
|
||||||
static void set_environment(void);
|
static void set_environment(void);
|
||||||
#endif
|
#endif
|
||||||
static void set_environment_defaults(void);
|
static void set_environment_defaults(void);
|
||||||
@ -222,7 +222,7 @@ void init_libsnes_sym(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
set_environment_defaults();
|
set_environment_defaults();
|
||||||
#ifdef NEED_DYNAMIC
|
#if defined(NEED_DYNAMIC) || defined(GEKKO) || defined(__CELLOS_LV2__) || defined(XENON)
|
||||||
set_environment();
|
set_environment();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@ -280,7 +280,9 @@ void dylib_close(dylib_t lib)
|
|||||||
dlclose(lib);
|
dlclose(lib);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(NEED_DYNAMIC) || defined(GEKKO) || defined(__CELLOS_LV2__) || defined(XENON)
|
||||||
static bool environment_cb(unsigned cmd, void *data)
|
static bool environment_cb(unsigned cmd, void *data)
|
||||||
{
|
{
|
||||||
switch (cmd)
|
switch (cmd)
|
||||||
@ -340,7 +342,9 @@ static bool environment_cb(unsigned cmd, void *data)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NEED_DYNAMIC
|
||||||
// SSNES extension hooks. Totally optional 'n shizz :)
|
// SSNES extension hooks. Totally optional 'n shizz :)
|
||||||
static void set_environment(void)
|
static void set_environment(void)
|
||||||
{
|
{
|
||||||
@ -356,6 +360,12 @@ static void set_environment(void)
|
|||||||
if (psnes_set_environment)
|
if (psnes_set_environment)
|
||||||
psnes_set_environment(environment_cb);
|
psnes_set_environment(environment_cb);
|
||||||
}
|
}
|
||||||
|
#elif defined(GEKKO) || defined(__CELLOS_LV2__) || defined(XENON)
|
||||||
|
// Not very optional when we're running on a console without dynamic loading support.
|
||||||
|
static void set_environment(void)
|
||||||
|
{
|
||||||
|
snes_set_environment(environment_cb);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Assume SNES as defaults.
|
// Assume SNES as defaults.
|
||||||
|
@ -98,7 +98,7 @@ static bool wii_key_pressed(void *data, int key)
|
|||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
case SSNES_QUIT_KEY:
|
case SSNES_QUIT_KEY:
|
||||||
return g_quit || pad_state[0][SNES_DEVICE_ID_JOYPAD_START];
|
return g_quit || pad_state[0][SNES_DEVICE_ID_JOYPAD_SELECT];
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@ int ssnes_main(int argc, char **argv);
|
|||||||
int main(void)
|
int main(void)
|
||||||
{
|
{
|
||||||
char arg0[] = "ssnes";
|
char arg0[] = "ssnes";
|
||||||
char arg1[] = "sd:/FFIII.smc";
|
char arg1[] = "sd:/MM2.nes";
|
||||||
char *argv[] = { arg0, arg1, NULL };
|
char *argv[] = { arg0, arg1, NULL };
|
||||||
|
|
||||||
fatInitDefault();
|
fatInitDefault();
|
||||||
|
20
wii/video.c
20
wii/video.c
@ -159,15 +159,17 @@ static void update_texture(const uint32_t *src,
|
|||||||
width &= ~15;
|
width &= ~15;
|
||||||
height &= ~3;
|
height &= ~3;
|
||||||
|
|
||||||
|
#define RGB15to16(col) ({ uint32_t hi = (col << 1) & 0xffe0ffe0u; uint32_t lo = col & 0x001f001f; hi | lo; })
|
||||||
|
|
||||||
#define BLIT_CHUNK(off) { \
|
#define BLIT_CHUNK(off) { \
|
||||||
tmp_dst[ 0 + off] = tmp_src[0]; \
|
tmp_dst[ 0 + off] = RGB15to16(tmp_src[0]); \
|
||||||
tmp_dst[ 1 + off] = tmp_src[1]; \
|
tmp_dst[ 1 + off] = RGB15to16(tmp_src[1]); \
|
||||||
tmp_dst[ 8 + off] = tmp_src[2]; \
|
tmp_dst[ 8 + off] = RGB15to16(tmp_src[2]); \
|
||||||
tmp_dst[ 9 + off] = tmp_src[3]; \
|
tmp_dst[ 9 + off] = RGB15to16(tmp_src[3]); \
|
||||||
tmp_dst[16 + off] = tmp_src[4]; \
|
tmp_dst[16 + off] = RGB15to16(tmp_src[4]); \
|
||||||
tmp_dst[17 + off] = tmp_src[5]; \
|
tmp_dst[17 + off] = RGB15to16(tmp_src[5]); \
|
||||||
tmp_dst[24 + off] = tmp_src[6]; \
|
tmp_dst[24 + off] = RGB15to16(tmp_src[6]); \
|
||||||
tmp_dst[25 + off] = tmp_src[7]; }
|
tmp_dst[25 + off] = RGB15to16(tmp_src[7]); }
|
||||||
|
|
||||||
#define BLIT_LINE(off) { \
|
#define BLIT_LINE(off) { \
|
||||||
const uint32_t *tmp_src = src; \
|
const uint32_t *tmp_src = src; \
|
||||||
@ -178,7 +180,7 @@ static void update_texture(const uint32_t *src,
|
|||||||
|
|
||||||
width >>= 1;
|
width >>= 1;
|
||||||
|
|
||||||
// Texture data is 4x4 tiled @ 15bpp (docs say it's RGB565, but apparently it's RGB555).
|
// Texture data is 4x4 tiled @ 15bpp.
|
||||||
// Use 32-bit to transfer more data per cycle.
|
// Use 32-bit to transfer more data per cycle.
|
||||||
uint32_t *dst = g_tex.data;
|
uint32_t *dst = g_tex.data;
|
||||||
for (unsigned i = 0; i < height; i += 4, dst += 4 * width)
|
for (unsigned i = 0; i < height; i += 4, dst += 4 * width)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user