mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
Merge branch 'master' into sync
This commit is contained in:
commit
8df7540c96
@ -753,6 +753,8 @@ ifeq ($(HAVE_LAKKA_SWITCH), 1)
|
||||
DEFINES += -DHAVE_LAKKA_SWITCH
|
||||
endif
|
||||
|
||||
OBJ += menu/menu_shader.o
|
||||
|
||||
ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
OBJ += menu/menu_driver.o \
|
||||
menu/menu_content.o \
|
||||
@ -760,7 +762,6 @@ ifeq ($(HAVE_MENU_COMMON), 1)
|
||||
menu/menu_entries.o \
|
||||
menu/menu_setting.o \
|
||||
menu/menu_networking.o \
|
||||
menu/menu_shader.o \
|
||||
menu/widgets/menu_filebrowser.o \
|
||||
menu/widgets/menu_dialog.o \
|
||||
menu/widgets/menu_input_dialog.o \
|
||||
|
@ -41,6 +41,7 @@ HAVE_NETWORKING = 1
|
||||
HAVE_NETPLAYDISCOVERY = 1
|
||||
HAVE_STB_FONT = 1
|
||||
HAVE_CHEEVOS = 1
|
||||
HAVE_CHD = 1
|
||||
|
||||
# RetroArch libnx useful flags
|
||||
HAVE_THREADS = 1
|
||||
|
@ -81,26 +81,27 @@ static void audioCreateThread(ps2_audio_t *ps2)
|
||||
thread.attr=thread.option=0;
|
||||
|
||||
/*Backup the PS2 content to be used in the thread */
|
||||
backup_ps2 = ps2;
|
||||
backup_ps2 = ps2;
|
||||
|
||||
ps2->running = true;
|
||||
ps2->running = true;
|
||||
ps2->worker_thread = CreateThread(&thread);
|
||||
|
||||
if (ps2->worker_thread >= 0)
|
||||
{
|
||||
if (ps2->worker_thread >= 0) {
|
||||
ret = StartThread(ps2->worker_thread, NULL);
|
||||
if (ret < 0)
|
||||
if (ret < 0) {
|
||||
printf("sound_init: StartThread returned %d\n", ret);
|
||||
}
|
||||
else
|
||||
}
|
||||
} else {
|
||||
printf("CreateThread failed: %d\n", ps2->worker_thread);
|
||||
}
|
||||
}
|
||||
|
||||
static void audioStopNDeleteThread(ps2_audio_t *ps2)
|
||||
{
|
||||
ps2->running = false;
|
||||
if (ps2->worker_thread)
|
||||
if (ps2->worker_thread) {
|
||||
ps2->worker_thread = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
@ -108,14 +109,13 @@ static void audioConfigure(ps2_audio_t *ps2, unsigned rate)
|
||||
int err;
|
||||
struct audsrv_fmt_t format;
|
||||
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.bits = AUDIO_BITS;
|
||||
format.freq = rate;
|
||||
format.channels = AUDIO_CHANNELS;
|
||||
|
||||
err = audsrv_set_format(&format);
|
||||
err = audsrv_set_format(&format);
|
||||
|
||||
if (err)
|
||||
{
|
||||
if (err){
|
||||
printf("set format returned %d\n", err);
|
||||
printf("audsrv returned error string: %s\n", audsrv_get_error_string());
|
||||
}
|
||||
@ -128,16 +128,16 @@ static void audioCreateSemas(ps2_audio_t *ps2)
|
||||
ee_sema_t lock_info;
|
||||
ee_sema_t cond_lock_info;
|
||||
|
||||
lock_info.max_count = 1;
|
||||
lock_info.init_count = 1;
|
||||
lock_info.option = 0;
|
||||
ps2->lock = CreateSema(&lock_info);
|
||||
lock_info.max_count = 1;
|
||||
lock_info.init_count = 1;
|
||||
lock_info.option = 0;
|
||||
ps2->lock = CreateSema(&lock_info);
|
||||
|
||||
cond_lock_info.init_count = 1;
|
||||
cond_lock_info.max_count = 1;
|
||||
cond_lock_info.option = 0;
|
||||
cond_lock_info.option = 0;
|
||||
|
||||
ps2->cond_lock = CreateSema(&cond_lock_info);
|
||||
ps2->cond_lock = CreateSema(&cond_lock_info);
|
||||
}
|
||||
|
||||
static void *ps2_audio_init(const char *device,
|
||||
@ -164,18 +164,15 @@ static void ps2_audio_free(void *data)
|
||||
if(!ps2)
|
||||
return;
|
||||
|
||||
if(ps2->running)
|
||||
{
|
||||
if(ps2->running){
|
||||
audioStopNDeleteThread(ps2);
|
||||
|
||||
if (ps2->lock)
|
||||
{
|
||||
if (ps2->lock){
|
||||
iDeleteSema(ps2->lock);
|
||||
ps2->lock = 0;
|
||||
}
|
||||
|
||||
if (ps2->cond_lock)
|
||||
{
|
||||
if (ps2->cond_lock){
|
||||
iDeleteSema(ps2->cond_lock);
|
||||
ps2->cond_lock = 0;
|
||||
}
|
||||
@ -192,14 +189,14 @@ static ssize_t ps2_audio_write(void *data, const void *buf, size_t size)
|
||||
if (!ps2->running)
|
||||
return -1;
|
||||
|
||||
if (ps2->nonblocking)
|
||||
{
|
||||
if (ps2->nonblocking){
|
||||
if (fifo_write_avail(ps2->buffer) < size)
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (fifo_write_avail(ps2->buffer) < size)
|
||||
while (fifo_write_avail(ps2->buffer) < size) {
|
||||
WaitSema(ps2->cond_lock);
|
||||
}
|
||||
|
||||
WaitSema(ps2->lock);
|
||||
fifo_write(ps2->buffer, buf, size);
|
||||
@ -213,8 +210,9 @@ static bool ps2_audio_alive(void *data)
|
||||
bool alive = false;
|
||||
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
if (ps2)
|
||||
if (ps2) {
|
||||
alive = ps2->running;
|
||||
}
|
||||
|
||||
return alive;
|
||||
}
|
||||
@ -224,8 +222,7 @@ static bool ps2_audio_stop(void *data)
|
||||
bool stop = true;
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (ps2)
|
||||
{
|
||||
if (ps2) {
|
||||
audioStopNDeleteThread(ps2);
|
||||
audsrv_stop_audio();
|
||||
}
|
||||
@ -235,13 +232,13 @@ static bool ps2_audio_stop(void *data)
|
||||
|
||||
static bool ps2_audio_start(void *data, bool is_shutdown)
|
||||
{
|
||||
bool start = true;
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
bool start = true;
|
||||
|
||||
if(ps2)
|
||||
{
|
||||
if (!ps2->running && !ps2->worker_thread)
|
||||
if (ps2) {
|
||||
if (!ps2->running && !ps2->worker_thread) {
|
||||
audioCreateThread(ps2);
|
||||
}
|
||||
}
|
||||
|
||||
return start;
|
||||
@ -250,8 +247,10 @@ static bool ps2_audio_start(void *data, bool is_shutdown)
|
||||
static void ps2_audio_set_nonblock_state(void *data, bool toggle)
|
||||
{
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
if (ps2)
|
||||
|
||||
if (ps2) {
|
||||
ps2->nonblocking = toggle;
|
||||
}
|
||||
}
|
||||
|
||||
static bool ps2_audio_use_float(void *data)
|
||||
@ -263,8 +262,7 @@ static size_t ps2_audio_write_avail(void *data)
|
||||
{
|
||||
ps2_audio_t* ps2 = (ps2_audio_t*)data;
|
||||
|
||||
if (ps2 && ps2->running)
|
||||
{
|
||||
if (ps2 && ps2->running) {
|
||||
size_t size;
|
||||
WaitSema(ps2->lock);
|
||||
size = AUDIO_BUFFER - fifo_read_avail(ps2->buffer);
|
||||
|
@ -401,6 +401,8 @@ static bool default_screenshots_in_content_dir = false;
|
||||
|
||||
#if defined(__CELLOS_LV2__) || defined(_XBOX1) || defined(_XBOX360)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_L3_R3;
|
||||
#elif defined(PS2)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_HOLD_START;
|
||||
#elif defined(VITA)
|
||||
static unsigned menu_toggle_gamepad_combo = INPUT_TOGGLE_L1_R1_START_SELECT;
|
||||
#elif defined(SWITCH)
|
||||
|
@ -61,6 +61,7 @@ struct netplay_room *room;
|
||||
|
||||
static char user_id[128];
|
||||
static char user_name[128];
|
||||
static char party_name[128];
|
||||
static char user_avatar[PATH_MAX_LENGTH];
|
||||
|
||||
static char cdn_url[] = "https://cdn.discordapp.com/avatars";
|
||||
@ -131,6 +132,10 @@ static bool discord_download_avatar(
|
||||
static void handle_discord_ready(const DiscordUser* connectedUser)
|
||||
{
|
||||
strlcpy(user_name, connectedUser->username, sizeof(user_name));
|
||||
strlcpy(party_name, connectedUser->username, sizeof(user_name));
|
||||
strlcat(party_name, "|", sizeof(party_name));
|
||||
strlcat(party_name, connectedUser->discriminator, sizeof(party_name));
|
||||
|
||||
RARCH_LOG("[Discord] connected to user: %s#%s - avatar id: %s\n",
|
||||
connectedUser->username,
|
||||
connectedUser->discriminator,
|
||||
@ -150,25 +155,89 @@ static void handle_discord_error(int errcode, const char* message)
|
||||
RARCH_LOG("[Discord] error (%d: %s)\n", errcode, message);
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
static int action_ok_push_netplay_refresh_rooms(const char *path,
|
||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||
{
|
||||
char url [2048] = "http://newlobby.libretro.com/list/";
|
||||
#ifndef RARCH_CONSOLE
|
||||
task_push_netplay_lan_scan(netplay_lan_scan_callback);
|
||||
#endif
|
||||
task_push_http_transfer(url, true, NULL, netplay_refresh_rooms_cb, NULL);
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void handle_discord_join_cb(void *task_data, void *user_data, const char *err)
|
||||
{
|
||||
struct netplay_room *room;
|
||||
char tmp_hostname[32];
|
||||
|
||||
http_transfer_data_t *data = (http_transfer_data_t*)task_data;
|
||||
|
||||
if (!data || err)
|
||||
goto finish;
|
||||
|
||||
data->data = (char*)realloc(data->data, data->len + 1);
|
||||
data->data[data->len] = '\0';
|
||||
|
||||
netplay_rooms_parse(data->data);
|
||||
room = netplay_room_get(0);
|
||||
|
||||
if (room)
|
||||
{
|
||||
RARCH_LOG("[Discord] joining lobby at: %s:%d\n",
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port);
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
deinit_netplay();
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
|
||||
snprintf(tmp_hostname, sizeof(tmp_hostname), "%s:%d",
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port);
|
||||
|
||||
task_push_netplay_crc_scan(room->gamecrc,
|
||||
room->gamename, tmp_hostname, room->corename);
|
||||
|
||||
}
|
||||
|
||||
finish:
|
||||
|
||||
if (err)
|
||||
RARCH_ERR("%s: %s\n", msg_hash_to_str(MSG_DOWNLOAD_FAILED), err);
|
||||
|
||||
if (data)
|
||||
{
|
||||
if (data->data)
|
||||
free(data->data);
|
||||
free(data);
|
||||
}
|
||||
|
||||
if (user_data)
|
||||
free(user_data);
|
||||
}
|
||||
|
||||
static void handle_discord_join(const char* secret)
|
||||
{
|
||||
char url [2048] = "http://lobby.libretro.com/";
|
||||
char tmp_hostname[32];
|
||||
static struct string_list *list = NULL;
|
||||
|
||||
RARCH_LOG("[Discord] join (%s)\n", secret);
|
||||
RARCH_LOG("[Discord] join secret: (%s)\n", secret);
|
||||
list = string_split(secret, "|");
|
||||
|
||||
strlcat(url, list->elems[0].data, sizeof(url));
|
||||
strlcat(url, "/", sizeof(url));
|
||||
RARCH_LOG("[Discord] querying lobby id: %s at %s\n", list->elems[0].data, url);
|
||||
|
||||
|
||||
snprintf(tmp_hostname,
|
||||
sizeof(tmp_hostname),
|
||||
"%s|%s", list->elems[0].data, list->elems[1].data);
|
||||
|
||||
if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL))
|
||||
deinit_netplay();
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
|
||||
task_push_netplay_crc_scan(atoi(list->elems[3].data),
|
||||
list->elems[2].data,
|
||||
tmp_hostname, list->elems[4].data);
|
||||
task_push_http_transfer(url, true, NULL, handle_discord_join_cb, NULL);
|
||||
}
|
||||
|
||||
static void handle_discord_spectate(const char* secret)
|
||||
@ -309,20 +378,16 @@ void discord_update(enum discord_presence presence)
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port);
|
||||
|
||||
{
|
||||
char party_id[128];
|
||||
char join_secret[128];
|
||||
snprintf(party_id, sizeof(party_id), "%d|%s", room->id, room->nickname);
|
||||
snprintf(join_secret, sizeof(join_secret), "%s|%d|%s|%u|%s",
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_address : room->address,
|
||||
room->host_method == NETPLAY_HOST_METHOD_MITM ? room->mitm_port : room->port,
|
||||
room->gamename, room->gamecrc, room->corename);
|
||||
RARCH_LOG("%s\n", join_secret);
|
||||
snprintf(join_secret, sizeof(join_secret), "%d|%s", room->id, room->nickname);
|
||||
discord_presence.joinSecret = strdup(join_secret);
|
||||
/* discord_presence.spectateSecret = "SPECSPECSPEC"; */
|
||||
discord_presence.partyId = strdup(party_id);
|
||||
discord_presence.partyId = strdup(party_name);
|
||||
discord_presence.partyMax = 0;
|
||||
discord_presence.partySize = 0;
|
||||
RARCH_LOG("[Discord] joining: \n Secret: %s\n Party: %s\n", discord_presence.joinSecret, discord_presence.partyId);
|
||||
|
||||
RARCH_LOG("[Discord] join secret: %s\n", join_secret);
|
||||
RARCH_LOG("[Discord] party id: %s\n", party_name);
|
||||
}
|
||||
break;
|
||||
case DISCORD_PRESENCE_NETPLAY_HOSTING_STOPPED:
|
||||
|
4
driver.c
4
driver.c
@ -386,6 +386,10 @@ void drivers_init(int flags)
|
||||
if (flags & DRIVER_MENU_MASK)
|
||||
menu_driver_init(video_is_threaded);
|
||||
}
|
||||
#else
|
||||
/* Qt uses core info, even if the menu is disabled */
|
||||
command_event(CMD_EVENT_CORE_INFO_INIT, NULL);
|
||||
command_event(CMD_EVENT_LOAD_CORE_PERSIST, NULL);
|
||||
#endif
|
||||
|
||||
if (flags & (DRIVER_VIDEO_MASK | DRIVER_AUDIO_MASK))
|
||||
|
@ -45,7 +45,7 @@ typedef struct ps2_video
|
||||
|
||||
// PRIVATE METHODS
|
||||
static GSGLOBAL *init_GSGlobal(void) {
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
GSGLOBAL *gsGlobal = gsKit_init_global();
|
||||
|
||||
gsGlobal->Mode = GS_MODE_NTSC;
|
||||
gsGlobal->Interlace = GS_INTERLACED;
|
||||
@ -54,28 +54,26 @@ static GSGLOBAL *init_GSGlobal(void) {
|
||||
gsGlobal->Height = NTSC_HEIGHT;
|
||||
|
||||
gsGlobal->PSM = GS_PSM_CT16;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PSMZ = GS_PSMZ_16;
|
||||
gsGlobal->DoubleBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->ZBuffering = GS_SETTING_OFF;
|
||||
gsGlobal->PrimAlphaEnable = GS_SETTING_OFF;
|
||||
|
||||
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);
|
||||
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);
|
||||
/* Initialize the DMAC */
|
||||
dmaKit_chan_init(DMA_CHANNEL_GIF);
|
||||
|
||||
gsKit_init_screen(gsGlobal);
|
||||
gsKit_mode_switch(gsGlobal, GS_ONESHOT);
|
||||
gsKit_init_screen(gsGlobal);
|
||||
gsKit_mode_switch(gsGlobal, GS_ONESHOT);
|
||||
|
||||
gsKit_clear(gsGlobal, GS_BLACK);
|
||||
|
||||
return gsGlobal;
|
||||
return gsGlobal;
|
||||
}
|
||||
|
||||
static GSTEXTURE * prepare_new_texture(void) {
|
||||
GSTEXTURE *texture = calloc(1, sizeof(*texture));
|
||||
return texture;
|
||||
GSTEXTURE *texture = calloc(1, sizeof(*texture));
|
||||
return texture;
|
||||
}
|
||||
|
||||
static void init_ps2_video(ps2_video_t *ps2) {
|
||||
@ -93,22 +91,22 @@ static void deinitTexture(GSTEXTURE *texture) {
|
||||
|
||||
static void color_correction32(uint32_t *buffer, uint32_t dimensions)
|
||||
{
|
||||
uint32_t i;
|
||||
uint32_t x32;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
uint32_t i;
|
||||
uint32_t x32;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
x32 = buffer[i];
|
||||
buffer[i] = ((x32 >> 16) & 0xFF) | ((x32 << 16) & 0xFF0000) | (x32 & 0xFF00FF00);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void color_correction16(uint16_t *buffer, uint32_t dimensions)
|
||||
{
|
||||
uint32_t i;
|
||||
uint16_t x16;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
uint32_t i;
|
||||
uint16_t x16;
|
||||
for (i = 0; i < dimensions; i++) {
|
||||
x16 = buffer[i];
|
||||
buffer[i] = (x16 & 0x8000) | ((x16 << 10) & 0x7C00) | ((x16 >> 1) & 0x3E0) | ((x16 >> 11) & 0x1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void transfer_texture(GSTEXTURE *texture, const void *frame,
|
||||
@ -144,7 +142,7 @@ if (color_correction) {
|
||||
|
||||
static void vram_alloc(GSGLOBAL *gsGlobal, GSTEXTURE *texture) {
|
||||
uint32_t size = gsKit_texture_size(texture->Width, texture->Height, texture->PSM);
|
||||
texture->Vram=gsKit_vram_alloc(gsGlobal, size, GSKIT_ALLOC_USERBUFFER);
|
||||
texture->Vram = gsKit_vram_alloc(gsGlobal, size, GSKIT_ALLOC_USERBUFFER);
|
||||
if(texture->Vram == GSKIT_ALLOC_ERROR) {
|
||||
printf("VRAM Allocation Failed. Will not upload texture.\n");
|
||||
}
|
||||
@ -152,24 +150,24 @@ static void vram_alloc(GSGLOBAL *gsGlobal, GSTEXTURE *texture) {
|
||||
|
||||
static void prim_texture(GSGLOBAL *gsGlobal, GSTEXTURE *texture, int zPosition, bool force_aspect) {
|
||||
float x1, y1, x2, y2;
|
||||
if (force_aspect) {
|
||||
float width_proportion = (float)gsGlobal->Width / (float)texture->Width;
|
||||
float height_proportion = (float)gsGlobal->Height / (float)texture->Height;
|
||||
float delta = MIN(width_proportion, height_proportion);
|
||||
float newWidth = texture->Width * delta;
|
||||
float newHeight = texture->Height * delta;
|
||||
|
||||
x1 = (gsGlobal->Width - newWidth) / 2.0f;
|
||||
y1 = (gsGlobal->Height - newHeight) / 2.0f;
|
||||
x2 = newWidth + x1;
|
||||
y2 = newHeight + y1;
|
||||
if (force_aspect) {
|
||||
float width_proportion = (float)gsGlobal->Width / (float)texture->Width;
|
||||
float height_proportion = (float)gsGlobal->Height / (float)texture->Height;
|
||||
float delta = MIN(width_proportion, height_proportion);
|
||||
float newWidth = texture->Width * delta;
|
||||
float newHeight = texture->Height * delta;
|
||||
|
||||
x1 = (gsGlobal->Width - newWidth) / 2.0f;
|
||||
y1 = (gsGlobal->Height - newHeight) / 2.0f;
|
||||
x2 = newWidth + x1;
|
||||
y2 = newHeight + y1;
|
||||
|
||||
} else {
|
||||
x1 = 0.0f;
|
||||
y1 = 0.0f;
|
||||
x2 = gsGlobal->Width;
|
||||
y2 = gsGlobal->Height;
|
||||
}
|
||||
} else {
|
||||
x1 = 0.0f;
|
||||
y1 = 0.0f;
|
||||
x2 = gsGlobal->Width;
|
||||
y2 = gsGlobal->Height;
|
||||
}
|
||||
|
||||
gsKit_prim_sprite_texture( gsGlobal, texture,
|
||||
x1, //X1
|
||||
@ -225,13 +223,15 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
static float fps = 0.0;
|
||||
#endif
|
||||
ps2_video_t *ps2 = (ps2_video_t*)data;
|
||||
bool texture_empty = true;
|
||||
|
||||
if (!width || !height)
|
||||
return false;
|
||||
|
||||
if (frame_count%120==0) {
|
||||
printf("ps2_gfx_frame %d\n", frame_count);
|
||||
printf("ps2_gfx_frame %lu\n", frame_count);
|
||||
}
|
||||
gsKit_clear(ps2->gsGlobal, GS_BLACK);
|
||||
gsKit_vram_clear(ps2->gsGlobal);
|
||||
|
||||
if (frame) {
|
||||
@ -241,7 +241,7 @@ static bool ps2_gfx_frame(void *data, const void *frame,
|
||||
prim_texture(ps2->gsGlobal, ps2->coreTexture, 1, ps2->force_aspect);
|
||||
}
|
||||
|
||||
bool texture_empty = !ps2->menuTexture->Width || !ps2->menuTexture->Height;
|
||||
texture_empty = !ps2->menuTexture->Width || !ps2->menuTexture->Height;
|
||||
if (ps2->menuVisible && !texture_empty) {
|
||||
vram_alloc(ps2->gsGlobal, ps2->menuTexture);
|
||||
gsKit_texture_upload(ps2->gsGlobal, ps2->menuTexture);
|
||||
|
@ -32,6 +32,7 @@ static char padBuf[256] __attribute__((aligned(64)));
|
||||
|
||||
static uint64_t pad_state[PS2_MAX_PADS];
|
||||
|
||||
extern uint64_t lifecycle_state;
|
||||
|
||||
static const char *ps2_joypad_name(unsigned pad)
|
||||
{
|
||||
@ -45,6 +46,8 @@ static bool ps2_joypad_init(void *data)
|
||||
|
||||
for (i = 0; i < players_count; i++)
|
||||
{
|
||||
int ret, port, slot;
|
||||
|
||||
bool auto_configure = input_autoconfigure_connect( ps2_joypad_name(i),
|
||||
NULL,
|
||||
ps2_joypad.ident,
|
||||
@ -57,9 +60,6 @@ static bool ps2_joypad_init(void *data)
|
||||
|
||||
padInit(i);
|
||||
|
||||
int ret;
|
||||
int port, slot;
|
||||
|
||||
port = 0; // 0 -> Connector 1, 1 -> Connector 2
|
||||
slot = 0; // Always zero if not using multitap
|
||||
|
||||
@ -101,15 +101,13 @@ static void ps2_joypad_poll(void)
|
||||
unsigned players_count = PS2_MAX_PADS;
|
||||
struct padButtonStatus buttons;
|
||||
|
||||
for (player = 0; player < players_count; player++)
|
||||
{
|
||||
for (player = 0; player < players_count; player++) {
|
||||
unsigned j, k;
|
||||
unsigned i = player;
|
||||
unsigned p = player;
|
||||
|
||||
int ret = padRead(player, player, &buttons); // port, slot, buttons
|
||||
if (ret != 0)
|
||||
{
|
||||
if (ret != 0) {
|
||||
int32_t state_tmp = 0xffff ^ buttons.btns;
|
||||
|
||||
pad_state[i] = 0;
|
||||
|
@ -15,14 +15,13 @@
|
||||
#include "../led_driver.h"
|
||||
#include "../../verbosity.h"
|
||||
|
||||
static void null_init(void) { }
|
||||
static void null_free(void) { }
|
||||
static void null_set(int led, int state) { }
|
||||
static void null_led_init(void) { }
|
||||
static void null_led_free(void) { }
|
||||
static void null_led_set(int led, int state) { }
|
||||
|
||||
const led_driver_t null_led_driver = {
|
||||
null_init,
|
||||
null_free,
|
||||
null_set,
|
||||
null_led_init,
|
||||
null_led_free,
|
||||
null_led_set,
|
||||
"null"
|
||||
};
|
||||
|
||||
|
@ -22,18 +22,54 @@
|
||||
|
||||
#include "../menu_driver.h"
|
||||
|
||||
static bool g_menu_on = false;
|
||||
|
||||
static void* null_init(void **userdata, bool video_is_threaded)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)calloc(1, sizeof(*menu));
|
||||
|
||||
if (!menu)
|
||||
return NULL;
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
static void null_free(void *data)
|
||||
{
|
||||
menu_handle_t *menu = (menu_handle_t*)data;
|
||||
|
||||
/*if (menu)
|
||||
free(menu);*/
|
||||
}
|
||||
|
||||
static void null_toggle(void *userdata, bool menu_on)
|
||||
{
|
||||
(void)userdata;
|
||||
|
||||
g_menu_on = menu_on;
|
||||
}
|
||||
|
||||
static int null_menu_iterate(menu_handle_t *menu, void *userdata, enum menu_action action)
|
||||
{
|
||||
(void)menu;
|
||||
(void)userdata;
|
||||
(void)action;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
menu_ctx_driver_t menu_ctx_null = {
|
||||
NULL, /* set_texture */
|
||||
NULL, /* render_messagebox */
|
||||
NULL, /* iterate */
|
||||
null_menu_iterate,
|
||||
NULL, /* render */
|
||||
NULL, /* frame */
|
||||
NULL, /* init */
|
||||
NULL, /* free */
|
||||
null_init,
|
||||
null_free,
|
||||
NULL, /* context_reset */
|
||||
NULL, /* context_destroy */
|
||||
NULL, /* populate_entries */
|
||||
NULL, /* toggle */
|
||||
null_toggle,
|
||||
NULL, /* navigation_clear */
|
||||
NULL, /* navigation_decrement */
|
||||
NULL, /* navigation_increment */
|
||||
|
@ -85,26 +85,26 @@ float osk_dark[16] = {
|
||||
|
||||
/* Menu drivers */
|
||||
static const menu_ctx_driver_t *menu_ctx_drivers[] = {
|
||||
#if defined(HAVE_OZONE)
|
||||
&menu_ctx_ozone,
|
||||
#endif
|
||||
#if defined(HAVE_XUI)
|
||||
&menu_ctx_xui,
|
||||
#endif
|
||||
#if defined(HAVE_MATERIALUI)
|
||||
&menu_ctx_mui,
|
||||
#endif
|
||||
#if defined(HAVE_NUKLEAR)
|
||||
&menu_ctx_nuklear,
|
||||
#endif
|
||||
#if defined(HAVE_XMB)
|
||||
&menu_ctx_xmb,
|
||||
#if defined(HAVE_OZONE)
|
||||
&menu_ctx_ozone,
|
||||
#endif
|
||||
#if defined(HAVE_RGUI)
|
||||
&menu_ctx_rgui,
|
||||
#endif
|
||||
#if defined(HAVE_STRIPES)
|
||||
&menu_ctx_stripes,
|
||||
#endif
|
||||
#if defined(HAVE_RGUI)
|
||||
&menu_ctx_rgui,
|
||||
#if defined(HAVE_XMB)
|
||||
&menu_ctx_xmb,
|
||||
#endif
|
||||
#if defined(HAVE_XUI)
|
||||
&menu_ctx_xui,
|
||||
#endif
|
||||
#if defined(HAVE_ZARCH)
|
||||
&menu_ctx_zarch,
|
||||
@ -2072,8 +2072,9 @@ static bool menu_driver_init_internal(bool video_is_threaded)
|
||||
if (menu_driver_data)
|
||||
return true;
|
||||
|
||||
menu_driver_data = (menu_handle_t*)
|
||||
menu_driver_ctx->init(&menu_userdata, video_is_threaded);
|
||||
if (menu_driver_ctx->init)
|
||||
menu_driver_data = (menu_handle_t*)
|
||||
menu_driver_ctx->init(&menu_userdata, video_is_threaded);
|
||||
|
||||
if (!menu_driver_data || !menu_init(menu_driver_data))
|
||||
goto error;
|
||||
|
@ -208,7 +208,9 @@ bool menu_shader_manager_set_preset(void *data,
|
||||
}
|
||||
config_file_free(conf);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -394,7 +396,10 @@ int menu_shader_manager_clear_num_passes(void)
|
||||
if (shader->passes)
|
||||
shader->passes = 0;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_entries_ctl(MENU_ENTRIES_CTL_SET_REFRESH, &refresh);
|
||||
#endif
|
||||
|
||||
video_shader_resolve_parameters(NULL, shader);
|
||||
|
||||
return 0;
|
||||
|
@ -640,15 +640,6 @@ static void netplay_announce_cb(void *task_data, void *user_data, const char *er
|
||||
{
|
||||
RARCH_LOG("[netplay] announcing netplay game... \n");
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
if (discord_is_inited)
|
||||
{
|
||||
discord_userdata_t userdata;
|
||||
userdata.status = DISCORD_PRESENCE_NETPLAY_HOSTING;
|
||||
command_event(CMD_EVENT_DISCORD_UPDATE, &userdata);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (task_data)
|
||||
{
|
||||
unsigned i, ip_len, port_len;
|
||||
@ -794,6 +785,15 @@ static void netplay_announce_cb(void *task_data, void *user_data, const char *er
|
||||
free(host_string);
|
||||
}
|
||||
|
||||
#ifdef HAVE_DISCORD
|
||||
if (discord_is_inited)
|
||||
{
|
||||
discord_userdata_t userdata;
|
||||
userdata.status = DISCORD_PRESENCE_NETPLAY_HOSTING;
|
||||
command_event(CMD_EVENT_DISCORD_UPDATE, &userdata);
|
||||
}
|
||||
#endif
|
||||
|
||||
string_list_free(lines);
|
||||
free(buf);
|
||||
free(task_data);
|
||||
|
@ -70,24 +70,7 @@ static time_t _gmtotime_t (
|
||||
return seconds_from_1970;
|
||||
}
|
||||
|
||||
/* Protected methods in libc */
|
||||
void _ps2sdk_time_init(void)
|
||||
{
|
||||
SDL_Init(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
/* Protected methods in libc */
|
||||
void _ps2sdk_time_deinit(void)
|
||||
{
|
||||
SDL_QuitSubSystem(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
clock_t clock(void)
|
||||
{
|
||||
return SDL_GetTicks();
|
||||
}
|
||||
|
||||
time_t time(time_t *t) {
|
||||
time_t ps2_time(time_t *t) {
|
||||
time_t tim;
|
||||
sceCdCLOCK clocktime; /* defined in libcdvd.h */
|
||||
|
||||
@ -106,3 +89,26 @@ time_t time(time_t *t) {
|
||||
|
||||
return tim;
|
||||
}
|
||||
|
||||
/* Protected methods in libc */
|
||||
void _ps2sdk_time_init(void)
|
||||
{
|
||||
SDL_Init(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
/* Protected methods in libc */
|
||||
void _ps2sdk_time_deinit(void)
|
||||
{
|
||||
SDL_QuitSubSystem(SDL_INIT_TIMER);
|
||||
}
|
||||
|
||||
clock_t clock(void)
|
||||
{
|
||||
return SDL_GetTicks();
|
||||
}
|
||||
|
||||
time_t time(time_t *t) {
|
||||
time_t tim = -1;
|
||||
/* TODO: This function need to be implemented again because the SDK one is not working fine */
|
||||
return time;
|
||||
}
|
||||
|
@ -578,18 +578,20 @@ if [ "$HAVE_MENU" != 'no' ]; then
|
||||
if [ "$OS" = 'Win32' ]; then
|
||||
HAVE_SHADERPIPELINE=no
|
||||
HAVE_VULKAN=no
|
||||
die : 'Notice: Hardware rendering context not available.'
|
||||
elif [ "$HAVE_CACA" = 'yes' ] || [ "$HAVE_SIXEL" = 'yes' ]; then
|
||||
die : 'Notice: Hardware rendering context not available.'
|
||||
else
|
||||
if [ "$HAVE_CACA" != 'yes' ] && [ "$HAVE_SIXEL" != 'yes' ] &&
|
||||
[ "$HAVE_SDL" != 'yes' ] && [ "$HAVE_SDL2" != 'yes' ]; then
|
||||
HAVE_MENU=no
|
||||
HAVE_RGUI=no
|
||||
fi
|
||||
HAVE_MATERIALUI=no
|
||||
HAVE_OZONE=no
|
||||
HAVE_XMB=no
|
||||
HAVE_NUKLEAR=no
|
||||
HAVE_STRIPES=no
|
||||
HAVE_ZARCH=no
|
||||
die : 'Notice: Hardware rendering context not available, menu drivers will also be disabled.'
|
||||
fi
|
||||
die : 'Notice: Hardware rendering context not available.'
|
||||
fi
|
||||
fi
|
||||
|
||||
|
@ -7,7 +7,7 @@ HAVE_OPENGLES_CFLAGS= # C-flags for custom GLES library
|
||||
HAVE_CACA=no # Libcaca support
|
||||
HAVE_SIXEL=no # Libsixel support
|
||||
HAVE_LIBRETRODB=yes # Libretrodb support
|
||||
HAVE_MENU=yes # Enables menu drivers
|
||||
HAVE_MENU=yes # Enable menu drivers
|
||||
HAVE_RGUI=auto # RGUI menu
|
||||
HAVE_MATERIALUI=auto # MaterialUI menu
|
||||
HAVE_XMB=auto # XMB menu
|
||||
|
701
retroarch.c
701
retroarch.c
@ -753,52 +753,55 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
|
||||
|
||||
/* First pass: Read the config file path and any directory overrides, so
|
||||
* they're in place when we load the config */
|
||||
for (;;)
|
||||
if (argc)
|
||||
{
|
||||
int c = getopt_long(argc, argv, optstring, opts, NULL);
|
||||
for (;;)
|
||||
{
|
||||
int c = getopt_long(argc, argv, optstring, opts, NULL);
|
||||
|
||||
#if 0
|
||||
fprintf(stderr, "c is: %c (%d), optarg is: [%s]\n", c, c, string_is_empty(optarg) ? "" : optarg);
|
||||
fprintf(stderr, "c is: %c (%d), optarg is: [%s]\n", c, c, string_is_empty(optarg) ? "" : optarg);
|
||||
#endif
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 'h':
|
||||
retroarch_print_help(argv[0]);
|
||||
exit(0);
|
||||
|
||||
case 'c':
|
||||
RARCH_LOG("Set config file to : %s\n", optarg);
|
||||
path_set(RARCH_PATH_CONFIG, optarg);
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
case RA_OPT_APPENDCONFIG:
|
||||
path_set(RARCH_PATH_CONFIG_APPEND, optarg);
|
||||
break;
|
||||
switch (c)
|
||||
{
|
||||
case 'h':
|
||||
retroarch_print_help(argv[0]);
|
||||
exit(0);
|
||||
|
||||
case 's':
|
||||
strlcpy(global->name.savefile, optarg,
|
||||
sizeof(global->name.savefile));
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
||||
break;
|
||||
case 'c':
|
||||
RARCH_LOG("Set config file to : %s\n", optarg);
|
||||
path_set(RARCH_PATH_CONFIG, optarg);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
strlcpy(global->name.savestate, optarg,
|
||||
sizeof(global->name.savestate));
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
break;
|
||||
case RA_OPT_APPENDCONFIG:
|
||||
path_set(RARCH_PATH_CONFIG_APPEND, optarg);
|
||||
break;
|
||||
|
||||
/* Must handle '?' otherwise you get an infinite loop */
|
||||
case '?':
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
break;
|
||||
/* All other arguments are handled in the second pass */
|
||||
case 's':
|
||||
strlcpy(global->name.savefile, optarg,
|
||||
sizeof(global->name.savefile));
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_SAVE_PATH, NULL);
|
||||
break;
|
||||
|
||||
case 'S':
|
||||
strlcpy(global->name.savestate, optarg,
|
||||
sizeof(global->name.savestate));
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_STATE_PATH, NULL);
|
||||
break;
|
||||
|
||||
/* Must handle '?' otherwise you get an infinite loop */
|
||||
case '?':
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
break;
|
||||
/* All other arguments are handled in the second pass */
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -807,346 +810,350 @@ static void retroarch_parse_input_and_config(int argc, char *argv[])
|
||||
|
||||
/* Second pass: All other arguments override the config file */
|
||||
optind = 1;
|
||||
for (;;)
|
||||
|
||||
if (argc)
|
||||
{
|
||||
int c = getopt_long(argc, argv, optstring, opts, NULL);
|
||||
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
for (;;)
|
||||
{
|
||||
case 'd':
|
||||
{
|
||||
unsigned new_port;
|
||||
unsigned id = 0;
|
||||
struct string_list *list = string_split(optarg, ":");
|
||||
int port = 0;
|
||||
int c = getopt_long(argc, argv, optstring, opts, NULL);
|
||||
|
||||
if (list && list->size == 2)
|
||||
if (c == -1)
|
||||
break;
|
||||
|
||||
switch (c)
|
||||
{
|
||||
case 'd':
|
||||
{
|
||||
port = (int)strtol(list->elems[0].data, NULL, 0);
|
||||
id = (unsigned)strtoul(list->elems[1].data, NULL, 0);
|
||||
unsigned new_port;
|
||||
unsigned id = 0;
|
||||
struct string_list *list = string_split(optarg, ":");
|
||||
int port = 0;
|
||||
|
||||
if (list && list->size == 2)
|
||||
{
|
||||
port = (int)strtol(list->elems[0].data, NULL, 0);
|
||||
id = (unsigned)strtoul(list->elems[1].data, NULL, 0);
|
||||
}
|
||||
string_list_free(list);
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
{
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_VALUE_CONNECT_DEVICE_FROM_A_VALID_PORT));
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port -1;
|
||||
|
||||
input_config_set_device(new_port, id);
|
||||
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
string_list_free(list);
|
||||
break;
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
case 'A':
|
||||
{
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_VALUE_CONNECT_DEVICE_FROM_A_VALID_PORT));
|
||||
unsigned new_port;
|
||||
int port = (int)strtol(optarg, NULL, 0);
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
{
|
||||
RARCH_ERR("Connect dualanalog to a valid port.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port - 1;
|
||||
|
||||
input_config_set_device(new_port, RETRO_DEVICE_ANALOG);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
rarch_force_fullscreen = true;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
verbosity_enable();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_VERBOSITY, NULL);
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
{
|
||||
unsigned new_port;
|
||||
int port = (int)strtol(optarg, NULL, 0);
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
{
|
||||
RARCH_ERR("%s\n",
|
||||
msg_hash_to_str(MSG_DISCONNECT_DEVICE_FROM_A_VALID_PORT));
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port - 1;
|
||||
input_config_set_device(port - 1, RETRO_DEVICE_NONE);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
strlcpy(global->record.path, optarg,
|
||||
sizeof(global->record.path));
|
||||
if (recording_is_enabled())
|
||||
recording_set_state(true);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
case 'L':
|
||||
if (path_is_directory(optarg))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (rarch_first_start)
|
||||
core_set_on_cmdline = true;
|
||||
|
||||
path_clear(RARCH_PATH_CORE);
|
||||
strlcpy(settings->paths.directory_libretro, optarg,
|
||||
sizeof(settings->paths.directory_libretro));
|
||||
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY, NULL);
|
||||
RARCH_WARN("Using old --libretro behavior. "
|
||||
"Setting libretro_directory to \"%s\" instead.\n",
|
||||
optarg);
|
||||
}
|
||||
else if (filestream_exists(optarg))
|
||||
{
|
||||
if (rarch_first_start)
|
||||
core_set_on_cmdline = true;
|
||||
|
||||
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, optarg);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);
|
||||
|
||||
/* We requested explicit core, so use PLAIN core type. */
|
||||
retroarch_set_current_core_type(CORE_TYPE_PLAIN, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_WARN("--libretro argument \"%s\" is neither a file nor directory. Ignoring.\n",
|
||||
optarg);
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
case 'P':
|
||||
case 'R':
|
||||
bsv_movie_set_start_path(optarg);
|
||||
|
||||
if (c == 'P')
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_PLAYBACK, NULL);
|
||||
else
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_PLAYBACK, NULL);
|
||||
|
||||
if (c == 'R')
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_RECORDING, NULL);
|
||||
else
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_RECORDING, NULL);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
if (string_is_equal(optarg, "noload-nosave"))
|
||||
{
|
||||
rarch_is_sram_load_disabled = true;
|
||||
rarch_is_sram_save_disabled = true;
|
||||
}
|
||||
else if (string_is_equal(optarg, "noload-save"))
|
||||
rarch_is_sram_load_disabled = true;
|
||||
else if (string_is_equal(optarg, "load-nosave"))
|
||||
rarch_is_sram_save_disabled = true;
|
||||
else if (string_is_not_equal(optarg, "load-save"))
|
||||
{
|
||||
RARCH_ERR("Invalid argument in --sram-mode.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port -1;
|
||||
break;
|
||||
|
||||
input_config_set_device(new_port, id);
|
||||
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'A':
|
||||
{
|
||||
unsigned new_port;
|
||||
int port = (int)strtol(optarg, NULL, 0);
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
{
|
||||
RARCH_ERR("Connect dualanalog to a valid port.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port - 1;
|
||||
|
||||
input_config_set_device(new_port, RETRO_DEVICE_ANALOG);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'f':
|
||||
rarch_force_fullscreen = true;
|
||||
break;
|
||||
|
||||
case 'v':
|
||||
verbosity_enable();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_VERBOSITY, NULL);
|
||||
break;
|
||||
|
||||
case 'N':
|
||||
{
|
||||
unsigned new_port;
|
||||
int port = (int)strtol(optarg, NULL, 0);
|
||||
|
||||
if (port < 1 || port > MAX_USERS)
|
||||
{
|
||||
RARCH_ERR("%s\n",
|
||||
msg_hash_to_str(MSG_DISCONNECT_DEVICE_FROM_A_VALID_PORT));
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
new_port = port - 1;
|
||||
input_config_set_device(port - 1, RETRO_DEVICE_NONE);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_LIBRETRO_DEVICE, &new_port);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'r':
|
||||
strlcpy(global->record.path, optarg,
|
||||
sizeof(global->record.path));
|
||||
if (recording_is_enabled())
|
||||
recording_set_state(true);
|
||||
break;
|
||||
|
||||
#ifdef HAVE_DYNAMIC
|
||||
case 'L':
|
||||
if (path_is_directory(optarg))
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
if (rarch_first_start)
|
||||
core_set_on_cmdline = true;
|
||||
|
||||
path_clear(RARCH_PATH_CORE);
|
||||
strlcpy(settings->paths.directory_libretro, optarg,
|
||||
sizeof(settings->paths.directory_libretro));
|
||||
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO_DIRECTORY, NULL);
|
||||
RARCH_WARN("Using old --libretro behavior. "
|
||||
"Setting libretro_directory to \"%s\" instead.\n",
|
||||
optarg);
|
||||
}
|
||||
else if (filestream_exists(optarg))
|
||||
{
|
||||
if (rarch_first_start)
|
||||
core_set_on_cmdline = true;
|
||||
|
||||
rarch_ctl(RARCH_CTL_SET_LIBRETRO_PATH, optarg);
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_LIBRETRO, NULL);
|
||||
|
||||
/* We requested explicit core, so use PLAIN core type. */
|
||||
retroarch_set_current_core_type(CORE_TYPE_PLAIN, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
RARCH_WARN("--libretro argument \"%s\" is neither a file nor directory. Ignoring.\n",
|
||||
optarg);
|
||||
}
|
||||
|
||||
break;
|
||||
#endif
|
||||
case 'P':
|
||||
case 'R':
|
||||
bsv_movie_set_start_path(optarg);
|
||||
|
||||
if (c == 'P')
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_PLAYBACK, NULL);
|
||||
else
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_PLAYBACK, NULL);
|
||||
|
||||
if (c == 'R')
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_START_RECORDING, NULL);
|
||||
else
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_UNSET_START_RECORDING, NULL);
|
||||
break;
|
||||
|
||||
case 'M':
|
||||
if (string_is_equal(optarg, "noload-nosave"))
|
||||
{
|
||||
rarch_is_sram_load_disabled = true;
|
||||
rarch_is_sram_save_disabled = true;
|
||||
}
|
||||
else if (string_is_equal(optarg, "noload-save"))
|
||||
rarch_is_sram_load_disabled = true;
|
||||
else if (string_is_equal(optarg, "load-nosave"))
|
||||
rarch_is_sram_save_disabled = true;
|
||||
else if (string_is_not_equal(optarg, "load-save"))
|
||||
{
|
||||
RARCH_ERR("Invalid argument in --sram-mode.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef HAVE_NETWORKING
|
||||
case 'H':
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_MODE, NULL);
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_SERVER, NULL);
|
||||
break;
|
||||
|
||||
case 'C':
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
#ifdef HAVE_NETWORKING
|
||||
case 'H':
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_MODE, NULL);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL);
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
strlcpy(settings->paths.netplay_server, optarg,
|
||||
sizeof(settings->paths.netplay_server));
|
||||
}
|
||||
break;
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_SERVER, NULL);
|
||||
break;
|
||||
|
||||
case RA_OPT_STATELESS:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
case 'C':
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_MODE, NULL);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_ADDRESS, NULL);
|
||||
netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL);
|
||||
strlcpy(settings->paths.netplay_server, optarg,
|
||||
sizeof(settings->paths.netplay_server));
|
||||
}
|
||||
break;
|
||||
|
||||
configuration_set_bool(settings,
|
||||
settings->bools.netplay_stateless_mode, true);
|
||||
case RA_OPT_STATELESS:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_STATELESS_MODE, NULL);
|
||||
}
|
||||
break;
|
||||
configuration_set_bool(settings,
|
||||
settings->bools.netplay_stateless_mode, true);
|
||||
|
||||
case RA_OPT_CHECK_FRAMES:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_CHECK_FRAMES, NULL);
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_STATELESS_MODE, NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
configuration_set_int(settings,
|
||||
settings->ints.netplay_check_frames,
|
||||
(int)strtoul(optarg, NULL, 0));
|
||||
}
|
||||
break;
|
||||
case RA_OPT_CHECK_FRAMES:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_CHECK_FRAMES, NULL);
|
||||
|
||||
case RA_OPT_PORT:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_PORT, NULL);
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.netplay_port,
|
||||
(int)strtoul(optarg, NULL, 0));
|
||||
}
|
||||
break;
|
||||
configuration_set_int(settings,
|
||||
settings->ints.netplay_check_frames,
|
||||
(int)strtoul(optarg, NULL, 0));
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD)
|
||||
case RA_OPT_COMMAND:
|
||||
#ifdef HAVE_COMMAND
|
||||
if (command_network_send((const char*)optarg))
|
||||
case RA_OPT_PORT:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
retroarch_override_setting_set(
|
||||
RARCH_OVERRIDE_SETTING_NETPLAY_IP_PORT, NULL);
|
||||
configuration_set_uint(settings,
|
||||
settings->uints.netplay_port,
|
||||
(int)strtoul(optarg, NULL, 0));
|
||||
}
|
||||
break;
|
||||
|
||||
#if defined(HAVE_NETWORK_CMD)
|
||||
case RA_OPT_COMMAND:
|
||||
#ifdef HAVE_COMMAND
|
||||
if (command_network_send((const char*)optarg))
|
||||
exit(0);
|
||||
else
|
||||
retroarch_fail(1, "network_cmd_send()");
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
case RA_OPT_BPS:
|
||||
strlcpy(global->name.bps, optarg,
|
||||
sizeof(global->name.bps));
|
||||
rarch_bps_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_BPS_PREF, NULL);
|
||||
break;
|
||||
|
||||
case 'U':
|
||||
strlcpy(global->name.ups, optarg,
|
||||
sizeof(global->name.ups));
|
||||
rarch_ups_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_UPS_PREF, NULL);
|
||||
break;
|
||||
|
||||
case RA_OPT_IPS:
|
||||
strlcpy(global->name.ips, optarg,
|
||||
sizeof(global->name.ips));
|
||||
rarch_ips_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_IPS_PREF, NULL);
|
||||
break;
|
||||
|
||||
case RA_OPT_NO_PATCH:
|
||||
rarch_ctl(RARCH_CTL_SET_PATCH_BLOCKED, NULL);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
frontend_driver_detach_console();
|
||||
break;
|
||||
|
||||
case RA_OPT_MENU:
|
||||
explicit_menu = true;
|
||||
break;
|
||||
|
||||
case RA_OPT_NICK:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
has_set_username = true;
|
||||
|
||||
strlcpy(settings->paths.username, optarg,
|
||||
sizeof(settings->paths.username));
|
||||
}
|
||||
break;
|
||||
|
||||
case RA_OPT_SIZE:
|
||||
if (sscanf(optarg, "%ux%u",
|
||||
recording_driver_get_width(),
|
||||
recording_driver_get_height()) != 2)
|
||||
{
|
||||
RARCH_ERR("Wrong format for --size.\n");
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
break;
|
||||
|
||||
case RA_OPT_RECORDCONFIG:
|
||||
strlcpy(global->record.config, optarg,
|
||||
sizeof(global->record.config));
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES:
|
||||
runloop_max_frames = (unsigned)strtoul(optarg, NULL, 10);
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES_SCREENSHOT:
|
||||
runloop_max_frames_screenshot = true;
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES_SCREENSHOT_PATH:
|
||||
strlcpy(runloop_max_frames_screenshot_path, optarg, sizeof(runloop_max_frames_screenshot_path));
|
||||
break;
|
||||
|
||||
case RA_OPT_SUBSYSTEM:
|
||||
path_set(RARCH_PATH_SUBSYSTEM, optarg);
|
||||
break;
|
||||
|
||||
case RA_OPT_FEATURES:
|
||||
retroarch_print_features();
|
||||
exit(0);
|
||||
else
|
||||
retroarch_fail(1, "network_cmd_send()");
|
||||
#endif
|
||||
break;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
case RA_OPT_EOF_EXIT:
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_END_EOF, NULL);
|
||||
break;
|
||||
|
||||
case RA_OPT_BPS:
|
||||
strlcpy(global->name.bps, optarg,
|
||||
sizeof(global->name.bps));
|
||||
rarch_bps_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_BPS_PREF, NULL);
|
||||
break;
|
||||
case RA_OPT_VERSION:
|
||||
retroarch_print_version();
|
||||
exit(0);
|
||||
|
||||
case 'U':
|
||||
strlcpy(global->name.ups, optarg,
|
||||
sizeof(global->name.ups));
|
||||
rarch_ups_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_UPS_PREF, NULL);
|
||||
break;
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
case RA_OPT_LOG_FILE:
|
||||
retro_main_log_file_init(optarg);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case RA_OPT_IPS:
|
||||
strlcpy(global->name.ips, optarg,
|
||||
sizeof(global->name.ips));
|
||||
rarch_ips_pref = true;
|
||||
retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_IPS_PREF, NULL);
|
||||
break;
|
||||
case 'c':
|
||||
case 'h':
|
||||
case RA_OPT_APPENDCONFIG:
|
||||
case 's':
|
||||
case 'S':
|
||||
break; /* Handled in the first pass */
|
||||
|
||||
case RA_OPT_NO_PATCH:
|
||||
rarch_ctl(RARCH_CTL_SET_PATCH_BLOCKED, NULL);
|
||||
break;
|
||||
|
||||
case 'D':
|
||||
frontend_driver_detach_console();
|
||||
break;
|
||||
|
||||
case RA_OPT_MENU:
|
||||
explicit_menu = true;
|
||||
break;
|
||||
|
||||
case RA_OPT_NICK:
|
||||
{
|
||||
settings_t *settings = config_get_ptr();
|
||||
|
||||
has_set_username = true;
|
||||
|
||||
strlcpy(settings->paths.username, optarg,
|
||||
sizeof(settings->paths.username));
|
||||
}
|
||||
break;
|
||||
|
||||
case RA_OPT_SIZE:
|
||||
if (sscanf(optarg, "%ux%u",
|
||||
recording_driver_get_width(),
|
||||
recording_driver_get_height()) != 2)
|
||||
{
|
||||
RARCH_ERR("Wrong format for --size.\n");
|
||||
case '?':
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
break;
|
||||
|
||||
case RA_OPT_RECORDCONFIG:
|
||||
strlcpy(global->record.config, optarg,
|
||||
sizeof(global->record.config));
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES:
|
||||
runloop_max_frames = (unsigned)strtoul(optarg, NULL, 10);
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES_SCREENSHOT:
|
||||
runloop_max_frames_screenshot = true;
|
||||
break;
|
||||
|
||||
case RA_OPT_MAX_FRAMES_SCREENSHOT_PATH:
|
||||
strlcpy(runloop_max_frames_screenshot_path, optarg, sizeof(runloop_max_frames_screenshot_path));
|
||||
break;
|
||||
|
||||
case RA_OPT_SUBSYSTEM:
|
||||
path_set(RARCH_PATH_SUBSYSTEM, optarg);
|
||||
break;
|
||||
|
||||
case RA_OPT_FEATURES:
|
||||
retroarch_print_features();
|
||||
exit(0);
|
||||
|
||||
case RA_OPT_EOF_EXIT:
|
||||
bsv_movie_ctl(BSV_MOVIE_CTL_SET_END_EOF, NULL);
|
||||
break;
|
||||
|
||||
case RA_OPT_VERSION:
|
||||
retroarch_print_version();
|
||||
exit(0);
|
||||
|
||||
#ifdef HAVE_FILE_LOGGER
|
||||
case RA_OPT_LOG_FILE:
|
||||
retro_main_log_file_init(optarg);
|
||||
break;
|
||||
#endif
|
||||
|
||||
case 'c':
|
||||
case 'h':
|
||||
case RA_OPT_APPENDCONFIG:
|
||||
case 's':
|
||||
case 'S':
|
||||
break; /* Handled in the first pass */
|
||||
|
||||
case '?':
|
||||
retroarch_print_help(argv[0]);
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
|
||||
default:
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_ERROR_PARSING_ARGUMENTS));
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
default:
|
||||
RARCH_ERR("%s\n", msg_hash_to_str(MSG_ERROR_PARSING_ARGUMENTS));
|
||||
retroarch_fail(1, "retroarch_parse_input()");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -61,9 +61,10 @@
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
#include "../menu/menu_driver.h"
|
||||
#include "../menu/menu_shader.h"
|
||||
#endif
|
||||
|
||||
#include "../menu/menu_shader.h"
|
||||
|
||||
#ifdef HAVE_CHEEVOS
|
||||
#include "../cheevos/cheevos.h"
|
||||
#endif
|
||||
@ -290,11 +291,8 @@ static bool content_load(content_ctx_info_t *info)
|
||||
content_clear_subsystem();
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
/* TODO/FIXME - can we get rid of this? */
|
||||
menu_shader_manager_init();
|
||||
#endif
|
||||
|
||||
command_event(CMD_EVENT_HISTORY_INIT, NULL);
|
||||
command_event(CMD_EVENT_RESUME, NULL);
|
||||
command_event(CMD_EVENT_VIDEO_SET_ASPECT_RATIO, NULL);
|
||||
@ -832,8 +830,6 @@ static bool content_file_init(
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
static void menu_content_environment_get(int *argc, char *argv[],
|
||||
void *args, void *params_data)
|
||||
{
|
||||
@ -867,7 +863,6 @@ static void menu_content_environment_get(int *argc, char *argv[],
|
||||
path_get(RARCH_PATH_CORE);
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* task_load_content:
|
||||
@ -1115,10 +1110,8 @@ bool task_push_start_dummy_core(content_ctx_info_t *content_info)
|
||||
if (!string_is_empty(settings->paths.directory_system))
|
||||
content_ctx.directory_system = strdup(settings->paths.directory_system);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (!content_info->environ_get)
|
||||
content_info->environ_get = menu_content_environment_get;
|
||||
#endif
|
||||
|
||||
/* Clear content path */
|
||||
path_clear(RARCH_PATH_CONTENT);
|
||||
@ -1308,10 +1301,8 @@ bool task_push_start_current_core(content_ctx_info_t *content_info)
|
||||
if (!string_is_empty(settings->paths.directory_system))
|
||||
content_ctx.directory_system = strdup(settings->paths.directory_system);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (!content_info->environ_get)
|
||||
content_info->environ_get = menu_content_environment_get;
|
||||
#endif
|
||||
|
||||
/* Clear content path */
|
||||
path_clear(RARCH_PATH_CONTENT);
|
||||
@ -1560,10 +1551,8 @@ static bool task_load_content_callback(content_ctx_info_t *content_info,
|
||||
if (!string_is_empty(settings->paths.directory_system))
|
||||
content_ctx.directory_system = strdup(settings->paths.directory_system);
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
if (!content_info->environ_get)
|
||||
content_info->environ_get = menu_content_environment_get;
|
||||
#endif
|
||||
|
||||
if (firmware_update_status(&content_ctx))
|
||||
goto end;
|
||||
|
@ -28,9 +28,7 @@ extern "C" {
|
||||
#include "../../../retroarch.h"
|
||||
#include "../../../paths.h"
|
||||
#include "../../../file_path_special.h"
|
||||
#ifdef HAVE_MENU
|
||||
#include "../../../menu/menu_shader.h"
|
||||
#endif
|
||||
}
|
||||
|
||||
enum
|
||||
@ -169,7 +167,7 @@ void ShaderParamsDialog::clearLayout()
|
||||
void ShaderParamsDialog::getShaders(struct video_shader **menu_shader, struct video_shader **video_shader)
|
||||
{
|
||||
video_shader_ctx_t shader_info = {0};
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
struct video_shader *shader = menu_shader_get();
|
||||
|
||||
if (menu_shader)
|
||||
@ -195,7 +193,6 @@ void ShaderParamsDialog::getShaders(struct video_shader **menu_shader, struct vi
|
||||
*video_shader = NULL;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (video_shader)
|
||||
{
|
||||
@ -491,7 +488,6 @@ void ShaderParamsDialog::onShaderPassMoveUpClicked()
|
||||
|
||||
void ShaderParamsDialog::onShaderLoadPresetClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
QString path;
|
||||
QString filter;
|
||||
QByteArray pathArray;
|
||||
@ -541,7 +537,6 @@ void ShaderParamsDialog::onShaderLoadPresetClicked()
|
||||
type = video_shader_parse_type(pathData, RARCH_SHADER_NONE);
|
||||
|
||||
menu_shader_manager_set_preset(menu_shader, type, pathData);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderResetPass(int pass)
|
||||
@ -634,7 +629,6 @@ void ShaderParamsDialog::onShaderResetAllPasses()
|
||||
|
||||
void ShaderParamsDialog::onShaderAddPassClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
QString path;
|
||||
QString filter;
|
||||
QByteArray pathArray;
|
||||
@ -696,12 +690,10 @@ void ShaderParamsDialog::onShaderAddPassClicked()
|
||||
video_shader_resolve_parameters(NULL, menu_shader);
|
||||
|
||||
command_event(CMD_EVENT_SHADERS_APPLY_CHANGES, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderSavePresetAsClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
settings_t *settings = config_get_ptr();
|
||||
QString path;
|
||||
QByteArray pathArray;
|
||||
@ -716,7 +708,6 @@ void ShaderParamsDialog::onShaderSavePresetAsClicked()
|
||||
pathData = pathArray.constData();
|
||||
|
||||
saveShaderPreset(pathData, SHADER_PRESET_SAVE_NORMAL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type)
|
||||
@ -769,18 +760,15 @@ void ShaderParamsDialog::saveShaderPreset(const char *path, unsigned action_type
|
||||
strlcpy(file, path, sizeof(file));
|
||||
break;
|
||||
}
|
||||
#ifdef HAVE_MENU
|
||||
|
||||
if (menu_shader_manager_save_preset(file, false, true))
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_SHADER_PRESET_SAVED_SUCCESSFULLY),
|
||||
1, 100, true);
|
||||
else
|
||||
#endif
|
||||
{
|
||||
runloop_msg_queue_push(
|
||||
msg_hash_to_str(MSG_ERROR_SAVING_SHADER_PRESET),
|
||||
1, 100, true);
|
||||
}
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderSaveCorePresetClicked()
|
||||
@ -800,7 +788,6 @@ void ShaderParamsDialog::onShaderSaveGamePresetClicked()
|
||||
|
||||
void ShaderParamsDialog::onShaderClearAllPassesClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
struct video_shader *menu_shader = NULL;
|
||||
struct video_shader *video_shader = NULL;
|
||||
|
||||
@ -813,12 +800,10 @@ void ShaderParamsDialog::onShaderClearAllPassesClicked()
|
||||
menu_shader_manager_decrement_amount_passes();
|
||||
|
||||
onShaderApplyClicked();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderRemovePassClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
int i;
|
||||
QVariant passVariant;
|
||||
QAction *action = qobject_cast<QAction*>(sender());
|
||||
@ -854,7 +839,6 @@ void ShaderParamsDialog::onShaderRemovePassClicked()
|
||||
menu_shader_manager_decrement_amount_passes();
|
||||
|
||||
onShaderApplyClicked();
|
||||
#endif
|
||||
}
|
||||
|
||||
void ShaderParamsDialog::onShaderApplyClicked()
|
||||
|
@ -205,32 +205,36 @@ void LoadCoreWindow::initCoreList(const QStringList &extensionFilters)
|
||||
m_table->setSelectionBehavior(QAbstractItemView::SelectRows);
|
||||
m_table->setSelectionMode(QAbstractItemView::SingleSelection);
|
||||
m_table->setSortingEnabled(false);
|
||||
m_table->setRowCount(cores->count);
|
||||
m_table->setColumnCount(2);
|
||||
m_table->setHorizontalHeaderLabels(horizontal_header_labels);
|
||||
|
||||
for (i = 0; i < cores->count; i++)
|
||||
if (cores)
|
||||
{
|
||||
core_info_t *core = core_info_get(cores, i);
|
||||
QTableWidgetItem *name_item = NULL;
|
||||
QTableWidgetItem *version_item = new QTableWidgetItem(core->display_version);
|
||||
QVariantHash hash;
|
||||
const char *name = core->display_name;
|
||||
m_table->setRowCount(cores->count);
|
||||
|
||||
if (string_is_empty(name))
|
||||
name = path_basename(core->path);
|
||||
for (i = 0; i < cores->count; i++)
|
||||
{
|
||||
core_info_t *core = core_info_get(cores, i);
|
||||
QTableWidgetItem *name_item = NULL;
|
||||
QTableWidgetItem *version_item = new QTableWidgetItem(core->display_version);
|
||||
QVariantHash hash;
|
||||
const char *name = core->display_name;
|
||||
|
||||
name_item = new QTableWidgetItem(name);
|
||||
if (string_is_empty(name))
|
||||
name = path_basename(core->path);
|
||||
|
||||
hash["path"] = core->path;
|
||||
hash["extensions"] = QString(core->supported_extensions).split("|");
|
||||
name_item = new QTableWidgetItem(name);
|
||||
|
||||
name_item->setData(Qt::UserRole, hash);
|
||||
name_item->setFlags(name_item->flags() & ~Qt::ItemIsEditable);
|
||||
version_item->setFlags(version_item->flags() & ~Qt::ItemIsEditable);
|
||||
hash["path"] = core->path;
|
||||
hash["extensions"] = QString(core->supported_extensions).split("|");
|
||||
|
||||
m_table->setItem(i, CORE_NAME_COLUMN, name_item);
|
||||
m_table->setItem(i, CORE_VERSION_COLUMN, version_item);
|
||||
name_item->setData(Qt::UserRole, hash);
|
||||
name_item->setFlags(name_item->flags() & ~Qt::ItemIsEditable);
|
||||
version_item->setFlags(version_item->flags() & ~Qt::ItemIsEditable);
|
||||
|
||||
m_table->setItem(i, CORE_NAME_COLUMN, name_item);
|
||||
m_table->setItem(i, CORE_VERSION_COLUMN, version_item);
|
||||
}
|
||||
}
|
||||
|
||||
if (!extensionFilters.isEmpty())
|
||||
|
@ -1737,7 +1737,6 @@ label_noext - the display name of the content that is guaranteed not to contain
|
||||
*/
|
||||
void MainWindow::loadContent(const QHash<QString, QString> &contentHash)
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
content_ctx_info_t content_info;
|
||||
QByteArray corePathArray;
|
||||
QByteArray contentPathArray;
|
||||
@ -1851,41 +1850,43 @@ void MainWindow::loadContent(const QHash<QString, QString> &contentHash)
|
||||
content_info.args = NULL;
|
||||
content_info.environ_get = NULL;
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_navigation_set_selection(0);
|
||||
#endif
|
||||
|
||||
command_event(CMD_EVENT_UNLOAD_CORE, NULL);
|
||||
|
||||
if (!task_push_load_content_from_playlist_from_menu(
|
||||
corePath, contentPath, contentLabel,
|
||||
&content_info,
|
||||
NULL, NULL))
|
||||
if (!task_push_load_content_with_new_core_from_companion_ui(
|
||||
corePath, contentPath, &content_info,
|
||||
NULL, NULL))
|
||||
{
|
||||
QMessageBox::critical(this, msg_hash_to_str(MSG_ERROR), msg_hash_to_str(MSG_FAILED_TO_LOAD_CONTENT));
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef HAVE_MENU
|
||||
menu_driver_ctl(RARCH_MENU_CTL_SET_PENDING_QUICK_MENU, NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
void MainWindow::onRunClicked()
|
||||
{
|
||||
#ifdef HAVE_MENU
|
||||
QHash<QString, QString> contentHash;
|
||||
|
||||
switch (m_currentBrowser)
|
||||
{
|
||||
case BROWSER_TYPE_FILES:
|
||||
contentHash = getFileContentHash(m_proxyFileModel->mapToSource(m_fileTableView->currentIndex()));
|
||||
break;
|
||||
case BROWSER_TYPE_PLAYLISTS:
|
||||
contentHash = getCurrentContentHash();
|
||||
break;
|
||||
case BROWSER_TYPE_FILES:
|
||||
contentHash = getFileContentHash(m_proxyFileModel->mapToSource(m_fileTableView->currentIndex()));
|
||||
break;
|
||||
case BROWSER_TYPE_PLAYLISTS:
|
||||
contentHash = getCurrentContentHash();
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (contentHash.isEmpty())
|
||||
return;
|
||||
|
||||
|
||||
loadContent(contentHash);
|
||||
#endif
|
||||
}
|
||||
|
||||
bool MainWindow::isContentLessCore()
|
||||
|
Loading…
x
Reference in New Issue
Block a user