Merge remote-tracking branch 'upstream/master'

This commit is contained in:
CoalaJoe 2017-01-22 08:23:34 +01:00
commit 942122fef3
19 changed files with 127 additions and 45 deletions

View File

@ -22,6 +22,11 @@ LIBS :=
DEFINES := -DHAVE_CONFIG_H -DRARCH_INTERNAL -DHAVE_OVERLAY
DEFINES += -DGLOBAL_CONFIG_DIR='"$(GLOBAL_CONFIG_DIR)"'
ifneq ($(findstring DOS,$(OS)),)
CFLAGS += -march=i386
LDFLAGS += -lemu
endif
ifneq ($(findstring Win32,$(OS)),)
LDFLAGS += -static-libgcc
endif

View File

@ -35,8 +35,10 @@
#endif
#ifdef HAVE_COMMAND
#include <net/net_compat.h>
#include <net/net_socket.h>
#ifdef HAVE_NETWORKING
#include <net/net_compat.h>
#include <net/net_socket.h>
#endif
#include <string/stdstring.h>
#endif

View File

@ -137,7 +137,7 @@ static bool caca_gfx_frame(void *data, const void *frame,
if (!caca_cv)
return true;
if (caca_menu_frame)
if (caca_menu_frame && menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
frame_to_copy = caca_menu_frame;
width = caca_get_canvas_width(caca_cv);
@ -149,6 +149,9 @@ static bool caca_gfx_frame(void *data, const void *frame,
(frame_width < width && frame_height < height))
draw = false;
if (menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL))
draw = false;
caca_clear_canvas(caca_cv);
#ifdef HAVE_MENU

View File

@ -1445,13 +1445,12 @@ static bool gx_frame(void *data, const void *frame,
const char *msg,
video_frame_info_t *video_info)
{
char fps_txt[128];
char fps_text_buf[128];
static struct retro_perf_counter gx_frame = {0};
gx_video_t *gx = (gx_video_t*)data;
u8 clear_efb = GX_FALSE;
fps_txt[0] = fps_text_buf[0] = '\0';
fps_text_buf[0] = '\0';
performance_counter_init(&gx_frame, "gx_frame");
performance_counter_start(&gx_frame);

View File

@ -288,8 +288,8 @@ static void vg_free(void *data)
static void vg_calculate_quad(vg_t *vg, video_frame_info_t *video_info)
{
unsigned width = video_info->width;
unsigned heigh = video_info->height;
unsigned width = video_info->width;
unsigned height = video_info->height;
/* set viewport for aspect ratio, taken from the OpenGL driver. */
if (vg->keep_aspect)

View File

@ -77,9 +77,10 @@ static void caca_render_msg(video_frame_info_t *video_info,
void *data, const char *msg,
const void *userdata)
{
float x, y;
float x, y, scale;
unsigned width, height;
unsigned newX, newY;
unsigned align;
caca_raster_t *font = (caca_raster_t*)data;
const struct font_params *params = (const struct font_params*)userdata;
@ -90,11 +91,15 @@ static void caca_render_msg(video_frame_info_t *video_info,
{
x = params->x;
y = params->y;
scale = params->scale;
align = params->text_align;
}
else
{
x = video_info->font_msg_pos_x;
y = video_info->font_msg_pos_y;
scale = 1.0f;
align = TEXT_ALIGN_LEFT;
}
if (!font->caca || !font->caca->caca_cv || !font->caca->caca_display ||
@ -103,12 +108,22 @@ static void caca_render_msg(video_frame_info_t *video_info,
width = caca_get_canvas_width(*font->caca->caca_cv);
height = caca_get_canvas_height(*font->caca->caca_cv);
newY = height - (y * height * scale);
newX = x * width;
newY = height - (y * height);
if (strlen(msg) + newX > width)
newX -= strlen(msg) + newX - width;
switch (align)
{
case TEXT_ALIGN_LEFT:
newX = x * width * scale;
break;
case TEXT_ALIGN_RIGHT:
newX = (x * width * scale) - strlen(msg);
break;
case TEXT_ALIGN_CENTER:
newX = (x * width * scale) - (strlen(msg) / 2);
break;
default:
break;
}
caca_put_str(*font->caca->caca_cv, newX, newY, msg);

View File

@ -85,9 +85,10 @@ static void gdi_render_msg(
const void *userdata)
{
HDC hdc;
float x, y;
float x, y, scale;
gdi_raster_t *font = (gdi_raster_t*)data;
unsigned newX, newY, len;
unsigned align;
const struct font_params *params = (const struct font_params*)userdata;
HWND hwnd = win32_get_window();
unsigned width = video_info->width;
@ -100,19 +101,38 @@ static void gdi_render_msg(
{
x = params->x;
y = params->y;
scale = params->scale;
align = params->text_align;
}
else
{
x = video_info->font_msg_pos_x;
y = video_info->font_msg_pos_y;
scale = 1.0f;
align = TEXT_ALIGN_LEFT;
}
if (!font->gdi)
return;
len = utf8len(msg);
newX = x * width;
newY = height - (y * height);
switch (align)
{
case TEXT_ALIGN_LEFT:
newX = x * width * scale;
break;
case TEXT_ALIGN_RIGHT:
newX = (x * width * scale) - len;
break;
case TEXT_ALIGN_CENTER:
newX = (x * width * scale) - (len / 2);
break;
default:
break;
}
newY = height - (y * height * scale);
hdc = GetDC(hwnd);
SetBkMode(hdc, TRANSPARENT);

View File

@ -2279,7 +2279,7 @@ void video_driver_build_info(video_frame_info_t *video_info)
video_info->width = video_driver_width;
video_info->height = video_driver_height;
video_info->use_rgba = video_driver_supports_rgba();
video_info->use_rgba = video_driver_use_rgba;
video_info->libretro_running = false;
#ifdef HAVE_MENU
@ -2311,6 +2311,9 @@ void video_driver_build_info(video_frame_info_t *video_info)
video_info->xmb_alpha_factor = 0.0f;
video_info->menu_wallpaper_opacity = 0.0f;
#endif
video_info->runloop_is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
video_info->runloop_is_idle = runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL);
video_info->runloop_is_slowmotion = runloop_ctl(RUNLOOP_CTL_IS_SLOWMOTION, NULL);
video_driver_threaded_unlock();
}

View File

@ -128,6 +128,9 @@ typedef struct video_frame_info
bool battery_level_enable;
bool timedate_enable;
bool runloop_is_slowmotion;
bool runloop_is_idle;
bool runloop_is_paused;
} video_frame_info_t;
/* Optionally implemented interface to poke more

View File

@ -63,10 +63,10 @@ joypad_connection_t *pad_connection_init(unsigned pads);
void pad_connection_destroy(joypad_connection_t *joyconn);
void pad_connection_pad_deinit(joypad_connection_t *joyconn,
unsigned idx);
uint32_t idx);
void pad_connection_packet(joypad_connection_t *joyconn,
unsigned idx, uint8_t* data, uint32_t length);
uint32_t idx, uint8_t* data, uint32_t length);
uint64_t pad_connection_get_buttons(joypad_connection_t *joyconn,
unsigned idx);

View File

@ -44,7 +44,7 @@
#endif
#elif defined(_XBOX360)
#include <PPCIntrinsics.h>
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(ANDROID) || defined(__QNX__)
#elif defined(_POSIX_MONOTONIC_CLOCK) || defined(ANDROID) || defined(__QNX__) || defined(DJGPP)
/* POSIX_MONOTONIC_CLOCK is not being defined in Android headers despite support being present. */
#include <time.h>
#endif
@ -215,7 +215,7 @@ retro_time_t cpu_features_get_time_usec(void)
return tv.tv_sec * INT64_C(1000000) + (tv.tv_nsec + 500) / 1000;
#elif defined(EMSCRIPTEN)
return emscripten_get_now() * 1000;
#elif defined(__mips__)
#elif defined(__mips__) || defined(DJGPP)
struct timeval tv;
gettimeofday(&tv,NULL);
return (1000000 * tv.tv_sec + tv.tv_usec);

View File

@ -311,6 +311,8 @@ bool gl_check_capability(enum gl_capability_enum enum_idx)
if (major >= 3)
return true;
#else
if (strstr(vendor, "ATI Technologies"))
return false;
if (gl_query_extension("ARB_texture_storage"))
return true;
#endif

View File

@ -39,7 +39,7 @@ static INLINE float float_min(float a, float b)
#ifdef __SSE2__
_mm_store_ss( &a, _mm_min_ss(_mm_set_ss(a),_mm_set_ss(b)) );
return a;
#elif defined(__STDC_C99__) || defined(__STDC_C11__)
#elif !defined(DJGPP) && (defined(__STDC_C99__) || defined(__STDC_C11__))
return fminf(a, b);
#else
return MIN(a, b);
@ -51,7 +51,7 @@ static INLINE float float_max(float a, float b)
#ifdef __SSE2__
_mm_store_ss( &a, _mm_max_ss(_mm_set_ss(a),_mm_set_ss(b)) );
return a;
#elif defined(__STDC_C99__) || defined(__STDC_C11__)
#elif !defined(DJGPP) && (defined(__STDC_C99__) || defined(__STDC_C11__))
return fmaxf(a, b);
#else
return MAX(a, b);

View File

@ -83,6 +83,26 @@
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#define RARCH_SCALE_BASE 256
#ifdef DJGPP
#define timespec timeval
#define tv_nsec tv_usec
#include <unistd.h>
extern int nanosleep(const struct timespec *rqtp, struct timespec *rmtp);
static int nanosleepDOS(const struct timespec *rqtp, struct timespec *rmtp)
{
usleep(1000000 * rqtp->tv_sec + rqtp->tv_nsec / 1000);
if (rmtp)
rmtp->tv_sec = rmtp->tv_nsec=0;
return 0;
}
#define nanosleep nanosleepDOS
#endif
/**
* retro_sleep:
* @msec : amount in milliseconds to sleep

View File

@ -808,15 +808,10 @@ static void mui_render_menu_list(
float *menu_list_color)
{
float sum = 0;
unsigned header_height = 0;
size_t i = 0;
file_list_t *list = NULL;
uint64_t frame_count = video_info->frame_count;
if (!menu_display_get_update_pending())
return;
header_height = menu_display_get_header_height();
unsigned header_height = menu_display_get_header_height();
mui->raster_block.carr.coords.vertices = 0;
mui->raster_block2.carr.coords.vertices = 0;
@ -1287,15 +1282,16 @@ static void mui_frame(void *data, video_frame_info_t *video_info)
menu_display_font_bind_block(mui->font, &mui->raster_block);
menu_display_font_bind_block(mui->font2, &mui->raster_block2);
mui_render_menu_list(
video_info,
mui,
width,
height,
font_normal_color,
font_hover_color,
&active_tab_marker_color[0]
);
if (menu_display_get_update_pending())
mui_render_menu_list(
video_info,
mui,
width,
height,
font_normal_color,
font_hover_color,
&active_tab_marker_color[0]
);
menu_display_font_flush_block(video_info->width, video_info->height, mui->font);
menu_display_font_flush_block(video_info->width, video_info->height, mui->font2);

View File

@ -832,6 +832,15 @@ error:
RARCH_ERR("%s\n", dmsg);
runloop_msg_queue_push(dmsg, 1, 180, false);
}
if (!netplay->is_server)
{
/* Counter-intuitively, we still want to send our info. This is simply so
* that the server knows why we disconnected. */
if (!netplay_handshake_info(netplay, connection))
return false;
}
return false;
}
/**

View File

@ -152,6 +152,11 @@ else
add_define_make MAN_DIR "${PREFIX}/share/man"
fi
if [ "$OS" = 'DOS' ]; then
HAVE_SHADERPIPELINE=no
HAVE_LANGEXTRA=no
fi
if [ "$OS" = 'Win32' ]; then
HAVE_THREADS=yes
HAVE_THREAD_STORAGE=yes

View File

@ -2,6 +2,7 @@
if [ -n "$CROSS_COMPILE" ]; then
case "$CROSS_COMPILE" in
*'-mingw32'*) OS='Win32';;
*'-msdosdjgpp'*) OS='DOS';;
*);;
esac
fi

View File

@ -892,7 +892,7 @@ static enum runloop_state runloop_check_state(
if (runloop_cmd_triggered(trigger_input, RARCH_FULLSCREEN_TOGGLE_KEY))
{
command_event(CMD_EVENT_FULLSCREEN_TOGGLE, NULL);
if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
if (!runloop_idle)
video_driver_cached_frame();
}
@ -976,7 +976,7 @@ static enum runloop_state runloop_check_state(
/* Checks if slowmotion toggle/hold was being pressed and/or held. */
if (settings->video.black_frame_insertion)
{
if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
if (!runloop_idle)
video_driver_cached_frame();
}
@ -1015,13 +1015,12 @@ static enum runloop_state runloop_check_state(
return RUNLOOP_STATE_ITERATE;
}
static void runloop_netplay_pause(void)
{
#ifdef HAVE_NETWORKING
/* FIXME: This is an ugly way to tell Netplay this... */
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
/* FIXME: This is an ugly way to tell Netplay this... */
#define runloop_netplay_pause() netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL)
#else
#define runloop_netplay_pause() ((void)0)
#endif
}
/**
* runloop_iterate: