mirror of
https://github.com/libretro/RetroArch
synced 2025-04-18 14:42:30 +00:00
(WIIU) display core frames.
This commit is contained in:
parent
844c6ed582
commit
afdaf9afbd
@ -228,6 +228,10 @@ static int log_write(struct _reent *r, int fd, const char *ptr, size_t len)
|
|||||||
|
|
||||||
return len;
|
return len;
|
||||||
}
|
}
|
||||||
|
void net_print(const char* str)
|
||||||
|
{
|
||||||
|
log_write(NULL, 0, str, strlen(str));
|
||||||
|
}
|
||||||
|
|
||||||
static devoptab_t dotab_stdout = {
|
static devoptab_t dotab_stdout = {
|
||||||
"stdout", // device name
|
"stdout", // device name
|
||||||
@ -301,8 +305,8 @@ int __entry_menu(int argc, char **argv)
|
|||||||
unsigned sleep_ms = 0;
|
unsigned sleep_ms = 0;
|
||||||
int ret = runloop_iterate(&sleep_ms);
|
int ret = runloop_iterate(&sleep_ms);
|
||||||
|
|
||||||
if (ret == 1 && sleep_ms > 0)
|
// if (ret == 1 && sleep_ms > 0)
|
||||||
retro_sleep(sleep_ms);
|
// retro_sleep(sleep_ms);
|
||||||
task_queue_ctl(TASK_QUEUE_CTL_CHECK, NULL);
|
task_queue_ctl(TASK_QUEUE_CTL_CHECK, NULL);
|
||||||
if (ret == -1)
|
if (ret == -1)
|
||||||
break;
|
break;
|
||||||
|
@ -38,7 +38,7 @@ static frontend_ctx_driver_t *frontend_ctx_drivers[] = {
|
|||||||
&frontend_ctx_gx,
|
&frontend_ctx_gx,
|
||||||
#endif
|
#endif
|
||||||
#if defined(WIIU)
|
#if defined(WIIU)
|
||||||
// &frontend_ctx_wiiu,
|
&frontend_ctx_wiiu,
|
||||||
#endif
|
#endif
|
||||||
#if defined(__QNX__)
|
#if defined(__QNX__)
|
||||||
&frontend_ctx_qnx,
|
&frontend_ctx_qnx,
|
||||||
|
@ -39,22 +39,23 @@ typedef struct
|
|||||||
int width;
|
int width;
|
||||||
int height;
|
int height;
|
||||||
bool enable;
|
bool enable;
|
||||||
}menu;
|
} menu;
|
||||||
|
|
||||||
void* texture;
|
void* texture;
|
||||||
int tex_width;
|
int tex_width;
|
||||||
int tex_height;
|
int tex_height;
|
||||||
|
|
||||||
}wiiu_video_t;
|
} wiiu_video_t;
|
||||||
|
|
||||||
static void *wiiu_gfx_init(const video_info_t *video,
|
static void* wiiu_gfx_init(const video_info_t* video,
|
||||||
const input_driver_t **input, void **input_data)
|
const input_driver_t** input, void** input_data)
|
||||||
{
|
{
|
||||||
*input = NULL;
|
*input = NULL;
|
||||||
*input_data = NULL;
|
*input_data = NULL;
|
||||||
|
|
||||||
wiiu_video_t* wiiu = calloc(1, sizeof(*wiiu));
|
wiiu_video_t* wiiu = calloc(1, sizeof(*wiiu));
|
||||||
if(!wiiu)
|
|
||||||
|
if (!wiiu)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wiiu->screen_buffer0_size = OSScreenGetBufferSizeEx(0);
|
wiiu->screen_buffer0_size = OSScreenGetBufferSizeEx(0);
|
||||||
@ -101,11 +102,11 @@ static void *wiiu_gfx_init(const video_info_t *video,
|
|||||||
|
|
||||||
return wiiu;
|
return wiiu;
|
||||||
}
|
}
|
||||||
static void wiiu_gfx_free(void *data)
|
static void wiiu_gfx_free(void* data)
|
||||||
{
|
{
|
||||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||||
|
|
||||||
if(!wiiu)
|
if (!wiiu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
MEM1_free(wiiu->screen_buffer0);
|
MEM1_free(wiiu->screen_buffer0);
|
||||||
@ -117,9 +118,9 @@ static void wiiu_gfx_free(void *data)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_frame(void *data, const void *frame,
|
static bool wiiu_gfx_frame(void* data, const void* frame,
|
||||||
unsigned width, unsigned height, uint64_t frame_count,
|
unsigned width, unsigned height, uint64_t frame_count,
|
||||||
unsigned pitch, const char *msg)
|
unsigned pitch, const char* msg)
|
||||||
{
|
{
|
||||||
(void)frame;
|
(void)frame;
|
||||||
(void)width;
|
(void)width;
|
||||||
@ -135,33 +136,51 @@ static bool wiiu_gfx_frame(void *data, const void *frame,
|
|||||||
snprintf(frames_str, sizeof(frames_str), "frames : %i", frames++);
|
snprintf(frames_str, sizeof(frames_str), "frames : %i", frames++);
|
||||||
|
|
||||||
OSScreenClearBufferEx(1, 0);
|
OSScreenClearBufferEx(1, 0);
|
||||||
// OSScreenPutFontEx(1, 0, 0, "Hello world on DRC!!!");
|
|
||||||
|
|
||||||
const uint16_t* src = (uint16_t*)wiiu->menu.texture;
|
if (wiiu->menu.enable)
|
||||||
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
|
||||||
// for (i = 0; i < wiiu->menu.height; i++)
|
|
||||||
// {
|
|
||||||
// memcpy(dst, src, wiiu->menu.width * sizeof(uint16_t));
|
|
||||||
// dst += 896;
|
|
||||||
// src += wiiu->menu.tex_width;
|
|
||||||
// }
|
|
||||||
|
|
||||||
dst += 896 * (480 - wiiu->menu.height) / 2 + (896 - wiiu->menu.width) / 2;
|
|
||||||
int x, y;
|
|
||||||
for(y = 0; y < wiiu->menu.height; y++)
|
|
||||||
{
|
{
|
||||||
for(x = 0; x < wiiu->menu.width; x++)
|
const uint16_t* src = (uint16_t*)wiiu->menu.texture;
|
||||||
|
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
||||||
|
|
||||||
|
dst += 896 * (480 - wiiu->menu.height) / 2 + (896 - wiiu->menu.width) / 2;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
for (y = 0; y < wiiu->menu.height; y++)
|
||||||
{
|
{
|
||||||
int r = ((src[x] >> 12) & 0xF) << 4;
|
for (x = 0; x < wiiu->menu.width; x++)
|
||||||
int g = ((src[x] >> 8) & 0xF) << 4;
|
{
|
||||||
int b = ((src[x] >> 4) & 0xF) << 4;
|
int r = ((src[x] >> 12) & 0xF) << 4;
|
||||||
// r = 0;
|
int g = ((src[x] >> 8) & 0xF) << 4;
|
||||||
// g = 0;
|
int b = ((src[x] >> 4) & 0xF) << 4;
|
||||||
// b = 0;
|
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
||||||
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
}
|
||||||
|
|
||||||
|
src += wiiu->menu.tex_width;
|
||||||
|
dst += 896;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const uint16_t* src = (uint16_t*)frame;
|
||||||
|
uint32_t* dst = (uint32_t*)((uint8_t*)wiiu->screen_buffer1 + wiiu->screen_buffer1_id * wiiu->screen_buffer1_size / 2);
|
||||||
|
|
||||||
|
dst += (896 * (480 - height) + width) / 2;
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
for (y = 0; y < height; y++)
|
||||||
|
{
|
||||||
|
for (x = 0; x < width; x++)
|
||||||
|
{
|
||||||
|
int r = ((src[x] >> 11) & 0x1F) << 3;
|
||||||
|
int g = ((src[x] >> 5) & 0x3F) << 2;
|
||||||
|
int b = ((src[x] >> 0) & 0x1F) << 3;
|
||||||
|
dst[x] = (r << 0) | (b << 8) | (g << 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
src += pitch/2;
|
||||||
|
dst += 896;
|
||||||
}
|
}
|
||||||
src += wiiu->menu.tex_width;
|
|
||||||
dst += 896;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -177,39 +196,39 @@ static bool wiiu_gfx_frame(void *data, const void *frame,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wiiu_gfx_set_nonblock_state(void *data, bool toggle)
|
static void wiiu_gfx_set_nonblock_state(void* data, bool toggle)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)toggle;
|
(void)toggle;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_alive(void *data)
|
static bool wiiu_gfx_alive(void* data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_focus(void *data)
|
static bool wiiu_gfx_focus(void* data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_suppress_screensaver(void *data, bool enable)
|
static bool wiiu_gfx_suppress_screensaver(void* data, bool enable)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)enable;
|
(void)enable;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_has_windowed(void *data)
|
static bool wiiu_gfx_has_windowed(void* data)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_set_shader(void *data,
|
static bool wiiu_gfx_set_shader(void* data,
|
||||||
enum rarch_shader_type type, const char *path)
|
enum rarch_shader_type type, const char* path)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)type;
|
(void)type;
|
||||||
@ -218,21 +237,21 @@ static bool wiiu_gfx_set_shader(void *data,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wiiu_gfx_set_rotation(void *data,
|
static void wiiu_gfx_set_rotation(void* data,
|
||||||
unsigned rotation)
|
unsigned rotation)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)rotation;
|
(void)rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wiiu_gfx_viewport_info(void *data,
|
static void wiiu_gfx_viewport_info(void* data,
|
||||||
struct video_viewport *vp)
|
struct video_viewport* vp)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)vp;
|
(void)vp;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool wiiu_gfx_read_viewport(void *data, uint8_t *buffer)
|
static bool wiiu_gfx_read_viewport(void* data, uint8_t* buffer)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
(void)buffer;
|
(void)buffer;
|
||||||
@ -240,12 +259,12 @@ static bool wiiu_gfx_read_viewport(void *data, uint8_t *buffer)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
static uintptr_t wiiu_load_texture(void *video_data, void *data,
|
static uintptr_t wiiu_load_texture(void* video_data, void* data,
|
||||||
bool threaded, enum texture_filter_type filter_type)
|
bool threaded, enum texture_filter_type filter_type)
|
||||||
{
|
{
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
static void wiiu_unload_texture(void *data, uintptr_t handle)
|
static void wiiu_unload_texture(void* data, uintptr_t handle)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -271,19 +290,21 @@ static void wiiu_viewport_info(void* data, struct video_viewport* vp)
|
|||||||
vp->y = 0;
|
vp->y = 0;
|
||||||
}
|
}
|
||||||
static void wiiu_set_texture_frame(void* data, const void* frame, bool rgb32,
|
static void wiiu_set_texture_frame(void* data, const void* frame, bool rgb32,
|
||||||
unsigned width, unsigned height, float alpha)
|
unsigned width, unsigned height, float alpha)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
wiiu_video_t* wiiu = (wiiu_video_t*) data;
|
||||||
if(!wiiu)
|
|
||||||
|
if (!wiiu)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(!frame || !width || !height)
|
if (!frame || !width || !height)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if(width > wiiu->menu.tex_width)
|
if (width > wiiu->menu.tex_width)
|
||||||
width = wiiu->menu.tex_width;
|
width = wiiu->menu.tex_width;
|
||||||
if(height > wiiu->menu.tex_height)
|
|
||||||
|
if (height > wiiu->menu.tex_height)
|
||||||
height = wiiu->menu.tex_height;
|
height = wiiu->menu.tex_height;
|
||||||
|
|
||||||
wiiu->menu.width = width;
|
wiiu->menu.width = width;
|
||||||
@ -291,6 +312,7 @@ static void wiiu_set_texture_frame(void* data, const void* frame, bool rgb32,
|
|||||||
|
|
||||||
const uint16_t* src = frame;
|
const uint16_t* src = frame;
|
||||||
uint16_t* dst = (uint16_t*)wiiu->menu.texture;
|
uint16_t* dst = (uint16_t*)wiiu->menu.texture;
|
||||||
|
|
||||||
for (i = 0; i < height; i++)
|
for (i = 0; i < height; i++)
|
||||||
{
|
{
|
||||||
memcpy(dst, src, width * sizeof(uint16_t));
|
memcpy(dst, src, width * sizeof(uint16_t));
|
||||||
@ -307,8 +329,8 @@ static void wiiu_set_texture_enable(void* data, bool state, bool full_screen)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void wiiu_set_osd_msg(void *data, const char *msg,
|
static void wiiu_set_osd_msg(void* data, const char* msg,
|
||||||
const struct font_params *params, void *font)
|
const struct font_params* params, void* font)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,8 +359,8 @@ static const video_poke_interface_t wiiu_poke_interface =
|
|||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
static void wiiu_gfx_get_poke_interface(void *data,
|
static void wiiu_gfx_get_poke_interface(void* data,
|
||||||
const video_poke_interface_t **iface)
|
const video_poke_interface_t** iface)
|
||||||
{
|
{
|
||||||
(void)data;
|
(void)data;
|
||||||
*iface = &wiiu_poke_interface;
|
*iface = &wiiu_poke_interface;
|
||||||
@ -362,7 +384,7 @@ video_driver_t video_wiiu =
|
|||||||
wiiu_gfx_read_viewport,
|
wiiu_gfx_read_viewport,
|
||||||
NULL, /* read_frame_raw */
|
NULL, /* read_frame_raw */
|
||||||
#ifdef HAVE_OVERLAY
|
#ifdef HAVE_OVERLAY
|
||||||
NULL, /* overlay_interface */
|
NULL, /* overlay_interface */
|
||||||
#endif
|
#endif
|
||||||
wiiu_gfx_get_poke_interface,
|
wiiu_gfx_get_poke_interface,
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user