From b9c6fa585c7ce9747e12df4928013f02aadab00d Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 27 Nov 2016 11:25:29 -0500 Subject: [PATCH 001/638] reverse variable names for clarity, add separate latch for OK button to solve looping of menu ok/cancel swap toggle --- menu/menu_event.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/menu/menu_event.c b/menu/menu_event.c index a8e7b501da..e1de58f7bb 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -199,11 +199,18 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) size_t new_scroll_accel = 0; menu_input_t *menu_input = NULL; settings_t *settings = config_get_ptr(); + bool ok_current = false; + static bool ok_old = false; + bool ok_trigger = false; - menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? - RETRO_DEVICE_ID_JOYPAD_A: RETRO_DEVICE_ID_JOYPAD_B; - menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? - RETRO_DEVICE_ID_JOYPAD_B: RETRO_DEVICE_ID_JOYPAD_A; + menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? + RETRO_DEVICE_ID_JOYPAD_B : RETRO_DEVICE_ID_JOYPAD_A; + menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? + RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; + + ok_current = input & UINT64_C(1) << menu_ok_btn; + ok_trigger = ok_current & ~ok_old; + ok_old = ok_current; if (input) { @@ -334,7 +341,7 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) osk_idx = (enum osk_type)(OSK_TYPE_UNKNOWN + 1); } - if (trigger_input & (UINT64_C(1) << menu_cancel_btn)) + if (trigger_input & (UINT64_C(1) << menu_ok_btn)) { if (osk_ptr >= 0) { @@ -342,7 +349,7 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) } } - if (trigger_input & (UINT64_C(1) << menu_ok_btn)) + if (trigger_input & (UINT64_C(1) << menu_cancel_btn)) { input_keyboard_event(true, '\x7f', '\x7f', 0, RETRO_DEVICE_KEYBOARD); } @@ -366,10 +373,10 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) ret = MENU_ACTION_SCROLL_UP; else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_R)) ret = MENU_ACTION_SCROLL_DOWN; - else if (trigger_input & (UINT64_C(1) << menu_ok_btn)) - ret = MENU_ACTION_CANCEL; - else if (trigger_input & (UINT64_C(1) << menu_cancel_btn)) + else if (ok_trigger) ret = MENU_ACTION_OK; + else if (trigger_input & (UINT64_C(1) << menu_cancel_btn)) + ret = MENU_ACTION_CANCEL; else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_X)) ret = MENU_ACTION_SEARCH; else if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_Y)) From d6ebd2ad2b8dece5a84f397d3b07f8d009f453a3 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 27 Nov 2016 11:43:45 -0500 Subject: [PATCH 002/638] add define to clarify osk pointer math --- menu/menu_event.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/menu/menu_event.c b/menu/menu_event.c index e1de58f7bb..85b291bdda 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -45,6 +45,8 @@ #include "../retroarch.h" #include "../runloop.h" +#define OSK_CHARS_PER_LINE 11 + static unsigned char menu_keyboard_key_state[RETROK_LAST]; enum osk_type @@ -304,13 +306,13 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_DOWN)) { if (osk_ptr < 33) - osk_ptr = osk_ptr + 11; + osk_ptr = osk_ptr + OSK_CHARS_PER_LINE; } if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP)) { - if (osk_ptr > 10) - osk_ptr = osk_ptr - 11; + if (osk_ptr >= OSK_CHARS_PER_LINE) + osk_ptr = osk_ptr - OSK_CHARS_PER_LINE; } if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_RIGHT)) From ec24fb6bbd61d58f88ebcb95e586cafe1db9f738 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sun, 27 Nov 2016 23:16:45 +0100 Subject: [PATCH 003/638] (XMB) Display thumbnails for image history --- menu/drivers/xmb.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 893657a96c..58d9a5bf0f 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -55,6 +55,7 @@ #include "../../verbosity.h" #include "../../configuration.h" #include "../../retroarch.h" +#include "../../playlist.h" #include "../../tasks/tasks_internal.h" @@ -837,6 +838,9 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) char *scrub_char_pointer = NULL; settings_t *settings = config_get_ptr(); xmb_handle_t *xmb = (xmb_handle_t*)data; + playlist_t *playlist = NULL; + const char *core_name = NULL; + if (!xmb) return; @@ -853,6 +857,22 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) menu_entry_get(&entry, 0, i, NULL, true); + menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); + + if (playlist) + { + playlist_get_index(playlist, i, + NULL, NULL, NULL, &core_name, NULL, NULL); + + if (core_name && string_is_equal(core_name, "imageviewer")) + { + printf("%s\n", entry.label); + strlcpy(xmb->thumbnail_file_path, entry.label, + sizeof(xmb->thumbnail_file_path)); + return; + } + } + fill_pathname_join( xmb->thumbnail_file_path, settings->directory.thumbnails, From 57d3236b9909dcb2e0b178f615fe4c203a45dde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Sun, 27 Nov 2016 23:21:07 +0100 Subject: [PATCH 004/638] Delete a debug message --- menu/drivers/xmb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 58d9a5bf0f..5da6d86df8 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -866,7 +866,6 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) if (core_name && string_is_equal(core_name, "imageviewer")) { - printf("%s\n", entry.label); strlcpy(xmb->thumbnail_file_path, entry.label, sizeof(xmb->thumbnail_file_path)); return; From 9bba379ebd2a405405cc7e16b71921789875fb75 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Nov 2016 00:42:34 +0100 Subject: [PATCH 005/638] (msg_hash_de.c) Refactor strings --- intl/msg_hash_de.c | 1700 ++++++++++++++++++++++---------------------- 1 file changed, 850 insertions(+), 850 deletions(-) diff --git a/intl/msg_hash_de.c b/intl/msg_hash_de.c index 595a500dc3..3e8e9847e3 100644 --- a/intl/msg_hash_de.c +++ b/intl/msg_hash_de.c @@ -428,856 +428,856 @@ const char *msg_hash_to_str_de(enum msg_hash_enums msg) { switch (msg) { - case MENU_ENUM_LABEL_SETTINGS: - return "Einstellungen"; - case MENU_ENUM_LABEL_SHUTDOWN: - return "Ausschalten"; - case MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD: - return "Passwort"; - case MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_USERNAME: - return "Benutzername"; - case MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST: - return "Konten"; - case MENU_ENUM_LABEL_VALUE_ADD_TAB: - return "Hinzufügen"; - case MENU_ENUM_LABEL_VALUE_ARCHIVE_MODE: - return "Verknüpfte Aktion bei Archivdateien"; - case MENU_ENUM_LABEL_VALUE_ASK_ARCHIVE: - return "Nachfragen"; - case MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY: - return "Assets-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES: - return "Warte auf Audio-Frames"; - case MENU_ENUM_LABEL_VALUE_AUDIO_DEVICE: - return "Soundkarte"; - case MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER: - return "Audio-Treiber"; - case MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN: - return "Audio-DSP-Plugin"; - case MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE: - return "Aktiviere Audio"; - case MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR: - return "Audio-Filter-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_AUDIO_LATENCY: - return "Audiolatenz (ms)"; - case MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW: - return "Maximaler Audioversatz"; - case MENU_ENUM_LABEL_VALUE_AUDIO_MUTE: - return "Stumm"; - case MENU_ENUM_LABEL_VALUE_AUDIO_OUTPUT_RATE: - return "Audio-Frequenzrate (kHz)"; - case MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA: - return "Audio Rate Control Delta"; - case MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_DRIVER: - return "Audio-Resampler-Treiber"; - case MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS: - return "Audio-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_AUDIO_SYNC: - return "Synchronisiere Audio"; - case MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME: - return "Lautstärke (dB)"; - case MENU_ENUM_LABEL_VALUE_AUTOSAVE_INTERVAL: - return "Autospeicherungsintervall"; - case MENU_ENUM_LABEL_VALUE_AUTO_OVERRIDES_ENABLE: - return "Lade Override-Dateien automatisch"; - case MENU_ENUM_LABEL_VALUE_AUTO_REMAPS_ENABLE: - return "Lade Remap-Dateien automatisch"; - case MENU_ENUM_LABEL_VALUE_BLOCK_SRAM_OVERWRITE: - return "Blockiere SRAM-Überschreibung"; - case MENU_ENUM_LABEL_VALUE_BUILDBOT_ASSETS_URL: - return "Buildbot-Assets-URL"; - case MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY: /* FIXME/UPDATE */ - return "Entpack-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_CAMERA_ALLOW: - return "Erlaube Kamera-Zugriff"; - case MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER: - return "Kamera-Treiber"; - case MENU_ENUM_LABEL_VALUE_CHEAT: - return "Cheat"; - case MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES: - return "Änderungen übernehmen"; - case MENU_ENUM_LABEL_VALUE_CHEAT_DATABASE_PATH: - return "Cheat-Datei-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD: - return "Lade Cheat-Datei"; - case MENU_ENUM_LABEL_VALUE_CHEAT_FILE_SAVE_AS: - return "Speichere Cheat-Datei unter..."; - case MENU_ENUM_LABEL_VALUE_CHEAT_NUM_PASSES: - return "Cheat-Durchgänge"; - case MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT: - return "Schließe"; - case MENU_ENUM_LABEL_VALUE_CONFIGURATIONS: - return "Lade Konfigurationsdatei"; /* FIXME/UPDATE */ - case MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS: - return "Konfigurations-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT: - return "Speichere Konfiguration beim Beenden"; - case MENU_ENUM_LABEL_VALUE_CONFIRM_ON_EXIT: - return "Zum Beenden Nachfragen"; - case MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST: - return "Lade Content (Sammlung)"; /* FIXME/TODO - rewrite */ - case MENU_ENUM_LABEL_VALUE_CONTENT_DATABASE_DIRECTORY: - return "Content-Datenbankverzeichnis"; - case MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_SIZE: - return "Länge der Verlaufsliste"; - case MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS: - return "Content-Einstellungen"; /* FIXME */ - case MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY: - return "Core-Assets-Verzeichnis"; /* FIXME/UPDATE */ - case MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS: - return "Cheats"; - case MENU_ENUM_LABEL_VALUE_CORE_COUNTERS: - return "Core-Zähler"; - case MENU_ENUM_LABEL_VALUE_CORE_ENABLE: - return "Zeige Core-Namen"; - case MENU_ENUM_LABEL_VALUE_CORE_INFORMATION: - return "Core-Informationen"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS: - return "Autoren"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES: - return "Kategorien"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL: - return "Core-Beschriftung"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: - return "Core-Name"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Core-Hinweise"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: - return "Firmware"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: - return "Lizenz(en)"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS: - return "Berechtigungen"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS: - return "Unterstütze Erweiterungen"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER: - return "System-Hersteller"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME: - return "System-Name"; - case MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS: /* UPDATE/FIXME */ - return "Core-Input-Optionen"; - case MENU_ENUM_LABEL_VALUE_CORE_LIST: - return "Lade Core"; - case MENU_ENUM_LABEL_VALUE_CORE_OPTIONS: - return "Optionen"; - case MENU_ENUM_LABEL_VALUE_CORE_SETTINGS: - return "Core-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_CORE_SET_SUPPORTS_NO_CONTENT_ENABLE: /* TODO/FIXME */ - return "Cores nicht automatisch starten"; - case MENU_ENUM_LABEL_VALUE_CORE_SPECIFIC_CONFIG: - return "Core-Spezifische Konfiguration"; - case MENU_ENUM_LABEL_VALUE_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE: - return "Heruntergeladene Archive automatisch entpacken"; - case MENU_ENUM_LABEL_VALUE_CORE_UPDATER_BUILDBOT_URL: - return "Buildbot-Cores-URL"; - case MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST: - return "Core-Updater"; - case MENU_ENUM_LABEL_VALUE_CORE_UPDATER_SETTINGS: - return "Core-Updater-Einstellungen"; /* UPDATE/FIXME */ - case MENU_ENUM_LABEL_VALUE_CURSOR_DIRECTORY: - return "Cursor-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_CURSOR_MANAGER: - return "Cursormanager"; - case MENU_ENUM_LABEL_VALUE_CUSTOM_RATIO: - return "Benutzerdefiniertes Verhältnis"; - case MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER: - return "Datenbankmanager"; - case MENU_ENUM_LABEL_VALUE_DELETE_ENTRY: - return "Von der Playlist löschen"; - case MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST: - return "Lade Content (Core erkennen)"; /* FIXME */ - case MENU_ENUM_LABEL_VALUE_DIRECTORY_CONTENT: - return ""; - case MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT: - return ""; - case MENU_ENUM_LABEL_VALUE_DIRECTORY_NONE: - return ""; - case MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND: - return "Ordner nicht gefunden."; - case MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS: - return "Verzeichnis-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_DISABLED: - return "Deaktiviert"; - case MENU_ENUM_LABEL_VALUE_DISK_CYCLE_TRAY_STATUS: - return "Datenträgerstatus"; - case MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND: - return "Füge Datenträgerabbild hinzu"; - case MENU_ENUM_LABEL_VALUE_DISK_INDEX: - return "Datenträger-Nummer"; - case MENU_ENUM_LABEL_VALUE_DISK_OPTIONS: /* UPDATE/FIXME */ - return "Datenträger-Optionen"; - case MENU_ENUM_LABEL_VALUE_DONT_CARE: - return "Mir egal"; - case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE: - return "Aktiviere DPI-Override"; - case MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE: - return "DPI-Override"; - case MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS: - return "Treiber-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN: - return "Dummy bei Core-Abschaltung"; - case MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER: - return "Dynamischer Hintergrund"; - case MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY: - return "Dynamische-Bildschirmhintergründe-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR: - return "Hover-Farbe für Menü-Einträge"; - case MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR: - return "Normale Farbe für Menü-Einträge"; - case MENU_ENUM_LABEL_VALUE_FALSE: - return "False"; - case MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO: - return "Maximale Ausführungsgeschwindigkeit"; - case MENU_ENUM_LABEL_VALUE_FPS_SHOW: - return "Zeige Framerate"; - case MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE: - return "Begrenze maximale Ausführungsgeschwindigkeit"; - case MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS: - return "Frontendzähler"; - case MENU_ENUM_LABEL_VALUE_HELP: - return "Hilfe"; - case MENU_ENUM_LABEL_VALUE_HISTORY_LIST_ENABLE: - return "Aktiviere Verlaufsliste"; - case MENU_ENUM_LABEL_VALUE_HISTORY_TAB: - return "Verlauf"; - case MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU: /* Don't change. Breaks everything. (Would be: "Horizontales Menu") */ - return "Horizontal Menu"; - case MENU_ENUM_LABEL_VALUE_IMAGES_TAB: - return "Bilder"; - case MENU_ENUM_LABEL_VALUE_INFORMATION_LIST: - return "Information"; - case MENU_ENUM_LABEL_VALUE_INPUT_ALL_USERS_CONTROL_MENU: - return "Jeder nutze kann Menü Steuern"; - case MENU_ENUM_LABEL_VALUE_INPUT_AUTODETECT_ENABLE: - return "Automatische Konfiguration aktivieren"; - case MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD: - return "Schwellwert der Eingabe-Achsen"; - case MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_HIDE_UNBOUND: - return "Verstecke nicht zugewiesene Core-Eingabe-Beschriftungen"; - case MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_LABEL_SHOW: /* TODO/FIXME */ - return "Zeige Core-Eingabe-Beschriftungen"; - case MENU_ENUM_LABEL_VALUE_INPUT_DRIVER: - return "Eingabe-Treiber"; - case MENU_ENUM_LABEL_VALUE_INPUT_DUTY_CYCLE: - return "Auslastungsgrad"; - case MENU_ENUM_LABEL_VALUE_INPUT_MAX_USERS: - return "Maximale Benutzerzahl"; - case MENU_ENUM_LABEL_VALUE_INPUT_OSK_OVERLAY_ENABLE: - return "Zeige Tastatur-Overlay"; - case MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_ENABLE: - return "Aktiviere Overlay"; - case MENU_ENUM_LABEL_VALUE_INPUT_REMAPPING_DIRECTORY: /* UPDATE/FIXME */ - return "Eingabebelegungs-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE: - return "Bind-Remapping aktivieren"; - case MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS: - return "Eingabe-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_INPUT_TURBO_PERIOD: - return "Turbo-Dauer"; - case MENU_ENUM_LABEL_VALUE_INPUT_USER_BINDS: - return "Spieler %u Tastenbelegung"; - case MENU_ENUM_LABEL_VALUE_JOYPAD_AUTOCONFIG_DIR: - return "Eingabegerät-Autoconfig-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER: - return "Joypad-Treiber"; - case MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET: - return "Tastatur-Overlay-Voreinstellung"; - case MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED: - return "Chinesisch (Vereinfacht)"; - case MENU_ENUM_LABEL_VALUE_LANG_CHINESE_TRADITIONAL: - return "Chinesisch (Traditionell)"; - case MENU_ENUM_LABEL_VALUE_LANG_DUTCH: - return "Niederländisch"; - case MENU_ENUM_LABEL_VALUE_LANG_ENGLISH: - return "Englisch"; - case MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO: - return "Esperanto"; - case MENU_ENUM_LABEL_VALUE_LANG_FRENCH: - return "Französisch"; - case MENU_ENUM_LABEL_VALUE_LANG_GERMAN: - return "Deutsch"; - case MENU_ENUM_LABEL_VALUE_LANG_ITALIAN: - return "Italienisch"; - case MENU_ENUM_LABEL_VALUE_LANG_JAPANESE: - return "Japanisch"; - case MENU_ENUM_LABEL_VALUE_LANG_KOREAN: - return "Koreanisch"; - case MENU_ENUM_LABEL_VALUE_LANG_PORTUGUESE: - return "Portugiesisch"; - case MENU_ENUM_LABEL_VALUE_LANG_RUSSIAN: - return "Russisch"; - case MENU_ENUM_LABEL_VALUE_LANG_SPANISH: - return "Spanisch"; - case MENU_ENUM_LABEL_VALUE_LEFT_ANALOG: - return "Linker Analogstick"; - case MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH: - return "Core-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_LIBRETRO_INFO_PATH: - return "Core-Info-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_LIBRETRO_LOG_LEVEL: - return "Core-Logging-Stufe"; - case MENU_ENUM_LABEL_VALUE_LINEAR: - return "Linear"; - case MENU_ENUM_LABEL_VALUE_LOAD_ARCHIVE: - return "Lade Archiv"; - case MENU_ENUM_LABEL_VALUE_LOAD_CONTENT: - return "Lade Content"; /* FIXME */ - case MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY: - return "Lade Content (Verlauf)"; /* FIXME/UPDATE */ - case MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST: - return "Lade Content"; - case MENU_ENUM_LABEL_VALUE_LOAD_STATE: - return "Lade Savestate"; - case MENU_ENUM_LABEL_VALUE_LOCATION_ALLOW: - return "Erlaube Standort-Lokalisierung"; - case MENU_ENUM_LABEL_VALUE_LOCATION_DRIVER: - return "Standort-Treiber"; - case MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS: - return "Logging-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_LOG_VERBOSITY: - return "Log-Ausführlichkeit"; - case MENU_ENUM_LABEL_VALUE_MAIN_MENU: - return "Hauptmenü"; - case MENU_ENUM_LABEL_VALUE_MANAGEMENT: - return "Datenbank-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_MENU_DRIVER: - return "Menü-Treiber"; - case MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS: - return "Menü-Dateibrowser-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_MENU_SETTINGS: - return "Menü-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER: - return "Menühintergrund"; - case MENU_ENUM_LABEL_VALUE_MISSING: - return "Fehlt"; - case MENU_ENUM_LABEL_VALUE_MOUSE_ENABLE: - return "Maus-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_MULTIMEDIA_SETTINGS: - return "Media-Player-Einstellungen"; /* UPDATE/FIXME */ - case MENU_ENUM_LABEL_VALUE_MUSIC_TAB: - return "Musik"; - case MENU_ENUM_LABEL_VALUE_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE: - return "Bekannte Dateiendungen filtern"; /* TODO/FIXME - rewrite */ - case MENU_ENUM_LABEL_VALUE_NAVIGATION_WRAPAROUND: - return "Navigation umbrechen"; - case MENU_ENUM_LABEL_VALUE_NEAREST: - return "Nächster"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT: /* TODO: Original string changed */ - return "Tausche Netplay-Eingabe"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES: - return "Verzögere Netplay-Frames"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE: - return "Aktiviere Netplay"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS: /* TODO: Original string changed */ - return "IP-Addresse für Netplay"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_MODE: - return "Aktiviere Netplay-Client"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME: - return "Benutzername"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE: - return "Aktiviere Netplay-Zuschauermodus"; - case MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT: - return "TCP/UDP-Port für Netplay"; - case MENU_ENUM_LABEL_VALUE_NETWORK_CMD_ENABLE: - return "Netzwerk-Befehle"; - case MENU_ENUM_LABEL_VALUE_NETWORK_CMD_PORT: - return "Port für Netzwerk-Befehle"; - case MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS: - return "Netzwerk-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_NO: - return "Nein"; - case MENU_ENUM_LABEL_VALUE_NONE: - return "Keins"; - case MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE: - return "Nicht verfügbar"; - case MENU_ENUM_LABEL_VALUE_NO_CORE: - return "Kein Core"; - case MENU_ENUM_LABEL_VALUE_NO_CORES_AVAILABLE: - return "Kein Core verfügbar."; - case MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE: - return "Keine Core-Informationen verfügbar."; - case MENU_ENUM_LABEL_VALUE_NO_CORE_OPTIONS_AVAILABLE: - return "Keine Core-Optionen verfügbar."; - case MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE: - return "Keine Informationen verfügbar."; - case MENU_ENUM_LABEL_VALUE_NO_ITEMS: - return "Keine Einträge."; - case MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS: - return "Keine Leistungszähler."; - case MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE: - return "Keine Wiedergabelisten-Eintrage verfügbar."; - case MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND: - return "Keine Einstellungen gefunden."; - case MENU_ENUM_LABEL_VALUE_NO_SHADER_PARAMETERS: - return "Keine Shaderparameter"; - case MENU_ENUM_LABEL_VALUE_OFF: /* Don't change. Needed for XMB atm. (Would be: "AN") */ - return "OFF"; - case MENU_ENUM_LABEL_VALUE_ON: /* Don't change. Needed for XMB atm. (Would be: "AUS") */ - return "ON"; - case MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER: - return "Online-Aktualisierungen"; - case MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS: - return "OSD-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_OPEN_ARCHIVE: - return "Öffne Archiv"; - case MENU_ENUM_LABEL_VALUE_OPTIONAL: - return "Optional"; - case MENU_ENUM_LABEL_VALUE_OSK_OVERLAY_DIRECTORY: - return "OSK-Overlay-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY: - return "Overlay-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY: - return "Overlay-Transparenz"; - case MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET: - return "Overlay-Voreinstellung"; - case MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE: - return "Overlay-Skalierung"; - case MENU_ENUM_LABEL_VALUE_OVERLAY_SETTINGS: - return "Overlay-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_PAL60_ENABLE: - return "Verwende PAL60-Modus"; - case MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO: - return "Pausiere, wenn das Menü aktiv ist"; - case MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE: - return "Nicht im Hintergrund laufen"; - case MENU_ENUM_LABEL_VALUE_PERFCNT_ENABLE: - return "Leistungsindikatoren"; - case MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY: - return "Wiedergabelisten-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS: - return "Wiedergabelisten-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_POINTER_ENABLE: - return "Touch-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_PORT: - return "Port"; - case MENU_ENUM_LABEL_VALUE_PRESENT: - return "Vorhanden"; - case MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS: - return "Privatsphäre-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH: - return "RetroArch beenden"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CRC32: - return "CRC32"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION: - return "Beschreibung"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DEVELOPER: - return "Entwickler"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FRANCHISE: - return "Franchise"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_MD5: - return "MD5"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME: - return "Name"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ORIGIN: - return "Herkunft"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PUBLISHER: - return "Publisher"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH: - return "Veröffentlichungsmonat"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR: - return "Veröffentlichungsjahr"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SHA1: - return "SHA1"; - case MENU_ENUM_LABEL_VALUE_RDB_ENTRY_START_CONTENT: - return "Starte Content"; - case MENU_ENUM_LABEL_VALUE_REBOOT: - return "Neustart"; - case MENU_ENUM_LABEL_VALUE_RECORDING_CONFIG_DIRECTORY: - return "Aufnahme-Konfigurationsverzeichnis"; - case MENU_ENUM_LABEL_VALUE_RECORDING_OUTPUT_DIRECTORY: - return "Aufnahme-Ausgabeverzeichnis"; - case MENU_ENUM_LABEL_VALUE_RECORDING_SETTINGS: - return "Aufnahme-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_RECORD_CONFIG: - return "Aufnahme-Konfiguration"; - case MENU_ENUM_LABEL_VALUE_RECORD_DRIVER: - return "Aufnahme-Treiber"; - case MENU_ENUM_LABEL_VALUE_RECORD_ENABLE: - return "Aktiviere Aufnahmefunktion"; - case MENU_ENUM_LABEL_VALUE_RECORD_PATH: /* FIXME/UPDATE */ - return "Aufnahmepfad"; - case MENU_ENUM_LABEL_VALUE_RECORD_USE_OUTPUT_DIRECTORY: - return "Verwende Aufnahme-Ausgabeverzeichnis"; - case MENU_ENUM_LABEL_VALUE_REMAP_FILE_LOAD: - return "Lade Remap-Datei"; - case MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE: - return "Speichere Core-Remap-Datei"; - case MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME: - return "Speichere Spiel-Remap-Datei"; - case MENU_ENUM_LABEL_VALUE_REQUIRED: - return "Notwendig"; - case MENU_ENUM_LABEL_VALUE_RESTART_CONTENT: - return "Starte neu"; - case MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH: - return "Starte RetroArch neu"; - case MENU_ENUM_LABEL_VALUE_RESUME: - return "Fortsetzen"; - case MENU_ENUM_LABEL_VALUE_RESUME_CONTENT: - return "Fortsetzen"; - case MENU_ENUM_LABEL_VALUE_RETROKEYBOARD: - return "RetroKeyboard"; - case MENU_ENUM_LABEL_VALUE_RETROPAD: - return "RetroPad"; - case MENU_ENUM_LABEL_VALUE_REWIND_ENABLE: - return "Zurückspulen (Rewind) aktivieren"; - case MENU_ENUM_LABEL_VALUE_REWIND_GRANULARITY: - return "Genauigkeit des Zurückspulens (Rewind)"; - case MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS: - return "Zurückspul-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY: - return "Browser-Directory"; - case MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY: - return "Konfigurations-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN: - return "Zeige Startbildschirm"; - case MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG: - return "Rechter Analogstick"; - case MENU_ENUM_LABEL_VALUE_RUN: - return "Start"; - case MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY: - return "Spielstand-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_INDEX: - return "Automatische Indexierung von Save States"; - case MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_LOAD: - return "Automatisches Laden von Save States"; - case MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_SAVE: - return "Automatische Save States"; - case MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY: - return "Savestate-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_SAVE_NEW_CONFIG: - return "Speichere neue Konfiguration"; - case MENU_ENUM_LABEL_VALUE_SAVE_STATE: - return "Speichere Savestate"; - case MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS: - return "Spielstand-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY: - return "Durchsuche Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_SCAN_FILE: - return "Durchsuche Datei"; - case MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY: - return "<- Durchsuche ->"; - case MENU_ENUM_LABEL_VALUE_SCREENSHOT_DIRECTORY: - return "Bildschirmfoto-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION: - return "Bildschirmauflösung"; - case MENU_ENUM_LABEL_VALUE_SECONDS: - return "Sekunden"; - case MENU_ENUM_LABEL_VALUE_SETTINGS: - return "Einstellungen"; - case MENU_ENUM_LABEL_VALUE_SHADER: - return "Shader"; - case MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES: - return "Änderungen übernehmen"; - case MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS: - return "Shaders"; - case MENU_ENUM_LABEL_VALUE_SHOW_ADVANCED_SETTINGS: - return "Zeige erweitere Einstellungen"; - case MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES: - return "Zeige versteckte Ordner und Dateien"; - case MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO: - return "Zeitlupen-Verhältnis"; - case MENU_ENUM_LABEL_VALUE_SORT_SAVEFILES_ENABLE: - return "Sortiere Speicherdaten per Ordner"; - case MENU_ENUM_LABEL_VALUE_SORT_SAVESTATES_ENABLE: - return "Sortiere Save States per Ordner"; - case MENU_ENUM_LABEL_VALUE_STATUS: - return "Status"; - case MENU_ENUM_LABEL_VALUE_STDIN_CMD_ENABLE: - return "stdin-Befehle"; - case MENU_ENUM_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE: - return "Bildschirmschoner aussetzen"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_BGM_ENABLE: - return "Aktiviere System-BGM"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_DIRECTORY: - return "System/BIOS-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION: - return "Systeminformationen"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_7ZIP_SUPPORT: - return "7zip-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ALSA_SUPPORT: - return "ALSA-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE: - return "Build-Datum"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CG_SUPPORT: - return "Cg-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COCOA_SUPPORT: - return "Cocoa-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COMMAND_IFACE_SUPPORT: - return "Befehlsinterface-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CORETEXT_SUPPORT: - return "CoreText-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_FEATURES: - return "CPU-Eigenschaften"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_DPI: - return "Bildschirm-DPI"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_HEIGHT: - return "Bildschirmhöhe (mm)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_WIDTH: - return "Bildschirmbreite (mm)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DSOUND_SUPPORT: - return "DirectSound-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYLIB_SUPPORT: - return "Dynamic-Library-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_EGL_SUPPORT: - return "EGL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FBO_SUPPORT: - return "Unterstützung für OpenGL/Direct3D Render-to-Texture (Multi-Pass Shader)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FFMPEG_SUPPORT: - return "FFmpeg-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FREETYPE_SUPPORT: - return "FreeType-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_IDENTIFIER: - return "Frontend-Kennung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_NAME: - return "Frontend-Name"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_OS: - return "Frontend-Betriebssystem"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION: - return "Git-Version"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GLSL_SUPPORT: - return "GLSL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_HLSL_SUPPORT: - return "HLSL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_JACK_SUPPORT: - return "JACK-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_KMS_SUPPORT: - return "KMS/EGL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT: - return "LibretroDB-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBUSB_SUPPORT: - return "Libusb-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBXML2_SUPPORT: - return "Libxml2-XML-Parsing-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETPLAY_SUPPORT: - return "Netplay-Unterstützung (Peer-to-Peer)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETWORK_COMMAND_IFACE_SUPPORT: - return "Netzwerk-Befehlsinterface-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENAL_SUPPORT: - return "OpenAL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGLES_SUPPORT: - return "OpenGL-ES-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGL_SUPPORT: - return "OpenGL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENSL_SUPPORT: - return "OpenSL-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENVG_SUPPORT: - return "OpenVG-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OSS_SUPPORT: - return "OSS-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OVERLAY_SUPPORT: - return "Overlay-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE: - return "Energiequelle"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGED: - return "Geladen"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGING: - return "Lädt"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_DISCHARGING: - return "Entlädt"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_NO_SOURCE: - return "Keine Quelle"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PULSEAUDIO_SUPPORT: - return "PulseAudio-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PYTHON_SUPPORT: - return "Python-Unterstützung (Script-Unterstützung in Shadern)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETRORATING_LEVEL: - return "RetroRating-Stufe"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ROARAUDIO_SUPPORT: - return "RoarAudio-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RPNG_SUPPORT: - return "PNG-Unterstützung (RPNG)"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RSOUND_SUPPORT: - return "RSound-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL2_SUPPORT: - return "SDL2-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_IMAGE_SUPPORT: - return "SDL-Image-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_SUPPORT: - return "SDL1.2-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_THREADING_SUPPORT: - return "Threading-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_UDEV_SUPPORT: - return "Udev-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_V4L2_SUPPORT: - return "Video4Linux2-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_VIDEO_CONTEXT_DRIVER: - return "Video-Context-Treiber"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_WAYLAND_SUPPORT: - return "Wayland-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_X11_SUPPORT: - return "X11-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XAUDIO2_SUPPORT: - return "XAudio2-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XVIDEO_SUPPORT: - return "XVideo-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ZLIB_SUPPORT: - return "Zlib-Unterstützung"; - case MENU_ENUM_LABEL_VALUE_TAKE_SCREENSHOT: - return "Bildschirmfoto"; - case MENU_ENUM_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE: - return "Threaded Data Runloop"; - case MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE: - return "Zeige Uhrzeit / Datum"; - case MENU_ENUM_LABEL_VALUE_TITLE_COLOR: - return "Menü-Titel-Farbe"; - case MENU_ENUM_LABEL_VALUE_TRUE: - return "True"; - case MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT: - return "UI-Companion beim Hochfahren starten"; - case MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE: - return "Menüleiste"; - case MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE: - return "Komprimiertes Archiv kann nicht gelesen werden."; - case MENU_ENUM_LABEL_VALUE_UNKNOWN: - return "Unbekannt"; - case MENU_ENUM_LABEL_VALUE_UPDATE_ASSETS: - return "Aktualisiere Assets"; - case MENU_ENUM_LABEL_VALUE_UPDATE_AUTOCONFIG_PROFILES: - return "Aktualisiere Autoconfig-Profile"; - case MENU_ENUM_LABEL_VALUE_UPDATE_CG_SHADERS: - return "Aktualisiere CG-Shader"; - case MENU_ENUM_LABEL_VALUE_UPDATE_CHEATS: - return "Aktualisiere Cheats"; - case MENU_ENUM_LABEL_VALUE_UPDATE_DATABASES: - return "Aktualisiere Datenbanken"; - case MENU_ENUM_LABEL_VALUE_UPDATE_GLSL_SHADERS: - return "Aktualisiere GLSL-Shader"; - case MENU_ENUM_LABEL_VALUE_UPDATE_OVERLAYS: - return "Aktualisiere Overlays"; - case MENU_ENUM_LABEL_VALUE_USER: - return "Benutzer"; - case MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS: - return "Benutzeroberflächen-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_USER_LANGUAGE: - return "Sprache"; - case MENU_ENUM_LABEL_VALUE_USER_SETTINGS: - return "Benutzer-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_USE_BUILTIN_PLAYER: - return "Verwende integrierten Player"; /* FIXME/UPDATE */ - case MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY: - return ""; - case MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE: - return "Erlaube Bildrotation"; - case MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO: - return "Automatisches Bildseitenverhältnis"; - case MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX: - return "Bildseitenverhältnis-Index"; - case MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION: - return "Setze schwarze Frames ein"; - case MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN: - return "Bildränder (Overscan) zuschneiden (Neustart erforderlich)"; - case MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION: - return "Deaktiviere Desktop-Komposition"; - case MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER: - return "Grafiktreiber"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FILTER: - return "Videofilter"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR: - return "Grafikfilter-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_FLICKER: - return "Aktiviere Flacker-Filter"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FONT_ENABLE: - return "Zeige OSD-Nachrichten"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH: - return "Schriftart der OSD-Nachrichten"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE: - return "Schriftgröße der OSD-Nachrichten"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_ASPECT: - return "Erzwinge Bildseitenverhältnis"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_SRGB_DISABLE: - return "Erzwinge Deaktivierung des sRGB FBO"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FRAME_DELAY: - return "Bildverzögerung"; - case MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN: - return "Verwende Vollbildmodus"; - case MENU_ENUM_LABEL_VALUE_VIDEO_GAMMA: - return "Gamma"; - case MENU_ENUM_LABEL_VALUE_VIDEO_GPU_RECORD: - return "Aktiviere GPU-Aufnahmefunktion"; - case MENU_ENUM_LABEL_VALUE_VIDEO_GPU_SCREENSHOT: - return "Aktiviere GPU-Bildschirmfotos"; - case MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC: - return "Synchronisiere GPU und CPU"; - case MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC_FRAMES: - return "Synchronisiere Frames fest mit GPU"; - case MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X: - return "X-Position der OSD-Nachrichten"; - case MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y: - return "Y-Position der OSD-Nachrichten"; - case MENU_ENUM_LABEL_VALUE_VIDEO_MONITOR_INDEX: - return "Monitor-Index"; - case MENU_ENUM_LABEL_VALUE_VIDEO_POST_FILTER_RECORD: - return "Aktiviere Aufnahme von Post-Filtern"; - case MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE: - return "Bildwiederholrate"; - case MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO: - return "Geschätzte Bildwiederholrate"; - case MENU_ENUM_LABEL_VALUE_VIDEO_ROTATION: - return "Rotation"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SCALE: - return "Fenterskalierung"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER: - return "Ganzzahlige Bildskalierung"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS: - return "Video-Einstellungen"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_DIR: - return "Grafikshader-Verzeichnis"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES: - return "Shader-Durchgänge"; /* FIXME */ - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS: - return "Momentane Shaderparameter"; /* FIXME/UPDATE */ - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET: - return "Lade Shader-Voreinstellung"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS: - return "Menü Shaderparameter (Menü)"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS: - return "Speichere Shader-Voreinstellung unter..."; - case MENU_ENUM_LABEL_VALUE_VIDEO_SHARED_CONTEXT: - return "HW-Shared-Context aktivieren"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SMOOTH: - return "Bilineare Filterung (HW)"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SOFT_FILTER: - return "Aktiviere Soft-Filter"; - case MENU_ENUM_LABEL_VALUE_VIDEO_SWAP_INTERVAL: - return "VSync-Intervall"; - case MENU_ENUM_LABEL_VALUE_VIDEO_TAB: - return "Videos"; - case MENU_ENUM_LABEL_VALUE_VIDEO_THREADED: - return "Threaded Video"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VFILTER: - return "Bild entflackern"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_HEIGHT: - return "Bildchirmauflösung Höhe"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_WIDTH: - return "Bildchirmauflösung Breite"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_X: - return "Bildchirmauflösung X"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_Y: - return "Bildchirmauflösung Y"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VI_WIDTH: - return "Kalibriere VI-Bildbreite"; - case MENU_ENUM_LABEL_VALUE_VIDEO_VSYNC: - return "Vertikale Synchronisation (VSync)"; - case MENU_ENUM_LABEL_VALUE_VIDEO_WINDOWED_FULLSCREEN: - return "Unechter Vollbild-Modus (Windowed Fullscreen)"; - case MENU_ENUM_LABEL_VALUE_WIFI_DRIVER: - return "Wlan-Treiber"; - case MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS: - return "Wlan"; - case MENU_ENUM_LABEL_VALUE_XMB_SHADOWS_ENABLE: - return "Icon Schatten"; - case MENU_ENUM_LABEL_VALUE_XMB_SHOW_HISTORY: - return "Zeige Verlauf"; - case MENU_ENUM_LABEL_VALUE_XMB_SHOW_IMAGES: - return "Zeige Bilder"; - case MENU_ENUM_LABEL_VALUE_XMB_SHOW_MUSIC: - return "Zeige Musik"; - case MENU_ENUM_LABEL_VALUE_XMB_SHOW_SETTINGS: - return "Zeige Einstellungen"; - case MENU_ENUM_LABEL_VALUE_XMB_SHOW_VIDEO: - return "Zeige Videos"; - case MENU_ENUM_LABEL_VALUE_YES: - return "Ja"; + MSG_HASH(MENU_ENUM_LABEL_SETTINGS, + "Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_SHUTDOWN, + "Ausschalten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD, + "Passwort") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_USERNAME, + "Benutzername") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST, + "Konten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ADD_TAB, + "Hinzufügen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ARCHIVE_MODE, + "Verknüpfte Aktion bei Archivdateien") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ASK_ARCHIVE, + "Nachfragen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY, + "Assets-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES, + "Warte auf Audio-Frames") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DEVICE, + "Soundkarte") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER, + "Audio-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN, + "Audio-DSP-Plugin") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE, + "Aktiviere Audio") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR, + "Audio-Filter-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_LATENCY, + "Audiolatenz (ms)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW, + "Maximaler Audioversatz") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MUTE, + "Stumm") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_OUTPUT_RATE, + "Audio-Frequenzrate (kHz)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA, + "Audio Rate Control Delta") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_DRIVER, + "Audio-Resampler-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS, + "Audio-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SYNC, + "Synchronisiere Audio") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME, + "Lautstärke (dB)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTOSAVE_INTERVAL, + "Autospeicherungsintervall") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_OVERRIDES_ENABLE, + "Lade Override-Dateien automatisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_REMAPS_ENABLE, + "Lade Remap-Dateien automatisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_BLOCK_SRAM_OVERWRITE, + "Blockiere SRAM-Überschreibung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_BUILDBOT_ASSETS_URL, + "Buildbot-Assets-URL") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY, /* FIXME/UPDATE */ + "Entpack-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_ALLOW, + "Erlaube Kamera-Zugriff") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER, + "Kamera-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT, + "Cheat") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES, + "Änderungen übernehmen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_DATABASE_PATH, + "Cheat-Datei-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD, + "Lade Cheat-Datei") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_SAVE_AS, + "Speichere Cheat-Datei unter...") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_NUM_PASSES, + "Cheat-Durchgänge") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT, + "Schließe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATIONS, + "Lade Konfigurationsdatei") /* FIXME/UPDATE */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS, + "Konfigurations-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT, + "Speichere Konfiguration beim Beenden") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIRM_ON_EXIT, + "Zum Beenden Nachfragen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST, + "Lade Content (Sammlung)") /* FIXME/TODO - rewrite */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_DATABASE_DIRECTORY, + "Content-Datenbankverzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_SIZE, + "Länge der Verlaufsliste") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS, + "Content-Einstellungen") /* FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY, + "Core-Assets-Verzeichnis") /* FIXME/UPDATE */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS, + "Cheats") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_COUNTERS, + "Core-Zähler") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ENABLE, + "Zeige Core-Namen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION, + "Core-Informationen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS, + "Autoren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES, + "Kategorien") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, + "Core-Beschriftung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, + "Core-Name") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, + "Core-Hinweise") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, + "Firmware") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, + "Lizenz(en)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS, + "Berechtigungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS, + "Unterstütze Erweiterungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER, + "System-Hersteller") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME, + "System-Name") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS, /* UPDATE/FIXME */ + "Core-Input-Optionen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_LIST, + "Lade Core") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_OPTIONS, + "Optionen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS, + "Core-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SET_SUPPORTS_NO_CONTENT_ENABLE, /* TODO/FIXME */ + "Cores nicht automatisch starten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SPECIFIC_CONFIG, + "Core-Spezifische Konfiguration") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE, + "Heruntergeladene Archive automatisch entpacken") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_BUILDBOT_URL, + "Buildbot-Cores-URL") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST, + "Core-Updater") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_SETTINGS, + "Core-Updater-Einstellungen") /* UPDATE/FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_DIRECTORY, + "Cursor-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_MANAGER, + "Cursormanager") + MSG_HASH(MENU_ENUM_LABEL_VALUE_CUSTOM_RATIO, + "Benutzerdefiniertes Verhältnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER, + "Datenbankmanager") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY, + "Von der Playlist löschen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST, + "Lade Content (Core erkennen)") /* FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_CONTENT, + "") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT, + "") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NONE, + "") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND, + "Ordner nicht gefunden.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS, + "Verzeichnis-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DISABLED, + "Deaktiviert") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_CYCLE_TRAY_STATUS, + "Datenträgerstatus") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND, + "Füge Datenträgerabbild hinzu") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_INDEX, + "Datenträger-Nummer") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_OPTIONS, /* UPDATE/FIXME */ + "Datenträger-Optionen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DONT_CARE, + "Mir egal") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE, + "Aktiviere DPI-Override") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE, + "DPI-Override") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS, + "Treiber-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN, + "Dummy bei Core-Abschaltung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER, + "Dynamischer Hintergrund") + MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY, + "Dynamische-Bildschirmhintergründe-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR, + "Hover-Farbe für Menü-Einträge") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR, + "Normale Farbe für Menü-Einträge") + MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE, + "False") + MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO, + "Maximale Ausführungsgeschwindigkeit") + MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW, + "Zeige Framerate") + MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE, + "Begrenze maximale Ausführungsgeschwindigkeit") + MSG_HASH(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS, + "Frontendzähler") + MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP, + "Hilfe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_LIST_ENABLE, + "Aktiviere Verlaufsliste") + MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_TAB, + "Verlauf") + MSG_HASH(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU, /* Don't change. Breaks everything. (Would be, "Horizontales Menu") */ + "Horizontal Menu") + MSG_HASH(MENU_ENUM_LABEL_VALUE_IMAGES_TAB, + "Bilder") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INFORMATION_LIST, + "Information") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ALL_USERS_CONTROL_MENU, + "Jeder nutze kann Menü Steuern") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AUTODETECT_ENABLE, + "Automatische Konfiguration aktivieren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD, + "Schwellwert der Eingabe-Achsen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_HIDE_UNBOUND, + "Verstecke nicht zugewiesene Core-Eingabe-Beschriftungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_LABEL_SHOW, /* TODO/FIXME */ + "Zeige Core-Eingabe-Beschriftungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DRIVER, + "Eingabe-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DUTY_CYCLE, + "Auslastungsgrad") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_MAX_USERS, + "Maximale Benutzerzahl") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OSK_OVERLAY_ENABLE, + "Zeige Tastatur-Overlay") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_ENABLE, + "Aktiviere Overlay") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAPPING_DIRECTORY, /* UPDATE/FIXME */ + "Eingabebelegungs-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE, + "Bind-Remapping aktivieren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS, + "Eingabe-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_TURBO_PERIOD, + "Turbo-Dauer") + MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_USER_BINDS, + "Spieler %u Tastenbelegung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_AUTOCONFIG_DIR, + "Eingabegerät-Autoconfig-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER, + "Joypad-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET, + "Tastatur-Overlay-Voreinstellung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED, + "Chinesisch (Vereinfacht)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_TRADITIONAL, + "Chinesisch (Traditionell)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_DUTCH, + "Niederländisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ENGLISH, + "Englisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO, + "Esperanto") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_FRENCH, + "Französisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_GERMAN, + "Deutsch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ITALIAN, + "Italienisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_JAPANESE, + "Japanisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_KOREAN, + "Koreanisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_PORTUGUESE, + "Portugiesisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_RUSSIAN, + "Russisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_SPANISH, + "Spanisch") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LEFT_ANALOG, + "Linker Analogstick") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH, + "Core-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_INFO_PATH, + "Core-Info-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_LOG_LEVEL, + "Core-Logging-Stufe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LINEAR, + "Linear") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_ARCHIVE, + "Lade Archiv") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT, + "Lade Content") /* FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY, + "Lade Content (Verlauf)") /* FIXME/UPDATE */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST, + "Lade Content") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_STATE, + "Lade Savestate") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_ALLOW, + "Erlaube Standort-Lokalisierung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_DRIVER, + "Standort-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS, + "Logging-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_LOG_VERBOSITY, + "Log-Ausführlichkeit") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MAIN_MENU, + "Hauptmenü") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MANAGEMENT, + "Datenbank-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, + "Menü-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, + "Menü-Dateibrowser-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, + "Menü-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER, + "Menühintergrund") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MISSING, + "Fehlt") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MOUSE_ENABLE, + "Maus-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_MULTIMEDIA_SETTINGS, + "Media-Player-Einstellungen") /* UPDATE/FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_MUSIC_TAB, + "Musik") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE, + "Bekannte Dateiendungen filtern") /* TODO/FIXME - rewrite */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_WRAPAROUND, + "Navigation umbrechen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NEAREST, + "Nächster") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT, /* TODO, Original string changed */ + "Tausche Netplay-Eingabe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES, + "Verzögere Netplay-Frames") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE, + "Aktiviere Netplay") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS, /* TODO, Original string changed */ + "IP-Addresse für Netplay") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_MODE, + "Aktiviere Netplay-Client") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME, + "Benutzername") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE, + "Aktiviere Netplay-Zuschauermodus") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT, + "TCP/UDP-Port für Netplay") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_ENABLE, + "Netzwerk-Befehle") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_PORT, + "Port für Netzwerk-Befehle") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS, + "Netzwerk-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO, + "Nein") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NONE, + "Keins") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE, + "Nicht verfügbar") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE, + "Kein Core") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORES_AVAILABLE, + "Kein Core verfügbar.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE, + "Keine Core-Informationen verfügbar.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_OPTIONS_AVAILABLE, + "Keine Core-Optionen verfügbar.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE, + "Keine Informationen verfügbar.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_ITEMS, + "Keine Einträge.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS, + "Keine Leistungszähler.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE, + "Keine Wiedergabelisten-Eintrage verfügbar.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND, + "Keine Einstellungen gefunden.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SHADER_PARAMETERS, + "Keine Shaderparameter") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OFF, /* Don't change. Needed for XMB atm. (Would be, "AN") */ + "OFF") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ON, /* Don't change. Needed for XMB atm. (Would be, "AUS") */ + "ON") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER, + "Online-Aktualisierungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS, + "OSD-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OPEN_ARCHIVE, + "Öffne Archiv") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OPTIONAL, + "Optional") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OSK_OVERLAY_DIRECTORY, + "OSK-Overlay-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY, + "Overlay-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY, + "Overlay-Transparenz") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET, + "Overlay-Voreinstellung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE, + "Overlay-Skalierung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SETTINGS, + "Overlay-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PAL60_ENABLE, + "Verwende PAL60-Modus") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO, + "Pausiere, wenn das Menü aktiv ist") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE, + "Nicht im Hintergrund laufen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PERFCNT_ENABLE, + "Leistungsindikatoren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY, + "Wiedergabelisten-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS, + "Wiedergabelisten-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_POINTER_ENABLE, + "Touch-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PORT, + "Port") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PRESENT, + "Vorhanden") + MSG_HASH(MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS, + "Privatsphäre-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH, + "RetroArch beenden") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CRC32, + "CRC32") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION, + "Beschreibung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DEVELOPER, + "Entwickler") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FRANCHISE, + "Franchise") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_MD5, + "MD5") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME, + "Name") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ORIGIN, + "Herkunft") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PUBLISHER, + "Publisher") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH, + "Veröffentlichungsmonat") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR, + "Veröffentlichungsjahr") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SHA1, + "SHA1") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_START_CONTENT, + "Starte Content") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REBOOT, + "Neustart") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_CONFIG_DIRECTORY, + "Aufnahme-Konfigurationsverzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_OUTPUT_DIRECTORY, + "Aufnahme-Ausgabeverzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_SETTINGS, + "Aufnahme-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_CONFIG, + "Aufnahme-Konfiguration") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_DRIVER, + "Aufnahme-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_ENABLE, + "Aktiviere Aufnahmefunktion") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_PATH, /* FIXME/UPDATE */ + "Aufnahmepfad") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_USE_OUTPUT_DIRECTORY, + "Verwende Aufnahme-Ausgabeverzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_LOAD, + "Lade Remap-Datei") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE, + "Speichere Core-Remap-Datei") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME, + "Speichere Spiel-Remap-Datei") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REQUIRED, + "Notwendig") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_CONTENT, + "Starte neu") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH, + "Starte RetroArch neu") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME, + "Fortsetzen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME_CONTENT, + "Fortsetzen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROKEYBOARD, + "RetroKeyboard") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROPAD, + "RetroPad") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_ENABLE, + "Zurückspulen (Rewind) aktivieren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_GRANULARITY, + "Genauigkeit des Zurückspulens (Rewind)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS, + "Zurückspul-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY, + "Browser-Directory") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY, + "Konfigurations-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN, + "Zeige Startbildschirm") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG, + "Rechter Analogstick") + MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN, + "Start") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY, + "Spielstand-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_INDEX, + "Automatische Indexierung von Save States") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_LOAD, + "Automatisches Laden von Save States") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_SAVE, + "Automatische Save States") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY, + "Savestate-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_NEW_CONFIG, + "Speichere neue Konfiguration") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_STATE, + "Speichere Savestate") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS, + "Spielstand-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY, + "Durchsuche Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_FILE, + "Durchsuche Datei") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY, + "<- Durchsuche ->") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREENSHOT_DIRECTORY, + "Bildschirmfoto-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION, + "Bildschirmauflösung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SECONDS, + "Sekunden") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SETTINGS, + "Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER, + "Shader") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES, + "Änderungen übernehmen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS, + "Shaders") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_ADVANCED_SETTINGS, + "Zeige erweitere Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES, + "Zeige versteckte Ordner und Dateien") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO, + "Zeitlupen-Verhältnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVEFILES_ENABLE, + "Sortiere Speicherdaten per Ordner") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVESTATES_ENABLE, + "Sortiere Save States per Ordner") + MSG_HASH(MENU_ENUM_LABEL_VALUE_STATUS, + "Status") + MSG_HASH(MENU_ENUM_LABEL_VALUE_STDIN_CMD_ENABLE, + "stdin-Befehle") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE, + "Bildschirmschoner aussetzen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_BGM_ENABLE, + "Aktiviere System-BGM") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_DIRECTORY, + "System/BIOS-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION, + "Systeminformationen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_7ZIP_SUPPORT, + "7zip-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ALSA_SUPPORT, + "ALSA-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE, + "Build-Datum") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CG_SUPPORT, + "Cg-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COCOA_SUPPORT, + "Cocoa-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COMMAND_IFACE_SUPPORT, + "Befehlsinterface-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CORETEXT_SUPPORT, + "CoreText-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_FEATURES, + "CPU-Eigenschaften") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_DPI, + "Bildschirm-DPI") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_HEIGHT, + "Bildschirmhöhe (mm)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_WIDTH, + "Bildschirmbreite (mm)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DSOUND_SUPPORT, + "DirectSound-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYLIB_SUPPORT, + "Dynamic-Library-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_EGL_SUPPORT, + "EGL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FBO_SUPPORT, + "Unterstützung für OpenGL/Direct3D Render-to-Texture (Multi-Pass Shader)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FFMPEG_SUPPORT, + "FFmpeg-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FREETYPE_SUPPORT, + "FreeType-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_IDENTIFIER, + "Frontend-Kennung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_NAME, + "Frontend-Name") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_OS, + "Frontend-Betriebssystem") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION, + "Git-Version") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GLSL_SUPPORT, + "GLSL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_HLSL_SUPPORT, + "HLSL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_JACK_SUPPORT, + "JACK-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_KMS_SUPPORT, + "KMS/EGL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT, + "LibretroDB-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBUSB_SUPPORT, + "Libusb-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBXML2_SUPPORT, + "Libxml2-XML-Parsing-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETPLAY_SUPPORT, + "Netplay-Unterstützung (Peer-to-Peer)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETWORK_COMMAND_IFACE_SUPPORT, + "Netzwerk-Befehlsinterface-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENAL_SUPPORT, + "OpenAL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGLES_SUPPORT, + "OpenGL-ES-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGL_SUPPORT, + "OpenGL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENSL_SUPPORT, + "OpenSL-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENVG_SUPPORT, + "OpenVG-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OSS_SUPPORT, + "OSS-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OVERLAY_SUPPORT, + "Overlay-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE, + "Energiequelle") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGED, + "Geladen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGING, + "Lädt") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_DISCHARGING, + "Entlädt") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_NO_SOURCE, + "Keine Quelle") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PULSEAUDIO_SUPPORT, + "PulseAudio-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PYTHON_SUPPORT, + "Python-Unterstützung (Script-Unterstützung in Shadern)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETRORATING_LEVEL, + "RetroRating-Stufe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ROARAUDIO_SUPPORT, + "RoarAudio-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RPNG_SUPPORT, + "PNG-Unterstützung (RPNG)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RSOUND_SUPPORT, + "RSound-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL2_SUPPORT, + "SDL2-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_IMAGE_SUPPORT, + "SDL-Image-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_SUPPORT, + "SDL1.2-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_THREADING_SUPPORT, + "Threading-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_UDEV_SUPPORT, + "Udev-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_V4L2_SUPPORT, + "Video4Linux2-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_VIDEO_CONTEXT_DRIVER, + "Video-Context-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_WAYLAND_SUPPORT, + "Wayland-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_X11_SUPPORT, + "X11-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XAUDIO2_SUPPORT, + "XAudio2-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XVIDEO_SUPPORT, + "XVideo-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ZLIB_SUPPORT, + "Zlib-Unterstützung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_TAKE_SCREENSHOT, + "Bildschirmfoto") + MSG_HASH(MENU_ENUM_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE, + "Threaded Data Runloop") + MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE, + "Zeige Uhrzeit / Datum") + MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR, + "Menü-Titel-Farbe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE, + "True") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT, + "UI-Companion beim Hochfahren starten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE, + "Menüleiste") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE, + "Komprimiertes Archiv kann nicht gelesen werden.") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UNKNOWN, + "Unbekannt") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_ASSETS, + "Aktualisiere Assets") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_AUTOCONFIG_PROFILES, + "Aktualisiere Autoconfig-Profile") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CG_SHADERS, + "Aktualisiere CG-Shader") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CHEATS, + "Aktualisiere Cheats") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_DATABASES, + "Aktualisiere Datenbanken") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_GLSL_SHADERS, + "Aktualisiere GLSL-Shader") + MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_OVERLAYS, + "Aktualisiere Overlays") + MSG_HASH(MENU_ENUM_LABEL_VALUE_USER, + "Benutzer") + MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS, + "Benutzeroberflächen-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_LANGUAGE, + "Sprache") + MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_SETTINGS, + "Benutzer-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_BUILTIN_PLAYER, + "Verwende integrierten Player") /* FIXME/UPDATE */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY, + "") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE, + "Erlaube Bildrotation") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO, + "Automatisches Bildseitenverhältnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX, + "Bildseitenverhältnis-Index") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION, + "Setze schwarze Frames ein") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN, + "Bildränder (Overscan) zuschneiden (Neustart erforderlich)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION, + "Deaktiviere Desktop-Komposition") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER, + "Grafiktreiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER, + "Videofilter") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR, + "Grafikfilter-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_FLICKER, + "Aktiviere Flacker-Filter") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_ENABLE, + "Zeige OSD-Nachrichten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH, + "Schriftart der OSD-Nachrichten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE, + "Schriftgröße der OSD-Nachrichten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_ASPECT, + "Erzwinge Bildseitenverhältnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_SRGB_DISABLE, + "Erzwinge Deaktivierung des sRGB FBO") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FRAME_DELAY, + "Bildverzögerung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN, + "Verwende Vollbildmodus") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GAMMA, + "Gamma") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_RECORD, + "Aktiviere GPU-Aufnahmefunktion") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_SCREENSHOT, + "Aktiviere GPU-Bildschirmfotos") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC, + "Synchronisiere GPU und CPU") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC_FRAMES, + "Synchronisiere Frames fest mit GPU") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X, + "X-Position der OSD-Nachrichten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y, + "Y-Position der OSD-Nachrichten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MONITOR_INDEX, + "Monitor-Index") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_POST_FILTER_RECORD, + "Aktiviere Aufnahme von Post-Filtern") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE, + "Bildwiederholrate") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO, + "Geschätzte Bildwiederholrate") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ROTATION, + "Rotation") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE, + "Fenterskalierung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER, + "Ganzzahlige Bildskalierung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS, + "Video-Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_DIR, + "Grafikshader-Verzeichnis") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES, + "Shader-Durchgänge") /* FIXME */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS, + "Momentane Shaderparameter") /* FIXME/UPDATE */ + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET, + "Lade Shader-Voreinstellung") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS, + "Menü Shaderparameter (Menü)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS, + "Speichere Shader-Voreinstellung unter...") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHARED_CONTEXT, + "HW-Shared-Context aktivieren") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SMOOTH, + "Bilineare Filterung (HW)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SOFT_FILTER, + "Aktiviere Soft-Filter") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SWAP_INTERVAL, + "VSync-Intervall") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_TAB, + "Videos") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_THREADED, + "Threaded Video") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VFILTER, + "Bild entflackern") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_HEIGHT, + "Bildchirmauflösung Höhe") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_WIDTH, + "Bildchirmauflösung Breite") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_X, + "Bildchirmauflösung X") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_Y, + "Bildchirmauflösung Y") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VI_WIDTH, + "Kalibriere VI-Bildbreite") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VSYNC, + "Vertikale Synchronisation (VSync)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOWED_FULLSCREEN, + "Unechter Vollbild-Modus (Windowed Fullscreen)") + MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_DRIVER, + "Wlan-Treiber") + MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS, + "Wlan") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHADOWS_ENABLE, + "Icon Schatten") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_HISTORY, + "Zeige Verlauf") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_IMAGES, + "Zeige Bilder") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_MUSIC, + "Zeige Musik") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_SETTINGS, + "Zeige Einstellungen") + MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_VIDEO, + "Zeige Videos") + MSG_HASH(MENU_ENUM_LABEL_VALUE_YES, + "Ja") default: break; } From f31404e2c60f0a2544cbcf8b26a661b3f349c908 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Nov 2016 00:44:15 +0100 Subject: [PATCH 006/638] Add msg_hash_de.h --- intl/msg_hash_de.c | 851 +-------------------------------------------- intl/msg_hash_de.h | 846 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 847 insertions(+), 850 deletions(-) create mode 100644 intl/msg_hash_de.h diff --git a/intl/msg_hash_de.c b/intl/msg_hash_de.c index 3e8e9847e3..347ed53b70 100644 --- a/intl/msg_hash_de.c +++ b/intl/msg_hash_de.c @@ -428,856 +428,7 @@ const char *msg_hash_to_str_de(enum msg_hash_enums msg) { switch (msg) { - MSG_HASH(MENU_ENUM_LABEL_SETTINGS, - "Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_SHUTDOWN, - "Ausschalten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD, - "Passwort") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_USERNAME, - "Benutzername") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST, - "Konten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ADD_TAB, - "Hinzufügen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ARCHIVE_MODE, - "Verknüpfte Aktion bei Archivdateien") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ASK_ARCHIVE, - "Nachfragen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY, - "Assets-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES, - "Warte auf Audio-Frames") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DEVICE, - "Soundkarte") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER, - "Audio-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN, - "Audio-DSP-Plugin") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE, - "Aktiviere Audio") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR, - "Audio-Filter-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_LATENCY, - "Audiolatenz (ms)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW, - "Maximaler Audioversatz") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MUTE, - "Stumm") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_OUTPUT_RATE, - "Audio-Frequenzrate (kHz)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA, - "Audio Rate Control Delta") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_DRIVER, - "Audio-Resampler-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS, - "Audio-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SYNC, - "Synchronisiere Audio") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME, - "Lautstärke (dB)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTOSAVE_INTERVAL, - "Autospeicherungsintervall") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_OVERRIDES_ENABLE, - "Lade Override-Dateien automatisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_REMAPS_ENABLE, - "Lade Remap-Dateien automatisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_BLOCK_SRAM_OVERWRITE, - "Blockiere SRAM-Überschreibung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_BUILDBOT_ASSETS_URL, - "Buildbot-Assets-URL") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY, /* FIXME/UPDATE */ - "Entpack-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_ALLOW, - "Erlaube Kamera-Zugriff") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER, - "Kamera-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT, - "Cheat") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES, - "Änderungen übernehmen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_DATABASE_PATH, - "Cheat-Datei-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD, - "Lade Cheat-Datei") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_SAVE_AS, - "Speichere Cheat-Datei unter...") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_NUM_PASSES, - "Cheat-Durchgänge") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT, - "Schließe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATIONS, - "Lade Konfigurationsdatei") /* FIXME/UPDATE */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS, - "Konfigurations-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT, - "Speichere Konfiguration beim Beenden") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIRM_ON_EXIT, - "Zum Beenden Nachfragen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST, - "Lade Content (Sammlung)") /* FIXME/TODO - rewrite */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_DATABASE_DIRECTORY, - "Content-Datenbankverzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_SIZE, - "Länge der Verlaufsliste") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS, - "Content-Einstellungen") /* FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY, - "Core-Assets-Verzeichnis") /* FIXME/UPDATE */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS, - "Cheats") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_COUNTERS, - "Core-Zähler") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ENABLE, - "Zeige Core-Namen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION, - "Core-Informationen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS, - "Autoren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES, - "Kategorien") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, - "Core-Beschriftung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, - "Core-Name") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core-Hinweise") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, - "Firmware") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, - "Lizenz(en)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS, - "Berechtigungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS, - "Unterstütze Erweiterungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER, - "System-Hersteller") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME, - "System-Name") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS, /* UPDATE/FIXME */ - "Core-Input-Optionen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_LIST, - "Lade Core") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_OPTIONS, - "Optionen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS, - "Core-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SET_SUPPORTS_NO_CONTENT_ENABLE, /* TODO/FIXME */ - "Cores nicht automatisch starten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SPECIFIC_CONFIG, - "Core-Spezifische Konfiguration") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE, - "Heruntergeladene Archive automatisch entpacken") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_BUILDBOT_URL, - "Buildbot-Cores-URL") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST, - "Core-Updater") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_SETTINGS, - "Core-Updater-Einstellungen") /* UPDATE/FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_DIRECTORY, - "Cursor-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_MANAGER, - "Cursormanager") - MSG_HASH(MENU_ENUM_LABEL_VALUE_CUSTOM_RATIO, - "Benutzerdefiniertes Verhältnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER, - "Datenbankmanager") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY, - "Von der Playlist löschen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST, - "Lade Content (Core erkennen)") /* FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_CONTENT, - "") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT, - "") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NONE, - "") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND, - "Ordner nicht gefunden.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS, - "Verzeichnis-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DISABLED, - "Deaktiviert") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_CYCLE_TRAY_STATUS, - "Datenträgerstatus") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND, - "Füge Datenträgerabbild hinzu") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_INDEX, - "Datenträger-Nummer") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_OPTIONS, /* UPDATE/FIXME */ - "Datenträger-Optionen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DONT_CARE, - "Mir egal") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE, - "Aktiviere DPI-Override") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE, - "DPI-Override") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS, - "Treiber-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN, - "Dummy bei Core-Abschaltung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER, - "Dynamischer Hintergrund") - MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY, - "Dynamische-Bildschirmhintergründe-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR, - "Hover-Farbe für Menü-Einträge") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR, - "Normale Farbe für Menü-Einträge") - MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE, - "False") - MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO, - "Maximale Ausführungsgeschwindigkeit") - MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW, - "Zeige Framerate") - MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE, - "Begrenze maximale Ausführungsgeschwindigkeit") - MSG_HASH(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS, - "Frontendzähler") - MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP, - "Hilfe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_LIST_ENABLE, - "Aktiviere Verlaufsliste") - MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_TAB, - "Verlauf") - MSG_HASH(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU, /* Don't change. Breaks everything. (Would be, "Horizontales Menu") */ - "Horizontal Menu") - MSG_HASH(MENU_ENUM_LABEL_VALUE_IMAGES_TAB, - "Bilder") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INFORMATION_LIST, - "Information") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ALL_USERS_CONTROL_MENU, - "Jeder nutze kann Menü Steuern") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AUTODETECT_ENABLE, - "Automatische Konfiguration aktivieren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD, - "Schwellwert der Eingabe-Achsen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_HIDE_UNBOUND, - "Verstecke nicht zugewiesene Core-Eingabe-Beschriftungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_LABEL_SHOW, /* TODO/FIXME */ - "Zeige Core-Eingabe-Beschriftungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DRIVER, - "Eingabe-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DUTY_CYCLE, - "Auslastungsgrad") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_MAX_USERS, - "Maximale Benutzerzahl") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OSK_OVERLAY_ENABLE, - "Zeige Tastatur-Overlay") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_ENABLE, - "Aktiviere Overlay") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAPPING_DIRECTORY, /* UPDATE/FIXME */ - "Eingabebelegungs-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE, - "Bind-Remapping aktivieren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS, - "Eingabe-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_TURBO_PERIOD, - "Turbo-Dauer") - MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_USER_BINDS, - "Spieler %u Tastenbelegung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_AUTOCONFIG_DIR, - "Eingabegerät-Autoconfig-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER, - "Joypad-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET, - "Tastatur-Overlay-Voreinstellung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED, - "Chinesisch (Vereinfacht)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_TRADITIONAL, - "Chinesisch (Traditionell)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_DUTCH, - "Niederländisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ENGLISH, - "Englisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO, - "Esperanto") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_FRENCH, - "Französisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_GERMAN, - "Deutsch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ITALIAN, - "Italienisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_JAPANESE, - "Japanisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_KOREAN, - "Koreanisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_PORTUGUESE, - "Portugiesisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_RUSSIAN, - "Russisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_SPANISH, - "Spanisch") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LEFT_ANALOG, - "Linker Analogstick") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH, - "Core-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_INFO_PATH, - "Core-Info-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_LOG_LEVEL, - "Core-Logging-Stufe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LINEAR, - "Linear") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_ARCHIVE, - "Lade Archiv") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT, - "Lade Content") /* FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY, - "Lade Content (Verlauf)") /* FIXME/UPDATE */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST, - "Lade Content") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_STATE, - "Lade Savestate") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_ALLOW, - "Erlaube Standort-Lokalisierung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_DRIVER, - "Standort-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS, - "Logging-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_LOG_VERBOSITY, - "Log-Ausführlichkeit") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MAIN_MENU, - "Hauptmenü") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MANAGEMENT, - "Datenbank-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, - "Menü-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, - "Menü-Dateibrowser-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, - "Menü-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER, - "Menühintergrund") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MISSING, - "Fehlt") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MOUSE_ENABLE, - "Maus-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_MULTIMEDIA_SETTINGS, - "Media-Player-Einstellungen") /* UPDATE/FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_MUSIC_TAB, - "Musik") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE, - "Bekannte Dateiendungen filtern") /* TODO/FIXME - rewrite */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_WRAPAROUND, - "Navigation umbrechen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NEAREST, - "Nächster") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT, /* TODO, Original string changed */ - "Tausche Netplay-Eingabe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES, - "Verzögere Netplay-Frames") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE, - "Aktiviere Netplay") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS, /* TODO, Original string changed */ - "IP-Addresse für Netplay") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_MODE, - "Aktiviere Netplay-Client") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME, - "Benutzername") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE, - "Aktiviere Netplay-Zuschauermodus") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT, - "TCP/UDP-Port für Netplay") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_ENABLE, - "Netzwerk-Befehle") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_PORT, - "Port für Netzwerk-Befehle") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS, - "Netzwerk-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO, - "Nein") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NONE, - "Keins") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE, - "Nicht verfügbar") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE, - "Kein Core") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORES_AVAILABLE, - "Kein Core verfügbar.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE, - "Keine Core-Informationen verfügbar.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_OPTIONS_AVAILABLE, - "Keine Core-Optionen verfügbar.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE, - "Keine Informationen verfügbar.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_ITEMS, - "Keine Einträge.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS, - "Keine Leistungszähler.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE, - "Keine Wiedergabelisten-Eintrage verfügbar.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND, - "Keine Einstellungen gefunden.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SHADER_PARAMETERS, - "Keine Shaderparameter") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OFF, /* Don't change. Needed for XMB atm. (Would be, "AN") */ - "OFF") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ON, /* Don't change. Needed for XMB atm. (Would be, "AUS") */ - "ON") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER, - "Online-Aktualisierungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS, - "OSD-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OPEN_ARCHIVE, - "Öffne Archiv") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OPTIONAL, - "Optional") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OSK_OVERLAY_DIRECTORY, - "OSK-Overlay-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY, - "Overlay-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY, - "Overlay-Transparenz") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET, - "Overlay-Voreinstellung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE, - "Overlay-Skalierung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SETTINGS, - "Overlay-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PAL60_ENABLE, - "Verwende PAL60-Modus") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO, - "Pausiere, wenn das Menü aktiv ist") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE, - "Nicht im Hintergrund laufen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PERFCNT_ENABLE, - "Leistungsindikatoren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY, - "Wiedergabelisten-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS, - "Wiedergabelisten-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_POINTER_ENABLE, - "Touch-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PORT, - "Port") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PRESENT, - "Vorhanden") - MSG_HASH(MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS, - "Privatsphäre-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH, - "RetroArch beenden") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CRC32, - "CRC32") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION, - "Beschreibung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DEVELOPER, - "Entwickler") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FRANCHISE, - "Franchise") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_MD5, - "MD5") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME, - "Name") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ORIGIN, - "Herkunft") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PUBLISHER, - "Publisher") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH, - "Veröffentlichungsmonat") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR, - "Veröffentlichungsjahr") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SHA1, - "SHA1") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_START_CONTENT, - "Starte Content") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REBOOT, - "Neustart") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_CONFIG_DIRECTORY, - "Aufnahme-Konfigurationsverzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_OUTPUT_DIRECTORY, - "Aufnahme-Ausgabeverzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_SETTINGS, - "Aufnahme-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_CONFIG, - "Aufnahme-Konfiguration") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_DRIVER, - "Aufnahme-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_ENABLE, - "Aktiviere Aufnahmefunktion") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_PATH, /* FIXME/UPDATE */ - "Aufnahmepfad") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_USE_OUTPUT_DIRECTORY, - "Verwende Aufnahme-Ausgabeverzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_LOAD, - "Lade Remap-Datei") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE, - "Speichere Core-Remap-Datei") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME, - "Speichere Spiel-Remap-Datei") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REQUIRED, - "Notwendig") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_CONTENT, - "Starte neu") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH, - "Starte RetroArch neu") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME, - "Fortsetzen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME_CONTENT, - "Fortsetzen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROKEYBOARD, - "RetroKeyboard") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROPAD, - "RetroPad") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_ENABLE, - "Zurückspulen (Rewind) aktivieren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_GRANULARITY, - "Genauigkeit des Zurückspulens (Rewind)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS, - "Zurückspul-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY, - "Browser-Directory") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY, - "Konfigurations-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN, - "Zeige Startbildschirm") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG, - "Rechter Analogstick") - MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN, - "Start") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY, - "Spielstand-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_INDEX, - "Automatische Indexierung von Save States") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_LOAD, - "Automatisches Laden von Save States") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_SAVE, - "Automatische Save States") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY, - "Savestate-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_NEW_CONFIG, - "Speichere neue Konfiguration") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_STATE, - "Speichere Savestate") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS, - "Spielstand-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY, - "Durchsuche Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_FILE, - "Durchsuche Datei") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY, - "<- Durchsuche ->") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREENSHOT_DIRECTORY, - "Bildschirmfoto-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION, - "Bildschirmauflösung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SECONDS, - "Sekunden") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SETTINGS, - "Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER, - "Shader") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES, - "Änderungen übernehmen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS, - "Shaders") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_ADVANCED_SETTINGS, - "Zeige erweitere Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES, - "Zeige versteckte Ordner und Dateien") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO, - "Zeitlupen-Verhältnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVEFILES_ENABLE, - "Sortiere Speicherdaten per Ordner") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVESTATES_ENABLE, - "Sortiere Save States per Ordner") - MSG_HASH(MENU_ENUM_LABEL_VALUE_STATUS, - "Status") - MSG_HASH(MENU_ENUM_LABEL_VALUE_STDIN_CMD_ENABLE, - "stdin-Befehle") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE, - "Bildschirmschoner aussetzen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_BGM_ENABLE, - "Aktiviere System-BGM") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_DIRECTORY, - "System/BIOS-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION, - "Systeminformationen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_7ZIP_SUPPORT, - "7zip-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ALSA_SUPPORT, - "ALSA-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE, - "Build-Datum") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CG_SUPPORT, - "Cg-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COCOA_SUPPORT, - "Cocoa-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COMMAND_IFACE_SUPPORT, - "Befehlsinterface-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CORETEXT_SUPPORT, - "CoreText-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_FEATURES, - "CPU-Eigenschaften") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_DPI, - "Bildschirm-DPI") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_HEIGHT, - "Bildschirmhöhe (mm)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_WIDTH, - "Bildschirmbreite (mm)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DSOUND_SUPPORT, - "DirectSound-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYLIB_SUPPORT, - "Dynamic-Library-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_EGL_SUPPORT, - "EGL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FBO_SUPPORT, - "Unterstützung für OpenGL/Direct3D Render-to-Texture (Multi-Pass Shader)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FFMPEG_SUPPORT, - "FFmpeg-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FREETYPE_SUPPORT, - "FreeType-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_IDENTIFIER, - "Frontend-Kennung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_NAME, - "Frontend-Name") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_OS, - "Frontend-Betriebssystem") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION, - "Git-Version") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GLSL_SUPPORT, - "GLSL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_HLSL_SUPPORT, - "HLSL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_JACK_SUPPORT, - "JACK-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_KMS_SUPPORT, - "KMS/EGL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT, - "LibretroDB-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBUSB_SUPPORT, - "Libusb-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBXML2_SUPPORT, - "Libxml2-XML-Parsing-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETPLAY_SUPPORT, - "Netplay-Unterstützung (Peer-to-Peer)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETWORK_COMMAND_IFACE_SUPPORT, - "Netzwerk-Befehlsinterface-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENAL_SUPPORT, - "OpenAL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGLES_SUPPORT, - "OpenGL-ES-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGL_SUPPORT, - "OpenGL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENSL_SUPPORT, - "OpenSL-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENVG_SUPPORT, - "OpenVG-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OSS_SUPPORT, - "OSS-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OVERLAY_SUPPORT, - "Overlay-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE, - "Energiequelle") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGED, - "Geladen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGING, - "Lädt") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_DISCHARGING, - "Entlädt") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_NO_SOURCE, - "Keine Quelle") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PULSEAUDIO_SUPPORT, - "PulseAudio-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PYTHON_SUPPORT, - "Python-Unterstützung (Script-Unterstützung in Shadern)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETRORATING_LEVEL, - "RetroRating-Stufe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ROARAUDIO_SUPPORT, - "RoarAudio-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RPNG_SUPPORT, - "PNG-Unterstützung (RPNG)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RSOUND_SUPPORT, - "RSound-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL2_SUPPORT, - "SDL2-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_IMAGE_SUPPORT, - "SDL-Image-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_SUPPORT, - "SDL1.2-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_THREADING_SUPPORT, - "Threading-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_UDEV_SUPPORT, - "Udev-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_V4L2_SUPPORT, - "Video4Linux2-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_VIDEO_CONTEXT_DRIVER, - "Video-Context-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_WAYLAND_SUPPORT, - "Wayland-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_X11_SUPPORT, - "X11-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XAUDIO2_SUPPORT, - "XAudio2-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XVIDEO_SUPPORT, - "XVideo-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ZLIB_SUPPORT, - "Zlib-Unterstützung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_TAKE_SCREENSHOT, - "Bildschirmfoto") - MSG_HASH(MENU_ENUM_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE, - "Threaded Data Runloop") - MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE, - "Zeige Uhrzeit / Datum") - MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR, - "Menü-Titel-Farbe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE, - "True") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT, - "UI-Companion beim Hochfahren starten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE, - "Menüleiste") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE, - "Komprimiertes Archiv kann nicht gelesen werden.") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UNKNOWN, - "Unbekannt") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_ASSETS, - "Aktualisiere Assets") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_AUTOCONFIG_PROFILES, - "Aktualisiere Autoconfig-Profile") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CG_SHADERS, - "Aktualisiere CG-Shader") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CHEATS, - "Aktualisiere Cheats") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_DATABASES, - "Aktualisiere Datenbanken") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_GLSL_SHADERS, - "Aktualisiere GLSL-Shader") - MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_OVERLAYS, - "Aktualisiere Overlays") - MSG_HASH(MENU_ENUM_LABEL_VALUE_USER, - "Benutzer") - MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS, - "Benutzeroberflächen-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_LANGUAGE, - "Sprache") - MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_SETTINGS, - "Benutzer-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_BUILTIN_PLAYER, - "Verwende integrierten Player") /* FIXME/UPDATE */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY, - "") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE, - "Erlaube Bildrotation") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO, - "Automatisches Bildseitenverhältnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX, - "Bildseitenverhältnis-Index") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION, - "Setze schwarze Frames ein") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN, - "Bildränder (Overscan) zuschneiden (Neustart erforderlich)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION, - "Deaktiviere Desktop-Komposition") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER, - "Grafiktreiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER, - "Videofilter") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR, - "Grafikfilter-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_FLICKER, - "Aktiviere Flacker-Filter") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_ENABLE, - "Zeige OSD-Nachrichten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH, - "Schriftart der OSD-Nachrichten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE, - "Schriftgröße der OSD-Nachrichten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_ASPECT, - "Erzwinge Bildseitenverhältnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_SRGB_DISABLE, - "Erzwinge Deaktivierung des sRGB FBO") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FRAME_DELAY, - "Bildverzögerung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN, - "Verwende Vollbildmodus") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GAMMA, - "Gamma") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_RECORD, - "Aktiviere GPU-Aufnahmefunktion") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_SCREENSHOT, - "Aktiviere GPU-Bildschirmfotos") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC, - "Synchronisiere GPU und CPU") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC_FRAMES, - "Synchronisiere Frames fest mit GPU") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X, - "X-Position der OSD-Nachrichten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y, - "Y-Position der OSD-Nachrichten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MONITOR_INDEX, - "Monitor-Index") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_POST_FILTER_RECORD, - "Aktiviere Aufnahme von Post-Filtern") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE, - "Bildwiederholrate") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO, - "Geschätzte Bildwiederholrate") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ROTATION, - "Rotation") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE, - "Fenterskalierung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER, - "Ganzzahlige Bildskalierung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS, - "Video-Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_DIR, - "Grafikshader-Verzeichnis") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES, - "Shader-Durchgänge") /* FIXME */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS, - "Momentane Shaderparameter") /* FIXME/UPDATE */ - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET, - "Lade Shader-Voreinstellung") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS, - "Menü Shaderparameter (Menü)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS, - "Speichere Shader-Voreinstellung unter...") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHARED_CONTEXT, - "HW-Shared-Context aktivieren") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SMOOTH, - "Bilineare Filterung (HW)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SOFT_FILTER, - "Aktiviere Soft-Filter") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SWAP_INTERVAL, - "VSync-Intervall") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_TAB, - "Videos") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_THREADED, - "Threaded Video") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VFILTER, - "Bild entflackern") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_HEIGHT, - "Bildchirmauflösung Höhe") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_WIDTH, - "Bildchirmauflösung Breite") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_X, - "Bildchirmauflösung X") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_Y, - "Bildchirmauflösung Y") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VI_WIDTH, - "Kalibriere VI-Bildbreite") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VSYNC, - "Vertikale Synchronisation (VSync)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOWED_FULLSCREEN, - "Unechter Vollbild-Modus (Windowed Fullscreen)") - MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_DRIVER, - "Wlan-Treiber") - MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS, - "Wlan") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHADOWS_ENABLE, - "Icon Schatten") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_HISTORY, - "Zeige Verlauf") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_IMAGES, - "Zeige Bilder") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_MUSIC, - "Zeige Musik") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_SETTINGS, - "Zeige Einstellungen") - MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_VIDEO, - "Zeige Videos") - MSG_HASH(MENU_ENUM_LABEL_VALUE_YES, - "Ja") + #include "msg_hash_de.h" default: break; } diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h new file mode 100644 index 0000000000..ea8f5f638a --- /dev/null +++ b/intl/msg_hash_de.h @@ -0,0 +1,846 @@ +MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_PASSWORD, + "Passwort") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_CHEEVOS_USERNAME, + "Benutzername") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ACCOUNTS_LIST, + "Konten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ADD_TAB, + "Hinzufügen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ARCHIVE_MODE, + "Verknüpfte Aktion bei Archivdateien") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ASK_ARCHIVE, + "Nachfragen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ASSETS_DIRECTORY, + "Assets-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_BLOCK_FRAMES, + "Warte auf Audio-Frames") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DEVICE, + "Soundkarte") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DRIVER, + "Audio-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_DSP_PLUGIN, + "Audio-DSP-Plugin") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_ENABLE, + "Aktiviere Audio") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_FILTER_DIR, + "Audio-Filter-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_LATENCY, + "Audiolatenz (ms)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MAX_TIMING_SKEW, + "Maximaler Audioversatz") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_MUTE, + "Stumm") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_OUTPUT_RATE, + "Audio-Frequenzrate (kHz)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RATE_CONTROL_DELTA, + "Audio Rate Control Delta") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_RESAMPLER_DRIVER, + "Audio-Resampler-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SETTINGS, + "Audio-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_SYNC, + "Synchronisiere Audio") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUDIO_VOLUME, + "Lautstärke (dB)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTOSAVE_INTERVAL, + "Autospeicherungsintervall") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_OVERRIDES_ENABLE, + "Lade Override-Dateien automatisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_AUTO_REMAPS_ENABLE, + "Lade Remap-Dateien automatisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_BLOCK_SRAM_OVERWRITE, + "Blockiere SRAM-Überschreibung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_BUILDBOT_ASSETS_URL, + "Buildbot-Assets-URL") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CACHE_DIRECTORY, /* FIXME/UPDATE */ + "Entpack-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_ALLOW, + "Erlaube Kamera-Zugriff") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CAMERA_DRIVER, + "Kamera-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT, + "Cheat") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_APPLY_CHANGES, + "Änderungen übernehmen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_DATABASE_PATH, + "Cheat-Datei-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_LOAD, + "Lade Cheat-Datei") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_FILE_SAVE_AS, + "Speichere Cheat-Datei unter...") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHEAT_NUM_PASSES, + "Cheat-Durchgänge") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CLOSE_CONTENT, + "Schließe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATIONS, + "Lade Konfigurationsdatei") /* FIXME/UPDATE */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIGURATION_SETTINGS, + "Konfigurations-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIG_SAVE_ON_EXIT, + "Speichere Konfiguration beim Beenden") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONFIRM_ON_EXIT, + "Zum Beenden Nachfragen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_COLLECTION_LIST, + "Lade Content (Sammlung)") /* FIXME/TODO - rewrite */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_DATABASE_DIRECTORY, + "Content-Datenbankverzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_HISTORY_SIZE, + "Länge der Verlaufsliste") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CONTENT_SETTINGS, + "Content-Einstellungen") /* FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ASSETS_DIRECTORY, + "Core-Assets-Verzeichnis") /* FIXME/UPDATE */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_CHEAT_OPTIONS, + "Cheats") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_COUNTERS, + "Core-Zähler") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_ENABLE, + "Zeige Core-Namen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFORMATION, + "Core-Informationen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_AUTHORS, + "Autoren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CATEGORIES, + "Kategorien") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, + "Core-Beschriftung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, + "Core-Name") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, + "Core-Hinweise") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, + "Firmware") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, + "Lizenz(en)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_PERMISSIONS, + "Berechtigungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS, + "Unterstütze Erweiterungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_MANUFACTURER, + "System-Hersteller") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_SYSTEM_NAME, + "System-Name") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INPUT_REMAPPING_OPTIONS, /* UPDATE/FIXME */ + "Core-Input-Optionen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_LIST, + "Lade Core") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_OPTIONS, + "Optionen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS, + "Core-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SET_SUPPORTS_NO_CONTENT_ENABLE, /* TODO/FIXME */ + "Cores nicht automatisch starten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_SPECIFIC_CONFIG, + "Core-Spezifische Konfiguration") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_AUTO_EXTRACT_ARCHIVE, + "Heruntergeladene Archive automatisch entpacken") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_BUILDBOT_URL, + "Buildbot-Cores-URL") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_LIST, + "Core-Updater") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_UPDATER_SETTINGS, + "Core-Updater-Einstellungen") /* UPDATE/FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_DIRECTORY, + "Cursor-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CURSOR_MANAGER, + "Cursormanager") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CUSTOM_RATIO, + "Benutzerdefiniertes Verhältnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_MANAGER, + "Datenbankmanager") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DELETE_ENTRY, + "Von der Playlist löschen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST, + "Lade Content (Core erkennen)") /* FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_CONTENT, + "") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_DEFAULT, + "") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NONE, + "") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_NOT_FOUND, + "Ordner nicht gefunden.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS, + "Verzeichnis-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DISABLED, + "Deaktiviert") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_CYCLE_TRAY_STATUS, + "Datenträgerstatus") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_IMAGE_APPEND, + "Füge Datenträgerabbild hinzu") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_INDEX, + "Datenträger-Nummer") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DISK_OPTIONS, /* UPDATE/FIXME */ + "Datenträger-Optionen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DONT_CARE, + "Mir egal") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_ENABLE, + "Aktiviere DPI-Override") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DPI_OVERRIDE_VALUE, + "DPI-Override") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS, + "Treiber-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN, + "Dummy bei Core-Abschaltung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER, + "Dynamischer Hintergrund") +MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY, + "Dynamische-Bildschirmhintergründe-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_HOVER_COLOR, + "Hover-Farbe für Menü-Einträge") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ENTRY_NORMAL_COLOR, + "Normale Farbe für Menü-Einträge") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FALSE, + "False") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FASTFORWARD_RATIO, + "Maximale Ausführungsgeschwindigkeit") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FPS_SHOW, + "Zeige Framerate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRAME_THROTTLE_ENABLE, + "Begrenze maximale Ausführungsgeschwindigkeit") +MSG_HASH(MENU_ENUM_LABEL_VALUE_FRONTEND_COUNTERS, + "Frontendzähler") +MSG_HASH(MENU_ENUM_LABEL_VALUE_HELP, + "Hilfe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_LIST_ENABLE, + "Aktiviere Verlaufsliste") +MSG_HASH(MENU_ENUM_LABEL_VALUE_HISTORY_TAB, + "Verlauf") +MSG_HASH(MENU_ENUM_LABEL_VALUE_HORIZONTAL_MENU, /* Don't change. Breaks everything. (Would be, "Horizontales Menu") */ + "Horizontal Menu") +MSG_HASH(MENU_ENUM_LABEL_VALUE_IMAGES_TAB, + "Bilder") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INFORMATION_LIST, + "Information") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_ALL_USERS_CONTROL_MENU, + "Jeder nutze kann Menü Steuern") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AUTODETECT_ENABLE, + "Automatische Konfiguration aktivieren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_AXIS_THRESHOLD, + "Schwellwert der Eingabe-Achsen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_HIDE_UNBOUND, + "Verstecke nicht zugewiesene Core-Eingabe-Beschriftungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DESCRIPTOR_LABEL_SHOW, /* TODO/FIXME */ + "Zeige Core-Eingabe-Beschriftungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DRIVER, + "Eingabe-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_DUTY_CYCLE, + "Auslastungsgrad") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_MAX_USERS, + "Maximale Benutzerzahl") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OSK_OVERLAY_ENABLE, + "Zeige Tastatur-Overlay") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_OVERLAY_ENABLE, + "Aktiviere Overlay") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAPPING_DIRECTORY, /* UPDATE/FIXME */ + "Eingabebelegungs-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_REMAP_BINDS_ENABLE, + "Bind-Remapping aktivieren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_SETTINGS, + "Eingabe-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_TURBO_PERIOD, + "Turbo-Dauer") +MSG_HASH(MENU_ENUM_LABEL_VALUE_INPUT_USER_BINDS, + "Spieler %u Tastenbelegung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_AUTOCONFIG_DIR, + "Eingabegerät-Autoconfig-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_JOYPAD_DRIVER, + "Joypad-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_KEYBOARD_OVERLAY_PRESET, + "Tastatur-Overlay-Voreinstellung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_SIMPLIFIED, + "Chinesisch (Vereinfacht)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_CHINESE_TRADITIONAL, + "Chinesisch (Traditionell)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_DUTCH, + "Niederländisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ENGLISH, + "Englisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ESPERANTO, + "Esperanto") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_FRENCH, + "Französisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_GERMAN, + "Deutsch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_ITALIAN, + "Italienisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_JAPANESE, + "Japanisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_KOREAN, + "Koreanisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_PORTUGUESE, + "Portugiesisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_RUSSIAN, + "Russisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LANG_SPANISH, + "Spanisch") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LEFT_ANALOG, + "Linker Analogstick") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_DIR_PATH, + "Core-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_INFO_PATH, + "Core-Info-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LIBRETRO_LOG_LEVEL, + "Core-Logging-Stufe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LINEAR, + "Linear") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_ARCHIVE, + "Lade Archiv") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT, + "Lade Content") /* FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_HISTORY, + "Lade Content (Verlauf)") /* FIXME/UPDATE */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_CONTENT_LIST, + "Lade Content") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOAD_STATE, + "Lade Savestate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_ALLOW, + "Erlaube Standort-Lokalisierung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOCATION_DRIVER, + "Standort-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS, + "Logging-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_LOG_VERBOSITY, + "Log-Ausführlichkeit") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MAIN_MENU, + "Hauptmenü") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MANAGEMENT, + "Datenbank-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_DRIVER, + "Menü-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_FILE_BROWSER_SETTINGS, + "Menü-Dateibrowser-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_SETTINGS, + "Menü-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MENU_WALLPAPER, + "Menühintergrund") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MISSING, + "Fehlt") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MOUSE_ENABLE, + "Maus-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_MULTIMEDIA_SETTINGS, + "Media-Player-Einstellungen") /* UPDATE/FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_MUSIC_TAB, + "Musik") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_BROWSER_FILTER_SUPPORTED_EXTENSIONS_ENABLE, + "Bekannte Dateiendungen filtern") /* TODO/FIXME - rewrite */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_NAVIGATION_WRAPAROUND, + "Navigation umbrechen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NEAREST, + "Nächster") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_CLIENT_SWAP_INPUT, /* TODO, Original string changed */ + "Tausche Netplay-Eingabe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES, + "Verzögere Netplay-Frames") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE, + "Aktiviere Netplay") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS, /* TODO, Original string changed */ + "IP-Addresse für Netplay") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_MODE, + "Aktiviere Netplay-Client") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME, + "Benutzername") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE, + "Aktiviere Netplay-Zuschauermodus") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT, + "TCP/UDP-Port für Netplay") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_ENABLE, + "Netzwerk-Befehle") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_PORT, + "Port für Netzwerk-Befehle") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS, + "Netzwerk-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO, + "Nein") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NONE, + "Keins") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NOT_AVAILABLE, + "Nicht verfügbar") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE, + "Kein Core") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORES_AVAILABLE, + "Kein Core verfügbar.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_INFORMATION_AVAILABLE, + "Keine Core-Informationen verfügbar.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_CORE_OPTIONS_AVAILABLE, + "Keine Core-Optionen verfügbar.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE, + "Keine Informationen verfügbar.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_ITEMS, + "Keine Einträge.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS, + "Keine Leistungszähler.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE, + "Keine Wiedergabelisten-Eintrage verfügbar.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND, + "Keine Einstellungen gefunden.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_SHADER_PARAMETERS, + "Keine Shaderparameter") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OFF, /* Don't change. Needed for XMB atm. (Would be, "AN") */ + "OFF") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ON, /* Don't change. Needed for XMB atm. (Would be, "AUS") */ + "ON") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ONLINE_UPDATER, + "Online-Aktualisierungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_ONSCREEN_DISPLAY_SETTINGS, + "OSD-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OPEN_ARCHIVE, + "Öffne Archiv") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OPTIONAL, + "Optional") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OSK_OVERLAY_DIRECTORY, + "OSK-Overlay-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_DIRECTORY, + "Overlay-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_OPACITY, + "Overlay-Transparenz") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_PRESET, + "Overlay-Voreinstellung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SCALE, + "Overlay-Skalierung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_OVERLAY_SETTINGS, + "Overlay-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PAL60_ENABLE, + "Verwende PAL60-Modus") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_LIBRETRO, + "Pausiere, wenn das Menü aktiv ist") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PAUSE_NONACTIVE, + "Nicht im Hintergrund laufen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PERFCNT_ENABLE, + "Leistungsindikatoren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_DIRECTORY, + "Wiedergabelisten-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PLAYLIST_SETTINGS, + "Wiedergabelisten-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_POINTER_ENABLE, + "Touch-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PORT, + "Port") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PRESENT, + "Vorhanden") +MSG_HASH(MENU_ENUM_LABEL_VALUE_PRIVACY_SETTINGS, + "Privatsphäre-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_QUIT_RETROARCH, + "RetroArch beenden") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_CRC32, + "CRC32") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DESCRIPTION, + "Beschreibung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_DEVELOPER, + "Entwickler") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_FRANCHISE, + "Franchise") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_MD5, + "MD5") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME, + "Name") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_ORIGIN, + "Herkunft") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_PUBLISHER, + "Publisher") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_MONTH, + "Veröffentlichungsmonat") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_RELEASE_YEAR, + "Veröffentlichungsjahr") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_SHA1, + "SHA1") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_START_CONTENT, + "Starte Content") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REBOOT, + "Neustart") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_CONFIG_DIRECTORY, + "Aufnahme-Konfigurationsverzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_OUTPUT_DIRECTORY, + "Aufnahme-Ausgabeverzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORDING_SETTINGS, + "Aufnahme-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_CONFIG, + "Aufnahme-Konfiguration") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_DRIVER, + "Aufnahme-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_ENABLE, + "Aktiviere Aufnahmefunktion") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_PATH, /* FIXME/UPDATE */ + "Aufnahmepfad") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RECORD_USE_OUTPUT_DIRECTORY, + "Verwende Aufnahme-Ausgabeverzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_LOAD, + "Lade Remap-Datei") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_CORE, + "Speichere Core-Remap-Datei") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REMAP_FILE_SAVE_GAME, + "Speichere Spiel-Remap-Datei") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REQUIRED, + "Notwendig") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_CONTENT, + "Starte neu") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RESTART_RETROARCH, + "Starte RetroArch neu") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME, + "Fortsetzen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RESUME_CONTENT, + "Fortsetzen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROKEYBOARD, + "RetroKeyboard") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RETROPAD, + "RetroPad") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_ENABLE, + "Zurückspulen (Rewind) aktivieren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_GRANULARITY, + "Genauigkeit des Zurückspulens (Rewind)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_REWIND_SETTINGS, + "Zurückspul-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_BROWSER_DIRECTORY, + "Browser-Directory") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_CONFIG_DIRECTORY, + "Konfigurations-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RGUI_SHOW_START_SCREEN, + "Zeige Startbildschirm") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RIGHT_ANALOG, + "Rechter Analogstick") +MSG_HASH(MENU_ENUM_LABEL_VALUE_RUN, + "Start") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVEFILE_DIRECTORY, + "Spielstand-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_INDEX, + "Automatische Indexierung von Save States") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_LOAD, + "Automatisches Laden von Save States") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_SAVE, + "Automatische Save States") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY, + "Savestate-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_NEW_CONFIG, + "Speichere neue Konfiguration") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_STATE, + "Speichere Savestate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS, + "Spielstand-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_DIRECTORY, + "Durchsuche Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_FILE, + "Durchsuche Datei") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY, + "<- Durchsuche ->") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREENSHOT_DIRECTORY, + "Bildschirmfoto-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SCREEN_RESOLUTION, + "Bildschirmauflösung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SECONDS, + "Sekunden") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SETTINGS, + "Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER, + "Shader") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_APPLY_CHANGES, + "Änderungen übernehmen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHADER_OPTIONS, + "Shaders") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_ADVANCED_SETTINGS, + "Zeige erweitere Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SHOW_HIDDEN_FILES, + "Zeige versteckte Ordner und Dateien") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SLOWMOTION_RATIO, + "Zeitlupen-Verhältnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVEFILES_ENABLE, + "Sortiere Speicherdaten per Ordner") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SORT_SAVESTATES_ENABLE, + "Sortiere Save States per Ordner") +MSG_HASH(MENU_ENUM_LABEL_VALUE_STATUS, + "Status") +MSG_HASH(MENU_ENUM_LABEL_VALUE_STDIN_CMD_ENABLE, + "stdin-Befehle") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SUSPEND_SCREENSAVER_ENABLE, + "Bildschirmschoner aussetzen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_BGM_ENABLE, + "Aktiviere System-BGM") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_DIRECTORY, + "System/BIOS-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFORMATION, + "Systeminformationen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_7ZIP_SUPPORT, + "7zip-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ALSA_SUPPORT, + "ALSA-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE, + "Build-Datum") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CG_SUPPORT, + "Cg-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COCOA_SUPPORT, + "Cocoa-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_COMMAND_IFACE_SUPPORT, + "Befehlsinterface-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CORETEXT_SUPPORT, + "CoreText-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_CPU_FEATURES, + "CPU-Eigenschaften") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_DPI, + "Bildschirm-DPI") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_HEIGHT, + "Bildschirmhöhe (mm)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DISPLAY_METRIC_MM_WIDTH, + "Bildschirmbreite (mm)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DSOUND_SUPPORT, + "DirectSound-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_DYLIB_SUPPORT, + "Dynamic-Library-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_EGL_SUPPORT, + "EGL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FBO_SUPPORT, + "Unterstützung für OpenGL/Direct3D Render-to-Texture (Multi-Pass Shader)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FFMPEG_SUPPORT, + "FFmpeg-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FREETYPE_SUPPORT, + "FreeType-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_IDENTIFIER, + "Frontend-Kennung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_NAME, + "Frontend-Name") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_FRONTEND_OS, + "Frontend-Betriebssystem") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION, + "Git-Version") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GLSL_SUPPORT, + "GLSL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_HLSL_SUPPORT, + "HLSL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_JACK_SUPPORT, + "JACK-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_KMS_SUPPORT, + "KMS/EGL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBRETRODB_SUPPORT, + "LibretroDB-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBUSB_SUPPORT, + "Libusb-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_LIBXML2_SUPPORT, + "Libxml2-XML-Parsing-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETPLAY_SUPPORT, + "Netplay-Unterstützung (Peer-to-Peer)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_NETWORK_COMMAND_IFACE_SUPPORT, + "Netzwerk-Befehlsinterface-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENAL_SUPPORT, + "OpenAL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGLES_SUPPORT, + "OpenGL-ES-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENGL_SUPPORT, + "OpenGL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENSL_SUPPORT, + "OpenSL-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OPENVG_SUPPORT, + "OpenVG-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OSS_SUPPORT, + "OSS-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_OVERLAY_SUPPORT, + "Overlay-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE, + "Energiequelle") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGED, + "Geladen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_CHARGING, + "Lädt") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_DISCHARGING, + "Entlädt") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_POWER_SOURCE_NO_SOURCE, + "Keine Quelle") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PULSEAUDIO_SUPPORT, + "PulseAudio-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_PYTHON_SUPPORT, + "Python-Unterstützung (Script-Unterstützung in Shadern)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RETRORATING_LEVEL, + "RetroRating-Stufe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ROARAUDIO_SUPPORT, + "RoarAudio-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RPNG_SUPPORT, + "PNG-Unterstützung (RPNG)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_RSOUND_SUPPORT, + "RSound-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL2_SUPPORT, + "SDL2-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_IMAGE_SUPPORT, + "SDL-Image-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_SDL_SUPPORT, + "SDL1.2-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_THREADING_SUPPORT, + "Threading-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_UDEV_SUPPORT, + "Udev-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_V4L2_SUPPORT, + "Video4Linux2-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_VIDEO_CONTEXT_DRIVER, + "Video-Context-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_WAYLAND_SUPPORT, + "Wayland-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_X11_SUPPORT, + "X11-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XAUDIO2_SUPPORT, + "XAudio2-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_XVIDEO_SUPPORT, + "XVideo-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_ZLIB_SUPPORT, + "Zlib-Unterstützung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_TAKE_SCREENSHOT, + "Bildschirmfoto") +MSG_HASH(MENU_ENUM_LABEL_VALUE_THREADED_DATA_RUNLOOP_ENABLE, + "Threaded Data Runloop") +MSG_HASH(MENU_ENUM_LABEL_VALUE_TIMEDATE_ENABLE, + "Zeige Uhrzeit / Datum") +MSG_HASH(MENU_ENUM_LABEL_VALUE_TITLE_COLOR, + "Menü-Titel-Farbe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_TRUE, + "True") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_COMPANION_START_ON_BOOT, + "UI-Companion beim Hochfahren starten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UI_MENUBAR_ENABLE, + "Menüleiste") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UNABLE_TO_READ_COMPRESSED_FILE, + "Komprimiertes Archiv kann nicht gelesen werden.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UNKNOWN, + "Unbekannt") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_ASSETS, + "Aktualisiere Assets") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_AUTOCONFIG_PROFILES, + "Aktualisiere Autoconfig-Profile") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CG_SHADERS, + "Aktualisiere CG-Shader") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_CHEATS, + "Aktualisiere Cheats") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_DATABASES, + "Aktualisiere Datenbanken") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_GLSL_SHADERS, + "Aktualisiere GLSL-Shader") +MSG_HASH(MENU_ENUM_LABEL_VALUE_UPDATE_OVERLAYS, + "Aktualisiere Overlays") +MSG_HASH(MENU_ENUM_LABEL_VALUE_USER, + "Benutzer") +MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS, + "Benutzeroberflächen-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_LANGUAGE, + "Sprache") +MSG_HASH(MENU_ENUM_LABEL_VALUE_USER_SETTINGS, + "Benutzer-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_BUILTIN_PLAYER, + "Verwende integrierten Player") /* FIXME/UPDATE */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY, + "") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE, + "Erlaube Bildrotation") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_AUTO, + "Automatisches Bildseitenverhältnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ASPECT_RATIO_INDEX, + "Bildseitenverhältnis-Index") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_BLACK_FRAME_INSERTION, + "Setze schwarze Frames ein") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_CROP_OVERSCAN, + "Bildränder (Overscan) zuschneiden (Neustart erforderlich)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DISABLE_COMPOSITION, + "Deaktiviere Desktop-Komposition") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_DRIVER, + "Grafiktreiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER, + "Videofilter") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_DIR, + "Grafikfilter-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_FLICKER, + "Aktiviere Flacker-Filter") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_ENABLE, + "Zeige OSD-Nachrichten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_PATH, + "Schriftart der OSD-Nachrichten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FONT_SIZE, + "Schriftgröße der OSD-Nachrichten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_ASPECT, + "Erzwinge Bildseitenverhältnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FORCE_SRGB_DISABLE, + "Erzwinge Deaktivierung des sRGB FBO") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FRAME_DELAY, + "Bildverzögerung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_FULLSCREEN, + "Verwende Vollbildmodus") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GAMMA, + "Gamma") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_RECORD, + "Aktiviere GPU-Aufnahmefunktion") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_GPU_SCREENSHOT, + "Aktiviere GPU-Bildschirmfotos") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC, + "Synchronisiere GPU und CPU") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_HARD_SYNC_FRAMES, + "Synchronisiere Frames fest mit GPU") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_X, + "X-Position der OSD-Nachrichten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MESSAGE_POS_Y, + "Y-Position der OSD-Nachrichten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_MONITOR_INDEX, + "Monitor-Index") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_POST_FILTER_RECORD, + "Aktiviere Aufnahme von Post-Filtern") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE, + "Bildwiederholrate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_REFRESH_RATE_AUTO, + "Geschätzte Bildwiederholrate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_ROTATION, + "Rotation") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE, + "Fenterskalierung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SCALE_INTEGER, + "Ganzzahlige Bildskalierung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SETTINGS, + "Video-Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_DIR, + "Grafikshader-Verzeichnis") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_NUM_PASSES, + "Shader-Durchgänge") /* FIXME */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PARAMETERS, + "Momentane Shaderparameter") /* FIXME/UPDATE */ +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET, + "Lade Shader-Voreinstellung") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_PARAMETERS, + "Menü Shaderparameter (Menü)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHADER_PRESET_SAVE_AS, + "Speichere Shader-Voreinstellung unter...") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SHARED_CONTEXT, + "HW-Shared-Context aktivieren") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SMOOTH, + "Bilineare Filterung (HW)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SOFT_FILTER, + "Aktiviere Soft-Filter") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_SWAP_INTERVAL, + "VSync-Intervall") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_TAB, + "Videos") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_THREADED, + "Threaded Video") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VFILTER, + "Bild entflackern") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_HEIGHT, + "Bildchirmauflösung Höhe") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_WIDTH, + "Bildchirmauflösung Breite") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_X, + "Bildchirmauflösung X") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VIEWPORT_CUSTOM_Y, + "Bildchirmauflösung Y") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VI_WIDTH, + "Kalibriere VI-Bildbreite") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_VSYNC, + "Vertikale Synchronisation (VSync)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_VIDEO_WINDOWED_FULLSCREEN, + "Unechter Vollbild-Modus (Windowed Fullscreen)") +MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_DRIVER, + "Wlan-Treiber") +MSG_HASH(MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS, + "Wlan") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHADOWS_ENABLE, + "Icon Schatten") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_HISTORY, + "Zeige Verlauf") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_IMAGES, + "Zeige Bilder") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_MUSIC, + "Zeige Musik") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_SETTINGS, + "Zeige Einstellungen") +MSG_HASH(MENU_ENUM_LABEL_VALUE_XMB_SHOW_VIDEO, + "Zeige Videos") +MSG_HASH(MENU_ENUM_LABEL_VALUE_YES, + "Ja") From dc15a880f7f1f58e125409f8f830b3c7d8b2040e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 28 Nov 2016 00:59:58 +0100 Subject: [PATCH 007/638] Fix screenshots in content_dir --- tasks/task_screenshot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index b568240b01..72b9e7f479 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -305,8 +305,8 @@ static bool take_screenshot_choice(const char *name_base) settings_t *settings = config_get_ptr(); /* No way to infer screenshot directory. */ - if ( string_is_empty(settings->directory.screenshot) - && (!string_is_empty(name_base))) + if ( string_is_empty(settings->directory.screenshot) + && string_is_empty(name_base)) return false; if (video_driver_supports_viewport_read()) From 9505602675172c7126687d8e695a984697d13844 Mon Sep 17 00:00:00 2001 From: radius Date: Sun, 27 Nov 2016 19:25:38 -0500 Subject: [PATCH 008/638] Prevent loading content when firmware is missing --- core_info.c | 10 ++++++++-- intl/msg_hash_us.h | 2 ++ menu/cbs/menu_cbs_ok.c | 8 ++++++-- msg_hash.h | 1 + runloop.c | 28 ++++++++++++++++++++++++++++ runloop.h | 4 ++++ 6 files changed, 49 insertions(+), 4 deletions(-) diff --git a/core_info.c b/core_info.c index 4dc70f6d69..b2e71714e0 100644 --- a/core_info.c +++ b/core_info.c @@ -21,6 +21,8 @@ #include #include #include +#include +#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -410,7 +412,7 @@ static bool core_info_list_update_missing_firmware_internal( if (!info) return false; - + runloop_ctl(RUNLOOP_CTL_UNSET_MISSING_BIOS, NULL); for (i = 0; i < info->firmware_count; i++) { if (!info->firmware[i].path) @@ -419,6 +421,11 @@ static bool core_info_list_update_missing_firmware_internal( fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path)); info->firmware[i].missing = !path_file_exists(path); + if (info->firmware[i].missing) + { + runloop_ctl(RUNLOOP_CTL_SET_MISSING_BIOS, NULL); + RARCH_WARN("Firmware missing: %s\n", info->firmware[i].path); + } } return true; @@ -522,7 +529,6 @@ bool core_info_list_update_missing_firmware(core_info_ctx_firmware_t *info) { if (!info) return false; - return core_info_list_update_missing_firmware_internal( core_info_curr_list, info->path, info->directory.system); diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 80454c295a..8240988031 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1936,6 +1936,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "Loaded state from slot #-1 (auto).") MSG_HASH(MSG_LOADING, "Loading") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "Loading content file") MSG_HASH(MSG_LOADING_HISTORY_FILE, diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index f34468abb3..abeacb5009 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -854,7 +854,12 @@ static int generic_action_ok_file_load(const char *corepath, const char *fullpat enum rarch_core_type action_type, enum content_mode_load content_enum_idx) { content_ctx_info_t content_info = {0}; - + if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL)) + { + runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 200, 100, true); + RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); + return 0; + } if (!task_push_content_load_default( corepath, fullpath, &content_info, @@ -1877,7 +1882,6 @@ static int action_ok_load_core_deferred(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { menu_handle_t *menu = NULL; - if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu)) return menu_cbs_exit(); diff --git a/msg_hash.h b/msg_hash.h index b079fc668e..8e5477a7c0 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -155,6 +155,7 @@ enum msg_hash_enums MSG_FAILED, MSG_SUCCEEDED, MSG_LOADING, + MSG_FIRMWARE, MSG_CONNECTING_TO_PORT, MSG_CONNECTED_TO, MSG_FAILED_TO_LOAD, diff --git a/runloop.c b/runloop.c index f73e69949e..721aeed46d 100644 --- a/runloop.c +++ b/runloop.c @@ -127,6 +127,7 @@ static bool runloop_core_shutdown_initiated = false; static bool runloop_perfcnt_enable = false; static bool runloop_overrides_active = false; static bool runloop_game_options_active = false; +static bool runloop_missing_bios = false; global_t *global_get_ptr(void) { @@ -134,6 +135,18 @@ global_t *global_get_ptr(void) return &g_extern; } +void update_firmware_status() +{ + core_info_t *core_info = NULL; + settings_t *settings = config_get_ptr(); + core_info_ctx_firmware_t firmware_info; + + core_info_get_current_core(&core_info); + firmware_info.path = core_info->path; + firmware_info.directory.system = settings->directory.system; + core_info_list_update_missing_firmware(&firmware_info); +} + void runloop_msg_queue_push(const char *msg, unsigned prio, unsigned duration, bool flush) @@ -341,6 +354,14 @@ bool runloop_ctl(enum runloop_ctl_state state, void *data) break; case RUNLOOP_CTL_IS_OVERRIDES_ACTIVE: return runloop_overrides_active; + case RUNLOOP_CTL_SET_MISSING_BIOS: + runloop_missing_bios = true; + break; + case RUNLOOP_CTL_UNSET_MISSING_BIOS: + runloop_missing_bios = false; + break; + case RUNLOOP_CTL_IS_MISSING_BIOS: + return runloop_missing_bios; case RUNLOOP_CTL_SET_GAME_OPTIONS_ACTIVE: runloop_game_options_active = true; break; @@ -1109,6 +1130,13 @@ int runloop_iterate(unsigned *sleep_ms) settings_t *settings = config_get_ptr(); uint64_t current_input = menu_driver_ctl(RARCH_MENU_CTL_IS_ALIVE, NULL) ? input_menu_keys_pressed() : input_keys_pressed(); uint64_t old_input = last_input; + static char old_core[PATH_MAX_LENGTH] = ""; + + if (!string_is_equal(old_core, path_get(RARCH_PATH_CORE))) + { + update_firmware_status(); + strlcpy (old_core, path_get(RARCH_PATH_CORE), sizeof(old_core)); + } last_input = current_input; diff --git a/runloop.h b/runloop.h index a8cdb8851b..35fada6eb1 100644 --- a/runloop.h +++ b/runloop.h @@ -54,6 +54,10 @@ enum runloop_ctl_state RUNLOOP_CTL_SET_OVERRIDES_ACTIVE, RUNLOOP_CTL_UNSET_OVERRIDES_ACTIVE, + RUNLOOP_CTL_IS_MISSING_BIOS, + RUNLOOP_CTL_SET_MISSING_BIOS, + RUNLOOP_CTL_UNSET_MISSING_BIOS, + RUNLOOP_CTL_IS_GAME_OPTIONS_ACTIVE, RUNLOOP_CTL_SET_GAME_OPTIONS_ACTIVE, RUNLOOP_CTL_UNSET_GAME_OPTIONS_ACTIVE, From 8f4d6b8784853dbc88483bfdbd490ff77d0b4187 Mon Sep 17 00:00:00 2001 From: radius Date: Sun, 27 Nov 2016 19:50:41 -0500 Subject: [PATCH 009/638] only block loading when firmware is required --- core_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core_info.c b/core_info.c index b2e71714e0..be7d191a26 100644 --- a/core_info.c +++ b/core_info.c @@ -421,7 +421,7 @@ static bool core_info_list_update_missing_firmware_internal( fill_pathname_join(path, systemdir, info->firmware[i].path, sizeof(path)); info->firmware[i].missing = !path_file_exists(path); - if (info->firmware[i].missing) + if (info->firmware[i].missing && !info->firmware[i].optional) { runloop_ctl(RUNLOOP_CTL_SET_MISSING_BIOS, NULL); RARCH_WARN("Firmware missing: %s\n", info->firmware[i].path); From 7b7a107e45dc731f95e013ffe07c1e67d2269268 Mon Sep 17 00:00:00 2001 From: radius Date: Sun, 27 Nov 2016 19:56:44 -0500 Subject: [PATCH 010/638] add english string to localization files --- intl/msg_hash_eo.h | 2 ++ intl/msg_hash_fr.h | 2 ++ intl/msg_hash_ja.h | 2 ++ intl/msg_hash_nl.h | 2 ++ intl/msg_hash_ru.h | 2 ++ 5 files changed, 10 insertions(+) diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 3993cacca5..62fd137dae 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -1936,6 +1936,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "Loaded state from slot #-1 (auto).") MSG_HASH(MSG_LOADING, "Loading") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "Loading content file") MSG_HASH(MSG_LOADING_HISTORY_FILE, diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 7f81159d68..625dd77a9c 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -1902,6 +1902,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "Chargement du savestate à partir du slot #-1 (auto).") MSG_HASH(MSG_LOADING, "Loading") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "Chargement du contenu") MSG_HASH(MSG_LOADING_HISTORY_FILE, diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index d1cd29c607..415149f4bd 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -1938,6 +1938,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "スロット-1 (自動)から保存状態をロードしました。") MSG_HASH(MSG_LOADING, "ロード中") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "コンテンツをロード中") MSG_HASH(MSG_LOADING_HISTORY_FILE, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 3e17063c37..519801657e 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -1936,6 +1936,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "Loaded state from slot #-1 (auto).") MSG_HASH(MSG_LOADING, "Loading") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "Loading content file") MSG_HASH(MSG_LOADING_HISTORY_FILE, diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 5f8ee71c36..f88ddda2c6 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -1930,6 +1930,8 @@ MSG_HASH(MSG_LOADED_STATE_FROM_SLOT_AUTO, "Загружено сохранение из слота #-1 (auto).") MSG_HASH(MSG_LOADING, "Loading") +MSG_HASH(MSG_FIRMWARE, + "One or more firmware files are missing") MSG_HASH(MSG_LOADING_CONTENT_FILE, "Загружен файл контента") MSG_HASH(MSG_LOADING_HISTORY_FILE, From b1fc261f9ae9a3036cc40e8cefabe9058e337d4a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Nov 2016 02:24:23 +0100 Subject: [PATCH 011/638] Buildfix --- core_info.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core_info.c b/core_info.c index be7d191a26..d6e98c8bf6 100644 --- a/core_info.c +++ b/core_info.c @@ -21,13 +21,14 @@ #include #include #include -#include -#include #ifdef HAVE_CONFIG_H #include "config.h" #endif +#include "runloop.h" +#include "verbosity.h" + #include "config.def.h" #include "core_info.h" #include "configuration.h" From d57d672d15306d6d27b1660921d278ae3eb9cc16 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Nov 2016 02:25:38 +0100 Subject: [PATCH 012/638] Remove unused variable --- gfx/drivers/vita2d_gfx.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/gfx/drivers/vita2d_gfx.c b/gfx/drivers/vita2d_gfx.c index cb10df5891..7a3ca5090a 100644 --- a/gfx/drivers/vita2d_gfx.c +++ b/gfx/drivers/vita2d_gfx.c @@ -43,7 +43,6 @@ static void *vita2d_gfx_init(const video_info_t *video, const input_driver_t **input, void **input_data) { vita_video_t *vita = (vita_video_t *)calloc(1, sizeof(vita_video_t)); - settings_t *settings = config_get_ptr(); unsigned temp_width = PSP_FB_WIDTH; unsigned temp_height = PSP_FB_HEIGHT; @@ -133,7 +132,6 @@ static bool vita2d_gfx_frame(void *data, const void *frame, vita_video_t *vita = (vita_video_t *)data; settings_t *settings = config_get_ptr(); - if (frame) { if(!(vita->texture&&vita2d_texture_get_datap(vita->texture)==frame)){ From ee49eeec092cc093ce34d7d31b58123c8cb4bc18 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 27 Nov 2016 22:02:10 -0500 Subject: [PATCH 013/638] fix endless word_wrap() loop when a label has a newline and no spaces --- menu/drivers/xmb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 5da6d86df8..1b738358f3 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1911,7 +1911,7 @@ char* word_wrap (char* buffer, char* string, int line_width) { i++; } /* check for whitespace */ - if ( isspace( string[ i ] ) ) + if (string[i] == ' ') { buffer[i] = '\n'; i++; @@ -1921,7 +1921,7 @@ char* word_wrap (char* buffer, char* string, int line_width) { /* check for nearest whitespace back in string */ for ( k = i; k > 0; k--) { - if ( isspace( string[ k ] ) ) + if (string[k] == ' ') { buffer[ k ] = '\n'; /* set string index back to character after this one */ From 78e75cdc69bdae42be5db8a7fb747241d7aa3a10 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 27 Nov 2016 22:02:22 -0500 Subject: [PATCH 014/638] whitespace --- menu/drivers/xmb.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 1b738358f3..e4cbf58b7c 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -1886,27 +1886,27 @@ static uintptr_t xmb_icon_get_id(xmb_handle_t *xmb, return xmb->textures.list[XMB_TEXTURE_SUBSETTING]; } -char* word_wrap (char* buffer, char* string, int line_width) { +char* word_wrap(char* buffer, char* string, int line_width) { unsigned i = 0; int k, counter; - while(i < strlen( string ) ) + while(i < strlen(string)) { /* copy string until the end of the line is reached */ - for ( counter = 1; counter <= line_width; counter++ ) + for (counter = 1; counter <= line_width; counter++) { /* check if end of string reached */ - if ( i == strlen( string ) ) + if (i == strlen(string)) { - buffer[ i ] = 0; + buffer[i] = 0; return buffer; } - buffer[ i ] = string[ i ]; + buffer[i] = string[i]; /* check for newlines embedded in the original input * and reset the index */ - if ( buffer[ i ] == '\n' ) + if (buffer[i] == '\n') counter = 1; i++; } @@ -1919,11 +1919,11 @@ char* word_wrap (char* buffer, char* string, int line_width) { else { /* check for nearest whitespace back in string */ - for ( k = i; k > 0; k--) + for (k = i; k > 0; k--) { if (string[k] == ' ') { - buffer[ k ] = '\n'; + buffer[k] = '\n'; /* set string index back to character after this one */ i = k + 1; break; @@ -1931,7 +1931,8 @@ char* word_wrap (char* buffer, char* string, int line_width) { } } } - buffer[ i ] = 0; + + buffer[i] = 0; return buffer; } From 951f3f3e196777d0538fba1219d20e614519ae22 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sun, 27 Nov 2016 23:29:13 -0500 Subject: [PATCH 015/638] don't allow ok button to work from behind the OSK --- menu/menu_event.c | 1 + 1 file changed, 1 insertion(+) diff --git a/menu/menu_event.c b/menu/menu_event.c index 85b291bdda..c6f93d4c01 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -361,6 +361,7 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) input_keyboard_event(true, '\n', '\n', 0, RETRO_DEVICE_KEYBOARD); trigger_input = 0; + ok_trigger = 0; } if (trigger_input & (UINT64_C(1) << RETRO_DEVICE_ID_JOYPAD_UP)) From a1a70c63efd8a668bd3947293fa5e215a139cc78 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Mon, 28 Nov 2016 19:23:04 +0100 Subject: [PATCH 016/638] Set to Pulseaudio by default --- config.def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.def.h b/config.def.h index ec46d274dc..7320a71d71 100644 --- a/config.def.h +++ b/config.def.h @@ -191,12 +191,12 @@ enum #define AUDIO_DEFAULT_DRIVER AUDIO_PSP #elif defined(_3DS) #define AUDIO_DEFAULT_DRIVER AUDIO_CTR +#elif defined(HAVE_PULSE) +#define AUDIO_DEFAULT_DRIVER AUDIO_PULSE #elif defined(HAVE_ALSA) && defined(HAVE_VIDEOCORE) #define AUDIO_DEFAULT_DRIVER AUDIO_ALSATHREAD #elif defined(HAVE_ALSA) #define AUDIO_DEFAULT_DRIVER AUDIO_ALSA -#elif defined(HAVE_PULSE) -#define AUDIO_DEFAULT_DRIVER AUDIO_PULSE #elif defined(HAVE_OSS) #define AUDIO_DEFAULT_DRIVER AUDIO_OSS #elif defined(HAVE_JACK) From 0a83f7a888aac1dc7bed3b1c6e9357f3462dd56a Mon Sep 17 00:00:00 2001 From: fr500 Date: Mon, 28 Nov 2016 17:03:03 -0500 Subject: [PATCH 017/638] add removable storage shortcut --- frontend/drivers/platform_linux.c | 8 ++++++-- intl/msg_hash_chs.c | 4 +++- intl/msg_hash_eo.h | 6 ++++-- intl/msg_hash_fr.h | 6 ++++-- intl/msg_hash_it.c | 4 +++- intl/msg_hash_ja.h | 4 +++- intl/msg_hash_nl.h | 6 ++++-- intl/msg_hash_ru.h | 6 ++++-- intl/msg_hash_us.h | 6 ++++-- intl/msg_hash_vn.c | 6 ++++-- menu/cbs/menu_cbs_label.c | 4 ++-- msg_hash.h | 3 ++- 12 files changed, 43 insertions(+), 20 deletions(-) diff --git a/frontend/drivers/platform_linux.c b/frontend/drivers/platform_linux.c index 0cb921557c..6ca9c5c0b8 100644 --- a/frontend/drivers/platform_linux.c +++ b/frontend/drivers/platform_linux.c @@ -1865,8 +1865,12 @@ static int frontend_linux_parse_drive_list(void *data) FILE_TYPE_DIRECTORY, 0, 0); menu_entries_append_enum(list, internal_storage_path, - msg_hash_to_str(MSG_INTERNAL_MEMORY), - MSG_INTERNAL_MEMORY, FILE_TYPE_DIRECTORY, 0, 0); + msg_hash_to_str(MSG_INTERNAL_STORAGE), + MSG_INTERNAL_STORAGE, FILE_TYPE_DIRECTORY, 0, 0); + menu_entries_append_enum(list, + "/storage", + msg_hash_to_str(MSG_REMOVABLE_STORAGE), + MSG_REMOVABLE_STORAGE, FILE_TYPE_DIRECTORY, 0, 0); #endif menu_entries_append_enum(list, "/", "", diff --git a/intl/msg_hash_chs.c b/intl/msg_hash_chs.c index 29932aa142..9b83e5dee7 100644 --- a/intl/msg_hash_chs.c +++ b/intl/msg_hash_chs.c @@ -3488,8 +3488,10 @@ const char *msg_hash_to_str_chs(enum msg_hash_enums msg) return "Preset Filename"; case MSG_INTERFACE: return "接口"; - case MSG_INTERNAL_MEMORY: + case MSG_INTERNAL_STORAGE: return "内部存储"; + case MSG_REMOVABLE_STORAGE: + return "Removable Storage"; case MSG_INVALID_NICKNAME_SIZE: return "Invalid nickname size."; case MSG_IN_BYTES: diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 62fd137dae..0fb82b102e 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -1916,8 +1916,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "Interface") -MSG_HASH(MSG_INTERNAL_MEMORY, - "Internal Memory") +MSG_HASH(MSG_INTERNAL_STORAGE, + "Internal Storage") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 625dd77a9c..c6e6c6a73e 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -1882,8 +1882,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "Interface") -MSG_HASH(MSG_INTERNAL_MEMORY, - "Internal Memory") +MSG_HASH(MSG_INTERNAL_STORAGE, + "Internal Storage") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_it.c b/intl/msg_hash_it.c index 2a117d3317..9075205d3f 100644 --- a/intl/msg_hash_it.c +++ b/intl/msg_hash_it.c @@ -2189,8 +2189,10 @@ const char *msg_hash_to_str_it(enum msg_hash_enums msg) return "Normale"; case MENU_ENUM_LABEL_VALUE_INPUT_POLL_TYPE_BEHAVIOR_EARLY: return "Presto"; - case MSG_INTERNAL_MEMORY: + case MSG_INTERNAL_STORAGE: return "Memoria interna"; + case MSG_REMOVABLE_STORAGE: + return "Removable storage"; case MSG_EXTERNAL_APPLICATION_DIR: return "Directory app esterna"; case MSG_APPLICATION_DIR: diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index 415149f4bd..c0134c711a 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -1918,8 +1918,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "インタフェース") -MSG_HASH(MSG_INTERNAL_MEMORY, +MSG_HASH(MSG_INTERNAL_STORAGE, "内部メモリ") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index 519801657e..a82c44b7a1 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -1916,8 +1916,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "Interface") -MSG_HASH(MSG_INTERNAL_MEMORY, - "Internal Memory") +MSG_HASH(MSG_INTERNAL_STORAGE, + "Internal Storage") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index f88ddda2c6..26f1dc3c97 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -1910,8 +1910,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "Interface") -MSG_HASH(MSG_INTERNAL_MEMORY, - "Internal Memory") +MSG_HASH(MSG_INTERNAL_STORAGE, + "Internal Storage") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 8240988031..9bc408784a 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1916,8 +1916,10 @@ MSG_HASH(MSG_INPUT_PRESET_FILENAME, "Preset Filename") MSG_HASH(MSG_INTERFACE, "Interface") -MSG_HASH(MSG_INTERNAL_MEMORY, - "Internal Memory") +MSG_HASH(MSG_INTERNAL_STORAGE, + "Internal Storage") +MSG_HASH(MSG_REMOVABLE_STORAGE, + "Removable Storage") MSG_HASH(MSG_INVALID_NICKNAME_SIZE, "Invalid nickname size.") MSG_HASH(MSG_IN_BYTES, diff --git a/intl/msg_hash_vn.c b/intl/msg_hash_vn.c index 9f5110f066..27fc34a523 100644 --- a/intl/msg_hash_vn.c +++ b/intl/msg_hash_vn.c @@ -3535,8 +3535,10 @@ const char *msg_hash_to_str_vn(enum msg_hash_enums msg) return "Preset Filename"; case MSG_INTERFACE: return "Interface"; - case MSG_INTERNAL_MEMORY: - return "Internal Memory"; + case MSG_INTERNAL_STORAGE: + return "Internal Storage"; + case MSG_REMOVABLE_STORAGE: + return "Removable Storage"; case MSG_INVALID_NICKNAME_SIZE: return "Invalid nickname size."; case MSG_IN_BYTES: diff --git a/menu/cbs/menu_cbs_label.c b/menu/cbs/menu_cbs_label.c index e9745e09ad..8c36dd5ba0 100644 --- a/menu/cbs/menu_cbs_label.c +++ b/menu/cbs/menu_cbs_label.c @@ -51,7 +51,7 @@ static int action_bind_label_internal_memory( const char *label, const char *path, char *s, size_t len) { - strlcpy(s, msg_hash_to_str(MSG_INTERNAL_MEMORY), len); + strlcpy(s, msg_hash_to_str(MSG_INTERNAL_STORAGE), len); return 0; } @@ -109,7 +109,7 @@ int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_PLAYLIST_COLLECTION_ENTRY: BIND_ACTION_LABEL(cbs, action_bind_label_playlist_collection_entry); break; - case MSG_INTERNAL_MEMORY: + case MSG_INTERNAL_STORAGE: BIND_ACTION_LABEL(cbs, action_bind_label_internal_memory); break; case MSG_APPLICATION_DIR: diff --git a/msg_hash.h b/msg_hash.h index 8e5477a7c0..4e074ab52b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -888,7 +888,8 @@ enum msg_hash_enums MSG_IN_BYTES, MSG_IN_MEGABYTES, MSG_IN_GIGABYTES, - MSG_INTERNAL_MEMORY, + MSG_INTERNAL_STORAGE, + MSG_REMOVABLE_STORAGE, MSG_APPLICATION_DIR, MSG_EXTERNAL_APPLICATION_DIR, From 7be7568d7d27b2494619b9ee0c2104e620acaed0 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Mon, 28 Nov 2016 18:19:54 -0500 Subject: [PATCH 018/638] do not try to get an archive list if it is inside another archive --- database_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database_info.c b/database_info.c index 37be9b16f9..45bd9baf13 100644 --- a/database_info.c +++ b/database_info.c @@ -423,7 +423,7 @@ database_info_handle_t *database_info_dir_init(const char *dir, { const char *path = db->list->elems[i].data; - if (path_is_compressed_file(path)) + if (path_is_compressed_file(path) && !path_contains_compressed_file(path)) { struct string_list *archive_list = file_archive_get_file_list(path, NULL); From cfd0b4847e983a3f70aa22e8a8ade5370bd09377 Mon Sep 17 00:00:00 2001 From: radius Date: Mon, 28 Nov 2016 20:14:13 -0500 Subject: [PATCH 019/638] fix label --- menu/cbs/menu_cbs_label.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/menu/cbs/menu_cbs_label.c b/menu/cbs/menu_cbs_label.c index 8c36dd5ba0..64ab226e78 100644 --- a/menu/cbs/menu_cbs_label.c +++ b/menu/cbs/menu_cbs_label.c @@ -55,6 +55,16 @@ static int action_bind_label_internal_memory( return 0; } +static int action_bind_label_removable_storage( + file_list_t *list, + unsigned type, unsigned i, + const char *label, const char *path, + char *s, size_t len) +{ + strlcpy(s, msg_hash_to_str(MSG_REMOVABLE_STORAGE), len); + return 0; +} + static int action_bind_label_external_application_dir( file_list_t *list, unsigned type, unsigned i, @@ -112,6 +122,9 @@ int menu_cbs_init_bind_label(menu_file_list_cbs_t *cbs, case MSG_INTERNAL_STORAGE: BIND_ACTION_LABEL(cbs, action_bind_label_internal_memory); break; + case MSG_REMOVABLE_STORAGE: + BIND_ACTION_LABEL(cbs, action_bind_label_removable_storage); + break; case MSG_APPLICATION_DIR: BIND_ACTION_LABEL(cbs, action_bind_label_application_dir); break; From 869800dc0431b6214f74e4cabc4d3756147f4586 Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 00:49:22 -0500 Subject: [PATCH 020/638] Only block loading for CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU and only when a system dir is properly configured --- menu/cbs/menu_cbs_ok.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index abeacb5009..1400a4c8ca 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -854,7 +854,11 @@ static int generic_action_ok_file_load(const char *corepath, const char *fullpat enum rarch_core_type action_type, enum content_mode_load content_enum_idx) { content_ctx_info_t content_info = {0}; - if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL)) + settings_t *settings = config_get_ptr(); + + if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL) + && !string_is_empty(settings->directory.system) + && content_enum_idx == CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU) { runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 200, 100, true); RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); From ff828f884dbb6b24f5dbf7da9491f077061ebc09 Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 00:56:54 -0500 Subject: [PATCH 021/638] fix with the correct enum --- menu/cbs/menu_cbs_ok.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 1400a4c8ca..5a7e307929 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -858,7 +858,7 @@ static int generic_action_ok_file_load(const char *corepath, const char *fullpat if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL) && !string_is_empty(settings->directory.system) - && content_enum_idx == CONTENT_MODE_LOAD_NOTHING_WITH_CURRENT_CORE_FROM_MENU) + && content_enum_idx == CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU) { runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 200, 100, true); RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); From 59c99a59e71f4918586d54798274eb1203165891 Mon Sep 17 00:00:00 2001 From: Diego Viola Date: Tue, 29 Nov 2016 11:23:26 -0200 Subject: [PATCH 022/638] Fix typo --- qb/config.params.sh | 2 +- retroarch.c | 2 +- ui/drivers/qt/wimp-test/main.cpp | 2 +- ui/drivers/qt/wimp/wimp.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qb/config.params.sh b/qb/config.params.sh index 61d5a41861..202e158b27 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -79,7 +79,7 @@ HAVE_PRESERVE_DYLIB=no # Enable dlclose() for Valgrind support HAVE_PARPORT=auto # Parallel port joypad support HAVE_IMAGEVIEWER=yes # Built-in image viewer support. HAVE_MMAP=auto # MMAP support -HAVE_QT=no # QT companion support +HAVE_QT=no # Qt companion support HAVE_XSHM=no # XShm video driver support HAVE_CHEEVOS=yes # Retro Achievements HAVE_SHADERPIPELINE=yes # Additional shader-based pipelines diff --git a/retroarch.c b/retroarch.c index 96627dcdf5..bb375b4c0b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -220,7 +220,7 @@ static void retroarch_print_features(void) _PSUPP(cocoa, "Cocoa", "Cocoa UI companion support " "(for OSX and/or iOS)"); - _PSUPP(qt, "QT", "QT UI companion support"); + _PSUPP(qt, "Qt", "Qt UI companion support"); _PSUPP(avfoundation, "AVFoundation", "Camera driver"); _PSUPP(v4l2, "Video4Linux2", "Camera driver"); } diff --git a/ui/drivers/qt/wimp-test/main.cpp b/ui/drivers/qt/wimp-test/main.cpp index 868dab39bc..7dbfd5e59a 100644 --- a/ui/drivers/qt/wimp-test/main.cpp +++ b/ui/drivers/qt/wimp-test/main.cpp @@ -15,7 +15,7 @@ void *initGui(void *arg) { char **arguments = (char**)arg; t = ctrWimp(i,arguments); - CreateMainWindow(t); //-->uncomment this to open the QT gui + CreateMainWindow(t); //-->uncomment this to open the Qt GUI return 0; } diff --git a/ui/drivers/qt/wimp/wimp.h b/ui/drivers/qt/wimp/wimp.h index 6c7c368677..f404e852eb 100644 --- a/ui/drivers/qt/wimp/wimp.h +++ b/ui/drivers/qt/wimp/wimp.h @@ -41,7 +41,7 @@ class WIMPSHARED_EXPORT Wimp : public QGuiApplication public: Wimp(int argc, char *argv[]): QGuiApplication(argc, argv) {} - /* create the main QT window */ + /* create the main Qt window */ int CreateMainWindow(); /* get a pointer to RetroArch settings */ From cd9d09d1f306e4f2ec1da2db71fc00202eefd954 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 02:04:13 -0500 Subject: [PATCH 023/638] use unicode versions of windows functions --- file_path_special.c | 6 ++++- gfx/common/win32_common.cpp | 27 ++++++++++++++----- gfx/common/win32_common.h | 6 ++++- gfx/drivers/d3d.cpp | 4 +++ gfx/drivers_font/d3d_w32_font.cpp | 2 +- libretro-common/file/retro_dirent.c | 11 ++++++-- libretro-common/file/retro_stat.c | 11 +++++++- libretro-common/include/retro_dirent.h | 2 ++ libretro-common/include/retro_miscellaneous.h | 3 +++ libretro-common/streams/file_stream.c | 3 +++ 10 files changed, 63 insertions(+), 12 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 83ba105f52..540bf7073a 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -208,6 +208,8 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; + wchar_t ws[len]; + size_t ws_size = 0; #endif #ifdef __HAIKU__ image_info info; @@ -219,7 +221,9 @@ void fill_pathname_application_path(char *s, size_t len) return; #ifdef _WIN32 - ret = GetModuleFileName(GetModuleHandle(NULL), s, len - 1); + mbstowcs_s(&ws_size, ws, len, s, len - 1); + + ret = GetModuleFileName(GetModuleHandle(NULL), ws, len - 1); s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 61cafb7717..81e4c98444 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -260,6 +260,7 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) static int win32_drag_query_file(HWND hwnd, WPARAM wparam) { char szFilename[1024] = {0}; + wchar_t wszFilename[1024] = {0}; if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { @@ -268,8 +269,11 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) content_ctx_info_t content_info = {0}; core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; + size_t file_len = 0; - DragQueryFile((HDROP)wparam, 0, szFilename, 1024); + DragQueryFile((HDROP)wparam, 0, wszFilename, 1024); + + wcstombs_s(&file_len, szFilename, sizeof(szFilename), wszFilename, sizeof(szFilename) - 1); core_info_get_list(&core_info_list); @@ -510,7 +514,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowEx(0, "RetroArch", "RetroArch", + main_window.hwnd = CreateWindowEx(0, L"RetroArch", L"RetroArch", style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -578,6 +582,9 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; + wchar_t dev_name_wide[1024]; + size_t dev_name_size = strlen(dev_name) + 1; + size_t dev_name_wide_size = 0; memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -588,7 +595,10 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - return ChangeDisplaySettingsEx(dev_name, &devmode, + + mbstowcs_s(&dev_name_wide_size, dev_name_wide, dev_name_size, dev_name, dev_name_size - 1); + + return ChangeDisplaySettingsEx(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; #endif } @@ -679,7 +689,8 @@ bool win32_suppress_screensaver(void *data, bool enable) #endif } -void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, +/* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ +void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) { @@ -704,10 +715,14 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, } else { + char dev_name[CCHDEVICENAME] = {0}; + size_t name_len = 0; *style = WS_POPUP | WS_VISIBLE; + wcstombs_s(&name_len, dev_name, sizeof(dev_name), current_mon->szDevice, sizeof(dev_name) - 1); + if (!win32_monitor_set_fullscreen(*width, *height, - refresh, current_mon->szDevice)) + refresh, dev_name)) {} /* Display settings might have changed, get new coordinates. */ @@ -853,7 +868,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClass("RetroArch", GetModuleHandle(NULL)); + UnregisterClass(L"RetroArch", GetModuleHandle(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 552be27fd1..a53015c41c 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -21,6 +21,9 @@ #ifndef _XBOX #define WIN32_LEAN_AND_MEAN +#define UNICODE +#include +#include #include #endif @@ -94,7 +97,8 @@ void win32_check_window(bool *quit, void win32_set_window(unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, void *rect_data); -void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, +/* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ +void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 8715dddffd..95bfc96f8b 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -18,6 +18,10 @@ #ifdef _XBOX #include #include +#else +#define UNICODE +#include +#include #endif #include diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index eb6f4027bd..35d6e26f43 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -45,7 +45,7 @@ static void *d3dfonts_w32_init_font(void *video_data, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_PITCH, - "Verdana" /* Hardcode FTL */ + L"Verdana" /* Hardcode FTL */ }; d3dfonts = (d3dfonts_t*)calloc(1, sizeof(*d3dfonts)); diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 54c77b6a24..3eceb9285c 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -28,11 +28,15 @@ #include #include #include +#include struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) char path_buf[1024]; + wchar_t pathW[1024]; + size_t path_size = 0; + size_t out_size = 0; #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -41,7 +45,9 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) snprintf(path_buf, sizeof(path_buf), "%s\\*", name); - rdir->directory = FindFirstFile(path_buf, &rdir->entry); + path_size = strlen(path_buf) + 1; + mbstowcs_s(&out_size, pathW, path_size, path_buf, path_size - 1); + rdir->directory = FindFirstFile(pathW, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -93,7 +99,8 @@ int retro_readdir(struct RDIR *rdir) const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) - return rdir->entry.cFileName; + utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); + return rdir->path; #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; #else diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 077a1b7e60..e0ed739ee3 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -33,6 +33,9 @@ #include #define INVALID_FILE_ATTRIBUTES -1 #else +#define UNICODE +#include +#include #include #include #include @@ -102,7 +105,13 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - DWORD ret = GetFileAttributesEx(path, fInfoLevelId, &file_info); + size_t path_len = strlen(path); + wchar_t path_wide[path_len + 1]; + size_t path_wide_size = 0; + + mbstowcs_s(&path_wide_size, path_wide, path_len + 1, path, path_len); + + DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else diff --git a/libretro-common/include/retro_dirent.h b/libretro-common/include/retro_dirent.h index 4a44934e46..6270287a00 100644 --- a/libretro-common/include/retro_dirent.h +++ b/libretro-common/include/retro_dirent.h @@ -24,6 +24,7 @@ #define __RETRO_DIRENT_H #include +#include #include @@ -65,6 +66,7 @@ struct RDIR WIN32_FIND_DATA entry; HANDLE directory; bool next; + char path[PATH_MAX_LENGTH]; #elif defined(VITA) || defined(PSP) SceUID directory; SceIoDirent entry; diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 83d004b8a0..2ab71c52dc 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -47,6 +47,9 @@ #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN +#define UNICODE +#include +#include #include #elif defined(_WIN32) && defined(_XBOX) #include diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index 6d74a9a106..db9d23b565 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -26,6 +26,9 @@ #include #if defined(_WIN32) +# define UNICODE +# include +# include # ifdef _MSC_VER # define setmode _setmode # endif From 495deae31b7aeef3de6540c120c1b52a417a654e Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 04:18:53 -0500 Subject: [PATCH 024/638] still not working --- libretro-common/file/retro_dirent.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 3eceb9285c..63dad81d90 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -33,8 +33,8 @@ struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) - char path_buf[1024]; - wchar_t pathW[1024]; + char path_buf[1024] = {0}; + wchar_t pathW[1024] = {0}; size_t path_size = 0; size_t out_size = 0; #endif @@ -46,7 +46,7 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) snprintf(path_buf, sizeof(path_buf), "%s\\*", name); path_size = strlen(path_buf) + 1; - mbstowcs_s(&out_size, pathW, path_size, path_buf, path_size - 1); + mbstowcs_s(&out_size, pathW, sizeof(pathW) / sizeof(wchar_t), path_buf, utf8len(path_buf)); rdir->directory = FindFirstFile(pathW, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); @@ -99,6 +99,7 @@ int retro_readdir(struct RDIR *rdir) const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) + memset(rdir->path, 0, sizeof(rdir->path)); utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); return rdir->path; #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) From 8adafa924941af46ab0e60cd4c52259351e0bade Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 12:53:38 -0500 Subject: [PATCH 025/638] use UTF8/16 conversion functions instead of codepage ones --- file_path_special.c | 5 ++--- gfx/common/win32_common.cpp | 16 +++++++--------- libretro-common/file/retro_dirent.c | 5 +---- libretro-common/file/retro_stat.c | 10 +++------- 4 files changed, 13 insertions(+), 23 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 540bf7073a..36e1f8ee36 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -208,8 +208,7 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; - wchar_t ws[len]; - size_t ws_size = 0; + wchar_t ws[PATH_MAX_LENGTH] = {0}; #endif #ifdef __HAIKU__ image_info info; @@ -221,7 +220,7 @@ void fill_pathname_application_path(char *s, size_t len) return; #ifdef _WIN32 - mbstowcs_s(&ws_size, ws, len, s, len - 1); + MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); ret = GetModuleFileName(GetModuleHandle(NULL), ws, len - 1); s[ret] = '\0'; diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 81e4c98444..dcdbf1cf2d 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -47,6 +47,8 @@ extern "C" { #endif +#include + LRESULT win32_menu_loop(HWND owner, WPARAM wparam); #ifndef _MSC_VER @@ -269,11 +271,10 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) content_ctx_info_t content_info = {0}; core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; - size_t file_len = 0; - DragQueryFile((HDROP)wparam, 0, wszFilename, 1024); + DragQueryFile((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); - wcstombs_s(&file_len, szFilename, sizeof(szFilename), wszFilename, sizeof(szFilename) - 1); + utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); core_info_get_list(&core_info_list); @@ -582,9 +583,7 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; - wchar_t dev_name_wide[1024]; - size_t dev_name_size = strlen(dev_name) + 1; - size_t dev_name_wide_size = 0; + wchar_t dev_name_wide[1024] = {0}; memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -596,7 +595,7 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - mbstowcs_s(&dev_name_wide_size, dev_name_wide, dev_name_size, dev_name, dev_name_size - 1); + MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); return ChangeDisplaySettingsEx(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; @@ -716,10 +715,9 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, else { char dev_name[CCHDEVICENAME] = {0}; - size_t name_len = 0; *style = WS_POPUP | WS_VISIBLE; - wcstombs_s(&name_len, dev_name, sizeof(dev_name), current_mon->szDevice, sizeof(dev_name) - 1); + utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); if (!win32_monitor_set_fullscreen(*width, *height, refresh, dev_name)) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 63dad81d90..c36473f6a7 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -35,8 +35,6 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) char path_buf[1024] = {0}; wchar_t pathW[1024] = {0}; - size_t path_size = 0; - size_t out_size = 0; #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -45,8 +43,7 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) snprintf(path_buf, sizeof(path_buf), "%s\\*", name); - path_size = strlen(path_buf) + 1; - mbstowcs_s(&out_size, pathW, sizeof(pathW) / sizeof(wchar_t), path_buf, utf8len(path_buf)); + MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); rdir->directory = FindFirstFile(pathW, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index e0ed739ee3..1293b6bd86 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -24,6 +24,7 @@ #include #include #include +#include #if defined(_WIN32) #ifdef _MSC_VER @@ -33,9 +34,6 @@ #include #define INVALID_FILE_ATTRIBUTES -1 #else -#define UNICODE -#include -#include #include #include #include @@ -105,11 +103,9 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - size_t path_len = strlen(path); - wchar_t path_wide[path_len + 1]; - size_t path_wide_size = 0; + wchar_t path_wide[PATH_MAX_LENGTH] = {0}; - mbstowcs_s(&path_wide_size, path_wide, path_len + 1, path, path_len); + MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); if (ret == 0) From 187e1fc71bd65ae95d5761e52a661e2f3aa8e45c Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 13:47:07 -0500 Subject: [PATCH 026/638] use wide fopen() on windows --- libretro-common/streams/file_stream.c | 32 +++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index db9d23b565..d9406dba80 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -66,6 +66,7 @@ #include #include +#include struct RFILE { @@ -76,6 +77,18 @@ struct RFILE #define HAVE_BUFFERED_IO 1 +#ifdef _WIN32 +#define MODE_STR_READ L"r" +#define MODE_STR_READ_UNBUF L"rb" +#define MODE_STR_WRITE_UNBUF L"wb" +#define MODE_STR_WRITE_PLUS L"w+" +#else +#define MODE_STR_READ "r" +#define MODE_STR_READ_UNBUF "rb" +#define MODE_STR_WRITE_UNBUF "wb" +#define MODE_STR_WRITE_PLUS "w+" +#endif + #if defined(HAVE_BUFFERED_IO) FILE *fp; #endif @@ -104,7 +117,12 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) int flags = 0; int mode_int = 0; #if defined(HAVE_BUFFERED_IO) +#ifdef _WIN32 + const wchar_t *mode_str = NULL; + wchar_t path_wide[PATH_MAX_LENGTH] = {0}; +#else const char *mode_str = NULL; +#endif #endif RFILE *stream = (RFILE*)calloc(1, sizeof(*stream)); @@ -132,7 +150,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #else #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) - mode_str = "r"; + mode_str = MODE_STR_READ; #endif /* No "else" here */ flags = O_RDONLY; @@ -145,7 +163,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #else #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) - mode_str = "rb"; + mode_str = MODE_STR_READ_UNBUF; #endif /* No "else" here */ flags = O_RDONLY; @@ -158,7 +176,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #else #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) - mode_str = "wb"; + mode_str = MODE_STR_WRITE_UNBUF; #endif else { @@ -176,7 +194,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #else #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) - mode_str = "w+"; + mode_str = MODE_STR_WRITE_PLUS; #endif else { @@ -195,13 +213,19 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) { +#ifdef _WIN32 + MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + stream->fp = _wfopen(path_wide, mode_str); +#else stream->fp = fopen(path, mode_str); +#endif if (!stream->fp) goto error; } else #endif { + /* FIXME: HAVE_BUFFERED_IO is always 1, but if it is ever changed, open() needs to be changed to _wopen() for WIndows. */ stream->fd = open(path, flags); if (stream->fd == -1) goto error; From dc99713a9b9961b61dbfa70b9353ba7f88bc2c60 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 14:26:33 -0500 Subject: [PATCH 027/638] create unicode window on Windows --- frontend/drivers/platform_win32.c | 2 +- ui/drivers/ui_win32.c | 33 ++++++++++++++++++++----------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 78ea284dbf..99a81b9889 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -17,11 +17,11 @@ #include #include +#include #include #include #include -#include #include #include #include diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 2ee92d0991..2281de4418 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -34,6 +34,7 @@ #define _WIN32_IE 0x0300 #endif +#include "../../gfx/common/win32_common.h" #include #include #include @@ -52,7 +53,6 @@ #include "../../tasks/tasks_internal.h" #include "../../gfx/common/gl_common.h" -#include "../../gfx/common/win32_common.h" #include "ui_win32.h" #define SHADER_DLG_WIDTH 220 @@ -234,6 +234,12 @@ void shader_dlg_params_reload(void) for (i = 0; i < (int)shader_info.data->num_parameters; i++) { shader_param_ctrl_t*control = &g_shader_dlg.controls[i]; + size_t param_desc_wide_size = sizeof(shader_info.data->parameters[i].desc) * 2; + wchar_t param_desc_wide[param_desc_wide_size]; + + memset(param_desc_wide, 0, sizeof(param_desc_wide)); + MultiByteToWideChar(CP_UTF8, 0, shader_info.data->parameters[i].desc, -1, param_desc_wide, sizeof(param_desc_wide) / sizeof(param_desc_wide[0])); + if ((shader_info.data->parameters[i].minimum == 0.0) && (shader_info.data->parameters[i].maximum @@ -249,8 +255,8 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowEx(0, "BUTTON", - shader_info.data->parameters[i].desc, + control->checkbox.hwnd = CreateWindowEx(0, L"BUTTON", + param_desc_wide, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); @@ -267,21 +273,21 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowEx(0, "STATIC", - shader_info.data->parameters[i].desc, + control->trackbar.label_title = CreateWindowEx(0, L"STATIC", + param_desc_wide, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, "", + control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, L"", WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowEx(0, "STATIC", "", + control->trackbar.label_val = CreateWindowEx(0, L"STATIC", L"", WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); @@ -299,7 +305,7 @@ void shader_dlg_params_reload(void) if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowEx(0, "STATIC", "", + g_shader_dlg.separator.hwnd = CreateWindowEx(0, L"STATIC", L"", SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -423,11 +429,16 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name) { + wchar_t class_name_wide[1024] = {0}; + + if (class_name) + MultiByteToWideChar(CP_UTF8, 0, class_name, -1, class_name_wide, sizeof(class_name_wide) / sizeof(class_name_wide[0])); + wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wndclass->hInstance = GetModuleHandle(NULL); wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); - wndclass->lpszClassName = (class_name != NULL) ? class_name : "RetroArch"; + wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); @@ -482,12 +493,12 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowEx(0, "Shader Dialog", "Shader Parameters", + g_shader_dlg.window.hwnd = CreateWindowEx(0, L"Shader Dialog", L"Shader Parameters", WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, "BUTTON", "Always on Top", + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, L"BUTTON", L"Always on Top", BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, From bb7a96e9a875aff15b38f3a8745e4a4bfd54bbdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Wed, 30 Nov 2016 00:18:27 +0100 Subject: [PATCH 028/638] Async Wi-Fi scan --- Makefile.common | 3 +- menu/menu_displaylist.c | 36 +++++++++---- retroarch.c | 4 ++ runloop.h | 3 ++ tasks/task_wifi.c | 116 ++++++++++++++++++++++++++++++++++++++++ tasks/tasks_internal.h | 3 ++ 6 files changed, 153 insertions(+), 12 deletions(-) create mode 100644 tasks/task_wifi.c diff --git a/Makefile.common b/Makefile.common index f3cfaf753a..a3fe4bd212 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1087,7 +1087,8 @@ ifeq ($(HAVE_NETWORKING), 1) $(LIBRETRO_COMM_DIR)/net/net_http.o \ $(LIBRETRO_COMM_DIR)/net/net_socket.o \ network/net_http_special.o \ - tasks/task_http.o + tasks/task_http.o \ + tasks/task_wifi.o ifneq ($(HAVE_SOCKET_LEGACY),1) OBJ += $(LIBRETRO_COMM_DIR)/net/net_ifinfo.o diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 2a3868681f..a5415d1af8 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -69,7 +69,7 @@ #include "../list_special.h" #include "../performance_counters.h" #include "../core_info.h" -#include "../wifi/wifi_driver.h" +#include "../tasks/tasks_internal.h" #ifdef HAVE_NETWORKING static void print_buf_lines(file_list_t *list, char *buf, @@ -4893,19 +4893,33 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) 0, 0, 0); else { - unsigned i; - struct string_list *ssid_list = string_list_new(); - driver_wifi_scan(); - driver_wifi_get_ssids(ssid_list); + global_t *global = global_get_ptr(); - for (i = 0; i < ssid_list->size; i++) + if (!global) + break; + + if (global->ssid_list->size == 0) { - const char *ssid = ssid_list->elems[i].data; + task_push_wifi_scan(); + menu_entries_append_enum(info->list, - ssid, - msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_WIFI), - MENU_ENUM_LABEL_CONNECT_WIFI, - MENU_WIFI, 0, 0); + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), + MENU_ENUM_LABEL_NO_SETTINGS_FOUND, + 0, 0, 0); + } + else + { + unsigned i; + for (i = 0; i < global->ssid_list->size; i++) + { + const char *ssid = global->ssid_list->elems[i].data; + menu_entries_append_enum(info->list, + ssid, + msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_WIFI), + MENU_ENUM_LABEL_CONNECT_WIFI, + MENU_WIFI, 0, 0); + } } } diff --git a/retroarch.c b/retroarch.c index bb375b4c0b..8205093eaf 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1011,6 +1011,10 @@ bool retroarch_main_init(int argc, char *argv[]) { bool init_failed = false; + global_t *global = global_get_ptr(); + if (global) + global->ssid_list = string_list_new(); + retroarch_init_state(); if (setjmp(error_sjlj_context) > 0) diff --git a/runloop.h b/runloop.h index 35fada6eb1..0e45e50252 100644 --- a/runloop.h +++ b/runloop.h @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -191,6 +192,8 @@ typedef struct global bool flickerfilter_enable; bool softfilter_enable; } console; + + struct string_list *ssid_list; } global_t; typedef struct runloop_ctx_msg_info diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c new file mode 100644 index 0000000000..1fd9223d68 --- /dev/null +++ b/tasks/task_wifi.c @@ -0,0 +1,116 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2016 - Jean-André Santoni + * + * 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 +#include +#include +#include + +#include "tasks_internal.h" +#include "../verbosity.h" +#include "../runloop.h" +#include "../wifi/wifi_driver.h" +#include "../menu/menu_entries.h" +#include "../menu/menu_driver.h" + +typedef struct +{ + struct string_list *ssid_list; +} wifi_handle_t; + +static void wifi_scan_callback(void *task_data, + void *user_data, const char *error) +{ + unsigned menu_type = 0; + const char *path = NULL; + const char *label = NULL; + enum msg_hash_enums enum_idx = MSG_UNKNOWN; + global_t *global = global_get_ptr(); + + menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); + + /* Don't push the results if we left the wifi menu */ + if (!global || !string_is_equal(label, + msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST))) + return; + + file_list_t *file_list = menu_entries_get_selection_buf_ptr(0); + + menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); + + unsigned i; + for (i = 0; i < global->ssid_list->size; i++) + { + const char *ssid = global->ssid_list->elems[i].data; + menu_entries_append_enum(file_list, + ssid, + msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_WIFI), + MENU_ENUM_LABEL_CONNECT_WIFI, + MENU_WIFI, 0, 0); + } +} + +static void task_wifi_scan_handler(retro_task_t *task) +{ + global_t *global = global_get_ptr(); + wifi_handle_t *state = (wifi_handle_t*)task->state; + + driver_wifi_scan(); + task->progress = 50; + task->title = strdup("Parsing SSID list..."); + driver_wifi_get_ssids(global->ssid_list); + task->progress = 100; + task->title = strdup("Wi-Fi scan complete"); + task->finished = true; + task->task_data = state; + + return; +} + +bool task_push_wifi_scan() +{ + retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); + wifi_handle_t *state = (wifi_handle_t*)calloc(1, sizeof(*state)); + + if (!task || !state) + goto error; + + state->ssid_list = string_list_new(); + + /* blocking means no other task can run while this one is running, which is the default */ + task->type = TASK_TYPE_BLOCKING; + task->state = state; + task->handler = task_wifi_scan_handler; + task->callback = wifi_scan_callback; + task->title = strdup("Scanning wireless networks..."); + + task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); + + return true; + +error: + if (state) + free(state); + if (task) + free(task); + + return false; +} \ No newline at end of file diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index f39636f89a..850c709edb 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -83,6 +83,9 @@ void *task_push_http_transfer(const char *url, bool mute, const char *type, retro_task_callback_t cb, void *userdata); task_retriever_info_t *http_task_get_transfer_list(void); + +bool task_push_wifi_scan(); + #endif bool task_push_image_load(const char *fullpath, From 99ab41be4a25ed22f4f6255d51e8fbf00aa16853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Wed, 30 Nov 2016 01:21:21 +0100 Subject: [PATCH 029/638] Don't use structs in global_t. Also simplifies the async wifi code. --- menu/menu_displaylist.c | 13 ++++++------- retroarch.c | 4 ---- runloop.h | 3 --- tasks/task_wifi.c | 15 ++++++--------- wifi/drivers/connmanctl.c | 3 +++ 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index a5415d1af8..5def784767 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -69,6 +69,7 @@ #include "../list_special.h" #include "../performance_counters.h" #include "../core_info.h" +#include "../wifi/wifi_driver.h" #include "../tasks/tasks_internal.h" #ifdef HAVE_NETWORKING @@ -4893,12 +4894,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) 0, 0, 0); else { - global_t *global = global_get_ptr(); + struct string_list *ssid_list = string_list_new(); + driver_wifi_get_ssids(ssid_list); - if (!global) - break; - - if (global->ssid_list->size == 0) + if (ssid_list->size == 0) { task_push_wifi_scan(); @@ -4911,9 +4910,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) else { unsigned i; - for (i = 0; i < global->ssid_list->size; i++) + for (i = 0; i < ssid_list->size; i++) { - const char *ssid = global->ssid_list->elems[i].data; + const char *ssid = ssid_list->elems[i].data; menu_entries_append_enum(info->list, ssid, msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_WIFI), diff --git a/retroarch.c b/retroarch.c index 8205093eaf..bb375b4c0b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1011,10 +1011,6 @@ bool retroarch_main_init(int argc, char *argv[]) { bool init_failed = false; - global_t *global = global_get_ptr(); - if (global) - global->ssid_list = string_list_new(); - retroarch_init_state(); if (setjmp(error_sjlj_context) > 0) diff --git a/runloop.h b/runloop.h index 0e45e50252..35fada6eb1 100644 --- a/runloop.h +++ b/runloop.h @@ -20,7 +20,6 @@ #include #include #include -#include #ifdef HAVE_CONFIG_H #include "config.h" @@ -192,8 +191,6 @@ typedef struct global bool flickerfilter_enable; bool softfilter_enable; } console; - - struct string_list *ssid_list; } global_t; typedef struct runloop_ctx_msg_info diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 1fd9223d68..ec2b83e616 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -43,12 +43,11 @@ static void wifi_scan_callback(void *task_data, const char *path = NULL; const char *label = NULL; enum msg_hash_enums enum_idx = MSG_UNKNOWN; - global_t *global = global_get_ptr(); menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); /* Don't push the results if we left the wifi menu */ - if (!global || !string_is_equal(label, + if (!string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST))) return; @@ -56,10 +55,13 @@ static void wifi_scan_callback(void *task_data, menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); + struct string_list *ssid_list = string_list_new(); + driver_wifi_get_ssids(ssid_list); + unsigned i; - for (i = 0; i < global->ssid_list->size; i++) + for (i = 0; i < ssid_list->size; i++) { - const char *ssid = global->ssid_list->elems[i].data; + const char *ssid = ssid_list->elems[i].data; menu_entries_append_enum(file_list, ssid, msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_WIFI), @@ -70,17 +72,12 @@ static void wifi_scan_callback(void *task_data, static void task_wifi_scan_handler(retro_task_t *task) { - global_t *global = global_get_ptr(); wifi_handle_t *state = (wifi_handle_t*)task->state; driver_wifi_scan(); - task->progress = 50; - task->title = strdup("Parsing SSID list..."); - driver_wifi_get_ssids(global->ssid_list); task->progress = 100; task->title = strdup("Wi-Fi scan complete"); task->finished = true; - task->task_data = state; return; } diff --git a/wifi/drivers/connmanctl.c b/wifi/drivers/connmanctl.c index 773b3ba26b..b9a7b2d068 100644 --- a/wifi/drivers/connmanctl.c +++ b/wifi/drivers/connmanctl.c @@ -81,6 +81,9 @@ static void connmanctl_get_ssids(struct string_list* ssids) union string_list_elem_attr attr; attr.i = RARCH_FILETYPE_UNSET; + if (!lines) + return; + for (i = 0; i < lines->size; i++) { char ssid[20]; From 367dea6723b344cb897b6af00af78c07133d7b25 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Tue, 29 Nov 2016 20:32:24 -0500 Subject: [PATCH 030/638] unicode-ify a couple other windows files, start changing function names to W version explicitly --- file_path_special.c | 3 +- frontend/drivers/platform_win32.c | 4 +-- gfx/common/win32_common.cpp | 40 ++++++++++----------- gfx/drivers_context/wgl_ctx.cpp | 4 +++ input/drivers/dinput.c | 4 +++ libretro-common/file/retro_dirent.c | 6 ++-- libretro-common/file/retro_stat.c | 2 +- ui/drivers/ui_win32.c | 54 ++++++++++++++--------------- 8 files changed, 63 insertions(+), 54 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 36e1f8ee36..9d17045311 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -222,7 +222,8 @@ void fill_pathname_application_path(char *s, size_t len) #ifdef _WIN32 MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - ret = GetModuleFileName(GetModuleHandle(NULL), ws, len - 1); + + ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 99a81b9889..2480e61f4e 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -177,7 +177,7 @@ static void frontend_win32_init(void *data) { typedef BOOL (WINAPI *isProcessDPIAwareProc)(); typedef BOOL (WINAPI *setProcessDPIAwareProc)(); - HMODULE handle = GetModuleHandle(TEXT("User32.dll")); + HMODULE handle = GetModuleHandleW(L"User32.dll"); isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)dylib_proc(handle, "IsProcessDPIAware"); setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)dylib_proc(handle, "SetProcessDPIAware"); @@ -338,7 +338,7 @@ static void frontend_win32_detach_console(void) { HWND wnd = GetConsoleWindow(); FreeConsole(); - PostMessage(wnd, WM_CLOSE, 0, 0); + PostMessageW(wnd, WM_CLOSE, 0, 0); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index dcdbf1cf2d..aa091e33de 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -212,20 +212,20 @@ void win32_monitor_from_window(void) void win32_monitor_get_info(void) { - MONITORINFOEX current_mon; + MONITORINFOEXW current_mon; memset(¤t_mon, 0, sizeof(current_mon)); - current_mon.cbSize = sizeof(MONITORINFOEX); + current_mon.cbSize = sizeof(MONITORINFOEXW); - GetMonitorInfo(win32_monitor_last, (MONITORINFO*)¤t_mon); - ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL); + GetMonitorInfoW(win32_monitor_last, (MONITORINFOEXW*)¤t_mon); + ChangeDisplaySettingsExW(current_mon.szDevice, NULL, NULL, 0, NULL); } void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) { unsigned i, fs_monitor; settings_t *settings = config_get_ptr(); - MONITORINFOEX *mon = (MONITORINFOEX*)data; + MONITORINFOEXW *mon = (MONITORINFOEXW*)data; HMONITOR *hm_to_use = (HMONITOR*)hm_data; if (!win32_monitor_last) @@ -254,8 +254,8 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) } memset(mon, 0, sizeof(*mon)); - mon->cbSize = sizeof(MONITORINFOEX); - GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon); + mon->cbSize = sizeof(MONITORINFOEXW); + GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)mon); } /* Get the count of the files dropped */ @@ -264,7 +264,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) char szFilename[1024] = {0}; wchar_t wszFilename[1024] = {0}; - if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) + if (DragQueryFileW((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { /*poll list of current cores */ size_t list_size; @@ -272,7 +272,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; - DragQueryFile((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); + DragQueryFileW((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); @@ -335,7 +335,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) else { /* Pick one core that could be compatible, ew */ - if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE), + if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( @@ -507,7 +507,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; - return DefWindowProc(hwnd, message, wparam, lparam); + return DefWindowProcW(hwnd, message, wparam, lparam); } bool win32_window_create(void *data, unsigned style, @@ -515,7 +515,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowEx(0, L"RetroArch", L"RetroArch", + main_window.hwnd = CreateWindowExW(0, L"RetroArch", L"RetroArch", style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -597,7 +597,7 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); - return ChangeDisplaySettingsEx(dev_name_wide, &devmode, + return ChangeDisplaySettingsExW(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; #endif } @@ -724,7 +724,7 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, {} /* Display settings might have changed, get new coordinates. */ - GetMonitorInfo(*hm_to_use, (MONITORINFO*)current_mon); + GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); *mon_rect = current_mon->rcMonitor; } } @@ -755,8 +755,8 @@ void win32_set_window(unsigned *width, unsigned *height, { RECT rc_temp = {0, 0, (LONG)*height, 0x7FFF}; SetMenu(main_window.hwnd, - LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); - SendMessage(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); + LoadMenuW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDR_MENU))); + SendMessageW(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); g_resize_height = *height += rc_temp.top + rect->top; SetWindowPos(main_window.hwnd, NULL, 0, 0, *width, *height, SWP_NOMOVE); } @@ -782,7 +782,7 @@ bool win32_set_video_mode(void *data, MSG msg; RECT mon_rect; unsigned mon_id; - MONITORINFOEX current_mon; + MONITORINFOEXW current_mon; bool windowed_full; RECT rect = {0}; HMONITOR hm_to_use = NULL; @@ -805,10 +805,10 @@ bool win32_set_video_mode(void *data, win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ - while (!g_inited && !g_quit && GetMessage(&msg, main_window.hwnd, 0, 0)) + while (!g_inited && !g_quit && GetMessageW(&msg, main_window.hwnd, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageW(&msg); } if (g_quit) @@ -866,7 +866,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClass(L"RetroArch", GetModuleHandle(NULL)); + UnregisterClassW(L"RetroArch", GetModuleHandleW(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 88b5eb87de..648f2123ec 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -23,6 +23,10 @@ #define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K #endif +#define UNICODE +#include +#include + #include #include diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 41cc7157ac..00850d9bfc 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -29,6 +29,10 @@ #define WM_MOUSEWHEEL 0x020A #endif +#define UNICODE +#include +#include + #include #include diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index c36473f6a7..dda73a682b 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -44,7 +44,7 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) snprintf(path_buf, sizeof(path_buf), "%s\\*", name); MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); - rdir->directory = FindFirstFile(pathW, &rdir->entry); + rdir->directory = FindFirstFileW(pathW, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -77,7 +77,7 @@ int retro_readdir(struct RDIR *rdir) { #if defined(_WIN32) if(rdir->next) - return (FindNextFile(rdir->directory, &rdir->entry) != 0); + return (FindNextFileW(rdir->directory, &rdir->entry) != 0); else { rdir->next = true; return (rdir->directory != INVALID_HANDLE_VALUE); @@ -120,7 +120,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) { #if defined(_WIN32) - const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry; + const WIN32_FIND_DATAW *entry = (const WIN32_FIND_DATAW*)&rdir->entry; return entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; #elif defined(PSP) || defined(VITA) const SceIoDirent *entry = (const SceIoDirent*)&rdir->entry; diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 1293b6bd86..95c79c18c3 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -107,7 +107,7 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); - DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); + DWORD ret = GetFileAttributesExW(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 2281de4418..d2a3a44ec0 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -155,20 +155,20 @@ static void shader_dlg_params_refresh(void) bool checked = (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); - SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: shader_dlg_refresh_trackbar_label(i); - SendMessage(control->trackbar.hwnd, + SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessage(control->trackbar.hwnd, + SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].maximum - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].current - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); @@ -255,12 +255,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowEx(0, L"BUTTON", + control->checkbox.hwnd = CreateWindowExW(0, L"BUTTON", param_desc_wide, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -273,27 +273,27 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowEx(0, L"STATIC", + control->trackbar.label_title = CreateWindowExW(0, L"STATIC", param_desc_wide, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, L"", + control->trackbar.hwnd = CreateWindowExW(0, TRACKBAR_CLASS, L"", WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowEx(0, L"STATIC", L"", + control->trackbar.label_val = CreateWindowExW(0, L"STATIC", L"", WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + SendMessageW(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, (LPARAM)control->trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -305,7 +305,7 @@ void shader_dlg_params_reload(void) if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowEx(0, L"STATIC", L"", + g_shader_dlg.separator.hwnd = CreateWindowExW(0, L"STATIC", L"", SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -395,7 +395,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_CHECKBOX) break; - if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; @@ -406,7 +406,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; case WM_HSCROLL: - i = GetWindowLong((HWND)lparam, GWL_ID); + i = GetWindowLongW((HWND)lparam, GWL_ID); if (i >= GFX_MAX_PARAMETERS) break; @@ -414,7 +414,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; @@ -423,7 +423,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, } - return DefWindowProc(hwnd, message, wparam, lparam); + return DefWindowProcW(hwnd, message, wparam, lparam); } bool win32_window_init(WNDCLASSEX *wndclass, @@ -436,11 +436,11 @@ bool win32_window_init(WNDCLASSEX *wndclass, wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndclass->hInstance = GetModuleHandle(NULL); - wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass->hInstance = GetModuleHandleW(NULL); + wndclass->hCursor = LoadCursorW(NULL, IDC_ARROW); wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; - wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); - wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), + wndclass->hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON)); + wndclass->hIconSm = (HICON)LoadImageW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); if (!fullscreen) wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW; @@ -448,7 +448,7 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (class_name != NULL) wndclass->style |= CS_CLASSDC; - if (!RegisterClassEx(wndclass)) + if (!RegisterClassExW(wndclass)) return false; /* This is non-NULL when we want a window for shader dialogs, @@ -473,7 +473,7 @@ bool win32_shader_dlg_init(void) if (!inited) { - WNDCLASSEX wc_shader_dlg = {0}; + WNDCLASSEXW wc_shader_dlg = {0}; INITCOMMONCONTROLSEX comm_ctrl_init = {0}; comm_ctrl_init.dwSize = sizeof(comm_ctrl_init); @@ -493,19 +493,19 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowEx(0, L"Shader Dialog", L"Shader Parameters", + g_shader_dlg.window.hwnd = CreateWindowExW(0, L"Shader Dialog", L"Shader Parameters", WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, L"BUTTON", L"Always on Top", + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowExW(0, L"BUTTON", L"Always on Top", BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)SHADER_DLG_CHECKBOX_ONTOP_ID, NULL, NULL); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; - SendMessage(g_shader_dlg.on_top_checkbox.hwnd, + SendMessageW(g_shader_dlg.on_top_checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -676,7 +676,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) command_event(cmd, NULL); if (do_wm_close) - PostMessage(owner, WM_CLOSE, 0, 0); + PostMessageW(owner, WM_CLOSE, 0, 0); return 0L; } From df956efd433fb912223711bd468b87546ca9fe2d Mon Sep 17 00:00:00 2001 From: FIX94 Date: Wed, 30 Nov 2016 02:37:42 +0100 Subject: [PATCH 031/638] (WiiU) properly set audio offset before starting playback --- audio/drivers/wiiu_audio.c | 8 ++++---- wiiu/multivoice.h | 1 + wiiu/system/imports.h | 1 + 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/audio/drivers/wiiu_audio.c b/audio/drivers/wiiu_audio.c index 44b9324faa..ed912eabc6 100644 --- a/audio/drivers/wiiu_audio.c +++ b/audio/drivers/wiiu_audio.c @@ -79,9 +79,7 @@ void wiiu_ax_callback(void) //buffer underrun, stop playback to let it fill up if(ax->written < AX_AUDIO_SAMPLE_MIN) AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_STOPPED); - //make sure to update written value if voice is running - if(AXIsMultiVoiceRunning(ax->mvoice)) - ax->written -= AX_AUDIO_SAMPLE_COUNT; + ax->written -= AX_AUDIO_SAMPLE_COUNT; OSUninterruptibleSpinLock_Release(&ax->spinlock); } } @@ -188,8 +186,10 @@ static bool ax_audio_start(void* data) //set back to playing on enough buffered data if(ax->written > AX_AUDIO_SAMPLE_LOAD) + { + AXSetMultiVoiceCurrentOffset(ax->mvoice, (ax->pos - ax->written) & AX_AUDIO_COUNT_MASK); AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_PLAYING); - + } return true; } diff --git a/wiiu/multivoice.h b/wiiu/multivoice.h index 5f197d7216..b8ab2284e5 100644 --- a/wiiu/multivoice.h +++ b/wiiu/multivoice.h @@ -12,6 +12,7 @@ typedef struct void AXAcquireMultiVoice(uint32_t prio, void *cb, uint32_t cbarg, void *setup, AXMVoice **mvoice); void AXSetMultiVoiceDeviceMix(AXMVoice *mvoice, AXDeviceType type, uint32_t id, uint32_t bus, uint16_t vol, int16_t delta); void AXSetMultiVoiceOffsets(AXMVoice *mvoice, AXVoiceOffsets *offsets); +void AXSetMultiVoiceCurrentOffset(AXMVoice *mvoice, uint32_t offset); void AXSetMultiVoiceState(AXMVoice *mvoice, AXVoiceState state); void AXSetMultiVoiceVe(AXMVoice *mvoice, AXVoiceVeData *veData); void AXSetMultiVoiceSrcType(AXMVoice *mvoice, AXVoiceSrcType type); diff --git a/wiiu/system/imports.h b/wiiu/system/imports.h index 26cc467b6d..5dd058c516 100644 --- a/wiiu/system/imports.h +++ b/wiiu/system/imports.h @@ -149,6 +149,7 @@ IMPORT(AXRegisterFrameCallback); IMPORT(AXAcquireMultiVoice); IMPORT(AXSetMultiVoiceDeviceMix); IMPORT(AXSetMultiVoiceOffsets); +IMPORT(AXSetMultiVoiceCurrentOffset); IMPORT(AXSetMultiVoiceState); IMPORT(AXSetMultiVoiceVe); IMPORT(AXSetMultiVoiceSrcType); From 65355994b34ee0289bd87ca05d9a105af5e677d6 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 21:00:53 -0500 Subject: [PATCH 032/638] NAT traversal Adding NAT traveral interface to libretro-common, with (currently) a backend support MiniUPNPC. Sensible future backends would be libupnp and a direct implementation of PCP/NAT-PMP. --- Makefile.common | 5 + libretro-common/include/net/net_natt.h | 47 ++++++ libretro-common/net/net_natt.c | 192 +++++++++++++++++++++++++ qb/config.libs.sh | 4 + qb/config.params.sh | 1 + 5 files changed, 249 insertions(+) create mode 100644 libretro-common/include/net/net_natt.h create mode 100644 libretro-common/net/net_natt.c diff --git a/Makefile.common b/Makefile.common index f3cfaf753a..2980615ee3 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1086,6 +1086,7 @@ ifeq ($(HAVE_NETWORKING), 1) OBJ += $(LIBRETRO_COMM_DIR)/net/net_compat.o \ $(LIBRETRO_COMM_DIR)/net/net_http.o \ $(LIBRETRO_COMM_DIR)/net/net_socket.o \ + $(LIBRETRO_COMM_DIR)/net/net_natt.o \ network/net_http_special.o \ tasks/task_http.o @@ -1123,6 +1124,10 @@ ifeq ($(HAVE_NETWORKING), 1) OBJ += input/input_remote.o \ cores/libretro-net-retropad/net_retropad_core.o endif + + ifeq ($(HAVE_MINIUPNPC), 1) + LIBS += -lminiupnpc + endif endif ifneq ($(findstring Win32,$(OS)),) diff --git a/libretro-common/include/net/net_natt.h b/libretro-common/include/net/net_natt.h new file mode 100644 index 0000000000..ec09780711 --- /dev/null +++ b/libretro-common/include/net/net_natt.h @@ -0,0 +1,47 @@ +#include + +struct natt_status { + /** The fdset to be selected upon to check for responses */ + fd_set fds; + + /** True if we've resolved an external IPv4 address */ + bool have_inet4; + + /** External IPv4 address */ + struct sockaddr_in ext_inet4_addr; + + /** True if we've resolved an external IPv6 address */ + bool have_inet6; + +#ifdef AF_INET6 + /** External IPv6 address */ + struct sockaddr_in6 ext_inet6_addr; +#endif + + /** Internal status (currently unused) */ + void *internal; +}; + +/** + * Initialize global NAT traversal structures (must be called once to use other + * functions) */ +void natt_init(void); + +/** Initialize a NAT traversal status object */ +bool natt_new(struct natt_status *status); + +/** Free a NAT traversal status object */ +void natt_free(struct natt_status *status); + +/** + * Make a port forwarding request. This may finish immediately or just send a + * request to the network. */ +bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen); + +/** + * Make a port forwarding request when only the port is known. Forwards any + * address it can find. */ +bool natt_open_port_any(struct natt_status *status, uint16_t port); + +/** Check for port forwarding responses */ +bool natt_read(struct natt_status *status); diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c new file mode 100644 index 0000000000..5f116a69cd --- /dev/null +++ b/libretro-common/net/net_natt.c @@ -0,0 +1,192 @@ +#include +#include +#include +#include + +#include +#include +#include + +#include + +#if HAVE_MINIUPNPC +#include +#include +#include + +static struct UPNPUrls urls; +static struct IGDdatas data; +#endif + +void natt_init(void) +{ +#if HAVE_MINIUPNPC + struct UPNPDev * devlist; + struct UPNPDev * dev; + char * descXML; + int descXMLsize = 0; + int upnperror = 0; + memset(&urls, 0, sizeof(struct UPNPUrls)); + memset(&data, 0, sizeof(struct IGDdatas)); + devlist = upnpDiscover(2000, NULL, NULL, 0, 0, &upnperror); + if (devlist) + { + dev = devlist; + while (dev) + { + if (strstr (dev->st, "InternetGatewayDevice")) + break; + dev = dev->pNext; + } + if (!dev) + dev = devlist; + + descXML = miniwget(dev->descURL, &descXMLsize, 0); + if (descXML) + { + parserootdesc (descXML, descXMLsize, &data); + free (descXML); descXML = 0; + GetUPNPUrls (&urls, &data, dev->descURL, 0); + } + freeUPNPDevlist(devlist); + } +#endif +} + +bool natt_new(struct natt_status *status) +{ + memset(status, 0, sizeof(struct natt_status)); + return true; +} + +void natt_free(struct natt_status *status) +{ + /* Nothing */ +} + +bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen) +{ +#if HAVE_MINIUPNPC + char host[PATH_MAX_LENGTH], ext_host[PATH_MAX_LENGTH], + port_str[6], ext_port_str[6]; + struct addrinfo hints = {0}, *ext_addrinfo; + int r; + + /* if NAT traversal is uninitialized or unavailable, oh well */ + if (!urls.controlURL[0]) + return false; + + /* figure out the internal info */ + if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, 0) != 0) + return false; + + /* add the port mapping */ + r = UPNP_AddAnyPortMapping(urls.controlURL, data.first.servicetype, port_str, + port_str, host, "retroarch", "TCP", NULL, "3600", ext_port_str); + if (r == 501 /* Action Failed */) + { + /* try the older AddPortMapping */ + memcpy(ext_port_str, port_str, 6); + r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, + port_str, host, "retroarch", "TCP", NULL, "3600"); + } + fprintf(stderr, "ERROR: %d\n", r); + if (r != 0) + return false; + + /* get the external IP */ + r = UPNP_GetExternalIPAddress(urls.controlURL, data.first.servicetype, ext_host); + if (r != 0) + return false; + + /* update the status */ + if (getaddrinfo_retro(ext_host, ext_port_str, &hints, &ext_addrinfo) != 0) + return false; + + if (ext_addrinfo->ai_family == AF_INET && + ext_addrinfo->ai_addrlen >= sizeof(struct sockaddr_in)) + { + status->have_inet4 = true; + status->ext_inet4_addr = *((struct sockaddr_in *) ext_addrinfo->ai_addr); + } +#ifdef AF_INET6 + else if (ext_addrinfo->ai_family == AF_INET6 && + ext_addrinfo->ai_addrlen >= sizeof(struct sockaddr_in6)) + { + status->have_inet6 = true; + status->ext_inet6_addr = *((struct sockaddr_in6 *) ext_addrinfo->ai_addr); + } + else + { + freeaddrinfo_retro(ext_addrinfo); + return false; + } +#endif + + return true; + +#else + return false; +#endif +} + +bool natt_open_port_any(struct natt_status *status, uint16_t port) +{ + struct net_ifinfo list; + bool ret = false; + size_t i; + struct addrinfo hints = {0}, *addr; + char port_str[6]; + + sprintf(port_str, "%hu", port); + + /* get our interfaces */ + if (!net_ifinfo_new(&list)) + return false; + + /* loop through them */ + for (i = 0; i < list.size; i++) + { + struct net_ifinfo_entry *entry = list.entries + i; + + /* ignore localhost */ + if (!strcmp(entry->host, "127.0.0.1") || !strcmp(entry->host, "::1")) + continue; + + /* make a request for this host */ + if (getaddrinfo_retro(entry->host, port_str, &hints, &addr) == 0) + { + ret = natt_open_port(status, addr->ai_addr, addr->ai_addrlen) || ret; + freeaddrinfo_retro(addr); + } + } + + /* BUGS! net_ifinfo_free(&list); */ + + return ret; +} + +bool natt_read(struct natt_status *status) +{ + /* MiniUPNPC is always synchronous, so there's nothing to read here. + * Reserved for future backends. */ + return false; +} + +#if 0 +/* If we want to remove redirects in the future, this is a sample of how to do + * that */ +void upnp_rem_redir (int port) +{ + char port_str[16]; + int t; + printf("TB : upnp_rem_redir (%d)\n", port); + if(urls.controlURL[0] == '\0') + { + printf("TB : the init was not done !\n"); + return; + } + sprintf(port_str, "%d", port); + UPNP_DeletePortMapping(urls.controlURL, data.first.servicetype, port_str, "TCP", NULL); +} +#endif diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 3d68a861a8..6d789eac9f 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -182,6 +182,10 @@ if [ "$HAVE_NETWORKING" = 'yes' ]; then fi HAVE_NETWORK_CMD=yes HAVE_NETWORKGAMEPAD=yes + + if [ "$HAVE_MINIUPNPC" != "no" ]; then + check_lib MINIUPNPC "-lminiupnpc" + fi else echo "Warning: All networking features have been disabled." HAVE_NETWORK_CMD='no' diff --git a/qb/config.params.sh b/qb/config.params.sh index 61d5a41861..9254edba6b 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -28,6 +28,7 @@ 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_MINIUPNPC=auto # Mini UPnP client library (for NAT traversal) HAVE_D3D9=yes # Direct3D 9 support HAVE_OPENGL=auto # OpenGL support HAVE_MALI_FBDEV=no # Mali fbdev context support From da406c3abb1dfef2c9cbf3149bb741ef40acc8df Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 21:09:47 -0500 Subject: [PATCH 033/638] Adding copyright headers and support for specifying protocol (TCP/UDP) --- libretro-common/include/net/net_natt.h | 34 ++++++++++++++++++++++++-- libretro-common/net/net_natt.c | 34 ++++++++++++++++++++++---- 2 files changed, 61 insertions(+), 7 deletions(-) diff --git a/libretro-common/include/net/net_natt.h b/libretro-common/include/net/net_natt.h index ec09780711..a4bbd29f00 100644 --- a/libretro-common/include/net/net_natt.h +++ b/libretro-common/include/net/net_natt.h @@ -1,4 +1,30 @@ +/* Copyright (C) 2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (net_natt.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_NET_NATT_H +#define _LIBRETRO_SDK_NET_NATT_H + #include +#include struct natt_status { /** The fdset to be selected upon to check for responses */ @@ -36,12 +62,16 @@ void natt_free(struct natt_status *status); /** * Make a port forwarding request. This may finish immediately or just send a * request to the network. */ -bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen); +bool natt_open_port(struct natt_status *status, struct sockaddr *addr, + socklen_t addrlen, enum socket_protocol proto); /** * Make a port forwarding request when only the port is known. Forwards any * address it can find. */ -bool natt_open_port_any(struct natt_status *status, uint16_t port); +bool natt_open_port_any(struct natt_status *status, uint16_t port, + enum socket_protocol proto); /** Check for port forwarding responses */ bool natt_read(struct natt_status *status); + +#endif diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 5f116a69cd..5bb6b380ee 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -1,3 +1,25 @@ +/* Copyright (C) 2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (net_natt.c). + * --------------------------------------------------------------------------------------- + * + * 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. + */ + #include #include #include @@ -64,11 +86,12 @@ void natt_free(struct natt_status *status) /* Nothing */ } -bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen) +bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen, enum socket_protocol proto) { #if HAVE_MINIUPNPC char host[PATH_MAX_LENGTH], ext_host[PATH_MAX_LENGTH], port_str[6], ext_port_str[6]; + const char *proto_str; struct addrinfo hints = {0}, *ext_addrinfo; int r; @@ -79,16 +102,17 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t /* figure out the internal info */ if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, 0) != 0) return false; + proto_str = (proto == SOCKET_PROTOCOL_UDP) ? "UDP" : "TCP"; /* add the port mapping */ r = UPNP_AddAnyPortMapping(urls.controlURL, data.first.servicetype, port_str, - port_str, host, "retroarch", "TCP", NULL, "3600", ext_port_str); + port_str, host, "retroarch", proto_str, NULL, "3600", ext_port_str); if (r == 501 /* Action Failed */) { /* try the older AddPortMapping */ memcpy(ext_port_str, port_str, 6); r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, - port_str, host, "retroarch", "TCP", NULL, "3600"); + port_str, host, "retroarch", proto_str, NULL, "3600"); } fprintf(stderr, "ERROR: %d\n", r); if (r != 0) @@ -130,7 +154,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t #endif } -bool natt_open_port_any(struct natt_status *status, uint16_t port) +bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_protocol proto) { struct net_ifinfo list; bool ret = false; @@ -156,7 +180,7 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port) /* make a request for this host */ if (getaddrinfo_retro(entry->host, port_str, &hints, &addr) == 0) { - ret = natt_open_port(status, addr->ai_addr, addr->ai_addrlen) || ret; + ret = natt_open_port(status, addr->ai_addr, addr->ai_addrlen, proto) || ret; freeaddrinfo_retro(addr); } } From 8f61e2b9788dcb3bf57e9b89fdb2d3da778d7011 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 21:16:04 -0500 Subject: [PATCH 034/638] Spacing correction (three spaces, not four) --- libretro-common/include/net/net_natt.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libretro-common/include/net/net_natt.h b/libretro-common/include/net/net_natt.h index a4bbd29f00..f50f6fa45f 100644 --- a/libretro-common/include/net/net_natt.h +++ b/libretro-common/include/net/net_natt.h @@ -27,25 +27,25 @@ #include struct natt_status { - /** The fdset to be selected upon to check for responses */ - fd_set fds; + /** The fdset to be selected upon to check for responses */ + fd_set fds; - /** True if we've resolved an external IPv4 address */ - bool have_inet4; + /** True if we've resolved an external IPv4 address */ + bool have_inet4; - /** External IPv4 address */ - struct sockaddr_in ext_inet4_addr; + /** External IPv4 address */ + struct sockaddr_in ext_inet4_addr; - /** True if we've resolved an external IPv6 address */ - bool have_inet6; + /** True if we've resolved an external IPv6 address */ + bool have_inet6; #ifdef AF_INET6 - /** External IPv6 address */ - struct sockaddr_in6 ext_inet6_addr; + /** External IPv6 address */ + struct sockaddr_in6 ext_inet6_addr; #endif - /** Internal status (currently unused) */ - void *internal; + /** Internal status (currently unused) */ + void *internal; }; /** From 50ec1bc9cdc07350481eadb98c30eb61843ad9b5 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 21:16:25 -0500 Subject: [PATCH 035/638] Add NAT traversal code to griffin --- griffin/griffin.c | 1 + 1 file changed, 1 insertion(+) diff --git a/griffin/griffin.c b/griffin/griffin.c index b57420f4a5..4785559281 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -879,6 +879,7 @@ NETPLAY #include "../libretro-common/net/net_compat.c" #include "../libretro-common/net/net_socket.c" #include "../libretro-common/net/net_http.c" +#include "../libretro-common/net/net_nett.c" #ifndef HAVE_SOCKET_LEGACY #include "../libretro-common/net/net_ifinfo.c" #endif From 48240c2806bd612f716440d842676c64fb0c402a Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 22:18:37 -0500 Subject: [PATCH 036/638] Adding Netplay NAT traversal option (but not implementation yet) --- configuration.c | 3 ++- configuration.h | 1 + intl/msg_hash_us.c | 6 ++++++ intl/msg_hash_us.h | 2 ++ menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 15 +++++++++++++++ msg_hash.h | 1 + 7 files changed, 31 insertions(+), 1 deletion(-) diff --git a/configuration.c b/configuration.c index 9256fde0b9..e1e6964bdd 100644 --- a/configuration.c +++ b/configuration.c @@ -799,6 +799,7 @@ static int populate_settings_bool(settings_t *settings, struct config_bool_setti #endif #ifdef HAVE_NETWORKING SETTING_BOOL("netplay_spectator_mode_enable",&settings->netplay.is_spectate, false, false /* TODO */, false); + SETTING_BOOL("netplay_nat_traversal", &settings->netplay.nat_traversal, true, true, false); #endif SETTING_BOOL("block_sram_overwrite", &settings->block_sram_overwrite, true, block_sram_overwrite, false); SETTING_BOOL("savestate_auto_index", &settings->savestate_auto_index, true, savestate_auto_index, false); @@ -921,7 +922,7 @@ static int populate_settings_int(settings_t *settings, struct config_int_setting #ifdef HAVE_NETWORKING SETTING_INT("netplay_ip_port", &settings->netplay.port, false, 0 /* TODO */, false); SETTING_INT("netplay_delay_frames", &settings->netplay.sync_frames, true, 16, false); - SETTING_INT("netplay_check_frames", &settings->netplay.check_frames, false, 30, false); + SETTING_INT("netplay_check_frames", &settings->netplay.check_frames, true, 30, false); #endif #ifdef HAVE_LANGEXTRA SETTING_INT("user_language", &settings->user_language, true, RETRO_LANGUAGE_ENGLISH, false); diff --git a/configuration.h b/configuration.h index bef8bbb67e..10ad4b7d17 100644 --- a/configuration.h +++ b/configuration.h @@ -403,6 +403,7 @@ typedef struct settings unsigned check_frames; bool is_spectate; bool swap_input; + bool nat_traversal; } netplay; #endif diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index d5abdde020..e15ac8cee9 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -1548,6 +1548,12 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) "no checks. This value is only used on the \n" "netplay host. \n"); break; + case MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL: + snprintf(s, len, + "When hosting, attempt to listen for\n" + "connections from the public internet, using\n" + "UPnP or similar technologies to escape LANs. \n"); + break; case MENU_ENUM_LABEL_VIDEO_MAX_SWAPCHAIN_IMAGES: snprintf(s, len, "Maximum amount of swapchain images. This \n" diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 8240988031..a70808f908 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -920,6 +920,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_SPECTATOR_MODE_ENABLE, "Netplay Spectator Enable") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_TCP_UDP_PORT, "Netplay TCP/UDP Port") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NAT_TRAVERSAL, + "Netplay NAT Traversal") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_ENABLE, "Network Commands") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETWORK_CMD_PORT, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 2a3868681f..4d0e99f658 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4942,6 +4942,10 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_NETPLAY_CLIENT_SWAP_INPUT, PARSE_ONLY_BOOL, false) != -1) count++; + if (menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL, + PARSE_ONLY_BOOL, false) != -1) + count++; if (menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_NETWORK_CMD_ENABLE, PARSE_ONLY_BOOL, false) != -1) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 651f4a2aa5..3dec0627f0 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5583,6 +5583,21 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE); + CONFIG_BOOL( + list, list_info, + &settings->netplay.is_spectate, + MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL, + MENU_ENUM_LABEL_VALUE_NETPLAY_NAT_TRAVERSAL, + false, + MENU_ENUM_LABEL_VALUE_OFF, + MENU_ENUM_LABEL_VALUE_ON, + &group_info, + &subgroup_info, + parent_group, + general_write_handler, + general_read_handler, + SD_FLAG_NONE); + CONFIG_BOOL( list, list_info, &settings->netplay.swap_input, diff --git a/msg_hash.h b/msg_hash.h index 8e5477a7c0..702453f0ec 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -974,6 +974,7 @@ enum msg_hash_enums MENU_LABEL(NETPLAY_CHECK_FRAMES), MENU_LABEL(NETPLAY_SPECTATOR_MODE_ENABLE), MENU_LABEL(NETPLAY_TCP_UDP_PORT), + MENU_LABEL(NETPLAY_NAT_TRAVERSAL), MENU_LABEL(SORT_SAVEFILES_ENABLE), MENU_LABEL(SORT_SAVESTATES_ENABLE), MENU_LABEL(NETPLAY_IP_ADDRESS), From 1b3789edde8956614dc6341220908de11324bd7d Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 22:21:44 -0500 Subject: [PATCH 037/638] better firmware checking --- menu/cbs/menu_cbs_ok.c | 8 -------- runloop.c | 21 +++++++++++++++++---- runloop.h | 2 ++ tasks/task_content.c | 9 +++++++++ 4 files changed, 28 insertions(+), 12 deletions(-) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 5a7e307929..861831824d 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -856,14 +856,6 @@ static int generic_action_ok_file_load(const char *corepath, const char *fullpat content_ctx_info_t content_info = {0}; settings_t *settings = config_get_ptr(); - if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL) - && !string_is_empty(settings->directory.system) - && content_enum_idx == CONTENT_MODE_LOAD_CONTENT_WITH_CURRENT_CORE_FROM_MENU) - { - runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 200, 100, true); - RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); - return 0; - } if (!task_push_content_load_default( corepath, fullpath, &content_info, diff --git a/runloop.c b/runloop.c index 721aeed46d..5c614f9789 100644 --- a/runloop.c +++ b/runloop.c @@ -140,11 +140,24 @@ void update_firmware_status() core_info_t *core_info = NULL; settings_t *settings = config_get_ptr(); core_info_ctx_firmware_t firmware_info; - core_info_get_current_core(&core_info); - firmware_info.path = core_info->path; - firmware_info.directory.system = settings->directory.system; - core_info_list_update_missing_firmware(&firmware_info); + + if (core_info && settings) + { + firmware_info.path = core_info->path; + if (!string_is_empty(settings->directory.system)) + firmware_info.directory.system = settings->directory.system; + else + { + char s[PATH_MAX_LENGTH]; + strlcpy(s, path_get(RARCH_PATH_CONTENT) ,sizeof(s)); + path_basedir(s); + firmware_info.directory.system = s; + } + RARCH_LOG("Updating firmware status for: %s on %s\n", core_info->path, + firmware_info.directory.system); + core_info_list_update_missing_firmware(&firmware_info); + } } void runloop_msg_queue_push(const char *msg, diff --git a/runloop.h b/runloop.h index 35fada6eb1..76fb50a6ce 100644 --- a/runloop.h +++ b/runloop.h @@ -223,6 +223,8 @@ char* runloop_msg_queue_pull(void); bool runloop_ctl(enum runloop_ctl_state state, void *data); +void update_firmware_status(); + RETRO_END_DECLS #endif diff --git a/tasks/task_content.c b/tasks/task_content.c index 343ba346f1..0483686318 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1241,6 +1241,9 @@ bool task_push_content_load_default( #endif case CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU: + update_firmware_status(); + if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL)) + goto skip; if (!task_load_content(content_info, loading_from_menu, mode)) goto error; break; @@ -1289,4 +1292,10 @@ error: } #endif return false; + +skip: + runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 1000, true); + RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); + + return true; } From 4f760352f4b5669946bc82ccacd759bfc5e08c8a Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 22:23:15 -0500 Subject: [PATCH 038/638] don't show the message for ten seconds --- tasks/task_content.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index 0483686318..b15dc86236 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1294,7 +1294,7 @@ error: return false; skip: - runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 1000, true); + runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 500, true); RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); return true; From 17dc79a00281adcc75e9d1d9046bb1f736cdb9fe Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 30 Nov 2016 04:32:59 +0100 Subject: [PATCH 039/638] Buildfixes/silence unused variable warnings --- input/drivers/cocoa_input.c | 3 +++ menu/cbs/menu_cbs_ok.c | 1 - 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/input/drivers/cocoa_input.c b/input/drivers/cocoa_input.c index bb113e3704..2d8d2682c5 100644 --- a/input/drivers/cocoa_input.c +++ b/input/drivers/cocoa_input.c @@ -150,6 +150,9 @@ static void cocoa_input_poll(void *data) #ifndef IOS float backing_scale_factor = get_backing_scale_factor(); #endif + + if (!apple) + return; for (i = 0; i < apple->touch_count; i++) { diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 861831824d..1d3a749b41 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -854,7 +854,6 @@ static int generic_action_ok_file_load(const char *corepath, const char *fullpat enum rarch_core_type action_type, enum content_mode_load content_enum_idx) { content_ctx_info_t content_info = {0}; - settings_t *settings = config_get_ptr(); if (!task_push_content_load_default( corepath, fullpath, From 7d4b159fe9e2ec30a23331310058e589c2708b97 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Nov 2016 04:35:06 +0100 Subject: [PATCH 040/638] Typo fix --- dynamic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic.c b/dynamic.c index eb2e964ffa..f93e8a8864 100644 --- a/dynamic.c +++ b/dynamic.c @@ -215,7 +215,7 @@ static bool load_dynamic_core(void) /* Try to verify that -lretro was not linked in from other modules * since loading it dynamically and with -l will fail hard. */ RARCH_ERR("Serious problem. RetroArch wants to load libretro cores" - "dyamically, but it is already linked.\n"); + "dynamically, but it is already linked.\n"); RARCH_ERR("This could happen if other modules RetroArch depends on " "link against libretro directly.\n"); RARCH_ERR("Proceeding could cause a crash. Aborting ...\n"); From 42da0a01845be4769b699ba1965ae8dc491cf56a Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 22:59:46 -0500 Subject: [PATCH 041/638] NAT traversal in Netplay For the time being, if NAT traversal is successful it simply announces it as an OSD message. In the future it will be used to inform a matchmaking server of the public port. This patch also included minor fixes to the NAT traversal implementation to make the select it demands actually doable. --- intl/msg_hash_us.h | 4 ++ libretro-common/include/net/net_natt.h | 6 ++ msg_hash.h | 1 + network/netplay/netplay.c | 83 ++++++++++++++++++++++++-- network/netplay/netplay.h | 3 +- network/netplay/netplay_net.c | 14 +++++ network/netplay/netplay_private.h | 4 ++ 7 files changed, 108 insertions(+), 7 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index a70808f908..9e865016d2 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -22,6 +22,10 @@ MSG_HASH( MSG_GOT_CONNECTION_FROM, "Got connection from" ) +MSG_HASH( + MSG_PUBLIC_ADDRESS, + "Public address" + ) MSG_HASH( MSG_NO_ARGUMENTS_SUPPLIED_AND_NO_MENU_BUILTIN, "No arguments supplied and no menu builtin, displaying help..." diff --git a/libretro-common/include/net/net_natt.h b/libretro-common/include/net/net_natt.h index f50f6fa45f..bb9c791f61 100644 --- a/libretro-common/include/net/net_natt.h +++ b/libretro-common/include/net/net_natt.h @@ -27,9 +27,15 @@ #include struct natt_status { + /** nfds for select when checking for input */ + int nfds; + /** The fdset to be selected upon to check for responses */ fd_set fds; + /** True if there might be a request outstanding */ + bool request_outstanding; + /** True if we've resolved an external IPv4 address */ bool have_inet4; diff --git a/msg_hash.h b/msg_hash.h index 702453f0ec..089559365e 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -173,6 +173,7 @@ enum msg_hash_enums MSG_NO_STATE_HAS_BEEN_LOADED_YET, MSG_GOT_CONNECTION_FROM, MSG_CONNECTION_SLOT, + MSG_PUBLIC_ADDRESS, MSG_NO_SAVE_STATE_HAS_BEEN_OVERWRITTEN_YET, MSG_CANNOT_INFER_NEW_CONFIG_PATH, MSG_UNDID_LOAD_STATE, diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 074b70e6ea..b2d33088f3 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -63,6 +63,8 @@ static netplay_t *netplay_data = NULL; /* Used to avoid recursive netplay calls */ static bool in_netplay = false; +static void announce_nat_traversal(netplay_t *netplay); + static int init_tcp_connection(const struct addrinfo *res, bool server, bool spectate, struct sockaddr *other_addr, socklen_t addr_size) @@ -172,6 +174,22 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, return ret; } +static void init_nat_traversal(netplay_t *netplay) +{ + natt_init(); + + if (!natt_new(&netplay->nat_traversal_state)) + { + netplay->nat_traversal = false; + return; + } + + natt_open_port_any(&netplay->nat_traversal_state, netplay->tcp_port, SOCKET_PROTOCOL_TCP); + + if (!netplay->nat_traversal_state.request_outstanding) + announce_nat_traversal(netplay); +} + static bool init_ad_socket(netplay_t *netplay, uint16_t port) { int fd = socket_init((void**)&netplay->addr, port, NULL, SOCKET_TYPE_DATAGRAM); @@ -202,6 +220,9 @@ static bool init_socket(netplay_t *netplay, const char *server, uint16_t port) if (!init_tcp_socket(netplay, server, port, netplay->spectate.enabled)) return false; + if (netplay->is_server && netplay->nat_traversal) + init_nat_traversal(netplay); + return true; } @@ -1047,6 +1068,36 @@ void netplay_log_connection(const struct sockaddr_storage *their_addr, #endif +static void announce_nat_traversal(netplay_t *netplay) +{ + char msg[512], host[PATH_MAX_LENGTH], port[6]; + + if (netplay->nat_traversal_state.have_inet4) + { + if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet4_addr, + sizeof(struct sockaddr_in), + host, PATH_MAX_LENGTH, port, 6, 0) != 0) + return; + + } +#ifdef AF_INET6 + else if (netplay->nat_traversal_state.have_inet6) + { + if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet6_addr, + sizeof(struct sockaddr_in6), + host, PATH_MAX_LENGTH, port, 6, 0) != 0) + return; + + } +#endif + else return; + + snprintf(msg, sizeof(msg), "%s: %s:%s\n", + msg_hash_to_str(MSG_PUBLIC_ADDRESS), + host, port); + runloop_msg_queue_push(msg, 1, 180, false); + RARCH_LOG("%s\n", msg); +} bool netplay_try_init_serialization(netplay_t *netplay) @@ -1166,6 +1217,7 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) * @check_frames : Frequency with which to check CRCs. * @cb : Libretro callbacks. * @spectate : If true, enable spectator mode. + * @nat_traversal : If true, attempt NAT traversal. * @nick : Nickname of user. * @quirks : Netplay quirks required for this session. * @@ -1174,10 +1226,9 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) * * Returns: new netplay handle. **/ -netplay_t *netplay_new(const char *server, uint16_t port, - unsigned frames, unsigned check_frames, - const struct retro_callbacks *cb, - bool spectate, const char *nick, uint64_t quirks) +netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, + unsigned check_frames, const struct retro_callbacks *cb, bool spectate, + bool nat_traversal, const char *nick, uint64_t quirks) { netplay_t *netplay = (netplay_t*)calloc(1, sizeof(*netplay)); if (!netplay) @@ -1189,6 +1240,7 @@ netplay_t *netplay_new(const char *server, uint16_t port, netplay->port = server ? 0 : 1; netplay->spectate.enabled = spectate; netplay->is_server = server == NULL; + netplay->nat_traversal = netplay->is_server ? nat_traversal : false; netplay->stall_frames = frames; netplay->check_frames = check_frames; netplay->quirks = quirks; @@ -1324,6 +1376,9 @@ void netplay_free(netplay_t *netplay) free(netplay->spectate.input); } + if (netplay->nat_traversal) + natt_free(&netplay->nat_traversal_state); + if (netplay->buffer) { for (i = 0; i < netplay->buffer_size; i++) @@ -1369,11 +1424,26 @@ bool netplay_pre_frame(netplay_t *netplay) netplay_try_init_serialization(netplay); } - /* Advertise our server if applicable */ if (netplay->is_server) { + /* Advertise our server if applicable */ if (netplay_ad_fd >= 0 || init_ad_socket(netplay, RARCH_DEFAULT_PORT)) netplay_ad_server(netplay, netplay_ad_fd); + + /* NAT traversal if applicable */ + if (netplay->nat_traversal && + netplay->nat_traversal_state.request_outstanding && + !netplay->nat_traversal_state.have_inet4) + { + struct timeval tmptv = {0}; + fd_set fds = netplay->nat_traversal_state.fds; + if (socket_select(netplay->nat_traversal_state.nfds, &fds, NULL, NULL, &tmptv) > 0) + natt_read(&netplay->nat_traversal_state); + + if (!netplay->nat_traversal_state.request_outstanding || + netplay->nat_traversal_state.have_inet4) + announce_nat_traversal(netplay); + } } if (!netplay->net_cbs->pre_frame(netplay)) @@ -1599,7 +1669,8 @@ bool init_netplay(bool is_spectate, const char *server, unsigned port) netplay_is_client ? server : NULL, port ? port : RARCH_DEFAULT_PORT, settings->netplay.sync_frames, settings->netplay.check_frames, &cbs, - is_spectate, settings->username, quirks); + is_spectate, settings->netplay.nat_traversal, settings->username, + quirks); if (netplay_data) return true; diff --git a/network/netplay/netplay.h b/network/netplay/netplay.h index 83b41b69a1..b1470bb96b 100644 --- a/network/netplay/netplay.h +++ b/network/netplay/netplay.h @@ -137,6 +137,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); * @check_frames : Frequency with which to check CRCs. * @cb : Libretro callbacks. * @spectate : If true, enable spectator mode. + * @nat_traversal : If true, attempt NAT traversal. * @nick : Nickname of user. * @quirks : Netplay quirks. * @@ -147,7 +148,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); **/ netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, unsigned check_frames, - const struct retro_callbacks *cb, bool spectate, + const struct retro_callbacks *cb, bool spectate, bool nat_traversal, const char *nick, uint64_t quirks); /** diff --git a/network/netplay/netplay_net.c b/network/netplay/netplay_net.c index c594587e0f..cc6e409fc6 100644 --- a/network/netplay/netplay_net.c +++ b/network/netplay/netplay_net.c @@ -20,6 +20,7 @@ #include #include +#include #include "netplay_private.h" @@ -337,6 +338,19 @@ static bool netplay_net_info_cb(netplay_t* netplay, unsigned frames) netplay->has_connection = true; } + { + struct natt_status status; + natt_init(); + if (natt_new(&status) && natt_open_port_any(&status, netplay->tcp_port, SOCKET_PROTOCOL_TCP)) + { + fprintf(stderr, "Forwarded to %d!\n", status.ext_inet4_addr.sin_port); + } + else + { + fprintf(stderr, "Forwarding failed :(\n"); + } + } + return true; } diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index 40689561c0..9318a70681 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -20,6 +20,7 @@ #include "netplay.h" #include +#include #include #include #include @@ -124,6 +125,9 @@ struct netplay int fd; /* TCP port (if serving) */ uint16_t tcp_port; + /* NAT traversal info (if NAT traversal is used and serving) */ + bool nat_traversal; + struct natt_status nat_traversal_state; /* Which port is governed by netplay (other user)? */ unsigned port; bool has_connection; From d3e4c1278a794ab12b3d309d5000ccba8cd828fd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Nov 2016 05:00:04 +0100 Subject: [PATCH 042/638] Add whitespace --- dynamic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dynamic.c b/dynamic.c index f93e8a8864..a375c92267 100644 --- a/dynamic.c +++ b/dynamic.c @@ -215,7 +215,7 @@ static bool load_dynamic_core(void) /* Try to verify that -lretro was not linked in from other modules * since loading it dynamically and with -l will fail hard. */ RARCH_ERR("Serious problem. RetroArch wants to load libretro cores" - "dynamically, but it is already linked.\n"); + " dynamically, but it is already linked.\n"); RARCH_ERR("This could happen if other modules RetroArch depends on " "link against libretro directly.\n"); RARCH_ERR("Proceeding could cause a crash. Aborting ...\n"); From 7197be5a0dcdbbe2fc2ab033bfcd934c719584a5 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 30 Nov 2016 05:06:50 +0100 Subject: [PATCH 043/638] (OSX) Prevent crash --- input/drivers_joypad/hid_joypad.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/input/drivers_joypad/hid_joypad.c b/input/drivers_joypad/hid_joypad.c index 988f05d842..1340638f24 100644 --- a/input/drivers_joypad/hid_joypad.c +++ b/input/drivers_joypad/hid_joypad.c @@ -38,7 +38,12 @@ static bool hid_joypad_query_pad(unsigned pad) static void hid_joypad_free(void) { - generic_hid->free((void*)hid_driver_get_data()); + if (!generic_hid) + return; + + if (generic_hid->free) + generic_hid->free((void*)hid_driver_get_data()); + generic_hid = NULL; } From c342c103aed089345182bdeee2633520e594272b Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:08:26 -0500 Subject: [PATCH 044/638] Always get numeric host/ports instead of names. --- libretro-common/net/net_natt.c | 2 +- network/netplay/netplay.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 5bb6b380ee..6c37fa225d 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -100,7 +100,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t return false; /* figure out the internal info */ - if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, 0) != 0) + if (getnameinfo(addr, addrlen, host, PATH_MAX_LENGTH, port_str, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return false; proto_str = (proto == SOCKET_PROTOCOL_UDP) ? "UDP" : "TCP"; diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index b2d33088f3..5bf7bdaf58 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1076,7 +1076,7 @@ static void announce_nat_traversal(netplay_t *netplay) { if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet4_addr, sizeof(struct sockaddr_in), - host, PATH_MAX_LENGTH, port, 6, 0) != 0) + host, PATH_MAX_LENGTH, port, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return; } @@ -1085,7 +1085,7 @@ static void announce_nat_traversal(netplay_t *netplay) { if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet6_addr, sizeof(struct sockaddr_in6), - host, PATH_MAX_LENGTH, port, 6, 0) != 0) + host, PATH_MAX_LENGTH, port, 6, NI_NUMERICHOST|NI_NUMERICSERV) != 0) return; } From 025993231fb6f09b2fed1d4c2dcda862b6c5ea5e Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:08:48 -0500 Subject: [PATCH 045/638] Use net_ifinfo how it's intended (?) to be used --- libretro-common/net/net_natt.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 6c37fa225d..2fb9dbe2eb 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -156,7 +156,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_protocol proto) { - struct net_ifinfo list; + struct net_ifinfo *list; bool ret = false; size_t i; struct addrinfo hints = {0}, *addr; @@ -165,13 +165,15 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p sprintf(port_str, "%hu", port); /* get our interfaces */ - if (!net_ifinfo_new(&list)) + if ((list = calloc(1, sizeof(struct net_ifinfo))) == NULL) + return false; + if (!net_ifinfo_new(list)) return false; /* loop through them */ - for (i = 0; i < list.size; i++) + for (i = 0; i < list->size; i++) { - struct net_ifinfo_entry *entry = list.entries + i; + struct net_ifinfo_entry *entry = list->entries + i; /* ignore localhost */ if (!strcmp(entry->host, "127.0.0.1") || !strcmp(entry->host, "::1")) @@ -185,7 +187,8 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p } } - /* BUGS! net_ifinfo_free(&list); */ + /* This really shouldn't free list, but does */ + net_ifinfo_free(list); return ret; } From 2522f688707a5cf72d3a60be62039d1f6c897fbb Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:10:19 -0500 Subject: [PATCH 046/638] C++ fixes --- libretro-common/net/net_natt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 2fb9dbe2eb..ea3a32a539 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -63,7 +63,7 @@ void natt_init(void) if (!dev) dev = devlist; - descXML = miniwget(dev->descURL, &descXMLsize, 0); + descXML = (char *) miniwget(dev->descURL, &descXMLsize, 0); if (descXML) { parserootdesc (descXML, descXMLsize, &data); @@ -165,7 +165,7 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p sprintf(port_str, "%hu", port); /* get our interfaces */ - if ((list = calloc(1, sizeof(struct net_ifinfo))) == NULL) + if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL) return false; if (!net_ifinfo_new(list)) return false; From ce2fbbdbe22f602dea1bde497ef1694e4fb89033 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Nov 2016 05:12:28 +0100 Subject: [PATCH 047/638] (hid_joypad.c) Prevent null pointer dereferences --- input/drivers_joypad/hid_joypad.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/input/drivers_joypad/hid_joypad.c b/input/drivers_joypad/hid_joypad.c index 1340638f24..fb504698da 100644 --- a/input/drivers_joypad/hid_joypad.c +++ b/input/drivers_joypad/hid_joypad.c @@ -18,7 +18,7 @@ #include "../input_hid_driver.h" #include "../input_driver.h" -static const hid_driver_t *generic_hid; +static const hid_driver_t *generic_hid = NULL; static bool hid_joypad_init(void *data) { @@ -33,7 +33,9 @@ static bool hid_joypad_init(void *data) static bool hid_joypad_query_pad(unsigned pad) { - return generic_hid->query_pad((void*)hid_driver_get_data(), pad); + if (generic_hid && generic_hid->query_pad) + return generic_hid->query_pad((void*)hid_driver_get_data(), pad); + return false; } static void hid_joypad_free(void) @@ -49,28 +51,37 @@ static void hid_joypad_free(void) static bool hid_joypad_button(unsigned port, uint16_t joykey) { - return generic_hid->button((void*)hid_driver_get_data(), port, joykey); + if (generic_hid && generic_hid->button) + return generic_hid->button((void*)hid_driver_get_data(), port, joykey); + return false; } static uint64_t hid_joypad_get_buttons(unsigned port) { - return generic_hid->get_buttons((void*)hid_driver_get_data(), port); + if (generic_hid && generic_hid->get_buttons) + return generic_hid->get_buttons((void*)hid_driver_get_data(), port); + return 0; } static int16_t hid_joypad_axis(unsigned port, uint32_t joyaxis) { - return generic_hid->axis((void*)hid_driver_get_data(), port, joyaxis); + if (generic_hid && generic_hid->axis) + return generic_hid->axis((void*)hid_driver_get_data(), port, joyaxis); + return 0; } static void hid_joypad_poll(void) { - generic_hid->poll((void*)hid_driver_get_data()); + if (generic_hid && generic_hid->poll) + generic_hid->poll((void*)hid_driver_get_data()); } static bool hid_joypad_rumble(unsigned pad, enum retro_rumble_effect effect, uint16_t strength) { - return generic_hid->set_rumble((void*)hid_driver_get_data(), pad, effect, strength); + if (generic_hid && generic_hid->set_rumble) + return generic_hid->set_rumble((void*)hid_driver_get_data(), pad, effect, strength); + return false; } static const char *hid_joypad_name(unsigned pad) From 2e7821e337ca9da422c64f7d0a198b33042e84a8 Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 23:22:22 -0500 Subject: [PATCH 048/638] add a toggle to the firmware check so it can be overruled --- config.def.h | 2 +- configuration.c | 1 + configuration.h | 1 + intl/msg_hash_chs.c | 10 ++++++++++ intl/msg_hash_eo.h | 4 ++++ intl/msg_hash_fr.h | 4 ++++ intl/msg_hash_ja.c | 10 ++++++++++ intl/msg_hash_ja.h | 4 ++++ intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_nl.h | 4 ++++ intl/msg_hash_ru.h | 4 ++++ intl/msg_hash_us.c | 10 ++++++++++ intl/msg_hash_us.h | 6 ++++++ intl/msg_hash_vn.c | 10 ++++++++++ menu/cbs/menu_cbs_sublabel.c | 4 ++++ menu/menu_displaylist.c | 3 +++ menu/menu_setting.c | 16 +++++++++++----- msg_hash.h | 1 + tasks/task_content.c | 6 ++++-- 19 files changed, 94 insertions(+), 8 deletions(-) diff --git a/config.def.h b/config.def.h index 7320a71d71..9afa317c8c 100644 --- a/config.def.h +++ b/config.def.h @@ -437,7 +437,7 @@ static const bool load_dummy_on_core_shutdown = false; #else static const bool load_dummy_on_core_shutdown = true; #endif - +static const bool check_firmware_before_loading = true; /* Forcibly disable composition. * Only valid on Windows Vista/7/8 for now. */ static const bool disable_composition = false; diff --git a/configuration.c b/configuration.c index 9256fde0b9..c727ed3dd5 100644 --- a/configuration.c +++ b/configuration.c @@ -699,6 +699,7 @@ static int populate_settings_bool(settings_t *settings, struct config_bool_setti SETTING_BOOL("input_descriptor_label_show", &settings->input.input_descriptor_label_show, true, input_descriptor_label_show, false); SETTING_BOOL("input_descriptor_hide_unbound", &settings->input.input_descriptor_hide_unbound, true, input_descriptor_hide_unbound, false); SETTING_BOOL("load_dummy_on_core_shutdown", &settings->load_dummy_on_core_shutdown, true, load_dummy_on_core_shutdown, false); + SETTING_BOOL("check_firmware_before_loading", &settings->check_firmware_before_loading, true, check_firmware_before_loading, false); SETTING_BOOL("builtin_mediaplayer_enable", &settings->multimedia.builtin_mediaplayer_enable, false, false /* TODO */, false); SETTING_BOOL("builtin_imageviewer_enable", &settings->multimedia.builtin_imageviewer_enable, true, true, false); SETTING_BOOL("fps_show", &settings->fps_show, true, false, false); diff --git a/configuration.h b/configuration.h index bef8bbb67e..fc52188ea4 100644 --- a/configuration.h +++ b/configuration.h @@ -440,6 +440,7 @@ typedef struct settings #endif bool fps_show; bool load_dummy_on_core_shutdown; + bool check_firmware_before_loading; bool game_specific_options; bool auto_overrides_enable; diff --git a/intl/msg_hash_chs.c b/intl/msg_hash_chs.c index 9b83e5dee7..524e028390 100644 --- a/intl/msg_hash_chs.c +++ b/intl/msg_hash_chs.c @@ -346,6 +346,16 @@ int menu_hash_get_help_chs_enum(enum msg_hash_enums msg, char *s, size_t len) "inside the menu and RetroArch won't \n" "shutdown."); break; + case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE: + snprintf(s, len, + "Some cores might need \n" + "firmware or bios files. \n" + " \n" + "If this option is disabled, \n" + "it will try to load even if such \n" + "firmware is missing. \n" + "down. \n"); + break; case MENU_ENUM_LABEL_PARENT_DIRECTORY: snprintf(s, len, "回到上级目录。"); diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 0fb82b102e..2de206143c 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -2152,6 +2152,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index c6e6c6a73e..62fbcc4d50 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -2118,6 +2118,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_ja.c b/intl/msg_hash_ja.c index cbeca862ac..c837e53cbd 100644 --- a/intl/msg_hash_ja.c +++ b/intl/msg_hash_ja.c @@ -354,6 +354,16 @@ int menu_hash_get_help_jp_enum(enum msg_hash_enums msg, char *s, size_t len) "inside the menu and RetroArch won't \n" "shutdown."); break; + case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE: + snprintf(s, len, + "Some cores might need \n" + "firmware or bios files. \n" + " \n" + "If this option is disabled, \n" + "it will try to load even if such \n" + "firmware is missing. \n" + "down. \n"); + break; case MENU_ENUM_LABEL_PARENT_DIRECTORY: snprintf(s, len, "Go back to the parent directory."); diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index c0134c711a..e06ed3f55e 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -2144,6 +2144,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 58ff4d78dc..a553a2e312 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -328,6 +328,8 @@ MSG_HASH(MENU_ENUM_LABEL_DPI_OVERRIDE_VALUE, "dpi_override_value") MSG_HASH(MENU_ENUM_LABEL_DRIVER_SETTINGS, "driver_settings") +MSG_HASH(MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE, + "check_for_missing_firmware") MSG_HASH(MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN, "dummy_on_core_shutdown") MSG_HASH(MENU_ENUM_LABEL_DYNAMIC_WALLPAPER, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index a82c44b7a1..fbbba7b8d1 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -2152,6 +2152,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 26f1dc3c97..8fc44eeefa 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -2146,6 +2146,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_us.c b/intl/msg_hash_us.c index d5abdde020..1379a72a7d 100644 --- a/intl/msg_hash_us.c +++ b/intl/msg_hash_us.c @@ -355,6 +355,16 @@ int menu_hash_get_help_us_enum(enum msg_hash_enums msg, char *s, size_t len) "inside the menu and RetroArch won't \n" "shutdown."); break; + case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE: + snprintf(s, len, + "Some cores might need \n" + "firmware or bios files. \n" + " \n" + "If this option is disabled, \n" + "it will try to load even if such \n" + "firmware is missing. \n" + "down. \n"); + break; case MENU_ENUM_LABEL_PARENT_DIRECTORY: snprintf(s, len, "Go back to the parent directory."); diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 9bc408784a..41c5878965 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -522,6 +522,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DRIVER_SETTINGS, "Driver") MSG_HASH(MENU_ENUM_LABEL_VALUE_DUMMY_ON_CORE_SHUTDOWN, "Load Dummy on Core Shutdown") +MSG_HASH(MENU_ENUM_LABEL_VALUE_CHECK_FOR_MISSING_FIRMWARE, + "Check for Missing Firmware Before Loading") MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPER, "Dynamic Wallpaper") MSG_HASH(MENU_ENUM_LABEL_VALUE_DYNAMIC_WALLPAPERS_DIRECTORY, @@ -2152,6 +2154,10 @@ MSG_HASH( MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN, "Some cores might have a shutdown feature. If enabled, it will prevent the core from shutting RetroArch down. Instead, it loads a dummy core." ) +MSG_HASH( + MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE, + "Check if all the required firmware is present before attempting to load content." + ) MSG_HASH( MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE, "Vertical refresh rate of your monitor. Used to calculate a suitable audio input rate. NOTE: This will be ignored if 'Threaded Video' is enabled." diff --git a/intl/msg_hash_vn.c b/intl/msg_hash_vn.c index 27fc34a523..ae666a994a 100644 --- a/intl/msg_hash_vn.c +++ b/intl/msg_hash_vn.c @@ -355,6 +355,16 @@ int menu_hash_get_help_vn_enum(enum msg_hash_enums msg, char *s, size_t len) "inside the menu and RetroArch won't \n" "shutdown."); break; + case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE: + snprintf(s, len, + "Some cores might need \n" + "firmware or bios files. \n" + " \n" + "If this option is disabled, \n" + "it will try to load even if such \n" + "firmware is missing. \n" + "down. \n"); + break; case MENU_ENUM_LABEL_PARENT_DIRECTORY: snprintf(s, len, "Go back to the parent thư mục."); diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index 7a5a65789a..f6ba1bb147 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -101,6 +101,7 @@ default_sublabel_macro(action_bind_sublabel_input_duty_cycle, MENU_ default_sublabel_macro(action_bind_sublabel_video_vertical_sync, MENU_ENUM_SUBLABEL_VIDEO_VSYNC) default_sublabel_macro(action_bind_sublabel_core_allow_rotate, MENU_ENUM_SUBLABEL_VIDEO_ALLOW_ROTATE) default_sublabel_macro(action_bind_sublabel_dummy_on_core_shutdown, MENU_ENUM_SUBLABEL_DUMMY_ON_CORE_SHUTDOWN) +default_sublabel_macro(action_bind_sublabel_dummy_check_missing_firmware, MENU_ENUM_SUBLABEL_CHECK_FOR_MISSING_FIRMWARE) default_sublabel_macro(action_bind_sublabel_video_refresh_rate, MENU_ENUM_SUBLABEL_VIDEO_REFRESH_RATE) default_sublabel_macro(action_bind_sublabel_audio_enable, MENU_ENUM_SUBLABEL_AUDIO_ENABLE) default_sublabel_macro(action_bind_sublabel_audio_max_timing_skew, MENU_ENUM_SUBLABEL_AUDIO_MAX_TIMING_SKEW) @@ -157,6 +158,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_dummy_on_core_shutdown); break; + case MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_dummy_check_missing_firmware); + break; case MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_core_allow_rotate); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 2a3868681f..f3975acdaa 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5243,6 +5243,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_DUMMY_ON_CORE_SHUTDOWN, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE, + PARSE_ONLY_BOOL, false); menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE, PARSE_ONLY_BOOL, false); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 651f4a2aa5..6f334610ac 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2712,7 +2712,7 @@ static bool setting_append_list( case SETTINGS_LIST_CORE: { unsigned i; - struct bool_entry bool_entries[4]; + struct bool_entry bool_entries[5]; START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_SETTINGS), parent_group); @@ -2743,12 +2743,18 @@ static bool setting_append_list( bool_entries[2].default_value = true; bool_entries[2].flags = SD_FLAG_ADVANCED; - bool_entries[3].target = &settings->video.allow_rotate; - bool_entries[3].name_enum_idx = MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE; - bool_entries[3].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE; - bool_entries[3].default_value = allow_rotate; + bool_entries[3].target = &settings->check_firmware_before_loading; + bool_entries[3].name_enum_idx = MENU_ENUM_LABEL_CHECK_FOR_MISSING_FIRMWARE; + bool_entries[3].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_CHECK_FOR_MISSING_FIRMWARE; + bool_entries[3].default_value = true; bool_entries[3].flags = SD_FLAG_ADVANCED; + bool_entries[4].target = &settings->video.allow_rotate; + bool_entries[4].name_enum_idx = MENU_ENUM_LABEL_VIDEO_ALLOW_ROTATE; + bool_entries[4].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_VIDEO_ALLOW_ROTATE; + bool_entries[4].default_value = allow_rotate; + bool_entries[4].flags = SD_FLAG_ADVANCED; + for (i = 0; i < ARRAY_SIZE(bool_entries); i++) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index 4e074ab52b..0ba1f8f489 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1144,6 +1144,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_NETWORK_REMOTE_USER_LAST_ENABLE = MENU_ENUM_LABEL_NETWORK_REMOTE_USER_1_ENABLE + MAX_USERS, MENU_LABEL(DUMMY_ON_CORE_SHUTDOWN), + MENU_LABEL(CHECK_FOR_MISSING_FIRMWARE), MENU_LABEL(DETECT_CORE_LIST_OK), MENU_LABEL(DETECT_CORE_LIST), diff --git a/tasks/task_content.c b/tasks/task_content.c index b15dc86236..d4e7ad90e3 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1037,6 +1037,7 @@ bool task_push_content_load_default( void *user_data) { bool loading_from_menu = false; + settings_t *settings = config_get_ptr(); if (!content_info) return false; @@ -1242,7 +1243,8 @@ bool task_push_content_load_default( case CONTENT_MODE_LOAD_CONTENT_WITH_FFMPEG_CORE_FROM_MENU: case CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU: update_firmware_status(); - if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL)) + if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL) && + settings->check_firmware_before_loading) goto skip; if (!task_load_content(content_info, loading_from_menu, mode)) goto error; @@ -1295,7 +1297,7 @@ error: skip: runloop_msg_queue_push(msg_hash_to_str(MSG_FIRMWARE), 100, 500, true); - RARCH_LOG(msg_hash_to_str(MSG_FIRMWARE)); + RARCH_LOG("Load content blocked. Reason: %s\n", msg_hash_to_str(MSG_FIRMWARE)); return true; } From 0b13f7dc4a93fa7719b81cb95639c9e11af026c2 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:26:53 -0500 Subject: [PATCH 049/638] Tpyo in griffin include of net_natt --- griffin/griffin.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index 4785559281..80de9a08b5 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -879,7 +879,7 @@ NETPLAY #include "../libretro-common/net/net_compat.c" #include "../libretro-common/net/net_socket.c" #include "../libretro-common/net/net_http.c" -#include "../libretro-common/net/net_nett.c" +#include "../libretro-common/net/net_natt.c" #ifndef HAVE_SOCKET_LEGACY #include "../libretro-common/net/net_ifinfo.c" #endif From 8e5e760773bc20e528663129d205f84aea9fd879 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:30:12 -0500 Subject: [PATCH 050/638] Remove accidentally-left debug printf --- libretro-common/net/net_natt.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index ea3a32a539..a3f28534aa 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -114,7 +114,6 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, port_str, host, "retroarch", proto_str, NULL, "3600"); } - fprintf(stderr, "ERROR: %d\n", r); if (r != 0) return false; From b1f9ef6073b3ca1820d23f0b600c2e5ab227435e Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:31:35 -0500 Subject: [PATCH 051/638] Since I've allocated net_ifinfo, I'd better free it in all returns --- libretro-common/net/net_natt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index a3f28534aa..2bd7d1f865 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -167,7 +167,10 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL) return false; if (!net_ifinfo_new(list)) + { + free(list); return false; + } /* loop through them */ for (i = 0; i < list->size; i++) From 7f62fee3750937540f4864b696ca27e748351530 Mon Sep 17 00:00:00 2001 From: radius Date: Tue, 29 Nov 2016 23:46:07 -0500 Subject: [PATCH 052/638] fix close content after loading has been blocked --- tasks/task_content.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/tasks/task_content.c b/tasks/task_content.c index d4e7ad90e3..6092f5611e 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1221,11 +1221,13 @@ bool task_push_content_load_default( default: break; } - /* Load content */ switch (mode) { case CONTENT_MODE_LOAD_NOTHING_WITH_DUMMY_CORE: + if (!task_load_content(content_info, loading_from_menu, mode)) + goto error; + break; case CONTENT_MODE_LOAD_FROM_CLI: #if defined(HAVE_NETWORKING) && defined(HAVE_NETWORKGAMEPAD) case CONTENT_MODE_LOAD_NOTHING_WITH_NET_RETROPAD_CORE_FROM_MENU: @@ -1244,8 +1246,9 @@ bool task_push_content_load_default( case CONTENT_MODE_LOAD_CONTENT_WITH_IMAGEVIEWER_CORE_FROM_MENU: update_firmware_status(); if(runloop_ctl(RUNLOOP_CTL_IS_MISSING_BIOS, NULL) && - settings->check_firmware_before_loading) - goto skip; + settings->check_firmware_before_loading) + goto skip; + if (!task_load_content(content_info, loading_from_menu, mode)) goto error; break; From 87344328fe38c256b06e922398e836514f1b11a8 Mon Sep 17 00:00:00 2001 From: vgmoose Date: Tue, 29 Nov 2016 23:52:48 -0500 Subject: [PATCH 053/638] (WiiU) put current git hash in meta.xml --- dist-scripts/wiiu-cores.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dist-scripts/wiiu-cores.sh b/dist-scripts/wiiu-cores.sh index e7cbd4ccb9..e3a5d53fc2 100755 --- a/dist-scripts/wiiu-cores.sh +++ b/dist-scripts/wiiu-cores.sh @@ -29,11 +29,12 @@ gen_meta_xml() systemname=`cat $info | lookup "systemname"` license=`cat $info | lookup "license"` date=`date +%Y%m%d%H%M%S` + build_hash=`git rev-parse --short HEAD 2>/dev/null` echo '' > "$1"_meta.xml echo '' >> "$1"_meta.xml echo ' '$corename'' >> "$1"_meta.xml echo ' '$authors'' >> "$1"_meta.xml - echo ' '$RARCH_VERSION' ('$date')' >> "$1"_meta.xml + echo ' '$RARCH_VERSION' r'$build_hash'' >> "$1"_meta.xml echo ' '$date'' >> "$1"_meta.xml echo ' RetroArch' >> "$1"_meta.xml echo -e ' '$display_name'\n\nSystem: '$systemname'\nLicense: '$license'' >> "$1"_meta.xml From b3ababce9aa8f9ee09f2151898587f5c02aac45c Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 00:25:16 -0500 Subject: [PATCH 054/638] Fix Netplay IPv6 support --- libretro-common/net/net_compat.c | 7 +++++-- network/netplay/netplay.c | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/libretro-common/net/net_compat.c b/libretro-common/net/net_compat.c index e61c145b9c..0976068f0b 100644 --- a/libretro-common/net/net_compat.c +++ b/libretro-common/net/net_compat.c @@ -165,11 +165,14 @@ int getaddrinfo_retro(const char *node, const char *service, (void)in_addr; (void)info; + if (!hints->ai_family) + { #if defined(_WIN32) || defined(HAVE_SOCKET_LEGACY) - hints->ai_family = AF_INET; + hints->ai_family = AF_INET; #else - hints->ai_family = AF_UNSPEC; + hints->ai_family = AF_UNSPEC; #endif + } #ifdef HAVE_SOCKET_LEGACY info = (struct addrinfo*)calloc(1, sizeof(*info)); diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 074b70e6ea..3fcea60f06 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -129,6 +129,10 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, port_buf[0] = '\0'; +#ifdef AF_INET6 + if (!server) + hints.ai_family = AF_INET6; +#endif hints.ai_socktype = SOCK_STREAM; if (!server) hints.ai_flags = AI_PASSIVE; @@ -140,6 +144,16 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, if (!res) return false; + /* If we're serving on IPv6, make sure we accept all connections, including + * IPv4 */ +#ifdef AF_INET6 + if (!server && res->ai_family == AF_INET6) + { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) res->ai_addr; + sin6->sin6_addr = in6addr_any; + } +#endif + /* If "localhost" is used, it is important to check every possible * address for IPv4/IPv6. */ tmp_info = res; From 3ac51389bb87b4050f4e6c5fb4d620ce52ee7c36 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Wed, 30 Nov 2016 02:07:17 -0500 Subject: [PATCH 055/638] dinput: catch null pointer --- input/drivers/dinput.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 00850d9bfc..d9f63127ed 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -208,6 +208,9 @@ static void dinput_poll(void *data) { struct dinput_input *di = (struct dinput_input*)data; + if (!di) + return; + memset(di->state, 0, sizeof(di->state)); if (di->keyboard) { From 5cf668c30280a13603ec2e86d2b844a0c54067ee Mon Sep 17 00:00:00 2001 From: radius Date: Wed, 30 Nov 2016 00:39:32 -0500 Subject: [PATCH 056/638] set the option as false by default for the time being --- config.def.h | 2 +- tasks/task_content.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config.def.h b/config.def.h index 9afa317c8c..78cb4e3ee7 100644 --- a/config.def.h +++ b/config.def.h @@ -437,7 +437,7 @@ static const bool load_dummy_on_core_shutdown = false; #else static const bool load_dummy_on_core_shutdown = true; #endif -static const bool check_firmware_before_loading = true; +static const bool check_firmware_before_loading = false; /* Forcibly disable composition. * Only valid on Windows Vista/7/8 for now. */ static const bool disable_composition = false; diff --git a/tasks/task_content.c b/tasks/task_content.c index 6092f5611e..9dad03364d 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -1221,6 +1221,8 @@ bool task_push_content_load_default( default: break; } + + RARCH_LOG("MODE: %d\n", mode); /* Load content */ switch (mode) { From ef65f6c57afdff8eb86340de378ac038ff10e399 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 10:48:11 -0500 Subject: [PATCH 057/638] Support for both MiniUPNPC 2.0 and MiniUPNPC < 2.0 MiniUPNPC 2.0 was a backwards-incompatible change (as .0s tend to be) but configure detects them the same. This adds support for the changed functions. --- libretro-common/net/net_natt.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 2bd7d1f865..851f5e5a65 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -50,7 +50,11 @@ void natt_init(void) int upnperror = 0; memset(&urls, 0, sizeof(struct UPNPUrls)); memset(&data, 0, sizeof(struct IGDdatas)); +#if MINIUPNPC_API_VERSION < 16 devlist = upnpDiscover(2000, NULL, NULL, 0, 0, &upnperror); +#else + devlist = upnpDiscover(2000, NULL, NULL, 0, 0, 2, &upnperror); +#endif if (devlist) { dev = devlist; @@ -63,7 +67,11 @@ void natt_init(void) if (!dev) dev = devlist; +#if MINIUPNPC_API_VERSION < 16 descXML = (char *) miniwget(dev->descURL, &descXMLsize, 0); +#else + descXML = (char *) miniwget(dev->descURL, &descXMLsize, 0, NULL); +#endif if (descXML) { parserootdesc (descXML, descXMLsize, &data); From 981cbf93c93243b078d86ba4b4875e0366677299 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Nov 2016 17:37:32 +0100 Subject: [PATCH 058/638] Add task_wifi to Griffin --- griffin/griffin.c | 1 + tasks/task_wifi.c | 4 ++-- tasks/tasks_internal.h | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/griffin/griffin.c b/griffin/griffin.c index 80de9a08b5..ab734ccd0d 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -884,6 +884,7 @@ NETPLAY #include "../libretro-common/net/net_ifinfo.c" #endif #include "../tasks/task_http.c" +#include "../tasks/task_wifi.c" #endif /*============================================================ diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index ec2b83e616..68ee0a374b 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -82,7 +82,7 @@ static void task_wifi_scan_handler(retro_task_t *task) return; } -bool task_push_wifi_scan() +bool task_push_wifi_scan(void) { retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); wifi_handle_t *state = (wifi_handle_t*)calloc(1, sizeof(*state)); @@ -110,4 +110,4 @@ error: free(task); return false; -} \ No newline at end of file +} diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 850c709edb..0975ccd120 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -84,7 +84,7 @@ void *task_push_http_transfer(const char *url, bool mute, const char *type, task_retriever_info_t *http_task_get_transfer_list(void); -bool task_push_wifi_scan(); +bool task_push_wifi_scan(void); #endif From d26905389bd9d0e6e8349bc7c0514a34be6b5f7b Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Wed, 30 Nov 2016 17:38:14 +0100 Subject: [PATCH 059/638] Cleanup --- tasks/task_wifi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 68ee0a374b..5a661afa9a 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -72,9 +72,8 @@ static void wifi_scan_callback(void *task_data, static void task_wifi_scan_handler(retro_task_t *task) { - wifi_handle_t *state = (wifi_handle_t*)task->state; - driver_wifi_scan(); + task->progress = 100; task->title = strdup("Wi-Fi scan complete"); task->finished = true; From 3f0a4183110b8b766005d75d2b9a59fbd4edbc3c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Wed, 30 Nov 2016 19:21:21 +0100 Subject: [PATCH 060/638] Fix Emscripten build --- menu/menu_displaylist.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index b5fa679d16..e60413d6de 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4892,6 +4892,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), MENU_ENUM_LABEL_NO_SETTINGS_FOUND, 0, 0, 0); +#ifdef HAVE_NETWORKING else { struct string_list *ssid_list = string_list_new(); @@ -4921,6 +4922,13 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } } } +#else + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), + MENU_ENUM_LABEL_NO_SETTINGS_FOUND, + 0, 0, 0); +#endif info->need_refresh = true; info->need_push = true; From 1f1a8eec893507f064ae748334e5a9ce044ec862 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 00:35:20 +0100 Subject: [PATCH 061/638] New message 'no networks found' --- intl/msg_hash_lbl.h | 2 ++ intl/msg_hash_us.h | 2 ++ menu/menu_displaylist.c | 18 +++++++++--------- msg_hash.h | 1 + 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index a553a2e312..ba73b123d8 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -624,6 +624,8 @@ MSG_HASH(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE, "no_history") MSG_HASH(MENU_ENUM_LABEL_NO_ITEMS, "no_items") +MSG_HASH(MENU_ENUM_LABEL_NO_NETWORKS_FOUND, + "no_networks_found") MSG_HASH(MENU_ENUM_LABEL_NO_PERFORMANCE_COUNTERS, "no_performance_counters") MSG_HASH(MENU_ENUM_LABEL_NO_PLAYLISTS, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 83ae437b73..396720b17c 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -964,6 +964,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE, "No information is available.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_ITEMS, "No items.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND, + "No networks found.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS, "No performance counters.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PLAYLISTS, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index e60413d6de..52a373c9e4 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4888,9 +4888,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_WIFI_SETTINGS_LIST: if (string_is_equal(settings->wifi.driver, "null")) menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND), - msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), - MENU_ENUM_LABEL_NO_SETTINGS_FOUND, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), + MENU_ENUM_LABEL_NO_NETWORKS_FOUND, 0, 0, 0); #ifdef HAVE_NETWORKING else @@ -4903,9 +4903,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) task_push_wifi_scan(); menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND), - msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), - MENU_ENUM_LABEL_NO_SETTINGS_FOUND, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), + MENU_ENUM_LABEL_NO_NETWORKS_FOUND, 0, 0, 0); } else @@ -4924,9 +4924,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } #else menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_SETTINGS_FOUND), - msg_hash_to_str(MENU_ENUM_LABEL_NO_SETTINGS_FOUND), - MENU_ENUM_LABEL_NO_SETTINGS_FOUND, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), + MENU_ENUM_LABEL_NO_NETWORKS_FOUND, 0, 0, 0); #endif diff --git a/msg_hash.h b/msg_hash.h index c9c3f1c4aa..670926979b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -862,6 +862,7 @@ enum msg_hash_enums MENU_LABEL(CONTENT_SETTINGS), MENU_LABEL(LOAD_CONTENT_LIST), MENU_LABEL(NO_SETTINGS_FOUND), + MENU_LABEL(NO_NETWORKS_FOUND), MENU_LABEL(NO_PERFORMANCE_COUNTERS), MENU_LABEL(FRAME_THROTTLE_SETTINGS), MENU_LABEL(FRAME_THROTTLE_ENABLE), From f41e420b446c3e2c1dd1e8903c2d4ffa6f0caeb8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 00:49:48 +0100 Subject: [PATCH 062/638] Unhardcode more strings --- intl/msg_hash_us.h | 4 ++++ msg_hash.h | 2 ++ tasks/task_wifi.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 396720b17c..1315f26510 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -2241,3 +2241,7 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_CURSOR_LIST_ENTRY_EDGE_MAGAZINE_RATING, "Database - Filter : Edge Magazine Rating") MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_CURSOR_LIST_ENTRY_DATABASE_INFO, "Database Info") +MSG_HASH(MSG_WIFI_SCAN_COMPLETE, + "Wi-Fi scan complete.") +MSG_HASH(MSG_SCANNING_WIRELESS_NETWORKS, + "Scanning wireless networks...") \ No newline at end of file diff --git a/msg_hash.h b/msg_hash.h index 670926979b..7d65595c13 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -278,6 +278,8 @@ enum msg_hash_enums MSG_MOVIE_RECORD_STOPPED, MSG_MOVIE_PLAYBACK_ENDED, MSG_TAKING_SCREENSHOT, + MSG_WIFI_SCAN_COMPLETE, + MSG_SCANNING_WIRELESS_NETWORKS, MSG_FAILED_TO_TAKE_SCREENSHOT, MSG_CUSTOM_TIMING_GIVEN, MSG_SAVING_STATE, diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 5a661afa9a..387b5a65fb 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -75,7 +75,7 @@ static void task_wifi_scan_handler(retro_task_t *task) driver_wifi_scan(); task->progress = 100; - task->title = strdup("Wi-Fi scan complete"); + task->title = strdup(msg_hash_to_str(MSG_WIFI_SCAN_COMPLETE)); task->finished = true; return; @@ -96,7 +96,7 @@ bool task_push_wifi_scan(void) task->state = state; task->handler = task_wifi_scan_handler; task->callback = wifi_scan_callback; - task->title = strdup("Scanning wireless networks..."); + task->title = strdup(msg_hash_to_str(MSG_SCANNING_WIRELESS_NETWORKS)); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); From c7f8cd3c6873367e897f441d8f88c448f8aabd26 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 19:01:32 -0500 Subject: [PATCH 063/638] Adding NAT traversal announcement for SOCKET_LEGACY --- network/netplay/netplay.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index a5916c249d..3ea2095969 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1086,6 +1086,7 @@ static void announce_nat_traversal(netplay_t *netplay) { char msg[512], host[PATH_MAX_LENGTH], port[6]; +#ifndef HAVE_SOCKET_LEGACY if (netplay->nat_traversal_state.have_inet4) { if (getnameinfo((const struct sockaddr *) &netplay->nat_traversal_state.ext_inet4_addr, @@ -1106,6 +1107,22 @@ static void announce_nat_traversal(netplay_t *netplay) #endif else return; +#else + if (netplay->nat_traversal_state.have_inet4) + { + strncpy(host, + inet_ntoa(netplay->nat_traversal_state.ext_inet4_addr.sin_addr), + PATH_MAX_LENGTH); + host[PATH_MAX_LENGTH-1] = '\0'; + snprintf(port, 6, "%hu", + ntohs(netplay->nat_traversal_state.ext_inet4_addr.sin_port)); + port[5] = '\0'; + + } + else return; + +#endif + snprintf(msg, sizeof(msg), "%s: %s:%s\n", msg_hash_to_str(MSG_PUBLIC_ADDRESS), host, port); From 4ad1aa7eff46216e1f78a860fb2e1437e886ed69 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 19:21:33 -0500 Subject: [PATCH 064/638] Don't double-free net_ifinfo structure. --- libretro-common/net/net_natt.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 851f5e5a65..ffc871c131 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -175,10 +175,7 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL) return false; if (!net_ifinfo_new(list)) - { - free(list); return false; - } /* loop through them */ for (i = 0; i < list->size; i++) From a0ac7e6a683271b69f7734b36ac59fa19079b696 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Wed, 30 Nov 2016 19:57:18 -0500 Subject: [PATCH 065/638] Make net_ifinfo's allocation behavior simpler and clearer --- libretro-common/net/net_ifinfo.c | 5 ++++- libretro-common/net/net_natt.c | 13 +++++-------- libretro-common/samples/net/net_ifinfo_test.c | 14 +++++--------- menu/menu_displaylist.c | 14 +++++--------- 4 files changed, 19 insertions(+), 27 deletions(-) diff --git a/libretro-common/net/net_ifinfo.c b/libretro-common/net/net_ifinfo.c index b119d207ce..5432f5a73d 100644 --- a/libretro-common/net/net_ifinfo.c +++ b/libretro-common/net/net_ifinfo.c @@ -65,7 +65,6 @@ void net_ifinfo_free(net_ifinfo_t *list) ptr->host = NULL; } free(list->entries); - free(list); } bool net_ifinfo_new(net_ifinfo_t *list) @@ -82,6 +81,8 @@ bool net_ifinfo_new(net_ifinfo_t *list) rv = GetAdaptersAddresses(AF_UNSPEC, GAA_FLAG_INCLUDE_PREFIX, NULL, adapter_addresses, &size); + memset(list, 0, sizeof(net_ifinfo_t)); + if (rv != ERROR_SUCCESS) goto error; @@ -122,6 +123,8 @@ bool net_ifinfo_new(net_ifinfo_t *list) struct ifaddrs *ifa = NULL; struct ifaddrs *ifaddr = NULL; + memset(list, 0, sizeof(net_ifinfo_t)); + if (getifaddrs(&ifaddr) == -1) goto error; diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index ffc871c131..f66d81205c 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -163,7 +163,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_protocol proto) { - struct net_ifinfo *list; + struct net_ifinfo list; bool ret = false; size_t i; struct addrinfo hints = {0}, *addr; @@ -172,15 +172,13 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p sprintf(port_str, "%hu", port); /* get our interfaces */ - if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL) - return false; - if (!net_ifinfo_new(list)) + if (!net_ifinfo_new(&list)) return false; /* loop through them */ - for (i = 0; i < list->size; i++) + for (i = 0; i < list.size; i++) { - struct net_ifinfo_entry *entry = list->entries + i; + struct net_ifinfo_entry *entry = list.entries + i; /* ignore localhost */ if (!strcmp(entry->host, "127.0.0.1") || !strcmp(entry->host, "::1")) @@ -194,8 +192,7 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p } } - /* This really shouldn't free list, but does */ - net_ifinfo_free(list); + net_ifinfo_free(&list); return ret; } diff --git a/libretro-common/samples/net/net_ifinfo_test.c b/libretro-common/samples/net/net_ifinfo_test.c index 4ac96bcbe0..1b825b3093 100644 --- a/libretro-common/samples/net/net_ifinfo_test.c +++ b/libretro-common/samples/net/net_ifinfo_test.c @@ -29,21 +29,17 @@ int main(int argc, const char *argv[]) { unsigned k = 0; - net_ifinfo_t *list = - (net_ifinfo_t*)calloc(1, sizeof(*list)); + net_ifinfo_t list; - if (!list) + if (!net_ifinfo_new(&list)) return -1; - if (!net_ifinfo_new(list)) - return -1; - - for (k = 0; k < list->size; k++) + for (k = 0; k < list.size; k++) { - printf("%s:%s\n", list->entries[k].name, list->entries[k].host); + printf("%s:%s\n", list.entries[k].name, list.entries[k].host); } - net_ifinfo_free(list); + net_ifinfo_free(&list); return 0; } diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 52a373c9e4..5a8790bb4e 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -430,16 +430,12 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info) static int menu_displaylist_parse_network_info(menu_displaylist_info_t *info) { unsigned k = 0; - net_ifinfo_t *list = - (net_ifinfo_t*)calloc(1, sizeof(*list)); + net_ifinfo_t list; - if (!list) + if (!net_ifinfo_new(&list)) return -1; - if (!net_ifinfo_new(list)) - return -1; - - for (k = 0; k < list->size; k++) + for (k = 0; k < list.size; k++) { char tmp[255]; @@ -447,12 +443,12 @@ static int menu_displaylist_parse_network_info(menu_displaylist_info_t *info) snprintf(tmp, sizeof(tmp), "%s (%s) : %s\n", msg_hash_to_str(MSG_INTERFACE), - list->entries[k].name, list->entries[k].host); + list.entries[k].name, list.entries[k].host); menu_entries_append_enum(info->list, tmp, "", MENU_ENUM_LABEL_NETWORK_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0); } - net_ifinfo_free(list); + net_ifinfo_free(&list); return 0; } #endif From 09aa219eb312c70770ba6cbf7b68507b4dcfc164 Mon Sep 17 00:00:00 2001 From: meleu Date: Wed, 30 Nov 2016 23:32:19 -0200 Subject: [PATCH 066/638] added menu_swap_ok_cancel Removed the deprecated `menu_ok_btn` and `menu_cancel_btn`. It's somehow related with this issue: https://github.com/libretro/RetroArch/issues/4111 --- retroarch.cfg | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/retroarch.cfg b/retroarch.cfg index d54ef28f6a..bd5f90b9f2 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -497,14 +497,15 @@ # input_player1_r3_btn = # Menu buttons. -# menu_ok_btn = -# menu_cancel_btn = # menu_search_btn = # menu_info_btn = # menu_default_btn = # menu_scroll_down_btn = # menu_scroll_up_btn = +# Swap buttons for OK/Cancel +# menu_swap_ok_cancel = false + # Axis for RetroArch D-Pad. # Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. # Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. From e6eeb8e5599cdd0ac3a24d80b61a667c7bd79c12 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 02:23:10 +0100 Subject: [PATCH 067/638] Simplify check_input_driver_block_hotkey --- input/input_driver.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 17db604604..f23ba4f42a 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -539,12 +539,12 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) bool kb_mapping_is_blocked = current_input->keyboard_mapping_is_blocked && current_input->keyboard_mapping_is_blocked(current_input_data); + input_driver_block_hotkey = false; + /* Don't block the check to RARCH_ENABLE_HOTKEY * unless we're really supposed to. */ if (kb_mapping_is_blocked) input_driver_block_hotkey = true; - else - input_driver_block_hotkey = false; /* If we haven't bound anything to this, * always allow hotkeys. */ @@ -556,10 +556,8 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) || (autoconf_bind->joykey != NO_BTN) || (autoconf_bind->joyaxis != AXIS_NONE); - if (kb_mapping_is_blocked || (use_hotkey_enable && !enable_hotkey)) + if (use_hotkey_enable && !enable_hotkey) input_driver_block_hotkey = true; - else - input_driver_block_hotkey = false; /* If we hold ENABLE_HOTKEY button, block all libretro input to allow * hotkeys to be bound to same keys as RetroPad. */ From 5337e494c6b23bc7289431a5c5e7490edb757919 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:01:21 +0100 Subject: [PATCH 068/638] More small cleanups --- input/input_driver.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index f23ba4f42a..a9ef6981f5 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -561,7 +561,7 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) /* If we hold ENABLE_HOTKEY button, block all libretro input to allow * hotkeys to be bound to same keys as RetroPad. */ - return (use_hotkey_enable && enable_hotkey); + return use_hotkey_enable; } static const unsigned buttons[] = { @@ -678,14 +678,13 @@ static INLINE bool input_keys_pressed_internal(unsigned i, uint64_t input_keys_pressed(void) { unsigned i; - uint64_t ret = 0; - settings_t *settings = config_get_ptr(); + uint64_t ret = 0; + settings_t *settings = config_get_ptr(); const struct retro_keybind *binds = settings->input.binds[0]; + bool enable_hotkey = current_input->input_state(current_input_data, &binds, 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); - if ( - check_input_driver_block_hotkey( - current_input->input_state(current_input_data, &binds, 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY))) + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; else input_driver_block_libretro_input = false; @@ -785,6 +784,7 @@ uint64_t input_menu_keys_pressed(void) { unsigned i; uint64_t ret = 0; + bool enable_hotkey = false; settings_t *settings = config_get_ptr(); const struct retro_keybind *binds[MAX_USERS] = {NULL}; @@ -795,10 +795,10 @@ uint64_t input_menu_keys_pressed(void) input_push_analog_dpad(settings->input.autoconf_binds[i], ANALOG_DPAD_LSTICK); - if ( - check_input_driver_block_hotkey( - current_input->input_state(current_input_data, &binds[0], 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY))) + enable_hotkey = current_input->input_state(current_input_data, &binds[0], 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); + + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; else input_driver_block_libretro_input = false; From c351aed0017f76b707568e14ce6cbebaeff6fc76 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:38:25 +0100 Subject: [PATCH 069/638] (input_driver.c) Cleanups --- input/input_driver.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index a9ef6981f5..562c27e1de 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -536,14 +536,11 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) &settings->input.binds[0][RARCH_ENABLE_HOTKEY]; const struct retro_keybind *autoconf_bind = &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; - bool kb_mapping_is_blocked = current_input->keyboard_mapping_is_blocked && - current_input->keyboard_mapping_is_blocked(current_input_data); - - input_driver_block_hotkey = false; /* Don't block the check to RARCH_ENABLE_HOTKEY * unless we're really supposed to. */ - if (kb_mapping_is_blocked) + if (current_input->keyboard_mapping_is_blocked && + current_input->keyboard_mapping_is_blocked(current_input_data)) input_driver_block_hotkey = true; /* If we haven't bound anything to this, @@ -684,10 +681,11 @@ uint64_t input_keys_pressed(void) bool enable_hotkey = current_input->input_state(current_input_data, &binds, 0, RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); + input_driver_block_libretro_input = false; + input_driver_block_hotkey = false; + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; - else - input_driver_block_libretro_input = false; for (i = 0; i < RARCH_BIND_LIST_END; i++) { @@ -798,11 +796,11 @@ uint64_t input_menu_keys_pressed(void) enable_hotkey = current_input->input_state(current_input_data, &binds[0], 0, RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); + input_driver_block_libretro_input = false; + input_driver_block_hotkey = false; + if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) input_driver_block_libretro_input = true; - else - input_driver_block_libretro_input = false; - for (i = 0; i < RARCH_BIND_LIST_END; i++) { From bd53c330699862c500fc0830724caf88a85af0c9 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:43:51 +0100 Subject: [PATCH 070/638] Move input_get_auto_bind to input_config.c --- input/input_autodetect.c | 13 ------------- input/input_autodetect.h | 3 --- input/input_config.c | 13 +++++++++++++ input/input_config.h | 2 ++ menu/cbs/menu_cbs_get_value.c | 2 +- menu/widgets/menu_dialog.c | 2 +- setting_list.c | 2 +- 7 files changed, 18 insertions(+), 19 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 85a3bfa6b1..43cede3528 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -322,19 +322,6 @@ error: return false; } -const struct retro_keybind *input_get_auto_bind(unsigned port, unsigned id) -{ - settings_t *settings = config_get_ptr(); - unsigned joy_idx = 0; - - if (settings) - joy_idx = settings->input.joypad_map[port]; - - if (joy_idx < MAX_USERS) - return &settings->input.autoconf_binds[joy_idx][id]; - return NULL; -} - void input_config_autoconfigure_disconnect(unsigned i, const char *ident) { char msg[255]; diff --git a/input/input_autodetect.h b/input/input_autodetect.h index 542e525219..6e6bb9b912 100644 --- a/input/input_autodetect.h +++ b/input/input_autodetect.h @@ -32,9 +32,6 @@ typedef struct autoconfig_params int32_t pid; } autoconfig_params_t; -const struct retro_keybind *input_get_auto_bind(unsigned port, - unsigned id); - bool input_config_autoconfigure_joypad(autoconfig_params_t *params); void input_config_autoconfigure_disconnect(unsigned i, const char *ident); diff --git a/input/input_config.c b/input/input_config.c index b8f713422e..1f7f6531fd 100644 --- a/input/input_config.c +++ b/input/input_config.c @@ -470,3 +470,16 @@ void input_config_get_bind_string(char *buf, const struct retro_keybind *bind, strlcat(buf, keybuf, size); #endif } + +const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id) +{ + settings_t *settings = config_get_ptr(); + unsigned joy_idx = 0; + + if (settings) + joy_idx = settings->input.joypad_map[port]; + + if (joy_idx < MAX_USERS) + return &settings->input.autoconf_binds[joy_idx][id]; + return NULL; +} diff --git a/input/input_config.h b/input/input_config.h index 8822f30d5a..79dd7f8acb 100644 --- a/input/input_config.h +++ b/input/input_config.h @@ -69,4 +69,6 @@ void input_config_parse_joy_button(config_file_t *conf, const char *prefix, void input_config_parse_joy_axis(config_file_t *conf, const char *prefix, const char *axis, struct retro_keybind *bind); +const struct retro_keybind *input_config_get_bind_auto(unsigned port, unsigned id); + #endif diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index c1a11ce419..271a5977fb 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -475,7 +475,7 @@ static void menu_action_setting_disp_set_label_input_desc( keybind = (const struct retro_keybind*) &settings->input.binds[inp_desc_user][remap_id]; auto_bind = (const struct retro_keybind*) - input_get_auto_bind(inp_desc_user, remap_id); + input_config_get_bind_auto(inp_desc_user, remap_id); input_config_get_bind_string(descriptor, keybind, auto_bind, sizeof(descriptor)); diff --git a/menu/widgets/menu_dialog.c b/menu/widgets/menu_dialog.c index f272685156..19205dcbfb 100644 --- a/menu/widgets/menu_dialog.c +++ b/menu/widgets/menu_dialog.c @@ -111,7 +111,7 @@ int menu_dialog_iterate(char *s, size_t len, const char *label) &settings->input.binds[0][binds[i]]; const struct retro_keybind *auto_bind = (const struct retro_keybind*) - input_get_auto_bind(0, binds[i]); + input_config_get_bind_auto(0, binds[i]); input_config_get_bind_string(desc[i], keybind, auto_bind, sizeof(desc[i])); diff --git a/setting_list.c b/setting_list.c index 9949da39c1..97fcfca679 100644 --- a/setting_list.c +++ b/setting_list.c @@ -610,7 +610,7 @@ static void setting_get_string_representation_st_bind(void *data, index_offset = setting->index_offset; keybind = (const struct retro_keybind*)setting->value.target.keybind; auto_bind = (const struct retro_keybind*) - input_get_auto_bind(index_offset, keybind->id); + input_config_get_bind_auto(index_offset, keybind->id); input_config_get_bind_string(s, keybind, auto_bind, len); } From eee077fe3137731467cbc731751de9e45e2de927 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:50:35 +0100 Subject: [PATCH 071/638] (udev) Simplify udev_joypad_handle_hotplug --- input/drivers_joypad/udev_joypad.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index bac6829b8d..df7660f927 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -420,18 +420,11 @@ static void udev_joypad_destroy(void) g_udev = NULL; } -static void udev_joypad_handle_hotplug(void) +static void udev_joypad_handle_hotplug(struct udev_device *dev) { - struct udev_device *dev = udev_monitor_receive_device(g_udev_mon); - const char *val; - const char *action; - const char *devnode; - if (!dev) - return; - - val = udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK"); - action = udev_device_get_action(dev); - devnode = udev_device_get_devnode(dev); + const char *val = udev_device_get_property_value(dev, "ID_INPUT_JOYSTICK"); + const char *action = udev_device_get_action(dev); + const char *devnode = udev_device_get_devnode(dev); if (!val || !string_is_equal(val, "1") || !devnode) goto end; @@ -523,8 +516,13 @@ static bool udev_set_rumble(unsigned i, enum retro_rumble_effect effect, uint16_ static void udev_joypad_poll(void) { unsigned i; + while (udev_hotplug_available()) - udev_joypad_handle_hotplug(); + { + struct udev_device *dev = udev_monitor_receive_device(g_udev_mon); + if (dev) + udev_joypad_handle_hotplug(dev); + } for (i = 0; i < MAX_USERS; i++) udev_poll_pad(&udev_pads[i], i); From 468644e21346579a4b9617f8a50376f0d328399f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 03:59:02 +0100 Subject: [PATCH 072/638] Simplify udev_hotplug_available and prevent implicit memset --- input/drivers_joypad/udev_joypad.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index df7660f927..c576f47a9b 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -160,15 +160,13 @@ static void udev_poll_pad(struct udev_joypad *pad, unsigned p) } } -static bool udev_hotplug_available(void) +static INLINE bool udev_hotplug_available(void) { - struct pollfd fds = {0}; + struct pollfd fds; - if (!g_udev_mon) - return false; - - fds.fd = udev_monitor_get_fd(g_udev_mon); - fds.events = POLLIN; + fds.fd = udev_monitor_get_fd(g_udev_mon); + fds.events = POLLIN; + fds.revents = 0; return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN); } @@ -517,7 +515,7 @@ static void udev_joypad_poll(void) { unsigned i; - while (udev_hotplug_available()) + while (g_udev_mon && udev_hotplug_available()) { struct udev_device *dev = udev_monitor_receive_device(g_udev_mon); if (dev) From a726fc2d8e4caa369d22ad64ae4db3678921d741 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 04:12:56 +0100 Subject: [PATCH 073/638] Further cleanups --- input/input_driver.c | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 562c27e1de..733c35348e 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -524,13 +524,11 @@ int16_t input_state(unsigned port, unsigned device, /** * check_input_driver_block_hotkey: - * @enable_hotkey : Is hotkey enable key enabled? * * Checks if 'hotkey enable' key is pressed. **/ -static bool check_input_driver_block_hotkey(bool enable_hotkey) +static bool check_input_driver_block_hotkey(void) { - bool use_hotkey_enable = false; settings_t *settings = config_get_ptr(); const struct retro_keybind *bind = &settings->input.binds[0][RARCH_ENABLE_HOTKEY]; @@ -545,7 +543,10 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) /* If we haven't bound anything to this, * always allow hotkeys. */ - use_hotkey_enable = + + /* If we hold ENABLE_HOTKEY button, block all libretro input to allow + * hotkeys to be bound to same keys as RetroPad. */ + return (bind->key != RETROK_UNKNOWN) || (bind->joykey != NO_BTN) || (bind->joyaxis != AXIS_NONE) @@ -553,12 +554,6 @@ static bool check_input_driver_block_hotkey(bool enable_hotkey) || (autoconf_bind->joykey != NO_BTN) || (autoconf_bind->joyaxis != AXIS_NONE); - if (use_hotkey_enable && !enable_hotkey) - input_driver_block_hotkey = true; - - /* If we hold ENABLE_HOTKEY button, block all libretro input to allow - * hotkeys to be bound to same keys as RetroPad. */ - return use_hotkey_enable; } static const unsigned buttons[] = { @@ -678,14 +673,18 @@ uint64_t input_keys_pressed(void) uint64_t ret = 0; settings_t *settings = config_get_ptr(); const struct retro_keybind *binds = settings->input.binds[0]; - bool enable_hotkey = current_input->input_state(current_input_data, &binds, 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); input_driver_block_libretro_input = false; input_driver_block_hotkey = false; - if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) - input_driver_block_libretro_input = true; + if (check_input_driver_block_hotkey()) + { + if (current_input->input_state(current_input_data, &binds, 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) + input_driver_block_libretro_input = true; + else + input_driver_block_hotkey = true; + } for (i = 0; i < RARCH_BIND_LIST_END; i++) { @@ -782,7 +781,6 @@ uint64_t input_menu_keys_pressed(void) { unsigned i; uint64_t ret = 0; - bool enable_hotkey = false; settings_t *settings = config_get_ptr(); const struct retro_keybind *binds[MAX_USERS] = {NULL}; @@ -793,14 +791,17 @@ uint64_t input_menu_keys_pressed(void) input_push_analog_dpad(settings->input.autoconf_binds[i], ANALOG_DPAD_LSTICK); - enable_hotkey = current_input->input_state(current_input_data, &binds[0], 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY); - input_driver_block_libretro_input = false; input_driver_block_hotkey = false; - if (check_input_driver_block_hotkey(enable_hotkey) && enable_hotkey) - input_driver_block_libretro_input = true; + if (check_input_driver_block_hotkey()) + { + if (current_input->input_state(current_input_data, &binds[0], 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) + input_driver_block_libretro_input = true; + else + input_driver_block_hotkey = true; + } for (i = 0; i < RARCH_BIND_LIST_END; i++) { From f54b8cb9a9075078aadede73a5cd51f50d470e21 Mon Sep 17 00:00:00 2001 From: terry1994 Date: Thu, 1 Dec 2016 09:33:06 +0100 Subject: [PATCH 074/638] Fix building on iOS 9 and 10. Adjusted iOS 10 project to target minimum iOS version of 10. Using minimum iOS version to determine availablity of clock_gettime (exists only on iOS 10+). Building with 10/10.1 SDK would cause this method to be called in iOS 9 builds, resulting in a crash on start. --- libretro-common/features/features_cpu.c | 2 +- .../RetroArch_iOS10.xcodeproj/project.pbxproj | 36 +++++++++---------- .../RetroArch_iOS10.xcscmblueprint | 30 ++++++++++++++++ 3 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 pkg/apple/RetroArch_iOS10.xcodeproj/project.xcworkspace/xcshareddata/RetroArch_iOS10.xcscmblueprint diff --git a/libretro-common/features/features_cpu.c b/libretro-common/features/features_cpu.c index 0dafa77eba..ddaa01f9ce 100644 --- a/libretro-common/features/features_cpu.c +++ b/libretro-common/features/features_cpu.c @@ -108,7 +108,7 @@ static int ra_clock_gettime(int clk_ik, struct timespec *t) } #endif -#if defined(__MACH__) && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000 +#if defined(__MACH__) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000 #else #define ra_clock_gettime clock_gettime #endif diff --git a/pkg/apple/RetroArch_iOS10.xcodeproj/project.pbxproj b/pkg/apple/RetroArch_iOS10.xcodeproj/project.pbxproj index a99d8b6716..570ccef6df 100644 --- a/pkg/apple/RetroArch_iOS10.xcodeproj/project.pbxproj +++ b/pkg/apple/RetroArch_iOS10.xcodeproj/project.pbxproj @@ -453,7 +453,7 @@ }; }; }; - buildConfigurationList = 96AFAE1F16C1D4EA009DE44C /* Build configuration list for PBXProject "RetroArch_iOS" */; + buildConfigurationList = 96AFAE1F16C1D4EA009DE44C /* Build configuration list for PBXProject "RetroArch_iOS10" */; compatibilityVersion = "Xcode 3.2"; developmentRegion = English; hasScannedForEncodings = 0; @@ -636,7 +636,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -714,7 +714,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -763,7 +763,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -841,7 +841,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -915,7 +915,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -961,7 +961,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1023,7 +1023,7 @@ "../../libretro-common/include", ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_NO_PIE = YES; LIBRARY_SEARCH_PATHS = ""; ONLY_ACTIVE_ARCH = NO; @@ -1034,7 +1034,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1099,7 +1099,7 @@ "../../libretro-common/include", ); INFOPLIST_FILE = "$(SRCROOT)/iOS/Info.plist"; - IPHONEOS_DEPLOYMENT_TARGET = 6.0; + IPHONEOS_DEPLOYMENT_TARGET = 10.0; LD_NO_PIE = YES; LIBRARY_SEARCH_PATHS = ""; OTHER_CFLAGS = ( @@ -1111,7 +1111,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1160,7 +1160,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1242,7 +1242,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1310,7 +1310,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1379,7 +1379,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1456,7 +1456,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1505,7 +1505,7 @@ "-DHAVE_NETWORKING", "-DHAVE_AVFOUNDATION", "-DHAVE_GRIFFIN", - "-DHAVE_UPDATE_ASSETS", + "-DHAVE_UPDATE_ASSETS", "-DHAVE_LANGEXTRA", "-DHAVE_CHEEVOS", "-DHAVE_IMAGEVIEWER", @@ -1583,7 +1583,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; - 96AFAE1F16C1D4EA009DE44C /* Build configuration list for PBXProject "RetroArch_iOS" */ = { + 96AFAE1F16C1D4EA009DE44C /* Build configuration list for PBXProject "RetroArch_iOS10" */ = { isa = XCConfigurationList; buildConfigurations = ( 96AFAE5216C1D4EA009DE44C /* Debug */, diff --git a/pkg/apple/RetroArch_iOS10.xcodeproj/project.xcworkspace/xcshareddata/RetroArch_iOS10.xcscmblueprint b/pkg/apple/RetroArch_iOS10.xcodeproj/project.xcworkspace/xcshareddata/RetroArch_iOS10.xcscmblueprint new file mode 100644 index 0000000000..b1429b86f1 --- /dev/null +++ b/pkg/apple/RetroArch_iOS10.xcodeproj/project.xcworkspace/xcshareddata/RetroArch_iOS10.xcscmblueprint @@ -0,0 +1,30 @@ +{ + "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "C7C12374C7051F8843B3EFA1ACCAF2907102CCF7", + "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { + + }, + "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { + "76200F0D6584D865E96F58DE862E738E88B23A3C" : 9223372036854775807, + "C7C12374C7051F8843B3EFA1ACCAF2907102CCF7" : 9223372036854775807 + }, + "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "8BA6E269-73BB-4AAE-8F4A-967CCF8ACA14", + "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { + "76200F0D6584D865E96F58DE862E738E88B23A3C" : "", + "C7C12374C7051F8843B3EFA1ACCAF2907102CCF7" : "retroarch\/" + }, + "DVTSourceControlWorkspaceBlueprintNameKey" : "RetroArch_iOS10", + "DVTSourceControlWorkspaceBlueprintVersion" : 204, + "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "pkg\/apple\/RetroArch_iOS10.xcodeproj", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/libretro\/libretro-super.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "76200F0D6584D865E96F58DE862E738E88B23A3C" + }, + { + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/libretro\/RetroArch.git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", + "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C7C12374C7051F8843B3EFA1ACCAF2907102CCF7" + } + ] +} \ No newline at end of file From 63ae172a23e6061c9868a738f0b3c83dc5c5b1b4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 15:02:29 +0100 Subject: [PATCH 075/638] Add udev_common.c/.h --- Makefile.common | 1 + griffin/griffin.c | 1 + input/common/udev_common.c | 34 ++++++++++++++++++++++++++++++ input/common/udev_common.h | 23 ++++++++++++++++++++ input/drivers_joypad/udev_joypad.c | 17 ++++----------- 5 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 input/common/udev_common.c create mode 100644 input/common/udev_common.h diff --git a/Makefile.common b/Makefile.common index 2fdc341072..6b9f0b197a 100644 --- a/Makefile.common +++ b/Makefile.common @@ -638,6 +638,7 @@ ifeq ($(HAVE_UDEV), 1) DEFINES += $(UDEV_CFLAGS) LIBS += $(UDEV_LIBS) OBJ += input/drivers/udev_input.o \ + input/common/udev_common.o \ input/drivers_keyboard/keyboard_event_udev.o \ input/drivers_joypad/udev_joypad.o endif diff --git a/griffin/griffin.c b/griffin/griffin.c index ab734ccd0d..e6cc4b3451 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -473,6 +473,7 @@ INPUT #endif #ifdef HAVE_UDEV +#include "../input/common/udev_common.c" #include "../input/drivers/udev_input.c" #include "../input/drivers_keyboard/keyboard_event_udev.c" #include "../input/drivers_joypad/udev_joypad.c" diff --git a/input/common/udev_common.c b/input/common/udev_common.c new file mode 100644 index 0000000000..d256f3916d --- /dev/null +++ b/input/common/udev_common.c @@ -0,0 +1,34 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * 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 "udev_common.h" + +bool udev_hotplug_available(void *dev) +{ + struct pollfd fds; + + fds.fd = udev_monitor_get_fd((struct udev_monitor*)dev); + fds.events = POLLIN; + fds.revents = 0; + + return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN); +} diff --git a/input/common/udev_common.h b/input/common/udev_common.h new file mode 100644 index 0000000000..c9ea19c191 --- /dev/null +++ b/input/common/udev_common.h @@ -0,0 +1,23 @@ +/* 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 . + */ + +#ifndef _UDEV_COMMON_H +#define _UDEV_COMMON_H + +#include + +bool udev_hotplug_available(void *dev); + +#endif diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index c576f47a9b..69c3385ae0 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -23,7 +23,6 @@ #include #include -#include #include #include #include @@ -34,6 +33,9 @@ #include "../input_autodetect.h" #include "../input_driver.h" + +#include "../common/udev_common.h" + #include "../../configuration.h" #include "../../runloop.h" #include "../../verbosity.h" @@ -160,17 +162,6 @@ static void udev_poll_pad(struct udev_joypad *pad, unsigned p) } } -static INLINE bool udev_hotplug_available(void) -{ - struct pollfd fds; - - fds.fd = udev_monitor_get_fd(g_udev_mon); - fds.events = POLLIN; - fds.revents = 0; - - return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN); -} - static int udev_find_vacant_pad(void) { unsigned i; @@ -515,7 +506,7 @@ static void udev_joypad_poll(void) { unsigned i; - while (g_udev_mon && udev_hotplug_available()) + while (g_udev_mon && udev_hotplug_available(g_udev_mon)) { struct udev_device *dev = udev_monitor_receive_device(g_udev_mon); if (dev) From 9afa24ea7019555782535dad4b5d4b38c8fcaabd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 15:05:17 +0100 Subject: [PATCH 076/638] Reuse udev_common.c function --- input/drivers/udev_input.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 3bd015e193..1600048f0b 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -42,10 +41,12 @@ #include "../drivers_keyboard/keyboard_event_udev.h" #include "../common/linux_common.h" +#include "../common/udev_common.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" + #include "../../configuration.h" #include "../../runloop.h" #include "../../verbosity.h" @@ -226,19 +227,6 @@ static void udev_handle_mouse(void *data, } } -static bool udev_input_hotplug_available(udev_input_t *udev) -{ - struct pollfd fds = {0}; - - if (!udev || !udev->monitor) - return false; - - fds.fd = udev_monitor_get_fd(udev->monitor); - fds.events = POLLIN; - - return (poll(&fds, 1, 0) == 1) && (fds.revents & POLLIN); -} - static bool add_device(udev_input_t *udev, const char *devnode, device_handle_cb cb) { @@ -382,7 +370,7 @@ static void udev_input_poll(void *data) udev->mouse_wu = udev->mouse_wd = 0; udev->mouse_whu = udev->mouse_whd = 0; - while (udev_input_hotplug_available(udev)) + while (udev->monitor && udev_hotplug_available(udev->monitor)) udev_input_handle_hotplug(udev); ret = epoll_wait(udev->epfd, events, ARRAY_SIZE(events), 0); From 4f7245fa9a817e6d4fa4e040be8e35017f6a0fb0 Mon Sep 17 00:00:00 2001 From: lasers Date: Thu, 1 Dec 2016 08:12:03 -0600 Subject: [PATCH 077/638] Avoid unpredictable sublabel --- intl/msg_hash_eo.h | 2 +- intl/msg_hash_fr.h | 2 +- intl/msg_hash_nl.h | 2 +- intl/msg_hash_ru.h | 2 +- intl/msg_hash_us.h | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 2de206143c..a7d8cc7484 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -1671,7 +1671,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, - "Display information for core, network, and system.\nDisplay manager for database and cursor.") + "Display information for core, network, and system. Display manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, "Download add-ons, components and contents for RetroArch.") MSG_HASH(MENU_ENUM_SUBLABEL_SAMBA_ENABLE, diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 62fbcc4d50..df9ebc903e 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -1639,7 +1639,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, - "Display information for core, network, and system.\nDisplay manager for database and cursor.") + "Display information for core, network, and system. Display manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, "Download add-ons, components and contents for RetroArch.") MSG_HASH(MENU_ENUM_SUBLABEL_SAMBA_ENABLE, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index fbbba7b8d1..39a47cdcfe 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -1671,7 +1671,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, - "Display information for core, network, and system.\nDisplay manager for database and cursor.") + "Display information for core, network, and system. Display manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, "Download add-ons, components and contents for RetroArch.") MSG_HASH(MENU_ENUM_SUBLABEL_SAMBA_ENABLE, diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 8fc44eeefa..80f501daaa 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -1667,7 +1667,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, - "Display information for core, network, and system.\nDisplay manager for database and cursor.") + "Display information for core, network, and system. Display manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, "Download add-ons, components and contents for RetroArch.") MSG_HASH(MENU_ENUM_SUBLABEL_SAMBA_ENABLE, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 1315f26510..afa3f8f503 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1681,7 +1681,7 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, - "Display information for core, network, and system.\nDisplay manager for database and cursor.") + "Display information for core, network, and system. Display manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, "Download add-ons, components and contents for RetroArch.") MSG_HASH(MENU_ENUM_SUBLABEL_SAMBA_ENABLE, From 8dc9c64297ee68bc1055031486ea5d6b12c03aba Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Thu, 1 Dec 2016 09:39:41 -0500 Subject: [PATCH 078/638] Yet another pre-2.0 fix for MiniUPNPC (if we have more problems I'll just drop support for pre-2.0) --- libretro-common/net/net_natt.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index f66d81205c..59e0530ef7 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -113,15 +113,19 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t proto_str = (proto == SOCKET_PROTOCOL_UDP) ? "UDP" : "TCP"; /* add the port mapping */ +#if MINIUPNPC_API_VERSION >= 16 r = UPNP_AddAnyPortMapping(urls.controlURL, data.first.servicetype, port_str, port_str, host, "retroarch", proto_str, NULL, "3600", ext_port_str); if (r == 501 /* Action Failed */) { +#endif /* try the older AddPortMapping */ memcpy(ext_port_str, port_str, 6); r = UPNP_AddPortMapping(urls.controlURL, data.first.servicetype, port_str, port_str, host, "retroarch", proto_str, NULL, "3600"); +#if MINIUPNPC_API_VERSION >= 16 } +#endif if (r != 0) return false; From da6d4a7599742c7a191afe9c95f2a290998d8777 Mon Sep 17 00:00:00 2001 From: lasers Date: Thu, 1 Dec 2016 09:22:59 -0600 Subject: [PATCH 079/638] Update skeleton cfg (core options) --- retroarch.cfg | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/retroarch.cfg b/retroarch.cfg index bd5f90b9f2..50bca91a36 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -159,7 +159,7 @@ # Video vsync. # video_vsync = true -# Max amount of swapchain images. +# Max amount of swapchain images. # Single buffering = 1, Double buffering = 2, 3 = Triple buffering # video_max_swapchain_images = 3 @@ -214,7 +214,7 @@ # Forces cropping of overscanned frames. # Exact behavior of this option is implementation specific. -# video_crop_overscan = true +# video_crop_overscan = true # Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset) # video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}" @@ -234,7 +234,7 @@ # Path to a font used for rendering messages. This path must be defined to enable fonts. # Do note that the _full_ path of the font is necessary! -# video_font_path = +# video_font_path = # Size of the font rendered. # video_font_size = 32 @@ -242,7 +242,7 @@ # Enable usage of OSD messages. # video_font_enable = true -# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. +# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. # [0.0, 0.0] maps to the lower left corner of the screen. # video_message_pos_x = 0.05 # video_message_pos_y = 0.05 @@ -379,9 +379,9 @@ # requested. # 2 : Late - Input polling is performed on first call to retro_input_state # per frame -# +# # Setting it to 0 or 2 can result in less latency depending on -# your configuration. +# your configuration. # # When netplay is enabled, the default polling behavior (1) will # be used regardless of the value set here. @@ -432,7 +432,7 @@ # tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket, # backslash, rightbracket, kp_period, kp_equals, rctrl, ralt # -# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, +# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, # rather than relying on a default. # input_player1_a = "x" # input_player1_b = "z" @@ -477,7 +477,7 @@ # Input device buttons. # Figure these out by using RetroArch-Phoenix or retroarch-joyconfig. -# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. +# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. # E.g. "h0up" # input_player1_a_btn = # input_player1_b_btn = @@ -506,8 +506,8 @@ # Swap buttons for OK/Cancel # menu_swap_ok_cancel = false -# Axis for RetroArch D-Pad. -# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. +# Axis for RetroArch D-Pad. +# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. # Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. # input_player1_left_axis = # input_player1_right_axis = @@ -546,7 +546,7 @@ # Hold for fast-forward. Releasing button disables fast-forward. # input_hold_fast_forward = l -# Key to exit RetroArch cleanly. +# Key to exit RetroArch cleanly. # Killing it in any hard way (SIGKILL, etc) will terminate RetroArch without saving RAM, etc. # On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization. # input_exit_emulator = escape @@ -630,7 +630,7 @@ #### Menu -# Menu driver to use. "rgui", "lakka", etc. +# Menu driver to use. "rgui", "lakka", etc. # menu_driver = "rgui" # If disabled, the libretro core will keep running in the background when we @@ -668,6 +668,14 @@ # per category. # menu_collapse_subgroups_enable = false +#### Core +# +# Prevent libretro cores from closing RetroArch on exit by loading a dummy core. +# load_dummy_on_core_shutdown = "true" + +# Check for firmware requirement(s) before loading a content. +# check_firmware_before_loading = "false" + #### UI # Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored @@ -707,7 +715,7 @@ # netplay_client_swap_input = false # The username of the person running RetroArch. This will be used for playing online, for instance. -# netplay_nickname = +# netplay_nickname = # The amount of delay frames to use for netplay. Increasing this value will increase # performance, but introduce more latency. @@ -721,7 +729,7 @@ # netplay_spectator_mode_enable = false # The IP Address of the host to connect to. -# netplay_ip_address = +# netplay_ip_address = # The port of the host IP Address. Can be either a TCP or UDP port. # netplay_ip_port = 55435 From d7f7d5f99a9c8d1903ef632f939b1809e9948e08 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 16:40:04 +0100 Subject: [PATCH 080/638] Rewrite epoll_common --- input/common/epoll_common.c | 27 +++++++++-------- input/common/epoll_common.h | 11 +++---- input/drivers_joypad/linuxraw_joypad.c | 42 ++++++++++++++------------ 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/input/common/epoll_common.c b/input/common/epoll_common.c index c2b21de8b5..5ead3ec034 100644 --- a/input/common/epoll_common.c +++ b/input/common/epoll_common.c @@ -19,21 +19,23 @@ #include #include +#include +#include + #include "epoll_common.h" #include "../../verbosity.h" -static int g_epoll; static bool epoll_inited; static bool epoll_first_inited_is_joypad; -bool epoll_new(bool is_joypad) +bool epoll_new(int *epoll_fd, bool is_joypad) { if (epoll_inited) return true; - g_epoll = epoll_create(32); - if (g_epoll < 0) + *epoll_fd = epoll_create(32); + if (*epoll_fd < 0) return false; epoll_first_inited_is_joypad = is_joypad; @@ -42,25 +44,26 @@ bool epoll_new(bool is_joypad) return true; } -void epoll_free(bool is_joypad) +void epoll_free(int *epoll_fd, bool is_joypad) { if (!epoll_inited || (is_joypad && !epoll_first_inited_is_joypad)) return; - if (g_epoll >= 0) - close(g_epoll); - g_epoll = -1; + if (*epoll_fd >= 0) + close(*epoll_fd); + + *epoll_fd = -1; epoll_inited = false; epoll_first_inited_is_joypad = false; } -int epoll_waiting(struct epoll_event *events, int maxevents, int timeout) +int epoll_waiting(int *epoll_fd, void *events, int maxevents, int timeout) { - return epoll_wait(g_epoll, events, maxevents, timeout); + return epoll_wait(*epoll_fd, (struct epoll_event*)events, maxevents, timeout); } -bool epoll_add(int fd, void *device) +bool epoll_add(int *epoll_fd, int fd, void *device) { struct epoll_event event = {0}; @@ -68,7 +71,7 @@ bool epoll_add(int fd, void *device) event.data.ptr = device; /* Shouldn't happen, but just check it. */ - if (epoll_ctl(g_epoll, EPOLL_CTL_ADD, fd, &event) < 0) + if (epoll_ctl(*epoll_fd, EPOLL_CTL_ADD, fd, &event) < 0) { RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n", fd, strerror(errno)); diff --git a/input/common/epoll_common.h b/input/common/epoll_common.h index ee901ccf19..a56fbdd2d3 100644 --- a/input/common/epoll_common.h +++ b/input/common/epoll_common.h @@ -18,17 +18,14 @@ #include -#include -#include - #include -bool epoll_new(bool is_joypad); +bool epoll_new(int *epoll_fd, bool is_joypad); -void epoll_free(bool is_joypad); +void epoll_free(int *epoll_fd, bool is_joypad); -int epoll_waiting(struct epoll_event *events, int maxevents, int timeout); +int epoll_waiting(int *epoll_fd, void *events, int maxevents, int timeout); -bool epoll_add(int fd, void *device); +bool epoll_add(int *epoll_fd, int fd, void *device); #endif diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 714e75f2c8..4ecaa21553 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -24,6 +24,9 @@ #include #include +#include +#include + #include #include "../common/epoll_common.h" @@ -46,8 +49,9 @@ struct linuxraw_joypad }; static struct linuxraw_joypad linuxraw_pads[MAX_USERS]; -static int g_inotify; -static bool g_hotplug; +static int linuxraw_epoll = 0; +static int linuxraw_inotify = 0; +static bool linuxraw_hotplug = false; static void linuxraw_poll_pad(struct linuxraw_joypad *pad) { @@ -100,7 +104,7 @@ static bool linuxraw_joypad_init_pad(const char *path, struct linuxraw_joypad *p { RARCH_LOG("[Device]: Found pad: %s on %s.\n", pad->ident, path); - if (g_hotplug) + if (linuxraw_hotplug) { char msg[512]; @@ -114,7 +118,7 @@ static bool linuxraw_joypad_init_pad(const char *path, struct linuxraw_joypad *p else RARCH_ERR("[Device]: Didn't find ident of %s.\n", path); - if (!epoll_add(pad->fd, pad)) + if (!epoll_add(&linuxraw_epoll, pad->fd, pad)) goto error; return true; @@ -134,7 +138,7 @@ static void handle_plugged_pad(void) if (!event_buf) return; - while ((rc = read(g_inotify, event_buf, event_size)) >= 0) + while ((rc = read(linuxraw_inotify, event_buf, event_size)) >= 0) { struct inotify_event *event = (struct inotify_event*)&event_buf[0]; @@ -158,7 +162,7 @@ static void handle_plugged_pad(void) { if (linuxraw_pads[idx].fd >= 0) { - if (g_hotplug) + if (linuxraw_hotplug) input_config_autoconfigure_disconnect(idx, linuxraw_pads[idx].ident); close(linuxraw_pads[idx].fd); @@ -204,7 +208,7 @@ static void linuxraw_joypad_poll(void) struct epoll_event events[MAX_USERS + 1]; retry: - ret = epoll_waiting(events, MAX_USERS + 1, 0); + ret = epoll_waiting(&linuxraw_epoll, events, MAX_USERS + 1, 0); if (ret < 0 && errno == EINTR) goto retry; @@ -224,7 +228,7 @@ static bool linuxraw_joypad_init(void *data) { unsigned i; - if (!epoll_new(true)) + if (!epoll_new(&linuxraw_epoll, true)) return false; for (i = 0; i < MAX_USERS; i++) @@ -255,16 +259,16 @@ static bool linuxraw_joypad_init(void *data) input_config_autoconfigure_joypad(¶ms); } - g_inotify = inotify_init(); + linuxraw_inotify = inotify_init(); - if (g_inotify >= 0) + if (linuxraw_inotify >= 0) { - fcntl(g_inotify, F_SETFL, fcntl(g_inotify, F_GETFL) | O_NONBLOCK); - inotify_add_watch(g_inotify, "/dev/input", IN_DELETE | IN_CREATE | IN_ATTRIB); - epoll_add(g_inotify, NULL); + fcntl(linuxraw_inotify, F_SETFL, fcntl(linuxraw_inotify, F_GETFL) | O_NONBLOCK); + inotify_add_watch(linuxraw_inotify, "/dev/input", IN_DELETE | IN_CREATE | IN_ATTRIB); + epoll_add(&linuxraw_epoll, linuxraw_inotify, NULL); } - g_hotplug = true; + linuxraw_hotplug = true; return true; } @@ -284,13 +288,13 @@ static void linuxraw_joypad_destroy(void) for (i = 0; i < MAX_USERS; i++) linuxraw_pads[i].fd = -1; - if (g_inotify >= 0) - close(g_inotify); - g_inotify = -1; + if (linuxraw_inotify >= 0) + close(linuxraw_inotify); + linuxraw_inotify = -1; - epoll_free(true); + epoll_free(&linuxraw_epoll, true); - g_hotplug = false; + linuxraw_hotplug = false; } static bool linuxraw_joypad_button(unsigned port, uint16_t joykey) From b63b67527464ef2f974f7f3ed4a4551528c18268 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 16:42:21 +0100 Subject: [PATCH 081/638] (linuxraw_joypad.c) Cleanups --- input/common/epoll_common.c | 19 ++----------------- input/common/epoll_common.h | 4 ++-- input/drivers_joypad/linuxraw_joypad.c | 4 ++-- 3 files changed, 6 insertions(+), 21 deletions(-) diff --git a/input/common/epoll_common.c b/input/common/epoll_common.c index 5ead3ec034..60a977f764 100644 --- a/input/common/epoll_common.c +++ b/input/common/epoll_common.c @@ -26,36 +26,21 @@ #include "../../verbosity.h" -static bool epoll_inited; -static bool epoll_first_inited_is_joypad; - -bool epoll_new(int *epoll_fd, bool is_joypad) +bool epoll_new(int *epoll_fd) { - if (epoll_inited) - return true; - *epoll_fd = epoll_create(32); if (*epoll_fd < 0) return false; - epoll_first_inited_is_joypad = is_joypad; - epoll_inited = true; - return true; } -void epoll_free(int *epoll_fd, bool is_joypad) +void epoll_free(int *epoll_fd) { - if (!epoll_inited || (is_joypad && !epoll_first_inited_is_joypad)) - return; - if (*epoll_fd >= 0) close(*epoll_fd); *epoll_fd = -1; - - epoll_inited = false; - epoll_first_inited_is_joypad = false; } int epoll_waiting(int *epoll_fd, void *events, int maxevents, int timeout) diff --git a/input/common/epoll_common.h b/input/common/epoll_common.h index a56fbdd2d3..1150d9982a 100644 --- a/input/common/epoll_common.h +++ b/input/common/epoll_common.h @@ -20,9 +20,9 @@ #include -bool epoll_new(int *epoll_fd, bool is_joypad); +bool epoll_new(int *epoll_fd); -void epoll_free(int *epoll_fd, bool is_joypad); +void epoll_free(int *epoll_fd); int epoll_waiting(int *epoll_fd, void *events, int maxevents, int timeout); diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 4ecaa21553..d5203d14e7 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -228,7 +228,7 @@ static bool linuxraw_joypad_init(void *data) { unsigned i; - if (!epoll_new(&linuxraw_epoll, true)) + if (!epoll_new(&linuxraw_epoll)) return false; for (i = 0; i < MAX_USERS; i++) @@ -292,7 +292,7 @@ static void linuxraw_joypad_destroy(void) close(linuxraw_inotify); linuxraw_inotify = -1; - epoll_free(&linuxraw_epoll, true); + epoll_free(&linuxraw_epoll); linuxraw_hotplug = false; } From 793519eb61ce81fe69acf8470c81eeaf313af2fb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 16:44:47 +0100 Subject: [PATCH 082/638] (linuxraw_joypad.c) Cleanups --- input/drivers_joypad/linuxraw_joypad.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index d5203d14e7..cec467c7de 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -28,6 +28,7 @@ #include #include +#include #include "../common/epoll_common.h" #include "../input_autodetect.h" @@ -179,15 +180,14 @@ static void handle_plugged_pad(void) /* Sometimes, device will be created before access to it is established. */ else if (event->mask & (IN_CREATE | IN_ATTRIB)) { - bool ret; char path[PATH_MAX_LENGTH]; path[0] = '\0'; snprintf(path, sizeof(path), "/dev/input/%s", event->name); - ret = linuxraw_joypad_init_pad(path, &linuxraw_pads[idx]); - if (*linuxraw_pads[idx].ident && ret) + if ( !string_is_empty(linuxraw_pads[idx].ident) + && linuxraw_joypad_init_pad(path, &linuxraw_pads[idx])) { params.idx = idx; strlcpy(params.name, linuxraw_pads[idx].ident, sizeof(params.name)); @@ -347,10 +347,10 @@ static bool linuxraw_joypad_query_pad(unsigned pad) static const char *linuxraw_joypad_name(unsigned pad) { - if (pad >= MAX_USERS) + if (pad >= MAX_USERS || string_is_empty(linuxraw_pads[pad].ident)) return NULL; - return *linuxraw_pads[pad].ident ? linuxraw_pads[pad].ident : NULL; + return linuxraw_pads[pad].ident; } input_device_driver_t linuxraw_joypad = { From ebe1ac696759a57239a31b4937f1402e24d19e94 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 16:46:32 +0100 Subject: [PATCH 083/638] (udev_joypad.c) Cleanups --- input/drivers_joypad/udev_joypad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index 69c3385ae0..59014c73d5 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -280,7 +280,7 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char pad->fd = fd; pad->path = strdup(path); - if (*pad->ident) + if (!string_is_empty(pad->ident)) { params.idx = p; strlcpy(params.name, pad->ident, sizeof(params.name)); @@ -636,10 +636,10 @@ static bool udev_joypad_query_pad(unsigned pad) static const char *udev_joypad_name(unsigned pad) { - if (pad >= MAX_USERS) + if (pad >= MAX_USERS || string_is_empty(udev_pads[pad].ident)) return NULL; - return *udev_pads[pad].ident ? udev_pads[pad].ident : NULL; + return udev_pads[pad].ident; } input_device_driver_t udev_joypad = { From 200be98052be2042391845be9c5528fe8b3bd303 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 16:51:43 +0100 Subject: [PATCH 084/638] (udev_input.c) use udev_common.c --- input/drivers/udev_input.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 1600048f0b..b8b760fad7 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -42,6 +42,7 @@ #include "../drivers_keyboard/keyboard_event_udev.h" #include "../common/linux_common.h" #include "../common/udev_common.h" +#include "../common/epoll_common.h" #include "../input_config.h" #include "../input_joypad_driver.h" @@ -234,7 +235,6 @@ static bool add_device(udev_input_t *udev, udev_input_device_t **tmp; udev_input_device_t *device = NULL; struct stat st = {0}; - struct epoll_event event = {0}; if (stat(devnode, &st) < 0) return false; @@ -268,13 +268,7 @@ static bool add_device(udev_input_t *udev, tmp[udev->num_devices++] = device; udev->devices = tmp; - event.events = EPOLLIN; - event.data.ptr = device; - - /* Shouldn't happen, but just check it. */ - if (epoll_ctl(udev->epfd, EPOLL_CTL_ADD, fd, &event) < 0) - RARCH_ERR("Failed to add FD (%d) to epoll list (%s).\n", - fd, strerror(errno)); + epoll_add(&udev->epfd, fd, device); return true; @@ -373,7 +367,7 @@ static void udev_input_poll(void *data) while (udev->monitor && udev_hotplug_available(udev->monitor)) udev_input_handle_hotplug(udev); - ret = epoll_wait(udev->epfd, events, ARRAY_SIZE(events), 0); + ret = epoll_waiting(&udev->epfd, events, ARRAY_SIZE(events), 0); for (i = 0; i < ret; i++) { @@ -552,8 +546,7 @@ static void udev_input_free(void *data) if (udev->joypad) udev->joypad->destroy(); - if (udev->epfd >= 0) - close(udev->epfd); + epoll_free(&udev->epfd); for (i = 0; i < udev->num_devices; i++) { @@ -638,8 +631,7 @@ static void *udev_input_init(void) goto error; #endif - udev->epfd = epoll_create(32); - if (udev->epfd < 0) + if (!epoll_new(&udev->epfd)) { RARCH_ERR("Failed to create epoll FD.\n"); goto error; From 31a95b897214e0214b776b92132156945789822a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 17:31:26 +0100 Subject: [PATCH 085/638] (android_input.c) Get rid of HAVE_MENU ifdefs --- input/drivers/android_input.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 6f6cb4629b..cabbb59012 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -342,9 +342,7 @@ static void android_input_poll_main_cmd(void) runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); -#ifdef HAVE_MENU video_driver_unset_stub_frame(); -#endif if ((android_app->sensor_state_mask & (UINT64_C(1) << RETRO_SENSOR_ACCELEROMETER_ENABLE)) @@ -364,9 +362,7 @@ static void android_input_poll_main_cmd(void) runloop_ctl(RUNLOOP_CTL_SET_PAUSED, &boolean); runloop_ctl(RUNLOOP_CTL_SET_IDLE, &boolean); -#ifdef HAVE_MENU video_driver_set_stub_frame(); -#endif /* Avoid draining battery while app is not being used. */ if ((android_app->sensor_state_mask From a9e627ca572592e3998655217a24e254e25c3e1a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 17:33:41 +0100 Subject: [PATCH 086/638] (udev_input.c) Rename static function --- input/drivers/udev_input.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index b8b760fad7..d904f78537 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -228,7 +228,7 @@ static void udev_handle_mouse(void *data, } } -static bool add_device(udev_input_t *udev, +static bool udev_input_add_device(udev_input_t *udev, const char *devnode, device_handle_cb cb) { int fd; @@ -339,7 +339,7 @@ static void udev_input_handle_hotplug(udev_input_t *udev) cb = udev_handle_mouse; RARCH_LOG("[udev]: Hotplug add %s: %s.\n", devtype, devnode); - add_device(udev, devnode, cb); + udev_input_add_device(udev, devnode, cb); } else if (string_is_equal(action, "remove")) { @@ -592,7 +592,7 @@ static bool open_devices(udev_input_t *udev, const char *type, device_handle_cb int fd = open(devnode, O_RDONLY | O_NONBLOCK); RARCH_LOG("[udev] Adding device %s as type %s.\n", devnode, type); - if (!add_device(udev, devnode, cb)) + if (!udev_input_add_device(udev, devnode, cb)) RARCH_ERR("[udev] Failed to open device: %s (%s).\n", devnode, strerror(errno)); close(fd); } From c1e343cec86383d20141dbe8147811552402591a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 17:37:27 +0100 Subject: [PATCH 087/638] Cleanup hid_joypad_name --- input/drivers_joypad/hid_joypad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/input/drivers_joypad/hid_joypad.c b/input/drivers_joypad/hid_joypad.c index fb504698da..11edf0dfa0 100644 --- a/input/drivers_joypad/hid_joypad.c +++ b/input/drivers_joypad/hid_joypad.c @@ -86,7 +86,9 @@ static bool hid_joypad_rumble(unsigned pad, static const char *hid_joypad_name(unsigned pad) { - return generic_hid->name((void*)hid_driver_get_data(), pad); + if (generic_hid && generic_hid->name) + return generic_hid->name((void*)hid_driver_get_data(), pad); + return NULL; } input_device_driver_t hid_joypad = { From debf5e0222847836fa50bfc882a1fd5538f23491 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 17:39:36 +0100 Subject: [PATCH 088/638] Rename g_udev and g_udev_mon --- input/drivers_joypad/udev_joypad.c | 38 ++++++++++++++++-------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index 59014c73d5..eccb4cb56e 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -84,8 +84,8 @@ struct udev_joypad int32_t pid; }; -static struct udev *g_udev; -static struct udev_monitor *g_udev_mon; +static struct udev *udev_joypad_fd; +static struct udev_monitor *udev_joypad_mon; static struct udev_joypad udev_pads[MAX_USERS]; static INLINE int16_t udev_compute_axis(const struct input_absinfo *info, int value) @@ -401,12 +401,14 @@ static void udev_joypad_destroy(void) for (i = 0; i < MAX_USERS; i++) udev_free_pad(i); - if (g_udev_mon) - udev_monitor_unref(g_udev_mon); - g_udev_mon = NULL; - if (g_udev) - udev_unref(g_udev); - g_udev = NULL; + if (udev_joypad_mon) + udev_monitor_unref(udev_joypad_mon); + + if (udev_joypad_fd) + udev_unref(udev_joypad_fd); + + udev_joypad_mon = NULL; + udev_joypad_fd = NULL; } static void udev_joypad_handle_hotplug(struct udev_device *dev) @@ -506,9 +508,9 @@ static void udev_joypad_poll(void) { unsigned i; - while (g_udev_mon && udev_hotplug_available(g_udev_mon)) + while (udev_joypad_mon && udev_hotplug_available(udev_joypad_mon)) { - struct udev_device *dev = udev_monitor_receive_device(g_udev_mon); + struct udev_device *dev = udev_monitor_receive_device(udev_joypad_mon); if (dev) udev_joypad_handle_hotplug(dev); } @@ -529,18 +531,18 @@ static bool udev_joypad_init(void *data) for (i = 0; i < MAX_USERS; i++) udev_pads[i].fd = -1; - g_udev = udev_new(); - if (!g_udev) + udev_joypad_fd = udev_new(); + if (!udev_joypad_fd) return false; - g_udev_mon = udev_monitor_new_from_netlink(g_udev, "udev"); - if (g_udev_mon) + udev_joypad_mon = udev_monitor_new_from_netlink(udev_joypad_fd, "udev"); + if (udev_joypad_mon) { - udev_monitor_filter_add_match_subsystem_devtype(g_udev_mon, "input", NULL); - udev_monitor_enable_receiving(g_udev_mon); + udev_monitor_filter_add_match_subsystem_devtype(udev_joypad_mon, "input", NULL); + udev_monitor_enable_receiving(udev_joypad_mon); } - enumerate = udev_enumerate_new(g_udev); + enumerate = udev_enumerate_new(udev_joypad_fd); if (!enumerate) goto error; @@ -551,7 +553,7 @@ static bool udev_joypad_init(void *data) for (item = devs; item; item = udev_list_entry_get_next(item)) { const char *name = udev_list_entry_get_name(item); - struct udev_device *dev = udev_device_new_from_syspath(g_udev, name); + struct udev_device *dev = udev_device_new_from_syspath(udev_joypad_fd, name); const char *devnode = udev_device_get_devnode(dev); if (devnode) From ba54f206263eccb21893b8d7e8e4e2c1a58fdf13 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Thu, 1 Dec 2016 12:13:36 -0500 Subject: [PATCH 089/638] initial libcaca video driver --- Makefile.common | 10 + gfx/common/caca_common.h | 36 +++ gfx/drivers/caca_gfx.c | 355 +++++++++++++++++++++++ gfx/drivers_font/caca_font.c | 139 +++++++++ gfx/font_driver.c | 34 +++ gfx/font_driver.h | 4 +- gfx/video_driver.c | 3 + gfx/video_driver.h | 1 + griffin/griffin.c | 8 + input/drivers/udev_input.c | 3 + menu/drivers_display/menu_display_caca.c | 101 +++++++ menu/menu_display.c | 7 + menu/menu_display.h | 4 +- 13 files changed, 703 insertions(+), 2 deletions(-) create mode 100644 gfx/common/caca_common.h create mode 100644 gfx/drivers/caca_gfx.c create mode 100644 gfx/drivers_font/caca_font.c create mode 100644 menu/drivers_display/menu_display_caca.c diff --git a/Makefile.common b/Makefile.common index 6b9f0b197a..afc39be629 100644 --- a/Makefile.common +++ b/Makefile.common @@ -713,6 +713,16 @@ ifeq ($(HAVE_KMS), 1) LIBS += $(GBM_LIBS) $(DRM_LIBS) $(EGL_LIBS) endif +ifeq ($(HAVE_CACA), 1) + DEFINES += -DHAVE_CACA + OBJ += gfx/drivers/caca_gfx.o gfx/drivers_font/caca_font.o + LIBS += -lcaca + + ifeq ($(HAVE_MENU_COMMON), 1) + OBJ += menu/drivers_display/menu_display_caca.o + endif +endif + ifeq ($(HAVE_PLAIN_DRM), 1) OBJ += gfx/drivers/drm_gfx.o CFLAGS += -I/usr/include/libdrm diff --git a/gfx/common/caca_common.h b/gfx/common/caca_common.h new file mode 100644 index 0000000000..ead5ceb5e2 --- /dev/null +++ b/gfx/common/caca_common.h @@ -0,0 +1,36 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * copyright (c) 2011-2015 - Daniel De Matteis + * copyright (c) 2016 - Brad Parker + * + * 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 . + */ + +#ifndef __CACA_COMMON_H +#define __CACA_COMMON_H + +struct caca_canvas; +struct caca_dither; +struct caca_display; + +typedef struct caca_canvas caca_canvas_t; +typedef struct caca_dither caca_dither_t; +typedef struct caca_display caca_display_t; + +typedef struct caca +{ + caca_canvas_t **caca_cv; + caca_dither_t **caca_dither; + caca_display_t **caca_display; +} caca_t; + +#endif diff --git a/gfx/drivers/caca_gfx.c b/gfx/drivers/caca_gfx.c new file mode 100644 index 0000000000..210327f2a1 --- /dev/null +++ b/gfx/drivers/caca_gfx.c @@ -0,0 +1,355 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2016 - Brad Parker + * + * 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 "../../driver.h" +#include "../../configuration.h" +#include "../../verbosity.h" +#include "../../menu/menu_driver.h" +#include "../common/caca_common.h" + +static caca_canvas_t *caca_cv = NULL; +static caca_dither_t *caca_dither = NULL; +static caca_display_t *caca_display = NULL; +static unsigned char *caca_menu_frame = NULL; +static unsigned caca_menu_width = 0; +static unsigned caca_menu_height = 0; +static unsigned caca_menu_pitch = 0; +static unsigned caca_video_width = 0; +static unsigned caca_video_height = 0; +static unsigned caca_video_pitch = 0; +static bool caca_rgb32 = 0; + +static void caca_gfx_free(void *data); + +static void caca_gfx_create() +{ + caca_display = caca_create_display(NULL); + caca_cv = caca_get_canvas(caca_display); + + if(!caca_video_width || !caca_video_height) + { + caca_video_width = caca_get_canvas_width(caca_cv); + caca_video_height = caca_get_canvas_height(caca_cv); + } + + if (caca_rgb32) + caca_dither = caca_create_dither(32, caca_video_width, caca_video_height, caca_video_pitch, + 0x00ff0000, 0xff00, 0xff, 0x0); + else + caca_dither = caca_create_dither(16, caca_video_width, caca_video_height, caca_video_pitch, + 0xf800, 0x7e0, 0x1f, 0x0); + + video_driver_set_size(&caca_video_width, &caca_video_height); +} + +static void *caca_gfx_init(const video_info_t *video, + const input_driver_t **input, void **input_data) +{ + settings_t *settings = config_get_ptr(); + caca_t *caca = (caca_t*)calloc(1, sizeof(*caca)); + + caca->caca_cv = &caca_cv; + caca->caca_dither = &caca_dither; + caca->caca_display = &caca_display; + + *input = NULL; + *input_data = NULL; + + caca_video_width = video->width; + caca_video_height = video->height; + caca_rgb32 = video->rgb32; + + if (video->rgb32) + caca_video_pitch = video->width * 4; + else + caca_video_pitch = video->width * 2; + + caca_gfx_create(); + + if (!caca_cv || !caca_dither || !caca_display) + { + /* TODO: handle errors */ + } + + if (settings->video.font_enable) + font_driver_init_osd(NULL, false, FONT_DRIVER_RENDER_CACA); + + return caca; +} + +static bool caca_gfx_frame(void *data, const void *frame, + unsigned frame_width, unsigned frame_height, uint64_t frame_count, + unsigned pitch, const char *msg) +{ + size_t len = 0; + void *buffer = NULL; + const void *frame_to_copy = frame; + unsigned width = 0; + unsigned height = 0; + bool draw = true; + + (void)data; + (void)frame; + (void)frame_width; + (void)frame_height; + (void)pitch; + (void)msg; + + if (!frame || !frame_width || !frame_height) + return true; + + if (caca_video_width != frame_width || caca_video_height != frame_height || caca_video_pitch != pitch) + { + if (frame_width > 4 && frame_height > 4) + { + caca_video_width = frame_width; + caca_video_height = frame_height; + caca_video_pitch = pitch; + caca_gfx_free(NULL); + caca_gfx_create(); + } + } + + if (!caca_cv) + return true; + + if (caca_menu_frame) + frame_to_copy = caca_menu_frame; + + width = caca_get_canvas_width(caca_cv); + height = caca_get_canvas_height(caca_cv); + + if (frame_to_copy == frame && frame_width == 4 && frame_height == 4 && (frame_width < width && frame_height < height)) + draw = false; + + caca_clear_canvas(caca_cv); + +#ifdef HAVE_MENU + menu_driver_ctl(RARCH_MENU_CTL_FRAME, NULL); +#endif + + if (msg) + font_driver_render_msg(NULL, msg, NULL); + + if (draw) + { + caca_dither_bitmap(caca_cv, 0, 0, + width, + height, + caca_dither, frame_to_copy); + + buffer = caca_export_canvas_to_memory(caca_cv, "caca", &len); + + if (buffer) + { + if (len) + caca_refresh_display(caca_display); + + free(buffer); + } + } + + return true; +} + +static void caca_gfx_set_nonblock_state(void *data, bool toggle) +{ + (void)data; + (void)toggle; +} + +static bool caca_gfx_alive(void *data) +{ + (void)data; + video_driver_set_size(&caca_video_width, &caca_video_height); + return true; +} + +static bool caca_gfx_focus(void *data) +{ + (void)data; + return true; +} + +static bool caca_gfx_suppress_screensaver(void *data, bool enable) +{ + (void)data; + (void)enable; + return false; +} + +static bool caca_gfx_has_windowed(void *data) +{ + (void)data; + return true; +} + +static void caca_gfx_free(void *data) +{ + (void)data; + + if (caca_display) + { + caca_free_display(caca_display); + caca_display = NULL; + } + + if (caca_dither) + { + caca_free_dither(caca_dither); + caca_dither = NULL; + } + + if (caca_menu_frame) + { + free(caca_menu_frame); + caca_menu_frame = NULL; + } +} + +static bool caca_gfx_set_shader(void *data, + enum rarch_shader_type type, const char *path) +{ + (void)data; + (void)type; + (void)path; + + return false; +} + +static void caca_gfx_set_rotation(void *data, + unsigned rotation) +{ + (void)data; + (void)rotation; +} + +static void caca_gfx_viewport_info(void *data, + struct video_viewport *vp) +{ + (void)data; + (void)vp; +} + +static bool caca_gfx_read_viewport(void *data, uint8_t *buffer) +{ + (void)data; + (void)buffer; + + return true; +} + +static void caca_set_texture_frame(void *data, + const void *frame, bool rgb32, unsigned width, unsigned height, + float alpha) +{ + unsigned pitch = width * 2; + + if (rgb32) + pitch = width * 4; + + if (caca_menu_frame) + { + free(caca_menu_frame); + caca_menu_frame = NULL; + } + + if (!caca_menu_frame || caca_menu_width != width || caca_menu_height != height || caca_menu_pitch != pitch) + if (pitch && height) + caca_menu_frame = (unsigned char*)malloc(pitch * height); + + if (caca_menu_frame && frame && pitch && height) + memcpy(caca_menu_frame, frame, pitch * height); +} + +static void caca_set_osd_msg(void *data, const char *msg, + const struct font_params *params, void *font) +{ + font_driver_render_msg(font, msg, params); +} + +static const video_poke_interface_t caca_poke_interface = { + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, + NULL, +#ifdef HAVE_FBO + NULL, +#else + NULL, +#endif + NULL, + NULL, + NULL, +#if defined(HAVE_MENU) + caca_set_texture_frame, + NULL, + caca_set_osd_msg, + NULL, +#else + NULL, + NULL, + NULL, + NULL, +#endif + + NULL, +#ifdef HAVE_MENU + NULL, +#endif +}; + +static void caca_gfx_get_poke_interface(void *data, + const video_poke_interface_t **iface) +{ + (void)data; + *iface = &caca_poke_interface; +} + +void caca_gfx_set_viewport(void *data, unsigned viewport_width, + unsigned viewport_height, bool force_full, bool allow_rotate) +{ +} + +video_driver_t video_caca = { + caca_gfx_init, + caca_gfx_frame, + caca_gfx_set_nonblock_state, + caca_gfx_alive, + caca_gfx_focus, + caca_gfx_suppress_screensaver, + caca_gfx_has_windowed, + caca_gfx_set_shader, + caca_gfx_free, + "caca", + caca_gfx_set_viewport, + caca_gfx_set_rotation, + caca_gfx_viewport_info, + caca_gfx_read_viewport, + NULL, /* read_frame_raw */ + +#ifdef HAVE_OVERLAY + NULL, /* overlay_interface */ +#endif + caca_gfx_get_poke_interface, +}; diff --git a/gfx/drivers_font/caca_font.c b/gfx/drivers_font/caca_font.c new file mode 100644 index 0000000000..c57088ab82 --- /dev/null +++ b/gfx/drivers_font/caca_font.c @@ -0,0 +1,139 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2010-2014 - Hans-Kristian Arntzen + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2016 - Brad Parker + * + * 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 + +#ifdef HAVE_CONFIG_H +#include "../../config.h" +#endif + +#include "../font_driver.h" +#include "../../runloop.h" +#include "../../configuration.h" +#include "../../verbosity.h" +#include "../common/caca_common.h" + +typedef struct +{ + const font_renderer_driver_t *caca_font_driver; + void *caca_font_data; + caca_t *caca; +} caca_raster_t; + +static void *caca_init_font(void *data, + const char *font_path, float font_size) +{ + caca_raster_t *font = (caca_raster_t*)calloc(1, sizeof(*font)); + + if (!font) + return NULL; + + font->caca = (caca_t*)data; + + font_size = 1; + + if (!font_renderer_create_default((const void**)&font->caca_font_driver, + &font->caca_font_data, font_path, font_size)) + { + RARCH_WARN("Couldn't initialize font renderer.\n"); + return NULL; + } + + return font; +} + +static void caca_render_free_font(void *data) +{ + +} + +static int caca_get_message_width(void *data, const char *msg, + unsigned msg_len, float scale) +{ + return 0; +} + +static const struct font_glyph *caca_font_get_glyph( + void *data, uint32_t code) +{ + return NULL; +} + +static void caca_render_msg(void *data, const char *msg, + const void *userdata) +{ + caca_raster_t *font = (caca_raster_t*)data; + float x, y; + unsigned width, height; + unsigned newX, newY; + settings_t *settings = config_get_ptr(); + const struct font_params *params = (const struct font_params*)userdata; + + if (!font || string_is_empty(msg)) + return; + + if (params) + { + x = params->x; + y = params->y; + } + else + { + x = settings->video.msg_pos_x; + y = settings->video.msg_pos_y; + } + + if (!font->caca || !font->caca->caca_cv || !font->caca->caca_display || + !*font->caca->caca_cv || !*font->caca->caca_display) + return; + + width = caca_get_canvas_width(*font->caca->caca_cv); + height = caca_get_canvas_height(*font->caca->caca_cv); + + newX = x * width; + newY = height - (y * height); + + if (strlen(msg) + newX > width) + newX -= strlen(msg) + newX - width; + + caca_put_str(*font->caca->caca_cv, newX, newY, msg); + + caca_refresh_display(*font->caca->caca_display); +} + +static void caca_font_flush_block(void* data) +{ + (void)data; +} + +static void caca_font_bind_block(void* data, void* userdata) +{ + (void)data; +} + +font_renderer_t caca_font = { + caca_init_font, + caca_render_free_font, + caca_render_msg, + "caca font", + caca_font_get_glyph, /* get_glyph */ + caca_font_bind_block, /* bind_block */ + caca_font_flush_block, /* flush */ + caca_get_message_width /* get_message_width */ +}; diff --git a/gfx/font_driver.c b/gfx/font_driver.c index f7bb8d082e..ef02618808 100644 --- a/gfx/font_driver.c +++ b/gfx/font_driver.c @@ -149,6 +149,35 @@ static bool gl_font_init_first( } #endif +#ifdef HAVE_CACA +static const font_renderer_t *caca_font_backends[] = { + &caca_font, + NULL, +}; + +static bool caca_font_init_first( + const void **font_driver, void **font_handle, + void *video_data, const char *font_path, float font_size) +{ + unsigned i; + + for (i = 0; caca_font_backends[i]; i++) + { + void *data = caca_font_backends[i]->init( + video_data, font_path, font_size); + + if (!data) + continue; + + *font_driver = caca_font_backends[i]; + *font_handle = data; + return true; + } + + return false; +} +#endif + #ifdef HAVE_VULKAN static const font_renderer_t *vulkan_font_backends[] = { &vulkan_raster_font, @@ -267,6 +296,11 @@ static bool font_init_first( case FONT_DRIVER_RENDER_CTR: return ctr_font_init_first(font_driver, font_handle, video_data, font_path, font_size); +#endif +#ifdef HAVE_CACA + case FONT_DRIVER_RENDER_CACA: + return caca_font_init_first(font_driver, font_handle, + video_data, font_path, font_size); #endif case FONT_DRIVER_RENDER_DONT_CARE: /* TODO/FIXME - lookup graphics driver's 'API' */ diff --git a/gfx/font_driver.h b/gfx/font_driver.h index 931091376f..6d3e374780 100644 --- a/gfx/font_driver.h +++ b/gfx/font_driver.h @@ -31,7 +31,8 @@ enum font_driver_render_api FONT_DRIVER_RENDER_DIRECT3D_API, FONT_DRIVER_RENDER_VITA2D, FONT_DRIVER_RENDER_CTR, - FONT_DRIVER_RENDER_VULKAN_API + FONT_DRIVER_RENDER_VULKAN_API, + FONT_DRIVER_RENDER_CACA }; enum text_alignment @@ -162,6 +163,7 @@ extern font_renderer_t d3d_win32_font; extern font_renderer_t vita2d_vita_font; extern font_renderer_t ctr_font; extern font_renderer_t vulkan_raster_font; +extern font_renderer_t caca_font; extern font_renderer_driver_t stb_font_renderer; extern font_renderer_driver_t stb_unicode_font_renderer; diff --git a/gfx/video_driver.c b/gfx/video_driver.c index f40fb0ba0a..69a9a8842b 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -223,6 +223,9 @@ static const video_driver_t *video_drivers[] = { #endif #ifdef HAVE_XSHM &video_xshm, +#endif +#ifdef HAVE_CACA + &video_caca, #endif &video_null, NULL, diff --git a/gfx/video_driver.h b/gfx/video_driver.h index 2a8b66792b..85f9823dfd 100644 --- a/gfx/video_driver.h +++ b/gfx/video_driver.h @@ -512,6 +512,7 @@ extern video_driver_t video_dispmanx; extern video_driver_t video_sunxi; extern video_driver_t video_drm; extern video_driver_t video_xshm; +extern video_driver_t video_caca; extern video_driver_t video_null; extern const void *frame_cache_data; diff --git a/griffin/griffin.c b/griffin/griffin.c index e6cc4b3451..3a5211a7b0 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -396,6 +396,10 @@ FONTS #include "../gfx/drivers_font/ctr_font.c" #endif +#if defined(HAVE_CACA) +#include "../gfx/drivers_font/caca_font.c" +#endif + #if defined(HAVE_VULKAN) #include "../gfx/drivers_font/vulkan_raster_font.c" @@ -973,6 +977,10 @@ MENU #include "../menu/drivers_display/menu_display_ctr.c" #endif +#ifdef HAVE_CACA +#include "../menu/drivers_display/menu_display_caca.c" +#endif + #endif diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index d904f78537..403011b241 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -498,6 +498,9 @@ static int16_t udev_input_state(void *data, const struct retro_keybind **binds, int16_t ret; udev_input_t *udev = (udev_input_t*)data; + if (!udev) + return 0; + switch (device) { case RETRO_DEVICE_JOYPAD: diff --git a/menu/drivers_display/menu_display_caca.c b/menu/drivers_display/menu_display_caca.c new file mode 100644 index 0000000000..1fbca75a6b --- /dev/null +++ b/menu/drivers_display/menu_display_caca.c @@ -0,0 +1,101 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2016 - Brad Parker + * + * 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 "../../config.def.h" +#include "../../gfx/font_driver.h" +#include "../../gfx/video_context_driver.h" + +#include "../menu_display.h" + +static void *menu_display_caca_get_default_mvp(void) +{ + return NULL; +} + +static void menu_display_caca_blend_begin(void) +{ +} + +static void menu_display_caca_blend_end(void) +{ +} + +static void menu_display_caca_draw(void *data) +{ + (void)data; +} + +static void menu_display_caca_draw_pipeline(void *data) +{ + (void)data; +} + +static void menu_display_caca_viewport(void *data) +{ + (void)data; +} + +static void menu_display_caca_restore_clear_color(void) +{ +} + +static void menu_display_caca_clear_color(menu_display_ctx_clearcolor_t *clearcolor) +{ + (void)clearcolor; +} + +static bool menu_display_caca_font_init_first( + void **font_handle, void *video_data, + const char *font_path, float font_size) +{ + font_data_t **handle = (font_data_t**)font_handle; + *handle = font_driver_init_first(video_data, + font_path, font_size, true, FONT_DRIVER_RENDER_CACA); + return *handle; +} + +static const float *menu_display_caca_get_default_vertices(void) +{ + static float dummy[16] = {0.0f}; + return &dummy[0]; +} + +static const float *menu_display_caca_get_default_tex_coords(void) +{ + static float dummy[16] = {0.0f}; + return &dummy[0]; +} + +menu_display_ctx_driver_t menu_display_ctx_caca = { + menu_display_caca_draw, + menu_display_caca_draw_pipeline, + menu_display_caca_viewport, + menu_display_caca_blend_begin, + menu_display_caca_blend_end, + menu_display_caca_restore_clear_color, + menu_display_caca_clear_color, + menu_display_caca_get_default_mvp, + menu_display_caca_get_default_vertices, + menu_display_caca_get_default_tex_coords, + menu_display_caca_font_init_first, + MENU_VIDEO_DRIVER_CACA, + "menu_display_caca", +}; diff --git a/menu/menu_display.c b/menu/menu_display.c index ad06916709..75ed2a78f5 100644 --- a/menu/menu_display.c +++ b/menu/menu_display.c @@ -79,6 +79,9 @@ static menu_display_ctx_driver_t *menu_display_ctx_drivers[] = { #endif #ifdef _3DS &menu_display_ctx_ctr, +#endif +#ifdef HAVE_CACA + &menu_display_ctx_caca, #endif &menu_display_ctx_null, NULL, @@ -135,6 +138,10 @@ static bool menu_display_check_compatibility( if (string_is_equal(video_driver, "ctr")) return true; break; + case MENU_VIDEO_DRIVER_CACA: + if (string_is_equal(video_driver, "caca")) + return true; + break; } return false; diff --git a/menu/menu_display.h b/menu/menu_display.h index c49d4f723a..f02befd3c9 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -92,7 +92,8 @@ enum menu_display_driver_type MENU_VIDEO_DRIVER_VULKAN, MENU_VIDEO_DRIVER_DIRECT3D, MENU_VIDEO_DRIVER_VITA2D, - MENU_VIDEO_DRIVER_CTR + MENU_VIDEO_DRIVER_CTR, + MENU_VIDEO_DRIVER_CACA }; typedef struct menu_display_ctx_clearcolor @@ -283,6 +284,7 @@ extern menu_display_ctx_driver_t menu_display_ctx_vulkan; extern menu_display_ctx_driver_t menu_display_ctx_d3d; extern menu_display_ctx_driver_t menu_display_ctx_vita2d; extern menu_display_ctx_driver_t menu_display_ctx_ctr; +extern menu_display_ctx_driver_t menu_display_ctx_caca; extern menu_display_ctx_driver_t menu_display_ctx_null; RETRO_END_DECLS From 83c6db746ec3ac6728c9b0dc3dac42e260d85591 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:24:07 +0100 Subject: [PATCH 090/638] Add libcaca switch --- qb/config.libs.sh | 1 + qb/config.params.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/qb/config.libs.sh b/qb/config.libs.sh index 6d789eac9f..3145ffcdce 100644 --- a/qb/config.libs.sh +++ b/qb/config.libs.sh @@ -209,6 +209,7 @@ if [ "$HAVE_DYLIB" = 'no' ] && [ "$HAVE_DYNAMIC" = 'yes' ]; then fi check_pkgconf ALSA alsa +check_lib CACA -lcaca check_header OSS sys/soundcard.h check_header OSS_BSD soundcard.h check_lib OSS_LIB -lossaudio diff --git a/qb/config.params.sh b/qb/config.params.sh index 3a338d8872..cb732e6448 100644 --- a/qb/config.params.sh +++ b/qb/config.params.sh @@ -1,3 +1,4 @@ +HAVE_CACA=no # Libcaca support HAVE_LIBRETRODB=yes # Libretrodb support HAVE_RGUI=yes # RGUI menu HAVE_MATERIALUI=auto # MaterialUI menu From 71ea15fed20d228b6e75dd27d90dc232611ae721 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:35:30 +0100 Subject: [PATCH 091/638] Use string_is_empty --- input/input_autodetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 43cede3528..4f6a75b3dc 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -137,7 +137,7 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, /* This will be the case if input driver is reinitialized. * No reason to spam autoconfigure messages every time. */ block_osd_spam = settings->input.autoconfigured[params->idx] - && *params->name; + && !string_is_empty(params->name); settings->input.autoconfigured[params->idx] = true; input_autoconfigure_joypad_conf(conf, @@ -303,7 +303,7 @@ bool input_config_autoconfigure_joypad(autoconfig_params_t *params) if (!input_config_autoconfigure_joypad_init(params)) goto error; - if (!*params->name) + if (string_is_empty(params->name)) goto error; if (input_autoconfigure_joypad_from_conf_dir(params)) From a485f1559d4ae9c937d1541bf73ec5e27ca55575 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:36:50 +0100 Subject: [PATCH 092/638] Move static bool variable --- input/input_autodetect.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 4f6a75b3dc..6a4474e66d 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -121,7 +121,6 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, char display_name[128]; char device_type[128]; bool block_osd_spam = false; - static bool remote_is_bound = false; settings_t *settings = config_get_ptr(); msg[0] = display_name[0] = device_type[0] = '\0'; @@ -145,6 +144,8 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, if (string_is_equal(device_type, "remote")) { + static bool remote_is_bound = false; + snprintf(msg, sizeof(msg), "%s configured.", string_is_empty(display_name) ? params->name : display_name); From a692b5953f3007175f36674cd935d5a166116bcb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:38:11 +0100 Subject: [PATCH 093/638] Put parentheses around conditionals --- input/input_autodetect.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 6a4474e66d..1d5e0cd6e2 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -95,10 +95,10 @@ static int input_try_autoconfigure_joypad_from_conf(config_file_t *conf, /* Check for VID/PID */ if ( (params->vid == input_vid) && (params->pid == input_pid) - && params->vid != 0 - && params->pid != 0 - && input_vid != 0 - && input_pid != 0) + && (params->vid != 0) + && (params->pid != 0) + && (input_vid != 0) + && (input_pid != 0)) score += 3; /* Check for name match */ From e689d554149ad43956f2218499bd3d54f39deddb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:52:34 +0100 Subject: [PATCH 094/638] Rename autoconfig functions --- input/drivers/android_input.c | 2 +- input/drivers/qnx_input.c | 7 +++++-- input/drivers_hid/iohidmanager_hid.c | 5 +++-- input/drivers_hid/libusb_hid.c | 6 +++--- input/drivers_hid/wiiusb_hid.c | 12 +++++++----- input/drivers_joypad/ctr_joypad.c | 3 ++- input/drivers_joypad/dinput_joypad.c | 4 +++- input/drivers_joypad/gx_joypad.c | 2 +- input/drivers_joypad/linuxraw_joypad.c | 12 +++++++----- input/drivers_joypad/parport_joypad.c | 3 ++- input/drivers_joypad/ps3_joypad.c | 5 +++-- input/drivers_joypad/psp_joypad.c | 4 ++-- input/drivers_joypad/qnx_joypad.c | 5 +++-- input/drivers_joypad/sdl_joypad.c | 6 +++--- input/drivers_joypad/udev_joypad.c | 4 ++-- input/drivers_joypad/wiiu_joypad.c | 3 ++- input/drivers_joypad/xdk_joypad.c | 6 +++--- input/drivers_joypad/xinput_joypad.c | 2 +- input/input_autodetect.c | 18 +++++++++--------- input/input_autodetect.h | 4 ++-- 20 files changed, 64 insertions(+), 49 deletions(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index cabbb59012..d786743345 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -902,7 +902,7 @@ static void handle_hotplug(android_input_data_t *android_data, settings->input.vid[*port] = params.vid; strlcpy(params.driver, android_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } if (!string_is_empty(name_buf)) diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index 2fe42ac8d2..7406d7fe8d 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -212,12 +212,15 @@ static void qnx_input_autodetect_gamepad(qnx_input_t *qnx, strlcpy(settings->input.device_names[port], name_buf, sizeof(settings->input.device_names[port])); - params.idx = port; strlcpy(params.name, name_buf, sizeof(params.name)); + + params.idx = port; params.vid = *controller->vid; params.pid = *controller->pid; + strlcpy(params.driver, qnx->joypad->ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); controller->port = port; qnx->port_device[port] = controller; diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 59cfded077..27897e2e1f 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -247,7 +247,7 @@ static void iohidmanager_hid_device_remove(void *data, if (hid && adapter && (adapter->slot < MAX_USERS)) { - input_config_autoconfigure_disconnect(adapter->slot, adapter->name); + input_autoconfigure_disconnect(adapter->slot, adapter->name); hid->buttons[adapter->slot] = 0; memset(hid->axes[adapter->slot], 0, sizeof(hid->axes)); @@ -309,7 +309,8 @@ static void iohidmanager_hid_device_add_autodetect(unsigned idx, strlcpy(params.name, device_name, sizeof(params.name)); strlcpy(params.driver, driver_name, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); + RARCH_LOG("Port %d: %s.\n", idx, device_name); } diff --git a/input/drivers_hid/libusb_hid.c b/input/drivers_hid/libusb_hid.c index f86c0ab6d4..170a972786 100644 --- a/input/drivers_hid/libusb_hid.c +++ b/input/drivers_hid/libusb_hid.c @@ -150,7 +150,7 @@ static void libusb_hid_device_add_autodetect(unsigned idx, strlcpy(params.name, device_name, sizeof(params.name)); strlcpy(params.driver, driver_name, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } static void libusb_get_description(struct libusb_device *device, @@ -367,9 +367,9 @@ static int remove_adapter(void *data, struct libusb_device *dev) if (adapter->next->device == dev) { struct libusb_adapter *new_next = NULL; - const char *name = (const char*)adapter->next->name; + const char *name = (const char*)adapter->next->name; - input_config_autoconfigure_disconnect(adapter->slot, name); + input_autoconfigure_disconnect(adapter->slot, name); adapter->next->quitting = true; sthread_join(adapter->next->thread); diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index 9bd629898f..2ffee90604 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -152,7 +152,7 @@ static void wiiusb_hid_device_add_autodetect(unsigned idx, strlcpy(settings->input.device_names[idx], device_name, sizeof(settings->input.device_names[idx])); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } static void wiiusb_get_description(usb_device_entry *device, @@ -209,15 +209,17 @@ static const char *wiiusb_hid_joypad_name(void *data, unsigned pad) static int32_t wiiusb_hid_release_adapter(struct wiiusb_adapter *adapter) { - wiiusb_hid_t *hid; - const char *name; + wiiusb_hid_t *hid = NULL; + const char *name = NULL; if (!adapter) return -1; - hid = adapter->hid; + hid = adapter->hid; name = wiiusb_hid_joypad_name(hid, adapter->slot); - input_config_autoconfigure_disconnect(adapter->slot, name); + + input_autoconfigure_disconnect(adapter->slot, name); + pad_connection_pad_deinit(&hid->connections[adapter->slot], adapter->slot); free(adapter->send_control_buffer); diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index f0504511c2..7a140a461b 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -55,7 +55,8 @@ static void ctr_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, ctr_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, ctr_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } static bool ctr_joypad_init(void *data) diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index b43d987d5d..068655d0c9 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -276,7 +276,9 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) strlcpy(params.driver, dinput_joypad.ident, sizeof(params.driver)); params.vid = dinput_joypad_vid(g_joypad_cnt); params.pid = dinput_joypad_pid(g_joypad_cnt); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); + settings->input.pid[g_joypad_cnt] = params.pid; settings->input.vid[g_joypad_cnt] = params.vid; } diff --git a/input/drivers_joypad/gx_joypad.c b/input/drivers_joypad/gx_joypad.c index 243c5b60e1..f0babcf07f 100644 --- a/input/drivers_joypad/gx_joypad.c +++ b/input/drivers_joypad/gx_joypad.c @@ -158,7 +158,7 @@ static void handle_hotplug(unsigned port, uint32_t ptype) params.idx = port; strlcpy(params.name, gx_joypad_name(port), sizeof(params.name)); strlcpy(params.driver, gx_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } } diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index cec467c7de..d6e54d3591 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -164,7 +164,7 @@ static void handle_plugged_pad(void) if (linuxraw_pads[idx].fd >= 0) { if (linuxraw_hotplug) - input_config_autoconfigure_disconnect(idx, linuxraw_pads[idx].ident); + input_autoconfigure_disconnect(idx, linuxraw_pads[idx].ident); close(linuxraw_pads[idx].fd); linuxraw_pads[idx].buttons = 0; @@ -174,7 +174,8 @@ static void handle_plugged_pad(void) /* TODO - implement VID/PID? */ params.idx = idx; - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } } /* Sometimes, device will be created before access to it is established. */ @@ -193,7 +194,8 @@ static void handle_plugged_pad(void) strlcpy(params.name, linuxraw_pads[idx].ident, sizeof(params.name)); strlcpy(params.driver, linuxraw_joypad.ident, sizeof(params.driver)); /* TODO - implement VID/PID? */ - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } } } @@ -252,11 +254,11 @@ static bool linuxraw_joypad_init(void *data) strlcpy(params.driver, "linuxraw", sizeof(params.driver)); /* TODO - implement VID/PID? */ - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); linuxraw_poll_pad(pad); } else - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } linuxraw_inotify = inotify_init(); diff --git a/input/drivers_joypad/parport_joypad.c b/input/drivers_joypad/parport_joypad.c index 1e2c830097..76180ae0f8 100644 --- a/input/drivers_joypad/parport_joypad.c +++ b/input/drivers_joypad/parport_joypad.c @@ -306,7 +306,8 @@ static bool parport_joypad_init(void *data) parport_free_pad(pad); } } - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } return true; diff --git a/input/drivers_joypad/ps3_joypad.c b/input/drivers_joypad/ps3_joypad.c index 2419389590..4f8cdf01cc 100644 --- a/input/drivers_joypad/ps3_joypad.c +++ b/input/drivers_joypad/ps3_joypad.c @@ -53,7 +53,8 @@ static void ps3_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, ps3_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, ps3_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } static bool ps3_joypad_init(void *data) @@ -138,7 +139,7 @@ static void ps3_joypad_poll(void) { if ( (pad_info.port_status[port] & CELL_PAD_STATUS_CONNECTED) == 0 ) { - input_config_autoconfigure_disconnect(port, ps3_joypad.ident); + input_autoconfigure_disconnect(port, ps3_joypad.ident); pads_connected[port] = 0; } else if ((pad_info.port_status[port] & CELL_PAD_STATUS_CONNECTED) > 0 ) diff --git a/input/drivers_joypad/psp_joypad.c b/input/drivers_joypad/psp_joypad.c index 905b170a27..f3e6edd483 100644 --- a/input/drivers_joypad/psp_joypad.c +++ b/input/drivers_joypad/psp_joypad.c @@ -83,7 +83,7 @@ static void psp_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, psp_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, psp_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } static bool psp_joypad_init(void *data) @@ -190,7 +190,7 @@ static void psp_joypad_poll(void) if (old_ctrl_info.port[player + 1] != SCE_CTRL_TYPE_UNPAIRED && curr_ctrl_info.port[player + 1] == SCE_CTRL_TYPE_UNPAIRED) { memset(&actuators[player], 0, sizeof(SceCtrlActuator)); - input_config_autoconfigure_disconnect(player, psp_joypad.ident); + input_autoconfigure_disconnect(player, psp_joypad.ident); } if (old_ctrl_info.port[player + 1] == SCE_CTRL_TYPE_UNPAIRED && diff --git a/input/drivers_joypad/qnx_joypad.c b/input/drivers_joypad/qnx_joypad.c index 3c73348f6f..f12501f857 100644 --- a/input/drivers_joypad/qnx_joypad.c +++ b/input/drivers_joypad/qnx_joypad.c @@ -41,9 +41,10 @@ static bool qnx_joypad_init(void *data) /* TODO - implement VID/PID? */ params.idx = autoconf_pad; - strlcpy(params.name, qnx_joypad_name(autoconf_pad), sizeof(params.name)); + strlcpy(params.name, qnx_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, qnx_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } return true; diff --git a/input/drivers_joypad/sdl_joypad.c b/input/drivers_joypad/sdl_joypad.c index 7586bf0e51..b88b3cd1e8 100644 --- a/input/drivers_joypad/sdl_joypad.c +++ b/input/drivers_joypad/sdl_joypad.c @@ -150,7 +150,7 @@ static void sdl_pad_connect(unsigned id) params.pid = product; strlcpy(params.driver, sdl_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); RARCH_LOG("[SDL]: Device #%u (%04x:%04x) connected: %s.\n", id, vendor, product, sdl_pad_name(id)); @@ -209,14 +209,14 @@ static void sdl_pad_disconnect(unsigned id) if (sdl_pads[id].controller) { SDL_GameControllerClose(sdl_pads[id].controller); - input_config_autoconfigure_disconnect(id, sdl_joypad.ident); + input_autoconfigure_disconnect(id, sdl_joypad.ident); } else #endif if (sdl_pads[id].joypad) { SDL_JoystickClose(sdl_pads[id].joypad); - input_config_autoconfigure_disconnect(id, sdl_joypad.ident); + input_autoconfigure_disconnect(id, sdl_joypad.ident); } settings->input.device_names[id][0] = '\0'; diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index eccb4cb56e..c876e0d076 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -290,7 +290,7 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char settings->input.vid[p] = params.vid; strlcpy(settings->input.device_names[p], params.name, sizeof(settings->input.device_names[p])); strlcpy(params.driver, udev_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); ret = 1; } @@ -387,7 +387,7 @@ static void udev_joypad_remove_device(const char *path) { if (udev_pads[i].path && string_is_equal(udev_pads[i].path, path)) { - input_config_autoconfigure_disconnect(i, udev_pads[i].ident); + input_autoconfigure_disconnect(i, udev_pads[i].ident); udev_free_pad(i); break; } diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index e0d2b04a32..02beb01fd9 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -62,7 +62,8 @@ static void wiiu_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, wiiu_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, wiiu_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + + input_autoconfigure_joypad(¶ms); } static bool wiiu_joypad_button(unsigned port_num, uint16_t key) diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index 2a457922eb..c18bf6cdac 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -55,7 +55,7 @@ static void xdk_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, xdk_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, xdk_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } static bool xdk_joypad_init(void *data) @@ -162,10 +162,10 @@ static void xdk_joypad_poll(void) if(gamepads[port]) XInputClose(gamepads[port]); - gamepads[port] = 0; + gamepads[port] = 0; pad_state[port] = 0; - input_config_autoconfigure_disconnect(port, xdk_joypad.ident); + input_autoconfigure_disconnect(port, xdk_joypad.ident); } /* handle inserted devices. */ diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 8938ac6296..71c145a080 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -268,7 +268,7 @@ static bool xinput_joypad_init(void *data) params.idx = autoconf_pad; strlcpy(params.name, xinput_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, xinput_joypad.ident, sizeof(params.driver)); - input_config_autoconfigure_joypad(¶ms); + input_autoconfigure_joypad(¶ms); } } diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 1d5e0cd6e2..1a44b002d6 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -34,7 +34,7 @@ /* Adds an index for devices with the same name, * so they can be identified in the GUI. */ -static void input_reindex_devices(void) +static void input_autoconfigure_joypad_reindex_devices(void) { unsigned i; settings_t *settings = config_get_ptr(); @@ -71,7 +71,7 @@ static void input_autoconfigure_joypad_conf(config_file_t *conf, } } -static int input_try_autoconfigure_joypad_from_conf(config_file_t *conf, +static int input_autoconfigure_joypad_try_from_conf(config_file_t *conf, autoconfig_params_t *params) { char ident[256]; @@ -163,13 +163,13 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, if (!block_osd_spam) runloop_msg_queue_push(msg, 2, 60, false); } - input_reindex_devices(); + input_autoconfigure_joypad_reindex_devices(); } static int input_autoconfigure_joypad_from_conf( config_file_t *conf, autoconfig_params_t *params) { - int ret = input_try_autoconfigure_joypad_from_conf(conf, + int ret = input_autoconfigure_joypad_try_from_conf(conf, params); if (ret) @@ -217,7 +217,7 @@ static bool input_autoconfigure_joypad_from_conf_dir( conf = config_file_new(list->elems[i].data); if (conf) - ret = input_try_autoconfigure_joypad_from_conf(conf, params); + ret = input_autoconfigure_joypad_try_from_conf(conf, params); if(ret >= current_best) { @@ -275,7 +275,7 @@ static bool input_autoconfigure_joypad_from_conf_internal( return false; } -static bool input_config_autoconfigure_joypad_init(autoconfig_params_t *params) +static bool input_autoconfigure_joypad_init(autoconfig_params_t *params) { size_t i; settings_t *settings = config_get_ptr(); @@ -295,13 +295,13 @@ static bool input_config_autoconfigure_joypad_init(autoconfig_params_t *params) return true; } -bool input_config_autoconfigure_joypad(autoconfig_params_t *params) +bool input_autoconfigure_joypad(autoconfig_params_t *params) { char msg[255]; msg[0] = '\0'; - if (!input_config_autoconfigure_joypad_init(params)) + if (!input_autoconfigure_joypad_init(params)) goto error; if (string_is_empty(params->name)) @@ -323,7 +323,7 @@ error: return false; } -void input_config_autoconfigure_disconnect(unsigned i, const char *ident) +void input_autoconfigure_disconnect(unsigned i, const char *ident) { char msg[255]; diff --git a/input/input_autodetect.h b/input/input_autodetect.h index 6e6bb9b912..3d6360a9a0 100644 --- a/input/input_autodetect.h +++ b/input/input_autodetect.h @@ -32,9 +32,9 @@ typedef struct autoconfig_params int32_t pid; } autoconfig_params_t; -bool input_config_autoconfigure_joypad(autoconfig_params_t *params); +bool input_autoconfigure_joypad(autoconfig_params_t *params); -void input_config_autoconfigure_disconnect(unsigned i, const char *ident); +void input_autoconfigure_disconnect(unsigned i, const char *ident); extern const char* const input_builtin_autoconfs[]; From 76d0380e45b84da7861ed4e666f0dd9817ee7f5e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 18:57:44 +0100 Subject: [PATCH 095/638] Rename input_autoconfigure_joypad to input_autoconfigure_connect --- input/drivers/android_input.c | 9 +++++---- input/drivers/qnx_input.c | 2 +- input/drivers_hid/iohidmanager_hid.c | 2 +- input/drivers_hid/libusb_hid.c | 2 +- input/drivers_hid/wiiusb_hid.c | 2 +- input/drivers_joypad/ctr_joypad.c | 4 ++-- input/drivers_joypad/dinput_joypad.c | 2 +- input/drivers_joypad/gx_joypad.c | 2 +- input/drivers_joypad/linuxraw_joypad.c | 8 ++++---- input/drivers_joypad/parport_joypad.c | 2 +- input/drivers_joypad/ps3_joypad.c | 2 +- input/drivers_joypad/psp_joypad.c | 3 ++- input/drivers_joypad/qnx_joypad.c | 2 +- input/drivers_joypad/sdl_joypad.c | 11 ++++++----- input/drivers_joypad/udev_joypad.c | 10 ++++++---- input/drivers_joypad/wiiu_joypad.c | 2 +- input/drivers_joypad/xdk_joypad.c | 2 +- input/drivers_joypad/xinput_joypad.c | 2 +- input/input_autodetect.c | 2 +- input/input_autodetect.h | 2 +- 20 files changed, 39 insertions(+), 34 deletions(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index d786743345..bafd67cdb1 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -895,14 +895,15 @@ static void handle_hotplug(android_input_data_t *android_data, params.vid, params.pid); strlcpy(params.name, name_buf, sizeof(params.name)); - params.idx = *port; - params.vid = vendorId; - params.pid = productId; + + params.idx = *port; + params.vid = vendorId; + params.pid = productId; settings->input.pid[*port] = params.pid; settings->input.vid[*port] = params.vid; strlcpy(params.driver, android_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } if (!string_is_empty(name_buf)) diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index 7406d7fe8d..76547897ba 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -220,7 +220,7 @@ static void qnx_input_autodetect_gamepad(qnx_input_t *qnx, strlcpy(params.driver, qnx->joypad->ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); controller->port = port; qnx->port_device[port] = controller; diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 27897e2e1f..e69120c825 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -309,7 +309,7 @@ static void iohidmanager_hid_device_add_autodetect(unsigned idx, strlcpy(params.name, device_name, sizeof(params.name)); strlcpy(params.driver, driver_name, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); RARCH_LOG("Port %d: %s.\n", idx, device_name); } diff --git a/input/drivers_hid/libusb_hid.c b/input/drivers_hid/libusb_hid.c index 170a972786..325b8462f7 100644 --- a/input/drivers_hid/libusb_hid.c +++ b/input/drivers_hid/libusb_hid.c @@ -150,7 +150,7 @@ static void libusb_hid_device_add_autodetect(unsigned idx, strlcpy(params.name, device_name, sizeof(params.name)); strlcpy(params.driver, driver_name, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static void libusb_get_description(struct libusb_device *device, diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index 2ffee90604..8e71f5c3a8 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -152,7 +152,7 @@ static void wiiusb_hid_device_add_autodetect(unsigned idx, strlcpy(settings->input.device_names[idx], device_name, sizeof(settings->input.device_names[idx])); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static void wiiusb_get_description(usb_device_entry *device, diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index 7a140a461b..970b695599 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -44,7 +44,7 @@ static const char *ctr_joypad_name(unsigned pad) static void ctr_joypad_autodetect_add(unsigned autoconf_pad) { - settings_t *settings = config_get_ptr(); + settings_t *settings = config_get_ptr(); autoconfig_params_t params = {{0}}; strlcpy(settings->input.device_names[autoconf_pad], @@ -56,7 +56,7 @@ static void ctr_joypad_autodetect_add(unsigned autoconf_pad) strlcpy(params.name, ctr_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, ctr_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static bool ctr_joypad_init(void *data) diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 068655d0c9..9a8b517998 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -277,7 +277,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) params.vid = dinput_joypad_vid(g_joypad_cnt); params.pid = dinput_joypad_pid(g_joypad_cnt); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); settings->input.pid[g_joypad_cnt] = params.pid; settings->input.vid[g_joypad_cnt] = params.vid; diff --git a/input/drivers_joypad/gx_joypad.c b/input/drivers_joypad/gx_joypad.c index f0babcf07f..e0ee1aa4ae 100644 --- a/input/drivers_joypad/gx_joypad.c +++ b/input/drivers_joypad/gx_joypad.c @@ -158,7 +158,7 @@ static void handle_hotplug(unsigned port, uint32_t ptype) params.idx = port; strlcpy(params.name, gx_joypad_name(port), sizeof(params.name)); strlcpy(params.driver, gx_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } } diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index d6e54d3591..263ebd8d65 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -175,7 +175,7 @@ static void handle_plugged_pad(void) /* TODO - implement VID/PID? */ params.idx = idx; - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } } /* Sometimes, device will be created before access to it is established. */ @@ -195,7 +195,7 @@ static void handle_plugged_pad(void) strlcpy(params.driver, linuxraw_joypad.ident, sizeof(params.driver)); /* TODO - implement VID/PID? */ - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } } } @@ -254,11 +254,11 @@ static bool linuxraw_joypad_init(void *data) strlcpy(params.driver, "linuxraw", sizeof(params.driver)); /* TODO - implement VID/PID? */ - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); linuxraw_poll_pad(pad); } else - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } linuxraw_inotify = inotify_init(); diff --git a/input/drivers_joypad/parport_joypad.c b/input/drivers_joypad/parport_joypad.c index 76180ae0f8..cf201e0e89 100644 --- a/input/drivers_joypad/parport_joypad.c +++ b/input/drivers_joypad/parport_joypad.c @@ -307,7 +307,7 @@ static bool parport_joypad_init(void *data) } } - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } return true; diff --git a/input/drivers_joypad/ps3_joypad.c b/input/drivers_joypad/ps3_joypad.c index 4f8cdf01cc..1950473d3a 100644 --- a/input/drivers_joypad/ps3_joypad.c +++ b/input/drivers_joypad/ps3_joypad.c @@ -54,7 +54,7 @@ static void ps3_joypad_autodetect_add(unsigned autoconf_pad) strlcpy(params.name, ps3_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, ps3_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static bool ps3_joypad_init(void *data) diff --git a/input/drivers_joypad/psp_joypad.c b/input/drivers_joypad/psp_joypad.c index f3e6edd483..66184d937e 100644 --- a/input/drivers_joypad/psp_joypad.c +++ b/input/drivers_joypad/psp_joypad.c @@ -83,7 +83,8 @@ static void psp_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, psp_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, psp_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + + input_autoconfigure_connect(¶ms); } static bool psp_joypad_init(void *data) diff --git a/input/drivers_joypad/qnx_joypad.c b/input/drivers_joypad/qnx_joypad.c index f12501f857..30c9646458 100644 --- a/input/drivers_joypad/qnx_joypad.c +++ b/input/drivers_joypad/qnx_joypad.c @@ -44,7 +44,7 @@ static bool qnx_joypad_init(void *data) strlcpy(params.name, qnx_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, qnx_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } return true; diff --git a/input/drivers_joypad/sdl_joypad.c b/input/drivers_joypad/sdl_joypad.c index b88b3cd1e8..fa761c93c3 100644 --- a/input/drivers_joypad/sdl_joypad.c +++ b/input/drivers_joypad/sdl_joypad.c @@ -144,13 +144,14 @@ static void sdl_pad_connect(unsigned id) product = guid_ptr[1]; #endif #endif - params.idx = id; - strlcpy(params.name, sdl_pad_name(id), sizeof(params.name)); - params.vid = vendor; - params.pid = product; + strlcpy(params.name, sdl_pad_name(id), sizeof(params.name)); strlcpy(params.driver, sdl_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + params.idx = id; + params.vid = vendor; + params.pid = product; + + input_autoconfigure_connect(¶ms); RARCH_LOG("[SDL]: Device #%u (%04x:%04x) connected: %s.\n", id, vendor, product, sdl_pad_name(id)); diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index c876e0d076..d57609ab38 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -282,15 +282,17 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char if (!string_is_empty(pad->ident)) { - params.idx = p; strlcpy(params.name, pad->ident, sizeof(params.name)); - params.vid = pad->vid; - params.pid = pad->pid; + + params.idx = p; + params.vid = pad->vid; + params.pid = pad->pid; settings->input.pid[p] = params.pid; settings->input.vid[p] = params.vid; + strlcpy(settings->input.device_names[p], params.name, sizeof(settings->input.device_names[p])); strlcpy(params.driver, udev_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); ret = 1; } diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index 02beb01fd9..0fdaf9a1e8 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -63,7 +63,7 @@ static void wiiu_joypad_autodetect_add(unsigned autoconf_pad) strlcpy(params.name, wiiu_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, wiiu_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static bool wiiu_joypad_button(unsigned port_num, uint16_t key) diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index c18bf6cdac..6ba0315f0d 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -55,7 +55,7 @@ static void xdk_joypad_autodetect_add(unsigned autoconf_pad) params.idx = autoconf_pad; strlcpy(params.name, xdk_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, xdk_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } static bool xdk_joypad_init(void *data) diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 71c145a080..df03433ce4 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -268,7 +268,7 @@ static bool xinput_joypad_init(void *data) params.idx = autoconf_pad; strlcpy(params.name, xinput_joypad_name(autoconf_pad), sizeof(params.name)); strlcpy(params.driver, xinput_joypad.ident, sizeof(params.driver)); - input_autoconfigure_joypad(¶ms); + input_autoconfigure_connect(¶ms); } } diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 1a44b002d6..809102d139 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -295,7 +295,7 @@ static bool input_autoconfigure_joypad_init(autoconfig_params_t *params) return true; } -bool input_autoconfigure_joypad(autoconfig_params_t *params) +bool input_autoconfigure_connect(autoconfig_params_t *params) { char msg[255]; diff --git a/input/input_autodetect.h b/input/input_autodetect.h index 3d6360a9a0..5957f23bd0 100644 --- a/input/input_autodetect.h +++ b/input/input_autodetect.h @@ -32,7 +32,7 @@ typedef struct autoconfig_params int32_t pid; } autoconfig_params_t; -bool input_autoconfigure_joypad(autoconfig_params_t *params); +bool input_autoconfigure_connect(autoconfig_params_t *params); void input_autoconfigure_disconnect(unsigned i, const char *ident); From 22798e26c7676fc90de0a49f70d29b9b71bba73d Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Thu, 1 Dec 2016 13:34:37 -0500 Subject: [PATCH 096/638] delay_frames naming consistency Unifying all of the various inconsistent names of delay_frames into a single name: delay_frames. --- configuration.c | 4 ++-- configuration.h | 2 +- menu/menu_setting.c | 4 ++-- network/netplay/netplay.c | 20 ++++++++++---------- network/netplay/netplay.h | 6 +++--- network/netplay/netplay_net.c | 2 +- network/netplay/netplay_private.h | 2 +- network/netplay/netplay_spectate.c | 2 +- retroarch.c | 4 ++-- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/configuration.c b/configuration.c index 9284821974..28659b4a0c 100644 --- a/configuration.c +++ b/configuration.c @@ -922,7 +922,7 @@ static int populate_settings_int(settings_t *settings, struct config_int_setting SETTING_INT("state_slot", (unsigned*)&settings->state_slot, false, 0 /* TODO */, false); #ifdef HAVE_NETWORKING SETTING_INT("netplay_ip_port", &settings->netplay.port, false, 0 /* TODO */, false); - SETTING_INT("netplay_delay_frames", &settings->netplay.sync_frames, true, 16, false); + SETTING_INT("netplay_delay_frames", &settings->netplay.delay_frames, true, 16, false); SETTING_INT("netplay_check_frames", &settings->netplay.check_frames, true, 30, false); #endif #ifdef HAVE_LANGEXTRA @@ -1839,7 +1839,7 @@ static bool config_load_file(const char *path, bool set_defaults, #ifdef HAVE_NETWORKING if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_DELAY_FRAMES, NULL)) - CONFIG_GET_INT_BASE(conf, settings, netplay.sync_frames, "netplay_delay_frames"); + CONFIG_GET_INT_BASE(conf, settings, netplay.delay_frames, "netplay_delay_frames"); if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_CHECK_FRAMES, NULL)) CONFIG_GET_INT_BASE(conf, settings, netplay.check_frames, "netplay_check_frames"); if (!retroarch_override_setting_is_set(RARCH_OVERRIDE_SETTING_NETPLAY_IP_PORT, NULL)) diff --git a/configuration.h b/configuration.h index 861143a3dd..9c0781601b 100644 --- a/configuration.h +++ b/configuration.h @@ -399,7 +399,7 @@ typedef struct settings { char server[255]; unsigned port; - unsigned sync_frames; + unsigned delay_frames; unsigned check_frames; bool is_spectate; bool swap_input; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index bdfca9c6c6..66425b8250 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -1717,7 +1717,7 @@ void general_write_handler(void *data) case MENU_ENUM_LABEL_NETPLAY_DELAY_FRAMES: #ifdef HAVE_NETWORKING { - bool val = (settings->netplay.sync_frames > 0); + bool val = (settings->netplay.delay_frames > 0); if (val) retroarch_override_setting_set(RARCH_OVERRIDE_SETTING_NETPLAY_DELAY_FRAMES, NULL); @@ -5548,7 +5548,7 @@ static bool setting_append_list( CONFIG_UINT( list, list_info, - &settings->netplay.sync_frames, + &settings->netplay.delay_frames, MENU_ENUM_LABEL_NETPLAY_DELAY_FRAMES, MENU_ENUM_LABEL_VALUE_NETPLAY_DELAY_FRAMES, 0, diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 3ea2095969..9479b9cd21 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -277,9 +277,9 @@ static void hangup(netplay_t *netplay) netplay->stall = 0; } -static bool netplay_info_cb(netplay_t* netplay, unsigned frames) +static bool netplay_info_cb(netplay_t* netplay, unsigned delay_frames) { - return netplay->net_cbs->info_cb(netplay, frames); + return netplay->net_cbs->info_cb(netplay, delay_frames); } /** @@ -832,7 +832,7 @@ static bool netplay_poll(void) /* Read Netplay input, block if we're configured to stall for input every * frame */ - if (netplay_data->stall_frames == 0 && + if (netplay_data->delay_frames == 0 && netplay_data->read_frame_count <= netplay_data->self_frame_count) res = poll_input(netplay_data, true); else @@ -856,7 +856,7 @@ static bool netplay_poll(void) break; default: /* not stalling */ - if (netplay_data->read_frame_count + netplay_data->stall_frames + if (netplay_data->read_frame_count + netplay_data->delay_frames <= netplay_data->self_frame_count) { netplay_data->stall = RARCH_NETPLAY_STALL_RUNNING_FAST; @@ -1244,7 +1244,7 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) * netplay_new: * @server : IP address of server. * @port : Port of server. - * @frames : Amount of lag frames. + * @delay_frames : Amount of delay frames. * @check_frames : Frequency with which to check CRCs. * @cb : Libretro callbacks. * @spectate : If true, enable spectator mode. @@ -1257,7 +1257,7 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) * * Returns: new netplay handle. **/ -netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, +netplay_t *netplay_new(const char *server, uint16_t port, unsigned delay_frames, unsigned check_frames, const struct retro_callbacks *cb, bool spectate, bool nat_traversal, const char *nick, uint64_t quirks) { @@ -1272,13 +1272,13 @@ netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, netplay->spectate.enabled = spectate; netplay->is_server = server == NULL; netplay->nat_traversal = netplay->is_server ? nat_traversal : false; - netplay->stall_frames = frames; + netplay->delay_frames = delay_frames; netplay->check_frames = check_frames; netplay->quirks = quirks; strlcpy(netplay->nick, nick, sizeof(netplay->nick)); - if (!netplay_init_buffers(netplay, frames)) + if (!netplay_init_buffers(netplay, delay_frames)) { free(netplay); return NULL; @@ -1295,7 +1295,7 @@ netplay_t *netplay_new(const char *server, uint16_t port, unsigned frames, return NULL; } - if(!netplay_info_cb(netplay, frames)) + if(!netplay_info_cb(netplay, delay_frames)) goto error; return netplay; @@ -1699,7 +1699,7 @@ bool init_netplay(bool is_spectate, const char *server, unsigned port) netplay_data = (netplay_t*)netplay_new( netplay_is_client ? server : NULL, port ? port : RARCH_DEFAULT_PORT, - settings->netplay.sync_frames, settings->netplay.check_frames, &cbs, + settings->netplay.delay_frames, settings->netplay.check_frames, &cbs, is_spectate, settings->netplay.nat_traversal, settings->username, quirks); diff --git a/network/netplay/netplay.h b/network/netplay/netplay.h index b1470bb96b..41bc60f743 100644 --- a/network/netplay/netplay.h +++ b/network/netplay/netplay.h @@ -110,7 +110,7 @@ enum netplay_cmd_cfg /* input.netplay_client_swap_input */ NETPLAY_CFG_SWAP_INPUT = 0x0002, - /* netplay.sync_frames */ + /* netplay.delay_frames */ NETPLAY_CFG_DELAY_FRAMES = 0x0004, /* For more than 2 players */ @@ -133,7 +133,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); * netplay_new: * @server : IP address of server. * @port : Port of server. - * @frames : Amount of lag frames. + * @delay_frames : Amount of delay frames. * @check_frames : Frequency with which to check CRCs. * @cb : Libretro callbacks. * @spectate : If true, enable spectator mode. @@ -147,7 +147,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); * Returns: new netplay handle. **/ netplay_t *netplay_new(const char *server, - uint16_t port, unsigned frames, unsigned check_frames, + uint16_t port, unsigned delay_frames, unsigned check_frames, const struct retro_callbacks *cb, bool spectate, bool nat_traversal, const char *nick, uint64_t quirks); diff --git a/network/netplay/netplay_net.c b/network/netplay/netplay_net.c index cc6e409fc6..51a3535e97 100644 --- a/network/netplay/netplay_net.c +++ b/network/netplay/netplay_net.c @@ -101,7 +101,7 @@ static bool netplay_net_pre_frame(netplay_t *netplay) /* If the core can't serialize properly, we must stall for the * remote input on EVERY frame, because we can't recover */ netplay->quirks |= NETPLAY_QUIRK_NO_SAVESTATES; - netplay->stall_frames = 0; + netplay->delay_frames = 0; } /* If we can't transmit savestates, we must stall until the client is ready */ diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index 9318a70681..3ac24227c4 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -212,7 +212,7 @@ struct netplay bool remote_paused; /* And stalling */ - uint32_t stall_frames; + uint32_t delay_frames; int stall; retro_time_t stall_time; diff --git a/network/netplay/netplay_spectate.c b/network/netplay/netplay_spectate.c index 5fbd3aa61b..7f20f7e976 100644 --- a/network/netplay/netplay_spectate.c +++ b/network/netplay/netplay_spectate.c @@ -243,7 +243,7 @@ static void netplay_spectate_post_frame(netplay_t *netplay) } /* If the server gets significantly ahead, skip to catch up */ - if (netplay->self_frame_count + netplay->stall_frames <= netplay->read_frame_count) + if (netplay->self_frame_count + netplay->delay_frames <= netplay->read_frame_count) { /* "Replay" into the future */ netplay->is_replay = true; diff --git a/retroarch.c b/retroarch.c index bb375b4c0b..af54841baa 100644 --- a/retroarch.c +++ b/retroarch.c @@ -339,7 +339,7 @@ static void retroarch_print_help(const char *arg0) puts(" -H, --host Host netplay as user 1."); puts(" -C, --connect=HOST Connect to netplay server as user 2."); puts(" --port=PORT Port used to netplay. Default is 55435."); - puts(" -F, --frames=NUMBER Sync frames when using netplay."); + puts(" -F, --frames=NUMBER Delay frames when using netplay."); puts(" --check-frames=NUMBER\n" " Check frames when using netplay."); puts(" --spectate Connect to netplay server as spectator."); @@ -708,7 +708,7 @@ static void retroarch_parse_input(int argc, char *argv[]) break; case 'F': - settings->netplay.sync_frames = strtol(optarg, NULL, 0); + settings->netplay.delay_frames = strtol(optarg, NULL, 0); retroarch_override_setting_set( RARCH_OVERRIDE_SETTING_NETPLAY_DELAY_FRAMES, NULL); break; From 2481ff3ad3ec806c42a29426844601decbff52c2 Mon Sep 17 00:00:00 2001 From: FIX94 Date: Thu, 1 Dec 2016 19:46:33 +0100 Subject: [PATCH 097/638] (WiiU) lower audio latency --- audio/drivers/wiiu_audio.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/audio/drivers/wiiu_audio.c b/audio/drivers/wiiu_audio.c index ed912eabc6..ea60e2cc58 100644 --- a/audio/drivers/wiiu_audio.c +++ b/audio/drivers/wiiu_audio.c @@ -49,16 +49,13 @@ typedef struct OSSpinLock spinlock; } ax_audio_t; -//4096 samples main buffer, 85ms total -#define AX_AUDIO_COUNT_SHIFT 12u -#define AX_AUDIO_COUNT (1u << AX_AUDIO_COUNT_SHIFT) -#define AX_AUDIO_COUNT_MASK (AX_AUDIO_COUNT - 1u) +//3072 samples main buffer, 64ms total +#define AX_AUDIO_COUNT 3072 #define AX_AUDIO_SIZE (AX_AUDIO_COUNT << 1u) -#define AX_AUDIO_SIZE_MASK (AX_AUDIO_SIZE - 1u) #define AX_AUDIO_SAMPLE_COUNT 144 //3ms -#define AX_AUDIO_SAMPLE_MIN (AX_AUDIO_SAMPLE_COUNT * 4) //12ms -#define AX_AUDIO_SAMPLE_LOAD (AX_AUDIO_SAMPLE_COUNT * 11) //33ms +#define AX_AUDIO_SAMPLE_MIN (AX_AUDIO_SAMPLE_COUNT * 3) //9ms +#define AX_AUDIO_SAMPLE_LOAD (AX_AUDIO_SAMPLE_COUNT * 10) //30ms #define AX_AUDIO_MAX_FREE (AX_AUDIO_COUNT - (AX_AUDIO_SAMPLE_COUNT * 2)) #define AX_AUDIO_RATE 48000 //#define ax_audio_ticks_to_samples(ticks) (((ticks) * 64) / 82875) @@ -174,6 +171,15 @@ static bool ax_audio_stop(void* data) return true; } +static int ax_audio_limit(int in) +{ + if(in < 0) + in += AX_AUDIO_COUNT; + else if(in >= AX_AUDIO_COUNT) + in -= AX_AUDIO_COUNT; + return in; +} + static bool ax_audio_start(void* data) { ax_audio_t* ax = (ax_audio_t*)data; @@ -187,7 +193,7 @@ static bool ax_audio_start(void* data) //set back to playing on enough buffered data if(ax->written > AX_AUDIO_SAMPLE_LOAD) { - AXSetMultiVoiceCurrentOffset(ax->mvoice, (ax->pos - ax->written) & AX_AUDIO_COUNT_MASK); + AXSetMultiVoiceCurrentOffset(ax->mvoice, ax_audio_limit(ax->pos - ax->written)); AXSetMultiVoiceState(ax->mvoice, AX_VOICE_STATE_PLAYING); } return true; @@ -242,8 +248,7 @@ static ssize_t ax_audio_write(void* data, const void* buf, size_t size) { ax->buffer_l[ax->pos] = src[i]; ax->buffer_r[ax->pos] = src[i + 1]; - ax->pos++; - ax->pos &= AX_AUDIO_COUNT_MASK; + ax->pos = ax_audio_limit(ax->pos + 1); //wrapped around, make sure to store cache if(ax->pos == 0) { From ba18428e11db00714732e77aaaf987b699b2baa3 Mon Sep 17 00:00:00 2001 From: lasers Date: Thu, 1 Dec 2016 13:02:03 -0600 Subject: [PATCH 098/638] Update skeleton cfg (swap buttons option) --- retroarch.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/retroarch.cfg b/retroarch.cfg index 50bca91a36..7d9890a08f 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -504,7 +504,7 @@ # menu_scroll_up_btn = # Swap buttons for OK/Cancel -# menu_swap_ok_cancel = false +# menu_swap_ok_cancel_buttons = false # Axis for RetroArch D-Pad. # Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. From 0aca3d04c077366f2c28f2071d1cb6706c6855d4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 20:22:28 +0100 Subject: [PATCH 099/638] Add way to hide message for screenshot tasks --- command.c | 2 +- tasks/task_screenshot.c | 44 +++++++++++++++++++++++------------------ tasks/tasks_internal.h | 2 +- 3 files changed, 27 insertions(+), 21 deletions(-) diff --git a/command.c b/command.c index 0c0de6aa83..683dd900bc 100644 --- a/command.c +++ b/command.c @@ -1899,7 +1899,7 @@ bool command_event(enum event_command cmd, void *data) settings->state_slot++; break; case CMD_EVENT_TAKE_SCREENSHOT: - if (!take_screenshot()) + if (!take_screenshot(false)) return false; break; case CMD_EVENT_UNLOAD_CORE: diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 72b9e7f479..f8b94aec4d 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -75,6 +75,7 @@ typedef struct int pitch; bool bgr24; void *userbuf; + bool hide_msg; } screenshot_task_state_t; /** @@ -174,7 +175,8 @@ static bool screenshot_dump( const void *frame, unsigned width, unsigned height, - int pitch, bool bgr24, void *userbuf) + int pitch, bool bgr24, bool hide_msg, + void *userbuf) { #ifdef _XBOX1 d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true); @@ -184,12 +186,13 @@ static bool screenshot_dump( screenshot_task_state_t *state = (screenshot_task_state_t*) calloc(1, sizeof(*state)); - state->bgr24 = bgr24; - state->height = height; - state->width = width; - state->pitch = pitch; - state->frame = frame; - state->userbuf = userbuf; + state->hide_msg = hide_msg; + state->bgr24 = bgr24; + state->height = height; + state->width = width; + state->pitch = pitch; + state->frame = frame; + state->userbuf = userbuf; if (settings->auto_screenshot_filename) fill_str_dated_filename(state->shotname, path_basename(name_base), @@ -215,14 +218,17 @@ static bool screenshot_dump( task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = task_screenshot_handler; - task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); + + if (!hide_msg) + task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); + task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); return true; } #if !defined(VITA) -static bool take_screenshot_viewport(const char *name_base) +static bool take_screenshot_viewport(const char *name_base, bool hide_msg) { char screenshot_path[PATH_MAX_LENGTH]; const char *screenshot_dir = NULL; @@ -257,7 +263,7 @@ static bool take_screenshot_viewport(const char *name_base) /* Data read from viewport is in bottom-up order, suitable for BMP. */ if (!screenshot_dump(name_base, screenshot_dir, buffer, vp.width, vp.height, - vp.width * 3, true, buffer)) + vp.width * 3, true, hide_msg, buffer)) goto error; return true; @@ -269,7 +275,7 @@ error: } #endif -static bool take_screenshot_raw(const char *name_base, void *userbuf) +static bool take_screenshot_raw(const char *name_base, bool hide_msg, void *userbuf) { size_t pitch; unsigned width, height; @@ -294,13 +300,13 @@ static bool take_screenshot_raw(const char *name_base, void *userbuf) */ if (!screenshot_dump(name_base, screenshot_dir, (const uint8_t*)data + (height - 1) * pitch, - width, height, -pitch, false, userbuf)) + width, height, -pitch, false, hide_msg, userbuf)) return false; return true; } -static bool take_screenshot_choice(const char *name_base) +static bool take_screenshot_choice(const char *name_base, bool hide_msg) { settings_t *settings = config_get_ptr(); @@ -316,14 +322,14 @@ static bool take_screenshot_choice(const char *name_base) if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) video_driver_cached_frame(); #if defined(VITA) - return take_screenshot_raw(name_base, NULL); + return take_screenshot_raw(name_base, hide__msg, NULL); #else - return take_screenshot_viewport(name_base); + return take_screenshot_viewport(name_base, hide_msg); #endif } if (!video_driver_cached_frame_has_valid_framebuffer()) - return take_screenshot_raw(name_base, NULL); + return take_screenshot_raw(name_base, hide_msg, NULL); if (video_driver_supports_read_frame_raw()) { @@ -345,7 +351,7 @@ static bool take_screenshot_choice(const char *name_base) if (frame_data) { video_driver_set_cached_frame_ptr(frame_data); - if (take_screenshot_raw(name_base, frame_data)) + if (take_screenshot_raw(name_base, hide_msg, frame_data)) ret = true; } @@ -360,11 +366,11 @@ static bool take_screenshot_choice(const char *name_base) * * Returns: true (1) if successful, otherwise false (0). **/ -bool take_screenshot(void) +bool take_screenshot(bool hide_msg) { char *name_base = strdup(path_get(RARCH_PATH_BASENAME)); bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - bool ret = take_screenshot_choice(name_base); + bool ret = take_screenshot_choice(name_base, hide_msg); const char *msg_screenshot = ret ? msg_hash_to_str(MSG_TAKING_SCREENSHOT) : msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 0975ccd120..245e1954a5 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -145,7 +145,7 @@ bool content_push_to_history_playlist( const char *core_path); /* TODO/FIXME - turn this into actual task */ -bool take_screenshot(void); +bool take_screenshot(bool hide_msg); bool event_load_save_files(void); From 0bd94b9b54b40d09be0255e7d235c5583aec92bf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 20:26:35 +0100 Subject: [PATCH 100/638] Move extern variable prototype to input_autodetect.c --- input/input_autodetect.c | 2 ++ input/input_autodetect.h | 3 --- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/input/input_autodetect.c b/input/input_autodetect.c index 809102d139..c1b7413bc3 100644 --- a/input/input_autodetect.c +++ b/input/input_autodetect.c @@ -32,6 +32,8 @@ #include "../runloop.h" #include "../verbosity.h" +extern const char* const input_builtin_autoconfs[]; + /* Adds an index for devices with the same name, * so they can be identified in the GUI. */ static void input_autoconfigure_joypad_reindex_devices(void) diff --git a/input/input_autodetect.h b/input/input_autodetect.h index 5957f23bd0..d92d386146 100644 --- a/input/input_autodetect.h +++ b/input/input_autodetect.h @@ -20,7 +20,6 @@ #include #include -#include typedef struct autoconfig_params { @@ -36,6 +35,4 @@ bool input_autoconfigure_connect(autoconfig_params_t *params); void input_autoconfigure_disconnect(unsigned i, const char *ident); -extern const char* const input_builtin_autoconfs[]; - #endif From 70053afd03ffaf130f2f66629a9494fb4c696433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 20:30:54 +0100 Subject: [PATCH 101/638] Revert "Add way to hide message for screenshot tasks" This reverts commit 0aca3d04c077366f2c28f2071d1cb6706c6855d4. --- command.c | 2 +- tasks/task_screenshot.c | 44 ++++++++++++++++++----------------------- tasks/tasks_internal.h | 2 +- 3 files changed, 21 insertions(+), 27 deletions(-) diff --git a/command.c b/command.c index 683dd900bc..0c0de6aa83 100644 --- a/command.c +++ b/command.c @@ -1899,7 +1899,7 @@ bool command_event(enum event_command cmd, void *data) settings->state_slot++; break; case CMD_EVENT_TAKE_SCREENSHOT: - if (!take_screenshot(false)) + if (!take_screenshot()) return false; break; case CMD_EVENT_UNLOAD_CORE: diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index f8b94aec4d..72b9e7f479 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -75,7 +75,6 @@ typedef struct int pitch; bool bgr24; void *userbuf; - bool hide_msg; } screenshot_task_state_t; /** @@ -175,8 +174,7 @@ static bool screenshot_dump( const void *frame, unsigned width, unsigned height, - int pitch, bool bgr24, bool hide_msg, - void *userbuf) + int pitch, bool bgr24, void *userbuf) { #ifdef _XBOX1 d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true); @@ -186,13 +184,12 @@ static bool screenshot_dump( screenshot_task_state_t *state = (screenshot_task_state_t*) calloc(1, sizeof(*state)); - state->hide_msg = hide_msg; - state->bgr24 = bgr24; - state->height = height; - state->width = width; - state->pitch = pitch; - state->frame = frame; - state->userbuf = userbuf; + state->bgr24 = bgr24; + state->height = height; + state->width = width; + state->pitch = pitch; + state->frame = frame; + state->userbuf = userbuf; if (settings->auto_screenshot_filename) fill_str_dated_filename(state->shotname, path_basename(name_base), @@ -218,17 +215,14 @@ static bool screenshot_dump( task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = task_screenshot_handler; - - if (!hide_msg) - task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); - + task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); return true; } #if !defined(VITA) -static bool take_screenshot_viewport(const char *name_base, bool hide_msg) +static bool take_screenshot_viewport(const char *name_base) { char screenshot_path[PATH_MAX_LENGTH]; const char *screenshot_dir = NULL; @@ -263,7 +257,7 @@ static bool take_screenshot_viewport(const char *name_base, bool hide_msg) /* Data read from viewport is in bottom-up order, suitable for BMP. */ if (!screenshot_dump(name_base, screenshot_dir, buffer, vp.width, vp.height, - vp.width * 3, true, hide_msg, buffer)) + vp.width * 3, true, buffer)) goto error; return true; @@ -275,7 +269,7 @@ error: } #endif -static bool take_screenshot_raw(const char *name_base, bool hide_msg, void *userbuf) +static bool take_screenshot_raw(const char *name_base, void *userbuf) { size_t pitch; unsigned width, height; @@ -300,13 +294,13 @@ static bool take_screenshot_raw(const char *name_base, bool hide_msg, void *user */ if (!screenshot_dump(name_base, screenshot_dir, (const uint8_t*)data + (height - 1) * pitch, - width, height, -pitch, false, hide_msg, userbuf)) + width, height, -pitch, false, userbuf)) return false; return true; } -static bool take_screenshot_choice(const char *name_base, bool hide_msg) +static bool take_screenshot_choice(const char *name_base) { settings_t *settings = config_get_ptr(); @@ -322,14 +316,14 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg) if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) video_driver_cached_frame(); #if defined(VITA) - return take_screenshot_raw(name_base, hide__msg, NULL); + return take_screenshot_raw(name_base, NULL); #else - return take_screenshot_viewport(name_base, hide_msg); + return take_screenshot_viewport(name_base); #endif } if (!video_driver_cached_frame_has_valid_framebuffer()) - return take_screenshot_raw(name_base, hide_msg, NULL); + return take_screenshot_raw(name_base, NULL); if (video_driver_supports_read_frame_raw()) { @@ -351,7 +345,7 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg) if (frame_data) { video_driver_set_cached_frame_ptr(frame_data); - if (take_screenshot_raw(name_base, hide_msg, frame_data)) + if (take_screenshot_raw(name_base, frame_data)) ret = true; } @@ -366,11 +360,11 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg) * * Returns: true (1) if successful, otherwise false (0). **/ -bool take_screenshot(bool hide_msg) +bool take_screenshot(void) { char *name_base = strdup(path_get(RARCH_PATH_BASENAME)); bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - bool ret = take_screenshot_choice(name_base, hide_msg); + bool ret = take_screenshot_choice(name_base); const char *msg_screenshot = ret ? msg_hash_to_str(MSG_TAKING_SCREENSHOT) : msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 245e1954a5..0975ccd120 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -145,7 +145,7 @@ bool content_push_to_history_playlist( const char *core_path); /* TODO/FIXME - turn this into actual task */ -bool take_screenshot(bool hide_msg); +bool take_screenshot(void); bool event_load_save_files(void); From 367dcef0b10d3a9ab2ea520f124e42d251fc7df1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 28 Nov 2016 01:57:48 +0100 Subject: [PATCH 102/638] Savestate thumbnails --- command.c | 1 + menu/drivers/xmb.c | 33 ++++++++++++++++++++++++++++++--- menu/menu_setting.c | 14 ++++++++++++-- tasks/task_screenshot.c | 16 +++++++++++++++- tasks/tasks_internal.h | 1 + 5 files changed, 59 insertions(+), 6 deletions(-) diff --git a/command.c b/command.c index 0c0de6aa83..8686411b84 100644 --- a/command.c +++ b/command.c @@ -1683,6 +1683,7 @@ static void command_event_main_state(unsigned cmd) switch (cmd) { case CMD_EVENT_SAVE_STATE: + take_savestate_screenshot(path); content_save_state(path, true, false); push_msg = false; break; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index e4cbf58b7c..df08a5cf07 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -56,6 +56,7 @@ #include "../../configuration.h" #include "../../retroarch.h" #include "../../playlist.h" +#include "../../runloop.h" #include "../../tasks/tasks_internal.h" @@ -837,6 +838,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) char *tmp = NULL; char *scrub_char_pointer = NULL; settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); xmb_handle_t *xmb = (xmb_handle_t*)data; playlist_t *playlist = NULL; const char *core_name = NULL; @@ -872,6 +874,33 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) } } + if (string_is_equal(entry.label, "state_slot")) + { + char path[PATH_MAX_LENGTH] = {0}; + if (settings->state_slot > 0) + snprintf(path, sizeof(path), "%s%d", + global->name.savestate, settings->state_slot); + else if (settings->state_slot < 0) + fill_pathname_join_delim(path, + global->name.savestate, "auto", '.', sizeof(path)); + else + strlcpy(path, global->name.savestate, sizeof(path)); + + strlcat(path, file_path_str(FILE_PATH_PNG_EXTENSION), sizeof(path)); + + if (path_file_exists(path)) + { + strlcpy(xmb->thumbnail_file_path, path, + sizeof(xmb->thumbnail_file_path)); + return; + } + else + { + xmb->thumbnail_file_path[0] = '\0'; + xmb->thumbnail = 0; + } + } + fill_pathname_join( xmb->thumbnail_file_path, settings->directory.thumbnails, @@ -974,9 +1003,7 @@ static void xmb_selection_pointer_changed( { ia = xmb->items.active.alpha; iz = xmb->items.active.zoom; - - depth = xmb_list_get_size(xmb, MENU_LIST_PLAIN); - if (!string_is_equal(xmb_thumbnails_ident(), "OFF") && depth == 1) + if (!string_is_equal(xmb_thumbnails_ident(), "OFF")) { xmb_update_thumbnail_path(xmb, i); xmb_update_thumbnail_image(xmb); diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 66425b8250..d04016fe4c 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -655,11 +655,21 @@ static int setting_handler(rarch_setting_t *setting, unsigned action) break; case MENU_ACTION_LEFT: if (setting->action_left) - return setting->action_left(setting, true); + { + int ret = setting->action_left(setting, false); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL); + return ret; + } break; case MENU_ACTION_RIGHT: if (setting->action_right) - return setting->action_right(setting, false); + { + int ret = setting->action_right(setting, false); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL); + return ret; + } break; case MENU_ACTION_SELECT: if (setting->action_select) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 72b9e7f479..af97794e71 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -191,7 +191,7 @@ static bool screenshot_dump( state->frame = frame; state->userbuf = userbuf; - if (settings->auto_screenshot_filename) + if (false) fill_str_dated_filename(state->shotname, path_basename(name_base), IMG_EXT, sizeof(state->shotname)); else @@ -382,3 +382,17 @@ bool take_screenshot(void) return ret; } + +bool take_savestate_screenshot(const char *name_base) +{ + bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); + bool ret = take_screenshot_choice(name_base); + + if (is_paused) + { + if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) + video_driver_cached_frame(); + } + + return ret; +} diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 0975ccd120..b48fd397c8 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -146,6 +146,7 @@ bool content_push_to_history_playlist( /* TODO/FIXME - turn this into actual task */ bool take_screenshot(void); +bool take_savestate_screenshot(const char *path); bool event_load_save_files(void); From d142ccca022b3d9fda0f3cbbd4894dd990ac66f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 28 Nov 2016 16:26:47 +0100 Subject: [PATCH 103/638] Never add the date in the screenshot filename if it is a savestate thumbnail --- tasks/task_screenshot.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index af97794e71..0fb3e13ba6 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -174,7 +174,7 @@ static bool screenshot_dump( const void *frame, unsigned width, unsigned height, - int pitch, bool bgr24, void *userbuf) + int pitch, bool bgr24, void *userbuf, bool savestate) { #ifdef _XBOX1 d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true); @@ -191,7 +191,7 @@ static bool screenshot_dump( state->frame = frame; state->userbuf = userbuf; - if (false) + if (settings->auto_screenshot_filename && !savestate) fill_str_dated_filename(state->shotname, path_basename(name_base), IMG_EXT, sizeof(state->shotname)); else @@ -222,7 +222,7 @@ static bool screenshot_dump( } #if !defined(VITA) -static bool take_screenshot_viewport(const char *name_base) +static bool take_screenshot_viewport(const char *name_base, bool savestate) { char screenshot_path[PATH_MAX_LENGTH]; const char *screenshot_dir = NULL; @@ -257,7 +257,7 @@ static bool take_screenshot_viewport(const char *name_base) /* Data read from viewport is in bottom-up order, suitable for BMP. */ if (!screenshot_dump(name_base, screenshot_dir, buffer, vp.width, vp.height, - vp.width * 3, true, buffer)) + vp.width * 3, true, buffer, savestate)) goto error; return true; @@ -269,7 +269,8 @@ error: } #endif -static bool take_screenshot_raw(const char *name_base, void *userbuf) +static bool take_screenshot_raw(const char *name_base, void *userbuf, + bool savestate) { size_t pitch; unsigned width, height; @@ -294,13 +295,13 @@ static bool take_screenshot_raw(const char *name_base, void *userbuf) */ if (!screenshot_dump(name_base, screenshot_dir, (const uint8_t*)data + (height - 1) * pitch, - width, height, -pitch, false, userbuf)) + width, height, -pitch, false, userbuf, savestate)) return false; return true; } -static bool take_screenshot_choice(const char *name_base) +static bool take_screenshot_choice(const char *name_base, bool savestate) { settings_t *settings = config_get_ptr(); @@ -316,14 +317,14 @@ static bool take_screenshot_choice(const char *name_base) if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) video_driver_cached_frame(); #if defined(VITA) - return take_screenshot_raw(name_base, NULL); + return take_screenshot_raw(name_base, NULL, savestate); #else - return take_screenshot_viewport(name_base); + return take_screenshot_viewport(name_base, savestate); #endif } if (!video_driver_cached_frame_has_valid_framebuffer()) - return take_screenshot_raw(name_base, NULL); + return take_screenshot_raw(name_base, NULL, savestate); if (video_driver_supports_read_frame_raw()) { @@ -345,7 +346,7 @@ static bool take_screenshot_choice(const char *name_base) if (frame_data) { video_driver_set_cached_frame_ptr(frame_data); - if (take_screenshot_raw(name_base, frame_data)) + if (take_screenshot_raw(name_base, frame_data, savestate)) ret = true; } @@ -364,7 +365,7 @@ bool take_screenshot(void) { char *name_base = strdup(path_get(RARCH_PATH_BASENAME)); bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - bool ret = take_screenshot_choice(name_base); + bool ret = take_screenshot_choice(name_base, false); const char *msg_screenshot = ret ? msg_hash_to_str(MSG_TAKING_SCREENSHOT) : msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); @@ -386,7 +387,7 @@ bool take_screenshot(void) bool take_savestate_screenshot(const char *name_base) { bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - bool ret = take_screenshot_choice(name_base); + bool ret = take_screenshot_choice(name_base, true); if (is_paused) { From a0c5a286021ddedf83d453db69df77d9fac6e8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Mon, 28 Nov 2016 16:47:58 +0100 Subject: [PATCH 104/638] Fix wrong thumbnail index --- menu/drivers/xmb.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index df08a5cf07..2ce9d30230 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -835,6 +835,7 @@ end: static void xmb_update_thumbnail_path(void *data, unsigned i) { menu_entry_t entry; + unsigned depth; char *tmp = NULL; char *scrub_char_pointer = NULL; settings_t *settings = config_get_ptr(); @@ -861,6 +862,10 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); + depth = xmb_list_get_size(xmb, MENU_LIST_PLAIN); + if (depth > 1 && !string_is_equal(entry.label, "state_slot")) + return; + if (playlist) { playlist_get_index(playlist, i, From d00566b0187ca2d7cb169222fa1f32aa07182c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Tue, 29 Nov 2016 14:57:30 +0100 Subject: [PATCH 105/638] Add setting for the savestate thumbnails --- command.c | 3 ++- config.def.h | 2 ++ configuration.c | 1 + configuration.h | 1 + intl/msg_hash_us.h | 2 ++ menu/drivers/xmb.c | 3 ++- menu/menu_displaylist.c | 3 +++ menu/menu_setting.c | 8 +++++++- msg_hash.h | 1 + 9 files changed, 21 insertions(+), 3 deletions(-) diff --git a/command.c b/command.c index 8686411b84..420056b950 100644 --- a/command.c +++ b/command.c @@ -1683,7 +1683,8 @@ static void command_event_main_state(unsigned cmd) switch (cmd) { case CMD_EVENT_SAVE_STATE: - take_savestate_screenshot(path); + if (settings->savestate_thumbnail_enable) + take_savestate_screenshot(path); content_save_state(path, true, false); push_msg = false; break; diff --git a/config.def.h b/config.def.h index 78cb4e3ee7..248022e2c1 100644 --- a/config.def.h +++ b/config.def.h @@ -781,6 +781,8 @@ static const bool savestate_auto_index = false; static const bool savestate_auto_save = false; static const bool savestate_auto_load = false; +static const bool savestate_thumbnail_enable = false; + /* Slowmotion ratio. */ static const float slowmotion_ratio = 3.0; diff --git a/configuration.c b/configuration.c index 28659b4a0c..3eebe88a4a 100644 --- a/configuration.c +++ b/configuration.c @@ -806,6 +806,7 @@ static int populate_settings_bool(settings_t *settings, struct config_bool_setti SETTING_BOOL("savestate_auto_index", &settings->savestate_auto_index, true, savestate_auto_index, false); SETTING_BOOL("savestate_auto_save", &settings->savestate_auto_save, true, savestate_auto_save, false); SETTING_BOOL("savestate_auto_load", &settings->savestate_auto_load, true, savestate_auto_load, false); + SETTING_BOOL("savestate_thumbnail_enable", &settings->savestate_thumbnail_enable, true, savestate_thumbnail_enable, false); SETTING_BOOL("history_list_enable", &settings->history_list_enable, true, def_history_list_enable, false); SETTING_BOOL("game_specific_options", &settings->game_specific_options, true, default_game_specific_options, false); SETTING_BOOL("auto_overrides_enable", &settings->auto_overrides_enable, true, default_auto_overrides_enable, false); diff --git a/configuration.h b/configuration.h index 9c0781601b..3612a07615 100644 --- a/configuration.h +++ b/configuration.h @@ -428,6 +428,7 @@ typedef struct settings bool savestate_auto_index; bool savestate_auto_save; bool savestate_auto_load; + bool savestate_thumbnail_enable; bool network_cmd_enable; unsigned network_cmd_port; diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 1315f26510..fc371ca9c1 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -1162,6 +1162,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_AUTO_SAVE, "Auto Save State") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_DIRECTORY, "Savestate") +MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVESTATE_THUMBNAIL_ENABLE, + "Savestate Thumbnails") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG, "Save Current Configuration") MSG_HASH(MENU_ENUM_LABEL_VALUE_SAVE_CURRENT_CONFIG_OVERRIDE_CORE, diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 2ce9d30230..783ef789fe 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -879,7 +879,8 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) } } - if (string_is_equal(entry.label, "state_slot")) + if (settings->savestate_thumbnail_enable + && string_is_equal(entry.label, "state_slot")) { char path[PATH_MAX_LENGTH] = {0}; if (settings->state_slot > 0) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 5a8790bb4e..d32345c235 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -4610,6 +4610,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_SAVESTATE_AUTO_LOAD, PARSE_ONLY_BOOL, false); + menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_SAVESTATE_THUMBNAIL_ENABLE, + PARSE_ONLY_BOOL, false); info->need_refresh = true; info->need_push = true; diff --git a/menu/menu_setting.c b/menu/menu_setting.c index d04016fe4c..7a6c12b9fe 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2928,7 +2928,7 @@ static bool setting_append_list( case SETTINGS_LIST_SAVING: { unsigned i; - struct bool_entry bool_entries[6]; + struct bool_entry bool_entries[7]; START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SAVING_SETTINGS), parent_group); parent_group = msg_hash_to_str(MENU_ENUM_LABEL_SAVING_SETTINGS); @@ -2972,6 +2972,12 @@ static bool setting_append_list( bool_entries[5].default_value = savestate_auto_load; bool_entries[5].flags = SD_FLAG_NONE; + bool_entries[6].target = &settings->savestate_thumbnail_enable; + bool_entries[6].name_enum_idx = MENU_ENUM_LABEL_SAVESTATE_THUMBNAIL_ENABLE; + bool_entries[6].SHORT_enum_idx = MENU_ENUM_LABEL_VALUE_SAVESTATE_THUMBNAIL_ENABLE; + bool_entries[6].default_value = savestate_thumbnail_enable; + bool_entries[6].flags = SD_FLAG_NONE; + for (i = 0; i < ARRAY_SIZE(bool_entries); i++) { CONFIG_BOOL( diff --git a/msg_hash.h b/msg_hash.h index 7d65595c13..9028b7698b 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -959,6 +959,7 @@ enum msg_hash_enums MENU_LABEL(SAVESTATE_AUTO_INDEX), MENU_LABEL(SAVESTATE_AUTO_SAVE), MENU_LABEL(SAVESTATE_AUTO_LOAD), + MENU_LABEL(SAVESTATE_THUMBNAIL_ENABLE), MENU_LABEL(SUSPEND_SCREENSAVER_ENABLE), MENU_LABEL(DPI_OVERRIDE_ENABLE), From 2fc592bbe62d458e6603762607de810bd6cc5a75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 02:43:53 +0100 Subject: [PATCH 106/638] Savestate thumbnails reimplementation --- menu/cbs/menu_cbs_cancel.c | 3 + menu/drivers/materialui.c | 3 + menu/drivers/xmb.c | 163 ++++++++++++++++++++++++++----------- menu/menu_display.c | 16 ++++ menu/menu_display.h | 3 + menu/menu_driver.c | 18 ++++ menu/menu_driver.h | 9 +- menu/menu_setting.c | 8 +- msg_hash.h | 1 + 9 files changed, 170 insertions(+), 54 deletions(-) diff --git a/menu/cbs/menu_cbs_cancel.c b/menu/cbs/menu_cbs_cancel.c index 5bbc48469f..f79221e831 100644 --- a/menu/cbs/menu_cbs_cancel.c +++ b/menu/cbs/menu_cbs_cancel.c @@ -37,6 +37,9 @@ static int action_cancel_pop_default(const char *path, menu_entries_pop_stack(&new_selection_ptr, 0, 1); menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE, NULL); + return 0; } diff --git a/menu/drivers/materialui.c b/menu/drivers/materialui.c index d53ec3f922..447d294615 100644 --- a/menu/drivers/materialui.c +++ b/menu/drivers/materialui.c @@ -1456,6 +1456,7 @@ static bool mui_load_image(void *userdata, void *data, enum menu_image_type type menu_display_allocate_white_texture(); break; case MENU_IMAGE_THUMBNAIL: + case MENU_IMAGE_SAVESTATE_THUMBNAIL: break; } @@ -1873,4 +1874,6 @@ menu_ctx_driver_t menu_ctx_mui = { NULL, NULL, mui_osk_ptr_at_pos, + NULL, + NULL }; diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 783ef789fe..83ea4912b3 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -166,10 +166,14 @@ typedef struct xmb_handle float x; float alpha; uintptr_t thumbnail; + uintptr_t savestate_thumbnail; float thumbnail_width; float thumbnail_height; + float savestate_thumbnail_width; + float savestate_thumbnail_height; char background_file_path[PATH_MAX_LENGTH]; char thumbnail_file_path[PATH_MAX_LENGTH]; + char savestate_thumbnail_file_path[PATH_MAX_LENGTH]; struct { @@ -585,7 +589,7 @@ static void xmb_draw_icon( } static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color, - unsigned width, unsigned height) + unsigned width, unsigned height, float w, float h, uintptr_t texture) { settings_t *settings = config_get_ptr(); unsigned i; @@ -594,7 +598,7 @@ static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color, struct video_coords coords; math_matrix_4x4 mymat; float shadow[16]; - float y = xmb->margins.screen.top + xmb->icon.size + xmb->thumbnail_height; + float y = xmb->margins.screen.top + xmb->icon.size + h; float x = xmb->margins.screen.left + xmb->icon.spacing.horizontal + xmb->icon.spacing.horizontal*4 - xmb->icon.size / 4; @@ -612,11 +616,11 @@ static void xmb_draw_thumbnail(xmb_handle_t *xmb, float *color, coords.tex_coord = NULL; coords.lut_tex_coord = NULL; - draw.width = xmb->thumbnail_width; - draw.height = xmb->thumbnail_height; + draw.width = w; + draw.height = h; draw.coords = &coords; draw.matrix_data = &mymat; - draw.texture = xmb->thumbnail; + draw.texture = texture; draw.prim_type = MENU_DISPLAY_PRIM_TRIANGLESTRIP; draw.pipeline.id = 0; @@ -862,10 +866,6 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); - depth = xmb_list_get_size(xmb, MENU_LIST_PLAIN); - if (depth > 1 && !string_is_equal(entry.label, "state_slot")) - return; - if (playlist) { playlist_get_index(playlist, i, @@ -879,34 +879,6 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) } } - if (settings->savestate_thumbnail_enable - && string_is_equal(entry.label, "state_slot")) - { - char path[PATH_MAX_LENGTH] = {0}; - if (settings->state_slot > 0) - snprintf(path, sizeof(path), "%s%d", - global->name.savestate, settings->state_slot); - else if (settings->state_slot < 0) - fill_pathname_join_delim(path, - global->name.savestate, "auto", '.', sizeof(path)); - else - strlcpy(path, global->name.savestate, sizeof(path)); - - strlcat(path, file_path_str(FILE_PATH_PNG_EXTENSION), sizeof(path)); - - if (path_file_exists(path)) - { - strlcpy(xmb->thumbnail_file_path, path, - sizeof(xmb->thumbnail_file_path)); - return; - } - else - { - xmb->thumbnail_file_path[0] = '\0'; - xmb->thumbnail = 0; - } - } - fill_pathname_join( xmb->thumbnail_file_path, settings->directory.thumbnails, @@ -928,7 +900,7 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) } /* Look for thumbnail file with this scrubbed filename */ - if (tmp) + if (tmp) { char tmp_new[PATH_MAX_LENGTH]; @@ -944,26 +916,93 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) sizeof(xmb->thumbnail_file_path)); } +static void xmb_update_savestate_thumbnail_path(void *data, unsigned i) +{ + menu_entry_t entry; + char *tmp = NULL; + char *scrub_char_pointer = NULL; + settings_t *settings = config_get_ptr(); + global_t *global = global_get_ptr(); + xmb_handle_t *xmb = (xmb_handle_t*)data; + playlist_t *playlist = NULL; + const char *core_name = NULL; + + if (!xmb) + return; + + entry.path[0] = '\0'; + entry.label[0] = '\0'; + entry.sublabel[0] = '\0'; + entry.value[0] = '\0'; + entry.rich_label[0] = '\0'; + entry.enum_idx = MSG_UNKNOWN; + entry.entry_idx = 0; + entry.idx = 0; + entry.type = 0; + entry.spacing = 0; + + menu_entry_get(&entry, 0, i, NULL, true); + + menu_driver_ctl(RARCH_MENU_CTL_PLAYLIST_GET, &playlist); + + if (settings->savestate_thumbnail_enable + && (string_is_equal(entry.label, "state_slot") + || string_is_equal(entry.label, "loadstate") + || string_is_equal(entry.label, "savestate"))) + { + char path[PATH_MAX_LENGTH] = {0}; + if (settings->state_slot > 0) + snprintf(path, sizeof(path), "%s%d", + global->name.savestate, settings->state_slot); + else if (settings->state_slot < 0) + fill_pathname_join_delim(path, + global->name.savestate, "auto", '.', sizeof(path)); + else + strlcpy(path, global->name.savestate, sizeof(path)); + + strlcat(path, file_path_str(FILE_PATH_PNG_EXTENSION), sizeof(path)); + + if (path_file_exists(path)) + { + strlcpy(xmb->savestate_thumbnail_file_path, path, + sizeof(xmb->savestate_thumbnail_file_path)); + return; + } + else + xmb->savestate_thumbnail_file_path[0] = '\0'; + } + else + xmb->savestate_thumbnail_file_path[0] = '\0'; +} + static void xmb_update_thumbnail_image(void *data) { xmb_handle_t *xmb = (xmb_handle_t*)data; if (!xmb) return; - if (path_file_exists(xmb->thumbnail_file_path)) - { -#if 0 - RARCH_LOG("path: %s\n", xmb->thumbnail_file_path); -#endif task_push_image_load(xmb->thumbnail_file_path, MENU_ENUM_LABEL_CB_MENU_THUMBNAIL, menu_display_handle_thumbnail_upload, NULL); - } else if (xmb->depth == 1) xmb->thumbnail = 0; } +static void xmb_update_savestate_thumbnail_image(void *data) +{ + xmb_handle_t *xmb = (xmb_handle_t*)data; + if (!xmb) + return; + + if (path_file_exists(xmb->savestate_thumbnail_file_path)) + task_push_image_load(xmb->savestate_thumbnail_file_path, + MENU_ENUM_LABEL_CB_MENU_SAVESTATE_THUMBNAIL, + menu_display_handle_savestate_thumbnail_upload, NULL); + else + xmb->savestate_thumbnail = 0; +} + static void xmb_selection_pointer_changed( xmb_handle_t *xmb, bool allow_animations) { @@ -1009,11 +1048,15 @@ static void xmb_selection_pointer_changed( { ia = xmb->items.active.alpha; iz = xmb->items.active.zoom; - if (!string_is_equal(xmb_thumbnails_ident(), "OFF")) + + depth = xmb_list_get_size(xmb, MENU_LIST_PLAIN); + if (!string_is_equal(xmb_thumbnails_ident(), "OFF") && depth == 1) { xmb_update_thumbnail_path(xmb, i); xmb_update_thumbnail_image(xmb); } + xmb_update_savestate_thumbnail_path(xmb, i); + xmb_update_savestate_thumbnail_image(xmb); } if ( (!allow_animations) @@ -1781,6 +1824,7 @@ static void xmb_populate_entries(void *data, menu_driver_ctl(RARCH_MENU_CTL_UNSET_PREVENT_POPULATE, NULL); if (!string_is_equal(xmb_thumbnails_ident(), "OFF")) xmb_update_thumbnail_image(xmb); + xmb_update_savestate_thumbnail_image(xmb); return; } @@ -2117,7 +2161,8 @@ static void xmb_draw_items(xmb_handle_t *xmb, if (string_is_empty(entry_value)) { - if (!string_is_equal(xmb_thumbnails_ident(), "OFF") && xmb->thumbnail) + if (xmb->savestate_thumbnail || + (!string_is_equal(xmb_thumbnails_ident(), "OFF") && xmb->thumbnail)) ticker_limit = 40; else ticker_limit = 70; @@ -2515,8 +2560,15 @@ static void xmb_frame(void *data) menu_display_rotate_z(&rotate_draw); menu_display_blend_begin(); - if (!string_is_equal(xmb_thumbnails_ident(), "OFF") && xmb->thumbnail) - xmb_draw_thumbnail(xmb, &coord_white[0], width, height); + if (xmb->savestate_thumbnail) + xmb_draw_thumbnail(xmb, &coord_white[0], width, height, + xmb->savestate_thumbnail_width, xmb->savestate_thumbnail_height, + xmb->savestate_thumbnail); + else if (xmb->thumbnail + && !string_is_equal(xmb_thumbnails_ident(), "OFF")) + xmb_draw_thumbnail(xmb, &coord_white[0], width, height, + xmb->thumbnail_width, xmb->thumbnail_height, + xmb->thumbnail); /* Clock image */ menu_display_set_alpha(coord_white, MIN(xmb->alpha, 1.00f)); @@ -2723,6 +2775,7 @@ static void xmb_layout_ps3(xmb_handle_t *xmb, int width) xmb->margins.screen.top = (256+32) * scale_factor; xmb->thumbnail_width = 460.0 * scale_factor; + xmb->savestate_thumbnail_width= 460.0 * scale_factor; xmb->cursor.size = 64.0; xmb->icon.spacing.horizontal = 200.0 * scale_factor; @@ -2775,6 +2828,7 @@ static void xmb_layout_psp(xmb_handle_t *xmb, int width) xmb->margins.screen.top = (256+32) * scale_factor; xmb->thumbnail_width = 460.0 * scale_factor; + xmb->savestate_thumbnail_width= 460.0 * scale_factor; xmb->cursor.size = 64.0; xmb->icon.spacing.horizontal = 250.0 * scale_factor; @@ -3072,6 +3126,16 @@ static bool xmb_load_image(void *userdata, void *data, enum menu_image_type type TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->thumbnail); } break; + case MENU_IMAGE_SAVESTATE_THUMBNAIL: + { + struct texture_image *img = (struct texture_image*)data; + xmb->savestate_thumbnail_height = xmb->savestate_thumbnail_width + * (float)img->height / (float)img->width; + video_driver_texture_unload(&xmb->savestate_thumbnail); + video_driver_texture_load(data, + TEXTURE_FILTER_MIPMAP_LINEAR, &xmb->savestate_thumbnail); + } + break; } return true; @@ -3263,6 +3327,7 @@ static void xmb_context_reset(void *data) if (!string_is_equal(xmb_thumbnails_ident(), "OFF")) xmb_update_thumbnail_image(xmb); + xmb_update_savestate_thumbnail_image(xmb); } static void xmb_navigation_clear(void *data, bool pending_push) @@ -3800,4 +3865,6 @@ menu_ctx_driver_t menu_ctx_xmb = { xmb_update_thumbnail_path, xmb_update_thumbnail_image, xmb_osk_ptr_at_pos, + xmb_update_savestate_thumbnail_path, + xmb_update_savestate_thumbnail_image }; diff --git a/menu/menu_display.c b/menu/menu_display.c index 75ed2a78f5..4d2d2ceddb 100644 --- a/menu/menu_display.c +++ b/menu/menu_display.c @@ -668,6 +668,22 @@ void menu_display_handle_thumbnail_upload(void *task_data, free(user_data); } +void menu_display_handle_savestate_thumbnail_upload(void *task_data, + void *user_data, const char *err) +{ + menu_ctx_load_image_t load_image_info; + struct texture_image *img = (struct texture_image*)task_data; + + load_image_info.data = img; + load_image_info.type = MENU_IMAGE_SAVESTATE_THUMBNAIL; + + menu_driver_ctl(RARCH_MENU_CTL_LOAD_IMAGE, &load_image_info); + + image_texture_free(img); + free(img); + free(user_data); +} + void menu_display_handle_wallpaper_upload(void *task_data, void *user_data, const char *err) { diff --git a/menu/menu_display.h b/menu/menu_display.h index f02befd3c9..0bf29d438a 100644 --- a/menu/menu_display.h +++ b/menu/menu_display.h @@ -249,6 +249,9 @@ void menu_display_handle_wallpaper_upload(void *task_data, void menu_display_handle_thumbnail_upload(void *task_data, void *user_data, const char *err); +void menu_display_handle_savestate_thumbnail_upload(void *task_data, + void *user_data, const char *err); + void menu_display_push_quad( unsigned width, unsigned height, const float *colors, int x1, int y1, diff --git a/menu/menu_driver.c b/menu/menu_driver.c index 9da96c472b..f9f2875f16 100644 --- a/menu/menu_driver.c +++ b/menu/menu_driver.c @@ -963,6 +963,24 @@ bool menu_driver_ctl(enum rarch_menu_ctl_state state, void *data) menu_driver_ctx->update_thumbnail_image(menu_userdata); } break; + case RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH: + { + size_t selection; + if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection)) + return false; + + if (!menu_driver_ctx || !menu_driver_ctx->update_savestate_thumbnail_path) + return false; + menu_driver_ctx->update_savestate_thumbnail_path(menu_userdata, selection); + } + break; + case RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE: + { + if (!menu_driver_ctx || !menu_driver_ctx->update_savestate_thumbnail_image) + return false; + menu_driver_ctx->update_savestate_thumbnail_image(menu_userdata); + } + break; default: case RARCH_MENU_CTL_NONE: break; diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 1645f3e21f..997ece0916 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -55,7 +55,8 @@ enum menu_image_type { MENU_IMAGE_NONE = 0, MENU_IMAGE_WALLPAPER, - MENU_IMAGE_THUMBNAIL + MENU_IMAGE_THUMBNAIL, + MENU_IMAGE_SAVESTATE_THUMBNAIL }; enum menu_environ_cb @@ -145,7 +146,9 @@ enum rarch_menu_ctl_state RARCH_MENU_CTL_OSK_PTR_AT_POS, RARCH_MENU_CTL_BIND_INIT, RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, - RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE + RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, + RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH, + RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE }; enum menu_settings_type @@ -276,6 +279,8 @@ typedef struct menu_ctx_driver void (*update_thumbnail_path)(void *data, unsigned i); void (*update_thumbnail_image)(void *data); int (*osk_ptr_at_pos)(void *data, int x, int y); + void (*update_savestate_thumbnail_path)(void *data, unsigned i); + void (*update_savestate_thumbnail_image)(void *data); } menu_ctx_driver_t; typedef struct menu_ctx_load_image diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 7a6c12b9fe..98b9f43bdb 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -657,8 +657,8 @@ static int setting_handler(rarch_setting_t *setting, unsigned action) if (setting->action_left) { int ret = setting->action_left(setting, false); - menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL); - menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE, NULL); return ret; } break; @@ -666,8 +666,8 @@ static int setting_handler(rarch_setting_t *setting, unsigned action) if (setting->action_right) { int ret = setting->action_right(setting, false); - menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_PATH, NULL); - menu_driver_ctl(RARCH_MENU_CTL_UPDATE_THUMBNAIL_IMAGE, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_PATH, NULL); + menu_driver_ctl(RARCH_MENU_CTL_UPDATE_SAVESTATE_THUMBNAIL_IMAGE, NULL); return ret; } break; diff --git a/msg_hash.h b/msg_hash.h index 9028b7698b..d4921acefc 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1476,6 +1476,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_CB_LAKKA_DOWNLOAD, MENU_ENUM_LABEL_CB_LAKKA_LIST, MENU_ENUM_LABEL_CB_MENU_THUMBNAIL, + MENU_ENUM_LABEL_CB_MENU_SAVESTATE_THUMBNAIL, MENU_ENUM_LABEL_CB_MENU_WALLPAPER, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_DOWNLOAD, MENU_ENUM_LABEL_CB_THUMBNAILS_UPDATER_LIST, From 41f1063da3e20b521152499d635b67d80bd723f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 20:32:13 +0100 Subject: [PATCH 107/638] Hide the screenshot message --- tasks/task_screenshot.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 0fb3e13ba6..ddc324a5ce 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -215,7 +215,8 @@ static bool screenshot_dump( task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = task_screenshot_handler; - task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); + if (!savestate) + task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); return true; From d3c22cb0e4caa188eef690af7c323e745a46ddf2 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 20:38:20 +0100 Subject: [PATCH 108/638] Move input/input_autodetect.c to tasks/task_autodetect.c --- Makefile.common | 2 +- griffin/griffin.c | 2 +- input/drivers/android_input.c | 2 +- input/drivers/dinput.c | 2 +- input/drivers/qnx_input.c | 2 +- input/drivers/rwebinput_input.c | 2 +- input/drivers/sdl_input.c | 2 +- input/drivers_hid/iohidmanager_hid.c | 2 +- input/drivers_hid/libusb_hid.c | 2 +- input/drivers_hid/wiiusb_hid.c | 2 +- input/drivers_joypad/ctr_joypad.c | 4 +- input/drivers_joypad/dinput_joypad.c | 2 +- input/drivers_joypad/gx_joypad.c | 6 +-- input/drivers_joypad/hid_joypad.c | 2 +- input/drivers_joypad/linuxraw_joypad.c | 2 +- input/drivers_joypad/parport_joypad.c | 2 +- input/drivers_joypad/ps3_joypad.c | 2 +- input/drivers_joypad/psp_joypad.c | 2 +- input/drivers_joypad/qnx_joypad.c | 2 +- input/drivers_joypad/sdl_joypad.c | 2 +- input/drivers_joypad/udev_joypad.c | 2 +- input/drivers_joypad/wiiu_joypad.c | 2 +- input/drivers_joypad/xdk_joypad.c | 2 +- input/drivers_joypad/xinput_joypad.c | 2 +- input/input_autodetect.h | 38 ------------------- input/input_autodetect_builtin.c | 2 +- menu/cbs/menu_cbs_get_value.c | 2 +- menu/menu_setting.c | 2 +- menu/widgets/menu_dialog.c | 2 +- setting_list.c | 2 +- .../task_autodetect.c | 17 +++++---- tasks/tasks_internal.h | 13 +++++++ 32 files changed, 56 insertions(+), 76 deletions(-) delete mode 100644 input/input_autodetect.h rename input/input_autodetect.c => tasks/task_autodetect.c (96%) diff --git a/Makefile.common b/Makefile.common index afc39be629..9abfa0afc3 100644 --- a/Makefile.common +++ b/Makefile.common @@ -183,7 +183,7 @@ OBJ += frontend/frontend.o \ $(LIBRETRO_COMM_DIR)/queues/message_queue.o \ managers/state_manager.o \ gfx/drivers_font_renderer/bitmapfont.o \ - input/input_autodetect.o \ + tasks/task_autodetect.o \ input/input_autodetect_builtin.o \ input/input_joypad_driver.o \ input/input_config.o \ diff --git a/griffin/griffin.c b/griffin/griffin.c index 3a5211a7b0..61d8125798 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -408,7 +408,7 @@ FONTS /*============================================================ INPUT ============================================================ */ -#include "../input/input_autodetect.c" +#include "../tasks/task_autodetect.c" #include "../input/input_joypad_driver.c" #include "../input/input_config.c" #include "../input/input_keymaps.c" diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index bafd67cdb1..8a5ac71be8 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -34,7 +34,7 @@ #endif #include "../../frontend/drivers/platform_linux.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../drivers_keyboard/keyboard_event_android.h" diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index d9f63127ed..c5f96d0ec5 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -48,7 +48,7 @@ #include "../../configuration.h" #include "../../verbosity.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers/qnx_input.c b/input/drivers/qnx_input.c index 76547897ba..8ad9a90d37 100644 --- a/input/drivers/qnx_input.c +++ b/input/drivers/qnx_input.c @@ -29,7 +29,7 @@ #include "../../configuration.h" #include "../input_joypad_driver.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #define MAX_PADS 8 diff --git a/input/drivers/rwebinput_input.c b/input/drivers/rwebinput_input.c index b1d378befa..a173bd804e 100644 --- a/input/drivers/rwebinput_input.c +++ b/input/drivers/rwebinput_input.c @@ -20,7 +20,7 @@ #include #include "../input_joypad_driver.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_keyboard.h" #include "../input_config.h" #include "../input_keymaps.h" diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 2d40ea486b..916b68e2c9 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -27,7 +27,7 @@ #include "../../gfx/video_context_driver.h" #include "../../configuration.h" #include "../../verbosity.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index e69120c825..32be73af2b 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -23,7 +23,7 @@ #include "../connect/joypad_connection.h" #include "../input_defines.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_hid_driver.h" #include "../../configuration.h" #include "../../verbosity.h" diff --git a/input/drivers_hid/libusb_hid.c b/input/drivers_hid/libusb_hid.c index 325b8462f7..81db02092c 100644 --- a/input/drivers_hid/libusb_hid.c +++ b/input/drivers_hid/libusb_hid.c @@ -25,7 +25,7 @@ #include "../connect/joypad_connection.h" #include "../input_defines.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_driver.h" #include "../input_hid_driver.h" diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index 8e71f5c3a8..cffa96b7f0 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -20,7 +20,7 @@ #include "../input_defines.h" #include "../connect/joypad_connection.h" -#include "../input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../input_hid_driver.h" #include "../../verbosity.h" diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index 970b695599..c341a54213 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -20,7 +20,9 @@ #include "../input_joypad_driver.h" #include "../input_driver.h" -#include "../input_autodetect.h" + +#include "../../tasks/tasks_internal.h" + #include "../../configuration.h" #include "../../runloop.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 9a8b517998..f3ceddb62e 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -28,7 +28,7 @@ #include "../../config.h" #endif -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_joypad/gx_joypad.c b/input/drivers_joypad/gx_joypad.c index e0ee1aa4ae..d01e90970a 100644 --- a/input/drivers_joypad/gx_joypad.c +++ b/input/drivers_joypad/gx_joypad.c @@ -15,15 +15,15 @@ * If not, see . */ -#include "../../configuration.h" -#include "../input_autodetect.h" - #include #include #ifdef HW_RVL #include #endif +#include "../../configuration.h" +#include "../../tasks/tasks_internal.h" + #ifdef GEKKO #define WPADInit WPAD_Init #define WPADDisconnect WPAD_Disconnect diff --git a/input/drivers_joypad/hid_joypad.c b/input/drivers_joypad/hid_joypad.c index 11edf0dfa0..5273de9098 100644 --- a/input/drivers_joypad/hid_joypad.c +++ b/input/drivers_joypad/hid_joypad.c @@ -14,7 +14,7 @@ * If not, see . */ -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../input_hid_driver.h" #include "../input_driver.h" diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 263ebd8d65..0ac222536a 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -31,11 +31,11 @@ #include #include "../common/epoll_common.h" -#include "../input_autodetect.h" #include "../input_driver.h" #include "../../configuration.h" #include "../../runloop.h" #include "../../verbosity.h" +#include "../../tasks/tasks_internal.h" #define NUM_BUTTONS 32 #define NUM_AXES 32 diff --git a/input/drivers_joypad/parport_joypad.c b/input/drivers_joypad/parport_joypad.c index cf201e0e89..3c10fab04e 100644 --- a/input/drivers_joypad/parport_joypad.c +++ b/input/drivers_joypad/parport_joypad.c @@ -25,7 +25,7 @@ #include -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../input_driver.h" #include "../../configuration.h" #include "../../verbosity.h" diff --git a/input/drivers_joypad/ps3_joypad.c b/input/drivers_joypad/ps3_joypad.c index 1950473d3a..665b35d56d 100644 --- a/input/drivers_joypad/ps3_joypad.c +++ b/input/drivers_joypad/ps3_joypad.c @@ -17,7 +17,7 @@ #include #include -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/psp_joypad.c b/input/drivers_joypad/psp_joypad.c index 66184d937e..b48011f127 100644 --- a/input/drivers_joypad/psp_joypad.c +++ b/input/drivers_joypad/psp_joypad.c @@ -16,7 +16,7 @@ #include -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/qnx_joypad.c b/input/drivers_joypad/qnx_joypad.c index 30c9646458..c0afa2b655 100644 --- a/input/drivers_joypad/qnx_joypad.c +++ b/input/drivers_joypad/qnx_joypad.c @@ -15,7 +15,7 @@ * If not, see . */ -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/sdl_joypad.c b/input/drivers_joypad/sdl_joypad.c index fa761c93c3..705f8b3ff8 100644 --- a/input/drivers_joypad/sdl_joypad.c +++ b/input/drivers_joypad/sdl_joypad.c @@ -22,7 +22,7 @@ #include "../../configuration.h" #include "../input_driver.h" -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../verbosity.h" typedef struct _sdl_joypad diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index d57609ab38..bb01a6f803 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -31,7 +31,7 @@ #include #include -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../input_driver.h" #include "../common/udev_common.h" diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index 0fdaf9a1e8..7c8d49da59 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -22,7 +22,7 @@ #include "../input_joypad_driver.h" #include "../input_driver.h" -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../configuration.h" #include "../../runloop.h" #include "../../configuration.h" diff --git a/input/drivers_joypad/xdk_joypad.c b/input/drivers_joypad/xdk_joypad.c index 6ba0315f0d..de466bece5 100644 --- a/input/drivers_joypad/xdk_joypad.c +++ b/input/drivers_joypad/xdk_joypad.c @@ -17,7 +17,7 @@ #include #include "../../configuration.h" -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" static uint64_t pad_state[MAX_PADS]; static int16_t analog_state[MAX_PADS][2][2]; diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index df03433ce4..bbcca9a3b4 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -35,7 +35,7 @@ #include "../../config.h" #endif -#include "../input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../../configuration.h" diff --git a/input/input_autodetect.h b/input/input_autodetect.h deleted file mode 100644 index d92d386146..0000000000 --- a/input/input_autodetect.h +++ /dev/null @@ -1,38 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * 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 . - */ - -#ifndef _INPUT_AUTODETECT_H -#define _INPUT_AUTODETECT_H - -#include - -#include - -typedef struct autoconfig_params -{ - char name[255]; - char driver[255]; - char display_name[255]; - unsigned idx; - int32_t vid; - int32_t pid; -} autoconfig_params_t; - -bool input_autoconfigure_connect(autoconfig_params_t *params); - -void input_autoconfigure_disconnect(unsigned i, const char *ident); - -#endif diff --git a/input/input_autodetect_builtin.c b/input/input_autodetect_builtin.c index bd61ac9886..a74705622f 100644 --- a/input/input_autodetect_builtin.c +++ b/input/input_autodetect_builtin.c @@ -19,7 +19,7 @@ #include "../config.h" #endif -#include "input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "input_config.h" #define DECL_BTN(btn, bind) "input_" #btn "_btn = " #bind "\n" diff --git a/menu/cbs/menu_cbs_get_value.c b/menu/cbs/menu_cbs_get_value.c index 271a5977fb..4bae7707e7 100644 --- a/menu/cbs/menu_cbs_get_value.c +++ b/menu/cbs/menu_cbs_get_value.c @@ -28,7 +28,7 @@ #include "../menu_shader.h" #include "../menu_display.h" -#include "../../input/input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../input/input_config.h" #include "../../core.h" diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 66425b8250..488febb274 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -70,7 +70,7 @@ #include "../audio/audio_driver.h" #include "../audio/audio_resampler_driver.h" #include "../input/input_config.h" -#include "../input/input_autodetect.h" +#include "../tasks/tasks_internal.h" #include "../config.def.h" #include "../ui/ui_companion_driver.h" #include "../performance_counters.h" diff --git a/menu/widgets/menu_dialog.c b/menu/widgets/menu_dialog.c index 19205dcbfb..a4f19879ab 100644 --- a/menu/widgets/menu_dialog.c +++ b/menu/widgets/menu_dialog.c @@ -33,7 +33,7 @@ #include "../../retroarch.h" #include "../../configuration.h" -#include "../../input/input_autodetect.h" +#include "../../tasks/tasks_internal.h" #include "../../input/input_config.h" static bool menu_dialog_pending_push = false; diff --git a/setting_list.c b/setting_list.c index 97fcfca679..5395c9ef2c 100644 --- a/setting_list.c +++ b/setting_list.c @@ -32,7 +32,7 @@ #include "configuration.h" #include "config.def.h" #include "input/input_config.h" -#include "input/input_autodetect.h" +#include "tasks/tasks_internal.h" #include "setting_list.h" rarch_setting_t setting_terminator_setting(void) diff --git a/input/input_autodetect.c b/tasks/task_autodetect.c similarity index 96% rename from input/input_autodetect.c rename to tasks/task_autodetect.c index c1b7413bc3..7524f79ca7 100644 --- a/input/input_autodetect.c +++ b/tasks/task_autodetect.c @@ -14,6 +14,8 @@ * If not, see . */ +/* TODO/FIXME - turn this into actual task */ + #include #include #include @@ -22,8 +24,7 @@ #include #include -#include "input_config.h" -#include "input_autodetect.h" +#include "../input/input_config.h" #include "../configuration.h" #include "../file_path_special.h" @@ -32,6 +33,8 @@ #include "../runloop.h" #include "../verbosity.h" +#include "tasks_internal.h" + extern const char* const input_builtin_autoconfs[]; /* Adds an index for devices with the same name, @@ -78,12 +81,12 @@ static int input_autoconfigure_joypad_try_from_conf(config_file_t *conf, { char ident[256]; char input_driver[32]; - int tmp_int = 0; - int input_vid = 0; - int input_pid = 0; - int score = 0; + int tmp_int = 0; + int input_vid = 0; + int input_pid = 0; + int score = 0; - ident[0] = input_driver[0] = '\0'; + ident[0] = input_driver[0] = '\0'; config_get_array(conf, "input_device", ident, sizeof(ident)); config_get_array(conf, "input_driver", input_driver, sizeof(input_driver)); diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 245e1954a5..5207360fe1 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -71,6 +71,15 @@ typedef struct nbio_handle unsigned status; } nbio_handle_t; +typedef struct autoconfig_params +{ + char name[255]; + char driver[255]; + char display_name[255]; + unsigned idx; + int32_t vid; + int32_t pid; +} autoconfig_params_t; #ifdef HAVE_NETWORKING typedef struct @@ -157,6 +166,10 @@ void *savefile_ptr_get(void); void path_init_savefile_new(void); +bool input_autoconfigure_connect(autoconfig_params_t *params); + +void input_autoconfigure_disconnect(unsigned i, const char *ident); + RETRO_END_DECLS #endif From f1dd06db20f17de9deed9450b74929f2f86d1c45 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 20:39:42 +0100 Subject: [PATCH 109/638] (task_autodetect.c) Remove header include --- tasks/task_autodetect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 7524f79ca7..5bc3e2cde5 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -29,7 +29,6 @@ #include "../configuration.h" #include "../file_path_special.h" #include "../list_special.h" -#include "../msg_hash.h" #include "../runloop.h" #include "../verbosity.h" From db8f47cb58836789d3f3d4907dfa513558b672b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 20:40:54 +0100 Subject: [PATCH 110/638] Set task_screenshot to non blocking --- tasks/task_screenshot.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index ddc324a5ce..4d0ec767bb 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -212,7 +212,7 @@ static bool screenshot_dump( } #endif - task->type = TASK_TYPE_BLOCKING; + task->type = TASK_TYPE_NONE; task->state = state; task->handler = task_screenshot_handler; if (!savestate) From 25cc9446e8bc7024bb0fc310521f37745ce77b90 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 20:41:41 +0100 Subject: [PATCH 111/638] Simplify input_autoconfigure_connect --- tasks/task_autodetect.c | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 5bc3e2cde5..c1e8eb398b 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -301,30 +301,31 @@ static bool input_autoconfigure_joypad_init(autoconfig_params_t *params) bool input_autoconfigure_connect(autoconfig_params_t *params) { - char msg[255]; - - msg[0] = '\0'; - if (!input_autoconfigure_joypad_init(params)) - goto error; + return false; if (string_is_empty(params->name)) - goto error; + return false; - if (input_autoconfigure_joypad_from_conf_dir(params)) - return true; - if (input_autoconfigure_joypad_from_conf_internal(params)) - return true; + if ( !input_autoconfigure_joypad_from_conf_dir(params) + && !input_autoconfigure_joypad_from_conf_internal(params)) + { + char msg[255]; - RARCH_LOG("Autodetect: no profiles found for %s (%d/%d).\n", - params->name, params->vid, params->pid); - snprintf(msg, sizeof(msg), "%s (%ld/%ld) %s.", - params->name, (long)params->vid, (long)params->pid, - msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED)); - runloop_msg_queue_push(msg, 2, 60, false); + msg[0] = '\0'; -error: - return false; + RARCH_LOG("Autodetect: no profiles found for %s (%d/%d).\n", + params->name, params->vid, params->pid); + + snprintf(msg, sizeof(msg), "%s (%ld/%ld) %s.", + params->name, (long)params->vid, (long)params->pid, + msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED)); + runloop_msg_queue_push(msg, 2, 60, false); + + return false; + } + + return true; } void input_autoconfigure_disconnect(unsigned i, const char *ident) From 23dd41a3cc34d2c5808506963cb6971df0feb1c7 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Thu, 1 Dec 2016 15:40:31 -0500 Subject: [PATCH 112/638] missing ../ --- input/drivers/sdl_input.c | 2 +- input/drivers_hid/libusb_hid.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/input/drivers/sdl_input.c b/input/drivers/sdl_input.c index 916b68e2c9..645a9fc4a7 100644 --- a/input/drivers/sdl_input.c +++ b/input/drivers/sdl_input.c @@ -27,7 +27,7 @@ #include "../../gfx/video_context_driver.h" #include "../../configuration.h" #include "../../verbosity.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_hid/libusb_hid.c b/input/drivers_hid/libusb_hid.c index 81db02092c..b6ee3834d8 100644 --- a/input/drivers_hid/libusb_hid.c +++ b/input/drivers_hid/libusb_hid.c @@ -25,7 +25,7 @@ #include "../connect/joypad_connection.h" #include "../input_defines.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_driver.h" #include "../input_hid_driver.h" From 305b2becbd6d9caff1ff2a014dd6ffa18b1447d8 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:16:06 +0100 Subject: [PATCH 113/638] input_autoconfigure_connect - now a task --- tasks/task_autodetect.c | 71 ++++++++++++++++++++++++++++++----------- 1 file changed, 53 insertions(+), 18 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index c1e8eb398b..2d9f6b9a8d 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -20,6 +20,7 @@ #include #include +#include #include #include #include @@ -119,7 +120,7 @@ static int input_autoconfigure_joypad_try_from_conf(config_file_t *conf, } static void input_autoconfigure_joypad_add(config_file_t *conf, - autoconfig_params_t *params) + autoconfig_params_t *params, retro_task_t *task) { char msg[128]; char display_name[128]; @@ -154,7 +155,7 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, string_is_empty(display_name) ? params->name : display_name); if(!remote_is_bound) - runloop_msg_queue_push(msg, 2, 60, false); + task->title = strdup(msg); remote_is_bound = true; } else @@ -165,19 +166,19 @@ static void input_autoconfigure_joypad_add(config_file_t *conf, params->idx); if (!block_osd_spam) - runloop_msg_queue_push(msg, 2, 60, false); + task->title = strdup(msg); } input_autoconfigure_joypad_reindex_devices(); } static int input_autoconfigure_joypad_from_conf( - config_file_t *conf, autoconfig_params_t *params) + config_file_t *conf, autoconfig_params_t *params, retro_task_t *task) { int ret = input_autoconfigure_joypad_try_from_conf(conf, params); if (ret) - input_autoconfigure_joypad_add(conf, params); + input_autoconfigure_joypad_add(conf, params, task); config_file_free(conf); @@ -185,7 +186,7 @@ static int input_autoconfigure_joypad_from_conf( } static bool input_autoconfigure_joypad_from_conf_dir( - autoconfig_params_t *params) + autoconfig_params_t *params, retro_task_t *task) { size_t i; char path[PATH_MAX_LENGTH]; @@ -244,7 +245,7 @@ static bool input_autoconfigure_joypad_from_conf_dir( config_get_config_path(conf, conf_path, sizeof(conf_path)); RARCH_LOG("Autodetect: selected configuration: %s\n", conf_path); - input_autoconfigure_joypad_add(conf, params); + input_autoconfigure_joypad_add(conf, params, task); config_file_free(conf); ret = 1; } @@ -260,7 +261,7 @@ static bool input_autoconfigure_joypad_from_conf_dir( } static bool input_autoconfigure_joypad_from_conf_internal( - autoconfig_params_t *params) + autoconfig_params_t *params, retro_task_t *task) { size_t i; settings_t *settings = config_get_ptr(); @@ -270,7 +271,7 @@ static bool input_autoconfigure_joypad_from_conf_internal( { config_file_t *conf = config_file_new_from_string( input_builtin_autoconfs[i]); - if (conf && input_autoconfigure_joypad_from_conf(conf, params)) + if (conf && input_autoconfigure_joypad_from_conf(conf, params, task)) return true; } @@ -299,16 +300,18 @@ static bool input_autoconfigure_joypad_init(autoconfig_params_t *params) return true; } -bool input_autoconfigure_connect(autoconfig_params_t *params) +static void input_autoconfigure_connect_handler(retro_task_t *task) { - if (!input_autoconfigure_joypad_init(params)) - return false; + autoconfig_params_t *params = task ? (autoconfig_params_t*)task->state : NULL; + + if (!params || !input_autoconfigure_joypad_init(params)) + return; if (string_is_empty(params->name)) - return false; + return; - if ( !input_autoconfigure_joypad_from_conf_dir(params) - && !input_autoconfigure_joypad_from_conf_internal(params)) + if ( !input_autoconfigure_joypad_from_conf_dir(params, task) + && !input_autoconfigure_joypad_from_conf_internal(params, task)) { char msg[255]; @@ -320,12 +323,14 @@ bool input_autoconfigure_connect(autoconfig_params_t *params) snprintf(msg, sizeof(msg), "%s (%ld/%ld) %s.", params->name, (long)params->vid, (long)params->pid, msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED)); - runloop_msg_queue_push(msg, 2, 60, false); + task->title = strdup(msg); - return false; + return; } - return true; + task->finished = true; + + return; } void input_autoconfigure_disconnect(unsigned i, const char *ident) @@ -341,3 +346,33 @@ void input_autoconfigure_disconnect(unsigned i, const char *ident) RARCH_LOG("%s: %s\n", msg_hash_to_str(MSG_AUTODETECT), msg); } + +bool input_autoconfigure_connect(autoconfig_params_t *params) +{ + retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); + autoconfig_params_t *state = (autoconfig_params_t*)calloc(1, sizeof(*state)); + + if (!task || !state) + goto error; + + strlcpy(state->name, params->name, sizeof(state->name)); + state->idx = params->idx; + state->vid = params->vid; + state->pid = params->pid; + + task->type = TASK_TYPE_BLOCKING; + task->state = state; + task->handler = input_autoconfigure_connect_handler; + + task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); + + return true; + +error: + if (state) + free(state); + if (task) + free(task); + + return false; +} From 6a2df4615b60f52929297824861b023a2dc9ca77 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:17:36 +0100 Subject: [PATCH 114/638] task_autodetect.c- style nits --- tasks/task_autodetect.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 2d9f6b9a8d..8f85c41c7f 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -356,12 +356,13 @@ bool input_autoconfigure_connect(autoconfig_params_t *params) goto error; strlcpy(state->name, params->name, sizeof(state->name)); - state->idx = params->idx; - state->vid = params->vid; - state->pid = params->pid; - task->type = TASK_TYPE_BLOCKING; - task->state = state; + state->idx = params->idx; + state->vid = params->vid; + state->pid = params->pid; + + task->type = TASK_TYPE_BLOCKING; + task->state = state; task->handler = input_autoconfigure_connect_handler; task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); From 4a894afc573781f173e2514715a05fa12344a8d5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:19:09 +0100 Subject: [PATCH 115/638] Don't make it a blocking task --- tasks/task_autodetect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 8f85c41c7f..3bb36b44ab 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -361,7 +361,6 @@ bool input_autoconfigure_connect(autoconfig_params_t *params) state->vid = params->vid; state->pid = params->pid; - task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = input_autoconfigure_connect_handler; From 5fdb5b4dcf5bf3e0172ad5aecfcf42ccb322b03a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:24:17 +0100 Subject: [PATCH 116/638] Updates --- input/drivers_joypad/udev_joypad.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index bb01a6f803..fd790ee5dd 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -183,7 +183,7 @@ static int udev_open_joystick(const char *path) if (fd < 0) return fd; - if ((ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || + if ( (ioctl(fd, EVIOCGBIT(0, sizeof(evbit)), evbit) < 0) || (ioctl(fd, EVIOCGBIT(EV_KEY, sizeof(keybit)), keybit) < 0) || (ioctl(fd, EVIOCGBIT(EV_ABS, sizeof(absbit)), absbit) < 0)) goto error; @@ -387,7 +387,8 @@ static void udev_joypad_remove_device(const char *path) for (i = 0; i < MAX_USERS; i++) { - if (udev_pads[i].path && string_is_equal(udev_pads[i].path, path)) + if ( !string_is_empty(udev_pads[i].path) + && string_is_equal(udev_pads[i].path, path)) { input_autoconfigure_disconnect(i, udev_pads[i].ident); udev_free_pad(i); From 3db866e5dc7886fa129e52307cab518774dfc08a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:36:38 +0100 Subject: [PATCH 117/638] disconnect action is a task now too --- tasks/task_autodetect.c | 44 +++++++++++++++++++++++++++++++++++------ tasks/tasks_internal.h | 2 +- 2 files changed, 39 insertions(+), 7 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 3bb36b44ab..440066537e 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -37,6 +37,11 @@ extern const char* const input_builtin_autoconfs[]; +typedef struct autoconfig_disconnect +{ + char msg[255]; +} autoconfig_disconnect_t; + /* Adds an index for devices with the same name, * so they can be identified in the GUI. */ static void input_autoconfigure_joypad_reindex_devices(void) @@ -329,22 +334,49 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) } task->finished = true; - - return; } -void input_autoconfigure_disconnect(unsigned i, const char *ident) +static void input_autoconfigure_disconnect_handler(retro_task_t *task) +{ + autoconfig_disconnect_t *params = task ? (autoconfig_disconnect_t*)task->state : NULL; + + task->title = strdup(params->msg); + task->finished = true; + + RARCH_LOG("%s: %s\n", msg_hash_to_str(MSG_AUTODETECT), params->msg); +} + +bool input_autoconfigure_disconnect(unsigned i, const char *ident) { char msg[255]; + retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); + autoconfig_disconnect_t *state = (autoconfig_disconnect_t*)calloc(1, sizeof(*state)); msg[0] = '\0'; snprintf(msg, sizeof(msg), "%s #%u (%s).", msg_hash_to_str(MSG_DEVICE_DISCONNECTED_FROM_PORT), i, ident); - runloop_msg_queue_push(msg, 2, 60, false); - RARCH_LOG("%s: %s\n", msg_hash_to_str(MSG_AUTODETECT), - msg); + + if (!task || !state) + goto error; + + strlcpy(state->msg, msg, sizeof(state->msg)); + + task->state = state; + task->handler = input_autoconfigure_disconnect_handler; + + task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); + + return true; + +error: + if (state) + free(state); + if (task) + free(task); + + return false; } bool input_autoconfigure_connect(autoconfig_params_t *params) diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 88f226538f..891fa81d6f 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -169,7 +169,7 @@ void path_init_savefile_new(void); bool input_autoconfigure_connect(autoconfig_params_t *params); -void input_autoconfigure_disconnect(unsigned i, const char *ident); +bool input_autoconfigure_disconnect(unsigned i, const char *ident); RETRO_END_DECLS From 82bea3ba9fb7fdd9d03b17bf87610b749642e074 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:37:27 +0100 Subject: [PATCH 118/638] Remove FIXME/TODO --- tasks/task_autodetect.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 440066537e..abd9024813 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -14,8 +14,6 @@ * If not, see . */ -/* TODO/FIXME - turn this into actual task */ - #include #include #include From 24a689c27459fbb71fc2ca13627766a0c02fb26e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:38:19 +0100 Subject: [PATCH 119/638] Cleanup --- tasks/task_autodetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index abd9024813..014dfdfe3e 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -114,8 +114,8 @@ static int input_autoconfigure_joypad_try_from_conf(config_file_t *conf, score += 2; else { - if (!string_is_empty(ident) - && string_is_equal(params->name, ident)) + if ( !string_is_empty(ident) + && string_is_equal(params->name, ident)) score += 1; } From 2cc4bef3aa42e4f99851e420fedaaaf2ef56491e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 22:38:56 +0100 Subject: [PATCH 120/638] Do the screenshot in the savestate callback --- command.c | 2 -- tasks/task_save.c | 26 ++++++++++++++++++++++++++ tasks/task_screenshot.c | 2 +- 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/command.c b/command.c index 420056b950..0c0de6aa83 100644 --- a/command.c +++ b/command.c @@ -1683,8 +1683,6 @@ static void command_event_main_state(unsigned cmd) switch (cmd) { case CMD_EVENT_SAVE_STATE: - if (settings->savestate_thumbnail_enable) - take_savestate_screenshot(path); content_save_state(path, true, false); push_msg = false; break; diff --git a/tasks/task_save.c b/tasks/task_save.c index 4155862af8..12cad9eda3 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -504,6 +504,8 @@ static void undo_save_state_cb(void *task_data, static void task_save_handler_finished(retro_task_t *task, save_task_state_t *state) { + save_task_state_t *task_data = NULL; + task->finished = true; filestream_close(state->file); @@ -511,6 +513,11 @@ static void task_save_handler_finished(retro_task_t *task, if (!task->error && task->cancelled) task->error = strdup("Task canceled"); + task_data = (save_task_state_t*)calloc(1, sizeof(*task_data)); + memcpy(task_data, state, sizeof(*state)); + + task->task_data = task_data; + if (state->data) { if (state->undo_save && state->data == undo_save_buf.data) @@ -970,6 +977,24 @@ error: free(load_data); } +/** + * save_state_cb: + * + * Called after the save state is done. Takes a screenshot if needed. + **/ +static void save_state_cb(void *task_data, + void *user_data, const char *error) +{ + settings_t *settings = config_get_ptr(); + save_task_state_t *state = (save_task_state_t*)task_data; + char *path = strdup(state->path); + + if (settings->savestate_thumbnail_enable) + take_savestate_screenshot(path); + + free(path); +} + /** * task_push_save_state: * @path : file path of the save state @@ -995,6 +1020,7 @@ static void task_push_save_state(const char *path, void *data, size_t size, bool task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = task_save_handler; + task->callback = save_state_cb; task->title = strdup(msg_hash_to_str(MSG_SAVING_STATE)); task->mute = state->mute; diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index 4d0ec767bb..ddc324a5ce 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -212,7 +212,7 @@ static bool screenshot_dump( } #endif - task->type = TASK_TYPE_NONE; + task->type = TASK_TYPE_BLOCKING; task->state = state; task->handler = task_screenshot_handler; if (!savestate) From 22e1854b8c5e5de29b0181287aae2ec843b1ecad Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:49:03 +0100 Subject: [PATCH 121/638] Get rid of runloop.h header include --- tasks/task_autodetect.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 014dfdfe3e..637e16ec90 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -28,7 +28,6 @@ #include "../configuration.h" #include "../file_path_special.h" #include "../list_special.h" -#include "../runloop.h" #include "../verbosity.h" #include "tasks_internal.h" From 0d79bc754c8d1410518aa5cc0ad58f70ac8a2a14 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Thu, 1 Dec 2016 22:51:46 +0100 Subject: [PATCH 122/638] (OSX) Buildfix --- input/drivers_hid/iohidmanager_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers_hid/iohidmanager_hid.c b/input/drivers_hid/iohidmanager_hid.c index 32be73af2b..3948f111e9 100644 --- a/input/drivers_hid/iohidmanager_hid.c +++ b/input/drivers_hid/iohidmanager_hid.c @@ -23,7 +23,7 @@ #include "../connect/joypad_connection.h" #include "../input_defines.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_hid_driver.h" #include "../../configuration.h" #include "../../verbosity.h" From 5e758208806041c6ea06c858d76e74b55d5d95c6 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Thu, 1 Dec 2016 22:54:34 +0100 Subject: [PATCH 123/638] Remove unused variables --- menu/drivers/xmb.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 83ea4912b3..939c00c055 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -839,11 +839,9 @@ end: static void xmb_update_thumbnail_path(void *data, unsigned i) { menu_entry_t entry; - unsigned depth; char *tmp = NULL; char *scrub_char_pointer = NULL; settings_t *settings = config_get_ptr(); - global_t *global = global_get_ptr(); xmb_handle_t *xmb = (xmb_handle_t*)data; playlist_t *playlist = NULL; const char *core_name = NULL; @@ -919,13 +917,10 @@ static void xmb_update_thumbnail_path(void *data, unsigned i) static void xmb_update_savestate_thumbnail_path(void *data, unsigned i) { menu_entry_t entry; - char *tmp = NULL; - char *scrub_char_pointer = NULL; settings_t *settings = config_get_ptr(); global_t *global = global_get_ptr(); xmb_handle_t *xmb = (xmb_handle_t*)data; playlist_t *playlist = NULL; - const char *core_name = NULL; if (!xmb) return; From 230d7105fd1f631e7d137c81ec7df61461fc32d0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:57:43 +0100 Subject: [PATCH 124/638] CXX_BUILD fix --- tasks/task_autodetect.c | 2 -- tasks/tasks_internal.h | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 637e16ec90..e775d7391b 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -32,8 +32,6 @@ #include "tasks_internal.h" -extern const char* const input_builtin_autoconfs[]; - typedef struct autoconfig_disconnect { char msg[255]; diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 891fa81d6f..d2b1fb16f1 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -171,6 +171,8 @@ bool input_autoconfigure_connect(autoconfig_params_t *params); bool input_autoconfigure_disconnect(unsigned i, const char *ident); +extern const char* const input_builtin_autoconfs[]; + RETRO_END_DECLS #endif From 02c0e8013b7fe252f9f555d2f404a1703ab2c38c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 22:59:00 +0100 Subject: [PATCH 125/638] C89_BUILD fixes --- tasks/task_wifi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 387b5a65fb..86476e7fb5 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -39,10 +39,13 @@ typedef struct static void wifi_scan_callback(void *task_data, void *user_data, const char *error) { + unsigned i; unsigned menu_type = 0; const char *path = NULL; const char *label = NULL; enum msg_hash_enums enum_idx = MSG_UNKNOWN; + file_list_t *file_list = NULL; + struct string_list *ssid_list = NULL; menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); @@ -51,14 +54,13 @@ static void wifi_scan_callback(void *task_data, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST))) return; - file_list_t *file_list = menu_entries_get_selection_buf_ptr(0); + file_list = menu_entries_get_selection_buf_ptr(0); menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); - struct string_list *ssid_list = string_list_new(); + ssid_list = string_list_new(); driver_wifi_get_ssids(ssid_list); - unsigned i; for (i = 0; i < ssid_list->size; i++) { const char *ssid = ssid_list->elems[i].data; From 4c41c7a3d0bee74a6f419d33981612297d9048d9 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Thu, 1 Dec 2016 23:03:09 +0100 Subject: [PATCH 126/638] Fix for when a device is not able to be autoconfigured - properly finish the task then --- tasks/task_autodetect.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index e775d7391b..5378a3b61f 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -304,11 +304,11 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) { autoconfig_params_t *params = task ? (autoconfig_params_t*)task->state : NULL; - if (!params || !input_autoconfigure_joypad_init(params)) - return; - - if (string_is_empty(params->name)) + if (!params || !input_autoconfigure_joypad_init(params) || string_is_empty(params->name)) + { + task->finished = true; return; + } if ( !input_autoconfigure_joypad_from_conf_dir(params, task) && !input_autoconfigure_joypad_from_conf_internal(params, task)) @@ -325,6 +325,7 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) msg_hash_to_str(MSG_DEVICE_NOT_CONFIGURED)); task->title = strdup(msg); + task->finished = true; return; } From 779b680264fe884cfd55cd7206be4c8c3e246e70 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 1 Dec 2016 23:05:36 +0100 Subject: [PATCH 127/638] (Android) Buildfix --- input/drivers/android_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers/android_input.c b/input/drivers/android_input.c index 8a5ac71be8..0c0410fca8 100644 --- a/input/drivers/android_input.c +++ b/input/drivers/android_input.c @@ -34,10 +34,10 @@ #endif #include "../../frontend/drivers/platform_linux.h" -#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../drivers_keyboard/keyboard_event_android.h" +#include "../../tasks/tasks_internal.h" #include "../../performance_counters.h" #include "../../configuration.h" From b8db914af47aedeb309faf70437cb4c77e8c70ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Thu, 1 Dec 2016 23:24:16 +0100 Subject: [PATCH 128/638] Fix savestate thumbnail path when screenshot dir is set --- tasks/task_screenshot.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/tasks/task_screenshot.c b/tasks/task_screenshot.c index ddc324a5ce..39c38a7d26 100644 --- a/tasks/task_screenshot.c +++ b/tasks/task_screenshot.c @@ -191,13 +191,20 @@ static bool screenshot_dump( state->frame = frame; state->userbuf = userbuf; - if (settings->auto_screenshot_filename && !savestate) - fill_str_dated_filename(state->shotname, path_basename(name_base), - IMG_EXT, sizeof(state->shotname)); + if (savestate) + { + snprintf(state->filename, sizeof(state->filename), "%s.png", name_base); + } else - snprintf(state->shotname, sizeof(state->shotname), "%s.png", path_basename(name_base)); + { + if (settings->auto_screenshot_filename) + fill_str_dated_filename(state->shotname, path_basename(name_base), + IMG_EXT, sizeof(state->shotname)); + else + snprintf(state->shotname, sizeof(state->shotname), "%s.png", path_basename(name_base)); - fill_pathname_join(state->filename, folder, state->shotname, sizeof(state->filename)); + fill_pathname_join(state->filename, folder, state->shotname, sizeof(state->filename)); + } #ifdef _XBOX1 d3d->dev->GetBackBuffer(-1, D3DBACKBUFFER_TYPE_MONO, &state->surf); From ac32ce8ad40e7e16fc41e573384c8281b5572bf2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 2 Dec 2016 00:20:50 +0100 Subject: [PATCH 129/638] Code cleaning + remove useless HAVE_LAKKA ifdefs --- menu/menu_setting.c | 42 +++++++++++++++++------------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 750314c6f4..0d5fc9c530 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2417,16 +2417,14 @@ static bool setting_append_list( &subgroup_info, parent_group); - if (settings->menu.show_advanced_settings) - { - CONFIG_ACTION( - list, list_info, - MENU_ENUM_LABEL_CORE_SETTINGS, - MENU_ENUM_LABEL_VALUE_CORE_SETTINGS, - &group_info, - &subgroup_info, - parent_group); - } + CONFIG_ACTION( + list, list_info, + MENU_ENUM_LABEL_CORE_SETTINGS, + MENU_ENUM_LABEL_VALUE_CORE_SETTINGS, + &group_info, + &subgroup_info, + parent_group); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); CONFIG_ACTION( list, list_info, @@ -2444,16 +2442,14 @@ static bool setting_append_list( &subgroup_info, parent_group); - if (settings->menu.show_advanced_settings) - { - CONFIG_ACTION( - list, list_info, - MENU_ENUM_LABEL_LOGGING_SETTINGS, - MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS, - &group_info, - &subgroup_info, - parent_group); - } + CONFIG_ACTION( + list, list_info, + MENU_ENUM_LABEL_LOGGING_SETTINGS, + MENU_ENUM_LABEL_VALUE_LOGGING_SETTINGS, + &group_info, + &subgroup_info, + parent_group); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); CONFIG_ACTION( list, list_info, @@ -2511,7 +2507,7 @@ static bool setting_append_list( &subgroup_info, parent_group); -#if !defined(RARCH_CONSOLE) && !defined(HAVE_LAKKA) +#if !defined(RARCH_CONSOLE) CONFIG_ACTION( list, list_info, MENU_ENUM_LABEL_USER_INTERFACE_SETTINGS, @@ -5266,7 +5262,6 @@ static bool setting_append_list( END_GROUP(list, list_info, parent_group); break; case SETTINGS_LIST_USER_INTERFACE: -#ifndef HAVE_LAKKA START_GROUP(list, list_info, &group_info, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USER_INTERFACE_SETTINGS), parent_group); @@ -5359,7 +5354,6 @@ static bool setting_append_list( END_SUB_GROUP(list, list_info, parent_group); END_GROUP(list, list_info, parent_group); -#endif break; case SETTINGS_LIST_PLAYLIST: START_GROUP(list, list_info, &group_info, @@ -5371,7 +5365,6 @@ static bool setting_append_list( START_SUB_GROUP(list, list_info, "History", &group_info, &subgroup_info, parent_group); -#ifndef HAVE_LAKKA CONFIG_BOOL( list, list_info, &settings->history_list_enable, @@ -5387,7 +5380,6 @@ static bool setting_append_list( general_read_handler, SD_FLAG_NONE ); -#endif CONFIG_UINT( list, list_info, From 344a7f9c07531228bc7d1e9d73d4828ca84b3085 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Andr=C3=A9=20Santoni?= Date: Fri, 2 Dec 2016 00:23:08 +0100 Subject: [PATCH 130/638] Indentation --- menu/menu_setting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 0d5fc9c530..2a399079d3 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2424,7 +2424,7 @@ static bool setting_append_list( &group_info, &subgroup_info, parent_group); - settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); + settings_data_list_current_add_flags(list, list_info, SD_FLAG_ADVANCED); CONFIG_ACTION( list, list_info, From 70557fdee6638e27b6dc5056e0037eaa417e4edb Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 00:24:18 +0100 Subject: [PATCH 131/638] (Wii) Buildfix --- input/drivers_hid/wiiusb_hid.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers_hid/wiiusb_hid.c b/input/drivers_hid/wiiusb_hid.c index cffa96b7f0..d09f6d6c8c 100644 --- a/input/drivers_hid/wiiusb_hid.c +++ b/input/drivers_hid/wiiusb_hid.c @@ -20,7 +20,7 @@ #include "../input_defines.h" #include "../connect/joypad_connection.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_hid_driver.h" #include "../../verbosity.h" From e5072c8e7fa8b523620daceda689fe3608ddd72c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 00:59:01 +0100 Subject: [PATCH 132/638] Put this behind #ifndef _XBOX ifdef --- gfx/common/win32_common.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index a53015c41c..704cb40e35 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -97,10 +97,12 @@ void win32_check_window(bool *quit, void win32_set_window(unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, void *rect_data); +#ifndef _XBOX /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); +#endif void win32_window_reset(void); From 2eeb8912e86adf4b0e902540c5b16aa6f9d7da49 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:03:14 +0100 Subject: [PATCH 133/638] (xdk1_xfonts.c) Add header include --- gfx/drivers_font/xdk1_xfonts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gfx/drivers_font/xdk1_xfonts.c b/gfx/drivers_font/xdk1_xfonts.c index e488b0d98e..a953fb5e72 100644 --- a/gfx/drivers_font/xdk1_xfonts.c +++ b/gfx/drivers_font/xdk1_xfonts.c @@ -20,6 +20,8 @@ #include "../../config.h" #endif +#include "../drivers/d3d.h" + #include "../font_driver.h" #include "../../runloop.h" From 0284853681373ac10299f735c4758e340e83c886 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:04:46 +0100 Subject: [PATCH 134/638] (xbox OG) Use flicker_filter_index --- gfx/video_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/video_driver.c b/gfx/video_driver.c index 69a9a8842b..5849c3eda5 100644 --- a/gfx/video_driver.c +++ b/gfx/video_driver.c @@ -1292,7 +1292,7 @@ void video_driver_menu_settings(void **list_data, void *list_info_data, #ifdef _XBOX1 CONFIG_UINT( list, list_info, - &settings->video.swap_interval, + &global->console.screen.flicker_filter_index, MENU_ENUM_LABEL_VIDEO_FILTER_FLICKER, MENU_ENUM_LABEL_VALUE_VIDEO_FILTER_FLICKER, 0, From 3b78c848a29defebf669b6e01d1106c30a764b03 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:06:53 +0100 Subject: [PATCH 135/638] Another Xbox buildfix --- libretro-common/lists/dir_list.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libretro-common/lists/dir_list.c b/libretro-common/lists/dir_list.c index fdba0dc475..3f2277c1c2 100644 --- a/libretro-common/lists/dir_list.c +++ b/libretro-common/lists/dir_list.c @@ -22,7 +22,9 @@ #include -#ifdef _WIN32 +#if defined(_WIN32) && defined(_XBOX) +#include +#elif defined(_WIN32) #include #endif From ff2892498e25f5a10e728073c96fe0edec80942c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:16:26 +0100 Subject: [PATCH 136/638] Change flicker_filter_index to unsigned int --- runloop.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runloop.h b/runloop.h index 76fb50a6ce..393e56c610 100644 --- a/runloop.h +++ b/runloop.h @@ -177,7 +177,7 @@ typedef struct global } resolutions; unsigned gamma_correction; - unsigned char flicker_filter_index; + unsigned int flicker_filter_index; unsigned char soft_filter_index; bool pal_enable; bool pal60_enable; From c8ff6d9030f8bc3f6b68dfae741c753294e85070 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:43:43 +0100 Subject: [PATCH 137/638] (menu_event.c) Add FIXME and some cleanups --- menu/menu_event.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/menu/menu_event.c b/menu/menu_event.c index c6f93d4c01..5d7cdaab5e 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -187,7 +187,6 @@ void menu_event_keyboard_set(bool down, enum retro_key key) unsigned menu_event(uint64_t input, uint64_t trigger_input) { - unsigned menu_ok_btn, menu_cancel_btn; menu_animation_ctx_delta_t delta; float delta_time; /* Used for key repeat */ @@ -201,18 +200,17 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) size_t new_scroll_accel = 0; menu_input_t *menu_input = NULL; settings_t *settings = config_get_ptr(); - bool ok_current = false; static bool ok_old = false; - bool ok_trigger = false; - - menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? + unsigned menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_B : RETRO_DEVICE_ID_JOYPAD_A; - menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? + unsigned menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; + bool ok_current = input & UINT64_C(1) << menu_ok_btn; - ok_current = input & UINT64_C(1) << menu_ok_btn; - ok_trigger = ok_current & ~ok_old; - ok_old = ok_current; + /* TODO/FIXME - unsafe use of type 'bool' in operation */ + bool ok_trigger = ok_current & ~ok_old; + + ok_old = ok_current; if (input) { From c3ea6d138540de06edc2ab5b8a65bc0791460fcf Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:46:16 +0100 Subject: [PATCH 138/638] Add HAVE_D3D9 ifdef --- menu/drivers_display/menu_display_d3d.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/menu/drivers_display/menu_display_d3d.cpp b/menu/drivers_display/menu_display_d3d.cpp index 9338b61ba1..7e61815904 100644 --- a/menu/drivers_display/menu_display_d3d.cpp +++ b/menu/drivers_display/menu_display_d3d.cpp @@ -28,7 +28,10 @@ #include "../../gfx/video_context_driver.h" #include "../../gfx/drivers/d3d.h" #include "../../gfx/common/d3d_common.h" + +#ifdef HAVE_D3D9 #include "../../gfx/include/d3d9/d3dx9math.h" +#endif #define BYTE_CLAMP(i) (int) ((((i) > 255) ? 255 : (((i) < 0) ? 0 : (i)))) From 4ee5fcae47e8052a6951e05c0eb6ece21a51b24c Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:51:26 +0100 Subject: [PATCH 139/638] Buildfixes --- gfx/drivers_context/d3d_ctx.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gfx/drivers_context/d3d_ctx.cpp b/gfx/drivers_context/d3d_ctx.cpp index f5710b589b..d1d051fab0 100644 --- a/gfx/drivers_context/d3d_ctx.cpp +++ b/gfx/drivers_context/d3d_ctx.cpp @@ -24,12 +24,15 @@ #include "../../config.h" #endif +#include + #include "../drivers/d3d.h" #include "../common/win32_common.h" #include "../../configuration.h" #include "../../runloop.h" #include "../../verbosity.h" +#include "../../ui/ui_companion_driver.h" #ifdef _MSC_VER #ifndef _XBOX From f9e72b89e2f7884c9de0158114e0d6848d6a98dd Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 01:54:28 +0100 Subject: [PATCH 140/638] (platform_xdk.cpp) Buildfixes --- frontend/drivers/platform_xdk.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/frontend/drivers/platform_xdk.cpp b/frontend/drivers/platform_xdk.cpp index 77d00abc82..4443d52bca 100644 --- a/frontend/drivers/platform_xdk.cpp +++ b/frontend/drivers/platform_xdk.cpp @@ -35,6 +35,7 @@ #include "../frontend_driver.h" #include "../../defaults.h" +#include "../../paths.h" #ifndef IS_SALAMANDER #include "../../retroarch.h" #ifdef HAVE_MENU @@ -1271,7 +1272,7 @@ static void frontend_xdk_exec(const char *path, bool should_load_game) snprintf((char*)ptr.Data, sizeof(ptr.Data), "%s", path_get(RARCH_PATH_CONTENT)); if (!string_is_empty(path)) - XLaunchNewImage(path, !string_is_empty(ptr.Data) ? &ptr : NULL); + XLaunchNewImage(path, !string_is_empty((const char*)ptr.Data) ? &ptr : NULL); #elif defined(_XBOX360) char game_path[1024] = {0}; From 5739be55942de8ec9f5a0780b80cf9bfafc9af42 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Thu, 1 Dec 2016 20:40:16 -0500 Subject: [PATCH 141/638] SOCKET_LEGACY doesn't even necessarily have inet_ntoa, so oh well, no host for you --- network/netplay/netplay.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 9479b9cd21..371c38a305 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1110,10 +1110,7 @@ static void announce_nat_traversal(netplay_t *netplay) #else if (netplay->nat_traversal_state.have_inet4) { - strncpy(host, - inet_ntoa(netplay->nat_traversal_state.ext_inet4_addr.sin_addr), - PATH_MAX_LENGTH); - host[PATH_MAX_LENGTH-1] = '\0'; + host[0] = '\0'; snprintf(port, 6, "%hu", ntohs(netplay->nat_traversal_state.ext_inet4_addr.sin_port)); port[5] = '\0'; From dd5736b27317dd5175fa0bad22dbbec91fb3f0f0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 05:26:37 +0100 Subject: [PATCH 142/638] Turn check_input_driver_block_hotkey into macro --- input/input_driver.c | 72 ++++++++++++++++++++++++-------------------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index 733c35348e..6eea00d479 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -526,35 +526,22 @@ int16_t input_state(unsigned port, unsigned device, * check_input_driver_block_hotkey: * * Checks if 'hotkey enable' key is pressed. + * + * If we haven't bound anything to this, + * always allow hotkeys. + + * If we hold ENABLE_HOTKEY button, block all libretro input to allow + * hotkeys to be bound to same keys as RetroPad. **/ -static bool check_input_driver_block_hotkey(void) -{ - settings_t *settings = config_get_ptr(); - const struct retro_keybind *bind = - &settings->input.binds[0][RARCH_ENABLE_HOTKEY]; - const struct retro_keybind *autoconf_bind = - &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; - - /* Don't block the check to RARCH_ENABLE_HOTKEY - * unless we're really supposed to. */ - if (current_input->keyboard_mapping_is_blocked && - current_input->keyboard_mapping_is_blocked(current_input_data)) - input_driver_block_hotkey = true; - - /* If we haven't bound anything to this, - * always allow hotkeys. */ - - /* If we hold ENABLE_HOTKEY button, block all libretro input to allow - * hotkeys to be bound to same keys as RetroPad. */ - return - (bind->key != RETROK_UNKNOWN) - || (bind->joykey != NO_BTN) - || (bind->joyaxis != AXIS_NONE) - || (autoconf_bind->key != RETROK_UNKNOWN ) - || (autoconf_bind->joykey != NO_BTN) - || (autoconf_bind->joyaxis != AXIS_NONE); - -} +#define check_input_driver_block_hotkey(normal_bind, autoconf_bind) \ +( \ + (((normal_bind)->key != RETROK_UNKNOWN) \ + || ((normal_bind)->joykey != NO_BTN) \ + || ((normal_bind)->joyaxis != AXIS_NONE) \ + || ((autoconf_bind)->key != RETROK_UNKNOWN ) \ + || ((autoconf_bind)->joykey != NO_BTN) \ + || ((autoconf_bind)->joyaxis != AXIS_NONE)) \ +) static const unsigned buttons[] = { RETRO_DEVICE_ID_JOYPAD_R, @@ -670,14 +657,22 @@ static INLINE bool input_keys_pressed_internal(unsigned i, uint64_t input_keys_pressed(void) { unsigned i; - uint64_t ret = 0; - settings_t *settings = config_get_ptr(); - const struct retro_keybind *binds = settings->input.binds[0]; + uint64_t ret = 0; + settings_t *settings = config_get_ptr(); + const struct retro_keybind *binds = settings->input.binds[0]; + const struct retro_keybind *binds_auto = &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; + const struct retro_keybind *normal = &binds[RARCH_ENABLE_HOTKEY]; input_driver_block_libretro_input = false; input_driver_block_hotkey = false; - if (check_input_driver_block_hotkey()) + /* Don't block the check to RARCH_ENABLE_HOTKEY + * unless we're really supposed to. */ + if (current_input->keyboard_mapping_is_blocked && + current_input->keyboard_mapping_is_blocked(current_input_data)) + input_driver_block_hotkey = true; + + if (check_input_driver_block_hotkey(normal, binds_auto)) { if (current_input->input_state(current_input_data, &binds, 0, RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) @@ -783,6 +778,8 @@ uint64_t input_menu_keys_pressed(void) uint64_t ret = 0; settings_t *settings = config_get_ptr(); const struct retro_keybind *binds[MAX_USERS] = {NULL}; + const struct retro_keybind *binds_norm = NULL; + const struct retro_keybind *binds_auto = NULL; if (!current_input || !current_input_data) return ret; @@ -794,7 +791,16 @@ uint64_t input_menu_keys_pressed(void) input_driver_block_libretro_input = false; input_driver_block_hotkey = false; - if (check_input_driver_block_hotkey()) + /* Don't block the check to RARCH_ENABLE_HOTKEY + * unless we're really supposed to. */ + if (current_input->keyboard_mapping_is_blocked && + current_input->keyboard_mapping_is_blocked(current_input_data)) + input_driver_block_hotkey = true; + + binds_norm = &settings->input.binds[0][RARCH_ENABLE_HOTKEY]; + binds_auto = &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; + + if (check_input_driver_block_hotkey(binds_norm, binds_auto)) { if (current_input->input_state(current_input_data, &binds[0], 0, RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) From 021559a87731f3184c608369c12ca2ed3f25831a Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 06:07:45 +0100 Subject: [PATCH 143/638] Get rid of runloop.h dependencies inside input/ dir --- input/drivers/udev_input.c | 1 - input/drivers_hid/null_hid.c | 1 - input/drivers_joypad/ctr_joypad.c | 1 - input/drivers_joypad/dinput_joypad.c | 1 - input/drivers_joypad/linuxraw_joypad.c | 12 ------------ input/drivers_joypad/udev_joypad.c | 17 +++-------------- input/drivers_joypad/wiiu_joypad.c | 1 - input/drivers_joypad/xinput_joypad.c | 2 -- input/input_driver.c | 1 - input/input_remote.c | 1 - 10 files changed, 3 insertions(+), 35 deletions(-) diff --git a/input/drivers/udev_input.c b/input/drivers/udev_input.c index 403011b241..c752a3e6ab 100644 --- a/input/drivers/udev_input.c +++ b/input/drivers/udev_input.c @@ -49,7 +49,6 @@ #include "../input_keymaps.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../verbosity.h" typedef struct udev_input udev_input_t; diff --git a/input/drivers_hid/null_hid.c b/input/drivers_hid/null_hid.c index 5b932b9ca7..30ed12d762 100644 --- a/input/drivers_hid/null_hid.c +++ b/input/drivers_hid/null_hid.c @@ -16,7 +16,6 @@ #include -#include "../../runloop.h" #include "../input_defines.h" #include "../input_hid_driver.h" diff --git a/input/drivers_joypad/ctr_joypad.c b/input/drivers_joypad/ctr_joypad.c index c341a54213..422053d8f9 100644 --- a/input/drivers_joypad/ctr_joypad.c +++ b/input/drivers_joypad/ctr_joypad.c @@ -24,7 +24,6 @@ #include "../../tasks/tasks_internal.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../configuration.h" #include "../../retroarch.h" #include "../../command.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index f3ceddb62e..61b4297a0a 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -33,7 +33,6 @@ #include "../input_joypad_driver.h" #include "../input_keymaps.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../verbosity.h" struct dinput_joypad diff --git a/input/drivers_joypad/linuxraw_joypad.c b/input/drivers_joypad/linuxraw_joypad.c index 0ac222536a..7d7733f5ed 100644 --- a/input/drivers_joypad/linuxraw_joypad.c +++ b/input/drivers_joypad/linuxraw_joypad.c @@ -33,7 +33,6 @@ #include "../common/epoll_common.h" #include "../input_driver.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../verbosity.h" #include "../../tasks/tasks_internal.h" @@ -104,17 +103,6 @@ static bool linuxraw_joypad_init_pad(const char *path, struct linuxraw_joypad *p JSIOCGNAME(sizeof(settings->input.device_names[0])), pad->ident) >= 0) { RARCH_LOG("[Device]: Found pad: %s on %s.\n", pad->ident, path); - - if (linuxraw_hotplug) - { - char msg[512]; - - msg[0] = '\0'; - - snprintf(msg, sizeof(msg), "Device connected. #%u (%s).", - (unsigned)(pad - linuxraw_pads), pad->ident); - runloop_msg_queue_push(msg, 0, 60, false); - } } else RARCH_ERR("[Device]: Didn't find ident of %s.\n", path); diff --git a/input/drivers_joypad/udev_joypad.c b/input/drivers_joypad/udev_joypad.c index fd790ee5dd..5374cde59e 100644 --- a/input/drivers_joypad/udev_joypad.c +++ b/input/drivers_joypad/udev_joypad.c @@ -37,7 +37,6 @@ #include "../common/udev_common.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../verbosity.h" /* Udev/evdev Linux joypad driver. @@ -311,7 +310,7 @@ static int udev_add_pad(struct udev_device *dev, unsigned p, int fd, const char return ret; } -static void udev_check_device(struct udev_device *dev, const char *path, bool hotplugged) +static void udev_check_device(struct udev_device *dev, const char *path) { int ret; int pad, fd; @@ -351,16 +350,6 @@ static void udev_check_device(struct udev_device *dev, const char *path, bool ho break; case 0: default: - if (hotplugged) - { - char msg[255]; - - msg[0] = '\0'; - - snprintf(msg, sizeof(msg), "Device connected: #%u (%s).", pad, path); - runloop_msg_queue_push(msg, 0, 60, false); - RARCH_LOG("[udev]: %s\n", msg); - } break; } } @@ -426,7 +415,7 @@ static void udev_joypad_handle_hotplug(struct udev_device *dev) if (string_is_equal(action, "add")) { RARCH_LOG("[udev]: Hotplug add: %s.\n", devnode); - udev_check_device(dev, devnode, true); + udev_check_device(dev, devnode); } else if (string_is_equal(action, "remove")) { @@ -560,7 +549,7 @@ static bool udev_joypad_init(void *data) const char *devnode = udev_device_get_devnode(dev); if (devnode) - udev_check_device(dev, devnode, false); + udev_check_device(dev, devnode); udev_device_unref(dev); } diff --git a/input/drivers_joypad/wiiu_joypad.c b/input/drivers_joypad/wiiu_joypad.c index 7c8d49da59..7bbe20b315 100644 --- a/input/drivers_joypad/wiiu_joypad.c +++ b/input/drivers_joypad/wiiu_joypad.c @@ -24,7 +24,6 @@ #include "../input_driver.h" #include "../../tasks/tasks_internal.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../configuration.h" #include "../../retroarch.h" #include "../../command.h" diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index bbcca9a3b4..8959b027ac 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -39,10 +39,8 @@ #include "../input_config.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../verbosity.h" - /* Check if the definitions do not already exist. * Official and mingw xinput headers have different include guards. */ diff --git a/input/input_driver.c b/input/input_driver.c index 6eea00d479..a3253a5998 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -31,7 +31,6 @@ #include "../configuration.h" #include "../driver.h" #include "../retroarch.h" -#include "../runloop.h" #include "../movie.h" #include "../list_special.h" #include "../verbosity.h" diff --git a/input/input_remote.c b/input/input_remote.c index 61a01ee3ca..5523e24dd3 100644 --- a/input/input_remote.c +++ b/input/input_remote.c @@ -40,7 +40,6 @@ #include "../configuration.h" #include "../msg_hash.h" -#include "../runloop.h" #include "../verbosity.h" #define DEFAULT_NETWORK_GAMEPAD_PORT 55400 From 642310e08a5a6b479a78be998f51172da0bf4ebe Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 06:19:27 +0100 Subject: [PATCH 144/638] Remove runloop.h header include from many files --- menu/cbs/menu_cbs_scan.c | 1 - menu/cbs/menu_cbs_select.c | 2 -- menu/drivers/menu_generic.c | 1 - menu/drivers/xmb.c | 17 ++++------------- tasks/task_wifi.c | 1 - 5 files changed, 4 insertions(+), 18 deletions(-) diff --git a/menu/cbs/menu_cbs_scan.c b/menu/cbs/menu_cbs_scan.c index 38c9aafdf1..dc49656dac 100644 --- a/menu/cbs/menu_cbs_scan.c +++ b/menu/cbs/menu_cbs_scan.c @@ -25,7 +25,6 @@ #include "../menu_setting.h" #include "../../configuration.h" -#include "../../runloop.h" #include "../../tasks/tasks_internal.h" #ifndef BIND_ACTION_SCAN diff --git a/menu/cbs/menu_cbs_select.c b/menu/cbs/menu_cbs_select.c index 97a62dd642..a3fd587761 100644 --- a/menu/cbs/menu_cbs_select.c +++ b/menu/cbs/menu_cbs_select.c @@ -24,8 +24,6 @@ #include "../menu_cbs.h" #include "../menu_setting.h" -#include "../../runloop.h" - #ifndef BIND_ACTION_SELECT #define BIND_ACTION_SELECT(cbs, name) \ cbs->action_select = name; \ diff --git a/menu/drivers/menu_generic.c b/menu/drivers/menu_generic.c index 304298d3a6..c5bac95d81 100644 --- a/menu/drivers/menu_generic.c +++ b/menu/drivers/menu_generic.c @@ -28,7 +28,6 @@ #include "../widgets/menu_input_bind_dialog.h" #include "../../verbosity.h" -#include "../../runloop.h" #include "../../content.h" #include "../../retroarch.h" diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 939c00c055..0db55c408f 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -2531,19 +2531,10 @@ static void xmb_frame(void *data) xmb->margins.title.top, 1, 1, TEXT_ALIGN_LEFT, width, height, xmb->font); -/* uncomment to print the messages on the XMB status line - if (string_is_empty(runloop_msg_queue_pull())) - {*/ - if (menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0) - xmb_draw_text(xmb, title_msg, xmb->margins.title.left, - height - xmb->margins.title.bottom, 1, 1, TEXT_ALIGN_LEFT, - width, height, xmb->font); -/* } - else - xmb_draw_text(xmb, runloop_msg_queue_pull(), xmb->margins.title.left, - height - xmb->margins.title.bottom, 1, 1, TEXT_ALIGN_LEFT, - width, height); -*/ + if (menu_entries_get_core_title(title_msg, sizeof(title_msg)) == 0) + xmb_draw_text(xmb, title_msg, xmb->margins.title.left, + height - xmb->margins.title.bottom, 1, 1, TEXT_ALIGN_LEFT, + width, height, xmb->font); rotate_draw.matrix = &mymat; rotate_draw.rotation = 0; diff --git a/tasks/task_wifi.c b/tasks/task_wifi.c index 86476e7fb5..95b71108f6 100644 --- a/tasks/task_wifi.c +++ b/tasks/task_wifi.c @@ -26,7 +26,6 @@ #include "tasks_internal.h" #include "../verbosity.h" -#include "../runloop.h" #include "../wifi/wifi_driver.h" #include "../menu/menu_entries.h" #include "../menu/menu_driver.h" From a911c24ba3800ea7fd2cbe3f73e2d8c3805885fa Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 06:26:41 +0100 Subject: [PATCH 145/638] Remove runloop.h header includes --- gfx/drivers_font/caca_font.c | 1 - gfx/drivers_font_renderer/coretext.c | 1 - 2 files changed, 2 deletions(-) diff --git a/gfx/drivers_font/caca_font.c b/gfx/drivers_font/caca_font.c index c57088ab82..aaf4df961f 100644 --- a/gfx/drivers_font/caca_font.c +++ b/gfx/drivers_font/caca_font.c @@ -24,7 +24,6 @@ #endif #include "../font_driver.h" -#include "../../runloop.h" #include "../../configuration.h" #include "../../verbosity.h" #include "../common/caca_common.h" diff --git a/gfx/drivers_font_renderer/coretext.c b/gfx/drivers_font_renderer/coretext.c index 8631dfcf1a..a7821c8552 100644 --- a/gfx/drivers_font_renderer/coretext.c +++ b/gfx/drivers_font_renderer/coretext.c @@ -32,7 +32,6 @@ #endif #include "../font_driver.h" -#include "../../runloop.h" #define CT_ATLAS_ROWS 16 #define CT_ATLAS_COLS 16 From 5e10dbf3486b46d22d544524397769d66af89a64 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 16:01:06 +0100 Subject: [PATCH 146/638] Move more runloop.h includes --- frontend/frontend.c | 3 +++ gfx/drivers_font/d3d_w32_font.cpp | 3 ++- gfx/drivers_font/xdk1_xfonts.c | 1 - gfx/drivers_font/xdk360_fonts.cpp | 6 ------ 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/frontend/frontend.c b/frontend/frontend.c index 9d1d853b33..19d229935b 100644 --- a/frontend/frontend.c +++ b/frontend/frontend.c @@ -34,7 +34,10 @@ #include "../driver.h" #include "../paths.h" #include "../retroarch.h" + +#ifndef HAVE_MAIN #include "../runloop.h" +#endif /** * main_exit: diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index 35d6e26f43..5f4d8d9453 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -22,9 +22,10 @@ #include "../font_driver.h" #include "../../configuration.h" -#include "../../runloop.h" +#ifdef HAVE_D3D9 #include "../include/d3d9/d3dx9core.h" +#endif typedef struct { diff --git a/gfx/drivers_font/xdk1_xfonts.c b/gfx/drivers_font/xdk1_xfonts.c index a953fb5e72..e0a357d80f 100644 --- a/gfx/drivers_font/xdk1_xfonts.c +++ b/gfx/drivers_font/xdk1_xfonts.c @@ -23,7 +23,6 @@ #include "../drivers/d3d.h" #include "../font_driver.h" -#include "../../runloop.h" typedef struct { diff --git a/gfx/drivers_font/xdk360_fonts.cpp b/gfx/drivers_font/xdk360_fonts.cpp index 3e8f84339c..e0e00ebc57 100644 --- a/gfx/drivers_font/xdk360_fonts.cpp +++ b/gfx/drivers_font/xdk360_fonts.cpp @@ -18,13 +18,8 @@ #include -#ifdef HAVE_CONFIG_H -#include "../../runloop.h" -#endif - #include "../d3d/d3d.h" #include "../font_driver.h" -#include "../../runloop.h" #include "../drivers/d3d_shaders/font.hlsl.d3d9.h" @@ -630,7 +625,6 @@ static void xdk360_free_font(void *data) static void xdk360_render_msg_post(xdk360_video_font_t * font) { - /* Cache the global pointer into a register */ LPDIRECT3DDEVICE d3dr = font->d3d->dev; d3d_set_texture(d3dr, 0, NULL); From 4b9571140f6498f17b011d7d9d7e50e27daef55e Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 16:07:33 +0100 Subject: [PATCH 147/638] Remove two runloop.h includes --- file_path_special.c | 1 - wifi/wifi_driver.c | 1 - 2 files changed, 2 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 9d17045311..88aeae7cf8 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -46,7 +46,6 @@ #include "file_path_special.h" #include "paths.h" -#include "runloop.h" #include "verbosity.h" void fill_pathname_expand_special(char *out_path, diff --git a/wifi/wifi_driver.c b/wifi/wifi_driver.c index 5c0d9c9f8f..c80137502d 100644 --- a/wifi/wifi_driver.c +++ b/wifi/wifi_driver.c @@ -26,7 +26,6 @@ #include "../configuration.h" #include "../driver.h" #include "../retroarch.h" -#include "../runloop.h" #include "../list_special.h" #include "../verbosity.h" From 65ba82ca4bd5983fc15537f99f3f463c6bc1ce26 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 16:45:58 +0100 Subject: [PATCH 148/638] (shader_gl_cg.c) Cleanups --- gfx/drivers_shader/shader_gl_cg.c | 54 +++++++++++++++++-------------- 1 file changed, 30 insertions(+), 24 deletions(-) diff --git a/gfx/drivers_shader/shader_gl_cg.c b/gfx/drivers_shader/shader_gl_cg.c index 40c2c243f3..5d06c6c97f 100644 --- a/gfx/drivers_shader/shader_gl_cg.c +++ b/gfx/drivers_shader/shader_gl_cg.c @@ -516,24 +516,26 @@ static bool gl_cg_compile_program( void *program_data, struct shader_program_info *program_info) { - const char *list = NULL; const char *argv[2 + GFX_MAX_SHADERS]; - bool ret = true; - char *listing_f = NULL; - char *listing_v = NULL; - unsigned i, argc = 0; + const char *list = NULL; + bool ret = true; + char *listing_f = NULL; + char *listing_v = NULL; + unsigned i, argc = 0; struct shader_program_cg *program = (struct shader_program_cg*)program_data; - cg_shader_data_t *cg = (cg_shader_data_t*)data; + cg_shader_data_t *cg = (cg_shader_data_t*)data; if (!program) program = &cg->prg[idx]; argv[argc++] = "-DPARAMETER_UNIFORM"; + for (i = 0; i < GFX_MAX_SHADERS; i++) { if (*(cg->alias_define[i])) argv[argc++] = cg->alias_define[i]; } + argv[argc] = NULL; if (program_info->is_file) @@ -587,7 +589,7 @@ end: static void gl_cg_set_program_base_attrib(void *data, unsigned i) { - cg_shader_data_t *cg = (cg_shader_data_t*)data; + cg_shader_data_t *cg = (cg_shader_data_t*)data; CGparameter param = cgGetFirstParameter( cg->prg[i].vprg, CG_PROGRAM); @@ -595,8 +597,8 @@ static void gl_cg_set_program_base_attrib(void *data, unsigned i) { uint32_t semantic_hash; const char *semantic = NULL; - if (cgGetParameterDirection(param) != CG_IN - || cgGetParameterVariability(param) != CG_VARYING) + if ( (cgGetParameterDirection(param) != CG_IN) + || (cgGetParameterVariability(param) != CG_VARYING)) continue; semantic = cgGetParameterSemantic(param); @@ -639,7 +641,7 @@ static void gl_cg_set_program_base_attrib(void *data, unsigned i) static bool gl_cg_load_stock(void *data) { struct shader_program_info program_info; - cg_shader_data_t *cg = (cg_shader_data_t*)data; + cg_shader_data_t *cg = (cg_shader_data_t*)data; program_info.combined = stock_cg_gl_program; program_info.is_file = false; @@ -659,6 +661,7 @@ error: static bool gl_cg_load_plain(void *data, const char *path) { cg_shader_data_t *cg = (cg_shader_data_t*)data; + if (!gl_cg_load_stock(cg)) return false; @@ -669,7 +672,12 @@ static bool gl_cg_load_plain(void *data, const char *path) cg->shader->passes = 1; - if (path) + if (string_is_empty(path)) + { + RARCH_LOG("Loading stock Cg file.\n"); + cg->prg[1] = cg->prg[0]; + } + else { struct shader_program_info program_info; @@ -682,11 +690,6 @@ static bool gl_cg_load_plain(void *data, const char *path) if (!gl_cg_compile_program(data, 1, &cg->prg[1], &program_info)) return false; } - else - { - RARCH_LOG("Loading stock Cg file.\n"); - cg->prg[1] = cg->prg[0]; - } video_shader_resolve_parameters(NULL, cg->shader); return true; @@ -697,7 +700,7 @@ static bool gl_cg_load_imports(void *data) unsigned i; retro_ctx_memory_info_t mem_info; struct state_tracker_info tracker_info = {0}; - cg_shader_data_t *cg = (cg_shader_data_t*)data; + cg_shader_data_t *cg = (cg_shader_data_t*)data; if (!cg->shader->variables) return true; @@ -728,9 +731,9 @@ static bool gl_cg_load_imports(void *data) } } - mem_info.data = NULL; - mem_info.size = 0; - mem_info.id = RETRO_MEMORY_SYSTEM_RAM; + mem_info.data = NULL; + mem_info.size = 0; + mem_info.id = RETRO_MEMORY_SYSTEM_RAM; core_get_memory(&mem_info); @@ -741,7 +744,7 @@ static bool gl_cg_load_imports(void *data) #ifdef HAVE_PYTHON if (*cg->shader->script_path) { - tracker_info.script = cg->shader->script_path; + tracker_info.script = cg->shader->script_path; tracker_info.script_is_file = true; } @@ -759,7 +762,7 @@ static bool gl_cg_load_imports(void *data) static bool gl_cg_load_shader(void *data, unsigned i) { struct shader_program_info program_info; - cg_shader_data_t *cg = (cg_shader_data_t*)data; + cg_shader_data_t *cg = (cg_shader_data_t*)data; program_info.combined = cg->shader->pass[i].source.path; program_info.is_file = true; @@ -776,7 +779,7 @@ static bool gl_cg_load_shader(void *data, unsigned i) static bool gl_cg_load_preset(void *data, const char *path) { unsigned i; - config_file_t *conf = NULL; + config_file_t *conf = NULL; cg_shader_data_t *cg = (cg_shader_data_t*)data; if (!gl_cg_load_stock(cg)) @@ -816,11 +819,13 @@ static bool gl_cg_load_preset(void *data, const char *path) } for (i = 0; i < cg->shader->passes; i++) + { if (*cg->shader->pass[i].alias) snprintf(cg->alias_define[i], sizeof(cg->alias_define[i]), "-D%s_ALIAS", cg->shader->pass[i].alias); + } for (i = 0; i < cg->shader->passes; i++) { @@ -1042,7 +1047,8 @@ static void *gl_cg_init(void *data, const char *path) memset(cg->alias_define, 0, sizeof(cg->alias_define)); - if (path && string_is_equal(path_get_extension(path), "cgp")) + if ( !string_is_empty(path) + && string_is_equal(path_get_extension(path), "cgp")) { if (!gl_cg_load_preset(cg, path)) goto error; From 45407f9b520654fa14e8a1ff1d93e12494a714f4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 16:50:08 +0100 Subject: [PATCH 149/638] (shader_glsl.c) Small cleanups --- gfx/drivers_shader/shader_glsl.c | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/gfx/drivers_shader/shader_glsl.c b/gfx/drivers_shader/shader_glsl.c index b406f12415..5d4f3fe96d 100644 --- a/gfx/drivers_shader/shader_glsl.c +++ b/gfx/drivers_shader/shader_glsl.c @@ -415,12 +415,7 @@ static bool gl_glsl_load_source_path(struct video_shader_pass *pass, const char *path) { ssize_t len; - int nitems = 0; - - if (!pass) - return false; - - nitems = filestream_read_file(path, + int nitems = filestream_read_file(path, (void**)&pass->source.string.vertex, &len); if (nitems <= 0 || len <= 0) @@ -451,17 +446,18 @@ static bool gl_glsl_compile_programs( * load the file here, and pretend * we were really using XML all along. */ - if (*pass->source.path && !gl_glsl_load_source_path( - pass, pass->source.path)) + if ( !string_is_empty(pass->source.path) + && !gl_glsl_load_source_path(pass, pass->source.path)) { RARCH_ERR("Failed to load GLSL shader: %s.\n", pass->source.path); return false; } - *pass->source.path = '\0'; - vertex = pass->source.string.vertex; - fragment = pass->source.string.fragment; + *pass->source.path = '\0'; + + vertex = pass->source.string.vertex; + fragment = pass->source.string.fragment; shader_prog_info.vertex = vertex; shader_prog_info.fragment = fragment; @@ -561,10 +557,10 @@ static void gl_glsl_find_uniforms_frame(glsl_shader_data_t *glsl, texture[0] = texture_size[0] = input_size[0] = tex_coord[0] = '\0'; - snprintf(texture, sizeof(texture), "%s%s", base, "Texture"); + snprintf(texture, sizeof(texture), "%s%s", base, "Texture"); snprintf(texture_size, sizeof(texture_size), "%s%s", base, "TextureSize"); - snprintf(input_size, sizeof(input_size), "%s%s", base, "InputSize"); - snprintf(tex_coord, sizeof(tex_coord), "%s%s", base, "TexCoord"); + snprintf(input_size, sizeof(input_size), "%s%s", base, "InputSize"); + snprintf(tex_coord, sizeof(tex_coord), "%s%s", base, "TexCoord"); if (frame->texture < 0) frame->texture = gl_glsl_get_uniform(glsl, prog, texture); @@ -888,7 +884,7 @@ static void *gl_glsl_init(void *data, const char *path) retro_ctx_memory_info_t mem_info; struct state_tracker_info info = {0}; - mem_info.id = RETRO_MEMORY_SYSTEM_RAM; + mem_info.id = RETRO_MEMORY_SYSTEM_RAM; core_get_memory(&mem_info); From a9473a71c5be2c378f8ed23645b03cd24a747387 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 17:34:40 +0100 Subject: [PATCH 150/638] (menu_shader.c) Cleanups --- menu/menu_shader.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/menu/menu_shader.c b/menu/menu_shader.c index 40746afb8b..0d03b67246 100644 --- a/menu/menu_shader.c +++ b/menu/menu_shader.c @@ -30,7 +30,6 @@ #include "../file_path_special.h" #include "../configuration.h" #include "../paths.h" -#include "../runloop.h" #include "../verbosity.h" #include "../gfx/video_shader_driver.h" @@ -163,10 +162,10 @@ void menu_shader_manager_set_preset(void *data, unsigned type, const char *preset_path) { #ifdef HAVE_SHADER_MANAGER - struct video_shader *shader = (struct video_shader*)data; - config_file_t *conf = NULL; - bool refresh = false; - settings_t *settings = config_get_ptr(); + struct video_shader *shader = (struct video_shader*)data; + config_file_t *conf = NULL; + bool refresh = false; + settings_t *settings = config_get_ptr(); settings->video.shader_enable = false; @@ -314,11 +313,29 @@ bool menu_shader_manager_save_preset( dirs[2] = config_directory; } - if (!(conf = (config_file_t*)config_file_new(NULL))) + conf = (config_file_t*)config_file_new(NULL); + + if (!conf) return false; + video_shader_write_conf_cgp(conf, shader); - if (!fullpath) + if (fullpath) + { + if (!string_is_empty(basename)) + strlcpy(preset_path, buffer, sizeof(preset_path)); + + if (config_file_write(conf, preset_path)) + { + RARCH_LOG("Saved shader preset to %s.\n", preset_path); + if (apply) + menu_shader_manager_set_preset(NULL, type, preset_path); + ret = true; + } + else + RARCH_LOG("Failed writing shader preset to %s.\n", preset_path); + } + else { for (d = 0; d < ARRAY_SIZE(dirs); d++) { @@ -340,20 +357,6 @@ bool menu_shader_manager_save_preset( RARCH_LOG("Failed writing shader preset to %s.\n", preset_path); } } - else - { - if (!string_is_empty(basename)) - strlcpy(preset_path, buffer, sizeof(preset_path)); - if (config_file_write(conf, preset_path)) - { - RARCH_LOG("Saved shader preset to %s.\n", preset_path); - if (apply) - menu_shader_manager_set_preset(NULL, type, preset_path); - ret = true; - } - else - RARCH_LOG("Failed writing shader preset to %s.\n", preset_path); - } config_file_free(conf); if (ret) From d3151927bf7a825d53d29d0ade0ea5e145d3d794 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 17:41:44 +0100 Subject: [PATCH 151/638] (Emscripten) Buildfix --- input/drivers/rwebinput_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/input/drivers/rwebinput_input.c b/input/drivers/rwebinput_input.c index a173bd804e..30de0252f5 100644 --- a/input/drivers/rwebinput_input.c +++ b/input/drivers/rwebinput_input.c @@ -20,11 +20,11 @@ #include #include "../input_joypad_driver.h" -#include "../tasks/tasks_internal.h" #include "../input_keyboard.h" #include "../input_config.h" #include "../input_keymaps.h" +#include "../../tasks/tasks_internal.h" #include "../../configuration.h" typedef struct rwebinput_state From 8e7d440ed55116c2c878b59696f13665cd09305d Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 17:44:35 +0100 Subject: [PATCH 152/638] (Zarch) Silence Zarch warning --- menu/drivers/zarch.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/menu/drivers/zarch.c b/menu/drivers/zarch.c index 9a07d3a8c3..f6d8f0b4b5 100644 --- a/menu/drivers/zarch.c +++ b/menu/drivers/zarch.c @@ -1061,6 +1061,9 @@ static bool zarch_load_image(void *userdata, break; case MENU_IMAGE_THUMBNAIL: break; + case MENU_IMAGE_SAVESTATE_THUMBNAIL: + /* TODO/FIXME -implement */ + break; } return true; From 0a0cc6494ac284fc3afdd6bbca6da30b1b6be11e Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:15:38 -0500 Subject: [PATCH 153/638] build fixes for MSVC, start moving back to TCHAR usage so we can switch unicode on and off --- audio/drivers/dsound.c | 24 +- input/drivers/dinput.c | 2 +- input/drivers_joypad/dinput_joypad.c | 21 +- libretro-common/dynamic/dylib.c | 18 +- libretro-common/file/retro_dirent.c | 5 +- libretro-common/include/encodings/win32.h | 53 + menu/menu_event.c | 6 +- retroarch.cfg | 2410 +++++++++++++------- ui/drivers/ui_win32.c | 67 +- ui/drivers/win32/ui_win32_browser_window.c | 50 +- ui/drivers/win32/ui_win32_window.cpp | 9 +- 11 files changed, 1797 insertions(+), 868 deletions(-) create mode 100644 libretro-common/include/encodings/win32.h diff --git a/audio/drivers/dsound.c b/audio/drivers/dsound.c index 2cdcf4d234..ff2d8368b8 100644 --- a/audio/drivers/dsound.c +++ b/audio/drivers/dsound.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -19,6 +19,8 @@ #include #include +#include + #ifndef _XBOX #include #include @@ -93,7 +95,7 @@ static INLINE bool grab_region(dsound_t *ds, uint32_t write_ptr, struct audio_lock *region) { const char *err = NULL; - HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, + HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, ®ion->chunk1, ®ion->size1, ®ion->chunk2, ®ion->size2, 0); if (res == DSERR_BUFFERLOST) @@ -152,7 +154,7 @@ static void dsound_thread(void *data) struct audio_lock region; DWORD read_ptr, avail, fifo_avail; get_positions(ds, &read_ptr, NULL); - + avail = write_avail(read_ptr, write_ptr, ds->buffer_size); EnterCriticalSection(&ds->crit); @@ -161,12 +163,12 @@ static void dsound_thread(void *data) if (avail < CHUNK_SIZE || ((fifo_avail < CHUNK_SIZE) && (avail < ds->buffer_size / 2))) { - /* No space to write, or we don't have data in our fifo, + /* No space to write, or we don't have data in our fifo, * but we can wait some time before it underruns ... */ /* We could opt for using the notification interface, - * but it is not guaranteed to work, so use high + * but it is not guaranteed to work, so use high * priority sleeping patterns. */ retro_sleep(1); @@ -182,7 +184,7 @@ static void dsound_thread(void *data) if (fifo_avail < CHUNK_SIZE) { - /* Got space to write, but nothing in FIFO (underrun), + /* Got space to write, but nothing in FIFO (underrun), * fill block with silence. */ memset(region.chunk1, 0, region.size1); @@ -191,7 +193,7 @@ static void dsound_thread(void *data) release_region(ds, ®ion); write_ptr = (write_ptr + region.size1 + region.size2) % ds->buffer_size; } - else + else { /* All is good. Pull from it and notify FIFO. */ @@ -291,11 +293,15 @@ struct dsound_dev LPGUID guid; }; -static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCSTR desc, LPCSTR module, LPVOID context) +static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCTSTR desc, LPCTSTR module, LPVOID context) { struct dsound_dev *dev = (struct dsound_dev*)context; + WCHAR_TO_CHAR_ALLOC(desc, desc_str) - RARCH_LOG("\t%u: %s\n", dev->total_count, desc); + RARCH_LOG("\t%u: %s\n", dev->total_count, desc_str); + + if (desc_str) + free(desc_str); if (dev->device == dev->total_count) dev->guid = guid; diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index c5f96d0ec5..51f76b4eab 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -48,7 +48,7 @@ #include "../../configuration.h" #include "../../verbosity.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index f3ceddb62e..1765410428 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -76,7 +77,7 @@ static void dinput_joypad_destroy(void) IDirectInputDevice8_Unacquire(g_pads[i].joypad); IDirectInputDevice8_Release(g_pads[i].joypad); } - + free(g_pads[i].joy_name); g_pads[i].joy_name = NULL; free(g_pads[i].joy_friendly_name); @@ -115,11 +116,11 @@ static bool guid_is_xinput_device(const GUID* product_guid) unsigned i, num_raw_devs = 0; PRAWINPUTDEVICELIST raw_devs = NULL; - /* Check for well known XInput device GUIDs, + /* Check for well known XInput device GUIDs, * thereby removing the need for the IG_ check. - * This lets us skip RAWINPUT for popular devices. + * This lets us skip RAWINPUT for popular devices. * - * Also, we need to do this for the Valve Streaming Gamepad + * Also, we need to do this for the Valve Streaming Gamepad * because it's virtualized and doesn't show up in the device list. */ for (i = 0; i < ARRAY_SIZE(common_xinput_guids); ++i) @@ -208,6 +209,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) #endif LPDIRECTINPUTDEVICE8 *pad = NULL; settings_t *settings = config_get_ptr(); + WCHAR_TO_CHAR_ALLOC(inst->tszInstanceName, name) (void)p; @@ -223,10 +225,13 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) if (FAILED(IDirectInput8_CreateDevice( g_dinput_ctx, &inst->guidInstance, pad, NULL))) #endif - return DIENUM_CONTINUE; + return DIENUM_CONTINUE; - g_pads[g_joypad_cnt].joy_name = strdup(inst->tszProductName); - g_pads[g_joypad_cnt].joy_friendly_name = strdup(inst->tszInstanceName); + g_pads[g_joypad_cnt].joy_name = strdup(name); + g_pads[g_joypad_cnt].joy_friendly_name = strdup(name); + + if (name) + free(name); /* there may be more useful info in the GUID so leave this here for a while */ #if 0 diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index 611c9f8771..a1da7b8a45 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef NEED_DYNAMIC @@ -34,7 +35,7 @@ #endif #ifdef _WIN32 -static char last_dyn_error[512]; +static TCHAR last_dyn_error[512]; static void set_dl_error(void) { @@ -45,11 +46,16 @@ static void set_dl_error(void) NULL, err, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), - last_dyn_error, + (LPTSTR)last_dyn_error, sizeof(last_dyn_error) - 1, NULL) == 0) - snprintf(last_dyn_error, sizeof(last_dyn_error) - 1, + { + WCHAR_TO_CHAR_ALLOC(last_dyn_error, last_dyn_error_str) + snprintf(last_dyn_error_str, sizeof(last_dyn_error) - 1, "unknown error %lu", err); + if (last_dyn_error_str) + free(last_dyn_error_str); + } } #endif @@ -65,8 +71,12 @@ dylib_t dylib_load(const char *path) { #ifdef _WIN32 int prevmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - dylib_t lib = LoadLibrary(path); + dylib_t lib = NULL; + CHAR_TO_WCHAR_ALLOC(path, path_wide) + lib = LoadLibrary(path_wide); + + free(path_wide); SetErrorMode(prevmode); if (!lib) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index dda73a682b..f29705b15d 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -97,7 +98,9 @@ const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) memset(rdir->path, 0, sizeof(rdir->path)); - utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); +#ifdef UNICODE + utf16_to_char_string((const uint16_t*)rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); +#endif return rdir->path; #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h new file mode 100644 index 0000000000..13ca67ce7b --- /dev/null +++ b/libretro-common/include/encodings/win32.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2010-2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (utf.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_ENCODINGS_WIN32_H +#define _LIBRETRO_ENCODINGS_WIN32_H + +#ifndef _XBOX +#ifdef _WIN32 +#define UNICODE +#include +#include +#include +#endif +#endif + +#ifdef UNICODE +#define CHAR_TO_WCHAR_ALLOC(s, ws) \ + size_t ws##_size = (s[0] ? strlen(s) : 0) + 1; \ + wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ + if (s[0]) \ + MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); + +#define WCHAR_TO_CHAR_ALLOC(ws, s) \ + size_t s##_size = ((ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ + char *s = (char*)calloc(s##_size, 1); \ + if (ws[0]) \ + utf16_to_char_string((const uint16_t*)ws, s, s##_size); + +#else +#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = strdup(s); +#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = strdup(ws); +#endif + +#endif diff --git a/menu/menu_event.c b/menu/menu_event.c index 5d7cdaab5e..dc31e700e4 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -200,14 +200,12 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) size_t new_scroll_accel = 0; menu_input_t *menu_input = NULL; settings_t *settings = config_get_ptr(); - static bool ok_old = false; + static char ok_old = 0; unsigned menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_B : RETRO_DEVICE_ID_JOYPAD_A; unsigned menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; - bool ok_current = input & UINT64_C(1) << menu_ok_btn; - - /* TODO/FIXME - unsafe use of type 'bool' in operation */ + char ok_current = input & UINT64_C(1) << menu_ok_btn; bool ok_trigger = ok_current & ~ok_old; ok_old = ok_current; diff --git a/retroarch.cfg b/retroarch.cfg index 7d9890a08f..489ff50820 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -1,800 +1,1610 @@ -## Skeleton config file for RetroArch - -# Save all save files (*.srm) to this directory. This includes related files like .bsv, .rtc, .psrm, etc ... -# This will be overridden by explicit command line options. -# savefile_directory = - -# Save all save states (*.state) to this directory. -# This will be overridden by explicit command line options. -# savestate_directory = - -# If set to a directory, content which is temporarily extracted -# will be extracted to this directory. -# cache_directory = - -# Save all input remapping files to this directory. -# input_remapping_directory = - -# Save all playlist files to this directory. -# playlist_directory = - -# If set to a directory, the content history playlist will be saved -# to this directory. -# content_history_dir = - -# Automatically saves a savestate at the end of RetroArch's lifetime. -# The path is $SRAM_PATH.auto. -# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. -# savestate_auto_save = false -# savestate_auto_load = true - -# Load libretro from a dynamic location for dynamically built RetroArch. -# This option is mandatory. - -# Path to a libretro implementation. -# libretro_path = "/path/to/libretro.so" - -# A directory for where to search for libretro core implementations. -# libretro_directory = - -# A directory for where to search for libretro core information. -# libretro_info_path = - -# Sets log level for libretro cores (GET_LOG_INTERFACE). -# If a log level issued by a libretro core is below libretro_log_level, it is ignored. -# DEBUG logs are always ignored unless verbose mode is activated (--verbose). -# DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3. -# libretro_log_level = 0 - -# Enable or disable verbosity level of frontend. -# log_verbosity = false - -# If this option is enabled, every content file loaded in RetroArch will be -# automatically added to a history list. -# history_list_enable = true - -# Enable or disable RetroArch performance counters -# perfcnt_enable = false - -# Path to core options config file. -# This config file is used to expose core-specific options. -# It will be written to by RetroArch. -# A default path will be assigned if not set. -# core_options_path = - -# Path to content history file. -# RetroArch keeps track of all content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_history_path = - -# Path to music content history file (optional). -# RetroArch keeps track of all music content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_music_history_path = - -# Path to image content history file (optional). -# RetroArch keeps track of all image content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_image_history_path = - -# Path to video content history file (optional). -# RetroArch keeps track of all video content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_video_history_path = - -# Number of entries that will be kept in content history file. -# content_history_size = 100 - -# Sets the "system" directory. -# Implementations can query for this directory to load BIOSes, system-specific configs, etc. -# system_directory = - -# Sets start directory for menu file browser. -# rgui_browser_directory = - -# Content directory. Interacts with RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY. -# Usually set by developers who bundle libretro/RetroArch apps to point to assets. -# content_directory = - -# Assets directory. This location is queried by default when menu interfaces try to look for -# loadable assets, etc. -# assets_directory = - -# Dynamic wallpapers directory. The place to store the wallpapers dynamically -# loaded by the menu depending on context. -# dynamic_wallpapers_directory = - -# Thumbnails directory. To store thumbnail files. -# thumbnails_directory = - -# Sets start directory for menu config browser. -# rgui_config_directory = - -# Show startup screen in menu. -# Is automatically set to false when seen for the first time. -# This is only updated in config if config_save_on_exit is set to true, however. -# rgui_show_start_screen = true - -# Flushes config to disk on exit. Useful for menu as settings can be modified. -# Overwrites the config. #include's and comments are not preserved. -# config_save_on_exit = true - -# Load up a specific config file based on the core being used. -# core_specific_config = false - -# Shows hidden files and folders in directory listings. -# show_hidden_files = true - -#### Video - -# Video driver to use. "gl", "xvideo", "sdl" -# video_driver = "gl" - -# Which context implementation to use. -# Possible ones for desktop are: glx, x-egl, kms-egl, sdl-gl, wgl. -# By default, tries to use first suitable driver. -# video_context_driver = - -# Windowed x resolution scale and y resolution scale -# (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale) -# video_scale = 3.0 - -# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. -# video_fullscreen_x = 0 -# video_fullscreen_y = 0 - -# Start in fullscreen. Can be changed at runtime. -# video_fullscreen = false - -# If fullscreen, prefer using a windowed fullscreen mode. -# video_windowed_fullscreen = true - -# Which monitor to prefer. 0 (default) means no particular monitor is preferred, 1 and up (1 being first monitor), -# suggests RetroArch to use that particular monitor. -# video_monitor_index = 0 - -# Forcibly disable composition. Only works in Windows Vista/7 for now. -# video_disable_composition = false - -# Video vsync. -# video_vsync = true - -# Max amount of swapchain images. -# Single buffering = 1, Double buffering = 2, 3 = Triple buffering -# video_max_swapchain_images = 3 - -# Forcibly disable sRGB FBO support. Some Intel OpenGL drivers on Windows -# have video problems with sRGB FBO support enabled. -# video_force_srgb_disable = false - -# Attempts to hard-synchronize CPU and GPU. Can reduce latency at cost of performance. -# video_hard_sync = false - -# Sets how many frames CPU can run ahead of GPU when using video_hard_sync. -# Maximum is 3. -# video_hard_sync_frames = 0 - -# Sets how many milliseconds to delay after VSync before running the core. -# Can reduce latency at cost of higher risk of stuttering. -# Maximum is 15. -# video_frame_delay = 0 - -# Inserts a black frame inbetween frames. -# Useful for 120 Hz monitors who want to play 60 Hz material with eliminated ghosting. -# video_refresh_rate should still be configured as if it is a 60 Hz monitor (divide refresh rate by 2). -# video_black_frame_insertion = false - -# Use threaded video driver. Using this might improve performance at possible cost of latency and more video stuttering. -# video_threaded = false - -# Use a shared context for HW rendered libretro cores. -# Avoids having to assume HW state changes inbetween frames. -# video_shared_context = false - -# Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders. -# video_smooth = true - -# Forces rendering area to stay equal to content aspect ratio or as defined in video_aspect_ratio. -# video_force_aspect = true - -# Only scales video in integer steps. -# The base size depends on system-reported geometry and aspect ratio. -# If video_force_aspect is not set, X/Y will be integer scaled independently. -# video_scale_integer = false - -# A floating point value for video aspect ratio (width / height). -# If this is not set, aspect ratio is assumed to be automatic. -# Behavior then is defined by video_aspect_ratio_auto. -# video_aspect_ratio = - -# If this is true and video_aspect_ratio is not set, -# aspect ratio is decided by libretro implementation. -# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set. -# video_aspect_ratio_auto = false - -# Forces cropping of overscanned frames. -# Exact behavior of this option is implementation specific. -# video_crop_overscan = true - -# Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset) -# video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}" - -# Load video_shader on startup. -# Other shaders can still be loaded later in runtime. -# video_shader_enable = false - -# Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access. -# video_shader_dir = - -# CPU-based video filter. Path to a dynamic library. -# video_filter = - -# Defines a directory where CPU-based video filters are kept. -# video_filter_dir = - -# Path to a font used for rendering messages. This path must be defined to enable fonts. -# Do note that the _full_ path of the font is necessary! -# video_font_path = - -# Size of the font rendered. -# video_font_size = 32 - -# Enable usage of OSD messages. -# video_font_enable = true - -# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. -# [0.0, 0.0] maps to the lower left corner of the screen. -# video_message_pos_x = 0.05 -# video_message_pos_y = 0.05 - -# Color for message. The value is treated as a hexadecimal value. -# It is a regular RGB hex number, i.e. red is "ff0000". -# video_message_color = ffffff - -# Video refresh rate of your monitor. -# Used to calculate a suitable audio input rate. -# video_refresh_rate = 59.94 - -# Allows libretro cores to set rotation modes. -# Setting this to false will honor, but ignore this request. -# This is useful for vertically oriented content where one manually rotates the monitor. -# video_allow_rotate = true - -# Forces a certain rotation of the screen. -# The rotation is added to rotations which the libretro core sets (see video_allow_rotate). -# The angle is * 90 degrees counter-clockwise. -# video_rotation = 0 - -#### Audio - -# Enable audio. -# audio_enable = true - -# Mutes audio. -# audio_mute_enable = false - -# Audio output samplerate. -# audio_out_rate = 48000 - -# Audio resampler backend. Which audio resampler to use. -# Default will use "sinc". -# audio_resampler = - -# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio. -# audio_driver = - -# Override the default audio device the audio_driver uses. This is driver dependant. E.g. ALSA wants a PCM device, OSS wants a path (e.g. /dev/dsp), Jack wants portnames (e.g. system:playback1,system:playback_2), and so on ... -# audio_device = - -# Audio DSP plugin that processes audio before it's sent to the driver. Path to a dynamic library. -# audio_dsp_plugin = - -# Directory where DSP plugins are kept. -# audio_filter_dir = - -# Will sync (block) on audio. Recommended. -# audio_sync = true - -# Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. -# audio_latency = 64 - -# Enable audio rate control. -# audio_rate_control = true - -# Controls audio rate control delta. Defines how much input rate can be adjusted dynamically. -# Input rate = in_rate * (1.0 +/- audio_rate_control_delta) -# audio_rate_control_delta = 0.005 - -# Controls maximum audio timing skew. Defines the maximum change in input rate. -# Input rate = in_rate * (1.0 +/- max_timing_skew) -# audio_max_timing_skew = 0.05 - -# Audio volume. Volume is expressed in dB. -# 0 dB is normal volume. No gain will be applied. -# Gain can be controlled in runtime with input_volume_up/input_volume_down. -# audio_volume = 0.0 - -#### Overlay - -# Defines a directory where overlays are kept for easy access. -# overlay_directory = - -# Enable or disable the current overlay. -# input_overlay_enable = true - -# Hide the current overlay from appearing inside the menu. -# input_overlay_hide_in_menu = true - -# Path to input overlay. -# input_overlay = - -# Overlay opacity. -# input_overlay_opacity = 1.0 - -# Overlay scale. -# input_overlay_scale = 1.0 - -#### Input - -# Input driver. Depending on video driver, it might force a different input driver. -# input_driver = sdl - -# Input device driver. (Valid: linuxraw, sdl, dinput) -# input_joypad_driver = - -# Path to input remapping file. -# input_remapping_path = - -# Input bind timer timeout. -# Amount of seconds to wait until proceeding to the next bind. Default: 5, minimum: 1 -# input_bind_timeout = 1 - -# If enabled, overrides the input binds with the remapped binds set for the current core. -# input_remap_binds_enable = true - -# Maximum amount of users supported by RetroArch. -# input_max_users = 16 - -# Keyboard layout for input driver if applicable (udev/evdev for now). -# Syntax is either just layout (e.g. "no"), or a layout and variant separated with colon ("no:nodeadkeys"). -# input_keyboard_layout = - -# Defines axis threshold. Possible values are [0.0, 1.0] -# input_axis_threshold = 0.5 - -# Enable input auto-detection. Will attempt to autoconfigure -# joypads, Plug-and-Play style. -# input_autodetect_enable = true - -# Show the input descriptors set by the core instead of the -# default ones. -# input_descriptor_label_show = true - -# Hide input descriptors that were not set by the core. -# input_descriptor_hide_unbound = false - -# Influence how input polling is done inside RetroArch. -# 0 : Early - Input polling is performed before call to retro_run. -# 1 : Normal - Input polling is performed when retro_input_poll is -# requested. -# 2 : Late - Input polling is performed on first call to retro_input_state -# per frame -# -# Setting it to 0 or 2 can result in less latency depending on -# your configuration. -# -# When netplay is enabled, the default polling behavior (1) will -# be used regardless of the value set here. -# input_poll_type_behavior = 1 - -# Directory for joypad autoconfigs. -# If a joypad is plugged in, that joypad will be autoconfigured if a config file -# corresponding to that joypad is present in joypad_autoconfig_dir. -# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs. -# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend. -# Requires input_autodetect_enable to be enabled. -# joypad_autoconfig_dir = - -# Sets which libretro device is used for a user. -# Devices are indentified with a number. -# This is normally saved by the menu. -# Device IDs are found in libretro.h. -# These settings are overridden by explicit command-line arguments which refer to input devices. -# None: 0 -# Joypad (RetroPad): 1 -# Mouse: 2 -# Keyboard: 3 -# Generic Lightgun: 4 -# Joypad w/ Analog (RetroPad + Analog sticks): 5 -# Multitap (SNES specific): 257 -# Super Scope (SNES specific): 260 -# Justifier (SNES specific): 516 -# Justifiers (SNES specific): 772 - -# input_libretro_device_p1 = -# input_libretro_device_p2 = -# input_libretro_device_p3 = -# input_libretro_device_p4 = -# input_libretro_device_p5 = -# input_libretro_device_p6 = -# input_libretro_device_p7 = -# input_libretro_device_p8 = - -# Keyboard input. Will recognize letters ("a" to "z") and the following special keys (where "kp_" -# is for keypad keys): -# -# left, right, up, down, enter, kp_enter, tab, insert, del, end, home, -# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus, -# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, -# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown, -# keypad0, keypad1, keypad2, keypad3, keypad4, keypad5, keypad6, keypad7, keypad8, keypad9, -# period, capslock, numlock, backspace, multiply, divide, print_screen, scroll_lock, -# tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket, -# backslash, rightbracket, kp_period, kp_equals, rctrl, ralt -# -# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, -# rather than relying on a default. -# input_player1_a = "x" -# input_player1_b = "z" -# input_player1_y = "a" -# input_player1_x = "s" -# input_player1_start = "enter" -# input_player1_select = "rshift" -# input_player1_l = "q" -# input_player1_r = "w" -# input_player1_left = "left" -# input_player1_right = "right" -# input_player1_up = "up" -# input_player1_down = "down" -# input_player1_l2 = -# input_player1_r2 = -# input_player1_l3 = -# input_player1_r3 = - -# Two analog sticks (DualShock-esque). -# Bound as usual, however, if a real analog axis is bound, -# it can be read as a true analog. -# Positive X axis is right, Positive Y axis is down. -# input_player1_l_x_plus = -# input_player1_l_x_minus = -# input_player1_l_y_plus = -# input_player1_l_y_minus = -# input_player1_r_x_plus = -# input_player1_r_x_minus = -# input_player1_r_y_plus = -# input_player1_r_y_minus = - -# If desired, it is possible to override which joypads are being used for user 1 through 8. -# First joypad available is 0. -# input_player1_joypad_index = 0 -# input_player2_joypad_index = 1 -# input_player3_joypad_index = 2 -# input_player4_joypad_index = 3 -# input_player5_joypad_index = 4 -# input_player6_joypad_index = 5 -# input_player7_joypad_index = 6 -# input_player8_joypad_index = 7 - -# Input device buttons. -# Figure these out by using RetroArch-Phoenix or retroarch-joyconfig. -# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. -# E.g. "h0up" -# input_player1_a_btn = -# input_player1_b_btn = -# input_player1_y_btn = -# input_player1_x_btn = -# input_player1_start_btn = -# input_player1_select_btn = -# input_player1_l_btn = -# input_player1_r_btn = -# input_player1_left_btn = -# input_player1_right_btn = -# input_player1_up_btn = -# input_player1_down_btn = -# input_player1_l2_btn = -# input_player1_r2_btn = -# input_player1_l3_btn = -# input_player1_r3_btn = - -# Menu buttons. -# menu_search_btn = -# menu_info_btn = -# menu_default_btn = -# menu_scroll_down_btn = -# menu_scroll_up_btn = - -# Swap buttons for OK/Cancel -# menu_swap_ok_cancel_buttons = false - -# Axis for RetroArch D-Pad. -# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. -# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. -# input_player1_left_axis = -# input_player1_right_axis = -# input_player1_up_axis = -# input_player1_down_axis = - -# Holding the turbo while pressing another button will let the button enter a turbo mode -# where the button state is modulated with a periodic signal. -# The modulation stops when the button itself (not turbo button) is released. -# input_player1_turbo = - -# Describes the period and how long of that period a turbo-enabled button should behave. -# Numbers are described in frames. -# input_turbo_period = 6 -# input_turbo_duty_cycle = 3 - -# This goes all the way to user 8 (*_player2_*, *_player3_*, etc), but omitted for clarity. -# All input binds have corresponding binds for keyboard (none), joykeys (_btn) and joyaxes (_axis) as well. - -# Toggles fullscreen. -# input_toggle_fullscreen = f - -# Saves state. -# input_save_state = f2 -# Loads state. -# input_load_state = f4 - -# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline). -# When slot is != 0, path will be $path%d, where %d is slot number. -# input_state_slot_increase = f7 -# input_state_slot_decrease = f6 - -# Toggles between fast-forwarding and normal speed. -# input_toggle_fast_forward = space - -# Hold for fast-forward. Releasing button disables fast-forward. -# input_hold_fast_forward = l - -# Key to exit RetroArch cleanly. -# Killing it in any hard way (SIGKILL, etc) will terminate RetroArch without saving RAM, etc. -# On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization. -# input_exit_emulator = escape - - -# Applies next and previous shader in directory. -# input_shader_next = m -# input_shader_prev = n - -# Hold button down to rewind. Rewinding must be enabled. -# input_rewind = r - -# Toggle between recording and not. -# input_movie_record_toggle = o - -# Toggle between paused and non-paused state -# input_pause_toggle = p - -# Frame advance when content is paused -# input_frame_advance = k - -# Reset the content. -# input_reset = h - -# Cheats. -# input_cheat_index_plus = y -# input_cheat_index_minus = t -# input_cheat_toggle = u - -# Mute/unmute audio -# input_audio_mute = f9 - -# Take screenshot -# input_screenshot = f8 - -# Netplay flip users. -# input_netplay_flip_players = i - -# Hold for slowmotion. -# input_slowmotion = e - -# Enable other hotkeys. -# If this hotkey is bound to either keyboard, joybutton or joyaxis, -# all other hotkeys will be disabled unless this hotkey is also held at the same time. -# This is useful for RETRO_KEYBOARD centric implementations -# which query a large area of the keyboard, where it is not desirable -# that hotkeys get in the way. - -# Alternatively, all hotkeys for keyboard could be disabled by the user. -# input_enable_hotkey_btn = - -# Increases audio volume. -# input_volume_up = kp_plus -# Decreases audio volume. -# input_volume_down = kp_minus - -# Toggles to next overlay. Wraps around. -# input_overlay_next = - -# Toggles eject for disks. Used for multiple-disk content. -# input_disk_eject_toggle = - -# Cycles through disk images. Use after ejecting. -# Complete by toggling eject again. -# input_disk_next = - -# Toggles menu. -# input_menu_toggle = f1 - -# RetroPad button combination to toggle menu -# 0 = none, 1 = L + R + Y + D-Pad Down, 2 = L3 + R3, 3 = Start + Select -# input_menu_toggle_gamepad_combo = 0 - -# allow any RetroPad to control the menu -# all_users_control_menu = false - -# Toggles mouse grab. When mouse is grabbed, RetroArch hides the mouse, -# and keeps the mouse pointer inside the window to allow relative mouse input -# to work better. -# input_grab_mouse_toggle = f11 - -#### Menu - -# Menu driver to use. "rgui", "lakka", etc. -# menu_driver = "rgui" - -# If disabled, the libretro core will keep running in the background when we -# are in the menu. -# menu_pause_libretro = false - -# Enable mouse input inside the menu. -# menu_mouse_enable = false - -# Enable touch input inside the menu. -# menu_pointer_enable = false - -# Shows current date and/or time inside menu. -# menu_timedate_enable = true - -# Shows current core inside menu. -# menu_core_enable = true - -# Path to an image to set as menu wallpaper. -# menu_wallpaper = - -# Dynamically load a new wallpaper depending on context. -# menu_dynamic_wallpaper_enable = false - -# Type of thumbnail to display. 0 = none, 1 = snaps, 2 = titles, 3 = boxarts -# menu_thumbnails = 0 - -# Wrap-around to beginning and/or end if boundary of list is reached horizontally or vertically -# menu_navigation_wraparound_enable = false - -# Filter files being show in 'Load Content' by supported extensions -# menu_navigation_browser_filter_supported_extensions_enable = true - -# Collapse subgroup settings into main group to create one big listing of settings -# per category. -# menu_collapse_subgroups_enable = false - -#### Core -# -# Prevent libretro cores from closing RetroArch on exit by loading a dummy core. -# load_dummy_on_core_shutdown = "true" - -# Check for firmware requirement(s) before loading a content. -# check_firmware_before_loading = "false" - -#### UI - -# Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored -# by video driver. -# suspend_screensaver_enable = true - -# Start UI companion driver's interface on boot (if available). -# ui_companion_start_on_boot = true - -#### Camera - -# Override the default camera device the camera driver uses. This is driver dependant. -# camera_device = - -# Override the default privacy permission for cores that want to access camera services. Is "false" by default. -# camera_allow = false - -#### Location - -# Override the default privacy permission for cores that want to access location services. Is "false" by default. -# location_allow = false - -#### Core Updater - -# URL to core update directory on buildbot. -# core_updater_buildbot_url = "http://buildbot.libretro.com" - -# URL to assets update directory on buildbot. -# core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" - -# After downloading, automatically extract archives that the downloads are contained inside. -# core_updater_auto_extract_archive = true - -#### Network - -# When being client over netplay, use keybinds for user 1. -# netplay_client_swap_input = false - -# The username of the person running RetroArch. This will be used for playing online, for instance. -# netplay_nickname = - -# The amount of delay frames to use for netplay. Increasing this value will increase -# performance, but introduce more latency. -# netplay_delay_frames = 0 - -# Netplay mode for the current user. -# false is Server, true is Client. -# netplay_mode = false - -# Enable or disable spectator mode for the user during netplay. -# netplay_spectator_mode_enable = false - -# The IP Address of the host to connect to. -# netplay_ip_address = - -# The port of the host IP Address. Can be either a TCP or UDP port. -# netplay_ip_port = 55435 - -#### Misc - -# Enable rewinding. This will take a performance hit when playing, so it is disabled by default. -# rewind_enable = false - -# Rewinding buffer size in megabytes. Bigger rewinding buffer means you can rewind longer. -# The buffer should be approx. 20MB per minute of buffer time. -# rewind_buffer_size = 20 - -# Rewind granularity. When rewinding defined number of frames, you can rewind several frames at a time, increasing the rewinding speed. -# rewind_granularity = 1 - -# Pause gameplay when window focus is lost. -# pause_nonactive = true - -# Autosaves the non-volatile SRAM at a regular interval. This is disabled by default unless set otherwise. -# The interval is measured in seconds. A value of 0 disables autosave. -# autosave_interval = - -# Path to content database directory. -# content_database_path = - -# Path to cheat database directory. -# cheat_database_path = - -# Directory to dump screenshots to. -# screenshot_directory = - -# Records video after CPU video filter. -# video_post_filter_record = false - -# Records output of GPU shaded material if available. -# video_gpu_record = false - -# Screenshots output of GPU shaded material if available. -# video_gpu_screenshot = true - -# Block SRAM from being overwritten when loading save states. -# Might potentially lead to buggy games. -# block_sram_overwrite = false - -# When saving a savestate, save state index is automatically increased before -# it is saved. -# Also, when loading content, the index will be set to the highest existing index. -# There is no upper bound on the index. -# savestate_auto_index = false - -# Slowmotion ratio. When slowmotion, content will slow down by factor. -# slowmotion_ratio = 3.0 - -# The maximum rate at which content will be run when using fast forward. (E.g. 5.0 for 60 fps content => 300 fps cap). -# RetroArch will go to sleep to ensure that the maximum rate will not be exceeded. -# Do not rely on this cap to be perfectly accurate. -# If this is set at 0, then fastforward ratio is unlimited (no FPS cap) -# fastforward_ratio = 0.0 - -# Enable stdin/network command interface. -# network_cmd_enable = false -# network_cmd_port = 55355 -# stdin_cmd_enable = false - -#### Bundle extraction - - +video_driver = "caca" +core_updater_buildbot_url = "http://buildbot.libretro.com/nightly/win-x86_64/latest/" +core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" +libretro_directory = "cores" +libretro_info_path = "info" +content_database_path = "database\rdb" +cheat_database_path = "cheats" +content_history_path = ".\content_history.lpl" +content_music_history_path = ".\content_music_history.lpl" +content_video_history_path = ".\content_video_history.lpl" +content_image_history_path = ".\content_image_history.lpl" +cursor_directory = "database\cursors" +screenshot_directory = "default" +system_directory = "default" +input_remapping_directory = "config\remaps" +video_shader_dir = "shaders" +video_filter_dir = "filters\video" +core_assets_directory = "downloads" +assets_directory = "assets" +dynamic_wallpapers_directory = "assets\wallpapers" +thumbnails_directory = "thumbnails" +playlist_directory = "playlists" +joypad_autoconfig_dir = "autoconfig" +audio_filter_dir = "filters\audio" +savefile_directory = "default" +savestate_directory = "default" +rgui_browser_directory = "default" +rgui_config_directory = "config" +overlay_directory = "overlays" +screenshot_directory = "default" +record_driver = "null" +camera_driver = "null" +wifi_driver = "null" +location_driver = "null" +menu_driver = "xmb" +audio_driver = "xaudio" +audio_resampler = "sinc" +input_driver = "dinput" +input_joypad_driver = "xinput" +video_aspect_ratio = "-1.000000" +video_scale = "3.000000" +video_refresh_rate = "59.940060" +audio_rate_control_delta = "0.005000" +audio_max_timing_skew = "0.050000" +audio_volume = "0.000000" +input_overlay_opacity = "0.700000" +input_overlay_scale = "1.000000" +menu_wallpaper_opacity = "0.300000" +menu_footer_opacity = "1.000000" +menu_header_opacity = "1.000000" +video_message_pos_x = "0.050000" +video_message_pos_y = "0.050000" +video_font_size = "32.000000" +fastforward_ratio = "0.000000" +slowmotion_ratio = "3.000000" +input_axis_threshold = "0.500000" +input_bind_timeout = "5" +input_turbo_period = "6" +input_duty_cycle = "3" +input_max_users = "5" +input_menu_toggle_gamepad_combo = "0" +audio_latency = "64" +audio_block_frames = "0" +rewind_granularity = "1" +autosave_interval = "0" +libretro_log_level = "0" +keyboard_gamepad_mapping_type = "1" +input_poll_type_behavior = "2" +video_monitor_index = "0" +video_fullscreen_x = "0" +video_fullscreen_y = "0" +video_window_x = "0" +video_window_y = "0" +network_cmd_port = "55355" +network_remote_base_port = "55400" +dpi_override_value = "200" +menu_thumbnails = "3" +xmb_alpha_factor = "75" +xmb_scale_factor = "100" +xmb_theme = "0" +xmb_menu_color_theme = "4" +materialui_menu_color_theme = "0" +menu_shader_pipeline = "2" +audio_out_rate = "48000" +custom_viewport_width = "960" +custom_viewport_height = "720" +custom_viewport_x = "0" +custom_viewport_y = "0" +content_history_size = "100" +video_hard_sync_frames = "0" +video_frame_delay = "0" +video_max_swapchain_images = "3" +video_swap_interval = "1" +video_rotation = "0" +aspect_ratio_index = "21" +state_slot = "0" +netplay_ip_port = "0" +netplay_delay_frames = "16" +netplay_check_frames = "30" +user_language = "0" +bundle_assets_extract_version_current = "0" +bundle_assets_extract_last_version = "0" +input_device_p1 = "0" +input_player1_joypad_index = "0" +input_libretro_device_p1 = "1" +input_player1_analog_dpad_mode = "0" +input_device_p2 = "0" +input_player2_joypad_index = "1" +input_libretro_device_p2 = "1" +input_player2_analog_dpad_mode = "0" +input_device_p3 = "0" +input_player3_joypad_index = "2" +input_libretro_device_p3 = "1" +input_player3_analog_dpad_mode = "0" +input_device_p4 = "0" +input_player4_joypad_index = "3" +input_libretro_device_p4 = "1" +input_player4_analog_dpad_mode = "0" +input_device_p5 = "0" +input_player5_joypad_index = "4" +input_libretro_device_p5 = "1" +input_player5_analog_dpad_mode = "0" +input_device_p6 = "0" +input_player6_joypad_index = "5" +input_libretro_device_p6 = "1" +input_player6_analog_dpad_mode = "0" +input_device_p7 = "0" +input_player7_joypad_index = "6" +input_libretro_device_p7 = "1" +input_player7_analog_dpad_mode = "0" +input_device_p8 = "0" +input_player8_joypad_index = "7" +input_libretro_device_p8 = "1" +input_player8_analog_dpad_mode = "0" +input_device_p9 = "0" +input_player9_joypad_index = "8" +input_libretro_device_p9 = "1" +input_player9_analog_dpad_mode = "0" +input_device_p10 = "0" +input_player10_joypad_index = "9" +input_libretro_device_p10 = "1" +input_player10_analog_dpad_mode = "0" +input_device_p11 = "0" +input_player11_joypad_index = "10" +input_libretro_device_p11 = "1" +input_player11_analog_dpad_mode = "0" +input_device_p12 = "0" +input_player12_joypad_index = "11" +input_libretro_device_p12 = "1" +input_player12_analog_dpad_mode = "0" +input_device_p13 = "0" +input_player13_joypad_index = "12" +input_libretro_device_p13 = "1" +input_player13_analog_dpad_mode = "0" +input_device_p14 = "0" +input_player14_joypad_index = "13" +input_libretro_device_p14 = "1" +input_player14_analog_dpad_mode = "0" +input_device_p15 = "0" +input_player15_joypad_index = "14" +input_libretro_device_p15 = "1" +input_player15_analog_dpad_mode = "0" +input_device_p16 = "0" +input_player16_joypad_index = "15" +input_libretro_device_p16 = "1" +input_player16_analog_dpad_mode = "0" +ui_companion_start_on_boot = "true" +ui_companion_enable = "false" +video_gpu_record = "false" +input_remap_binds_enable = "true" +all_users_control_menu = "false" +menu_swap_ok_cancel_buttons = "true" +netplay_client_swap_input = "true" +input_descriptor_label_show = "true" +input_descriptor_hide_unbound = "false" +load_dummy_on_core_shutdown = "true" +check_firmware_before_loading = "false" +builtin_mediaplayer_enable = "false" +builtin_imageviewer_enable = "true" +fps_show = "false" +ui_menubar_enable = "true" +suspend_screensaver_enable = "true" +rewind_enable = "false" +audio_sync = "true" +video_shader_enable = "false" +video_aspect_ratio_auto = "false" +video_allow_rotate = "true" +video_windowed_fullscreen = "true" +video_crop_overscan = "true" +video_scale_integer = "false" +video_smooth = "true" +video_force_aspect = "true" +video_threaded = "false" +video_shared_context = "false" +custom_bgm_enable = "false" +auto_screenshot_filename = "true" +video_force_srgb_disable = "false" +video_fullscreen = "false" +bundle_assets_extract_enable = "false" +video_vsync = "true" +video_hard_sync = "false" +video_black_frame_insertion = "false" +video_disable_composition = "false" +pause_nonactive = "true" +video_gpu_screenshot = "true" +video_post_filter_record = "false" +keyboard_gamepad_enable = "true" +core_set_supports_no_game_enable = "true" +audio_enable = "true" +audio_mute_enable = "false" +location_allow = "false" +video_font_enable = "true" +core_updater_auto_extract_archive = "true" +camera_allow = "false" +threaded_data_runloop_enable = "true" +menu_throttle_framerate = "true" +menu_linear_filter = "true" +dpi_override_enable = "true" +menu_pause_libretro = "true" +menu_mouse_enable = "true" +menu_pointer_enable = "false" +menu_timedate_enable = "true" +menu_core_enable = "true" +menu_dynamic_wallpaper_enable = "false" +xmb_shadows_enable = "true" +xmb_show_settings = "true" +xmb_show_images = "true" +xmb_show_history = "true" +rgui_show_start_screen = "false" +menu_navigation_wraparound_enable = "true" +menu_navigation_browser_filter_supported_extensions_enable = "true" +menu_show_advanced_settings = "true" +cheevos_enable = "false" +cheevos_test_unofficial = "false" +cheevos_hardcore_mode_enable = "false" +input_overlay_enable = "true" +input_overlay_enable_autopreferred = "true" +input_overlay_hide_in_menu = "true" +network_cmd_enable = "false" +stdin_cmd_enable = "false" +network_remote_enable = "false" +netplay_spectator_mode_enable = "false" +netplay_nat_traversal = "true" +block_sram_overwrite = "false" +savestate_auto_index = "false" +savestate_auto_save = "false" +savestate_auto_load = "false" +savestate_thumbnail_enable = "false" +history_list_enable = "true" +game_specific_options = "false" +auto_overrides_enable = "true" +auto_remaps_enable = "true" +auto_shaders_enable = "true" +sort_savefiles_enable = "false" +sort_savestates_enable = "false" +config_save_on_exit = "true" +show_hidden_files = "true" +input_autodetect_enable = "true" +audio_rate_control = "true" +network_remote_enable_user_p1 = "false" +network_remote_enable_user_p2 = "false" +network_remote_enable_user_p3 = "false" +network_remote_enable_user_p4 = "false" +network_remote_enable_user_p5 = "false" +network_remote_enable_user_p6 = "false" +network_remote_enable_user_p7 = "false" +network_remote_enable_user_p8 = "false" +network_remote_enable_user_p9 = "false" +network_remote_enable_user_p10 = "false" +network_remote_enable_user_p11 = "false" +network_remote_enable_user_p12 = "false" +network_remote_enable_user_p13 = "false" +network_remote_enable_user_p14 = "false" +network_remote_enable_user_p15 = "false" +network_remote_enable_user_p16 = "false" +log_verbosity = "false" +perfcnt_enable = "false" +video_message_color = "ffff00" +menu_entry_normal_color = "ffffffff" +menu_entry_hover_color = "ff64ff64" +menu_title_color = "ff64ff64" +gamma_correction = "false" +flicker_filter_enable = "false" +soft_filter_enable = "false" +soft_filter_index = "0" +current_resolution_id = "0" +flicker_filter_index = "0" +input_player1_b = "z" +input_player1_b_btn = "nul" +input_player1_b_axis = "nul" +input_player1_y = "a" +input_player1_y_btn = "nul" +input_player1_y_axis = "nul" +input_player1_select = "rshift" +input_player1_select_btn = "nul" +input_player1_select_axis = "nul" +input_player1_start = "enter" +input_player1_start_btn = "nul" +input_player1_start_axis = "nul" +input_player1_up = "up" +input_player1_up_btn = "nul" +input_player1_up_axis = "nul" +input_player1_down = "down" +input_player1_down_btn = "nul" +input_player1_down_axis = "nul" +input_player1_left = "left" +input_player1_left_btn = "nul" +input_player1_left_axis = "nul" +input_player1_right = "right" +input_player1_right_btn = "nul" +input_player1_right_axis = "nul" +input_player1_a = "x" +input_player1_a_btn = "nul" +input_player1_a_axis = "nul" +input_player1_x = "s" +input_player1_x_btn = "nul" +input_player1_x_axis = "nul" +input_player1_l = "q" +input_player1_l_btn = "nul" +input_player1_l_axis = "nul" +input_player1_r = "w" +input_player1_r_btn = "nul" +input_player1_r_axis = "nul" +input_player1_l2 = "nul" +input_player1_l2_btn = "nul" +input_player1_l2_axis = "nul" +input_player1_r2 = "nul" +input_player1_r2_btn = "nul" +input_player1_r2_axis = "nul" +input_player1_l3 = "nul" +input_player1_l3_btn = "nul" +input_player1_l3_axis = "nul" +input_player1_r3 = "nul" +input_player1_r3_btn = "nul" +input_player1_r3_axis = "nul" +input_player1_l_x_plus = "nul" +input_player1_l_x_plus_btn = "nul" +input_player1_l_x_plus_axis = "nul" +input_player1_l_x_minus = "nul" +input_player1_l_x_minus_btn = "nul" +input_player1_l_x_minus_axis = "nul" +input_player1_l_y_plus = "nul" +input_player1_l_y_plus_btn = "nul" +input_player1_l_y_plus_axis = "nul" +input_player1_l_y_minus = "nul" +input_player1_l_y_minus_btn = "nul" +input_player1_l_y_minus_axis = "nul" +input_player1_r_x_plus = "nul" +input_player1_r_x_plus_btn = "nul" +input_player1_r_x_plus_axis = "nul" +input_player1_r_x_minus = "nul" +input_player1_r_x_minus_btn = "nul" +input_player1_r_x_minus_axis = "nul" +input_player1_r_y_plus = "nul" +input_player1_r_y_plus_btn = "nul" +input_player1_r_y_plus_axis = "nul" +input_player1_r_y_minus = "nul" +input_player1_r_y_minus_btn = "nul" +input_player1_r_y_minus_axis = "nul" +input_player1_turbo = "nul" +input_player1_turbo_btn = "nul" +input_player1_turbo_axis = "nul" +input_toggle_fast_forward = "space" +input_toggle_fast_forward_btn = "nul" +input_toggle_fast_forward_axis = "nul" +input_hold_fast_forward = "l" +input_hold_fast_forward_btn = "nul" +input_hold_fast_forward_axis = "nul" +input_load_state = "f4" +input_load_state_btn = "nul" +input_load_state_axis = "nul" +input_save_state = "f2" +input_save_state_btn = "nul" +input_save_state_axis = "nul" +input_toggle_fullscreen = "f" +input_toggle_fullscreen_btn = "nul" +input_toggle_fullscreen_axis = "nul" +input_exit_emulator = "escape" +input_exit_emulator_btn = "nul" +input_exit_emulator_axis = "nul" +input_state_slot_increase = "f7" +input_state_slot_increase_btn = "nul" +input_state_slot_increase_axis = "nul" +input_state_slot_decrease = "f6" +input_state_slot_decrease_btn = "nul" +input_state_slot_decrease_axis = "nul" +input_rewind = "r" +input_rewind_btn = "nul" +input_rewind_axis = "nul" +input_movie_record_toggle = "o" +input_movie_record_toggle_btn = "nul" +input_movie_record_toggle_axis = "nul" +input_pause_toggle = "p" +input_pause_toggle_btn = "nul" +input_pause_toggle_axis = "nul" +input_frame_advance = "k" +input_frame_advance_btn = "nul" +input_frame_advance_axis = "nul" +input_reset = "h" +input_reset_btn = "nul" +input_reset_axis = "nul" +input_shader_next = "m" +input_shader_next_btn = "nul" +input_shader_next_axis = "nul" +input_shader_prev = "n" +input_shader_prev_btn = "nul" +input_shader_prev_axis = "nul" +input_cheat_index_plus = "y" +input_cheat_index_plus_btn = "nul" +input_cheat_index_plus_axis = "nul" +input_cheat_index_minus = "t" +input_cheat_index_minus_btn = "nul" +input_cheat_index_minus_axis = "nul" +input_cheat_toggle = "u" +input_cheat_toggle_btn = "nul" +input_cheat_toggle_axis = "nul" +input_screenshot = "f8" +input_screenshot_btn = "nul" +input_screenshot_axis = "nul" +input_audio_mute = "f9" +input_audio_mute_btn = "nul" +input_audio_mute_axis = "nul" +input_osk_toggle = "f12" +input_osk_toggle_btn = "nul" +input_osk_toggle_axis = "nul" +input_netplay_flip_players = "i" +input_netplay_flip_players_btn = "nul" +input_netplay_flip_players_axis = "nul" +input_slowmotion = "e" +input_slowmotion_btn = "nul" +input_slowmotion_axis = "nul" +input_enable_hotkey = "nul" +input_enable_hotkey_btn = "nul" +input_enable_hotkey_axis = "nul" +input_volume_up = "add" +input_volume_up_btn = "nul" +input_volume_up_axis = "nul" +input_volume_down = "subtract" +input_volume_down_btn = "nul" +input_volume_down_axis = "nul" +input_overlay_next = "nul" +input_overlay_next_btn = "nul" +input_overlay_next_axis = "nul" +input_disk_eject_toggle = "nul" +input_disk_eject_toggle_btn = "nul" +input_disk_eject_toggle_axis = "nul" +input_disk_next = "nul" +input_disk_next_btn = "nul" +input_disk_next_axis = "nul" +input_disk_prev = "nul" +input_disk_prev_btn = "nul" +input_disk_prev_axis = "nul" +input_grab_mouse_toggle = "f11" +input_grab_mouse_toggle_btn = "nul" +input_grab_mouse_toggle_axis = "nul" +input_menu_toggle = "f1" +input_menu_toggle_btn = "nul" +input_menu_toggle_axis = "nul" +input_player2_b = "nul" +input_player2_b_btn = "nul" +input_player2_b_axis = "nul" +input_player2_y = "nul" +input_player2_y_btn = "nul" +input_player2_y_axis = "nul" +input_player2_select = "nul" +input_player2_select_btn = "nul" +input_player2_select_axis = "nul" +input_player2_start = "nul" +input_player2_start_btn = "nul" +input_player2_start_axis = "nul" +input_player2_up = "nul" +input_player2_up_btn = "nul" +input_player2_up_axis = "nul" +input_player2_down = "nul" +input_player2_down_btn = "nul" +input_player2_down_axis = "nul" +input_player2_left = "nul" +input_player2_left_btn = "nul" +input_player2_left_axis = "nul" +input_player2_right = "nul" +input_player2_right_btn = "nul" +input_player2_right_axis = "nul" +input_player2_a = "nul" +input_player2_a_btn = "nul" +input_player2_a_axis = "nul" +input_player2_x = "nul" +input_player2_x_btn = "nul" +input_player2_x_axis = "nul" +input_player2_l = "nul" +input_player2_l_btn = "nul" +input_player2_l_axis = "nul" +input_player2_r = "nul" +input_player2_r_btn = "nul" +input_player2_r_axis = "nul" +input_player2_l2 = "nul" +input_player2_l2_btn = "nul" +input_player2_l2_axis = "nul" +input_player2_r2 = "nul" +input_player2_r2_btn = "nul" +input_player2_r2_axis = "nul" +input_player2_l3 = "nul" +input_player2_l3_btn = "nul" +input_player2_l3_axis = "nul" +input_player2_r3 = "nul" +input_player2_r3_btn = "nul" +input_player2_r3_axis = "nul" +input_player2_l_x_plus = "nul" +input_player2_l_x_plus_btn = "nul" +input_player2_l_x_plus_axis = "nul" +input_player2_l_x_minus = "nul" +input_player2_l_x_minus_btn = "nul" +input_player2_l_x_minus_axis = "nul" +input_player2_l_y_plus = "nul" +input_player2_l_y_plus_btn = "nul" +input_player2_l_y_plus_axis = "nul" +input_player2_l_y_minus = "nul" +input_player2_l_y_minus_btn = "nul" +input_player2_l_y_minus_axis = "nul" +input_player2_r_x_plus = "nul" +input_player2_r_x_plus_btn = "nul" +input_player2_r_x_plus_axis = "nul" +input_player2_r_x_minus = "nul" +input_player2_r_x_minus_btn = "nul" +input_player2_r_x_minus_axis = "nul" +input_player2_r_y_plus = "nul" +input_player2_r_y_plus_btn = "nul" +input_player2_r_y_plus_axis = "nul" +input_player2_r_y_minus = "nul" +input_player2_r_y_minus_btn = "nul" +input_player2_r_y_minus_axis = "nul" +input_player2_turbo = "nul" +input_player2_turbo_btn = "nul" +input_player2_turbo_axis = "nul" +input_player3_b = "nul" +input_player3_b_btn = "nul" +input_player3_b_axis = "nul" +input_player3_y = "nul" +input_player3_y_btn = "nul" +input_player3_y_axis = "nul" +input_player3_select = "nul" +input_player3_select_btn = "nul" +input_player3_select_axis = "nul" +input_player3_start = "nul" +input_player3_start_btn = "nul" +input_player3_start_axis = "nul" +input_player3_up = "nul" +input_player3_up_btn = "nul" +input_player3_up_axis = "nul" +input_player3_down = "nul" +input_player3_down_btn = "nul" +input_player3_down_axis = "nul" +input_player3_left = "nul" +input_player3_left_btn = "nul" +input_player3_left_axis = "nul" +input_player3_right = "nul" +input_player3_right_btn = "nul" +input_player3_right_axis = "nul" +input_player3_a = "nul" +input_player3_a_btn = "nul" +input_player3_a_axis = "nul" +input_player3_x = "nul" +input_player3_x_btn = "nul" +input_player3_x_axis = "nul" +input_player3_l = "nul" +input_player3_l_btn = "nul" +input_player3_l_axis = "nul" +input_player3_r = "nul" +input_player3_r_btn = "nul" +input_player3_r_axis = "nul" +input_player3_l2 = "nul" +input_player3_l2_btn = "nul" +input_player3_l2_axis = "nul" +input_player3_r2 = "nul" +input_player3_r2_btn = "nul" +input_player3_r2_axis = "nul" +input_player3_l3 = "nul" +input_player3_l3_btn = "nul" +input_player3_l3_axis = "nul" +input_player3_r3 = "nul" +input_player3_r3_btn = "nul" +input_player3_r3_axis = "nul" +input_player3_l_x_plus = "nul" +input_player3_l_x_plus_btn = "nul" +input_player3_l_x_plus_axis = "nul" +input_player3_l_x_minus = "nul" +input_player3_l_x_minus_btn = "nul" +input_player3_l_x_minus_axis = "nul" +input_player3_l_y_plus = "nul" +input_player3_l_y_plus_btn = "nul" +input_player3_l_y_plus_axis = "nul" +input_player3_l_y_minus = "nul" +input_player3_l_y_minus_btn = "nul" +input_player3_l_y_minus_axis = "nul" +input_player3_r_x_plus = "nul" +input_player3_r_x_plus_btn = "nul" +input_player3_r_x_plus_axis = "nul" +input_player3_r_x_minus = "nul" +input_player3_r_x_minus_btn = "nul" +input_player3_r_x_minus_axis = "nul" +input_player3_r_y_plus = "nul" +input_player3_r_y_plus_btn = "nul" +input_player3_r_y_plus_axis = "nul" +input_player3_r_y_minus = "nul" +input_player3_r_y_minus_btn = "nul" +input_player3_r_y_minus_axis = "nul" +input_player3_turbo = "nul" +input_player3_turbo_btn = "nul" +input_player3_turbo_axis = "nul" +input_player4_b = "nul" +input_player4_b_btn = "nul" +input_player4_b_axis = "nul" +input_player4_y = "nul" +input_player4_y_btn = "nul" +input_player4_y_axis = "nul" +input_player4_select = "nul" +input_player4_select_btn = "nul" +input_player4_select_axis = "nul" +input_player4_start = "nul" +input_player4_start_btn = "nul" +input_player4_start_axis = "nul" +input_player4_up = "nul" +input_player4_up_btn = "nul" +input_player4_up_axis = "nul" +input_player4_down = "nul" +input_player4_down_btn = "nul" +input_player4_down_axis = "nul" +input_player4_left = "nul" +input_player4_left_btn = "nul" +input_player4_left_axis = "nul" +input_player4_right = "nul" +input_player4_right_btn = "nul" +input_player4_right_axis = "nul" +input_player4_a = "nul" +input_player4_a_btn = "nul" +input_player4_a_axis = "nul" +input_player4_x = "nul" +input_player4_x_btn = "nul" +input_player4_x_axis = "nul" +input_player4_l = "nul" +input_player4_l_btn = "nul" +input_player4_l_axis = "nul" +input_player4_r = "nul" +input_player4_r_btn = "nul" +input_player4_r_axis = "nul" +input_player4_l2 = "nul" +input_player4_l2_btn = "nul" +input_player4_l2_axis = "nul" +input_player4_r2 = "nul" +input_player4_r2_btn = "nul" +input_player4_r2_axis = "nul" +input_player4_l3 = "nul" +input_player4_l3_btn = "nul" +input_player4_l3_axis = "nul" +input_player4_r3 = "nul" +input_player4_r3_btn = "nul" +input_player4_r3_axis = "nul" +input_player4_l_x_plus = "nul" +input_player4_l_x_plus_btn = "nul" +input_player4_l_x_plus_axis = "nul" +input_player4_l_x_minus = "nul" +input_player4_l_x_minus_btn = "nul" +input_player4_l_x_minus_axis = "nul" +input_player4_l_y_plus = "nul" +input_player4_l_y_plus_btn = "nul" +input_player4_l_y_plus_axis = "nul" +input_player4_l_y_minus = "nul" +input_player4_l_y_minus_btn = "nul" +input_player4_l_y_minus_axis = "nul" +input_player4_r_x_plus = "nul" +input_player4_r_x_plus_btn = "nul" +input_player4_r_x_plus_axis = "nul" +input_player4_r_x_minus = "nul" +input_player4_r_x_minus_btn = "nul" +input_player4_r_x_minus_axis = "nul" +input_player4_r_y_plus = "nul" +input_player4_r_y_plus_btn = "nul" +input_player4_r_y_plus_axis = "nul" +input_player4_r_y_minus = "nul" +input_player4_r_y_minus_btn = "nul" +input_player4_r_y_minus_axis = "nul" +input_player4_turbo = "nul" +input_player4_turbo_btn = "nul" +input_player4_turbo_axis = "nul" +input_player5_b = "nul" +input_player5_b_btn = "nul" +input_player5_b_axis = "nul" +input_player5_y = "nul" +input_player5_y_btn = "nul" +input_player5_y_axis = "nul" +input_player5_select = "nul" +input_player5_select_btn = "nul" +input_player5_select_axis = "nul" +input_player5_start = "nul" +input_player5_start_btn = "nul" +input_player5_start_axis = "nul" +input_player5_up = "nul" +input_player5_up_btn = "nul" +input_player5_up_axis = "nul" +input_player5_down = "nul" +input_player5_down_btn = "nul" +input_player5_down_axis = "nul" +input_player5_left = "nul" +input_player5_left_btn = "nul" +input_player5_left_axis = "nul" +input_player5_right = "nul" +input_player5_right_btn = "nul" +input_player5_right_axis = "nul" +input_player5_a = "nul" +input_player5_a_btn = "nul" +input_player5_a_axis = "nul" +input_player5_x = "nul" +input_player5_x_btn = "nul" +input_player5_x_axis = "nul" +input_player5_l = "nul" +input_player5_l_btn = "nul" +input_player5_l_axis = "nul" +input_player5_r = "nul" +input_player5_r_btn = "nul" +input_player5_r_axis = "nul" +input_player5_l2 = "nul" +input_player5_l2_btn = "nul" +input_player5_l2_axis = "nul" +input_player5_r2 = "nul" +input_player5_r2_btn = "nul" +input_player5_r2_axis = "nul" +input_player5_l3 = "nul" +input_player5_l3_btn = "nul" +input_player5_l3_axis = "nul" +input_player5_r3 = "nul" +input_player5_r3_btn = "nul" +input_player5_r3_axis = "nul" +input_player5_l_x_plus = "nul" +input_player5_l_x_plus_btn = "nul" +input_player5_l_x_plus_axis = "nul" +input_player5_l_x_minus = "nul" +input_player5_l_x_minus_btn = "nul" +input_player5_l_x_minus_axis = "nul" +input_player5_l_y_plus = "nul" +input_player5_l_y_plus_btn = "nul" +input_player5_l_y_plus_axis = "nul" +input_player5_l_y_minus = "nul" +input_player5_l_y_minus_btn = "nul" +input_player5_l_y_minus_axis = "nul" +input_player5_r_x_plus = "nul" +input_player5_r_x_plus_btn = "nul" +input_player5_r_x_plus_axis = "nul" +input_player5_r_x_minus = "nul" +input_player5_r_x_minus_btn = "nul" +input_player5_r_x_minus_axis = "nul" +input_player5_r_y_plus = "nul" +input_player5_r_y_plus_btn = "nul" +input_player5_r_y_plus_axis = "nul" +input_player5_r_y_minus = "nul" +input_player5_r_y_minus_btn = "nul" +input_player5_r_y_minus_axis = "nul" +input_player5_turbo = "nul" +input_player5_turbo_btn = "nul" +input_player5_turbo_axis = "nul" +input_player6_b = "nul" +input_player6_b_btn = "nul" +input_player6_b_axis = "nul" +input_player6_y = "nul" +input_player6_y_btn = "nul" +input_player6_y_axis = "nul" +input_player6_select = "nul" +input_player6_select_btn = "nul" +input_player6_select_axis = "nul" +input_player6_start = "nul" +input_player6_start_btn = "nul" +input_player6_start_axis = "nul" +input_player6_up = "nul" +input_player6_up_btn = "nul" +input_player6_up_axis = "nul" +input_player6_down = "nul" +input_player6_down_btn = "nul" +input_player6_down_axis = "nul" +input_player6_left = "nul" +input_player6_left_btn = "nul" +input_player6_left_axis = "nul" +input_player6_right = "nul" +input_player6_right_btn = "nul" +input_player6_right_axis = "nul" +input_player6_a = "nul" +input_player6_a_btn = "nul" +input_player6_a_axis = "nul" +input_player6_x = "nul" +input_player6_x_btn = "nul" +input_player6_x_axis = "nul" +input_player6_l = "nul" +input_player6_l_btn = "nul" +input_player6_l_axis = "nul" +input_player6_r = "nul" +input_player6_r_btn = "nul" +input_player6_r_axis = "nul" +input_player6_l2 = "nul" +input_player6_l2_btn = "nul" +input_player6_l2_axis = "nul" +input_player6_r2 = "nul" +input_player6_r2_btn = "nul" +input_player6_r2_axis = "nul" +input_player6_l3 = "nul" +input_player6_l3_btn = "nul" +input_player6_l3_axis = "nul" +input_player6_r3 = "nul" +input_player6_r3_btn = "nul" +input_player6_r3_axis = "nul" +input_player6_l_x_plus = "nul" +input_player6_l_x_plus_btn = "nul" +input_player6_l_x_plus_axis = "nul" +input_player6_l_x_minus = "nul" +input_player6_l_x_minus_btn = "nul" +input_player6_l_x_minus_axis = "nul" +input_player6_l_y_plus = "nul" +input_player6_l_y_plus_btn = "nul" +input_player6_l_y_plus_axis = "nul" +input_player6_l_y_minus = "nul" +input_player6_l_y_minus_btn = "nul" +input_player6_l_y_minus_axis = "nul" +input_player6_r_x_plus = "nul" +input_player6_r_x_plus_btn = "nul" +input_player6_r_x_plus_axis = "nul" +input_player6_r_x_minus = "nul" +input_player6_r_x_minus_btn = "nul" +input_player6_r_x_minus_axis = "nul" +input_player6_r_y_plus = "nul" +input_player6_r_y_plus_btn = "nul" +input_player6_r_y_plus_axis = "nul" +input_player6_r_y_minus = "nul" +input_player6_r_y_minus_btn = "nul" +input_player6_r_y_minus_axis = "nul" +input_player6_turbo = "nul" +input_player6_turbo_btn = "nul" +input_player6_turbo_axis = "nul" +input_player7_b = "nul" +input_player7_b_btn = "nul" +input_player7_b_axis = "nul" +input_player7_y = "nul" +input_player7_y_btn = "nul" +input_player7_y_axis = "nul" +input_player7_select = "nul" +input_player7_select_btn = "nul" +input_player7_select_axis = "nul" +input_player7_start = "nul" +input_player7_start_btn = "nul" +input_player7_start_axis = "nul" +input_player7_up = "nul" +input_player7_up_btn = "nul" +input_player7_up_axis = "nul" +input_player7_down = "nul" +input_player7_down_btn = "nul" +input_player7_down_axis = "nul" +input_player7_left = "nul" +input_player7_left_btn = "nul" +input_player7_left_axis = "nul" +input_player7_right = "nul" +input_player7_right_btn = "nul" +input_player7_right_axis = "nul" +input_player7_a = "nul" +input_player7_a_btn = "nul" +input_player7_a_axis = "nul" +input_player7_x = "nul" +input_player7_x_btn = "nul" +input_player7_x_axis = "nul" +input_player7_l = "nul" +input_player7_l_btn = "nul" +input_player7_l_axis = "nul" +input_player7_r = "nul" +input_player7_r_btn = "nul" +input_player7_r_axis = "nul" +input_player7_l2 = "nul" +input_player7_l2_btn = "nul" +input_player7_l2_axis = "nul" +input_player7_r2 = "nul" +input_player7_r2_btn = "nul" +input_player7_r2_axis = "nul" +input_player7_l3 = "nul" +input_player7_l3_btn = "nul" +input_player7_l3_axis = "nul" +input_player7_r3 = "nul" +input_player7_r3_btn = "nul" +input_player7_r3_axis = "nul" +input_player7_l_x_plus = "nul" +input_player7_l_x_plus_btn = "nul" +input_player7_l_x_plus_axis = "nul" +input_player7_l_x_minus = "nul" +input_player7_l_x_minus_btn = "nul" +input_player7_l_x_minus_axis = "nul" +input_player7_l_y_plus = "nul" +input_player7_l_y_plus_btn = "nul" +input_player7_l_y_plus_axis = "nul" +input_player7_l_y_minus = "nul" +input_player7_l_y_minus_btn = "nul" +input_player7_l_y_minus_axis = "nul" +input_player7_r_x_plus = "nul" +input_player7_r_x_plus_btn = "nul" +input_player7_r_x_plus_axis = "nul" +input_player7_r_x_minus = "nul" +input_player7_r_x_minus_btn = "nul" +input_player7_r_x_minus_axis = "nul" +input_player7_r_y_plus = "nul" +input_player7_r_y_plus_btn = "nul" +input_player7_r_y_plus_axis = "nul" +input_player7_r_y_minus = "nul" +input_player7_r_y_minus_btn = "nul" +input_player7_r_y_minus_axis = "nul" +input_player7_turbo = "nul" +input_player7_turbo_btn = "nul" +input_player7_turbo_axis = "nul" +input_player8_b = "nul" +input_player8_b_btn = "nul" +input_player8_b_axis = "nul" +input_player8_y = "nul" +input_player8_y_btn = "nul" +input_player8_y_axis = "nul" +input_player8_select = "nul" +input_player8_select_btn = "nul" +input_player8_select_axis = "nul" +input_player8_start = "nul" +input_player8_start_btn = "nul" +input_player8_start_axis = "nul" +input_player8_up = "nul" +input_player8_up_btn = "nul" +input_player8_up_axis = "nul" +input_player8_down = "nul" +input_player8_down_btn = "nul" +input_player8_down_axis = "nul" +input_player8_left = "nul" +input_player8_left_btn = "nul" +input_player8_left_axis = "nul" +input_player8_right = "nul" +input_player8_right_btn = "nul" +input_player8_right_axis = "nul" +input_player8_a = "nul" +input_player8_a_btn = "nul" +input_player8_a_axis = "nul" +input_player8_x = "nul" +input_player8_x_btn = "nul" +input_player8_x_axis = "nul" +input_player8_l = "nul" +input_player8_l_btn = "nul" +input_player8_l_axis = "nul" +input_player8_r = "nul" +input_player8_r_btn = "nul" +input_player8_r_axis = "nul" +input_player8_l2 = "nul" +input_player8_l2_btn = "nul" +input_player8_l2_axis = "nul" +input_player8_r2 = "nul" +input_player8_r2_btn = "nul" +input_player8_r2_axis = "nul" +input_player8_l3 = "nul" +input_player8_l3_btn = "nul" +input_player8_l3_axis = "nul" +input_player8_r3 = "nul" +input_player8_r3_btn = "nul" +input_player8_r3_axis = "nul" +input_player8_l_x_plus = "nul" +input_player8_l_x_plus_btn = "nul" +input_player8_l_x_plus_axis = "nul" +input_player8_l_x_minus = "nul" +input_player8_l_x_minus_btn = "nul" +input_player8_l_x_minus_axis = "nul" +input_player8_l_y_plus = "nul" +input_player8_l_y_plus_btn = "nul" +input_player8_l_y_plus_axis = "nul" +input_player8_l_y_minus = "nul" +input_player8_l_y_minus_btn = "nul" +input_player8_l_y_minus_axis = "nul" +input_player8_r_x_plus = "nul" +input_player8_r_x_plus_btn = "nul" +input_player8_r_x_plus_axis = "nul" +input_player8_r_x_minus = "nul" +input_player8_r_x_minus_btn = "nul" +input_player8_r_x_minus_axis = "nul" +input_player8_r_y_plus = "nul" +input_player8_r_y_plus_btn = "nul" +input_player8_r_y_plus_axis = "nul" +input_player8_r_y_minus = "nul" +input_player8_r_y_minus_btn = "nul" +input_player8_r_y_minus_axis = "nul" +input_player8_turbo = "nul" +input_player8_turbo_btn = "nul" +input_player8_turbo_axis = "nul" +input_player9_b = "nul" +input_player9_b_btn = "nul" +input_player9_b_axis = "nul" +input_player9_y = "nul" +input_player9_y_btn = "nul" +input_player9_y_axis = "nul" +input_player9_select = "nul" +input_player9_select_btn = "nul" +input_player9_select_axis = "nul" +input_player9_start = "nul" +input_player9_start_btn = "nul" +input_player9_start_axis = "nul" +input_player9_up = "nul" +input_player9_up_btn = "nul" +input_player9_up_axis = "nul" +input_player9_down = "nul" +input_player9_down_btn = "nul" +input_player9_down_axis = "nul" +input_player9_left = "nul" +input_player9_left_btn = "nul" +input_player9_left_axis = "nul" +input_player9_right = "nul" +input_player9_right_btn = "nul" +input_player9_right_axis = "nul" +input_player9_a = "nul" +input_player9_a_btn = "nul" +input_player9_a_axis = "nul" +input_player9_x = "nul" +input_player9_x_btn = "nul" +input_player9_x_axis = "nul" +input_player9_l = "nul" +input_player9_l_btn = "nul" +input_player9_l_axis = "nul" +input_player9_r = "nul" +input_player9_r_btn = "nul" +input_player9_r_axis = "nul" +input_player9_l2 = "nul" +input_player9_l2_btn = "nul" +input_player9_l2_axis = "nul" +input_player9_r2 = "nul" +input_player9_r2_btn = "nul" +input_player9_r2_axis = "nul" +input_player9_l3 = "nul" +input_player9_l3_btn = "nul" +input_player9_l3_axis = "nul" +input_player9_r3 = "nul" +input_player9_r3_btn = "nul" +input_player9_r3_axis = "nul" +input_player9_l_x_plus = "nul" +input_player9_l_x_plus_btn = "nul" +input_player9_l_x_plus_axis = "nul" +input_player9_l_x_minus = "nul" +input_player9_l_x_minus_btn = "nul" +input_player9_l_x_minus_axis = "nul" +input_player9_l_y_plus = "nul" +input_player9_l_y_plus_btn = "nul" +input_player9_l_y_plus_axis = "nul" +input_player9_l_y_minus = "nul" +input_player9_l_y_minus_btn = "nul" +input_player9_l_y_minus_axis = "nul" +input_player9_r_x_plus = "nul" +input_player9_r_x_plus_btn = "nul" +input_player9_r_x_plus_axis = "nul" +input_player9_r_x_minus = "nul" +input_player9_r_x_minus_btn = "nul" +input_player9_r_x_minus_axis = "nul" +input_player9_r_y_plus = "nul" +input_player9_r_y_plus_btn = "nul" +input_player9_r_y_plus_axis = "nul" +input_player9_r_y_minus = "nul" +input_player9_r_y_minus_btn = "nul" +input_player9_r_y_minus_axis = "nul" +input_player9_turbo = "nul" +input_player9_turbo_btn = "nul" +input_player9_turbo_axis = "nul" +input_player10_b = "nul" +input_player10_b_btn = "nul" +input_player10_b_axis = "nul" +input_player10_y = "nul" +input_player10_y_btn = "nul" +input_player10_y_axis = "nul" +input_player10_select = "nul" +input_player10_select_btn = "nul" +input_player10_select_axis = "nul" +input_player10_start = "nul" +input_player10_start_btn = "nul" +input_player10_start_axis = "nul" +input_player10_up = "nul" +input_player10_up_btn = "nul" +input_player10_up_axis = "nul" +input_player10_down = "nul" +input_player10_down_btn = "nul" +input_player10_down_axis = "nul" +input_player10_left = "nul" +input_player10_left_btn = "nul" +input_player10_left_axis = "nul" +input_player10_right = "nul" +input_player10_right_btn = "nul" +input_player10_right_axis = "nul" +input_player10_a = "nul" +input_player10_a_btn = "nul" +input_player10_a_axis = "nul" +input_player10_x = "nul" +input_player10_x_btn = "nul" +input_player10_x_axis = "nul" +input_player10_l = "nul" +input_player10_l_btn = "nul" +input_player10_l_axis = "nul" +input_player10_r = "nul" +input_player10_r_btn = "nul" +input_player10_r_axis = "nul" +input_player10_l2 = "nul" +input_player10_l2_btn = "nul" +input_player10_l2_axis = "nul" +input_player10_r2 = "nul" +input_player10_r2_btn = "nul" +input_player10_r2_axis = "nul" +input_player10_l3 = "nul" +input_player10_l3_btn = "nul" +input_player10_l3_axis = "nul" +input_player10_r3 = "nul" +input_player10_r3_btn = "nul" +input_player10_r3_axis = "nul" +input_player10_l_x_plus = "nul" +input_player10_l_x_plus_btn = "nul" +input_player10_l_x_plus_axis = "nul" +input_player10_l_x_minus = "nul" +input_player10_l_x_minus_btn = "nul" +input_player10_l_x_minus_axis = "nul" +input_player10_l_y_plus = "nul" +input_player10_l_y_plus_btn = "nul" +input_player10_l_y_plus_axis = "nul" +input_player10_l_y_minus = "nul" +input_player10_l_y_minus_btn = "nul" +input_player10_l_y_minus_axis = "nul" +input_player10_r_x_plus = "nul" +input_player10_r_x_plus_btn = "nul" +input_player10_r_x_plus_axis = "nul" +input_player10_r_x_minus = "nul" +input_player10_r_x_minus_btn = "nul" +input_player10_r_x_minus_axis = "nul" +input_player10_r_y_plus = "nul" +input_player10_r_y_plus_btn = "nul" +input_player10_r_y_plus_axis = "nul" +input_player10_r_y_minus = "nul" +input_player10_r_y_minus_btn = "nul" +input_player10_r_y_minus_axis = "nul" +input_player10_turbo = "nul" +input_player10_turbo_btn = "nul" +input_player10_turbo_axis = "nul" +input_player11_b = "nul" +input_player11_b_btn = "nul" +input_player11_b_axis = "nul" +input_player11_y = "nul" +input_player11_y_btn = "nul" +input_player11_y_axis = "nul" +input_player11_select = "nul" +input_player11_select_btn = "nul" +input_player11_select_axis = "nul" +input_player11_start = "nul" +input_player11_start_btn = "nul" +input_player11_start_axis = "nul" +input_player11_up = "nul" +input_player11_up_btn = "nul" +input_player11_up_axis = "nul" +input_player11_down = "nul" +input_player11_down_btn = "nul" +input_player11_down_axis = "nul" +input_player11_left = "nul" +input_player11_left_btn = "nul" +input_player11_left_axis = "nul" +input_player11_right = "nul" +input_player11_right_btn = "nul" +input_player11_right_axis = "nul" +input_player11_a = "nul" +input_player11_a_btn = "nul" +input_player11_a_axis = "nul" +input_player11_x = "nul" +input_player11_x_btn = "nul" +input_player11_x_axis = "nul" +input_player11_l = "nul" +input_player11_l_btn = "nul" +input_player11_l_axis = "nul" +input_player11_r = "nul" +input_player11_r_btn = "nul" +input_player11_r_axis = "nul" +input_player11_l2 = "nul" +input_player11_l2_btn = "nul" +input_player11_l2_axis = "nul" +input_player11_r2 = "nul" +input_player11_r2_btn = "nul" +input_player11_r2_axis = "nul" +input_player11_l3 = "nul" +input_player11_l3_btn = "nul" +input_player11_l3_axis = "nul" +input_player11_r3 = "nul" +input_player11_r3_btn = "nul" +input_player11_r3_axis = "nul" +input_player11_l_x_plus = "nul" +input_player11_l_x_plus_btn = "nul" +input_player11_l_x_plus_axis = "nul" +input_player11_l_x_minus = "nul" +input_player11_l_x_minus_btn = "nul" +input_player11_l_x_minus_axis = "nul" +input_player11_l_y_plus = "nul" +input_player11_l_y_plus_btn = "nul" +input_player11_l_y_plus_axis = "nul" +input_player11_l_y_minus = "nul" +input_player11_l_y_minus_btn = "nul" +input_player11_l_y_minus_axis = "nul" +input_player11_r_x_plus = "nul" +input_player11_r_x_plus_btn = "nul" +input_player11_r_x_plus_axis = "nul" +input_player11_r_x_minus = "nul" +input_player11_r_x_minus_btn = "nul" +input_player11_r_x_minus_axis = "nul" +input_player11_r_y_plus = "nul" +input_player11_r_y_plus_btn = "nul" +input_player11_r_y_plus_axis = "nul" +input_player11_r_y_minus = "nul" +input_player11_r_y_minus_btn = "nul" +input_player11_r_y_minus_axis = "nul" +input_player11_turbo = "nul" +input_player11_turbo_btn = "nul" +input_player11_turbo_axis = "nul" +input_player12_b = "nul" +input_player12_b_btn = "nul" +input_player12_b_axis = "nul" +input_player12_y = "nul" +input_player12_y_btn = "nul" +input_player12_y_axis = "nul" +input_player12_select = "nul" +input_player12_select_btn = "nul" +input_player12_select_axis = "nul" +input_player12_start = "nul" +input_player12_start_btn = "nul" +input_player12_start_axis = "nul" +input_player12_up = "nul" +input_player12_up_btn = "nul" +input_player12_up_axis = "nul" +input_player12_down = "nul" +input_player12_down_btn = "nul" +input_player12_down_axis = "nul" +input_player12_left = "nul" +input_player12_left_btn = "nul" +input_player12_left_axis = "nul" +input_player12_right = "nul" +input_player12_right_btn = "nul" +input_player12_right_axis = "nul" +input_player12_a = "nul" +input_player12_a_btn = "nul" +input_player12_a_axis = "nul" +input_player12_x = "nul" +input_player12_x_btn = "nul" +input_player12_x_axis = "nul" +input_player12_l = "nul" +input_player12_l_btn = "nul" +input_player12_l_axis = "nul" +input_player12_r = "nul" +input_player12_r_btn = "nul" +input_player12_r_axis = "nul" +input_player12_l2 = "nul" +input_player12_l2_btn = "nul" +input_player12_l2_axis = "nul" +input_player12_r2 = "nul" +input_player12_r2_btn = "nul" +input_player12_r2_axis = "nul" +input_player12_l3 = "nul" +input_player12_l3_btn = "nul" +input_player12_l3_axis = "nul" +input_player12_r3 = "nul" +input_player12_r3_btn = "nul" +input_player12_r3_axis = "nul" +input_player12_l_x_plus = "nul" +input_player12_l_x_plus_btn = "nul" +input_player12_l_x_plus_axis = "nul" +input_player12_l_x_minus = "nul" +input_player12_l_x_minus_btn = "nul" +input_player12_l_x_minus_axis = "nul" +input_player12_l_y_plus = "nul" +input_player12_l_y_plus_btn = "nul" +input_player12_l_y_plus_axis = "nul" +input_player12_l_y_minus = "nul" +input_player12_l_y_minus_btn = "nul" +input_player12_l_y_minus_axis = "nul" +input_player12_r_x_plus = "nul" +input_player12_r_x_plus_btn = "nul" +input_player12_r_x_plus_axis = "nul" +input_player12_r_x_minus = "nul" +input_player12_r_x_minus_btn = "nul" +input_player12_r_x_minus_axis = "nul" +input_player12_r_y_plus = "nul" +input_player12_r_y_plus_btn = "nul" +input_player12_r_y_plus_axis = "nul" +input_player12_r_y_minus = "nul" +input_player12_r_y_minus_btn = "nul" +input_player12_r_y_minus_axis = "nul" +input_player12_turbo = "nul" +input_player12_turbo_btn = "nul" +input_player12_turbo_axis = "nul" +input_player13_b = "nul" +input_player13_b_btn = "nul" +input_player13_b_axis = "nul" +input_player13_y = "nul" +input_player13_y_btn = "nul" +input_player13_y_axis = "nul" +input_player13_select = "nul" +input_player13_select_btn = "nul" +input_player13_select_axis = "nul" +input_player13_start = "nul" +input_player13_start_btn = "nul" +input_player13_start_axis = "nul" +input_player13_up = "nul" +input_player13_up_btn = "nul" +input_player13_up_axis = "nul" +input_player13_down = "nul" +input_player13_down_btn = "nul" +input_player13_down_axis = "nul" +input_player13_left = "nul" +input_player13_left_btn = "nul" +input_player13_left_axis = "nul" +input_player13_right = "nul" +input_player13_right_btn = "nul" +input_player13_right_axis = "nul" +input_player13_a = "nul" +input_player13_a_btn = "nul" +input_player13_a_axis = "nul" +input_player13_x = "nul" +input_player13_x_btn = "nul" +input_player13_x_axis = "nul" +input_player13_l = "nul" +input_player13_l_btn = "nul" +input_player13_l_axis = "nul" +input_player13_r = "nul" +input_player13_r_btn = "nul" +input_player13_r_axis = "nul" +input_player13_l2 = "nul" +input_player13_l2_btn = "nul" +input_player13_l2_axis = "nul" +input_player13_r2 = "nul" +input_player13_r2_btn = "nul" +input_player13_r2_axis = "nul" +input_player13_l3 = "nul" +input_player13_l3_btn = "nul" +input_player13_l3_axis = "nul" +input_player13_r3 = "nul" +input_player13_r3_btn = "nul" +input_player13_r3_axis = "nul" +input_player13_l_x_plus = "nul" +input_player13_l_x_plus_btn = "nul" +input_player13_l_x_plus_axis = "nul" +input_player13_l_x_minus = "nul" +input_player13_l_x_minus_btn = "nul" +input_player13_l_x_minus_axis = "nul" +input_player13_l_y_plus = "nul" +input_player13_l_y_plus_btn = "nul" +input_player13_l_y_plus_axis = "nul" +input_player13_l_y_minus = "nul" +input_player13_l_y_minus_btn = "nul" +input_player13_l_y_minus_axis = "nul" +input_player13_r_x_plus = "nul" +input_player13_r_x_plus_btn = "nul" +input_player13_r_x_plus_axis = "nul" +input_player13_r_x_minus = "nul" +input_player13_r_x_minus_btn = "nul" +input_player13_r_x_minus_axis = "nul" +input_player13_r_y_plus = "nul" +input_player13_r_y_plus_btn = "nul" +input_player13_r_y_plus_axis = "nul" +input_player13_r_y_minus = "nul" +input_player13_r_y_minus_btn = "nul" +input_player13_r_y_minus_axis = "nul" +input_player13_turbo = "nul" +input_player13_turbo_btn = "nul" +input_player13_turbo_axis = "nul" +input_player14_b = "nul" +input_player14_b_btn = "nul" +input_player14_b_axis = "nul" +input_player14_y = "nul" +input_player14_y_btn = "nul" +input_player14_y_axis = "nul" +input_player14_select = "nul" +input_player14_select_btn = "nul" +input_player14_select_axis = "nul" +input_player14_start = "nul" +input_player14_start_btn = "nul" +input_player14_start_axis = "nul" +input_player14_up = "nul" +input_player14_up_btn = "nul" +input_player14_up_axis = "nul" +input_player14_down = "nul" +input_player14_down_btn = "nul" +input_player14_down_axis = "nul" +input_player14_left = "nul" +input_player14_left_btn = "nul" +input_player14_left_axis = "nul" +input_player14_right = "nul" +input_player14_right_btn = "nul" +input_player14_right_axis = "nul" +input_player14_a = "nul" +input_player14_a_btn = "nul" +input_player14_a_axis = "nul" +input_player14_x = "nul" +input_player14_x_btn = "nul" +input_player14_x_axis = "nul" +input_player14_l = "nul" +input_player14_l_btn = "nul" +input_player14_l_axis = "nul" +input_player14_r = "nul" +input_player14_r_btn = "nul" +input_player14_r_axis = "nul" +input_player14_l2 = "nul" +input_player14_l2_btn = "nul" +input_player14_l2_axis = "nul" +input_player14_r2 = "nul" +input_player14_r2_btn = "nul" +input_player14_r2_axis = "nul" +input_player14_l3 = "nul" +input_player14_l3_btn = "nul" +input_player14_l3_axis = "nul" +input_player14_r3 = "nul" +input_player14_r3_btn = "nul" +input_player14_r3_axis = "nul" +input_player14_l_x_plus = "nul" +input_player14_l_x_plus_btn = "nul" +input_player14_l_x_plus_axis = "nul" +input_player14_l_x_minus = "nul" +input_player14_l_x_minus_btn = "nul" +input_player14_l_x_minus_axis = "nul" +input_player14_l_y_plus = "nul" +input_player14_l_y_plus_btn = "nul" +input_player14_l_y_plus_axis = "nul" +input_player14_l_y_minus = "nul" +input_player14_l_y_minus_btn = "nul" +input_player14_l_y_minus_axis = "nul" +input_player14_r_x_plus = "nul" +input_player14_r_x_plus_btn = "nul" +input_player14_r_x_plus_axis = "nul" +input_player14_r_x_minus = "nul" +input_player14_r_x_minus_btn = "nul" +input_player14_r_x_minus_axis = "nul" +input_player14_r_y_plus = "nul" +input_player14_r_y_plus_btn = "nul" +input_player14_r_y_plus_axis = "nul" +input_player14_r_y_minus = "nul" +input_player14_r_y_minus_btn = "nul" +input_player14_r_y_minus_axis = "nul" +input_player14_turbo = "nul" +input_player14_turbo_btn = "nul" +input_player14_turbo_axis = "nul" +input_player15_b = "nul" +input_player15_b_btn = "nul" +input_player15_b_axis = "nul" +input_player15_y = "nul" +input_player15_y_btn = "nul" +input_player15_y_axis = "nul" +input_player15_select = "nul" +input_player15_select_btn = "nul" +input_player15_select_axis = "nul" +input_player15_start = "nul" +input_player15_start_btn = "nul" +input_player15_start_axis = "nul" +input_player15_up = "nul" +input_player15_up_btn = "nul" +input_player15_up_axis = "nul" +input_player15_down = "nul" +input_player15_down_btn = "nul" +input_player15_down_axis = "nul" +input_player15_left = "nul" +input_player15_left_btn = "nul" +input_player15_left_axis = "nul" +input_player15_right = "nul" +input_player15_right_btn = "nul" +input_player15_right_axis = "nul" +input_player15_a = "nul" +input_player15_a_btn = "nul" +input_player15_a_axis = "nul" +input_player15_x = "nul" +input_player15_x_btn = "nul" +input_player15_x_axis = "nul" +input_player15_l = "nul" +input_player15_l_btn = "nul" +input_player15_l_axis = "nul" +input_player15_r = "nul" +input_player15_r_btn = "nul" +input_player15_r_axis = "nul" +input_player15_l2 = "nul" +input_player15_l2_btn = "nul" +input_player15_l2_axis = "nul" +input_player15_r2 = "nul" +input_player15_r2_btn = "nul" +input_player15_r2_axis = "nul" +input_player15_l3 = "nul" +input_player15_l3_btn = "nul" +input_player15_l3_axis = "nul" +input_player15_r3 = "nul" +input_player15_r3_btn = "nul" +input_player15_r3_axis = "nul" +input_player15_l_x_plus = "nul" +input_player15_l_x_plus_btn = "nul" +input_player15_l_x_plus_axis = "nul" +input_player15_l_x_minus = "nul" +input_player15_l_x_minus_btn = "nul" +input_player15_l_x_minus_axis = "nul" +input_player15_l_y_plus = "nul" +input_player15_l_y_plus_btn = "nul" +input_player15_l_y_plus_axis = "nul" +input_player15_l_y_minus = "nul" +input_player15_l_y_minus_btn = "nul" +input_player15_l_y_minus_axis = "nul" +input_player15_r_x_plus = "nul" +input_player15_r_x_plus_btn = "nul" +input_player15_r_x_plus_axis = "nul" +input_player15_r_x_minus = "nul" +input_player15_r_x_minus_btn = "nul" +input_player15_r_x_minus_axis = "nul" +input_player15_r_y_plus = "nul" +input_player15_r_y_plus_btn = "nul" +input_player15_r_y_plus_axis = "nul" +input_player15_r_y_minus = "nul" +input_player15_r_y_minus_btn = "nul" +input_player15_r_y_minus_axis = "nul" +input_player15_turbo = "nul" +input_player15_turbo_btn = "nul" +input_player15_turbo_axis = "nul" +input_player16_b = "nul" +input_player16_b_btn = "nul" +input_player16_b_axis = "nul" +input_player16_y = "nul" +input_player16_y_btn = "nul" +input_player16_y_axis = "nul" +input_player16_select = "nul" +input_player16_select_btn = "nul" +input_player16_select_axis = "nul" +input_player16_start = "nul" +input_player16_start_btn = "nul" +input_player16_start_axis = "nul" +input_player16_up = "nul" +input_player16_up_btn = "nul" +input_player16_up_axis = "nul" +input_player16_down = "nul" +input_player16_down_btn = "nul" +input_player16_down_axis = "nul" +input_player16_left = "nul" +input_player16_left_btn = "nul" +input_player16_left_axis = "nul" +input_player16_right = "nul" +input_player16_right_btn = "nul" +input_player16_right_axis = "nul" +input_player16_a = "nul" +input_player16_a_btn = "nul" +input_player16_a_axis = "nul" +input_player16_x = "nul" +input_player16_x_btn = "nul" +input_player16_x_axis = "nul" +input_player16_l = "nul" +input_player16_l_btn = "nul" +input_player16_l_axis = "nul" +input_player16_r = "nul" +input_player16_r_btn = "nul" +input_player16_r_axis = "nul" +input_player16_l2 = "nul" +input_player16_l2_btn = "nul" +input_player16_l2_axis = "nul" +input_player16_r2 = "nul" +input_player16_r2_btn = "nul" +input_player16_r2_axis = "nul" +input_player16_l3 = "nul" +input_player16_l3_btn = "nul" +input_player16_l3_axis = "nul" +input_player16_r3 = "nul" +input_player16_r3_btn = "nul" +input_player16_r3_axis = "nul" +input_player16_l_x_plus = "nul" +input_player16_l_x_plus_btn = "nul" +input_player16_l_x_plus_axis = "nul" +input_player16_l_x_minus = "nul" +input_player16_l_x_minus_btn = "nul" +input_player16_l_x_minus_axis = "nul" +input_player16_l_y_plus = "nul" +input_player16_l_y_plus_btn = "nul" +input_player16_l_y_plus_axis = "nul" +input_player16_l_y_minus = "nul" +input_player16_l_y_minus_btn = "nul" +input_player16_l_y_minus_axis = "nul" +input_player16_r_x_plus = "nul" +input_player16_r_x_plus_btn = "nul" +input_player16_r_x_plus_axis = "nul" +input_player16_r_x_minus = "nul" +input_player16_r_x_minus_btn = "nul" +input_player16_r_x_minus_axis = "nul" +input_player16_r_y_plus = "nul" +input_player16_r_y_plus_btn = "nul" +input_player16_r_y_plus_axis = "nul" +input_player16_r_y_minus = "nul" +input_player16_r_y_minus_btn = "nul" +input_player16_r_y_minus_axis = "nul" +input_player16_turbo = "nul" +input_player16_turbo_btn = "nul" +input_player16_turbo_axis = "nul" +xmb_font = "" +netplay_nickname = "" +video_filter = "" +audio_dsp_plugin = "" +netplay_ip_address = "" +recording_output_directory = "" +recording_config_directory = "" +core_options_path = "" +video_shader = "" +menu_wallpaper = "" +input_overlay = "" +video_font_path = "" +content_history_dir = "" +cache_directory = "" +resampler_directory = "" +xmb_font = "" +playlist_names = "" +playlist_cores = "" +audio_device = "" +camera_device = "" +cheevos_username = "" +cheevos_password = "" +video_context_driver = "" +input_keyboard_layout = "" +bundle_assets_src_path = "" +bundle_assets_dst_path = "" +bundle_assets_dst_path_subdir = "" diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index d2a3a44ec0..2a8fc12836 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef _MSC_VER #pragma comment( lib, "comctl32" ) @@ -121,7 +122,7 @@ static void shader_dlg_refresh_trackbar_label(int index) video_shader_driver_get_current_shader(&shader_info); - if (floorf(shader_info.data->parameters[index].current) + if (floorf(shader_info.data->parameters[index].current) == shader_info.data->parameters[index].current) snprintf(val_buffer, sizeof(val_buffer), "%.0f", shader_info.data->parameters[index].current); @@ -152,8 +153,8 @@ static void shader_dlg_params_refresh(void) { case SHADER_PARAM_CTRL_CHECKBOX: { - bool checked = - (shader_info.data->parameters[i].current == + bool checked = + (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } @@ -165,12 +166,12 @@ static void shader_dlg_params_refresh(void) TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].maximum - - shader_info.data->parameters[i].minimum) + (LPARAM)((shader_info.data->parameters[i].maximum - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].current - - shader_info.data->parameters[i].minimum) / + (LPARAM)((shader_info.data->parameters[i].current - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); break; case SHADER_PARAM_CTRL_NONE: @@ -233,21 +234,16 @@ void shader_dlg_params_reload(void) for (i = 0; i < (int)shader_info.data->num_parameters; i++) { - shader_param_ctrl_t*control = &g_shader_dlg.controls[i]; - size_t param_desc_wide_size = sizeof(shader_info.data->parameters[i].desc) * 2; - wchar_t param_desc_wide[param_desc_wide_size]; - - memset(param_desc_wide, 0, sizeof(param_desc_wide)); - MultiByteToWideChar(CP_UTF8, 0, shader_info.data->parameters[i].desc, -1, param_desc_wide, sizeof(param_desc_wide) / sizeof(param_desc_wide[0])); - + shader_param_ctrl_t *control = &g_shader_dlg.controls[i]; + CHAR_TO_WCHAR_ALLOC(shader_info.data->parameters[i].desc, param_desc_wide) if ((shader_info.data->parameters[i].minimum == 0.0) - && (shader_info.data->parameters[i].maximum - == (shader_info.data->parameters[i].minimum + && (shader_info.data->parameters[i].maximum + == (shader_info.data->parameters[i].minimum + shader_info.data->parameters[i].step))) { - if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT - + SHADER_DLG_CTRL_MARGIN + 20) + if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT + + SHADER_DLG_CTRL_MARGIN + 20) > SHADER_DLG_MAX_HEIGHT) { pos_y = g_shader_dlg.parameters_start_y; @@ -300,6 +296,8 @@ void shader_dlg_params_reload(void) } + if (param_desc_wide) + free(param_desc_wide); } if (window && g_shader_dlg.separator.hwnd) @@ -328,7 +326,7 @@ static void shader_dlg_update_on_top_state(void) bool on_top = SendMessage(g_shader_dlg.on_top_checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED; - SetWindowPos(g_shader_dlg.window.hwnd, on_top + SetWindowPos(g_shader_dlg.window.hwnd, on_top ? HWND_TOPMOST : HWND_NOTOPMOST , 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } @@ -397,10 +395,10 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; else - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum; break; @@ -415,7 +413,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; shader_dlg_refresh_trackbar_label(i); @@ -451,10 +449,10 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (!RegisterClassExW(wndclass)) return false; - /* This is non-NULL when we want a window for shader dialogs, + /* This is non-NULL when we want a window for shader dialogs, * therefore early return here */ /* TODO/FIXME - this is ugly. Find a better way */ - if (class_name != NULL) + if (class_name != NULL) return true; if (!win32_shader_dlg_init()) @@ -523,7 +521,7 @@ static bool win32_browser( const char *initial_dir) { bool result = false; - const ui_browser_window_t *browser = + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); if (browser) @@ -534,14 +532,17 @@ static bool win32_browser( browser_state.title = strdup(title); browser_state.startdir = strdup(initial_dir); browser_state.path = strdup(filename); - browser_state.window = owner; result = browser->open(&browser_state); - free(browser_state.filters); - free(browser_state.title); - free(browser_state.startdir); - free(browser_state.path); + if (browser_state.filters) + free(browser_state.filters); + if (browser_state.title) + free(browser_state.title); + if (browser_state.startdir) + free(browser_state.startdir); + if (browser_state.path) + free(browser_state.path); } return result; @@ -554,7 +555,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) bool do_wm_close = false; settings_t *settings = config_get_ptr(); - switch (mode) + switch (mode) { case ID_M_LOAD_CORE: case ID_M_LOAD_CONTENT: @@ -663,7 +664,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) signed idx = -1; settings->state_slot = idx; } - else if (mode >= (ID_M_STATE_INDEX_AUTO+1) + else if (mode >= (ID_M_STATE_INDEX_AUTO+1) && mode <= (ID_M_STATE_INDEX_AUTO+10)) { signed idx = (mode - (ID_M_STATE_INDEX_AUTO+1)); @@ -677,7 +678,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) if (do_wm_close) PostMessageW(owner, WM_CLOSE, 0, 0); - + return 0L; } diff --git a/ui/drivers/win32/ui_win32_browser_window.c b/ui/drivers/win32/ui_win32_browser_window.c index 1aeaccf0d8..25203866ce 100644 --- a/ui/drivers/win32/ui_win32_browser_window.c +++ b/ui/drivers/win32/ui_win32_browser_window.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -26,23 +27,60 @@ static bool ui_browser_window_win32_core(ui_browser_window_state_t *state, bool save) { OPENFILENAME ofn = {}; + bool success = true; +#ifdef UNICODE + size_t filters_size = (state->filters ? strlen(state->filters) : 0) + 1; + size_t path_size = strlen(state->path) + 1; + size_t title_size = strlen(state->title) + 1; + size_t startdir_size = strlen(state->startdir) + 1; - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = (HWND)state->window; + wchar_t *filters_wide = (wchar_t*)calloc(filters_size, 2); + wchar_t *path_wide = (wchar_t*)calloc(path_size, 2); + wchar_t *title_wide = (wchar_t*)calloc(title_size, 2); + wchar_t *startdir_wide = (wchar_t*)calloc(startdir_size, 2); + + if (state->filters) + MultiByteToWideChar(CP_UTF8, 0, state->filters, -1, filters_wide, filters_size); + if (state->title) + MultiByteToWideChar(CP_UTF8, 0, state->title, -1, title_wide, title_size); + if (state->path) + MultiByteToWideChar(CP_UTF8, 0, state->path, -1, path_wide, path_size); + if (state->startdir) + MultiByteToWideChar(CP_UTF8, 0, state->startdir, -1, startdir_wide, startdir_size); + + ofn.lpstrFilter = filters_wide; + ofn.lpstrFile = path_wide; + ofn.lpstrTitle = title_wide; + ofn.lpstrInitialDir = startdir_wide; +#else ofn.lpstrFilter = state->filters; ofn.lpstrFile = state->path; ofn.lpstrTitle = state->title; ofn.lpstrInitialDir = state->startdir; - ofn.lpstrDefExt = ""; +#endif + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = (HWND)state->window; + ofn.lpstrDefExt = TEXT(""); ofn.nMaxFile = PATH_MAX; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; if ( save && !GetOpenFileName(&ofn)) - return false; + success = false; if (!save && !GetSaveFileName(&ofn)) - return false; + success = false; - return true; +#ifdef UNICODE + if (filters_wide) + free(filters_wide); + if (title_wide) + free(title_wide); + if (path_wide) + free(path_wide); + if (startdir_wide) + free(startdir_wide); +#endif + + return success; } static bool ui_browser_window_win32_open(ui_browser_window_state_t *state) diff --git a/ui/drivers/win32/ui_win32_window.cpp b/ui/drivers/win32/ui_win32_window.cpp index d76866a0ba..4a14da3296 100644 --- a/ui/drivers/win32/ui_win32_window.cpp +++ b/ui/drivers/win32/ui_win32_window.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #ifdef _MSC_VER @@ -62,7 +64,7 @@ static void ui_window_win32_set_focused(void *data) SetFocus(window->hwnd); } -static void ui_window_win32_set_visible(void *data, +static void ui_window_win32_set_visible(void *data, bool set_visible) { ui_window_win32_t *window = (ui_window_win32_t*)data; @@ -72,7 +74,10 @@ static void ui_window_win32_set_visible(void *data, static void ui_window_win32_set_title(void *data, char *buf) { ui_window_win32_t *window = (ui_window_win32_t*)data; - SetWindowText(window->hwnd, buf); + CHAR_TO_WCHAR_ALLOC(buf, buf_wide) + SetWindowText(window->hwnd, buf_wide); + if (buf_wide) + free(buf_wide); } void ui_window_win32_set_droppable(void *data, bool droppable) From 5bd8c096dc2ef14f2162c97dcad364bd33e56c39 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:18:19 -0500 Subject: [PATCH 154/638] revert retroarch.cfg --- retroarch.cfg | 2410 ++++++++++++++++--------------------------------- 1 file changed, 800 insertions(+), 1610 deletions(-) diff --git a/retroarch.cfg b/retroarch.cfg index 489ff50820..7d9890a08f 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -1,1610 +1,800 @@ -video_driver = "caca" -core_updater_buildbot_url = "http://buildbot.libretro.com/nightly/win-x86_64/latest/" -core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" -libretro_directory = "cores" -libretro_info_path = "info" -content_database_path = "database\rdb" -cheat_database_path = "cheats" -content_history_path = ".\content_history.lpl" -content_music_history_path = ".\content_music_history.lpl" -content_video_history_path = ".\content_video_history.lpl" -content_image_history_path = ".\content_image_history.lpl" -cursor_directory = "database\cursors" -screenshot_directory = "default" -system_directory = "default" -input_remapping_directory = "config\remaps" -video_shader_dir = "shaders" -video_filter_dir = "filters\video" -core_assets_directory = "downloads" -assets_directory = "assets" -dynamic_wallpapers_directory = "assets\wallpapers" -thumbnails_directory = "thumbnails" -playlist_directory = "playlists" -joypad_autoconfig_dir = "autoconfig" -audio_filter_dir = "filters\audio" -savefile_directory = "default" -savestate_directory = "default" -rgui_browser_directory = "default" -rgui_config_directory = "config" -overlay_directory = "overlays" -screenshot_directory = "default" -record_driver = "null" -camera_driver = "null" -wifi_driver = "null" -location_driver = "null" -menu_driver = "xmb" -audio_driver = "xaudio" -audio_resampler = "sinc" -input_driver = "dinput" -input_joypad_driver = "xinput" -video_aspect_ratio = "-1.000000" -video_scale = "3.000000" -video_refresh_rate = "59.940060" -audio_rate_control_delta = "0.005000" -audio_max_timing_skew = "0.050000" -audio_volume = "0.000000" -input_overlay_opacity = "0.700000" -input_overlay_scale = "1.000000" -menu_wallpaper_opacity = "0.300000" -menu_footer_opacity = "1.000000" -menu_header_opacity = "1.000000" -video_message_pos_x = "0.050000" -video_message_pos_y = "0.050000" -video_font_size = "32.000000" -fastforward_ratio = "0.000000" -slowmotion_ratio = "3.000000" -input_axis_threshold = "0.500000" -input_bind_timeout = "5" -input_turbo_period = "6" -input_duty_cycle = "3" -input_max_users = "5" -input_menu_toggle_gamepad_combo = "0" -audio_latency = "64" -audio_block_frames = "0" -rewind_granularity = "1" -autosave_interval = "0" -libretro_log_level = "0" -keyboard_gamepad_mapping_type = "1" -input_poll_type_behavior = "2" -video_monitor_index = "0" -video_fullscreen_x = "0" -video_fullscreen_y = "0" -video_window_x = "0" -video_window_y = "0" -network_cmd_port = "55355" -network_remote_base_port = "55400" -dpi_override_value = "200" -menu_thumbnails = "3" -xmb_alpha_factor = "75" -xmb_scale_factor = "100" -xmb_theme = "0" -xmb_menu_color_theme = "4" -materialui_menu_color_theme = "0" -menu_shader_pipeline = "2" -audio_out_rate = "48000" -custom_viewport_width = "960" -custom_viewport_height = "720" -custom_viewport_x = "0" -custom_viewport_y = "0" -content_history_size = "100" -video_hard_sync_frames = "0" -video_frame_delay = "0" -video_max_swapchain_images = "3" -video_swap_interval = "1" -video_rotation = "0" -aspect_ratio_index = "21" -state_slot = "0" -netplay_ip_port = "0" -netplay_delay_frames = "16" -netplay_check_frames = "30" -user_language = "0" -bundle_assets_extract_version_current = "0" -bundle_assets_extract_last_version = "0" -input_device_p1 = "0" -input_player1_joypad_index = "0" -input_libretro_device_p1 = "1" -input_player1_analog_dpad_mode = "0" -input_device_p2 = "0" -input_player2_joypad_index = "1" -input_libretro_device_p2 = "1" -input_player2_analog_dpad_mode = "0" -input_device_p3 = "0" -input_player3_joypad_index = "2" -input_libretro_device_p3 = "1" -input_player3_analog_dpad_mode = "0" -input_device_p4 = "0" -input_player4_joypad_index = "3" -input_libretro_device_p4 = "1" -input_player4_analog_dpad_mode = "0" -input_device_p5 = "0" -input_player5_joypad_index = "4" -input_libretro_device_p5 = "1" -input_player5_analog_dpad_mode = "0" -input_device_p6 = "0" -input_player6_joypad_index = "5" -input_libretro_device_p6 = "1" -input_player6_analog_dpad_mode = "0" -input_device_p7 = "0" -input_player7_joypad_index = "6" -input_libretro_device_p7 = "1" -input_player7_analog_dpad_mode = "0" -input_device_p8 = "0" -input_player8_joypad_index = "7" -input_libretro_device_p8 = "1" -input_player8_analog_dpad_mode = "0" -input_device_p9 = "0" -input_player9_joypad_index = "8" -input_libretro_device_p9 = "1" -input_player9_analog_dpad_mode = "0" -input_device_p10 = "0" -input_player10_joypad_index = "9" -input_libretro_device_p10 = "1" -input_player10_analog_dpad_mode = "0" -input_device_p11 = "0" -input_player11_joypad_index = "10" -input_libretro_device_p11 = "1" -input_player11_analog_dpad_mode = "0" -input_device_p12 = "0" -input_player12_joypad_index = "11" -input_libretro_device_p12 = "1" -input_player12_analog_dpad_mode = "0" -input_device_p13 = "0" -input_player13_joypad_index = "12" -input_libretro_device_p13 = "1" -input_player13_analog_dpad_mode = "0" -input_device_p14 = "0" -input_player14_joypad_index = "13" -input_libretro_device_p14 = "1" -input_player14_analog_dpad_mode = "0" -input_device_p15 = "0" -input_player15_joypad_index = "14" -input_libretro_device_p15 = "1" -input_player15_analog_dpad_mode = "0" -input_device_p16 = "0" -input_player16_joypad_index = "15" -input_libretro_device_p16 = "1" -input_player16_analog_dpad_mode = "0" -ui_companion_start_on_boot = "true" -ui_companion_enable = "false" -video_gpu_record = "false" -input_remap_binds_enable = "true" -all_users_control_menu = "false" -menu_swap_ok_cancel_buttons = "true" -netplay_client_swap_input = "true" -input_descriptor_label_show = "true" -input_descriptor_hide_unbound = "false" -load_dummy_on_core_shutdown = "true" -check_firmware_before_loading = "false" -builtin_mediaplayer_enable = "false" -builtin_imageviewer_enable = "true" -fps_show = "false" -ui_menubar_enable = "true" -suspend_screensaver_enable = "true" -rewind_enable = "false" -audio_sync = "true" -video_shader_enable = "false" -video_aspect_ratio_auto = "false" -video_allow_rotate = "true" -video_windowed_fullscreen = "true" -video_crop_overscan = "true" -video_scale_integer = "false" -video_smooth = "true" -video_force_aspect = "true" -video_threaded = "false" -video_shared_context = "false" -custom_bgm_enable = "false" -auto_screenshot_filename = "true" -video_force_srgb_disable = "false" -video_fullscreen = "false" -bundle_assets_extract_enable = "false" -video_vsync = "true" -video_hard_sync = "false" -video_black_frame_insertion = "false" -video_disable_composition = "false" -pause_nonactive = "true" -video_gpu_screenshot = "true" -video_post_filter_record = "false" -keyboard_gamepad_enable = "true" -core_set_supports_no_game_enable = "true" -audio_enable = "true" -audio_mute_enable = "false" -location_allow = "false" -video_font_enable = "true" -core_updater_auto_extract_archive = "true" -camera_allow = "false" -threaded_data_runloop_enable = "true" -menu_throttle_framerate = "true" -menu_linear_filter = "true" -dpi_override_enable = "true" -menu_pause_libretro = "true" -menu_mouse_enable = "true" -menu_pointer_enable = "false" -menu_timedate_enable = "true" -menu_core_enable = "true" -menu_dynamic_wallpaper_enable = "false" -xmb_shadows_enable = "true" -xmb_show_settings = "true" -xmb_show_images = "true" -xmb_show_history = "true" -rgui_show_start_screen = "false" -menu_navigation_wraparound_enable = "true" -menu_navigation_browser_filter_supported_extensions_enable = "true" -menu_show_advanced_settings = "true" -cheevos_enable = "false" -cheevos_test_unofficial = "false" -cheevos_hardcore_mode_enable = "false" -input_overlay_enable = "true" -input_overlay_enable_autopreferred = "true" -input_overlay_hide_in_menu = "true" -network_cmd_enable = "false" -stdin_cmd_enable = "false" -network_remote_enable = "false" -netplay_spectator_mode_enable = "false" -netplay_nat_traversal = "true" -block_sram_overwrite = "false" -savestate_auto_index = "false" -savestate_auto_save = "false" -savestate_auto_load = "false" -savestate_thumbnail_enable = "false" -history_list_enable = "true" -game_specific_options = "false" -auto_overrides_enable = "true" -auto_remaps_enable = "true" -auto_shaders_enable = "true" -sort_savefiles_enable = "false" -sort_savestates_enable = "false" -config_save_on_exit = "true" -show_hidden_files = "true" -input_autodetect_enable = "true" -audio_rate_control = "true" -network_remote_enable_user_p1 = "false" -network_remote_enable_user_p2 = "false" -network_remote_enable_user_p3 = "false" -network_remote_enable_user_p4 = "false" -network_remote_enable_user_p5 = "false" -network_remote_enable_user_p6 = "false" -network_remote_enable_user_p7 = "false" -network_remote_enable_user_p8 = "false" -network_remote_enable_user_p9 = "false" -network_remote_enable_user_p10 = "false" -network_remote_enable_user_p11 = "false" -network_remote_enable_user_p12 = "false" -network_remote_enable_user_p13 = "false" -network_remote_enable_user_p14 = "false" -network_remote_enable_user_p15 = "false" -network_remote_enable_user_p16 = "false" -log_verbosity = "false" -perfcnt_enable = "false" -video_message_color = "ffff00" -menu_entry_normal_color = "ffffffff" -menu_entry_hover_color = "ff64ff64" -menu_title_color = "ff64ff64" -gamma_correction = "false" -flicker_filter_enable = "false" -soft_filter_enable = "false" -soft_filter_index = "0" -current_resolution_id = "0" -flicker_filter_index = "0" -input_player1_b = "z" -input_player1_b_btn = "nul" -input_player1_b_axis = "nul" -input_player1_y = "a" -input_player1_y_btn = "nul" -input_player1_y_axis = "nul" -input_player1_select = "rshift" -input_player1_select_btn = "nul" -input_player1_select_axis = "nul" -input_player1_start = "enter" -input_player1_start_btn = "nul" -input_player1_start_axis = "nul" -input_player1_up = "up" -input_player1_up_btn = "nul" -input_player1_up_axis = "nul" -input_player1_down = "down" -input_player1_down_btn = "nul" -input_player1_down_axis = "nul" -input_player1_left = "left" -input_player1_left_btn = "nul" -input_player1_left_axis = "nul" -input_player1_right = "right" -input_player1_right_btn = "nul" -input_player1_right_axis = "nul" -input_player1_a = "x" -input_player1_a_btn = "nul" -input_player1_a_axis = "nul" -input_player1_x = "s" -input_player1_x_btn = "nul" -input_player1_x_axis = "nul" -input_player1_l = "q" -input_player1_l_btn = "nul" -input_player1_l_axis = "nul" -input_player1_r = "w" -input_player1_r_btn = "nul" -input_player1_r_axis = "nul" -input_player1_l2 = "nul" -input_player1_l2_btn = "nul" -input_player1_l2_axis = "nul" -input_player1_r2 = "nul" -input_player1_r2_btn = "nul" -input_player1_r2_axis = "nul" -input_player1_l3 = "nul" -input_player1_l3_btn = "nul" -input_player1_l3_axis = "nul" -input_player1_r3 = "nul" -input_player1_r3_btn = "nul" -input_player1_r3_axis = "nul" -input_player1_l_x_plus = "nul" -input_player1_l_x_plus_btn = "nul" -input_player1_l_x_plus_axis = "nul" -input_player1_l_x_minus = "nul" -input_player1_l_x_minus_btn = "nul" -input_player1_l_x_minus_axis = "nul" -input_player1_l_y_plus = "nul" -input_player1_l_y_plus_btn = "nul" -input_player1_l_y_plus_axis = "nul" -input_player1_l_y_minus = "nul" -input_player1_l_y_minus_btn = "nul" -input_player1_l_y_minus_axis = "nul" -input_player1_r_x_plus = "nul" -input_player1_r_x_plus_btn = "nul" -input_player1_r_x_plus_axis = "nul" -input_player1_r_x_minus = "nul" -input_player1_r_x_minus_btn = "nul" -input_player1_r_x_minus_axis = "nul" -input_player1_r_y_plus = "nul" -input_player1_r_y_plus_btn = "nul" -input_player1_r_y_plus_axis = "nul" -input_player1_r_y_minus = "nul" -input_player1_r_y_minus_btn = "nul" -input_player1_r_y_minus_axis = "nul" -input_player1_turbo = "nul" -input_player1_turbo_btn = "nul" -input_player1_turbo_axis = "nul" -input_toggle_fast_forward = "space" -input_toggle_fast_forward_btn = "nul" -input_toggle_fast_forward_axis = "nul" -input_hold_fast_forward = "l" -input_hold_fast_forward_btn = "nul" -input_hold_fast_forward_axis = "nul" -input_load_state = "f4" -input_load_state_btn = "nul" -input_load_state_axis = "nul" -input_save_state = "f2" -input_save_state_btn = "nul" -input_save_state_axis = "nul" -input_toggle_fullscreen = "f" -input_toggle_fullscreen_btn = "nul" -input_toggle_fullscreen_axis = "nul" -input_exit_emulator = "escape" -input_exit_emulator_btn = "nul" -input_exit_emulator_axis = "nul" -input_state_slot_increase = "f7" -input_state_slot_increase_btn = "nul" -input_state_slot_increase_axis = "nul" -input_state_slot_decrease = "f6" -input_state_slot_decrease_btn = "nul" -input_state_slot_decrease_axis = "nul" -input_rewind = "r" -input_rewind_btn = "nul" -input_rewind_axis = "nul" -input_movie_record_toggle = "o" -input_movie_record_toggle_btn = "nul" -input_movie_record_toggle_axis = "nul" -input_pause_toggle = "p" -input_pause_toggle_btn = "nul" -input_pause_toggle_axis = "nul" -input_frame_advance = "k" -input_frame_advance_btn = "nul" -input_frame_advance_axis = "nul" -input_reset = "h" -input_reset_btn = "nul" -input_reset_axis = "nul" -input_shader_next = "m" -input_shader_next_btn = "nul" -input_shader_next_axis = "nul" -input_shader_prev = "n" -input_shader_prev_btn = "nul" -input_shader_prev_axis = "nul" -input_cheat_index_plus = "y" -input_cheat_index_plus_btn = "nul" -input_cheat_index_plus_axis = "nul" -input_cheat_index_minus = "t" -input_cheat_index_minus_btn = "nul" -input_cheat_index_minus_axis = "nul" -input_cheat_toggle = "u" -input_cheat_toggle_btn = "nul" -input_cheat_toggle_axis = "nul" -input_screenshot = "f8" -input_screenshot_btn = "nul" -input_screenshot_axis = "nul" -input_audio_mute = "f9" -input_audio_mute_btn = "nul" -input_audio_mute_axis = "nul" -input_osk_toggle = "f12" -input_osk_toggle_btn = "nul" -input_osk_toggle_axis = "nul" -input_netplay_flip_players = "i" -input_netplay_flip_players_btn = "nul" -input_netplay_flip_players_axis = "nul" -input_slowmotion = "e" -input_slowmotion_btn = "nul" -input_slowmotion_axis = "nul" -input_enable_hotkey = "nul" -input_enable_hotkey_btn = "nul" -input_enable_hotkey_axis = "nul" -input_volume_up = "add" -input_volume_up_btn = "nul" -input_volume_up_axis = "nul" -input_volume_down = "subtract" -input_volume_down_btn = "nul" -input_volume_down_axis = "nul" -input_overlay_next = "nul" -input_overlay_next_btn = "nul" -input_overlay_next_axis = "nul" -input_disk_eject_toggle = "nul" -input_disk_eject_toggle_btn = "nul" -input_disk_eject_toggle_axis = "nul" -input_disk_next = "nul" -input_disk_next_btn = "nul" -input_disk_next_axis = "nul" -input_disk_prev = "nul" -input_disk_prev_btn = "nul" -input_disk_prev_axis = "nul" -input_grab_mouse_toggle = "f11" -input_grab_mouse_toggle_btn = "nul" -input_grab_mouse_toggle_axis = "nul" -input_menu_toggle = "f1" -input_menu_toggle_btn = "nul" -input_menu_toggle_axis = "nul" -input_player2_b = "nul" -input_player2_b_btn = "nul" -input_player2_b_axis = "nul" -input_player2_y = "nul" -input_player2_y_btn = "nul" -input_player2_y_axis = "nul" -input_player2_select = "nul" -input_player2_select_btn = "nul" -input_player2_select_axis = "nul" -input_player2_start = "nul" -input_player2_start_btn = "nul" -input_player2_start_axis = "nul" -input_player2_up = "nul" -input_player2_up_btn = "nul" -input_player2_up_axis = "nul" -input_player2_down = "nul" -input_player2_down_btn = "nul" -input_player2_down_axis = "nul" -input_player2_left = "nul" -input_player2_left_btn = "nul" -input_player2_left_axis = "nul" -input_player2_right = "nul" -input_player2_right_btn = "nul" -input_player2_right_axis = "nul" -input_player2_a = "nul" -input_player2_a_btn = "nul" -input_player2_a_axis = "nul" -input_player2_x = "nul" -input_player2_x_btn = "nul" -input_player2_x_axis = "nul" -input_player2_l = "nul" -input_player2_l_btn = "nul" -input_player2_l_axis = "nul" -input_player2_r = "nul" -input_player2_r_btn = "nul" -input_player2_r_axis = "nul" -input_player2_l2 = "nul" -input_player2_l2_btn = "nul" -input_player2_l2_axis = "nul" -input_player2_r2 = "nul" -input_player2_r2_btn = "nul" -input_player2_r2_axis = "nul" -input_player2_l3 = "nul" -input_player2_l3_btn = "nul" -input_player2_l3_axis = "nul" -input_player2_r3 = "nul" -input_player2_r3_btn = "nul" -input_player2_r3_axis = "nul" -input_player2_l_x_plus = "nul" -input_player2_l_x_plus_btn = "nul" -input_player2_l_x_plus_axis = "nul" -input_player2_l_x_minus = "nul" -input_player2_l_x_minus_btn = "nul" -input_player2_l_x_minus_axis = "nul" -input_player2_l_y_plus = "nul" -input_player2_l_y_plus_btn = "nul" -input_player2_l_y_plus_axis = "nul" -input_player2_l_y_minus = "nul" -input_player2_l_y_minus_btn = "nul" -input_player2_l_y_minus_axis = "nul" -input_player2_r_x_plus = "nul" -input_player2_r_x_plus_btn = "nul" -input_player2_r_x_plus_axis = "nul" -input_player2_r_x_minus = "nul" -input_player2_r_x_minus_btn = "nul" -input_player2_r_x_minus_axis = "nul" -input_player2_r_y_plus = "nul" -input_player2_r_y_plus_btn = "nul" -input_player2_r_y_plus_axis = "nul" -input_player2_r_y_minus = "nul" -input_player2_r_y_minus_btn = "nul" -input_player2_r_y_minus_axis = "nul" -input_player2_turbo = "nul" -input_player2_turbo_btn = "nul" -input_player2_turbo_axis = "nul" -input_player3_b = "nul" -input_player3_b_btn = "nul" -input_player3_b_axis = "nul" -input_player3_y = "nul" -input_player3_y_btn = "nul" -input_player3_y_axis = "nul" -input_player3_select = "nul" -input_player3_select_btn = "nul" -input_player3_select_axis = "nul" -input_player3_start = "nul" -input_player3_start_btn = "nul" -input_player3_start_axis = "nul" -input_player3_up = "nul" -input_player3_up_btn = "nul" -input_player3_up_axis = "nul" -input_player3_down = "nul" -input_player3_down_btn = "nul" -input_player3_down_axis = "nul" -input_player3_left = "nul" -input_player3_left_btn = "nul" -input_player3_left_axis = "nul" -input_player3_right = "nul" -input_player3_right_btn = "nul" -input_player3_right_axis = "nul" -input_player3_a = "nul" -input_player3_a_btn = "nul" -input_player3_a_axis = "nul" -input_player3_x = "nul" -input_player3_x_btn = "nul" -input_player3_x_axis = "nul" -input_player3_l = "nul" -input_player3_l_btn = "nul" -input_player3_l_axis = "nul" -input_player3_r = "nul" -input_player3_r_btn = "nul" -input_player3_r_axis = "nul" -input_player3_l2 = "nul" -input_player3_l2_btn = "nul" -input_player3_l2_axis = "nul" -input_player3_r2 = "nul" -input_player3_r2_btn = "nul" -input_player3_r2_axis = "nul" -input_player3_l3 = "nul" -input_player3_l3_btn = "nul" -input_player3_l3_axis = "nul" -input_player3_r3 = "nul" -input_player3_r3_btn = "nul" -input_player3_r3_axis = "nul" -input_player3_l_x_plus = "nul" -input_player3_l_x_plus_btn = "nul" -input_player3_l_x_plus_axis = "nul" -input_player3_l_x_minus = "nul" -input_player3_l_x_minus_btn = "nul" -input_player3_l_x_minus_axis = "nul" -input_player3_l_y_plus = "nul" -input_player3_l_y_plus_btn = "nul" -input_player3_l_y_plus_axis = "nul" -input_player3_l_y_minus = "nul" -input_player3_l_y_minus_btn = "nul" -input_player3_l_y_minus_axis = "nul" -input_player3_r_x_plus = "nul" -input_player3_r_x_plus_btn = "nul" -input_player3_r_x_plus_axis = "nul" -input_player3_r_x_minus = "nul" -input_player3_r_x_minus_btn = "nul" -input_player3_r_x_minus_axis = "nul" -input_player3_r_y_plus = "nul" -input_player3_r_y_plus_btn = "nul" -input_player3_r_y_plus_axis = "nul" -input_player3_r_y_minus = "nul" -input_player3_r_y_minus_btn = "nul" -input_player3_r_y_minus_axis = "nul" -input_player3_turbo = "nul" -input_player3_turbo_btn = "nul" -input_player3_turbo_axis = "nul" -input_player4_b = "nul" -input_player4_b_btn = "nul" -input_player4_b_axis = "nul" -input_player4_y = "nul" -input_player4_y_btn = "nul" -input_player4_y_axis = "nul" -input_player4_select = "nul" -input_player4_select_btn = "nul" -input_player4_select_axis = "nul" -input_player4_start = "nul" -input_player4_start_btn = "nul" -input_player4_start_axis = "nul" -input_player4_up = "nul" -input_player4_up_btn = "nul" -input_player4_up_axis = "nul" -input_player4_down = "nul" -input_player4_down_btn = "nul" -input_player4_down_axis = "nul" -input_player4_left = "nul" -input_player4_left_btn = "nul" -input_player4_left_axis = "nul" -input_player4_right = "nul" -input_player4_right_btn = "nul" -input_player4_right_axis = "nul" -input_player4_a = "nul" -input_player4_a_btn = "nul" -input_player4_a_axis = "nul" -input_player4_x = "nul" -input_player4_x_btn = "nul" -input_player4_x_axis = "nul" -input_player4_l = "nul" -input_player4_l_btn = "nul" -input_player4_l_axis = "nul" -input_player4_r = "nul" -input_player4_r_btn = "nul" -input_player4_r_axis = "nul" -input_player4_l2 = "nul" -input_player4_l2_btn = "nul" -input_player4_l2_axis = "nul" -input_player4_r2 = "nul" -input_player4_r2_btn = "nul" -input_player4_r2_axis = "nul" -input_player4_l3 = "nul" -input_player4_l3_btn = "nul" -input_player4_l3_axis = "nul" -input_player4_r3 = "nul" -input_player4_r3_btn = "nul" -input_player4_r3_axis = "nul" -input_player4_l_x_plus = "nul" -input_player4_l_x_plus_btn = "nul" -input_player4_l_x_plus_axis = "nul" -input_player4_l_x_minus = "nul" -input_player4_l_x_minus_btn = "nul" -input_player4_l_x_minus_axis = "nul" -input_player4_l_y_plus = "nul" -input_player4_l_y_plus_btn = "nul" -input_player4_l_y_plus_axis = "nul" -input_player4_l_y_minus = "nul" -input_player4_l_y_minus_btn = "nul" -input_player4_l_y_minus_axis = "nul" -input_player4_r_x_plus = "nul" -input_player4_r_x_plus_btn = "nul" -input_player4_r_x_plus_axis = "nul" -input_player4_r_x_minus = "nul" -input_player4_r_x_minus_btn = "nul" -input_player4_r_x_minus_axis = "nul" -input_player4_r_y_plus = "nul" -input_player4_r_y_plus_btn = "nul" -input_player4_r_y_plus_axis = "nul" -input_player4_r_y_minus = "nul" -input_player4_r_y_minus_btn = "nul" -input_player4_r_y_minus_axis = "nul" -input_player4_turbo = "nul" -input_player4_turbo_btn = "nul" -input_player4_turbo_axis = "nul" -input_player5_b = "nul" -input_player5_b_btn = "nul" -input_player5_b_axis = "nul" -input_player5_y = "nul" -input_player5_y_btn = "nul" -input_player5_y_axis = "nul" -input_player5_select = "nul" -input_player5_select_btn = "nul" -input_player5_select_axis = "nul" -input_player5_start = "nul" -input_player5_start_btn = "nul" -input_player5_start_axis = "nul" -input_player5_up = "nul" -input_player5_up_btn = "nul" -input_player5_up_axis = "nul" -input_player5_down = "nul" -input_player5_down_btn = "nul" -input_player5_down_axis = "nul" -input_player5_left = "nul" -input_player5_left_btn = "nul" -input_player5_left_axis = "nul" -input_player5_right = "nul" -input_player5_right_btn = "nul" -input_player5_right_axis = "nul" -input_player5_a = "nul" -input_player5_a_btn = "nul" -input_player5_a_axis = "nul" -input_player5_x = "nul" -input_player5_x_btn = "nul" -input_player5_x_axis = "nul" -input_player5_l = "nul" -input_player5_l_btn = "nul" -input_player5_l_axis = "nul" -input_player5_r = "nul" -input_player5_r_btn = "nul" -input_player5_r_axis = "nul" -input_player5_l2 = "nul" -input_player5_l2_btn = "nul" -input_player5_l2_axis = "nul" -input_player5_r2 = "nul" -input_player5_r2_btn = "nul" -input_player5_r2_axis = "nul" -input_player5_l3 = "nul" -input_player5_l3_btn = "nul" -input_player5_l3_axis = "nul" -input_player5_r3 = "nul" -input_player5_r3_btn = "nul" -input_player5_r3_axis = "nul" -input_player5_l_x_plus = "nul" -input_player5_l_x_plus_btn = "nul" -input_player5_l_x_plus_axis = "nul" -input_player5_l_x_minus = "nul" -input_player5_l_x_minus_btn = "nul" -input_player5_l_x_minus_axis = "nul" -input_player5_l_y_plus = "nul" -input_player5_l_y_plus_btn = "nul" -input_player5_l_y_plus_axis = "nul" -input_player5_l_y_minus = "nul" -input_player5_l_y_minus_btn = "nul" -input_player5_l_y_minus_axis = "nul" -input_player5_r_x_plus = "nul" -input_player5_r_x_plus_btn = "nul" -input_player5_r_x_plus_axis = "nul" -input_player5_r_x_minus = "nul" -input_player5_r_x_minus_btn = "nul" -input_player5_r_x_minus_axis = "nul" -input_player5_r_y_plus = "nul" -input_player5_r_y_plus_btn = "nul" -input_player5_r_y_plus_axis = "nul" -input_player5_r_y_minus = "nul" -input_player5_r_y_minus_btn = "nul" -input_player5_r_y_minus_axis = "nul" -input_player5_turbo = "nul" -input_player5_turbo_btn = "nul" -input_player5_turbo_axis = "nul" -input_player6_b = "nul" -input_player6_b_btn = "nul" -input_player6_b_axis = "nul" -input_player6_y = "nul" -input_player6_y_btn = "nul" -input_player6_y_axis = "nul" -input_player6_select = "nul" -input_player6_select_btn = "nul" -input_player6_select_axis = "nul" -input_player6_start = "nul" -input_player6_start_btn = "nul" -input_player6_start_axis = "nul" -input_player6_up = "nul" -input_player6_up_btn = "nul" -input_player6_up_axis = "nul" -input_player6_down = "nul" -input_player6_down_btn = "nul" -input_player6_down_axis = "nul" -input_player6_left = "nul" -input_player6_left_btn = "nul" -input_player6_left_axis = "nul" -input_player6_right = "nul" -input_player6_right_btn = "nul" -input_player6_right_axis = "nul" -input_player6_a = "nul" -input_player6_a_btn = "nul" -input_player6_a_axis = "nul" -input_player6_x = "nul" -input_player6_x_btn = "nul" -input_player6_x_axis = "nul" -input_player6_l = "nul" -input_player6_l_btn = "nul" -input_player6_l_axis = "nul" -input_player6_r = "nul" -input_player6_r_btn = "nul" -input_player6_r_axis = "nul" -input_player6_l2 = "nul" -input_player6_l2_btn = "nul" -input_player6_l2_axis = "nul" -input_player6_r2 = "nul" -input_player6_r2_btn = "nul" -input_player6_r2_axis = "nul" -input_player6_l3 = "nul" -input_player6_l3_btn = "nul" -input_player6_l3_axis = "nul" -input_player6_r3 = "nul" -input_player6_r3_btn = "nul" -input_player6_r3_axis = "nul" -input_player6_l_x_plus = "nul" -input_player6_l_x_plus_btn = "nul" -input_player6_l_x_plus_axis = "nul" -input_player6_l_x_minus = "nul" -input_player6_l_x_minus_btn = "nul" -input_player6_l_x_minus_axis = "nul" -input_player6_l_y_plus = "nul" -input_player6_l_y_plus_btn = "nul" -input_player6_l_y_plus_axis = "nul" -input_player6_l_y_minus = "nul" -input_player6_l_y_minus_btn = "nul" -input_player6_l_y_minus_axis = "nul" -input_player6_r_x_plus = "nul" -input_player6_r_x_plus_btn = "nul" -input_player6_r_x_plus_axis = "nul" -input_player6_r_x_minus = "nul" -input_player6_r_x_minus_btn = "nul" -input_player6_r_x_minus_axis = "nul" -input_player6_r_y_plus = "nul" -input_player6_r_y_plus_btn = "nul" -input_player6_r_y_plus_axis = "nul" -input_player6_r_y_minus = "nul" -input_player6_r_y_minus_btn = "nul" -input_player6_r_y_minus_axis = "nul" -input_player6_turbo = "nul" -input_player6_turbo_btn = "nul" -input_player6_turbo_axis = "nul" -input_player7_b = "nul" -input_player7_b_btn = "nul" -input_player7_b_axis = "nul" -input_player7_y = "nul" -input_player7_y_btn = "nul" -input_player7_y_axis = "nul" -input_player7_select = "nul" -input_player7_select_btn = "nul" -input_player7_select_axis = "nul" -input_player7_start = "nul" -input_player7_start_btn = "nul" -input_player7_start_axis = "nul" -input_player7_up = "nul" -input_player7_up_btn = "nul" -input_player7_up_axis = "nul" -input_player7_down = "nul" -input_player7_down_btn = "nul" -input_player7_down_axis = "nul" -input_player7_left = "nul" -input_player7_left_btn = "nul" -input_player7_left_axis = "nul" -input_player7_right = "nul" -input_player7_right_btn = "nul" -input_player7_right_axis = "nul" -input_player7_a = "nul" -input_player7_a_btn = "nul" -input_player7_a_axis = "nul" -input_player7_x = "nul" -input_player7_x_btn = "nul" -input_player7_x_axis = "nul" -input_player7_l = "nul" -input_player7_l_btn = "nul" -input_player7_l_axis = "nul" -input_player7_r = "nul" -input_player7_r_btn = "nul" -input_player7_r_axis = "nul" -input_player7_l2 = "nul" -input_player7_l2_btn = "nul" -input_player7_l2_axis = "nul" -input_player7_r2 = "nul" -input_player7_r2_btn = "nul" -input_player7_r2_axis = "nul" -input_player7_l3 = "nul" -input_player7_l3_btn = "nul" -input_player7_l3_axis = "nul" -input_player7_r3 = "nul" -input_player7_r3_btn = "nul" -input_player7_r3_axis = "nul" -input_player7_l_x_plus = "nul" -input_player7_l_x_plus_btn = "nul" -input_player7_l_x_plus_axis = "nul" -input_player7_l_x_minus = "nul" -input_player7_l_x_minus_btn = "nul" -input_player7_l_x_minus_axis = "nul" -input_player7_l_y_plus = "nul" -input_player7_l_y_plus_btn = "nul" -input_player7_l_y_plus_axis = "nul" -input_player7_l_y_minus = "nul" -input_player7_l_y_minus_btn = "nul" -input_player7_l_y_minus_axis = "nul" -input_player7_r_x_plus = "nul" -input_player7_r_x_plus_btn = "nul" -input_player7_r_x_plus_axis = "nul" -input_player7_r_x_minus = "nul" -input_player7_r_x_minus_btn = "nul" -input_player7_r_x_minus_axis = "nul" -input_player7_r_y_plus = "nul" -input_player7_r_y_plus_btn = "nul" -input_player7_r_y_plus_axis = "nul" -input_player7_r_y_minus = "nul" -input_player7_r_y_minus_btn = "nul" -input_player7_r_y_minus_axis = "nul" -input_player7_turbo = "nul" -input_player7_turbo_btn = "nul" -input_player7_turbo_axis = "nul" -input_player8_b = "nul" -input_player8_b_btn = "nul" -input_player8_b_axis = "nul" -input_player8_y = "nul" -input_player8_y_btn = "nul" -input_player8_y_axis = "nul" -input_player8_select = "nul" -input_player8_select_btn = "nul" -input_player8_select_axis = "nul" -input_player8_start = "nul" -input_player8_start_btn = "nul" -input_player8_start_axis = "nul" -input_player8_up = "nul" -input_player8_up_btn = "nul" -input_player8_up_axis = "nul" -input_player8_down = "nul" -input_player8_down_btn = "nul" -input_player8_down_axis = "nul" -input_player8_left = "nul" -input_player8_left_btn = "nul" -input_player8_left_axis = "nul" -input_player8_right = "nul" -input_player8_right_btn = "nul" -input_player8_right_axis = "nul" -input_player8_a = "nul" -input_player8_a_btn = "nul" -input_player8_a_axis = "nul" -input_player8_x = "nul" -input_player8_x_btn = "nul" -input_player8_x_axis = "nul" -input_player8_l = "nul" -input_player8_l_btn = "nul" -input_player8_l_axis = "nul" -input_player8_r = "nul" -input_player8_r_btn = "nul" -input_player8_r_axis = "nul" -input_player8_l2 = "nul" -input_player8_l2_btn = "nul" -input_player8_l2_axis = "nul" -input_player8_r2 = "nul" -input_player8_r2_btn = "nul" -input_player8_r2_axis = "nul" -input_player8_l3 = "nul" -input_player8_l3_btn = "nul" -input_player8_l3_axis = "nul" -input_player8_r3 = "nul" -input_player8_r3_btn = "nul" -input_player8_r3_axis = "nul" -input_player8_l_x_plus = "nul" -input_player8_l_x_plus_btn = "nul" -input_player8_l_x_plus_axis = "nul" -input_player8_l_x_minus = "nul" -input_player8_l_x_minus_btn = "nul" -input_player8_l_x_minus_axis = "nul" -input_player8_l_y_plus = "nul" -input_player8_l_y_plus_btn = "nul" -input_player8_l_y_plus_axis = "nul" -input_player8_l_y_minus = "nul" -input_player8_l_y_minus_btn = "nul" -input_player8_l_y_minus_axis = "nul" -input_player8_r_x_plus = "nul" -input_player8_r_x_plus_btn = "nul" -input_player8_r_x_plus_axis = "nul" -input_player8_r_x_minus = "nul" -input_player8_r_x_minus_btn = "nul" -input_player8_r_x_minus_axis = "nul" -input_player8_r_y_plus = "nul" -input_player8_r_y_plus_btn = "nul" -input_player8_r_y_plus_axis = "nul" -input_player8_r_y_minus = "nul" -input_player8_r_y_minus_btn = "nul" -input_player8_r_y_minus_axis = "nul" -input_player8_turbo = "nul" -input_player8_turbo_btn = "nul" -input_player8_turbo_axis = "nul" -input_player9_b = "nul" -input_player9_b_btn = "nul" -input_player9_b_axis = "nul" -input_player9_y = "nul" -input_player9_y_btn = "nul" -input_player9_y_axis = "nul" -input_player9_select = "nul" -input_player9_select_btn = "nul" -input_player9_select_axis = "nul" -input_player9_start = "nul" -input_player9_start_btn = "nul" -input_player9_start_axis = "nul" -input_player9_up = "nul" -input_player9_up_btn = "nul" -input_player9_up_axis = "nul" -input_player9_down = "nul" -input_player9_down_btn = "nul" -input_player9_down_axis = "nul" -input_player9_left = "nul" -input_player9_left_btn = "nul" -input_player9_left_axis = "nul" -input_player9_right = "nul" -input_player9_right_btn = "nul" -input_player9_right_axis = "nul" -input_player9_a = "nul" -input_player9_a_btn = "nul" -input_player9_a_axis = "nul" -input_player9_x = "nul" -input_player9_x_btn = "nul" -input_player9_x_axis = "nul" -input_player9_l = "nul" -input_player9_l_btn = "nul" -input_player9_l_axis = "nul" -input_player9_r = "nul" -input_player9_r_btn = "nul" -input_player9_r_axis = "nul" -input_player9_l2 = "nul" -input_player9_l2_btn = "nul" -input_player9_l2_axis = "nul" -input_player9_r2 = "nul" -input_player9_r2_btn = "nul" -input_player9_r2_axis = "nul" -input_player9_l3 = "nul" -input_player9_l3_btn = "nul" -input_player9_l3_axis = "nul" -input_player9_r3 = "nul" -input_player9_r3_btn = "nul" -input_player9_r3_axis = "nul" -input_player9_l_x_plus = "nul" -input_player9_l_x_plus_btn = "nul" -input_player9_l_x_plus_axis = "nul" -input_player9_l_x_minus = "nul" -input_player9_l_x_minus_btn = "nul" -input_player9_l_x_minus_axis = "nul" -input_player9_l_y_plus = "nul" -input_player9_l_y_plus_btn = "nul" -input_player9_l_y_plus_axis = "nul" -input_player9_l_y_minus = "nul" -input_player9_l_y_minus_btn = "nul" -input_player9_l_y_minus_axis = "nul" -input_player9_r_x_plus = "nul" -input_player9_r_x_plus_btn = "nul" -input_player9_r_x_plus_axis = "nul" -input_player9_r_x_minus = "nul" -input_player9_r_x_minus_btn = "nul" -input_player9_r_x_minus_axis = "nul" -input_player9_r_y_plus = "nul" -input_player9_r_y_plus_btn = "nul" -input_player9_r_y_plus_axis = "nul" -input_player9_r_y_minus = "nul" -input_player9_r_y_minus_btn = "nul" -input_player9_r_y_minus_axis = "nul" -input_player9_turbo = "nul" -input_player9_turbo_btn = "nul" -input_player9_turbo_axis = "nul" -input_player10_b = "nul" -input_player10_b_btn = "nul" -input_player10_b_axis = "nul" -input_player10_y = "nul" -input_player10_y_btn = "nul" -input_player10_y_axis = "nul" -input_player10_select = "nul" -input_player10_select_btn = "nul" -input_player10_select_axis = "nul" -input_player10_start = "nul" -input_player10_start_btn = "nul" -input_player10_start_axis = "nul" -input_player10_up = "nul" -input_player10_up_btn = "nul" -input_player10_up_axis = "nul" -input_player10_down = "nul" -input_player10_down_btn = "nul" -input_player10_down_axis = "nul" -input_player10_left = "nul" -input_player10_left_btn = "nul" -input_player10_left_axis = "nul" -input_player10_right = "nul" -input_player10_right_btn = "nul" -input_player10_right_axis = "nul" -input_player10_a = "nul" -input_player10_a_btn = "nul" -input_player10_a_axis = "nul" -input_player10_x = "nul" -input_player10_x_btn = "nul" -input_player10_x_axis = "nul" -input_player10_l = "nul" -input_player10_l_btn = "nul" -input_player10_l_axis = "nul" -input_player10_r = "nul" -input_player10_r_btn = "nul" -input_player10_r_axis = "nul" -input_player10_l2 = "nul" -input_player10_l2_btn = "nul" -input_player10_l2_axis = "nul" -input_player10_r2 = "nul" -input_player10_r2_btn = "nul" -input_player10_r2_axis = "nul" -input_player10_l3 = "nul" -input_player10_l3_btn = "nul" -input_player10_l3_axis = "nul" -input_player10_r3 = "nul" -input_player10_r3_btn = "nul" -input_player10_r3_axis = "nul" -input_player10_l_x_plus = "nul" -input_player10_l_x_plus_btn = "nul" -input_player10_l_x_plus_axis = "nul" -input_player10_l_x_minus = "nul" -input_player10_l_x_minus_btn = "nul" -input_player10_l_x_minus_axis = "nul" -input_player10_l_y_plus = "nul" -input_player10_l_y_plus_btn = "nul" -input_player10_l_y_plus_axis = "nul" -input_player10_l_y_minus = "nul" -input_player10_l_y_minus_btn = "nul" -input_player10_l_y_minus_axis = "nul" -input_player10_r_x_plus = "nul" -input_player10_r_x_plus_btn = "nul" -input_player10_r_x_plus_axis = "nul" -input_player10_r_x_minus = "nul" -input_player10_r_x_minus_btn = "nul" -input_player10_r_x_minus_axis = "nul" -input_player10_r_y_plus = "nul" -input_player10_r_y_plus_btn = "nul" -input_player10_r_y_plus_axis = "nul" -input_player10_r_y_minus = "nul" -input_player10_r_y_minus_btn = "nul" -input_player10_r_y_minus_axis = "nul" -input_player10_turbo = "nul" -input_player10_turbo_btn = "nul" -input_player10_turbo_axis = "nul" -input_player11_b = "nul" -input_player11_b_btn = "nul" -input_player11_b_axis = "nul" -input_player11_y = "nul" -input_player11_y_btn = "nul" -input_player11_y_axis = "nul" -input_player11_select = "nul" -input_player11_select_btn = "nul" -input_player11_select_axis = "nul" -input_player11_start = "nul" -input_player11_start_btn = "nul" -input_player11_start_axis = "nul" -input_player11_up = "nul" -input_player11_up_btn = "nul" -input_player11_up_axis = "nul" -input_player11_down = "nul" -input_player11_down_btn = "nul" -input_player11_down_axis = "nul" -input_player11_left = "nul" -input_player11_left_btn = "nul" -input_player11_left_axis = "nul" -input_player11_right = "nul" -input_player11_right_btn = "nul" -input_player11_right_axis = "nul" -input_player11_a = "nul" -input_player11_a_btn = "nul" -input_player11_a_axis = "nul" -input_player11_x = "nul" -input_player11_x_btn = "nul" -input_player11_x_axis = "nul" -input_player11_l = "nul" -input_player11_l_btn = "nul" -input_player11_l_axis = "nul" -input_player11_r = "nul" -input_player11_r_btn = "nul" -input_player11_r_axis = "nul" -input_player11_l2 = "nul" -input_player11_l2_btn = "nul" -input_player11_l2_axis = "nul" -input_player11_r2 = "nul" -input_player11_r2_btn = "nul" -input_player11_r2_axis = "nul" -input_player11_l3 = "nul" -input_player11_l3_btn = "nul" -input_player11_l3_axis = "nul" -input_player11_r3 = "nul" -input_player11_r3_btn = "nul" -input_player11_r3_axis = "nul" -input_player11_l_x_plus = "nul" -input_player11_l_x_plus_btn = "nul" -input_player11_l_x_plus_axis = "nul" -input_player11_l_x_minus = "nul" -input_player11_l_x_minus_btn = "nul" -input_player11_l_x_minus_axis = "nul" -input_player11_l_y_plus = "nul" -input_player11_l_y_plus_btn = "nul" -input_player11_l_y_plus_axis = "nul" -input_player11_l_y_minus = "nul" -input_player11_l_y_minus_btn = "nul" -input_player11_l_y_minus_axis = "nul" -input_player11_r_x_plus = "nul" -input_player11_r_x_plus_btn = "nul" -input_player11_r_x_plus_axis = "nul" -input_player11_r_x_minus = "nul" -input_player11_r_x_minus_btn = "nul" -input_player11_r_x_minus_axis = "nul" -input_player11_r_y_plus = "nul" -input_player11_r_y_plus_btn = "nul" -input_player11_r_y_plus_axis = "nul" -input_player11_r_y_minus = "nul" -input_player11_r_y_minus_btn = "nul" -input_player11_r_y_minus_axis = "nul" -input_player11_turbo = "nul" -input_player11_turbo_btn = "nul" -input_player11_turbo_axis = "nul" -input_player12_b = "nul" -input_player12_b_btn = "nul" -input_player12_b_axis = "nul" -input_player12_y = "nul" -input_player12_y_btn = "nul" -input_player12_y_axis = "nul" -input_player12_select = "nul" -input_player12_select_btn = "nul" -input_player12_select_axis = "nul" -input_player12_start = "nul" -input_player12_start_btn = "nul" -input_player12_start_axis = "nul" -input_player12_up = "nul" -input_player12_up_btn = "nul" -input_player12_up_axis = "nul" -input_player12_down = "nul" -input_player12_down_btn = "nul" -input_player12_down_axis = "nul" -input_player12_left = "nul" -input_player12_left_btn = "nul" -input_player12_left_axis = "nul" -input_player12_right = "nul" -input_player12_right_btn = "nul" -input_player12_right_axis = "nul" -input_player12_a = "nul" -input_player12_a_btn = "nul" -input_player12_a_axis = "nul" -input_player12_x = "nul" -input_player12_x_btn = "nul" -input_player12_x_axis = "nul" -input_player12_l = "nul" -input_player12_l_btn = "nul" -input_player12_l_axis = "nul" -input_player12_r = "nul" -input_player12_r_btn = "nul" -input_player12_r_axis = "nul" -input_player12_l2 = "nul" -input_player12_l2_btn = "nul" -input_player12_l2_axis = "nul" -input_player12_r2 = "nul" -input_player12_r2_btn = "nul" -input_player12_r2_axis = "nul" -input_player12_l3 = "nul" -input_player12_l3_btn = "nul" -input_player12_l3_axis = "nul" -input_player12_r3 = "nul" -input_player12_r3_btn = "nul" -input_player12_r3_axis = "nul" -input_player12_l_x_plus = "nul" -input_player12_l_x_plus_btn = "nul" -input_player12_l_x_plus_axis = "nul" -input_player12_l_x_minus = "nul" -input_player12_l_x_minus_btn = "nul" -input_player12_l_x_minus_axis = "nul" -input_player12_l_y_plus = "nul" -input_player12_l_y_plus_btn = "nul" -input_player12_l_y_plus_axis = "nul" -input_player12_l_y_minus = "nul" -input_player12_l_y_minus_btn = "nul" -input_player12_l_y_minus_axis = "nul" -input_player12_r_x_plus = "nul" -input_player12_r_x_plus_btn = "nul" -input_player12_r_x_plus_axis = "nul" -input_player12_r_x_minus = "nul" -input_player12_r_x_minus_btn = "nul" -input_player12_r_x_minus_axis = "nul" -input_player12_r_y_plus = "nul" -input_player12_r_y_plus_btn = "nul" -input_player12_r_y_plus_axis = "nul" -input_player12_r_y_minus = "nul" -input_player12_r_y_minus_btn = "nul" -input_player12_r_y_minus_axis = "nul" -input_player12_turbo = "nul" -input_player12_turbo_btn = "nul" -input_player12_turbo_axis = "nul" -input_player13_b = "nul" -input_player13_b_btn = "nul" -input_player13_b_axis = "nul" -input_player13_y = "nul" -input_player13_y_btn = "nul" -input_player13_y_axis = "nul" -input_player13_select = "nul" -input_player13_select_btn = "nul" -input_player13_select_axis = "nul" -input_player13_start = "nul" -input_player13_start_btn = "nul" -input_player13_start_axis = "nul" -input_player13_up = "nul" -input_player13_up_btn = "nul" -input_player13_up_axis = "nul" -input_player13_down = "nul" -input_player13_down_btn = "nul" -input_player13_down_axis = "nul" -input_player13_left = "nul" -input_player13_left_btn = "nul" -input_player13_left_axis = "nul" -input_player13_right = "nul" -input_player13_right_btn = "nul" -input_player13_right_axis = "nul" -input_player13_a = "nul" -input_player13_a_btn = "nul" -input_player13_a_axis = "nul" -input_player13_x = "nul" -input_player13_x_btn = "nul" -input_player13_x_axis = "nul" -input_player13_l = "nul" -input_player13_l_btn = "nul" -input_player13_l_axis = "nul" -input_player13_r = "nul" -input_player13_r_btn = "nul" -input_player13_r_axis = "nul" -input_player13_l2 = "nul" -input_player13_l2_btn = "nul" -input_player13_l2_axis = "nul" -input_player13_r2 = "nul" -input_player13_r2_btn = "nul" -input_player13_r2_axis = "nul" -input_player13_l3 = "nul" -input_player13_l3_btn = "nul" -input_player13_l3_axis = "nul" -input_player13_r3 = "nul" -input_player13_r3_btn = "nul" -input_player13_r3_axis = "nul" -input_player13_l_x_plus = "nul" -input_player13_l_x_plus_btn = "nul" -input_player13_l_x_plus_axis = "nul" -input_player13_l_x_minus = "nul" -input_player13_l_x_minus_btn = "nul" -input_player13_l_x_minus_axis = "nul" -input_player13_l_y_plus = "nul" -input_player13_l_y_plus_btn = "nul" -input_player13_l_y_plus_axis = "nul" -input_player13_l_y_minus = "nul" -input_player13_l_y_minus_btn = "nul" -input_player13_l_y_minus_axis = "nul" -input_player13_r_x_plus = "nul" -input_player13_r_x_plus_btn = "nul" -input_player13_r_x_plus_axis = "nul" -input_player13_r_x_minus = "nul" -input_player13_r_x_minus_btn = "nul" -input_player13_r_x_minus_axis = "nul" -input_player13_r_y_plus = "nul" -input_player13_r_y_plus_btn = "nul" -input_player13_r_y_plus_axis = "nul" -input_player13_r_y_minus = "nul" -input_player13_r_y_minus_btn = "nul" -input_player13_r_y_minus_axis = "nul" -input_player13_turbo = "nul" -input_player13_turbo_btn = "nul" -input_player13_turbo_axis = "nul" -input_player14_b = "nul" -input_player14_b_btn = "nul" -input_player14_b_axis = "nul" -input_player14_y = "nul" -input_player14_y_btn = "nul" -input_player14_y_axis = "nul" -input_player14_select = "nul" -input_player14_select_btn = "nul" -input_player14_select_axis = "nul" -input_player14_start = "nul" -input_player14_start_btn = "nul" -input_player14_start_axis = "nul" -input_player14_up = "nul" -input_player14_up_btn = "nul" -input_player14_up_axis = "nul" -input_player14_down = "nul" -input_player14_down_btn = "nul" -input_player14_down_axis = "nul" -input_player14_left = "nul" -input_player14_left_btn = "nul" -input_player14_left_axis = "nul" -input_player14_right = "nul" -input_player14_right_btn = "nul" -input_player14_right_axis = "nul" -input_player14_a = "nul" -input_player14_a_btn = "nul" -input_player14_a_axis = "nul" -input_player14_x = "nul" -input_player14_x_btn = "nul" -input_player14_x_axis = "nul" -input_player14_l = "nul" -input_player14_l_btn = "nul" -input_player14_l_axis = "nul" -input_player14_r = "nul" -input_player14_r_btn = "nul" -input_player14_r_axis = "nul" -input_player14_l2 = "nul" -input_player14_l2_btn = "nul" -input_player14_l2_axis = "nul" -input_player14_r2 = "nul" -input_player14_r2_btn = "nul" -input_player14_r2_axis = "nul" -input_player14_l3 = "nul" -input_player14_l3_btn = "nul" -input_player14_l3_axis = "nul" -input_player14_r3 = "nul" -input_player14_r3_btn = "nul" -input_player14_r3_axis = "nul" -input_player14_l_x_plus = "nul" -input_player14_l_x_plus_btn = "nul" -input_player14_l_x_plus_axis = "nul" -input_player14_l_x_minus = "nul" -input_player14_l_x_minus_btn = "nul" -input_player14_l_x_minus_axis = "nul" -input_player14_l_y_plus = "nul" -input_player14_l_y_plus_btn = "nul" -input_player14_l_y_plus_axis = "nul" -input_player14_l_y_minus = "nul" -input_player14_l_y_minus_btn = "nul" -input_player14_l_y_minus_axis = "nul" -input_player14_r_x_plus = "nul" -input_player14_r_x_plus_btn = "nul" -input_player14_r_x_plus_axis = "nul" -input_player14_r_x_minus = "nul" -input_player14_r_x_minus_btn = "nul" -input_player14_r_x_minus_axis = "nul" -input_player14_r_y_plus = "nul" -input_player14_r_y_plus_btn = "nul" -input_player14_r_y_plus_axis = "nul" -input_player14_r_y_minus = "nul" -input_player14_r_y_minus_btn = "nul" -input_player14_r_y_minus_axis = "nul" -input_player14_turbo = "nul" -input_player14_turbo_btn = "nul" -input_player14_turbo_axis = "nul" -input_player15_b = "nul" -input_player15_b_btn = "nul" -input_player15_b_axis = "nul" -input_player15_y = "nul" -input_player15_y_btn = "nul" -input_player15_y_axis = "nul" -input_player15_select = "nul" -input_player15_select_btn = "nul" -input_player15_select_axis = "nul" -input_player15_start = "nul" -input_player15_start_btn = "nul" -input_player15_start_axis = "nul" -input_player15_up = "nul" -input_player15_up_btn = "nul" -input_player15_up_axis = "nul" -input_player15_down = "nul" -input_player15_down_btn = "nul" -input_player15_down_axis = "nul" -input_player15_left = "nul" -input_player15_left_btn = "nul" -input_player15_left_axis = "nul" -input_player15_right = "nul" -input_player15_right_btn = "nul" -input_player15_right_axis = "nul" -input_player15_a = "nul" -input_player15_a_btn = "nul" -input_player15_a_axis = "nul" -input_player15_x = "nul" -input_player15_x_btn = "nul" -input_player15_x_axis = "nul" -input_player15_l = "nul" -input_player15_l_btn = "nul" -input_player15_l_axis = "nul" -input_player15_r = "nul" -input_player15_r_btn = "nul" -input_player15_r_axis = "nul" -input_player15_l2 = "nul" -input_player15_l2_btn = "nul" -input_player15_l2_axis = "nul" -input_player15_r2 = "nul" -input_player15_r2_btn = "nul" -input_player15_r2_axis = "nul" -input_player15_l3 = "nul" -input_player15_l3_btn = "nul" -input_player15_l3_axis = "nul" -input_player15_r3 = "nul" -input_player15_r3_btn = "nul" -input_player15_r3_axis = "nul" -input_player15_l_x_plus = "nul" -input_player15_l_x_plus_btn = "nul" -input_player15_l_x_plus_axis = "nul" -input_player15_l_x_minus = "nul" -input_player15_l_x_minus_btn = "nul" -input_player15_l_x_minus_axis = "nul" -input_player15_l_y_plus = "nul" -input_player15_l_y_plus_btn = "nul" -input_player15_l_y_plus_axis = "nul" -input_player15_l_y_minus = "nul" -input_player15_l_y_minus_btn = "nul" -input_player15_l_y_minus_axis = "nul" -input_player15_r_x_plus = "nul" -input_player15_r_x_plus_btn = "nul" -input_player15_r_x_plus_axis = "nul" -input_player15_r_x_minus = "nul" -input_player15_r_x_minus_btn = "nul" -input_player15_r_x_minus_axis = "nul" -input_player15_r_y_plus = "nul" -input_player15_r_y_plus_btn = "nul" -input_player15_r_y_plus_axis = "nul" -input_player15_r_y_minus = "nul" -input_player15_r_y_minus_btn = "nul" -input_player15_r_y_minus_axis = "nul" -input_player15_turbo = "nul" -input_player15_turbo_btn = "nul" -input_player15_turbo_axis = "nul" -input_player16_b = "nul" -input_player16_b_btn = "nul" -input_player16_b_axis = "nul" -input_player16_y = "nul" -input_player16_y_btn = "nul" -input_player16_y_axis = "nul" -input_player16_select = "nul" -input_player16_select_btn = "nul" -input_player16_select_axis = "nul" -input_player16_start = "nul" -input_player16_start_btn = "nul" -input_player16_start_axis = "nul" -input_player16_up = "nul" -input_player16_up_btn = "nul" -input_player16_up_axis = "nul" -input_player16_down = "nul" -input_player16_down_btn = "nul" -input_player16_down_axis = "nul" -input_player16_left = "nul" -input_player16_left_btn = "nul" -input_player16_left_axis = "nul" -input_player16_right = "nul" -input_player16_right_btn = "nul" -input_player16_right_axis = "nul" -input_player16_a = "nul" -input_player16_a_btn = "nul" -input_player16_a_axis = "nul" -input_player16_x = "nul" -input_player16_x_btn = "nul" -input_player16_x_axis = "nul" -input_player16_l = "nul" -input_player16_l_btn = "nul" -input_player16_l_axis = "nul" -input_player16_r = "nul" -input_player16_r_btn = "nul" -input_player16_r_axis = "nul" -input_player16_l2 = "nul" -input_player16_l2_btn = "nul" -input_player16_l2_axis = "nul" -input_player16_r2 = "nul" -input_player16_r2_btn = "nul" -input_player16_r2_axis = "nul" -input_player16_l3 = "nul" -input_player16_l3_btn = "nul" -input_player16_l3_axis = "nul" -input_player16_r3 = "nul" -input_player16_r3_btn = "nul" -input_player16_r3_axis = "nul" -input_player16_l_x_plus = "nul" -input_player16_l_x_plus_btn = "nul" -input_player16_l_x_plus_axis = "nul" -input_player16_l_x_minus = "nul" -input_player16_l_x_minus_btn = "nul" -input_player16_l_x_minus_axis = "nul" -input_player16_l_y_plus = "nul" -input_player16_l_y_plus_btn = "nul" -input_player16_l_y_plus_axis = "nul" -input_player16_l_y_minus = "nul" -input_player16_l_y_minus_btn = "nul" -input_player16_l_y_minus_axis = "nul" -input_player16_r_x_plus = "nul" -input_player16_r_x_plus_btn = "nul" -input_player16_r_x_plus_axis = "nul" -input_player16_r_x_minus = "nul" -input_player16_r_x_minus_btn = "nul" -input_player16_r_x_minus_axis = "nul" -input_player16_r_y_plus = "nul" -input_player16_r_y_plus_btn = "nul" -input_player16_r_y_plus_axis = "nul" -input_player16_r_y_minus = "nul" -input_player16_r_y_minus_btn = "nul" -input_player16_r_y_minus_axis = "nul" -input_player16_turbo = "nul" -input_player16_turbo_btn = "nul" -input_player16_turbo_axis = "nul" -xmb_font = "" -netplay_nickname = "" -video_filter = "" -audio_dsp_plugin = "" -netplay_ip_address = "" -recording_output_directory = "" -recording_config_directory = "" -core_options_path = "" -video_shader = "" -menu_wallpaper = "" -input_overlay = "" -video_font_path = "" -content_history_dir = "" -cache_directory = "" -resampler_directory = "" -xmb_font = "" -playlist_names = "" -playlist_cores = "" -audio_device = "" -camera_device = "" -cheevos_username = "" -cheevos_password = "" -video_context_driver = "" -input_keyboard_layout = "" -bundle_assets_src_path = "" -bundle_assets_dst_path = "" -bundle_assets_dst_path_subdir = "" +## Skeleton config file for RetroArch + +# Save all save files (*.srm) to this directory. This includes related files like .bsv, .rtc, .psrm, etc ... +# This will be overridden by explicit command line options. +# savefile_directory = + +# Save all save states (*.state) to this directory. +# This will be overridden by explicit command line options. +# savestate_directory = + +# If set to a directory, content which is temporarily extracted +# will be extracted to this directory. +# cache_directory = + +# Save all input remapping files to this directory. +# input_remapping_directory = + +# Save all playlist files to this directory. +# playlist_directory = + +# If set to a directory, the content history playlist will be saved +# to this directory. +# content_history_dir = + +# Automatically saves a savestate at the end of RetroArch's lifetime. +# The path is $SRAM_PATH.auto. +# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. +# savestate_auto_save = false +# savestate_auto_load = true + +# Load libretro from a dynamic location for dynamically built RetroArch. +# This option is mandatory. + +# Path to a libretro implementation. +# libretro_path = "/path/to/libretro.so" + +# A directory for where to search for libretro core implementations. +# libretro_directory = + +# A directory for where to search for libretro core information. +# libretro_info_path = + +# Sets log level for libretro cores (GET_LOG_INTERFACE). +# If a log level issued by a libretro core is below libretro_log_level, it is ignored. +# DEBUG logs are always ignored unless verbose mode is activated (--verbose). +# DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3. +# libretro_log_level = 0 + +# Enable or disable verbosity level of frontend. +# log_verbosity = false + +# If this option is enabled, every content file loaded in RetroArch will be +# automatically added to a history list. +# history_list_enable = true + +# Enable or disable RetroArch performance counters +# perfcnt_enable = false + +# Path to core options config file. +# This config file is used to expose core-specific options. +# It will be written to by RetroArch. +# A default path will be assigned if not set. +# core_options_path = + +# Path to content history file. +# RetroArch keeps track of all content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_history_path = + +# Path to music content history file (optional). +# RetroArch keeps track of all music content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_music_history_path = + +# Path to image content history file (optional). +# RetroArch keeps track of all image content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_image_history_path = + +# Path to video content history file (optional). +# RetroArch keeps track of all video content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_video_history_path = + +# Number of entries that will be kept in content history file. +# content_history_size = 100 + +# Sets the "system" directory. +# Implementations can query for this directory to load BIOSes, system-specific configs, etc. +# system_directory = + +# Sets start directory for menu file browser. +# rgui_browser_directory = + +# Content directory. Interacts with RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY. +# Usually set by developers who bundle libretro/RetroArch apps to point to assets. +# content_directory = + +# Assets directory. This location is queried by default when menu interfaces try to look for +# loadable assets, etc. +# assets_directory = + +# Dynamic wallpapers directory. The place to store the wallpapers dynamically +# loaded by the menu depending on context. +# dynamic_wallpapers_directory = + +# Thumbnails directory. To store thumbnail files. +# thumbnails_directory = + +# Sets start directory for menu config browser. +# rgui_config_directory = + +# Show startup screen in menu. +# Is automatically set to false when seen for the first time. +# This is only updated in config if config_save_on_exit is set to true, however. +# rgui_show_start_screen = true + +# Flushes config to disk on exit. Useful for menu as settings can be modified. +# Overwrites the config. #include's and comments are not preserved. +# config_save_on_exit = true + +# Load up a specific config file based on the core being used. +# core_specific_config = false + +# Shows hidden files and folders in directory listings. +# show_hidden_files = true + +#### Video + +# Video driver to use. "gl", "xvideo", "sdl" +# video_driver = "gl" + +# Which context implementation to use. +# Possible ones for desktop are: glx, x-egl, kms-egl, sdl-gl, wgl. +# By default, tries to use first suitable driver. +# video_context_driver = + +# Windowed x resolution scale and y resolution scale +# (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale) +# video_scale = 3.0 + +# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. +# video_fullscreen_x = 0 +# video_fullscreen_y = 0 + +# Start in fullscreen. Can be changed at runtime. +# video_fullscreen = false + +# If fullscreen, prefer using a windowed fullscreen mode. +# video_windowed_fullscreen = true + +# Which monitor to prefer. 0 (default) means no particular monitor is preferred, 1 and up (1 being first monitor), +# suggests RetroArch to use that particular monitor. +# video_monitor_index = 0 + +# Forcibly disable composition. Only works in Windows Vista/7 for now. +# video_disable_composition = false + +# Video vsync. +# video_vsync = true + +# Max amount of swapchain images. +# Single buffering = 1, Double buffering = 2, 3 = Triple buffering +# video_max_swapchain_images = 3 + +# Forcibly disable sRGB FBO support. Some Intel OpenGL drivers on Windows +# have video problems with sRGB FBO support enabled. +# video_force_srgb_disable = false + +# Attempts to hard-synchronize CPU and GPU. Can reduce latency at cost of performance. +# video_hard_sync = false + +# Sets how many frames CPU can run ahead of GPU when using video_hard_sync. +# Maximum is 3. +# video_hard_sync_frames = 0 + +# Sets how many milliseconds to delay after VSync before running the core. +# Can reduce latency at cost of higher risk of stuttering. +# Maximum is 15. +# video_frame_delay = 0 + +# Inserts a black frame inbetween frames. +# Useful for 120 Hz monitors who want to play 60 Hz material with eliminated ghosting. +# video_refresh_rate should still be configured as if it is a 60 Hz monitor (divide refresh rate by 2). +# video_black_frame_insertion = false + +# Use threaded video driver. Using this might improve performance at possible cost of latency and more video stuttering. +# video_threaded = false + +# Use a shared context for HW rendered libretro cores. +# Avoids having to assume HW state changes inbetween frames. +# video_shared_context = false + +# Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders. +# video_smooth = true + +# Forces rendering area to stay equal to content aspect ratio or as defined in video_aspect_ratio. +# video_force_aspect = true + +# Only scales video in integer steps. +# The base size depends on system-reported geometry and aspect ratio. +# If video_force_aspect is not set, X/Y will be integer scaled independently. +# video_scale_integer = false + +# A floating point value for video aspect ratio (width / height). +# If this is not set, aspect ratio is assumed to be automatic. +# Behavior then is defined by video_aspect_ratio_auto. +# video_aspect_ratio = + +# If this is true and video_aspect_ratio is not set, +# aspect ratio is decided by libretro implementation. +# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set. +# video_aspect_ratio_auto = false + +# Forces cropping of overscanned frames. +# Exact behavior of this option is implementation specific. +# video_crop_overscan = true + +# Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset) +# video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}" + +# Load video_shader on startup. +# Other shaders can still be loaded later in runtime. +# video_shader_enable = false + +# Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access. +# video_shader_dir = + +# CPU-based video filter. Path to a dynamic library. +# video_filter = + +# Defines a directory where CPU-based video filters are kept. +# video_filter_dir = + +# Path to a font used for rendering messages. This path must be defined to enable fonts. +# Do note that the _full_ path of the font is necessary! +# video_font_path = + +# Size of the font rendered. +# video_font_size = 32 + +# Enable usage of OSD messages. +# video_font_enable = true + +# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. +# [0.0, 0.0] maps to the lower left corner of the screen. +# video_message_pos_x = 0.05 +# video_message_pos_y = 0.05 + +# Color for message. The value is treated as a hexadecimal value. +# It is a regular RGB hex number, i.e. red is "ff0000". +# video_message_color = ffffff + +# Video refresh rate of your monitor. +# Used to calculate a suitable audio input rate. +# video_refresh_rate = 59.94 + +# Allows libretro cores to set rotation modes. +# Setting this to false will honor, but ignore this request. +# This is useful for vertically oriented content where one manually rotates the monitor. +# video_allow_rotate = true + +# Forces a certain rotation of the screen. +# The rotation is added to rotations which the libretro core sets (see video_allow_rotate). +# The angle is * 90 degrees counter-clockwise. +# video_rotation = 0 + +#### Audio + +# Enable audio. +# audio_enable = true + +# Mutes audio. +# audio_mute_enable = false + +# Audio output samplerate. +# audio_out_rate = 48000 + +# Audio resampler backend. Which audio resampler to use. +# Default will use "sinc". +# audio_resampler = + +# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio. +# audio_driver = + +# Override the default audio device the audio_driver uses. This is driver dependant. E.g. ALSA wants a PCM device, OSS wants a path (e.g. /dev/dsp), Jack wants portnames (e.g. system:playback1,system:playback_2), and so on ... +# audio_device = + +# Audio DSP plugin that processes audio before it's sent to the driver. Path to a dynamic library. +# audio_dsp_plugin = + +# Directory where DSP plugins are kept. +# audio_filter_dir = + +# Will sync (block) on audio. Recommended. +# audio_sync = true + +# Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. +# audio_latency = 64 + +# Enable audio rate control. +# audio_rate_control = true + +# Controls audio rate control delta. Defines how much input rate can be adjusted dynamically. +# Input rate = in_rate * (1.0 +/- audio_rate_control_delta) +# audio_rate_control_delta = 0.005 + +# Controls maximum audio timing skew. Defines the maximum change in input rate. +# Input rate = in_rate * (1.0 +/- max_timing_skew) +# audio_max_timing_skew = 0.05 + +# Audio volume. Volume is expressed in dB. +# 0 dB is normal volume. No gain will be applied. +# Gain can be controlled in runtime with input_volume_up/input_volume_down. +# audio_volume = 0.0 + +#### Overlay + +# Defines a directory where overlays are kept for easy access. +# overlay_directory = + +# Enable or disable the current overlay. +# input_overlay_enable = true + +# Hide the current overlay from appearing inside the menu. +# input_overlay_hide_in_menu = true + +# Path to input overlay. +# input_overlay = + +# Overlay opacity. +# input_overlay_opacity = 1.0 + +# Overlay scale. +# input_overlay_scale = 1.0 + +#### Input + +# Input driver. Depending on video driver, it might force a different input driver. +# input_driver = sdl + +# Input device driver. (Valid: linuxraw, sdl, dinput) +# input_joypad_driver = + +# Path to input remapping file. +# input_remapping_path = + +# Input bind timer timeout. +# Amount of seconds to wait until proceeding to the next bind. Default: 5, minimum: 1 +# input_bind_timeout = 1 + +# If enabled, overrides the input binds with the remapped binds set for the current core. +# input_remap_binds_enable = true + +# Maximum amount of users supported by RetroArch. +# input_max_users = 16 + +# Keyboard layout for input driver if applicable (udev/evdev for now). +# Syntax is either just layout (e.g. "no"), or a layout and variant separated with colon ("no:nodeadkeys"). +# input_keyboard_layout = + +# Defines axis threshold. Possible values are [0.0, 1.0] +# input_axis_threshold = 0.5 + +# Enable input auto-detection. Will attempt to autoconfigure +# joypads, Plug-and-Play style. +# input_autodetect_enable = true + +# Show the input descriptors set by the core instead of the +# default ones. +# input_descriptor_label_show = true + +# Hide input descriptors that were not set by the core. +# input_descriptor_hide_unbound = false + +# Influence how input polling is done inside RetroArch. +# 0 : Early - Input polling is performed before call to retro_run. +# 1 : Normal - Input polling is performed when retro_input_poll is +# requested. +# 2 : Late - Input polling is performed on first call to retro_input_state +# per frame +# +# Setting it to 0 or 2 can result in less latency depending on +# your configuration. +# +# When netplay is enabled, the default polling behavior (1) will +# be used regardless of the value set here. +# input_poll_type_behavior = 1 + +# Directory for joypad autoconfigs. +# If a joypad is plugged in, that joypad will be autoconfigured if a config file +# corresponding to that joypad is present in joypad_autoconfig_dir. +# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs. +# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend. +# Requires input_autodetect_enable to be enabled. +# joypad_autoconfig_dir = + +# Sets which libretro device is used for a user. +# Devices are indentified with a number. +# This is normally saved by the menu. +# Device IDs are found in libretro.h. +# These settings are overridden by explicit command-line arguments which refer to input devices. +# None: 0 +# Joypad (RetroPad): 1 +# Mouse: 2 +# Keyboard: 3 +# Generic Lightgun: 4 +# Joypad w/ Analog (RetroPad + Analog sticks): 5 +# Multitap (SNES specific): 257 +# Super Scope (SNES specific): 260 +# Justifier (SNES specific): 516 +# Justifiers (SNES specific): 772 + +# input_libretro_device_p1 = +# input_libretro_device_p2 = +# input_libretro_device_p3 = +# input_libretro_device_p4 = +# input_libretro_device_p5 = +# input_libretro_device_p6 = +# input_libretro_device_p7 = +# input_libretro_device_p8 = + +# Keyboard input. Will recognize letters ("a" to "z") and the following special keys (where "kp_" +# is for keypad keys): +# +# left, right, up, down, enter, kp_enter, tab, insert, del, end, home, +# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus, +# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, +# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown, +# keypad0, keypad1, keypad2, keypad3, keypad4, keypad5, keypad6, keypad7, keypad8, keypad9, +# period, capslock, numlock, backspace, multiply, divide, print_screen, scroll_lock, +# tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket, +# backslash, rightbracket, kp_period, kp_equals, rctrl, ralt +# +# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, +# rather than relying on a default. +# input_player1_a = "x" +# input_player1_b = "z" +# input_player1_y = "a" +# input_player1_x = "s" +# input_player1_start = "enter" +# input_player1_select = "rshift" +# input_player1_l = "q" +# input_player1_r = "w" +# input_player1_left = "left" +# input_player1_right = "right" +# input_player1_up = "up" +# input_player1_down = "down" +# input_player1_l2 = +# input_player1_r2 = +# input_player1_l3 = +# input_player1_r3 = + +# Two analog sticks (DualShock-esque). +# Bound as usual, however, if a real analog axis is bound, +# it can be read as a true analog. +# Positive X axis is right, Positive Y axis is down. +# input_player1_l_x_plus = +# input_player1_l_x_minus = +# input_player1_l_y_plus = +# input_player1_l_y_minus = +# input_player1_r_x_plus = +# input_player1_r_x_minus = +# input_player1_r_y_plus = +# input_player1_r_y_minus = + +# If desired, it is possible to override which joypads are being used for user 1 through 8. +# First joypad available is 0. +# input_player1_joypad_index = 0 +# input_player2_joypad_index = 1 +# input_player3_joypad_index = 2 +# input_player4_joypad_index = 3 +# input_player5_joypad_index = 4 +# input_player6_joypad_index = 5 +# input_player7_joypad_index = 6 +# input_player8_joypad_index = 7 + +# Input device buttons. +# Figure these out by using RetroArch-Phoenix or retroarch-joyconfig. +# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. +# E.g. "h0up" +# input_player1_a_btn = +# input_player1_b_btn = +# input_player1_y_btn = +# input_player1_x_btn = +# input_player1_start_btn = +# input_player1_select_btn = +# input_player1_l_btn = +# input_player1_r_btn = +# input_player1_left_btn = +# input_player1_right_btn = +# input_player1_up_btn = +# input_player1_down_btn = +# input_player1_l2_btn = +# input_player1_r2_btn = +# input_player1_l3_btn = +# input_player1_r3_btn = + +# Menu buttons. +# menu_search_btn = +# menu_info_btn = +# menu_default_btn = +# menu_scroll_down_btn = +# menu_scroll_up_btn = + +# Swap buttons for OK/Cancel +# menu_swap_ok_cancel_buttons = false + +# Axis for RetroArch D-Pad. +# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. +# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. +# input_player1_left_axis = +# input_player1_right_axis = +# input_player1_up_axis = +# input_player1_down_axis = + +# Holding the turbo while pressing another button will let the button enter a turbo mode +# where the button state is modulated with a periodic signal. +# The modulation stops when the button itself (not turbo button) is released. +# input_player1_turbo = + +# Describes the period and how long of that period a turbo-enabled button should behave. +# Numbers are described in frames. +# input_turbo_period = 6 +# input_turbo_duty_cycle = 3 + +# This goes all the way to user 8 (*_player2_*, *_player3_*, etc), but omitted for clarity. +# All input binds have corresponding binds for keyboard (none), joykeys (_btn) and joyaxes (_axis) as well. + +# Toggles fullscreen. +# input_toggle_fullscreen = f + +# Saves state. +# input_save_state = f2 +# Loads state. +# input_load_state = f4 + +# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline). +# When slot is != 0, path will be $path%d, where %d is slot number. +# input_state_slot_increase = f7 +# input_state_slot_decrease = f6 + +# Toggles between fast-forwarding and normal speed. +# input_toggle_fast_forward = space + +# Hold for fast-forward. Releasing button disables fast-forward. +# input_hold_fast_forward = l + +# Key to exit RetroArch cleanly. +# Killing it in any hard way (SIGKILL, etc) will terminate RetroArch without saving RAM, etc. +# On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization. +# input_exit_emulator = escape + + +# Applies next and previous shader in directory. +# input_shader_next = m +# input_shader_prev = n + +# Hold button down to rewind. Rewinding must be enabled. +# input_rewind = r + +# Toggle between recording and not. +# input_movie_record_toggle = o + +# Toggle between paused and non-paused state +# input_pause_toggle = p + +# Frame advance when content is paused +# input_frame_advance = k + +# Reset the content. +# input_reset = h + +# Cheats. +# input_cheat_index_plus = y +# input_cheat_index_minus = t +# input_cheat_toggle = u + +# Mute/unmute audio +# input_audio_mute = f9 + +# Take screenshot +# input_screenshot = f8 + +# Netplay flip users. +# input_netplay_flip_players = i + +# Hold for slowmotion. +# input_slowmotion = e + +# Enable other hotkeys. +# If this hotkey is bound to either keyboard, joybutton or joyaxis, +# all other hotkeys will be disabled unless this hotkey is also held at the same time. +# This is useful for RETRO_KEYBOARD centric implementations +# which query a large area of the keyboard, where it is not desirable +# that hotkeys get in the way. + +# Alternatively, all hotkeys for keyboard could be disabled by the user. +# input_enable_hotkey_btn = + +# Increases audio volume. +# input_volume_up = kp_plus +# Decreases audio volume. +# input_volume_down = kp_minus + +# Toggles to next overlay. Wraps around. +# input_overlay_next = + +# Toggles eject for disks. Used for multiple-disk content. +# input_disk_eject_toggle = + +# Cycles through disk images. Use after ejecting. +# Complete by toggling eject again. +# input_disk_next = + +# Toggles menu. +# input_menu_toggle = f1 + +# RetroPad button combination to toggle menu +# 0 = none, 1 = L + R + Y + D-Pad Down, 2 = L3 + R3, 3 = Start + Select +# input_menu_toggle_gamepad_combo = 0 + +# allow any RetroPad to control the menu +# all_users_control_menu = false + +# Toggles mouse grab. When mouse is grabbed, RetroArch hides the mouse, +# and keeps the mouse pointer inside the window to allow relative mouse input +# to work better. +# input_grab_mouse_toggle = f11 + +#### Menu + +# Menu driver to use. "rgui", "lakka", etc. +# menu_driver = "rgui" + +# If disabled, the libretro core will keep running in the background when we +# are in the menu. +# menu_pause_libretro = false + +# Enable mouse input inside the menu. +# menu_mouse_enable = false + +# Enable touch input inside the menu. +# menu_pointer_enable = false + +# Shows current date and/or time inside menu. +# menu_timedate_enable = true + +# Shows current core inside menu. +# menu_core_enable = true + +# Path to an image to set as menu wallpaper. +# menu_wallpaper = + +# Dynamically load a new wallpaper depending on context. +# menu_dynamic_wallpaper_enable = false + +# Type of thumbnail to display. 0 = none, 1 = snaps, 2 = titles, 3 = boxarts +# menu_thumbnails = 0 + +# Wrap-around to beginning and/or end if boundary of list is reached horizontally or vertically +# menu_navigation_wraparound_enable = false + +# Filter files being show in 'Load Content' by supported extensions +# menu_navigation_browser_filter_supported_extensions_enable = true + +# Collapse subgroup settings into main group to create one big listing of settings +# per category. +# menu_collapse_subgroups_enable = false + +#### Core +# +# Prevent libretro cores from closing RetroArch on exit by loading a dummy core. +# load_dummy_on_core_shutdown = "true" + +# Check for firmware requirement(s) before loading a content. +# check_firmware_before_loading = "false" + +#### UI + +# Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored +# by video driver. +# suspend_screensaver_enable = true + +# Start UI companion driver's interface on boot (if available). +# ui_companion_start_on_boot = true + +#### Camera + +# Override the default camera device the camera driver uses. This is driver dependant. +# camera_device = + +# Override the default privacy permission for cores that want to access camera services. Is "false" by default. +# camera_allow = false + +#### Location + +# Override the default privacy permission for cores that want to access location services. Is "false" by default. +# location_allow = false + +#### Core Updater + +# URL to core update directory on buildbot. +# core_updater_buildbot_url = "http://buildbot.libretro.com" + +# URL to assets update directory on buildbot. +# core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" + +# After downloading, automatically extract archives that the downloads are contained inside. +# core_updater_auto_extract_archive = true + +#### Network + +# When being client over netplay, use keybinds for user 1. +# netplay_client_swap_input = false + +# The username of the person running RetroArch. This will be used for playing online, for instance. +# netplay_nickname = + +# The amount of delay frames to use for netplay. Increasing this value will increase +# performance, but introduce more latency. +# netplay_delay_frames = 0 + +# Netplay mode for the current user. +# false is Server, true is Client. +# netplay_mode = false + +# Enable or disable spectator mode for the user during netplay. +# netplay_spectator_mode_enable = false + +# The IP Address of the host to connect to. +# netplay_ip_address = + +# The port of the host IP Address. Can be either a TCP or UDP port. +# netplay_ip_port = 55435 + +#### Misc + +# Enable rewinding. This will take a performance hit when playing, so it is disabled by default. +# rewind_enable = false + +# Rewinding buffer size in megabytes. Bigger rewinding buffer means you can rewind longer. +# The buffer should be approx. 20MB per minute of buffer time. +# rewind_buffer_size = 20 + +# Rewind granularity. When rewinding defined number of frames, you can rewind several frames at a time, increasing the rewinding speed. +# rewind_granularity = 1 + +# Pause gameplay when window focus is lost. +# pause_nonactive = true + +# Autosaves the non-volatile SRAM at a regular interval. This is disabled by default unless set otherwise. +# The interval is measured in seconds. A value of 0 disables autosave. +# autosave_interval = + +# Path to content database directory. +# content_database_path = + +# Path to cheat database directory. +# cheat_database_path = + +# Directory to dump screenshots to. +# screenshot_directory = + +# Records video after CPU video filter. +# video_post_filter_record = false + +# Records output of GPU shaded material if available. +# video_gpu_record = false + +# Screenshots output of GPU shaded material if available. +# video_gpu_screenshot = true + +# Block SRAM from being overwritten when loading save states. +# Might potentially lead to buggy games. +# block_sram_overwrite = false + +# When saving a savestate, save state index is automatically increased before +# it is saved. +# Also, when loading content, the index will be set to the highest existing index. +# There is no upper bound on the index. +# savestate_auto_index = false + +# Slowmotion ratio. When slowmotion, content will slow down by factor. +# slowmotion_ratio = 3.0 + +# The maximum rate at which content will be run when using fast forward. (E.g. 5.0 for 60 fps content => 300 fps cap). +# RetroArch will go to sleep to ensure that the maximum rate will not be exceeded. +# Do not rely on this cap to be perfectly accurate. +# If this is set at 0, then fastforward ratio is unlimited (no FPS cap) +# fastforward_ratio = 0.0 + +# Enable stdin/network command interface. +# network_cmd_enable = false +# network_cmd_port = 55355 +# stdin_cmd_enable = false + +#### Bundle extraction + + From f64fb911b8ad2323d7324f21541e8bc267f10b34 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:46:32 -0500 Subject: [PATCH 155/638] remove explicit unicode def/undefs --- gfx/common/win32_common.cpp | 48 +++++++++---------- gfx/common/win32_common.h | 8 ++-- gfx/drivers/d3d.cpp | 48 +++++++++---------- gfx/drivers_context/wgl_ctx.cpp | 19 ++++---- input/drivers/dinput.c | 5 +- libretro-common/include/compat/msvc.h | 5 +- libretro-common/include/encodings/win32.h | 10 ++++ libretro-common/include/retro_miscellaneous.h | 7 +-- libretro-common/streams/file_stream.c | 10 ++-- 9 files changed, 79 insertions(+), 81 deletions(-) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index aa091e33de..a9792c3730 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -1,6 +1,6 @@ /* 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. @@ -76,7 +76,7 @@ ui_window_win32_t main_window; /* Power Request APIs */ #if !defined(_XBOX) && (_MSC_VER == 1310) -typedef struct _REASON_CONTEXT +typedef struct _REASON_CONTEXT { ULONG Version; DWORD Flags; @@ -129,7 +129,7 @@ extern "C" } }; -INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, +INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { size_t list_size; @@ -148,16 +148,16 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); - hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); for (i = 0; i < list_size; i++) { const core_info_t *info = (const core_info_t*)&core_info[i]; - SendMessage(hwndList, LB_ADDSTRING, 0, - (LPARAM)info->display_name); + SendMessage(hwndList, LB_ADDSTRING, 0, + (LPARAM)info->display_name); } - SetFocus(hwndList); - return TRUE; + SetFocus(hwndList); + return TRUE; } case WM_COMMAND: @@ -168,20 +168,20 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, EndDialog(hDlg, LOWORD(wParam)); break; case ID_CORELISTBOX: - switch (HIWORD(wParam)) - { + switch (HIWORD(wParam)) + { case LBN_SELCHANGE: { int lbItem; const core_info_t *info = NULL; - HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); - lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); + HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); core_info_get_list(&core_info_list); core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); info = (const core_info_t*)&core_info[lbItem]; runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path); - } + } break; } return TRUE; @@ -336,7 +336,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) { /* Pick one core that could be compatible, ew */ if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), - hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) + hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( NULL, NULL, @@ -408,7 +408,7 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message, } *quit = true; break; - case WM_COMMAND: + case WM_COMMAND: { settings_t *settings = config_get_ptr(); if (settings->ui.menubar_enable) @@ -453,7 +453,7 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LPCREATESTRUCT p_cs = (LPCREATESTRUCT)lparam; curD3D = p_cs->lpCreateParams; g_inited = true; - + win32_window.hwnd = hwnd; ui_window_win32_set_droppable(&win32_window, true); @@ -533,7 +533,7 @@ bool win32_window_create(void *data, unsigned style, #endif bool win32_get_metrics(void *data, - enum display_metric_types type, float *value) + enum display_metric_types type, float *value) { #ifdef _XBOX return false; @@ -616,7 +616,7 @@ void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) { #ifndef _XBOX - const ui_application_t *application = + const ui_application_t *application = ui_companion_driver_get_application_ptr(); if (application) application->process_events(); @@ -696,12 +696,12 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, #ifndef _XBOX settings_t *settings = config_get_ptr(); - /* Windows only reports the refresh rates for modelines as - * an integer, so video.refresh_rate needs to be rounded. Also, account + /* Windows only reports the refresh rates for modelines as + * an integer, so video.refresh_rate needs to be rounded. Also, account * for black frame insertion using video.refresh_rate set to half * of the display refresh rate, as well as higher vsync swap intervals. */ float refresh_mod = settings->video.black_frame_insertion ? 2.0f : 1.0f; - unsigned refresh = roundf(settings->video.refresh_rate + unsigned refresh = roundf(settings->video.refresh_rate * refresh_mod * settings->video.swap_interval); if (fullscreen) @@ -714,14 +714,14 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, } else { - char dev_name[CCHDEVICENAME] = {0}; + char dev_name[CCHDEVICENAME] = {0}; *style = WS_POPUP | WS_VISIBLE; utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); if (!win32_monitor_set_fullscreen(*width, *height, refresh, dev_name)) - {} + {} /* Display settings might have changed, get new coordinates. */ GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); @@ -801,7 +801,7 @@ bool win32_set_video_mode(void *data, if (!win32_window_create(data, style, &mon_rect, width, height, fullscreen)) return false; - + win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 704cb40e35..f3496b095c 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,12 +18,10 @@ #define WIN32_COMMON_H__ #include +#include #ifndef _XBOX #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #endif @@ -83,7 +81,7 @@ bool win32_window_create(void *data, unsigned style, bool win32_suppress_screensaver(void *data, bool enable); bool win32_get_metrics(void *data, - enum display_metric_types type, float *value); + enum display_metric_types type, float *value); void win32_show_cursor(bool state); diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 95bfc96f8b..b429ac8319 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -15,13 +15,11 @@ * If not, see . */ +#include + #ifdef _XBOX #include #include -#else -#define UNICODE -#include -#include #endif #include @@ -155,14 +153,14 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) video_info->input_scale * RARCH_SCALE_BASE; if (!renderchain_init_first(&d3d->renderchain_driver, - &d3d->renderchain_data)) + &d3d->renderchain_data)) { - RARCH_ERR("Renderchain could not be initialized.\n"); - return false; + RARCH_ERR("Renderchain could not be initialized.\n"); + return false; } if (!d3d->renderchain_driver || !d3d->renderchain_data) - return false; + return false; if ( !d3d->renderchain_driver->init( @@ -187,7 +185,7 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) for (i = 1; i < d3d->shader.passes; i++) { d3d->renderchain_driver->convert_geometry(d3d->renderchain_data, - &link_info, + &link_info, &out_width, &out_height, current_width, current_height, &d3d->final_viewport); @@ -327,8 +325,8 @@ static void d3d_viewport_info(void *data, struct video_viewport *vp) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->viewport_info) return; @@ -364,7 +362,7 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay) vert[i][7] = 1.0f; vert[i][8] = overlay->alpha_mod; } - + d3d_viewport_info(d3d, &vp); overlay_width = vp.width; @@ -502,7 +500,7 @@ void d3d_make_d3dpp(void *data, #ifdef _XBOX d3dpp->Windowed = false; #else - d3dpp->Windowed = settings->video.windowed_fullscreen + d3dpp->Windowed = settings->video.windowed_fullscreen || !info->fullscreen; #endif d3dpp->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; @@ -533,13 +531,13 @@ void d3d_make_d3dpp(void *data, d3dpp->BackBufferFormat = #ifdef _XBOX360 global->console.screen.gamma_correction ? - (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? + (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5) : #endif info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5; #else d3dpp->hDeviceWindow = win32_get_window(); - d3dpp->BackBufferFormat = !d3dpp->Windowed ? + d3dpp->BackBufferFormat = !d3dpp->Windowed ? D3DFMT_X8R8G8B8 : D3DFMT_UNKNOWN; #endif @@ -713,8 +711,8 @@ static void d3d_calculate_rect(void *data, if (fabsf(device_aspect - desired_aspect) < 0.0001f) { - /* If the aspect ratios of screen and desired aspect - * ratio are sufficiently equal (floating point stuff), + /* If the aspect ratios of screen and desired aspect + * ratio are sufficiently equal (floating point stuff), * assume they are actually equal. */ } @@ -806,7 +804,7 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info) video_driver_get_size(&width, &height); d3d_set_viewport(d3d, - width, height, false, true); + width, height, false, true); #if defined(_XBOX360) strlcpy(settings->path.font, "game:\\media\\Arial_12.xpr", @@ -1047,7 +1045,7 @@ static bool d3d_construct(d3d_video_t *d3d, win_height, info->fullscreen); win32_set_window(&win_width, &win_height, info->fullscreen, - windowed_full, &rect); + windowed_full, &rect); #endif #ifdef HAVE_SHADERS @@ -1337,7 +1335,7 @@ static bool d3d_overlay_load(void *data, image_data; if (!d3d) - return false; + return false; d3d_free_overlays(d3d); d3d->overlays.resize(num_images); @@ -1542,8 +1540,8 @@ static bool d3d_read_viewport(void *data, uint8_t *buffer) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->read_viewport) return false; @@ -1603,7 +1601,7 @@ static void d3d_set_menu_texture_frame(void *data, || d3d->menu->tex_h != height) { if (d3d->menu) - d3d_texture_free(d3d->menu->tex); + d3d_texture_free(d3d->menu->tex); d3d->menu->tex = d3d_texture_new(d3d->dev, NULL, width, height, 1, @@ -1686,7 +1684,7 @@ static void video_texture_load_d3d(d3d_video_t *d3d, uintptr_t *id) { *id = (uintptr_t)d3d_texture_new(d3d->dev, NULL, - ti->width, ti->height, 1, + ti->width, ti->height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL); } @@ -1739,7 +1737,7 @@ static void d3d_unload_texture(void *data, uintptr_t id) { LPDIRECT3DTEXTURE texid; if (!id) - return; + return; texid = (LPDIRECT3DTEXTURE)id; d3d_texture_free(texid); diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 648f2123ec..b1575e9ae5 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -23,10 +23,7 @@ #define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K #endif -#define UNICODE -#include -#include - +#include #include #include @@ -146,9 +143,9 @@ static void create_gl_context(HWND hwnd, bool *quit) else { g_hrc = wglCreateContext(g_hdc); - + /* We'll create shared context later if not. */ - if (g_hrc && !core_context && !debug) + if (g_hrc && !core_context && !debug) { g_hw_hrc = wglCreateContext(g_hdc); if (g_hw_hrc) @@ -190,7 +187,7 @@ static void create_gl_context(HWND hwnd, bool *quit) *aptr++ = g_minor; /* Technically, we don't have core/compat until 3.2. - * Version 3.1 is either compat or not depending + * Version 3.1 is either compat or not depending * on GL_ARB_compatibility. */ if ((g_major * 1000 + g_minor) >= 3002) @@ -262,7 +259,7 @@ void create_graphics_context(HWND hwnd, bool *quit) GetClientRect(hwnd, &rect); HINSTANCE instance = GetModuleHandle(NULL); if (!vulkan_surface_create(&g_vk, VULKAN_WSI_WIN32, - &instance, &hwnd, + &instance, &hwnd, width, height, g_interval)) *quit = true; g_inited = true; @@ -439,7 +436,7 @@ static void *gfx_ctx_wgl_init(void *video_driver) if (g_inited) return NULL; - + win32_window_reset(); win32_monitor_init(); @@ -601,7 +598,7 @@ static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol) } static bool gfx_ctx_wgl_get_metrics(void *data, - enum display_metric_types type, float *value) + enum display_metric_types type, float *value) { return win32_get_metrics(data, type, value); } diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 51f76b4eab..dfb3033711 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -29,10 +29,7 @@ #define WM_MOUSEWHEEL 0x020A #endif -#define UNICODE -#include -#include - +#include #include #include diff --git a/libretro-common/include/compat/msvc.h b/libretro-common/include/compat/msvc.h index e767bef7f8..b56a51fad3 100644 --- a/libretro-common/include/compat/msvc.h +++ b/libretro-common/include/compat/msvc.h @@ -35,12 +35,12 @@ extern "C" { #ifndef snprintf #define snprintf c99_snprintf_retro__ #endif - + int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...); #endif /* Pre-MSVC 2010 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */ -#if _MSC_VER < 1600 +#if _MSC_VER < 1600 #include #include #ifndef vsnprintf @@ -53,7 +53,6 @@ extern "C" { } #endif -#undef UNICODE /* Do not bother with UNICODE at this time. */ #include #include #include diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 13ca67ce7b..8a911c556f 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -28,7 +28,17 @@ #define UNICODE #include #include + +#ifdef __cplusplus +extern "C" { +#endif + #include + +#ifdef __cplusplus +} +#endif + #endif #endif diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 2ab71c52dc..e9405eae63 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -45,11 +45,12 @@ #include #endif +#ifdef _WIN32 +#include +#endif + #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #elif defined(_WIN32) && defined(_XBOX) #include diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index d9406dba80..dfa2ef1a96 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -26,9 +26,7 @@ #include #if defined(_WIN32) -# define UNICODE -# include -# include +#include # ifdef _MSC_VER # define setmode _setmode # endif @@ -295,7 +293,7 @@ char *filestream_getline(RFILE *stream) } newline[idx] = '\0'; - return newline; + return newline; } char *filestream_gets(RFILE *stream, char *s, size_t len) @@ -346,7 +344,7 @@ ssize_t filestream_seek(RFILE *stream, ssize_t offset, int whence) #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function is + /* Need to check stream->mapped because this function is * called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) { @@ -416,7 +414,7 @@ ssize_t filestream_tell(RFILE *stream) return ftell(stream->fp); #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function + /* Need to check stream->mapped because this function * is called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) return stream->mappos; From 3846ce1837e00644459eceda1612a72614a31a15 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:15:38 -0500 Subject: [PATCH 156/638] build fixes for MSVC, start moving back to TCHAR usage so we can switch unicode on and off --- audio/drivers/dsound.c | 24 +- input/drivers/dinput.c | 2 +- input/drivers_joypad/dinput_joypad.c | 21 +- libretro-common/dynamic/dylib.c | 18 +- libretro-common/file/retro_dirent.c | 5 +- libretro-common/include/encodings/win32.h | 53 + menu/menu_event.c | 6 +- retroarch.cfg | 2410 +++++++++++++------- ui/drivers/ui_win32.c | 67 +- ui/drivers/win32/ui_win32_browser_window.c | 50 +- ui/drivers/win32/ui_win32_window.cpp | 9 +- 11 files changed, 1797 insertions(+), 868 deletions(-) create mode 100644 libretro-common/include/encodings/win32.h diff --git a/audio/drivers/dsound.c b/audio/drivers/dsound.c index 2cdcf4d234..ff2d8368b8 100644 --- a/audio/drivers/dsound.c +++ b/audio/drivers/dsound.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -19,6 +19,8 @@ #include #include +#include + #ifndef _XBOX #include #include @@ -93,7 +95,7 @@ static INLINE bool grab_region(dsound_t *ds, uint32_t write_ptr, struct audio_lock *region) { const char *err = NULL; - HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, + HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, ®ion->chunk1, ®ion->size1, ®ion->chunk2, ®ion->size2, 0); if (res == DSERR_BUFFERLOST) @@ -152,7 +154,7 @@ static void dsound_thread(void *data) struct audio_lock region; DWORD read_ptr, avail, fifo_avail; get_positions(ds, &read_ptr, NULL); - + avail = write_avail(read_ptr, write_ptr, ds->buffer_size); EnterCriticalSection(&ds->crit); @@ -161,12 +163,12 @@ static void dsound_thread(void *data) if (avail < CHUNK_SIZE || ((fifo_avail < CHUNK_SIZE) && (avail < ds->buffer_size / 2))) { - /* No space to write, or we don't have data in our fifo, + /* No space to write, or we don't have data in our fifo, * but we can wait some time before it underruns ... */ /* We could opt for using the notification interface, - * but it is not guaranteed to work, so use high + * but it is not guaranteed to work, so use high * priority sleeping patterns. */ retro_sleep(1); @@ -182,7 +184,7 @@ static void dsound_thread(void *data) if (fifo_avail < CHUNK_SIZE) { - /* Got space to write, but nothing in FIFO (underrun), + /* Got space to write, but nothing in FIFO (underrun), * fill block with silence. */ memset(region.chunk1, 0, region.size1); @@ -191,7 +193,7 @@ static void dsound_thread(void *data) release_region(ds, ®ion); write_ptr = (write_ptr + region.size1 + region.size2) % ds->buffer_size; } - else + else { /* All is good. Pull from it and notify FIFO. */ @@ -291,11 +293,15 @@ struct dsound_dev LPGUID guid; }; -static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCSTR desc, LPCSTR module, LPVOID context) +static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCTSTR desc, LPCTSTR module, LPVOID context) { struct dsound_dev *dev = (struct dsound_dev*)context; + WCHAR_TO_CHAR_ALLOC(desc, desc_str) - RARCH_LOG("\t%u: %s\n", dev->total_count, desc); + RARCH_LOG("\t%u: %s\n", dev->total_count, desc_str); + + if (desc_str) + free(desc_str); if (dev->device == dev->total_count) dev->guid = guid; diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index c5f96d0ec5..51f76b4eab 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -48,7 +48,7 @@ #include "../../configuration.h" #include "../../verbosity.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 61b4297a0a..40d542bcc9 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -75,7 +76,7 @@ static void dinput_joypad_destroy(void) IDirectInputDevice8_Unacquire(g_pads[i].joypad); IDirectInputDevice8_Release(g_pads[i].joypad); } - + free(g_pads[i].joy_name); g_pads[i].joy_name = NULL; free(g_pads[i].joy_friendly_name); @@ -114,11 +115,11 @@ static bool guid_is_xinput_device(const GUID* product_guid) unsigned i, num_raw_devs = 0; PRAWINPUTDEVICELIST raw_devs = NULL; - /* Check for well known XInput device GUIDs, + /* Check for well known XInput device GUIDs, * thereby removing the need for the IG_ check. - * This lets us skip RAWINPUT for popular devices. + * This lets us skip RAWINPUT for popular devices. * - * Also, we need to do this for the Valve Streaming Gamepad + * Also, we need to do this for the Valve Streaming Gamepad * because it's virtualized and doesn't show up in the device list. */ for (i = 0; i < ARRAY_SIZE(common_xinput_guids); ++i) @@ -207,6 +208,7 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) #endif LPDIRECTINPUTDEVICE8 *pad = NULL; settings_t *settings = config_get_ptr(); + WCHAR_TO_CHAR_ALLOC(inst->tszInstanceName, name) (void)p; @@ -222,10 +224,13 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) if (FAILED(IDirectInput8_CreateDevice( g_dinput_ctx, &inst->guidInstance, pad, NULL))) #endif - return DIENUM_CONTINUE; + return DIENUM_CONTINUE; - g_pads[g_joypad_cnt].joy_name = strdup(inst->tszProductName); - g_pads[g_joypad_cnt].joy_friendly_name = strdup(inst->tszInstanceName); + g_pads[g_joypad_cnt].joy_name = strdup(name); + g_pads[g_joypad_cnt].joy_friendly_name = strdup(name); + + if (name) + free(name); /* there may be more useful info in the GUID so leave this here for a while */ #if 0 diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index 611c9f8771..a1da7b8a45 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef NEED_DYNAMIC @@ -34,7 +35,7 @@ #endif #ifdef _WIN32 -static char last_dyn_error[512]; +static TCHAR last_dyn_error[512]; static void set_dl_error(void) { @@ -45,11 +46,16 @@ static void set_dl_error(void) NULL, err, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), - last_dyn_error, + (LPTSTR)last_dyn_error, sizeof(last_dyn_error) - 1, NULL) == 0) - snprintf(last_dyn_error, sizeof(last_dyn_error) - 1, + { + WCHAR_TO_CHAR_ALLOC(last_dyn_error, last_dyn_error_str) + snprintf(last_dyn_error_str, sizeof(last_dyn_error) - 1, "unknown error %lu", err); + if (last_dyn_error_str) + free(last_dyn_error_str); + } } #endif @@ -65,8 +71,12 @@ dylib_t dylib_load(const char *path) { #ifdef _WIN32 int prevmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - dylib_t lib = LoadLibrary(path); + dylib_t lib = NULL; + CHAR_TO_WCHAR_ALLOC(path, path_wide) + lib = LoadLibrary(path_wide); + + free(path_wide); SetErrorMode(prevmode); if (!lib) diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index dda73a682b..f29705b15d 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -24,6 +24,7 @@ #include #include +#include #include #include @@ -97,7 +98,9 @@ const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) memset(rdir->path, 0, sizeof(rdir->path)); - utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); +#ifdef UNICODE + utf16_to_char_string((const uint16_t*)rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); +#endif return rdir->path; #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h new file mode 100644 index 0000000000..13ca67ce7b --- /dev/null +++ b/libretro-common/include/encodings/win32.h @@ -0,0 +1,53 @@ +/* Copyright (C) 2010-2016 The RetroArch team + * + * --------------------------------------------------------------------------------------- + * The following license statement only applies to this file (utf.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_ENCODINGS_WIN32_H +#define _LIBRETRO_ENCODINGS_WIN32_H + +#ifndef _XBOX +#ifdef _WIN32 +#define UNICODE +#include +#include +#include +#endif +#endif + +#ifdef UNICODE +#define CHAR_TO_WCHAR_ALLOC(s, ws) \ + size_t ws##_size = (s[0] ? strlen(s) : 0) + 1; \ + wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ + if (s[0]) \ + MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); + +#define WCHAR_TO_CHAR_ALLOC(ws, s) \ + size_t s##_size = ((ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ + char *s = (char*)calloc(s##_size, 1); \ + if (ws[0]) \ + utf16_to_char_string((const uint16_t*)ws, s, s##_size); + +#else +#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = strdup(s); +#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = strdup(ws); +#endif + +#endif diff --git a/menu/menu_event.c b/menu/menu_event.c index 5d7cdaab5e..dc31e700e4 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -200,14 +200,12 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) size_t new_scroll_accel = 0; menu_input_t *menu_input = NULL; settings_t *settings = config_get_ptr(); - static bool ok_old = false; + static char ok_old = 0; unsigned menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_B : RETRO_DEVICE_ID_JOYPAD_A; unsigned menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; - bool ok_current = input & UINT64_C(1) << menu_ok_btn; - - /* TODO/FIXME - unsafe use of type 'bool' in operation */ + char ok_current = input & UINT64_C(1) << menu_ok_btn; bool ok_trigger = ok_current & ~ok_old; ok_old = ok_current; diff --git a/retroarch.cfg b/retroarch.cfg index 7d9890a08f..489ff50820 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -1,800 +1,1610 @@ -## Skeleton config file for RetroArch - -# Save all save files (*.srm) to this directory. This includes related files like .bsv, .rtc, .psrm, etc ... -# This will be overridden by explicit command line options. -# savefile_directory = - -# Save all save states (*.state) to this directory. -# This will be overridden by explicit command line options. -# savestate_directory = - -# If set to a directory, content which is temporarily extracted -# will be extracted to this directory. -# cache_directory = - -# Save all input remapping files to this directory. -# input_remapping_directory = - -# Save all playlist files to this directory. -# playlist_directory = - -# If set to a directory, the content history playlist will be saved -# to this directory. -# content_history_dir = - -# Automatically saves a savestate at the end of RetroArch's lifetime. -# The path is $SRAM_PATH.auto. -# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. -# savestate_auto_save = false -# savestate_auto_load = true - -# Load libretro from a dynamic location for dynamically built RetroArch. -# This option is mandatory. - -# Path to a libretro implementation. -# libretro_path = "/path/to/libretro.so" - -# A directory for where to search for libretro core implementations. -# libretro_directory = - -# A directory for where to search for libretro core information. -# libretro_info_path = - -# Sets log level for libretro cores (GET_LOG_INTERFACE). -# If a log level issued by a libretro core is below libretro_log_level, it is ignored. -# DEBUG logs are always ignored unless verbose mode is activated (--verbose). -# DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3. -# libretro_log_level = 0 - -# Enable or disable verbosity level of frontend. -# log_verbosity = false - -# If this option is enabled, every content file loaded in RetroArch will be -# automatically added to a history list. -# history_list_enable = true - -# Enable or disable RetroArch performance counters -# perfcnt_enable = false - -# Path to core options config file. -# This config file is used to expose core-specific options. -# It will be written to by RetroArch. -# A default path will be assigned if not set. -# core_options_path = - -# Path to content history file. -# RetroArch keeps track of all content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_history_path = - -# Path to music content history file (optional). -# RetroArch keeps track of all music content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_music_history_path = - -# Path to image content history file (optional). -# RetroArch keeps track of all image content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_image_history_path = - -# Path to video content history file (optional). -# RetroArch keeps track of all video content loaded in the menu and from CLI directly for convenient quick loading. -# A default path will be assigned if not set. -# content_video_history_path = - -# Number of entries that will be kept in content history file. -# content_history_size = 100 - -# Sets the "system" directory. -# Implementations can query for this directory to load BIOSes, system-specific configs, etc. -# system_directory = - -# Sets start directory for menu file browser. -# rgui_browser_directory = - -# Content directory. Interacts with RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY. -# Usually set by developers who bundle libretro/RetroArch apps to point to assets. -# content_directory = - -# Assets directory. This location is queried by default when menu interfaces try to look for -# loadable assets, etc. -# assets_directory = - -# Dynamic wallpapers directory. The place to store the wallpapers dynamically -# loaded by the menu depending on context. -# dynamic_wallpapers_directory = - -# Thumbnails directory. To store thumbnail files. -# thumbnails_directory = - -# Sets start directory for menu config browser. -# rgui_config_directory = - -# Show startup screen in menu. -# Is automatically set to false when seen for the first time. -# This is only updated in config if config_save_on_exit is set to true, however. -# rgui_show_start_screen = true - -# Flushes config to disk on exit. Useful for menu as settings can be modified. -# Overwrites the config. #include's and comments are not preserved. -# config_save_on_exit = true - -# Load up a specific config file based on the core being used. -# core_specific_config = false - -# Shows hidden files and folders in directory listings. -# show_hidden_files = true - -#### Video - -# Video driver to use. "gl", "xvideo", "sdl" -# video_driver = "gl" - -# Which context implementation to use. -# Possible ones for desktop are: glx, x-egl, kms-egl, sdl-gl, wgl. -# By default, tries to use first suitable driver. -# video_context_driver = - -# Windowed x resolution scale and y resolution scale -# (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale) -# video_scale = 3.0 - -# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. -# video_fullscreen_x = 0 -# video_fullscreen_y = 0 - -# Start in fullscreen. Can be changed at runtime. -# video_fullscreen = false - -# If fullscreen, prefer using a windowed fullscreen mode. -# video_windowed_fullscreen = true - -# Which monitor to prefer. 0 (default) means no particular monitor is preferred, 1 and up (1 being first monitor), -# suggests RetroArch to use that particular monitor. -# video_monitor_index = 0 - -# Forcibly disable composition. Only works in Windows Vista/7 for now. -# video_disable_composition = false - -# Video vsync. -# video_vsync = true - -# Max amount of swapchain images. -# Single buffering = 1, Double buffering = 2, 3 = Triple buffering -# video_max_swapchain_images = 3 - -# Forcibly disable sRGB FBO support. Some Intel OpenGL drivers on Windows -# have video problems with sRGB FBO support enabled. -# video_force_srgb_disable = false - -# Attempts to hard-synchronize CPU and GPU. Can reduce latency at cost of performance. -# video_hard_sync = false - -# Sets how many frames CPU can run ahead of GPU when using video_hard_sync. -# Maximum is 3. -# video_hard_sync_frames = 0 - -# Sets how many milliseconds to delay after VSync before running the core. -# Can reduce latency at cost of higher risk of stuttering. -# Maximum is 15. -# video_frame_delay = 0 - -# Inserts a black frame inbetween frames. -# Useful for 120 Hz monitors who want to play 60 Hz material with eliminated ghosting. -# video_refresh_rate should still be configured as if it is a 60 Hz monitor (divide refresh rate by 2). -# video_black_frame_insertion = false - -# Use threaded video driver. Using this might improve performance at possible cost of latency and more video stuttering. -# video_threaded = false - -# Use a shared context for HW rendered libretro cores. -# Avoids having to assume HW state changes inbetween frames. -# video_shared_context = false - -# Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders. -# video_smooth = true - -# Forces rendering area to stay equal to content aspect ratio or as defined in video_aspect_ratio. -# video_force_aspect = true - -# Only scales video in integer steps. -# The base size depends on system-reported geometry and aspect ratio. -# If video_force_aspect is not set, X/Y will be integer scaled independently. -# video_scale_integer = false - -# A floating point value for video aspect ratio (width / height). -# If this is not set, aspect ratio is assumed to be automatic. -# Behavior then is defined by video_aspect_ratio_auto. -# video_aspect_ratio = - -# If this is true and video_aspect_ratio is not set, -# aspect ratio is decided by libretro implementation. -# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set. -# video_aspect_ratio_auto = false - -# Forces cropping of overscanned frames. -# Exact behavior of this option is implementation specific. -# video_crop_overscan = true - -# Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset) -# video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}" - -# Load video_shader on startup. -# Other shaders can still be loaded later in runtime. -# video_shader_enable = false - -# Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access. -# video_shader_dir = - -# CPU-based video filter. Path to a dynamic library. -# video_filter = - -# Defines a directory where CPU-based video filters are kept. -# video_filter_dir = - -# Path to a font used for rendering messages. This path must be defined to enable fonts. -# Do note that the _full_ path of the font is necessary! -# video_font_path = - -# Size of the font rendered. -# video_font_size = 32 - -# Enable usage of OSD messages. -# video_font_enable = true - -# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. -# [0.0, 0.0] maps to the lower left corner of the screen. -# video_message_pos_x = 0.05 -# video_message_pos_y = 0.05 - -# Color for message. The value is treated as a hexadecimal value. -# It is a regular RGB hex number, i.e. red is "ff0000". -# video_message_color = ffffff - -# Video refresh rate of your monitor. -# Used to calculate a suitable audio input rate. -# video_refresh_rate = 59.94 - -# Allows libretro cores to set rotation modes. -# Setting this to false will honor, but ignore this request. -# This is useful for vertically oriented content where one manually rotates the monitor. -# video_allow_rotate = true - -# Forces a certain rotation of the screen. -# The rotation is added to rotations which the libretro core sets (see video_allow_rotate). -# The angle is * 90 degrees counter-clockwise. -# video_rotation = 0 - -#### Audio - -# Enable audio. -# audio_enable = true - -# Mutes audio. -# audio_mute_enable = false - -# Audio output samplerate. -# audio_out_rate = 48000 - -# Audio resampler backend. Which audio resampler to use. -# Default will use "sinc". -# audio_resampler = - -# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio. -# audio_driver = - -# Override the default audio device the audio_driver uses. This is driver dependant. E.g. ALSA wants a PCM device, OSS wants a path (e.g. /dev/dsp), Jack wants portnames (e.g. system:playback1,system:playback_2), and so on ... -# audio_device = - -# Audio DSP plugin that processes audio before it's sent to the driver. Path to a dynamic library. -# audio_dsp_plugin = - -# Directory where DSP plugins are kept. -# audio_filter_dir = - -# Will sync (block) on audio. Recommended. -# audio_sync = true - -# Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. -# audio_latency = 64 - -# Enable audio rate control. -# audio_rate_control = true - -# Controls audio rate control delta. Defines how much input rate can be adjusted dynamically. -# Input rate = in_rate * (1.0 +/- audio_rate_control_delta) -# audio_rate_control_delta = 0.005 - -# Controls maximum audio timing skew. Defines the maximum change in input rate. -# Input rate = in_rate * (1.0 +/- max_timing_skew) -# audio_max_timing_skew = 0.05 - -# Audio volume. Volume is expressed in dB. -# 0 dB is normal volume. No gain will be applied. -# Gain can be controlled in runtime with input_volume_up/input_volume_down. -# audio_volume = 0.0 - -#### Overlay - -# Defines a directory where overlays are kept for easy access. -# overlay_directory = - -# Enable or disable the current overlay. -# input_overlay_enable = true - -# Hide the current overlay from appearing inside the menu. -# input_overlay_hide_in_menu = true - -# Path to input overlay. -# input_overlay = - -# Overlay opacity. -# input_overlay_opacity = 1.0 - -# Overlay scale. -# input_overlay_scale = 1.0 - -#### Input - -# Input driver. Depending on video driver, it might force a different input driver. -# input_driver = sdl - -# Input device driver. (Valid: linuxraw, sdl, dinput) -# input_joypad_driver = - -# Path to input remapping file. -# input_remapping_path = - -# Input bind timer timeout. -# Amount of seconds to wait until proceeding to the next bind. Default: 5, minimum: 1 -# input_bind_timeout = 1 - -# If enabled, overrides the input binds with the remapped binds set for the current core. -# input_remap_binds_enable = true - -# Maximum amount of users supported by RetroArch. -# input_max_users = 16 - -# Keyboard layout for input driver if applicable (udev/evdev for now). -# Syntax is either just layout (e.g. "no"), or a layout and variant separated with colon ("no:nodeadkeys"). -# input_keyboard_layout = - -# Defines axis threshold. Possible values are [0.0, 1.0] -# input_axis_threshold = 0.5 - -# Enable input auto-detection. Will attempt to autoconfigure -# joypads, Plug-and-Play style. -# input_autodetect_enable = true - -# Show the input descriptors set by the core instead of the -# default ones. -# input_descriptor_label_show = true - -# Hide input descriptors that were not set by the core. -# input_descriptor_hide_unbound = false - -# Influence how input polling is done inside RetroArch. -# 0 : Early - Input polling is performed before call to retro_run. -# 1 : Normal - Input polling is performed when retro_input_poll is -# requested. -# 2 : Late - Input polling is performed on first call to retro_input_state -# per frame -# -# Setting it to 0 or 2 can result in less latency depending on -# your configuration. -# -# When netplay is enabled, the default polling behavior (1) will -# be used regardless of the value set here. -# input_poll_type_behavior = 1 - -# Directory for joypad autoconfigs. -# If a joypad is plugged in, that joypad will be autoconfigured if a config file -# corresponding to that joypad is present in joypad_autoconfig_dir. -# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs. -# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend. -# Requires input_autodetect_enable to be enabled. -# joypad_autoconfig_dir = - -# Sets which libretro device is used for a user. -# Devices are indentified with a number. -# This is normally saved by the menu. -# Device IDs are found in libretro.h. -# These settings are overridden by explicit command-line arguments which refer to input devices. -# None: 0 -# Joypad (RetroPad): 1 -# Mouse: 2 -# Keyboard: 3 -# Generic Lightgun: 4 -# Joypad w/ Analog (RetroPad + Analog sticks): 5 -# Multitap (SNES specific): 257 -# Super Scope (SNES specific): 260 -# Justifier (SNES specific): 516 -# Justifiers (SNES specific): 772 - -# input_libretro_device_p1 = -# input_libretro_device_p2 = -# input_libretro_device_p3 = -# input_libretro_device_p4 = -# input_libretro_device_p5 = -# input_libretro_device_p6 = -# input_libretro_device_p7 = -# input_libretro_device_p8 = - -# Keyboard input. Will recognize letters ("a" to "z") and the following special keys (where "kp_" -# is for keypad keys): -# -# left, right, up, down, enter, kp_enter, tab, insert, del, end, home, -# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus, -# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, -# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown, -# keypad0, keypad1, keypad2, keypad3, keypad4, keypad5, keypad6, keypad7, keypad8, keypad9, -# period, capslock, numlock, backspace, multiply, divide, print_screen, scroll_lock, -# tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket, -# backslash, rightbracket, kp_period, kp_equals, rctrl, ralt -# -# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, -# rather than relying on a default. -# input_player1_a = "x" -# input_player1_b = "z" -# input_player1_y = "a" -# input_player1_x = "s" -# input_player1_start = "enter" -# input_player1_select = "rshift" -# input_player1_l = "q" -# input_player1_r = "w" -# input_player1_left = "left" -# input_player1_right = "right" -# input_player1_up = "up" -# input_player1_down = "down" -# input_player1_l2 = -# input_player1_r2 = -# input_player1_l3 = -# input_player1_r3 = - -# Two analog sticks (DualShock-esque). -# Bound as usual, however, if a real analog axis is bound, -# it can be read as a true analog. -# Positive X axis is right, Positive Y axis is down. -# input_player1_l_x_plus = -# input_player1_l_x_minus = -# input_player1_l_y_plus = -# input_player1_l_y_minus = -# input_player1_r_x_plus = -# input_player1_r_x_minus = -# input_player1_r_y_plus = -# input_player1_r_y_minus = - -# If desired, it is possible to override which joypads are being used for user 1 through 8. -# First joypad available is 0. -# input_player1_joypad_index = 0 -# input_player2_joypad_index = 1 -# input_player3_joypad_index = 2 -# input_player4_joypad_index = 3 -# input_player5_joypad_index = 4 -# input_player6_joypad_index = 5 -# input_player7_joypad_index = 6 -# input_player8_joypad_index = 7 - -# Input device buttons. -# Figure these out by using RetroArch-Phoenix or retroarch-joyconfig. -# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. -# E.g. "h0up" -# input_player1_a_btn = -# input_player1_b_btn = -# input_player1_y_btn = -# input_player1_x_btn = -# input_player1_start_btn = -# input_player1_select_btn = -# input_player1_l_btn = -# input_player1_r_btn = -# input_player1_left_btn = -# input_player1_right_btn = -# input_player1_up_btn = -# input_player1_down_btn = -# input_player1_l2_btn = -# input_player1_r2_btn = -# input_player1_l3_btn = -# input_player1_r3_btn = - -# Menu buttons. -# menu_search_btn = -# menu_info_btn = -# menu_default_btn = -# menu_scroll_down_btn = -# menu_scroll_up_btn = - -# Swap buttons for OK/Cancel -# menu_swap_ok_cancel_buttons = false - -# Axis for RetroArch D-Pad. -# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. -# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. -# input_player1_left_axis = -# input_player1_right_axis = -# input_player1_up_axis = -# input_player1_down_axis = - -# Holding the turbo while pressing another button will let the button enter a turbo mode -# where the button state is modulated with a periodic signal. -# The modulation stops when the button itself (not turbo button) is released. -# input_player1_turbo = - -# Describes the period and how long of that period a turbo-enabled button should behave. -# Numbers are described in frames. -# input_turbo_period = 6 -# input_turbo_duty_cycle = 3 - -# This goes all the way to user 8 (*_player2_*, *_player3_*, etc), but omitted for clarity. -# All input binds have corresponding binds for keyboard (none), joykeys (_btn) and joyaxes (_axis) as well. - -# Toggles fullscreen. -# input_toggle_fullscreen = f - -# Saves state. -# input_save_state = f2 -# Loads state. -# input_load_state = f4 - -# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline). -# When slot is != 0, path will be $path%d, where %d is slot number. -# input_state_slot_increase = f7 -# input_state_slot_decrease = f6 - -# Toggles between fast-forwarding and normal speed. -# input_toggle_fast_forward = space - -# Hold for fast-forward. Releasing button disables fast-forward. -# input_hold_fast_forward = l - -# Key to exit RetroArch cleanly. -# Killing it in any hard way (SIGKILL, etc) will terminate RetroArch without saving RAM, etc. -# On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization. -# input_exit_emulator = escape - - -# Applies next and previous shader in directory. -# input_shader_next = m -# input_shader_prev = n - -# Hold button down to rewind. Rewinding must be enabled. -# input_rewind = r - -# Toggle between recording and not. -# input_movie_record_toggle = o - -# Toggle between paused and non-paused state -# input_pause_toggle = p - -# Frame advance when content is paused -# input_frame_advance = k - -# Reset the content. -# input_reset = h - -# Cheats. -# input_cheat_index_plus = y -# input_cheat_index_minus = t -# input_cheat_toggle = u - -# Mute/unmute audio -# input_audio_mute = f9 - -# Take screenshot -# input_screenshot = f8 - -# Netplay flip users. -# input_netplay_flip_players = i - -# Hold for slowmotion. -# input_slowmotion = e - -# Enable other hotkeys. -# If this hotkey is bound to either keyboard, joybutton or joyaxis, -# all other hotkeys will be disabled unless this hotkey is also held at the same time. -# This is useful for RETRO_KEYBOARD centric implementations -# which query a large area of the keyboard, where it is not desirable -# that hotkeys get in the way. - -# Alternatively, all hotkeys for keyboard could be disabled by the user. -# input_enable_hotkey_btn = - -# Increases audio volume. -# input_volume_up = kp_plus -# Decreases audio volume. -# input_volume_down = kp_minus - -# Toggles to next overlay. Wraps around. -# input_overlay_next = - -# Toggles eject for disks. Used for multiple-disk content. -# input_disk_eject_toggle = - -# Cycles through disk images. Use after ejecting. -# Complete by toggling eject again. -# input_disk_next = - -# Toggles menu. -# input_menu_toggle = f1 - -# RetroPad button combination to toggle menu -# 0 = none, 1 = L + R + Y + D-Pad Down, 2 = L3 + R3, 3 = Start + Select -# input_menu_toggle_gamepad_combo = 0 - -# allow any RetroPad to control the menu -# all_users_control_menu = false - -# Toggles mouse grab. When mouse is grabbed, RetroArch hides the mouse, -# and keeps the mouse pointer inside the window to allow relative mouse input -# to work better. -# input_grab_mouse_toggle = f11 - -#### Menu - -# Menu driver to use. "rgui", "lakka", etc. -# menu_driver = "rgui" - -# If disabled, the libretro core will keep running in the background when we -# are in the menu. -# menu_pause_libretro = false - -# Enable mouse input inside the menu. -# menu_mouse_enable = false - -# Enable touch input inside the menu. -# menu_pointer_enable = false - -# Shows current date and/or time inside menu. -# menu_timedate_enable = true - -# Shows current core inside menu. -# menu_core_enable = true - -# Path to an image to set as menu wallpaper. -# menu_wallpaper = - -# Dynamically load a new wallpaper depending on context. -# menu_dynamic_wallpaper_enable = false - -# Type of thumbnail to display. 0 = none, 1 = snaps, 2 = titles, 3 = boxarts -# menu_thumbnails = 0 - -# Wrap-around to beginning and/or end if boundary of list is reached horizontally or vertically -# menu_navigation_wraparound_enable = false - -# Filter files being show in 'Load Content' by supported extensions -# menu_navigation_browser_filter_supported_extensions_enable = true - -# Collapse subgroup settings into main group to create one big listing of settings -# per category. -# menu_collapse_subgroups_enable = false - -#### Core -# -# Prevent libretro cores from closing RetroArch on exit by loading a dummy core. -# load_dummy_on_core_shutdown = "true" - -# Check for firmware requirement(s) before loading a content. -# check_firmware_before_loading = "false" - -#### UI - -# Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored -# by video driver. -# suspend_screensaver_enable = true - -# Start UI companion driver's interface on boot (if available). -# ui_companion_start_on_boot = true - -#### Camera - -# Override the default camera device the camera driver uses. This is driver dependant. -# camera_device = - -# Override the default privacy permission for cores that want to access camera services. Is "false" by default. -# camera_allow = false - -#### Location - -# Override the default privacy permission for cores that want to access location services. Is "false" by default. -# location_allow = false - -#### Core Updater - -# URL to core update directory on buildbot. -# core_updater_buildbot_url = "http://buildbot.libretro.com" - -# URL to assets update directory on buildbot. -# core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" - -# After downloading, automatically extract archives that the downloads are contained inside. -# core_updater_auto_extract_archive = true - -#### Network - -# When being client over netplay, use keybinds for user 1. -# netplay_client_swap_input = false - -# The username of the person running RetroArch. This will be used for playing online, for instance. -# netplay_nickname = - -# The amount of delay frames to use for netplay. Increasing this value will increase -# performance, but introduce more latency. -# netplay_delay_frames = 0 - -# Netplay mode for the current user. -# false is Server, true is Client. -# netplay_mode = false - -# Enable or disable spectator mode for the user during netplay. -# netplay_spectator_mode_enable = false - -# The IP Address of the host to connect to. -# netplay_ip_address = - -# The port of the host IP Address. Can be either a TCP or UDP port. -# netplay_ip_port = 55435 - -#### Misc - -# Enable rewinding. This will take a performance hit when playing, so it is disabled by default. -# rewind_enable = false - -# Rewinding buffer size in megabytes. Bigger rewinding buffer means you can rewind longer. -# The buffer should be approx. 20MB per minute of buffer time. -# rewind_buffer_size = 20 - -# Rewind granularity. When rewinding defined number of frames, you can rewind several frames at a time, increasing the rewinding speed. -# rewind_granularity = 1 - -# Pause gameplay when window focus is lost. -# pause_nonactive = true - -# Autosaves the non-volatile SRAM at a regular interval. This is disabled by default unless set otherwise. -# The interval is measured in seconds. A value of 0 disables autosave. -# autosave_interval = - -# Path to content database directory. -# content_database_path = - -# Path to cheat database directory. -# cheat_database_path = - -# Directory to dump screenshots to. -# screenshot_directory = - -# Records video after CPU video filter. -# video_post_filter_record = false - -# Records output of GPU shaded material if available. -# video_gpu_record = false - -# Screenshots output of GPU shaded material if available. -# video_gpu_screenshot = true - -# Block SRAM from being overwritten when loading save states. -# Might potentially lead to buggy games. -# block_sram_overwrite = false - -# When saving a savestate, save state index is automatically increased before -# it is saved. -# Also, when loading content, the index will be set to the highest existing index. -# There is no upper bound on the index. -# savestate_auto_index = false - -# Slowmotion ratio. When slowmotion, content will slow down by factor. -# slowmotion_ratio = 3.0 - -# The maximum rate at which content will be run when using fast forward. (E.g. 5.0 for 60 fps content => 300 fps cap). -# RetroArch will go to sleep to ensure that the maximum rate will not be exceeded. -# Do not rely on this cap to be perfectly accurate. -# If this is set at 0, then fastforward ratio is unlimited (no FPS cap) -# fastforward_ratio = 0.0 - -# Enable stdin/network command interface. -# network_cmd_enable = false -# network_cmd_port = 55355 -# stdin_cmd_enable = false - -#### Bundle extraction - - +video_driver = "caca" +core_updater_buildbot_url = "http://buildbot.libretro.com/nightly/win-x86_64/latest/" +core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" +libretro_directory = "cores" +libretro_info_path = "info" +content_database_path = "database\rdb" +cheat_database_path = "cheats" +content_history_path = ".\content_history.lpl" +content_music_history_path = ".\content_music_history.lpl" +content_video_history_path = ".\content_video_history.lpl" +content_image_history_path = ".\content_image_history.lpl" +cursor_directory = "database\cursors" +screenshot_directory = "default" +system_directory = "default" +input_remapping_directory = "config\remaps" +video_shader_dir = "shaders" +video_filter_dir = "filters\video" +core_assets_directory = "downloads" +assets_directory = "assets" +dynamic_wallpapers_directory = "assets\wallpapers" +thumbnails_directory = "thumbnails" +playlist_directory = "playlists" +joypad_autoconfig_dir = "autoconfig" +audio_filter_dir = "filters\audio" +savefile_directory = "default" +savestate_directory = "default" +rgui_browser_directory = "default" +rgui_config_directory = "config" +overlay_directory = "overlays" +screenshot_directory = "default" +record_driver = "null" +camera_driver = "null" +wifi_driver = "null" +location_driver = "null" +menu_driver = "xmb" +audio_driver = "xaudio" +audio_resampler = "sinc" +input_driver = "dinput" +input_joypad_driver = "xinput" +video_aspect_ratio = "-1.000000" +video_scale = "3.000000" +video_refresh_rate = "59.940060" +audio_rate_control_delta = "0.005000" +audio_max_timing_skew = "0.050000" +audio_volume = "0.000000" +input_overlay_opacity = "0.700000" +input_overlay_scale = "1.000000" +menu_wallpaper_opacity = "0.300000" +menu_footer_opacity = "1.000000" +menu_header_opacity = "1.000000" +video_message_pos_x = "0.050000" +video_message_pos_y = "0.050000" +video_font_size = "32.000000" +fastforward_ratio = "0.000000" +slowmotion_ratio = "3.000000" +input_axis_threshold = "0.500000" +input_bind_timeout = "5" +input_turbo_period = "6" +input_duty_cycle = "3" +input_max_users = "5" +input_menu_toggle_gamepad_combo = "0" +audio_latency = "64" +audio_block_frames = "0" +rewind_granularity = "1" +autosave_interval = "0" +libretro_log_level = "0" +keyboard_gamepad_mapping_type = "1" +input_poll_type_behavior = "2" +video_monitor_index = "0" +video_fullscreen_x = "0" +video_fullscreen_y = "0" +video_window_x = "0" +video_window_y = "0" +network_cmd_port = "55355" +network_remote_base_port = "55400" +dpi_override_value = "200" +menu_thumbnails = "3" +xmb_alpha_factor = "75" +xmb_scale_factor = "100" +xmb_theme = "0" +xmb_menu_color_theme = "4" +materialui_menu_color_theme = "0" +menu_shader_pipeline = "2" +audio_out_rate = "48000" +custom_viewport_width = "960" +custom_viewport_height = "720" +custom_viewport_x = "0" +custom_viewport_y = "0" +content_history_size = "100" +video_hard_sync_frames = "0" +video_frame_delay = "0" +video_max_swapchain_images = "3" +video_swap_interval = "1" +video_rotation = "0" +aspect_ratio_index = "21" +state_slot = "0" +netplay_ip_port = "0" +netplay_delay_frames = "16" +netplay_check_frames = "30" +user_language = "0" +bundle_assets_extract_version_current = "0" +bundle_assets_extract_last_version = "0" +input_device_p1 = "0" +input_player1_joypad_index = "0" +input_libretro_device_p1 = "1" +input_player1_analog_dpad_mode = "0" +input_device_p2 = "0" +input_player2_joypad_index = "1" +input_libretro_device_p2 = "1" +input_player2_analog_dpad_mode = "0" +input_device_p3 = "0" +input_player3_joypad_index = "2" +input_libretro_device_p3 = "1" +input_player3_analog_dpad_mode = "0" +input_device_p4 = "0" +input_player4_joypad_index = "3" +input_libretro_device_p4 = "1" +input_player4_analog_dpad_mode = "0" +input_device_p5 = "0" +input_player5_joypad_index = "4" +input_libretro_device_p5 = "1" +input_player5_analog_dpad_mode = "0" +input_device_p6 = "0" +input_player6_joypad_index = "5" +input_libretro_device_p6 = "1" +input_player6_analog_dpad_mode = "0" +input_device_p7 = "0" +input_player7_joypad_index = "6" +input_libretro_device_p7 = "1" +input_player7_analog_dpad_mode = "0" +input_device_p8 = "0" +input_player8_joypad_index = "7" +input_libretro_device_p8 = "1" +input_player8_analog_dpad_mode = "0" +input_device_p9 = "0" +input_player9_joypad_index = "8" +input_libretro_device_p9 = "1" +input_player9_analog_dpad_mode = "0" +input_device_p10 = "0" +input_player10_joypad_index = "9" +input_libretro_device_p10 = "1" +input_player10_analog_dpad_mode = "0" +input_device_p11 = "0" +input_player11_joypad_index = "10" +input_libretro_device_p11 = "1" +input_player11_analog_dpad_mode = "0" +input_device_p12 = "0" +input_player12_joypad_index = "11" +input_libretro_device_p12 = "1" +input_player12_analog_dpad_mode = "0" +input_device_p13 = "0" +input_player13_joypad_index = "12" +input_libretro_device_p13 = "1" +input_player13_analog_dpad_mode = "0" +input_device_p14 = "0" +input_player14_joypad_index = "13" +input_libretro_device_p14 = "1" +input_player14_analog_dpad_mode = "0" +input_device_p15 = "0" +input_player15_joypad_index = "14" +input_libretro_device_p15 = "1" +input_player15_analog_dpad_mode = "0" +input_device_p16 = "0" +input_player16_joypad_index = "15" +input_libretro_device_p16 = "1" +input_player16_analog_dpad_mode = "0" +ui_companion_start_on_boot = "true" +ui_companion_enable = "false" +video_gpu_record = "false" +input_remap_binds_enable = "true" +all_users_control_menu = "false" +menu_swap_ok_cancel_buttons = "true" +netplay_client_swap_input = "true" +input_descriptor_label_show = "true" +input_descriptor_hide_unbound = "false" +load_dummy_on_core_shutdown = "true" +check_firmware_before_loading = "false" +builtin_mediaplayer_enable = "false" +builtin_imageviewer_enable = "true" +fps_show = "false" +ui_menubar_enable = "true" +suspend_screensaver_enable = "true" +rewind_enable = "false" +audio_sync = "true" +video_shader_enable = "false" +video_aspect_ratio_auto = "false" +video_allow_rotate = "true" +video_windowed_fullscreen = "true" +video_crop_overscan = "true" +video_scale_integer = "false" +video_smooth = "true" +video_force_aspect = "true" +video_threaded = "false" +video_shared_context = "false" +custom_bgm_enable = "false" +auto_screenshot_filename = "true" +video_force_srgb_disable = "false" +video_fullscreen = "false" +bundle_assets_extract_enable = "false" +video_vsync = "true" +video_hard_sync = "false" +video_black_frame_insertion = "false" +video_disable_composition = "false" +pause_nonactive = "true" +video_gpu_screenshot = "true" +video_post_filter_record = "false" +keyboard_gamepad_enable = "true" +core_set_supports_no_game_enable = "true" +audio_enable = "true" +audio_mute_enable = "false" +location_allow = "false" +video_font_enable = "true" +core_updater_auto_extract_archive = "true" +camera_allow = "false" +threaded_data_runloop_enable = "true" +menu_throttle_framerate = "true" +menu_linear_filter = "true" +dpi_override_enable = "true" +menu_pause_libretro = "true" +menu_mouse_enable = "true" +menu_pointer_enable = "false" +menu_timedate_enable = "true" +menu_core_enable = "true" +menu_dynamic_wallpaper_enable = "false" +xmb_shadows_enable = "true" +xmb_show_settings = "true" +xmb_show_images = "true" +xmb_show_history = "true" +rgui_show_start_screen = "false" +menu_navigation_wraparound_enable = "true" +menu_navigation_browser_filter_supported_extensions_enable = "true" +menu_show_advanced_settings = "true" +cheevos_enable = "false" +cheevos_test_unofficial = "false" +cheevos_hardcore_mode_enable = "false" +input_overlay_enable = "true" +input_overlay_enable_autopreferred = "true" +input_overlay_hide_in_menu = "true" +network_cmd_enable = "false" +stdin_cmd_enable = "false" +network_remote_enable = "false" +netplay_spectator_mode_enable = "false" +netplay_nat_traversal = "true" +block_sram_overwrite = "false" +savestate_auto_index = "false" +savestate_auto_save = "false" +savestate_auto_load = "false" +savestate_thumbnail_enable = "false" +history_list_enable = "true" +game_specific_options = "false" +auto_overrides_enable = "true" +auto_remaps_enable = "true" +auto_shaders_enable = "true" +sort_savefiles_enable = "false" +sort_savestates_enable = "false" +config_save_on_exit = "true" +show_hidden_files = "true" +input_autodetect_enable = "true" +audio_rate_control = "true" +network_remote_enable_user_p1 = "false" +network_remote_enable_user_p2 = "false" +network_remote_enable_user_p3 = "false" +network_remote_enable_user_p4 = "false" +network_remote_enable_user_p5 = "false" +network_remote_enable_user_p6 = "false" +network_remote_enable_user_p7 = "false" +network_remote_enable_user_p8 = "false" +network_remote_enable_user_p9 = "false" +network_remote_enable_user_p10 = "false" +network_remote_enable_user_p11 = "false" +network_remote_enable_user_p12 = "false" +network_remote_enable_user_p13 = "false" +network_remote_enable_user_p14 = "false" +network_remote_enable_user_p15 = "false" +network_remote_enable_user_p16 = "false" +log_verbosity = "false" +perfcnt_enable = "false" +video_message_color = "ffff00" +menu_entry_normal_color = "ffffffff" +menu_entry_hover_color = "ff64ff64" +menu_title_color = "ff64ff64" +gamma_correction = "false" +flicker_filter_enable = "false" +soft_filter_enable = "false" +soft_filter_index = "0" +current_resolution_id = "0" +flicker_filter_index = "0" +input_player1_b = "z" +input_player1_b_btn = "nul" +input_player1_b_axis = "nul" +input_player1_y = "a" +input_player1_y_btn = "nul" +input_player1_y_axis = "nul" +input_player1_select = "rshift" +input_player1_select_btn = "nul" +input_player1_select_axis = "nul" +input_player1_start = "enter" +input_player1_start_btn = "nul" +input_player1_start_axis = "nul" +input_player1_up = "up" +input_player1_up_btn = "nul" +input_player1_up_axis = "nul" +input_player1_down = "down" +input_player1_down_btn = "nul" +input_player1_down_axis = "nul" +input_player1_left = "left" +input_player1_left_btn = "nul" +input_player1_left_axis = "nul" +input_player1_right = "right" +input_player1_right_btn = "nul" +input_player1_right_axis = "nul" +input_player1_a = "x" +input_player1_a_btn = "nul" +input_player1_a_axis = "nul" +input_player1_x = "s" +input_player1_x_btn = "nul" +input_player1_x_axis = "nul" +input_player1_l = "q" +input_player1_l_btn = "nul" +input_player1_l_axis = "nul" +input_player1_r = "w" +input_player1_r_btn = "nul" +input_player1_r_axis = "nul" +input_player1_l2 = "nul" +input_player1_l2_btn = "nul" +input_player1_l2_axis = "nul" +input_player1_r2 = "nul" +input_player1_r2_btn = "nul" +input_player1_r2_axis = "nul" +input_player1_l3 = "nul" +input_player1_l3_btn = "nul" +input_player1_l3_axis = "nul" +input_player1_r3 = "nul" +input_player1_r3_btn = "nul" +input_player1_r3_axis = "nul" +input_player1_l_x_plus = "nul" +input_player1_l_x_plus_btn = "nul" +input_player1_l_x_plus_axis = "nul" +input_player1_l_x_minus = "nul" +input_player1_l_x_minus_btn = "nul" +input_player1_l_x_minus_axis = "nul" +input_player1_l_y_plus = "nul" +input_player1_l_y_plus_btn = "nul" +input_player1_l_y_plus_axis = "nul" +input_player1_l_y_minus = "nul" +input_player1_l_y_minus_btn = "nul" +input_player1_l_y_minus_axis = "nul" +input_player1_r_x_plus = "nul" +input_player1_r_x_plus_btn = "nul" +input_player1_r_x_plus_axis = "nul" +input_player1_r_x_minus = "nul" +input_player1_r_x_minus_btn = "nul" +input_player1_r_x_minus_axis = "nul" +input_player1_r_y_plus = "nul" +input_player1_r_y_plus_btn = "nul" +input_player1_r_y_plus_axis = "nul" +input_player1_r_y_minus = "nul" +input_player1_r_y_minus_btn = "nul" +input_player1_r_y_minus_axis = "nul" +input_player1_turbo = "nul" +input_player1_turbo_btn = "nul" +input_player1_turbo_axis = "nul" +input_toggle_fast_forward = "space" +input_toggle_fast_forward_btn = "nul" +input_toggle_fast_forward_axis = "nul" +input_hold_fast_forward = "l" +input_hold_fast_forward_btn = "nul" +input_hold_fast_forward_axis = "nul" +input_load_state = "f4" +input_load_state_btn = "nul" +input_load_state_axis = "nul" +input_save_state = "f2" +input_save_state_btn = "nul" +input_save_state_axis = "nul" +input_toggle_fullscreen = "f" +input_toggle_fullscreen_btn = "nul" +input_toggle_fullscreen_axis = "nul" +input_exit_emulator = "escape" +input_exit_emulator_btn = "nul" +input_exit_emulator_axis = "nul" +input_state_slot_increase = "f7" +input_state_slot_increase_btn = "nul" +input_state_slot_increase_axis = "nul" +input_state_slot_decrease = "f6" +input_state_slot_decrease_btn = "nul" +input_state_slot_decrease_axis = "nul" +input_rewind = "r" +input_rewind_btn = "nul" +input_rewind_axis = "nul" +input_movie_record_toggle = "o" +input_movie_record_toggle_btn = "nul" +input_movie_record_toggle_axis = "nul" +input_pause_toggle = "p" +input_pause_toggle_btn = "nul" +input_pause_toggle_axis = "nul" +input_frame_advance = "k" +input_frame_advance_btn = "nul" +input_frame_advance_axis = "nul" +input_reset = "h" +input_reset_btn = "nul" +input_reset_axis = "nul" +input_shader_next = "m" +input_shader_next_btn = "nul" +input_shader_next_axis = "nul" +input_shader_prev = "n" +input_shader_prev_btn = "nul" +input_shader_prev_axis = "nul" +input_cheat_index_plus = "y" +input_cheat_index_plus_btn = "nul" +input_cheat_index_plus_axis = "nul" +input_cheat_index_minus = "t" +input_cheat_index_minus_btn = "nul" +input_cheat_index_minus_axis = "nul" +input_cheat_toggle = "u" +input_cheat_toggle_btn = "nul" +input_cheat_toggle_axis = "nul" +input_screenshot = "f8" +input_screenshot_btn = "nul" +input_screenshot_axis = "nul" +input_audio_mute = "f9" +input_audio_mute_btn = "nul" +input_audio_mute_axis = "nul" +input_osk_toggle = "f12" +input_osk_toggle_btn = "nul" +input_osk_toggle_axis = "nul" +input_netplay_flip_players = "i" +input_netplay_flip_players_btn = "nul" +input_netplay_flip_players_axis = "nul" +input_slowmotion = "e" +input_slowmotion_btn = "nul" +input_slowmotion_axis = "nul" +input_enable_hotkey = "nul" +input_enable_hotkey_btn = "nul" +input_enable_hotkey_axis = "nul" +input_volume_up = "add" +input_volume_up_btn = "nul" +input_volume_up_axis = "nul" +input_volume_down = "subtract" +input_volume_down_btn = "nul" +input_volume_down_axis = "nul" +input_overlay_next = "nul" +input_overlay_next_btn = "nul" +input_overlay_next_axis = "nul" +input_disk_eject_toggle = "nul" +input_disk_eject_toggle_btn = "nul" +input_disk_eject_toggle_axis = "nul" +input_disk_next = "nul" +input_disk_next_btn = "nul" +input_disk_next_axis = "nul" +input_disk_prev = "nul" +input_disk_prev_btn = "nul" +input_disk_prev_axis = "nul" +input_grab_mouse_toggle = "f11" +input_grab_mouse_toggle_btn = "nul" +input_grab_mouse_toggle_axis = "nul" +input_menu_toggle = "f1" +input_menu_toggle_btn = "nul" +input_menu_toggle_axis = "nul" +input_player2_b = "nul" +input_player2_b_btn = "nul" +input_player2_b_axis = "nul" +input_player2_y = "nul" +input_player2_y_btn = "nul" +input_player2_y_axis = "nul" +input_player2_select = "nul" +input_player2_select_btn = "nul" +input_player2_select_axis = "nul" +input_player2_start = "nul" +input_player2_start_btn = "nul" +input_player2_start_axis = "nul" +input_player2_up = "nul" +input_player2_up_btn = "nul" +input_player2_up_axis = "nul" +input_player2_down = "nul" +input_player2_down_btn = "nul" +input_player2_down_axis = "nul" +input_player2_left = "nul" +input_player2_left_btn = "nul" +input_player2_left_axis = "nul" +input_player2_right = "nul" +input_player2_right_btn = "nul" +input_player2_right_axis = "nul" +input_player2_a = "nul" +input_player2_a_btn = "nul" +input_player2_a_axis = "nul" +input_player2_x = "nul" +input_player2_x_btn = "nul" +input_player2_x_axis = "nul" +input_player2_l = "nul" +input_player2_l_btn = "nul" +input_player2_l_axis = "nul" +input_player2_r = "nul" +input_player2_r_btn = "nul" +input_player2_r_axis = "nul" +input_player2_l2 = "nul" +input_player2_l2_btn = "nul" +input_player2_l2_axis = "nul" +input_player2_r2 = "nul" +input_player2_r2_btn = "nul" +input_player2_r2_axis = "nul" +input_player2_l3 = "nul" +input_player2_l3_btn = "nul" +input_player2_l3_axis = "nul" +input_player2_r3 = "nul" +input_player2_r3_btn = "nul" +input_player2_r3_axis = "nul" +input_player2_l_x_plus = "nul" +input_player2_l_x_plus_btn = "nul" +input_player2_l_x_plus_axis = "nul" +input_player2_l_x_minus = "nul" +input_player2_l_x_minus_btn = "nul" +input_player2_l_x_minus_axis = "nul" +input_player2_l_y_plus = "nul" +input_player2_l_y_plus_btn = "nul" +input_player2_l_y_plus_axis = "nul" +input_player2_l_y_minus = "nul" +input_player2_l_y_minus_btn = "nul" +input_player2_l_y_minus_axis = "nul" +input_player2_r_x_plus = "nul" +input_player2_r_x_plus_btn = "nul" +input_player2_r_x_plus_axis = "nul" +input_player2_r_x_minus = "nul" +input_player2_r_x_minus_btn = "nul" +input_player2_r_x_minus_axis = "nul" +input_player2_r_y_plus = "nul" +input_player2_r_y_plus_btn = "nul" +input_player2_r_y_plus_axis = "nul" +input_player2_r_y_minus = "nul" +input_player2_r_y_minus_btn = "nul" +input_player2_r_y_minus_axis = "nul" +input_player2_turbo = "nul" +input_player2_turbo_btn = "nul" +input_player2_turbo_axis = "nul" +input_player3_b = "nul" +input_player3_b_btn = "nul" +input_player3_b_axis = "nul" +input_player3_y = "nul" +input_player3_y_btn = "nul" +input_player3_y_axis = "nul" +input_player3_select = "nul" +input_player3_select_btn = "nul" +input_player3_select_axis = "nul" +input_player3_start = "nul" +input_player3_start_btn = "nul" +input_player3_start_axis = "nul" +input_player3_up = "nul" +input_player3_up_btn = "nul" +input_player3_up_axis = "nul" +input_player3_down = "nul" +input_player3_down_btn = "nul" +input_player3_down_axis = "nul" +input_player3_left = "nul" +input_player3_left_btn = "nul" +input_player3_left_axis = "nul" +input_player3_right = "nul" +input_player3_right_btn = "nul" +input_player3_right_axis = "nul" +input_player3_a = "nul" +input_player3_a_btn = "nul" +input_player3_a_axis = "nul" +input_player3_x = "nul" +input_player3_x_btn = "nul" +input_player3_x_axis = "nul" +input_player3_l = "nul" +input_player3_l_btn = "nul" +input_player3_l_axis = "nul" +input_player3_r = "nul" +input_player3_r_btn = "nul" +input_player3_r_axis = "nul" +input_player3_l2 = "nul" +input_player3_l2_btn = "nul" +input_player3_l2_axis = "nul" +input_player3_r2 = "nul" +input_player3_r2_btn = "nul" +input_player3_r2_axis = "nul" +input_player3_l3 = "nul" +input_player3_l3_btn = "nul" +input_player3_l3_axis = "nul" +input_player3_r3 = "nul" +input_player3_r3_btn = "nul" +input_player3_r3_axis = "nul" +input_player3_l_x_plus = "nul" +input_player3_l_x_plus_btn = "nul" +input_player3_l_x_plus_axis = "nul" +input_player3_l_x_minus = "nul" +input_player3_l_x_minus_btn = "nul" +input_player3_l_x_minus_axis = "nul" +input_player3_l_y_plus = "nul" +input_player3_l_y_plus_btn = "nul" +input_player3_l_y_plus_axis = "nul" +input_player3_l_y_minus = "nul" +input_player3_l_y_minus_btn = "nul" +input_player3_l_y_minus_axis = "nul" +input_player3_r_x_plus = "nul" +input_player3_r_x_plus_btn = "nul" +input_player3_r_x_plus_axis = "nul" +input_player3_r_x_minus = "nul" +input_player3_r_x_minus_btn = "nul" +input_player3_r_x_minus_axis = "nul" +input_player3_r_y_plus = "nul" +input_player3_r_y_plus_btn = "nul" +input_player3_r_y_plus_axis = "nul" +input_player3_r_y_minus = "nul" +input_player3_r_y_minus_btn = "nul" +input_player3_r_y_minus_axis = "nul" +input_player3_turbo = "nul" +input_player3_turbo_btn = "nul" +input_player3_turbo_axis = "nul" +input_player4_b = "nul" +input_player4_b_btn = "nul" +input_player4_b_axis = "nul" +input_player4_y = "nul" +input_player4_y_btn = "nul" +input_player4_y_axis = "nul" +input_player4_select = "nul" +input_player4_select_btn = "nul" +input_player4_select_axis = "nul" +input_player4_start = "nul" +input_player4_start_btn = "nul" +input_player4_start_axis = "nul" +input_player4_up = "nul" +input_player4_up_btn = "nul" +input_player4_up_axis = "nul" +input_player4_down = "nul" +input_player4_down_btn = "nul" +input_player4_down_axis = "nul" +input_player4_left = "nul" +input_player4_left_btn = "nul" +input_player4_left_axis = "nul" +input_player4_right = "nul" +input_player4_right_btn = "nul" +input_player4_right_axis = "nul" +input_player4_a = "nul" +input_player4_a_btn = "nul" +input_player4_a_axis = "nul" +input_player4_x = "nul" +input_player4_x_btn = "nul" +input_player4_x_axis = "nul" +input_player4_l = "nul" +input_player4_l_btn = "nul" +input_player4_l_axis = "nul" +input_player4_r = "nul" +input_player4_r_btn = "nul" +input_player4_r_axis = "nul" +input_player4_l2 = "nul" +input_player4_l2_btn = "nul" +input_player4_l2_axis = "nul" +input_player4_r2 = "nul" +input_player4_r2_btn = "nul" +input_player4_r2_axis = "nul" +input_player4_l3 = "nul" +input_player4_l3_btn = "nul" +input_player4_l3_axis = "nul" +input_player4_r3 = "nul" +input_player4_r3_btn = "nul" +input_player4_r3_axis = "nul" +input_player4_l_x_plus = "nul" +input_player4_l_x_plus_btn = "nul" +input_player4_l_x_plus_axis = "nul" +input_player4_l_x_minus = "nul" +input_player4_l_x_minus_btn = "nul" +input_player4_l_x_minus_axis = "nul" +input_player4_l_y_plus = "nul" +input_player4_l_y_plus_btn = "nul" +input_player4_l_y_plus_axis = "nul" +input_player4_l_y_minus = "nul" +input_player4_l_y_minus_btn = "nul" +input_player4_l_y_minus_axis = "nul" +input_player4_r_x_plus = "nul" +input_player4_r_x_plus_btn = "nul" +input_player4_r_x_plus_axis = "nul" +input_player4_r_x_minus = "nul" +input_player4_r_x_minus_btn = "nul" +input_player4_r_x_minus_axis = "nul" +input_player4_r_y_plus = "nul" +input_player4_r_y_plus_btn = "nul" +input_player4_r_y_plus_axis = "nul" +input_player4_r_y_minus = "nul" +input_player4_r_y_minus_btn = "nul" +input_player4_r_y_minus_axis = "nul" +input_player4_turbo = "nul" +input_player4_turbo_btn = "nul" +input_player4_turbo_axis = "nul" +input_player5_b = "nul" +input_player5_b_btn = "nul" +input_player5_b_axis = "nul" +input_player5_y = "nul" +input_player5_y_btn = "nul" +input_player5_y_axis = "nul" +input_player5_select = "nul" +input_player5_select_btn = "nul" +input_player5_select_axis = "nul" +input_player5_start = "nul" +input_player5_start_btn = "nul" +input_player5_start_axis = "nul" +input_player5_up = "nul" +input_player5_up_btn = "nul" +input_player5_up_axis = "nul" +input_player5_down = "nul" +input_player5_down_btn = "nul" +input_player5_down_axis = "nul" +input_player5_left = "nul" +input_player5_left_btn = "nul" +input_player5_left_axis = "nul" +input_player5_right = "nul" +input_player5_right_btn = "nul" +input_player5_right_axis = "nul" +input_player5_a = "nul" +input_player5_a_btn = "nul" +input_player5_a_axis = "nul" +input_player5_x = "nul" +input_player5_x_btn = "nul" +input_player5_x_axis = "nul" +input_player5_l = "nul" +input_player5_l_btn = "nul" +input_player5_l_axis = "nul" +input_player5_r = "nul" +input_player5_r_btn = "nul" +input_player5_r_axis = "nul" +input_player5_l2 = "nul" +input_player5_l2_btn = "nul" +input_player5_l2_axis = "nul" +input_player5_r2 = "nul" +input_player5_r2_btn = "nul" +input_player5_r2_axis = "nul" +input_player5_l3 = "nul" +input_player5_l3_btn = "nul" +input_player5_l3_axis = "nul" +input_player5_r3 = "nul" +input_player5_r3_btn = "nul" +input_player5_r3_axis = "nul" +input_player5_l_x_plus = "nul" +input_player5_l_x_plus_btn = "nul" +input_player5_l_x_plus_axis = "nul" +input_player5_l_x_minus = "nul" +input_player5_l_x_minus_btn = "nul" +input_player5_l_x_minus_axis = "nul" +input_player5_l_y_plus = "nul" +input_player5_l_y_plus_btn = "nul" +input_player5_l_y_plus_axis = "nul" +input_player5_l_y_minus = "nul" +input_player5_l_y_minus_btn = "nul" +input_player5_l_y_minus_axis = "nul" +input_player5_r_x_plus = "nul" +input_player5_r_x_plus_btn = "nul" +input_player5_r_x_plus_axis = "nul" +input_player5_r_x_minus = "nul" +input_player5_r_x_minus_btn = "nul" +input_player5_r_x_minus_axis = "nul" +input_player5_r_y_plus = "nul" +input_player5_r_y_plus_btn = "nul" +input_player5_r_y_plus_axis = "nul" +input_player5_r_y_minus = "nul" +input_player5_r_y_minus_btn = "nul" +input_player5_r_y_minus_axis = "nul" +input_player5_turbo = "nul" +input_player5_turbo_btn = "nul" +input_player5_turbo_axis = "nul" +input_player6_b = "nul" +input_player6_b_btn = "nul" +input_player6_b_axis = "nul" +input_player6_y = "nul" +input_player6_y_btn = "nul" +input_player6_y_axis = "nul" +input_player6_select = "nul" +input_player6_select_btn = "nul" +input_player6_select_axis = "nul" +input_player6_start = "nul" +input_player6_start_btn = "nul" +input_player6_start_axis = "nul" +input_player6_up = "nul" +input_player6_up_btn = "nul" +input_player6_up_axis = "nul" +input_player6_down = "nul" +input_player6_down_btn = "nul" +input_player6_down_axis = "nul" +input_player6_left = "nul" +input_player6_left_btn = "nul" +input_player6_left_axis = "nul" +input_player6_right = "nul" +input_player6_right_btn = "nul" +input_player6_right_axis = "nul" +input_player6_a = "nul" +input_player6_a_btn = "nul" +input_player6_a_axis = "nul" +input_player6_x = "nul" +input_player6_x_btn = "nul" +input_player6_x_axis = "nul" +input_player6_l = "nul" +input_player6_l_btn = "nul" +input_player6_l_axis = "nul" +input_player6_r = "nul" +input_player6_r_btn = "nul" +input_player6_r_axis = "nul" +input_player6_l2 = "nul" +input_player6_l2_btn = "nul" +input_player6_l2_axis = "nul" +input_player6_r2 = "nul" +input_player6_r2_btn = "nul" +input_player6_r2_axis = "nul" +input_player6_l3 = "nul" +input_player6_l3_btn = "nul" +input_player6_l3_axis = "nul" +input_player6_r3 = "nul" +input_player6_r3_btn = "nul" +input_player6_r3_axis = "nul" +input_player6_l_x_plus = "nul" +input_player6_l_x_plus_btn = "nul" +input_player6_l_x_plus_axis = "nul" +input_player6_l_x_minus = "nul" +input_player6_l_x_minus_btn = "nul" +input_player6_l_x_minus_axis = "nul" +input_player6_l_y_plus = "nul" +input_player6_l_y_plus_btn = "nul" +input_player6_l_y_plus_axis = "nul" +input_player6_l_y_minus = "nul" +input_player6_l_y_minus_btn = "nul" +input_player6_l_y_minus_axis = "nul" +input_player6_r_x_plus = "nul" +input_player6_r_x_plus_btn = "nul" +input_player6_r_x_plus_axis = "nul" +input_player6_r_x_minus = "nul" +input_player6_r_x_minus_btn = "nul" +input_player6_r_x_minus_axis = "nul" +input_player6_r_y_plus = "nul" +input_player6_r_y_plus_btn = "nul" +input_player6_r_y_plus_axis = "nul" +input_player6_r_y_minus = "nul" +input_player6_r_y_minus_btn = "nul" +input_player6_r_y_minus_axis = "nul" +input_player6_turbo = "nul" +input_player6_turbo_btn = "nul" +input_player6_turbo_axis = "nul" +input_player7_b = "nul" +input_player7_b_btn = "nul" +input_player7_b_axis = "nul" +input_player7_y = "nul" +input_player7_y_btn = "nul" +input_player7_y_axis = "nul" +input_player7_select = "nul" +input_player7_select_btn = "nul" +input_player7_select_axis = "nul" +input_player7_start = "nul" +input_player7_start_btn = "nul" +input_player7_start_axis = "nul" +input_player7_up = "nul" +input_player7_up_btn = "nul" +input_player7_up_axis = "nul" +input_player7_down = "nul" +input_player7_down_btn = "nul" +input_player7_down_axis = "nul" +input_player7_left = "nul" +input_player7_left_btn = "nul" +input_player7_left_axis = "nul" +input_player7_right = "nul" +input_player7_right_btn = "nul" +input_player7_right_axis = "nul" +input_player7_a = "nul" +input_player7_a_btn = "nul" +input_player7_a_axis = "nul" +input_player7_x = "nul" +input_player7_x_btn = "nul" +input_player7_x_axis = "nul" +input_player7_l = "nul" +input_player7_l_btn = "nul" +input_player7_l_axis = "nul" +input_player7_r = "nul" +input_player7_r_btn = "nul" +input_player7_r_axis = "nul" +input_player7_l2 = "nul" +input_player7_l2_btn = "nul" +input_player7_l2_axis = "nul" +input_player7_r2 = "nul" +input_player7_r2_btn = "nul" +input_player7_r2_axis = "nul" +input_player7_l3 = "nul" +input_player7_l3_btn = "nul" +input_player7_l3_axis = "nul" +input_player7_r3 = "nul" +input_player7_r3_btn = "nul" +input_player7_r3_axis = "nul" +input_player7_l_x_plus = "nul" +input_player7_l_x_plus_btn = "nul" +input_player7_l_x_plus_axis = "nul" +input_player7_l_x_minus = "nul" +input_player7_l_x_minus_btn = "nul" +input_player7_l_x_minus_axis = "nul" +input_player7_l_y_plus = "nul" +input_player7_l_y_plus_btn = "nul" +input_player7_l_y_plus_axis = "nul" +input_player7_l_y_minus = "nul" +input_player7_l_y_minus_btn = "nul" +input_player7_l_y_minus_axis = "nul" +input_player7_r_x_plus = "nul" +input_player7_r_x_plus_btn = "nul" +input_player7_r_x_plus_axis = "nul" +input_player7_r_x_minus = "nul" +input_player7_r_x_minus_btn = "nul" +input_player7_r_x_minus_axis = "nul" +input_player7_r_y_plus = "nul" +input_player7_r_y_plus_btn = "nul" +input_player7_r_y_plus_axis = "nul" +input_player7_r_y_minus = "nul" +input_player7_r_y_minus_btn = "nul" +input_player7_r_y_minus_axis = "nul" +input_player7_turbo = "nul" +input_player7_turbo_btn = "nul" +input_player7_turbo_axis = "nul" +input_player8_b = "nul" +input_player8_b_btn = "nul" +input_player8_b_axis = "nul" +input_player8_y = "nul" +input_player8_y_btn = "nul" +input_player8_y_axis = "nul" +input_player8_select = "nul" +input_player8_select_btn = "nul" +input_player8_select_axis = "nul" +input_player8_start = "nul" +input_player8_start_btn = "nul" +input_player8_start_axis = "nul" +input_player8_up = "nul" +input_player8_up_btn = "nul" +input_player8_up_axis = "nul" +input_player8_down = "nul" +input_player8_down_btn = "nul" +input_player8_down_axis = "nul" +input_player8_left = "nul" +input_player8_left_btn = "nul" +input_player8_left_axis = "nul" +input_player8_right = "nul" +input_player8_right_btn = "nul" +input_player8_right_axis = "nul" +input_player8_a = "nul" +input_player8_a_btn = "nul" +input_player8_a_axis = "nul" +input_player8_x = "nul" +input_player8_x_btn = "nul" +input_player8_x_axis = "nul" +input_player8_l = "nul" +input_player8_l_btn = "nul" +input_player8_l_axis = "nul" +input_player8_r = "nul" +input_player8_r_btn = "nul" +input_player8_r_axis = "nul" +input_player8_l2 = "nul" +input_player8_l2_btn = "nul" +input_player8_l2_axis = "nul" +input_player8_r2 = "nul" +input_player8_r2_btn = "nul" +input_player8_r2_axis = "nul" +input_player8_l3 = "nul" +input_player8_l3_btn = "nul" +input_player8_l3_axis = "nul" +input_player8_r3 = "nul" +input_player8_r3_btn = "nul" +input_player8_r3_axis = "nul" +input_player8_l_x_plus = "nul" +input_player8_l_x_plus_btn = "nul" +input_player8_l_x_plus_axis = "nul" +input_player8_l_x_minus = "nul" +input_player8_l_x_minus_btn = "nul" +input_player8_l_x_minus_axis = "nul" +input_player8_l_y_plus = "nul" +input_player8_l_y_plus_btn = "nul" +input_player8_l_y_plus_axis = "nul" +input_player8_l_y_minus = "nul" +input_player8_l_y_minus_btn = "nul" +input_player8_l_y_minus_axis = "nul" +input_player8_r_x_plus = "nul" +input_player8_r_x_plus_btn = "nul" +input_player8_r_x_plus_axis = "nul" +input_player8_r_x_minus = "nul" +input_player8_r_x_minus_btn = "nul" +input_player8_r_x_minus_axis = "nul" +input_player8_r_y_plus = "nul" +input_player8_r_y_plus_btn = "nul" +input_player8_r_y_plus_axis = "nul" +input_player8_r_y_minus = "nul" +input_player8_r_y_minus_btn = "nul" +input_player8_r_y_minus_axis = "nul" +input_player8_turbo = "nul" +input_player8_turbo_btn = "nul" +input_player8_turbo_axis = "nul" +input_player9_b = "nul" +input_player9_b_btn = "nul" +input_player9_b_axis = "nul" +input_player9_y = "nul" +input_player9_y_btn = "nul" +input_player9_y_axis = "nul" +input_player9_select = "nul" +input_player9_select_btn = "nul" +input_player9_select_axis = "nul" +input_player9_start = "nul" +input_player9_start_btn = "nul" +input_player9_start_axis = "nul" +input_player9_up = "nul" +input_player9_up_btn = "nul" +input_player9_up_axis = "nul" +input_player9_down = "nul" +input_player9_down_btn = "nul" +input_player9_down_axis = "nul" +input_player9_left = "nul" +input_player9_left_btn = "nul" +input_player9_left_axis = "nul" +input_player9_right = "nul" +input_player9_right_btn = "nul" +input_player9_right_axis = "nul" +input_player9_a = "nul" +input_player9_a_btn = "nul" +input_player9_a_axis = "nul" +input_player9_x = "nul" +input_player9_x_btn = "nul" +input_player9_x_axis = "nul" +input_player9_l = "nul" +input_player9_l_btn = "nul" +input_player9_l_axis = "nul" +input_player9_r = "nul" +input_player9_r_btn = "nul" +input_player9_r_axis = "nul" +input_player9_l2 = "nul" +input_player9_l2_btn = "nul" +input_player9_l2_axis = "nul" +input_player9_r2 = "nul" +input_player9_r2_btn = "nul" +input_player9_r2_axis = "nul" +input_player9_l3 = "nul" +input_player9_l3_btn = "nul" +input_player9_l3_axis = "nul" +input_player9_r3 = "nul" +input_player9_r3_btn = "nul" +input_player9_r3_axis = "nul" +input_player9_l_x_plus = "nul" +input_player9_l_x_plus_btn = "nul" +input_player9_l_x_plus_axis = "nul" +input_player9_l_x_minus = "nul" +input_player9_l_x_minus_btn = "nul" +input_player9_l_x_minus_axis = "nul" +input_player9_l_y_plus = "nul" +input_player9_l_y_plus_btn = "nul" +input_player9_l_y_plus_axis = "nul" +input_player9_l_y_minus = "nul" +input_player9_l_y_minus_btn = "nul" +input_player9_l_y_minus_axis = "nul" +input_player9_r_x_plus = "nul" +input_player9_r_x_plus_btn = "nul" +input_player9_r_x_plus_axis = "nul" +input_player9_r_x_minus = "nul" +input_player9_r_x_minus_btn = "nul" +input_player9_r_x_minus_axis = "nul" +input_player9_r_y_plus = "nul" +input_player9_r_y_plus_btn = "nul" +input_player9_r_y_plus_axis = "nul" +input_player9_r_y_minus = "nul" +input_player9_r_y_minus_btn = "nul" +input_player9_r_y_minus_axis = "nul" +input_player9_turbo = "nul" +input_player9_turbo_btn = "nul" +input_player9_turbo_axis = "nul" +input_player10_b = "nul" +input_player10_b_btn = "nul" +input_player10_b_axis = "nul" +input_player10_y = "nul" +input_player10_y_btn = "nul" +input_player10_y_axis = "nul" +input_player10_select = "nul" +input_player10_select_btn = "nul" +input_player10_select_axis = "nul" +input_player10_start = "nul" +input_player10_start_btn = "nul" +input_player10_start_axis = "nul" +input_player10_up = "nul" +input_player10_up_btn = "nul" +input_player10_up_axis = "nul" +input_player10_down = "nul" +input_player10_down_btn = "nul" +input_player10_down_axis = "nul" +input_player10_left = "nul" +input_player10_left_btn = "nul" +input_player10_left_axis = "nul" +input_player10_right = "nul" +input_player10_right_btn = "nul" +input_player10_right_axis = "nul" +input_player10_a = "nul" +input_player10_a_btn = "nul" +input_player10_a_axis = "nul" +input_player10_x = "nul" +input_player10_x_btn = "nul" +input_player10_x_axis = "nul" +input_player10_l = "nul" +input_player10_l_btn = "nul" +input_player10_l_axis = "nul" +input_player10_r = "nul" +input_player10_r_btn = "nul" +input_player10_r_axis = "nul" +input_player10_l2 = "nul" +input_player10_l2_btn = "nul" +input_player10_l2_axis = "nul" +input_player10_r2 = "nul" +input_player10_r2_btn = "nul" +input_player10_r2_axis = "nul" +input_player10_l3 = "nul" +input_player10_l3_btn = "nul" +input_player10_l3_axis = "nul" +input_player10_r3 = "nul" +input_player10_r3_btn = "nul" +input_player10_r3_axis = "nul" +input_player10_l_x_plus = "nul" +input_player10_l_x_plus_btn = "nul" +input_player10_l_x_plus_axis = "nul" +input_player10_l_x_minus = "nul" +input_player10_l_x_minus_btn = "nul" +input_player10_l_x_minus_axis = "nul" +input_player10_l_y_plus = "nul" +input_player10_l_y_plus_btn = "nul" +input_player10_l_y_plus_axis = "nul" +input_player10_l_y_minus = "nul" +input_player10_l_y_minus_btn = "nul" +input_player10_l_y_minus_axis = "nul" +input_player10_r_x_plus = "nul" +input_player10_r_x_plus_btn = "nul" +input_player10_r_x_plus_axis = "nul" +input_player10_r_x_minus = "nul" +input_player10_r_x_minus_btn = "nul" +input_player10_r_x_minus_axis = "nul" +input_player10_r_y_plus = "nul" +input_player10_r_y_plus_btn = "nul" +input_player10_r_y_plus_axis = "nul" +input_player10_r_y_minus = "nul" +input_player10_r_y_minus_btn = "nul" +input_player10_r_y_minus_axis = "nul" +input_player10_turbo = "nul" +input_player10_turbo_btn = "nul" +input_player10_turbo_axis = "nul" +input_player11_b = "nul" +input_player11_b_btn = "nul" +input_player11_b_axis = "nul" +input_player11_y = "nul" +input_player11_y_btn = "nul" +input_player11_y_axis = "nul" +input_player11_select = "nul" +input_player11_select_btn = "nul" +input_player11_select_axis = "nul" +input_player11_start = "nul" +input_player11_start_btn = "nul" +input_player11_start_axis = "nul" +input_player11_up = "nul" +input_player11_up_btn = "nul" +input_player11_up_axis = "nul" +input_player11_down = "nul" +input_player11_down_btn = "nul" +input_player11_down_axis = "nul" +input_player11_left = "nul" +input_player11_left_btn = "nul" +input_player11_left_axis = "nul" +input_player11_right = "nul" +input_player11_right_btn = "nul" +input_player11_right_axis = "nul" +input_player11_a = "nul" +input_player11_a_btn = "nul" +input_player11_a_axis = "nul" +input_player11_x = "nul" +input_player11_x_btn = "nul" +input_player11_x_axis = "nul" +input_player11_l = "nul" +input_player11_l_btn = "nul" +input_player11_l_axis = "nul" +input_player11_r = "nul" +input_player11_r_btn = "nul" +input_player11_r_axis = "nul" +input_player11_l2 = "nul" +input_player11_l2_btn = "nul" +input_player11_l2_axis = "nul" +input_player11_r2 = "nul" +input_player11_r2_btn = "nul" +input_player11_r2_axis = "nul" +input_player11_l3 = "nul" +input_player11_l3_btn = "nul" +input_player11_l3_axis = "nul" +input_player11_r3 = "nul" +input_player11_r3_btn = "nul" +input_player11_r3_axis = "nul" +input_player11_l_x_plus = "nul" +input_player11_l_x_plus_btn = "nul" +input_player11_l_x_plus_axis = "nul" +input_player11_l_x_minus = "nul" +input_player11_l_x_minus_btn = "nul" +input_player11_l_x_minus_axis = "nul" +input_player11_l_y_plus = "nul" +input_player11_l_y_plus_btn = "nul" +input_player11_l_y_plus_axis = "nul" +input_player11_l_y_minus = "nul" +input_player11_l_y_minus_btn = "nul" +input_player11_l_y_minus_axis = "nul" +input_player11_r_x_plus = "nul" +input_player11_r_x_plus_btn = "nul" +input_player11_r_x_plus_axis = "nul" +input_player11_r_x_minus = "nul" +input_player11_r_x_minus_btn = "nul" +input_player11_r_x_minus_axis = "nul" +input_player11_r_y_plus = "nul" +input_player11_r_y_plus_btn = "nul" +input_player11_r_y_plus_axis = "nul" +input_player11_r_y_minus = "nul" +input_player11_r_y_minus_btn = "nul" +input_player11_r_y_minus_axis = "nul" +input_player11_turbo = "nul" +input_player11_turbo_btn = "nul" +input_player11_turbo_axis = "nul" +input_player12_b = "nul" +input_player12_b_btn = "nul" +input_player12_b_axis = "nul" +input_player12_y = "nul" +input_player12_y_btn = "nul" +input_player12_y_axis = "nul" +input_player12_select = "nul" +input_player12_select_btn = "nul" +input_player12_select_axis = "nul" +input_player12_start = "nul" +input_player12_start_btn = "nul" +input_player12_start_axis = "nul" +input_player12_up = "nul" +input_player12_up_btn = "nul" +input_player12_up_axis = "nul" +input_player12_down = "nul" +input_player12_down_btn = "nul" +input_player12_down_axis = "nul" +input_player12_left = "nul" +input_player12_left_btn = "nul" +input_player12_left_axis = "nul" +input_player12_right = "nul" +input_player12_right_btn = "nul" +input_player12_right_axis = "nul" +input_player12_a = "nul" +input_player12_a_btn = "nul" +input_player12_a_axis = "nul" +input_player12_x = "nul" +input_player12_x_btn = "nul" +input_player12_x_axis = "nul" +input_player12_l = "nul" +input_player12_l_btn = "nul" +input_player12_l_axis = "nul" +input_player12_r = "nul" +input_player12_r_btn = "nul" +input_player12_r_axis = "nul" +input_player12_l2 = "nul" +input_player12_l2_btn = "nul" +input_player12_l2_axis = "nul" +input_player12_r2 = "nul" +input_player12_r2_btn = "nul" +input_player12_r2_axis = "nul" +input_player12_l3 = "nul" +input_player12_l3_btn = "nul" +input_player12_l3_axis = "nul" +input_player12_r3 = "nul" +input_player12_r3_btn = "nul" +input_player12_r3_axis = "nul" +input_player12_l_x_plus = "nul" +input_player12_l_x_plus_btn = "nul" +input_player12_l_x_plus_axis = "nul" +input_player12_l_x_minus = "nul" +input_player12_l_x_minus_btn = "nul" +input_player12_l_x_minus_axis = "nul" +input_player12_l_y_plus = "nul" +input_player12_l_y_plus_btn = "nul" +input_player12_l_y_plus_axis = "nul" +input_player12_l_y_minus = "nul" +input_player12_l_y_minus_btn = "nul" +input_player12_l_y_minus_axis = "nul" +input_player12_r_x_plus = "nul" +input_player12_r_x_plus_btn = "nul" +input_player12_r_x_plus_axis = "nul" +input_player12_r_x_minus = "nul" +input_player12_r_x_minus_btn = "nul" +input_player12_r_x_minus_axis = "nul" +input_player12_r_y_plus = "nul" +input_player12_r_y_plus_btn = "nul" +input_player12_r_y_plus_axis = "nul" +input_player12_r_y_minus = "nul" +input_player12_r_y_minus_btn = "nul" +input_player12_r_y_minus_axis = "nul" +input_player12_turbo = "nul" +input_player12_turbo_btn = "nul" +input_player12_turbo_axis = "nul" +input_player13_b = "nul" +input_player13_b_btn = "nul" +input_player13_b_axis = "nul" +input_player13_y = "nul" +input_player13_y_btn = "nul" +input_player13_y_axis = "nul" +input_player13_select = "nul" +input_player13_select_btn = "nul" +input_player13_select_axis = "nul" +input_player13_start = "nul" +input_player13_start_btn = "nul" +input_player13_start_axis = "nul" +input_player13_up = "nul" +input_player13_up_btn = "nul" +input_player13_up_axis = "nul" +input_player13_down = "nul" +input_player13_down_btn = "nul" +input_player13_down_axis = "nul" +input_player13_left = "nul" +input_player13_left_btn = "nul" +input_player13_left_axis = "nul" +input_player13_right = "nul" +input_player13_right_btn = "nul" +input_player13_right_axis = "nul" +input_player13_a = "nul" +input_player13_a_btn = "nul" +input_player13_a_axis = "nul" +input_player13_x = "nul" +input_player13_x_btn = "nul" +input_player13_x_axis = "nul" +input_player13_l = "nul" +input_player13_l_btn = "nul" +input_player13_l_axis = "nul" +input_player13_r = "nul" +input_player13_r_btn = "nul" +input_player13_r_axis = "nul" +input_player13_l2 = "nul" +input_player13_l2_btn = "nul" +input_player13_l2_axis = "nul" +input_player13_r2 = "nul" +input_player13_r2_btn = "nul" +input_player13_r2_axis = "nul" +input_player13_l3 = "nul" +input_player13_l3_btn = "nul" +input_player13_l3_axis = "nul" +input_player13_r3 = "nul" +input_player13_r3_btn = "nul" +input_player13_r3_axis = "nul" +input_player13_l_x_plus = "nul" +input_player13_l_x_plus_btn = "nul" +input_player13_l_x_plus_axis = "nul" +input_player13_l_x_minus = "nul" +input_player13_l_x_minus_btn = "nul" +input_player13_l_x_minus_axis = "nul" +input_player13_l_y_plus = "nul" +input_player13_l_y_plus_btn = "nul" +input_player13_l_y_plus_axis = "nul" +input_player13_l_y_minus = "nul" +input_player13_l_y_minus_btn = "nul" +input_player13_l_y_minus_axis = "nul" +input_player13_r_x_plus = "nul" +input_player13_r_x_plus_btn = "nul" +input_player13_r_x_plus_axis = "nul" +input_player13_r_x_minus = "nul" +input_player13_r_x_minus_btn = "nul" +input_player13_r_x_minus_axis = "nul" +input_player13_r_y_plus = "nul" +input_player13_r_y_plus_btn = "nul" +input_player13_r_y_plus_axis = "nul" +input_player13_r_y_minus = "nul" +input_player13_r_y_minus_btn = "nul" +input_player13_r_y_minus_axis = "nul" +input_player13_turbo = "nul" +input_player13_turbo_btn = "nul" +input_player13_turbo_axis = "nul" +input_player14_b = "nul" +input_player14_b_btn = "nul" +input_player14_b_axis = "nul" +input_player14_y = "nul" +input_player14_y_btn = "nul" +input_player14_y_axis = "nul" +input_player14_select = "nul" +input_player14_select_btn = "nul" +input_player14_select_axis = "nul" +input_player14_start = "nul" +input_player14_start_btn = "nul" +input_player14_start_axis = "nul" +input_player14_up = "nul" +input_player14_up_btn = "nul" +input_player14_up_axis = "nul" +input_player14_down = "nul" +input_player14_down_btn = "nul" +input_player14_down_axis = "nul" +input_player14_left = "nul" +input_player14_left_btn = "nul" +input_player14_left_axis = "nul" +input_player14_right = "nul" +input_player14_right_btn = "nul" +input_player14_right_axis = "nul" +input_player14_a = "nul" +input_player14_a_btn = "nul" +input_player14_a_axis = "nul" +input_player14_x = "nul" +input_player14_x_btn = "nul" +input_player14_x_axis = "nul" +input_player14_l = "nul" +input_player14_l_btn = "nul" +input_player14_l_axis = "nul" +input_player14_r = "nul" +input_player14_r_btn = "nul" +input_player14_r_axis = "nul" +input_player14_l2 = "nul" +input_player14_l2_btn = "nul" +input_player14_l2_axis = "nul" +input_player14_r2 = "nul" +input_player14_r2_btn = "nul" +input_player14_r2_axis = "nul" +input_player14_l3 = "nul" +input_player14_l3_btn = "nul" +input_player14_l3_axis = "nul" +input_player14_r3 = "nul" +input_player14_r3_btn = "nul" +input_player14_r3_axis = "nul" +input_player14_l_x_plus = "nul" +input_player14_l_x_plus_btn = "nul" +input_player14_l_x_plus_axis = "nul" +input_player14_l_x_minus = "nul" +input_player14_l_x_minus_btn = "nul" +input_player14_l_x_minus_axis = "nul" +input_player14_l_y_plus = "nul" +input_player14_l_y_plus_btn = "nul" +input_player14_l_y_plus_axis = "nul" +input_player14_l_y_minus = "nul" +input_player14_l_y_minus_btn = "nul" +input_player14_l_y_minus_axis = "nul" +input_player14_r_x_plus = "nul" +input_player14_r_x_plus_btn = "nul" +input_player14_r_x_plus_axis = "nul" +input_player14_r_x_minus = "nul" +input_player14_r_x_minus_btn = "nul" +input_player14_r_x_minus_axis = "nul" +input_player14_r_y_plus = "nul" +input_player14_r_y_plus_btn = "nul" +input_player14_r_y_plus_axis = "nul" +input_player14_r_y_minus = "nul" +input_player14_r_y_minus_btn = "nul" +input_player14_r_y_minus_axis = "nul" +input_player14_turbo = "nul" +input_player14_turbo_btn = "nul" +input_player14_turbo_axis = "nul" +input_player15_b = "nul" +input_player15_b_btn = "nul" +input_player15_b_axis = "nul" +input_player15_y = "nul" +input_player15_y_btn = "nul" +input_player15_y_axis = "nul" +input_player15_select = "nul" +input_player15_select_btn = "nul" +input_player15_select_axis = "nul" +input_player15_start = "nul" +input_player15_start_btn = "nul" +input_player15_start_axis = "nul" +input_player15_up = "nul" +input_player15_up_btn = "nul" +input_player15_up_axis = "nul" +input_player15_down = "nul" +input_player15_down_btn = "nul" +input_player15_down_axis = "nul" +input_player15_left = "nul" +input_player15_left_btn = "nul" +input_player15_left_axis = "nul" +input_player15_right = "nul" +input_player15_right_btn = "nul" +input_player15_right_axis = "nul" +input_player15_a = "nul" +input_player15_a_btn = "nul" +input_player15_a_axis = "nul" +input_player15_x = "nul" +input_player15_x_btn = "nul" +input_player15_x_axis = "nul" +input_player15_l = "nul" +input_player15_l_btn = "nul" +input_player15_l_axis = "nul" +input_player15_r = "nul" +input_player15_r_btn = "nul" +input_player15_r_axis = "nul" +input_player15_l2 = "nul" +input_player15_l2_btn = "nul" +input_player15_l2_axis = "nul" +input_player15_r2 = "nul" +input_player15_r2_btn = "nul" +input_player15_r2_axis = "nul" +input_player15_l3 = "nul" +input_player15_l3_btn = "nul" +input_player15_l3_axis = "nul" +input_player15_r3 = "nul" +input_player15_r3_btn = "nul" +input_player15_r3_axis = "nul" +input_player15_l_x_plus = "nul" +input_player15_l_x_plus_btn = "nul" +input_player15_l_x_plus_axis = "nul" +input_player15_l_x_minus = "nul" +input_player15_l_x_minus_btn = "nul" +input_player15_l_x_minus_axis = "nul" +input_player15_l_y_plus = "nul" +input_player15_l_y_plus_btn = "nul" +input_player15_l_y_plus_axis = "nul" +input_player15_l_y_minus = "nul" +input_player15_l_y_minus_btn = "nul" +input_player15_l_y_minus_axis = "nul" +input_player15_r_x_plus = "nul" +input_player15_r_x_plus_btn = "nul" +input_player15_r_x_plus_axis = "nul" +input_player15_r_x_minus = "nul" +input_player15_r_x_minus_btn = "nul" +input_player15_r_x_minus_axis = "nul" +input_player15_r_y_plus = "nul" +input_player15_r_y_plus_btn = "nul" +input_player15_r_y_plus_axis = "nul" +input_player15_r_y_minus = "nul" +input_player15_r_y_minus_btn = "nul" +input_player15_r_y_minus_axis = "nul" +input_player15_turbo = "nul" +input_player15_turbo_btn = "nul" +input_player15_turbo_axis = "nul" +input_player16_b = "nul" +input_player16_b_btn = "nul" +input_player16_b_axis = "nul" +input_player16_y = "nul" +input_player16_y_btn = "nul" +input_player16_y_axis = "nul" +input_player16_select = "nul" +input_player16_select_btn = "nul" +input_player16_select_axis = "nul" +input_player16_start = "nul" +input_player16_start_btn = "nul" +input_player16_start_axis = "nul" +input_player16_up = "nul" +input_player16_up_btn = "nul" +input_player16_up_axis = "nul" +input_player16_down = "nul" +input_player16_down_btn = "nul" +input_player16_down_axis = "nul" +input_player16_left = "nul" +input_player16_left_btn = "nul" +input_player16_left_axis = "nul" +input_player16_right = "nul" +input_player16_right_btn = "nul" +input_player16_right_axis = "nul" +input_player16_a = "nul" +input_player16_a_btn = "nul" +input_player16_a_axis = "nul" +input_player16_x = "nul" +input_player16_x_btn = "nul" +input_player16_x_axis = "nul" +input_player16_l = "nul" +input_player16_l_btn = "nul" +input_player16_l_axis = "nul" +input_player16_r = "nul" +input_player16_r_btn = "nul" +input_player16_r_axis = "nul" +input_player16_l2 = "nul" +input_player16_l2_btn = "nul" +input_player16_l2_axis = "nul" +input_player16_r2 = "nul" +input_player16_r2_btn = "nul" +input_player16_r2_axis = "nul" +input_player16_l3 = "nul" +input_player16_l3_btn = "nul" +input_player16_l3_axis = "nul" +input_player16_r3 = "nul" +input_player16_r3_btn = "nul" +input_player16_r3_axis = "nul" +input_player16_l_x_plus = "nul" +input_player16_l_x_plus_btn = "nul" +input_player16_l_x_plus_axis = "nul" +input_player16_l_x_minus = "nul" +input_player16_l_x_minus_btn = "nul" +input_player16_l_x_minus_axis = "nul" +input_player16_l_y_plus = "nul" +input_player16_l_y_plus_btn = "nul" +input_player16_l_y_plus_axis = "nul" +input_player16_l_y_minus = "nul" +input_player16_l_y_minus_btn = "nul" +input_player16_l_y_minus_axis = "nul" +input_player16_r_x_plus = "nul" +input_player16_r_x_plus_btn = "nul" +input_player16_r_x_plus_axis = "nul" +input_player16_r_x_minus = "nul" +input_player16_r_x_minus_btn = "nul" +input_player16_r_x_minus_axis = "nul" +input_player16_r_y_plus = "nul" +input_player16_r_y_plus_btn = "nul" +input_player16_r_y_plus_axis = "nul" +input_player16_r_y_minus = "nul" +input_player16_r_y_minus_btn = "nul" +input_player16_r_y_minus_axis = "nul" +input_player16_turbo = "nul" +input_player16_turbo_btn = "nul" +input_player16_turbo_axis = "nul" +xmb_font = "" +netplay_nickname = "" +video_filter = "" +audio_dsp_plugin = "" +netplay_ip_address = "" +recording_output_directory = "" +recording_config_directory = "" +core_options_path = "" +video_shader = "" +menu_wallpaper = "" +input_overlay = "" +video_font_path = "" +content_history_dir = "" +cache_directory = "" +resampler_directory = "" +xmb_font = "" +playlist_names = "" +playlist_cores = "" +audio_device = "" +camera_device = "" +cheevos_username = "" +cheevos_password = "" +video_context_driver = "" +input_keyboard_layout = "" +bundle_assets_src_path = "" +bundle_assets_dst_path = "" +bundle_assets_dst_path_subdir = "" diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index d2a3a44ec0..2a8fc12836 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -19,6 +19,7 @@ #include #include #include +#include #ifdef _MSC_VER #pragma comment( lib, "comctl32" ) @@ -121,7 +122,7 @@ static void shader_dlg_refresh_trackbar_label(int index) video_shader_driver_get_current_shader(&shader_info); - if (floorf(shader_info.data->parameters[index].current) + if (floorf(shader_info.data->parameters[index].current) == shader_info.data->parameters[index].current) snprintf(val_buffer, sizeof(val_buffer), "%.0f", shader_info.data->parameters[index].current); @@ -152,8 +153,8 @@ static void shader_dlg_params_refresh(void) { case SHADER_PARAM_CTRL_CHECKBOX: { - bool checked = - (shader_info.data->parameters[i].current == + bool checked = + (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } @@ -165,12 +166,12 @@ static void shader_dlg_params_refresh(void) TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].maximum - - shader_info.data->parameters[i].minimum) + (LPARAM)((shader_info.data->parameters[i].maximum - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].current - - shader_info.data->parameters[i].minimum) / + (LPARAM)((shader_info.data->parameters[i].current - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); break; case SHADER_PARAM_CTRL_NONE: @@ -233,21 +234,16 @@ void shader_dlg_params_reload(void) for (i = 0; i < (int)shader_info.data->num_parameters; i++) { - shader_param_ctrl_t*control = &g_shader_dlg.controls[i]; - size_t param_desc_wide_size = sizeof(shader_info.data->parameters[i].desc) * 2; - wchar_t param_desc_wide[param_desc_wide_size]; - - memset(param_desc_wide, 0, sizeof(param_desc_wide)); - MultiByteToWideChar(CP_UTF8, 0, shader_info.data->parameters[i].desc, -1, param_desc_wide, sizeof(param_desc_wide) / sizeof(param_desc_wide[0])); - + shader_param_ctrl_t *control = &g_shader_dlg.controls[i]; + CHAR_TO_WCHAR_ALLOC(shader_info.data->parameters[i].desc, param_desc_wide) if ((shader_info.data->parameters[i].minimum == 0.0) - && (shader_info.data->parameters[i].maximum - == (shader_info.data->parameters[i].minimum + && (shader_info.data->parameters[i].maximum + == (shader_info.data->parameters[i].minimum + shader_info.data->parameters[i].step))) { - if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT - + SHADER_DLG_CTRL_MARGIN + 20) + if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT + + SHADER_DLG_CTRL_MARGIN + 20) > SHADER_DLG_MAX_HEIGHT) { pos_y = g_shader_dlg.parameters_start_y; @@ -300,6 +296,8 @@ void shader_dlg_params_reload(void) } + if (param_desc_wide) + free(param_desc_wide); } if (window && g_shader_dlg.separator.hwnd) @@ -328,7 +326,7 @@ static void shader_dlg_update_on_top_state(void) bool on_top = SendMessage(g_shader_dlg.on_top_checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED; - SetWindowPos(g_shader_dlg.window.hwnd, on_top + SetWindowPos(g_shader_dlg.window.hwnd, on_top ? HWND_TOPMOST : HWND_NOTOPMOST , 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } @@ -397,10 +395,10 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; else - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum; break; @@ -415,7 +413,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; shader_dlg_refresh_trackbar_label(i); @@ -451,10 +449,10 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (!RegisterClassExW(wndclass)) return false; - /* This is non-NULL when we want a window for shader dialogs, + /* This is non-NULL when we want a window for shader dialogs, * therefore early return here */ /* TODO/FIXME - this is ugly. Find a better way */ - if (class_name != NULL) + if (class_name != NULL) return true; if (!win32_shader_dlg_init()) @@ -523,7 +521,7 @@ static bool win32_browser( const char *initial_dir) { bool result = false; - const ui_browser_window_t *browser = + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); if (browser) @@ -534,14 +532,17 @@ static bool win32_browser( browser_state.title = strdup(title); browser_state.startdir = strdup(initial_dir); browser_state.path = strdup(filename); - browser_state.window = owner; result = browser->open(&browser_state); - free(browser_state.filters); - free(browser_state.title); - free(browser_state.startdir); - free(browser_state.path); + if (browser_state.filters) + free(browser_state.filters); + if (browser_state.title) + free(browser_state.title); + if (browser_state.startdir) + free(browser_state.startdir); + if (browser_state.path) + free(browser_state.path); } return result; @@ -554,7 +555,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) bool do_wm_close = false; settings_t *settings = config_get_ptr(); - switch (mode) + switch (mode) { case ID_M_LOAD_CORE: case ID_M_LOAD_CONTENT: @@ -663,7 +664,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) signed idx = -1; settings->state_slot = idx; } - else if (mode >= (ID_M_STATE_INDEX_AUTO+1) + else if (mode >= (ID_M_STATE_INDEX_AUTO+1) && mode <= (ID_M_STATE_INDEX_AUTO+10)) { signed idx = (mode - (ID_M_STATE_INDEX_AUTO+1)); @@ -677,7 +678,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) if (do_wm_close) PostMessageW(owner, WM_CLOSE, 0, 0); - + return 0L; } diff --git a/ui/drivers/win32/ui_win32_browser_window.c b/ui/drivers/win32/ui_win32_browser_window.c index 1aeaccf0d8..25203866ce 100644 --- a/ui/drivers/win32/ui_win32_browser_window.c +++ b/ui/drivers/win32/ui_win32_browser_window.c @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -26,23 +27,60 @@ static bool ui_browser_window_win32_core(ui_browser_window_state_t *state, bool save) { OPENFILENAME ofn = {}; + bool success = true; +#ifdef UNICODE + size_t filters_size = (state->filters ? strlen(state->filters) : 0) + 1; + size_t path_size = strlen(state->path) + 1; + size_t title_size = strlen(state->title) + 1; + size_t startdir_size = strlen(state->startdir) + 1; - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = (HWND)state->window; + wchar_t *filters_wide = (wchar_t*)calloc(filters_size, 2); + wchar_t *path_wide = (wchar_t*)calloc(path_size, 2); + wchar_t *title_wide = (wchar_t*)calloc(title_size, 2); + wchar_t *startdir_wide = (wchar_t*)calloc(startdir_size, 2); + + if (state->filters) + MultiByteToWideChar(CP_UTF8, 0, state->filters, -1, filters_wide, filters_size); + if (state->title) + MultiByteToWideChar(CP_UTF8, 0, state->title, -1, title_wide, title_size); + if (state->path) + MultiByteToWideChar(CP_UTF8, 0, state->path, -1, path_wide, path_size); + if (state->startdir) + MultiByteToWideChar(CP_UTF8, 0, state->startdir, -1, startdir_wide, startdir_size); + + ofn.lpstrFilter = filters_wide; + ofn.lpstrFile = path_wide; + ofn.lpstrTitle = title_wide; + ofn.lpstrInitialDir = startdir_wide; +#else ofn.lpstrFilter = state->filters; ofn.lpstrFile = state->path; ofn.lpstrTitle = state->title; ofn.lpstrInitialDir = state->startdir; - ofn.lpstrDefExt = ""; +#endif + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = (HWND)state->window; + ofn.lpstrDefExt = TEXT(""); ofn.nMaxFile = PATH_MAX; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; if ( save && !GetOpenFileName(&ofn)) - return false; + success = false; if (!save && !GetSaveFileName(&ofn)) - return false; + success = false; - return true; +#ifdef UNICODE + if (filters_wide) + free(filters_wide); + if (title_wide) + free(title_wide); + if (path_wide) + free(path_wide); + if (startdir_wide) + free(startdir_wide); +#endif + + return success; } static bool ui_browser_window_win32_open(ui_browser_window_state_t *state) diff --git a/ui/drivers/win32/ui_win32_window.cpp b/ui/drivers/win32/ui_win32_window.cpp index d76866a0ba..4a14da3296 100644 --- a/ui/drivers/win32/ui_win32_window.cpp +++ b/ui/drivers/win32/ui_win32_window.cpp @@ -20,6 +20,8 @@ #include #include +#include + #include #ifdef _MSC_VER @@ -62,7 +64,7 @@ static void ui_window_win32_set_focused(void *data) SetFocus(window->hwnd); } -static void ui_window_win32_set_visible(void *data, +static void ui_window_win32_set_visible(void *data, bool set_visible) { ui_window_win32_t *window = (ui_window_win32_t*)data; @@ -72,7 +74,10 @@ static void ui_window_win32_set_visible(void *data, static void ui_window_win32_set_title(void *data, char *buf) { ui_window_win32_t *window = (ui_window_win32_t*)data; - SetWindowText(window->hwnd, buf); + CHAR_TO_WCHAR_ALLOC(buf, buf_wide) + SetWindowText(window->hwnd, buf_wide); + if (buf_wide) + free(buf_wide); } void ui_window_win32_set_droppable(void *data, bool droppable) From a082df0027fafa69857b99125831582c255c8e78 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 13:18:35 -0500 Subject: [PATCH 157/638] More stripping out of NAT traversal for SOCKET_LEGACY --- libretro-common/net/net_natt.c | 11 +++++++++++ network/netplay/netplay.c | 10 +--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index 59e0530ef7..6ee8a60d42 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -42,6 +42,7 @@ static struct IGDdatas data; void natt_init(void) { +#ifndef HAVE_SOCKET_LEGACY #if HAVE_MINIUPNPC struct UPNPDev * devlist; struct UPNPDev * dev; @@ -81,6 +82,7 @@ void natt_init(void) freeUPNPDevlist(devlist); } #endif +#endif } bool natt_new(struct natt_status *status) @@ -96,6 +98,7 @@ void natt_free(struct natt_status *status) bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t addrlen, enum socket_protocol proto) { +#ifndef HAVE_SOCKET_LEGACY #if HAVE_MINIUPNPC char host[PATH_MAX_LENGTH], ext_host[PATH_MAX_LENGTH], port_str[6], ext_port_str[6]; @@ -160,6 +163,9 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t return true; +#else + return false; +#endif #else return false; #endif @@ -167,6 +173,7 @@ bool natt_open_port(struct natt_status *status, struct sockaddr *addr, socklen_t bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_protocol proto) { +#ifndef HAVE_SOCKET_LEGACY struct net_ifinfo list; bool ret = false; size_t i; @@ -199,6 +206,10 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p net_ifinfo_free(&list); return ret; + +#else + return false; +#endif } bool natt_read(struct natt_status *status) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 371c38a305..c63285be71 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1108,15 +1108,7 @@ static void announce_nat_traversal(netplay_t *netplay) else return; #else - if (netplay->nat_traversal_state.have_inet4) - { - host[0] = '\0'; - snprintf(port, 6, "%hu", - ntohs(netplay->nat_traversal_state.ext_inet4_addr.sin_port)); - port[5] = '\0'; - - } - else return; + return; #endif From 5547b3fa3ee01e089eacc212ebea5f7454f231c4 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Fri, 2 Dec 2016 19:58:39 +0100 Subject: [PATCH 158/638] Rename some variables in wgl_ctx.cpp and cahnge prefix 'g_' to 'win32_' --- gfx/drivers_context/wgl_ctx.cpp | 191 ++++++++++++++++---------------- 1 file changed, 93 insertions(+), 98 deletions(-) diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 648f2123ec..b1d4a149d2 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -86,23 +86,22 @@ static wglCreateContextAttribsProc pcreate_context; #endif static BOOL (APIENTRY *p_swap_interval)(int); -static bool g_use_hw_ctx; -static HGLRC g_hrc; -static HGLRC g_hw_hrc; -static HDC g_hdc; -static bool g_core_hw_context_enable; +static HGLRC win32_hrc; +static HGLRC win32_hw_hrc; +static HDC win32_hdc; +static bool win32_use_hw_ctx = false; +static bool win32_core_hw_context_enable = false; #ifdef HAVE_VULKAN -static gfx_ctx_vulkan_data_t g_vk; +static gfx_ctx_vulkan_data_t win32_vk; #endif -static unsigned g_major; -static unsigned g_minor; -static enum gfx_ctx_api g_api; +static unsigned win32_major = 0; +static unsigned win32_minor = 0; +static unsigned win32_interval = 0; +static enum gfx_ctx_api win32_api = GFX_CTX_NONE; -static unsigned g_interval; - -static dylib_t dll_handle = NULL; /* Handle to OpenGL32.dll */ +static dylib_t dll_handle = NULL; /* Handle to OpenGL32.dll */ static void setup_pixel_format(HDC hdc) { @@ -122,38 +121,34 @@ static void setup_pixel_format(HDC hdc) #if defined(HAVE_OPENGL) static void create_gl_context(HWND hwnd, bool *quit) { - bool core_context; - struct retro_hw_render_callback *hwr = NULL; - bool debug = false; + struct retro_hw_render_callback *hwr = video_driver_get_hw_context(); + bool debug = hwr->debug_context; + bool core_context = (win32_major * 1000 + win32_minor) >= 3001; + dll_handle = dylib_load("OpenGL32.dll"); + win32_hdc = GetDC(hwnd); - hwr = video_driver_get_hw_context(); - - debug = hwr->debug_context; - dll_handle = dylib_load("OpenGL32.dll"); - g_hdc = GetDC(hwnd); - setup_pixel_format(g_hdc); + setup_pixel_format(win32_hdc); #ifdef GL_DEBUG debug = true; #endif - core_context = (g_major * 1000 + g_minor) >= 3001; - if (g_hrc) + if (win32_hrc) { RARCH_LOG("[WGL]: Using cached GL context.\n"); video_driver_set_video_cache_context_ack(); } else { - g_hrc = wglCreateContext(g_hdc); + win32_hrc = wglCreateContext(win32_hdc); /* We'll create shared context later if not. */ - if (g_hrc && !core_context && !debug) + if (win32_hrc && !core_context && !debug) { - g_hw_hrc = wglCreateContext(g_hdc); - if (g_hw_hrc) + win32_hw_hrc = wglCreateContext(win32_hdc); + if (win32_hw_hrc) { - if (!wglShareLists(g_hrc, g_hw_hrc)) + if (!wglShareLists(win32_hrc, win32_hw_hrc)) { RARCH_LOG("[WGL]: Failed to share contexts.\n"); *quit = true; @@ -164,9 +159,9 @@ static void create_gl_context(HWND hwnd, bool *quit) } } - if (g_hrc) + if (win32_hrc) { - if (wglMakeCurrent(g_hdc, g_hrc)) + if (wglMakeCurrent(win32_hdc, win32_hrc)) g_inited = true; else *quit = true; @@ -185,15 +180,15 @@ static void create_gl_context(HWND hwnd, bool *quit) if (core_context) { *aptr++ = WGL_CONTEXT_MAJOR_VERSION_ARB; - *aptr++ = g_major; + *aptr++ = win32_major; *aptr++ = WGL_CONTEXT_MINOR_VERSION_ARB; - *aptr++ = g_minor; + *aptr++ = win32_minor; /* Technically, we don't have core/compat until 3.2. * Version 3.1 is either compat or not depending * on GL_ARB_compatibility. */ - if ((g_major * 1000 + g_minor) >= 3002) + if ((win32_major * 1000 + win32_minor) >= 3002) { *aptr++ = WGL_CONTEXT_PROFILE_MASK_ARB; *aptr++ = WGL_CONTEXT_CORE_PROFILE_BIT_ARB; @@ -214,23 +209,23 @@ static void create_gl_context(HWND hwnd, bool *quit) if (pcreate_context) { - HGLRC context = pcreate_context(g_hdc, NULL, attribs); + HGLRC context = pcreate_context(win32_hdc, NULL, attribs); if (context) { wglMakeCurrent(NULL, NULL); - wglDeleteContext(g_hrc); - g_hrc = context; - if (!wglMakeCurrent(g_hdc, g_hrc)) + wglDeleteContext(win32_hrc); + win32_hrc = context; + if (!wglMakeCurrent(win32_hdc, win32_hrc)) *quit = true; } else RARCH_ERR("[WGL]: Failed to create core context. Falling back to legacy context.\n"); - if (g_use_hw_ctx) + if (win32_use_hw_ctx) { - g_hw_hrc = pcreate_context(g_hdc, context, attribs); - if (!g_hw_hrc) + win32_hw_hrc = pcreate_context(win32_hdc, context, attribs); + if (!win32_hw_hrc) { RARCH_ERR("[WGL]: Failed to create shared context.\n"); *quit = true; @@ -245,7 +240,7 @@ static void create_gl_context(HWND hwnd, bool *quit) void create_graphics_context(HWND hwnd, bool *quit) { - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #if defined(HAVE_OPENGL) @@ -261,9 +256,9 @@ void create_graphics_context(HWND hwnd, bool *quit) unsigned height = rect.bottom - rect.top; GetClientRect(hwnd, &rect); HINSTANCE instance = GetModuleHandle(NULL); - if (!vulkan_surface_create(&g_vk, VULKAN_WSI_WIN32, + if (!vulkan_surface_create(&win32_vk, VULKAN_WSI_WIN32, &instance, &hwnd, - width, height, g_interval)) + width, height, win32_interval)) *quit = true; g_inited = true; #endif @@ -281,30 +276,30 @@ void *dinput_wgl; static void gfx_ctx_wgl_swap_interval(void *data, unsigned interval) { (void)data; - g_interval = interval; + win32_interval = interval; - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #ifdef HAVE_OPENGL - if (!g_hrc) + if (!win32_hrc) return; if (!p_swap_interval) return; - RARCH_LOG("[WGL]: wglSwapInterval(%u)\n", g_interval); - if (!p_swap_interval(g_interval)) + RARCH_LOG("[WGL]: wglSwapInterval(%u)\n", win32_interval); + if (!p_swap_interval(win32_interval)) RARCH_WARN("[WGL]: wglSwapInterval() failed.\n"); #endif break; case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - if (g_interval != interval) + if (win32_interval != interval) { - g_interval = interval; - if (g_vk.swapchain) - g_vk.need_new_swapchain = true; + win32_interval = interval; + if (win32_vk.swapchain) + win32_vk.need_new_swapchain = true; } #endif break; @@ -320,11 +315,11 @@ static void gfx_ctx_wgl_check_window(void *data, bool *quit, { win32_check_window(quit, resize, width, height); - switch (g_api) + switch (win32_api) { case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - if (g_vk.need_new_swapchain) + if (win32_vk.need_new_swapchain) *resize = true; #endif break; @@ -339,18 +334,18 @@ static void gfx_ctx_wgl_swap_buffers(void *data) { (void)data; - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #ifdef HAVE_OPENGL - SwapBuffers(g_hdc); + SwapBuffers(win32_hdc); #endif break; case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - vulkan_present(&g_vk, g_vk.context.current_swapchain_index); - vulkan_acquire_next_image(&g_vk); + vulkan_present(&win32_vk, win32_vk.context.current_swapchain_index); + vulkan_acquire_next_image(&win32_vk); #endif break; @@ -367,18 +362,18 @@ static bool gfx_ctx_wgl_set_resize(void *data, (void)width; (void)height; - switch (g_api) + switch (win32_api) { case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - if (!vulkan_create_swapchain(&g_vk, width, height, g_interval)) + if (!vulkan_create_swapchain(&win32_vk, width, height, win32_interval)) { RARCH_ERR("[Win32/Vulkan]: Failed to update swapchain.\n"); return false; } - g_vk.context.invalid_swapchain = true; - g_vk.need_new_swapchain = false; + win32_vk.context.invalid_swapchain = true; + win32_vk.need_new_swapchain = false; #endif break; @@ -394,7 +389,7 @@ static void gfx_ctx_wgl_update_window_title(void *data) { char buf[128]; char buf_fps[128]; - settings_t *settings = config_get_ptr(); + settings_t *settings = config_get_ptr(); const ui_window_t *window = ui_companion_driver_get_window_ptr(); buf[0] = buf_fps[0] = '\0'; @@ -414,10 +409,10 @@ static void gfx_ctx_wgl_get_video_size(void *data, if (!window) { - unsigned mon_id; RECT mon_rect; MONITORINFOEX current_mon; - HMONITOR hm_to_use = NULL; + unsigned mon_id = 0; + HMONITOR hm_to_use = NULL; win32_monitor_info(¤t_mon, &hm_to_use, &mon_id); mon_rect = current_mon.rcMonitor; @@ -447,11 +442,11 @@ static void *gfx_ctx_wgl_init(void *video_driver) if (!win32_window_init(&wndclass, true, NULL)) return NULL; - switch (g_api) + switch (win32_api) { case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - if (!vulkan_context_init(&g_vk, VULKAN_WSI_WIN32)) + if (!vulkan_context_init(&win32_vk, VULKAN_WSI_WIN32)) return NULL; #endif break; @@ -469,22 +464,22 @@ static void gfx_ctx_wgl_destroy(void *data) (void)data; - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #ifdef HAVE_OPENGL - if (g_hrc) + if (win32_hrc) { glFinish(); wglMakeCurrent(NULL, NULL); if (!video_driver_is_video_cache_context()) { - if (g_hw_hrc) - wglDeleteContext(g_hw_hrc); - wglDeleteContext(g_hrc); - g_hrc = NULL; - g_hw_hrc = NULL; + if (win32_hw_hrc) + wglDeleteContext(win32_hw_hrc); + wglDeleteContext(win32_hrc); + win32_hrc = NULL; + win32_hw_hrc = NULL; } } #endif @@ -492,10 +487,10 @@ static void gfx_ctx_wgl_destroy(void *data) case GFX_CTX_VULKAN_API: #ifdef HAVE_VULKAN - vulkan_context_destroy(&g_vk, g_vk.vk_surface != VK_NULL_HANDLE); - if (g_vk.context.queue_lock) - slock_free(g_vk.context.queue_lock); - memset(&g_vk, 0, sizeof(g_vk)); + vulkan_context_destroy(&win32_vk, win32_vk.vk_surface != VK_NULL_HANDLE); + if (win32_vk.context.queue_lock) + slock_free(win32_vk.context.queue_lock); + memset(&win32_vk, 0, sizeof(win32_vk)); #endif break; @@ -504,10 +499,10 @@ static void gfx_ctx_wgl_destroy(void *data) break; } - if (window && g_hdc) + if (window && win32_hdc) { - ReleaseDC(window, g_hdc); - g_hdc = NULL; + ReleaseDC(window, win32_hdc); + win32_hdc = NULL; } if (window) @@ -522,11 +517,11 @@ static void gfx_ctx_wgl_destroy(void *data) g_restore_desktop = false; } - g_core_hw_context_enable = false; - g_inited = false; - g_major = 0; - g_minor = 0; - p_swap_interval = NULL; + win32_core_hw_context_enable = false; + g_inited = false; + win32_major = 0; + win32_minor = 0; + p_swap_interval = NULL; } static bool gfx_ctx_wgl_set_video_mode(void *data, @@ -539,7 +534,7 @@ static bool gfx_ctx_wgl_set_video_mode(void *data, goto error; } - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #ifdef HAVE_OPENGL @@ -553,7 +548,7 @@ static bool gfx_ctx_wgl_set_video_mode(void *data, break; } - gfx_ctx_wgl_swap_interval(data, g_interval); + gfx_ctx_wgl_swap_interval(data, win32_interval); return true; error: @@ -611,9 +606,9 @@ static bool gfx_ctx_wgl_bind_api(void *data, { (void)data; - g_major = major; - g_minor = minor; - g_api = api; + win32_major = major; + win32_minor = minor; + win32_api = api; #if defined(HAVE_OPENGL) if (api == GFX_CTX_OPENGL_API) @@ -635,14 +630,14 @@ static void gfx_ctx_wgl_show_mouse(void *data, bool state) static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable) { - switch (g_api) + switch (win32_api) { case GFX_CTX_OPENGL_API: #ifdef HAVE_OPENGL - g_use_hw_ctx = enable; + win32_use_hw_ctx = enable; - if (g_hdc) - wglMakeCurrent(g_hdc, enable ? g_hw_hrc : g_hrc); + if (win32_hdc) + wglMakeCurrent(win32_hdc, enable ? win32_hw_hrc : win32_hrc); #endif break; @@ -656,14 +651,14 @@ static void gfx_ctx_wgl_bind_hw_render(void *data, bool enable) static void *gfx_ctx_wgl_get_context_data(void *data) { (void)data; - return &g_vk.context; + return &win32_vk.context; } #endif static uint32_t gfx_ctx_wgl_get_flags(void *data) { uint32_t flags = 0; - if (g_core_hw_context_enable) + if (win32_core_hw_context_enable) { BIT32_SET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT); } @@ -677,7 +672,7 @@ static uint32_t gfx_ctx_wgl_get_flags(void *data) static void gfx_ctx_wgl_set_flags(void *data, uint32_t flags) { if (BIT32_GET(flags, GFX_CTX_FLAGS_GL_CORE_CONTEXT)) - g_core_hw_context_enable = true; + win32_core_hw_context_enable = true; } const gfx_ctx_driver_t gfx_ctx_wgl = { From 44b95a16023560cfb520bcfd487d831408861bdc Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:18:19 -0500 Subject: [PATCH 159/638] revert retroarch.cfg --- retroarch.cfg | 2410 ++++++++++++++++--------------------------------- 1 file changed, 800 insertions(+), 1610 deletions(-) diff --git a/retroarch.cfg b/retroarch.cfg index 489ff50820..7d9890a08f 100644 --- a/retroarch.cfg +++ b/retroarch.cfg @@ -1,1610 +1,800 @@ -video_driver = "caca" -core_updater_buildbot_url = "http://buildbot.libretro.com/nightly/win-x86_64/latest/" -core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" -libretro_directory = "cores" -libretro_info_path = "info" -content_database_path = "database\rdb" -cheat_database_path = "cheats" -content_history_path = ".\content_history.lpl" -content_music_history_path = ".\content_music_history.lpl" -content_video_history_path = ".\content_video_history.lpl" -content_image_history_path = ".\content_image_history.lpl" -cursor_directory = "database\cursors" -screenshot_directory = "default" -system_directory = "default" -input_remapping_directory = "config\remaps" -video_shader_dir = "shaders" -video_filter_dir = "filters\video" -core_assets_directory = "downloads" -assets_directory = "assets" -dynamic_wallpapers_directory = "assets\wallpapers" -thumbnails_directory = "thumbnails" -playlist_directory = "playlists" -joypad_autoconfig_dir = "autoconfig" -audio_filter_dir = "filters\audio" -savefile_directory = "default" -savestate_directory = "default" -rgui_browser_directory = "default" -rgui_config_directory = "config" -overlay_directory = "overlays" -screenshot_directory = "default" -record_driver = "null" -camera_driver = "null" -wifi_driver = "null" -location_driver = "null" -menu_driver = "xmb" -audio_driver = "xaudio" -audio_resampler = "sinc" -input_driver = "dinput" -input_joypad_driver = "xinput" -video_aspect_ratio = "-1.000000" -video_scale = "3.000000" -video_refresh_rate = "59.940060" -audio_rate_control_delta = "0.005000" -audio_max_timing_skew = "0.050000" -audio_volume = "0.000000" -input_overlay_opacity = "0.700000" -input_overlay_scale = "1.000000" -menu_wallpaper_opacity = "0.300000" -menu_footer_opacity = "1.000000" -menu_header_opacity = "1.000000" -video_message_pos_x = "0.050000" -video_message_pos_y = "0.050000" -video_font_size = "32.000000" -fastforward_ratio = "0.000000" -slowmotion_ratio = "3.000000" -input_axis_threshold = "0.500000" -input_bind_timeout = "5" -input_turbo_period = "6" -input_duty_cycle = "3" -input_max_users = "5" -input_menu_toggle_gamepad_combo = "0" -audio_latency = "64" -audio_block_frames = "0" -rewind_granularity = "1" -autosave_interval = "0" -libretro_log_level = "0" -keyboard_gamepad_mapping_type = "1" -input_poll_type_behavior = "2" -video_monitor_index = "0" -video_fullscreen_x = "0" -video_fullscreen_y = "0" -video_window_x = "0" -video_window_y = "0" -network_cmd_port = "55355" -network_remote_base_port = "55400" -dpi_override_value = "200" -menu_thumbnails = "3" -xmb_alpha_factor = "75" -xmb_scale_factor = "100" -xmb_theme = "0" -xmb_menu_color_theme = "4" -materialui_menu_color_theme = "0" -menu_shader_pipeline = "2" -audio_out_rate = "48000" -custom_viewport_width = "960" -custom_viewport_height = "720" -custom_viewport_x = "0" -custom_viewport_y = "0" -content_history_size = "100" -video_hard_sync_frames = "0" -video_frame_delay = "0" -video_max_swapchain_images = "3" -video_swap_interval = "1" -video_rotation = "0" -aspect_ratio_index = "21" -state_slot = "0" -netplay_ip_port = "0" -netplay_delay_frames = "16" -netplay_check_frames = "30" -user_language = "0" -bundle_assets_extract_version_current = "0" -bundle_assets_extract_last_version = "0" -input_device_p1 = "0" -input_player1_joypad_index = "0" -input_libretro_device_p1 = "1" -input_player1_analog_dpad_mode = "0" -input_device_p2 = "0" -input_player2_joypad_index = "1" -input_libretro_device_p2 = "1" -input_player2_analog_dpad_mode = "0" -input_device_p3 = "0" -input_player3_joypad_index = "2" -input_libretro_device_p3 = "1" -input_player3_analog_dpad_mode = "0" -input_device_p4 = "0" -input_player4_joypad_index = "3" -input_libretro_device_p4 = "1" -input_player4_analog_dpad_mode = "0" -input_device_p5 = "0" -input_player5_joypad_index = "4" -input_libretro_device_p5 = "1" -input_player5_analog_dpad_mode = "0" -input_device_p6 = "0" -input_player6_joypad_index = "5" -input_libretro_device_p6 = "1" -input_player6_analog_dpad_mode = "0" -input_device_p7 = "0" -input_player7_joypad_index = "6" -input_libretro_device_p7 = "1" -input_player7_analog_dpad_mode = "0" -input_device_p8 = "0" -input_player8_joypad_index = "7" -input_libretro_device_p8 = "1" -input_player8_analog_dpad_mode = "0" -input_device_p9 = "0" -input_player9_joypad_index = "8" -input_libretro_device_p9 = "1" -input_player9_analog_dpad_mode = "0" -input_device_p10 = "0" -input_player10_joypad_index = "9" -input_libretro_device_p10 = "1" -input_player10_analog_dpad_mode = "0" -input_device_p11 = "0" -input_player11_joypad_index = "10" -input_libretro_device_p11 = "1" -input_player11_analog_dpad_mode = "0" -input_device_p12 = "0" -input_player12_joypad_index = "11" -input_libretro_device_p12 = "1" -input_player12_analog_dpad_mode = "0" -input_device_p13 = "0" -input_player13_joypad_index = "12" -input_libretro_device_p13 = "1" -input_player13_analog_dpad_mode = "0" -input_device_p14 = "0" -input_player14_joypad_index = "13" -input_libretro_device_p14 = "1" -input_player14_analog_dpad_mode = "0" -input_device_p15 = "0" -input_player15_joypad_index = "14" -input_libretro_device_p15 = "1" -input_player15_analog_dpad_mode = "0" -input_device_p16 = "0" -input_player16_joypad_index = "15" -input_libretro_device_p16 = "1" -input_player16_analog_dpad_mode = "0" -ui_companion_start_on_boot = "true" -ui_companion_enable = "false" -video_gpu_record = "false" -input_remap_binds_enable = "true" -all_users_control_menu = "false" -menu_swap_ok_cancel_buttons = "true" -netplay_client_swap_input = "true" -input_descriptor_label_show = "true" -input_descriptor_hide_unbound = "false" -load_dummy_on_core_shutdown = "true" -check_firmware_before_loading = "false" -builtin_mediaplayer_enable = "false" -builtin_imageviewer_enable = "true" -fps_show = "false" -ui_menubar_enable = "true" -suspend_screensaver_enable = "true" -rewind_enable = "false" -audio_sync = "true" -video_shader_enable = "false" -video_aspect_ratio_auto = "false" -video_allow_rotate = "true" -video_windowed_fullscreen = "true" -video_crop_overscan = "true" -video_scale_integer = "false" -video_smooth = "true" -video_force_aspect = "true" -video_threaded = "false" -video_shared_context = "false" -custom_bgm_enable = "false" -auto_screenshot_filename = "true" -video_force_srgb_disable = "false" -video_fullscreen = "false" -bundle_assets_extract_enable = "false" -video_vsync = "true" -video_hard_sync = "false" -video_black_frame_insertion = "false" -video_disable_composition = "false" -pause_nonactive = "true" -video_gpu_screenshot = "true" -video_post_filter_record = "false" -keyboard_gamepad_enable = "true" -core_set_supports_no_game_enable = "true" -audio_enable = "true" -audio_mute_enable = "false" -location_allow = "false" -video_font_enable = "true" -core_updater_auto_extract_archive = "true" -camera_allow = "false" -threaded_data_runloop_enable = "true" -menu_throttle_framerate = "true" -menu_linear_filter = "true" -dpi_override_enable = "true" -menu_pause_libretro = "true" -menu_mouse_enable = "true" -menu_pointer_enable = "false" -menu_timedate_enable = "true" -menu_core_enable = "true" -menu_dynamic_wallpaper_enable = "false" -xmb_shadows_enable = "true" -xmb_show_settings = "true" -xmb_show_images = "true" -xmb_show_history = "true" -rgui_show_start_screen = "false" -menu_navigation_wraparound_enable = "true" -menu_navigation_browser_filter_supported_extensions_enable = "true" -menu_show_advanced_settings = "true" -cheevos_enable = "false" -cheevos_test_unofficial = "false" -cheevos_hardcore_mode_enable = "false" -input_overlay_enable = "true" -input_overlay_enable_autopreferred = "true" -input_overlay_hide_in_menu = "true" -network_cmd_enable = "false" -stdin_cmd_enable = "false" -network_remote_enable = "false" -netplay_spectator_mode_enable = "false" -netplay_nat_traversal = "true" -block_sram_overwrite = "false" -savestate_auto_index = "false" -savestate_auto_save = "false" -savestate_auto_load = "false" -savestate_thumbnail_enable = "false" -history_list_enable = "true" -game_specific_options = "false" -auto_overrides_enable = "true" -auto_remaps_enable = "true" -auto_shaders_enable = "true" -sort_savefiles_enable = "false" -sort_savestates_enable = "false" -config_save_on_exit = "true" -show_hidden_files = "true" -input_autodetect_enable = "true" -audio_rate_control = "true" -network_remote_enable_user_p1 = "false" -network_remote_enable_user_p2 = "false" -network_remote_enable_user_p3 = "false" -network_remote_enable_user_p4 = "false" -network_remote_enable_user_p5 = "false" -network_remote_enable_user_p6 = "false" -network_remote_enable_user_p7 = "false" -network_remote_enable_user_p8 = "false" -network_remote_enable_user_p9 = "false" -network_remote_enable_user_p10 = "false" -network_remote_enable_user_p11 = "false" -network_remote_enable_user_p12 = "false" -network_remote_enable_user_p13 = "false" -network_remote_enable_user_p14 = "false" -network_remote_enable_user_p15 = "false" -network_remote_enable_user_p16 = "false" -log_verbosity = "false" -perfcnt_enable = "false" -video_message_color = "ffff00" -menu_entry_normal_color = "ffffffff" -menu_entry_hover_color = "ff64ff64" -menu_title_color = "ff64ff64" -gamma_correction = "false" -flicker_filter_enable = "false" -soft_filter_enable = "false" -soft_filter_index = "0" -current_resolution_id = "0" -flicker_filter_index = "0" -input_player1_b = "z" -input_player1_b_btn = "nul" -input_player1_b_axis = "nul" -input_player1_y = "a" -input_player1_y_btn = "nul" -input_player1_y_axis = "nul" -input_player1_select = "rshift" -input_player1_select_btn = "nul" -input_player1_select_axis = "nul" -input_player1_start = "enter" -input_player1_start_btn = "nul" -input_player1_start_axis = "nul" -input_player1_up = "up" -input_player1_up_btn = "nul" -input_player1_up_axis = "nul" -input_player1_down = "down" -input_player1_down_btn = "nul" -input_player1_down_axis = "nul" -input_player1_left = "left" -input_player1_left_btn = "nul" -input_player1_left_axis = "nul" -input_player1_right = "right" -input_player1_right_btn = "nul" -input_player1_right_axis = "nul" -input_player1_a = "x" -input_player1_a_btn = "nul" -input_player1_a_axis = "nul" -input_player1_x = "s" -input_player1_x_btn = "nul" -input_player1_x_axis = "nul" -input_player1_l = "q" -input_player1_l_btn = "nul" -input_player1_l_axis = "nul" -input_player1_r = "w" -input_player1_r_btn = "nul" -input_player1_r_axis = "nul" -input_player1_l2 = "nul" -input_player1_l2_btn = "nul" -input_player1_l2_axis = "nul" -input_player1_r2 = "nul" -input_player1_r2_btn = "nul" -input_player1_r2_axis = "nul" -input_player1_l3 = "nul" -input_player1_l3_btn = "nul" -input_player1_l3_axis = "nul" -input_player1_r3 = "nul" -input_player1_r3_btn = "nul" -input_player1_r3_axis = "nul" -input_player1_l_x_plus = "nul" -input_player1_l_x_plus_btn = "nul" -input_player1_l_x_plus_axis = "nul" -input_player1_l_x_minus = "nul" -input_player1_l_x_minus_btn = "nul" -input_player1_l_x_minus_axis = "nul" -input_player1_l_y_plus = "nul" -input_player1_l_y_plus_btn = "nul" -input_player1_l_y_plus_axis = "nul" -input_player1_l_y_minus = "nul" -input_player1_l_y_minus_btn = "nul" -input_player1_l_y_minus_axis = "nul" -input_player1_r_x_plus = "nul" -input_player1_r_x_plus_btn = "nul" -input_player1_r_x_plus_axis = "nul" -input_player1_r_x_minus = "nul" -input_player1_r_x_minus_btn = "nul" -input_player1_r_x_minus_axis = "nul" -input_player1_r_y_plus = "nul" -input_player1_r_y_plus_btn = "nul" -input_player1_r_y_plus_axis = "nul" -input_player1_r_y_minus = "nul" -input_player1_r_y_minus_btn = "nul" -input_player1_r_y_minus_axis = "nul" -input_player1_turbo = "nul" -input_player1_turbo_btn = "nul" -input_player1_turbo_axis = "nul" -input_toggle_fast_forward = "space" -input_toggle_fast_forward_btn = "nul" -input_toggle_fast_forward_axis = "nul" -input_hold_fast_forward = "l" -input_hold_fast_forward_btn = "nul" -input_hold_fast_forward_axis = "nul" -input_load_state = "f4" -input_load_state_btn = "nul" -input_load_state_axis = "nul" -input_save_state = "f2" -input_save_state_btn = "nul" -input_save_state_axis = "nul" -input_toggle_fullscreen = "f" -input_toggle_fullscreen_btn = "nul" -input_toggle_fullscreen_axis = "nul" -input_exit_emulator = "escape" -input_exit_emulator_btn = "nul" -input_exit_emulator_axis = "nul" -input_state_slot_increase = "f7" -input_state_slot_increase_btn = "nul" -input_state_slot_increase_axis = "nul" -input_state_slot_decrease = "f6" -input_state_slot_decrease_btn = "nul" -input_state_slot_decrease_axis = "nul" -input_rewind = "r" -input_rewind_btn = "nul" -input_rewind_axis = "nul" -input_movie_record_toggle = "o" -input_movie_record_toggle_btn = "nul" -input_movie_record_toggle_axis = "nul" -input_pause_toggle = "p" -input_pause_toggle_btn = "nul" -input_pause_toggle_axis = "nul" -input_frame_advance = "k" -input_frame_advance_btn = "nul" -input_frame_advance_axis = "nul" -input_reset = "h" -input_reset_btn = "nul" -input_reset_axis = "nul" -input_shader_next = "m" -input_shader_next_btn = "nul" -input_shader_next_axis = "nul" -input_shader_prev = "n" -input_shader_prev_btn = "nul" -input_shader_prev_axis = "nul" -input_cheat_index_plus = "y" -input_cheat_index_plus_btn = "nul" -input_cheat_index_plus_axis = "nul" -input_cheat_index_minus = "t" -input_cheat_index_minus_btn = "nul" -input_cheat_index_minus_axis = "nul" -input_cheat_toggle = "u" -input_cheat_toggle_btn = "nul" -input_cheat_toggle_axis = "nul" -input_screenshot = "f8" -input_screenshot_btn = "nul" -input_screenshot_axis = "nul" -input_audio_mute = "f9" -input_audio_mute_btn = "nul" -input_audio_mute_axis = "nul" -input_osk_toggle = "f12" -input_osk_toggle_btn = "nul" -input_osk_toggle_axis = "nul" -input_netplay_flip_players = "i" -input_netplay_flip_players_btn = "nul" -input_netplay_flip_players_axis = "nul" -input_slowmotion = "e" -input_slowmotion_btn = "nul" -input_slowmotion_axis = "nul" -input_enable_hotkey = "nul" -input_enable_hotkey_btn = "nul" -input_enable_hotkey_axis = "nul" -input_volume_up = "add" -input_volume_up_btn = "nul" -input_volume_up_axis = "nul" -input_volume_down = "subtract" -input_volume_down_btn = "nul" -input_volume_down_axis = "nul" -input_overlay_next = "nul" -input_overlay_next_btn = "nul" -input_overlay_next_axis = "nul" -input_disk_eject_toggle = "nul" -input_disk_eject_toggle_btn = "nul" -input_disk_eject_toggle_axis = "nul" -input_disk_next = "nul" -input_disk_next_btn = "nul" -input_disk_next_axis = "nul" -input_disk_prev = "nul" -input_disk_prev_btn = "nul" -input_disk_prev_axis = "nul" -input_grab_mouse_toggle = "f11" -input_grab_mouse_toggle_btn = "nul" -input_grab_mouse_toggle_axis = "nul" -input_menu_toggle = "f1" -input_menu_toggle_btn = "nul" -input_menu_toggle_axis = "nul" -input_player2_b = "nul" -input_player2_b_btn = "nul" -input_player2_b_axis = "nul" -input_player2_y = "nul" -input_player2_y_btn = "nul" -input_player2_y_axis = "nul" -input_player2_select = "nul" -input_player2_select_btn = "nul" -input_player2_select_axis = "nul" -input_player2_start = "nul" -input_player2_start_btn = "nul" -input_player2_start_axis = "nul" -input_player2_up = "nul" -input_player2_up_btn = "nul" -input_player2_up_axis = "nul" -input_player2_down = "nul" -input_player2_down_btn = "nul" -input_player2_down_axis = "nul" -input_player2_left = "nul" -input_player2_left_btn = "nul" -input_player2_left_axis = "nul" -input_player2_right = "nul" -input_player2_right_btn = "nul" -input_player2_right_axis = "nul" -input_player2_a = "nul" -input_player2_a_btn = "nul" -input_player2_a_axis = "nul" -input_player2_x = "nul" -input_player2_x_btn = "nul" -input_player2_x_axis = "nul" -input_player2_l = "nul" -input_player2_l_btn = "nul" -input_player2_l_axis = "nul" -input_player2_r = "nul" -input_player2_r_btn = "nul" -input_player2_r_axis = "nul" -input_player2_l2 = "nul" -input_player2_l2_btn = "nul" -input_player2_l2_axis = "nul" -input_player2_r2 = "nul" -input_player2_r2_btn = "nul" -input_player2_r2_axis = "nul" -input_player2_l3 = "nul" -input_player2_l3_btn = "nul" -input_player2_l3_axis = "nul" -input_player2_r3 = "nul" -input_player2_r3_btn = "nul" -input_player2_r3_axis = "nul" -input_player2_l_x_plus = "nul" -input_player2_l_x_plus_btn = "nul" -input_player2_l_x_plus_axis = "nul" -input_player2_l_x_minus = "nul" -input_player2_l_x_minus_btn = "nul" -input_player2_l_x_minus_axis = "nul" -input_player2_l_y_plus = "nul" -input_player2_l_y_plus_btn = "nul" -input_player2_l_y_plus_axis = "nul" -input_player2_l_y_minus = "nul" -input_player2_l_y_minus_btn = "nul" -input_player2_l_y_minus_axis = "nul" -input_player2_r_x_plus = "nul" -input_player2_r_x_plus_btn = "nul" -input_player2_r_x_plus_axis = "nul" -input_player2_r_x_minus = "nul" -input_player2_r_x_minus_btn = "nul" -input_player2_r_x_minus_axis = "nul" -input_player2_r_y_plus = "nul" -input_player2_r_y_plus_btn = "nul" -input_player2_r_y_plus_axis = "nul" -input_player2_r_y_minus = "nul" -input_player2_r_y_minus_btn = "nul" -input_player2_r_y_minus_axis = "nul" -input_player2_turbo = "nul" -input_player2_turbo_btn = "nul" -input_player2_turbo_axis = "nul" -input_player3_b = "nul" -input_player3_b_btn = "nul" -input_player3_b_axis = "nul" -input_player3_y = "nul" -input_player3_y_btn = "nul" -input_player3_y_axis = "nul" -input_player3_select = "nul" -input_player3_select_btn = "nul" -input_player3_select_axis = "nul" -input_player3_start = "nul" -input_player3_start_btn = "nul" -input_player3_start_axis = "nul" -input_player3_up = "nul" -input_player3_up_btn = "nul" -input_player3_up_axis = "nul" -input_player3_down = "nul" -input_player3_down_btn = "nul" -input_player3_down_axis = "nul" -input_player3_left = "nul" -input_player3_left_btn = "nul" -input_player3_left_axis = "nul" -input_player3_right = "nul" -input_player3_right_btn = "nul" -input_player3_right_axis = "nul" -input_player3_a = "nul" -input_player3_a_btn = "nul" -input_player3_a_axis = "nul" -input_player3_x = "nul" -input_player3_x_btn = "nul" -input_player3_x_axis = "nul" -input_player3_l = "nul" -input_player3_l_btn = "nul" -input_player3_l_axis = "nul" -input_player3_r = "nul" -input_player3_r_btn = "nul" -input_player3_r_axis = "nul" -input_player3_l2 = "nul" -input_player3_l2_btn = "nul" -input_player3_l2_axis = "nul" -input_player3_r2 = "nul" -input_player3_r2_btn = "nul" -input_player3_r2_axis = "nul" -input_player3_l3 = "nul" -input_player3_l3_btn = "nul" -input_player3_l3_axis = "nul" -input_player3_r3 = "nul" -input_player3_r3_btn = "nul" -input_player3_r3_axis = "nul" -input_player3_l_x_plus = "nul" -input_player3_l_x_plus_btn = "nul" -input_player3_l_x_plus_axis = "nul" -input_player3_l_x_minus = "nul" -input_player3_l_x_minus_btn = "nul" -input_player3_l_x_minus_axis = "nul" -input_player3_l_y_plus = "nul" -input_player3_l_y_plus_btn = "nul" -input_player3_l_y_plus_axis = "nul" -input_player3_l_y_minus = "nul" -input_player3_l_y_minus_btn = "nul" -input_player3_l_y_minus_axis = "nul" -input_player3_r_x_plus = "nul" -input_player3_r_x_plus_btn = "nul" -input_player3_r_x_plus_axis = "nul" -input_player3_r_x_minus = "nul" -input_player3_r_x_minus_btn = "nul" -input_player3_r_x_minus_axis = "nul" -input_player3_r_y_plus = "nul" -input_player3_r_y_plus_btn = "nul" -input_player3_r_y_plus_axis = "nul" -input_player3_r_y_minus = "nul" -input_player3_r_y_minus_btn = "nul" -input_player3_r_y_minus_axis = "nul" -input_player3_turbo = "nul" -input_player3_turbo_btn = "nul" -input_player3_turbo_axis = "nul" -input_player4_b = "nul" -input_player4_b_btn = "nul" -input_player4_b_axis = "nul" -input_player4_y = "nul" -input_player4_y_btn = "nul" -input_player4_y_axis = "nul" -input_player4_select = "nul" -input_player4_select_btn = "nul" -input_player4_select_axis = "nul" -input_player4_start = "nul" -input_player4_start_btn = "nul" -input_player4_start_axis = "nul" -input_player4_up = "nul" -input_player4_up_btn = "nul" -input_player4_up_axis = "nul" -input_player4_down = "nul" -input_player4_down_btn = "nul" -input_player4_down_axis = "nul" -input_player4_left = "nul" -input_player4_left_btn = "nul" -input_player4_left_axis = "nul" -input_player4_right = "nul" -input_player4_right_btn = "nul" -input_player4_right_axis = "nul" -input_player4_a = "nul" -input_player4_a_btn = "nul" -input_player4_a_axis = "nul" -input_player4_x = "nul" -input_player4_x_btn = "nul" -input_player4_x_axis = "nul" -input_player4_l = "nul" -input_player4_l_btn = "nul" -input_player4_l_axis = "nul" -input_player4_r = "nul" -input_player4_r_btn = "nul" -input_player4_r_axis = "nul" -input_player4_l2 = "nul" -input_player4_l2_btn = "nul" -input_player4_l2_axis = "nul" -input_player4_r2 = "nul" -input_player4_r2_btn = "nul" -input_player4_r2_axis = "nul" -input_player4_l3 = "nul" -input_player4_l3_btn = "nul" -input_player4_l3_axis = "nul" -input_player4_r3 = "nul" -input_player4_r3_btn = "nul" -input_player4_r3_axis = "nul" -input_player4_l_x_plus = "nul" -input_player4_l_x_plus_btn = "nul" -input_player4_l_x_plus_axis = "nul" -input_player4_l_x_minus = "nul" -input_player4_l_x_minus_btn = "nul" -input_player4_l_x_minus_axis = "nul" -input_player4_l_y_plus = "nul" -input_player4_l_y_plus_btn = "nul" -input_player4_l_y_plus_axis = "nul" -input_player4_l_y_minus = "nul" -input_player4_l_y_minus_btn = "nul" -input_player4_l_y_minus_axis = "nul" -input_player4_r_x_plus = "nul" -input_player4_r_x_plus_btn = "nul" -input_player4_r_x_plus_axis = "nul" -input_player4_r_x_minus = "nul" -input_player4_r_x_minus_btn = "nul" -input_player4_r_x_minus_axis = "nul" -input_player4_r_y_plus = "nul" -input_player4_r_y_plus_btn = "nul" -input_player4_r_y_plus_axis = "nul" -input_player4_r_y_minus = "nul" -input_player4_r_y_minus_btn = "nul" -input_player4_r_y_minus_axis = "nul" -input_player4_turbo = "nul" -input_player4_turbo_btn = "nul" -input_player4_turbo_axis = "nul" -input_player5_b = "nul" -input_player5_b_btn = "nul" -input_player5_b_axis = "nul" -input_player5_y = "nul" -input_player5_y_btn = "nul" -input_player5_y_axis = "nul" -input_player5_select = "nul" -input_player5_select_btn = "nul" -input_player5_select_axis = "nul" -input_player5_start = "nul" -input_player5_start_btn = "nul" -input_player5_start_axis = "nul" -input_player5_up = "nul" -input_player5_up_btn = "nul" -input_player5_up_axis = "nul" -input_player5_down = "nul" -input_player5_down_btn = "nul" -input_player5_down_axis = "nul" -input_player5_left = "nul" -input_player5_left_btn = "nul" -input_player5_left_axis = "nul" -input_player5_right = "nul" -input_player5_right_btn = "nul" -input_player5_right_axis = "nul" -input_player5_a = "nul" -input_player5_a_btn = "nul" -input_player5_a_axis = "nul" -input_player5_x = "nul" -input_player5_x_btn = "nul" -input_player5_x_axis = "nul" -input_player5_l = "nul" -input_player5_l_btn = "nul" -input_player5_l_axis = "nul" -input_player5_r = "nul" -input_player5_r_btn = "nul" -input_player5_r_axis = "nul" -input_player5_l2 = "nul" -input_player5_l2_btn = "nul" -input_player5_l2_axis = "nul" -input_player5_r2 = "nul" -input_player5_r2_btn = "nul" -input_player5_r2_axis = "nul" -input_player5_l3 = "nul" -input_player5_l3_btn = "nul" -input_player5_l3_axis = "nul" -input_player5_r3 = "nul" -input_player5_r3_btn = "nul" -input_player5_r3_axis = "nul" -input_player5_l_x_plus = "nul" -input_player5_l_x_plus_btn = "nul" -input_player5_l_x_plus_axis = "nul" -input_player5_l_x_minus = "nul" -input_player5_l_x_minus_btn = "nul" -input_player5_l_x_minus_axis = "nul" -input_player5_l_y_plus = "nul" -input_player5_l_y_plus_btn = "nul" -input_player5_l_y_plus_axis = "nul" -input_player5_l_y_minus = "nul" -input_player5_l_y_minus_btn = "nul" -input_player5_l_y_minus_axis = "nul" -input_player5_r_x_plus = "nul" -input_player5_r_x_plus_btn = "nul" -input_player5_r_x_plus_axis = "nul" -input_player5_r_x_minus = "nul" -input_player5_r_x_minus_btn = "nul" -input_player5_r_x_minus_axis = "nul" -input_player5_r_y_plus = "nul" -input_player5_r_y_plus_btn = "nul" -input_player5_r_y_plus_axis = "nul" -input_player5_r_y_minus = "nul" -input_player5_r_y_minus_btn = "nul" -input_player5_r_y_minus_axis = "nul" -input_player5_turbo = "nul" -input_player5_turbo_btn = "nul" -input_player5_turbo_axis = "nul" -input_player6_b = "nul" -input_player6_b_btn = "nul" -input_player6_b_axis = "nul" -input_player6_y = "nul" -input_player6_y_btn = "nul" -input_player6_y_axis = "nul" -input_player6_select = "nul" -input_player6_select_btn = "nul" -input_player6_select_axis = "nul" -input_player6_start = "nul" -input_player6_start_btn = "nul" -input_player6_start_axis = "nul" -input_player6_up = "nul" -input_player6_up_btn = "nul" -input_player6_up_axis = "nul" -input_player6_down = "nul" -input_player6_down_btn = "nul" -input_player6_down_axis = "nul" -input_player6_left = "nul" -input_player6_left_btn = "nul" -input_player6_left_axis = "nul" -input_player6_right = "nul" -input_player6_right_btn = "nul" -input_player6_right_axis = "nul" -input_player6_a = "nul" -input_player6_a_btn = "nul" -input_player6_a_axis = "nul" -input_player6_x = "nul" -input_player6_x_btn = "nul" -input_player6_x_axis = "nul" -input_player6_l = "nul" -input_player6_l_btn = "nul" -input_player6_l_axis = "nul" -input_player6_r = "nul" -input_player6_r_btn = "nul" -input_player6_r_axis = "nul" -input_player6_l2 = "nul" -input_player6_l2_btn = "nul" -input_player6_l2_axis = "nul" -input_player6_r2 = "nul" -input_player6_r2_btn = "nul" -input_player6_r2_axis = "nul" -input_player6_l3 = "nul" -input_player6_l3_btn = "nul" -input_player6_l3_axis = "nul" -input_player6_r3 = "nul" -input_player6_r3_btn = "nul" -input_player6_r3_axis = "nul" -input_player6_l_x_plus = "nul" -input_player6_l_x_plus_btn = "nul" -input_player6_l_x_plus_axis = "nul" -input_player6_l_x_minus = "nul" -input_player6_l_x_minus_btn = "nul" -input_player6_l_x_minus_axis = "nul" -input_player6_l_y_plus = "nul" -input_player6_l_y_plus_btn = "nul" -input_player6_l_y_plus_axis = "nul" -input_player6_l_y_minus = "nul" -input_player6_l_y_minus_btn = "nul" -input_player6_l_y_minus_axis = "nul" -input_player6_r_x_plus = "nul" -input_player6_r_x_plus_btn = "nul" -input_player6_r_x_plus_axis = "nul" -input_player6_r_x_minus = "nul" -input_player6_r_x_minus_btn = "nul" -input_player6_r_x_minus_axis = "nul" -input_player6_r_y_plus = "nul" -input_player6_r_y_plus_btn = "nul" -input_player6_r_y_plus_axis = "nul" -input_player6_r_y_minus = "nul" -input_player6_r_y_minus_btn = "nul" -input_player6_r_y_minus_axis = "nul" -input_player6_turbo = "nul" -input_player6_turbo_btn = "nul" -input_player6_turbo_axis = "nul" -input_player7_b = "nul" -input_player7_b_btn = "nul" -input_player7_b_axis = "nul" -input_player7_y = "nul" -input_player7_y_btn = "nul" -input_player7_y_axis = "nul" -input_player7_select = "nul" -input_player7_select_btn = "nul" -input_player7_select_axis = "nul" -input_player7_start = "nul" -input_player7_start_btn = "nul" -input_player7_start_axis = "nul" -input_player7_up = "nul" -input_player7_up_btn = "nul" -input_player7_up_axis = "nul" -input_player7_down = "nul" -input_player7_down_btn = "nul" -input_player7_down_axis = "nul" -input_player7_left = "nul" -input_player7_left_btn = "nul" -input_player7_left_axis = "nul" -input_player7_right = "nul" -input_player7_right_btn = "nul" -input_player7_right_axis = "nul" -input_player7_a = "nul" -input_player7_a_btn = "nul" -input_player7_a_axis = "nul" -input_player7_x = "nul" -input_player7_x_btn = "nul" -input_player7_x_axis = "nul" -input_player7_l = "nul" -input_player7_l_btn = "nul" -input_player7_l_axis = "nul" -input_player7_r = "nul" -input_player7_r_btn = "nul" -input_player7_r_axis = "nul" -input_player7_l2 = "nul" -input_player7_l2_btn = "nul" -input_player7_l2_axis = "nul" -input_player7_r2 = "nul" -input_player7_r2_btn = "nul" -input_player7_r2_axis = "nul" -input_player7_l3 = "nul" -input_player7_l3_btn = "nul" -input_player7_l3_axis = "nul" -input_player7_r3 = "nul" -input_player7_r3_btn = "nul" -input_player7_r3_axis = "nul" -input_player7_l_x_plus = "nul" -input_player7_l_x_plus_btn = "nul" -input_player7_l_x_plus_axis = "nul" -input_player7_l_x_minus = "nul" -input_player7_l_x_minus_btn = "nul" -input_player7_l_x_minus_axis = "nul" -input_player7_l_y_plus = "nul" -input_player7_l_y_plus_btn = "nul" -input_player7_l_y_plus_axis = "nul" -input_player7_l_y_minus = "nul" -input_player7_l_y_minus_btn = "nul" -input_player7_l_y_minus_axis = "nul" -input_player7_r_x_plus = "nul" -input_player7_r_x_plus_btn = "nul" -input_player7_r_x_plus_axis = "nul" -input_player7_r_x_minus = "nul" -input_player7_r_x_minus_btn = "nul" -input_player7_r_x_minus_axis = "nul" -input_player7_r_y_plus = "nul" -input_player7_r_y_plus_btn = "nul" -input_player7_r_y_plus_axis = "nul" -input_player7_r_y_minus = "nul" -input_player7_r_y_minus_btn = "nul" -input_player7_r_y_minus_axis = "nul" -input_player7_turbo = "nul" -input_player7_turbo_btn = "nul" -input_player7_turbo_axis = "nul" -input_player8_b = "nul" -input_player8_b_btn = "nul" -input_player8_b_axis = "nul" -input_player8_y = "nul" -input_player8_y_btn = "nul" -input_player8_y_axis = "nul" -input_player8_select = "nul" -input_player8_select_btn = "nul" -input_player8_select_axis = "nul" -input_player8_start = "nul" -input_player8_start_btn = "nul" -input_player8_start_axis = "nul" -input_player8_up = "nul" -input_player8_up_btn = "nul" -input_player8_up_axis = "nul" -input_player8_down = "nul" -input_player8_down_btn = "nul" -input_player8_down_axis = "nul" -input_player8_left = "nul" -input_player8_left_btn = "nul" -input_player8_left_axis = "nul" -input_player8_right = "nul" -input_player8_right_btn = "nul" -input_player8_right_axis = "nul" -input_player8_a = "nul" -input_player8_a_btn = "nul" -input_player8_a_axis = "nul" -input_player8_x = "nul" -input_player8_x_btn = "nul" -input_player8_x_axis = "nul" -input_player8_l = "nul" -input_player8_l_btn = "nul" -input_player8_l_axis = "nul" -input_player8_r = "nul" -input_player8_r_btn = "nul" -input_player8_r_axis = "nul" -input_player8_l2 = "nul" -input_player8_l2_btn = "nul" -input_player8_l2_axis = "nul" -input_player8_r2 = "nul" -input_player8_r2_btn = "nul" -input_player8_r2_axis = "nul" -input_player8_l3 = "nul" -input_player8_l3_btn = "nul" -input_player8_l3_axis = "nul" -input_player8_r3 = "nul" -input_player8_r3_btn = "nul" -input_player8_r3_axis = "nul" -input_player8_l_x_plus = "nul" -input_player8_l_x_plus_btn = "nul" -input_player8_l_x_plus_axis = "nul" -input_player8_l_x_minus = "nul" -input_player8_l_x_minus_btn = "nul" -input_player8_l_x_minus_axis = "nul" -input_player8_l_y_plus = "nul" -input_player8_l_y_plus_btn = "nul" -input_player8_l_y_plus_axis = "nul" -input_player8_l_y_minus = "nul" -input_player8_l_y_minus_btn = "nul" -input_player8_l_y_minus_axis = "nul" -input_player8_r_x_plus = "nul" -input_player8_r_x_plus_btn = "nul" -input_player8_r_x_plus_axis = "nul" -input_player8_r_x_minus = "nul" -input_player8_r_x_minus_btn = "nul" -input_player8_r_x_minus_axis = "nul" -input_player8_r_y_plus = "nul" -input_player8_r_y_plus_btn = "nul" -input_player8_r_y_plus_axis = "nul" -input_player8_r_y_minus = "nul" -input_player8_r_y_minus_btn = "nul" -input_player8_r_y_minus_axis = "nul" -input_player8_turbo = "nul" -input_player8_turbo_btn = "nul" -input_player8_turbo_axis = "nul" -input_player9_b = "nul" -input_player9_b_btn = "nul" -input_player9_b_axis = "nul" -input_player9_y = "nul" -input_player9_y_btn = "nul" -input_player9_y_axis = "nul" -input_player9_select = "nul" -input_player9_select_btn = "nul" -input_player9_select_axis = "nul" -input_player9_start = "nul" -input_player9_start_btn = "nul" -input_player9_start_axis = "nul" -input_player9_up = "nul" -input_player9_up_btn = "nul" -input_player9_up_axis = "nul" -input_player9_down = "nul" -input_player9_down_btn = "nul" -input_player9_down_axis = "nul" -input_player9_left = "nul" -input_player9_left_btn = "nul" -input_player9_left_axis = "nul" -input_player9_right = "nul" -input_player9_right_btn = "nul" -input_player9_right_axis = "nul" -input_player9_a = "nul" -input_player9_a_btn = "nul" -input_player9_a_axis = "nul" -input_player9_x = "nul" -input_player9_x_btn = "nul" -input_player9_x_axis = "nul" -input_player9_l = "nul" -input_player9_l_btn = "nul" -input_player9_l_axis = "nul" -input_player9_r = "nul" -input_player9_r_btn = "nul" -input_player9_r_axis = "nul" -input_player9_l2 = "nul" -input_player9_l2_btn = "nul" -input_player9_l2_axis = "nul" -input_player9_r2 = "nul" -input_player9_r2_btn = "nul" -input_player9_r2_axis = "nul" -input_player9_l3 = "nul" -input_player9_l3_btn = "nul" -input_player9_l3_axis = "nul" -input_player9_r3 = "nul" -input_player9_r3_btn = "nul" -input_player9_r3_axis = "nul" -input_player9_l_x_plus = "nul" -input_player9_l_x_plus_btn = "nul" -input_player9_l_x_plus_axis = "nul" -input_player9_l_x_minus = "nul" -input_player9_l_x_minus_btn = "nul" -input_player9_l_x_minus_axis = "nul" -input_player9_l_y_plus = "nul" -input_player9_l_y_plus_btn = "nul" -input_player9_l_y_plus_axis = "nul" -input_player9_l_y_minus = "nul" -input_player9_l_y_minus_btn = "nul" -input_player9_l_y_minus_axis = "nul" -input_player9_r_x_plus = "nul" -input_player9_r_x_plus_btn = "nul" -input_player9_r_x_plus_axis = "nul" -input_player9_r_x_minus = "nul" -input_player9_r_x_minus_btn = "nul" -input_player9_r_x_minus_axis = "nul" -input_player9_r_y_plus = "nul" -input_player9_r_y_plus_btn = "nul" -input_player9_r_y_plus_axis = "nul" -input_player9_r_y_minus = "nul" -input_player9_r_y_minus_btn = "nul" -input_player9_r_y_minus_axis = "nul" -input_player9_turbo = "nul" -input_player9_turbo_btn = "nul" -input_player9_turbo_axis = "nul" -input_player10_b = "nul" -input_player10_b_btn = "nul" -input_player10_b_axis = "nul" -input_player10_y = "nul" -input_player10_y_btn = "nul" -input_player10_y_axis = "nul" -input_player10_select = "nul" -input_player10_select_btn = "nul" -input_player10_select_axis = "nul" -input_player10_start = "nul" -input_player10_start_btn = "nul" -input_player10_start_axis = "nul" -input_player10_up = "nul" -input_player10_up_btn = "nul" -input_player10_up_axis = "nul" -input_player10_down = "nul" -input_player10_down_btn = "nul" -input_player10_down_axis = "nul" -input_player10_left = "nul" -input_player10_left_btn = "nul" -input_player10_left_axis = "nul" -input_player10_right = "nul" -input_player10_right_btn = "nul" -input_player10_right_axis = "nul" -input_player10_a = "nul" -input_player10_a_btn = "nul" -input_player10_a_axis = "nul" -input_player10_x = "nul" -input_player10_x_btn = "nul" -input_player10_x_axis = "nul" -input_player10_l = "nul" -input_player10_l_btn = "nul" -input_player10_l_axis = "nul" -input_player10_r = "nul" -input_player10_r_btn = "nul" -input_player10_r_axis = "nul" -input_player10_l2 = "nul" -input_player10_l2_btn = "nul" -input_player10_l2_axis = "nul" -input_player10_r2 = "nul" -input_player10_r2_btn = "nul" -input_player10_r2_axis = "nul" -input_player10_l3 = "nul" -input_player10_l3_btn = "nul" -input_player10_l3_axis = "nul" -input_player10_r3 = "nul" -input_player10_r3_btn = "nul" -input_player10_r3_axis = "nul" -input_player10_l_x_plus = "nul" -input_player10_l_x_plus_btn = "nul" -input_player10_l_x_plus_axis = "nul" -input_player10_l_x_minus = "nul" -input_player10_l_x_minus_btn = "nul" -input_player10_l_x_minus_axis = "nul" -input_player10_l_y_plus = "nul" -input_player10_l_y_plus_btn = "nul" -input_player10_l_y_plus_axis = "nul" -input_player10_l_y_minus = "nul" -input_player10_l_y_minus_btn = "nul" -input_player10_l_y_minus_axis = "nul" -input_player10_r_x_plus = "nul" -input_player10_r_x_plus_btn = "nul" -input_player10_r_x_plus_axis = "nul" -input_player10_r_x_minus = "nul" -input_player10_r_x_minus_btn = "nul" -input_player10_r_x_minus_axis = "nul" -input_player10_r_y_plus = "nul" -input_player10_r_y_plus_btn = "nul" -input_player10_r_y_plus_axis = "nul" -input_player10_r_y_minus = "nul" -input_player10_r_y_minus_btn = "nul" -input_player10_r_y_minus_axis = "nul" -input_player10_turbo = "nul" -input_player10_turbo_btn = "nul" -input_player10_turbo_axis = "nul" -input_player11_b = "nul" -input_player11_b_btn = "nul" -input_player11_b_axis = "nul" -input_player11_y = "nul" -input_player11_y_btn = "nul" -input_player11_y_axis = "nul" -input_player11_select = "nul" -input_player11_select_btn = "nul" -input_player11_select_axis = "nul" -input_player11_start = "nul" -input_player11_start_btn = "nul" -input_player11_start_axis = "nul" -input_player11_up = "nul" -input_player11_up_btn = "nul" -input_player11_up_axis = "nul" -input_player11_down = "nul" -input_player11_down_btn = "nul" -input_player11_down_axis = "nul" -input_player11_left = "nul" -input_player11_left_btn = "nul" -input_player11_left_axis = "nul" -input_player11_right = "nul" -input_player11_right_btn = "nul" -input_player11_right_axis = "nul" -input_player11_a = "nul" -input_player11_a_btn = "nul" -input_player11_a_axis = "nul" -input_player11_x = "nul" -input_player11_x_btn = "nul" -input_player11_x_axis = "nul" -input_player11_l = "nul" -input_player11_l_btn = "nul" -input_player11_l_axis = "nul" -input_player11_r = "nul" -input_player11_r_btn = "nul" -input_player11_r_axis = "nul" -input_player11_l2 = "nul" -input_player11_l2_btn = "nul" -input_player11_l2_axis = "nul" -input_player11_r2 = "nul" -input_player11_r2_btn = "nul" -input_player11_r2_axis = "nul" -input_player11_l3 = "nul" -input_player11_l3_btn = "nul" -input_player11_l3_axis = "nul" -input_player11_r3 = "nul" -input_player11_r3_btn = "nul" -input_player11_r3_axis = "nul" -input_player11_l_x_plus = "nul" -input_player11_l_x_plus_btn = "nul" -input_player11_l_x_plus_axis = "nul" -input_player11_l_x_minus = "nul" -input_player11_l_x_minus_btn = "nul" -input_player11_l_x_minus_axis = "nul" -input_player11_l_y_plus = "nul" -input_player11_l_y_plus_btn = "nul" -input_player11_l_y_plus_axis = "nul" -input_player11_l_y_minus = "nul" -input_player11_l_y_minus_btn = "nul" -input_player11_l_y_minus_axis = "nul" -input_player11_r_x_plus = "nul" -input_player11_r_x_plus_btn = "nul" -input_player11_r_x_plus_axis = "nul" -input_player11_r_x_minus = "nul" -input_player11_r_x_minus_btn = "nul" -input_player11_r_x_minus_axis = "nul" -input_player11_r_y_plus = "nul" -input_player11_r_y_plus_btn = "nul" -input_player11_r_y_plus_axis = "nul" -input_player11_r_y_minus = "nul" -input_player11_r_y_minus_btn = "nul" -input_player11_r_y_minus_axis = "nul" -input_player11_turbo = "nul" -input_player11_turbo_btn = "nul" -input_player11_turbo_axis = "nul" -input_player12_b = "nul" -input_player12_b_btn = "nul" -input_player12_b_axis = "nul" -input_player12_y = "nul" -input_player12_y_btn = "nul" -input_player12_y_axis = "nul" -input_player12_select = "nul" -input_player12_select_btn = "nul" -input_player12_select_axis = "nul" -input_player12_start = "nul" -input_player12_start_btn = "nul" -input_player12_start_axis = "nul" -input_player12_up = "nul" -input_player12_up_btn = "nul" -input_player12_up_axis = "nul" -input_player12_down = "nul" -input_player12_down_btn = "nul" -input_player12_down_axis = "nul" -input_player12_left = "nul" -input_player12_left_btn = "nul" -input_player12_left_axis = "nul" -input_player12_right = "nul" -input_player12_right_btn = "nul" -input_player12_right_axis = "nul" -input_player12_a = "nul" -input_player12_a_btn = "nul" -input_player12_a_axis = "nul" -input_player12_x = "nul" -input_player12_x_btn = "nul" -input_player12_x_axis = "nul" -input_player12_l = "nul" -input_player12_l_btn = "nul" -input_player12_l_axis = "nul" -input_player12_r = "nul" -input_player12_r_btn = "nul" -input_player12_r_axis = "nul" -input_player12_l2 = "nul" -input_player12_l2_btn = "nul" -input_player12_l2_axis = "nul" -input_player12_r2 = "nul" -input_player12_r2_btn = "nul" -input_player12_r2_axis = "nul" -input_player12_l3 = "nul" -input_player12_l3_btn = "nul" -input_player12_l3_axis = "nul" -input_player12_r3 = "nul" -input_player12_r3_btn = "nul" -input_player12_r3_axis = "nul" -input_player12_l_x_plus = "nul" -input_player12_l_x_plus_btn = "nul" -input_player12_l_x_plus_axis = "nul" -input_player12_l_x_minus = "nul" -input_player12_l_x_minus_btn = "nul" -input_player12_l_x_minus_axis = "nul" -input_player12_l_y_plus = "nul" -input_player12_l_y_plus_btn = "nul" -input_player12_l_y_plus_axis = "nul" -input_player12_l_y_minus = "nul" -input_player12_l_y_minus_btn = "nul" -input_player12_l_y_minus_axis = "nul" -input_player12_r_x_plus = "nul" -input_player12_r_x_plus_btn = "nul" -input_player12_r_x_plus_axis = "nul" -input_player12_r_x_minus = "nul" -input_player12_r_x_minus_btn = "nul" -input_player12_r_x_minus_axis = "nul" -input_player12_r_y_plus = "nul" -input_player12_r_y_plus_btn = "nul" -input_player12_r_y_plus_axis = "nul" -input_player12_r_y_minus = "nul" -input_player12_r_y_minus_btn = "nul" -input_player12_r_y_minus_axis = "nul" -input_player12_turbo = "nul" -input_player12_turbo_btn = "nul" -input_player12_turbo_axis = "nul" -input_player13_b = "nul" -input_player13_b_btn = "nul" -input_player13_b_axis = "nul" -input_player13_y = "nul" -input_player13_y_btn = "nul" -input_player13_y_axis = "nul" -input_player13_select = "nul" -input_player13_select_btn = "nul" -input_player13_select_axis = "nul" -input_player13_start = "nul" -input_player13_start_btn = "nul" -input_player13_start_axis = "nul" -input_player13_up = "nul" -input_player13_up_btn = "nul" -input_player13_up_axis = "nul" -input_player13_down = "nul" -input_player13_down_btn = "nul" -input_player13_down_axis = "nul" -input_player13_left = "nul" -input_player13_left_btn = "nul" -input_player13_left_axis = "nul" -input_player13_right = "nul" -input_player13_right_btn = "nul" -input_player13_right_axis = "nul" -input_player13_a = "nul" -input_player13_a_btn = "nul" -input_player13_a_axis = "nul" -input_player13_x = "nul" -input_player13_x_btn = "nul" -input_player13_x_axis = "nul" -input_player13_l = "nul" -input_player13_l_btn = "nul" -input_player13_l_axis = "nul" -input_player13_r = "nul" -input_player13_r_btn = "nul" -input_player13_r_axis = "nul" -input_player13_l2 = "nul" -input_player13_l2_btn = "nul" -input_player13_l2_axis = "nul" -input_player13_r2 = "nul" -input_player13_r2_btn = "nul" -input_player13_r2_axis = "nul" -input_player13_l3 = "nul" -input_player13_l3_btn = "nul" -input_player13_l3_axis = "nul" -input_player13_r3 = "nul" -input_player13_r3_btn = "nul" -input_player13_r3_axis = "nul" -input_player13_l_x_plus = "nul" -input_player13_l_x_plus_btn = "nul" -input_player13_l_x_plus_axis = "nul" -input_player13_l_x_minus = "nul" -input_player13_l_x_minus_btn = "nul" -input_player13_l_x_minus_axis = "nul" -input_player13_l_y_plus = "nul" -input_player13_l_y_plus_btn = "nul" -input_player13_l_y_plus_axis = "nul" -input_player13_l_y_minus = "nul" -input_player13_l_y_minus_btn = "nul" -input_player13_l_y_minus_axis = "nul" -input_player13_r_x_plus = "nul" -input_player13_r_x_plus_btn = "nul" -input_player13_r_x_plus_axis = "nul" -input_player13_r_x_minus = "nul" -input_player13_r_x_minus_btn = "nul" -input_player13_r_x_minus_axis = "nul" -input_player13_r_y_plus = "nul" -input_player13_r_y_plus_btn = "nul" -input_player13_r_y_plus_axis = "nul" -input_player13_r_y_minus = "nul" -input_player13_r_y_minus_btn = "nul" -input_player13_r_y_minus_axis = "nul" -input_player13_turbo = "nul" -input_player13_turbo_btn = "nul" -input_player13_turbo_axis = "nul" -input_player14_b = "nul" -input_player14_b_btn = "nul" -input_player14_b_axis = "nul" -input_player14_y = "nul" -input_player14_y_btn = "nul" -input_player14_y_axis = "nul" -input_player14_select = "nul" -input_player14_select_btn = "nul" -input_player14_select_axis = "nul" -input_player14_start = "nul" -input_player14_start_btn = "nul" -input_player14_start_axis = "nul" -input_player14_up = "nul" -input_player14_up_btn = "nul" -input_player14_up_axis = "nul" -input_player14_down = "nul" -input_player14_down_btn = "nul" -input_player14_down_axis = "nul" -input_player14_left = "nul" -input_player14_left_btn = "nul" -input_player14_left_axis = "nul" -input_player14_right = "nul" -input_player14_right_btn = "nul" -input_player14_right_axis = "nul" -input_player14_a = "nul" -input_player14_a_btn = "nul" -input_player14_a_axis = "nul" -input_player14_x = "nul" -input_player14_x_btn = "nul" -input_player14_x_axis = "nul" -input_player14_l = "nul" -input_player14_l_btn = "nul" -input_player14_l_axis = "nul" -input_player14_r = "nul" -input_player14_r_btn = "nul" -input_player14_r_axis = "nul" -input_player14_l2 = "nul" -input_player14_l2_btn = "nul" -input_player14_l2_axis = "nul" -input_player14_r2 = "nul" -input_player14_r2_btn = "nul" -input_player14_r2_axis = "nul" -input_player14_l3 = "nul" -input_player14_l3_btn = "nul" -input_player14_l3_axis = "nul" -input_player14_r3 = "nul" -input_player14_r3_btn = "nul" -input_player14_r3_axis = "nul" -input_player14_l_x_plus = "nul" -input_player14_l_x_plus_btn = "nul" -input_player14_l_x_plus_axis = "nul" -input_player14_l_x_minus = "nul" -input_player14_l_x_minus_btn = "nul" -input_player14_l_x_minus_axis = "nul" -input_player14_l_y_plus = "nul" -input_player14_l_y_plus_btn = "nul" -input_player14_l_y_plus_axis = "nul" -input_player14_l_y_minus = "nul" -input_player14_l_y_minus_btn = "nul" -input_player14_l_y_minus_axis = "nul" -input_player14_r_x_plus = "nul" -input_player14_r_x_plus_btn = "nul" -input_player14_r_x_plus_axis = "nul" -input_player14_r_x_minus = "nul" -input_player14_r_x_minus_btn = "nul" -input_player14_r_x_minus_axis = "nul" -input_player14_r_y_plus = "nul" -input_player14_r_y_plus_btn = "nul" -input_player14_r_y_plus_axis = "nul" -input_player14_r_y_minus = "nul" -input_player14_r_y_minus_btn = "nul" -input_player14_r_y_minus_axis = "nul" -input_player14_turbo = "nul" -input_player14_turbo_btn = "nul" -input_player14_turbo_axis = "nul" -input_player15_b = "nul" -input_player15_b_btn = "nul" -input_player15_b_axis = "nul" -input_player15_y = "nul" -input_player15_y_btn = "nul" -input_player15_y_axis = "nul" -input_player15_select = "nul" -input_player15_select_btn = "nul" -input_player15_select_axis = "nul" -input_player15_start = "nul" -input_player15_start_btn = "nul" -input_player15_start_axis = "nul" -input_player15_up = "nul" -input_player15_up_btn = "nul" -input_player15_up_axis = "nul" -input_player15_down = "nul" -input_player15_down_btn = "nul" -input_player15_down_axis = "nul" -input_player15_left = "nul" -input_player15_left_btn = "nul" -input_player15_left_axis = "nul" -input_player15_right = "nul" -input_player15_right_btn = "nul" -input_player15_right_axis = "nul" -input_player15_a = "nul" -input_player15_a_btn = "nul" -input_player15_a_axis = "nul" -input_player15_x = "nul" -input_player15_x_btn = "nul" -input_player15_x_axis = "nul" -input_player15_l = "nul" -input_player15_l_btn = "nul" -input_player15_l_axis = "nul" -input_player15_r = "nul" -input_player15_r_btn = "nul" -input_player15_r_axis = "nul" -input_player15_l2 = "nul" -input_player15_l2_btn = "nul" -input_player15_l2_axis = "nul" -input_player15_r2 = "nul" -input_player15_r2_btn = "nul" -input_player15_r2_axis = "nul" -input_player15_l3 = "nul" -input_player15_l3_btn = "nul" -input_player15_l3_axis = "nul" -input_player15_r3 = "nul" -input_player15_r3_btn = "nul" -input_player15_r3_axis = "nul" -input_player15_l_x_plus = "nul" -input_player15_l_x_plus_btn = "nul" -input_player15_l_x_plus_axis = "nul" -input_player15_l_x_minus = "nul" -input_player15_l_x_minus_btn = "nul" -input_player15_l_x_minus_axis = "nul" -input_player15_l_y_plus = "nul" -input_player15_l_y_plus_btn = "nul" -input_player15_l_y_plus_axis = "nul" -input_player15_l_y_minus = "nul" -input_player15_l_y_minus_btn = "nul" -input_player15_l_y_minus_axis = "nul" -input_player15_r_x_plus = "nul" -input_player15_r_x_plus_btn = "nul" -input_player15_r_x_plus_axis = "nul" -input_player15_r_x_minus = "nul" -input_player15_r_x_minus_btn = "nul" -input_player15_r_x_minus_axis = "nul" -input_player15_r_y_plus = "nul" -input_player15_r_y_plus_btn = "nul" -input_player15_r_y_plus_axis = "nul" -input_player15_r_y_minus = "nul" -input_player15_r_y_minus_btn = "nul" -input_player15_r_y_minus_axis = "nul" -input_player15_turbo = "nul" -input_player15_turbo_btn = "nul" -input_player15_turbo_axis = "nul" -input_player16_b = "nul" -input_player16_b_btn = "nul" -input_player16_b_axis = "nul" -input_player16_y = "nul" -input_player16_y_btn = "nul" -input_player16_y_axis = "nul" -input_player16_select = "nul" -input_player16_select_btn = "nul" -input_player16_select_axis = "nul" -input_player16_start = "nul" -input_player16_start_btn = "nul" -input_player16_start_axis = "nul" -input_player16_up = "nul" -input_player16_up_btn = "nul" -input_player16_up_axis = "nul" -input_player16_down = "nul" -input_player16_down_btn = "nul" -input_player16_down_axis = "nul" -input_player16_left = "nul" -input_player16_left_btn = "nul" -input_player16_left_axis = "nul" -input_player16_right = "nul" -input_player16_right_btn = "nul" -input_player16_right_axis = "nul" -input_player16_a = "nul" -input_player16_a_btn = "nul" -input_player16_a_axis = "nul" -input_player16_x = "nul" -input_player16_x_btn = "nul" -input_player16_x_axis = "nul" -input_player16_l = "nul" -input_player16_l_btn = "nul" -input_player16_l_axis = "nul" -input_player16_r = "nul" -input_player16_r_btn = "nul" -input_player16_r_axis = "nul" -input_player16_l2 = "nul" -input_player16_l2_btn = "nul" -input_player16_l2_axis = "nul" -input_player16_r2 = "nul" -input_player16_r2_btn = "nul" -input_player16_r2_axis = "nul" -input_player16_l3 = "nul" -input_player16_l3_btn = "nul" -input_player16_l3_axis = "nul" -input_player16_r3 = "nul" -input_player16_r3_btn = "nul" -input_player16_r3_axis = "nul" -input_player16_l_x_plus = "nul" -input_player16_l_x_plus_btn = "nul" -input_player16_l_x_plus_axis = "nul" -input_player16_l_x_minus = "nul" -input_player16_l_x_minus_btn = "nul" -input_player16_l_x_minus_axis = "nul" -input_player16_l_y_plus = "nul" -input_player16_l_y_plus_btn = "nul" -input_player16_l_y_plus_axis = "nul" -input_player16_l_y_minus = "nul" -input_player16_l_y_minus_btn = "nul" -input_player16_l_y_minus_axis = "nul" -input_player16_r_x_plus = "nul" -input_player16_r_x_plus_btn = "nul" -input_player16_r_x_plus_axis = "nul" -input_player16_r_x_minus = "nul" -input_player16_r_x_minus_btn = "nul" -input_player16_r_x_minus_axis = "nul" -input_player16_r_y_plus = "nul" -input_player16_r_y_plus_btn = "nul" -input_player16_r_y_plus_axis = "nul" -input_player16_r_y_minus = "nul" -input_player16_r_y_minus_btn = "nul" -input_player16_r_y_minus_axis = "nul" -input_player16_turbo = "nul" -input_player16_turbo_btn = "nul" -input_player16_turbo_axis = "nul" -xmb_font = "" -netplay_nickname = "" -video_filter = "" -audio_dsp_plugin = "" -netplay_ip_address = "" -recording_output_directory = "" -recording_config_directory = "" -core_options_path = "" -video_shader = "" -menu_wallpaper = "" -input_overlay = "" -video_font_path = "" -content_history_dir = "" -cache_directory = "" -resampler_directory = "" -xmb_font = "" -playlist_names = "" -playlist_cores = "" -audio_device = "" -camera_device = "" -cheevos_username = "" -cheevos_password = "" -video_context_driver = "" -input_keyboard_layout = "" -bundle_assets_src_path = "" -bundle_assets_dst_path = "" -bundle_assets_dst_path_subdir = "" +## Skeleton config file for RetroArch + +# Save all save files (*.srm) to this directory. This includes related files like .bsv, .rtc, .psrm, etc ... +# This will be overridden by explicit command line options. +# savefile_directory = + +# Save all save states (*.state) to this directory. +# This will be overridden by explicit command line options. +# savestate_directory = + +# If set to a directory, content which is temporarily extracted +# will be extracted to this directory. +# cache_directory = + +# Save all input remapping files to this directory. +# input_remapping_directory = + +# Save all playlist files to this directory. +# playlist_directory = + +# If set to a directory, the content history playlist will be saved +# to this directory. +# content_history_dir = + +# Automatically saves a savestate at the end of RetroArch's lifetime. +# The path is $SRAM_PATH.auto. +# RetroArch will automatically load any savestate with this path on startup if savestate_auto_load is set. +# savestate_auto_save = false +# savestate_auto_load = true + +# Load libretro from a dynamic location for dynamically built RetroArch. +# This option is mandatory. + +# Path to a libretro implementation. +# libretro_path = "/path/to/libretro.so" + +# A directory for where to search for libretro core implementations. +# libretro_directory = + +# A directory for where to search for libretro core information. +# libretro_info_path = + +# Sets log level for libretro cores (GET_LOG_INTERFACE). +# If a log level issued by a libretro core is below libretro_log_level, it is ignored. +# DEBUG logs are always ignored unless verbose mode is activated (--verbose). +# DEBUG = 0, INFO = 1, WARN = 2, ERROR = 3. +# libretro_log_level = 0 + +# Enable or disable verbosity level of frontend. +# log_verbosity = false + +# If this option is enabled, every content file loaded in RetroArch will be +# automatically added to a history list. +# history_list_enable = true + +# Enable or disable RetroArch performance counters +# perfcnt_enable = false + +# Path to core options config file. +# This config file is used to expose core-specific options. +# It will be written to by RetroArch. +# A default path will be assigned if not set. +# core_options_path = + +# Path to content history file. +# RetroArch keeps track of all content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_history_path = + +# Path to music content history file (optional). +# RetroArch keeps track of all music content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_music_history_path = + +# Path to image content history file (optional). +# RetroArch keeps track of all image content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_image_history_path = + +# Path to video content history file (optional). +# RetroArch keeps track of all video content loaded in the menu and from CLI directly for convenient quick loading. +# A default path will be assigned if not set. +# content_video_history_path = + +# Number of entries that will be kept in content history file. +# content_history_size = 100 + +# Sets the "system" directory. +# Implementations can query for this directory to load BIOSes, system-specific configs, etc. +# system_directory = + +# Sets start directory for menu file browser. +# rgui_browser_directory = + +# Content directory. Interacts with RETRO_ENVIRONMENT_GET_CONTENT_DIRECTORY. +# Usually set by developers who bundle libretro/RetroArch apps to point to assets. +# content_directory = + +# Assets directory. This location is queried by default when menu interfaces try to look for +# loadable assets, etc. +# assets_directory = + +# Dynamic wallpapers directory. The place to store the wallpapers dynamically +# loaded by the menu depending on context. +# dynamic_wallpapers_directory = + +# Thumbnails directory. To store thumbnail files. +# thumbnails_directory = + +# Sets start directory for menu config browser. +# rgui_config_directory = + +# Show startup screen in menu. +# Is automatically set to false when seen for the first time. +# This is only updated in config if config_save_on_exit is set to true, however. +# rgui_show_start_screen = true + +# Flushes config to disk on exit. Useful for menu as settings can be modified. +# Overwrites the config. #include's and comments are not preserved. +# config_save_on_exit = true + +# Load up a specific config file based on the core being used. +# core_specific_config = false + +# Shows hidden files and folders in directory listings. +# show_hidden_files = true + +#### Video + +# Video driver to use. "gl", "xvideo", "sdl" +# video_driver = "gl" + +# Which context implementation to use. +# Possible ones for desktop are: glx, x-egl, kms-egl, sdl-gl, wgl. +# By default, tries to use first suitable driver. +# video_context_driver = + +# Windowed x resolution scale and y resolution scale +# (Real x res: base_size * xscale * aspect_ratio, real y res: base_size * yscale) +# video_scale = 3.0 + +# Fullscreen resolution. Resolution of 0 uses the resolution of the desktop. +# video_fullscreen_x = 0 +# video_fullscreen_y = 0 + +# Start in fullscreen. Can be changed at runtime. +# video_fullscreen = false + +# If fullscreen, prefer using a windowed fullscreen mode. +# video_windowed_fullscreen = true + +# Which monitor to prefer. 0 (default) means no particular monitor is preferred, 1 and up (1 being first monitor), +# suggests RetroArch to use that particular monitor. +# video_monitor_index = 0 + +# Forcibly disable composition. Only works in Windows Vista/7 for now. +# video_disable_composition = false + +# Video vsync. +# video_vsync = true + +# Max amount of swapchain images. +# Single buffering = 1, Double buffering = 2, 3 = Triple buffering +# video_max_swapchain_images = 3 + +# Forcibly disable sRGB FBO support. Some Intel OpenGL drivers on Windows +# have video problems with sRGB FBO support enabled. +# video_force_srgb_disable = false + +# Attempts to hard-synchronize CPU and GPU. Can reduce latency at cost of performance. +# video_hard_sync = false + +# Sets how many frames CPU can run ahead of GPU when using video_hard_sync. +# Maximum is 3. +# video_hard_sync_frames = 0 + +# Sets how many milliseconds to delay after VSync before running the core. +# Can reduce latency at cost of higher risk of stuttering. +# Maximum is 15. +# video_frame_delay = 0 + +# Inserts a black frame inbetween frames. +# Useful for 120 Hz monitors who want to play 60 Hz material with eliminated ghosting. +# video_refresh_rate should still be configured as if it is a 60 Hz monitor (divide refresh rate by 2). +# video_black_frame_insertion = false + +# Use threaded video driver. Using this might improve performance at possible cost of latency and more video stuttering. +# video_threaded = false + +# Use a shared context for HW rendered libretro cores. +# Avoids having to assume HW state changes inbetween frames. +# video_shared_context = false + +# Smoothens picture with bilinear filtering. Should be disabled if using pixel shaders. +# video_smooth = true + +# Forces rendering area to stay equal to content aspect ratio or as defined in video_aspect_ratio. +# video_force_aspect = true + +# Only scales video in integer steps. +# The base size depends on system-reported geometry and aspect ratio. +# If video_force_aspect is not set, X/Y will be integer scaled independently. +# video_scale_integer = false + +# A floating point value for video aspect ratio (width / height). +# If this is not set, aspect ratio is assumed to be automatic. +# Behavior then is defined by video_aspect_ratio_auto. +# video_aspect_ratio = + +# If this is true and video_aspect_ratio is not set, +# aspect ratio is decided by libretro implementation. +# If this is false, 1:1 PAR will always be assumed if video_aspect_ratio is not set. +# video_aspect_ratio_auto = false + +# Forces cropping of overscanned frames. +# Exact behavior of this option is implementation specific. +# video_crop_overscan = true + +# Path to shader. Shader can be either Cg, CGP (Cg preset) or GLSL, GLSLP (GLSL preset) +# video_shader = "/path/to/shader.{cg,cgp,glsl,glslp}" + +# Load video_shader on startup. +# Other shaders can still be loaded later in runtime. +# video_shader_enable = false + +# Defines a directory where shaders (Cg, CGP, GLSL) are kept for easy access. +# video_shader_dir = + +# CPU-based video filter. Path to a dynamic library. +# video_filter = + +# Defines a directory where CPU-based video filters are kept. +# video_filter_dir = + +# Path to a font used for rendering messages. This path must be defined to enable fonts. +# Do note that the _full_ path of the font is necessary! +# video_font_path = + +# Size of the font rendered. +# video_font_size = 32 + +# Enable usage of OSD messages. +# video_font_enable = true + +# Offset for where messages will be placed on screen. Values are in range 0.0 to 1.0 for both x and y values. +# [0.0, 0.0] maps to the lower left corner of the screen. +# video_message_pos_x = 0.05 +# video_message_pos_y = 0.05 + +# Color for message. The value is treated as a hexadecimal value. +# It is a regular RGB hex number, i.e. red is "ff0000". +# video_message_color = ffffff + +# Video refresh rate of your monitor. +# Used to calculate a suitable audio input rate. +# video_refresh_rate = 59.94 + +# Allows libretro cores to set rotation modes. +# Setting this to false will honor, but ignore this request. +# This is useful for vertically oriented content where one manually rotates the monitor. +# video_allow_rotate = true + +# Forces a certain rotation of the screen. +# The rotation is added to rotations which the libretro core sets (see video_allow_rotate). +# The angle is * 90 degrees counter-clockwise. +# video_rotation = 0 + +#### Audio + +# Enable audio. +# audio_enable = true + +# Mutes audio. +# audio_mute_enable = false + +# Audio output samplerate. +# audio_out_rate = 48000 + +# Audio resampler backend. Which audio resampler to use. +# Default will use "sinc". +# audio_resampler = + +# Audio driver backend. Depending on configuration possible candidates are: alsa, pulse, oss, jack, rsound, roar, openal, sdl, xaudio. +# audio_driver = + +# Override the default audio device the audio_driver uses. This is driver dependant. E.g. ALSA wants a PCM device, OSS wants a path (e.g. /dev/dsp), Jack wants portnames (e.g. system:playback1,system:playback_2), and so on ... +# audio_device = + +# Audio DSP plugin that processes audio before it's sent to the driver. Path to a dynamic library. +# audio_dsp_plugin = + +# Directory where DSP plugins are kept. +# audio_filter_dir = + +# Will sync (block) on audio. Recommended. +# audio_sync = true + +# Desired audio latency in milliseconds. Might not be honored if driver can't provide given latency. +# audio_latency = 64 + +# Enable audio rate control. +# audio_rate_control = true + +# Controls audio rate control delta. Defines how much input rate can be adjusted dynamically. +# Input rate = in_rate * (1.0 +/- audio_rate_control_delta) +# audio_rate_control_delta = 0.005 + +# Controls maximum audio timing skew. Defines the maximum change in input rate. +# Input rate = in_rate * (1.0 +/- max_timing_skew) +# audio_max_timing_skew = 0.05 + +# Audio volume. Volume is expressed in dB. +# 0 dB is normal volume. No gain will be applied. +# Gain can be controlled in runtime with input_volume_up/input_volume_down. +# audio_volume = 0.0 + +#### Overlay + +# Defines a directory where overlays are kept for easy access. +# overlay_directory = + +# Enable or disable the current overlay. +# input_overlay_enable = true + +# Hide the current overlay from appearing inside the menu. +# input_overlay_hide_in_menu = true + +# Path to input overlay. +# input_overlay = + +# Overlay opacity. +# input_overlay_opacity = 1.0 + +# Overlay scale. +# input_overlay_scale = 1.0 + +#### Input + +# Input driver. Depending on video driver, it might force a different input driver. +# input_driver = sdl + +# Input device driver. (Valid: linuxraw, sdl, dinput) +# input_joypad_driver = + +# Path to input remapping file. +# input_remapping_path = + +# Input bind timer timeout. +# Amount of seconds to wait until proceeding to the next bind. Default: 5, minimum: 1 +# input_bind_timeout = 1 + +# If enabled, overrides the input binds with the remapped binds set for the current core. +# input_remap_binds_enable = true + +# Maximum amount of users supported by RetroArch. +# input_max_users = 16 + +# Keyboard layout for input driver if applicable (udev/evdev for now). +# Syntax is either just layout (e.g. "no"), or a layout and variant separated with colon ("no:nodeadkeys"). +# input_keyboard_layout = + +# Defines axis threshold. Possible values are [0.0, 1.0] +# input_axis_threshold = 0.5 + +# Enable input auto-detection. Will attempt to autoconfigure +# joypads, Plug-and-Play style. +# input_autodetect_enable = true + +# Show the input descriptors set by the core instead of the +# default ones. +# input_descriptor_label_show = true + +# Hide input descriptors that were not set by the core. +# input_descriptor_hide_unbound = false + +# Influence how input polling is done inside RetroArch. +# 0 : Early - Input polling is performed before call to retro_run. +# 1 : Normal - Input polling is performed when retro_input_poll is +# requested. +# 2 : Late - Input polling is performed on first call to retro_input_state +# per frame +# +# Setting it to 0 or 2 can result in less latency depending on +# your configuration. +# +# When netplay is enabled, the default polling behavior (1) will +# be used regardless of the value set here. +# input_poll_type_behavior = 1 + +# Directory for joypad autoconfigs. +# If a joypad is plugged in, that joypad will be autoconfigured if a config file +# corresponding to that joypad is present in joypad_autoconfig_dir. +# Input binds which are made explicit (input_playerN_*_btn/axis) will take priority over autoconfigs. +# Autoconfigs can be created with retroarch-joyconfig, manually, or with a frontend. +# Requires input_autodetect_enable to be enabled. +# joypad_autoconfig_dir = + +# Sets which libretro device is used for a user. +# Devices are indentified with a number. +# This is normally saved by the menu. +# Device IDs are found in libretro.h. +# These settings are overridden by explicit command-line arguments which refer to input devices. +# None: 0 +# Joypad (RetroPad): 1 +# Mouse: 2 +# Keyboard: 3 +# Generic Lightgun: 4 +# Joypad w/ Analog (RetroPad + Analog sticks): 5 +# Multitap (SNES specific): 257 +# Super Scope (SNES specific): 260 +# Justifier (SNES specific): 516 +# Justifiers (SNES specific): 772 + +# input_libretro_device_p1 = +# input_libretro_device_p2 = +# input_libretro_device_p3 = +# input_libretro_device_p4 = +# input_libretro_device_p5 = +# input_libretro_device_p6 = +# input_libretro_device_p7 = +# input_libretro_device_p8 = + +# Keyboard input. Will recognize letters ("a" to "z") and the following special keys (where "kp_" +# is for keypad keys): +# +# left, right, up, down, enter, kp_enter, tab, insert, del, end, home, +# rshift, shift, ctrl, alt, space, escape, add, subtract, kp_plus, kp_minus, +# f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, +# num0, num1, num2, num3, num4, num5, num6, num7, num8, num9, pageup, pagedown, +# keypad0, keypad1, keypad2, keypad3, keypad4, keypad5, keypad6, keypad7, keypad8, keypad9, +# period, capslock, numlock, backspace, multiply, divide, print_screen, scroll_lock, +# tilde, backquote, pause, quote, comma, minus, slash, semicolon, equals, leftbracket, +# backslash, rightbracket, kp_period, kp_equals, rctrl, ralt +# +# Keyboard input, Joypad and Joyaxis will all obey the "nul" bind, which disables the bind completely, +# rather than relying on a default. +# input_player1_a = "x" +# input_player1_b = "z" +# input_player1_y = "a" +# input_player1_x = "s" +# input_player1_start = "enter" +# input_player1_select = "rshift" +# input_player1_l = "q" +# input_player1_r = "w" +# input_player1_left = "left" +# input_player1_right = "right" +# input_player1_up = "up" +# input_player1_down = "down" +# input_player1_l2 = +# input_player1_r2 = +# input_player1_l3 = +# input_player1_r3 = + +# Two analog sticks (DualShock-esque). +# Bound as usual, however, if a real analog axis is bound, +# it can be read as a true analog. +# Positive X axis is right, Positive Y axis is down. +# input_player1_l_x_plus = +# input_player1_l_x_minus = +# input_player1_l_y_plus = +# input_player1_l_y_minus = +# input_player1_r_x_plus = +# input_player1_r_x_minus = +# input_player1_r_y_plus = +# input_player1_r_y_minus = + +# If desired, it is possible to override which joypads are being used for user 1 through 8. +# First joypad available is 0. +# input_player1_joypad_index = 0 +# input_player2_joypad_index = 1 +# input_player3_joypad_index = 2 +# input_player4_joypad_index = 3 +# input_player5_joypad_index = 4 +# input_player6_joypad_index = 5 +# input_player7_joypad_index = 6 +# input_player8_joypad_index = 7 + +# Input device buttons. +# Figure these out by using RetroArch-Phoenix or retroarch-joyconfig. +# You can use joypad hats with hnxx, where n is the hat, and xx is a string representing direction. +# E.g. "h0up" +# input_player1_a_btn = +# input_player1_b_btn = +# input_player1_y_btn = +# input_player1_x_btn = +# input_player1_start_btn = +# input_player1_select_btn = +# input_player1_l_btn = +# input_player1_r_btn = +# input_player1_left_btn = +# input_player1_right_btn = +# input_player1_up_btn = +# input_player1_down_btn = +# input_player1_l2_btn = +# input_player1_r2_btn = +# input_player1_l3_btn = +# input_player1_r3_btn = + +# Menu buttons. +# menu_search_btn = +# menu_info_btn = +# menu_default_btn = +# menu_scroll_down_btn = +# menu_scroll_up_btn = + +# Swap buttons for OK/Cancel +# menu_swap_ok_cancel_buttons = false + +# Axis for RetroArch D-Pad. +# Needs to be either '+' or '-' in the first character signaling either positive or negative direction of the axis, then the axis number. +# Do note that every other input option has the corresponding _btn and _axis binds as well; they are omitted here for clarity. +# input_player1_left_axis = +# input_player1_right_axis = +# input_player1_up_axis = +# input_player1_down_axis = + +# Holding the turbo while pressing another button will let the button enter a turbo mode +# where the button state is modulated with a periodic signal. +# The modulation stops when the button itself (not turbo button) is released. +# input_player1_turbo = + +# Describes the period and how long of that period a turbo-enabled button should behave. +# Numbers are described in frames. +# input_turbo_period = 6 +# input_turbo_duty_cycle = 3 + +# This goes all the way to user 8 (*_player2_*, *_player3_*, etc), but omitted for clarity. +# All input binds have corresponding binds for keyboard (none), joykeys (_btn) and joyaxes (_axis) as well. + +# Toggles fullscreen. +# input_toggle_fullscreen = f + +# Saves state. +# input_save_state = f2 +# Loads state. +# input_load_state = f4 + +# State slots. With slot set to 0, save state name is *.state (or whatever defined on commandline). +# When slot is != 0, path will be $path%d, where %d is slot number. +# input_state_slot_increase = f7 +# input_state_slot_decrease = f6 + +# Toggles between fast-forwarding and normal speed. +# input_toggle_fast_forward = space + +# Hold for fast-forward. Releasing button disables fast-forward. +# input_hold_fast_forward = l + +# Key to exit RetroArch cleanly. +# Killing it in any hard way (SIGKILL, etc) will terminate RetroArch without saving RAM, etc. +# On Unix-likes, SIGINT/SIGTERM allows a clean deinitialization. +# input_exit_emulator = escape + + +# Applies next and previous shader in directory. +# input_shader_next = m +# input_shader_prev = n + +# Hold button down to rewind. Rewinding must be enabled. +# input_rewind = r + +# Toggle between recording and not. +# input_movie_record_toggle = o + +# Toggle between paused and non-paused state +# input_pause_toggle = p + +# Frame advance when content is paused +# input_frame_advance = k + +# Reset the content. +# input_reset = h + +# Cheats. +# input_cheat_index_plus = y +# input_cheat_index_minus = t +# input_cheat_toggle = u + +# Mute/unmute audio +# input_audio_mute = f9 + +# Take screenshot +# input_screenshot = f8 + +# Netplay flip users. +# input_netplay_flip_players = i + +# Hold for slowmotion. +# input_slowmotion = e + +# Enable other hotkeys. +# If this hotkey is bound to either keyboard, joybutton or joyaxis, +# all other hotkeys will be disabled unless this hotkey is also held at the same time. +# This is useful for RETRO_KEYBOARD centric implementations +# which query a large area of the keyboard, where it is not desirable +# that hotkeys get in the way. + +# Alternatively, all hotkeys for keyboard could be disabled by the user. +# input_enable_hotkey_btn = + +# Increases audio volume. +# input_volume_up = kp_plus +# Decreases audio volume. +# input_volume_down = kp_minus + +# Toggles to next overlay. Wraps around. +# input_overlay_next = + +# Toggles eject for disks. Used for multiple-disk content. +# input_disk_eject_toggle = + +# Cycles through disk images. Use after ejecting. +# Complete by toggling eject again. +# input_disk_next = + +# Toggles menu. +# input_menu_toggle = f1 + +# RetroPad button combination to toggle menu +# 0 = none, 1 = L + R + Y + D-Pad Down, 2 = L3 + R3, 3 = Start + Select +# input_menu_toggle_gamepad_combo = 0 + +# allow any RetroPad to control the menu +# all_users_control_menu = false + +# Toggles mouse grab. When mouse is grabbed, RetroArch hides the mouse, +# and keeps the mouse pointer inside the window to allow relative mouse input +# to work better. +# input_grab_mouse_toggle = f11 + +#### Menu + +# Menu driver to use. "rgui", "lakka", etc. +# menu_driver = "rgui" + +# If disabled, the libretro core will keep running in the background when we +# are in the menu. +# menu_pause_libretro = false + +# Enable mouse input inside the menu. +# menu_mouse_enable = false + +# Enable touch input inside the menu. +# menu_pointer_enable = false + +# Shows current date and/or time inside menu. +# menu_timedate_enable = true + +# Shows current core inside menu. +# menu_core_enable = true + +# Path to an image to set as menu wallpaper. +# menu_wallpaper = + +# Dynamically load a new wallpaper depending on context. +# menu_dynamic_wallpaper_enable = false + +# Type of thumbnail to display. 0 = none, 1 = snaps, 2 = titles, 3 = boxarts +# menu_thumbnails = 0 + +# Wrap-around to beginning and/or end if boundary of list is reached horizontally or vertically +# menu_navigation_wraparound_enable = false + +# Filter files being show in 'Load Content' by supported extensions +# menu_navigation_browser_filter_supported_extensions_enable = true + +# Collapse subgroup settings into main group to create one big listing of settings +# per category. +# menu_collapse_subgroups_enable = false + +#### Core +# +# Prevent libretro cores from closing RetroArch on exit by loading a dummy core. +# load_dummy_on_core_shutdown = "true" + +# Check for firmware requirement(s) before loading a content. +# check_firmware_before_loading = "false" + +#### UI + +# Suspends the screensaver if set to true. Is a hint that does not necessarily have to be honored +# by video driver. +# suspend_screensaver_enable = true + +# Start UI companion driver's interface on boot (if available). +# ui_companion_start_on_boot = true + +#### Camera + +# Override the default camera device the camera driver uses. This is driver dependant. +# camera_device = + +# Override the default privacy permission for cores that want to access camera services. Is "false" by default. +# camera_allow = false + +#### Location + +# Override the default privacy permission for cores that want to access location services. Is "false" by default. +# location_allow = false + +#### Core Updater + +# URL to core update directory on buildbot. +# core_updater_buildbot_url = "http://buildbot.libretro.com" + +# URL to assets update directory on buildbot. +# core_updater_buildbot_assets_url = "http://buildbot.libretro.com/assets/" + +# After downloading, automatically extract archives that the downloads are contained inside. +# core_updater_auto_extract_archive = true + +#### Network + +# When being client over netplay, use keybinds for user 1. +# netplay_client_swap_input = false + +# The username of the person running RetroArch. This will be used for playing online, for instance. +# netplay_nickname = + +# The amount of delay frames to use for netplay. Increasing this value will increase +# performance, but introduce more latency. +# netplay_delay_frames = 0 + +# Netplay mode for the current user. +# false is Server, true is Client. +# netplay_mode = false + +# Enable or disable spectator mode for the user during netplay. +# netplay_spectator_mode_enable = false + +# The IP Address of the host to connect to. +# netplay_ip_address = + +# The port of the host IP Address. Can be either a TCP or UDP port. +# netplay_ip_port = 55435 + +#### Misc + +# Enable rewinding. This will take a performance hit when playing, so it is disabled by default. +# rewind_enable = false + +# Rewinding buffer size in megabytes. Bigger rewinding buffer means you can rewind longer. +# The buffer should be approx. 20MB per minute of buffer time. +# rewind_buffer_size = 20 + +# Rewind granularity. When rewinding defined number of frames, you can rewind several frames at a time, increasing the rewinding speed. +# rewind_granularity = 1 + +# Pause gameplay when window focus is lost. +# pause_nonactive = true + +# Autosaves the non-volatile SRAM at a regular interval. This is disabled by default unless set otherwise. +# The interval is measured in seconds. A value of 0 disables autosave. +# autosave_interval = + +# Path to content database directory. +# content_database_path = + +# Path to cheat database directory. +# cheat_database_path = + +# Directory to dump screenshots to. +# screenshot_directory = + +# Records video after CPU video filter. +# video_post_filter_record = false + +# Records output of GPU shaded material if available. +# video_gpu_record = false + +# Screenshots output of GPU shaded material if available. +# video_gpu_screenshot = true + +# Block SRAM from being overwritten when loading save states. +# Might potentially lead to buggy games. +# block_sram_overwrite = false + +# When saving a savestate, save state index is automatically increased before +# it is saved. +# Also, when loading content, the index will be set to the highest existing index. +# There is no upper bound on the index. +# savestate_auto_index = false + +# Slowmotion ratio. When slowmotion, content will slow down by factor. +# slowmotion_ratio = 3.0 + +# The maximum rate at which content will be run when using fast forward. (E.g. 5.0 for 60 fps content => 300 fps cap). +# RetroArch will go to sleep to ensure that the maximum rate will not be exceeded. +# Do not rely on this cap to be perfectly accurate. +# If this is set at 0, then fastforward ratio is unlimited (no FPS cap) +# fastforward_ratio = 0.0 + +# Enable stdin/network command interface. +# network_cmd_enable = false +# network_cmd_port = 55355 +# stdin_cmd_enable = false + +#### Bundle extraction + + From a109df9271de5905d61ba30acd82da7052fd025e Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 14:15:39 -0500 Subject: [PATCH 160/638] make existing hard-coded unicode calls switchable back to ansi --- file_path_special.c | 25 ++++++---- frontend/drivers/platform_win32.c | 16 +++--- gfx/common/win32_common.cpp | 59 ++++++++++++---------- gfx/common/win32_common.h | 2 +- gfx/drivers_font/d3d_w32_font.cpp | 5 +- libretro-common/dynamic/dylib.c | 2 +- libretro-common/file/retro_dirent.c | 10 +++- libretro-common/file/retro_stat.c | 11 ++-- libretro-common/include/encodings/win32.h | 12 ++--- ui/drivers/ui_win32.c | 61 +++++++++++------------ 10 files changed, 110 insertions(+), 93 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 9d17045311..9a32780993 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -1,6 +1,6 @@ /* 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. @@ -124,7 +124,7 @@ void fill_pathname_abbreviate_special(char *out_path, fill_pathname_application_path(application_dir, sizeof(application_dir)); path_basedir(application_dir); - + for (i = 0; candidates[i]; i++) { if (!string_is_empty(candidates[i]) && strstr(in_path, candidates[i]) == in_path) @@ -132,11 +132,11 @@ void fill_pathname_abbreviate_special(char *out_path, size_t src_size = strlcpy(out_path, notations[i], size); retro_assert(src_size < size); - + out_path += src_size; size -= src_size; in_path += strlen(candidates[i]); - + if (!path_char_is_slash(*in_path)) { retro_assert(strlcpy(out_path, path_default_slash(), size) < size); @@ -208,8 +208,10 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; +#ifdef UNICODE wchar_t ws[PATH_MAX_LENGTH] = {0}; #endif +#endif #ifdef __HAIKU__ image_info info; int32_t cookie = 0; @@ -220,10 +222,13 @@ void fill_pathname_application_path(char *s, size_t len) return; #ifdef _WIN32 +#ifdef UNICODE MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - - ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); +#else + ret = GetModuleFileName(GetModuleHandle(NULL), s, len - 1); +#endif + s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) @@ -233,7 +238,7 @@ void fill_pathname_application_path(char *s, size_t len) CFStringGetCString(bundle_path, s, len, kCFStringEncodingUTF8); CFRelease(bundle_path); CFRelease(bundle_url); - + retro_assert(strlcat(s, "nobin", len) < len); return; } @@ -253,7 +258,7 @@ void fill_pathname_application_path(char *s, size_t len) char link_path[255]; link_path[0] = *s = '\0'; - pid = getpid(); + pid = getpid(); /* Linux, BSD and Solaris paths. Not standardized. */ for (i = 0; i < ARRAY_SIZE(exts); i++) @@ -271,7 +276,7 @@ void fill_pathname_application_path(char *s, size_t len) } } } - + RARCH_ERR("Cannot resolve application path! This should not happen.\n"); #endif } @@ -329,7 +334,7 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe #ifdef HAVE_ZARCH { settings_t *settings = config_get_ptr(); - fill_pathname_join(s, + fill_pathname_join(s, settings->directory.assets, "zarch", len); diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 2480e61f4e..8e5b8e3673 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -40,8 +40,8 @@ #include "../../runloop.h" #include "../../verbosity.h" -/* We only load this library once, so we let it be - * unloaded at application shutdown, since unloading +/* We only load this library once, so we let it be + * unloaded at application shutdown, since unloading * it early seems to cause issues on some systems. */ @@ -71,7 +71,7 @@ static bool gfx_init_dwm(void) } atexit(gfx_dwm_shutdown); - HRESULT (WINAPI *mmcss)(BOOL) = + HRESULT (WINAPI *mmcss)(BOOL) = (HRESULT (WINAPI*)(BOOL))dylib_proc(dwmlib, "DwmEnableMMCSS"); if (mmcss) { @@ -94,7 +94,7 @@ static void gfx_set_dwm(void) if (settings->video.disable_composition == dwm_composition_disabled) return; - HRESULT (WINAPI *composition_enable)(UINT) = + HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition"); if (!composition_enable) { @@ -177,7 +177,7 @@ static void frontend_win32_init(void *data) { typedef BOOL (WINAPI *isProcessDPIAwareProc)(); typedef BOOL (WINAPI *setProcessDPIAwareProc)(); - HMODULE handle = GetModuleHandleW(L"User32.dll"); + HMODULE handle = GetModuleHandle(TEXT("User32.dll")); isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)dylib_proc(handle, "IsProcessDPIAware"); setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)dylib_proc(handle, "SetProcessDPIAware"); @@ -189,13 +189,13 @@ static void frontend_win32_init(void *data) setDPIAwareProc(); } } - + } enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percent) { SYSTEM_POWER_STATUS status; - enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; + enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; if (!GetSystemPowerStatus(&status)) return ret; @@ -338,7 +338,7 @@ static void frontend_win32_detach_console(void) { HWND wnd = GetConsoleWindow(); FreeConsole(); - PostMessageW(wnd, WM_CLOSE, 0, 0); + PostMessage(wnd, WM_CLOSE, 0, 0); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index a9792c3730..3d4bda7462 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -212,20 +212,20 @@ void win32_monitor_from_window(void) void win32_monitor_get_info(void) { - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; memset(¤t_mon, 0, sizeof(current_mon)); - current_mon.cbSize = sizeof(MONITORINFOEXW); + current_mon.cbSize = sizeof(MONITORINFOEX); - GetMonitorInfoW(win32_monitor_last, (MONITORINFOEXW*)¤t_mon); - ChangeDisplaySettingsExW(current_mon.szDevice, NULL, NULL, 0, NULL); + GetMonitorInfo(win32_monitor_last, (MONITORINFOEX*)¤t_mon); + ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL); } void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) { unsigned i, fs_monitor; settings_t *settings = config_get_ptr(); - MONITORINFOEXW *mon = (MONITORINFOEXW*)data; + MONITORINFOEX *mon = (MONITORINFOEX*)data; HMONITOR *hm_to_use = (HMONITOR*)hm_data; if (!win32_monitor_last) @@ -254,8 +254,8 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) } memset(mon, 0, sizeof(*mon)); - mon->cbSize = sizeof(MONITORINFOEXW); - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)mon); + mon->cbSize = sizeof(MONITORINFOEX); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)mon); } /* Get the count of the files dropped */ @@ -264,18 +264,19 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) char szFilename[1024] = {0}; wchar_t wszFilename[1024] = {0}; - if (DragQueryFileW((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) + if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { /*poll list of current cores */ size_t list_size; content_ctx_info_t content_info = {0}; core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; - +#ifdef UNICODE DragQueryFileW((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); - utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); - +#else + DragQueryFile((HDROP)wparam, 0, szFilename, sizeof(szFilename)); +#endif core_info_get_list(&core_info_list); if (!core_info_list) @@ -335,7 +336,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) else { /* Pick one core that could be compatible, ew */ - if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), + if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE), hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( @@ -507,7 +508,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_create(void *data, unsigned style, @@ -515,7 +516,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowExW(0, L"RetroArch", L"RetroArch", + main_window.hwnd = CreateWindowEx(0, TEXT("RetroArch"), TEXT("RetroArch"), style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -583,7 +584,8 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; - wchar_t dev_name_wide[1024] = {0}; + unsigned res = 0; + CHAR_TO_WCHAR_ALLOC(dev_name, dev_name_wide) memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -595,10 +597,13 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); - - return ChangeDisplaySettingsExW(dev_name_wide, &devmode, + res = ChangeDisplaySettingsEx(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; + + if (dev_name_wide) + free(dev_name_wide); + + return res; #endif } @@ -655,7 +660,7 @@ bool win32_suppress_screensaver(void *data, bool enable) typedef HANDLE (WINAPI * PowerCreateRequestPtr)(REASON_CONTEXT *context); typedef BOOL (WINAPI * PowerSetRequestPtr)(HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType); - HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); + HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); PowerCreateRequestPtr powerCreateRequest = (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest"); PowerSetRequestPtr powerSetRequest = @@ -689,7 +694,7 @@ bool win32_suppress_screensaver(void *data, bool enable) } /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) { @@ -724,7 +729,7 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, {} /* Display settings might have changed, get new coordinates. */ - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)current_mon); *mon_rect = current_mon->rcMonitor; } } @@ -755,8 +760,8 @@ void win32_set_window(unsigned *width, unsigned *height, { RECT rc_temp = {0, 0, (LONG)*height, 0x7FFF}; SetMenu(main_window.hwnd, - LoadMenuW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDR_MENU))); - SendMessageW(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); + LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); + SendMessage(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); g_resize_height = *height += rc_temp.top + rect->top; SetWindowPos(main_window.hwnd, NULL, 0, 0, *width, *height, SWP_NOMOVE); } @@ -782,7 +787,7 @@ bool win32_set_video_mode(void *data, MSG msg; RECT mon_rect; unsigned mon_id; - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; bool windowed_full; RECT rect = {0}; HMONITOR hm_to_use = NULL; @@ -805,10 +810,10 @@ bool win32_set_video_mode(void *data, win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ - while (!g_inited && !g_quit && GetMessageW(&msg, main_window.hwnd, 0, 0)) + while (!g_inited && !g_quit && GetMessage(&msg, main_window.hwnd, 0, 0)) { TranslateMessage(&msg); - DispatchMessageW(&msg); + DispatchMessage(&msg); } if (g_quit) @@ -866,7 +871,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClassW(L"RetroArch", GetModuleHandleW(NULL)); + UnregisterClass(TEXT("RetroArch"), GetModuleHandle(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index f3496b095c..d7a803c300 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -97,7 +97,7 @@ void win32_set_window(unsigned *width, unsigned *height, #ifndef _XBOX /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); #endif diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index 35d6e26f43..b7d310d592 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,6 +18,7 @@ #include "../../config.h" #endif +#include #include "../drivers/d3d.h" #include "../font_driver.h" @@ -45,7 +46,7 @@ static void *d3dfonts_w32_init_font(void *video_data, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_PITCH, - L"Verdana" /* Hardcode FTL */ + TEXT("Verdana") /* Hardcode FTL */ }; d3dfonts = (d3dfonts_t*)calloc(1, sizeof(*d3dfonts)); diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index a1da7b8a45..d73172ed1e 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -35,7 +35,7 @@ #endif #ifdef _WIN32 -static TCHAR last_dyn_error[512]; +static TCHAR last_dyn_error[512] = {0}; static void set_dl_error(void) { diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index f29705b15d..4a9a02aeca 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -35,7 +35,9 @@ struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) char path_buf[1024] = {0}; +#ifdef UNICODE wchar_t pathW[1024] = {0}; +#endif #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -43,9 +45,13 @@ struct RDIR *retro_opendir(const char *name) return NULL; #if defined(_WIN32) +#ifdef UNICODE snprintf(path_buf, sizeof(path_buf), "%s\\*", name); MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); rdir->directory = FindFirstFileW(pathW, &rdir->entry); +#else + rdir->directory = FindFirstFile(path_buf, &rdir->entry); +#endif #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -78,7 +84,7 @@ int retro_readdir(struct RDIR *rdir) { #if defined(_WIN32) if(rdir->next) - return (FindNextFileW(rdir->directory, &rdir->entry) != 0); + return (FindNextFile(rdir->directory, &rdir->entry) != 0); else { rdir->next = true; return (rdir->directory != INVALID_HANDLE_VALUE); @@ -123,7 +129,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) { #if defined(_WIN32) - const WIN32_FIND_DATAW *entry = (const WIN32_FIND_DATAW*)&rdir->entry; + const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry; return entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; #elif defined(PSP) || defined(VITA) const SceIoDirent *entry = (const SceIoDirent*)&rdir->entry; diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 95c79c18c3..e918956f3b 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #if defined(_WIN32) @@ -103,11 +104,13 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - wchar_t path_wide[PATH_MAX_LENGTH] = {0}; + CHAR_TO_WCHAR_ALLOC(path, path_wide) - MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); + + if (path_wide) + free(path_wide); - DWORD ret = GetFileAttributesExW(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else @@ -208,7 +211,7 @@ bool mkdir_norecurse(const char *dir) #elif defined(PSP) || defined(_3DS) if ((ret == -1) && path_is_directory(dir)) ret = 0; -#else +#else if (ret < 0 && errno == EEXIST && path_is_directory(dir)) ret = 0; #endif diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 8a911c556f..03b385a5fb 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -44,20 +44,20 @@ extern "C" { #ifdef UNICODE #define CHAR_TO_WCHAR_ALLOC(s, ws) \ - size_t ws##_size = (s[0] ? strlen(s) : 0) + 1; \ + size_t ws##_size = (NULL != s && s[0] ? strlen(s) : 0) + 1; \ wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ - if (s[0]) \ + if (NULL != s && s[0]) \ MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); #define WCHAR_TO_CHAR_ALLOC(ws, s) \ - size_t s##_size = ((ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ + size_t s##_size = ((NULL != ws && ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ char *s = (char*)calloc(s##_size, 1); \ - if (ws[0]) \ + if (NULL != ws && ws[0]) \ utf16_to_char_string((const uint16_t*)ws, s, s##_size); #else -#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = strdup(s); -#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = strdup(ws); +#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = (NULL != s && s[0] ? strdup(s) : NULL); +#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = (NULL != ws && ws[0] ? strdup(ws) : NULL); #endif #endif diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 2a8fc12836..8dc324223a 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -156,20 +156,20 @@ static void shader_dlg_params_refresh(void) bool checked = (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); - SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: shader_dlg_refresh_trackbar_label(i); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].maximum - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].current - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); @@ -251,12 +251,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowExW(0, L"BUTTON", + control->checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), param_desc_wide, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -269,27 +269,27 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowExW(0, L"STATIC", + control->trackbar.label_title = CreateWindowEx(0, TEXT("STATIC"), param_desc_wide, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowExW(0, TRACKBAR_CLASS, L"", + control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, TEXT(""), WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowExW(0, L"STATIC", L"", + control->trackbar.label_val = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessageW(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, (LPARAM)control->trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -303,7 +303,7 @@ void shader_dlg_params_reload(void) if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowExW(0, L"STATIC", L"", + g_shader_dlg.separator.hwnd = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -393,7 +393,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_CHECKBOX) break; - if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; @@ -404,7 +404,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; case WM_HSCROLL: - i = GetWindowLongW((HWND)lparam, GWL_ID); + i = GetWindowLong((HWND)lparam, GWL_ID); if (i >= GFX_MAX_PARAMETERS) break; @@ -412,7 +412,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; @@ -421,24 +421,21 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, } - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name) { - wchar_t class_name_wide[1024] = {0}; - - if (class_name) - MultiByteToWideChar(CP_UTF8, 0, class_name, -1, class_name_wide, sizeof(class_name_wide) / sizeof(class_name_wide[0])); + CHAR_TO_WCHAR_ALLOC(class_name, class_name_wide) wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndclass->hInstance = GetModuleHandleW(NULL); - wndclass->hCursor = LoadCursorW(NULL, IDC_ARROW); - wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; - wndclass->hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON)); - wndclass->hIconSm = (HICON)LoadImageW(GetModuleHandleW(NULL), + wndclass->hInstance = GetModuleHandle(NULL); + wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass->lpszClassName = (class_name_wide != NULL) ? class_name_wide : TEXT("RetroArch"); + wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); + wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); if (!fullscreen) wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW; @@ -446,7 +443,7 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (class_name != NULL) wndclass->style |= CS_CLASSDC; - if (!RegisterClassExW(wndclass)) + if (!RegisterClassEx(wndclass)) return false; /* This is non-NULL when we want a window for shader dialogs, @@ -471,7 +468,7 @@ bool win32_shader_dlg_init(void) if (!inited) { - WNDCLASSEXW wc_shader_dlg = {0}; + WNDCLASSEX wc_shader_dlg = {0}; INITCOMMONCONTROLSEX comm_ctrl_init = {0}; comm_ctrl_init.dwSize = sizeof(comm_ctrl_init); @@ -491,19 +488,19 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowExW(0, L"Shader Dialog", L"Shader Parameters", + g_shader_dlg.window.hwnd = CreateWindowEx(0, TEXT("Shader Dialog"), TEXT("Shader Parameters"), WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowExW(0, L"BUTTON", L"Always on Top", + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), TEXT("Always on Top"), BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)SHADER_DLG_CHECKBOX_ONTOP_ID, NULL, NULL); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; - SendMessageW(g_shader_dlg.on_top_checkbox.hwnd, + SendMessage(g_shader_dlg.on_top_checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -677,7 +674,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) command_event(cmd, NULL); if (do_wm_close) - PostMessageW(owner, WM_CLOSE, 0, 0); + PostMessage(owner, WM_CLOSE, 0, 0); return 0L; } From d891f1c90ba0e233195e394625bbe4723e34ca08 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 12:46:32 -0500 Subject: [PATCH 161/638] remove explicit unicode def/undefs --- gfx/common/win32_common.cpp | 48 +++++++++---------- gfx/common/win32_common.h | 8 ++-- gfx/drivers/d3d.cpp | 48 +++++++++---------- input/drivers/dinput.c | 5 +- libretro-common/include/compat/msvc.h | 5 +- libretro-common/include/encodings/win32.h | 10 ++++ libretro-common/include/retro_miscellaneous.h | 7 +-- libretro-common/streams/file_stream.c | 10 ++-- 8 files changed, 71 insertions(+), 70 deletions(-) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index aa091e33de..a9792c3730 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -1,6 +1,6 @@ /* 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. @@ -76,7 +76,7 @@ ui_window_win32_t main_window; /* Power Request APIs */ #if !defined(_XBOX) && (_MSC_VER == 1310) -typedef struct _REASON_CONTEXT +typedef struct _REASON_CONTEXT { ULONG Version; DWORD Flags; @@ -129,7 +129,7 @@ extern "C" } }; -INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, +INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { size_t list_size; @@ -148,16 +148,16 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); - hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); for (i = 0; i < list_size; i++) { const core_info_t *info = (const core_info_t*)&core_info[i]; - SendMessage(hwndList, LB_ADDSTRING, 0, - (LPARAM)info->display_name); + SendMessage(hwndList, LB_ADDSTRING, 0, + (LPARAM)info->display_name); } - SetFocus(hwndList); - return TRUE; + SetFocus(hwndList); + return TRUE; } case WM_COMMAND: @@ -168,20 +168,20 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, EndDialog(hDlg, LOWORD(wParam)); break; case ID_CORELISTBOX: - switch (HIWORD(wParam)) - { + switch (HIWORD(wParam)) + { case LBN_SELCHANGE: { int lbItem; const core_info_t *info = NULL; - HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); - lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); + HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); core_info_get_list(&core_info_list); core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); info = (const core_info_t*)&core_info[lbItem]; runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path); - } + } break; } return TRUE; @@ -336,7 +336,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) { /* Pick one core that could be compatible, ew */ if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), - hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) + hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( NULL, NULL, @@ -408,7 +408,7 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message, } *quit = true; break; - case WM_COMMAND: + case WM_COMMAND: { settings_t *settings = config_get_ptr(); if (settings->ui.menubar_enable) @@ -453,7 +453,7 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LPCREATESTRUCT p_cs = (LPCREATESTRUCT)lparam; curD3D = p_cs->lpCreateParams; g_inited = true; - + win32_window.hwnd = hwnd; ui_window_win32_set_droppable(&win32_window, true); @@ -533,7 +533,7 @@ bool win32_window_create(void *data, unsigned style, #endif bool win32_get_metrics(void *data, - enum display_metric_types type, float *value) + enum display_metric_types type, float *value) { #ifdef _XBOX return false; @@ -616,7 +616,7 @@ void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) { #ifndef _XBOX - const ui_application_t *application = + const ui_application_t *application = ui_companion_driver_get_application_ptr(); if (application) application->process_events(); @@ -696,12 +696,12 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, #ifndef _XBOX settings_t *settings = config_get_ptr(); - /* Windows only reports the refresh rates for modelines as - * an integer, so video.refresh_rate needs to be rounded. Also, account + /* Windows only reports the refresh rates for modelines as + * an integer, so video.refresh_rate needs to be rounded. Also, account * for black frame insertion using video.refresh_rate set to half * of the display refresh rate, as well as higher vsync swap intervals. */ float refresh_mod = settings->video.black_frame_insertion ? 2.0f : 1.0f; - unsigned refresh = roundf(settings->video.refresh_rate + unsigned refresh = roundf(settings->video.refresh_rate * refresh_mod * settings->video.swap_interval); if (fullscreen) @@ -714,14 +714,14 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, } else { - char dev_name[CCHDEVICENAME] = {0}; + char dev_name[CCHDEVICENAME] = {0}; *style = WS_POPUP | WS_VISIBLE; utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); if (!win32_monitor_set_fullscreen(*width, *height, refresh, dev_name)) - {} + {} /* Display settings might have changed, get new coordinates. */ GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); @@ -801,7 +801,7 @@ bool win32_set_video_mode(void *data, if (!win32_window_create(data, style, &mon_rect, width, height, fullscreen)) return false; - + win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 704cb40e35..f3496b095c 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,12 +18,10 @@ #define WIN32_COMMON_H__ #include +#include #ifndef _XBOX #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #endif @@ -83,7 +81,7 @@ bool win32_window_create(void *data, unsigned style, bool win32_suppress_screensaver(void *data, bool enable); bool win32_get_metrics(void *data, - enum display_metric_types type, float *value); + enum display_metric_types type, float *value); void win32_show_cursor(bool state); diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 95bfc96f8b..b429ac8319 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -15,13 +15,11 @@ * If not, see . */ +#include + #ifdef _XBOX #include #include -#else -#define UNICODE -#include -#include #endif #include @@ -155,14 +153,14 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) video_info->input_scale * RARCH_SCALE_BASE; if (!renderchain_init_first(&d3d->renderchain_driver, - &d3d->renderchain_data)) + &d3d->renderchain_data)) { - RARCH_ERR("Renderchain could not be initialized.\n"); - return false; + RARCH_ERR("Renderchain could not be initialized.\n"); + return false; } if (!d3d->renderchain_driver || !d3d->renderchain_data) - return false; + return false; if ( !d3d->renderchain_driver->init( @@ -187,7 +185,7 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) for (i = 1; i < d3d->shader.passes; i++) { d3d->renderchain_driver->convert_geometry(d3d->renderchain_data, - &link_info, + &link_info, &out_width, &out_height, current_width, current_height, &d3d->final_viewport); @@ -327,8 +325,8 @@ static void d3d_viewport_info(void *data, struct video_viewport *vp) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->viewport_info) return; @@ -364,7 +362,7 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay) vert[i][7] = 1.0f; vert[i][8] = overlay->alpha_mod; } - + d3d_viewport_info(d3d, &vp); overlay_width = vp.width; @@ -502,7 +500,7 @@ void d3d_make_d3dpp(void *data, #ifdef _XBOX d3dpp->Windowed = false; #else - d3dpp->Windowed = settings->video.windowed_fullscreen + d3dpp->Windowed = settings->video.windowed_fullscreen || !info->fullscreen; #endif d3dpp->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; @@ -533,13 +531,13 @@ void d3d_make_d3dpp(void *data, d3dpp->BackBufferFormat = #ifdef _XBOX360 global->console.screen.gamma_correction ? - (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? + (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5) : #endif info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5; #else d3dpp->hDeviceWindow = win32_get_window(); - d3dpp->BackBufferFormat = !d3dpp->Windowed ? + d3dpp->BackBufferFormat = !d3dpp->Windowed ? D3DFMT_X8R8G8B8 : D3DFMT_UNKNOWN; #endif @@ -713,8 +711,8 @@ static void d3d_calculate_rect(void *data, if (fabsf(device_aspect - desired_aspect) < 0.0001f) { - /* If the aspect ratios of screen and desired aspect - * ratio are sufficiently equal (floating point stuff), + /* If the aspect ratios of screen and desired aspect + * ratio are sufficiently equal (floating point stuff), * assume they are actually equal. */ } @@ -806,7 +804,7 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info) video_driver_get_size(&width, &height); d3d_set_viewport(d3d, - width, height, false, true); + width, height, false, true); #if defined(_XBOX360) strlcpy(settings->path.font, "game:\\media\\Arial_12.xpr", @@ -1047,7 +1045,7 @@ static bool d3d_construct(d3d_video_t *d3d, win_height, info->fullscreen); win32_set_window(&win_width, &win_height, info->fullscreen, - windowed_full, &rect); + windowed_full, &rect); #endif #ifdef HAVE_SHADERS @@ -1337,7 +1335,7 @@ static bool d3d_overlay_load(void *data, image_data; if (!d3d) - return false; + return false; d3d_free_overlays(d3d); d3d->overlays.resize(num_images); @@ -1542,8 +1540,8 @@ static bool d3d_read_viewport(void *data, uint8_t *buffer) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->read_viewport) return false; @@ -1603,7 +1601,7 @@ static void d3d_set_menu_texture_frame(void *data, || d3d->menu->tex_h != height) { if (d3d->menu) - d3d_texture_free(d3d->menu->tex); + d3d_texture_free(d3d->menu->tex); d3d->menu->tex = d3d_texture_new(d3d->dev, NULL, width, height, 1, @@ -1686,7 +1684,7 @@ static void video_texture_load_d3d(d3d_video_t *d3d, uintptr_t *id) { *id = (uintptr_t)d3d_texture_new(d3d->dev, NULL, - ti->width, ti->height, 1, + ti->width, ti->height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL); } @@ -1739,7 +1737,7 @@ static void d3d_unload_texture(void *data, uintptr_t id) { LPDIRECT3DTEXTURE texid; if (!id) - return; + return; texid = (LPDIRECT3DTEXTURE)id; d3d_texture_free(texid); diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index 51f76b4eab..dfb3033711 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -29,10 +29,7 @@ #define WM_MOUSEWHEEL 0x020A #endif -#define UNICODE -#include -#include - +#include #include #include diff --git a/libretro-common/include/compat/msvc.h b/libretro-common/include/compat/msvc.h index e767bef7f8..b56a51fad3 100644 --- a/libretro-common/include/compat/msvc.h +++ b/libretro-common/include/compat/msvc.h @@ -35,12 +35,12 @@ extern "C" { #ifndef snprintf #define snprintf c99_snprintf_retro__ #endif - + int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...); #endif /* Pre-MSVC 2010 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */ -#if _MSC_VER < 1600 +#if _MSC_VER < 1600 #include #include #ifndef vsnprintf @@ -53,7 +53,6 @@ extern "C" { } #endif -#undef UNICODE /* Do not bother with UNICODE at this time. */ #include #include #include diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 13ca67ce7b..8a911c556f 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -28,7 +28,17 @@ #define UNICODE #include #include + +#ifdef __cplusplus +extern "C" { +#endif + #include + +#ifdef __cplusplus +} +#endif + #endif #endif diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 2ab71c52dc..e9405eae63 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -45,11 +45,12 @@ #include #endif +#ifdef _WIN32 +#include +#endif + #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #elif defined(_WIN32) && defined(_XBOX) #include diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index d9406dba80..dfa2ef1a96 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -26,9 +26,7 @@ #include #if defined(_WIN32) -# define UNICODE -# include -# include +#include # ifdef _MSC_VER # define setmode _setmode # endif @@ -295,7 +293,7 @@ char *filestream_getline(RFILE *stream) } newline[idx] = '\0'; - return newline; + return newline; } char *filestream_gets(RFILE *stream, char *s, size_t len) @@ -346,7 +344,7 @@ ssize_t filestream_seek(RFILE *stream, ssize_t offset, int whence) #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function is + /* Need to check stream->mapped because this function is * called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) { @@ -416,7 +414,7 @@ ssize_t filestream_tell(RFILE *stream) return ftell(stream->fp); #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function + /* Need to check stream->mapped because this function * is called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) return stream->mappos; From 3b8a81dd31dc6ba06be4d4ec4d1f51b3960d07ae Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 14:15:39 -0500 Subject: [PATCH 162/638] make existing hard-coded unicode calls switchable back to ansi --- file_path_special.c | 25 ++++++---- frontend/drivers/platform_win32.c | 16 +++--- gfx/common/win32_common.cpp | 59 ++++++++++++---------- gfx/common/win32_common.h | 2 +- gfx/drivers_font/d3d_w32_font.cpp | 5 +- libretro-common/dynamic/dylib.c | 2 +- libretro-common/file/retro_dirent.c | 10 +++- libretro-common/file/retro_stat.c | 11 ++-- libretro-common/include/encodings/win32.h | 12 ++--- ui/drivers/ui_win32.c | 61 +++++++++++------------ 10 files changed, 110 insertions(+), 93 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 88aeae7cf8..c4012acb64 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -1,6 +1,6 @@ /* 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. @@ -123,7 +123,7 @@ void fill_pathname_abbreviate_special(char *out_path, fill_pathname_application_path(application_dir, sizeof(application_dir)); path_basedir(application_dir); - + for (i = 0; candidates[i]; i++) { if (!string_is_empty(candidates[i]) && strstr(in_path, candidates[i]) == in_path) @@ -131,11 +131,11 @@ void fill_pathname_abbreviate_special(char *out_path, size_t src_size = strlcpy(out_path, notations[i], size); retro_assert(src_size < size); - + out_path += src_size; size -= src_size; in_path += strlen(candidates[i]); - + if (!path_char_is_slash(*in_path)) { retro_assert(strlcpy(out_path, path_default_slash(), size) < size); @@ -207,8 +207,10 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; +#ifdef UNICODE wchar_t ws[PATH_MAX_LENGTH] = {0}; #endif +#endif #ifdef __HAIKU__ image_info info; int32_t cookie = 0; @@ -219,10 +221,13 @@ void fill_pathname_application_path(char *s, size_t len) return; #ifdef _WIN32 +#ifdef UNICODE MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - - ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); +#else + ret = GetModuleFileName(GetModuleHandle(NULL), s, len - 1); +#endif + s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) @@ -232,7 +237,7 @@ void fill_pathname_application_path(char *s, size_t len) CFStringGetCString(bundle_path, s, len, kCFStringEncodingUTF8); CFRelease(bundle_path); CFRelease(bundle_url); - + retro_assert(strlcat(s, "nobin", len) < len); return; } @@ -252,7 +257,7 @@ void fill_pathname_application_path(char *s, size_t len) char link_path[255]; link_path[0] = *s = '\0'; - pid = getpid(); + pid = getpid(); /* Linux, BSD and Solaris paths. Not standardized. */ for (i = 0; i < ARRAY_SIZE(exts); i++) @@ -270,7 +275,7 @@ void fill_pathname_application_path(char *s, size_t len) } } } - + RARCH_ERR("Cannot resolve application path! This should not happen.\n"); #endif } @@ -328,7 +333,7 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe #ifdef HAVE_ZARCH { settings_t *settings = config_get_ptr(); - fill_pathname_join(s, + fill_pathname_join(s, settings->directory.assets, "zarch", len); diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 2480e61f4e..8e5b8e3673 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -40,8 +40,8 @@ #include "../../runloop.h" #include "../../verbosity.h" -/* We only load this library once, so we let it be - * unloaded at application shutdown, since unloading +/* We only load this library once, so we let it be + * unloaded at application shutdown, since unloading * it early seems to cause issues on some systems. */ @@ -71,7 +71,7 @@ static bool gfx_init_dwm(void) } atexit(gfx_dwm_shutdown); - HRESULT (WINAPI *mmcss)(BOOL) = + HRESULT (WINAPI *mmcss)(BOOL) = (HRESULT (WINAPI*)(BOOL))dylib_proc(dwmlib, "DwmEnableMMCSS"); if (mmcss) { @@ -94,7 +94,7 @@ static void gfx_set_dwm(void) if (settings->video.disable_composition == dwm_composition_disabled) return; - HRESULT (WINAPI *composition_enable)(UINT) = + HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition"); if (!composition_enable) { @@ -177,7 +177,7 @@ static void frontend_win32_init(void *data) { typedef BOOL (WINAPI *isProcessDPIAwareProc)(); typedef BOOL (WINAPI *setProcessDPIAwareProc)(); - HMODULE handle = GetModuleHandleW(L"User32.dll"); + HMODULE handle = GetModuleHandle(TEXT("User32.dll")); isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)dylib_proc(handle, "IsProcessDPIAware"); setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)dylib_proc(handle, "SetProcessDPIAware"); @@ -189,13 +189,13 @@ static void frontend_win32_init(void *data) setDPIAwareProc(); } } - + } enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percent) { SYSTEM_POWER_STATUS status; - enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; + enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; if (!GetSystemPowerStatus(&status)) return ret; @@ -338,7 +338,7 @@ static void frontend_win32_detach_console(void) { HWND wnd = GetConsoleWindow(); FreeConsole(); - PostMessageW(wnd, WM_CLOSE, 0, 0); + PostMessage(wnd, WM_CLOSE, 0, 0); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index a9792c3730..3d4bda7462 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -212,20 +212,20 @@ void win32_monitor_from_window(void) void win32_monitor_get_info(void) { - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; memset(¤t_mon, 0, sizeof(current_mon)); - current_mon.cbSize = sizeof(MONITORINFOEXW); + current_mon.cbSize = sizeof(MONITORINFOEX); - GetMonitorInfoW(win32_monitor_last, (MONITORINFOEXW*)¤t_mon); - ChangeDisplaySettingsExW(current_mon.szDevice, NULL, NULL, 0, NULL); + GetMonitorInfo(win32_monitor_last, (MONITORINFOEX*)¤t_mon); + ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL); } void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) { unsigned i, fs_monitor; settings_t *settings = config_get_ptr(); - MONITORINFOEXW *mon = (MONITORINFOEXW*)data; + MONITORINFOEX *mon = (MONITORINFOEX*)data; HMONITOR *hm_to_use = (HMONITOR*)hm_data; if (!win32_monitor_last) @@ -254,8 +254,8 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) } memset(mon, 0, sizeof(*mon)); - mon->cbSize = sizeof(MONITORINFOEXW); - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)mon); + mon->cbSize = sizeof(MONITORINFOEX); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)mon); } /* Get the count of the files dropped */ @@ -264,18 +264,19 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) char szFilename[1024] = {0}; wchar_t wszFilename[1024] = {0}; - if (DragQueryFileW((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) + if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { /*poll list of current cores */ size_t list_size; content_ctx_info_t content_info = {0}; core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; - +#ifdef UNICODE DragQueryFileW((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); - utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); - +#else + DragQueryFile((HDROP)wparam, 0, szFilename, sizeof(szFilename)); +#endif core_info_get_list(&core_info_list); if (!core_info_list) @@ -335,7 +336,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) else { /* Pick one core that could be compatible, ew */ - if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), + if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE), hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( @@ -507,7 +508,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_create(void *data, unsigned style, @@ -515,7 +516,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowExW(0, L"RetroArch", L"RetroArch", + main_window.hwnd = CreateWindowEx(0, TEXT("RetroArch"), TEXT("RetroArch"), style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -583,7 +584,8 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; - wchar_t dev_name_wide[1024] = {0}; + unsigned res = 0; + CHAR_TO_WCHAR_ALLOC(dev_name, dev_name_wide) memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -595,10 +597,13 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); - - return ChangeDisplaySettingsExW(dev_name_wide, &devmode, + res = ChangeDisplaySettingsEx(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; + + if (dev_name_wide) + free(dev_name_wide); + + return res; #endif } @@ -655,7 +660,7 @@ bool win32_suppress_screensaver(void *data, bool enable) typedef HANDLE (WINAPI * PowerCreateRequestPtr)(REASON_CONTEXT *context); typedef BOOL (WINAPI * PowerSetRequestPtr)(HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType); - HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); + HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); PowerCreateRequestPtr powerCreateRequest = (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest"); PowerSetRequestPtr powerSetRequest = @@ -689,7 +694,7 @@ bool win32_suppress_screensaver(void *data, bool enable) } /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) { @@ -724,7 +729,7 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, {} /* Display settings might have changed, get new coordinates. */ - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)current_mon); *mon_rect = current_mon->rcMonitor; } } @@ -755,8 +760,8 @@ void win32_set_window(unsigned *width, unsigned *height, { RECT rc_temp = {0, 0, (LONG)*height, 0x7FFF}; SetMenu(main_window.hwnd, - LoadMenuW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDR_MENU))); - SendMessageW(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); + LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); + SendMessage(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); g_resize_height = *height += rc_temp.top + rect->top; SetWindowPos(main_window.hwnd, NULL, 0, 0, *width, *height, SWP_NOMOVE); } @@ -782,7 +787,7 @@ bool win32_set_video_mode(void *data, MSG msg; RECT mon_rect; unsigned mon_id; - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; bool windowed_full; RECT rect = {0}; HMONITOR hm_to_use = NULL; @@ -805,10 +810,10 @@ bool win32_set_video_mode(void *data, win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ - while (!g_inited && !g_quit && GetMessageW(&msg, main_window.hwnd, 0, 0)) + while (!g_inited && !g_quit && GetMessage(&msg, main_window.hwnd, 0, 0)) { TranslateMessage(&msg); - DispatchMessageW(&msg); + DispatchMessage(&msg); } if (g_quit) @@ -866,7 +871,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClassW(L"RetroArch", GetModuleHandleW(NULL)); + UnregisterClass(TEXT("RetroArch"), GetModuleHandle(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index f3496b095c..d7a803c300 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -97,7 +97,7 @@ void win32_set_window(unsigned *width, unsigned *height, #ifndef _XBOX /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); #endif diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index 5f4d8d9453..402a27f6ed 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,6 +18,7 @@ #include "../../config.h" #endif +#include #include "../drivers/d3d.h" #include "../font_driver.h" @@ -46,7 +47,7 @@ static void *d3dfonts_w32_init_font(void *video_data, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_PITCH, - L"Verdana" /* Hardcode FTL */ + TEXT("Verdana") /* Hardcode FTL */ }; d3dfonts = (d3dfonts_t*)calloc(1, sizeof(*d3dfonts)); diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index a1da7b8a45..d73172ed1e 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -35,7 +35,7 @@ #endif #ifdef _WIN32 -static TCHAR last_dyn_error[512]; +static TCHAR last_dyn_error[512] = {0}; static void set_dl_error(void) { diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index f29705b15d..4a9a02aeca 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -35,7 +35,9 @@ struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) char path_buf[1024] = {0}; +#ifdef UNICODE wchar_t pathW[1024] = {0}; +#endif #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -43,9 +45,13 @@ struct RDIR *retro_opendir(const char *name) return NULL; #if defined(_WIN32) +#ifdef UNICODE snprintf(path_buf, sizeof(path_buf), "%s\\*", name); MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); rdir->directory = FindFirstFileW(pathW, &rdir->entry); +#else + rdir->directory = FindFirstFile(path_buf, &rdir->entry); +#endif #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -78,7 +84,7 @@ int retro_readdir(struct RDIR *rdir) { #if defined(_WIN32) if(rdir->next) - return (FindNextFileW(rdir->directory, &rdir->entry) != 0); + return (FindNextFile(rdir->directory, &rdir->entry) != 0); else { rdir->next = true; return (rdir->directory != INVALID_HANDLE_VALUE); @@ -123,7 +129,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) { #if defined(_WIN32) - const WIN32_FIND_DATAW *entry = (const WIN32_FIND_DATAW*)&rdir->entry; + const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry; return entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; #elif defined(PSP) || defined(VITA) const SceIoDirent *entry = (const SceIoDirent*)&rdir->entry; diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 95c79c18c3..e918956f3b 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #if defined(_WIN32) @@ -103,11 +104,13 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - wchar_t path_wide[PATH_MAX_LENGTH] = {0}; + CHAR_TO_WCHAR_ALLOC(path, path_wide) - MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); + + if (path_wide) + free(path_wide); - DWORD ret = GetFileAttributesExW(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else @@ -208,7 +211,7 @@ bool mkdir_norecurse(const char *dir) #elif defined(PSP) || defined(_3DS) if ((ret == -1) && path_is_directory(dir)) ret = 0; -#else +#else if (ret < 0 && errno == EEXIST && path_is_directory(dir)) ret = 0; #endif diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 8a911c556f..03b385a5fb 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -44,20 +44,20 @@ extern "C" { #ifdef UNICODE #define CHAR_TO_WCHAR_ALLOC(s, ws) \ - size_t ws##_size = (s[0] ? strlen(s) : 0) + 1; \ + size_t ws##_size = (NULL != s && s[0] ? strlen(s) : 0) + 1; \ wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ - if (s[0]) \ + if (NULL != s && s[0]) \ MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); #define WCHAR_TO_CHAR_ALLOC(ws, s) \ - size_t s##_size = ((ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ + size_t s##_size = ((NULL != ws && ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ char *s = (char*)calloc(s##_size, 1); \ - if (ws[0]) \ + if (NULL != ws && ws[0]) \ utf16_to_char_string((const uint16_t*)ws, s, s##_size); #else -#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = strdup(s); -#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = strdup(ws); +#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = (NULL != s && s[0] ? strdup(s) : NULL); +#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = (NULL != ws && ws[0] ? strdup(ws) : NULL); #endif #endif diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 2a8fc12836..8dc324223a 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -156,20 +156,20 @@ static void shader_dlg_params_refresh(void) bool checked = (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); - SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: shader_dlg_refresh_trackbar_label(i); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].maximum - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].current - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); @@ -251,12 +251,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowExW(0, L"BUTTON", + control->checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), param_desc_wide, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -269,27 +269,27 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowExW(0, L"STATIC", + control->trackbar.label_title = CreateWindowEx(0, TEXT("STATIC"), param_desc_wide, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowExW(0, TRACKBAR_CLASS, L"", + control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, TEXT(""), WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowExW(0, L"STATIC", L"", + control->trackbar.label_val = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessageW(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, (LPARAM)control->trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -303,7 +303,7 @@ void shader_dlg_params_reload(void) if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowExW(0, L"STATIC", L"", + g_shader_dlg.separator.hwnd = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -393,7 +393,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_CHECKBOX) break; - if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; @@ -404,7 +404,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; case WM_HSCROLL: - i = GetWindowLongW((HWND)lparam, GWL_ID); + i = GetWindowLong((HWND)lparam, GWL_ID); if (i >= GFX_MAX_PARAMETERS) break; @@ -412,7 +412,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; @@ -421,24 +421,21 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, } - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name) { - wchar_t class_name_wide[1024] = {0}; - - if (class_name) - MultiByteToWideChar(CP_UTF8, 0, class_name, -1, class_name_wide, sizeof(class_name_wide) / sizeof(class_name_wide[0])); + CHAR_TO_WCHAR_ALLOC(class_name, class_name_wide) wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndclass->hInstance = GetModuleHandleW(NULL); - wndclass->hCursor = LoadCursorW(NULL, IDC_ARROW); - wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; - wndclass->hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON)); - wndclass->hIconSm = (HICON)LoadImageW(GetModuleHandleW(NULL), + wndclass->hInstance = GetModuleHandle(NULL); + wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass->lpszClassName = (class_name_wide != NULL) ? class_name_wide : TEXT("RetroArch"); + wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); + wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); if (!fullscreen) wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW; @@ -446,7 +443,7 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (class_name != NULL) wndclass->style |= CS_CLASSDC; - if (!RegisterClassExW(wndclass)) + if (!RegisterClassEx(wndclass)) return false; /* This is non-NULL when we want a window for shader dialogs, @@ -471,7 +468,7 @@ bool win32_shader_dlg_init(void) if (!inited) { - WNDCLASSEXW wc_shader_dlg = {0}; + WNDCLASSEX wc_shader_dlg = {0}; INITCOMMONCONTROLSEX comm_ctrl_init = {0}; comm_ctrl_init.dwSize = sizeof(comm_ctrl_init); @@ -491,19 +488,19 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowExW(0, L"Shader Dialog", L"Shader Parameters", + g_shader_dlg.window.hwnd = CreateWindowEx(0, TEXT("Shader Dialog"), TEXT("Shader Parameters"), WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowExW(0, L"BUTTON", L"Always on Top", + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), TEXT("Always on Top"), BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)SHADER_DLG_CHECKBOX_ONTOP_ID, NULL, NULL); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; - SendMessageW(g_shader_dlg.on_top_checkbox.hwnd, + SendMessage(g_shader_dlg.on_top_checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -677,7 +674,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) command_event(cmd, NULL); if (do_wm_close) - PostMessageW(owner, WM_CLOSE, 0, 0); + PostMessage(owner, WM_CLOSE, 0, 0); return 0L; } From 84b65514f21985e473ac1bf9abfc2e54029bfcf3 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 14:33:43 -0500 Subject: [PATCH 163/638] ok button input should be unsigned --- menu/menu_event.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/menu/menu_event.c b/menu/menu_event.c index dc31e700e4..7f0bf6e904 100644 --- a/menu/menu_event.c +++ b/menu/menu_event.c @@ -200,13 +200,13 @@ unsigned menu_event(uint64_t input, uint64_t trigger_input) size_t new_scroll_accel = 0; menu_input_t *menu_input = NULL; settings_t *settings = config_get_ptr(); - static char ok_old = 0; + static unsigned ok_old = 0; unsigned menu_ok_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_B : RETRO_DEVICE_ID_JOYPAD_A; unsigned menu_cancel_btn = settings->input.menu_swap_ok_cancel_buttons ? RETRO_DEVICE_ID_JOYPAD_A : RETRO_DEVICE_ID_JOYPAD_B; - char ok_current = input & UINT64_C(1) << menu_ok_btn; - bool ok_trigger = ok_current & ~ok_old; + unsigned ok_current = input & UINT64_C(1) << menu_ok_btn; + unsigned ok_trigger = ok_current & ~ok_old; ok_old = ok_current; From 826afd137c06403b2d5bed9623005348f79ecece Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 15:34:15 -0500 Subject: [PATCH 164/638] disable unicode until GL context is fixed --- libretro-common/include/encodings/win32.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 03b385a5fb..45e7c9a5c3 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -25,9 +25,9 @@ #ifndef _XBOX #ifdef _WIN32 -#define UNICODE +/*#define UNICODE #include -#include +#include */ #ifdef __cplusplus extern "C" { From d7dbb6cac0a245713fcffc6ce49f1e51b4a76360 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 16:36:46 -0500 Subject: [PATCH 165/638] Fix NAT traversal menu setting. --- menu/menu_setting.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 2a399079d3..0bfadabefd 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -5599,7 +5599,7 @@ static bool setting_append_list( CONFIG_BOOL( list, list_info, - &settings->netplay.is_spectate, + &settings->netplay.nat_traversal, MENU_ENUM_LABEL_NETPLAY_NAT_TRAVERSAL, MENU_ENUM_LABEL_VALUE_NETPLAY_NAT_TRAVERSAL, false, From addff325d06028a1c3e81baceed97e65714720ee Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 18:56:29 -0500 Subject: [PATCH 166/638] Netplay discovery LAN scanning task (incomplete) --- Makefile.common | 1 + menu/menu_driver.h | 1 + msg_hash.h | 3 + network/netplay/netplay.h | 1 + network/netplay/netplay_common.c | 1 + network/netplay/netplay_discovery.h | 56 +++++++++++++++++ network/netplay/netplay_private.h | 1 + tasks/task_netplay_lan_scan.c | 96 +++++++++++++++++++++++++++++ tasks/tasks_internal.h | 2 + 9 files changed, 162 insertions(+) create mode 100644 network/netplay/netplay_discovery.h create mode 100644 tasks/task_netplay_lan_scan.c diff --git a/Makefile.common b/Makefile.common index 9abfa0afc3..40fe16f938 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1100,6 +1100,7 @@ ifeq ($(HAVE_NETWORKING), 1) $(LIBRETRO_COMM_DIR)/net/net_natt.o \ network/net_http_special.o \ tasks/task_http.o \ + tasks/task_netplay_lan_scan.o \ tasks/task_wifi.o ifneq ($(HAVE_SOCKET_LEGACY),1) diff --git a/menu/menu_driver.h b/menu/menu_driver.h index 997ece0916..ffcc5935f5 100644 --- a/menu/menu_driver.h +++ b/menu/menu_driver.h @@ -183,6 +183,7 @@ enum menu_settings_type MENU_SETTING_SUBGROUP, MENU_SETTING_HORIZONTAL_MENU, MENU_WIFI, + MENU_NETPLAY_LAN_SCAN, MENU_INFO_MESSAGE, MENU_SETTINGS_SHADER_PARAMETER_0, MENU_SETTINGS_SHADER_PARAMETER_LAST = MENU_SETTINGS_SHADER_PARAMETER_0 + (GFX_MAX_PARAMETERS - 1), diff --git a/msg_hash.h b/msg_hash.h index d4921acefc..13989391bc 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -141,6 +141,7 @@ enum msg_hash_enums MSG_NETPLAY_USERS_HAS_FLIPPED, MSG_UNKNOWN_NETPLAY_COMMAND_RECEIVED, MSG_CONNECTING_TO_NETPLAY_HOST, + MSG_NETPLAY_LAN_SCANNING, MSG_WAITING_FOR_CLIENT, MSG_AUTODETECT, MSG_AUDIO_VOLUME, @@ -809,6 +810,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_DEFERRED_UPDATER_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_NETWORK_SETTINGS_LIST, + MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST, MENU_ENUM_LABEL_DEFERRED_USER_SETTINGS_LIST, MENU_ENUM_LABEL_DEFERRED_DIRECTORY_SETTINGS_LIST, @@ -875,6 +877,7 @@ enum msg_hash_enums MENU_LABEL(NETPLAY_ENABLE_CLIENT), MENU_LABEL(NETPLAY_DISCONNECT), MENU_LABEL(NETPLAY_SETTINGS), + MENU_LABEL(NETPLAY_CONNECT_TO), MENU_ENUM_LABEL_RESET, MENU_ENUM_LABEL_SLOWMOTION, diff --git a/network/netplay/netplay.h b/network/netplay/netplay.h index 41bc60f743..5793efae1f 100644 --- a/network/netplay/netplay.h +++ b/network/netplay/netplay.h @@ -1,6 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2016 - Gregor Richards * * 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- diff --git a/network/netplay/netplay_common.c b/network/netplay/netplay_common.c index f3edd0ab14..67b07a70d8 100644 --- a/network/netplay/netplay_common.c +++ b/network/netplay/netplay_common.c @@ -471,6 +471,7 @@ bool netplay_ad_server(netplay_t *netplay, int ad_fd) break; /* Somebody queried, so check that it's valid */ + addr_size = sizeof(their_addr); if (recvfrom(ad_fd, (char*)ad_packet_buffer, AD_PACKET_MAX_SIZE, 0, &their_addr, &addr_size) >= (ssize_t) (2*sizeof(uint32_t))) { diff --git a/network/netplay/netplay_discovery.h b/network/netplay/netplay_discovery.h new file mode 100644 index 0000000000..f0b7358c78 --- /dev/null +++ b/network/netplay/netplay_discovery.h @@ -0,0 +1,56 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2016 - Gregor Richards + * + * 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 . + */ + + +#ifndef __RARCH_NETPLAY_DISCOVERY_H +#define __RARCH_NETPLAY_DISCOVERY_H + +#include + +#define NETPLAY_HOST_STR_LEN 32 + +enum rarch_netplay_discovery_ctl_state +{ + RARCH_NETPLAY_DISCOVERY_CTL_NONE = 0, + RARCH_NETPLAY_DISCOVERY_CTL_LAN_SEND_QUERY, + RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, + RARCH_NETPLAY_DISCOVERY_CTL_LAN_CLEAR_RESPONSES +}; + +struct netplay_host { + struct sockaddr addr; + socklen_t addrlen; + + char nick[NETPLAY_HOST_STR_LEN]; + char core[NETPLAY_HOST_STR_LEN]; + char core_version[NETPLAY_HOST_STR_LEN]; + char content[NETPLAY_HOST_STR_LEN]; +}; + +struct netplay_host_list { + struct netplay_host *hosts; + size_t size; +}; + +/** Initialize Netplay discovery */ +bool init_netplay_discovery(void); + +/** Deinitialize and free Netplay discovery */ +void deinit_netplay_discovery(void); + +/** Discovery control */ +bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, void *data); + +#endif diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index 3ac24227c4..b24c8cccdf 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -1,6 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * Copyright (C) 2011-2016 - Daniel De Matteis + * Copyright (C) 2016 - Gregor Richards * * 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- diff --git a/tasks/task_netplay_lan_scan.c b/tasks/task_netplay_lan_scan.c new file mode 100644 index 0000000000..cd2462d58f --- /dev/null +++ b/tasks/task_netplay_lan_scan.c @@ -0,0 +1,96 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2016 - Jean-André Santoni + * + * 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 "tasks_internal.h" +#include "../verbosity.h" +#include "../network/netplay/netplay_discovery.h" +#include "../menu/menu_entries.h" +#include "../menu/menu_driver.h" + +static void netplay_lan_scan_callback(void *task_data, + void *user_data, const char *error) +{ + unsigned i; + unsigned menu_type = 0; + const char *path = NULL; + const char *label = NULL; + enum msg_hash_enums enum_idx = MSG_UNKNOWN; + file_list_t *file_list = NULL; + struct netplay_host_list *netplay_hosts = NULL; + + menu_entries_get_last_stack(&path, &label, &menu_type, &enum_idx, NULL); + + /* Don't push the results if we left the LAN scan menu */ + if (!string_is_equal(label, + msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST))) + return; + + file_list = menu_entries_get_selection_buf_ptr(0); + + menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); + + if (netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, (void *) &netplay_hosts)) + { + for (i = 0; i < netplay_hosts->size; i++) + { + struct netplay_host *host = &netplay_hosts->hosts[i]; + menu_entries_append_enum(file_list, + host->nick, + msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_CONNECT_TO), + MENU_ENUM_LABEL_NETPLAY_CONNECT_TO, + MENU_NETPLAY_LAN_SCAN, 0, 0); + } + } +} + +static void task_netplay_lan_scan_handler(retro_task_t *task) +{ + if (init_netplay_discovery()) + { + netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_CLEAR_RESPONSES, NULL); + netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_SEND_QUERY, NULL); + } + + task->progress = 100; + task->title = strdup(msg_hash_to_str(MSG_NETPLAY_LAN_SCANNING)); + task->finished = true; + + return; +} + +bool task_push_netplay_lan_scan(void) +{ + retro_task_t *task = (retro_task_t*)calloc(1, sizeof(*task)); + + if (!task) + goto error; + + task->type = TASK_TYPE_BLOCKING; + task->handler = task_netplay_lan_scan_handler; + task->callback = netplay_lan_scan_callback; + task->title = strdup(msg_hash_to_str(MSG_NETPLAY_LAN_SCANNING)); + + task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); + + return true; + +error: + if (task) + free(task); + + return false; +} diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index d2b1fb16f1..cc14596739 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -95,6 +95,8 @@ task_retriever_info_t *http_task_get_transfer_list(void); bool task_push_wifi_scan(void); +bool task_push_netplay_lan_scan(void); + #endif bool task_push_image_load(const char *fullpath, From 4c18cec752ca86550c5301fc445f8f18d79ff1c6 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 19:49:42 -0500 Subject: [PATCH 167/638] Added Netplay discovery code (not yet in menu) --- Makefile.common | 1 + network/netplay/netplay.c | 30 +-- network/netplay/netplay_common.c | 101 --------- network/netplay/netplay_discovery.c | 321 ++++++++++++++++++++++++++++ network/netplay/netplay_private.h | 4 +- 5 files changed, 327 insertions(+), 130 deletions(-) create mode 100644 network/netplay/netplay_discovery.c diff --git a/Makefile.common b/Makefile.common index 40fe16f938..7de2ceb6ad 100644 --- a/Makefile.common +++ b/Makefile.common @@ -1121,6 +1121,7 @@ ifeq ($(HAVE_NETWORKING), 1) OBJ += network/netplay/netplay_net.o \ network/netplay/netplay_spectate.o \ network/netplay/netplay_common.o \ + network/netplay/netplay_discovery.o \ network/netplay/netplay.o # Retro Achievements (also depends on threads) diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index c63285be71..8c0e25270e 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -54,9 +54,6 @@ enum static bool netplay_enabled = false; static bool netplay_is_client = false; -/* Used to advertise or request advertisement of Netplay */ -static int netplay_ad_fd = -1; - /* Used while Netplay is running */ static netplay_t *netplay_data = NULL; @@ -204,28 +201,6 @@ static void init_nat_traversal(netplay_t *netplay) announce_nat_traversal(netplay); } -static bool init_ad_socket(netplay_t *netplay, uint16_t port) -{ - int fd = socket_init((void**)&netplay->addr, port, NULL, SOCKET_TYPE_DATAGRAM); - - if (fd < 0) - goto error; - - if (!socket_bind(fd, (void*)netplay->addr)) - { - socket_close(fd); - goto error; - } - - netplay_ad_fd = fd; - - return true; - -error: - RARCH_ERR("Failed to initialize netplay advertisement socket.\n"); - return false; -} - static bool init_socket(netplay_t *netplay, const char *server, uint16_t port) { if (!network_init()) @@ -1446,9 +1421,8 @@ bool netplay_pre_frame(netplay_t *netplay) if (netplay->is_server) { - /* Advertise our server if applicable */ - if (netplay_ad_fd >= 0 || init_ad_socket(netplay, RARCH_DEFAULT_PORT)) - netplay_ad_server(netplay, netplay_ad_fd); + /* Advertise our server */ + netplay_lan_ad_server(netplay); /* NAT traversal if applicable */ if (netplay->nat_traversal && diff --git a/network/netplay/netplay_common.c b/network/netplay/netplay_common.c index 67b07a70d8..16779d54d7 100644 --- a/network/netplay/netplay_common.c +++ b/network/netplay/netplay_common.c @@ -420,104 +420,3 @@ uint32_t netplay_delta_frame_crc(netplay_t *netplay, struct delta_frame *delta) return 0; return encoding_crc32(0L, (const unsigned char*)delta->state, netplay->state_size); } - -/* - * AD PACKET FORMAT: - * - * Request: - * 1 word: RANQ (RetroArch Netplay Query) - * 1 word: Netplay protocol version - * - * Reply: - * 1 word : RANS (RetroArch Netplay Server) - * 1 word : Netplay protocol version - * 1 word : Port - * 8 words: RetroArch version - * 8 words: Nick - * 8 words: Core name - * 8 words: Core version - * 8 words: Content name (currently always blank) - */ - -#define AD_PACKET_MAX_SIZE 512 -#define AD_PACKET_STRING_SIZE 32 -#define AD_PACKET_STRING_WORDS (AD_PACKET_STRING_SIZE/sizeof(uint32_t)) -static uint32_t *ad_packet_buffer = NULL; - -bool netplay_ad_server(netplay_t *netplay, int ad_fd) -{ - fd_set fds; - struct timeval tmp_tv = {0}; - struct sockaddr their_addr; - socklen_t addr_size; - rarch_system_info_t *info = NULL; - size_t bufloc; - - if (!ad_packet_buffer) - { - ad_packet_buffer = (uint32_t *) malloc(AD_PACKET_MAX_SIZE); - if (!ad_packet_buffer) - return false; - } - - /* Check for any ad queries */ - while (1) - { - FD_ZERO(&fds); - FD_SET(ad_fd, &fds); - if (socket_select(ad_fd + 1, &fds, NULL, NULL, &tmp_tv) <= 0) - break; - if (!FD_ISSET(ad_fd, &fds)) - break; - - /* Somebody queried, so check that it's valid */ - addr_size = sizeof(their_addr); - if (recvfrom(ad_fd, (char*)ad_packet_buffer, AD_PACKET_MAX_SIZE, 0, - &their_addr, &addr_size) >= (ssize_t) (2*sizeof(uint32_t))) - { - /* Make sure it's a valid query */ - if (memcmp(ad_packet_buffer, "RANQ", 4)) - continue; - - /* For this version */ - if (ntohl(ad_packet_buffer[1]) != NETPLAY_PROTOCOL_VERSION) - continue; - - runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info); - - /* Now build our response */ - memset(ad_packet_buffer, 0, AD_PACKET_MAX_SIZE); - memcpy(ad_packet_buffer, "RANS", 4); - ad_packet_buffer[1] = htonl(NETPLAY_PROTOCOL_VERSION); - ad_packet_buffer[2] = htonl(netplay->tcp_port); - bufloc = 3; - strncpy((char *) (ad_packet_buffer + bufloc), - PACKAGE_VERSION, AD_PACKET_STRING_SIZE); - bufloc += AD_PACKET_STRING_WORDS; - strncpy((char *) (ad_packet_buffer + bufloc), - netplay->nick, AD_PACKET_STRING_SIZE); - bufloc += AD_PACKET_STRING_WORDS; - if (info) - { - strncpy((char *) (ad_packet_buffer + bufloc), - info->info.library_name, AD_PACKET_STRING_SIZE); - bufloc += AD_PACKET_STRING_WORDS; - strncpy((char *) (ad_packet_buffer + bufloc), - info->info.library_version, AD_PACKET_STRING_SIZE); - bufloc += AD_PACKET_STRING_WORDS; - /* Blank content */ - bufloc += AD_PACKET_STRING_WORDS; - } - else - { - bufloc += 3*AD_PACKET_STRING_WORDS; - } - - /* And send it */ - sendto(ad_fd, (const char*)ad_packet_buffer, bufloc*sizeof(uint32_t), 0, - &their_addr, addr_size); - } - } - - return true; -} diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c new file mode 100644 index 0000000000..9074609ebf --- /dev/null +++ b/network/netplay/netplay_discovery.c @@ -0,0 +1,321 @@ +/* RetroArch - A frontend for libretro. + * Copyright (C) 2016 - Gregor Richards + * + * 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 . + */ + +/* + * AD PACKET FORMAT: + * + * Request: + * 1 word: RANQ (RetroArch Netplay Query) + * 1 word: Netplay protocol version + * + * Reply: + * 1 word : RANS (RetroArch Netplay Server) + * 1 word : Netplay protocol version + * 1 word : Port + * 8 words: RetroArch version + * 8 words: Nick + * 8 words: Core name + * 8 words: Core version + * 8 words: Content name (currently always blank) + */ + +#include +#include + +#include + +#include "../../runloop.h" +#include "../../version.h" +#include "netplay.h" +#include "netplay_discovery.h" +#include "netplay_private.h" + +struct ad_packet +{ + uint32_t header; + uint32_t protocol_version; + uint32_t port; + char retroarch_version[NETPLAY_HOST_STR_LEN]; + char nick[NETPLAY_HOST_STR_LEN]; + char core[NETPLAY_HOST_STR_LEN]; + char core_version[NETPLAY_HOST_STR_LEN]; + char content[NETPLAY_HOST_STR_LEN]; +}; + +bool netplay_lan_ad_client(void); + +/* LAN discovery sockets */ +static int lan_ad_server_fd = -1; +static int lan_ad_client_fd = -1; + +/* Packet buffer for advertisement and responses */ +static struct ad_packet ad_packet_buffer; + +/* List of discovered hosts */ +static struct netplay_host_list discovered_hosts; +static size_t discovered_hosts_allocated; + +/** Initialize Netplay discovery (client) */ +bool init_netplay_discovery(void) +{ + struct addrinfo *addr = NULL; + int fd = socket_init((void **) &addr, 0, NULL, SOCKET_TYPE_DATAGRAM); + + if (fd < 0) + goto error; + + if (!socket_bind(fd, (void*)addr)) + { + socket_close(fd); + goto error; + } + + lan_ad_client_fd = fd; + freeaddrinfo_retro(addr); + return true; + +error: + if (addr) + freeaddrinfo_retro(addr); + RARCH_ERR("Failed to initialize netplay advertisement client socket.\n"); + return false; +} + +/** Deinitialize and free Netplay discovery */ +void deinit_netplay_discovery(void) +{ + if (lan_ad_client_fd >= 0) + { + socket_close(lan_ad_client_fd); + lan_ad_client_fd = -1; + } +} + +/** Discovery control */ +bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, void *data) +{ + char port_str[6]; + + if (lan_ad_client_fd < 0) + return false; + + switch (state) + { + case RARCH_NETPLAY_DISCOVERY_CTL_LAN_SEND_QUERY: + { + struct addrinfo hints = {0}, *addr; + + /* Get the broadcast address (IPv4 only for now) */ + snprintf(port_str, 6, "%hu", RARCH_DEFAULT_PORT); + if (getaddrinfo_retro("255.255.255.255", port_str, &hints, &addr) < 0) + return false; + + /* Put together the request */ + memcpy((void *) &ad_packet_buffer, "RANQ", 4); + ad_packet_buffer.protocol_version = htonl(NETPLAY_PROTOCOL_VERSION); + + /* And send it off */ + sendto(lan_ad_client_fd, &ad_packet_buffer, 2*sizeof(uint32_t), 0, + addr->ai_addr, addr->ai_addrlen); + break; + } + + case RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES: + return netplay_lan_ad_client(); + + case RARCH_NETPLAY_DISCOVERY_CTL_LAN_CLEAR_RESPONSES: + discovered_hosts.size = 0; + break; + + default: + return false; + } + + return true; +} + +static bool init_lan_ad_server_socket(netplay_t *netplay, uint16_t port) +{ + struct addrinfo *addr = NULL; + int fd = socket_init((void **) &addr, port, NULL, SOCKET_TYPE_DATAGRAM); + + if (fd < 0) + goto error; + + if (!socket_bind(fd, (void*)addr)) + { + socket_close(fd); + goto error; + } + + lan_ad_server_fd = fd; + freeaddrinfo_retro(addr); + + return true; + +error: + if (addr) + freeaddrinfo_retro(addr); + RARCH_ERR("Failed to initialize netplay advertisement socket.\n"); + return false; +} + +bool netplay_lan_ad_server(netplay_t *netplay) +{ + fd_set fds; + struct timeval tmp_tv = {0}; + struct sockaddr their_addr; + socklen_t addr_size; + rarch_system_info_t *info = NULL; + size_t bufloc; + + if (lan_ad_server_fd < 0 && !init_lan_ad_server_socket(netplay, RARCH_DEFAULT_PORT)) + return false; + + /* Check for any ad queries */ + while (1) + { + FD_ZERO(&fds); + FD_SET(lan_ad_server_fd, &fds); + if (socket_select(lan_ad_server_fd + 1, &fds, NULL, NULL, &tmp_tv) <= 0) + break; + if (!FD_ISSET(lan_ad_server_fd, &fds)) + break; + + /* Somebody queried, so check that it's valid */ + addr_size = sizeof(their_addr); + if (recvfrom(lan_ad_server_fd, (char*)&ad_packet_buffer, + sizeof(struct ad_packet), 0, &their_addr, &addr_size) >= + (ssize_t) (2*sizeof(uint32_t))) + { + /* Make sure it's a valid query */ + if (memcmp((void *) &ad_packet_buffer, "RANQ", 4)) + continue; + + /* For this version */ + if (ntohl(ad_packet_buffer.protocol_version) != + NETPLAY_PROTOCOL_VERSION) + continue; + + runloop_ctl(RUNLOOP_CTL_SYSTEM_INFO_GET, &info); + + /* Now build our response */ + memset(&ad_packet_buffer, 0, sizeof(struct ad_packet)); + memcpy(&ad_packet_buffer, "RANS", 4); + ad_packet_buffer.protocol_version = + htonl(NETPLAY_PROTOCOL_VERSION); + ad_packet_buffer.port = htonl(netplay->tcp_port); + strncpy(ad_packet_buffer.retroarch_version, PACKAGE_VERSION, + NETPLAY_HOST_STR_LEN); + strncpy(ad_packet_buffer.nick, netplay->nick, NETPLAY_HOST_STR_LEN); + if (info) + { + strncpy(ad_packet_buffer.core, info->info.library_name, + NETPLAY_HOST_STR_LEN); + strncpy(ad_packet_buffer.core_version, info->info.library_version, + NETPLAY_HOST_STR_LEN); + } + + /* And send it */ + sendto(lan_ad_server_fd, (const char*)&ad_packet_buffer, + sizeof(struct ad_packet), 0, &their_addr, addr_size); + } + } + + return true; +} + +bool netplay_lan_ad_client(void) +{ + fd_set fds; + struct timeval tmp_tv = {0}; + struct sockaddr their_addr; + socklen_t addr_size; + rarch_system_info_t *info = NULL; + size_t bufloc; + + if (lan_ad_client_fd < 0) + return false; + + /* Check for any ad queries */ + while (1) + { + FD_ZERO(&fds); + FD_SET(lan_ad_client_fd, &fds); + if (socket_select(lan_ad_client_fd + 1, &fds, NULL, NULL, &tmp_tv) <= 0) + break; + if (!FD_ISSET(lan_ad_client_fd, &fds)) + break; + + /* Somebody queried, so check that it's valid */ + addr_size = sizeof(their_addr); + if (recvfrom(lan_ad_client_fd, (char*)&ad_packet_buffer, + sizeof(struct ad_packet), 0, &their_addr, &addr_size) >= + sizeof(struct ad_packet)) + { + struct netplay_host *host; + + /* Make sure it's a valid response */ + if (memcmp((void *) &ad_packet_buffer, "RANS", 4)) + continue; + + /* For this version */ + if (ntohl(ad_packet_buffer.protocol_version) != NETPLAY_PROTOCOL_VERSION) + continue; + + /* Allocate space for it */ + if (discovered_hosts.size >= discovered_hosts_allocated) + { + size_t allocated = discovered_hosts_allocated; + struct netplay_host *new_hosts; + + if (allocated == 0) allocated = 2; + else allocated *= 2; + + if (discovered_hosts.hosts) + new_hosts = realloc(discovered_hosts.hosts, allocated * sizeof(struct netplay_host)); + else + /* Should be equivalent to realloc, but I don't trust screwy libcs */ + new_hosts = malloc(allocated * sizeof(struct netplay_host)); + + if (!new_hosts) + return false; + + discovered_hosts.hosts = new_hosts; + discovered_hosts_allocated = allocated; + } + + /* Get our host structure */ + host = &discovered_hosts.hosts[discovered_hosts.size++]; + + /* Copy in the response */ + memset(host, 0, sizeof(struct netplay_host)); + host->addr = their_addr; + host->addrlen = addr_size; + strncpy(host->nick, ad_packet_buffer.nick, NETPLAY_HOST_STR_LEN); + strncpy(host->core, ad_packet_buffer.core, NETPLAY_HOST_STR_LEN); + strncpy(host->core_version, ad_packet_buffer.core_version, + NETPLAY_HOST_STR_LEN); + strncpy(host->content, ad_packet_buffer.content, + NETPLAY_HOST_STR_LEN); + host->nick[NETPLAY_HOST_STR_LEN-1] = + host->core[NETPLAY_HOST_STR_LEN-1] = + host->core_version[NETPLAY_HOST_STR_LEN-1] = + host->content[NETPLAY_HOST_STR_LEN-1] = '\0'; + } + } + + return true; +} diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index b24c8cccdf..3b72e52160 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -258,6 +258,8 @@ bool netplay_cmd_crc(netplay_t *netplay, struct delta_frame *delta); bool netplay_cmd_request_savestate(netplay_t *netplay); -bool netplay_ad_server(netplay_t *netplay, int ad_fd); +/* DISCOVERY: */ + +bool netplay_lan_ad_server(netplay_t *netplay); #endif From 3446cf09d6ca5c9b9d024a8f0cc355be28be4fb9 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 20:28:22 -0500 Subject: [PATCH 168/638] Actually report discovered hosts back to the caller! --- network/netplay/netplay_discovery.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 9074609ebf..89f87adef2 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -133,7 +133,10 @@ bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, } case RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES: - return netplay_lan_ad_client(); + if (!netplay_lan_ad_client()) + return false; + *((struct netplay_host_list **) data) = &discovered_hosts; + break; case RARCH_NETPLAY_DISCOVERY_CTL_LAN_CLEAR_RESPONSES: discovered_hosts.size = 0; From ba0985de379dd35970fe14551d89b91cba774637 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 20:38:55 -0500 Subject: [PATCH 169/638] Actually report the host port as the Netplay port, not the discovery port --- network/netplay/netplay_discovery.c | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 89f87adef2..6ac8062d81 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -240,6 +240,22 @@ bool netplay_lan_ad_server(netplay_t *netplay) return true; } +#ifdef HAVE_SOCKET_LEGACY +/* The fact that I need to write this is deeply depressing */ +static int16_t htons_for_morons(int16_t value) +{ + union { + int32_t l; + int16_t s[2]; + } val; + val.l = htonl(value); + return val.s[2]; +} +#ifndef htons +#define htons htons_for_morons +#endif +#endif + bool netplay_lan_ad_client(void) { fd_set fds; @@ -278,6 +294,23 @@ bool netplay_lan_ad_client(void) if (ntohl(ad_packet_buffer.protocol_version) != NETPLAY_PROTOCOL_VERSION) continue; + /* And that we know how to handle it */ + if (their_addr.sa_family == AF_INET) + { + struct sockaddr_in *sin = (struct sockaddr_in *) &their_addr; + sin->sin_port = htons(ad_packet_buffer.port); + + } +#ifdef AF_INET6 + else if (their_addr.sa_family == AF_INET6) + { + struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) &their_addr; + sin6->sin6_port = htons(ad_packet_buffer.port); + + } +#endif + else continue; + /* Allocate space for it */ if (discovered_hosts.size >= discovered_hosts_allocated) { From cc7bf6b4fa2fdee9942a3e1922a79f695c360f37 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 21:11:55 -0500 Subject: [PATCH 170/638] more unicode fixes --- file_path_special.c | 22 ++++++++++++++++------ gfx/common/win32_common.cpp | 8 +++++--- input/drivers_joypad/dinput_joypad.c | 9 +++++---- input/drivers_joypad/xinput_joypad.c | 1 + input/input_remote.c | 1 + libretro-common/file/retro_dirent.c | 6 ++++-- libretro-common/streams/file_stream.c | 18 +++++++++--------- 7 files changed, 41 insertions(+), 24 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index c4012acb64..32d1ac8be0 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -15,6 +15,8 @@ #ifdef _WIN32 +#include +#include #include #else #include @@ -207,9 +209,7 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; -#ifdef UNICODE - wchar_t ws[PATH_MAX_LENGTH] = {0}; -#endif + LPTSTR ws = (LPTSTR)calloc(len, sizeof(TCHAR)); #endif #ifdef __HAIKU__ image_info info; @@ -218,16 +218,26 @@ void fill_pathname_application_path(char *s, size_t len) (void)i; if (!len) + { +#ifdef _WIN32 + if (ws) + free(ws); +#endif return; + } #ifdef _WIN32 + ret = GetModuleFileName(GetModuleHandle(NULL), ws, len - 1); + memset(s, 0, len); #ifdef UNICODE - MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); + utf16_to_char_string(ws, s, len); #else - ret = GetModuleFileName(GetModuleHandle(NULL), s, len - 1); + memcpy(s, ws, len); #endif + if (ws) + free(ws); + s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 3d4bda7462..a708d36c34 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -13,6 +13,7 @@ * If not, see . */ +#include #include #include @@ -719,15 +720,16 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, } else { - char dev_name[CCHDEVICENAME] = {0}; + WCHAR_TO_CHAR_ALLOC(current_mon->szDevice, dev_name) *style = WS_POPUP | WS_VISIBLE; - utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); - if (!win32_monitor_set_fullscreen(*width, *height, refresh, dev_name)) {} + if (dev_name) + free(dev_name); + /* Display settings might have changed, get new coordinates. */ GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)current_mon); *mon_rect = current_mon->rcMonitor; diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 40d542bcc9..8617310477 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -152,17 +153,17 @@ static bool guid_is_xinput_device(const GUID* product_guid) for (i = 0; i < num_raw_devs; i++) { RID_DEVICE_INFO rdi; - char devName[128] = {0}; + TCHAR devName[128] = {0}; UINT rdiSize = sizeof(rdi); UINT nameSize = sizeof(devName); rdi.cbSize = sizeof (rdi); if ((raw_devs[i].dwType == RIM_TYPEHID) && - (GetRawInputDeviceInfoA(raw_devs[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) && + (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) && (MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == ((LONG)product_guid->Data1)) && - (GetRawInputDeviceInfoA(raw_devs[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) && - (strstr(devName, "IG_") != NULL) ) + (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) && + (_tcsstr(devName, TEXT("IG_")) != NULL) ) { free(raw_devs); raw_devs = NULL; diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 8959b027ac..8ffb4ef8ce 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -26,6 +26,7 @@ #include #include +#include #include #include #include diff --git a/input/input_remote.c b/input/input_remote.c index 5523e24dd3..5d27734ed7 100644 --- a/input/input_remote.c +++ b/input/input_remote.c @@ -20,6 +20,7 @@ #include #ifdef _WIN32 +#include #include #else #include diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 4a9a02aeca..eb6cc45adc 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -103,11 +103,13 @@ int retro_readdir(struct RDIR *rdir) const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) - memset(rdir->path, 0, sizeof(rdir->path)); #ifdef UNICODE + memset(rdir->path, 0, sizeof(rdir->path)); utf16_to_char_string((const uint16_t*)rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); -#endif return rdir->path; +#else + return rdir->entry.cFileName; +#endif #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; #else diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index dfa2ef1a96..f88131389a 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -76,10 +76,10 @@ struct RFILE #define HAVE_BUFFERED_IO 1 #ifdef _WIN32 -#define MODE_STR_READ L"r" -#define MODE_STR_READ_UNBUF L"rb" -#define MODE_STR_WRITE_UNBUF L"wb" -#define MODE_STR_WRITE_PLUS L"w+" +#define MODE_STR_READ TEXT("r") +#define MODE_STR_READ_UNBUF TEXT("rb") +#define MODE_STR_WRITE_UNBUF TEXT("wb") +#define MODE_STR_WRITE_PLUS TEXT("w+") #else #define MODE_STR_READ "r" #define MODE_STR_READ_UNBUF "rb" @@ -116,10 +116,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) int mode_int = 0; #if defined(HAVE_BUFFERED_IO) #ifdef _WIN32 - const wchar_t *mode_str = NULL; - wchar_t path_wide[PATH_MAX_LENGTH] = {0}; -#else - const char *mode_str = NULL; + const TCHAR *mode_str = NULL; #endif #endif RFILE *stream = (RFILE*)calloc(1, sizeof(*stream)); @@ -212,8 +209,11 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) { #ifdef _WIN32 - MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + CHAR_TO_WCHAR_ALLOC(path, path_wide) stream->fp = _wfopen(path_wide, mode_str); + + if (path_wide) + free(path_wide); #else stream->fp = fopen(path, mode_str); #endif From 077d5440ee1eed0e9fcede4ee92f3f4a67de3b7a Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 21:16:15 -0500 Subject: [PATCH 171/638] Allow Netplay to receive a struct netplay_host to connect to rather than using the configured setting --- command.c | 2 +- network/netplay/netplay.c | 66 +++++++++++++++++++++++++-------------- network/netplay/netplay.h | 5 +-- 3 files changed, 47 insertions(+), 26 deletions(-) diff --git a/command.c b/command.c index 0c0de6aa83..c660640118 100644 --- a/command.c +++ b/command.c @@ -2359,7 +2359,7 @@ bool command_event(enum event_command cmd, void *data) command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); #ifdef HAVE_NETWORKING if (!init_netplay( - settings->netplay.is_spectate, settings->netplay.server, + settings->netplay.is_spectate, data, settings->netplay.server, settings->netplay.port)) return false; #endif diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index 8c0e25270e..f3dd7c0e56 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -30,6 +30,7 @@ #include #include "netplay_private.h" +#include "netplay_discovery.h" #include "../../autosave.h" #include "../../configuration.h" @@ -117,8 +118,8 @@ end: return fd; } -static bool init_tcp_socket(netplay_t *netplay, const char *server, - uint16_t port, bool spectate) +static bool init_tcp_socket(netplay_t *netplay, void *direct_host, + const char *server, uint16_t port, bool spectate) { char port_buf[16]; bool ret = false; @@ -128,25 +129,41 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, port_buf[0] = '\0'; + if (!direct_host) + { #ifdef AF_INET6 - if (!server) - hints.ai_family = AF_INET6; + if (!server) + hints.ai_family = AF_INET6; #endif - hints.ai_socktype = SOCK_STREAM; - if (!server) - hints.ai_flags = AI_PASSIVE; + hints.ai_socktype = SOCK_STREAM; + if (!server) + hints.ai_flags = AI_PASSIVE; - snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port); - if (getaddrinfo_retro(server, port_buf, &hints, &res) < 0) - return false; + snprintf(port_buf, sizeof(port_buf), "%hu", (unsigned short)port); + if (getaddrinfo_retro(server, port_buf, &hints, &res) < 0) + return false; - if (!res) - return false; + if (!res) + return false; + + } + else + { + /* I'll build my own addrinfo! With blackjack and hookers! */ + struct netplay_host *host = (struct netplay_host *) direct_host; + hints.ai_family = host->addr.sa_family; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; + hints.ai_addrlen = host->addrlen; + hints.ai_addr = &host->addr; + res = &hints; + + } /* If we're serving on IPv6, make sure we accept all connections, including * IPv4 */ #ifdef AF_INET6 - if (!server && res->ai_family == AF_INET6) + if (!direct_host && !server && res->ai_family == AF_INET6) { struct sockaddr_in6 *sin6 = (struct sockaddr_in6 *) res->ai_addr; sin6->sin6_addr = in6addr_any; @@ -161,7 +178,7 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, { int fd = init_tcp_connection( tmp_info, - server, + direct_host || server, netplay->spectate.enabled, (struct sockaddr*)&netplay->other_addr, sizeof(netplay->other_addr)); @@ -176,7 +193,7 @@ static bool init_tcp_socket(netplay_t *netplay, const char *server, tmp_info = tmp_info->ai_next; } - if (res) + if (res && !direct_host) freeaddrinfo_retro(res); if (!ret) @@ -201,12 +218,12 @@ static void init_nat_traversal(netplay_t *netplay) announce_nat_traversal(netplay); } -static bool init_socket(netplay_t *netplay, const char *server, uint16_t port) +static bool init_socket(netplay_t *netplay, void *direct_host, const char *server, uint16_t port) { if (!network_init()) return false; - if (!init_tcp_socket(netplay, server, port, netplay->spectate.enabled)) + if (!init_tcp_socket(netplay, direct_host, server, port, netplay->spectate.enabled)) return false; if (netplay->is_server && netplay->nat_traversal) @@ -236,7 +253,7 @@ static void hangup(netplay_t *netplay) if (netplay->is_server && !netplay->spectate.enabled) { /* In server mode, make the socket listen for a new connection */ - if (!init_socket(netplay, NULL, netplay->tcp_port)) + if (!init_socket(netplay, NULL, NULL, netplay->tcp_port)) { RARCH_WARN("Failed to reinitialize Netplay.\n"); runloop_msg_queue_push("Failed to reinitialize Netplay.", 0, 480, false); @@ -1206,6 +1223,7 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) /** * netplay_new: + * @direct_host : Netplay host discovered from scanning. * @server : IP address of server. * @port : Port of server. * @delay_frames : Amount of delay frames. @@ -1221,9 +1239,10 @@ static bool netplay_init_buffers(netplay_t *netplay, unsigned frames) * * Returns: new netplay handle. **/ -netplay_t *netplay_new(const char *server, uint16_t port, unsigned delay_frames, - unsigned check_frames, const struct retro_callbacks *cb, bool spectate, - bool nat_traversal, const char *nick, uint64_t quirks) +netplay_t *netplay_new(void *direct_host, const char *server, uint16_t port, + unsigned delay_frames, unsigned check_frames, + const struct retro_callbacks *cb, bool spectate, bool nat_traversal, + const char *nick, uint64_t quirks) { netplay_t *netplay = (netplay_t*)calloc(1, sizeof(*netplay)); if (!netplay) @@ -1253,7 +1272,7 @@ netplay_t *netplay_new(const char *server, uint16_t port, unsigned delay_frames, else netplay->net_cbs = netplay_get_cbs_net(); - if (!init_socket(netplay, server, port)) + if (!init_socket(netplay, direct_host, server, port)) { free(netplay); return NULL; @@ -1610,7 +1629,7 @@ void deinit_netplay(void) * Returns: true (1) if successful, otherwise false (0). **/ -bool init_netplay(bool is_spectate, const char *server, unsigned port) +bool init_netplay(bool is_spectate, void *direct_host, const char *server, unsigned port) { struct retro_callbacks cbs = {0}; settings_t *settings = config_get_ptr(); @@ -1660,6 +1679,7 @@ bool init_netplay(bool is_spectate, const char *server, unsigned port) } netplay_data = (netplay_t*)netplay_new( + netplay_is_client ? direct_host : NULL, netplay_is_client ? server : NULL, port ? port : RARCH_DEFAULT_PORT, settings->netplay.delay_frames, settings->netplay.check_frames, &cbs, diff --git a/network/netplay/netplay.h b/network/netplay/netplay.h index 5793efae1f..69fce43df8 100644 --- a/network/netplay/netplay.h +++ b/network/netplay/netplay.h @@ -132,6 +132,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); /** * netplay_new: + * @direct_host : Netplay host discovered from scanning. * @server : IP address of server. * @port : Port of server. * @delay_frames : Amount of delay frames. @@ -147,7 +148,7 @@ size_t audio_sample_batch_net(const int16_t *data, size_t frames); * * Returns: new netplay handle. **/ -netplay_t *netplay_new(const char *server, +netplay_t *netplay_new(void *direct_host, const char *server, uint16_t port, unsigned delay_frames, unsigned check_frames, const struct retro_callbacks *cb, bool spectate, bool nat_traversal, const char *nick, uint64_t quirks); @@ -223,7 +224,7 @@ bool netplay_disconnect(netplay_t *netplay); * * Returns: true (1) if successful, otherwise false (0). **/ -bool init_netplay(bool is_spectate, const char *server, unsigned port); +bool init_netplay(bool is_spectate, void *direct_host, const char *server, unsigned port); void deinit_netplay(void); From fcf09f10efabe9591e3e86fe28a0d7e02104534d Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 22:12:00 -0500 Subject: [PATCH 172/638] more unicode fixes --- libretro-common/dynamic/dylib.c | 5 ++++- libretro-common/file/retro_stat.c | 10 ++++++++++ libretro-common/streams/file_stream.c | 3 ++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index d73172ed1e..154a5458ed 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -76,7 +76,9 @@ dylib_t dylib_load(const char *path) lib = LoadLibrary(path_wide); - free(path_wide); + if (path_wide) + free(path_wide); + SetErrorMode(prevmode); if (!lib) @@ -84,6 +86,7 @@ dylib_t dylib_load(const char *path) set_dl_error(); return NULL; } + last_dyn_error[0] = 0; #else dylib_t lib = dlopen(path, RTLD_LAZY); diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index e918956f3b..a8b1282a1f 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #if defined(_WIN32) @@ -196,7 +197,16 @@ bool mkdir_norecurse(const char *dir) { int ret; #if defined(_WIN32) +#ifdef _MSC_VER + CHAR_TO_WCHAR_ALLOC(dir, dir_wide) + + ret = _tmkdir(dir_wide); + + if (dir_wide) + free(dir_wide); +#else ret = _mkdir(dir); +#endif #elif defined(IOS) ret = mkdir(dir, 0755); #elif defined(VITA) || defined(PSP) diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index f88131389a..531a4e91f5 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -27,6 +27,7 @@ #if defined(_WIN32) #include +#include # ifdef _MSC_VER # define setmode _setmode # endif @@ -210,7 +211,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) { #ifdef _WIN32 CHAR_TO_WCHAR_ALLOC(path, path_wide) - stream->fp = _wfopen(path_wide, mode_str); + stream->fp = _tfopen(path_wide, mode_str); if (path_wide) free(path_wide); From 0577749fae4b73e860b1dcbc912e950d7fc5323f Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:40:26 -0500 Subject: [PATCH 173/638] Netplay LAN scanning is go! (sort of) --- intl/msg_hash_us.h | 10 +++++- menu/cbs/menu_cbs_deferred_push.c | 11 ++++++ menu/cbs/menu_cbs_ok.c | 55 +++++++++++++++++++++++++++++ menu/cbs/menu_cbs_sublabel.c | 4 +++ menu/cbs/menu_cbs_title.c | 7 ++++ menu/menu_cbs.h | 1 + menu/menu_displaylist.c | 51 ++++++++++++++++++++++++++ menu/menu_displaylist.h | 1 + menu/menu_setting.c | 8 +++++ msg_hash.h | 3 ++ network/netplay/netplay.c | 2 +- network/netplay/netplay_discovery.c | 8 ++++- network/netplay/netplay_net.c | 13 ------- network/netplay/netplay_private.h | 1 + tasks/task_netplay_lan_scan.c | 10 +++--- 15 files changed, 165 insertions(+), 20 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index fc371ca9c1..fa082796d7 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -916,6 +916,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_ENABLE_HOST, "Start hosting") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_IP_ADDRESS, "Server Address") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS, + "Scan local network") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_MODE, "Netplay Client Enable") MSG_HASH(MENU_ENUM_LABEL_VALUE_NETPLAY_NICKNAME, @@ -1682,6 +1684,8 @@ MSG_HASH(MENU_ENUM_SUBLABEL_LOG_VERBOSITY, "Enable or disable logging to the terminal.") MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY, "Join or host a netplay session.") +MSG_HASH(MENU_ENUM_SUBLABEL_NETPLAY_LAN_SCAN_SETTINGS, + "Search for and connect to netplay hosts on the local network.") MSG_HASH(MENU_ENUM_SUBLABEL_INFORMATION_LIST_LIST, "Display information for core, network, and system.\nDisplay manager for database and cursor.") MSG_HASH(MENU_ENUM_SUBLABEL_ONLINE_UPDATER, @@ -2246,4 +2250,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_DATABASE_CURSOR_LIST_ENTRY_DATABASE_INFO, MSG_HASH(MSG_WIFI_SCAN_COMPLETE, "Wi-Fi scan complete.") MSG_HASH(MSG_SCANNING_WIRELESS_NETWORKS, - "Scanning wireless networks...") \ No newline at end of file + "Scanning wireless networks...") +MSG_HASH(MSG_NETPLAY_LAN_SCAN_COMPLETE, + "Netplay scan complete.") +MSG_HASH(MSG_NETPLAY_LAN_SCANNING, + "Scanning for netplay hosts...") diff --git a/menu/cbs/menu_cbs_deferred_push.c b/menu/cbs/menu_cbs_deferred_push.c index 61cff95e54..299108bfec 100644 --- a/menu/cbs/menu_cbs_deferred_push.c +++ b/menu/cbs/menu_cbs_deferred_push.c @@ -190,6 +190,11 @@ static int deferred_push_network_settings_list(menu_displaylist_info_t *info) return deferred_push_dlist(info, DISPLAYLIST_NETWORK_SETTINGS_LIST); } +static int deferred_push_netplay_lan_scan_settings_list(menu_displaylist_info_t *info) +{ + return deferred_push_dlist(info, DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST); +} + static int deferred_push_lakka_services_list(menu_displaylist_info_t *info) { return deferred_push_dlist(info, DISPLAYLIST_LAKKA_SERVICES_LIST); @@ -792,6 +797,12 @@ static int menu_cbs_init_bind_deferred_push_compare_label( return 0; } + if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST))) + { + BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_netplay_lan_scan_settings_list); + return 0; + } + if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST))) { BIND_ACTION_DEFERRED_PUSH(cbs, deferred_push_lakka_services_list); diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index 1d3a749b41..ee1f338e25 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -53,6 +53,7 @@ #ifdef HAVE_NETWORKING #include "../../network/netplay/netplay.h" +#include "../../network/netplay/netplay_discovery.h" #endif typedef struct @@ -754,6 +755,14 @@ int generic_action_ok_displaylist_push(const char *path, info.enum_idx = MENU_ENUM_LABEL_DEFERRED_WIFI_SETTINGS_LIST; dl_type = DISPLAYLIST_GENERIC; break; + case ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST: + info.directory_ptr = idx; + info.type = type; + info_path = path; + info_label = msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST); + info.enum_idx = MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST; + dl_type = DISPLAYLIST_GENERIC; + break; case ACTION_OK_DL_LAKKA_SERVICES_LIST: info.directory_ptr = idx; info.type = type; @@ -2927,6 +2936,13 @@ static int action_ok_network_list(const char *path, entry_idx, ACTION_OK_DL_NETWORK_SETTINGS_LIST); } +static int action_ok_netplay_lan_scan_list(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + return generic_action_ok_displaylist_push(path, NULL, label, type, idx, + entry_idx, ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST); +} + static int action_ok_lakka_services(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -2979,6 +2995,39 @@ static int action_ok_wifi(const char *path, return 0; } +static int action_ok_netplay_lan_scan(const char *path, + const char *label, unsigned type, size_t idx, size_t entry_idx) +{ + struct netplay_host_list *hosts; + struct netplay_host *host; + bool netplay_was_on = false; + + /* Figure out what host we're connecting to */ + if (!netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &hosts)) + return -1; + if (entry_idx >= hosts->size) + return -1; + host = &hosts->hosts[entry_idx]; + + /* Enable Netplay client mode */ + if (netplay_driver_ctl(RARCH_NETPLAY_CTL_IS_DATA_INITED, NULL)) + { + netplay_was_on = true; + command_event(CMD_EVENT_NETPLAY_DEINIT, NULL); + } + netplay_driver_ctl(RARCH_NETPLAY_CTL_ENABLE_CLIENT, NULL); + + /* Enable Netplay */ + if (!command_event(CMD_EVENT_NETPLAY_INIT, (void *) host)) + return -1; + + /* And make sure we use its callbacks */ + if (!netplay_was_on && !core_set_netplay_callbacks()) + return -1; + + return generic_action_ok_command(CMD_EVENT_RESUME); +} + static int action_ok_content_collection_list(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { @@ -3829,6 +3878,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_NETWORK_SETTINGS: BIND_ACTION_OK(cbs, action_ok_network_list); break; + case MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS: + BIND_ACTION_OK(cbs, action_ok_netplay_lan_scan_list); + break; case MENU_ENUM_LABEL_LAKKA_SERVICES: BIND_ACTION_OK(cbs, action_ok_lakka_services); break; @@ -4154,6 +4206,9 @@ static int menu_cbs_init_bind_ok_compare_type(menu_file_list_cbs_t *cbs, case MENU_WIFI: BIND_ACTION_OK(cbs, action_ok_wifi); break; + case MENU_NETPLAY_LAN_SCAN: + BIND_ACTION_OK(cbs, action_ok_netplay_lan_scan); + break; case FILE_TYPE_CURSOR: switch (menu_label_hash) { diff --git a/menu/cbs/menu_cbs_sublabel.c b/menu/cbs/menu_cbs_sublabel.c index f6ba1bb147..2ad8fa27cb 100644 --- a/menu/cbs/menu_cbs_sublabel.c +++ b/menu/cbs/menu_cbs_sublabel.c @@ -58,6 +58,7 @@ default_sublabel_macro(action_bind_sublabel_video_window_scale, MENU_ default_sublabel_macro(action_bind_sublabel_audio_settings_list, MENU_ENUM_SUBLABEL_AUDIO_SETTINGS) default_sublabel_macro(action_bind_sublabel_input_settings_list, MENU_ENUM_SUBLABEL_INPUT_SETTINGS) default_sublabel_macro(action_bind_sublabel_wifi_settings_list, MENU_ENUM_SUBLABEL_WIFI_SETTINGS) +default_sublabel_macro(action_bind_sublabel_netplay_lan_scan_settings_list,MENU_ENUM_SUBLABEL_NETPLAY_LAN_SCAN_SETTINGS) default_sublabel_macro(action_bind_sublabel_help_list, MENU_ENUM_SUBLABEL_HELP_LIST) default_sublabel_macro(action_bind_sublabel_services_settings_list, MENU_ENUM_SUBLABEL_SERVICES_SETTINGS) default_sublabel_macro(action_bind_sublabel_ssh_enable, MENU_ENUM_SUBLABEL_SSH_ENABLE) @@ -351,6 +352,9 @@ int menu_cbs_init_bind_sublabel(menu_file_list_cbs_t *cbs, case MENU_ENUM_LABEL_WIFI_SETTINGS: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_wifi_settings_list); break; + case MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS: + BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_netplay_lan_scan_settings_list); + break; case MENU_ENUM_LABEL_HELP_LIST: BIND_ACTION_SUBLABEL(cbs, action_bind_sublabel_help_list); break; diff --git a/menu/cbs/menu_cbs_title.c b/menu/cbs/menu_cbs_title.c index 55e2fff822..ed69c9907c 100644 --- a/menu/cbs/menu_cbs_title.c +++ b/menu/cbs/menu_cbs_title.c @@ -118,6 +118,7 @@ default_title_macro(action_get_menu_file_browser_settings_list, MENU_ENUM_LABEL_ default_title_macro(action_get_retro_achievements_settings_list,MENU_ENUM_LABEL_VALUE_RETRO_ACHIEVEMENTS_SETTINGS) default_title_macro(action_get_wifi_settings_list, MENU_ENUM_LABEL_VALUE_WIFI_SETTINGS) default_title_macro(action_get_network_settings_list, MENU_ENUM_LABEL_VALUE_NETWORK_SETTINGS) +default_title_macro(action_get_netplay_lan_scan_settings_list, MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS) default_title_macro(action_get_lakka_services_list, MENU_ENUM_LABEL_VALUE_LAKKA_SERVICES) default_title_macro(action_get_user_settings_list, MENU_ENUM_LABEL_VALUE_USER_SETTINGS) default_title_macro(action_get_directory_settings_list, MENU_ENUM_LABEL_VALUE_DIRECTORY_SETTINGS) @@ -403,6 +404,12 @@ static int menu_cbs_init_bind_title_compare_label(menu_file_list_cbs_t *cbs, return 0; } + if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST))) + { + BIND_ACTION_GET_TITLE(cbs, action_get_netplay_lan_scan_settings_list); + return 0; + } + if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_LAKKA_SERVICES_LIST))) { BIND_ACTION_GET_TITLE(cbs, action_get_lakka_services_list); diff --git a/menu/menu_cbs.h b/menu/menu_cbs.h index 84668a78d6..7f9ac751c3 100644 --- a/menu/menu_cbs.h +++ b/menu/menu_cbs.h @@ -93,6 +93,7 @@ enum ACTION_OK_DL_UPDATER_SETTINGS_LIST, ACTION_OK_DL_WIFI_SETTINGS_LIST, ACTION_OK_DL_NETWORK_SETTINGS_LIST, + ACTION_OK_DL_NETPLAY_LAN_SCAN_SETTINGS_LIST, ACTION_OK_DL_LAKKA_SERVICES_LIST, ACTION_OK_DL_USER_SETTINGS_LIST, ACTION_OK_DL_DIRECTORY_SETTINGS_LIST, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index d32345c235..eaf879c887 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -40,6 +40,10 @@ #include "../cheevos.h" #endif +#ifdef HAVE_NETWORKING +#include "../network/netplay/netplay_discovery.h" +#endif + #ifdef __linux__ #include "../frontend/drivers/platform_linux.h" #endif @@ -4216,6 +4220,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) case DISPLAYLIST_UPDATER_SETTINGS_LIST: case DISPLAYLIST_WIFI_SETTINGS_LIST: case DISPLAYLIST_NETWORK_SETTINGS_LIST: + case DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST: case DISPLAYLIST_LAKKA_SERVICES_LIST: case DISPLAYLIST_USER_SETTINGS_LIST: case DISPLAYLIST_DIRECTORY_SETTINGS_LIST: @@ -5008,6 +5013,50 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) 0, 0, 0); } + info->need_refresh = true; + info->need_push = true; + break; + case DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST: +#ifdef HAVE_NETWORKING + { + struct netplay_host_list *hosts; + + if (!netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, &hosts)) + hosts = NULL; + + if (!hosts || hosts->size == 0) + { + if (!hosts) + task_push_netplay_lan_scan(); + + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), + MENU_ENUM_LABEL_NO_NETWORKS_FOUND, + 0, 0, 0); + } + else + { + size_t i; + for (i = 0; i < hosts->size; i++) + { + struct netplay_host *host = &hosts->hosts[i]; + menu_entries_append_enum(info->list, + host->nick, + msg_hash_to_str(MENU_ENUM_LABEL_CONNECT_NETPLAY_LAN), + MENU_ENUM_LABEL_CONNECT_NETPLAY_LAN, + MENU_NETPLAY_LAN_SCAN, 0, 0); + } + } + } +#else + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), + MENU_ENUM_LABEL_NO_NETWORKS_FOUND, + 0, 0, 0); +#endif + info->need_refresh = true; info->need_push = true; break; @@ -5418,6 +5467,8 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) MENU_ENUM_LABEL_WIFI_SETTINGS, PARSE_ACTION, false); ret = menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_NETWORK_SETTINGS, PARSE_ACTION, false); + ret = menu_displaylist_parse_settings_enum(menu, info, + MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS, PARSE_ACTION, false); ret = menu_displaylist_parse_settings_enum(menu, info, MENU_ENUM_LABEL_LAKKA_SERVICES, PARSE_ACTION, false); ret = menu_displaylist_parse_settings_enum(menu, info, diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index 2248148abb..d03324acea 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -128,6 +128,7 @@ enum menu_displaylist_ctl_state DISPLAYLIST_UPDATER_SETTINGS_LIST, DISPLAYLIST_WIFI_SETTINGS_LIST, DISPLAYLIST_NETWORK_SETTINGS_LIST, + DISPLAYLIST_NETPLAY_LAN_SCAN_SETTINGS_LIST, DISPLAYLIST_LAKKA_SERVICES_LIST, DISPLAYLIST_USER_SETTINGS_LIST, DISPLAYLIST_DIRECTORY_SETTINGS_LIST, diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 2a399079d3..67fb41412d 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2560,6 +2560,14 @@ static bool setting_append_list( &subgroup_info, parent_group); + CONFIG_ACTION( + list, list_info, + MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS, + MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS, + &group_info, + &subgroup_info, + parent_group); + #ifdef HAVE_LAKKA CONFIG_ACTION( list, list_info, diff --git a/msg_hash.h b/msg_hash.h index 13989391bc..5a5494c483 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -141,6 +141,7 @@ enum msg_hash_enums MSG_NETPLAY_USERS_HAS_FLIPPED, MSG_UNKNOWN_NETPLAY_COMMAND_RECEIVED, MSG_CONNECTING_TO_NETPLAY_HOST, + MSG_NETPLAY_LAN_SCAN_COMPLETE, MSG_NETPLAY_LAN_SCANNING, MSG_WAITING_FOR_CLIENT, MSG_AUTODETECT, @@ -714,8 +715,10 @@ enum msg_hash_enums MENU_LABEL(DIRECTORY_SETTINGS), MENU_LABEL(PRIVACY_SETTINGS), MENU_LABEL(NETWORK_SETTINGS), + MENU_LABEL(NETPLAY_LAN_SCAN_SETTINGS), MENU_ENUM_LABEL_CONNECT_WIFI, + MENU_ENUM_LABEL_CONNECT_NETPLAY_LAN, MENU_LABEL(MENU_ENUM_LINEAR_FILTER), MENU_LABEL(MENU_ENUM_THROTTLE_FRAMERATE), diff --git a/network/netplay/netplay.c b/network/netplay/netplay.c index f3dd7c0e56..905d340fc8 100644 --- a/network/netplay/netplay.c +++ b/network/netplay/netplay.c @@ -1259,7 +1259,7 @@ netplay_t *netplay_new(void *direct_host, const char *server, uint16_t port, netplay->check_frames = check_frames; netplay->quirks = quirks; - strlcpy(netplay->nick, nick, sizeof(netplay->nick)); + strlcpy(netplay->nick, nick[0] ? nick : RARCH_DEFAULT_NICK, sizeof(netplay->nick)); if (!netplay_init_buffers(netplay, delay_frames)) { diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 6ac8062d81..61122e58bb 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -116,12 +116,18 @@ bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, case RARCH_NETPLAY_DISCOVERY_CTL_LAN_SEND_QUERY: { struct addrinfo hints = {0}, *addr; + int canBroadcast = 1; /* Get the broadcast address (IPv4 only for now) */ snprintf(port_str, 6, "%hu", RARCH_DEFAULT_PORT); if (getaddrinfo_retro("255.255.255.255", port_str, &hints, &addr) < 0) return false; + /* Make it broadcastable */ +#if defined(SOL_SOCKET) && defined(SO_BROADCAST) + setsockopt(lan_ad_client_fd, SOL_SOCKET, SO_BROADCAST, (void *) &canBroadcast, sizeof(canBroadcast)); +#endif + /* Put together the request */ memcpy((void *) &ad_packet_buffer, "RANQ", 4); ad_packet_buffer.protocol_version = htonl(NETPLAY_PROTOCOL_VERSION); @@ -298,7 +304,7 @@ bool netplay_lan_ad_client(void) if (their_addr.sa_family == AF_INET) { struct sockaddr_in *sin = (struct sockaddr_in *) &their_addr; - sin->sin_port = htons(ad_packet_buffer.port); + sin->sin_port = htons(ntohl(ad_packet_buffer.port)); } #ifdef AF_INET6 diff --git a/network/netplay/netplay_net.c b/network/netplay/netplay_net.c index 51a3535e97..a9472ef039 100644 --- a/network/netplay/netplay_net.c +++ b/network/netplay/netplay_net.c @@ -338,19 +338,6 @@ static bool netplay_net_info_cb(netplay_t* netplay, unsigned frames) netplay->has_connection = true; } - { - struct natt_status status; - natt_init(); - if (natt_new(&status) && natt_open_port_any(&status, netplay->tcp_port, SOCKET_PROTOCOL_TCP)) - { - fprintf(stderr, "Forwarded to %d!\n", status.ext_inet4_addr.sin_port); - } - else - { - fprintf(stderr, "Forwarding failed :(\n"); - } - } - return true; } diff --git a/network/netplay/netplay_private.h b/network/netplay/netplay_private.h index 3b72e52160..e8bf108da7 100644 --- a/network/netplay/netplay_private.h +++ b/network/netplay/netplay_private.h @@ -37,6 +37,7 @@ #define WORDS_PER_FRAME 4 /* Allows us to send 128 bits worth of state per frame. */ #define MAX_SPECTATORS 16 #define RARCH_DEFAULT_PORT 55435 +#define RARCH_DEFAULT_NICK "Anonymous" #define NETPLAY_PROTOCOL_VERSION 3 diff --git a/tasks/task_netplay_lan_scan.c b/tasks/task_netplay_lan_scan.c index cd2462d58f..8844b78f54 100644 --- a/tasks/task_netplay_lan_scan.c +++ b/tasks/task_netplay_lan_scan.c @@ -39,12 +39,14 @@ static void netplay_lan_scan_callback(void *task_data, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_NETPLAY_LAN_SCAN_SETTINGS_LIST))) return; - file_list = menu_entries_get_selection_buf_ptr(0); - - menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); - if (netplay_discovery_driver_ctl(RARCH_NETPLAY_DISCOVERY_CTL_LAN_GET_RESPONSES, (void *) &netplay_hosts)) { + if (netplay_hosts->size > 0) + { + file_list = menu_entries_get_selection_buf_ptr(0); + menu_entries_ctl(MENU_ENTRIES_CTL_CLEAR, file_list); + } + for (i = 0; i < netplay_hosts->size; i++) { struct netplay_host *host = &netplay_hosts->hosts[i]; From b4ec66e34afa3b1793e22234998b7d75d9a8732c Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:42:29 -0500 Subject: [PATCH 174/638] Move local network scanning out of settings and into Netplay --- menu/menu_displaylist.c | 4 ++++ menu/menu_setting.c | 8 -------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index eaf879c887..ae67b10f87 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -1564,6 +1564,10 @@ static int menu_displaylist_parse_netplay( msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_SETTINGS), MENU_ENUM_LABEL_NETWORK_SETTINGS, MENU_SETTING_GROUP, 0, 0); + menu_entries_append_enum(info->list, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS), + msg_hash_to_str(MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS), + MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS, MENU_SETTING_GROUP, 0, 0); #else menu_entries_append_enum(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_ITEMS), diff --git a/menu/menu_setting.c b/menu/menu_setting.c index 67fb41412d..2a399079d3 100644 --- a/menu/menu_setting.c +++ b/menu/menu_setting.c @@ -2560,14 +2560,6 @@ static bool setting_append_list( &subgroup_info, parent_group); - CONFIG_ACTION( - list, list_info, - MENU_ENUM_LABEL_NETPLAY_LAN_SCAN_SETTINGS, - MENU_ENUM_LABEL_VALUE_NETPLAY_LAN_SCAN_SETTINGS, - &group_info, - &subgroup_info, - parent_group); - #ifdef HAVE_LAKKA CONFIG_ACTION( list, list_info, From 1f281beea2348ddc6e67b5e2cde4dca40c0de544 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:49:56 -0500 Subject: [PATCH 175/638] Replace "no networks found" message with "no netplay hosts found" --- intl/msg_hash_us.h | 2 ++ menu/menu_displaylist.c | 12 ++++++------ msg_hash.h | 1 + 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index fa082796d7..3756fe6e88 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -966,6 +966,8 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_INFORMATION_AVAILABLE, "No information is available.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_ITEMS, "No items.") +MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_NETPLAY_HOSTS_FOUND, + "No netplay hosts found.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND, "No networks found.") MSG_HASH(MENU_ENUM_LABEL_VALUE_NO_PERFORMANCE_COUNTERS, diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index ae67b10f87..24ffc54d67 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -5034,9 +5034,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) task_push_netplay_lan_scan(); menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), - msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), - MENU_ENUM_LABEL_NO_NETWORKS_FOUND, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETPLAY_HOSTS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETPLAY_HOSTS_FOUND), + MENU_ENUM_LABEL_NO_NETPLAY_HOSTS_FOUND, 0, 0, 0); } else @@ -5055,9 +5055,9 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } #else menu_entries_append_enum(info->list, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETWORKS_FOUND), - msg_hash_to_str(MENU_ENUM_LABEL_NO_NETWORKS_FOUND), - MENU_ENUM_LABEL_NO_NETWORKS_FOUND, + msg_hash_to_str(MENU_ENUM_LABEL_VALUE_NO_NETPLAY_HOSTS_FOUND), + msg_hash_to_str(MENU_ENUM_LABEL_NO_NETPLAY_HOSTS_FOUND), + MENU_ENUM_LABEL_NO_NETPLAY_HOSTS_FOUND, 0, 0, 0); #endif diff --git a/msg_hash.h b/msg_hash.h index 5a5494c483..11de0792c2 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -881,6 +881,7 @@ enum msg_hash_enums MENU_LABEL(NETPLAY_DISCONNECT), MENU_LABEL(NETPLAY_SETTINGS), MENU_LABEL(NETPLAY_CONNECT_TO), + MENU_LABEL(NO_NETPLAY_HOSTS_FOUND), MENU_ENUM_LABEL_RESET, MENU_ENUM_LABEL_SLOWMOTION, From c9edc87d4a4cb5629f0ab7034cd315e2c7075feb Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:52:19 -0500 Subject: [PATCH 176/638] Add NO_NETPLAY_HOSTS_FOUND to labels as well. --- intl/msg_hash_lbl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index ba73b123d8..4ea1c0930b 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -624,6 +624,8 @@ MSG_HASH(MENU_ENUM_LABEL_NO_HISTORY_AVAILABLE, "no_history") MSG_HASH(MENU_ENUM_LABEL_NO_ITEMS, "no_items") +MSG_HASH(MENU_ENUM_LABEL_NO_NETPLAY_HOSTS_FOUND, + "no_netplay_hosts_found") MSG_HASH(MENU_ENUM_LABEL_NO_NETWORKS_FOUND, "no_networks_found") MSG_HASH(MENU_ENUM_LABEL_NO_PERFORMANCE_COUNTERS, From 6c516f1de428e5bd929c67a57a9dcbf176425482 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:54:14 -0500 Subject: [PATCH 177/638] Griffin-fying Netplay LAN scanning --- griffin/griffin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/griffin/griffin.c b/griffin/griffin.c index 61d8125798..a7c29a9bc5 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -880,6 +880,7 @@ NETPLAY #include "../network/netplay/netplay_net.c" #include "../network/netplay/netplay_spectate.c" #include "../network/netplay/netplay_common.c" +#include "../network/netplay/netplay_discovery.c" #include "../network/netplay/netplay.c" #include "../libretro-common/net/net_compat.c" #include "../libretro-common/net/net_socket.c" @@ -889,6 +890,7 @@ NETPLAY #include "../libretro-common/net/net_ifinfo.c" #endif #include "../tasks/task_http.c" +#include "../tasks/task_netplay_lan_scan.c" #include "../tasks/task_wifi.c" #endif From 8993003259c79d44b7c5539f78f9345fed7b98c1 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 22:56:37 -0500 Subject: [PATCH 178/638] C++ fixes --- network/netplay/netplay_discovery.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 61122e58bb..3eb5d5e03d 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -288,7 +288,7 @@ bool netplay_lan_ad_client(void) addr_size = sizeof(their_addr); if (recvfrom(lan_ad_client_fd, (char*)&ad_packet_buffer, sizeof(struct ad_packet), 0, &their_addr, &addr_size) >= - sizeof(struct ad_packet)) + (ssize_t) sizeof(struct ad_packet)) { struct netplay_host *host; @@ -327,10 +327,13 @@ bool netplay_lan_ad_client(void) else allocated *= 2; if (discovered_hosts.hosts) - new_hosts = realloc(discovered_hosts.hosts, allocated * sizeof(struct netplay_host)); + new_hosts = (struct netplay_host *) + realloc(discovered_hosts.hosts, allocated * sizeof(struct + netplay_host)); else /* Should be equivalent to realloc, but I don't trust screwy libcs */ - new_hosts = malloc(allocated * sizeof(struct netplay_host)); + new_hosts = (struct netplay_host *) + malloc(allocated * sizeof(struct netplay_host)); if (!new_hosts) return false; From d20acaa63dd91ef30ccd0b06d5f8c175f7fb1cf5 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 23:00:09 -0500 Subject: [PATCH 179/638] more unicode fixes --- input/drivers_joypad/dinput_joypad.c | 8 ++++++++ libretro-common/file/retro_dirent.c | 2 +- libretro-common/file/retro_stat.c | 10 +++++++--- libretro-common/include/encodings/win32.h | 6 +++--- libretro-common/streams/file_stream.c | 2 ++ 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 8617310477..1de46b4a66 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -163,7 +163,15 @@ static bool guid_is_xinput_device(const GUID* product_guid) (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) && (MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == ((LONG)product_guid->Data1)) && (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) && +#ifdef _MSC_VER (_tcsstr(devName, TEXT("IG_")) != NULL) ) +#else +#ifdef UNICODE + (wcsstr((const wchar_t*)devName, L"IG_") != NULL) ) +#else + (strstr(devName, "IG_" != NULL) ) +#endif +#endif { free(raw_devs); raw_devs = NULL; diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index eb6cc45adc..26ed172539 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -47,7 +47,7 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) #ifdef UNICODE snprintf(path_buf, sizeof(path_buf), "%s\\*", name); - MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); + MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW)); rdir->directory = FindFirstFileW(pathW, &rdir->entry); #else rdir->directory = FindFirstFile(path_buf, &rdir->entry); diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index a8b1282a1f..830e309d47 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -197,15 +197,19 @@ bool mkdir_norecurse(const char *dir) { int ret; #if defined(_WIN32) -#ifdef _MSC_VER CHAR_TO_WCHAR_ALLOC(dir, dir_wide) +#ifdef _MSC_VER ret = _tmkdir(dir_wide); +#else +#ifdef UNICODE + ret = _wmkdir(dir_wide); +#else + ret = _mkdir(dir_wide); +#endif if (dir_wide) free(dir_wide); -#else - ret = _mkdir(dir); #endif #elif defined(IOS) ret = mkdir(dir, 0755); diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h index 45e7c9a5c3..bac9fae1cc 100644 --- a/libretro-common/include/encodings/win32.h +++ b/libretro-common/include/encodings/win32.h @@ -25,9 +25,9 @@ #ifndef _XBOX #ifdef _WIN32 -/*#define UNICODE +#define UNICODE #include -#include */ +#include #ifdef __cplusplus extern "C" { @@ -47,7 +47,7 @@ extern "C" { size_t ws##_size = (NULL != s && s[0] ? strlen(s) : 0) + 1; \ wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ if (NULL != s && s[0]) \ - MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size / sizeof(wchar_t)); + MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size); #define WCHAR_TO_CHAR_ALLOC(ws, s) \ size_t s##_size = ((NULL != ws && ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index 531a4e91f5..1b559e9108 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -118,6 +118,8 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #if defined(HAVE_BUFFERED_IO) #ifdef _WIN32 const TCHAR *mode_str = NULL; +#else + const char *mode_str = NULL; #endif #endif RFILE *stream = (RFILE*)calloc(1, sizeof(*stream)); From b69734ce4a876eacb798fc740b158600bdf96fa7 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 23:01:44 -0500 Subject: [PATCH 180/638] more unicode fixes --- libretro-common/file/retro_stat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 830e309d47..e0d53ca792 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -25,10 +25,10 @@ #include #include #include -#include #include #if defined(_WIN32) +#include #ifdef _MSC_VER #define setmode _setmode #endif From 4b2a45a276b756e94a5ca08da36a21d269e3ebc8 Mon Sep 17 00:00:00 2001 From: Twinaphex Date: Sat, 3 Dec 2016 05:07:27 +0100 Subject: [PATCH 181/638] remove unused variables --- network/netplay/netplay_discovery.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 3eb5d5e03d..6a0f58b5a4 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -188,7 +188,6 @@ bool netplay_lan_ad_server(netplay_t *netplay) struct sockaddr their_addr; socklen_t addr_size; rarch_system_info_t *info = NULL; - size_t bufloc; if (lan_ad_server_fd < 0 && !init_lan_ad_server_socket(netplay, RARCH_DEFAULT_PORT)) return false; @@ -268,8 +267,6 @@ bool netplay_lan_ad_client(void) struct timeval tmp_tv = {0}; struct sockaddr their_addr; socklen_t addr_size; - rarch_system_info_t *info = NULL; - size_t bufloc; if (lan_ad_client_fd < 0) return false; From cc664db231511efe055066743c5023804c110466 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 23:08:34 -0500 Subject: [PATCH 182/638] Be explicit about types. --- network/netplay/netplay_discovery.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index 3eb5d5e03d..4f2b99d163 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -119,7 +119,7 @@ bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, int canBroadcast = 1; /* Get the broadcast address (IPv4 only for now) */ - snprintf(port_str, 6, "%hu", RARCH_DEFAULT_PORT); + snprintf(port_str, 6, "%hu", (unsigned short) RARCH_DEFAULT_PORT); if (getaddrinfo_retro("255.255.255.255", port_str, &hints, &addr) < 0) return false; From 3c7fc73735374cbdd78d02021367d69d78757dbf Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Fri, 2 Dec 2016 23:15:53 -0500 Subject: [PATCH 183/638] sendto fix for MSVC --- network/netplay/netplay_discovery.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/network/netplay/netplay_discovery.c b/network/netplay/netplay_discovery.c index cc2a61b956..99c277c4fd 100644 --- a/network/netplay/netplay_discovery.c +++ b/network/netplay/netplay_discovery.c @@ -133,8 +133,8 @@ bool netplay_discovery_driver_ctl(enum rarch_netplay_discovery_ctl_state state, ad_packet_buffer.protocol_version = htonl(NETPLAY_PROTOCOL_VERSION); /* And send it off */ - sendto(lan_ad_client_fd, &ad_packet_buffer, 2*sizeof(uint32_t), 0, - addr->ai_addr, addr->ai_addrlen); + sendto(lan_ad_client_fd, (const char *) &ad_packet_buffer, + 2*sizeof(uint32_t), 0, addr->ai_addr, addr->ai_addrlen); break; } From 634bdee3016a1c8f6313bd389700f2c708854234 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Sat, 3 Dec 2016 00:03:29 -0500 Subject: [PATCH 184/638] Make sure discovery code is properly ifdef'd for networking-less systems --- menu/cbs/menu_cbs_ok.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index ee1f338e25..104113a2fe 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -2998,6 +2998,7 @@ static int action_ok_wifi(const char *path, static int action_ok_netplay_lan_scan(const char *path, const char *label, unsigned type, size_t idx, size_t entry_idx) { +#ifdef HAVE_NETWORKING struct netplay_host_list *hosts; struct netplay_host *host; bool netplay_was_on = false; @@ -3026,6 +3027,10 @@ static int action_ok_netplay_lan_scan(const char *path, return -1; return generic_action_ok_command(CMD_EVENT_RESUME); + +#else + return -1; +#endif } static int action_ok_content_collection_list(const char *path, From 697760d5809715e5bfa50c4cf841be466f758272 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 3 Dec 2016 06:09:55 +0100 Subject: [PATCH 185/638] Silence some warnings --- tasks/task_autodetect.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/task_autodetect.c b/tasks/task_autodetect.c index 5378a3b61f..a1a7622004 100644 --- a/tasks/task_autodetect.c +++ b/tasks/task_autodetect.c @@ -302,7 +302,7 @@ static bool input_autoconfigure_joypad_init(autoconfig_params_t *params) static void input_autoconfigure_connect_handler(retro_task_t *task) { - autoconfig_params_t *params = task ? (autoconfig_params_t*)task->state : NULL; + autoconfig_params_t *params = (autoconfig_params_t*)task->state; if (!params || !input_autoconfigure_joypad_init(params) || string_is_empty(params->name)) { @@ -334,7 +334,7 @@ static void input_autoconfigure_connect_handler(retro_task_t *task) static void input_autoconfigure_disconnect_handler(retro_task_t *task) { - autoconfig_disconnect_t *params = task ? (autoconfig_disconnect_t*)task->state : NULL; + autoconfig_disconnect_t *params = (autoconfig_disconnect_t*)task->state; task->title = strdup(params->msg); task->finished = true; From d36e7700f783fe3383929aac5549b7a013b9459f Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 3 Dec 2016 06:14:57 +0100 Subject: [PATCH 186/638] (input_driver.c) Style nits --- input/input_driver.c | 191 ++++++++++++++++++++++--------------------- 1 file changed, 96 insertions(+), 95 deletions(-) diff --git a/input/input_driver.c b/input/input_driver.c index a3253a5998..1035581b0c 100644 --- a/input/input_driver.c +++ b/input/input_driver.c @@ -596,99 +596,6 @@ void state_tracker_update_input(uint16_t *input1, uint16_t *input2) input_pop_analog_dpad(settings->input.autoconf_binds[i]); } -static INLINE bool input_keys_pressed_internal(unsigned i, - const struct retro_keybind *binds) -{ - if (((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY))) - || !input_driver_block_hotkey)) - { - if (current_input->input_state(current_input_data, &binds, - 0, RETRO_DEVICE_JOYPAD, 0, i)) - return true; - } - - if (i >= RARCH_FIRST_META_KEY) - { - if (current_input->meta_key_pressed(current_input_data, i)) - return true; - } - -#ifdef HAVE_OVERLAY - if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i)) - return true; -#endif - -#ifdef HAVE_COMMAND - if (input_driver_command) - { - command_handle_t handle; - - handle.handle = input_driver_command; - handle.id = i; - - if (command_get(&handle)) - return true; - } -#endif - -#ifdef HAVE_NETWORKGAMEPAD - if (input_driver_remote) - { - if (input_remote_key_pressed(i, 0)) - return true; - } -#endif - - return false; -} - -/** - * input_keys_pressed: - * - * Grab an input sample for this frame. - * - * TODO: In case RARCH_BIND_LIST_END starts exceeding 64, - * and you need a bitmask of more than 64 entries, reimplement - * it to use something like rarch_bits_t. - * - * Returns: Input sample containg a mask of all pressed keys. - */ -uint64_t input_keys_pressed(void) -{ - unsigned i; - uint64_t ret = 0; - settings_t *settings = config_get_ptr(); - const struct retro_keybind *binds = settings->input.binds[0]; - const struct retro_keybind *binds_auto = &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; - const struct retro_keybind *normal = &binds[RARCH_ENABLE_HOTKEY]; - - input_driver_block_libretro_input = false; - input_driver_block_hotkey = false; - - /* Don't block the check to RARCH_ENABLE_HOTKEY - * unless we're really supposed to. */ - if (current_input->keyboard_mapping_is_blocked && - current_input->keyboard_mapping_is_blocked(current_input_data)) - input_driver_block_hotkey = true; - - if (check_input_driver_block_hotkey(normal, binds_auto)) - { - if (current_input->input_state(current_input_data, &binds, 0, - RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) - input_driver_block_libretro_input = true; - else - input_driver_block_hotkey = true; - } - - for (i = 0; i < RARCH_BIND_LIST_END; i++) - { - if (input_keys_pressed_internal(i, binds)) - ret |= (UINT64_C(1) << i); - } - - return ret; -} - static INLINE bool input_menu_keys_pressed_internal(unsigned i) { settings_t *settings = config_get_ptr(); @@ -759,6 +666,100 @@ static INLINE bool input_menu_keys_pressed_internal(unsigned i) return false; } +static INLINE bool input_keys_pressed_internal(unsigned i, + const struct retro_keybind *binds) +{ + if (((!input_driver_block_libretro_input && ((i < RARCH_FIRST_META_KEY))) + || !input_driver_block_hotkey)) + { + if (current_input->input_state(current_input_data, &binds, + 0, RETRO_DEVICE_JOYPAD, 0, i)) + return true; + } + + if (i >= RARCH_FIRST_META_KEY) + { + if (current_input->meta_key_pressed(current_input_data, i)) + return true; + } + +#ifdef HAVE_OVERLAY + if (overlay_ptr && input_overlay_key_pressed(overlay_ptr, i)) + return true; +#endif + +#ifdef HAVE_COMMAND + if (input_driver_command) + { + command_handle_t handle; + + handle.handle = input_driver_command; + handle.id = i; + + if (command_get(&handle)) + return true; + } +#endif + +#ifdef HAVE_NETWORKGAMEPAD + if (input_driver_remote) + { + if (input_remote_key_pressed(i, 0)) + return true; + } +#endif + + return false; +} + +/** + * input_keys_pressed: + * + * Grab an input sample for this frame. + * + * TODO: In case RARCH_BIND_LIST_END starts exceeding 64, + * and you need a bitmask of more than 64 entries, reimplement + * it to use something like rarch_bits_t. + * + * Returns: Input sample containg a mask of all pressed keys. + */ +uint64_t input_keys_pressed(void) +{ + unsigned i; + uint64_t ret = 0; + settings_t *settings = config_get_ptr(); + const struct retro_keybind *binds = settings->input.binds[0]; + const struct retro_keybind *binds_auto = &settings->input.autoconf_binds[0][RARCH_ENABLE_HOTKEY]; + const struct retro_keybind *normal = &binds[RARCH_ENABLE_HOTKEY]; + + input_driver_block_libretro_input = false; + input_driver_block_hotkey = false; + + /* Don't block the check to RARCH_ENABLE_HOTKEY + * unless we're really supposed to. */ + if (current_input->keyboard_mapping_is_blocked && + current_input->keyboard_mapping_is_blocked(current_input_data)) + input_driver_block_hotkey = true; + + if (check_input_driver_block_hotkey(normal, binds_auto)) + { + if (current_input->input_state(current_input_data, &binds, 0, + RETRO_DEVICE_JOYPAD, 0, RARCH_ENABLE_HOTKEY)) + input_driver_block_libretro_input = true; + else + input_driver_block_hotkey = true; + } + + for (i = 0; i < RARCH_BIND_LIST_END; i++) + { + if (input_keys_pressed_internal(i, binds)) + ret |= (UINT64_C(1) << i); + } + + return ret; +} + + /** * input_menu_keys_pressed: * @@ -774,8 +775,8 @@ static INLINE bool input_menu_keys_pressed_internal(unsigned i) uint64_t input_menu_keys_pressed(void) { unsigned i; - uint64_t ret = 0; - settings_t *settings = config_get_ptr(); + uint64_t ret = 0; + settings_t *settings = config_get_ptr(); const struct retro_keybind *binds[MAX_USERS] = {NULL}; const struct retro_keybind *binds_norm = NULL; const struct retro_keybind *binds_auto = NULL; From f725b48555a1bbb77ec3d960fe74a1aefe312507 Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Fri, 2 Dec 2016 23:36:23 -0500 Subject: [PATCH 187/638] starting to revert unicode changes --- audio/drivers/dsound.c | 24 ++-- file_path_special.c | 37 ++--- frontend/drivers/platform_win32.c | 16 +-- gfx/common/win32_common.cpp | 113 ++++++++-------- gfx/common/win32_common.h | 10 +- gfx/drivers/d3d.cpp | 48 +++---- gfx/drivers_context/wgl_ctx.cpp | 13 +- gfx/drivers_font/d3d_w32_font.cpp | 5 +- input/drivers/dinput.c | 7 +- input/drivers_joypad/dinput_joypad.c | 38 ++---- input/drivers_joypad/xinput_joypad.c | 1 - input/input_remote.c | 1 - libretro-common/dynamic/dylib.c | 21 +-- libretro-common/file/retro_dirent.c | 19 +-- libretro-common/file/retro_stat.c | 27 +--- libretro-common/include/compat/msvc.h | 5 +- libretro-common/include/encodings/win32.h | 63 --------- libretro-common/include/retro_miscellaneous.h | 7 +- libretro-common/streams/file_stream.c | 29 ++-- ui/drivers/ui_win32.c | 128 +++++++++--------- ui/drivers/win32/ui_win32_browser_window.c | 50 +------ ui/drivers/win32/ui_win32_window.cpp | 9 +- 22 files changed, 245 insertions(+), 426 deletions(-) delete mode 100644 libretro-common/include/encodings/win32.h diff --git a/audio/drivers/dsound.c b/audio/drivers/dsound.c index ff2d8368b8..2cdcf4d234 100644 --- a/audio/drivers/dsound.c +++ b/audio/drivers/dsound.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -19,8 +19,6 @@ #include #include -#include - #ifndef _XBOX #include #include @@ -95,7 +93,7 @@ static INLINE bool grab_region(dsound_t *ds, uint32_t write_ptr, struct audio_lock *region) { const char *err = NULL; - HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, + HRESULT res = IDirectSoundBuffer_Lock(ds->dsb, write_ptr, CHUNK_SIZE, ®ion->chunk1, ®ion->size1, ®ion->chunk2, ®ion->size2, 0); if (res == DSERR_BUFFERLOST) @@ -154,7 +152,7 @@ static void dsound_thread(void *data) struct audio_lock region; DWORD read_ptr, avail, fifo_avail; get_positions(ds, &read_ptr, NULL); - + avail = write_avail(read_ptr, write_ptr, ds->buffer_size); EnterCriticalSection(&ds->crit); @@ -163,12 +161,12 @@ static void dsound_thread(void *data) if (avail < CHUNK_SIZE || ((fifo_avail < CHUNK_SIZE) && (avail < ds->buffer_size / 2))) { - /* No space to write, or we don't have data in our fifo, + /* No space to write, or we don't have data in our fifo, * but we can wait some time before it underruns ... */ /* We could opt for using the notification interface, - * but it is not guaranteed to work, so use high + * but it is not guaranteed to work, so use high * priority sleeping patterns. */ retro_sleep(1); @@ -184,7 +182,7 @@ static void dsound_thread(void *data) if (fifo_avail < CHUNK_SIZE) { - /* Got space to write, but nothing in FIFO (underrun), + /* Got space to write, but nothing in FIFO (underrun), * fill block with silence. */ memset(region.chunk1, 0, region.size1); @@ -193,7 +191,7 @@ static void dsound_thread(void *data) release_region(ds, ®ion); write_ptr = (write_ptr + region.size1 + region.size2) % ds->buffer_size; } - else + else { /* All is good. Pull from it and notify FIFO. */ @@ -293,15 +291,11 @@ struct dsound_dev LPGUID guid; }; -static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCTSTR desc, LPCTSTR module, LPVOID context) +static BOOL CALLBACK enumerate_cb(LPGUID guid, LPCSTR desc, LPCSTR module, LPVOID context) { struct dsound_dev *dev = (struct dsound_dev*)context; - WCHAR_TO_CHAR_ALLOC(desc, desc_str) - RARCH_LOG("\t%u: %s\n", dev->total_count, desc_str); - - if (desc_str) - free(desc_str); + RARCH_LOG("\t%u: %s\n", dev->total_count, desc); if (dev->device == dev->total_count) dev->guid = guid; diff --git a/file_path_special.c b/file_path_special.c index 32d1ac8be0..88aeae7cf8 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -1,6 +1,6 @@ /* 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. @@ -15,8 +15,6 @@ #ifdef _WIN32 -#include -#include #include #else #include @@ -125,7 +123,7 @@ void fill_pathname_abbreviate_special(char *out_path, fill_pathname_application_path(application_dir, sizeof(application_dir)); path_basedir(application_dir); - + for (i = 0; candidates[i]; i++) { if (!string_is_empty(candidates[i]) && strstr(in_path, candidates[i]) == in_path) @@ -133,11 +131,11 @@ void fill_pathname_abbreviate_special(char *out_path, size_t src_size = strlcpy(out_path, notations[i], size); retro_assert(src_size < size); - + out_path += src_size; size -= src_size; in_path += strlen(candidates[i]); - + if (!path_char_is_slash(*in_path)) { retro_assert(strlcpy(out_path, path_default_slash(), size) < size); @@ -209,7 +207,7 @@ void fill_pathname_application_path(char *s, size_t len) #endif #ifdef _WIN32 DWORD ret; - LPTSTR ws = (LPTSTR)calloc(len, sizeof(TCHAR)); + wchar_t ws[PATH_MAX_LENGTH] = {0}; #endif #ifdef __HAIKU__ image_info info; @@ -218,26 +216,13 @@ void fill_pathname_application_path(char *s, size_t len) (void)i; if (!len) - { -#ifdef _WIN32 - if (ws) - free(ws); -#endif return; - } #ifdef _WIN32 - ret = GetModuleFileName(GetModuleHandle(NULL), ws, len - 1); - memset(s, 0, len); -#ifdef UNICODE - utf16_to_char_string(ws, s, len); -#else - memcpy(s, ws, len); -#endif + MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - if (ws) - free(ws); + ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) @@ -247,7 +232,7 @@ void fill_pathname_application_path(char *s, size_t len) CFStringGetCString(bundle_path, s, len, kCFStringEncodingUTF8); CFRelease(bundle_path); CFRelease(bundle_url); - + retro_assert(strlcat(s, "nobin", len) < len); return; } @@ -267,7 +252,7 @@ void fill_pathname_application_path(char *s, size_t len) char link_path[255]; link_path[0] = *s = '\0'; - pid = getpid(); + pid = getpid(); /* Linux, BSD and Solaris paths. Not standardized. */ for (i = 0; i < ARRAY_SIZE(exts); i++) @@ -285,7 +270,7 @@ void fill_pathname_application_path(char *s, size_t len) } } } - + RARCH_ERR("Cannot resolve application path! This should not happen.\n"); #endif } @@ -343,7 +328,7 @@ void fill_pathname_application_special(char *s, size_t len, enum application_spe #ifdef HAVE_ZARCH { settings_t *settings = config_get_ptr(); - fill_pathname_join(s, + fill_pathname_join(s, settings->directory.assets, "zarch", len); diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 8e5b8e3673..2480e61f4e 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -40,8 +40,8 @@ #include "../../runloop.h" #include "../../verbosity.h" -/* We only load this library once, so we let it be - * unloaded at application shutdown, since unloading +/* We only load this library once, so we let it be + * unloaded at application shutdown, since unloading * it early seems to cause issues on some systems. */ @@ -71,7 +71,7 @@ static bool gfx_init_dwm(void) } atexit(gfx_dwm_shutdown); - HRESULT (WINAPI *mmcss)(BOOL) = + HRESULT (WINAPI *mmcss)(BOOL) = (HRESULT (WINAPI*)(BOOL))dylib_proc(dwmlib, "DwmEnableMMCSS"); if (mmcss) { @@ -94,7 +94,7 @@ static void gfx_set_dwm(void) if (settings->video.disable_composition == dwm_composition_disabled) return; - HRESULT (WINAPI *composition_enable)(UINT) = + HRESULT (WINAPI *composition_enable)(UINT) = (HRESULT (WINAPI*)(UINT))dylib_proc(dwmlib, "DwmEnableComposition"); if (!composition_enable) { @@ -177,7 +177,7 @@ static void frontend_win32_init(void *data) { typedef BOOL (WINAPI *isProcessDPIAwareProc)(); typedef BOOL (WINAPI *setProcessDPIAwareProc)(); - HMODULE handle = GetModuleHandle(TEXT("User32.dll")); + HMODULE handle = GetModuleHandleW(L"User32.dll"); isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)dylib_proc(handle, "IsProcessDPIAware"); setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)dylib_proc(handle, "SetProcessDPIAware"); @@ -189,13 +189,13 @@ static void frontend_win32_init(void *data) setDPIAwareProc(); } } - + } enum frontend_powerstate frontend_win32_get_powerstate(int *seconds, int *percent) { SYSTEM_POWER_STATUS status; - enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; + enum frontend_powerstate ret = FRONTEND_POWERSTATE_NONE; if (!GetSystemPowerStatus(&status)) return ret; @@ -338,7 +338,7 @@ static void frontend_win32_detach_console(void) { HWND wnd = GetConsoleWindow(); FreeConsole(); - PostMessage(wnd, WM_CLOSE, 0, 0); + PostMessageW(wnd, WM_CLOSE, 0, 0); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index a708d36c34..aa091e33de 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -1,6 +1,6 @@ /* 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. @@ -13,7 +13,6 @@ * If not, see . */ -#include #include #include @@ -77,7 +76,7 @@ ui_window_win32_t main_window; /* Power Request APIs */ #if !defined(_XBOX) && (_MSC_VER == 1310) -typedef struct _REASON_CONTEXT +typedef struct _REASON_CONTEXT { ULONG Version; DWORD Flags; @@ -130,7 +129,7 @@ extern "C" } }; -INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, +INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { size_t list_size; @@ -149,16 +148,16 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); - hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); for (i = 0; i < list_size; i++) { const core_info_t *info = (const core_info_t*)&core_info[i]; - SendMessage(hwndList, LB_ADDSTRING, 0, - (LPARAM)info->display_name); + SendMessage(hwndList, LB_ADDSTRING, 0, + (LPARAM)info->display_name); } - SetFocus(hwndList); - return TRUE; + SetFocus(hwndList); + return TRUE; } case WM_COMMAND: @@ -169,20 +168,20 @@ INT_PTR CALLBACK PickCoreProc(HWND hDlg, UINT message, EndDialog(hDlg, LOWORD(wParam)); break; case ID_CORELISTBOX: - switch (HIWORD(wParam)) - { + switch (HIWORD(wParam)) + { case LBN_SELCHANGE: { int lbItem; const core_info_t *info = NULL; - HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); - lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); + HWND hwndList = GetDlgItem(hDlg, ID_CORELISTBOX); + lbItem = (int)SendMessage(hwndList, LB_GETCURSEL, 0, 0); core_info_get_list(&core_info_list); core_info_list_get_supported_cores(core_info_list, path_get(RARCH_PATH_CONTENT), &core_info, &list_size); info = (const core_info_t*)&core_info[lbItem]; runloop_ctl(RUNLOOP_CTL_SET_LIBRETRO_PATH,info->path); - } + } break; } return TRUE; @@ -213,20 +212,20 @@ void win32_monitor_from_window(void) void win32_monitor_get_info(void) { - MONITORINFOEX current_mon; + MONITORINFOEXW current_mon; memset(¤t_mon, 0, sizeof(current_mon)); - current_mon.cbSize = sizeof(MONITORINFOEX); + current_mon.cbSize = sizeof(MONITORINFOEXW); - GetMonitorInfo(win32_monitor_last, (MONITORINFOEX*)¤t_mon); - ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL); + GetMonitorInfoW(win32_monitor_last, (MONITORINFOEXW*)¤t_mon); + ChangeDisplaySettingsExW(current_mon.szDevice, NULL, NULL, 0, NULL); } void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) { unsigned i, fs_monitor; settings_t *settings = config_get_ptr(); - MONITORINFOEX *mon = (MONITORINFOEX*)data; + MONITORINFOEXW *mon = (MONITORINFOEXW*)data; HMONITOR *hm_to_use = (HMONITOR*)hm_data; if (!win32_monitor_last) @@ -255,8 +254,8 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) } memset(mon, 0, sizeof(*mon)); - mon->cbSize = sizeof(MONITORINFOEX); - GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)mon); + mon->cbSize = sizeof(MONITORINFOEXW); + GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)mon); } /* Get the count of the files dropped */ @@ -265,19 +264,18 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) char szFilename[1024] = {0}; wchar_t wszFilename[1024] = {0}; - if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) + if (DragQueryFileW((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { /*poll list of current cores */ size_t list_size; content_ctx_info_t content_info = {0}; core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; -#ifdef UNICODE + DragQueryFileW((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); + utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); -#else - DragQueryFile((HDROP)wparam, 0, szFilename, sizeof(szFilename)); -#endif + core_info_get_list(&core_info_list); if (!core_info_list) @@ -337,8 +335,8 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) else { /* Pick one core that could be compatible, ew */ - if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE), - hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) + if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), + hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( NULL, NULL, @@ -410,7 +408,7 @@ static LRESULT CALLBACK WndProcCommon(bool *quit, HWND hwnd, UINT message, } *quit = true; break; - case WM_COMMAND: + case WM_COMMAND: { settings_t *settings = config_get_ptr(); if (settings->ui.menubar_enable) @@ -455,7 +453,7 @@ LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message, LPCREATESTRUCT p_cs = (LPCREATESTRUCT)lparam; curD3D = p_cs->lpCreateParams; g_inited = true; - + win32_window.hwnd = hwnd; ui_window_win32_set_droppable(&win32_window, true); @@ -509,7 +507,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; - return DefWindowProc(hwnd, message, wparam, lparam); + return DefWindowProcW(hwnd, message, wparam, lparam); } bool win32_window_create(void *data, unsigned style, @@ -517,7 +515,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowEx(0, TEXT("RetroArch"), TEXT("RetroArch"), + main_window.hwnd = CreateWindowExW(0, L"RetroArch", L"RetroArch", style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -535,7 +533,7 @@ bool win32_window_create(void *data, unsigned style, #endif bool win32_get_metrics(void *data, - enum display_metric_types type, float *value) + enum display_metric_types type, float *value) { #ifdef _XBOX return false; @@ -585,8 +583,7 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; - unsigned res = 0; - CHAR_TO_WCHAR_ALLOC(dev_name, dev_name_wide) + wchar_t dev_name_wide[1024] = {0}; memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -598,13 +595,10 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - res = ChangeDisplaySettingsEx(dev_name_wide, &devmode, + MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); + + return ChangeDisplaySettingsExW(dev_name_wide, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; - - if (dev_name_wide) - free(dev_name_wide); - - return res; #endif } @@ -622,7 +616,7 @@ void win32_check_window(bool *quit, bool *resize, unsigned *width, unsigned *height) { #ifndef _XBOX - const ui_application_t *application = + const ui_application_t *application = ui_companion_driver_get_application_ptr(); if (application) application->process_events(); @@ -661,7 +655,7 @@ bool win32_suppress_screensaver(void *data, bool enable) typedef HANDLE (WINAPI * PowerCreateRequestPtr)(REASON_CONTEXT *context); typedef BOOL (WINAPI * PowerSetRequestPtr)(HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType); - HMODULE kernel32 = GetModuleHandle(TEXT("kernel32.dll")); + HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); PowerCreateRequestPtr powerCreateRequest = (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest"); PowerSetRequestPtr powerSetRequest = @@ -695,19 +689,19 @@ bool win32_suppress_screensaver(void *data, bool enable) } /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) { #ifndef _XBOX settings_t *settings = config_get_ptr(); - /* Windows only reports the refresh rates for modelines as - * an integer, so video.refresh_rate needs to be rounded. Also, account + /* Windows only reports the refresh rates for modelines as + * an integer, so video.refresh_rate needs to be rounded. Also, account * for black frame insertion using video.refresh_rate set to half * of the display refresh rate, as well as higher vsync swap intervals. */ float refresh_mod = settings->video.black_frame_insertion ? 2.0f : 1.0f; - unsigned refresh = roundf(settings->video.refresh_rate + unsigned refresh = roundf(settings->video.refresh_rate * refresh_mod * settings->video.swap_interval); if (fullscreen) @@ -720,18 +714,17 @@ void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, } else { - WCHAR_TO_CHAR_ALLOC(current_mon->szDevice, dev_name) + char dev_name[CCHDEVICENAME] = {0}; *style = WS_POPUP | WS_VISIBLE; + utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); + if (!win32_monitor_set_fullscreen(*width, *height, refresh, dev_name)) - {} - - if (dev_name) - free(dev_name); + {} /* Display settings might have changed, get new coordinates. */ - GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)current_mon); + GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); *mon_rect = current_mon->rcMonitor; } } @@ -762,8 +755,8 @@ void win32_set_window(unsigned *width, unsigned *height, { RECT rc_temp = {0, 0, (LONG)*height, 0x7FFF}; SetMenu(main_window.hwnd, - LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); - SendMessage(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); + LoadMenuW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDR_MENU))); + SendMessageW(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); g_resize_height = *height += rc_temp.top + rect->top; SetWindowPos(main_window.hwnd, NULL, 0, 0, *width, *height, SWP_NOMOVE); } @@ -789,7 +782,7 @@ bool win32_set_video_mode(void *data, MSG msg; RECT mon_rect; unsigned mon_id; - MONITORINFOEX current_mon; + MONITORINFOEXW current_mon; bool windowed_full; RECT rect = {0}; HMONITOR hm_to_use = NULL; @@ -808,14 +801,14 @@ bool win32_set_video_mode(void *data, if (!win32_window_create(data, style, &mon_rect, width, height, fullscreen)) return false; - + win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ - while (!g_inited && !g_quit && GetMessage(&msg, main_window.hwnd, 0, 0)) + while (!g_inited && !g_quit && GetMessageW(&msg, main_window.hwnd, 0, 0)) { TranslateMessage(&msg); - DispatchMessage(&msg); + DispatchMessageW(&msg); } if (g_quit) @@ -873,7 +866,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClass(TEXT("RetroArch"), GetModuleHandle(NULL)); + UnregisterClassW(L"RetroArch", GetModuleHandleW(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index d7a803c300..704cb40e35 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,10 +18,12 @@ #define WIN32_COMMON_H__ #include -#include #ifndef _XBOX #define WIN32_LEAN_AND_MEAN +#define UNICODE +#include +#include #include #endif @@ -81,7 +83,7 @@ bool win32_window_create(void *data, unsigned style, bool win32_suppress_screensaver(void *data, bool enable); bool win32_get_metrics(void *data, - enum display_metric_types type, float *value); + enum display_metric_types type, float *value); void win32_show_cursor(bool state); @@ -97,7 +99,7 @@ void win32_set_window(unsigned *width, unsigned *height, #ifndef _XBOX /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); #endif diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index b429ac8319..95bfc96f8b 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -15,11 +15,13 @@ * If not, see . */ -#include - #ifdef _XBOX #include #include +#else +#define UNICODE +#include +#include #endif #include @@ -153,14 +155,14 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) video_info->input_scale * RARCH_SCALE_BASE; if (!renderchain_init_first(&d3d->renderchain_driver, - &d3d->renderchain_data)) + &d3d->renderchain_data)) { - RARCH_ERR("Renderchain could not be initialized.\n"); - return false; + RARCH_ERR("Renderchain could not be initialized.\n"); + return false; } if (!d3d->renderchain_driver || !d3d->renderchain_data) - return false; + return false; if ( !d3d->renderchain_driver->init( @@ -185,7 +187,7 @@ static bool d3d_init_chain(d3d_video_t *d3d, const video_info_t *video_info) for (i = 1; i < d3d->shader.passes; i++) { d3d->renderchain_driver->convert_geometry(d3d->renderchain_data, - &link_info, + &link_info, &out_width, &out_height, current_width, current_height, &d3d->final_viewport); @@ -325,8 +327,8 @@ static void d3d_viewport_info(void *data, struct video_viewport *vp) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->viewport_info) return; @@ -362,7 +364,7 @@ static void d3d_overlay_render(d3d_video_t *d3d, overlay_t *overlay) vert[i][7] = 1.0f; vert[i][8] = overlay->alpha_mod; } - + d3d_viewport_info(d3d, &vp); overlay_width = vp.width; @@ -500,7 +502,7 @@ void d3d_make_d3dpp(void *data, #ifdef _XBOX d3dpp->Windowed = false; #else - d3dpp->Windowed = settings->video.windowed_fullscreen + d3dpp->Windowed = settings->video.windowed_fullscreen || !info->fullscreen; #endif d3dpp->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; @@ -531,13 +533,13 @@ void d3d_make_d3dpp(void *data, d3dpp->BackBufferFormat = #ifdef _XBOX360 global->console.screen.gamma_correction ? - (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? + (D3DFORMAT)MAKESRGBFMT(info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5) : #endif info->rgb32 ? D3DFMT_X8R8G8B8 : D3DFMT_LIN_R5G6B5; #else d3dpp->hDeviceWindow = win32_get_window(); - d3dpp->BackBufferFormat = !d3dpp->Windowed ? + d3dpp->BackBufferFormat = !d3dpp->Windowed ? D3DFMT_X8R8G8B8 : D3DFMT_UNKNOWN; #endif @@ -711,8 +713,8 @@ static void d3d_calculate_rect(void *data, if (fabsf(device_aspect - desired_aspect) < 0.0001f) { - /* If the aspect ratios of screen and desired aspect - * ratio are sufficiently equal (floating point stuff), + /* If the aspect ratios of screen and desired aspect + * ratio are sufficiently equal (floating point stuff), * assume they are actually equal. */ } @@ -804,7 +806,7 @@ static bool d3d_initialize(d3d_video_t *d3d, const video_info_t *info) video_driver_get_size(&width, &height); d3d_set_viewport(d3d, - width, height, false, true); + width, height, false, true); #if defined(_XBOX360) strlcpy(settings->path.font, "game:\\media\\Arial_12.xpr", @@ -1045,7 +1047,7 @@ static bool d3d_construct(d3d_video_t *d3d, win_height, info->fullscreen); win32_set_window(&win_width, &win_height, info->fullscreen, - windowed_full, &rect); + windowed_full, &rect); #endif #ifdef HAVE_SHADERS @@ -1335,7 +1337,7 @@ static bool d3d_overlay_load(void *data, image_data; if (!d3d) - return false; + return false; d3d_free_overlays(d3d); d3d->overlays.resize(num_images); @@ -1540,8 +1542,8 @@ static bool d3d_read_viewport(void *data, uint8_t *buffer) { d3d_video_t *d3d = (d3d_video_t*)data; - if ( !d3d || - !d3d->renderchain_driver || + if ( !d3d || + !d3d->renderchain_driver || !d3d->renderchain_driver->read_viewport) return false; @@ -1601,7 +1603,7 @@ static void d3d_set_menu_texture_frame(void *data, || d3d->menu->tex_h != height) { if (d3d->menu) - d3d_texture_free(d3d->menu->tex); + d3d_texture_free(d3d->menu->tex); d3d->menu->tex = d3d_texture_new(d3d->dev, NULL, width, height, 1, @@ -1684,7 +1686,7 @@ static void video_texture_load_d3d(d3d_video_t *d3d, uintptr_t *id) { *id = (uintptr_t)d3d_texture_new(d3d->dev, NULL, - ti->width, ti->height, 1, + ti->width, ti->height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, 0, 0, 0, NULL, NULL); } @@ -1737,7 +1739,7 @@ static void d3d_unload_texture(void *data, uintptr_t id) { LPDIRECT3DTEXTURE texid; if (!id) - return; + return; texid = (LPDIRECT3DTEXTURE)id; d3d_texture_free(texid); diff --git a/gfx/drivers_context/wgl_ctx.cpp b/gfx/drivers_context/wgl_ctx.cpp index 83cf7b9b74..b1d4a149d2 100644 --- a/gfx/drivers_context/wgl_ctx.cpp +++ b/gfx/drivers_context/wgl_ctx.cpp @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -23,7 +23,10 @@ #define _WIN32_WINNT 0x0500 //_WIN32_WINNT_WIN2K #endif -#include +#define UNICODE +#include +#include + #include #include @@ -182,7 +185,7 @@ static void create_gl_context(HWND hwnd, bool *quit) *aptr++ = win32_minor; /* Technically, we don't have core/compat until 3.2. - * Version 3.1 is either compat or not depending + * Version 3.1 is either compat or not depending * on GL_ARB_compatibility. */ if ((win32_major * 1000 + win32_minor) >= 3002) @@ -431,7 +434,7 @@ static void *gfx_ctx_wgl_init(void *video_driver) if (g_inited) return NULL; - + win32_window_reset(); win32_monitor_init(); @@ -593,7 +596,7 @@ static gfx_ctx_proc_t gfx_ctx_wgl_get_proc_address(const char *symbol) } static bool gfx_ctx_wgl_get_metrics(void *data, - enum display_metric_types type, float *value) + enum display_metric_types type, float *value) { return win32_get_metrics(data, type, value); } diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index 402a27f6ed..5f4d8d9453 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -18,7 +18,6 @@ #include "../../config.h" #endif -#include #include "../drivers/d3d.h" #include "../font_driver.h" @@ -47,7 +46,7 @@ static void *d3dfonts_w32_init_font(void *video_data, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_PITCH, - TEXT("Verdana") /* Hardcode FTL */ + L"Verdana" /* Hardcode FTL */ }; d3dfonts = (d3dfonts_t*)calloc(1, sizeof(*d3dfonts)); diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index dfb3033711..c5f96d0ec5 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -29,7 +29,10 @@ #define WM_MOUSEWHEEL 0x020A #endif -#include +#define UNICODE +#include +#include + #include #include @@ -45,7 +48,7 @@ #include "../../configuration.h" #include "../../verbosity.h" -#include "../../tasks/tasks_internal.h" +#include "../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/input/drivers_joypad/dinput_joypad.c b/input/drivers_joypad/dinput_joypad.c index 1de46b4a66..61b4297a0a 100644 --- a/input/drivers_joypad/dinput_joypad.c +++ b/input/drivers_joypad/dinput_joypad.c @@ -1,7 +1,7 @@ /* RetroArch - A frontend for libretro. * Copyright (C) 2010-2014 - Hans-Kristian Arntzen * 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. @@ -17,8 +17,6 @@ #include #include #include -#include -#include #include #include @@ -77,7 +75,7 @@ static void dinput_joypad_destroy(void) IDirectInputDevice8_Unacquire(g_pads[i].joypad); IDirectInputDevice8_Release(g_pads[i].joypad); } - + free(g_pads[i].joy_name); g_pads[i].joy_name = NULL; free(g_pads[i].joy_friendly_name); @@ -116,11 +114,11 @@ static bool guid_is_xinput_device(const GUID* product_guid) unsigned i, num_raw_devs = 0; PRAWINPUTDEVICELIST raw_devs = NULL; - /* Check for well known XInput device GUIDs, + /* Check for well known XInput device GUIDs, * thereby removing the need for the IG_ check. - * This lets us skip RAWINPUT for popular devices. + * This lets us skip RAWINPUT for popular devices. * - * Also, we need to do this for the Valve Streaming Gamepad + * Also, we need to do this for the Valve Streaming Gamepad * because it's virtualized and doesn't show up in the device list. */ for (i = 0; i < ARRAY_SIZE(common_xinput_guids); ++i) @@ -153,25 +151,17 @@ static bool guid_is_xinput_device(const GUID* product_guid) for (i = 0; i < num_raw_devs; i++) { RID_DEVICE_INFO rdi; - TCHAR devName[128] = {0}; + char devName[128] = {0}; UINT rdiSize = sizeof(rdi); UINT nameSize = sizeof(devName); rdi.cbSize = sizeof (rdi); if ((raw_devs[i].dwType == RIM_TYPEHID) && - (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) && + (GetRawInputDeviceInfoA(raw_devs[i].hDevice, RIDI_DEVICEINFO, &rdi, &rdiSize) != ((UINT)-1)) && (MAKELONG(rdi.hid.dwVendorId, rdi.hid.dwProductId) == ((LONG)product_guid->Data1)) && - (GetRawInputDeviceInfo(raw_devs[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) && -#ifdef _MSC_VER - (_tcsstr(devName, TEXT("IG_")) != NULL) ) -#else -#ifdef UNICODE - (wcsstr((const wchar_t*)devName, L"IG_") != NULL) ) -#else - (strstr(devName, "IG_" != NULL) ) -#endif -#endif + (GetRawInputDeviceInfoA(raw_devs[i].hDevice, RIDI_DEVICENAME, devName, &nameSize) != ((UINT)-1)) && + (strstr(devName, "IG_") != NULL) ) { free(raw_devs); raw_devs = NULL; @@ -217,7 +207,6 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) #endif LPDIRECTINPUTDEVICE8 *pad = NULL; settings_t *settings = config_get_ptr(); - WCHAR_TO_CHAR_ALLOC(inst->tszInstanceName, name) (void)p; @@ -233,13 +222,10 @@ static BOOL CALLBACK enum_joypad_cb(const DIDEVICEINSTANCE *inst, void *p) if (FAILED(IDirectInput8_CreateDevice( g_dinput_ctx, &inst->guidInstance, pad, NULL))) #endif - return DIENUM_CONTINUE; + return DIENUM_CONTINUE; - g_pads[g_joypad_cnt].joy_name = strdup(name); - g_pads[g_joypad_cnt].joy_friendly_name = strdup(name); - - if (name) - free(name); + g_pads[g_joypad_cnt].joy_name = strdup(inst->tszProductName); + g_pads[g_joypad_cnt].joy_friendly_name = strdup(inst->tszInstanceName); /* there may be more useful info in the GUID so leave this here for a while */ #if 0 diff --git a/input/drivers_joypad/xinput_joypad.c b/input/drivers_joypad/xinput_joypad.c index 8ffb4ef8ce..8959b027ac 100644 --- a/input/drivers_joypad/xinput_joypad.c +++ b/input/drivers_joypad/xinput_joypad.c @@ -26,7 +26,6 @@ #include #include -#include #include #include #include diff --git a/input/input_remote.c b/input/input_remote.c index 5d27734ed7..5523e24dd3 100644 --- a/input/input_remote.c +++ b/input/input_remote.c @@ -20,7 +20,6 @@ #include #ifdef _WIN32 -#include #include #else #include diff --git a/libretro-common/dynamic/dylib.c b/libretro-common/dynamic/dylib.c index 154a5458ed..611c9f8771 100644 --- a/libretro-common/dynamic/dylib.c +++ b/libretro-common/dynamic/dylib.c @@ -23,7 +23,6 @@ #include #include #include -#include #ifdef NEED_DYNAMIC @@ -35,7 +34,7 @@ #endif #ifdef _WIN32 -static TCHAR last_dyn_error[512] = {0}; +static char last_dyn_error[512]; static void set_dl_error(void) { @@ -46,16 +45,11 @@ static void set_dl_error(void) NULL, err, MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT), - (LPTSTR)last_dyn_error, + last_dyn_error, sizeof(last_dyn_error) - 1, NULL) == 0) - { - WCHAR_TO_CHAR_ALLOC(last_dyn_error, last_dyn_error_str) - snprintf(last_dyn_error_str, sizeof(last_dyn_error) - 1, + snprintf(last_dyn_error, sizeof(last_dyn_error) - 1, "unknown error %lu", err); - if (last_dyn_error_str) - free(last_dyn_error_str); - } } #endif @@ -71,13 +65,7 @@ dylib_t dylib_load(const char *path) { #ifdef _WIN32 int prevmode = SetErrorMode(SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX); - dylib_t lib = NULL; - CHAR_TO_WCHAR_ALLOC(path, path_wide) - - lib = LoadLibrary(path_wide); - - if (path_wide) - free(path_wide); + dylib_t lib = LoadLibrary(path); SetErrorMode(prevmode); @@ -86,7 +74,6 @@ dylib_t dylib_load(const char *path) set_dl_error(); return NULL; } - last_dyn_error[0] = 0; #else dylib_t lib = dlopen(path, RTLD_LAZY); diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index 26ed172539..dda73a682b 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -24,7 +24,6 @@ #include #include -#include #include #include @@ -35,9 +34,7 @@ struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) char path_buf[1024] = {0}; -#ifdef UNICODE wchar_t pathW[1024] = {0}; -#endif #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -45,13 +42,9 @@ struct RDIR *retro_opendir(const char *name) return NULL; #if defined(_WIN32) -#ifdef UNICODE snprintf(path_buf, sizeof(path_buf), "%s\\*", name); - MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW)); + MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); rdir->directory = FindFirstFileW(pathW, &rdir->entry); -#else - rdir->directory = FindFirstFile(path_buf, &rdir->entry); -#endif #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -84,7 +77,7 @@ int retro_readdir(struct RDIR *rdir) { #if defined(_WIN32) if(rdir->next) - return (FindNextFile(rdir->directory, &rdir->entry) != 0); + return (FindNextFileW(rdir->directory, &rdir->entry) != 0); else { rdir->next = true; return (rdir->directory != INVALID_HANDLE_VALUE); @@ -103,13 +96,9 @@ int retro_readdir(struct RDIR *rdir) const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) -#ifdef UNICODE memset(rdir->path, 0, sizeof(rdir->path)); - utf16_to_char_string((const uint16_t*)rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); + utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); return rdir->path; -#else - return rdir->entry.cFileName; -#endif #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; #else @@ -131,7 +120,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) { #if defined(_WIN32) - const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry; + const WIN32_FIND_DATAW *entry = (const WIN32_FIND_DATAW*)&rdir->entry; return entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; #elif defined(PSP) || defined(VITA) const SceIoDirent *entry = (const SceIoDirent*)&rdir->entry; diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index e0d53ca792..95c79c18c3 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -24,11 +24,9 @@ #include #include #include -#include #include #if defined(_WIN32) -#include #ifdef _MSC_VER #define setmode _setmode #endif @@ -105,13 +103,11 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - CHAR_TO_WCHAR_ALLOC(path, path_wide) + wchar_t path_wide[PATH_MAX_LENGTH] = {0}; - DWORD ret = GetFileAttributesEx(path_wide, fInfoLevelId, &file_info); - - if (path_wide) - free(path_wide); + MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + DWORD ret = GetFileAttributesExW(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else @@ -197,20 +193,7 @@ bool mkdir_norecurse(const char *dir) { int ret; #if defined(_WIN32) - CHAR_TO_WCHAR_ALLOC(dir, dir_wide) - -#ifdef _MSC_VER - ret = _tmkdir(dir_wide); -#else -#ifdef UNICODE - ret = _wmkdir(dir_wide); -#else - ret = _mkdir(dir_wide); -#endif - - if (dir_wide) - free(dir_wide); -#endif + ret = _mkdir(dir); #elif defined(IOS) ret = mkdir(dir, 0755); #elif defined(VITA) || defined(PSP) @@ -225,7 +208,7 @@ bool mkdir_norecurse(const char *dir) #elif defined(PSP) || defined(_3DS) if ((ret == -1) && path_is_directory(dir)) ret = 0; -#else +#else if (ret < 0 && errno == EEXIST && path_is_directory(dir)) ret = 0; #endif diff --git a/libretro-common/include/compat/msvc.h b/libretro-common/include/compat/msvc.h index b56a51fad3..e767bef7f8 100644 --- a/libretro-common/include/compat/msvc.h +++ b/libretro-common/include/compat/msvc.h @@ -35,12 +35,12 @@ extern "C" { #ifndef snprintf #define snprintf c99_snprintf_retro__ #endif - + int c99_snprintf_retro__(char *outBuf, size_t size, const char *format, ...); #endif /* Pre-MSVC 2010 compilers don't implement vsnprintf in a cross-platform manner? Not sure about this one. */ -#if _MSC_VER < 1600 +#if _MSC_VER < 1600 #include #include #ifndef vsnprintf @@ -53,6 +53,7 @@ extern "C" { } #endif +#undef UNICODE /* Do not bother with UNICODE at this time. */ #include #include #include diff --git a/libretro-common/include/encodings/win32.h b/libretro-common/include/encodings/win32.h deleted file mode 100644 index bac9fae1cc..0000000000 --- a/libretro-common/include/encodings/win32.h +++ /dev/null @@ -1,63 +0,0 @@ -/* Copyright (C) 2010-2016 The RetroArch team - * - * --------------------------------------------------------------------------------------- - * The following license statement only applies to this file (utf.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_ENCODINGS_WIN32_H -#define _LIBRETRO_ENCODINGS_WIN32_H - -#ifndef _XBOX -#ifdef _WIN32 -#define UNICODE -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -#include - -#ifdef __cplusplus -} -#endif - -#endif -#endif - -#ifdef UNICODE -#define CHAR_TO_WCHAR_ALLOC(s, ws) \ - size_t ws##_size = (NULL != s && s[0] ? strlen(s) : 0) + 1; \ - wchar_t *ws = (wchar_t*)calloc(ws##_size, 2); \ - if (NULL != s && s[0]) \ - MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, ws##_size); - -#define WCHAR_TO_CHAR_ALLOC(ws, s) \ - size_t s##_size = ((NULL != ws && ws[0] ? wcslen((const wchar_t*)ws) : 0) / 2) + 1; \ - char *s = (char*)calloc(s##_size, 1); \ - if (NULL != ws && ws[0]) \ - utf16_to_char_string((const uint16_t*)ws, s, s##_size); - -#else -#define CHAR_TO_WCHAR_ALLOC(s, ws) char *ws = (NULL != s && s[0] ? strdup(s) : NULL); -#define WCHAR_TO_CHAR_ALLOC(ws, s) char *s = (NULL != ws && ws[0] ? strdup(ws) : NULL); -#endif - -#endif diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index e9405eae63..2ab71c52dc 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -45,12 +45,11 @@ #include #endif -#ifdef _WIN32 -#include -#endif - #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN +#define UNICODE +#include +#include #include #elif defined(_WIN32) && defined(_XBOX) #include diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index 1b559e9108..d9406dba80 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -26,8 +26,9 @@ #include #if defined(_WIN32) -#include -#include +# define UNICODE +# include +# include # ifdef _MSC_VER # define setmode _setmode # endif @@ -77,10 +78,10 @@ struct RFILE #define HAVE_BUFFERED_IO 1 #ifdef _WIN32 -#define MODE_STR_READ TEXT("r") -#define MODE_STR_READ_UNBUF TEXT("rb") -#define MODE_STR_WRITE_UNBUF TEXT("wb") -#define MODE_STR_WRITE_PLUS TEXT("w+") +#define MODE_STR_READ L"r" +#define MODE_STR_READ_UNBUF L"rb" +#define MODE_STR_WRITE_UNBUF L"wb" +#define MODE_STR_WRITE_PLUS L"w+" #else #define MODE_STR_READ "r" #define MODE_STR_READ_UNBUF "rb" @@ -117,7 +118,8 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) int mode_int = 0; #if defined(HAVE_BUFFERED_IO) #ifdef _WIN32 - const TCHAR *mode_str = NULL; + const wchar_t *mode_str = NULL; + wchar_t path_wide[PATH_MAX_LENGTH] = {0}; #else const char *mode_str = NULL; #endif @@ -212,11 +214,8 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) { #ifdef _WIN32 - CHAR_TO_WCHAR_ALLOC(path, path_wide) - stream->fp = _tfopen(path_wide, mode_str); - - if (path_wide) - free(path_wide); + MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + stream->fp = _wfopen(path_wide, mode_str); #else stream->fp = fopen(path, mode_str); #endif @@ -296,7 +295,7 @@ char *filestream_getline(RFILE *stream) } newline[idx] = '\0'; - return newline; + return newline; } char *filestream_gets(RFILE *stream, char *s, size_t len) @@ -347,7 +346,7 @@ ssize_t filestream_seek(RFILE *stream, ssize_t offset, int whence) #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function is + /* Need to check stream->mapped because this function is * called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) { @@ -417,7 +416,7 @@ ssize_t filestream_tell(RFILE *stream) return ftell(stream->fp); #endif #ifdef HAVE_MMAP - /* Need to check stream->mapped because this function + /* Need to check stream->mapped because this function * is called in filestream_open() */ if (stream->mapped && stream->hints & RFILE_HINT_MMAP) return stream->mappos; diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index 8dc324223a..d2a3a44ec0 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -19,7 +19,6 @@ #include #include #include -#include #ifdef _MSC_VER #pragma comment( lib, "comctl32" ) @@ -122,7 +121,7 @@ static void shader_dlg_refresh_trackbar_label(int index) video_shader_driver_get_current_shader(&shader_info); - if (floorf(shader_info.data->parameters[index].current) + if (floorf(shader_info.data->parameters[index].current) == shader_info.data->parameters[index].current) snprintf(val_buffer, sizeof(val_buffer), "%.0f", shader_info.data->parameters[index].current); @@ -153,25 +152,25 @@ static void shader_dlg_params_refresh(void) { case SHADER_PARAM_CTRL_CHECKBOX: { - bool checked = - (shader_info.data->parameters[i].current == + bool checked = + (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); - SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: shader_dlg_refresh_trackbar_label(i); - SendMessage(control->trackbar.hwnd, + SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessage(control->trackbar.hwnd, + SendMessageW(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].maximum - - shader_info.data->parameters[i].minimum) + (LPARAM)((shader_info.data->parameters[i].maximum - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, - (LPARAM)((shader_info.data->parameters[i].current - - shader_info.data->parameters[i].minimum) / + SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + (LPARAM)((shader_info.data->parameters[i].current - + shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); break; case SHADER_PARAM_CTRL_NONE: @@ -234,16 +233,21 @@ void shader_dlg_params_reload(void) for (i = 0; i < (int)shader_info.data->num_parameters; i++) { - shader_param_ctrl_t *control = &g_shader_dlg.controls[i]; - CHAR_TO_WCHAR_ALLOC(shader_info.data->parameters[i].desc, param_desc_wide) + shader_param_ctrl_t*control = &g_shader_dlg.controls[i]; + size_t param_desc_wide_size = sizeof(shader_info.data->parameters[i].desc) * 2; + wchar_t param_desc_wide[param_desc_wide_size]; + + memset(param_desc_wide, 0, sizeof(param_desc_wide)); + MultiByteToWideChar(CP_UTF8, 0, shader_info.data->parameters[i].desc, -1, param_desc_wide, sizeof(param_desc_wide) / sizeof(param_desc_wide[0])); + if ((shader_info.data->parameters[i].minimum == 0.0) - && (shader_info.data->parameters[i].maximum - == (shader_info.data->parameters[i].minimum + && (shader_info.data->parameters[i].maximum + == (shader_info.data->parameters[i].minimum + shader_info.data->parameters[i].step))) { - if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT - + SHADER_DLG_CTRL_MARGIN + 20) + if ((pos_y + SHADER_DLG_CHECKBOX_HEIGHT + + SHADER_DLG_CTRL_MARGIN + 20) > SHADER_DLG_MAX_HEIGHT) { pos_y = g_shader_dlg.parameters_start_y; @@ -251,12 +255,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), + control->checkbox.hwnd = CreateWindowExW(0, L"BUTTON", param_desc_wide, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -269,41 +273,39 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowEx(0, TEXT("STATIC"), + control->trackbar.label_title = CreateWindowExW(0, L"STATIC", param_desc_wide, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, TEXT(""), + control->trackbar.hwnd = CreateWindowExW(0, TRACKBAR_CLASS, L"", WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), + control->trackbar.label_val = CreateWindowExW(0, L"STATIC", L"", WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessageW(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + SendMessageW(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, (LPARAM)control->trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; } - if (param_desc_wide) - free(param_desc_wide); } if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowEx(0, TEXT("STATIC"), TEXT(""), + g_shader_dlg.separator.hwnd = CreateWindowExW(0, L"STATIC", L"", SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -326,7 +328,7 @@ static void shader_dlg_update_on_top_state(void) bool on_top = SendMessage(g_shader_dlg.on_top_checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED; - SetWindowPos(g_shader_dlg.window.hwnd, on_top + SetWindowPos(g_shader_dlg.window.hwnd, on_top ? HWND_TOPMOST : HWND_NOTOPMOST , 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); } @@ -393,18 +395,18 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_CHECKBOX) break; - if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; else - shader_info.data->parameters[i].current = + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum; break; case WM_HSCROLL: - i = GetWindowLong((HWND)lparam, GWL_ID); + i = GetWindowLongW((HWND)lparam, GWL_ID); if (i >= GFX_MAX_PARAMETERS) break; @@ -412,8 +414,8 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); - shader_info.data->parameters[i].current = + pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; shader_dlg_refresh_trackbar_label(i); @@ -421,21 +423,24 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, } - return DefWindowProc(hwnd, message, wparam, lparam); + return DefWindowProcW(hwnd, message, wparam, lparam); } bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name) { - CHAR_TO_WCHAR_ALLOC(class_name, class_name_wide) + wchar_t class_name_wide[1024] = {0}; + + if (class_name) + MultiByteToWideChar(CP_UTF8, 0, class_name, -1, class_name_wide, sizeof(class_name_wide) / sizeof(class_name_wide[0])); wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndclass->hInstance = GetModuleHandle(NULL); - wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); - wndclass->lpszClassName = (class_name_wide != NULL) ? class_name_wide : TEXT("RetroArch"); - wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); - wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), + wndclass->hInstance = GetModuleHandleW(NULL); + wndclass->hCursor = LoadCursorW(NULL, IDC_ARROW); + wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; + wndclass->hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON)); + wndclass->hIconSm = (HICON)LoadImageW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); if (!fullscreen) wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW; @@ -443,13 +448,13 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (class_name != NULL) wndclass->style |= CS_CLASSDC; - if (!RegisterClassEx(wndclass)) + if (!RegisterClassExW(wndclass)) return false; - /* This is non-NULL when we want a window for shader dialogs, + /* This is non-NULL when we want a window for shader dialogs, * therefore early return here */ /* TODO/FIXME - this is ugly. Find a better way */ - if (class_name != NULL) + if (class_name != NULL) return true; if (!win32_shader_dlg_init()) @@ -468,7 +473,7 @@ bool win32_shader_dlg_init(void) if (!inited) { - WNDCLASSEX wc_shader_dlg = {0}; + WNDCLASSEXW wc_shader_dlg = {0}; INITCOMMONCONTROLSEX comm_ctrl_init = {0}; comm_ctrl_init.dwSize = sizeof(comm_ctrl_init); @@ -488,19 +493,19 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowEx(0, TEXT("Shader Dialog"), TEXT("Shader Parameters"), + g_shader_dlg.window.hwnd = CreateWindowExW(0, L"Shader Dialog", L"Shader Parameters", WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, TEXT("BUTTON"), TEXT("Always on Top"), + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowExW(0, L"BUTTON", L"Always on Top", BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)SHADER_DLG_CHECKBOX_ONTOP_ID, NULL, NULL); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; - SendMessage(g_shader_dlg.on_top_checkbox.hwnd, + SendMessageW(g_shader_dlg.on_top_checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -518,7 +523,7 @@ static bool win32_browser( const char *initial_dir) { bool result = false; - const ui_browser_window_t *browser = + const ui_browser_window_t *browser = ui_companion_driver_get_browser_window_ptr(); if (browser) @@ -529,17 +534,14 @@ static bool win32_browser( browser_state.title = strdup(title); browser_state.startdir = strdup(initial_dir); browser_state.path = strdup(filename); + browser_state.window = owner; result = browser->open(&browser_state); - if (browser_state.filters) - free(browser_state.filters); - if (browser_state.title) - free(browser_state.title); - if (browser_state.startdir) - free(browser_state.startdir); - if (browser_state.path) - free(browser_state.path); + free(browser_state.filters); + free(browser_state.title); + free(browser_state.startdir); + free(browser_state.path); } return result; @@ -552,7 +554,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) bool do_wm_close = false; settings_t *settings = config_get_ptr(); - switch (mode) + switch (mode) { case ID_M_LOAD_CORE: case ID_M_LOAD_CONTENT: @@ -661,7 +663,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) signed idx = -1; settings->state_slot = idx; } - else if (mode >= (ID_M_STATE_INDEX_AUTO+1) + else if (mode >= (ID_M_STATE_INDEX_AUTO+1) && mode <= (ID_M_STATE_INDEX_AUTO+10)) { signed idx = (mode - (ID_M_STATE_INDEX_AUTO+1)); @@ -674,8 +676,8 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) command_event(cmd, NULL); if (do_wm_close) - PostMessage(owner, WM_CLOSE, 0, 0); - + PostMessageW(owner, WM_CLOSE, 0, 0); + return 0L; } diff --git a/ui/drivers/win32/ui_win32_browser_window.c b/ui/drivers/win32/ui_win32_browser_window.c index 25203866ce..1aeaccf0d8 100644 --- a/ui/drivers/win32/ui_win32_browser_window.c +++ b/ui/drivers/win32/ui_win32_browser_window.c @@ -18,7 +18,6 @@ #include #include #include -#include #include @@ -27,60 +26,23 @@ static bool ui_browser_window_win32_core(ui_browser_window_state_t *state, bool save) { OPENFILENAME ofn = {}; - bool success = true; -#ifdef UNICODE - size_t filters_size = (state->filters ? strlen(state->filters) : 0) + 1; - size_t path_size = strlen(state->path) + 1; - size_t title_size = strlen(state->title) + 1; - size_t startdir_size = strlen(state->startdir) + 1; - wchar_t *filters_wide = (wchar_t*)calloc(filters_size, 2); - wchar_t *path_wide = (wchar_t*)calloc(path_size, 2); - wchar_t *title_wide = (wchar_t*)calloc(title_size, 2); - wchar_t *startdir_wide = (wchar_t*)calloc(startdir_size, 2); - - if (state->filters) - MultiByteToWideChar(CP_UTF8, 0, state->filters, -1, filters_wide, filters_size); - if (state->title) - MultiByteToWideChar(CP_UTF8, 0, state->title, -1, title_wide, title_size); - if (state->path) - MultiByteToWideChar(CP_UTF8, 0, state->path, -1, path_wide, path_size); - if (state->startdir) - MultiByteToWideChar(CP_UTF8, 0, state->startdir, -1, startdir_wide, startdir_size); - - ofn.lpstrFilter = filters_wide; - ofn.lpstrFile = path_wide; - ofn.lpstrTitle = title_wide; - ofn.lpstrInitialDir = startdir_wide; -#else + ofn.lStructSize = sizeof(OPENFILENAME); + ofn.hwndOwner = (HWND)state->window; ofn.lpstrFilter = state->filters; ofn.lpstrFile = state->path; ofn.lpstrTitle = state->title; ofn.lpstrInitialDir = state->startdir; -#endif - ofn.lStructSize = sizeof(OPENFILENAME); - ofn.hwndOwner = (HWND)state->window; - ofn.lpstrDefExt = TEXT(""); + ofn.lpstrDefExt = ""; ofn.nMaxFile = PATH_MAX; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR; if ( save && !GetOpenFileName(&ofn)) - success = false; + return false; if (!save && !GetSaveFileName(&ofn)) - success = false; + return false; -#ifdef UNICODE - if (filters_wide) - free(filters_wide); - if (title_wide) - free(title_wide); - if (path_wide) - free(path_wide); - if (startdir_wide) - free(startdir_wide); -#endif - - return success; + return true; } static bool ui_browser_window_win32_open(ui_browser_window_state_t *state) diff --git a/ui/drivers/win32/ui_win32_window.cpp b/ui/drivers/win32/ui_win32_window.cpp index 4a14da3296..d76866a0ba 100644 --- a/ui/drivers/win32/ui_win32_window.cpp +++ b/ui/drivers/win32/ui_win32_window.cpp @@ -20,8 +20,6 @@ #include #include -#include - #include #ifdef _MSC_VER @@ -64,7 +62,7 @@ static void ui_window_win32_set_focused(void *data) SetFocus(window->hwnd); } -static void ui_window_win32_set_visible(void *data, +static void ui_window_win32_set_visible(void *data, bool set_visible) { ui_window_win32_t *window = (ui_window_win32_t*)data; @@ -74,10 +72,7 @@ static void ui_window_win32_set_visible(void *data, static void ui_window_win32_set_title(void *data, char *buf) { ui_window_win32_t *window = (ui_window_win32_t*)data; - CHAR_TO_WCHAR_ALLOC(buf, buf_wide) - SetWindowText(window->hwnd, buf_wide); - if (buf_wide) - free(buf_wide); + SetWindowText(window->hwnd, buf); } void ui_window_win32_set_droppable(void *data, bool droppable) From e39031cbd054cc38a0c9b2df113e602a363912fb Mon Sep 17 00:00:00 2001 From: Brad Parker Date: Sat, 3 Dec 2016 00:14:33 -0500 Subject: [PATCH 188/638] revert rest of unicode changes --- file_path_special.c | 5 +- frontend/drivers/platform_win32.c | 4 +- gfx/common/win32_common.cpp | 55 ++++++-------- gfx/common/win32_common.h | 5 +- gfx/drivers/d3d.cpp | 4 -- gfx/drivers_font/d3d_w32_font.cpp | 2 +- input/drivers/dinput.c | 6 +- libretro-common/file/retro_dirent.c | 12 ++-- libretro-common/file/retro_stat.c | 4 +- libretro-common/include/retro_miscellaneous.h | 3 - libretro-common/streams/file_stream.c | 20 ------ ui/drivers/ui_win32.c | 71 ++++++++----------- 12 files changed, 64 insertions(+), 127 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 88aeae7cf8..8a9b60dadc 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -219,10 +219,7 @@ void fill_pathname_application_path(char *s, size_t len) return; #ifdef _WIN32 - MultiByteToWideChar(CP_UTF8, 0, s, -1, ws, sizeof(ws) / sizeof(ws[0])); - - - ret = GetModuleFileNameW(GetModuleHandleW(NULL), ws, sizeof(ws) / sizeof(ws[0])); + ret = GetModuleFileName(GetModuleHandle(NULL), s, len - 1); s[ret] = '\0'; #elif defined(__APPLE__) if (bundle) diff --git a/frontend/drivers/platform_win32.c b/frontend/drivers/platform_win32.c index 2480e61f4e..2cd6121be1 100644 --- a/frontend/drivers/platform_win32.c +++ b/frontend/drivers/platform_win32.c @@ -177,7 +177,7 @@ static void frontend_win32_init(void *data) { typedef BOOL (WINAPI *isProcessDPIAwareProc)(); typedef BOOL (WINAPI *setProcessDPIAwareProc)(); - HMODULE handle = GetModuleHandleW(L"User32.dll"); + HMODULE handle = GetModuleHandle("User32.dll"); isProcessDPIAwareProc isDPIAwareProc = (isProcessDPIAwareProc)dylib_proc(handle, "IsProcessDPIAware"); setProcessDPIAwareProc setDPIAwareProc = (setProcessDPIAwareProc)dylib_proc(handle, "SetProcessDPIAware"); @@ -338,7 +338,7 @@ static void frontend_win32_detach_console(void) { HWND wnd = GetConsoleWindow(); FreeConsole(); - PostMessageW(wnd, WM_CLOSE, 0, 0); + PostMessage(wnd, WM_CLOSE, 0, 0); } #endif } diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index aa091e33de..6595f11a82 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -212,20 +212,20 @@ void win32_monitor_from_window(void) void win32_monitor_get_info(void) { - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; memset(¤t_mon, 0, sizeof(current_mon)); - current_mon.cbSize = sizeof(MONITORINFOEXW); + current_mon.cbSize = sizeof(MONITORINFOEX); - GetMonitorInfoW(win32_monitor_last, (MONITORINFOEXW*)¤t_mon); - ChangeDisplaySettingsExW(current_mon.szDevice, NULL, NULL, 0, NULL); + GetMonitorInfo(win32_monitor_last, (MONITORINFOEX*)¤t_mon); + ChangeDisplaySettingsEx(current_mon.szDevice, NULL, NULL, 0, NULL); } void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) { unsigned i, fs_monitor; settings_t *settings = config_get_ptr(); - MONITORINFOEXW *mon = (MONITORINFOEXW*)data; + MONITORINFOEX *mon = (MONITORINFOEX*)data; HMONITOR *hm_to_use = (HMONITOR*)hm_data; if (!win32_monitor_last) @@ -254,17 +254,16 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id) } memset(mon, 0, sizeof(*mon)); - mon->cbSize = sizeof(MONITORINFOEXW); - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)mon); + mon->cbSize = sizeof(MONITORINFOEX); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)mon); } /* Get the count of the files dropped */ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) { char szFilename[1024] = {0}; - wchar_t wszFilename[1024] = {0}; - if (DragQueryFileW((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) + if (DragQueryFile((HDROP)wparam, 0xFFFFFFFF, NULL, 0)) { /*poll list of current cores */ size_t list_size; @@ -272,9 +271,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) core_info_list_t *core_info_list = NULL; const core_info_t *core_info = NULL; - DragQueryFileW((HDROP)wparam, 0, wszFilename, sizeof(wszFilename) / sizeof(wszFilename[0])); - - utf16_to_char_string((const uint16_t*)wszFilename, szFilename, sizeof(szFilename)); + DragQueryFile((HDROP)wparam, 0, szFilename, sizeof(szFilename)); core_info_get_list(&core_info_list); @@ -335,7 +332,7 @@ static int win32_drag_query_file(HWND hwnd, WPARAM wparam) else { /* Pick one core that could be compatible, ew */ - if(DialogBoxParamW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDD_PICKCORE), + if(DialogBoxParam(GetModuleHandle(NULL),MAKEINTRESOURCE(IDD_PICKCORE), hwnd,PickCoreProc,(LPARAM)NULL)==IDOK) { task_push_content_load_default( @@ -507,7 +504,7 @@ LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message, if (dinput_wgl && dinput_handle_message(dinput_wgl, message, wparam, lparam)) return 0; - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_create(void *data, unsigned style, @@ -515,7 +512,7 @@ bool win32_window_create(void *data, unsigned style, unsigned height, bool fullscreen) { #ifndef _XBOX - main_window.hwnd = CreateWindowExW(0, L"RetroArch", L"RetroArch", + main_window.hwnd = CreateWindowEx(0, "RetroArch", "RetroArch", style, fullscreen ? mon_rect->left : g_pos_x, fullscreen ? mon_rect->top : g_pos_y, @@ -583,7 +580,6 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, { #ifndef _XBOX DEVMODE devmode; - wchar_t dev_name_wide[1024] = {0}; memset(&devmode, 0, sizeof(devmode)); devmode.dmSize = sizeof(DEVMODE); @@ -595,9 +591,7 @@ static bool win32_monitor_set_fullscreen(unsigned width, unsigned height, RARCH_LOG("Setting fullscreen to %ux%u @ %uHz on device %s.\n", width, height, refresh, dev_name); - MultiByteToWideChar(CP_UTF8, 0, dev_name, -1, dev_name_wide, sizeof(dev_name_wide) / sizeof(dev_name_wide[0])); - - return ChangeDisplaySettingsExW(dev_name_wide, &devmode, + return ChangeDisplaySettingsEx(dev_name, &devmode, NULL, CDS_FULLSCREEN, NULL) == DISP_CHANGE_SUCCESSFUL; #endif } @@ -655,7 +649,7 @@ bool win32_suppress_screensaver(void *data, bool enable) typedef HANDLE (WINAPI * PowerCreateRequestPtr)(REASON_CONTEXT *context); typedef BOOL (WINAPI * PowerSetRequestPtr)(HANDLE PowerRequest, POWER_REQUEST_TYPE RequestType); - HMODULE kernel32 = GetModuleHandleW(L"kernel32.dll"); + HMODULE kernel32 = GetModuleHandle("kernel32.dll"); PowerCreateRequestPtr powerCreateRequest = (PowerCreateRequestPtr)GetProcAddress(kernel32, "PowerCreateRequest"); PowerSetRequestPtr powerSetRequest = @@ -689,7 +683,7 @@ bool win32_suppress_screensaver(void *data, bool enable) } /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style) { @@ -714,17 +708,14 @@ void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, } else { - char dev_name[CCHDEVICENAME] = {0}; *style = WS_POPUP | WS_VISIBLE; - utf16_to_char_string((const uint16_t*)current_mon->szDevice, dev_name, sizeof(dev_name)); - if (!win32_monitor_set_fullscreen(*width, *height, - refresh, dev_name)) + refresh, current_mon->szDevice)) {} /* Display settings might have changed, get new coordinates. */ - GetMonitorInfoW(*hm_to_use, (MONITORINFOEXW*)current_mon); + GetMonitorInfo(*hm_to_use, (MONITORINFOEX*)current_mon); *mon_rect = current_mon->rcMonitor; } } @@ -755,8 +746,8 @@ void win32_set_window(unsigned *width, unsigned *height, { RECT rc_temp = {0, 0, (LONG)*height, 0x7FFF}; SetMenu(main_window.hwnd, - LoadMenuW(GetModuleHandleW(NULL),MAKEINTRESOURCE(IDR_MENU))); - SendMessageW(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); + LoadMenu(GetModuleHandle(NULL),MAKEINTRESOURCE(IDR_MENU))); + SendMessage(main_window.hwnd, WM_NCCALCSIZE, FALSE, (LPARAM)&rc_temp); g_resize_height = *height += rc_temp.top + rect->top; SetWindowPos(main_window.hwnd, NULL, 0, 0, *width, *height, SWP_NOMOVE); } @@ -782,7 +773,7 @@ bool win32_set_video_mode(void *data, MSG msg; RECT mon_rect; unsigned mon_id; - MONITORINFOEXW current_mon; + MONITORINFOEX current_mon; bool windowed_full; RECT rect = {0}; HMONITOR hm_to_use = NULL; @@ -805,10 +796,10 @@ bool win32_set_video_mode(void *data, win32_set_window(&width, &height, fullscreen, windowed_full, &rect); /* Wait until context is created (or failed to do so ...) */ - while (!g_inited && !g_quit && GetMessageW(&msg, main_window.hwnd, 0, 0)) + while (!g_inited && !g_quit && GetMessage(&msg, main_window.hwnd, 0, 0)) { TranslateMessage(&msg); - DispatchMessageW(&msg); + DispatchMessage(&msg); } if (g_quit) @@ -866,7 +857,7 @@ void win32_window_reset(void) void win32_destroy_window(void) { #ifndef _XBOX - UnregisterClassW(L"RetroArch", GetModuleHandleW(NULL)); + UnregisterClass("RetroArch", GetModuleHandle(NULL)); #endif main_window.hwnd = NULL; } diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 704cb40e35..6e41231600 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -21,9 +21,6 @@ #ifndef _XBOX #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #endif @@ -99,7 +96,7 @@ void win32_set_window(unsigned *width, unsigned *height, #ifndef _XBOX /* FIXME: It should not be necessary to add the W after MONITORINFOEX, but linking fails without it. */ -void win32_set_style(MONITORINFOEXW *current_mon, HMONITOR *hm_to_use, +void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use, unsigned *width, unsigned *height, bool fullscreen, bool windowed_full, RECT *rect, RECT *mon_rect, DWORD *style); #endif diff --git a/gfx/drivers/d3d.cpp b/gfx/drivers/d3d.cpp index 95bfc96f8b..8715dddffd 100644 --- a/gfx/drivers/d3d.cpp +++ b/gfx/drivers/d3d.cpp @@ -18,10 +18,6 @@ #ifdef _XBOX #include #include -#else -#define UNICODE -#include -#include #endif #include diff --git a/gfx/drivers_font/d3d_w32_font.cpp b/gfx/drivers_font/d3d_w32_font.cpp index 5f4d8d9453..bf831d08d5 100644 --- a/gfx/drivers_font/d3d_w32_font.cpp +++ b/gfx/drivers_font/d3d_w32_font.cpp @@ -46,7 +46,7 @@ static void *d3dfonts_w32_init_font(void *video_data, OUT_TT_PRECIS, CLIP_DEFAULT_PRECIS, DEFAULT_PITCH, - L"Verdana" /* Hardcode FTL */ + "Verdana" /* Hardcode FTL */ }; d3dfonts = (d3dfonts_t*)calloc(1, sizeof(*d3dfonts)); diff --git a/input/drivers/dinput.c b/input/drivers/dinput.c index c5f96d0ec5..941f52759e 100644 --- a/input/drivers/dinput.c +++ b/input/drivers/dinput.c @@ -29,10 +29,6 @@ #define WM_MOUSEWHEEL 0x020A #endif -#define UNICODE -#include -#include - #include #include @@ -48,7 +44,7 @@ #include "../../configuration.h" #include "../../verbosity.h" -#include "../tasks/tasks_internal.h" +#include "../../tasks/tasks_internal.h" #include "../input_config.h" #include "../input_joypad_driver.h" #include "../input_keymaps.h" diff --git a/libretro-common/file/retro_dirent.c b/libretro-common/file/retro_dirent.c index dda73a682b..87b7e1bc7e 100644 --- a/libretro-common/file/retro_dirent.c +++ b/libretro-common/file/retro_dirent.c @@ -34,7 +34,6 @@ struct RDIR *retro_opendir(const char *name) { #if defined(_WIN32) char path_buf[1024] = {0}; - wchar_t pathW[1024] = {0}; #endif struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir)); @@ -43,8 +42,7 @@ struct RDIR *retro_opendir(const char *name) #if defined(_WIN32) snprintf(path_buf, sizeof(path_buf), "%s\\*", name); - MultiByteToWideChar(CP_UTF8, 0, path_buf, -1, pathW, sizeof(pathW) / sizeof(pathW[0])); - rdir->directory = FindFirstFileW(pathW, &rdir->entry); + rdir->directory = FindFirstFile(path_buf, &rdir->entry); #elif defined(VITA) || defined(PSP) rdir->directory = sceIoDopen(name); #elif defined(_3DS) @@ -77,7 +75,7 @@ int retro_readdir(struct RDIR *rdir) { #if defined(_WIN32) if(rdir->next) - return (FindNextFileW(rdir->directory, &rdir->entry) != 0); + return (FindNextFile(rdir->directory, &rdir->entry) != 0); else { rdir->next = true; return (rdir->directory != INVALID_HANDLE_VALUE); @@ -96,9 +94,7 @@ int retro_readdir(struct RDIR *rdir) const char *retro_dirent_get_name(struct RDIR *rdir) { #if defined(_WIN32) - memset(rdir->path, 0, sizeof(rdir->path)); - utf16_to_char_string(rdir->entry.cFileName, rdir->path, sizeof(rdir->path)); - return rdir->path; + return rdir->entry.cFileName; #elif defined(VITA) || defined(PSP) || defined(__CELLOS_LV2__) return rdir->entry.d_name; #else @@ -120,7 +116,7 @@ const char *retro_dirent_get_name(struct RDIR *rdir) bool retro_dirent_is_dir(struct RDIR *rdir, const char *path) { #if defined(_WIN32) - const WIN32_FIND_DATAW *entry = (const WIN32_FIND_DATAW*)&rdir->entry; + const WIN32_FIND_DATA *entry = (const WIN32_FIND_DATA*)&rdir->entry; return entry->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY; #elif defined(PSP) || defined(VITA) const SceIoDirent *entry = (const SceIoDirent*)&rdir->entry; diff --git a/libretro-common/file/retro_stat.c b/libretro-common/file/retro_stat.c index 95c79c18c3..0cd7fd9a4b 100644 --- a/libretro-common/file/retro_stat.c +++ b/libretro-common/file/retro_stat.c @@ -103,11 +103,9 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size) #elif defined(_WIN32) WIN32_FILE_ATTRIBUTE_DATA file_info; GET_FILEEX_INFO_LEVELS fInfoLevelId = GetFileExInfoStandard; - wchar_t path_wide[PATH_MAX_LENGTH] = {0}; - MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); + DWORD ret = GetFileAttributesEx(path, fInfoLevelId, &file_info); - DWORD ret = GetFileAttributesExW(path_wide, fInfoLevelId, &file_info); if (ret == 0) return false; #else diff --git a/libretro-common/include/retro_miscellaneous.h b/libretro-common/include/retro_miscellaneous.h index 2ab71c52dc..83d004b8a0 100644 --- a/libretro-common/include/retro_miscellaneous.h +++ b/libretro-common/include/retro_miscellaneous.h @@ -47,9 +47,6 @@ #if defined(_WIN32) && !defined(_XBOX) #define WIN32_LEAN_AND_MEAN -#define UNICODE -#include -#include #include #elif defined(_WIN32) && defined(_XBOX) #include diff --git a/libretro-common/streams/file_stream.c b/libretro-common/streams/file_stream.c index d9406dba80..b3ad1dcac9 100644 --- a/libretro-common/streams/file_stream.c +++ b/libretro-common/streams/file_stream.c @@ -26,9 +26,6 @@ #include #if defined(_WIN32) -# define UNICODE -# include -# include # ifdef _MSC_VER # define setmode _setmode # endif @@ -77,17 +74,10 @@ struct RFILE #define HAVE_BUFFERED_IO 1 -#ifdef _WIN32 -#define MODE_STR_READ L"r" -#define MODE_STR_READ_UNBUF L"rb" -#define MODE_STR_WRITE_UNBUF L"wb" -#define MODE_STR_WRITE_PLUS L"w+" -#else #define MODE_STR_READ "r" #define MODE_STR_READ_UNBUF "rb" #define MODE_STR_WRITE_UNBUF "wb" #define MODE_STR_WRITE_PLUS "w+" -#endif #if defined(HAVE_BUFFERED_IO) FILE *fp; @@ -117,12 +107,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) int flags = 0; int mode_int = 0; #if defined(HAVE_BUFFERED_IO) -#ifdef _WIN32 - const wchar_t *mode_str = NULL; - wchar_t path_wide[PATH_MAX_LENGTH] = {0}; -#else const char *mode_str = NULL; -#endif #endif RFILE *stream = (RFILE*)calloc(1, sizeof(*stream)); @@ -213,12 +198,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len) #if defined(HAVE_BUFFERED_IO) if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0) { -#ifdef _WIN32 - MultiByteToWideChar(CP_UTF8, 0, path, -1, path_wide, sizeof(path_wide) / sizeof(path_wide[0])); - stream->fp = _wfopen(path_wide, mode_str); -#else stream->fp = fopen(path, mode_str); -#endif if (!stream->fp) goto error; } diff --git a/ui/drivers/ui_win32.c b/ui/drivers/ui_win32.c index d2a3a44ec0..8a22a54b75 100644 --- a/ui/drivers/ui_win32.c +++ b/ui/drivers/ui_win32.c @@ -155,20 +155,20 @@ static void shader_dlg_params_refresh(void) bool checked = (shader_info.data->parameters[i].current == shader_info.data->parameters[i].maximum); - SendMessageW(control->checkbox.hwnd, BM_SETCHECK, checked, 0); + SendMessage(control->checkbox.hwnd, BM_SETCHECK, checked, 0); } break; case SHADER_PARAM_CTRL_TRACKBAR: shader_dlg_refresh_trackbar_label(i); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMIN, (WPARAM)TRUE, (LPARAM)0); - SendMessageW(control->trackbar.hwnd, + SendMessage(control->trackbar.hwnd, TBM_SETRANGEMAX, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].maximum - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); - SendMessageW(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETPOS, (WPARAM)TRUE, (LPARAM)((shader_info.data->parameters[i].current - shader_info.data->parameters[i].minimum) / shader_info.data->parameters[i].step)); @@ -234,12 +234,6 @@ void shader_dlg_params_reload(void) for (i = 0; i < (int)shader_info.data->num_parameters; i++) { shader_param_ctrl_t*control = &g_shader_dlg.controls[i]; - size_t param_desc_wide_size = sizeof(shader_info.data->parameters[i].desc) * 2; - wchar_t param_desc_wide[param_desc_wide_size]; - - memset(param_desc_wide, 0, sizeof(param_desc_wide)); - MultiByteToWideChar(CP_UTF8, 0, shader_info.data->parameters[i].desc, -1, param_desc_wide, sizeof(param_desc_wide) / sizeof(param_desc_wide[0])); - if ((shader_info.data->parameters[i].minimum == 0.0) && (shader_info.data->parameters[i].maximum @@ -255,12 +249,12 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_CHECKBOX; - control->checkbox.hwnd = CreateWindowExW(0, L"BUTTON", - param_desc_wide, + control->checkbox.hwnd = CreateWindowEx(0, "BUTTON", + shader_info.data->parameters[i].desc, WS_CHILD | WS_VISIBLE | BS_AUTOCHECKBOX, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; } else @@ -273,27 +267,27 @@ void shader_dlg_params_reload(void) } control->type = SHADER_PARAM_CTRL_TRACKBAR; - control->trackbar.label_title = CreateWindowExW(0, L"STATIC", - param_desc_wide, + control->trackbar.label_title = CreateWindowEx(0, "STATIC", + shader_info.data->parameters[i].desc, WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_title, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_LABEL_HEIGHT; - control->trackbar.hwnd = CreateWindowExW(0, TRACKBAR_CLASS, L"", + control->trackbar.hwnd = CreateWindowEx(0, TRACKBAR_CLASS, "", WS_CHILD | WS_VISIBLE | TBS_HORZ | TBS_NOTICKS, pos_x + SHADER_DLG_TRACKBAR_LABEL_WIDTH, pos_y, SHADER_DLG_TRACKBAR_WIDTH, SHADER_DLG_TRACKBAR_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - control->trackbar.label_val = CreateWindowExW(0, L"STATIC", L"", + control->trackbar.label_val = CreateWindowEx(0, "STATIC", "", WS_CHILD | WS_VISIBLE | SS_LEFT, pos_x, pos_y, SHADER_DLG_TRACKBAR_LABEL_WIDTH, SHADER_DLG_LABEL_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)(size_t)i, NULL, NULL); - SendMessageW(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); + SendMessage(control->trackbar.label_val, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); - SendMessageW(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, + SendMessage(control->trackbar.hwnd, TBM_SETBUDDY, (WPARAM)TRUE, (LPARAM)control->trackbar.label_val); pos_y += SHADER_DLG_TRACKBAR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -305,7 +299,7 @@ void shader_dlg_params_reload(void) if (window && g_shader_dlg.separator.hwnd) window->destroy(&g_shader_dlg.separator); - g_shader_dlg.separator.hwnd = CreateWindowExW(0, L"STATIC", L"", + g_shader_dlg.separator.hwnd = CreateWindowEx(0, "STATIC", "", SS_ETCHEDHORZ | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, g_shader_dlg.parameters_start_y - SHADER_DLG_CTRL_MARGIN - SHADER_DLG_SEPARATOR_HEIGHT / 2, (pos_x - SHADER_DLG_CTRL_X) + SHADER_DLG_CTRL_WIDTH, @@ -395,7 +389,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_CHECKBOX) break; - if (SendMessageW(g_shader_dlg.controls[i].checkbox.hwnd, + if (SendMessage(g_shader_dlg.controls[i].checkbox.hwnd, BM_GETCHECK, 0, 0) == BST_CHECKED) shader_info.data->parameters[i].current = shader_info.data->parameters[i].maximum; @@ -406,7 +400,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, break; case WM_HSCROLL: - i = GetWindowLongW((HWND)lparam, GWL_ID); + i = GetWindowLong((HWND)lparam, GWL_ID); if (i >= GFX_MAX_PARAMETERS) break; @@ -414,7 +408,7 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, if (g_shader_dlg.controls[i].type != SHADER_PARAM_CTRL_TRACKBAR) break; - pos = (int)SendMessageW(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); + pos = (int)SendMessage(g_shader_dlg.controls[i].trackbar.hwnd, TBM_GETPOS, 0, 0); shader_info.data->parameters[i].current = shader_info.data->parameters[i].minimum + pos * shader_info.data->parameters[i].step; @@ -423,24 +417,19 @@ static LRESULT CALLBACK ShaderDlgWndProc(HWND hwnd, UINT message, } - return DefWindowProcW(hwnd, message, wparam, lparam); + return DefWindowProc(hwnd, message, wparam, lparam); } bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name) { - wchar_t class_name_wide[1024] = {0}; - - if (class_name) - MultiByteToWideChar(CP_UTF8, 0, class_name, -1, class_name_wide, sizeof(class_name_wide) / sizeof(class_name_wide[0])); - wndclass->cbSize = sizeof(WNDCLASSEX); wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; - wndclass->hInstance = GetModuleHandleW(NULL); - wndclass->hCursor = LoadCursorW(NULL, IDC_ARROW); - wndclass->lpszClassName = (class_name != NULL) ? class_name_wide : L"RetroArch"; - wndclass->hIcon = LoadIconW(GetModuleHandleW(NULL), MAKEINTRESOURCE(IDI_ICON)); - wndclass->hIconSm = (HICON)LoadImageW(GetModuleHandleW(NULL), + wndclass->hInstance = GetModuleHandle(NULL); + wndclass->hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass->lpszClassName = (class_name != NULL) ? class_name : "RetroArch"; + wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON)); + wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0); if (!fullscreen) wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW; @@ -448,7 +437,7 @@ bool win32_window_init(WNDCLASSEX *wndclass, if (class_name != NULL) wndclass->style |= CS_CLASSDC; - if (!RegisterClassExW(wndclass)) + if (!RegisterClassEx(wndclass)) return false; /* This is non-NULL when we want a window for shader dialogs, @@ -473,7 +462,7 @@ bool win32_shader_dlg_init(void) if (!inited) { - WNDCLASSEXW wc_shader_dlg = {0}; + WNDCLASSEX wc_shader_dlg = {0}; INITCOMMONCONTROLSEX comm_ctrl_init = {0}; comm_ctrl_init.dwSize = sizeof(comm_ctrl_init); @@ -493,19 +482,19 @@ bool win32_shader_dlg_init(void) hFont = (HFONT)GetStockObject(DEFAULT_GUI_FONT); - g_shader_dlg.window.hwnd = CreateWindowExW(0, L"Shader Dialog", L"Shader Parameters", + g_shader_dlg.window.hwnd = CreateWindowEx(0, "Shader Dialog", "Shader Parameters", WS_POPUPWINDOW | WS_CAPTION, 100, 100, SHADER_DLG_WIDTH, SHADER_DLG_MIN_HEIGHT, NULL, NULL, NULL, NULL); pos_y = SHADER_DLG_CTRL_MARGIN; - g_shader_dlg.on_top_checkbox.hwnd = CreateWindowExW(0, L"BUTTON", L"Always on Top", + g_shader_dlg.on_top_checkbox.hwnd = CreateWindowEx(0, "BUTTON", "Always on Top", BS_AUTOCHECKBOX | WS_VISIBLE | WS_CHILD, SHADER_DLG_CTRL_X, pos_y, SHADER_DLG_CTRL_WIDTH, SHADER_DLG_CHECKBOX_HEIGHT, g_shader_dlg.window.hwnd, (HMENU)SHADER_DLG_CHECKBOX_ONTOP_ID, NULL, NULL); pos_y += SHADER_DLG_CHECKBOX_HEIGHT + SHADER_DLG_CTRL_MARGIN; - SendMessageW(g_shader_dlg.on_top_checkbox.hwnd, + SendMessage(g_shader_dlg.on_top_checkbox.hwnd, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0)); pos_y += SHADER_DLG_SEPARATOR_HEIGHT + SHADER_DLG_CTRL_MARGIN; @@ -676,7 +665,7 @@ LRESULT win32_menu_loop(HWND owner, WPARAM wparam) command_event(cmd, NULL); if (do_wm_close) - PostMessageW(owner, WM_CLOSE, 0, 0); + PostMessage(owner, WM_CLOSE, 0, 0); return 0L; } From 0c74d19112c723eeeab12b10591202cf73916466 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sat, 3 Dec 2016 06:46:53 +0100 Subject: [PATCH 189/638] (tasks/task_save) Replace some instances of runloop_msg_queue_push --- tasks/task_save.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/task_save.c b/tasks/task_save.c index 12cad9eda3..7ac203ed53 100644 --- a/tasks/task_save.c +++ b/tasks/task_save.c @@ -785,7 +785,7 @@ static void task_load_handler(retro_task_t *task) state->path, msg_hash_to_str(MSG_SUCCEEDED)); if (!task->mute) - runloop_msg_queue_push(msg, 1, 180, true); + task->title = strdup(msg); } else { @@ -796,7 +796,7 @@ static void task_load_handler(retro_task_t *task) settings->state_slot); if (!task->mute) - runloop_msg_queue_push(msg, 2, 180, true); + task->title = strdup(msg); } task_load_handler_finished(task, state); From b9031f47c6806718d583d28bd48241ad1bc13aaf Mon Sep 17 00:00:00 2001 From: lasers Date: Thu, 1 Dec 2016 21:16:00 -0600 Subject: [PATCH 190/638] Hide "Core Notes" --- menu/menu_displaylist.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 24ffc54d67..eb35cd1a72 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -408,12 +408,16 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info) if (core_info->notes) { - fill_pathname_noext(tmp, - msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES), - ": ", - sizeof(tmp)); - menu_entries_append_enum(info->list, tmp, "", - MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0); + +/* Disable "Core notes:" +* +* fill_pathname_noext(tmp, +* msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES), +* ": ", +* sizeof(tmp)); +* menu_entries_append_enum(info->list, tmp, "", +* MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0); +*/ for (i = 0; i < core_info->note_list->size; i++) { From 5dd34279373a590c5f598f52ed7036101ab9aecf Mon Sep 17 00:00:00 2001 From: lasers Date: Fri, 2 Dec 2016 02:10:19 -0600 Subject: [PATCH 191/638] Add (!) Notes --- menu/menu_displaylist.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index eb35cd1a72..4d4e6a6a93 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -381,7 +381,7 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info) { if (core_info->firmware[i].desc) { - snprintf(tmp, sizeof(tmp), " %s: %s", + snprintf(tmp, sizeof(tmp), "(!) %s: %s", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_RDB_ENTRY_NAME), core_info->firmware[i].desc ? core_info->firmware[i].desc : ""); @@ -389,7 +389,7 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info) MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0); - snprintf(tmp, sizeof(tmp), " %s: %s, %s", + snprintf(tmp, sizeof(tmp), "(!) %s: %s, %s", msg_hash_to_str(MENU_ENUM_LABEL_VALUE_STATUS), core_info->firmware[i].missing ? msg_hash_to_str(MENU_ENUM_LABEL_VALUE_MISSING) : From cd1860563b9e54317c14eed6162f683f3c3dfa7a Mon Sep 17 00:00:00 2001 From: lasers Date: Fri, 2 Dec 2016 03:15:02 -0600 Subject: [PATCH 192/638] Remove all Core Notes --- intl/msg_hash_chs.c | 2 -- intl/msg_hash_de.h | 2 -- intl/msg_hash_eo.h | 2 -- intl/msg_hash_es.c | 2 -- intl/msg_hash_fr.h | 2 -- intl/msg_hash_it.c | 2 -- intl/msg_hash_ja.h | 2 -- intl/msg_hash_nl.h | 2 -- intl/msg_hash_pl.c | 2 -- intl/msg_hash_pt.c | 2 -- intl/msg_hash_ru.h | 2 -- intl/msg_hash_us.h | 2 -- intl/msg_hash_vn.c | 2 -- menu/menu_displaylist.c | 11 ----------- msg_hash.h | 1 - 15 files changed, 38 deletions(-) diff --git a/intl/msg_hash_chs.c b/intl/msg_hash_chs.c index 524e028390..f5af3b9715 100644 --- a/intl/msg_hash_chs.c +++ b/intl/msg_hash_chs.c @@ -2066,8 +2066,6 @@ const char *msg_hash_to_str_chs(enum msg_hash_enums msg) return "核心标签"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: return "核心名称"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "核心说明"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "固件"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: diff --git a/intl/msg_hash_de.h b/intl/msg_hash_de.h index ea8f5f638a..82849646be 100644 --- a/intl/msg_hash_de.h +++ b/intl/msg_hash_de.h @@ -106,8 +106,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Core-Beschriftung") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Core-Name") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core-Hinweise") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_eo.h b/intl/msg_hash_eo.h index 2de206143c..b4bd51e63e 100644 --- a/intl/msg_hash_eo.h +++ b/intl/msg_hash_eo.h @@ -436,8 +436,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Core label") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Core name") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core notes") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_es.c b/intl/msg_hash_es.c index cc8da4497d..68b3d4d914 100644 --- a/intl/msg_hash_es.c +++ b/intl/msg_hash_es.c @@ -1615,8 +1615,6 @@ const char *msg_hash_to_str_es(enum msg_hash_enums msg) return "Etiqueta del núcleo"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: return "Nombre del núcleo"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Notas del núcleo"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "Firmware"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: diff --git a/intl/msg_hash_fr.h b/intl/msg_hash_fr.h index 62fbcc4d50..1aa1e7dd14 100644 --- a/intl/msg_hash_fr.h +++ b/intl/msg_hash_fr.h @@ -432,8 +432,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Label") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Nom") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Notes") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_it.c b/intl/msg_hash_it.c index 9075205d3f..9ebe0c6e37 100644 --- a/intl/msg_hash_it.c +++ b/intl/msg_hash_it.c @@ -1876,8 +1876,6 @@ const char *msg_hash_to_str_it(enum msg_hash_enums msg) return "Estensioni supportate"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "Firmware"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Note del core"; case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_BUILD_DATE: return "Data della build"; case MENU_ENUM_LABEL_VALUE_SYSTEM_INFO_GIT_VERSION: diff --git a/intl/msg_hash_ja.h b/intl/msg_hash_ja.h index e06ed3f55e..debddc98ae 100644 --- a/intl/msg_hash_ja.h +++ b/intl/msg_hash_ja.h @@ -446,8 +446,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "コアのラベル") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "コアの名前") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "コアのメモ") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "ファームウェア") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_nl.h b/intl/msg_hash_nl.h index fbbba7b8d1..e08cf04c79 100644 --- a/intl/msg_hash_nl.h +++ b/intl/msg_hash_nl.h @@ -436,8 +436,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Core label") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Core naam") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core opmerkingen") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_pl.c b/intl/msg_hash_pl.c index e53dfa161b..c087613b45 100644 --- a/intl/msg_hash_pl.c +++ b/intl/msg_hash_pl.c @@ -136,8 +136,6 @@ const char *msg_hash_to_str_pl(enum msg_hash_enums msg) return "Oznaczenie rdzenia"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: return "Nazwa rdzenia"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Dodatkowe informacje o rdzeniu"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "Firmware"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: diff --git a/intl/msg_hash_pt.c b/intl/msg_hash_pt.c index 1218c80f1d..0674f633aa 100644 --- a/intl/msg_hash_pt.c +++ b/intl/msg_hash_pt.c @@ -1074,8 +1074,6 @@ const char *msg_hash_to_str_pt(enum msg_hash_enums msg) return "Rótulo do core"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: return "Nome do core"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Notas do core"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "Firmware"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: diff --git a/intl/msg_hash_ru.h b/intl/msg_hash_ru.h index 8fc44eeefa..aa6f2726b3 100644 --- a/intl/msg_hash_ru.h +++ b/intl/msg_hash_ru.h @@ -436,8 +436,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Core label") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Core name") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core notes") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_us.h b/intl/msg_hash_us.h index 3756fe6e88..7f3350c1fe 100644 --- a/intl/msg_hash_us.h +++ b/intl/msg_hash_us.h @@ -440,8 +440,6 @@ MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_LABEL, "Core label") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME, "Core name") -MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, - "Core notes") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, "Firmware") MSG_HASH(MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, diff --git a/intl/msg_hash_vn.c b/intl/msg_hash_vn.c index ae666a994a..86a564e825 100644 --- a/intl/msg_hash_vn.c +++ b/intl/msg_hash_vn.c @@ -2110,8 +2110,6 @@ const char *msg_hash_to_str_vn(enum msg_hash_enums msg) return "Core label"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NAME: return "Core name"; - case MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES: - return "Core notes"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE: return "Firmware"; case MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES: diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 4d4e6a6a93..859e377584 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -408,17 +408,6 @@ static int menu_displaylist_parse_core_info(menu_displaylist_info_t *info) if (core_info->notes) { - -/* Disable "Core notes:" -* -* fill_pathname_noext(tmp, -* msg_hash_to_str(MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES), -* ": ", -* sizeof(tmp)); -* menu_entries_append_enum(info->list, tmp, "", -* MENU_ENUM_LABEL_CORE_INFO_ENTRY, MENU_SETTINGS_CORE_INFO_NONE, 0, 0); -*/ - for (i = 0; i < core_info->note_list->size; i++) { strlcpy(tmp, diff --git a/msg_hash.h b/msg_hash.h index 11de0792c2..818b6abf94 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -1324,7 +1324,6 @@ enum msg_hash_enums MENU_ENUM_LABEL_VALUE_CORE_INFO_LICENSES, MENU_ENUM_LABEL_VALUE_CORE_INFO_SUPPORTED_EXTENSIONS, MENU_ENUM_LABEL_VALUE_CORE_INFO_FIRMWARE, - MENU_ENUM_LABEL_VALUE_CORE_INFO_CORE_NOTES, /* System information */ From 98f0d4d45b18d5e8f302ff7e055aa14fc58ff0e0 Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Sat, 3 Dec 2016 09:46:20 -0500 Subject: [PATCH 193/638] Better error messages when the Netplay handshake fails --- network/netplay/netplay_common.c | 50 ++++++++++++++++++++------------ 1 file changed, 31 insertions(+), 19 deletions(-) diff --git a/network/netplay/netplay_common.c b/network/netplay/netplay_common.c index 16779d54d7..d10a7072b8 100644 --- a/network/netplay/netplay_common.c +++ b/network/netplay/netplay_common.c @@ -170,7 +170,7 @@ bool netplay_handshake(netplay_t *netplay) bool is_server = netplay->is_server; int compression = 0; - msg[0] = '\0'; + msg[0] = msg[sizeof(msg)-1] = '\0'; mem_info.id = RETRO_MEMORY_SAVE_RAM; @@ -190,22 +190,21 @@ bool netplay_handshake(netplay_t *netplay) if (!socket_receive_all_blocking(netplay->fd, header, sizeof(header))) { - RARCH_ERR("%s\n", - msg_hash_to_str(MSG_FAILED_TO_RECEIVE_HEADER_FROM_CLIENT)); - return false; + strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_HEADER_FROM_CLIENT), sizeof(msg)-1); + goto error; } if (*content_crc_ptr != ntohl(header[0])) { - RARCH_ERR("%s\n", msg_hash_to_str(MSG_CONTENT_CRC32S_DIFFER)); - return false; + strncpy(msg, msg_hash_to_str(MSG_CONTENT_CRC32S_DIFFER), sizeof(msg)-1); + goto error; } if (netplay_impl_magic() != ntohl(header[1])) { - RARCH_ERR("Implementations differ, make sure you're using exact same " - "libretro implementations and RetroArch version.\n"); - return false; + strncpy(msg, "Implementations differ. Make sure you're using exact same " + "libretro implementations and RetroArch version.", sizeof(msg)-1); + goto error; } /* Some cores only report the correct sram size late, so we can't actually @@ -223,13 +222,17 @@ bool netplay_handshake(netplay_t *netplay) netplay_endian_mismatch(local_pmagic, remote_pmagic)) { RARCH_ERR("Endianness mismatch with an endian-sensitive core.\n"); - return false; + strncpy(msg, "This core does not support inter-architecture netplay " + "between these systems.", sizeof(msg)-1); + goto error; } if ((netplay->quirks & NETPLAY_QUIRK_PLATFORM_DEPENDENT) && (local_pmagic != remote_pmagic)) { RARCH_ERR("Platform mismatch with a platform-sensitive core.\n"); - return false; + strncpy(msg, "This core does not support inter-architecture netplay.", + sizeof(msg)-1); + goto error; } /* Clear any existing compression */ @@ -267,21 +270,22 @@ bool netplay_handshake(netplay_t *netplay) { if (!netplay_send_nickname(netplay, netplay->fd)) { - RARCH_ERR("%s\n", - msg_hash_to_str(MSG_FAILED_TO_SEND_NICKNAME_TO_HOST)); - return false; + strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_SEND_NICKNAME_TO_HOST), + sizeof(msg)-1); + goto error; } } if (!netplay_get_nickname(netplay, netplay->fd)) { if (is_server) - RARCH_ERR("%s\n", - msg_hash_to_str(MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT)); + strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT), + sizeof(msg)-1); else - RARCH_ERR("%s\n", - msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST)); - return false; + strncpy(msg, + msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST), + sizeof(msg)-1); + goto error; } if (is_server) @@ -378,6 +382,14 @@ bool netplay_handshake(netplay_t *netplay) } return true; + +error: + if (msg[0]) + { + RARCH_ERR("%s\n", msg); + runloop_msg_queue_push(msg, 1, 180, false); + } + return false; } bool netplay_is_server(netplay_t* netplay) From f725f380616bfa832de4a97ce6ae21d61de0ac3f Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Sat, 3 Dec 2016 09:58:16 -0500 Subject: [PATCH 194/638] Use strlcpy --- network/netplay/netplay_common.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/network/netplay/netplay_common.c b/network/netplay/netplay_common.c index d10a7072b8..73e1632886 100644 --- a/network/netplay/netplay_common.c +++ b/network/netplay/netplay_common.c @@ -19,6 +19,7 @@ #include "netplay_private.h" #include +#include #include @@ -170,7 +171,7 @@ bool netplay_handshake(netplay_t *netplay) bool is_server = netplay->is_server; int compression = 0; - msg[0] = msg[sizeof(msg)-1] = '\0'; + msg[0] = '\0'; mem_info.id = RETRO_MEMORY_SAVE_RAM; @@ -190,20 +191,20 @@ bool netplay_handshake(netplay_t *netplay) if (!socket_receive_all_blocking(netplay->fd, header, sizeof(header))) { - strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_HEADER_FROM_CLIENT), sizeof(msg)-1); + strlcpy(msg, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_HEADER_FROM_CLIENT), sizeof(msg)); goto error; } if (*content_crc_ptr != ntohl(header[0])) { - strncpy(msg, msg_hash_to_str(MSG_CONTENT_CRC32S_DIFFER), sizeof(msg)-1); + strlcpy(msg, msg_hash_to_str(MSG_CONTENT_CRC32S_DIFFER), sizeof(msg)); goto error; } if (netplay_impl_magic() != ntohl(header[1])) { - strncpy(msg, "Implementations differ. Make sure you're using exact same " - "libretro implementations and RetroArch version.", sizeof(msg)-1); + strlcpy(msg, "Implementations differ. Make sure you're using exact same " + "libretro implementations and RetroArch version.", sizeof(msg)); goto error; } @@ -222,16 +223,16 @@ bool netplay_handshake(netplay_t *netplay) netplay_endian_mismatch(local_pmagic, remote_pmagic)) { RARCH_ERR("Endianness mismatch with an endian-sensitive core.\n"); - strncpy(msg, "This core does not support inter-architecture netplay " - "between these systems.", sizeof(msg)-1); + strlcpy(msg, "This core does not support inter-architecture netplay " + "between these systems.", sizeof(msg)); goto error; } if ((netplay->quirks & NETPLAY_QUIRK_PLATFORM_DEPENDENT) && (local_pmagic != remote_pmagic)) { RARCH_ERR("Platform mismatch with a platform-sensitive core.\n"); - strncpy(msg, "This core does not support inter-architecture netplay.", - sizeof(msg)-1); + strlcpy(msg, "This core does not support inter-architecture netplay.", + sizeof(msg)); goto error; } @@ -270,8 +271,8 @@ bool netplay_handshake(netplay_t *netplay) { if (!netplay_send_nickname(netplay, netplay->fd)) { - strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_SEND_NICKNAME_TO_HOST), - sizeof(msg)-1); + strlcpy(msg, msg_hash_to_str(MSG_FAILED_TO_SEND_NICKNAME_TO_HOST), + sizeof(msg)); goto error; } } @@ -279,12 +280,12 @@ bool netplay_handshake(netplay_t *netplay) if (!netplay_get_nickname(netplay, netplay->fd)) { if (is_server) - strncpy(msg, msg_hash_to_str(MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT), - sizeof(msg)-1); + strlcpy(msg, msg_hash_to_str(MSG_FAILED_TO_GET_NICKNAME_FROM_CLIENT), + sizeof(msg)); else - strncpy(msg, + strlcpy(msg, msg_hash_to_str(MSG_FAILED_TO_RECEIVE_NICKNAME_FROM_HOST), - sizeof(msg)-1); + sizeof(msg)); goto error; } From 53c30cacd5eca9591b1462378a5dc8d332ed6292 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Sat, 3 Dec 2016 16:05:04 +0100 Subject: [PATCH 195/638] Correctly check errors if preset cannot be found. --- gfx/drivers_shader/shader_vulkan.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gfx/drivers_shader/shader_vulkan.cpp b/gfx/drivers_shader/shader_vulkan.cpp index 70b8a292ea..e72703df20 100644 --- a/gfx/drivers_shader/shader_vulkan.cpp +++ b/gfx/drivers_shader/shader_vulkan.cpp @@ -2851,7 +2851,7 @@ vulkan_filter_chain_t *vulkan_filter_chain_create_from_preset( return nullptr; unique_ptr conf{ config_file_new(path) }; - if (!path) + if (!conf) return nullptr; if (!video_shader_read_conf_cgp(conf.get(), shader.get())) From d386f635256da5a539e41fbcd5e32ddea1493bf3 Mon Sep 17 00:00:00 2001 From: Rob Loach Date: Sat, 3 Dec 2016 11:44:26 -0500 Subject: [PATCH 196/638] [Emscripten] Add Tooltips to the buttons --- pkg/emscripten/libretro/index.html | 18 ++++----- pkg/emscripten/libretro/libretro.js | 61 ++++++++++++++++------------- 2 files changed, 42 insertions(+), 37 deletions(-) diff --git a/pkg/emscripten/libretro/index.html b/pkg/emscripten/libretro/index.html index e0a77e1ea9..855a69489e 100644 --- a/pkg/emscripten/libretro/index.html +++ b/pkg/emscripten/libretro/index.html @@ -10,12 +10,12 @@ - + - + - +