This commit is contained in:
twinaphex
2015-08-28 12:34:59 +02:00
parent 070c31c08d
commit 51977951cb

View File

@@ -685,6 +685,7 @@ void retro_run(void)
uint8_t *gfx; uint8_t *gfx;
int32_t ssize = 0; int32_t ssize = 0;
bool updated = false; bool updated = false;
unsigned incr = 0;
FCEUI_Emulate(&gfx, &sound, &ssize, 0); FCEUI_Emulate(&gfx, &sound, &ssize, 0);
@@ -721,63 +722,54 @@ void retro_run(void)
sceGuFinish(); sceGuFinish();
#endif #endif
if (use_overscan)
{
width = 256; width = 256;
height = 240; height = 240;
pitch = 256;
#ifndef PSP
pitch = 512; pitch = 512;
gfx = XBuf; gfx = XBuf;
if (use_raw_palette)
{
extern uint8 PPU[4];
int deemp = (PPU[1] >> 5) << 2;
for (y = 0; y < height; y++)
for ( x = 0; x < width; x++, gfx++)
fceu_video_out[y * width + x] = retro_palette[*gfx & 0x3F] | deemp;
} if (!use_overscan)
else
{ {
for (y = 0; y < height; y++) incr = 16;
for ( x = 0; x < width; x++, gfx++) width -= 16;
fceu_video_out[y * width + x] = retro_palette[*gfx]; height -= 16;
}
#endif
}
else
{
width = 256 - 16;
height = 240 - 16;
pitch = 256;
#ifndef PSP #ifndef PSP
pitch = 512 - 32; pitch -= 32;
gfx = XBuf + 8 + 256 * 8; gfx = gfx + 8 + 256 * 8;
#endif
}
#ifndef PSP
if (use_raw_palette) if (use_raw_palette)
{ {
extern uint8 PPU[4]; extern uint8 PPU[4];
int deemp = (PPU[1] >> 5) << 2; int deemp = (PPU[1] >> 5) << 2;
for (y = 0; y < height; y++, gfx += 16) for (y = 0; y < height; y++, gfx += incr)
for ( x = 0; x < width; x++, gfx++) for ( x = 0; x < width; x++, gfx++)
fceu_video_out[y * width + x] = retro_palette[*gfx & 0x3F] | deemp; fceu_video_out[y * width + x] = retro_palette[*gfx & 0x3F] | deemp;
} }
else else
{ {
for (y = 0; y < height; y++, gfx += 16) for (y = 0; y < height; y++, gfx += incr)
for ( x = 0; x < width; x++, gfx++) for ( x = 0; x < width; x++, gfx++)
fceu_video_out[y * width + x] = retro_palette[*gfx]; fceu_video_out[y * width + x] = retro_palette[*gfx];
} }
#endif #endif
}
video_cb(
#ifdef PSP #ifdef PSP
video_cb(texture_vram_p, width, height, pitch); texture_vram_p,
#else #else
video_cb(fceu_video_out, width, height, pitch); fceu_video_out,
#endif #endif
width, height,
#ifdef PSP
256
#else
pitch
#endif
);
FCEUD_UpdateInput(); FCEUD_UpdateInput();
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated) if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)