This commit is contained in:
twinaphex 2020-04-06 01:04:23 +02:00
commit e88568625c
15 changed files with 402 additions and 176 deletions

View File

@ -1,9 +1,17 @@
# Future
- AUTOCONFIG: Use correct port index in input device configured/disconnected notifications
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions.
- BUGFIX: Fix race condition where task could momentarily not be in the queue when reordering
- CHEEVOS/BUGFIX: Prevent null reference rendering achievement list while closing application
- CHEEVOS/BUGFIX: Report non-memorymap GBA cores as unsupported
- CHD: Fixes a crash caused by ignoring the return value from one of the CHD library functions
- LOCALIZATION: Update Spanish translation
- METAL/BUGFIX: GPU capture on Metal/OSX/NVidia could crash
- METAL/BUGFIX: Taking screenshots could capture black frames. Resulting PNG screenshots were black.
- METAL/BUGFIX: Corrupted image due to incorrect viewport copy when taking screenshot
- MENU: Prevent font-related segfaults when using extremely small scales/window sizes
- MENU: Fix 'gfx_display_draw_texture_slice()'
- MENU/FONT: Enable correct vertical alignment of text (+ font rendering fixes)
- MENU/RGUI: Enable automatic menu size reduction when running at low resolutions (down to 256x192)
- MENU/OZONE: Update timedate style options for Last Played sublabel metadata
- MENU/OZONE: Hide 'Menu Color Theme' setting when 'Use preferred system color theme' is enabled
- MENU/OZONE: Fix thumbnail switching via 'scan' button functionality
@ -11,8 +19,10 @@
- MENU/XMB: Fix thumbnail switching via 'scan' button functionality
- ODROID GO ADVANCE: Add DRM HW context driver
- PSL1GHT: Initial port
- QNX: Support analog sticks
- SCANNER: Prevent redundant playlist entries when handling M3U content
- SCANNER/ANDROID: Fix content scanner being unable to identify certain games from CHD images (raw data sector/subcode)
- TVOS: Disable overlays for tvOS, fix app icon
# 1.8.5
- 3DS: Keep the bottom screen hidden on sleep/wakeup. When the 3DS wakes back up after being closed, the bottom screen needs to be reinitialized. Adding the condition here will cause the screen to be turned on or off based on the state of ctr_bottom_screen_enabled, as you'd expect

View File

@ -426,6 +426,8 @@ ifeq ($(HAVE_QT), 1)
ifneq ($(findstring Linux,$(OS)),)
DEF_FLAGS += -fPIC
else ifneq ($(findstring BSD,$(OS)),)
DEF_FLAGS += -fPIC
endif
endif

View File

@ -1133,12 +1133,12 @@ void rcheevos_get_achievement_state(unsigned index, char *buffer, size_t buffer_
if (index < rcheevos_locals.patchdata.core_count)
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_LOCKED_ENTRY;
cheevo = &rcheevos_locals.core[index];
cheevo = rcheevos_locals.core ? &rcheevos_locals.core[index] : NULL;
}
else
{
enum_idx = MENU_ENUM_LABEL_VALUE_CHEEVOS_UNOFFICIAL_ENTRY;
cheevo = &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count];
cheevo = rcheevos_locals.unofficial ? &rcheevos_locals.unofficial[index - rcheevos_locals.patchdata.core_count] : NULL;
}
if (!cheevo || !cheevo->trigger)

View File

@ -248,6 +248,14 @@ const uint8_t* rcheevos_patch_address(unsigned address, int console)
}
}
}
else if (console == RC_CONSOLE_GAMEBOY_ADVANCE)
{
/* The RetroAchievements implementation of memory access for GBA puts the save RAM first,
* so the default looping behavior below is backwards. If the core doesn't expose a
* memory map, say it isn't supported.
*/
pointer = NULL;
}
else
{
unsigned i;

View File

@ -75,6 +75,7 @@
_device = d;
_layer = layer;
#if TARGET_OS_OSX
_layer.framebufferOnly = NO;
_layer.displaySyncEnabled = YES;
#endif
_library = l;
@ -544,13 +545,13 @@
NSUInteger dstStride = _viewport.width * 3;
uint8_t *dst = buffer + (_viewport.height - 1) * dstStride;
for (int y = _viewport.y; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
for (int y = 0; y < _viewport.height; y++, src += srcStride, dst -= dstStride)
{
for (int x = _viewport.x; x < _viewport.width; x++)
for (int x = 0; x < _viewport.width; x++)
{
dst[3 * x + 0] = src[4 * x + 0];
dst[3 * x + 1] = src[4 * x + 1];
dst[3 * x + 2] = src[4 * x + 2];
dst[3 * x + 0] = src[4 * (_viewport.x + x) + 0];
dst[3 * x + 1] = src[4 * (_viewport.x + x) + 1];
dst[3 * x + 2] = src[4 * (_viewport.x + x) + 2];
}
}
@ -642,6 +643,14 @@
if (_blitCommandBuffer)
{
#if TARGET_OS_OSX
if (_captureEnabled)
{
id<MTLBlitCommandEncoder> bce = [_blitCommandBuffer blitCommandEncoder];
[bce synchronizeResource:_backBuffer];
[bce endEncoding];
}
#endif
// pending blits for mipmaps or render passes for slang shaders
[_blitCommandBuffer commit];
[_blitCommandBuffer waitUntilCompleted];

View File

@ -922,7 +922,39 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_SCALE_FACTOR,
"Aplica un valor global a la escala del menú. Sirve para aumentar o reducir el tamaño de la interfaz de usuario."
"Aplica un valor global a la escala del menú. Se puede usar para aumentar o disminuir el tamaño de la interfaz de usuario."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_AUTO,
"Escala automática de los gráficos de Widgets"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_AUTO,
"Cambiar automáticamente el tamaño de las notificaciones, indicadores y controles basados en la escala del menú actual."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_FACTOR,
"Escala de los gráficos de Widgets"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_FACTOR,
"Aplica un valor a la escala de los gráficos de widgets. Solo aplica cuando 'Escala automática de los gráficos de Widgets' esta deactivado. Se puede utilizar para aumentar o disminuir el tamaño de las notificaciones, indicadores y controles independientemente del propio menú."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_FACTOR_FULLSCREEN,
"Escala de los gráficos de Widgets (Pantalla completa)"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_FACTOR_FULLSCREEN,
"Aplica un valor a la escala de los gráficos de widgets en modo de pantalla completa. Solo aplica cuando 'Escala automática de los gráficos de Widgets' esta deactivado. Se puede utilizar para aumentar o disminuir el tamaño de las notificaciones, indicadores y controles independientemente del propio menú."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_WIDGET_SCALE_FACTOR_WINDOWED,
"Escala de los gráficos de Widgets (Ventana)"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_WIDGET_SCALE_FACTOR_WINDOWED,
"Aplica un valor a la escala de los gráficos de widgets en modo ventana. Solo aplica cuando 'Escala automática de los gráficos de Widgets' esta deactivado. Se puede utilizar para aumentar o disminuir el tamaño de las notificaciones, indicadores y controles independientemente del propio menú."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS,
@ -1909,7 +1941,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_TRANSITION_ANIM_NONE,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_MENU_THUMBNAIL_VIEW_PORTRAIT,
@ -1929,7 +1961,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_DISABLED,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_PORTRAIT_LIST_SMALL,
@ -1945,7 +1977,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_DISABLED,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MATERIALUI_THUMBNAIL_VIEW_LANDSCAPE_LIST_SMALL,
@ -2297,11 +2329,11 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_OFF,
"OFF"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ON,
"ON"
"Activado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ONLINE,
@ -3591,7 +3623,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_ASPECT_RATIO_LOCK_NONE,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_ASPECT_RATIO_LOCK_FIT_SCREEN,
@ -4598,6 +4630,10 @@ MSG_HASH(
"Utiliza tablas de clasificación específicas para cada juego.\n"
"Esta opción no surtirá efecto si se ha desactivado el modo Hardcore."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_RICHPRESENCE_ENABLE,
"Envía el estado detallado del juego al sitio web RetroAchievements."
)
MSG_HASH(
MENU_ENUM_SUBLABEL_CHEEVOS_BADGES_ENABLE,
"Muestra insignias en la lista de logros."
@ -5815,11 +5851,11 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_DISABLED,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_ENABLED,
"Activar"
"Activado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_PATH,
@ -7138,6 +7174,22 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_SHOW_LEGACY_THUMBNAIL_UPDATER,
"Permite descargar los paquetes de miniaturas con el sistema antiguo."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_SCROLL_FAST,
"Aceleración de desplazamiento del menú"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MENU_SCROLL_FAST,
"Velocidad máxima del cursor al mantener presionada una dirección para desplazarse."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCROLL_NORMAL,
"Normal"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_SCROLL_FAST,
"Rápido"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MENU_VIEWS_SETTINGS,
"Vistas"
@ -7747,7 +7799,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_PARTICLE_EFFECT_NONE,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_RGUI_PARTICLE_EFFECT_SNOW,
@ -9325,7 +9377,7 @@ MSG_HASH(
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_ENTRY_REMOVE_ENABLE_NONE,
"Desactivar"
"Desactivado"
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_PLAYLIST_SORT_ALPHABETICAL,
@ -10341,6 +10393,14 @@ MSG_HASH(
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_DAT_FILE,
"Selecciona un archivo DAT XML de Logiqx o MAME para nombrar automáticamente los contenidos de arcade escaneados (para MAME, FinalBurn Neo, etc.)."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_DAT_FILE_FILTER,
"Filtro DAT de arcade"
)
MSG_HASH(
MENU_ENUM_SUBLABEL_MANUAL_CONTENT_SCAN_DAT_FILE_FILTER,
"Cuando utilice un archivo DAT arcade, solo agregue contenido a la lista de reproducción si se encuentra una entrada de archivo DAT coincidente."
)
MSG_HASH(
MENU_ENUM_LABEL_VALUE_MANUAL_CONTENT_SCAN_OVERWRITE,
"Sobrescribir lista existente"

View File

@ -171,7 +171,7 @@ retro_perf_tick_t cpu_features_get_perf_counter(void)
tv_sec = (long)((ularge.QuadPart - epoch) / 10000000L);
tv_usec = (long)(system_time.wMilliseconds * 1000);
time_ticks = (1000000 * tv_sec + tv_usec);
#elif defined(__linux__) || defined(__QNX__) || defined(__MACH__)
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(__QNX__) || defined(ANDROID) || defined(__MACH__) || defined(__PSL1GHT__)
struct timespec tv = {0};
if (ra_clock_gettime(CLOCK_MONOTONIC, &tv) == 0)
time_ticks = (retro_perf_tick_t)tv.tv_sec * 1000000000 +

View File

@ -506,18 +506,28 @@ static void threaded_worker(void *userdata)
finished = task->finished;
slock_unlock(property_lock);
slock_lock(running_lock);
task_queue_remove(&tasks_running, task);
slock_unlock(running_lock);
/* Update queue */
if (!finished)
{
/* Re-add task to running queue */
retro_task_threaded_push_running(task);
/* Move the task to the back of the queue */
/* mimics retro_task_threaded_push_running, but also includes a task_queue_remove */
slock_lock(running_lock);
slock_lock(queue_lock);
if (task->next != NULL) /* do nothing if only item in queue */
{
task_queue_remove(&tasks_running, task);
task_queue_put(&tasks_running, task);
}
slock_unlock(queue_lock);
slock_unlock(running_lock);
}
else
{
/* Remove task from running queue */
slock_lock(running_lock);
task_queue_remove(&tasks_running, task);
slock_unlock(running_lock);
/* Add task to finished queue */
slock_lock(finished_lock);
task_queue_put(&tasks_finished, task);

View File

@ -65,22 +65,35 @@
#include "../../wii/libogc/include/ogc/conf.h"
#endif
#define MAX_FB_WIDTH 426
#if defined(GEKKO)
/* When running on the Wii, need to round down the
* frame buffer width value such that the last two
* bits are zero */
#define RGUI_ROUND_FB_WIDTH(width) ((unsigned)(width) & ~3)
#else
/* On all other platforms, just want to round width
* down to the nearest multiple of 2 */
#define RGUI_ROUND_FB_WIDTH(width) ((unsigned)(width) & ~1)
#endif
#define RGUI_MIN_FB_HEIGHT 192
#define RGUI_MIN_FB_WIDTH 256
#define RGUI_MAX_FB_WIDTH 426
#define RGUI_ENTRY_VALUE_MAXLEN 19
#define RGUI_TICKER_SPACER " | "
#define NUM_FONT_GLYPHS_REGULAR 128
#define NUM_FONT_GLYPHS_EXTENDED 256
#define RGUI_NUM_FONT_GLYPHS_REGULAR 128
#define RGUI_NUM_FONT_GLYPHS_EXTENDED 256
#define NUM_PARTICLES 256
#define RGUI_NUM_PARTICLES 256
#ifndef PI
#define PI 3.14159265359f
#endif
#define BATTERY_WARN_THRESHOLD 20
#define RGUI_BATTERY_WARN_THRESHOLD 20
typedef struct
{
@ -572,7 +585,7 @@ typedef struct
gfx_thumbnail_path_data_t *thumbnail_path_data;
} rgui_t;
static bool font_lut[NUM_FONT_GLYPHS_EXTENDED][FONT_WIDTH * FONT_HEIGHT];
static bool font_lut[RGUI_NUM_FONT_GLYPHS_EXTENDED][FONT_WIDTH * FONT_HEIGHT];
/* A 'particle' is just 4 float variables that can
* be used for any purpose - e.g.:
@ -591,7 +604,7 @@ typedef struct
float d;
} rgui_particle_t;
static rgui_particle_t particles[NUM_PARTICLES] = {{ 0.0f }};
static rgui_particle_t particles[RGUI_NUM_PARTICLES] = {{ 0.0f }};
/* Particle effect animations update at a base rate
* of 60Hz (-> 16.666 ms update period) */
@ -1005,8 +1018,8 @@ static void rgui_fill_rect(
unsigned x_end = x + width;
unsigned y_end = y + height;
size_t x_size;
uint16_t scanline_even[MAX_FB_WIDTH]; /* Initial values don't matter here */
uint16_t scanline_odd[MAX_FB_WIDTH];
uint16_t scanline_even[RGUI_MAX_FB_WIDTH]; /* Initial values don't matter here */
uint16_t scanline_odd[RGUI_MAX_FB_WIDTH];
/* Note: unlike rgui_color_rect() and rgui_draw_particle(),
* this function is frequently used to fill large areas.
@ -1255,7 +1268,7 @@ static void rgui_init_particle_effect(rgui_t *rgui)
case RGUI_PARTICLE_EFFECT_SNOW:
case RGUI_PARTICLE_EFFECT_SNOW_ALT:
{
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -1278,9 +1291,9 @@ static void rgui_init_particle_effect(rgui_t *rgui)
8, 8, 8,
9, 9,
10};
unsigned num_drops = (unsigned)(0.85f * ((float)fb_width / (float)MAX_FB_WIDTH) * (float)NUM_PARTICLES);
unsigned num_drops = (unsigned)(0.85f * ((float)fb_width / (float)RGUI_MAX_FB_WIDTH) * (float)RGUI_NUM_PARTICLES);
num_drops = num_drops < NUM_PARTICLES ? num_drops : NUM_PARTICLES;
num_drops = num_drops < RGUI_NUM_PARTICLES ? num_drops : RGUI_NUM_PARTICLES;
for (i = 0; i < num_drops; i++)
{
@ -1302,7 +1315,7 @@ static void rgui_init_particle_effect(rgui_t *rgui)
float max_radius = (float)sqrt((double)((fb_width * fb_width) + (fb_height * fb_height))) / 2.0f;
float one_degree_radians = PI / 360.0f;
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -1319,7 +1332,7 @@ static void rgui_init_particle_effect(rgui_t *rgui)
break;
case RGUI_PARTICLE_EFFECT_STARFIELD:
{
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -1394,7 +1407,7 @@ static void rgui_render_particle_effect(rgui_t *rgui)
unsigned particle_size;
bool on_screen;
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -1452,10 +1465,10 @@ static void rgui_render_particle_effect(rgui_t *rgui)
8, 8, 8,
9, 9,
10};
unsigned num_drops = (unsigned)(0.85f * ((float)fb_width / (float)MAX_FB_WIDTH) * (float)NUM_PARTICLES);
unsigned num_drops = (unsigned)(0.85f * ((float)fb_width / (float)RGUI_MAX_FB_WIDTH) * (float)RGUI_NUM_PARTICLES);
bool on_screen;
num_drops = num_drops < NUM_PARTICLES ? num_drops : NUM_PARTICLES;
num_drops = num_drops < RGUI_NUM_PARTICLES ? num_drops : RGUI_NUM_PARTICLES;
for (i = 0; i < num_drops; i++)
{
@ -1494,7 +1507,7 @@ static void rgui_render_particle_effect(rgui_t *rgui)
float r_speed, theta_speed;
int x, y;
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -1551,7 +1564,7 @@ static void rgui_render_particle_effect(rgui_t *rgui)
/* Based on an example found here:
* https://codepen.io/nodws/pen/pejBNb */
for (i = 0; i < NUM_PARTICLES; i++)
for (i = 0; i < RGUI_NUM_PARTICLES; i++)
{
rgui_particle_t *particle = &particles[i];
@ -2406,7 +2419,7 @@ static void blit_line_regular(unsigned fb_width, int x, int y,
unsigned i, j;
uint8_t symbol = (uint8_t)*message++;
if (symbol >= NUM_FONT_GLYPHS_REGULAR)
if (symbol >= RGUI_NUM_FONT_GLYPHS_REGULAR)
continue;
if (symbol != ' ')
@ -2445,7 +2458,7 @@ static void blit_line_regular_shadow(unsigned fb_width, int x, int y,
unsigned i, j;
uint8_t symbol = (uint8_t)*message++;
if (symbol >= NUM_FONT_GLYPHS_REGULAR)
if (symbol >= RGUI_NUM_FONT_GLYPHS_REGULAR)
continue;
if (symbol != ' ')
@ -2500,7 +2513,7 @@ static void blit_line_extended(unsigned fb_width, int x, int y,
if (symbol == 338) /* Latin capital ligature oe */
symbol = 140;
if (symbol >= NUM_FONT_GLYPHS_EXTENDED)
if (symbol >= RGUI_NUM_FONT_GLYPHS_EXTENDED)
continue;
for (j = 0; j < FONT_HEIGHT; j++)
@ -2552,7 +2565,7 @@ static void blit_line_extended_shadow(unsigned fb_width, int x, int y,
if (symbol == 338) /* Latin capital ligature oe */
symbol = 140;
if (symbol >= NUM_FONT_GLYPHS_EXTENDED)
if (symbol >= RGUI_NUM_FONT_GLYPHS_EXTENDED)
continue;
for (j = 0; j < FONT_HEIGHT; j++)
@ -2717,7 +2730,7 @@ static void rgui_init_font_lut(void)
unsigned symbol_index, i, j;
/* Loop over all possible characters */
for (symbol_index = 0; symbol_index < NUM_FONT_GLYPHS_EXTENDED; symbol_index++)
for (symbol_index = 0; symbol_index < RGUI_NUM_FONT_GLYPHS_EXTENDED; symbol_index++)
{
for (j = 0; j < FONT_HEIGHT; j++)
{
@ -3525,7 +3538,7 @@ static void rgui_render(void *data,
{
unsigned powerstate_x;
enum rgui_symbol_type powerstate_symbol;
uint16_t powerstate_color = (powerstate.percent > BATTERY_WARN_THRESHOLD || powerstate.charging)
uint16_t powerstate_color = (powerstate.percent > RGUI_BATTERY_WARN_THRESHOLD || powerstate.charging)
? rgui->colors.title_color
: rgui->colors.hover_color;
@ -4108,9 +4121,21 @@ static void rgui_update_menu_viewport(rgui_t *rgui)
static bool rgui_set_aspect_ratio(rgui_t *rgui, bool delay_update)
{
unsigned base_term_width;
settings_t *settings = config_get_ptr();
unsigned rgui_aspect_ratio = settings->uints.menu_rgui_aspect_ratio;
unsigned aspect_ratio_lock = settings->uints.menu_rgui_aspect_ratio_lock;
unsigned mini_thumbnail_term_width;
#if defined(GEKKO)
size_t fb_pitch;
unsigned fb_width, fb_height;
/* Note: Maximum Wii frame buffer width is 424, not
* the usual 426, since the last two bits of the
* width value must be zero... */
unsigned max_frame_buf_width = 424;
#else
struct video_viewport vp;
unsigned max_frame_buf_width = RGUI_MAX_FB_WIDTH;
#endif
settings_t *settings = config_get_ptr();
unsigned rgui_aspect_ratio = settings->uints.menu_rgui_aspect_ratio;
unsigned aspect_ratio_lock = settings->uints.menu_rgui_aspect_ratio_lock;
rgui_framebuffer_free();
rgui_background_free();
@ -4121,102 +4146,140 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui, bool delay_update)
/* Cache new aspect ratio */
rgui->menu_aspect_ratio = rgui_aspect_ratio;
/* Set frame buffer dimensions: */
/* Frame buffer height */
#if defined(GEKKO)
{
size_t fb_pitch;
unsigned fb_width, fb_height;
gfx_display_get_fb_size(&fb_width, &fb_height, &fb_pitch);
/* Set frame buffer dimensions */
rgui_frame_buf.height = fb_height;
switch (rgui->menu_aspect_ratio)
{
/* Note: Maximum Wii framebuffer width is 424, not
* the usual 426, since the last two bits of the
* width value must be zero... */
case RGUI_ASPECT_RATIO_16_9:
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = 424;
else
rgui_frame_buf.width = (unsigned)
((16.0f / 9.0f) * (float)rgui_frame_buf.height) & ~3;
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_9_CENTRE:
if (rgui_frame_buf.height == 240)
{
rgui_frame_buf.width = 424;
base_term_width = 320;
}
else
{
rgui_frame_buf.width = (unsigned)
((16.0f / 9.0f) * (float)rgui_frame_buf.height) & ~3;
base_term_width = (unsigned)
(( 4.0f / 3.0f) * (float)rgui_frame_buf.height) & ~3;
}
break;
case RGUI_ASPECT_RATIO_16_10:
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = 384;
else
rgui_frame_buf.width = (unsigned)
((16.0f / 10.0f) * (float)rgui_frame_buf.height) & ~3;
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_10_CENTRE:
if (rgui_frame_buf.height == 240)
{
rgui_frame_buf.width = 384;
base_term_width = 320;
}
else
{
rgui_frame_buf.width = (unsigned)
((16.0f / 10.0f) * (float)rgui_frame_buf.height) & ~3;
base_term_width = (unsigned)
(( 4.0f / 3.0f) * (float)rgui_frame_buf.height) & ~3;
}
break;
default:
/* 4:3 */
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = 320;
else
rgui_frame_buf.width = (unsigned)
(( 4.0f / 3.0f) * (float)rgui_frame_buf.height) & ~3;
base_term_width = rgui_frame_buf.width;
break;
}
}
/* Since Wii graphics driver can change frame buffer
* dimensions at will, have to read currently set
* values */
gfx_display_get_fb_size(&fb_width, &fb_height, &fb_pitch);
rgui_frame_buf.height = fb_height;
#else
/* Set frame buffer dimensions */
/* If window height is less than RGUI default
* height of 240, allow the frame buffer to
* 'shrink' to a minimum height of 192 */
rgui_frame_buf.height = 240;
video_driver_get_viewport_info(&vp);
if (vp.full_height < rgui_frame_buf.height)
rgui_frame_buf.height = (vp.full_height > RGUI_MIN_FB_HEIGHT) ?
vp.full_height : RGUI_MIN_FB_HEIGHT;
#endif
/* Frame buffer width */
switch (rgui->menu_aspect_ratio)
{
case RGUI_ASPECT_RATIO_16_9:
rgui_frame_buf.width = 426;
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = max_frame_buf_width;
else
rgui_frame_buf.width = RGUI_ROUND_FB_WIDTH(
(16.0f / 9.0f) * (float)rgui_frame_buf.height);
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_9_CENTRE:
rgui_frame_buf.width = 426;
base_term_width = 320;
if (rgui_frame_buf.height == 240)
{
rgui_frame_buf.width = max_frame_buf_width;
base_term_width = 320;
}
else
{
rgui_frame_buf.width = RGUI_ROUND_FB_WIDTH(
(16.0f / 9.0f) * (float)rgui_frame_buf.height);
base_term_width = RGUI_ROUND_FB_WIDTH(
( 4.0f / 3.0f) * (float)rgui_frame_buf.height);
}
break;
case RGUI_ASPECT_RATIO_16_10:
rgui_frame_buf.width = 384;
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = 384;
else
rgui_frame_buf.width = RGUI_ROUND_FB_WIDTH(
(16.0f / 10.0f) * (float)rgui_frame_buf.height);
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_10_CENTRE:
rgui_frame_buf.width = 384;
base_term_width = 320;
if (rgui_frame_buf.height == 240)
{
rgui_frame_buf.width = 384;
base_term_width = 320;
}
else
{
rgui_frame_buf.width = RGUI_ROUND_FB_WIDTH(
(16.0f / 10.0f) * (float)rgui_frame_buf.height);
base_term_width = RGUI_ROUND_FB_WIDTH(
( 4.0f / 3.0f) * (float)rgui_frame_buf.height);
}
break;
default:
/* 4:3 */
rgui_frame_buf.width = 320;
if (rgui_frame_buf.height == 240)
rgui_frame_buf.width = 320;
else
rgui_frame_buf.width = RGUI_ROUND_FB_WIDTH(
( 4.0f / 3.0f) * (float)rgui_frame_buf.height);
base_term_width = rgui_frame_buf.width;
break;
}
/* Ensure frame buffer/terminal width is sane
* - Must be less than max_frame_buf_width
* (note that this is a redundant safety
* check - it can never actually happen...)
* - On platforms other than the Wii, must
* be less than window width but greater than
* defined minimum width */
rgui_frame_buf.width = (rgui_frame_buf.width > max_frame_buf_width) ?
max_frame_buf_width : rgui_frame_buf.width;
base_term_width = (base_term_width > rgui_frame_buf.width) ?
rgui_frame_buf.width : base_term_width;
#if !defined(GEKKO)
if (vp.full_width < rgui_frame_buf.width)
{
rgui_frame_buf.width = (vp.full_width > RGUI_MIN_FB_WIDTH) ?
RGUI_ROUND_FB_WIDTH(vp.full_width) : RGUI_MIN_FB_WIDTH;
/* An annoyance: have to rescale the frame buffer
* height and terminal width to maintain the correct
* aspect ratio... */
switch (rgui->menu_aspect_ratio)
{
case RGUI_ASPECT_RATIO_16_9:
rgui_frame_buf.height = (unsigned)(
( 9.0f / 16.0f) * (float)rgui_frame_buf.width);
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_9_CENTRE:
rgui_frame_buf.height = (unsigned)(
( 9.0f / 16.0f) * (float)rgui_frame_buf.width);
base_term_width = RGUI_ROUND_FB_WIDTH(
( 4.0f / 3.0f) * (float)rgui_frame_buf.height);
base_term_width = (base_term_width < RGUI_MIN_FB_WIDTH) ?
RGUI_MIN_FB_WIDTH : base_term_width;
break;
case RGUI_ASPECT_RATIO_16_10:
rgui_frame_buf.height = (unsigned)(
(10.0f / 16.0f) * (float)rgui_frame_buf.width);
base_term_width = rgui_frame_buf.width;
break;
case RGUI_ASPECT_RATIO_16_10_CENTRE:
rgui_frame_buf.height = (unsigned)(
(10.0f / 16.0f) * (float)rgui_frame_buf.width);
base_term_width = RGUI_ROUND_FB_WIDTH(
( 4.0f / 3.0f) * (float)rgui_frame_buf.height);
base_term_width = (base_term_width < RGUI_MIN_FB_WIDTH) ?
RGUI_MIN_FB_WIDTH : base_term_width;
break;
default:
/* 4:3 */
rgui_frame_buf.height = (unsigned)(
( 3.0f / 4.0f) * (float)rgui_frame_buf.width);
base_term_width = rgui_frame_buf.width;
break;
}
}
#endif
/* Allocate frame buffer */
@ -4260,7 +4323,9 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui, bool delay_update)
return false;
/* Allocate mini thumbnail buffers */
rgui->mini_thumbnail_max_width = ((rgui_term_layout.width - 4) > 19 ? 19 : (rgui_term_layout.width - 4)) * FONT_WIDTH_STRIDE;
mini_thumbnail_term_width = (unsigned)((float)rgui_term_layout.width * (2.0f / 5.0f));
mini_thumbnail_term_width = mini_thumbnail_term_width > 19 ? 19 : mini_thumbnail_term_width;
rgui->mini_thumbnail_max_width = mini_thumbnail_term_width * FONT_WIDTH_STRIDE;
rgui->mini_thumbnail_max_height = (unsigned)((rgui_term_layout.height * FONT_HEIGHT_STRIDE) * 0.5f) - 2;
mini_thumbnail.max_width = rgui->mini_thumbnail_max_width;
@ -4286,7 +4351,8 @@ static bool rgui_set_aspect_ratio(rgui_t *rgui, bool delay_update)
/* If aspect ratio lock is enabled, notify
* video driver of change */
if (aspect_ratio_lock != RGUI_ASPECT_RATIO_LOCK_NONE)
if ((aspect_ratio_lock != RGUI_ASPECT_RATIO_LOCK_NONE) &&
!rgui->ignore_resize_events)
{
rgui_update_menu_viewport(rgui);
rgui_set_video_config(rgui, &rgui->menu_video_settings, delay_update);
@ -4360,6 +4426,12 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
/* Cache initial video settings */
rgui_get_video_config(&rgui->content_video_settings);
/* Get initial 'window' dimensions */
video_driver_get_viewport_info(&vp);
rgui->window_width = vp.full_width;
rgui->window_height = vp.full_height;
rgui->ignore_resize_events = false;
/* Set aspect ratio
* - Allocates frame buffer
* - Configures variable 'menu display' settings */
@ -4391,12 +4463,6 @@ static void *rgui_init(void **userdata, bool video_is_threaded)
rgui->last_width = rgui_frame_buf.width;
rgui->last_height = rgui_frame_buf.height;
/* Get initial 'window' dimensions */
video_driver_get_viewport_info(&vp);
rgui->window_width = vp.full_width;
rgui->window_height = vp.full_height;
rgui->ignore_resize_events = false;
/* Initialise particle effect, if required */
if (rgui->particle_effect != RGUI_PARTICLE_EFFECT_NONE)
rgui_init_particle_effect(rgui);
@ -4913,10 +4979,19 @@ static void rgui_populate_entries(void *data,
/* If aspect ratio lock is enabled, must restore
* content video settings when accessing the video
* settings menu... */
* scaling settings menu... */
if (aspect_ratio_lock != RGUI_ASPECT_RATIO_LOCK_NONE)
{
#if defined(GEKKO)
/* On the Wii, have to restore content video settings
* at the top level video menu, otherwise changing
* resolutions is cumbersome (if menu aspect ratio
* is locked while this occurs, menu dimensions
* go out of sync...) */
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SETTINGS_LIST)))
#else
if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_VIDEO_SCALING_SETTINGS_LIST)))
#endif
{
/* Make sure that any changes made while accessing
* the video settings menu are preserved */
@ -5120,14 +5195,14 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
/* > Check for changes in aspect ratio */
if (settings->uints.menu_rgui_aspect_ratio != rgui->menu_aspect_ratio)
{
rgui_set_aspect_ratio(rgui, true);
/* If user changes aspect ratio directly after opening
* the video settings menu, then all bets are off - we
* can no longer guarantee that changes to aspect ratio
* the video scaling settings menu, then all bets are off
* - we can no longer guarantee that changes to aspect ratio
* and custom viewport settings will be preserved. So it
* no longer makes sense to ignore resize events */
rgui->ignore_resize_events = false;
rgui_set_aspect_ratio(rgui, true);
}
/* > Check for changes in aspect ratio lock setting */
@ -5139,21 +5214,56 @@ static void rgui_frame(void *data, video_frame_info_t *video_info)
rgui_set_video_config(rgui, &rgui->content_video_settings, true);
else
{
/* As with changes in aspect ratio, if we reach this point
* after visiting the video scaling settings menu, resize
* events should be monitored again */
rgui->ignore_resize_events = false;
rgui_update_menu_viewport(rgui);
rgui_set_video_config(rgui, &rgui->menu_video_settings, true);
/* As with changes in aspect ratio, if we reach this point
* after visiting the video settings menu, resize events
* should be monitored again */
rgui->ignore_resize_events = false;
}
}
/* > If aspect ratio is locked, have to rescale if window
* dimensions change */
/* > Check for changes in window (display) dimensions */
if ((rgui->window_width != video_width) ||
(rgui->window_height != video_height))
{
#if !defined(GEKKO)
/* If window width or height are less than the
* RGUI default size of (320-426)x240, must enable
* dynamic menu 'downscaling'.
* All texture buffers must be regenerated in this
* case - easiest way is to just call
* rgui_set_aspect_ratio()
* > rgui_set_aspect_ratio() must also be called
* when transitioning from a 'downscaled' size
* back the default */
unsigned default_fb_width;
switch (rgui->menu_aspect_ratio)
{
case RGUI_ASPECT_RATIO_16_9:
case RGUI_ASPECT_RATIO_16_9_CENTRE:
default_fb_width = RGUI_MAX_FB_WIDTH;
break;
case RGUI_ASPECT_RATIO_16_10:
case RGUI_ASPECT_RATIO_16_10_CENTRE:
default_fb_width = 384;
break;
default:
/* 4:3 */
default_fb_width = 320;
break;
}
if ((video_width < default_fb_width) ||
(rgui->window_width < default_fb_width) ||
(video_height < 240) ||
(rgui->window_height < 240))
rgui_set_aspect_ratio(rgui, true);
#endif
/* If aspect ratio is locked, have to update viewport */
if ((aspect_ratio_lock != RGUI_ASPECT_RATIO_LOCK_NONE) &&
!rgui->ignore_resize_events)
{
@ -5229,8 +5339,9 @@ static void rgui_toggle(void *userdata, bool menu_on)
if (rgui_is_video_config_equal(&current_video_settings, &rgui->menu_video_settings))
rgui_set_video_config(rgui, &rgui->content_video_settings, false);
/* Any modified video settings have now been registered,
* so it is again 'safe' to respond to window resize events */
/* Any modified video scaling settings have now been
* registered, so it is again 'safe' to respond to window
* resize events */
rgui->ignore_resize_events = false;
}
}

View File

@ -451,12 +451,12 @@
ORGANIZATIONNAME = RetroArch;
TargetAttributes = {
9204BE091D319EF300BD49DB = {
DevelopmentTeam = BJ7B9HU3GU;
DevelopmentTeam = R72X3BF4KE;
DevelopmentTeamName = RetroArch;
};
926C77D621FD1E6500103EDE = {
CreatedOnToolsVersion = 10.1;
DevelopmentTeam = BJ7B9HU3GU;
DevelopmentTeam = R72X3BF4KE;
ProvisioningStyle = Automatic;
};
};
@ -615,7 +615,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_RESOURCE_RULES_PATH = "$(SDKROOT)/ResourceRules.plist";
CURRENT_PROJECT_VERSION = 1.8.5;
DEVELOPMENT_TEAM = BJ7B9HU3GU;
DEVELOPMENT_TEAM = R72X3BF4KE;
ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
@ -710,7 +710,7 @@
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_RESOURCE_RULES_PATH = "$(SDKROOT)/ResourceRules.plist";
CURRENT_PROJECT_VERSION = 1.8.5;
DEVELOPMENT_TEAM = BJ7B9HU3GU;
DEVELOPMENT_TEAM = R72X3BF4KE;
ENABLE_BITCODE = NO;
GCC_PRECOMPILE_PREFIX_HEADER = NO;
GCC_PREFIX_HEADER = "";
@ -800,7 +800,7 @@
926C77E721FD1E6700103EDE /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -830,7 +830,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.8.5;
DEBUG_INFORMATION_FORMAT = dwarf;
DEVELOPMENT_TEAM = BJ7B9HU3GU;
DEVELOPMENT_TEAM = R72X3BF4KE;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -891,7 +891,6 @@
"-DRARCH_MOBILE",
"-DHAVE_COREAUDIO",
"-DHAVE_DYNAMIC",
"-DHAVE_OVERLAY",
"-DHAVE_VIDEO_LAYOUT",
"-DHAVE_ZLIB",
"-DHAVE_RPNG",
@ -923,7 +922,7 @@
926C77E821FD1E6700103EDE /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
ASSETCATALOG_COMPILER_APPICON_NAME = "App Icon & Top Shelf Image";
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
@ -953,7 +952,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1.8.5;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = BJ7B9HU3GU;
DEVELOPMENT_TEAM = R72X3BF4KE;
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
@ -1015,7 +1014,6 @@
"-DRARCH_MOBILE",
"-DHAVE_COREAUDIO",
"-DHAVE_DYNAMIC",
"-DHAVE_OVERLAY",
"-DHAVE_VIDEO_LAYOUT",
"-DHAVE_ZLIB",
"-DHAVE_RPNG",

View File

@ -1,17 +1,18 @@
{
"images" : [
{
"idiom" : "tv",
"filename" : "retroarch_logo_back.png",
"idiom" : "tv",
"scale" : "1x"
},
{
"filename" : "retroarch_logo_back-1.png",
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -1,17 +1,18 @@
{
"images" : [
{
"idiom" : "tv",
"filename" : "retroarch_logo_front.png",
"idiom" : "tv",
"scale" : "1x"
},
{
"filename" : "retroarch_logo_front-1.png",
"idiom" : "tv",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View File

@ -1114,8 +1114,14 @@ void playlist_write_runtime_file(playlist_t *playlist)
STRLEN_CONST("core_path"), JSON_UTF8);
JSON_Writer_WriteColon(context.writer);
JSON_Writer_WriteSpace(context.writer, 1);
JSON_Writer_WriteString(context.writer, playlist->entries[i].core_path,
strlen(playlist->entries[i].core_path), JSON_UTF8);
JSON_Writer_WriteString(context.writer,
playlist->entries[i].core_path
? playlist->entries[i].core_path
: "",
playlist->entries[i].core_path
? strlen(playlist->entries[i].core_path)
: 0,
JSON_UTF8);
JSON_Writer_WriteComma(context.writer);
JSON_Writer_WriteNewLine(context.writer);
@ -1461,8 +1467,13 @@ void playlist_write_file(playlist_t *playlist, bool use_old_format)
JSON_Writer_WriteColon(context.writer);
JSON_Writer_WriteSpace(context.writer, 1);
JSON_Writer_WriteString(context.writer,
playlist->entries[i].core_path,
strlen(playlist->entries[i].core_path), JSON_UTF8);
playlist->entries[i].core_path
? playlist->entries[i].core_path
: "",
playlist->entries[i].core_path
? strlen(playlist->entries[i].core_path)
: 0,
JSON_UTF8);
JSON_Writer_WriteComma(context.writer);
JSON_Writer_WriteNewLine(context.writer);
@ -1472,8 +1483,13 @@ void playlist_write_file(playlist_t *playlist, bool use_old_format)
JSON_Writer_WriteColon(context.writer);
JSON_Writer_WriteSpace(context.writer, 1);
JSON_Writer_WriteString(context.writer,
playlist->entries[i].core_name,
strlen(playlist->entries[i].core_name), JSON_UTF8);
playlist->entries[i].core_name
? playlist->entries[i].core_name
: "",
playlist->entries[i].core_name
? strlen(playlist->entries[i].core_name)
: 0,
JSON_UTF8);
JSON_Writer_WriteComma(context.writer);
JSON_Writer_WriteNewLine(context.writer);