From 0a1b3fedc0e03ea824d78d8ff56fa832614f40f6 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 5 Sep 2017 16:39:12 -0400 Subject: [PATCH] VC6 support (targets NT 3.51) --- audio/audio_driver.c | 11 +- gfx/common/win32_common.c | 6 +- gfx/drivers/gdi_gfx.c | 3 +- gfx/drivers_font/gdi_font.c | 6 - gfx/video_driver.c | 4 +- libretro-common/compat/compat_snprintf.c | 10 + libretro-common/features/features_cpu.c | 8 +- libretro-common/file/file_path.c | 6 +- libretro-common/include/compat/msvc.h | 32 +- libretro-common/include/compat/msvc/stdint.h | 6 +- libretro-common/include/retro_endianness.h | 16 +- libretro-common/include/streams/file_stream.h | 2 +- libretro-common/streams/file_stream.c | 4 +- libretro-db/libretrodb.c | 2 +- libretro-db/query.c | 28 +- libretro-db/rmsgpack_dom.c | 8 +- menu/cbs/menu_cbs_get_value.c | 6 +- menu/cbs/menu_cbs_ok.c | 3 +- network/netplay/netplay_init.c | 8 +- performance_counters.c | 6 +- pkg/msvc/RetroArch-msvc2005.sln | 25 -- pkg/msvc/msvc-2005/RetroArch-msvc2005.vcproj | 403 ------------------ pkg/msvc/msvc-6/RetroArch/RetroArch.dsp | 118 +++++ pkg/msvc/msvc-6/RetroArch/RetroArch.dsw | 29 ++ tasks/task_save.c | 9 +- ui/drivers/ui_win32.c | 9 +- 26 files changed, 280 insertions(+), 488 deletions(-) delete mode 100644 pkg/msvc/RetroArch-msvc2005.sln delete mode 100644 pkg/msvc/msvc-2005/RetroArch-msvc2005.vcproj create mode 100644 pkg/msvc/msvc-6/RetroArch/RetroArch.dsp create mode 100644 pkg/msvc/msvc-6/RetroArch/RetroArch.dsw diff --git a/audio/audio_driver.c b/audio/audio_driver.c index 83e8303110..f750d4df8c 100644 --- a/audio/audio_driver.c +++ b/audio/audio_driver.c @@ -212,10 +212,13 @@ static void compute_audio_buffer_statistics(void) accum_var += diff * diff; } - stddev = (unsigned)sqrt((double)accum_var / (samples - 2)); - avg_filled = 1.0f - (float)avg / audio_driver_buffer_size; - deviation = (float)stddev / audio_driver_buffer_size; - +#if defined(_MSC_VER) && _MSC_VER <= 1200 + /* FIXME: error C2520: conversion from unsigned __int64 to double not implemented, use signed __int64 */ +#else + stddev = (unsigned)sqrt((double)accum_var / (samples - 2)); + avg_filled = 1.0f - (float)avg / audio_driver_buffer_size; + deviation = (float)stddev / audio_driver_buffer_size; +#endif low_water_size = (unsigned)(audio_driver_buffer_size * 3 / 4); high_water_size = (unsigned)(audio_driver_buffer_size / 4); diff --git a/gfx/common/win32_common.c b/gfx/common/win32_common.c index 6bee409cb8..2d031daab7 100644 --- a/gfx/common/win32_common.c +++ b/gfx/common/win32_common.c @@ -36,7 +36,7 @@ #define IDI_ICON 1 #ifndef _WIN32_WINNT -#define _WIN32_WINNT 0x0500 /*_WIN32_WINNT_WIN2K */ +#define _WIN32_WINNT 0x0500 /* _WIN32_WINNT_WIN2K */ #endif #include @@ -630,6 +630,8 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message, if (gdi && gdi->memDC) { RECT rect; + HBRUSH brush = CreateSolidBrush(RGB(1,81,127)); + GetClientRect(hwnd, &rect); StretchBlt(gdi->winDC, @@ -637,7 +639,6 @@ LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message, gdi->screen_width, gdi->screen_height, gdi->memDC, 0, 0, gdi->video_width, gdi->video_height, SRCCOPY); - HBRUSH brush = CreateSolidBrush(RGB(1,81,127)); FillRect(gdi->memDC, &rect, brush); DeleteObject(brush); } @@ -888,7 +889,6 @@ bool win32_suppress_screensaver(void *data, bool enable) return false; } -/* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) diff --git a/gfx/drivers/gdi_gfx.c b/gfx/drivers/gdi_gfx.c index 9810646e3d..1e7b7ab971 100644 --- a/gfx/drivers/gdi_gfx.c +++ b/gfx/drivers/gdi_gfx.c @@ -190,6 +190,7 @@ static bool gdi_gfx_frame(void *data, const void *frame, bool draw = true; gdi_t *gdi = (gdi_t*)data; HWND hwnd = win32_get_window(); + BITMAPINFO *info; if (!frame || !frame_width || !frame_height) return true; @@ -266,7 +267,7 @@ static bool gdi_gfx_frame(void *data, const void *frame, gdi->screen_width = mode.width; gdi->screen_height = mode.height; - BITMAPINFO *info = (BITMAPINFO*)calloc(1, sizeof(*info) + (3 * sizeof(RGBQUAD))); + info = (BITMAPINFO*)calloc(1, sizeof(*info) + (3 * sizeof(RGBQUAD))); info->bmiHeader.biBitCount = bits; info->bmiHeader.biWidth = pitch / (bits / 8); diff --git a/gfx/drivers_font/gdi_font.c b/gfx/drivers_font/gdi_font.c index e59d5b845a..4fe0cc146c 100644 --- a/gfx/drivers_font/gdi_font.c +++ b/gfx/drivers_font/gdi_font.c @@ -132,12 +132,6 @@ static void gdi_render_msg( newY = height - (y * height * scale); - uint64_t frame_count = 0; - bool is_alive = false; - bool is_focused = false; - - video_driver_get_status(&frame_count, &is_alive, &is_focused); - font->gdi->bmp_old = (HBITMAP)SelectObject(font->gdi->memDC, font->gdi->bmp); SetBkMode(font->gdi->memDC, TRANSPARENT); SetTextColor(font->gdi->memDC, RGB(255,255,255)); diff --git a/gfx/video_driver.c b/gfx/video_driver.c index fddfa8740c..e637671d38 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -2321,7 +2321,7 @@ void video_driver_frame(const void *data, unsigned width, snprintf(frames_text, sizeof(frames_text), STRING_REP_UINT64, - (unsigned long long)video_driver_frame_count); + (uint64_t)video_driver_frame_count); strlcat(video_driver_window_title, frames_text, @@ -2337,7 +2337,7 @@ void video_driver_frame(const void *data, unsigned width, "FPS: %6.1f || %s: " STRING_REP_UINT64, last_fps, msg_hash_to_str(MSG_FRAMES), - (unsigned long long)video_driver_frame_count); + (uint64_t)video_driver_frame_count); } else { diff --git a/libretro-common/compat/compat_snprintf.c b/libretro-common/compat/compat_snprintf.c index 8baa56a618..49867deec1 100644 --- a/libretro-common/compat/compat_snprintf.c +++ b/libretro-common/compat/compat_snprintf.c @@ -57,4 +57,14 @@ int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...) return count; } + +int c89_vscprintf_retro__(const char *format, va_list pargs) +{ + int retval; + va_list argcopy; + va_copy(argcopy, pargs); + retval = vsnprintf(NULL, 0, format, argcopy); + va_end(argcopy); + return retval; +} #endif diff --git a/libretro-common/features/features_cpu.c b/libretro-common/features/features_cpu.c index 4b976f6774..94bf644b1f 100644 --- a/libretro-common/features/features_cpu.c +++ b/libretro-common/features/features_cpu.c @@ -136,8 +136,12 @@ retro_perf_tick_t cpu_features_get_perf_counter(void) { retro_perf_tick_t time_ticks = 0; #if defined(_WIN32) - long tv_sec, tv_usec; - static const unsigned __int64 epoch = 11644473600000000ULL; + long tv_sec, tv_usec; +#if defined(_MSC_VER) && _MSC_VER <= 1200 + static const unsigned __int64 epoch = 11644473600000000; +#else + static const unsigned __int64 epoch = 11644473600000000ULL; +#endif FILETIME file_time; SYSTEMTIME system_time; ULARGE_INTEGER ularge; diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index e19b13d37e..fcb3fd6c79 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -362,11 +362,13 @@ bool path_is_compressed_file(const char* path) * Returns: true (1) if file already exists, otherwise false (0). */ bool path_file_exists(const char *path) -{ +{ + FILE *dummy; + if (!path || !*path) return false; - FILE *dummy = fopen(path, "rb"); + dummy = fopen(path, "rb"); if (!dummy) return false; diff --git a/libretro-common/include/compat/msvc.h b/libretro-common/include/compat/msvc.h index 76bc2e468f..3ff05d47a1 100644 --- a/libretro-common/include/compat/msvc.h +++ b/libretro-common/include/compat/msvc.h @@ -28,7 +28,7 @@ #ifdef __cplusplus extern "C" { #endif - + /* Pre-MSVC 2015 compilers don't implement snprintf in a cross-platform manner. */ #if _MSC_VER < 1900 #include @@ -90,6 +90,36 @@ typedef int ssize_t; #if _MSC_VER < 1800 #define roundf(in) (in >= 0.0f ? floorf(in + 0.5f) : ceilf(in - 0.5f)) #endif + +#if _MSC_VER <= 1200 + #ifndef __cplusplus + /* VC6 math.h doesn't define some functions when in C mode. + * Trying to define a prototype gives "undefined reference". + * But providing an implementation then gives "function already has body". + * So the equivalent of the implementations from math.h are used as + * defines here instead, and it seems to work. + */ + #define cosf(x) ((float)cos((double)x)) + #define powf(x, y) ((float)pow((double)x, (double)y)) + #define sinf(x) ((float)sin((double)x)) + #define ceilf(x) ((float)ceil((double)x)) + #define floorf(x) ((float)floor((double)x)) + #define sqrtf(x) ((float)sqrt((double)x)) + #endif + + #ifndef _vscprintf + #define _vscprintf c89_vscprintf_retro__ + int c89_vscprintf_retro__(const char *format, va_list pargs); + #endif + + #ifndef _strtoui64 + #define _strtoui64(x, y, z) (_atoi64(x)) + #endif + + #ifndef va_copy + #define va_copy(x, y) ((x) = (y)) + #endif +#endif #ifndef PATH_MAX #define PATH_MAX _MAX_PATH diff --git a/libretro-common/include/compat/msvc/stdint.h b/libretro-common/include/compat/msvc/stdint.h index 403e1f73d8..fa7a2bfcd5 100644 --- a/libretro-common/include/compat/msvc/stdint.h +++ b/libretro-common/include/compat/msvc/stdint.h @@ -47,7 +47,11 @@ * error C2733: second C linkage of overloaded function 'wmemchr' not allowed */ #ifdef __cplusplus -extern "C" { +#if _MSC_VER <= 1200 +extern "C++" { +#else +extern "C" { +#endif #endif # include #ifdef __cplusplus diff --git a/libretro-common/include/retro_endianness.h b/libretro-common/include/retro_endianness.h index baa3eec986..2e4e6a2aee 100644 --- a/libretro-common/include/retro_endianness.h +++ b/libretro-common/include/retro_endianness.h @@ -27,7 +27,7 @@ #include #include -#if defined(_MSC_VER) +#if defined(_MSC_VER) && _MSC_VER > 1200 #define SWAP16 _byteswap_ushort #define SWAP32 _byteswap_ulong #else @@ -42,7 +42,18 @@ (((uint32_t)(x) & 0xff000000) >> 24) \ )) #endif - + +#if defined(_MSC_VER) && _MSC_VER <= 1200 +#define SWAP64(val) \ + ((((uint64_t)(val) & 0x00000000000000ff) << 56) \ + | (((uint64_t)(val) & 0x000000000000ff00) << 40) \ + | (((uint64_t)(val) & 0x0000000000ff0000) << 24) \ + | (((uint64_t)(val) & 0x00000000ff000000) << 8) \ + | (((uint64_t)(val) & 0x000000ff00000000) >> 8) \ + | (((uint64_t)(val) & 0x0000ff0000000000) >> 24) \ + | (((uint64_t)(val) & 0x00ff000000000000) >> 40) \ + | (((uint64_t)(val) & 0xff00000000000000) >> 56)) +#else #define SWAP64(val) \ ((((uint64_t)(val) & 0x00000000000000ffULL) << 56) \ | (((uint64_t)(val) & 0x000000000000ff00ULL) << 40) \ @@ -52,6 +63,7 @@ | (((uint64_t)(val) & 0x0000ff0000000000ULL) >> 24) \ | (((uint64_t)(val) & 0x00ff000000000000ULL) >> 40) \ | (((uint64_t)(val) & 0xff00000000000000ULL) >> 56)) +#endif /** * is_little_endian: diff --git a/libretro-common/include/streams/file_stream.h b/libretro-common/include/streams/file_stream.h index 5e6298d5df..2226fc3d58 100644 --- a/libretro-common/include/streams/file_stream.h +++ b/libretro-common/include/streams/file_stream.h @@ -49,7 +49,7 @@ enum RFILE_HINT_MMAP = 1<<9 /* requires RFILE_MODE_READ */ }; -long long int filestream_get_size(RFILE *stream); +int64_t filestream_get_size(RFILE *stream); void filestream_set_size(RFILE *stream); diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index c0425f4781..7a911bc4b5 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -69,7 +69,7 @@ struct RFILE { unsigned hints; char *ext; - long long int size; + int64_t size; #if defined(PSP) SceUID fd; #else @@ -111,7 +111,7 @@ const char *filestream_get_ext(RFILE *stream) return stream->ext; } -long long int filestream_get_size(RFILE *stream) +int64_t filestream_get_size(RFILE *stream) { if (!stream) return 0; diff --git a/libretro-db/libretrodb.c b/libretro-db/libretrodb.c index 3c8dd8756f..6667527c05 100644 --- a/libretro-db/libretrodb.c +++ b/libretro-db/libretrodb.c @@ -23,7 +23,7 @@ #include #include #ifdef _WIN32 -#include +#include #else #include #endif diff --git a/libretro-db/query.c b/libretro-db/query.c index a47fc4e99e..f0fd6cb291 100644 --- a/libretro-db/query.c +++ b/libretro-db/query.c @@ -291,11 +291,11 @@ static void query_raise_expected_number(ssize_t where, const char **error) #ifdef _WIN32 snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected number", - (unsigned long long)where); + (uint64_t)where); #else snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Expected number", - (unsigned long long)where); + (uint64_t)where); #endif *error = tmp_error_buff; } @@ -305,11 +305,11 @@ static void query_raise_expected_string(ssize_t where, const char ** error) #ifdef _WIN32 snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected string", - (unsigned long long)where); + (uint64_t)where); #else snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Expected string", - (unsigned long long)where); + (uint64_t)where); #endif *error = tmp_error_buff; } @@ -319,12 +319,12 @@ static void query_raise_unexpected_eof(ssize_t where, const char ** error) #ifdef _WIN32 snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Unexpected EOF", - (unsigned long long)where + (uint64_t)where ); #else snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Unexpected EOF", - (unsigned long long)where + (uint64_t)where ); #endif *error = tmp_error_buff; @@ -342,12 +342,12 @@ static void query_raise_unknown_function(ssize_t where, const char *name, #ifdef _WIN32 int n = snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Unknown function '", - (unsigned long long)where + (uint64_t)where ); #else int n = snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Unknown function '", - (unsigned long long)where + (uint64_t)where ); #endif @@ -364,13 +364,13 @@ static void query_raise_expected_eof( #ifdef _WIN32 snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected EOF found '%c'", - (unsigned long long)where, + (uint64_t)where, found ); #else snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Expected EOF found '%c'", - (unsigned long long)where, + (uint64_t)where, found ); #endif @@ -384,11 +384,11 @@ static void query_raise_unexpected_char( #ifdef _WIN32 snprintf(tmp_error_buff, MAX_ERROR_LEN, "%I64u::Expected '%c' found '%c'", - (unsigned long long)where, expected, found); + (uint64_t)where, expected, found); #else snprintf(tmp_error_buff, MAX_ERROR_LEN, "%llu::Expected '%c' found '%c'", - (unsigned long long)where, expected, found); + (uint64_t)where, expected, found); #endif *error = tmp_error_buff; } @@ -420,11 +420,11 @@ static struct buffer query_parse_integer(struct buffer buff, #ifdef _WIN32 test = (sscanf(buff.data + buff.offset, "%I64d", - (signed long long*)&value->val.int_) == 0); + (int64_t*)&value->val.int_) == 0); #else test = (sscanf(buff.data + buff.offset, "%lld", - (signed long long*)&value->val.int_) == 0); + (int64_t*)&value->val.int_) == 0); #endif if (test) diff --git a/libretro-db/rmsgpack_dom.c b/libretro-db/rmsgpack_dom.c index 8335bb4ef8..590cd00e25 100644 --- a/libretro-db/rmsgpack_dom.c +++ b/libretro-db/rmsgpack_dom.c @@ -316,16 +316,16 @@ void rmsgpack_dom_value_print(struct rmsgpack_dom_value *obj) break; case RDT_INT: #ifdef _WIN32 - printf("%I64d", (signed long long)obj->val.int_); + printf("%I64d", (int64_t)obj->val.int_); #else - printf("%lld", (signed long long)obj->val.int_); + printf("%lld", (int64_t)obj->val.int_); #endif break; case RDT_UINT: #ifdef _WIN32 - printf("%I64u", (unsigned long long)obj->val.uint_); + printf("%I64u", (uint64_t)obj->val.uint_); #else - printf("%llu", (unsigned long long)obj->val.uint_); + printf("%llu", (uint64_t)obj->val.uint_); #endif break; case RDT_STRING: diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index ac9b76e4c0..5cbcba4dba 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -525,9 +525,9 @@ static void menu_action_setting_disp_set_label_perf_counters_common( #else "%llu ticks, %llu runs.", #endif - ((unsigned long long)counters[offset]->total / - (unsigned long long)counters[offset]->call_cnt), - (unsigned long long)counters[offset]->call_cnt); + ((uint64_t)counters[offset]->total / + (uint64_t)counters[offset]->call_cnt), + (uint64_t)counters[offset]->call_cnt); } static void general_disp_set_label_perf_counters( diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 1c2bd36fb7..200d4f52d8 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -1872,9 +1872,10 @@ static void menu_input_st_string_cb_rename_entry(void *userdata, if (!string_is_empty(label)) { playlist_t *tmp_playlist = NULL; - menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist); size_t new_selection_ptr = menu_input_dialog_get_kb_idx(); + menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &tmp_playlist); + if (tmp_playlist) { playlist_update(tmp_playlist, diff --git a/network/netplay/netplay_init.c b/network/netplay/netplay_init.c index 969439b894..75f1edaf0e 100644 --- a/network/netplay/netplay_init.c +++ b/network/netplay/netplay_init.c @@ -168,8 +168,12 @@ static bool init_tcp_socket(netplay_t *netplay, void *direct_host, #ifdef HAVE_INET6 if (!direct_host && !server && res->ai_family == AF_INET6) { - struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) res->ai_addr; - sin6->sin6_addr = in6addr_any; + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) res->ai_addr; +#if defined(_MSC_VER) && _MSC_VER <= 1200 + IN6ADDR_SETANY(sin6); +#else + sin6->sin6_addr = in6addr_any; +#endif } #endif diff --git a/performance_counters.c b/performance_counters.c index 95437300d5..a9fd732454 100644 --- a/performance_counters.c +++ b/performance_counters.c @@ -98,9 +98,9 @@ static void log_counters(struct retro_perf_counter **counters, unsigned num) { RARCH_LOG(PERF_LOG_FMT, counters[i]->ident, - (unsigned long long)counters[i]->total / - (unsigned long long)counters[i]->call_cnt, - (unsigned long long)counters[i]->call_cnt); + (uint64_t)counters[i]->total / + (uint64_t)counters[i]->call_cnt, + (uint64_t)counters[i]->call_cnt); } } } diff --git a/pkg/msvc/RetroArch-msvc2005.sln b/pkg/msvc/RetroArch-msvc2005.sln deleted file mode 100644 index e1e948b204..0000000000 --- a/pkg/msvc/RetroArch-msvc2005.sln +++ /dev/null @@ -1,25 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 9.00 -# Visual C++ Express 2005 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "RetroArch-msvc2005", "msvc-2005\RetroArch-msvc2005.vcproj", "{1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug NoAccel|Win32 = Debug NoAccel|Win32 - Debug|Win32 = Debug|Win32 - Release NoAccel|Win32 = Release NoAccel|Win32 - Release|Win32 = Release|Win32 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Debug NoAccel|Win32.ActiveCfg = Debug NoAccel|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Debug NoAccel|Win32.Build.0 = Debug NoAccel|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Debug|Win32.ActiveCfg = Debug|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Debug|Win32.Build.0 = Debug|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Release NoAccel|Win32.ActiveCfg = Release NoAccel|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Release NoAccel|Win32.Build.0 = Release NoAccel|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Release|Win32.ActiveCfg = Release|Win32 - {1FEFA874-F6A6-4CE6-9DB4-3B291A364CE5}.Release|Win32.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/pkg/msvc/msvc-2005/RetroArch-msvc2005.vcproj b/pkg/msvc/msvc-2005/RetroArch-msvc2005.vcproj deleted file mode 100644 index d846458c05..0000000000 --- a/pkg/msvc/msvc-2005/RetroArch-msvc2005.vcproj +++ /dev/null @@ -1,403 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/pkg/msvc/msvc-6/RetroArch/RetroArch.dsp b/pkg/msvc/msvc-6/RetroArch/RetroArch.dsp new file mode 100644 index 0000000000..af06a1fa67 --- /dev/null +++ b/pkg/msvc/msvc-6/RetroArch/RetroArch.dsp @@ -0,0 +1,118 @@ +# Microsoft Developer Studio Project File - Name="RetroArch" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Console Application" 0x0103 + +CFG=RetroArch - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "RetroArch.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "RetroArch.mak" CFG="RetroArch - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "RetroArch - Win32 Release" (based on "Win32 (x86) Console Application") +!MESSAGE "RetroArch - Win32 Debug" (based on "Win32 (x86) Console Application") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +RSC=rc.exe + +!IF "$(CFG)" == "RetroArch - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c +# ADD CPP /nologo /w /W0 /GX /O2 /I "../../../../libretro-common/include" /I "../../../../libretro-common/include/compat/msvc" /I "$(ProgramFiles)/Microsoft Platform SDK/include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /D _WIN32_WINNT=0x0351 /D "RARCH_INTERNAL" /D "HAVE_CC_RESAMPLER" /D "HAVE_GRIFFIN" /D "HAVE_FBO" /D "HAVE_ZLIB" /D "HAVE_RPNG" /D "HAVE_RJPEG" /D "HAVE_RBMP" /D "HAVE_RTGA" /D "HAVE_IMAGEVIEWER" /D "HAVE_XMB" /D "WANT_ZLIB" /D "HAVE_DYLIB" /D "HAVE_NETWORK_CMD" /D "HAVE_COMMAND" /D "HAVE_STDIN_CMD" /D "HAVE_THREADS" /D "HAVE_DYNAMIC" /D "HAVE_OVERLAY" /D "HAVE_RGUI" /D "HAVE_MENU" /D "HAVE_7ZIP" /D "HAVE_MATERIALUI" /D "HAVE_LIBRETRODB" /D "HAVE_STB_FONT" /D "__STDC_CONSTANT_MACROS" /YX /FD /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x411 /d "NDEBUG" +# ADD RSC /l 0x809 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib /subsystem:console /verbose /machine:I386 +# SUBTRACT LINK32 /nologo + +!ELSEIF "$(CFG)" == "RetroArch - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c +# ADD CPP /nologo /w /W0 /Gm /GX /ZI /Od /I "../../../../libretro-common/include" /I "../../../../libretro-common/include/compat/msvc" /I "$(ProgramFiles)/Microsoft Platform SDK/include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /D _WIN32_WINNT=0x0351 /D "RARCH_INTERNAL" /D "HAVE_CC_RESAMPLER" /D "HAVE_GRIFFIN" /D "HAVE_FBO" /D "HAVE_ZLIB" /D "HAVE_RPNG" /D "HAVE_RJPEG" /D "HAVE_RBMP" /D "HAVE_RTGA" /D "HAVE_IMAGEVIEWER" /D "HAVE_XMB" /D "WANT_ZLIB" /D "HAVE_DYLIB" /D "HAVE_NETWORK_CMD" /D "HAVE_COMMAND" /D "HAVE_STDIN_CMD" /D "HAVE_THREADS" /D "HAVE_DYNAMIC" /D "HAVE_OVERLAY" /D "HAVE_RGUI" /D "HAVE_MENU" /D "HAVE_7ZIP" /D "HAVE_MATERIALUI" /D "HAVE_LIBRETRODB" /D "HAVE_STB_FONT" /D "__STDC_CONSTANT_MACROS" /YX /FD /GZ /c +# SUBTRACT CPP /Fr +# ADD BASE RSC /l 0x411 /d "_DEBUG" +# ADD RSC /l 0x411 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "RetroArch - Win32 Release" +# Name "RetroArch - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=..\..\..\..\griffin\griffin.c +# End Source File +# Begin Source File + +SOURCE=..\..\..\..\griffin\griffin_cpp.cpp + +!IF "$(CFG)" == "RetroArch - Win32 Release" + +# ADD CPP /D WINVER=0x0400 /D _WIN32_WINNT=0x0400 + +!ELSEIF "$(CFG)" == "RetroArch - Win32 Debug" + +!ENDIF + +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/pkg/msvc/msvc-6/RetroArch/RetroArch.dsw b/pkg/msvc/msvc-6/RetroArch/RetroArch.dsw new file mode 100644 index 0000000000..8d6fcf058b --- /dev/null +++ b/pkg/msvc/msvc-6/RetroArch/RetroArch.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "RetroArch"=".\RetroArch.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/tasks/task_save.c b/tasks/task_save.c index 43fb7cf9d9..abc3eb3aa7 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -186,9 +186,12 @@ static void autosave_thread(void *data) slock_lock(save->cond_lock); - if (!save->quit) - scond_wait_timeout(save->cond, save->cond_lock, - save->interval * 1000000LL); + if (!save->quit) +#if defined(_MSC_VER) && _MSC_VER <= 1200 + scond_wait_timeout(save->cond, save->cond_lock, save->interval * 1000000); +#else + scond_wait_timeout(save->cond, save->cond_lock, save->interval * 1000000LL); +#endif slock_unlock(save->cond_lock); } diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 5b2a411390..d11cf61738 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -53,7 +53,10 @@ #include "../../gfx/video_driver.h" #include "../../tasks/tasks_internal.h" +#ifdef HAVE_OPENGL #include "../../gfx/common/gl_common.h" +#endif + #include "ui_win32.h" #define SHADER_DLG_WIDTH 220 @@ -148,11 +151,13 @@ static void shader_dlg_params_refresh(void) switch (control->type) { case SHADER_PARAM_CTRL_CHECKBOX: - { + { + bool checked; + video_shader_ctx_t shader_info; video_shader_driver_get_current_shader(&shader_info); - bool checked = shader_info.data ? + checked = shader_info.data ? (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum) : false; SendMessage(control->elems.checkbox.hwnd, BM_SETCHECK, checked, 0);