From a4dda417392f37e52646e87073b83244fdcc56e6 Mon Sep 17 00:00:00 2001 From: libretroadmin Date: Mon, 20 Feb 2023 15:33:54 +0100 Subject: [PATCH] (PSL1GHT) Buildfixes/warning fixes --- gfx/drivers/rsx_gfx.c | 31 +++++++++++++--------- gfx/drivers/vulkan.c | 8 +++--- gfx/drivers_context/ps3_ctx.c | 43 ++++++++++++------------------- gfx/drivers_context/psl1ght_ctx.c | 30 +++------------------ input/drivers/psl1ght_input.c | 9 ++++++- input/drivers_joypad/ps3_joypad.c | 3 +++ menu/menu_driver.c | 4 +++ 7 files changed, 58 insertions(+), 70 deletions(-) diff --git a/gfx/drivers/rsx_gfx.c b/gfx/drivers/rsx_gfx.c index 43bb9cc873..b558be4920 100644 --- a/gfx/drivers/rsx_gfx.c +++ b/gfx/drivers/rsx_gfx.c @@ -741,6 +741,8 @@ static void rsx_unload_texture(void *data, } } +#if 0 +/* TODO/FIXME - commenting this code out for now until it gets used */ static void rsx_fill_black(uint32_t *dst, uint32_t *dst_end, size_t sz) { if (sz > dst_end - dst) @@ -867,6 +869,7 @@ static void rsx_blit_buffer( if (dst < dst_end) memset(dst, 0, 4 * (dst_end - dst)); } +#endif static void rsx_load_texture_data(rsx_t* rsx, rsx_texture_t *texture, const void *frame, unsigned width, unsigned height, unsigned pitch, @@ -1346,6 +1349,9 @@ static void rsx_viewport_info(void* data, struct video_viewport* vp) *vp = gcm->vp; } +#if 0 +/* TODO/FIXME - does this function have to be hooked up as a function callback + * or can it be removed? */ static void rsx_set_osd_msg(void *data, video_frame_info_t *video_info, const char *msg, @@ -1355,6 +1361,7 @@ static void rsx_set_osd_msg(void *data, if (gcm && gcm->msg_rendering_enabled) font_driver_render_msg(data, msg, params, font); } +#endif static uint32_t rsx_get_flags(void *data) { return 0; } @@ -1362,28 +1369,28 @@ static const video_poke_interface_t rsx_poke_interface = { rsx_get_flags, rsx_load_texture, rsx_unload_texture, - NULL, - NULL, + NULL, /* set_video_mode */ + NULL, /* get_refresh_rate */ rsx_set_filtering, NULL, /* get_video_output_size */ NULL, /* get_video_output_prev */ NULL, /* get_video_output_next */ NULL, /* get_current_framebuffer */ - NULL, + NULL, /* get_proc_address */ rsx_set_aspect_ratio, rsx_apply_state_changes, rsx_set_texture_frame, rsx_set_texture_enable, font_driver_render_msg, - NULL, /* show_mouse */ - NULL, /* grab_mouse_toggle */ - NULL, /* get_current_shader */ - NULL, /* get_current_software_framebuffer */ - NULL, /* get_hw_render_interface */ - NULL, /* set_hdr_max_nits */ - NULL, /* set_hdr_paper_white_nits */ - NULL, /* set_hdr_contrast */ - NULL /* set_hdr_expand_gamut */ + NULL, /* show_mouse */ + NULL, /* grab_mouse_toggle */ + NULL, /* get_current_shader */ + NULL, /* get_current_software_framebuffer */ + NULL, /* get_hw_render_interface */ + NULL, /* set_hdr_max_nits */ + NULL, /* set_hdr_paper_white_nits */ + NULL, /* set_hdr_contrast */ + NULL /* set_hdr_expand_gamut */ }; static void rsx_get_poke_interface(void* data, diff --git a/gfx/drivers/vulkan.c b/gfx/drivers/vulkan.c index 2cd1cd8b0a..b194b96b57 100644 --- a/gfx/drivers/vulkan.c +++ b/gfx/drivers/vulkan.c @@ -3415,13 +3415,13 @@ static const video_poke_interface_t vulkan_poke_interface = { vulkan_load_texture, vulkan_unload_texture, vulkan_set_video_mode, - vulkan_get_refresh_rate, /* get_refresh_rate */ - NULL, + vulkan_get_refresh_rate, /* get_refresh_rate */ + NULL, /* set_filtering */ vulkan_get_video_output_size, vulkan_get_video_output_prev, vulkan_get_video_output_next, - NULL, - NULL, + NULL, /* get_current_framebuffer */ + NULL, /* get_proc_address */ vulkan_set_aspect_ratio, vulkan_apply_state_changes, vulkan_set_texture_frame, diff --git a/gfx/drivers_context/ps3_ctx.c b/gfx/drivers_context/ps3_ctx.c index e7e8a1ddbc..44ce0471df 100644 --- a/gfx/drivers_context/ps3_ctx.c +++ b/gfx/drivers_context/ps3_ctx.c @@ -29,8 +29,10 @@ #include "../../verbosity.h" #include #include "../../frontend/frontend_driver.h" +#if defined(HAVE_PSGL) #include "../common/gl_common.h" #include "../common/gl2_common.h" +#endif typedef struct gfx_ctx_ps3_data { @@ -55,23 +57,6 @@ static void gfx_ctx_ps3_get_resolution(unsigned idx, *height = resolution.height; } -static float gfx_ctx_ps3_get_aspect_ratio(void *data) -{ - CellVideoOutState videoState; - - cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState); - - switch (videoState.displayMode.aspect) - { - case CELL_VIDEO_OUT_ASPECT_4_3: - return 4.0f/3.0f; - case CELL_VIDEO_OUT_ASPECT_16_9: - break; - } - - return 16.0f/9.0f; -} - static void gfx_ctx_ps3_get_available_resolutions(void) { unsigned i; @@ -151,13 +136,17 @@ static void gfx_ctx_ps3_set_swap_interval(void *data, int interval) static void gfx_ctx_ps3_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height) { +#if defined(HAVE_PSGL) gl2_t *gl = data; +#endif *quit = false; *resize = false; +#if defined(HAVE_PSGL) if (gl->should_resize) *resize = true; +#endif } static bool gfx_ctx_ps3_has_focus(void *data) { return true; } @@ -190,7 +179,7 @@ static void *gfx_ctx_ps3_init(void *video_driver) PSGLdeviceParameters params; PSGLinitOptions options; #endif - global_t *global = global_get_ptr(); + global_t *global = global_get_ptr(); gfx_ctx_ps3_data_t *ps3 = (gfx_ctx_ps3_data_t*) calloc(1, sizeof(gfx_ctx_ps3_data_t)); @@ -207,9 +196,9 @@ static void *gfx_ctx_ps3_init(void *video_driver) psglInit(&options); params.enable = - PSGL_DEVICE_PARAMETERS_COLOR_FORMAT | - PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT | - PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE; + PSGL_DEVICE_PARAMETERS_COLOR_FORMAT + | PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT + | PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE; params.colorFormat = GL_ARGB_SCE; params.depthFormat = GL_NONE; params.multisamplingMode = GL_MULTISAMPLING_NONE_SCE; @@ -301,13 +290,13 @@ static bool gfx_ctx_ps3_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { ps3_api = api; - +#ifdef HAVE_PSGL if ( - api == GFX_CTX_OPENGL_API || - api == GFX_CTX_OPENGL_ES_API + (api == GFX_CTX_OPENGL_API) + || (api == GFX_CTX_OPENGL_ES_API) ) return true; - +#endif return false; } @@ -329,8 +318,8 @@ static void gfx_ctx_ps3_get_video_output_size(void *data, } else { - global->console.screen.pal_enable = false; - global->console.screen.pal60_enable = false; + global->console.screen.pal_enable = false; + global->console.screen.pal60_enable = false; } } diff --git a/gfx/drivers_context/psl1ght_ctx.c b/gfx/drivers_context/psl1ght_ctx.c index 5913e60955..b9641c413e 100755 --- a/gfx/drivers_context/psl1ght_ctx.c +++ b/gfx/drivers_context/psl1ght_ctx.c @@ -35,7 +35,7 @@ typedef struct gfx_ctx_psl1ght_data PSGLdevice* gl_device; PSGLcontext* gl_context; #else - gcmContextData *rx_context; + void *empty; #endif } gfx_ctx_psl1ght_data_t; @@ -52,23 +52,6 @@ static void gfx_ctx_psl1ght_get_resolution(unsigned idx, *height = resolution.height; } -static float gfx_ctx_psl1ght_get_aspect_ratio(void *data) -{ - CellVideoOutState videoState; - - cellVideoOutGetState(CELL_VIDEO_OUT_PRIMARY, 0, &videoState); - - switch (videoState.displayMode.aspect) - { - case CELL_VIDEO_OUT_ASPECT_4_3: - return 4.0f/3.0f; - case CELL_VIDEO_OUT_ASPECT_16_9: - break; - } - - return 16.0f/9.0f; -} - static void gfx_ctx_psl1ght_get_available_resolutions(void) { unsigned i; @@ -148,7 +131,6 @@ static void gfx_ctx_psl1ght_set_swap_interval(void *data, int interval) static void gfx_ctx_psl1ght_check_window(void *data, bool *quit, bool *resize, unsigned *width, unsigned *height) { - } static bool gfx_ctx_psl1ght_has_focus(void *data) { return true; } @@ -176,15 +158,13 @@ static void gfx_ctx_psl1ght_get_video_size(void *data, static void *gfx_ctx_psl1ght_init(void *video_driver) { - global_t *global = global_get_ptr(); + global_t *global = global_get_ptr(); gfx_ctx_psl1ght_data_t *psl1ght = (gfx_ctx_psl1ght_data_t*) calloc(1, sizeof(gfx_ctx_psl1ght_data_t)); if (!psl1ght) return NULL; - - global->console.screen.pal_enable = cellVideoOutGetResolutionAvailability( CELL_VIDEO_OUT_PRIMARY, CELL_VIDEO_OUT_RESOLUTION_576, @@ -239,10 +219,8 @@ static bool gfx_ctx_psl1ght_bind_api(void *data, enum gfx_ctx_api api, unsigned major, unsigned minor) { ps3_api = api; - if (api == GFX_CTX_RSX_API) return true; - return false; } @@ -264,8 +242,8 @@ static void gfx_ctx_psl1ght_get_video_output_size(void *data, } else { - global->console.screen.pal_enable = false; - global->console.screen.pal60_enable = false; + global->console.screen.pal_enable = false; + global->console.screen.pal60_enable = false; } } diff --git a/input/drivers/psl1ght_input.c b/input/drivers/psl1ght_input.c index 0b78f4bafd..49b35d7240 100644 --- a/input/drivers/psl1ght_input.c +++ b/input/drivers/psl1ght_input.c @@ -35,6 +35,10 @@ #include "../../tasks/tasks_internal.h" +#ifdef __PSL1GHT__ +#include +#endif + #ifdef HAVE_LIGHTGUN #include #include @@ -390,6 +394,7 @@ void readGemAccPosition(int num_gem) void readGemInertial(ps3_input_t *ps3, int num_gem) { + VmathVector4 v; gemGetInertialState(num_gem, 0, -22000, &ps3->gem_inertial_state); v.vec128 = ps3->gem_inertial_state.accelerometer; v.vec128 = ps3->gem_inertial_state.accelerometer_bias; @@ -667,7 +672,9 @@ static int16_t ps3_lightgun_device_state(ps3_input_t *ps3, to actual lightgun behavior) */ ray_start.vec128 = ps3->gem_state.pos; VmathVector4 ray_tmp = {.vec128 = {0.0f,0.0f,-1.0f,0.0f}}; - const VmathQuat *quat = &ps3->gem_state.quat; + const VmathQuat *quat = &ps3->gem_state.quat; /* TODO/FIXME - warning - VmathVector3/VmathVector4 issue again */ + /* TODO/FIXME - note: expected 'VmathVector3 * {aka struct _VmathVector3 *}' but argument is of type 'VmathVector4 * {aka struct _VmathVector4 *}' + * vmathQRotate takes type VmathVector3* instead of VmathVector4* */ vmathQRotate(&ray_dir, quat, &ray_tmp); float t = -ray_start.vec128[2] / ray_dir.vec128[2]; pointer_x = ray_start.vec128[0] + ray_dir.vec128[0]*t; diff --git a/input/drivers_joypad/ps3_joypad.c b/input/drivers_joypad/ps3_joypad.c index 230bb8a148..8e579062a6 100644 --- a/input/drivers_joypad/ps3_joypad.c +++ b/input/drivers_joypad/ps3_joypad.c @@ -280,6 +280,9 @@ static bool ps3_joypad_rumble(unsigned pad, strength = 255; params.motor[1] = strength; break; + case RETRO_RUMBLE_DUMMY: + default: + break; } cellPadSetActDirect(pad, ¶ms); diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 273e8ed2b3..b28538fd08 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -8045,7 +8045,9 @@ int generic_menu_entry_action( } else /* MENU_SCROLL_START_LETTER */ { +#ifdef HAVE_AUDIOMIXER size_t selection_old = menu_st->selection_ptr; +#endif if ( menu_st->scroll.index_size && menu_st->selection_ptr != 0 @@ -8103,7 +8105,9 @@ int generic_menu_entry_action( { if (menu_st->scroll.index_size) { +#ifdef HAVE_AUDIOMIXER size_t selection_old = menu_st->selection_ptr; +#endif if (menu_st->selection_ptr == menu_st->scroll.index_list[menu_st->scroll.index_size - 1]) menu_st->selection_ptr = selection_buf_size - 1; else