diff --git a/audio/drivers/switch_audio.c b/audio/drivers/switch_audio.c index 38caa1d849..4b9a20259c 100644 --- a/audio/drivers/switch_audio.c +++ b/audio/drivers/switch_audio.c @@ -32,7 +32,9 @@ static const int sample_rate = 48000; static const int max_num_samples = sample_rate; static const int num_channels = 2; +#ifndef HAVE_LIBNX static const size_t sample_buffer_size = ((max_num_samples * num_channels * sizeof(uint16_t)) + 0xfff) & ~0xfff; +#endif typedef struct { @@ -98,7 +100,9 @@ static ssize_t switch_audio_write(void *data, const void *buf, size_t size) while (!swa->current_buffer) { +#ifndef HAVE_LIBNX uint32_t handle_idx = 0; +#endif num = 0; #ifdef HAVE_LIBNX @@ -236,7 +240,9 @@ static void *switch_audio_init(const char *device, { unsigned i; char names[8][0x20]; +#ifndef HAVE_LIBNX uint32_t num_names = 0; +#endif switch_audio_t *swa = (switch_audio_t*) calloc(1, sizeof(*swa)); if (!swa) @@ -333,8 +339,9 @@ fail_audio_output: /* TODO/FIXME - fix libnx codepath */ #ifndef HAVE_LIBNX audio_ipc_output_close(&swa->output); -#endif fail_audio_ipc: +#endif + /* TODO/FIXME - fix libnx codepath */ #ifndef HAVE_LIBNX audio_ipc_finalize(); diff --git a/audio/drivers/switch_thread_audio.c b/audio/drivers/switch_thread_audio.c index f7848bf9be..ef1d10864b 100644 --- a/audio/drivers/switch_thread_audio.c +++ b/audio/drivers/switch_thread_audio.c @@ -39,7 +39,6 @@ static const size_t thread_stack_size = 1024 * 8; static const int thread_preferred_cpu = 2; static const int channel_count = 2; static const size_t sample_size = sizeof(uint16_t); -static const size_t frame_size = channel_count * sample_size; #define AUDIO_BUFFER_COUNT 2 @@ -144,8 +143,10 @@ static void *switch_thread_audio_init(const char *device, unsigned rate, unsigne Result rc; unsigned i; uint32_t prio; +#ifndef HAVE_LIBNX char names[8][0x20]; uint32_t num_names = 0; +#endif switch_thread_audio_t *swa = (switch_thread_audio_t *)calloc(1, sizeof(*swa)); if (!swa) diff --git a/disk_control_interface.c b/disk_control_interface.c index 98ef958a14..ef361bdbfe 100644 --- a/disk_control_interface.c +++ b/disk_control_interface.c @@ -236,7 +236,6 @@ void disk_control_get_image_label( error: label[0] = '\0'; - return; } /***********/ diff --git a/frontend/drivers/platform_switch.c b/frontend/drivers/platform_switch.c index b38372ad36..d2affe70d0 100644 --- a/frontend/drivers/platform_switch.c +++ b/frontend/drivers/platform_switch.c @@ -94,7 +94,6 @@ void libnx_apply_overclock(void) static void on_applet_hook(AppletHookType hook, void *param) { - u32 performance_mode; AppletFocusState focus_state; /* Exit request */ @@ -131,9 +130,11 @@ static void on_applet_hook(AppletHookType hook, void *param) /* Performance mode */ case AppletHookType_OnPerformanceMode: - /* 0 == Handheld, 1 == Docked - * Since CPU doesn't change we just re-apply */ - performance_mode = appletGetPerformanceMode(); + { + /* 0 == Handheld, 1 == Docked + * Since CPU doesn't change we just re-apply */ + u32 performance_mode = appletGetPerformanceMode(); + } libnx_apply_overclock(); break; @@ -318,17 +319,20 @@ static void frontend_switch_deinit(void *data) static void frontend_switch_exec(const char *path, bool should_load_game) { char game_path[PATH_MAX-4]; +#ifndef IS_SALAMANDER const char *arg_data[3]; int args = 0; - - game_path[0] = NULL; arg_data[0] = NULL; arg_data[args] = elf_path_cst; arg_data[args + 1] = NULL; args++; +#endif + + game_path[0] = NULL; RARCH_LOG("Attempt to load core: [%s].\n", path); + #ifndef IS_SALAMANDER if (should_load_game && !path_is_empty(RARCH_PATH_CONTENT)) { @@ -618,8 +622,6 @@ char *realpath(const char *name, char *resolved) for (start = end = name; *start; start = end) { - int n; - /* Skip sequence of multiple path-separators. */ while (*start == '/') ++start; diff --git a/gfx/drivers/switch_nx_gfx.c b/gfx/drivers/switch_nx_gfx.c index c25a77c8f0..102cea6bd9 100644 --- a/gfx/drivers/switch_nx_gfx.c +++ b/gfx/drivers/switch_nx_gfx.c @@ -580,7 +580,7 @@ static void switch_set_texture_frame( struct scaler_ctx *sctx = NULL; if (sw->menu_texture.pixels) - realloc(sw->menu_texture.pixels, sz); + sw->menu_texture.pixels = realloc(sw->menu_texture.pixels, sz); else sw->menu_texture.pixels = malloc(sz); diff --git a/gfx/drivers_context/switch_ctx.c b/gfx/drivers_context/switch_ctx.c index 5466371349..29bb3f3340 100644 --- a/gfx/drivers_context/switch_ctx.c +++ b/gfx/drivers_context/switch_ctx.c @@ -47,10 +47,8 @@ void switch_ctx_destroy(void *data) } static void switch_ctx_get_video_size(void *data, - unsigned *width, unsigned *height) + unsigned *width, unsigned *height) { - switch_ctx_data_t *ctx_nx = (switch_ctx_data_t *)data; - switch (appletGetOperationMode()) { default: diff --git a/gfx/drivers_font/switch_font.c b/gfx/drivers_font/switch_font.c index 1e9de648fa..831000f8af 100644 --- a/gfx/drivers_font/switch_font.c +++ b/gfx/drivers_font/switch_font.c @@ -46,7 +46,7 @@ static void *switch_font_init_font(void *data, const char *font_path, if (!font) return NULL; - if (!font_renderer_create_default((const void **)&font->font_driver, + if (!font_renderer_create_default(&font->font_driver, &font->font_data, font_path, font_size)) { RARCH_WARN("Couldn't initialize font renderer.\n"); @@ -250,73 +250,83 @@ static void switch_font_render_msg( void *data, const char *msg, const struct font_params *params) { - float x, y, scale, drop_mod, drop_alpha; - int drop_x, drop_y; - unsigned max_glyphs; + float x, y, scale; enum text_alignment text_align; - unsigned color, color_dark, r, g, b, - alpha, r_dark, g_dark, b_dark, alpha_dark; + unsigned color, r, g, b, alpha; switch_font_t *font = (switch_font_t *)data; - unsigned width = video_info->width; - unsigned height = video_info->height; +#if 0 + int drop_x, drop_y; + float drop_mod, drop_alpha; + unsigned max_glyphs; + unsigned color_dark, r_dark, g_dark, b_dark, alpha_dark; + unsigned width = video_info->width; + unsigned height = video_info->height; +#endif - if (!font || !msg || msg && !*msg) + if (!font || !msg || (msg && !*msg)) return; if (params) { - x = params->x; - y = params->y; - scale = params->scale; + x = params->x; + y = params->y; + scale = params->scale; text_align = params->text_align; - drop_x = params->drop_x; - drop_y = params->drop_y; - drop_mod = params->drop_mod; + +#if 0 + drop_x = params->drop_x; + drop_y = params->drop_y; drop_alpha = params->drop_alpha; + drop_mod = params->drop_mod; +#endif - r = FONT_COLOR_GET_RED(params->color); - g = FONT_COLOR_GET_GREEN(params->color); - b = FONT_COLOR_GET_BLUE(params->color); - alpha = FONT_COLOR_GET_ALPHA(params->color); + r = FONT_COLOR_GET_RED(params->color); + g = FONT_COLOR_GET_GREEN(params->color); + b = FONT_COLOR_GET_BLUE(params->color); + alpha = FONT_COLOR_GET_ALPHA(params->color); - color = params->color; + color = params->color; } else { - x = 0.0f; - y = 0.0f; - scale = 1.0f; + x = 0.0f; + y = 0.0f; + scale = 1.0f; text_align = TEXT_ALIGN_LEFT; - r = (video_info->font_msg_color_r * 255); - g = (video_info->font_msg_color_g * 255); - b = (video_info->font_msg_color_b * 255); - alpha = 255; - color = COLOR_ABGR(r, g, b, alpha); + r = (video_info->font_msg_color_r * 255); + g = (video_info->font_msg_color_g * 255); + b = (video_info->font_msg_color_b * 255); + alpha = 255; + color = COLOR_ABGR(r, g, b, alpha); - drop_x = -2; - drop_y = -2; - drop_mod = 0.3f; +#if 0 + drop_x = -2; + drop_y = -2; + drop_mod = 0.3f; drop_alpha = 1.0f; +#endif } +#if 0 max_glyphs = strlen(msg); - /*if (drop_x || drop_y) - max_glyphs *= 2; + if (drop_x || drop_y) + max_glyphs *= 2; - if (drop_x || drop_y) - { - r_dark = r * drop_mod; - g_dark = g * drop_mod; - b_dark = b * drop_mod; - alpha_dark = alpha * drop_alpha; - color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark); + if (drop_x || drop_y) + { + r_dark = r * drop_mod; + g_dark = g * drop_mod; + b_dark = b * drop_mod; + alpha_dark = alpha * drop_alpha; + color_dark = COLOR_ABGR(r_dark, g_dark, b_dark, alpha_dark); - switch_font_render_message(video_info, font, msg, scale, color_dark, - x + scale * drop_x / width, y + - scale * drop_y / height, text_align); - }*/ + switch_font_render_message(video_info, font, msg, scale, color_dark, + x + scale * drop_x / width, y + + scale * drop_y / height, text_align); + } +#endif switch_font_render_message(video_info, font, msg, scale, color, x, y, text_align); diff --git a/input/drivers/switch_input.c b/input/drivers/switch_input.c index ebc8001f2b..baa36f5d7f 100644 --- a/input/drivers/switch_input.c +++ b/input/drivers/switch_input.c @@ -963,6 +963,8 @@ static bool switch_input_set_sensor_state(void *data, unsigned port, sw->sixaxis_handles_count[port] = handles_count; } return true; + case RETRO_SENSOR_DUMMY: + break; } #endif diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 40b422cc53..454e1d696b 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -3276,18 +3276,18 @@ static int action_ok_deferred_list_stub(const char *path, static int action_ok_set_switch_cpu_profile(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { - char* profile_name = SWITCH_CPU_PROFILES[entry_idx]; char command[PATH_MAX_LENGTH] = {0}; - #ifdef HAVE_LAKKA_SWITCH + char* profile_name = SWITCH_CPU_PROFILES[entry_idx]; + snprintf(command, sizeof(command), "cpu-profile set '%s'", profile_name); system(command); snprintf(command, sizeof(command), "Current profile set to %s", profile_name); #else + unsigned profile_clock = SWITCH_CPU_SPEEDS_VALUES[entry_idx]; config_get_ptr()->uints.libnx_overclock = entry_idx; - unsigned profile_clock = SWITCH_CPU_SPEEDS_VALUES[entry_idx]; if (hosversionBefore(8, 0, 0)) pcvSetClockRate(PcvModule_CpuBus, (u32)profile_clock); else diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index e44d988d52..a65da2f739 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -7944,7 +7944,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, unsigned i; char text[PATH_MAX_LENGTH]; char current_profile[PATH_MAX_LENGTH]; +#ifdef HAVE_LAKKA_SWITCH FILE *profile = NULL; +#endif const size_t profiles_count = sizeof(SWITCH_CPU_PROFILES)/sizeof(SWITCH_CPU_PROFILES[1]); runloop_msg_queue_push("Warning : extended overclocking can damage the Switch", 1, 90, true, NULL, MESSAGE_QUEUE_ICON_DEFAULT, MESSAGE_QUEUE_CATEGORY_INFO);