(PSL1GHT) Buildfixes/warning fixes

This commit is contained in:
libretroadmin 2023-02-20 15:33:54 +01:00
parent fed60c62b6
commit a4dda41739
7 changed files with 58 additions and 70 deletions

View File

@ -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) static void rsx_fill_black(uint32_t *dst, uint32_t *dst_end, size_t sz)
{ {
if (sz > dst_end - dst) if (sz > dst_end - dst)
@ -867,6 +869,7 @@ static void rsx_blit_buffer(
if (dst < dst_end) if (dst < dst_end)
memset(dst, 0, 4 * (dst_end - dst)); memset(dst, 0, 4 * (dst_end - dst));
} }
#endif
static void rsx_load_texture_data(rsx_t* rsx, rsx_texture_t *texture, static void rsx_load_texture_data(rsx_t* rsx, rsx_texture_t *texture,
const void *frame, unsigned width, unsigned height, unsigned pitch, 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; *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, static void rsx_set_osd_msg(void *data,
video_frame_info_t *video_info, video_frame_info_t *video_info,
const char *msg, const char *msg,
@ -1355,6 +1361,7 @@ static void rsx_set_osd_msg(void *data,
if (gcm && gcm->msg_rendering_enabled) if (gcm && gcm->msg_rendering_enabled)
font_driver_render_msg(data, msg, params, font); font_driver_render_msg(data, msg, params, font);
} }
#endif
static uint32_t rsx_get_flags(void *data) { return 0; } static uint32_t rsx_get_flags(void *data) { return 0; }
@ -1362,14 +1369,14 @@ static const video_poke_interface_t rsx_poke_interface = {
rsx_get_flags, rsx_get_flags,
rsx_load_texture, rsx_load_texture,
rsx_unload_texture, rsx_unload_texture,
NULL, NULL, /* set_video_mode */
NULL, NULL, /* get_refresh_rate */
rsx_set_filtering, rsx_set_filtering,
NULL, /* get_video_output_size */ NULL, /* get_video_output_size */
NULL, /* get_video_output_prev */ NULL, /* get_video_output_prev */
NULL, /* get_video_output_next */ NULL, /* get_video_output_next */
NULL, /* get_current_framebuffer */ NULL, /* get_current_framebuffer */
NULL, NULL, /* get_proc_address */
rsx_set_aspect_ratio, rsx_set_aspect_ratio,
rsx_apply_state_changes, rsx_apply_state_changes,
rsx_set_texture_frame, rsx_set_texture_frame,

View File

@ -3416,12 +3416,12 @@ static const video_poke_interface_t vulkan_poke_interface = {
vulkan_unload_texture, vulkan_unload_texture,
vulkan_set_video_mode, vulkan_set_video_mode,
vulkan_get_refresh_rate, /* get_refresh_rate */ vulkan_get_refresh_rate, /* get_refresh_rate */
NULL, NULL, /* set_filtering */
vulkan_get_video_output_size, vulkan_get_video_output_size,
vulkan_get_video_output_prev, vulkan_get_video_output_prev,
vulkan_get_video_output_next, vulkan_get_video_output_next,
NULL, NULL, /* get_current_framebuffer */
NULL, NULL, /* get_proc_address */
vulkan_set_aspect_ratio, vulkan_set_aspect_ratio,
vulkan_apply_state_changes, vulkan_apply_state_changes,
vulkan_set_texture_frame, vulkan_set_texture_frame,

View File

@ -29,8 +29,10 @@
#include "../../verbosity.h" #include "../../verbosity.h"
#include <defines/ps3_defines.h> #include <defines/ps3_defines.h>
#include "../../frontend/frontend_driver.h" #include "../../frontend/frontend_driver.h"
#if defined(HAVE_PSGL)
#include "../common/gl_common.h" #include "../common/gl_common.h"
#include "../common/gl2_common.h" #include "../common/gl2_common.h"
#endif
typedef struct gfx_ctx_ps3_data typedef struct gfx_ctx_ps3_data
{ {
@ -55,23 +57,6 @@ static void gfx_ctx_ps3_get_resolution(unsigned idx,
*height = resolution.height; *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) static void gfx_ctx_ps3_get_available_resolutions(void)
{ {
unsigned i; 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, static void gfx_ctx_ps3_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height) bool *resize, unsigned *width, unsigned *height)
{ {
#if defined(HAVE_PSGL)
gl2_t *gl = data; gl2_t *gl = data;
#endif
*quit = false; *quit = false;
*resize = false; *resize = false;
#if defined(HAVE_PSGL)
if (gl->should_resize) if (gl->should_resize)
*resize = true; *resize = true;
#endif
} }
static bool gfx_ctx_ps3_has_focus(void *data) { return true; } static bool gfx_ctx_ps3_has_focus(void *data) { return true; }
@ -207,9 +196,9 @@ static void *gfx_ctx_ps3_init(void *video_driver)
psglInit(&options); psglInit(&options);
params.enable = params.enable =
PSGL_DEVICE_PARAMETERS_COLOR_FORMAT | PSGL_DEVICE_PARAMETERS_COLOR_FORMAT
PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT | | PSGL_DEVICE_PARAMETERS_DEPTH_FORMAT
PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE; | PSGL_DEVICE_PARAMETERS_MULTISAMPLING_MODE;
params.colorFormat = GL_ARGB_SCE; params.colorFormat = GL_ARGB_SCE;
params.depthFormat = GL_NONE; params.depthFormat = GL_NONE;
params.multisamplingMode = GL_MULTISAMPLING_NONE_SCE; 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) enum gfx_ctx_api api, unsigned major, unsigned minor)
{ {
ps3_api = api; ps3_api = api;
#ifdef HAVE_PSGL
if ( if (
api == GFX_CTX_OPENGL_API || (api == GFX_CTX_OPENGL_API)
api == GFX_CTX_OPENGL_ES_API || (api == GFX_CTX_OPENGL_ES_API)
) )
return true; return true;
#endif
return false; return false;
} }

View File

@ -35,7 +35,7 @@ typedef struct gfx_ctx_psl1ght_data
PSGLdevice* gl_device; PSGLdevice* gl_device;
PSGLcontext* gl_context; PSGLcontext* gl_context;
#else #else
gcmContextData *rx_context; void *empty;
#endif #endif
} gfx_ctx_psl1ght_data_t; } gfx_ctx_psl1ght_data_t;
@ -52,23 +52,6 @@ static void gfx_ctx_psl1ght_get_resolution(unsigned idx,
*height = resolution.height; *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) static void gfx_ctx_psl1ght_get_available_resolutions(void)
{ {
unsigned i; 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, static void gfx_ctx_psl1ght_check_window(void *data, bool *quit,
bool *resize, unsigned *width, unsigned *height) bool *resize, unsigned *width, unsigned *height)
{ {
} }
static bool gfx_ctx_psl1ght_has_focus(void *data) { return true; } static bool gfx_ctx_psl1ght_has_focus(void *data) { return true; }
@ -183,8 +165,6 @@ static void *gfx_ctx_psl1ght_init(void *video_driver)
if (!psl1ght) if (!psl1ght)
return NULL; return NULL;
global->console.screen.pal_enable = global->console.screen.pal_enable =
cellVideoOutGetResolutionAvailability( cellVideoOutGetResolutionAvailability(
CELL_VIDEO_OUT_PRIMARY, CELL_VIDEO_OUT_RESOLUTION_576, 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) enum gfx_ctx_api api, unsigned major, unsigned minor)
{ {
ps3_api = api; ps3_api = api;
if (api == GFX_CTX_RSX_API) if (api == GFX_CTX_RSX_API)
return true; return true;
return false; return false;
} }

View File

@ -35,6 +35,10 @@
#include "../../tasks/tasks_internal.h" #include "../../tasks/tasks_internal.h"
#ifdef __PSL1GHT__
#include <spurs/spurs.h>
#endif
#ifdef HAVE_LIGHTGUN #ifdef HAVE_LIGHTGUN
#include <sys/spu.h> #include <sys/spu.h>
#include <io/camera.h> #include <io/camera.h>
@ -390,6 +394,7 @@ void readGemAccPosition(int num_gem)
void readGemInertial(ps3_input_t *ps3, int num_gem) void readGemInertial(ps3_input_t *ps3, int num_gem)
{ {
VmathVector4 v;
gemGetInertialState(num_gem, 0, -22000, &ps3->gem_inertial_state); gemGetInertialState(num_gem, 0, -22000, &ps3->gem_inertial_state);
v.vec128 = ps3->gem_inertial_state.accelerometer; v.vec128 = ps3->gem_inertial_state.accelerometer;
v.vec128 = ps3->gem_inertial_state.accelerometer_bias; 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) */ to actual lightgun behavior) */
ray_start.vec128 = ps3->gem_state.pos; ray_start.vec128 = ps3->gem_state.pos;
VmathVector4 ray_tmp = {.vec128 = {0.0f,0.0f,-1.0f,0.0f}}; 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); vmathQRotate(&ray_dir, quat, &ray_tmp);
float t = -ray_start.vec128[2] / ray_dir.vec128[2]; float t = -ray_start.vec128[2] / ray_dir.vec128[2];
pointer_x = ray_start.vec128[0] + ray_dir.vec128[0]*t; pointer_x = ray_start.vec128[0] + ray_dir.vec128[0]*t;

View File

@ -280,6 +280,9 @@ static bool ps3_joypad_rumble(unsigned pad,
strength = 255; strength = 255;
params.motor[1] = strength; params.motor[1] = strength;
break; break;
case RETRO_RUMBLE_DUMMY:
default:
break;
} }
cellPadSetActDirect(pad, &params); cellPadSetActDirect(pad, &params);

View File

@ -8045,7 +8045,9 @@ int generic_menu_entry_action(
} }
else /* MENU_SCROLL_START_LETTER */ else /* MENU_SCROLL_START_LETTER */
{ {
#ifdef HAVE_AUDIOMIXER
size_t selection_old = menu_st->selection_ptr; size_t selection_old = menu_st->selection_ptr;
#endif
if ( if (
menu_st->scroll.index_size menu_st->scroll.index_size
&& menu_st->selection_ptr != 0 && menu_st->selection_ptr != 0
@ -8103,7 +8105,9 @@ int generic_menu_entry_action(
{ {
if (menu_st->scroll.index_size) if (menu_st->scroll.index_size)
{ {
#ifdef HAVE_AUDIOMIXER
size_t selection_old = menu_st->selection_ptr; 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]) if (menu_st->selection_ptr == menu_st->scroll.index_list[menu_st->scroll.index_size - 1])
menu_st->selection_ptr = selection_buf_size - 1; menu_st->selection_ptr = selection_buf_size - 1;
else else