Skip to content

Commit

Permalink
(WiiU) enable libretrodb.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaspider committed May 22, 2017
1 parent eede1a4 commit 634de19
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile.wiiu
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ifeq ($(GRIFFIN_BUILD), 1)
OBJ += griffin/griffin.o
DEFINES += -DHAVE_GRIFFIN=1 -DHAVE_MENU -DHAVE_RGUI -DHAVE_LIBRETRODB
DEFINES += -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DWANT_ZLIB -DHAVE_CC_RESAMPLER
DEFINES += -DHAVE_STB_FONT -DHAVE_LANGEXTRA
DEFINES += -DHAVE_STB_FONT -DHAVE_LANGEXTRA -DHAVE_LIBRETRODB
# DEFINES += -DHAVE_FREETYPE
DEFINES += -DHAVE_XMB -DHAVE_MATERIALUI
else
Expand All @@ -57,6 +57,7 @@ else
HAVE_STB_FONT = 1
# HAVE_FREETYPE = 1
HAVE_LANGEXTRA = 1
HAVE_LIBRETRODB = 1

include Makefile.common
BLACKLIST :=
Expand Down
1 change: 1 addition & 0 deletions gfx/common/gx2_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,6 @@ typedef struct
unsigned rotation;
bool keep_aspect;
bool should_resize;
bool render_msg_enabled;

} wiiu_video_t;
15 changes: 12 additions & 3 deletions gfx/drivers/wiiu_gfx.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,10 +542,10 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
#if 0
static u32 last_frame_tick;
if (!(wiiu->menu.enable))
printf("\r frame time : %10.6f ms \n", (float)(currentTick - last_frame_tick) * 1000.0f / (float)wiiu_timer_clock);
printf("frame time : %10.6f ms \r", (float)(currentTick - last_frame_tick) * 1000.0f / (float)wiiu_timer_clock);
last_frame_tick = currentTick;
#endif
printf("\rfps: %8.8f frames : %5i", fps, wiiu->frames++);
printf("fps: %8.8f frames : %5i\r", fps, wiiu->frames++);
fflush(stdout);

if (wiiu->should_resize)
Expand Down Expand Up @@ -625,12 +625,16 @@ static bool wiiu_gfx_frame(void* data, const void* frame,
GX2SetAttribBuffer(1, wiiu->vertex_cache.size * sizeof(tex_coord_t), sizeof(tex_coord_t), wiiu->vertex_cache.tex_coords);
GX2SetPixelSampler(&wiiu->sampler_linear, wiiu->shader->sampler.location);

wiiu->render_msg_enabled = true;

if (wiiu->menu.enable)
menu_driver_frame(video_info);

if (msg)
font_driver_render_msg(video_info, NULL, msg, NULL);

wiiu->render_msg_enabled = false;

GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, wiiu->vertex_cache.positions, wiiu->vertex_cache.current * sizeof(position_t));
GX2Invalidate(GX2_INVALIDATE_MODE_CPU_ATTRIBUTE_BUFFER, wiiu->vertex_cache.tex_coords, wiiu->vertex_cache.current * sizeof(tex_coord_t));

Expand Down Expand Up @@ -827,7 +831,12 @@ static void wiiu_gfx_set_osd_msg(void* data,
wiiu_video_t* wiiu = (wiiu_video_t*)data;

if (wiiu)
font_driver_render_msg(video_info, font, msg, params);
{
if (wiiu->render_msg_enabled)
font_driver_render_msg(video_info, font, msg, params);
else
printf("OSD msg: %s\n", msg);
}

}

Expand Down
2 changes: 1 addition & 1 deletion libretro-common/include/retro_common_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ typedef int ssize_t;
#define STRING_REP_INT64 "%I64u"
#define STRING_REP_UINT64 "%I64u"
#define STRING_REP_ULONG "%Iu"
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA)
#elif defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) && !defined(WIIU)
#define STRING_REP_INT64 "%llu"
#define STRING_REP_UINT64 "%llu"
#define STRING_REP_ULONG "%zu"
Expand Down
2 changes: 1 addition & 1 deletion tasks/task_database.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ static int task_database_iterate_start(database_info_handle_t *db,

snprintf(msg, sizeof(msg),
STRING_REP_ULONG "/" STRING_REP_ULONG ": %s %s...\n",
#if defined(_WIN32) || defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA)
#if defined(_WIN32) || defined(__STDC_VERSION__) && __STDC_VERSION__>=199901L && !defined(VITA) &&!defined(WIIU)
db->list_ptr,
db->list->size,
#else
Expand Down

0 comments on commit 634de19

Please sign in to comment.