Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 0 additions & 96 deletions 10bpc-gl.diff

This file was deleted.

27 changes: 5 additions & 22 deletions audio/drivers/coreaudio_mic_ios.m
Original file line number Diff line number Diff line change
Expand Up @@ -87,15 +87,19 @@ static OSStatus coreaudio_input_callback(
if (FIFO_WRITE_AVAIL(microphone->sample_buffer) >= actual_bytes)
fifo_write(microphone->sample_buffer,
bufferList.mBuffers[0].mData, actual_bytes);
#ifdef DEBUG
else if (microphone->drop_count++ % 1000 == 0)
RARCH_WARN("[CoreAudio] FIFO full, dropping %u bytes.\n",
(unsigned)actual_bytes);
#endif
scond_signal(microphone->fifo_cond);
slock_unlock(microphone->fifo_lock);
}
}
#ifdef DEBUG
else if (status != noErr)
RARCH_ERR("[CoreAudio] Failed to render audio: %d.\n", (int)status);
#endif

return noErr;
}
Expand All @@ -105,10 +109,7 @@ static OSStatus coreaudio_input_callback(
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)calloc(1, sizeof(*microphone));
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to allocate microphone driver.\n");
return NULL;
}

microphone->sample_rate = 0;
microphone->nonblock = false;
Expand Down Expand Up @@ -150,14 +151,11 @@ static void coreaudio_microphone_free(void *driver_context)
static int coreaudio_microphone_read(void *driver_context,
void *microphone_context, void *buf, size_t size)
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
size_t avail, read_amt;
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;

if (!microphone || !buf)
{
RARCH_ERR("[CoreAudio] Invalid parameters in read.\n");
return -1;
}

slock_lock(microphone->fifo_lock);

Expand Down Expand Up @@ -219,10 +217,7 @@ static void coreaudio_microphone_set_format(coreaudio_microphone_t *microphone,
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)driver_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Invalid driver context.\n");
return NULL;
}

/* Guard against calling open_mic twice without close_mic */
if (microphone->audio_unit)
Expand Down Expand Up @@ -300,10 +295,7 @@ static void coreaudio_microphone_set_format(coreaudio_microphone_t *microphone,
}
microphone->sample_buffer = fifo_new(fifoBufferSize);
if (!microphone->sample_buffer)
{
RARCH_ERR("[CoreAudio] Failed to create sample buffer.\n");
return NULL;
}
}

/* Initialize audio unit */
Expand Down Expand Up @@ -436,10 +428,7 @@ static void coreaudio_microphone_close_mic(void *driver_context, void *microphon
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to close microphone.\n");
return;
}

if (microphone->is_running)
{
Expand Down Expand Up @@ -472,10 +461,7 @@ static bool coreaudio_microphone_start_mic(void *driver_context, void *microphon
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to start microphone.\n");
return false;
}

if (microphone->sample_buffer)
{
Expand All @@ -501,10 +487,7 @@ static bool coreaudio_microphone_stop_mic(void *driver_context, void *microphone
{
coreaudio_microphone_t *microphone = (coreaudio_microphone_t*)microphone_context;
if (!microphone)
{
RARCH_ERR("[CoreAudio] Failed to stop microphone.\n");
return false;
}

if (microphone->is_running)
{
Expand Down
23 changes: 4 additions & 19 deletions audio/drivers/coreaudio_mic_macos.m
Original file line number Diff line number Diff line change
Expand Up @@ -228,16 +228,20 @@ static OSStatus coreaudio_macos_input_callback(void *inRefCon,
if (FIFO_WRITE_AVAIL(mic->fifo) >= actual_bytes)
fifo_write(mic->fifo, buffer_list.mBuffers[0].mData,
actual_bytes);
#ifdef DEBUG
else if (mic->drop_count++ % 1000 == 0)
RARCH_WARN("[CoreAudio macOS Mic] FIFO full, dropping %u bytes\n",
(unsigned)actual_bytes);
#endif
scond_signal(mic->fifo_cond);
slock_unlock(mic->fifo_lock);
}
}
#ifdef DEBUG
else if (status != noErr)
RARCH_ERR("[CoreAudio macOS Mic] Failed to render audio: %d\n",
(int)status);
#endif

/* Always return noErr — returning errors may cause CoreAudio to
* stop invoking the callback entirely. */
Expand Down Expand Up @@ -335,10 +339,7 @@ void coreaudio_macos_microphone_free(void *data)
{
struct string_list *list = string_list_new();
if (!list)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to create string_list.\n");
return NULL;
}

AudioObjectPropertyAddress prop_addr_devices = {
kAudioHardwarePropertyDevices,
Expand All @@ -350,7 +351,6 @@ void coreaudio_macos_microphone_free(void *data)
OSStatus status = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &prop_addr_devices, 0, NULL, &propsize);
if (status != noErr || propsize == 0)
{
RARCH_ERR("[CoreAudio macOS Mic] Error getting size of device list: %d\n", (int)status);
string_list_free(list);
return NULL;
}
Expand All @@ -359,15 +359,13 @@ void coreaudio_macos_microphone_free(void *data)
AudioDeviceID *all_devices = (AudioDeviceID *)malloc(propsize);
if (!all_devices)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to allocate memory for device list.\n");
string_list_free(list);
return NULL;
}

status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &prop_addr_devices, 0, NULL, &propsize, all_devices);
if (status != noErr)
{
RARCH_ERR("[CoreAudio macOS Mic] Error getting device list: %d\n", (int)status);
free(all_devices);
string_list_free(list);
return NULL;
Expand Down Expand Up @@ -484,13 +482,9 @@ static void coreaudio_macos_microphone_device_list_free(const void *data, struct
/* For this driver, init() returns a placeholder (void*)1, so we don't use 'data' to allocate the mic instance. */
/* The actual mic instance (coreaudio_macos_microphone_t) is allocated below. */


coreaudio_macos_microphone_t *mic = (coreaudio_macos_microphone_t *)calloc(1, sizeof(coreaudio_macos_microphone_t));
if (!mic)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to allocate memory for microphone context.\n");
return NULL;
}

atomic_init(&mic->is_running, false);
atomic_init(&mic->is_initialized, false);
Expand Down Expand Up @@ -684,10 +678,7 @@ static void coreaudio_macos_microphone_device_list_free(const void *data, struct
mic->callback_buffer_size = max_frames * mic->format.mBytesPerFrame;
mic->callback_buffer = calloc(1, mic->callback_buffer_size);
if (!mic->callback_buffer)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to allocate callback buffer\n");
goto error;
}
}

/* Initialize FIFO — size based on latency parameter */
Expand All @@ -699,10 +690,7 @@ static void coreaudio_macos_microphone_device_list_free(const void *data, struct
* mic->format.mBytesPerFrame / 10); /* 100ms fallback */
mic->fifo = fifo_new(fifo_size);
if (!mic->fifo)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to allocate FIFO buffer\n");
goto error;
}
fifo_clear(mic->fifo);
RARCH_LOG("[CoreAudio macOS Mic] FIFO buffer: %u bytes (%.0f ms)\n",
(unsigned)fifo_size,
Expand Down Expand Up @@ -932,10 +920,7 @@ static AudioDeviceID get_macos_device_id_for_uid_or_name(const char *uid_or_name
UInt32 num_devices = propsize / sizeof(AudioDeviceID);
AudioDeviceID *all_devices = (AudioDeviceID *)malloc(propsize);
if (!all_devices)
{
RARCH_ERR("[CoreAudio macOS Mic] Failed to allocate memory for device list for UID lookup.\n");
return kAudioObjectUnknown;
}

status = AudioObjectGetPropertyData(kAudioObjectSystemObject, &prop_addr_devices, 0, NULL, &propsize, all_devices);
if (status != noErr)
Expand Down
9 changes: 9 additions & 0 deletions configuration.c
Original file line number Diff line number Diff line change
Expand Up @@ -3599,6 +3599,15 @@ static bool check_menu_driver_compatibility(settings_t *settings)
return (memcmp(video_driver, "metal", 5) == 0 && video_driver[5] == '\0');
case 'r':
return (memcmp(video_driver, "rsx", 3) == 0 && video_driver[3] == '\0');
case 's':
/* sdl2 supports the full menu set (XMB/Ozone/MaterialUI/RGUI)
* via gfx_display_ctx_sdl2 + sdl2_raster_font, gated on
* SDL_RenderGeometry (>= 2.0.18). On older SDL builds the
* driver self-disables the gfx_display backend, and only
* RGUI's bitmap path is functional - which already returned
* true via the rgui early-out above, so allowing sdl2 here
* is safe regardless of the runtime SDL version. */
return (memcmp(video_driver, "sdl2", 4) == 0 && video_driver[4] == '\0');
case 'c':
return (memcmp(video_driver, "ctr", 3) == 0 && video_driver[3] == '\0');
default:
Expand Down
25 changes: 25 additions & 0 deletions gfx/common/sdl2_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,31 @@ typedef struct _sdl2_video
uint8_t font_b;

uint8_t flags;

#ifdef HAVE_OVERLAY
/* On-screen input overlay state. Each entry holds an SDL_Texture
* uploaded as ARGB8888 (matching the supports_rgba=false byte
* layout RetroArch hands us in load()) and rendered via
* SDL_RenderCopy with per-texture alpha modulation each frame.
*
* vert_coords / tex_coords are 4-float (x, y, w, h) tuples in
* 0..1 normalised space. vertex_geom flips y to (1.0f - y) and
* negates h, matching d3d8 / gl / d3d9_common; vertex_geom
* comments document the rationale - we undo the flip at render
* time in sdl2_overlays_render. */
struct sdl2_overlay
{
SDL_Texture *tex;
unsigned tex_w;
unsigned tex_h;
float tex_coords[4];
float vert_coords[4];
float alpha_mod;
bool fullscreen;
} *overlays;
unsigned overlays_size;
bool overlays_enabled;
#endif
} sdl2_video_t;

void sdl2_set_handles(void *data, enum rarch_display_type
Expand Down
8 changes: 3 additions & 5 deletions gfx/drivers/gdi_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2612,11 +2612,9 @@ static bool gdi_frame(void *data, const void *frame,
unsigned surface_width;
unsigned surface_height;

/* GDI does not implement these effects. XMB still calls into the
* shader-pipeline draw path, so we force-disable the bits that
* would route through it; this is preserved verbatim from the
* legacy driver. */
video_info->xmb_shadows_enable = false;
/* GDI has no programmable shader pipeline, so the animated XMB
* backgrounds (Ribbon / Snow / Bokeh / etc.) can't run — force
* that off so XMB falls back to the static gradient. */
video_info->menu_shader_pipeline = 0;

if (!frame || !frame_width || !frame_height)
Expand Down
5 changes: 3 additions & 2 deletions gfx/drivers/gl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -1641,8 +1641,9 @@ static bool gl1_frame(void *data, const void *frame,
&video_info->osd_stat_params;
bool overlay_behind_menu = video_info->overlay_behind_menu;

/* FIXME: Force these settings off as they interfere with the rendering */
video_info->xmb_shadows_enable = false;
/* gl1 fixed-function has no programmable pipeline, so the
* animated XMB backgrounds (Ribbon / Snow / Bokeh / etc.) can't
* run -- force that off so XMB falls back to the static gradient. */
video_info->menu_shader_pipeline = 0;

if (gl1->flags & GL1_FLAG_SHOULD_RESIZE)
Expand Down
Loading
Loading