mirror of
https://github.com/libretro/RetroArch
synced 2025-02-07 03:40:24 +00:00
Merge branch 'libretro:master' into bugfix/controller-duplication-bug
This commit is contained in:
commit
86b297e0fd
16
CHANGES.md
16
CHANGES.md
@ -1,11 +1,23 @@
|
||||
# Future
|
||||
|
||||
# 1.9.8
|
||||
- CHEEVOS: Hide challenge indicators when resetting
|
||||
- CONTENT INFORMATION: Show content info label+path rows always
|
||||
- DUMMY CORE: Skip state_manager_event_{deinit/init} when core type is dummy, should skip warning spam 'Implementation uses threaded audio. Cannot use rewind..' when using rewind
|
||||
- INPUT/UDEV: Limit udev device scan to subsystem 'input'
|
||||
- LIBNX/SWITCH: Fix poll missing for controller 2-8
|
||||
- LIBNX/SWITCH: Fix layout not applied correctly and hangs when splitting joycons
|
||||
- DATABASE/EXPLORE: Fix CRC32 reading in explore menu
|
||||
- DATABASE/LIBRETRODB: Fix writing of numerical values
|
||||
- DATABASE/LIBRETRODB: Fix libretro-db loading on big endian platforms
|
||||
- MOUSE: Change default mouse index to port index
|
||||
- MOUSE: Friendly names for mice where available
|
||||
- OSX: Fix some memory leaks
|
||||
- PS2: Implement alpha for the video driver
|
||||
- WINRAW: Trigger joypad driver reinit on DEVICECHANGE - avoids fullscreen toggle
|
||||
- WINRAW: Alt sticky fix
|
||||
- WINRAW: Prevent Alt getting stuck when Alt-Tabbing
|
||||
- WINRAW: Add pointer status
|
||||
- WIIU: Compress RPX libretro cores
|
||||
- WIIU: Add ICInvalidateRange (necessary for JITs)
|
||||
|
||||
# 1.9.7
|
||||
- 3DS: Add unique ID's
|
||||
|
@ -27,10 +27,10 @@ INCDIR += -Ips2/include -Ilibretro-common/include -Ideps -Ideps/stb -Ideps/7zip
|
||||
CFLAGS = $(OPTIMIZE_LV) $(DISABLE_WARNINGS) -ffast-math -fsingle-precision-constant
|
||||
ASFLAGS = $(CFLAGS)
|
||||
|
||||
RARCH_DEFINES += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS -DHAVE_RGUI
|
||||
RARCH_DEFINES += -DPS2 -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DHAVE_SCREENSHOTS -DHAVE_REWIND -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_CONFIGFILE -DHAVE_PATCH -DHAVE_CHEATS
|
||||
RARCH_DEFINES += -DHAVE_ZLIB -DHAVE_NO_BUILTINZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP -D_7ZIP_ST -DHAVE_CC_RESAMPLER -DHAVE_AUDIOMIXER
|
||||
RARCH_DEFINES += -DHAVE_VIDEO_FILTER -DHAVE_RGUI
|
||||
RARCH_DEFINES += -DHAVE_DSP_FILTER
|
||||
RARCH_DEFINES += -DHAVE_VIDEO_FILTER
|
||||
|
||||
LDFLAGS += -L$(PS2DEV)/gsKit/lib -L$(PS2SDK)/ports/lib -L.
|
||||
# Lib cdvd is needed to get proper time
|
||||
|
@ -153,20 +153,25 @@ static void CFSearchPathForDirectoriesInDomains(unsigned flags,
|
||||
CFTypeRef array_val = (CFTypeRef)CFBridgingRetainCompat(
|
||||
NSSearchPathForDirectoriesInDomains(NSConvertFlagsCF(flags),
|
||||
NSConvertDomainFlagsCF(domain_mask), (BOOL)expand_tilde));
|
||||
CFArrayRef array = array_val ? CFRetain(array_val) : NULL;
|
||||
CFTypeRef path_val = (CFTypeRef)CFArrayGetValueAtIndex(array, 0);
|
||||
CFStringRef path = path_val ? CFRetain(path_val) : NULL;
|
||||
CFRelease(array_val);
|
||||
if (!path || !array)
|
||||
{
|
||||
if (path)
|
||||
CFRelease(path);
|
||||
return;
|
||||
}
|
||||
|
||||
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
|
||||
CFRelease(path);
|
||||
CFRelease(array);
|
||||
if (array_val)
|
||||
{
|
||||
CFArrayRef array = CFRetain(array_val);
|
||||
CFTypeRef path_val = (CFTypeRef)CFArrayGetValueAtIndex(array, 0);
|
||||
|
||||
if (path_val)
|
||||
{
|
||||
CFStringRef path = CFRetain(path_val);
|
||||
if (path)
|
||||
{
|
||||
CFStringGetCString(path, s, len, kCFStringEncodingUTF8);
|
||||
CFRelease(path);
|
||||
}
|
||||
}
|
||||
|
||||
if (array)
|
||||
CFRelease(array);
|
||||
}
|
||||
}
|
||||
|
||||
static void CFTemporaryDirectory(char *s, size_t len)
|
||||
|
@ -23,10 +23,10 @@
|
||||
|
||||
#include "../../libretro-common/include/libretro_gskit_ps2.h"
|
||||
|
||||
/* turn white GS Screen */
|
||||
#define GS_TEXT GS_SETREG_RGBAQ(0x80,0x80,0x80,0x80,0x00)
|
||||
/* turn white GS Screen */
|
||||
#define GS_BLACK GS_SETREG_RGBAQ(0x00,0x00,0x00,0x00,0x00)
|
||||
/* Generic tint color */
|
||||
#define GS_TEXT GS_SETREG_RGBA(0x80,0x80,0x80,0x80)
|
||||
/* turn black GS Screen */
|
||||
#define GS_BLACK GS_SETREG_RGBA(0x00,0x00,0x00,0x80)
|
||||
|
||||
#define NTSC_WIDTH 640
|
||||
#define NTSC_HEIGHT 448
|
||||
@ -67,6 +67,32 @@ static int vsync_handler()
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Copy of gsKit_sync_flip, but without the 'flip'
|
||||
static void gsKit_sync(GSGLOBAL *gsGlobal)
|
||||
{
|
||||
if(!gsGlobal->FirstFrame)
|
||||
WaitSema(vsync_sema_id);
|
||||
|
||||
while (PollSema(vsync_sema_id) >= 0);
|
||||
}
|
||||
|
||||
static void gsKit_flip(GSGLOBAL *gsGlobal)
|
||||
{
|
||||
if(!gsGlobal->FirstFrame)
|
||||
{
|
||||
if(gsGlobal->DoubleBuffering == GS_SETTING_ON)
|
||||
{
|
||||
GS_SET_DISPFB2( gsGlobal->ScreenBuffer[gsGlobal->ActiveBuffer & 1] / 8192,
|
||||
gsGlobal->Width / 64, gsGlobal->PSM, 0, 0 );
|
||||
|
||||
gsGlobal->ActiveBuffer ^= 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gsKit_setactive(gsGlobal);
|
||||
}
|
||||
|
||||
static GSGLOBAL *init_GSGlobal(void)
|
||||
{
|
||||
ee_sema_t sema;
|
||||
@ -75,6 +101,12 @@ static GSGLOBAL *init_GSGlobal(void)
|
||||
sema.option = 0;
|
||||
vsync_sema_id = CreateSema(&sema);
|
||||
|
||||
dmaKit_init(D_CTRL_RELE_OFF,D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
|
||||
D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF);
|
||||
|
||||
/* Initialize the DMAC */
|
||||
dmaKit_chan_init(DMA_CHANNEL_GIF);
|
||||
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
|
||||
gsGlobal->Mode = GS_MODE_NTSC;
|
||||
@ -82,22 +114,24 @@ static GSGLOBAL *init_GSGlobal(void)
|
||||
gsGlobal->Field = GS_FIELD;
|
||||
gsGlobal->Width = NTSC_WIDTH;
|
||||
gsGlobal->Height = NTSC_HEIGHT;
|
||||
|
||||
gsGlobal->PSM = GS_PSM_CT16;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PSM = GS_PSM_CT32;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16S;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_ON;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PrimAlphaEnable = GS_SETTING_OFF;
|
||||
gsGlobal->Dithering = GS_SETTING_ON;
|
||||
|
||||
dmaKit_init(D_CTRL_RELE_OFF,D_CTRL_MFD_OFF, D_CTRL_STS_UNSPEC,
|
||||
D_CTRL_STD_OFF, D_CTRL_RCYC_8, 1 << DMA_CHANNEL_GIF);
|
||||
|
||||
/* Initialize the DMAC */
|
||||
dmaKit_chan_init(DMA_CHANNEL_GIF);
|
||||
gsGlobal->Test->ATST = 7; // NOTEQUAL to AREF passes
|
||||
gsGlobal->Test->AREF = 0x00;
|
||||
gsGlobal->Test->AFAIL = 0; // KEEP
|
||||
|
||||
gsKit_init_screen(gsGlobal);
|
||||
gsKit_mode_switch(gsGlobal, GS_ONESHOT);
|
||||
|
||||
gsKit_set_test(gsGlobal, GS_ZTEST_OFF);
|
||||
gsKit_set_primalpha(gsGlobal, GS_SETREG_ALPHA(0, 1, 0, 1, 0), 0);
|
||||
|
||||
gsKit_clear(gsGlobal, GS_BLACK);
|
||||
gsKit_flip(gsGlobal);
|
||||
|
||||
return gsGlobal;
|
||||
}
|
||||
@ -109,37 +143,9 @@ static void deinit_GSGlobal(GSGLOBAL *gsGlobal)
|
||||
gsKit_deinit_global(gsGlobal);
|
||||
}
|
||||
|
||||
/* Copy of gsKit_sync_flip, but without the 'flip' */
|
||||
static void gsKit_sync(GSGLOBAL *gsGlobal)
|
||||
{
|
||||
if (!gsGlobal->FirstFrame)
|
||||
WaitSema(vsync_sema_id);
|
||||
|
||||
while (PollSema(vsync_sema_id) >= 0);
|
||||
}
|
||||
|
||||
/* Copy of gsKit_sync_flip, but without the 'sync' */
|
||||
static void gsKit_flip(GSGLOBAL *gsGlobal)
|
||||
{
|
||||
if (!gsGlobal->FirstFrame)
|
||||
{
|
||||
if (gsGlobal->DoubleBuffering == GS_SETTING_ON)
|
||||
{
|
||||
GS_SET_DISPFB2( gsGlobal->ScreenBuffer[
|
||||
gsGlobal->ActiveBuffer & 1] / 8192,
|
||||
gsGlobal->Width / 64, gsGlobal->PSM, 0, 0 );
|
||||
|
||||
gsGlobal->ActiveBuffer ^= 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
gsKit_setactive(gsGlobal);
|
||||
}
|
||||
|
||||
static GSTEXTURE *prepare_new_texture(void)
|
||||
{
|
||||
GSTEXTURE *texture = (GSTEXTURE*)calloc(1, sizeof(*texture));
|
||||
GSTEXTURE *texture = (GSTEXTURE*)calloc(1, sizeof(GSTEXTURE));
|
||||
return texture;
|
||||
}
|
||||
|
||||
@ -223,13 +229,18 @@ static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition,
|
||||
|
||||
static void refreshScreen(ps2_video_t *ps2)
|
||||
{
|
||||
if (ps2->vsync)
|
||||
{
|
||||
gsKit_sync(ps2->gsGlobal);
|
||||
gsKit_flip(ps2->gsGlobal);
|
||||
}
|
||||
// Draw everything
|
||||
gsKit_set_finish(ps2->gsGlobal);
|
||||
gsKit_queue_exec(ps2->gsGlobal);
|
||||
gsKit_finish();
|
||||
|
||||
// Let texture manager know we're moving to the next frame
|
||||
gsKit_TexManager_nextFrame(ps2->gsGlobal);
|
||||
|
||||
// Sync and flip
|
||||
if (ps2->vsync)
|
||||
gsKit_sync(ps2->gsGlobal);
|
||||
gsKit_flip(ps2->gsGlobal);
|
||||
}
|
||||
|
||||
static void *ps2_gfx_init(const video_info_t *video,
|
||||
@ -286,6 +297,8 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
printf("ps2_gfx_frame %llu\n", frame_count);
|
||||
#endif
|
||||
|
||||
gsKit_clear(ps2->gsGlobal, GS_BLACK);
|
||||
|
||||
if (frame)
|
||||
{
|
||||
struct retro_hw_ps2_insets padding = empty_ps2_insets;
|
||||
@ -304,6 +317,10 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
padding = ps2->iface.padding;
|
||||
}
|
||||
|
||||
/* Disable Alpha for cores */
|
||||
ps2->gsGlobal->PrimAlphaEnable = GS_SETTING_OFF;
|
||||
gsKit_set_test(ps2->gsGlobal, GS_ATEST_OFF);
|
||||
|
||||
gsKit_TexManager_invalidate(ps2->gsGlobal, ps2->coreTexture);
|
||||
gsKit_TexManager_bind(ps2->gsGlobal, ps2->coreTexture);
|
||||
prim_texture(ps2->gsGlobal, ps2->coreTexture, 1, ps2->force_aspect, padding);
|
||||
@ -320,8 +337,7 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
else if (statistics_show)
|
||||
{
|
||||
if (osd_params)
|
||||
font_driver_render_msg(ps2, video_info->stat_text,
|
||||
osd_params, NULL);
|
||||
font_driver_render_msg(ps2, video_info->stat_text, osd_params, NULL);
|
||||
}
|
||||
|
||||
if (!string_is_empty(msg))
|
||||
@ -405,6 +421,16 @@ static void ps2_set_texture_enable(void *data, bool enable, bool fullscreen)
|
||||
ps2->fullscreen = fullscreen;
|
||||
}
|
||||
|
||||
static void ps2_set_osd_msg(void *data,
|
||||
const char *msg,
|
||||
const void *params, void *font)
|
||||
{
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
|
||||
if (ps2)
|
||||
font_driver_render_msg(data, msg, params, font);
|
||||
}
|
||||
|
||||
static bool ps2_get_hw_render_interface(void* data,
|
||||
const struct retro_hw_render_interface** iface)
|
||||
{
|
||||
@ -431,7 +457,7 @@ static const video_poke_interface_t ps2_poke_interface = {
|
||||
NULL, /* apply_state_changes */
|
||||
ps2_set_texture_frame,
|
||||
ps2_set_texture_enable,
|
||||
font_driver_render_msg, /* set_osd_msg */
|
||||
ps2_set_osd_msg, /* set_osd_msg */
|
||||
NULL, /* show_mouse */
|
||||
NULL, /* grab_mouse_toggle */
|
||||
NULL, /* get_current_shader */
|
||||
|
@ -146,6 +146,10 @@ static void ps2_font_render_line(
|
||||
|
||||
if (!ps2)
|
||||
return;
|
||||
|
||||
/* Enable Alpha for font */
|
||||
ps2->gsGlobal->PrimAlphaEnable = GS_SETTING_ON;
|
||||
gsKit_set_test(ps2->gsGlobal, GS_ATEST_ON);
|
||||
|
||||
switch (text_align)
|
||||
{
|
||||
@ -159,7 +163,7 @@ static void ps2_font_render_line(
|
||||
}
|
||||
|
||||
/* We need to >> 1, because GS_SETREG_RGBAQ expect 0x80 as max color */
|
||||
colorA = (int)(((color & 0xFF000000) >> 24) >> 1);
|
||||
colorA = (int)(((color & 0xFF000000) >> 24) >> 2);
|
||||
colorB = (int)(((color & 0x00FF0000) >> 16) >> 1);
|
||||
colorG = (int)(((color & 0x0000FF00) >> 8) >> 1);
|
||||
colorR = (int)(((color & 0x000000FF) >> 0) >> 1);
|
||||
|
@ -65,6 +65,7 @@ IMPORT(DCInvalidateRange);
|
||||
IMPORT(DCFlushRange);
|
||||
IMPORT(DCStoreRange);
|
||||
IMPORT(DCStoreRangeNoSync);
|
||||
IMPORT(ICInvalidateRange);
|
||||
|
||||
IMPORT(__gh_errno_ptr);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user