mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +00:00
commit
d5a4998b47
@ -144,6 +144,14 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
if (!wiiu)
|
||||
return NULL;
|
||||
|
||||
void* wiiuinput = NULL;
|
||||
if (input && input_data)
|
||||
{
|
||||
wiiuinput = input_wiiu.init();
|
||||
*input = wiiuinput ? &input_wiiu : NULL;
|
||||
*input_data = wiiuinput;
|
||||
}
|
||||
|
||||
/* video init */
|
||||
wiiu->cmd_buffer = MEM2_alloc(0x400000, 0x40);
|
||||
u32 init_attributes[] =
|
||||
@ -210,8 +218,6 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2SetSwapInterval(1);
|
||||
|
||||
/* init shader */
|
||||
|
||||
|
||||
// wiiu->shader = MEM2_alloc(sizeof(*wiiu->shader), GX2_VERTEX_BUFFER_ALIGNMENT);
|
||||
wiiu->shader = MEM2_alloc(sizeof(tex_shader), 0x1000);
|
||||
memcpy(wiiu->shader, &tex_shader, sizeof(tex_shader));
|
||||
@ -303,21 +309,22 @@ static void* wiiu_gfx_init(const video_info_t* video,
|
||||
GX2InitSampler(&wiiu->sampler_nearest, GX2_TEX_CLAMP_MODE_CLAMP, GX2_TEX_XY_FILTER_MODE_POINT);
|
||||
GX2InitSampler(&wiiu->sampler_linear, GX2_TEX_CLAMP_MODE_CLAMP, GX2_TEX_XY_FILTER_MODE_LINEAR);
|
||||
|
||||
|
||||
/* set Texture and Sampler */
|
||||
GX2SetPixelTexture(&wiiu->texture, wiiu->shader->sampler.location);
|
||||
GX2SetPixelSampler(&wiiu->sampler_linear, wiiu->shader->sampler.location);
|
||||
|
||||
/* clear leftover image */
|
||||
GX2ClearColor(&wiiu->color_buffer, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
GX2CopyColorBufferToScanBuffer(&wiiu->color_buffer, GX2_SCAN_TARGET_DRC);
|
||||
GX2CopyColorBufferToScanBuffer(&wiiu->color_buffer, GX2_SCAN_TARGET_TV);
|
||||
|
||||
GX2SwapScanBuffers();
|
||||
GX2Flush();
|
||||
GX2WaitForVsync();
|
||||
|
||||
GX2SetTVEnable(GX2_ENABLE);
|
||||
GX2SetDRCEnable(GX2_ENABLE);
|
||||
|
||||
if (input && input_data)
|
||||
{
|
||||
void* wiiuinput = NULL;
|
||||
wiiuinput = input_wiiu.init();
|
||||
*input = wiiuinput ? &input_wiiu : NULL;
|
||||
*input_data = wiiuinput;
|
||||
}
|
||||
wiiu->noblock = false;
|
||||
wiiu->syncframes = 60;
|
||||
|
||||
@ -330,8 +337,15 @@ static void wiiu_gfx_free(void* data)
|
||||
if (!wiiu)
|
||||
return;
|
||||
|
||||
/* clear leftover image */
|
||||
GX2ClearColor(&wiiu->color_buffer, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||
GX2CopyColorBufferToScanBuffer(&wiiu->color_buffer, GX2_SCAN_TARGET_DRC);
|
||||
GX2CopyColorBufferToScanBuffer(&wiiu->color_buffer, GX2_SCAN_TARGET_TV);
|
||||
|
||||
GX2SwapScanBuffers();
|
||||
GX2Flush();
|
||||
GX2DrawDone();
|
||||
GX2WaitForVsync();
|
||||
GX2Shutdown();
|
||||
|
||||
GX2SetTVEnable(GX2_DISABLE);
|
||||
|
@ -39,6 +39,7 @@
|
||||
static uint64_t pad_state;
|
||||
static int16_t analog_state[1][2][2];
|
||||
extern uint64_t lifecycle_state;
|
||||
static bool wiiu_pad_inited = false;
|
||||
|
||||
static const char *wiiu_joypad_name(unsigned pad)
|
||||
{
|
||||
@ -50,6 +51,9 @@ static void wiiu_joypad_autodetect_add(unsigned autoconf_pad)
|
||||
settings_t *settings = config_get_ptr();
|
||||
autoconfig_params_t params = {{0}};
|
||||
|
||||
if (!settings->input.autodetect_enable)
|
||||
return;
|
||||
|
||||
strlcpy(settings->input.device_names[autoconf_pad],
|
||||
wiiu_joypad_name(autoconf_pad),
|
||||
sizeof(settings->input.device_names[autoconf_pad]));
|
||||
@ -61,15 +65,6 @@ static void wiiu_joypad_autodetect_add(unsigned autoconf_pad)
|
||||
input_config_autoconfigure_joypad(¶ms);
|
||||
}
|
||||
|
||||
static bool wiiu_joypad_init(void *data)
|
||||
{
|
||||
wiiu_joypad_autodetect_add(0);
|
||||
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wiiu_joypad_button(unsigned port_num, uint16_t key)
|
||||
{
|
||||
if (port_num >= MAX_PADS)
|
||||
@ -159,7 +154,7 @@ static void wiiu_joypad_poll(void)
|
||||
|
||||
BIT64_CLEAR(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
|
||||
if((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200))
|
||||
if((vpad.tpNormal.touched) && (vpad.tpNormal.x > 200) && (vpad.tpNormal.validity) == 0)
|
||||
BIT64_SET(lifecycle_state, RARCH_MENU_TOGGLE);
|
||||
|
||||
/* panic button */
|
||||
@ -168,18 +163,26 @@ static void wiiu_joypad_poll(void)
|
||||
(vpad.hold & VPAD_BUTTON_STICK_R) &&
|
||||
(vpad.hold & VPAD_BUTTON_STICK_L))
|
||||
command_event(CMD_EVENT_QUIT, NULL);
|
||||
}
|
||||
|
||||
static bool wiiu_joypad_init(void *data)
|
||||
{
|
||||
wiiu_joypad_autodetect_add(0);
|
||||
wiiu_joypad_poll();
|
||||
wiiu_pad_inited = true;
|
||||
(void)data;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool wiiu_joypad_query_pad(unsigned pad)
|
||||
{
|
||||
/* FIXME */
|
||||
return pad < MAX_USERS && pad_state;
|
||||
return pad < MAX_USERS && wiiu_pad_inited;
|
||||
}
|
||||
|
||||
|
||||
static void wiiu_joypad_destroy(void)
|
||||
{
|
||||
wiiu_pad_inited = false;
|
||||
}
|
||||
|
||||
input_device_driver_t wiiu_joypad = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user