From c374c9853dd49365e06397f345e2395e4415828e Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Mon, 6 Jun 2016 22:27:41 +0200 Subject: [PATCH 01/66] Some potential fixes for Android Vulkan. --- gfx/common/vksym.h | 1 + gfx/common/vulkan_common.c | 48 +++++++++++++++++++++++++++++-- gfx/drivers_context/android_ctx.c | 4 +-- 3 files changed, 48 insertions(+), 5 deletions(-) diff --git a/gfx/common/vksym.h b/gfx/common/vksym.h index 7b56e0aa4a..51f3f5d07c 100644 --- a/gfx/common/vksym.h +++ b/gfx/common/vksym.h @@ -223,6 +223,7 @@ typedef struct vulkan_context_fp PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties; PFN_vkGetPhysicalDeviceQueueFamilyProperties vkGetPhysicalDeviceQueueFamilyProperties; + PFN_vkGetPhysicalDeviceSurfacePresentModesKHR vkGetSurfacePresentModesKHR; PFN_vkGetPhysicalDeviceSurfaceSupportKHR vkGetPhysicalDeviceSurfaceSupportKHR; PFN_vkGetPhysicalDeviceSurfaceCapabilitiesKHR vkGetPhysicalDeviceSurfaceCapabilitiesKHR; PFN_vkGetPhysicalDeviceSurfaceFormatsKHR vkGetPhysicalDeviceSurfaceFormatsKHR; diff --git a/gfx/common/vulkan_common.c b/gfx/common/vulkan_common.c index 03217a5fb3..74a71bd4d7 100644 --- a/gfx/common/vulkan_common.c +++ b/gfx/common/vulkan_common.c @@ -1054,6 +1054,7 @@ static bool vulkan_load_instance_symbols(gfx_ctx_vulkan_data_t *vk) VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceQueueFamilyProperties); VK_GET_INSTANCE_PROC_ADDR(CreateDevice); + VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceSurfacePresentModesKHR); VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceSurfaceSupportKHR); VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceSurfaceCapabilitiesKHR); VK_GET_INSTANCE_PROC_ADDR(GetPhysicalDeviceSurfaceFormatsKHR); @@ -1504,7 +1505,12 @@ bool vulkan_surface_create(gfx_ctx_vulkan_data_t *vk, if (VKFUNC(vkCreateAndroidSurfaceKHR)(vk->context.instance, &surf_info, NULL, &vk->vk_surface) != VK_SUCCESS) + { + RARCH_ERR("[Vulkan]: Failed to create Android surface.\n"); return false; + } + RARCH_LOG("[Vulkan]: Created Android surface: %llu\n", + (unsigned long long)vk->vk_surface); } #endif break; @@ -1725,18 +1731,50 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk, { unsigned i; uint32_t format_count; + uint32_t present_mode_count; uint32_t desired_swapchain_images; VkSwapchainCreateInfoKHR info; VkSurfaceCapabilitiesKHR surface_properties; VkSurfaceFormatKHR formats[256]; + VkPresentModeKHR present_modes[16]; VkSurfaceFormatKHR format; VkExtent2D swapchain_size; VkSwapchainKHR old_swapchain; VkSurfaceTransformFlagBitsKHR pre_transform; + VkPresentModeKHR swapchain_present_mode = VK_PRESENT_MODE_FIFO_KHR; - /* TODO: Properly query these. */ - VkPresentModeKHR swapchain_present_mode = swap_interval - ? VK_PRESENT_MODE_FIFO_KHR : VK_PRESENT_MODE_MAILBOX_KHR; + present_mode_count = 0; + VKFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR)( + vk->context.gpu, vk->vk_surface, + &present_mode_count, NULL); + if (present_mode_count < 1 || present_mode_count > 16) + { + RARCH_ERR("[Vulkan]: Bogus present modes found.\n"); + return false; + } + VKFUNC(vkGetPhysicalDeviceSurfacePresentModesKHR)( + vk->context.gpu, vk->vk_surface, + &present_mode_count, present_modes); + + for (i = 0; i < present_mode_count; i++) + { + if (!swap_interval && present_modes[i] == VK_PRESENT_MODE_MAILBOX_KHR) + { + swapchain_present_mode = VK_PRESENT_MODE_MAILBOX_KHR; + break; + } + else if (!swap_interval && present_modes[i] == VK_PRESENT_MODE_IMMEDIATE_KHR) + { + swapchain_present_mode = VK_PRESENT_MODE_IMMEDIATE_KHR; + break; + } + else if (swap_interval && present_modes[i] == VK_PRESENT_MODE_FIFO_KHR) + { + /* Kind of tautological since FIFO must always be present. */ + swapchain_present_mode = VK_PRESENT_MODE_FIFO_KHR; + break; + } + } RARCH_LOG("[Vulkan]: Creating swapchain with present mode: %u\n", (unsigned)swapchain_present_mode); @@ -1772,6 +1810,9 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk, else swapchain_size = surface_properties.currentExtent; + RARCH_LOG("[Vulkan]: Using swapchain size %u x %u.\n", + swapchain_size.width, swapchain_size.height); + desired_swapchain_images = surface_properties.minImageCount + 1; /* Limit latency. */ @@ -1793,6 +1834,7 @@ bool vulkan_create_swapchain(gfx_ctx_vulkan_data_t *vk, old_swapchain = vk->swapchain; + memset(&info, 0, sizeof(info)); info.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; info.surface = vk->vk_surface; info.minImageCount = desired_swapchain_images; diff --git a/gfx/drivers_context/android_ctx.c b/gfx/drivers_context/android_ctx.c index 976c02cb05..58cb47a57c 100644 --- a/gfx/drivers_context/android_ctx.c +++ b/gfx/drivers_context/android_ctx.c @@ -152,12 +152,12 @@ static void *android_gfx_ctx_init(void *video_driver) if (!android_app->window) goto unlock_error; - ANativeWindow_setBuffersGeometry(android_app->window, 0, 0, format); - switch (android_api) { case GFX_CTX_OPENGL_API: case GFX_CTX_OPENGL_ES_API: + ANativeWindow_setBuffersGeometry(android_app->window, 0, 0, format); + #ifdef HAVE_EGL if (!egl_create_context(&and->egl, context_attributes)) { From e3919c9d496aea37df48ddd151882884987a3385 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 02:09:19 +0200 Subject: [PATCH 02/66] (GLSM) Remove this -unnecessary --- libretro-common/include/glsym/glsym_es2.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/libretro-common/include/glsym/glsym_es2.h b/libretro-common/include/glsym/glsym_es2.h index b68f8a98f9..3e841145eb 100644 --- a/libretro-common/include/glsym/glsym_es2.h +++ b/libretro-common/include/glsym/glsym_es2.h @@ -44,12 +44,6 @@ typedef void *GLeglImageOES; #if !defined(GL_OES_fixed_point) && !defined(HAVE_OPENGLES2) typedef GLint GLfixed; #endif -#if defined(OSX) && !defined(MAC_OS_X_VERSION_10_7) -typedef long long int GLint64; -typedef unsigned long long int GLuint64; -typedef unsigned long long int GLuint64EXT; -typedef struct __GLsync *GLsync; -#endif typedef void (GL_APIENTRYP RGLSYMGLDEBUGMESSAGECONTROLKHRPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); typedef void (GL_APIENTRYP RGLSYMGLDEBUGMESSAGEINSERTKHRPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); typedef void (GL_APIENTRYP RGLSYMGLDEBUGMESSAGECALLBACKKHRPROC) (RGLGENGLDEBUGPROCKHR callback, const void *userParam); From d240437f6bdb223b8780e31d2ee14b1d9fa9fc14 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 02:18:45 +0200 Subject: [PATCH 03/66] Update GLSM --- libretro-common/glsm/glsm.c | 8 ++++---- libretro-common/include/glsm/glsmsym.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libretro-common/glsm/glsm.c b/libretro-common/glsm/glsm.c index 3e4767df07..80c9df410e 100644 --- a/libretro-common/glsm/glsm.c +++ b/libretro-common/glsm/glsm.c @@ -1809,10 +1809,10 @@ void rglDeleteVertexArrays(GLsizei n, const GLuint *arrays) * OpenGL : 3.2 * OpenGLES : 3.0 */ -GLsync rglFenceSync(GLenum condition, GLbitfield flags) +void *rglFenceSync(GLenum condition, GLbitfield flags) { #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES3) - return glFenceSync(condition, flags); + return (GLsync)glFenceSync(condition, flags); #endif } @@ -1822,10 +1822,10 @@ GLsync rglFenceSync(GLenum condition, GLbitfield flags) * OpenGL : 3.2 * OpenGLES : 3.0 */ -void rglWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) +void rglWaitSync(void *sync, GLbitfield flags, GLuint64 timeout) { #if defined(HAVE_OPENGL) || defined(HAVE_OPENGLES) && defined(HAVE_OPENGLES3) - glWaitSync(sync, flags, timeout); + glWaitSync((GLsync)sync, flags, timeout); #endif } diff --git a/libretro-common/include/glsm/glsmsym.h b/libretro-common/include/glsm/glsmsym.h index b00908ba61..f261570717 100644 --- a/libretro-common/include/glsm/glsmsym.h +++ b/libretro-common/include/glsm/glsmsym.h @@ -393,8 +393,8 @@ void rglTexSubImage2D( GLenum target, GLenum type, const GLvoid * pixels); void rglDeleteVertexArrays(GLsizei n, const GLuint *arrays); -GLsync rglFenceSync(GLenum condition, GLbitfield flags); -void rglWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout); +void *rglFenceSync(GLenum condition, GLbitfield flags); +void rglWaitSync(void *data, GLbitfield flags, GLuint64 timeout); RETRO_END_DECLS From afe68b2a6205ab971912e78809aa6fb7f964f20a Mon Sep 17 00:00:00 2001 From: radius Date: Mon, 6 Jun 2016 19:22:43 -0500 Subject: [PATCH 04/66] [nk] allow picking core and content on demo window --- menu/drivers/nuklear.c | 20 +------- menu/drivers/nuklear/nk_menu.h | 4 +- menu/drivers/nuklear/nk_wnd_file_picker.c | 11 +++-- menu/drivers/nuklear/nk_wnd_main.c | 57 ++++++++++++++++++++++- 4 files changed, 66 insertions(+), 26 deletions(-) diff --git a/menu/drivers/nuklear.c b/menu/drivers/nuklear.c index 0ae78b97e7..28115baa0e 100644 --- a/menu/drivers/nuklear.c +++ b/menu/drivers/nuklear.c @@ -48,34 +48,19 @@ #include "../../verbosity.h" #include "../../tasks/tasks_internal.h" +/* this is the main control function, it opens and closes windows, */ static void nk_menu_main(nk_menu_handle_t *nk) { - settings_t *settings = config_get_ptr(); struct nk_context *ctx = &nk->ctx; - static char out[PATH_MAX_LENGTH]; - if (nk->window[NK_WND_SETTINGS].open) nk_wnd_settings(nk); - if (nk->window[NK_WND_FILE_PICKER].open) - { - if (nk_wnd_file_picker(nk, settings->directory.menu_content, out, ".zip")) - { - RARCH_LOG ("%s selected\n", out); - nk_window_close(&nk->ctx, "Select File"); - } - } if (nk->window[NK_WND_SHADER_PARAMETERS].open) nk_wnd_shader_parameters(nk); if (nk->window[NK_WND_MAIN].open) - nk_wnd_main(nk); - - nk->window[NK_WND_SETTINGS].open = !nk_window_is_closed(ctx, "Settings"); - nk->window[NK_WND_FILE_PICKER].open = !nk_window_is_closed(ctx, "Select File"); - nk->window[NK_WND_SHADER_PARAMETERS].open = !nk_window_is_closed(ctx, "Shader Parameters"); - nk->window[NK_WND_MAIN].open = !nk_window_is_closed(ctx, "Main"); + nk_wnd_main(nk, "Demo"); nk_buffer_info(&nk->status, &nk->ctx.memory); } @@ -311,7 +296,6 @@ static void *nk_menu_init(void **userdata) nk->window[i].open = true; #else nk->window[NK_WND_MAIN].open = true; - nk->window[NK_WND_FILE_PICKER].open = true; #endif return menu; diff --git a/menu/drivers/nuklear/nk_menu.h b/menu/drivers/nuklear/nk_menu.h index a62b8cf9d3..74d8d1a0c6 100644 --- a/menu/drivers/nuklear/nk_menu.h +++ b/menu/drivers/nuklear/nk_menu.h @@ -86,8 +86,8 @@ typedef struct nk_menu_handle } nk_menu_handle_t; void nk_wnd_shader_parameters(nk_menu_handle_t *nk); -void nk_wnd_main(nk_menu_handle_t *nk); -bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const char* filter); +void nk_wnd_main(nk_menu_handle_t *nk, const char* title); +bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, char* filter); void nk_wnd_settings(nk_menu_handle_t *nk); void nk_wnd_set_state(nk_menu_handle_t *nk, const int id, struct nk_vec2 pos, struct nk_vec2 size); diff --git a/menu/drivers/nuklear/nk_wnd_file_picker.c b/menu/drivers/nuklear/nk_wnd_file_picker.c index 758e8002aa..47c3171271 100644 --- a/menu/drivers/nuklear/nk_wnd_file_picker.c +++ b/menu/drivers/nuklear/nk_wnd_file_picker.c @@ -61,7 +61,7 @@ void load_icons(nk_menu_handle_t *nk) assets_loaded = true; } -bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const char* filter) +bool nk_wnd_file_picker(nk_menu_handle_t *nk, char* title, char* in, char* out, char* filter) { struct nk_panel layout; struct nk_context *ctx = &nk->ctx; @@ -80,7 +80,6 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const c if (!string_is_empty(in) && string_is_empty(path)) { - RARCH_LOG("beep\n"); strlcpy(path, in, sizeof(path)); files = dir_list_new(path, filter, true, true); } @@ -88,7 +87,7 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const c if (!assets_loaded) load_icons(nk); - if (nk_begin(ctx, &layout, "Select File", nk_rect(10, 10, 500, 400), + if (nk_begin(ctx, &layout, title, nk_rect(10, 10, 500, 400), NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| NK_WINDOW_BORDER)) { @@ -136,7 +135,12 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const c nk_layout_row_dynamic(ctx, 30, 1); { if (nk_button_text(ctx, "OK", 2, NK_BUTTON_DEFAULT)) + { ret = true; + strlcpy(out, path, sizeof(path)); + nk->window[NK_WND_FILE_PICKER].open = false; + path[0] = '\0'; + } } } @@ -144,7 +148,6 @@ bool nk_wnd_file_picker(nk_menu_handle_t *nk, const char* in, char* out, const c dir_list_sort(files, true); /* copy the path variable to out*/ - strlcpy(out, path, sizeof(path)); /* save position and size to restore after context reset */ nk_wnd_set_state(nk, id, nk_window_get_position(ctx), nk_window_get_size(ctx)); diff --git a/menu/drivers/nuklear/nk_wnd_main.c b/menu/drivers/nuklear/nk_wnd_main.c index 14a8e3cf76..a225a74b5c 100644 --- a/menu/drivers/nuklear/nk_wnd_main.c +++ b/menu/drivers/nuklear/nk_wnd_main.c @@ -29,19 +29,72 @@ #include "../../menu_driver.h" #include "../../menu_hash.h" -void nk_wnd_main(nk_menu_handle_t *nk) +static char* out; +static char core[PATH_MAX_LENGTH] = {0}; +static char content[PATH_MAX_LENGTH] = {0}; +float ratio[] = {0.85f, 0.15f}; + +void nk_wnd_main(nk_menu_handle_t *nk, const char* title) { unsigned i; video_shader_ctx_t shader_info; struct nk_panel layout; struct nk_context *ctx = &nk->ctx; const int id = NK_WND_MAIN; + settings_t *settings = config_get_ptr(); - if (nk_begin(ctx, &layout, "Main", nk_rect(240, 10, 300, 400), + static char picker_filter[PATH_MAX_LENGTH]; + static char picker_title[PATH_MAX_LENGTH]; + static char* picker_startup_dir; + + int len_core, len_content = 0; + + if (!out) + out = &core; + + if (!string_is_empty(core)) + len_core = strlen(path_basename(core)); + if (!string_is_empty(content)) + len_content = strlen(content); + + if (nk->window[NK_WND_FILE_PICKER].open) + { + if (nk_wnd_file_picker(nk, picker_title, picker_startup_dir, out, picker_filter)) + { + RARCH_LOG ("%s selected\n", out); + nk_window_close(&nk->ctx, picker_title); + } + } + + + if (nk_begin(ctx, &layout, title, nk_rect(240, 10, 600, 400), NK_WINDOW_CLOSABLE|NK_WINDOW_MINIMIZABLE|NK_WINDOW_MOVABLE| NK_WINDOW_SCALABLE|NK_WINDOW_BORDER)) { nk_layout_row_dynamic(ctx, 30, 1); + nk_label(ctx,"Core:", NK_TEXT_LEFT); + nk_layout_row(ctx, NK_DYNAMIC, 30, 3, ratio); + nk_edit_string(ctx, NK_EDIT_SIMPLE, path_basename(core), &len_core, 64, nk_filter_default); + if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT)) + { + out = &core; + strlcpy(picker_title, "Select core", sizeof(picker_title)); + strlcpy(picker_filter, ".dll", sizeof(picker_filter)); + picker_startup_dir = settings->directory.libretro; + nk->window[NK_WND_FILE_PICKER].open = true; + } + nk_layout_row_dynamic(ctx, 30, 1); + nk_label(ctx,"Content:", NK_TEXT_LEFT); + nk_layout_row(ctx, NK_DYNAMIC, 30, 3, ratio); + nk_edit_string(ctx, NK_EDIT_SIMPLE, content, &len_content, 64, nk_filter_default); + if (nk_button_text(ctx, "...", 3, NK_BUTTON_DEFAULT)) + { + out = &content; + strlcpy(picker_title, "Select content", sizeof(picker_title)); + strlcpy(picker_filter, ".zip", sizeof(picker_filter)); + picker_startup_dir = settings->directory.menu_content; + nk->window[NK_WND_FILE_PICKER].open = true; + } } /* save position and size to restore after context reset */ From d44062d8417ae3ee9975b46624885f3d47d49678 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 03:01:33 +0200 Subject: [PATCH 05/66] Make HAVE_HID completely optional --- Makefile.common | 16 +++++++++++----- griffin/griffin.c | 2 +- input/input_joypad_driver.c | 2 ++ list_special.c | 2 ++ qb/config.params.sh | 1 + 5 files changed, 17 insertions(+), 6 deletions(-) diff --git a/Makefile.common b/Makefile.common index bc5d1a7c38..3779ff8069 100644 --- a/Makefile.common +++ b/Makefile.common @@ -18,6 +18,10 @@ ifeq ($(HAVE_LIBRETRODB),) HAVE_LIBRETRODB = 1 endif +ifeq ($(HAVE_HID), 1) + DEFINES += -DHAVE_HID +endif + ifeq ($(HAVE_LIBRETRODB), 1) DEFINES += -DHAVE_LIBRETRODB endif @@ -154,7 +158,6 @@ OBJ += frontend/frontend.o \ libretro-common/hash/rhash.o \ audio/audio_driver.o \ input/input_driver.o \ - input/input_hid_driver.o \ gfx/video_coord_array.o \ gfx/video_driver.o \ camera/camera_driver.o \ @@ -206,7 +209,6 @@ OBJ += frontend/frontend.o \ input/drivers/nullinput.o \ input/drivers_hid/null_hid.o \ input/drivers_joypad/null_joypad.o \ - input/drivers_joypad/hid_joypad.o \ playlist.o \ movie.o \ record/record_driver.o \ @@ -595,19 +597,21 @@ endif ifeq ($(HAVE_LIBUSB), 1) ifeq ($(HAVE_THREADS), 1) +ifeq ($(HAVE_HID), 1) DEFINES += -DHAVE_LIBUSB OBJ += input/drivers_hid/libusb_hid.o LIBS += -lusb-1.0 - HAVE_HID = 1 +endif endif endif ifeq ($(HAVE_IOHIDMANAGER), 1) +ifeq ($(HAVE_HID), 1) DEFINES += -DHAVE_IOHIDMANAGER OBJ += input/drivers_hid/iohidmanager_hid.o - HAVE_HID = 1 LIBS += -framework IOKit endif +endif ifeq ($(HAVE_CORELOCATION), 1) DEFINES += -DHAVE_CORELOCATION @@ -616,7 +620,9 @@ endif ifeq ($(HAVE_HID), 1) DEFINES += -DHAVE_HID - OBJ += input/connect/joypad_connection.o \ + OBJ += input/input_hid_driver.o \ + input/drivers_joypad/hid_joypad.o \ + input/connect/joypad_connection.o \ input/connect/connect_ps2adapter.o \ input/connect/connect_ps3.o \ input/connect/connect_ps4.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 2c0727da27..f7c3dcc143 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -442,6 +442,7 @@ INPUT (HID) ============================================================ */ #include "../input/drivers_joypad/hid_joypad.c" +#ifdef HAVE_HID #include "../input/drivers_hid/null_hid.c" #if defined(HAVE_LIBUSB) && defined(HAVE_THREADS) @@ -460,7 +461,6 @@ INPUT (HID) #include "../input/drivers_hid/wiiusb_hid.c" #endif -#ifdef HAVE_HID #include "../input/connect/joypad_connection.c" #include "../input/connect/connect_ps3.c" #include "../input/connect/connect_ps4.c" diff --git a/input/input_joypad_driver.c b/input/input_joypad_driver.c index 5f699e8019..5c733cbc66 100644 --- a/input/input_joypad_driver.c +++ b/input/input_joypad_driver.c @@ -68,7 +68,9 @@ static input_device_driver_t *joypad_drivers[] = { #ifdef HAVE_MFI &mfi_joypad, #endif +#ifdef HAVE_HID &hid_joypad, +#endif &null_joypad, NULL, }; diff --git a/list_special.c b/list_special.c index 2f1064d81e..60cd0a8ff4 100644 --- a/list_special.c +++ b/list_special.c @@ -202,6 +202,7 @@ struct string_list *string_list_new_special(enum string_list_type type, } break; case STRING_LIST_INPUT_HID_DRIVERS: +#ifdef HAVE_HID for (i = 0; hid_driver_find_handle(i); i++) { const char *opt = hid_driver_find_ident(i); @@ -209,6 +210,7 @@ struct string_list *string_list_new_special(enum string_list_type type, string_list_append(s, opt, attr); } +#endif break; case STRING_LIST_INPUT_JOYPAD_DRIVERS: for (i = 0; joypad_driver_find_handle(i); i++) diff --git a/qb/config.params.sh b/qb/config.params.sh index 187b05fe71..4a8eba10a2 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -82,3 +82,4 @@ HAVE_RPNG=yes # RPNG support HAVE_RBMP=yes # RBMP support HAVE_RJPEG=yes # RJPEG support HAVE_RTGA=yes # RTGA support +HAVE_HID=yes # Low-level HID (Human Interface Device) support From 6fc943228e6705360da4ebbfc5cb5f5e87949d63 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 04:07:12 +0200 Subject: [PATCH 06/66] Create libretro-common/include/compat/intrinsics.h --- libretro-common/algorithms/mismatch.c | 27 +-------- libretro-common/include/compat/intrinsics.h | 65 +++++++++++++++++++++ 2 files changed, 66 insertions(+), 26 deletions(-) create mode 100644 libretro-common/include/compat/intrinsics.h diff --git a/libretro-common/algorithms/mismatch.c b/libretro-common/algorithms/mismatch.c index 1d7892cc82..b7997023ff 100644 --- a/libretro-common/algorithms/mismatch.c +++ b/libretro-common/algorithms/mismatch.c @@ -26,6 +26,7 @@ #include #include +#include #if defined(__x86_64__) || defined(__i386__) || defined(__i486__) || defined(__i686__) #define CPU_X86 @@ -40,32 +41,6 @@ #include #endif -#if __SSE2__ -#if defined(__GNUC__) -static INLINE int compat_ctz(unsigned x) -{ - return __builtin_ctz(x); -} -#else - -/* Only checks at nibble granularity, - * because that's what we need. */ - -static INLINE int compat_ctz(unsigned x) -{ - if (x & 0x000f) - return 0; - if (x & 0x00f0) - return 4; - if (x & 0x0f00) - return 8; - if (x & 0xf000) - return 12; - return 16; -} -#endif -#endif - /* There's no equivalent in libc, you'd think so ... * std::mismatch exists, but it's not optimized at all. */ size_t find_change(const uint16_t *a, const uint16_t *b) diff --git a/libretro-common/include/compat/intrinsics.h b/libretro-common/include/compat/intrinsics.h new file mode 100644 index 0000000000..4f38d1d6d5 --- /dev/null +++ b/libretro-common/include/compat/intrinsics.h @@ -0,0 +1,65 @@ +/* Copyright (C) 2010-2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (intrinsics.h). + * --------------------------------------------------------------------------------------- + * + * Permission is hereby granted, free of charge, + * to any person obtaining a copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, + * and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +#ifndef __LIBRETRO_SDK_COMPAT_INTRINSICS_H +#define __LIBRETRO_SDK_COMPAT_INTRINSICS_H + +#include +#include + +#include +#include + +RETRO_BEGIN_DECLS + +#if defined(__GNUC__) +static INLINE int compat_ctz(unsigned x) +{ + return __builtin_ctz(x); +} +#elif defined(_MSC_VER) && defined(_MSC_VER >= 1400) +static INLINE int compat_ctz(unsigned x) +{ + int r = 0; + _BitScanReverse(&r, x); + return r; +} +#else +/* Only checks at nibble granularity, + * because that's what we need. */ +static INLINE int compat_ctz(unsigned x) +{ + if (x & 0x000f) + return 0; + if (x & 0x00f0) + return 4; + if (x & 0x0f00) + return 8; + if (x & 0xf000) + return 12; + return 16; +} +#endif + +RETRO_END_DECLS + +#endif From 53701a565f7f6270bccbffa96c0e85b873d85a4c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 04:15:27 +0200 Subject: [PATCH 07/66] Add compat_clz_u16 --- libretro-common/include/compat/intrinsics.h | 22 ++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/libretro-common/include/compat/intrinsics.h b/libretro-common/include/compat/intrinsics.h index 4f38d1d6d5..9072b6cfa0 100644 --- a/libretro-common/include/compat/intrinsics.h +++ b/libretro-common/include/compat/intrinsics.h @@ -23,14 +23,34 @@ #ifndef __LIBRETRO_SDK_COMPAT_INTRINSICS_H #define __LIBRETRO_SDK_COMPAT_INTRINSICS_H -#include +#include #include +#include #include #include RETRO_BEGIN_DECLS +/* Count Leading Zero, unsigned 16bit input value */ +static INLINE unsigned compat_clz_u16(uint16_t val) +{ +#ifdef __GNUC__ + return __builtin_clz(val << 16 | 0x8000); +#else + unsigned ret = 0; + + while(!(val & 0x8000) && ret < 16) + { + val <<= 1; + ret++; + } + + return ret; +#endif +} + +/* Count Trailing Zero */ #if defined(__GNUC__) static INLINE int compat_ctz(unsigned x) { From d14444e0fc0a95a70f8e155b82d7aa4a2004cb0f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 04:22:21 +0200 Subject: [PATCH 08/66] Include intrin.h header for MSVC --- libretro-common/include/compat/intrinsics.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretro-common/include/compat/intrinsics.h b/libretro-common/include/compat/intrinsics.h index 9072b6cfa0..8e58f70d56 100644 --- a/libretro-common/include/compat/intrinsics.h +++ b/libretro-common/include/compat/intrinsics.h @@ -30,6 +30,10 @@ #include #include +#ifdef _MSC_VER +#include +#endif + RETRO_BEGIN_DECLS /* Count Leading Zero, unsigned 16bit input value */ From b1fe3506d75a9691945957c47af243a9b5c40ea8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 04:48:06 +0200 Subject: [PATCH 09/66] Change preprocessor conditional --- libretro-common/include/compat/intrinsics.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro-common/include/compat/intrinsics.h b/libretro-common/include/compat/intrinsics.h index 8e58f70d56..994bccbef8 100644 --- a/libretro-common/include/compat/intrinsics.h +++ b/libretro-common/include/compat/intrinsics.h @@ -60,7 +60,7 @@ static INLINE int compat_ctz(unsigned x) { return __builtin_ctz(x); } -#elif defined(_MSC_VER) && defined(_MSC_VER >= 1400) +#elif _MSC_VER >= 1400 static INLINE int compat_ctz(unsigned x) { int r = 0; From 175ec671127f0000a2000e6c4987b859f048d36f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 05:15:22 +0200 Subject: [PATCH 10/66] Compile in hid_joypad.c only when HAVE_HID is defined --- griffin/griffin.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index f7c3dcc143..c84ccb4285 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -440,9 +440,8 @@ INPUT /*============================================================ INPUT (HID) ============================================================ */ -#include "../input/drivers_joypad/hid_joypad.c" - #ifdef HAVE_HID +#include "../input/drivers_joypad/hid_joypad.c" #include "../input/drivers_hid/null_hid.c" #if defined(HAVE_LIBUSB) && defined(HAVE_THREADS) From 689b95f2f27ebb3bb9d93fa331cd9683d4c39d5d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 05:39:51 +0200 Subject: [PATCH 11/66] Don't compile in input_hid_driver.c either --- griffin/griffin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index c84ccb4285..fd261fac30 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -356,7 +356,6 @@ INPUT ============================================================ */ #include "../input/input_autodetect.c" #include "../input/input_joypad_driver.c" -#include "../input/input_hid_driver.c" #include "../input/input_config.c" #include "../input/input_keymaps.c" #include "../input/input_remapping.c" @@ -441,6 +440,7 @@ INPUT INPUT (HID) ============================================================ */ #ifdef HAVE_HID +#include "../input/input_hid_driver.c" #include "../input/drivers_joypad/hid_joypad.c" #include "../input/drivers_hid/null_hid.c" From 63af59a198b2d21fd7e007b1043a9ef76fc92f43 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 06:05:41 +0200 Subject: [PATCH 12/66] Add HAVE_LANGEXTRA --- Makefile.common | 39 +++++++++++-------- Makefile.griffin | 7 ++++ Makefile.ps3 | 2 +- Makefile.psp1 | 2 +- configuration.c | 6 +++ configuration.h | 2 + dynamic.c | 2 + menu/menu_hash.c | 4 ++ menu/menu_setting.c | 4 ++ msg_hash.c | 2 + pkg/android/phoenix/jni/Android.mk | 2 +- pkg/android/phoenix/jni/Android2.mk | 2 +- pkg/apple/RetroArch.xcodeproj/project.pbxproj | 4 ++ .../RetroArch_PPC.xcodeproj/project.pbxproj | 2 + .../RetroArch_iOS.xcodeproj/project.pbxproj | 11 ++++++ pkg/msvc/RetroArch-360/RetroArch-360.vcxproj | 12 +++--- .../RetroArch-Xbox1/RetroArch-Xbox1.vcproj | 14 +++---- pkg/msvc/msvc-2010/RetroArch-msvc2010.vcxproj | 8 ++-- pkg/qnx/bb10/.cproject | 7 ++++ qb/config.params.sh | 1 + 20 files changed, 96 insertions(+), 37 deletions(-) diff --git a/Makefile.common b/Makefile.common index 3779ff8069..1de457b311 100644 --- a/Makefile.common +++ b/Makefile.common @@ -122,14 +122,6 @@ OBJ += frontend/frontend.o \ input/input_keyboard.o \ command.o \ msg_hash.o \ - intl/msg_hash_de.o \ - intl/msg_hash_eo.o \ - intl/msg_hash_es.o \ - intl/msg_hash_fr.o \ - intl/msg_hash_it.o \ - intl/msg_hash_nl.o \ - intl/msg_hash_pl.o \ - intl/msg_hash_pt.o \ intl/msg_hash_us.o \ runloop.o \ libretro-common/algorithms/mismatch.o \ @@ -217,6 +209,29 @@ OBJ += frontend/frontend.o \ performance_counters.o \ verbosity.o +ifeq ($(HAVE_LANGEXTRA), 1) +DEFINES += -DHAVE_LANGEXTRA +OBJ += intl/msg_hash_de.o \ + intl/msg_hash_eo.o \ + intl/msg_hash_es.o \ + intl/msg_hash_fr.o \ + intl/msg_hash_it.o \ + intl/msg_hash_nl.o \ + intl/msg_hash_pl.o \ + intl/msg_hash_pt.o + +ifeq ($(HAVE_MENU), 1) +OBJ += menu/intl/menu_hash_de.o \ + menu/intl/menu_hash_es.o \ + menu/intl/menu_hash_eo.o \ + menu/intl/menu_hash_fr.o \ + menu/intl/menu_hash_it.o \ + menu/intl/menu_hash_nl.o \ + menu/intl/menu_hash_pl.o \ + menu/intl/menu_hash_pt.o +endif +endif + ifneq ($(HAVE_GETOPT_LONG), 1) OBJ += libretro-common/compat/compat_getopt.o endif @@ -466,14 +481,6 @@ ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/menu_hash.o \ menu/menu_driver.o \ menu/menu_content.o \ - menu/intl/menu_hash_de.o \ - menu/intl/menu_hash_es.o \ - menu/intl/menu_hash_eo.o \ - menu/intl/menu_hash_fr.o \ - menu/intl/menu_hash_it.o \ - menu/intl/menu_hash_nl.o \ - menu/intl/menu_hash_pl.o \ - menu/intl/menu_hash_pt.o \ menu/intl/menu_hash_us$(PSEUDO_NS).o \ menu/menu_input.o \ menu/menu_entry.o \ diff --git a/Makefile.griffin b/Makefile.griffin index 3cdb7f905f..2d3a09d8c8 100644 --- a/Makefile.griffin +++ b/Makefile.griffin @@ -137,6 +137,7 @@ endif RARCH_CONSOLE = 1 ifeq ($(platform), wii) + HAVE_LANGEXTRA := 1 HAVE_WIIUSB_HID := 1 HAVE_RARCH_EXEC := 1 HAVE_RSOUND := 1 @@ -192,6 +193,7 @@ else ifeq ($(platform), psp1) HAVE_RBMP := 1 HAVE_RTGA := 1 HAVE_KERNEL_PRX := 1 + HAVE_LANGEXTRA := 1 RARCH_CONSOLE = 1 ifeq ($(BUILD_PRX), 1) @@ -220,6 +222,7 @@ else ifeq ($(platform), vita) HAVE_FILTERS_BUILTIN := 1 HAVE_BUILTIN_AUTOCONFIG := 1 + HAVE_LANGEXTRA := 1 HAVE_RPNG := 1 HAVE_RJPEG := 1 HAVE_RBMP := 1 @@ -330,6 +333,10 @@ endif CFLAGS += -std=gnu99 -DSINC_LOWER_QUALITY -DHAVE_RGUI -DHAVE_MENU -DHAVE_GRIFFIN=1 -Wno-char-subscripts -DRARCH_INTERNAL +ifeq ($(HAVE_LANGEXTRA), 1) +CFLAGS += -DHAVE_LANGEXTRA +endif + ifeq ($(HAVE_FILTERS_BUILTIN), 1) CFLAGS += -DHAVE_FILTERS_BUILTIN endif diff --git a/Makefile.ps3 b/Makefile.ps3 index 59017bd929..6eca1312b3 100644 --- a/Makefile.ps3 +++ b/Makefile.ps3 @@ -106,7 +106,7 @@ PPU_LDLIBS = $(FONT_LIBS) $(GL_LIBS) $(WHOLE_START) -lretro_ps3 $(WHOLE_END) -l PPU_RANLIB = $(CELL_SDK)/host-win32/ppu/bin/ppu-lv2-ranlib.exe -DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG +DEFINES += -DHAVE_THREADS -DRARCH_CONSOLE -DHAVE_OPENGL -DHAVE_HEADSET -DHAVE_LANGEXTRA -DHAVE_OPENGLES -DHAVE_OPENGLES1 -DHAVE_PSGL -DHAVE_CG -DHAVE_CG_RUNTIME_COMPILER -DHAVE_FBO -DHAVE_SYSMODULES -DHAVE_SYSUTILS -DHAVE_RARCH_EXEC -DHAVE_RSOUND -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DHAVE_7Z -DWANT_ZLIB -DSINC_LOWER_QUALITY -D__CELLOS_LV2__ -DHAVE_NETPLAY=1 -DHAVE_NETWORKING=1 -DHAVE_SOCKET_LEGACY=1 -DHAVE_MOUSE -DHAVE_GRIFFIN=1 -DHAVE_MULTIMAN=1 -DPC_DEVELOPMENT_IP_ADDRESS=\"$(PC_DEVELOPMENT_IP_ADDRESS)\" -DPC_DEVELOPMENT_UDP_PORT=$(PC_DEVELOPMENT_UDP_PORT) -DHAVE_FILTERS_BUILTIN -DHAVE_BUILTIN_AUTOCONFIG ifeq ($(DEBUG), 1) PPU_OPTIMIZE_LV := -O0 -g diff --git a/Makefile.psp1 b/Makefile.psp1 index f4b71b78da..984996eaf0 100644 --- a/Makefile.psp1 +++ b/Makefile.psp1 @@ -23,7 +23,7 @@ INCDIR = deps/zlib deps/7zip libretro-common/include CFLAGS = $(OPTIMIZE_LV) -G0 -std=gnu99 -ffast-math ASFLAGS = $(CFLAGS) -RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP +RARCH_DEFINES = -DPSP -D_MIPS_ARCH_ALLEGREX -DHAVE_LANGEXTRA -DHAVE_ZLIB -DHAVE_RPNG -DHAVE_RJPEG -DWANT_ZLIB -DHAVE_GRIFFIN=1 -DRARCH_INTERNAL -DRARCH_CONSOLE -DHAVE_MENU -DHAVE_RGUI -DSINC_LOWEST_QUALITY -DHAVE_BUILTIN_AUTOCONFIG -DHAVE_FILTERS_BUILTIN -DHAVE_7ZIP LIBDIR = LDFLAGS = diff --git a/configuration.c b/configuration.c index 2c4616c514..fbf5d42004 100644 --- a/configuration.c +++ b/configuration.c @@ -777,7 +777,9 @@ static void config_set_defaults(void) settings->menu_scroll_down_btn = default_menu_btn_scroll_down; settings->menu_scroll_up_btn = default_menu_btn_scroll_up; +#ifdef HAVE_LANGEXTRA settings->user_language = 0; +#endif global->console.sound.system_bgm_enable = false; @@ -1773,7 +1775,9 @@ static bool config_load_file(const char *path, bool set_defaults) if (!rarch_ctl(RARCH_CTL_HAS_SET_USERNAME, NULL)) config_get_path(conf, "netplay_nickname", settings->username, sizeof(settings->username)); +#ifdef HAVE_LANGEXTRA CONFIG_GET_INT_BASE(conf, settings, user_language, "user_language"); +#endif #ifdef HAVE_NETPLAY if (!global->has_set.netplay_mode) CONFIG_GET_BOOL_BASE(conf, global, netplay.is_spectate, @@ -2895,7 +2899,9 @@ bool config_save_file(const char *path) config_set_int(conf, "netplay_delay_frames", global->netplay.sync_frames); #endif config_set_string(conf, "netplay_nickname", settings->username); +#ifdef HAVE_LANGEXTRA config_set_int(conf, "user_language", settings->user_language); +#endif config_set_bool(conf, "custom_bgm_enable", global->console.sound.system_bgm_enable); diff --git a/configuration.h b/configuration.h index 4dea82b897..95fa5e9571 100644 --- a/configuration.h +++ b/configuration.h @@ -404,7 +404,9 @@ typedef struct settings unsigned menu_scroll_up_btn; char username[32]; +#ifdef HAVE_LANGEXTRA unsigned int user_language; +#endif bool config_save_on_exit; diff --git a/dynamic.c b/dynamic.c index 29ec690b9f..c5e5cac8e1 100644 --- a/dynamic.c +++ b/dynamic.c @@ -901,9 +901,11 @@ bool rarch_environment_cb(unsigned cmd, void *data) break; case RETRO_ENVIRONMENT_GET_LANGUAGE: +#ifdef HAVE_LANGEXTRA *(unsigned *)data = settings->user_language; RARCH_LOG("Environ GET_LANGUAGE: \"%u\".\n", settings->user_language); +#endif break; case RETRO_ENVIRONMENT_SET_PIXEL_FORMAT: diff --git a/menu/menu_hash.c b/menu/menu_hash.c index 145e5daae3..8c7ed377b0 100644 --- a/menu/menu_hash.c +++ b/menu/menu_hash.c @@ -31,6 +31,7 @@ const char *menu_hash_to_str(uint32_t hash) if (!settings) return "null"; +#ifdef HAVE_LANGEXTRA switch (settings->user_language) { case RETRO_LANGUAGE_FRENCH: @@ -60,6 +61,7 @@ const char *menu_hash_to_str(uint32_t hash) default: break; } +#endif if (ret && !string_is_equal(ret, "null")) return ret; @@ -75,6 +77,7 @@ int menu_hash_get_help(uint32_t hash, char *s, size_t len) if (!settings) return -1; +#ifdef HAVE_LANGEXTRA switch (settings->user_language) { case RETRO_LANGUAGE_FRENCH: @@ -104,6 +107,7 @@ int menu_hash_get_help(uint32_t hash, char *s, size_t len) default: break; } +#endif if (ret == 0) return ret; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 10655aee10..fd7a3f4422 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1147,6 +1147,7 @@ static void setting_get_string_representation_uint_autosave_interval(void *data, } #endif +#ifdef HAVE_LANGEXTRA static void setting_get_string_representation_uint_user_language(void *data, char *s, size_t len) { @@ -1171,6 +1172,7 @@ static void setting_get_string_representation_uint_user_language(void *data, if (settings) strlcpy(s, modes[settings->user_language], len); } +#endif static void setting_get_string_representation_uint_libretro_log_level(void *data, char *s, size_t len) @@ -6776,6 +6778,7 @@ static bool setting_append_list( general_read_handler); settings_data_list_current_add_flags(list, list_info, SD_FLAG_ALLOW_INPUT); +#ifdef HAVE_LANGEXTRA CONFIG_UINT( list, list_info, &settings->user_language, @@ -6799,6 +6802,7 @@ static bool setting_append_list( menu_settings_list_current_add_cmd(list, list_info, CMD_EVENT_MENU_REFRESH); (*list)[list_info->index - 1].get_string_representation = &setting_get_string_representation_uint_user_language; +#endif END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); diff --git a/msg_hash.c b/msg_hash.c index fc0dbe3b6b..06ef0994bb 100644 --- a/msg_hash.c +++ b/msg_hash.c @@ -30,6 +30,7 @@ const char *msg_hash_to_str(uint32_t hash) if (!settings) goto end; +#ifdef HAVE_LANGEXTRA switch (settings->user_language) { case RETRO_LANGUAGE_FRENCH: @@ -64,6 +65,7 @@ const char *msg_hash_to_str(uint32_t hash) default: break; } +#endif if (ret && !string_is_equal(ret, "null")) return ret; diff --git a/pkg/android/phoenix/jni/Android.mk b/pkg/android/phoenix/jni/Android.mk index f3ae77bede..f9cba21737 100644 --- a/pkg/android/phoenix/jni/Android.mk +++ b/pkg/android/phoenix/jni/Android.mk @@ -53,7 +53,7 @@ else GLES_LIB := -lGLESv2 endif -DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_EGL -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_SHADERPIPELINE -DHAVE_LIBRETRODB -DHAVE_STB_FONT +DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DHAVE_LANGEXTRA -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_EGL -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_SHADERPIPELINE -DHAVE_LIBRETRODB -DHAVE_STB_FONT DEFINES += -DWANT_IFADDRS ifeq ($(HAVE_VULKAN),1) diff --git a/pkg/android/phoenix/jni/Android2.mk b/pkg/android/phoenix/jni/Android2.mk index 11f93147a1..30de1776b5 100644 --- a/pkg/android/phoenix/jni/Android2.mk +++ b/pkg/android/phoenix/jni/Android2.mk @@ -53,7 +53,7 @@ else GLES_LIB := -lGLESv2 endif -DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_SHADERPIPELINE -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT +DEFINES += -DRARCH_MOBILE -DHAVE_GRIFFIN -DHAVE_LANGEXTRA -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DHAVE_ZLIB_DEFLATE -DHAVE_RPNG -DHAVE_RJPEG -DHAVE_RBMP -DHAVE_RTGA -DINLINE=inline -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DHAVE_NETWORKING -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_MATERIALUI -DHAVE_XMB -DHAVE_SHADERPIPELINE -std=gnu99 -DHAVE_LIBRETRODB -DHAVE_STB_FONT DEFINES += -DWANT_IFADDRS ifeq ($(HAVE_VULKAN),1) diff --git a/pkg/apple/RetroArch.xcodeproj/project.pbxproj b/pkg/apple/RetroArch.xcodeproj/project.pbxproj index dd6055a15c..bca6023b49 100644 --- a/pkg/apple/RetroArch.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch.xcodeproj/project.pbxproj @@ -383,6 +383,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.5; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORETEXT", @@ -448,6 +449,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.5; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_IOHIDMANAGER", @@ -515,6 +517,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.5; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORETEXT", @@ -579,6 +582,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.5; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_IOHIDMANAGER", diff --git a/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj index 0a69db10d3..ee01406c5c 100644 --- a/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj @@ -282,6 +282,7 @@ ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_STB_FONT", "-DHAVE_IOHIDMANAGER", @@ -355,6 +356,7 @@ "-DNS_BLOCK_ASSERTIONS=1", "-DNDEBUG", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_STB_FONT", "-DHAVE_IOHIDMANAGER", diff --git a/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj index 9781baba64..36296df892 100644 --- a/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_iOS.xcodeproj/project.pbxproj @@ -521,6 +521,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -598,6 +599,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -646,6 +648,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -723,6 +726,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORETEXT", @@ -796,6 +800,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -841,6 +846,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -918,6 +924,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -984,6 +991,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -1051,6 +1059,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -1127,6 +1136,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", @@ -1175,6 +1185,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", "-DHAVE_CORELOCATION", diff --git a/pkg/msvc/RetroArch-360/RetroArch-360.vcxproj b/pkg/msvc/RetroArch-360/RetroArch-360.vcxproj index 8f15dd0c31..56b84ce6d6 100644 --- a/pkg/msvc/RetroArch-360/RetroArch-360.vcxproj +++ b/pkg/msvc/RetroArch-360/RetroArch-360.vcxproj @@ -113,7 +113,7 @@ true false MultiThreadedDebug - _DEBUG;_XBOX;DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + _DEBUG;_XBOX;DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;%(PreprocessorDefinitions);_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN Callcap $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) @@ -152,7 +152,7 @@ AnalyzeOnly false MultiThreadedDebug - _DEBUG;_XBOX;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + _DEBUG;_XBOX;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN Callcap $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) @@ -192,7 +192,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + NDEBUG;_XBOX;PROFILE;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN Callcap $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) @@ -237,7 +237,7 @@ Size false MultiThreaded - NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XUI;HAVE_MENU;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + NDEBUG;_XBOX;PROFILE;FASTCAP;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XUI;HAVE_MENU;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) @@ -279,7 +279,7 @@ false false MultiThreaded - NDEBUG;_XBOX;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE=1;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XUI;HAVE_MENU;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + NDEBUG;_XBOX;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE=1;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XUI;HAVE_MENU;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) @@ -321,7 +321,7 @@ false false MultiThreaded - NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN + NDEBUG;_XBOX;LTCG;%(PreprocessorDefinitions);DONT_HAVE_STATE_TRACKER;HAVE_XINPUT2;_CRT_SECURE_NO_WARNINGS;RARCH_CONSOLE;HAVE_XUI;HAVE_MENU;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_SOCKET_LEGACY;HAVE_ZLIB;HAVE_RARCH_EXEC;D3DCOMPILE_USEVOIDS;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_HLSL;HAVE_D3D9;HAVE_D3D;RARCH_INTERNAL;MSB_FIRST;_XBOX360;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_XAUDIO;HAVE_RPNG;HAVE_RJPEG;HAVE_THREADS;HAVE_BUILTIN_AUTOCONFIG;HAVE_FILTERS_BUILTIN $(SolutionDir)\..\..\deps\zlib;$(SolutionDir)\..\..\libretro-common\include;$(SolutionDir)\..\..\;%(AdditionalIncludeDirectories) diff --git a/pkg/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj b/pkg/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj index bfce51ff68..01bd30767a 100644 --- a/pkg/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj +++ b/pkg/msvc/RetroArch-Xbox1/RetroArch-Xbox1.vcproj @@ -22,7 +22,7 @@ Optimization="3" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="_DEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" MinimalRebuild="TRUE" BasicRuntimeChecks="0" RuntimeLibrary="1" @@ -72,7 +72,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -127,7 +127,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;PROFILE;FASTCAP;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -188,7 +188,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_LANGEXTRA;inline=_inline;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -241,7 +241,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -300,7 +300,7 @@ EnableFiberSafeOptimizations="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;inline=_inline;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;HAVE_GRIFFIN;HAVE_LANGEXTRA;inline=_inline;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" @@ -353,7 +353,7 @@ OmitFramePointers="TRUE" OptimizeForProcessor="2" AdditionalIncludeDirectories=""$(SolutionDir)\..\..\libretro-common\include";"$(SolutionDir)\..\..\libretro-common\include\compat\msvc";"$(SolutionDir)\msvc-71";"$(SolutionDir)\..\..\deps\zlib"" - PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" + PreprocessorDefinitions="NDEBUG;_XBOX;_XBOX1;DONT_HAVE_STATE_TRACKER;HAVE_RGUI;HAVE_MENU;RARCH_CONSOLE;HAVE_XINPUT_XBOX1;__STDC_CONSTANT_MACROS;HAVE_ZLIB;LTCG;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_RARCH_EXEC;HAVE_DSOUND;HAVE_D3D;HAVE_D3D8;RARCH_INTERNAL;WANT_ZLIB;SINC_LOWER_QUALITY;HAVE_THREADS;HAVE_FILTERS_BUILTIN;HAVE_BUILTIN_AUTOCONFIG" StringPooling="TRUE" RuntimeLibrary="0" BufferSecurityCheck="TRUE" diff --git a/pkg/msvc/msvc-2010/RetroArch-msvc2010.vcxproj b/pkg/msvc/msvc-2010/RetroArch-msvc2010.vcxproj index 3b451c8ea1..f24f1da50a 100644 --- a/pkg/msvc/msvc-2010/RetroArch-msvc2010.vcxproj +++ b/pkg/msvc/msvc-2010/RetroArch-msvc2010.vcxproj @@ -100,7 +100,7 @@ Level3 Disabled - WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT + WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\gfx\inc;%(AdditionalIncludeDirectories) MultiThreadedDebug CompileAsCpp @@ -120,7 +120,7 @@ Level3 Disabled - WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT + WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;_DEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\gfx\inc;%(AdditionalIncludeDirectories) MultiThreadedDebug CompileAsCpp @@ -142,7 +142,7 @@ MaxSpeed true true - WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_GRIFFIN;HAVE_FBO;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_GL_SYNC;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT + WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;_CRT_NONSTDC_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;__SSE__;__i686__;HAVE_OVERLAY;HAVE_MENU;HAVE_RGUI;HAVE_GL_SYNC;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\gfx\inc;%(AdditionalIncludeDirectories) MultiThreaded CompileAsCpp @@ -167,7 +167,7 @@ MaxSpeed true true - WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT + WIN32;RARCH_INTERNAL;HAVE_D3D;HAVE_D3D9;HAVE_CG;HAVE_GLSL;HAVE_GRIFFIN;HAVE_LANGEXTRA;HAVE_FBO;HAVE_ZLIB;HAVE_XMB;HAVE_SHADERPIPELINE;WANT_ZLIB;HAVE_FBO;NDEBUG;_WINDOWS;%(PreprocessorDefinitions);HAVE_BUILTIN_AUTOCONFIG;HAVE_DINPUT;HAVE_XINPUT;HAVE_XAUDIO;HAVE_DSOUND;HAVE_OPENGL;HAVE_DYLIB;HAVE_NETPLAY;HAVE_NETWORKING;HAVE_NETWORK_CMD;HAVE_COMMAND;HAVE_STDIN_CMD;HAVE_THREADS;HAVE_DYNAMIC;HAVE_RPNG;HAVE_RJPEG;HAVE_RBMP;HAVE_RTGA;WANT_ZLIB;_CRT_SECURE_NO_WARNINGS;__SSE__;__SSE2__;__x86_64__;HAVE_OVERLAY;HAVE_RGUI;HAVE_GL_SYNC;HAVE_MENU;HAVE_7ZIP;HAVE_MATERIALUI;HAVE_LIBRETRODB;HAVE_STB_FONT $(MSBuildProjectDirectory);$(MSBuildProjectDirectory)\..\..\..\;$(CG_INC_PATH);$(MSBuildProjectDirectory)\..\..\..\deps\zlib;$(MSBuildProjectDirectory)\..\..\..\libretro-common\include;$(MSBuildProjectDirectory)\..\..\..\gfx\inc;%(AdditionalIncludeDirectories) MultiThreaded CompileAsCpp diff --git a/pkg/qnx/bb10/.cproject b/pkg/qnx/bb10/.cproject index eea6f5db12..b3f22dd489 100644 --- a/pkg/qnx/bb10/.cproject +++ b/pkg/qnx/bb10/.cproject @@ -47,6 +47,7 @@ + @@ -179,6 +180,7 @@ + @@ -313,6 +315,7 @@ + @@ -448,6 +451,7 @@ + @@ -581,6 +585,7 @@ + @@ -714,6 +719,7 @@ + @@ -848,6 +854,7 @@ + diff --git a/qb/config.params.sh b/qb/config.params.sh index 4a8eba10a2..c07d3205de 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -83,3 +83,4 @@ HAVE_RBMP=yes # RBMP support HAVE_RJPEG=yes # RJPEG support HAVE_RTGA=yes # RTGA support HAVE_HID=yes # Low-level HID (Human Interface Device) support +HAVE_LANGEXTRA=yes # Multi-language support From b45824a7a88821a665b27e256b7c1ee05afa35c1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 06:14:28 +0200 Subject: [PATCH 13/66] Reorder files in Makefile.common --- Makefile.common | 112 ++++++++++++++++++++-------------------- tasks/task_screenshot.c | 4 +- 2 files changed, 60 insertions(+), 56 deletions(-) diff --git a/Makefile.common b/Makefile.common index 1de457b311..e1039a84e9 100644 --- a/Makefile.common +++ b/Makefile.common @@ -110,6 +110,58 @@ ifneq ($(GIT_VERSION),) endif # General object files +OBJ += libretro-common/algorithms/mismatch.o \ + libretro-common/queues/task_queue.o \ + libretro-common/queues/fifo_queue.o \ + libretro-common/encodings/encoding_utf.o \ + libretro-common/lists/file_list.o \ + libretro-common/lists/dir_list.o \ + libretro-common/file/retro_dirent.o \ + libretro-common/streams/file_stream.o \ + libretro-common/streams/interface_stream.o \ + libretro-common/streams/memory_stream.o \ + libretro-common/file/retro_stat.o \ + libretro-common/lists/string_list.o \ + libretro-common/string/stdstring.o \ + libretro-common/memmap/memalign.o \ + libretro-common/file/nbio/nbio_stdio.o \ + libretro-common/file/file_path.o \ + libretro-common/hash/rhash.o \ + libretro-common/dynamic/dylib.o \ + libretro-common/queues/message_queue.o \ + libretro-common/compat/compat_fnmatch.o \ + libretro-common/compat/compat_posix_string.o \ + libretro-common/file/config_file.o \ + libretro-common/gfx/scaler/scaler.o \ + libretro-common/gfx/scaler/pixconv.o \ + libretro-common/gfx/scaler/scaler_int.o \ + libretro-common/gfx/scaler/scaler_filter.o \ + libretro-common/features/features_cpu.o \ + libretro-common/formats/image_texture.o \ + libretro-common/conversion/s16_to_float.o \ + libretro-common/conversion/float_to_s16.o \ + libretro-common/gfx/math/matrix_4x4.o \ + libretro-common/gfx/math/matrix_3x3.o \ + libretro-common/formats/json/jsonsax.o \ + libretro-common/formats/image_transfer.o + +ifneq ($(HAVE_GETOPT_LONG), 1) +OBJ += libretro-common/compat/compat_getopt.o +endif + +ifneq ($(HAVE_STRCASESTR), 1) +OBJ += libretro-common/compat/compat_strcasestr.o +endif + +ifneq ($(HAVE_STRL), 1) +OBJ += libretro-common/compat/compat_strl.o +endif + +ifeq ($(HAVE_NEON),1) + OBJ += libretro-common/conversion/s16_to_float_neon.o \ + libretro-common/conversion/float_to_s16_neon.o +endif + OBJ += frontend/frontend.o \ frontend/frontend_driver.o \ @@ -124,30 +176,14 @@ OBJ += frontend/frontend.o \ msg_hash.o \ intl/msg_hash_us.o \ runloop.o \ - libretro-common/algorithms/mismatch.o \ - libretro-common/queues/task_queue.o \ tasks/tasks_internal.o \ tasks/task_content.o \ tasks/task_save_ram.o \ tasks/task_save_state.o \ tasks/task_file_transfer.o \ tasks/task_image.o \ - libretro-common/encodings/encoding_utf.o \ - libretro-common/lists/file_list.o \ - libretro-common/lists/dir_list.o \ - libretro-common/file/retro_dirent.o \ - libretro-common/streams/file_stream.o \ - libretro-common/streams/interface_stream.o \ - libretro-common/streams/memory_stream.o \ - libretro-common/file/retro_stat.o \ - libretro-common/lists/string_list.o \ - libretro-common/string/stdstring.o \ - libretro-common/memmap/memalign.o \ list_special.o \ - libretro-common/file/nbio/nbio_stdio.o \ - libretro-common/file/file_path.o \ file_path_special.o \ - libretro-common/hash/rhash.o \ audio/audio_driver.o \ input/input_driver.o \ gfx/video_coord_array.o \ @@ -156,10 +192,8 @@ OBJ += frontend/frontend.o \ location/location_driver.o \ driver.o \ configuration.o \ - libretro-common/dynamic/dylib.o \ dynamic.o \ cores/dynamic_dummy.o \ - libretro-common/queues/message_queue.o \ managers/state_manager.o \ gfx/drivers_font_renderer/bitmapfont.o \ input/input_autodetect.o \ @@ -170,22 +204,14 @@ OBJ += frontend/frontend.o \ tasks/task_overlay.o \ input/input_overlay.o \ patch.o \ - libretro-common/queues/fifo_queue.o \ managers/core_option_manager.o \ - libretro-common/compat/compat_fnmatch.o \ - libretro-common/compat/compat_posix_string.o \ managers/cheat_manager.o \ core_info.o \ - libretro-common/file/config_file.o \ config_file_userdata.o \ tasks/task_screenshot.o \ - libretro-common/gfx/scaler/scaler.o \ gfx/drivers_shader/shader_null.o \ gfx/video_shader_driver.o \ gfx/video_shader_parse.o \ - libretro-common/gfx/scaler/pixconv.o \ - libretro-common/gfx/scaler/scaler_int.o \ - libretro-common/gfx/scaler/scaler_filter.o \ gfx/font_driver.o \ gfx/video_filter.o \ audio/audio_resampler_driver.o \ @@ -205,7 +231,6 @@ OBJ += frontend/frontend.o \ movie.o \ record/record_driver.o \ record/drivers/record_null.o \ - libretro-common/features/features_cpu.o \ performance_counters.o \ verbosity.o @@ -232,19 +257,6 @@ OBJ += menu/intl/menu_hash_de.o \ endif endif -ifneq ($(HAVE_GETOPT_LONG), 1) -OBJ += libretro-common/compat/compat_getopt.o -endif - -ifneq ($(HAVE_STRCASESTR), 1) -OBJ += libretro-common/compat/compat_strcasestr.o -endif - -ifneq ($(HAVE_STRL), 1) -OBJ += libretro-common/compat/compat_strl.o -endif - -OBJ += libretro-common/formats/image_texture.o ifeq ($(HAVE_IMAGEVIEWER), 1) DEFINES += -DHAVE_IMAGEVIEWER @@ -392,12 +404,6 @@ ifeq ($(HAVE_NEON),1) DEFINES += -DSINC_LOWER_QUALITY endif -OBJ += libretro-common/conversion/s16_to_float.o \ - libretro-common/conversion/float_to_s16.o -ifeq ($(HAVE_NEON),1) - OBJ += libretro-common/conversion/s16_to_float_neon.o \ - libretro-common/conversion/float_to_s16_neon.o -endif ifneq ($(findstring Win32,$(OS)),) HAVE_VULKAN=1 @@ -655,9 +661,7 @@ endif OBJ += gfx/video_context_driver.o \ gfx/drivers_context/gfx_null_ctx.o \ - gfx/video_state_tracker.o \ - libretro-common/gfx/math/matrix_4x4.o \ - libretro-common/gfx/math/matrix_3x3.o + gfx/video_state_tracker.o ifeq ($(HAVE_KMS), 1) HAVE_AND_WILL_USE_DRM = 1 @@ -953,13 +957,10 @@ endif ifeq ($(HAVE_RBMP), 1) DEFINES += -DHAVE_RBMP - OBJ += libretro-common/formats/bmp/rbmp.o + OBJ += libretro-common/formats/bmp/rbmp.o \ + libretro-common/formats/bmp/rbmp_encode.o endif -OBJ += libretro-common/formats/bmp/rbmp_encode.o \ - libretro-common/formats/json/jsonsax.o \ - libretro-common/formats/image_transfer.o - ifdef HAVE_COMPRESSION DEFINES += -DHAVE_COMPRESSION endif @@ -1035,7 +1036,8 @@ ifeq ($(HAVE_NETWORKING), 1) ifeq ($(HAVE_CHEEVOS), 1) ifeq ($(HAVE_THREADS), 1) DEFINES += -DHAVE_CHEEVOS - OBJ += cheevos.o libretro-common/utils/md5.o + OBJ += cheevos.o \ + libretro-common/utils/md5.o endif endif diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 07ff1bade1..527952f8c7 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -33,7 +33,9 @@ #include #include +#ifdef HAVE_RBMP #include +#endif #if defined(HAVE_ZLIB_DEFLATE) && defined(HAVE_RPNG) #include @@ -112,7 +114,7 @@ static bool screenshot_dump( width * 3 ); free(out_buffer); -#else +#elif defined(HAVE_RBMP) enum rbmp_source_type bmp_type = RBMP_SOURCE_TYPE_DONT_CARE; if (bgr24) From 180fb9cbffcc8ebea397c9f730c38c89b8bfc0bb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 06:14:55 +0200 Subject: [PATCH 14/66] Don't compile in rbmp_encode when HAVE_RBMP is not defined --- griffin/griffin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index fd261fac30..31682170aa 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -246,8 +246,8 @@ VIDEO IMAGE #endif #ifdef HAVE_RBMP #include "../libretro-common/formats/bmp/rbmp.c" -#endif #include "../libretro-common/formats/bmp/rbmp_encode.c" +#endif /*============================================================ VIDEO DRIVER From 9b60b81f70bff0d9aee7f6cfbd163c026712545f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 06:28:33 +0200 Subject: [PATCH 15/66] Buildfixes --- Makefile.common | 195 +++++++++++++++++++++++++++------------------- griffin/griffin.c | 9 ++- 2 files changed, 121 insertions(+), 83 deletions(-) diff --git a/Makefile.common b/Makefile.common index e1039a84e9..b608887a26 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,3 +1,7 @@ +CFLAGS += -I./libretro-common/include + +# Switches + ifeq ($(HAVE_GL_CONTEXT),) HAVE_GL_CONTEXT=0 @@ -64,52 +68,8 @@ ifeq ($(HAVE_SHADERPIPELINE), 1) CFLAGS += -DHAVE_SHADERPIPELINE endif -CFLAGS += -I./libretro-common/include +# General libretro-common files -# Switches - - -# System - -ifneq ($(findstring BSD,$(OS)),) - BSD_LOCAL_INC += -I/usr/local/include -endif - -ifneq ($(findstring Darwin,$(OS)),) - OSX := 1 - LIBS += -framework AppKit -else - OSX := 0 -endif - -ifneq ($(findstring Linux,$(OS)),) - LIBS += -lrt - OBJ += input/drivers/linuxraw_input.o \ - input/common/linux_common.o \ - input/common/epoll_common.o \ - input/drivers_joypad/linuxraw_joypad.o \ - frontend/drivers/platform_linux.o -endif - - -ifeq ($(findstring Haiku,$(OS)),) - LIBS += -lm - DEBUG_FLAG = -g -else - LIBS += -lroot -lnetwork - # stable and nightly haiku builds are stuck on gdb 6.x but we use gcc4 - DEBUG_FLAG = -gdwarf-2 -endif - -# Git - -GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null) -ifneq ($(GIT_VERSION),) - DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=$(GIT_VERSION) - OBJ += git_version.o -endif - -# General object files OBJ += libretro-common/algorithms/mismatch.o \ libretro-common/queues/task_queue.o \ libretro-common/queues/fifo_queue.o \ @@ -145,6 +105,15 @@ OBJ += libretro-common/algorithms/mismatch.o \ libretro-common/formats/json/jsonsax.o \ libretro-common/formats/image_transfer.o +ifeq ($(HAVE_THREADS), 1) +OBJ += libretro-common/rthreads/rthreads.o \ + libretro-common/rthreads/rsemaphore.o +endif + +ifeq ($(HAVE_GL_CONTEXT), 1) +OBJ += libretro-common/glsym/rglgen.o +endif + ifneq ($(HAVE_GETOPT_LONG), 1) OBJ += libretro-common/compat/compat_getopt.o endif @@ -162,7 +131,90 @@ ifeq ($(HAVE_NEON),1) libretro-common/conversion/float_to_s16_neon.o endif +ifeq ($(HAVE_RTGA), 1) + OBJ += libretro-common/formats/tga/rtga.o +endif +ifeq ($(HAVE_RPNG), 1) + OBJ += libretro-common/formats/png/rpng.o \ + libretro-common/formats/png/rpng_encode.o +endif + +ifeq ($(HAVE_RJPEG), 1) + OBJ += libretro-common/formats/jpeg/rjpeg.o +endif + +ifeq ($(HAVE_RBMP), 1) + OBJ += libretro-common/formats/bmp/rbmp.o \ + libretro-common/formats/bmp/rbmp_encode.o +endif + +ifeq ($(HAVE_NETWORKING), 1) + OBJ += libretro-common/net/net_compat.o \ + libretro-common/net/net_http.o \ + libretro-common/net/net_socket.o + + ifneq ($(HAVE_SOCKET_LEGACY),1) + OBJ += libretro-common/net/net_ifinfo.o + endif + + ifeq ($(WANT_IFADDRS), 1) + OBJ += libretro-common/compat/compat_ifaddrs.o + endif + + ifeq ($(HAVE_CHEEVOS), 1) + ifeq ($(HAVE_THREADS), 1) + OBJ += libretro-common/utils/md5.o + endif + endif +endif + +ifeq ($(HAVE_ZLIB), 1) + OBJ += libretro-common/file/archive_file.o \ + libretro-common/file/archive_file_zlib.o +endif + +# System + +ifneq ($(findstring BSD,$(OS)),) + BSD_LOCAL_INC += -I/usr/local/include +endif + +ifneq ($(findstring Darwin,$(OS)),) + OSX := 1 + LIBS += -framework AppKit +else + OSX := 0 +endif + +ifneq ($(findstring Linux,$(OS)),) + LIBS += -lrt + OBJ += input/drivers/linuxraw_input.o \ + input/common/linux_common.o \ + input/common/epoll_common.o \ + input/drivers_joypad/linuxraw_joypad.o \ + frontend/drivers/platform_linux.o +endif + +ifeq ($(findstring Haiku,$(OS)),) + LIBS += -lm + DEBUG_FLAG = -g +else + LIBS += -lroot -lnetwork + # stable and nightly haiku builds are stuck on gdb 6.x but we use gcc4 + DEBUG_FLAG = -gdwarf-2 +endif + +# Git + +GIT_VERSION := $(shell git rev-parse --short HEAD 2>/dev/null) +ifneq ($(GIT_VERSION),) + DEFINES += -DHAVE_GIT_VERSION -DGIT_VERSION=$(GIT_VERSION) + OBJ += git_version.o +endif + + +# General object files OBJ += frontend/frontend.o \ frontend/frontend_driver.o \ frontend/drivers/platform_null.o \ @@ -245,16 +297,6 @@ OBJ += intl/msg_hash_de.o \ intl/msg_hash_pl.o \ intl/msg_hash_pt.o -ifeq ($(HAVE_MENU), 1) -OBJ += menu/intl/menu_hash_de.o \ - menu/intl/menu_hash_es.o \ - menu/intl/menu_hash_eo.o \ - menu/intl/menu_hash_fr.o \ - menu/intl/menu_hash_it.o \ - menu/intl/menu_hash_nl.o \ - menu/intl/menu_hash_pl.o \ - menu/intl/menu_hash_pt.o -endif endif @@ -516,6 +558,17 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/drivers_display/menu_display_null.o \ menu/drivers/menu_generic.o \ menu/drivers/null.o + +ifeq ($(HAVE_LANGEXTRA), 1) +OBJ += menu/intl/menu_hash_de.o \ + menu/intl/menu_hash_es.o \ + menu/intl/menu_hash_eo.o \ + menu/intl/menu_hash_fr.o \ + menu/intl/menu_hash_it.o \ + menu/intl/menu_hash_nl.o \ + menu/intl/menu_hash_pl.o \ + menu/intl/menu_hash_pt.o +endif endif ifeq ($(UTF8), 1) @@ -535,9 +588,7 @@ ifeq ($(HAVE_FREETYPE), 1) endif ifeq ($(HAVE_THREADS), 1) - OBJ += libretro-common/rthreads/rthreads.o \ - libretro-common/rthreads/rsemaphore.o \ - gfx/video_thread_wrapper.o \ + OBJ += gfx/video_thread_wrapper.o \ audio/audio_thread_wrapper.o DEFINES += -DHAVE_THREADS ifeq ($(findstring Haiku,$(OS)),) @@ -674,8 +725,7 @@ ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ gfx/common/gl_common.o \ - gfx/drivers_font/gl_raster_font.o \ - libretro-common/glsym/rglgen.o + gfx/drivers_font/gl_raster_font.o ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/drivers_display/menu_display_gl.o @@ -925,9 +975,7 @@ endif ifeq ($(HAVE_ZLIB), 1) - OBJ += libretro-common/file/archive_file.o \ - libretro-common/file/archive_file_zlib.o \ - tasks/task_decompress.o + OBJ += tasks/task_decompress.o OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB HAVE_COMPRESSION = 1 @@ -941,24 +989,18 @@ endif ifeq ($(HAVE_RTGA), 1) DEFINES += -DHAVE_RTGA - OBJ += libretro-common/formats/tga/rtga.o endif ifeq ($(HAVE_RPNG), 1) DEFINES += -DHAVE_RPNG - OBJ += libretro-common/formats/png/rpng.o \ - libretro-common/formats/png/rpng_encode.o endif ifeq ($(HAVE_RJPEG), 1) DEFINES += -DHAVE_RJPEG - OBJ += libretro-common/formats/jpeg/rjpeg.o endif ifeq ($(HAVE_RBMP), 1) DEFINES += -DHAVE_RBMP - OBJ += libretro-common/formats/bmp/rbmp.o \ - libretro-common/formats/bmp/rbmp_encode.o endif ifdef HAVE_COMPRESSION @@ -1002,19 +1044,11 @@ endif ifeq ($(HAVE_NETWORKING), 1) DEFINES += -DHAVE_NETWORKING - OBJ += libretro-common/net/net_compat.o \ - libretro-common/net/net_http.o \ - libretro-common/net/net_socket.o \ - network/net_http_special.o \ - tasks/task_http.o - - ifneq ($(HAVE_SOCKET_LEGACY),1) - OBJ += libretro-common/net/net_ifinfo.o - endif + OBJ += network/net_http_special.o \ + tasks/task_http.o ifeq ($(WANT_IFADDRS), 1) DEFINES += -DWANT_IFADDRS - OBJ += libretro-common/compat/compat_ifaddrs.o endif ifneq ($(findstring Win32,$(OS)),) @@ -1036,8 +1070,7 @@ ifeq ($(HAVE_NETWORKING), 1) ifeq ($(HAVE_CHEEVOS), 1) ifeq ($(HAVE_THREADS), 1) DEFINES += -DHAVE_CHEEVOS - OBJ += cheevos.o \ - libretro-common/utils/md5.o + OBJ += cheevos.o endif endif diff --git a/griffin/griffin.c b/griffin/griffin.c index 31682170aa..603a6c7260 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -757,6 +757,7 @@ RETROARCH #include "../tasks/tasks_internal.c" #include "../msg_hash.c" +#ifdef HAVE_LANGEXTRA #include "../intl/msg_hash_de.c" #include "../intl/msg_hash_es.c" #include "../intl/msg_hash_eo.c" @@ -765,10 +766,12 @@ RETROARCH #include "../intl/msg_hash_nl.c" #include "../intl/msg_hash_pt.c" #include "../intl/msg_hash_pl.c" -#include "../intl/msg_hash_us.c" #ifdef HAVE_UTF8 #include "../intl/msg_hash_ru.c" #endif +#endif + +#include "../intl/msg_hash_us.c" /*============================================================ RECORDING @@ -870,6 +873,7 @@ MENU #include "../menu/menu_displaylist.c" #include "../menu/menu_animation.c" +#ifdef HAVE_LANGEXTRA #include "../menu/intl/menu_hash_de.c" #include "../menu/intl/menu_hash_es.c" #include "../menu/intl/menu_hash_eo.c" @@ -878,10 +882,11 @@ MENU #include "../menu/intl/menu_hash_nl.c" #include "../menu/intl/menu_hash_pl.c" #include "../menu/intl/menu_hash_pt.c" -#include "../menu/intl/menu_hash_us.c" #ifdef HAVE_UTF8 #include "../menu/intl/menu_hash_ru.c" #endif +#endif +#include "../menu/intl/menu_hash_us.c" #include "../menu/drivers/null.c" #include "../menu/drivers/menu_generic.c" From f15b7227863059a0812f8518a3ae97b811f1bc56 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 06:35:48 +0200 Subject: [PATCH 16/66] Buildfix --- Makefile.common | 218 ++++++++++++++++++++---------------------------- 1 file changed, 92 insertions(+), 126 deletions(-) diff --git a/Makefile.common b/Makefile.common index b608887a26..8188adc08b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1,7 +1,3 @@ -CFLAGS += -I./libretro-common/include - -# Switches - ifeq ($(HAVE_GL_CONTEXT),) HAVE_GL_CONTEXT=0 @@ -68,111 +64,10 @@ ifeq ($(HAVE_SHADERPIPELINE), 1) CFLAGS += -DHAVE_SHADERPIPELINE endif -# General libretro-common files +CFLAGS += -I./libretro-common/include -OBJ += libretro-common/algorithms/mismatch.o \ - libretro-common/queues/task_queue.o \ - libretro-common/queues/fifo_queue.o \ - libretro-common/encodings/encoding_utf.o \ - libretro-common/lists/file_list.o \ - libretro-common/lists/dir_list.o \ - libretro-common/file/retro_dirent.o \ - libretro-common/streams/file_stream.o \ - libretro-common/streams/interface_stream.o \ - libretro-common/streams/memory_stream.o \ - libretro-common/file/retro_stat.o \ - libretro-common/lists/string_list.o \ - libretro-common/string/stdstring.o \ - libretro-common/memmap/memalign.o \ - libretro-common/file/nbio/nbio_stdio.o \ - libretro-common/file/file_path.o \ - libretro-common/hash/rhash.o \ - libretro-common/dynamic/dylib.o \ - libretro-common/queues/message_queue.o \ - libretro-common/compat/compat_fnmatch.o \ - libretro-common/compat/compat_posix_string.o \ - libretro-common/file/config_file.o \ - libretro-common/gfx/scaler/scaler.o \ - libretro-common/gfx/scaler/pixconv.o \ - libretro-common/gfx/scaler/scaler_int.o \ - libretro-common/gfx/scaler/scaler_filter.o \ - libretro-common/features/features_cpu.o \ - libretro-common/formats/image_texture.o \ - libretro-common/conversion/s16_to_float.o \ - libretro-common/conversion/float_to_s16.o \ - libretro-common/gfx/math/matrix_4x4.o \ - libretro-common/gfx/math/matrix_3x3.o \ - libretro-common/formats/json/jsonsax.o \ - libretro-common/formats/image_transfer.o +# Switches -ifeq ($(HAVE_THREADS), 1) -OBJ += libretro-common/rthreads/rthreads.o \ - libretro-common/rthreads/rsemaphore.o -endif - -ifeq ($(HAVE_GL_CONTEXT), 1) -OBJ += libretro-common/glsym/rglgen.o -endif - -ifneq ($(HAVE_GETOPT_LONG), 1) -OBJ += libretro-common/compat/compat_getopt.o -endif - -ifneq ($(HAVE_STRCASESTR), 1) -OBJ += libretro-common/compat/compat_strcasestr.o -endif - -ifneq ($(HAVE_STRL), 1) -OBJ += libretro-common/compat/compat_strl.o -endif - -ifeq ($(HAVE_NEON),1) - OBJ += libretro-common/conversion/s16_to_float_neon.o \ - libretro-common/conversion/float_to_s16_neon.o -endif - -ifeq ($(HAVE_RTGA), 1) - OBJ += libretro-common/formats/tga/rtga.o -endif - -ifeq ($(HAVE_RPNG), 1) - OBJ += libretro-common/formats/png/rpng.o \ - libretro-common/formats/png/rpng_encode.o -endif - -ifeq ($(HAVE_RJPEG), 1) - OBJ += libretro-common/formats/jpeg/rjpeg.o -endif - -ifeq ($(HAVE_RBMP), 1) - OBJ += libretro-common/formats/bmp/rbmp.o \ - libretro-common/formats/bmp/rbmp_encode.o -endif - -ifeq ($(HAVE_NETWORKING), 1) - OBJ += libretro-common/net/net_compat.o \ - libretro-common/net/net_http.o \ - libretro-common/net/net_socket.o - - ifneq ($(HAVE_SOCKET_LEGACY),1) - OBJ += libretro-common/net/net_ifinfo.o - endif - - ifeq ($(WANT_IFADDRS), 1) - OBJ += libretro-common/compat/compat_ifaddrs.o - endif - - ifeq ($(HAVE_CHEEVOS), 1) - ifeq ($(HAVE_THREADS), 1) - OBJ += libretro-common/utils/md5.o - endif - endif -endif - -ifeq ($(HAVE_ZLIB), 1) - OBJ += libretro-common/file/archive_file.o \ - libretro-common/file/archive_file_zlib.o -endif # System @@ -196,6 +91,7 @@ ifneq ($(findstring Linux,$(OS)),) frontend/drivers/platform_linux.o endif + ifeq ($(findstring Haiku,$(OS)),) LIBS += -lm DEBUG_FLAG = -g @@ -213,8 +109,8 @@ ifneq ($(GIT_VERSION),) OBJ += git_version.o endif - # General object files + OBJ += frontend/frontend.o \ frontend/frontend_driver.o \ frontend/drivers/platform_null.o \ @@ -228,14 +124,30 @@ OBJ += frontend/frontend.o \ msg_hash.o \ intl/msg_hash_us.o \ runloop.o \ + libretro-common/algorithms/mismatch.o \ + libretro-common/queues/task_queue.o \ tasks/tasks_internal.o \ tasks/task_content.o \ tasks/task_save_ram.o \ tasks/task_save_state.o \ tasks/task_file_transfer.o \ tasks/task_image.o \ + libretro-common/encodings/encoding_utf.o \ + libretro-common/lists/file_list.o \ + libretro-common/lists/dir_list.o \ + libretro-common/file/retro_dirent.o \ + libretro-common/streams/file_stream.o \ + libretro-common/streams/interface_stream.o \ + libretro-common/streams/memory_stream.o \ + libretro-common/file/retro_stat.o \ + libretro-common/lists/string_list.o \ + libretro-common/string/stdstring.o \ + libretro-common/memmap/memalign.o \ list_special.o \ + libretro-common/file/nbio/nbio_stdio.o \ + libretro-common/file/file_path.o \ file_path_special.o \ + libretro-common/hash/rhash.o \ audio/audio_driver.o \ input/input_driver.o \ gfx/video_coord_array.o \ @@ -244,8 +156,10 @@ OBJ += frontend/frontend.o \ location/location_driver.o \ driver.o \ configuration.o \ + libretro-common/dynamic/dylib.o \ dynamic.o \ cores/dynamic_dummy.o \ + libretro-common/queues/message_queue.o \ managers/state_manager.o \ gfx/drivers_font_renderer/bitmapfont.o \ input/input_autodetect.o \ @@ -256,14 +170,22 @@ OBJ += frontend/frontend.o \ tasks/task_overlay.o \ input/input_overlay.o \ patch.o \ + libretro-common/queues/fifo_queue.o \ managers/core_option_manager.o \ + libretro-common/compat/compat_fnmatch.o \ + libretro-common/compat/compat_posix_string.o \ managers/cheat_manager.o \ core_info.o \ + libretro-common/file/config_file.o \ config_file_userdata.o \ tasks/task_screenshot.o \ + libretro-common/gfx/scaler/scaler.o \ gfx/drivers_shader/shader_null.o \ gfx/video_shader_driver.o \ gfx/video_shader_parse.o \ + libretro-common/gfx/scaler/pixconv.o \ + libretro-common/gfx/scaler/scaler_int.o \ + libretro-common/gfx/scaler/scaler_filter.o \ gfx/font_driver.o \ gfx/video_filter.o \ audio/audio_resampler_driver.o \ @@ -283,6 +205,7 @@ OBJ += frontend/frontend.o \ movie.o \ record/record_driver.o \ record/drivers/record_null.o \ + libretro-common/features/features_cpu.o \ performance_counters.o \ verbosity.o @@ -299,6 +222,19 @@ OBJ += intl/msg_hash_de.o \ endif +ifneq ($(HAVE_GETOPT_LONG), 1) +OBJ += libretro-common/compat/compat_getopt.o +endif + +ifneq ($(HAVE_STRCASESTR), 1) +OBJ += libretro-common/compat/compat_strcasestr.o +endif + +ifneq ($(HAVE_STRL), 1) +OBJ += libretro-common/compat/compat_strl.o +endif + +OBJ += libretro-common/formats/image_texture.o ifeq ($(HAVE_IMAGEVIEWER), 1) DEFINES += -DHAVE_IMAGEVIEWER @@ -446,6 +382,12 @@ ifeq ($(HAVE_NEON),1) DEFINES += -DSINC_LOWER_QUALITY endif +OBJ += libretro-common/conversion/s16_to_float.o \ + libretro-common/conversion/float_to_s16.o +ifeq ($(HAVE_NEON),1) + OBJ += libretro-common/conversion/s16_to_float_neon.o \ + libretro-common/conversion/float_to_s16_neon.o +endif ifneq ($(findstring Win32,$(OS)),) HAVE_VULKAN=1 @@ -526,6 +468,17 @@ ifeq ($(HAVE_MENU_COMMON), 1) else PSEUDO_NS := endif + +ifeq ($(HAVE_LANGEXTRA), 1) +OBJ += menu/intl/menu_hash_de.o \ + menu/intl/menu_hash_es.o \ + menu/intl/menu_hash_eo.o \ + menu/intl/menu_hash_fr.o \ + menu/intl/menu_hash_it.o \ + menu/intl/menu_hash_nl.o \ + menu/intl/menu_hash_pl.o \ + menu/intl/menu_hash_pt.o +endif OBJ += menu/menu_hash.o \ menu/menu_driver.o \ menu/menu_content.o \ @@ -558,17 +511,6 @@ ifeq ($(HAVE_MENU_COMMON), 1) menu/drivers_display/menu_display_null.o \ menu/drivers/menu_generic.o \ menu/drivers/null.o - -ifeq ($(HAVE_LANGEXTRA), 1) -OBJ += menu/intl/menu_hash_de.o \ - menu/intl/menu_hash_es.o \ - menu/intl/menu_hash_eo.o \ - menu/intl/menu_hash_fr.o \ - menu/intl/menu_hash_it.o \ - menu/intl/menu_hash_nl.o \ - menu/intl/menu_hash_pl.o \ - menu/intl/menu_hash_pt.o -endif endif ifeq ($(UTF8), 1) @@ -588,7 +530,9 @@ ifeq ($(HAVE_FREETYPE), 1) endif ifeq ($(HAVE_THREADS), 1) - OBJ += gfx/video_thread_wrapper.o \ + OBJ += libretro-common/rthreads/rthreads.o \ + libretro-common/rthreads/rsemaphore.o \ + gfx/video_thread_wrapper.o \ audio/audio_thread_wrapper.o DEFINES += -DHAVE_THREADS ifeq ($(findstring Haiku,$(OS)),) @@ -712,7 +656,9 @@ endif OBJ += gfx/video_context_driver.o \ gfx/drivers_context/gfx_null_ctx.o \ - gfx/video_state_tracker.o + gfx/video_state_tracker.o \ + libretro-common/gfx/math/matrix_4x4.o \ + libretro-common/gfx/math/matrix_3x3.o ifeq ($(HAVE_KMS), 1) HAVE_AND_WILL_USE_DRM = 1 @@ -725,7 +671,8 @@ ifeq ($(HAVE_GL_CONTEXT), 1) DEFINES += -DHAVE_OPENGL -DHAVE_GLSL OBJ += gfx/drivers/gl.o \ gfx/common/gl_common.o \ - gfx/drivers_font/gl_raster_font.o + gfx/drivers_font/gl_raster_font.o \ + libretro-common/glsym/rglgen.o ifeq ($(HAVE_MENU_COMMON), 1) OBJ += menu/drivers_display/menu_display_gl.o @@ -975,7 +922,9 @@ endif ifeq ($(HAVE_ZLIB), 1) - OBJ += tasks/task_decompress.o + OBJ += libretro-common/file/archive_file.o \ + libretro-common/file/archive_file_zlib.o \ + tasks/task_decompress.o OBJ += $(ZLIB_OBJS) DEFINES += -DHAVE_ZLIB HAVE_COMPRESSION = 1 @@ -989,20 +938,29 @@ endif ifeq ($(HAVE_RTGA), 1) DEFINES += -DHAVE_RTGA + OBJ += libretro-common/formats/tga/rtga.o endif ifeq ($(HAVE_RPNG), 1) DEFINES += -DHAVE_RPNG + OBJ += libretro-common/formats/png/rpng.o \ + libretro-common/formats/png/rpng_encode.o endif ifeq ($(HAVE_RJPEG), 1) DEFINES += -DHAVE_RJPEG + OBJ += libretro-common/formats/jpeg/rjpeg.o endif ifeq ($(HAVE_RBMP), 1) DEFINES += -DHAVE_RBMP + OBJ += libretro-common/formats/bmp/rbmp.o endif +OBJ += libretro-common/formats/bmp/rbmp_encode.o \ + libretro-common/formats/json/jsonsax.o \ + libretro-common/formats/image_transfer.o + ifdef HAVE_COMPRESSION DEFINES += -DHAVE_COMPRESSION endif @@ -1044,11 +1002,19 @@ endif ifeq ($(HAVE_NETWORKING), 1) DEFINES += -DHAVE_NETWORKING - OBJ += network/net_http_special.o \ - tasks/task_http.o + OBJ += libretro-common/net/net_compat.o \ + libretro-common/net/net_http.o \ + libretro-common/net/net_socket.o \ + network/net_http_special.o \ + tasks/task_http.o + + ifneq ($(HAVE_SOCKET_LEGACY),1) + OBJ += libretro-common/net/net_ifinfo.o + endif ifeq ($(WANT_IFADDRS), 1) DEFINES += -DWANT_IFADDRS + OBJ += libretro-common/compat/compat_ifaddrs.o endif ifneq ($(findstring Win32,$(OS)),) @@ -1070,7 +1036,7 @@ ifeq ($(HAVE_NETWORKING), 1) ifeq ($(HAVE_CHEEVOS), 1) ifeq ($(HAVE_THREADS), 1) DEFINES += -DHAVE_CHEEVOS - OBJ += cheevos.o + OBJ += cheevos.o libretro-common/utils/md5.o endif endif From afe67ca2547f3a6caaf69ab8cc3fa6ac577fc6fc Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 14:47:54 +0200 Subject: [PATCH 17/66] C89/C90 don't support bitfields on uint8_t - work around this --- input/connect/connect_ps4.c | 71 ++++++++++++++++++++----------------- 1 file changed, 39 insertions(+), 32 deletions(-) diff --git a/input/connect/connect_ps4.c b/input/connect/connect_ps4.c index 647ae2ad0b..41da1057da 100644 --- a/input/connect/connect_ps4.c +++ b/input/connect/connect_ps4.c @@ -19,6 +19,7 @@ #include #include +#include #include "joypad_connection.h" #include "../input_defines.h" @@ -37,46 +38,52 @@ enum connect_ps4_dpad_states DPAD_OFF = 0x8 }; +#if (__STDC_VERSION__ >= 199901L) || defined(__cplusplus) +typedef uint8_t bf_uint8_t; +#else +typedef int bf_uint8_t; +#endif + struct ps4buttons { #ifdef MSB_FIRST - uint8_t triangle : 1; - uint8_t circle : 1; - uint8_t cross : 1; - uint8_t square : 1; - uint8_t dpad : 4; + bf_uint8_t triangle : 1; + bf_uint8_t circle : 1; + bf_uint8_t cross : 1; + bf_uint8_t square : 1; + bf_uint8_t dpad : 4; - uint8_t r3 : 1; - uint8_t l3 : 1; - uint8_t options : 1; - uint8_t share : 1; - uint8_t r2 : 1; - uint8_t l2 : 1; - uint8_t r1 : 1; - uint8_t l1 : 1; + bf_uint8_t r3 : 1; + bf_uint8_t l3 : 1; + bf_uint8_t options : 1; + bf_uint8_t share : 1; + bf_uint8_t r2 : 1; + bf_uint8_t l2 : 1; + bf_uint8_t r1 : 1; + bf_uint8_t l1 : 1; - uint8_t reportcounter : 6; - uint8_t touchpad : 1; - uint8_t ps : 1; + bf_uint8_t reportcounter : 6; + bf_uint8_t touchpad : 1; + bf_uint8_t ps : 1; #else - uint8_t dpad : 4; - uint8_t square : 1; - uint8_t cross : 1; - uint8_t circle : 1; - uint8_t triangle : 1; + bf_uint8_t dpad : 4; + bf_uint8_t square : 1; + bf_uint8_t cross : 1; + bf_uint8_t circle : 1; + bf_uint8_t triangle : 1; - uint8_t l1 : 1; - uint8_t r1 : 1; - uint8_t l2 : 1; - uint8_t r2 : 1; - uint8_t share : 1; - uint8_t options : 1; - uint8_t l3 : 1; - uint8_t r3 : 1; + bf_uint8_t l1 : 1; + bf_uint8_t r1 : 1; + bf_uint8_t l2 : 1; + bf_uint8_t r2 : 1; + bf_uint8_t share : 1; + bf_uint8_t options : 1; + bf_uint8_t l3 : 1; + bf_uint8_t r3 : 1; - uint8_t ps : 1; - uint8_t touchpad : 1; - uint8_t reportcounter : 6; + bf_uint8_t ps : 1; + bf_uint8_t touchpad : 1; + bf_uint8_t reportcounter : 6; #endif }__attribute__((packed)); From cf996f724e983d27085fba28acd45e1b14aec58f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 15:23:07 +0200 Subject: [PATCH 18/66] Rename HAVE_NETWORK_GAMEPAD to HAVE_NETWORKGAMEPAD - and don't bake it in for the C89 build --- Makefile.common | 4 ++-- config.features.h | 2 +- configuration.c | 4 ++-- cores/internal_cores.h | 2 +- dynamic.c | 4 ++-- griffin/griffin.c | 2 +- input/input_driver.c | 14 +++++++------- input/input_remote.c | 16 ++++++++-------- menu/menu_setting.c | 2 +- qb/config.libs.sh | 4 ++-- qb/config.params.sh | 2 ++ tasks/task_content.c | 8 ++++---- 12 files changed, 33 insertions(+), 31 deletions(-) diff --git a/Makefile.common b/Makefile.common index 8188adc08b..0e254a3688 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1024,7 +1024,7 @@ ifeq ($(HAVE_NETWORKING), 1) # Netplay ifeq ($(HAVE_NETPLAY), 1) - DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD -DHAVE_NETWORK_GAMEPAD + DEFINES += -DHAVE_NETPLAY -DHAVE_NETWORK_CMD OBJ += network/netplay/netplay_net.o \ network/netplay/netplay_spectate.o \ network/netplay/netplay_common.o \ @@ -1040,7 +1040,7 @@ ifeq ($(HAVE_NETWORKING), 1) endif endif - ifeq ($(HAVE_NETWORK_GAMEPAD), 1) + ifeq ($(HAVE_NETWORKGAMEPAD), 1) OBJ += input/input_remote.o \ cores/libretro-net-retropad/net_retropad_core.o endif diff --git a/config.features.h b/config.features.h index 974f301091..de11691684 100644 --- a/config.features.h +++ b/config.features.h @@ -32,7 +32,7 @@ static const bool _network_command_supp = true; static const bool _network_command_supp = false; #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD static const bool _network_gamepad_supp = true; #else static const bool _network_gamepad_supp = false; diff --git a/configuration.c b/configuration.c index fbf5d42004..4b3dd9104f 100644 --- a/configuration.c +++ b/configuration.c @@ -1741,7 +1741,7 @@ static bool config_load_file(const char *path, bool set_defaults) settings->bluetooth_enable = path_file_exists(LAKKA_BLUETOOTH_PATH); #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD CONFIG_GET_BOOL_BASE(conf, settings, network_remote_enable, "network_remote_enable"); for (i = 0; i < MAX_USERS; i++) { @@ -2925,7 +2925,7 @@ bool config_save_file(const char *path) config_set_int(conf, cfg, settings->input.analog_dpad_mode[i]); } -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD for (i = 0; i < MAX_USERS; i++) { char tmp[64] = {0}; diff --git a/cores/internal_cores.h b/cores/internal_cores.h index 82f9aa59e5..d30b8d17b2 100644 --- a/cores/internal_cores.h +++ b/cores/internal_cores.h @@ -184,7 +184,7 @@ size_t libretro_imageviewer_retro_get_memory_size(unsigned id); #endif -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) /* Internal networked retropad core. */ void libretro_netretropad_retro_init(void); diff --git a/dynamic.c b/dynamic.c index c5e5cac8e1..401cfce17c 100644 --- a/dynamic.c +++ b/dynamic.c @@ -77,7 +77,7 @@ static dylib_t lib_handle; #define SYMBOL_IMAGEVIEWER(x) current_core->x = libretro_imageviewer_##x #endif -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) #define SYMBOL_NETRETROPAD(x) current_core->x = libretro_netretropad_##x #endif @@ -507,7 +507,7 @@ static void load_symbols(enum rarch_core_type type, struct retro_core_t *current #endif break; case CORE_TYPE_NETRETROPAD: -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) SYMBOL_NETRETROPAD(retro_init); SYMBOL_NETRETROPAD(retro_deinit); diff --git a/griffin/griffin.c b/griffin/griffin.c index 603a6c7260..92e4380361 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -934,7 +934,7 @@ MENU #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD #include "../input/input_remote.c" #include "../cores/libretro-net-retropad/net_retropad_core.c" #endif diff --git a/input/input_driver.c b/input/input_driver.c index 60f89d51c2..cb0aba6d9b 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -27,7 +27,7 @@ #include "../verbosity.h" #include "../command.h" -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD #include "input_remote.h" #endif @@ -95,7 +95,7 @@ static turbo_buttons_t input_driver_turbo_btns; #ifdef HAVE_COMMAND static command_t *input_driver_command = NULL; #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD static input_remote_t *input_driver_remote = NULL; #endif static const input_driver_t *current_input = NULL; @@ -281,7 +281,7 @@ static retro_input_t input_driver_keys_pressed(void) } #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD if (input_driver_remote) state |= input_remote_key_pressed(key,0); #endif @@ -436,7 +436,7 @@ void input_poll(void) command_poll(input_driver_command); #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD if (input_driver_remote) input_remote_poll(input_driver_remote); #endif @@ -486,7 +486,7 @@ int16_t input_state(unsigned port, unsigned device, input_state_overlay(&res, port, device, idx, id); #endif -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD input_remote_state(&res, port, device, idx, id); #endif } @@ -877,7 +877,7 @@ void input_driver_deinit_command(void) void input_driver_deinit_remote(void) { -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD if (input_driver_remote) input_remote_free(input_driver_remote); input_driver_remote = NULL; @@ -886,7 +886,7 @@ void input_driver_deinit_remote(void) bool input_driver_init_remote(void) { -#ifdef HAVE_NETWORK_GAMEPAD +#ifdef HAVE_NETWORKGAMEPAD settings_t *settings = config_get_ptr(); if (!settings->network_remote_enable) diff --git a/input/input_remote.c b/input/input_remote.c index 2f20c0d8db..a04cf01a33 100644 --- a/input/input_remote.c +++ b/input/input_remote.c @@ -41,7 +41,7 @@ struct input_remote { -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) int net_fd[MAX_USERS]; #endif @@ -63,7 +63,7 @@ static input_remote_state_t *input_remote_get_state_ptr(void) return &remote_st_ptr; } -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) static bool input_remote_init_network(input_remote_t *handle, uint16_t port, unsigned user) { @@ -107,7 +107,7 @@ error: input_remote_t *input_remote_new(uint16_t port) { unsigned user; -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) settings_t *settings = config_get_ptr(); #endif input_remote_t *handle = (input_remote_t*) @@ -118,7 +118,7 @@ input_remote_t *input_remote_new(uint16_t port) (void)port; -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) for(user = 0; user < settings->input.max_users; user ++) { handle->net_fd[user] = -1; @@ -130,7 +130,7 @@ input_remote_t *input_remote_new(uint16_t port) return handle; -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) error: input_remote_free(handle); return NULL; @@ -140,7 +140,7 @@ error: void input_remote_free(input_remote_t *handle) { unsigned user; -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) settings_t *settings = config_get_ptr(); for(user = 0; user < settings->input.max_users; user ++) @@ -150,7 +150,7 @@ void input_remote_free(input_remote_t *handle) free(handle); } -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) static void input_remote_parse_packet(char *buffer, unsigned size, unsigned user) { input_remote_state_t *ol_state = input_remote_get_state_ptr(); @@ -212,7 +212,7 @@ void input_remote_poll(input_remote_t *handle) { if (settings->network_remote_enable_user[user]) { -#if defined(HAVE_NETWORK_GAMEPAD) && defined(HAVE_NETPLAY) +#if defined(HAVE_NETWORKGAMEPAD) && defined(HAVE_NETPLAY) char buf[8]; ssize_t ret; fd_set fds; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index fd7a3f4422..a3e3dd5dea 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -3575,7 +3575,7 @@ static bool setting_append_list( &subgroup_info, parent_group); -#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORK_GAMEPAD) +#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORKGAMEPAD) CONFIG_ACTION( list, list_info, menu_hash_to_str(MENU_LABEL_START_NET_RETROPAD), diff --git a/qb/config.libs.sh b/qb/config.libs.sh index a5093b5c4e..e693821d48 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -161,14 +161,14 @@ if [ "$HAVE_NETWORKING" = 'yes' ]; then fi fi HAVE_NETWORK_CMD=yes - HAVE_NETWORK_GAMEPAD=yes + HAVE_NETWORKGAMEPAD=yes [ "$HAVE_NETPLAY" != 'no' ] && HAVE_NETPLAY='yes' else echo "Warning: All networking features have been disabled." HAVE_NETWORK_CMD='no' HAVE_NETPLAY='no' - HAVE_NETWORK_GAMEPAD='no' + HAVE_NETWORKGAMEPAD='no' fi check_lib STDIN_CMD "$CLIB" fcntl diff --git a/qb/config.params.sh b/qb/config.params.sh index c07d3205de..c197aef6d9 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -21,6 +21,8 @@ C89_FFMPEG=no HAVE_SSA=auto # SSA/ASS for FFmpeg subtitle support HAVE_DYLIB=auto # Dynamic loading support HAVE_NETWORKING=auto # Networking features (recommended) +HAVE_NETWORKGAMEPAD=auto # Networked game pad (plus baked-in core) +C89_NETWORKGAMEPAD=no HAVE_NETPLAY=auto # Netplay support (requires networking) HAVE_D3D9=yes # Direct3D 9 support HAVE_OPENGL=auto # OpenGL support diff --git a/tasks/task_content.c b/tasks/task_content.c index 66d8b5366c..7ffe33ef43 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1713,7 +1713,7 @@ bool task_push_content_load_default( /* First we determine if we are loading from a menu */ switch (mode) { -#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORK_GAMEPAD) +#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORKGAMEPAD) case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU: #endif case CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU: @@ -1845,7 +1845,7 @@ bool task_push_content_load_default( runloop_ctl(RUNLOOP_CTL_DATA_DEINIT, NULL); runloop_ctl(RUNLOOP_CTL_TASK_INIT, NULL); break; -#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORK_GAMEPAD) +#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORKGAMEPAD) case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU: retroarch_set_current_core_type(CORE_TYPE_NETRETROPAD, true); break; @@ -1859,7 +1859,7 @@ bool task_push_content_load_default( { case CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE: case CONTENT_MODE_LOAD_FROM_CLI: -#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORK_GAMEPAD) +#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORKGAMEPAD) case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU: #endif case CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU: @@ -1894,7 +1894,7 @@ bool task_push_content_load_default( switch (mode) { case CONTENT_MODE_LOAD_CONTENT_FROM_PLAYLIST_FROM_MENU: -#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORK_GAMEPAD) +#if defined(HAVE_NETPLAY) && defined(HAVE_NETWORKGAMEPAD) case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU: #endif break; From b83d58cd5915d2e9263a79708bf761969d464ee1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 15:25:00 +0200 Subject: [PATCH 19/66] xmb_gradient_ident - don't bake it in when HAVE_SHADERPIPELINE is not defined --- menu/drivers/xmb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 1ab2471083..66e47c7106 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -351,6 +351,7 @@ static const char *xmb_thumbnails_ident(void) return "OFF"; } +#ifdef HAVE_SHADERPIPELINE static float *xmb_gradient_ident(void) { settings_t *settings = config_get_ptr(); @@ -380,6 +381,7 @@ static float *xmb_gradient_ident(void) return &gradient_legacy_red[0]; } +#endif static void xmb_fill_default_background_path(xmb_handle_t *xmb, char *path, size_t size) From a90bd8cb672fd3747ae8a4fbee97da361259278e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 16:31:35 +0200 Subject: [PATCH 20/66] Add ui_null_application.c --- Makefile.common | 1 + griffin/griffin.c | 1 + ui/drivers/null/ui_null_application.c | 31 +++++++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 1 + ui/drivers/ui_cocoatouch.m | 1 + ui/drivers/ui_null.c | 1 + ui/drivers/ui_qt.c | 1 + ui/drivers/ui_win32.c | 1 + ui/ui_companion_driver.h | 9 ++++++++ 9 files changed, 47 insertions(+) create mode 100644 ui/drivers/null/ui_null_application.c diff --git a/Makefile.common b/Makefile.common index 0e254a3688..4e37d10def 100644 --- a/Makefile.common +++ b/Makefile.common @@ -117,6 +117,7 @@ OBJ += frontend/frontend.o \ ui/ui_companion_driver.o \ ui/drivers/ui_null.o \ ui/drivers/null/ui_null_window.o \ + ui/drivers/null/ui_null_application.o \ core_impl.o \ retroarch.o \ input/input_keyboard.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 92e4380361..5c2a4aa4fe 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -723,6 +723,7 @@ UI #include "../ui/drivers/ui_null.c" #include "../ui/drivers/null/ui_null_window.c" +#include "../ui/drivers/null/ui_null_application.c" #ifdef HAVE_QT #include "../ui/drivers/ui_qt.c" diff --git a/ui/drivers/null/ui_null_application.c b/ui/drivers/null/ui_null_application.c new file mode 100644 index 0000000000..47545160fe --- /dev/null +++ b/ui/drivers/null/ui_null_application.c @@ -0,0 +1,31 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +void ui_application_null_process_events(void *data) +{ +} + +const ui_application_t ui_application_null = { + ui_application_null_process_events, + "null" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index c41f023b5a..fc240b31f7 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -597,5 +597,6 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, &ui_window_cocoa, + &ui_application_null, "cocoa", }; diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 61409338a5..74a17b3bfc 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -688,5 +688,6 @@ const ui_companion_driver_t ui_companion_cocoatouch = { ui_companion_cocoatouch_msg_queue_push, ui_companion_cocoatouch_render_messagebox, &ui_window_null, + &ui_application_null, "cocoatouch", }; diff --git a/ui/drivers/ui_null.c b/ui/drivers/ui_null.c index 1c81c80280..960096fcd5 100644 --- a/ui/drivers/ui_null.c +++ b/ui/drivers/ui_null.c @@ -89,5 +89,6 @@ const ui_companion_driver_t ui_companion_null = { NULL, NULL, &ui_window_null, + &ui_application_null, "null", }; diff --git a/ui/drivers/ui_qt.c b/ui/drivers/ui_qt.c index e50dca24ad..fb76f72e60 100644 --- a/ui/drivers/ui_qt.c +++ b/ui/drivers/ui_qt.c @@ -133,5 +133,6 @@ const ui_companion_driver_t ui_companion_qt = { NULL, NULL, &ui_window_null, + &ui_application_null, "qt", }; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index b3f7e2daa6..afc2588ba7 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -730,5 +730,6 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, &ui_window_win32, + &ui_application_null, "win32", }; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 5c89c1244d..169bb8cb76 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -31,6 +31,12 @@ RETRO_BEGIN_DECLS +typedef struct ui_application +{ + void (*process_events)(void *data); + const char *ident; +} ui_application_t; + typedef struct ui_window { void (*destroy)(void *data); @@ -55,6 +61,7 @@ typedef struct ui_companion_driver void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush); void (*render_messagebox)(const char *msg); const ui_window_t *window; + const ui_application_t *application; const char *ident; } ui_companion_driver_t; @@ -62,6 +69,8 @@ extern const ui_window_t ui_window_null; extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; +extern const ui_application_t ui_application_null; + extern const ui_companion_driver_t ui_companion_null; extern const ui_companion_driver_t ui_companion_cocoa; extern const ui_companion_driver_t ui_companion_cocoatouch; From febe0a2a1ec0a8c5fca312fed35f4eb290d74865 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 16:32:13 +0200 Subject: [PATCH 21/66] (UI) Turn some functions static --- ui/drivers/null/ui_null_application.c | 2 +- ui/drivers/null/ui_null_window.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/drivers/null/ui_null_application.c b/ui/drivers/null/ui_null_application.c index 47545160fe..6704a22cec 100644 --- a/ui/drivers/null/ui_null_application.c +++ b/ui/drivers/null/ui_null_application.c @@ -21,7 +21,7 @@ #include "../../ui_companion_driver.h" -void ui_application_null_process_events(void *data) +static void ui_application_null_process_events(void *data) { } diff --git a/ui/drivers/null/ui_null_window.c b/ui/drivers/null/ui_null_window.c index 9a26741397..ec0b889d8e 100644 --- a/ui/drivers/null/ui_null_window.c +++ b/ui/drivers/null/ui_null_window.c @@ -21,11 +21,11 @@ #include "../../ui_companion_driver.h" -void ui_window_null_destroy(void *data) +static void ui_window_null_destroy(void *data) { } -void ui_window_null_set_focused(void *data) +static void ui_window_null_set_focused(void *data) { } From ee8277b31c43562c35b6636db6b47d926fa113c5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 16:33:55 +0200 Subject: [PATCH 22/66] Rename ui_win32_window.h to ui_win32.h --- gfx/common/win32_common.h | 2 +- ui/drivers/ui_win32.c | 2 +- ui/drivers/{win32/ui_win32_window.h => ui_win32.h} | 6 +++--- ui/drivers/win32/ui_win32_window.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) rename ui/drivers/{win32/ui_win32_window.h => ui_win32.h} (92%) diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 8b28ec38f6..ae4ca28779 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -35,7 +35,7 @@ #ifndef _XBOX #include "../../ui/drivers/ui_win32_resource.h" -#include "../../ui/drivers/win32/ui_win32_window.h" +#include "../../ui/drivers/ui_win32.h" extern unsigned g_resize_width; extern unsigned g_resize_height; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index afc2588ba7..9450e3d00b 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -54,7 +54,7 @@ #include "../../gfx/common/gl_common.h" #include "../../gfx/common/win32_common.h" -#include "win32/ui_win32_window.h" +#include "ui_win32.h" #define SHADER_DLG_WIDTH 220 #define SHADER_DLG_MIN_HEIGHT 200 diff --git a/ui/drivers/win32/ui_win32_window.h b/ui/drivers/ui_win32.h similarity index 92% rename from ui/drivers/win32/ui_win32_window.h rename to ui/drivers/ui_win32.h index 957b2109b6..10c25cbd4d 100644 --- a/ui/drivers/win32/ui_win32_window.h +++ b/ui/drivers/ui_win32.h @@ -14,8 +14,8 @@ * If not, see . */ -#ifndef _WIN32_WINDOW_UI -#define _WIN32_WINDOW_UI +#ifndef _WIN32_UI +#define _WIN32_UI #include #include @@ -28,7 +28,7 @@ #include #endif -#include "../../ui_companion_driver.h" +#include "../ui_companion_driver.h" RETRO_BEGIN_DECLS diff --git a/ui/drivers/win32/ui_win32_window.c b/ui/drivers/win32/ui_win32_window.c index 49d8a1c244..2a371f2d89 100644 --- a/ui/drivers/win32/ui_win32_window.c +++ b/ui/drivers/win32/ui_win32_window.c @@ -41,7 +41,7 @@ #include #include -#include "ui_win32_window.h" +#include "../ui_win32.h" #include "../../ui_companion_driver.h" #include "../../../driver.h" From 07ca97618d38f5730f71badd7908ab2d39d0bbfa Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 16:43:25 +0200 Subject: [PATCH 23/66] Add ui_application_win32 --- ui/drivers/ui_win32.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ui/drivers/ui_win32.h b/ui/drivers/ui_win32.h index 10c25cbd4d..07a242c199 100644 --- a/ui/drivers/ui_win32.h +++ b/ui/drivers/ui_win32.h @@ -32,6 +32,11 @@ RETRO_BEGIN_DECLS +typedef struct ui_application_win32 +{ + void *empty; +} ui_application_win32_t; + typedef struct ui_window_win32 { HWND hwnd; From f17b4fba0568815a5b815e7316008ffe9d982dc0 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 7 Jun 2016 16:47:48 +0200 Subject: [PATCH 24/66] Rename ui_cocoa_window.h --- gfx/drivers_context/cocoa_gl_ctx.m | 2 +- ui/drivers/cocoa/cocoa_common.m | 2 +- ui/drivers/cocoa/ui_cocoa_window.m | 2 +- ui/drivers/{cocoa/ui_cocoa_window.h => ui_cocoa.h} | 13 +++++++++---- 4 files changed, 12 insertions(+), 7 deletions(-) rename ui/drivers/{cocoa/ui_cocoa_window.h => ui_cocoa.h} (84%) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index ce006b75ae..e038630e49 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -89,7 +89,7 @@ static bool g_is_syncing = true; static bool g_use_hw_ctx; #if defined(HAVE_COCOA) -#include "../../ui/drivers/cocoa/ui_cocoa_window.h" +#include "../../ui/drivers/ui_cocoa.h" static NSOpenGLPixelFormat* g_format; void *glcontext_get_ptr(void) diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index 7c06fff93f..4627c1c211 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -18,7 +18,7 @@ #include #include "cocoa_common.h" #ifdef HAVE_COCOA -#include "ui_cocoa_window.h" +#include "../ui_cocoa.h" #endif /* Define compatibility symbols and categories. */ diff --git a/ui/drivers/cocoa/ui_cocoa_window.m b/ui/drivers/cocoa/ui_cocoa_window.m index 9287fe765e..6a2282575f 100644 --- a/ui/drivers/cocoa/ui_cocoa_window.m +++ b/ui/drivers/cocoa/ui_cocoa_window.m @@ -20,7 +20,7 @@ #include #include "cocoa_common.h" -#include "ui_cocoa_window.h" +#include "../ui_cocoa.h" #include "../../ui_companion_driver.h" static void ui_window_cocoa_destroy(void *data) diff --git a/ui/drivers/cocoa/ui_cocoa_window.h b/ui/drivers/ui_cocoa.h similarity index 84% rename from ui/drivers/cocoa/ui_cocoa_window.h rename to ui/drivers/ui_cocoa.h index 23079dfe29..242e4a1151 100644 --- a/ui/drivers/cocoa/ui_cocoa_window.h +++ b/ui/drivers/ui_cocoa.h @@ -14,8 +14,8 @@ * If not, see . */ -#ifndef _COCOA_WINDOW_UI -#define _COCOA_WINDOW_UI +#ifndef _COCOA_UI +#define _COCOA_UI #include #include @@ -23,12 +23,17 @@ #include #include -#include "cocoa_common.h" +#include "cocoa/cocoa_common.h" -#include "../../ui_companion_driver.h" +#include "../ui_companion_driver.h" RETRO_BEGIN_DECLS +typedef struct ui_application_cocoa +{ + void *empty; +} ui_application_cocoa_t; + typedef struct ui_window_cocoa { CocoaView *data; From 3b16eb1e91b02a523bcc0dec1799c7e8a0024dfb Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 7 Jun 2016 16:51:25 +0200 Subject: [PATCH 25/66] Add (stub) ui_cocoa_application.m --- Makefile.common | 1 + griffin/griffin_objc.m | 1 + ui/drivers/cocoa/ui_cocoa_application.m | 31 +++++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 2 +- ui/ui_companion_driver.h | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 ui/drivers/cocoa/ui_cocoa_application.m diff --git a/Makefile.common b/Makefile.common index 4e37d10def..8be4c7266a 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1087,6 +1087,7 @@ ifeq ($(HAVE_COCOA),1) input/drivers_keyboard/keyboard_event_apple.o \ ui/drivers/ui_cocoa.o \ ui/drivers/cocoa/ui_cocoa_window.o \ + ui/drivers/cocoa/ui_cocoa_application.o \ ui/drivers/cocoa/cocoa_common.o \ gfx/drivers_context/cocoa_gl_ctx.o endif diff --git a/griffin/griffin_objc.m b/griffin/griffin_objc.m index 46b089901a..2d640d1c9f 100644 --- a/griffin/griffin_objc.m +++ b/griffin/griffin_objc.m @@ -42,6 +42,7 @@ #elif defined(HAVE_COCOA) #include "../ui/drivers/ui_cocoa.m" #include "../ui/drivers/cocoa/ui_cocoa_window.m" +#include "../ui/drivers/cocoa/ui_cocoa_application.m" #endif #endif diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m new file mode 100644 index 0000000000..74b2c5ebe7 --- /dev/null +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -0,0 +1,31 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static void ui_application_cocoa_process_events(void *data) +{ +} + +const ui_application_t ui_application_cocoa = { + ui_application_cocoa_process_events, + "cocoa" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index fc240b31f7..46b3da0f4b 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -597,6 +597,6 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, &ui_window_cocoa, - &ui_application_null, + &ui_application_cocoa, "cocoa", }; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 169bb8cb76..71996d5c0f 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -70,6 +70,7 @@ extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; extern const ui_application_t ui_application_null; +extern const ui_application_t ui_application_cocoa; extern const ui_companion_driver_t ui_companion_null; extern const ui_companion_driver_t ui_companion_cocoa; From 3aeecc7eb263bf9836c55606b2283768bdbda826 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 17:03:34 +0200 Subject: [PATCH 26/66] Create ui_win32_application.c --- Makefile.common | 3 ++- griffin/griffin.c | 1 + ui/drivers/ui_win32.c | 2 +- ui/drivers/win32/ui_win32_application.c | 31 +++++++++++++++++++++++++ ui/ui_companion_driver.h | 1 + 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 ui/drivers/win32/ui_win32_application.c diff --git a/Makefile.common b/Makefile.common index 8be4c7266a..1822a2363b 100644 --- a/Makefile.common +++ b/Makefile.common @@ -650,7 +650,8 @@ endif ifneq ($(findstring Win32,$(OS)),) OBJ += ui/drivers/ui_win32.o \ - ui/drivers/win32/ui_win32_window.o + ui/drivers/win32/ui_win32_window.o \ + ui/drivers/win32/ui_win32_application.o endif # Video diff --git a/griffin/griffin.c b/griffin/griffin.c index 5c2a4aa4fe..020b6c5770 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -732,6 +732,7 @@ UI #if defined(_WIN32) && !defined(_XBOX) #include "../ui/drivers/ui_win32.c" #include "../ui/drivers/win32/ui_win32_window.c" +#include "../ui/drivers/win32/ui_win32_application.c" #endif /*============================================================ diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 9450e3d00b..a33dd27757 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -730,6 +730,6 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, &ui_window_win32, - &ui_application_null, + &ui_application_win32, "win32", }; diff --git a/ui/drivers/win32/ui_win32_application.c b/ui/drivers/win32/ui_win32_application.c new file mode 100644 index 0000000000..2b0bf4b2f9 --- /dev/null +++ b/ui/drivers/win32/ui_win32_application.c @@ -0,0 +1,31 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static void ui_application_win32_process_events(void *data) +{ +} + +const ui_application_t ui_application_win32 = { + ui_application_win32_process_events, + "win32" +}; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 71996d5c0f..44710f02af 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -70,6 +70,7 @@ extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; extern const ui_application_t ui_application_null; +extern const ui_application_t ui_application_win32; extern const ui_application_t ui_application_cocoa; extern const ui_companion_driver_t ui_companion_null; From 4dded0c76bfe1ee61f76264f2b2b82a5996f9b99 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 17:07:11 +0200 Subject: [PATCH 27/66] Change signature of process_events --- ui/drivers/cocoa/ui_cocoa_application.m | 2 +- ui/drivers/null/ui_null_application.c | 2 +- ui/drivers/win32/ui_win32_application.c | 2 +- ui/ui_companion_driver.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m index 74b2c5ebe7..d757b7ddf3 100644 --- a/ui/drivers/cocoa/ui_cocoa_application.m +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -21,7 +21,7 @@ #include "../../ui_companion_driver.h" -static void ui_application_cocoa_process_events(void *data) +static void ui_application_cocoa_process_events(void) { } diff --git a/ui/drivers/null/ui_null_application.c b/ui/drivers/null/ui_null_application.c index 6704a22cec..6d49b0878c 100644 --- a/ui/drivers/null/ui_null_application.c +++ b/ui/drivers/null/ui_null_application.c @@ -21,7 +21,7 @@ #include "../../ui_companion_driver.h" -static void ui_application_null_process_events(void *data) +static void ui_application_null_process_events(void) { } diff --git a/ui/drivers/win32/ui_win32_application.c b/ui/drivers/win32/ui_win32_application.c index 2b0bf4b2f9..7120bb3173 100644 --- a/ui/drivers/win32/ui_win32_application.c +++ b/ui/drivers/win32/ui_win32_application.c @@ -21,7 +21,7 @@ #include "../../ui_companion_driver.h" -static void ui_application_win32_process_events(void *data) +static void ui_application_win32_process_events(void) { } diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 44710f02af..4c0bcb5b71 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -33,7 +33,7 @@ RETRO_BEGIN_DECLS typedef struct ui_application { - void (*process_events)(void *data); + void (*process_events)(void); const char *ident; } ui_application_t; From c1a321015a13cc69e6752ef4da038bfa682d3cbb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 17:10:27 +0200 Subject: [PATCH 28/66] Create ui_companion_driver_get_application_ptr --- ui/ui_companion_driver.c | 8 ++++++++ ui/ui_companion_driver.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index 1d2dc5cf9b..0df5dd85f5 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -177,3 +177,11 @@ const ui_window_t *ui_companion_driver_get_window_ptr(void) return NULL; return ui->window; } + +const ui_application_t *ui_companion_driver_get_application_ptr(void) +{ + const ui_companion_driver_t *ui = ui_companion_get_ptr(); + if (!ui) + return NULL; + return ui->application; +} diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 4c0bcb5b71..131b01e0e4 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -122,6 +122,8 @@ void ui_companion_driver_free(void); const ui_window_t *ui_companion_driver_get_window_ptr(void); +const ui_application_t *ui_companion_driver_get_application_ptr(void); + RETRO_END_DECLS #endif From 02910fd64d59c80635205c590ff123601358d65b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 7 Jun 2016 17:14:57 +0200 Subject: [PATCH 29/66] (Cocoa) Implement ui_application_process_events --- ui/drivers/cocoa/ui_cocoa_application.m | 11 +++++++++++ ui/drivers/ui_cocoa.m | 14 ++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m index d757b7ddf3..63af3b67ee 100644 --- a/ui/drivers/cocoa/ui_cocoa_application.m +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -19,10 +19,21 @@ #include #include +#include +#include "cocoa_common.h" #include "../../ui_companion_driver.h" static void ui_application_cocoa_process_events(void) { + while (1) + { + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES]; + if (!event) + break; + [event retain]; + [NSApp sendEvent: event]; + [event release]; + }; } const ui_application_t ui_application_cocoa = { diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 46b3da0f4b..6d246fe358 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -207,15 +207,7 @@ static char** waiting_argv; static void poll_iteration(void) { - while (1) - { - NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES]; - if (!event) - break; - [event retain]; - [NSApp sendEvent: event]; - [event release]; - }; + } - (void) rarch_main @@ -224,7 +216,9 @@ static void poll_iteration(void) while (ret != -1) { unsigned sleep_ms = 0; - poll_iteration(); + const ui_application_t *application = ui_companion_driver_get_application_ptr(); + if (application) + application->process_events(); ret = runloop_iterate(&sleep_ms); if (ret == 1 && sleep_ms > 0) retro_sleep(sleep_ms); From ba962d5ddaef8e0ad47b39d4d05d99a9989c3800 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Tue, 7 Jun 2016 17:16:16 +0200 Subject: [PATCH 30/66] Remove poll_iteration --- ui/drivers/ui_cocoa.m | 5 ----- 1 file changed, 5 deletions(-) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 6d246fe358..d18ee7466f 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -205,11 +205,6 @@ static char** waiting_argv; [self performSelectorOnMainThread:@selector(rarch_main) withObject:nil waitUntilDone:NO]; } -static void poll_iteration(void) -{ - -} - - (void) rarch_main { int ret = 0; From f4c3a41f84ed040518595f14a83753bf2d4a393a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 17:28:51 +0200 Subject: [PATCH 31/66] (Win32) Implement application process events --- gfx/common/win32_common.cpp | 10 +++------- libretro-common/include/compat/intrinsics.h | 6 +++--- tasks/task_save_state.c | 5 +++++ ui/drivers/win32/ui_win32_application.c | 14 ++++++++++++++ ui/drivers/win32/ui_win32_window.c | 2 ++ 5 files changed, 27 insertions(+), 10 deletions(-) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index e58d95e675..fb27a77ea3 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -537,13 +537,9 @@ void win32_show_cursor(bool state) void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) { #ifndef _XBOX - MSG msg; - - while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) - { - TranslateMessage(&msg); - DispatchMessage(&msg); - } + const ui_application_t *application = ui_companion_driver_get_application_ptr(); + if (application) + application->process_events(); #endif *quit = g_quit; diff --git a/libretro-common/include/compat/intrinsics.h b/libretro-common/include/compat/intrinsics.h index 994bccbef8..d93623ba8c 100644 --- a/libretro-common/include/compat/intrinsics.h +++ b/libretro-common/include/compat/intrinsics.h @@ -63,9 +63,9 @@ static INLINE int compat_ctz(unsigned x) #elif _MSC_VER >= 1400 static INLINE int compat_ctz(unsigned x) { - int r = 0; - _BitScanReverse(&r, x); - return r; + unsigned long r = 0; + _BitScanReverse((unsigned long*)&r, x); + return (int)r; } #else /* Only checks at nibble granularity, diff --git a/tasks/task_save_state.c b/tasks/task_save_state.c index 9422d1b88c..8c8a8dd002 100644 --- a/tasks/task_save_state.c +++ b/tasks/task_save_state.c @@ -18,7 +18,12 @@ #include #include #include + +#ifdef _WIN32 +#include +#else #include +#endif #include #include diff --git a/ui/drivers/win32/ui_win32_application.c b/ui/drivers/win32/ui_win32_application.c index 7120bb3173..3afe0fc893 100644 --- a/ui/drivers/win32/ui_win32_application.c +++ b/ui/drivers/win32/ui_win32_application.c @@ -19,10 +19,24 @@ #include #include +#include + #include "../../ui_companion_driver.h" static void ui_application_win32_process_events(void) { + MSG msg; + + while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) + { + MSG msg2; + + if (PeekMessage(&msg2, 0, 0, 0, PM_REMOVE)) + { + TranslateMessage(&msg2); + DispatchMessage (&msg2); + } + } } const ui_application_t ui_application_win32 = { diff --git a/ui/drivers/win32/ui_win32_window.c b/ui/drivers/win32/ui_win32_window.c index 2a371f2d89..987e751f49 100644 --- a/ui/drivers/win32/ui_win32_window.c +++ b/ui/drivers/win32/ui_win32_window.c @@ -20,6 +20,8 @@ #include #include +#include + #ifdef _MSC_VER #pragma comment( lib, "comctl32" ) #endif From dbf59a72bdfaf9111c3fc9c11b560ecb0309fe09 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 17:32:37 +0200 Subject: [PATCH 32/66] (ui_win32_application.c) Indenting cleanups --- ui/drivers/win32/ui_win32_application.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/drivers/win32/ui_win32_application.c b/ui/drivers/win32/ui_win32_application.c index 3afe0fc893..6c0a673fd9 100644 --- a/ui/drivers/win32/ui_win32_application.c +++ b/ui/drivers/win32/ui_win32_application.c @@ -31,11 +31,11 @@ static void ui_application_win32_process_events(void) { MSG msg2; - if (PeekMessage(&msg2, 0, 0, 0, PM_REMOVE)) - { + if (PeekMessage(&msg2, 0, 0, 0, PM_REMOVE)) + { TranslateMessage(&msg2); DispatchMessage (&msg2); - } + } } } From 3f44ba59eb50132970c1cc51aaab1785ffd6045d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 18:02:37 +0200 Subject: [PATCH 33/66] Add pending_events function callback --- ui/drivers/cocoa/ui_cocoa_application.m | 9 +++++++++ ui/drivers/null/ui_null_application.c | 6 ++++++ ui/drivers/win32/ui_win32_application.c | 17 +++++++++++------ ui/ui_companion_driver.h | 1 + 4 files changed, 27 insertions(+), 6 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m index 63af3b67ee..4ca526a099 100644 --- a/ui/drivers/cocoa/ui_cocoa_application.m +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -23,6 +23,14 @@ #include "cocoa_common.h" #include "../../ui_companion_driver.h" +static bool ui_application_cocoa_pending_events(void) +{ + NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES]; + if (!event) + return false; + return true; +} + static void ui_application_cocoa_process_events(void) { while (1) @@ -37,6 +45,7 @@ static void ui_application_cocoa_process_events(void) } const ui_application_t ui_application_cocoa = { + ui_application_cocoa_pending_events, ui_application_cocoa_process_events, "cocoa" }; diff --git a/ui/drivers/null/ui_null_application.c b/ui/drivers/null/ui_null_application.c index 6d49b0878c..7f90a10d60 100644 --- a/ui/drivers/null/ui_null_application.c +++ b/ui/drivers/null/ui_null_application.c @@ -21,11 +21,17 @@ #include "../../ui_companion_driver.h" +static bool ui_application_null_pending_events(void) +{ + return true; +} + static void ui_application_null_process_events(void) { } const ui_application_t ui_application_null = { + ui_application_null_pending_events, ui_application_null_process_events, "null" }; diff --git a/ui/drivers/win32/ui_win32_application.c b/ui/drivers/win32/ui_win32_application.c index 6c0a673fd9..9603469aad 100644 --- a/ui/drivers/win32/ui_win32_application.c +++ b/ui/drivers/win32/ui_win32_application.c @@ -23,23 +23,28 @@ #include "../../ui_companion_driver.h" -static void ui_application_win32_process_events(void) +static bool ui_application_win32_pending_events(void) { MSG msg; + return PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE); +} - while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) +static void ui_application_win32_process_events(void) +{ + while (ui_application_win32_pending_events()) { - MSG msg2; + MSG msg; - if (PeekMessage(&msg2, 0, 0, 0, PM_REMOVE)) + if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) { - TranslateMessage(&msg2); - DispatchMessage (&msg2); + TranslateMessage(&msg); + DispatchMessage (&msg); } } } const ui_application_t ui_application_win32 = { + ui_application_win32_pending_events, ui_application_win32_process_events, "win32" }; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 131b01e0e4..a1bf3a6752 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -33,6 +33,7 @@ RETRO_BEGIN_DECLS typedef struct ui_application { + bool (*pending_events)(void); void (*process_events)(void); const char *ident; } ui_application_t; From 20766147a6f3586f9dbcc9dc64f01e1a49ea82e5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Tue, 7 Jun 2016 18:04:07 +0200 Subject: [PATCH 34/66] Cleanup --- ui/drivers/cocoa/ui_cocoa_application.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/drivers/cocoa/ui_cocoa_application.m b/ui/drivers/cocoa/ui_cocoa_application.m index 4ca526a099..636bb0458f 100644 --- a/ui/drivers/cocoa/ui_cocoa_application.m +++ b/ui/drivers/cocoa/ui_cocoa_application.m @@ -41,7 +41,7 @@ static void ui_application_cocoa_process_events(void) [event retain]; [NSApp sendEvent: event]; [event release]; - }; + } } const ui_application_t ui_application_cocoa = { From 991ea3c0081fec6747f55d8adca691dc64fe9d26 Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 7 Jun 2016 19:40:11 -0500 Subject: [PATCH 35/66] [nk] fix nuklear in linux and don't request a core context on windows --- gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h | 2 +- gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h | 2 +- gfx/drivers/gl_shaders/shaders_common.h | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h b/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h index f93675553a..0ace8b1a3c 100644 --- a/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h +++ b/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h @@ -1,6 +1,6 @@ #include "shaders_common.h" -static const char *nuklear_fragment_shader = GLSL_330( +static const char *nuklear_fragment_shader = GLSL_300( precision mediump float; uniform sampler2D Texture; in vec2 Frag_UV; diff --git a/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h b/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h index b0c46850d1..a8c7a0bcea 100644 --- a/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h +++ b/gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h @@ -1,6 +1,6 @@ #include "shaders_common.h" -static const char *nuklear_vertex_shader = GLSL_330( +static const char *nuklear_vertex_shader = GLSL_300( uniform mat4 ProjMtx; in vec2 Position; in vec2 TexCoord; diff --git a/gfx/drivers/gl_shaders/shaders_common.h b/gfx/drivers/gl_shaders/shaders_common.h index a07c3a852c..2838bb4631 100644 --- a/gfx/drivers/gl_shaders/shaders_common.h +++ b/gfx/drivers/gl_shaders/shaders_common.h @@ -6,6 +6,7 @@ #define GLSL_330(src) "#version 330 es\nprecision mediump float;\n" #src #else #define GLSL(src) "" #src +#define GLSL_300(src) "#version 300 es\n" #src #define GLSL_330(src) "#version 330 core\n" #src #endif From 4e91f6fcd07435f131274388956edbb7c49fab15 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 05:26:33 +0200 Subject: [PATCH 36/66] Use CG macro instead --- gfx/drivers/gl_shaders/opaque.cg.h | 2 +- gfx/drivers/gl_shaders/pipeline_nuklear.cg.h | 2 +- gfx/drivers/gl_shaders/pipeline_xmb_ribbon_simple.cg.h | 2 +- gfx/drivers/gl_shaders/shaders_common.h | 2 ++ 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/gfx/drivers/gl_shaders/opaque.cg.h b/gfx/drivers/gl_shaders/opaque.cg.h index 1071a6f5fd..b105758ec4 100644 --- a/gfx/drivers/gl_shaders/opaque.cg.h +++ b/gfx/drivers/gl_shaders/opaque.cg.h @@ -1,6 +1,6 @@ #include "shaders_common.h" -static const char *stock_cg_gl_program = GLSL( +static const char *stock_cg_gl_program = CG( struct input { float2 tex_coord; diff --git a/gfx/drivers/gl_shaders/pipeline_nuklear.cg.h b/gfx/drivers/gl_shaders/pipeline_nuklear.cg.h index f2de0a2417..3b41dceb84 100644 --- a/gfx/drivers/gl_shaders/pipeline_nuklear.cg.h +++ b/gfx/drivers/gl_shaders/pipeline_nuklear.cg.h @@ -1,6 +1,6 @@ #include "shaders_common.h" -static const char *nuklear_shader = GLSL( +static const char *nuklear_shader = CG( struct input { float time; diff --git a/gfx/drivers/gl_shaders/pipeline_xmb_ribbon_simple.cg.h b/gfx/drivers/gl_shaders/pipeline_xmb_ribbon_simple.cg.h index de504a6c79..53dfa09483 100644 --- a/gfx/drivers/gl_shaders/pipeline_xmb_ribbon_simple.cg.h +++ b/gfx/drivers/gl_shaders/pipeline_xmb_ribbon_simple.cg.h @@ -1,6 +1,6 @@ #include "shaders_common.h" -static const char *stock_xmb_simple = GLSL( +static const char *stock_xmb_simple = CG( struct input { float time; diff --git a/gfx/drivers/gl_shaders/shaders_common.h b/gfx/drivers/gl_shaders/shaders_common.h index 2838bb4631..ce09b6eed8 100644 --- a/gfx/drivers/gl_shaders/shaders_common.h +++ b/gfx/drivers/gl_shaders/shaders_common.h @@ -2,9 +2,11 @@ #define _SHADERS_COMMON #if defined(HAVE_OPENGLES) +#define CG(src) "" #src #define GLSL(src) "precision mediump float;\n" #src #define GLSL_330(src) "#version 330 es\nprecision mediump float;\n" #src #else +#define CG(src) "" #src #define GLSL(src) "" #src #define GLSL_300(src) "#version 300 es\n" #src #define GLSL_330(src) "#version 330 core\n" #src From b7d3ed5264a66e1295b79f8cad989aaf79cf1f36 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 05:32:45 +0200 Subject: [PATCH 37/66] (nk_common.c) Add HAVE_GLSL ifdef --- menu/drivers/nuklear/nk_common.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/menu/drivers/nuklear/nk_common.c b/menu/drivers/nuklear/nk_common.c index 2770d06c39..cf5b2332d7 100644 --- a/menu/drivers/nuklear/nk_common.c +++ b/menu/drivers/nuklear/nk_common.c @@ -32,8 +32,10 @@ #include "../../menu_display.h" #include "../../../gfx/video_shader_driver.h" +#ifdef HAVE_GLSL #include "../../../gfx/drivers/gl_shaders/pipeline_nuklear.glsl.vert.h" #include "../../../gfx/drivers/gl_shaders/pipeline_nuklear.glsl.frag.h" +#endif struct nk_font *font; struct nk_font_atlas atlas; From 793d0de45c3df3afe9a0afd88319f0dd2bb18cd2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:17:26 +0200 Subject: [PATCH 38/66] Add ui_message_window_buttons/ui_message_window_response --- ui/ui_companion_driver.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index a1bf3a6752..9f263b7927 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -31,6 +31,22 @@ RETRO_BEGIN_DECLS +enum ui_message_window_buttons +{ + UI_MSG_WINDOW_OK = 0, + UI_MSG_WINDOW_OKCANCEL, + UI_MSG_WINDOW_YESNO, + UI_MSG_WINDOW_YESNOCANCEL +}; + +enum ui_message_window_response +{ + UI_MSG_RESPONSE_OK = 0, + UI_MSG_RESPONSE_CANCEL, + UI_MSG_RESPONSE_YES, + UI_MSG_RESPONSE_NO +}; + typedef struct ui_application { bool (*pending_events)(void); From c35e75a0bd84bf374aa44f6918546e00c39d9208 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:24:15 +0200 Subject: [PATCH 39/66] Create ui_msg_window_t --- ui/ui_companion_driver.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 9f263b7927..837e16048f 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -31,7 +31,7 @@ RETRO_BEGIN_DECLS -enum ui_message_window_buttons +enum ui_msg_window_buttons { UI_MSG_WINDOW_OK = 0, UI_MSG_WINDOW_OKCANCEL, @@ -39,7 +39,7 @@ enum ui_message_window_buttons UI_MSG_WINDOW_YESNOCANCEL }; -enum ui_message_window_response +enum ui_msg_window_response { UI_MSG_RESPONSE_OK = 0, UI_MSG_RESPONSE_CANCEL, @@ -47,6 +47,20 @@ enum ui_message_window_response UI_MSG_RESPONSE_NO }; +typedef struct ui_msg_window_state +{ + enum ui_msg_window_buttons buttons; + char text[256]; + char title[256]; +} ui_msg_window_state; + +typedef struct ui_msg_window +{ + enum ui_msg_window_response (*error)(ui_msg_window_state *state); + enum ui_msg_window_response (*information)(ui_msg_window_state *state); + enum ui_msg_window_response (*question)(ui_msg_window_state *state); +} ui_msg_window_t; + typedef struct ui_application { bool (*pending_events)(void); From a247b1616472c863b494002d61f0fbd88ba2457a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:29:52 +0200 Subject: [PATCH 40/66] Add ui_null_msg_window --- Makefile.common | 1 + griffin/griffin.c | 1 + ui/drivers/null/ui_null_msg_window.c | 44 ++++++++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 1 + ui/drivers/ui_cocoatouch.m | 1 + ui/drivers/ui_null.c | 1 + ui/drivers/ui_qt.c | 1 + ui/drivers/ui_win32.c | 1 + ui/ui_companion_driver.h | 4 +++ 9 files changed, 55 insertions(+) create mode 100644 ui/drivers/null/ui_null_msg_window.c diff --git a/Makefile.common b/Makefile.common index 1822a2363b..479a252d63 100644 --- a/Makefile.common +++ b/Makefile.common @@ -117,6 +117,7 @@ OBJ += frontend/frontend.o \ ui/ui_companion_driver.o \ ui/drivers/ui_null.o \ ui/drivers/null/ui_null_window.o \ + ui/drivers/null/ui_null_msg_window.o \ ui/drivers/null/ui_null_application.o \ core_impl.o \ retroarch.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 020b6c5770..f1a7c8cf63 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -723,6 +723,7 @@ UI #include "../ui/drivers/ui_null.c" #include "../ui/drivers/null/ui_null_window.c" +#include "../ui/drivers/null/ui_null_msg_window.c" #include "../ui/drivers/null/ui_null_application.c" #ifdef HAVE_QT diff --git a/ui/drivers/null/ui_null_msg_window.c b/ui/drivers/null/ui_null_msg_window.c new file mode 100644 index 0000000000..32f5d04dac --- /dev/null +++ b/ui/drivers/null/ui_null_msg_window.c @@ -0,0 +1,44 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static enum ui_msg_window_response ui_msg_window_null_error(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_null_information(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_null_question(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +const ui_msg_window_t ui_msg_window_null = { + ui_msg_window_null_error, + ui_msg_window_null_information, + ui_msg_window_null_question, + "null" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index d18ee7466f..881790f486 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -585,6 +585,7 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_cocoa, &ui_application_cocoa, "cocoa", diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index 74a17b3bfc..ee088add9c 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -687,6 +687,7 @@ const ui_companion_driver_t ui_companion_cocoatouch = { ui_companion_cocoatouch_notify_refresh, ui_companion_cocoatouch_msg_queue_push, ui_companion_cocoatouch_render_messagebox, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "cocoatouch", diff --git a/ui/drivers/ui_null.c b/ui/drivers/ui_null.c index 960096fcd5..6d4027e585 100644 --- a/ui/drivers/ui_null.c +++ b/ui/drivers/ui_null.c @@ -88,6 +88,7 @@ const ui_companion_driver_t ui_companion_null = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "null", diff --git a/ui/drivers/ui_qt.c b/ui/drivers/ui_qt.c index fb76f72e60..2b521f5cf5 100644 --- a/ui/drivers/ui_qt.c +++ b/ui/drivers/ui_qt.c @@ -132,6 +132,7 @@ const ui_companion_driver_t ui_companion_qt = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_null, &ui_application_null, "qt", diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index a33dd27757..7b338e054b 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -729,6 +729,7 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, + &ui_msg_window_null, &ui_window_win32, &ui_application_win32, "win32", diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 837e16048f..549cd37aec 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -59,6 +59,7 @@ typedef struct ui_msg_window enum ui_msg_window_response (*error)(ui_msg_window_state *state); enum ui_msg_window_response (*information)(ui_msg_window_state *state); enum ui_msg_window_response (*question)(ui_msg_window_state *state); + const char *ident; } ui_msg_window_t; typedef struct ui_application @@ -91,6 +92,7 @@ typedef struct ui_companion_driver void (*notify_refresh)(void *data); void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush); void (*render_messagebox)(const char *msg); + const ui_msg_window_t *msg_window; const ui_window_t *window; const ui_application_t *application; const char *ident; @@ -100,6 +102,8 @@ extern const ui_window_t ui_window_null; extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; +extern const ui_msg_window_t ui_msg_window_null; + extern const ui_application_t ui_application_null; extern const ui_application_t ui_application_win32; extern const ui_application_t ui_application_cocoa; From 10a25209da4b151d0f624dc12a42a63dc233ba5f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:33:15 +0200 Subject: [PATCH 41/66] (Msg window) Add backends for Win32/Cocoa --- Makefile.common | 1 + griffin/griffin.c | 1 + griffin/griffin_objc.m | 1 + ui/drivers/cocoa/ui_cocoa_msg_window.m | 44 ++++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 2 +- ui/drivers/ui_win32.c | 2 +- ui/drivers/win32/ui_win32_msg_window.c | 46 ++++++++++++++++++++++++++ ui/ui_companion_driver.h | 2 ++ 8 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 ui/drivers/cocoa/ui_cocoa_msg_window.m create mode 100644 ui/drivers/win32/ui_win32_msg_window.c diff --git a/Makefile.common b/Makefile.common index 479a252d63..4e1ebeeb70 100644 --- a/Makefile.common +++ b/Makefile.common @@ -652,6 +652,7 @@ endif ifneq ($(findstring Win32,$(OS)),) OBJ += ui/drivers/ui_win32.o \ ui/drivers/win32/ui_win32_window.o \ + ui/drivers/win32/ui_win32_msg_window.o \ ui/drivers/win32/ui_win32_application.o endif diff --git a/griffin/griffin.c b/griffin/griffin.c index f1a7c8cf63..e7e970eded 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -733,6 +733,7 @@ UI #if defined(_WIN32) && !defined(_XBOX) #include "../ui/drivers/ui_win32.c" #include "../ui/drivers/win32/ui_win32_window.c" +#include "../ui/drivers/win32/ui_win32_msg_window.c" #include "../ui/drivers/win32/ui_win32_application.c" #endif diff --git a/griffin/griffin_objc.m b/griffin/griffin_objc.m index 2d640d1c9f..3cbd73d805 100644 --- a/griffin/griffin_objc.m +++ b/griffin/griffin_objc.m @@ -42,6 +42,7 @@ #elif defined(HAVE_COCOA) #include "../ui/drivers/ui_cocoa.m" #include "../ui/drivers/cocoa/ui_cocoa_window.m" +#include "../ui/drivers/cocoa/ui_cocoa_msg_window.m" #include "../ui/drivers/cocoa/ui_cocoa_application.m" #endif diff --git a/ui/drivers/cocoa/ui_cocoa_msg_window.m b/ui/drivers/cocoa/ui_cocoa_msg_window.m new file mode 100644 index 0000000000..38a92df741 --- /dev/null +++ b/ui/drivers/cocoa/ui_cocoa_msg_window.m @@ -0,0 +1,44 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static enum ui_msg_window_response ui_msg_window_cocoa_error(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_cocoa_information(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_cocoa_question(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +const ui_msg_window_t ui_msg_window_cocoa = { + ui_msg_window_cocoa_error, + ui_msg_window_cocoa_information, + ui_msg_window_cocoa_question, + "cocoa" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 881790f486..ccd0e8f548 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -585,7 +585,7 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, - &ui_msg_window_null, + &ui_msg_window_cocoa, &ui_window_cocoa, &ui_application_cocoa, "cocoa", diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 7b338e054b..d72cd72d69 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -729,7 +729,7 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, - &ui_msg_window_null, + &ui_msg_window_win32, &ui_window_win32, &ui_application_win32, "win32", diff --git a/ui/drivers/win32/ui_win32_msg_window.c b/ui/drivers/win32/ui_win32_msg_window.c new file mode 100644 index 0000000000..3fa9fae03f --- /dev/null +++ b/ui/drivers/win32/ui_win32_msg_window.c @@ -0,0 +1,46 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include + +#include "../../ui_companion_driver.h" + +static enum ui_msg_window_response ui_msg_window_win32_error(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_win32_information(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +static enum ui_msg_window_response ui_msg_window_win32_question(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + +const ui_msg_window_t ui_msg_window_win32 = { + ui_msg_window_win32_error, + ui_msg_window_win32_information, + ui_msg_window_win32_question, + "win32" +}; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 549cd37aec..1c4e94a426 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -103,6 +103,8 @@ extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; extern const ui_msg_window_t ui_msg_window_null; +extern const ui_msg_window_t ui_msg_window_win32; +extern const ui_msg_window_t ui_msg_window_cocoa; extern const ui_application_t ui_application_null; extern const ui_application_t ui_application_win32; From a6406a57ca744c7c27237a9713bfdf09936c0e3e Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 06:35:04 +0200 Subject: [PATCH 42/66] Add ui_cocoa_msg_window.m to Cocoa --- Makefile.common | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile.common b/Makefile.common index 4e1ebeeb70..e29cd36c9c 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1090,6 +1090,7 @@ ifeq ($(HAVE_COCOA),1) input/drivers_keyboard/keyboard_event_apple.o \ ui/drivers/ui_cocoa.o \ ui/drivers/cocoa/ui_cocoa_window.o \ + ui/drivers/cocoa/ui_cocoa_msg_window.o \ ui/drivers/cocoa/ui_cocoa_application.o \ ui/drivers/cocoa/cocoa_common.o \ gfx/drivers_context/cocoa_gl_ctx.o From 1fc0009cdc3d328e248381c028ab652800fc30b2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 06:37:00 +0200 Subject: [PATCH 43/66] ui_msg_window_state - turn title and text into pointers --- ui/ui_companion_driver.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 1c4e94a426..dc6cfafe59 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -50,8 +50,8 @@ enum ui_msg_window_response typedef struct ui_msg_window_state { enum ui_msg_window_buttons buttons; - char text[256]; - char title[256]; + char *text; + char *title; } ui_msg_window_state; typedef struct ui_msg_window From aa81c1d82f93dc4d18d62b1742b9821d15ba409d Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 06:56:25 +0200 Subject: [PATCH 44/66] Start implementing ui_cocoa_msg_window.m --- ui/drivers/cocoa/ui_cocoa_msg_window.m | 94 +++++++++++++++++++++++++- ui/drivers/ui_cocoa.m | 2 +- ui/ui_companion_driver.h | 11 ++- 3 files changed, 102 insertions(+), 5 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_msg_window.m b/ui/drivers/cocoa/ui_cocoa_msg_window.m index 38a92df741..06d5e19cfb 100644 --- a/ui/drivers/cocoa/ui_cocoa_msg_window.m +++ b/ui/drivers/cocoa/ui_cocoa_msg_window.m @@ -19,21 +19,109 @@ #include #include +#include + +#include "cocoa_common.h" + #include "../../ui_companion_driver.h" +extern id apple_platform; + +static enum ui_msg_window_response ui_msg_window_cocoa_dialog(ui_msg_window_state *state, enum ui_msg_window_type type) +{ + NSInteger response; + NSAlert* alert = [[NSAlert new] autorelease]; + + if (!string_is_empty(state->title)) + [alert setMessageText:BOXSTRING(state->title)]; + [alert setInformativeText:BOXSTRING(state->text)]; + + switch (state->buttons) + { + case UI_MSG_WINDOW_OK: + [alert addButtonWithTitle:BOXSTRING("OK")]; + break; + case UI_MSG_WINDOW_YESNO: + [alert addButtonWithTitle:BOXSTRING("Yes")]; + [alert addButtonWithTitle:BOXSTRING("No")]; + break; + case UI_MSG_WINDOW_OKCANCEL: + [alert addButtonWithTitle:BOXSTRING("OK")]; + [alert addButtonWithTitle:BOXSTRING("Cancel")]; + break; + case UI_MSG_WINDOW_YESNOCANCEL: + [alert addButtonWithTitle:BOXSTRING("Yes")]; + [alert addButtonWithTitle:BOXSTRING("No")]; + [alert addButtonWithTitle:BOXSTRING("Cancel")]; + break; + } + + switch (type) + { + case UI_MSG_WINDOW_TYPE_ERROR: + [alert setAlertStyle:NSCriticalAlertStyle]; + break; + case UI_MSG_WINDOW_TYPE_WARNING: + [alert setAlertStyle:NSWarningAlertStyle]; + break; + case UI_MSG_WINDOW_TYPE_QUESTION: + [alert setAlertStyle:NSInformationalAlertStyle]; + break; + case UI_MSG_WINDOW_TYPE_INFORMATION: + [alert setAlertStyle:NSInformationalAlertStyle]; + break; + } + + [alert beginSheetModalForWindow:((RetroArch_OSX*)[[NSApplication sharedApplication] delegate]).window + modalDelegate:apple_platform + didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) + contextInfo:nil]; + response = [[NSApplication sharedApplication] runModalForWindow:[alert window]]; + + switch (state->buttons) + { + case UI_MSG_WINDOW_OK: + if (response == NSAlertFirstButtonReturn) + return UI_MSG_RESPONSE_OK; + break; + case UI_MSG_WINDOW_OKCANCEL: + if (response == NSAlertFirstButtonReturn) + return UI_MSG_RESPONSE_OK; + if (response == NSAlertSecondButtonReturn) + return UI_MSG_RESPONSE_CANCEL; + break; + case UI_MSG_WINDOW_YESNO: + if (response == NSAlertFirstButtonReturn) + return UI_MSG_RESPONSE_YES; + if (response == NSAlertSecondButtonReturn) + return UI_MSG_RESPONSE_NO; + break; + case UI_MSG_WINDOW_YESNOCANCEL: + if (response == NSAlertFirstButtonReturn) + return UI_MSG_RESPONSE_YES; + if (response == NSAlertSecondButtonReturn) + return UI_MSG_RESPONSE_NO; + if (response == NSAlertThirdButtonReturn) + return UI_MSG_RESPONSE_CANCEL; + break; + } + + return UI_MSG_RESPONSE_NA; +} + static enum ui_msg_window_response ui_msg_window_cocoa_error(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_ERROR); } static enum ui_msg_window_response ui_msg_window_cocoa_information(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_INFORMATION); } static enum ui_msg_window_response ui_msg_window_cocoa_question(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_QUESTION); } const ui_msg_window_t ui_msg_window_cocoa = { diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index ccd0e8f548..c5eb7facb3 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -35,7 +35,7 @@ #include "../../system.h" #include "../../tasks/tasks_internal.h" -static id apple_platform; +id apple_platform; static void app_terminate(void) { diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index dc6cfafe59..66ab650f2e 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -41,12 +41,21 @@ enum ui_msg_window_buttons enum ui_msg_window_response { - UI_MSG_RESPONSE_OK = 0, + UI_MSG_RESPONSE_NA = 0, + UI_MSG_RESPONSE_OK, UI_MSG_RESPONSE_CANCEL, UI_MSG_RESPONSE_YES, UI_MSG_RESPONSE_NO }; +enum ui_msg_window_type +{ + UI_MSG_WINDOW_TYPE_ERROR = 0, + UI_MSG_WINDOW_TYPE_INFORMATION, + UI_MSG_WINDOW_TYPE_QUESTION, + UI_MSG_WINDOW_TYPE_WARNING +}; + typedef struct ui_msg_window_state { enum ui_msg_window_buttons buttons; From 3c7fafe9a36476240413591583139c1c14581ad1 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 07:02:38 +0200 Subject: [PATCH 45/66] Create ui_companion_driver_get_msg_window_ptr --- ui/ui_companion_driver.c | 8 ++++++++ ui/ui_companion_driver.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index 0df5dd85f5..ef789526cd 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -170,6 +170,14 @@ void ui_companion_driver_free(void) ui_companion = NULL; } +const ui_msg_window_t *ui_companion_driver_get_msg_window_ptr(void) +{ + const ui_companion_driver_t *ui = ui_companion_get_ptr(); + if (!ui) + return NULL; + return ui->msg_window; +} + const ui_window_t *ui_companion_driver_get_window_ptr(void) { const ui_companion_driver_t *ui = ui_companion_get_ptr(); diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 66ab650f2e..0d3101c944 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -166,6 +166,8 @@ void ui_companion_driver_toggle(void); void ui_companion_driver_free(void); +const ui_msg_window_t *ui_companion_driver_get_msg_window_ptr(void); + const ui_window_t *ui_companion_driver_get_window_ptr(void); const ui_application_t *ui_companion_driver_get_application_ptr(void); From 6cf905508ec258c90f58f8fc9a4c0d08b4d6b87b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 07:07:10 +0200 Subject: [PATCH 46/66] Reimplement apple_display_alert to use new ui_msg_window implementation --- ui/drivers/ui_cocoa.m | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index c5eb7facb3..8395b46f32 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -506,16 +506,13 @@ int main(int argc, char *argv[]) void apple_display_alert(const char *message, const char *title) { - NSAlert* alert = [[NSAlert new] autorelease]; - - [alert setMessageText:(*title) ? BOXSTRING(title) : BOXSTRING("RetroArch")]; - [alert setInformativeText:BOXSTRING(message)]; - [alert setAlertStyle:NSInformationalAlertStyle]; - [alert beginSheetModalForWindow:((RetroArch_OSX*)[[NSApplication sharedApplication] delegate]).window - modalDelegate:apple_platform - didEndSelector:@selector(alertDidEnd:returnCode:contextInfo:) - contextInfo:nil]; - [[NSApplication sharedApplication] runModalForWindow:[alert window]]; + ui_msg_window_state msg_window_state; + const ui_msg_window_t *msg_window = ui_companion_driver_get_msg_window_ptr(); + if (!msg_window) + return; + msg_window_state.text = strdup(message); + msg_window_state.text = (*title) ? strdup(title) : strdup("RetroArch"); + msg_window->information(&msg_window_state); } typedef struct ui_companion_cocoa From 047ffe9d304d859f5a3508c14506d773587a0fc7 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 07:19:19 +0200 Subject: [PATCH 47/66] Remove apple_display_alert --- ui/drivers/cocoa/cocoa_common.h | 2 -- ui/drivers/ui_cocoa.m | 20 ++++++++------------ ui/drivers/ui_cocoatouch.m | 4 +++- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/ui/drivers/cocoa/cocoa_common.h b/ui/drivers/cocoa/cocoa_common.h index 93f4322a60..4fcb2ac8d0 100644 --- a/ui/drivers/cocoa/cocoa_common.h +++ b/ui/drivers/cocoa/cocoa_common.h @@ -112,8 +112,6 @@ void get_ios_version(int *major, int *minor); #endif -extern void apple_display_alert(const char *message, const char *title); - #define BOXSTRING(x) [NSString stringWithUTF8String:x] #define BOXINT(x) [NSNumber numberWithInt:x] #define BOXUINT(x) [NSNumber numberWithUnsignedInt:x] diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 8395b46f32..f6227425d9 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -281,7 +281,14 @@ static char** waiting_argv; } else { - apple_display_alert("Cannot open multiple files", "RetroArch"); + ui_msg_window_state msg_window_state; + const ui_msg_window_t *msg_window = ui_companion_driver_get_msg_window_ptr(); + if (msg_window) + { + msg_window_state.text = strdup("Cannot open multiple files"); + msg_window_state.text = strdup("RetroArch"); + msg_window->information(&msg_window_state); + } [sender replyToOpenOrPrint:NSApplicationDelegateReplyFailure]; } } @@ -504,17 +511,6 @@ int main(int argc, char *argv[]) return NSApplicationMain(argc, (const char **) argv); } -void apple_display_alert(const char *message, const char *title) -{ - ui_msg_window_state msg_window_state; - const ui_msg_window_t *msg_window = ui_companion_driver_get_msg_window_ptr(); - if (!msg_window) - return; - msg_window_state.text = strdup(message); - msg_window_state.text = (*title) ? strdup(title) : strdup("RetroArch"); - msg_window->information(&msg_window_state); -} - typedef struct ui_companion_cocoa { void *empty; diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index ee088add9c..f51f04300e 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -534,7 +534,8 @@ int main(int argc, char *argv[]) } } -void apple_display_alert(const char *message, const char *title) +#if 0 +static void apple_display_alert(const char *message, const char *title) { UIAlertView* alert = [[UIAlertView alloc] initWithTitle:BOXSTRING(title) message:BOXSTRING(message) @@ -543,6 +544,7 @@ void apple_display_alert(const char *message, const char *title) otherButtonTitles:nil]; [alert show]; } +#endif static void apple_rarch_exited(void) { From 615fc0432f786dbe60d100dbb68b4eead05e4342 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 07:24:26 +0200 Subject: [PATCH 48/66] Free strdup'ed values --- ui/drivers/ui_cocoa.m | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index f6227425d9..31c8feb036 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -281,13 +281,16 @@ static char** waiting_argv; } else { - ui_msg_window_state msg_window_state; const ui_msg_window_t *msg_window = ui_companion_driver_get_msg_window_ptr(); if (msg_window) { - msg_window_state.text = strdup("Cannot open multiple files"); - msg_window_state.text = strdup("RetroArch"); + ui_msg_window_state msg_window_state; + msg_window_state.text = strdup("Cannot open multiple files"); + msg_window_state.title = strdup("RetroArch"); msg_window->information(&msg_window_state); + + free(msg_window_state.text); + free(msg_window_state.title); } [sender replyToOpenOrPrint:NSApplicationDelegateReplyFailure]; } From 0a7bc4d21f60232d67229167992537a73a1ced77 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 07:27:46 +0200 Subject: [PATCH 49/66] Add 'warning' --- ui/drivers/cocoa/ui_cocoa_msg_window.m | 6 ++++++ ui/drivers/null/ui_null_msg_window.c | 6 ++++++ ui/drivers/win32/ui_win32_msg_window.c | 6 ++++++ ui/ui_companion_driver.h | 5 +++-- 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_msg_window.m b/ui/drivers/cocoa/ui_cocoa_msg_window.m index 06d5e19cfb..f09672b2d0 100644 --- a/ui/drivers/cocoa/ui_cocoa_msg_window.m +++ b/ui/drivers/cocoa/ui_cocoa_msg_window.m @@ -124,9 +124,15 @@ static enum ui_msg_window_response ui_msg_window_cocoa_question(ui_msg_window_st return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_QUESTION); } +static enum ui_msg_window_response ui_msg_window_cocoa_warning(ui_msg_window_state *state) +{ + return ui_msg_window_cocoa_dialog(state, UI_MSG_WINDOW_TYPE_WARNING); +} + const ui_msg_window_t ui_msg_window_cocoa = { ui_msg_window_cocoa_error, ui_msg_window_cocoa_information, ui_msg_window_cocoa_question, + ui_msg_window_cocoa_warning, "cocoa" }; diff --git a/ui/drivers/null/ui_null_msg_window.c b/ui/drivers/null/ui_null_msg_window.c index 32f5d04dac..20e91d3a46 100644 --- a/ui/drivers/null/ui_null_msg_window.c +++ b/ui/drivers/null/ui_null_msg_window.c @@ -36,9 +36,15 @@ static enum ui_msg_window_response ui_msg_window_null_question(ui_msg_window_sta return UI_MSG_RESPONSE_CANCEL; } +static enum ui_msg_window_response ui_msg_window_null_warning(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + const ui_msg_window_t ui_msg_window_null = { ui_msg_window_null_error, ui_msg_window_null_information, ui_msg_window_null_question, + ui_msg_window_null_warning, "null" }; diff --git a/ui/drivers/win32/ui_win32_msg_window.c b/ui/drivers/win32/ui_win32_msg_window.c index 3fa9fae03f..cb26058a81 100644 --- a/ui/drivers/win32/ui_win32_msg_window.c +++ b/ui/drivers/win32/ui_win32_msg_window.c @@ -38,9 +38,15 @@ static enum ui_msg_window_response ui_msg_window_win32_question(ui_msg_window_st return UI_MSG_RESPONSE_CANCEL; } +static enum ui_msg_window_response ui_msg_window_win32_warning(ui_msg_window_state *state) +{ + return UI_MSG_RESPONSE_CANCEL; +} + const ui_msg_window_t ui_msg_window_win32 = { ui_msg_window_win32_error, ui_msg_window_win32_information, ui_msg_window_win32_question, + ui_msg_window_win32_warning, "win32" }; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 0d3101c944..8affdb8b9d 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -65,9 +65,10 @@ typedef struct ui_msg_window_state typedef struct ui_msg_window { - enum ui_msg_window_response (*error)(ui_msg_window_state *state); + enum ui_msg_window_response (*error )(ui_msg_window_state *state); enum ui_msg_window_response (*information)(ui_msg_window_state *state); - enum ui_msg_window_response (*question)(ui_msg_window_state *state); + enum ui_msg_window_response (*question )(ui_msg_window_state *state); + enum ui_msg_window_response (*warning )(ui_msg_window_state *state); const char *ident; } ui_msg_window_t; From f1708563744b6c4275a73d345e4bad1843a02632 Mon Sep 17 00:00:00 2001 From: neville Date: Wed, 8 Jun 2016 07:41:59 +0200 Subject: [PATCH 50/66] (OSX) Fixes --- gfx/drivers_context/cocoa_gl_ctx.m | 3 ++- pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj | 8 ++++---- ui/drivers/cocoa/cocoa_common.m | 1 + 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index e038630e49..9e30e3176e 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -31,6 +31,7 @@ #endif #endif +#include #include #import "../../ui/drivers/cocoa/cocoa_common.h" @@ -163,7 +164,7 @@ void *get_chosen_screen(void) if (settings->video.monitor_index >= screens.count) { - RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead.\n"); + RARCH_WARN("video_monitor_index is greater than the number of connected monitors; using main screen instead."); #if __has_feature(objc_arc) return (__bridge void*)screens; #else diff --git a/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj index ee01406c5c..7969a31c6c 100644 --- a/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_PPC.xcodeproj/project.pbxproj @@ -282,7 +282,7 @@ ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = ( "-DHAVE_GRIFFIN", - "-DHAVE_LANGEXTRA", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_STB_FONT", "-DHAVE_IOHIDMANAGER", @@ -316,7 +316,7 @@ "-DHAVE_ZARCH", "-DHAVE_HID", "-DHAVE_XMB", - "-DHAVE_SHADERPIPELINE", + "-DHAVE_SHADERPIPELINE", "-DHAVE_MMAP", "-DHAVE_LIBRETRODB", "-DHAVE_FILTERS_BUILTIN", @@ -356,7 +356,7 @@ "-DNS_BLOCK_ASSERTIONS=1", "-DNDEBUG", "-DHAVE_GRIFFIN", - "-DHAVE_LANGEXTRA", + "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_STB_FONT", "-DHAVE_IOHIDMANAGER", @@ -390,7 +390,7 @@ "-DHAVE_ZARCH", "-DHAVE_HID", "-DHAVE_XMB", - "-DHAVE_SHADERPIPELINE", + "-DHAVE_SHADERPIPELINE", "-DHAVE_MMAP", "-DHAVE_LIBRETRODB", "-DHAVE_FILTERS_BUILTIN", diff --git a/ui/drivers/cocoa/cocoa_common.m b/ui/drivers/cocoa/cocoa_common.m index 4627c1c211..248aa170e2 100644 --- a/ui/drivers/cocoa/cocoa_common.m +++ b/ui/drivers/cocoa/cocoa_common.m @@ -20,6 +20,7 @@ #ifdef HAVE_COCOA #include "../ui_cocoa.h" #endif +#include "../../../verbosity.h" /* Define compatibility symbols and categories. */ From d178f90cc14edef362c22d57a6c82c6191707288 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 08:19:06 +0200 Subject: [PATCH 51/66] Remove this header --- gfx/drivers_context/cocoa_gl_ctx.m | 1 - 1 file changed, 1 deletion(-) diff --git a/gfx/drivers_context/cocoa_gl_ctx.m b/gfx/drivers_context/cocoa_gl_ctx.m index 9e30e3176e..2735ddd8ff 100644 --- a/gfx/drivers_context/cocoa_gl_ctx.m +++ b/gfx/drivers_context/cocoa_gl_ctx.m @@ -31,7 +31,6 @@ #endif #endif -#include #include #import "../../ui/drivers/cocoa/cocoa_common.h" From 47abc22fe9ab89d51e6aac07264fb95d76960e94 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 10:05:48 +0200 Subject: [PATCH 52/66] ui_win32_window.c needs to become a C++ file for DragAcceptFiles --- griffin/griffin.c | 1 - griffin/griffin_cpp.cpp | 8 ++++++++ ui/drivers/win32/ui_win32_msg_window.c | 17 +++++++++++++++++ .../{ui_win32_window.c => ui_win32_window.cpp} | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) rename ui/drivers/win32/{ui_win32_window.c => ui_win32_window.cpp} (96%) diff --git a/griffin/griffin.c b/griffin/griffin.c index e7e970eded..48a6c912dd 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -732,7 +732,6 @@ UI #if defined(_WIN32) && !defined(_XBOX) #include "../ui/drivers/ui_win32.c" -#include "../ui/drivers/win32/ui_win32_window.c" #include "../ui/drivers/win32/ui_win32_msg_window.c" #include "../ui/drivers/win32/ui_win32_application.c" #endif diff --git a/griffin/griffin_cpp.cpp b/griffin/griffin_cpp.cpp index 54e88b1233..f1d4a01743 100644 --- a/griffin/griffin_cpp.cpp +++ b/griffin/griffin_cpp.cpp @@ -120,6 +120,14 @@ VIDEO CONTEXT #include "../gfx/drivers_context/d3d_ctx.cpp" #endif +/*============================================================ +UI +============================================================ */ + +#if defined(_WIN32) && !defined(_XBOX) +#include "../ui/drivers/win32/ui_win32_window.cpp" +#endif + /*============================================================ VIDEO DRIVER ============================================================ */ diff --git a/ui/drivers/win32/ui_win32_msg_window.c b/ui/drivers/win32/ui_win32_msg_window.c index cb26058a81..24ce672389 100644 --- a/ui/drivers/win32/ui_win32_msg_window.c +++ b/ui/drivers/win32/ui_win32_msg_window.c @@ -23,6 +23,23 @@ #include "../../ui_companion_driver.h" +static enum ui_msg_window_response ui_msg_window_win32_response(ui_msg_window_state *state, UINT response) +{ + switch (response) + { + case IDOK: + return UI_MSG_RESPONSE_OK; + case IDCANCEL: + return UI_MSG_RESPONSE_CANCEL; + case IDYES: + return UI_MSG_RESPONSE_YES; + case IDNO: + return UI_MSG_RESPONSE_NO; + } + + return UI_MSG_RESPONSE_NA; +} + static enum ui_msg_window_response ui_msg_window_win32_error(ui_msg_window_state *state) { return UI_MSG_RESPONSE_CANCEL; diff --git a/ui/drivers/win32/ui_win32_window.c b/ui/drivers/win32/ui_win32_window.cpp similarity index 96% rename from ui/drivers/win32/ui_win32_window.c rename to ui/drivers/win32/ui_win32_window.cpp index 987e751f49..9df67c27e7 100644 --- a/ui/drivers/win32/ui_win32_window.c +++ b/ui/drivers/win32/ui_win32_window.cpp @@ -77,6 +77,7 @@ static void ui_window_win32_set_title(void *data, char *buf) static void ui_window_win32_set_droppable(void *data, bool droppable) { + /* Minimum supported client: Windows XP, minimum supported server: Windows 2000 Server */ ui_window_win32_t *window = (ui_window_win32_t*)data; DragAcceptFiles(window->hwnd, droppable); } From d63442ca3b89d7145524e7ce55c7e6c021a28e59 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 10:19:37 +0200 Subject: [PATCH 53/66] Implement ui_win32_msg_window --- ui/drivers/win32/ui_win32_msg_window.c | 45 +++++++++++++++++++++++--- 1 file changed, 41 insertions(+), 4 deletions(-) diff --git a/ui/drivers/win32/ui_win32_msg_window.c b/ui/drivers/win32/ui_win32_msg_window.c index 24ce672389..97a20b73a2 100644 --- a/ui/drivers/win32/ui_win32_msg_window.c +++ b/ui/drivers/win32/ui_win32_msg_window.c @@ -35,29 +35,66 @@ static enum ui_msg_window_response ui_msg_window_win32_response(ui_msg_window_st return UI_MSG_RESPONSE_YES; case IDNO: return UI_MSG_RESPONSE_NO; + default: + break; + } + + switch (state->buttons) + { + case UI_MSG_WINDOW_OK: + return UI_MSG_RESPONSE_OK; + case UI_MSG_WINDOW_OKCANCEL: + return UI_MSG_RESPONSE_CANCEL; + case UI_MSG_WINDOW_YESNO: + return UI_MSG_RESPONSE_NO; + case UI_MSG_WINDOW_YESNOCANCEL: + return UI_MSG_RESPONSE_CANCEL; + default: + break; } return UI_MSG_RESPONSE_NA; } +static UINT ui_msg_window_win32_buttons(ui_msg_window_state *state) +{ + switch (state->buttons) + { + case UI_MSG_WINDOW_OK: + return MB_OK; + case UI_MSG_WINDOW_OKCANCEL: + return MB_OKCANCEL; + case UI_MSG_WINDOW_YESNO: + return MB_YESNO; + case UI_MSG_WINDOW_YESNOCANCEL: + return MB_YESNOCANCEL; + } + + return 0; +} + static enum ui_msg_window_response ui_msg_window_win32_error(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + UINT flags = MB_ICONERROR | ui_msg_window_win32_buttons(state); + return ui_msg_window_win32_response(state, MessageBoxA(NULL, (LPCSTR)state->text, (LPCSTR)state->title, flags)); } static enum ui_msg_window_response ui_msg_window_win32_information(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + UINT flags = MB_ICONINFORMATION | ui_msg_window_win32_buttons(state); + return ui_msg_window_win32_response(state, MessageBoxA(NULL, (LPCSTR)state->text, (LPCSTR)state->title, flags)); } static enum ui_msg_window_response ui_msg_window_win32_question(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + UINT flags = MB_ICONQUESTION | ui_msg_window_win32_buttons(state); + return ui_msg_window_win32_response(state, MessageBoxA(NULL, (LPCSTR)state->text, (LPCSTR)state->title, flags)); } static enum ui_msg_window_response ui_msg_window_win32_warning(ui_msg_window_state *state) { - return UI_MSG_RESPONSE_CANCEL; + UINT flags = MB_ICONWARNING | ui_msg_window_win32_buttons(state); + return ui_msg_window_win32_response(state, MessageBoxA(NULL, (LPCSTR)state->text, (LPCSTR)state->title, flags)); } const ui_msg_window_t ui_msg_window_win32 = { From 0e01a3c84b871e7e26ec4bb2a0d5d26573b528e0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 15:47:00 +0200 Subject: [PATCH 54/66] Add ui_browser_window --- Makefile.common | 1 + griffin/griffin.c | 1 + ui/drivers/ui_cocoa.m | 1 + ui/drivers/ui_cocoatouch.m | 1 + ui/drivers/ui_null.c | 1 + ui/drivers/ui_qt.c | 1 + ui/drivers/ui_win32.c | 1 + ui/ui_companion_driver.h | 23 ++++++++++++++++++++--- 8 files changed, 27 insertions(+), 3 deletions(-) diff --git a/Makefile.common b/Makefile.common index e29cd36c9c..ef959c8d64 100644 --- a/Makefile.common +++ b/Makefile.common @@ -117,6 +117,7 @@ OBJ += frontend/frontend.o \ ui/ui_companion_driver.o \ ui/drivers/ui_null.o \ ui/drivers/null/ui_null_window.o \ + ui/drivers/null/ui_null_browser_window.o \ ui/drivers/null/ui_null_msg_window.o \ ui/drivers/null/ui_null_application.o \ core_impl.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 48a6c912dd..3a48eb8dbc 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -723,6 +723,7 @@ UI #include "../ui/drivers/ui_null.c" #include "../ui/drivers/null/ui_null_window.c" +#include "../ui/drivers/null/ui_null_browser_window.c" #include "../ui/drivers/null/ui_null_msg_window.c" #include "../ui/drivers/null/ui_null_application.c" diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 31c8feb036..2db46d31bb 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -581,6 +581,7 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, + &ui_browser_window_null, &ui_msg_window_cocoa, &ui_window_cocoa, &ui_application_cocoa, diff --git a/ui/drivers/ui_cocoatouch.m b/ui/drivers/ui_cocoatouch.m index f51f04300e..2f3df5027e 100644 --- a/ui/drivers/ui_cocoatouch.m +++ b/ui/drivers/ui_cocoatouch.m @@ -689,6 +689,7 @@ const ui_companion_driver_t ui_companion_cocoatouch = { ui_companion_cocoatouch_notify_refresh, ui_companion_cocoatouch_msg_queue_push, ui_companion_cocoatouch_render_messagebox, + &ui_browser_window_null, &ui_msg_window_null, &ui_window_null, &ui_application_null, diff --git a/ui/drivers/ui_null.c b/ui/drivers/ui_null.c index 6d4027e585..d1520c7875 100644 --- a/ui/drivers/ui_null.c +++ b/ui/drivers/ui_null.c @@ -88,6 +88,7 @@ const ui_companion_driver_t ui_companion_null = { NULL, NULL, NULL, + &ui_browser_window_null, &ui_msg_window_null, &ui_window_null, &ui_application_null, diff --git a/ui/drivers/ui_qt.c b/ui/drivers/ui_qt.c index 2b521f5cf5..899d3b6ccb 100644 --- a/ui/drivers/ui_qt.c +++ b/ui/drivers/ui_qt.c @@ -132,6 +132,7 @@ const ui_companion_driver_t ui_companion_qt = { NULL, NULL, NULL, + &ui_browser_window_null, &ui_msg_window_null, &ui_window_null, &ui_application_null, diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index d72cd72d69..fc47842982 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -729,6 +729,7 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, + &ui_browser_window_null, &ui_msg_window_win32, &ui_window_win32, &ui_application_win32, diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 8affdb8b9d..80db91a131 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -63,6 +63,20 @@ typedef struct ui_msg_window_state char *title; } ui_msg_window_state; +typedef struct ui_browser_window_state +{ + char *filters; + char *path; + char *title; +} ui_browser_window_state_t; + +typedef struct ui_browser_window +{ + bool (*open)(ui_browser_window_state_t *state); + bool (*save)(ui_browser_window_state_t *state); + const char *ident; +} ui_browser_window_t; + typedef struct ui_msg_window { enum ui_msg_window_response (*error )(ui_msg_window_state *state); @@ -102,12 +116,15 @@ typedef struct ui_companion_driver void (*notify_refresh)(void *data); void (*msg_queue_push)(const char *msg, unsigned priority, unsigned duration, bool flush); void (*render_messagebox)(const char *msg); - const ui_msg_window_t *msg_window; - const ui_window_t *window; - const ui_application_t *application; + const ui_browser_window_t *browser_window; + const ui_msg_window_t *msg_window; + const ui_window_t *window; + const ui_application_t *application; const char *ident; } ui_companion_driver_t; +extern const ui_browser_window_t ui_browser_window_null; + extern const ui_window_t ui_window_null; extern const ui_window_t ui_window_cocoa; extern const ui_window_t ui_window_win32; From 969ef4b88dd7c7503f0c6c82ae7b69c0d1af6905 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 15:51:43 +0200 Subject: [PATCH 55/66] Add stub browser window implementations for Win32/Cocoa --- griffin/griffin.c | 1 + ui/drivers/cocoa/ui_cocoa_browser_window.m | 40 ++++++++++++++++++++++ ui/drivers/ui_cocoa.m | 2 +- ui/drivers/ui_win32.c | 2 +- ui/drivers/win32/ui_win32_browser_window.c | 40 ++++++++++++++++++++++ ui/ui_companion_driver.h | 2 ++ 6 files changed, 85 insertions(+), 2 deletions(-) create mode 100644 ui/drivers/cocoa/ui_cocoa_browser_window.m create mode 100644 ui/drivers/win32/ui_win32_browser_window.c diff --git a/griffin/griffin.c b/griffin/griffin.c index 3a48eb8dbc..f3433d1713 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -733,6 +733,7 @@ UI #if defined(_WIN32) && !defined(_XBOX) #include "../ui/drivers/ui_win32.c" +#include "../ui/drivers/win32/ui_win32_browser_window.c" #include "../ui/drivers/win32/ui_win32_msg_window.c" #include "../ui/drivers/win32/ui_win32_application.c" #endif diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m new file mode 100644 index 0000000000..bd1d2135b8 --- /dev/null +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -0,0 +1,40 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "cocoa_common.h" + +#include "../../ui_companion_driver.h" + +static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) +{ + return false; +} + +static bool ui_browser_window_cocoa_save(ui_browser_window_state_t *state) +{ + return false; +} + +const ui_browser_window_t ui_browser_window_cocoa = { + ui_browser_window_cocoa_open, + ui_browser_window_cocoa_save, + "cocoa" +}; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 2db46d31bb..a1c50d1905 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -581,7 +581,7 @@ const ui_companion_driver_t ui_companion_cocoa = { NULL, NULL, NULL, - &ui_browser_window_null, + &ui_browser_window_cocoa, &ui_msg_window_cocoa, &ui_window_cocoa, &ui_application_cocoa, diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index fc47842982..86390a2877 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -729,7 +729,7 @@ const ui_companion_driver_t ui_companion_win32 = { NULL, NULL, NULL, - &ui_browser_window_null, + &ui_browser_window_win32, &ui_msg_window_win32, &ui_window_win32, &ui_application_win32, diff --git a/ui/drivers/win32/ui_win32_browser_window.c b/ui/drivers/win32/ui_win32_browser_window.c new file mode 100644 index 0000000000..c9fa086c76 --- /dev/null +++ b/ui/drivers/win32/ui_win32_browser_window.c @@ -0,0 +1,40 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include + +#include "../../ui_companion_driver.h" + +static bool ui_browser_window_win32_open(ui_browser_window_state_t *state) +{ + return false; +} + +static bool ui_browser_window_win32_save(ui_browser_window_state_t *state) +{ + return false; +} + +const ui_browser_window_t ui_browser_window_win32 = { + ui_browser_window_win32_open, + ui_browser_window_win32_save, + "win32" +}; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 80db91a131..f119e73fa4 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -124,6 +124,8 @@ typedef struct ui_companion_driver } ui_companion_driver_t; extern const ui_browser_window_t ui_browser_window_null; +extern const ui_browser_window_t ui_browser_window_cocoa; +extern const ui_browser_window_t ui_browser_window_win32; extern const ui_window_t ui_window_null; extern const ui_window_t ui_window_cocoa; From 7a3e3ab46b80fadf08ae6eb14ab07456bbdef547 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 15:52:58 +0200 Subject: [PATCH 56/66] Add to Makefile files --- Makefile.common | 2 ++ griffin/griffin_objc.m | 1 + 2 files changed, 3 insertions(+) diff --git a/Makefile.common b/Makefile.common index ef959c8d64..69733f65c5 100644 --- a/Makefile.common +++ b/Makefile.common @@ -653,6 +653,7 @@ endif ifneq ($(findstring Win32,$(OS)),) OBJ += ui/drivers/ui_win32.o \ ui/drivers/win32/ui_win32_window.o \ + ui/drivers/win32/ui_win32_browser_window.o \ ui/drivers/win32/ui_win32_msg_window.o \ ui/drivers/win32/ui_win32_application.o endif @@ -1091,6 +1092,7 @@ ifeq ($(HAVE_COCOA),1) input/drivers_keyboard/keyboard_event_apple.o \ ui/drivers/ui_cocoa.o \ ui/drivers/cocoa/ui_cocoa_window.o \ + ui/drivers/cocoa/ui_cocoa_browser_window.o \ ui/drivers/cocoa/ui_cocoa_msg_window.o \ ui/drivers/cocoa/ui_cocoa_application.o \ ui/drivers/cocoa/cocoa_common.o \ diff --git a/griffin/griffin_objc.m b/griffin/griffin_objc.m index 3cbd73d805..31960ffa45 100644 --- a/griffin/griffin_objc.m +++ b/griffin/griffin_objc.m @@ -41,6 +41,7 @@ #elif defined(HAVE_COCOA) #include "../ui/drivers/ui_cocoa.m" +#include "../ui/drivers/cocoa/ui_cocoa_browser_window.m" #include "../ui/drivers/cocoa/ui_cocoa_window.m" #include "../ui/drivers/cocoa/ui_cocoa_msg_window.m" #include "../ui/drivers/cocoa/ui_cocoa_application.m" From d9e61e51538ef8dafe3d451d111c8c93249be371 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 15:53:59 +0200 Subject: [PATCH 57/66] Add missing file --- ui/drivers/null/ui_null_browser_window.c | 38 ++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 ui/drivers/null/ui_null_browser_window.c diff --git a/ui/drivers/null/ui_null_browser_window.c b/ui/drivers/null/ui_null_browser_window.c new file mode 100644 index 0000000000..9b0209a361 --- /dev/null +++ b/ui/drivers/null/ui_null_browser_window.c @@ -0,0 +1,38 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * + * RetroArch is free software: you can redistribute it and/or modify it under the terms + * of the GNU General Public License as published by the Free Software Found- + * ation, either version 3 of the License, or (at your option) any later version. + * + * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; + * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR + * PURPOSE. See the GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along with RetroArch. + * If not, see . + */ + +#include +#include +#include +#include +#include + +#include "../../ui_companion_driver.h" + +static bool ui_browser_window_null_open(ui_browser_window_state_t *state) +{ + return false; +} + +static bool ui_browser_window_null_save(ui_browser_window_state_t *state) +{ + return false; +} + +const ui_browser_window_t ui_browser_window_null = { + ui_browser_window_null_open, + ui_browser_window_null_save, + "null" +}; From 9e5ad14da005539b5cbc050ce5ba8ff0683b326b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 16:11:06 +0200 Subject: [PATCH 58/66] Start implementing untested ui_browser_window_cocoa_open function --- ui/drivers/cocoa/ui_cocoa_browser_window.m | 19 +++++++++++++++++++ ui/ui_companion_driver.h | 2 ++ 2 files changed, 21 insertions(+) diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m index bd1d2135b8..5369e31134 100644 --- a/ui/drivers/cocoa/ui_cocoa_browser_window.m +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -25,6 +25,25 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) { + NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; + NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING("dylib"), BOXSTRING("Core"), nil]; + [panel setAllowedFileTypes:filetypes]; +#if defined(MAC_OS_X_VERSION_10_6) + [panel setMessage:BOXSTRING(state->title)]; + if ([panel runModalForDirectory:BOXSTRING(state->path) file:nil] == 1) + return true; +#else + [panel setTitle:NSLocalizedString(BOXSTRING(string->title), BOXSTRING("open panel"))]; + [panel setDirectory:BOXSTRING(state->startdir)]; + [panel setCanChooseDirectories:NO]; + [panel setCanChooseFiles:YES]; + [panel setAllowsMultipleSelection:NO]; + [panel setTreatsFilePackagesAsDirectories:NO]; + NSInteger result = [panel runModal]; + if (result == 1) + return true; +#endif + return false; } diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index f119e73fa4..e26bb70b24 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -65,7 +65,9 @@ typedef struct ui_msg_window_state typedef struct ui_browser_window_state { + void *window; char *filters; + char *startdir; char *path; char *title; } ui_browser_window_state_t; From 8088df5f0902f08ef710087462d3555bd3a89c95 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 16:39:46 +0200 Subject: [PATCH 59/66] Cleanups --- ui/drivers/cocoa/ui_cocoa_browser_window.m | 4 ++-- ui/ui_companion_driver.h | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m index 5369e31134..a37fc0b809 100644 --- a/ui/drivers/cocoa/ui_cocoa_browser_window.m +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -25,8 +25,8 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) { - NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; - NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING("dylib"), BOXSTRING("Core"), nil]; + NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; + NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING(state->filters), BOXSTRING(state->filters_title), nil]; [panel setAllowedFileTypes:filetypes]; #if defined(MAC_OS_X_VERSION_10_6) [panel setMessage:BOXSTRING(state->title)]; diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index e26bb70b24..6bbd6668a5 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -67,6 +67,7 @@ typedef struct ui_browser_window_state { void *window; char *filters; + char *filters_title; char *startdir; char *path; char *title; From 82ae93e348c108ff65f0de6b9d7c374a7e82ef0f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 16:56:45 +0200 Subject: [PATCH 60/66] Add ui_companion_driver_get_browser_window_ptr --- ui/ui_companion_driver.c | 8 ++++++++ ui/ui_companion_driver.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/ui/ui_companion_driver.c b/ui/ui_companion_driver.c index ef789526cd..8764cbe159 100644 --- a/ui/ui_companion_driver.c +++ b/ui/ui_companion_driver.c @@ -186,6 +186,14 @@ const ui_window_t *ui_companion_driver_get_window_ptr(void) return ui->window; } +const ui_browser_window_t *ui_companion_driver_get_browser_window_ptr(void) +{ + const ui_companion_driver_t *ui = ui_companion_get_ptr(); + if (!ui) + return NULL; + return ui->browser_window; +} + const ui_application_t *ui_companion_driver_get_application_ptr(void) { const ui_companion_driver_t *ui = ui_companion_get_ptr(); diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index 6bbd6668a5..fa3a5f595a 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -191,6 +191,8 @@ void ui_companion_driver_free(void); const ui_msg_window_t *ui_companion_driver_get_msg_window_ptr(void); +const ui_browser_window_t *ui_companion_driver_get_browser_window_ptr(void); + const ui_window_t *ui_companion_driver_get_window_ptr(void); const ui_application_t *ui_companion_driver_get_application_ptr(void); From 1cd441b1255a5f215b3c182a73ffb48836944f14 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 17:18:48 +0200 Subject: [PATCH 61/66] (Cocoa) Reimplement browser loading code --- ui/drivers/cocoa/ui_cocoa_browser_window.m | 15 ++-- ui/drivers/ui_cocoa.m | 95 ++++++++++------------ ui/ui_companion_driver.h | 1 + 3 files changed, 51 insertions(+), 60 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m index a37fc0b809..199585fdca 100644 --- a/ui/drivers/cocoa/ui_cocoa_browser_window.m +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -30,8 +30,8 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) [panel setAllowedFileTypes:filetypes]; #if defined(MAC_OS_X_VERSION_10_6) [panel setMessage:BOXSTRING(state->title)]; - if ([panel runModalForDirectory:BOXSTRING(state->path) file:nil] == 1) - return true; + if ([panel runModalForDirectory:BOXSTRING(state->startdir) file:nil] != 1) + return false; #else [panel setTitle:NSLocalizedString(BOXSTRING(string->title), BOXSTRING("open panel"))]; [panel setDirectory:BOXSTRING(state->startdir)]; @@ -40,11 +40,14 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) [panel setAllowsMultipleSelection:NO]; [panel setTreatsFilePackagesAsDirectories:NO]; NSInteger result = [panel runModal]; - if (result == 1) - return true; + if (result != 1) + return false; #endif - - return false; + NSURL *url = (NSURL*)panel.URL; + const char *res_path = [url.path UTF8String]; + state->result = strdup(res_path); + + return true; } static bool ui_browser_window_cocoa_save(ui_browser_window_state_t *state) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index a1c50d1905..b4622bcf71 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -296,39 +296,31 @@ static char** waiting_argv; } } -static void open_core_handler(NSOpenPanel *panel, NSInteger result) +static void open_core_handler(ui_browser_window_state_t *state, bool result) { - switch (result) - { - case 1: /* NSOKButton/NSModalResponseOK */ - if (panel.URL) - { - settings_t *settings = config_get_ptr(); - NSURL *url = (NSURL*)panel.URL; - NSString *__core = url.path; + if (!state) + return; + if (string_is_empty(state->result)) + return; + if (!result) + return; + + settings_t *settings = config_get_ptr(); - if (!__core) - return; + runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)state->result); + ui_companion_event_command(CMD_EVENT_LOAD_CORE); - runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH, (void*)__core.UTF8String); - ui_companion_event_command(CMD_EVENT_LOAD_CORE); - - if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL) + if (menu_driver_ctl(RARCH_MENU_CTL_HAS_LOAD_NO_CONTENT, NULL) && settings->set_supports_no_game_enable) - { - content_ctx_info_t content_info = {0}; - runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); - task_push_content_load_default( - NULL, NULL, - &content_info, - CORE_TYPE_PLAIN, - CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, - NULL, NULL); - } - } - break; - case 0: /* NSCancelButton/NSModalResponseCancel */ - break; + { + content_ctx_info_t content_info = {0}; + runloop_ctl(RUNLOOP_CTL_CLEAR_CONTENT_PATH, NULL); + task_push_content_load_default( + NULL, NULL, + &content_info, + CORE_TYPE_PLAIN, + CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, + NULL, NULL); } } @@ -369,31 +361,26 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) } - (IBAction)openCore:(id)sender { - NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; - settings_t *settings = config_get_ptr(); - NSString *startdir = BOXSTRING(settings->directory.libretro); - NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING("dylib"), BOXSTRING("Core"), nil]; - [panel setAllowedFileTypes:filetypes]; -#if defined(MAC_OS_X_VERSION_10_6) - [panel setMessage:BOXSTRING("Load Core")]; - [panel setDirectoryURL:[NSURL fileURLWithPath:startdir]]; - [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) - { - [[NSApplication sharedApplication] stopModal]; - open_core_handler(panel, result); - }]; - [[NSApplication sharedApplication] runModalForWindow:panel]; -#else - [panel setTitle:NSLocalizedString(BOXSTRING("Load Core"), BOXSTRING("open panel"))]; - [panel setDirectory:startdir]; - [panel setCanChooseDirectories:NO]; - [panel setCanChooseFiles:YES]; - [panel setAllowsMultipleSelection:NO]; - [panel setTreatsFilePackagesAsDirectories:NO]; - NSInteger result = [panel runModal]; - if (result == 1) - open_core_handler(panel, result); -#endif + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); + + if (browser) + { + ui_browser_window_state_t browser_state; + settings_t *settings = config_get_ptr(); + + browser_state.filters = strdup("dylib"); + browser_state.filters_title = strdup("Core"); + browser_state.title = strdup("Load Core"); + browser_state.startdir = strdup(settings->directory.libretro); + + bool result = browser->open(&browser_state); + open_core_handler(&browser_state, result); + + free(browser_state.filters); + free(browser_state.filters_title); + free(browser_state.title); + free(browser_state.startdir); + } } - (void)openDocument:(id)sender diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index fa3a5f595a..a2d6dfd364 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -71,6 +71,7 @@ typedef struct ui_browser_window_state char *startdir; char *path; char *title; + char *result; } ui_browser_window_state_t; typedef struct ui_browser_window From 817b63be999ecaff7eecd8f4fc1b1221687a102a Mon Sep 17 00:00:00 2001 From: neville Date: Wed, 8 Jun 2016 17:39:20 +0200 Subject: [PATCH 62/66] (OSX) Buildfix for pre-OSX 10.6 --- ui/drivers/cocoa/ui_cocoa_browser_window.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m index 199585fdca..aa5daa4d5f 100644 --- a/ui/drivers/cocoa/ui_cocoa_browser_window.m +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -33,7 +33,7 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) if ([panel runModalForDirectory:BOXSTRING(state->startdir) file:nil] != 1) return false; #else - [panel setTitle:NSLocalizedString(BOXSTRING(string->title), BOXSTRING("open panel"))]; + [panel setTitle:NSLocalizedString(BOXSTRING(state->title), BOXSTRING("open panel"))]; [panel setDirectory:BOXSTRING(state->startdir)]; [panel setCanChooseDirectories:NO]; [panel setCanChooseFiles:YES]; From 5a746e04c26b8e201c89ee5ef5e4b3e67cb4c94b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 17:51:05 +0200 Subject: [PATCH 63/66] (OSX) Refactor document loading code --- ui/drivers/cocoa/ui_cocoa_browser_window.m | 5 +- ui/drivers/ui_cocoa.m | 76 ++++++++++++---------- 2 files changed, 47 insertions(+), 34 deletions(-) diff --git a/ui/drivers/cocoa/ui_cocoa_browser_window.m b/ui/drivers/cocoa/ui_cocoa_browser_window.m index aa5daa4d5f..e8597b2b9d 100644 --- a/ui/drivers/cocoa/ui_cocoa_browser_window.m +++ b/ui/drivers/cocoa/ui_cocoa_browser_window.m @@ -26,7 +26,10 @@ static bool ui_browser_window_cocoa_open(ui_browser_window_state_t *state) { NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; - NSArray *filetypes = [[NSArray alloc] initWithObjects:BOXSTRING(state->filters), BOXSTRING(state->filters_title), nil]; + NSArray *filetypes = NULL; + + if (state->filters && !string_is_empty(state->filters)) + filetypes = [[NSArray alloc] initWithObjects:BOXSTRING(state->filters), BOXSTRING(state->filters_title), nil]; [panel setAllowedFileTypes:filetypes]; #if defined(MAC_OS_X_VERSION_10_6) [panel setMessage:BOXSTRING(state->title)]; diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index b4622bcf71..6ed2ec6ce2 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -324,39 +324,34 @@ static void open_core_handler(ui_browser_window_state_t *state, bool result) } } -static void open_document_handler(NSOpenPanel *panel, NSInteger result) +static void open_document_handler(ui_browser_window_state_t *state, bool result) { - switch (result) + if (!state) + return; + if (string_is_empty(state->result)) + return; + if (!result) + return; + + struct retro_system_info *system = NULL; + const char *core_name = NULL; + + menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_GET, &system); + + if (system) + core_name = system->library_name; + + runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)state->result); + + if (core_name) { - case 1: /* NSOKButton/NSModalResponseOK */ - if (panel.URL) - { - struct retro_system_info *system = NULL; - NSURL *url = (NSURL*)panel.URL; - NSString *__core = url.path; - const char *core_name = NULL; - - menu_driver_ctl(RARCH_MENU_CTL_SYSTEM_INFO_GET, &system); - - if (system) - core_name = system->library_name; - - runloop_ctl(RUNLOOP_CTL_SET_CONTENT_PATH, (void*)__core.UTF8String); - - if (core_name) - { - content_ctx_info_t content_info = {0}; - task_push_content_load_default( - NULL, NULL, - &content_info, - CORE_TYPE_PLAIN, - CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, - NULL, NULL); - } - } - break; - case 0: /* NSCancelButton/NSModalResponseCancel */ - break; + content_ctx_info_t content_info = {0}; + task_push_content_load_default( + NULL, NULL, + &content_info, + CORE_TYPE_PLAIN, + CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_COMPANION_UI, + NULL, NULL); } } @@ -385,12 +380,26 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) - (void)openDocument:(id)sender { - NSOpenPanel* panel = (NSOpenPanel*)[NSOpenPanel openPanel]; + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); settings_t *settings = config_get_ptr(); - NSString *startdir = BOXSTRING(settings->directory.menu_content); + NSString *startdir = BOXSTRING(settings->directory.menu_content); if (!startdir.length) startdir = BOXSTRING("/"); + + if (browser) + { + ui_browser_window_state_t browser_state = {0}; + + browser_state.title = strdup("Load Content"); + browser_state.startdir = strdup([startdir UTF8String]); + + bool result = browser->open(&browser_state); + open_document_handler(&browser_state, result); + + free(browser_state.title); + } +#if 0 #if defined(MAC_OS_X_VERSION_10_6) [panel setMessage:BOXSTRING("Load Content")]; [panel setDirectoryURL:[NSURL fileURLWithPath:startdir]]; @@ -411,6 +420,7 @@ static void open_document_handler(NSOpenPanel *panel, NSInteger result) if (result == 1) open_document_handler(panel, result); #endif +#endif } - (void)unloadingCore From 008e62284353dae88583700f80d6e0b59b4e1e9a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 17:53:51 +0200 Subject: [PATCH 64/66] Add capabilities to ui_browser_window_state --- ui/ui_companion_driver.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/ui_companion_driver.h b/ui/ui_companion_driver.h index a2d6dfd364..512e34c9c1 100644 --- a/ui/ui_companion_driver.h +++ b/ui/ui_companion_driver.h @@ -65,6 +65,17 @@ typedef struct ui_msg_window_state typedef struct ui_browser_window_state { + struct + { + bool can_choose_directories; + bool can_choose_directories_val; + bool can_choose_files; + bool can_choose_files_val; + bool allows_multiple_selection; + bool allows_multiple_selection_val; + bool treat_file_packages_as_directories; + bool treat_file_packages_as_directories_val; + } capabilities; void *window; char *filters; char *filters_title; From 29012aa74fa381fa828b84917eb37cc171f27462 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 8 Jun 2016 17:54:42 +0200 Subject: [PATCH 65/66] (Cocoa) Cleanups --- ui/drivers/ui_cocoa.m | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 6ed2ec6ce2..1b1f531f17 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -380,9 +380,9 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result) - (void)openDocument:(id)sender { - const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); settings_t *settings = config_get_ptr(); - NSString *startdir = BOXSTRING(settings->directory.menu_content); + NSString *startdir = BOXSTRING(settings->directory.menu_content); if (!startdir.length) startdir = BOXSTRING("/"); @@ -399,28 +399,6 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result) free(browser_state.title); } -#if 0 -#if defined(MAC_OS_X_VERSION_10_6) - [panel setMessage:BOXSTRING("Load Content")]; - [panel setDirectoryURL:[NSURL fileURLWithPath:startdir]]; - [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) - { - [[NSApplication sharedApplication] stopModal]; - open_document_handler(panel, result); - }]; - [[NSApplication sharedApplication] runModalForWindow:panel]; -#else - [panel setTitle:NSLocalizedString(BOXSTRING("Load Content"), BOXSTRING("open panel"))]; - [panel setDirectory:startdir]; - [panel setCanChooseDirectories:NO]; - [panel setCanChooseFiles:YES]; - [panel setAllowsMultipleSelection:NO]; - [panel setTreatsFilePackagesAsDirectories:NO]; - NSInteger result = [panel runModal]; - if (result == 1) - open_document_handler(panel, result); -#endif -#endif } - (void)unloadingCore From ac29a2acc2d5172d80a1d9aac46f96eb528346c9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 8 Jun 2016 17:56:09 +0200 Subject: [PATCH 66/66] Free heap variable --- ui/drivers/ui_cocoa.m | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/drivers/ui_cocoa.m b/ui/drivers/ui_cocoa.m index 1b1f531f17..47897c3a82 100644 --- a/ui/drivers/ui_cocoa.m +++ b/ui/drivers/ui_cocoa.m @@ -397,6 +397,7 @@ static void open_document_handler(ui_browser_window_state_t *state, bool result) bool result = browser->open(&browser_state); open_document_handler(&browser_state, result); + free(browser_state.startdir); free(browser_state.title); } }