diff --git a/ChangeLog b/ChangeLog index 90fc3b86d..3dea0bebb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,42 @@ +Version 2.5.42dev: + +* Map gamepad start button to menu when in Amiga joystick mode (not CD32). +* Map gamepad select button to pause action. +* Added/updated some XInput controller configs for DirectInput mode. + +Version 2.5.41dev: + +* Implement action_pause to make action key configurable. +* Separate auto-fire button (based on patch from S. Jordan). +* Dedicated auto-fire button mapped to "right trigger" by default. +* New boolean option jit_compiler (to enable/disable JIT compilation). +* New option jit_memory (=direct/indirect). +* JIT compiler defaults to direct memory access on all platforms now. +* JIT direct memory exception handler for OS X (32-bit). +* Imported updated translations from crowdin.com. + +Version 2.5.40dev: + +* Use SetUnhandledExceptionFilter on Windows for JIT direct memory. +* Unified (segfault) exception handler for Windows and Linux. +* Fixed mman for compatibility with JIT direct memory access. +* Re-enable uae_comp_trust* = indirectKS options. +* Allow uae_rtc to be set without disabling uae_chipset_compatible. +* Fixed flickering caused by undefined behavior in shift operations. +* Added new option log_bsdsocket (boolean). + +Version 2.5.39dev: + +* Updated config for Logitech F310 and added Thrustmaster Dual Action 4. +* Updated AROS kickstart replacement to ver. 2015-05-20 from WinUAE 3.1.0. +* Config files must end with .fs-uae or .conf to be loaded by FS-UAE. +* If you give fs-uae a command line argument with path to a .adf, it will + be used as value for floppy_drive_0. +* Imported updated translations from crowdin.com. + Version 2.5.38dev: -* Several new and update joystick and gamepad configs. +* Several new and updated joystick and gamepad configs. * Built-in configs for Xbox 360 / One pads on OS X (requires driver). * Changed default stereo separation setting to 70%. * Windows builds are digitally signed again. diff --git a/ISSUES b/ISSUES index f73ee3e35..2efeb0976 100644 --- a/ISSUES +++ b/ISSUES @@ -1,3 +1,9 @@ -* When entering the GUI using modifier+F12, the modifier key(s) sticks in - the emulated Amiga when you return to the emulation. -* Graphical flickering in Workbench with non-cycle-exact emulation. +* Amiga key sticks when opening/closing FS-UAE menu with modifier+F12 + https://github.com/FrodeSolheim/fs-uae/issues/77 + +* FS-UAE freezes with black screen on Windows / nVIDIA? + https://github.com/FrodeSolheim/fs-uae/issues/75 + +* Black screen when FS-UAE is started from FS-UAE Arcade? + https://github.com/FrodeSolheim/fs-uae/issues/76 + https://github.com/FrodeSolheim/fs-uae-arcade/issues/6 diff --git a/Makefile.am b/Makefile.am index 02ac4e52a..3aeea2a1d 100644 --- a/Makefile.am +++ b/Makefile.am @@ -441,6 +441,7 @@ libuae_a_SOURCES = \ src/od-fs/machdep/ppc/maccess.h \ src/od-fs/machdep/rpt.h \ src/od-fs/machdep/x86/maccess.h \ + src/od-fs/mman.cpp \ src/od-fs/mouse.cpp \ src/od-fs/mp3decoder.h \ src/od-fs/parser.cpp \ @@ -467,7 +468,6 @@ libuae_a_SOURCES = \ src/od-win32/debug_win32.h \ src/od-win32/dxwrap.h \ src/od-win32/md-fpp.h \ - src/od-win32/mman.cpp \ src/od-win32/parser.h \ src/od-win32/picasso96_win.cpp \ src/od-win32/picasso96_win.h \ @@ -554,6 +554,7 @@ libfsemu_a_SOURCES = \ libfsemu/include/fs/data.h \ libfsemu/include/fs/defines.h \ libfsemu/include/fs/emu.h \ + libfsemu/include/fs/emu/actions.h \ libfsemu/include/fs/emu/audio.h \ libfsemu/include/fs/emu/benchmark.h \ libfsemu/include/fs/emu/buffer.h \ @@ -594,7 +595,6 @@ libfsemu_a_SOURCES = \ libfsemu/src/conf.c \ libfsemu/src/data.c \ libfsemu/src/emu/actions.c \ - libfsemu/src/emu/actions.h \ libfsemu/src/emu/audio.h \ libfsemu/src/emu/audio_common.c \ libfsemu/src/emu/audio_debug.c \ @@ -1161,8 +1161,10 @@ EXTRA_DIST = $(TESTS) $(EXTRA_TESTS) \ src/inputevents.def \ src/jit/compemu_optimizer_x86.cpp \ src/jit/compemu_raw_x86.cpp \ + src/jit/exception_handler.cpp \ src/od-fs/bsdsocket_posix.cpp \ src/od-win32/bsdsock.cpp \ + src/od-win32/mman.cpp \ src/p96_blit.cpp \ src/sinctable.cpp \ src/table68k \ diff --git a/README b/README index 50aa22278..1b568d9ae 100644 --- a/README +++ b/README @@ -220,7 +220,7 @@ SUPPORTED HOST OPERATING SYSTEM =============================== - Linux - Windows XP or newer -- Mac OS X 10.5 or newer +- Mac OS X 10.6 or newer - FreeBSD (Other Unices will probably also work just fine) @@ -256,7 +256,7 @@ in the floppy list, some may be obscured. COPYRIGHT AND CREDITS ===================== -FS-UAE is Copyright (c) 2011-2014, Frode Solheim +FS-UAE is Copyright (c) 2011-2015, Frode Solheim Large portions are copyrighted by other individuals. FS-UAE is based on the fantastic work of the original UAE authors, the authors @@ -270,12 +270,10 @@ contributors (see the UAE distribution for full credits). WinUAE has been developed and maintained by Mathias Ortmann and Toni Wilen. Toni Wilen has developed WinUAE for the last years and is the current maintainer. E-UAE was developed by Richard Drummond (no longer maintained), -and P-UAE is developed by Mustafa "GnoStiC" TUFAN. +and P-UAE is developed by Mustafa "GnoStiC" TUFAN (no longer maintained). -http://www.amigaemulator.org/ http://www.winuae.net/ http://www.rcdrummond.net/uae/ -https://github.com/GnoStiC/PUAE http://www.softpres.org/ libfsemu is Copyright (c) 2011-2013, Frode Solheim diff --git a/configure.ac b/configure.ac index df0374b49..59523e302 100644 --- a/configure.ac +++ b/configure.ac @@ -150,8 +150,8 @@ PKG_CHECK_MODULES([OPENAL], [openal], [ AS_CASE([$host_os], [darwin*], [ AC_MSG_NOTICE([Using OpenAL.framework]) - #OPENAL_CFLAGS="-I/System/Library/Frameworks/OpenAL.framework/Headers" - OPENAL_CFLAGS="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/System/Library/Frameworks/OpenAL.framework/Headers" + OPENAL_CFLAGS="-I/System/Library/Frameworks/OpenAL.framework/Headers" + # OPENAL_CFLAGS="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/System/Library/Frameworks/OpenAL.framework/Headers" OPENAL_LIBS="-framework OpenAL" ], @@ -333,6 +333,8 @@ AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec]) AC_CHECK_MEMBERS([struct stat.st_mtimespec.tv_nsec]) AC_CHECK_MEMBERS([struct stat.st_mtime_nsec]) AC_CHECK_MEMBERS([struct in_addr.S_un]) +AC_CHECK_MEMBERS([struct ucontext.uc_mcontext.gregs], + [], [], [[#include ]]) AC_CHECK_TYPES([ptrdiff_t]) AC_STRUCT_ST_BLOCKS @@ -349,6 +351,7 @@ AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT64_T AC_TYPE_UINT8_T +AC_CHECK_TYPES([__uint128_t]) AC_TYPE_LONG_LONG_INT AC_CHECK_SIZEOF(int) diff --git a/debian/changelog b/debian/changelog index 28375fb05..4e7bf1bd7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,4 +2,4 @@ fs-uae (2.6.0~beta2-0) unstable; urgency=low * Dummy changelog entry. - -- Frode Solheim Sun, 9 Aug 2015 19:22:41 +0200 + -- Frode Solheim Sun, 20 Sep 2015 21:52:53 +0200 diff --git a/doc/options/jit_compiler b/doc/options/jit_compiler new file mode 100644 index 000000000..57d4f0b6d --- /dev/null +++ b/doc/options/jit_compiler @@ -0,0 +1 @@ +Type: Boolean diff --git a/doc/options/jit_memory b/doc/options/jit_memory new file mode 100644 index 000000000..1c1815b33 --- /dev/null +++ b/doc/options/jit_memory @@ -0,0 +1,4 @@ +Type: Choice + +Value: direct +Value: indirect diff --git a/doc/options/log_autoscale b/doc/options/log_autoscale new file mode 100644 index 000000000..634ba5579 --- /dev/null +++ b/doc/options/log_autoscale @@ -0,0 +1,7 @@ +Summary: Log Autoscale Changes +Type: boolean +Default: 0 +Example: 1 + +This option will cause changes in autoscale coordinates to be logged to +the log file *and* stdout. diff --git a/doc/options/log_bsdsocket b/doc/options/log_bsdsocket new file mode 100644 index 000000000..9988a9b00 --- /dev/null +++ b/doc/options/log_bsdsocket @@ -0,0 +1,4 @@ +Summary: +Type: boolean +Default: 0 +Example: 1 diff --git a/doc/options/uae_gfx_linemode b/doc/options/uae_gfx_linemode index 4be386855..db56a13e1 100644 --- a/doc/options/uae_gfx_linemode +++ b/doc/options/uae_gfx_linemode @@ -2,23 +2,23 @@ Description: Controls how lines are doubled and interlaced modes are handled Example: double2 Type: choice -Value: none ("Single / Single") +Value: none (Single / Single) -Value: double ("Double / Double Frames") -value: double2 ("Double / Double Fields") -Value: double3 ("Double / Double Fields+") +Value: double (Double / Double Frames) +value: double2 (Double / Double Fields) +Value: double3 (Double / Double Fields+) -Value: scanlines ("Scanlines / Double Frames") -Value: scanlines2 ("Scanlines / Double Fields") -Value: scanlines3 ("Scanlines / Double Fields+") +Value: scanlines (Scanlines / Double Frames) +Value: scanlines2 (Scanlines / Double Fields) +Value: scanlines3 (Scanlines / Double Fields+) -Value: scanlines2p ("Double Fields / Double Frames") -value: scanlines2p2 ("Double Fields / Double Fields") -Value: scanlines2p3 ("Double Fields / Double Fields+") +Value: scanlines2p (Double Fields / Double Frames) +value: scanlines2p2 (Double Fields / Double Fields) +Value: scanlines2p3 (Double Fields / Double Fields+) -Value: scanlines3p ("Double Fields+ / Double Frames") -Value: scanlines3p2 ("Double Fields+ / Double Fields") -Value: scanlines3p3 ("Double Fields+ / Double Fields+") +Value: scanlines3p (Double Fields+ / Double Frames) +Value: scanlines3p2 (Double Fields+ / Double Fields) +Value: scanlines3p3 (Double Fields+ / Double Fields+) Single: Non-interlaced lines are not doubled. diff --git a/doc/options/uae_rtc b/doc/options/uae_rtc index fe5161ea8..ff51283c1 100644 --- a/doc/options/uae_rtc +++ b/doc/options/uae_rtc @@ -11,7 +11,7 @@ want to override this option, you may also have to set Value: auto ("Auto") - Automatically enable RTC module for some Amiga models. Value: none ("None") - Real time clock is explicitly disabled. -Value: MSM6242B (Oki MSM6242B)- RTC module in A500/500+/600/1200/2000 models. +Value: MSM6242B (Oki MSM6242B) - RTC module in A500/500+/600/1200/2000 models. Value: RP5C01A (Ricoh RP5C01A) - RTC module in big-box Amigas (A3000, A4000). Value: MSM6242B_A2000 (A2000 MSM6242B) - Only used in very early A2000 revisions, not even WB 1.3 supports it. diff --git a/libfsemu/README b/libfsemu/README index 5bf0c0f6f..40108a019 100644 --- a/libfsemu/README +++ b/libfsemu/README @@ -1,4 +1,4 @@ -libfsemu is Copyright (c) 2011-2014, Frode Solheim, licensed under the +libfsemu is Copyright (c) 2011-2015, Frode Solheim, licensed under the terms of the GNU Lesser General Public License (See COPYING). diff --git a/libfsemu/include/fs/emu/actions.h b/libfsemu/include/fs/emu/actions.h new file mode 100644 index 000000000..33a68fc13 --- /dev/null +++ b/libfsemu/include/fs/emu/actions.h @@ -0,0 +1,12 @@ +#ifndef LIBFSEMU_ACTIONS_H +#define LIBFSEMU_ACTIONS_H + +#define FS_EMU_ACTION_TAUNT 0xc001 +#define FS_EMU_ACTION_SCREENSHOT 0xc002 +#define FS_EMU_ACTION_PAUSE 0xc003 +#define FS_EMU_ACTION_MENU_ALT 0xc004 + +void fs_emu_handle_libfsemu_action(int action, int state); + +#endif /* LIBFSEMU_ACTIONS_H */ + diff --git a/libfsemu/include/fs/lazyness.h b/libfsemu/include/fs/lazyness.h index 78d61be00..7b74a240b 100644 --- a/libfsemu/include/fs/lazyness.h +++ b/libfsemu/include/fs/lazyness.h @@ -3,4 +3,7 @@ extern int g_fs_log_input; +/* bsdsocket.h (uae) */ +extern int log_bsd; + #endif /* FS_LAZYNESS_H */ diff --git a/libfsemu/src/emu/actions.c b/libfsemu/src/emu/actions.c index 54225bd93..945b79ac6 100644 --- a/libfsemu/src/emu/actions.c +++ b/libfsemu/src/emu/actions.c @@ -21,14 +21,12 @@ #endif #include +#include +#include #include - -#include "actions.h" #include "video.h" - #include - static const char* g_taunts[] = { "You play like a dairy farmer!", "No one will ever catch ME playing as badly as you do!", @@ -42,21 +40,28 @@ static const char* g_taunts[] = { }; static int g_num_taunts = 8; -static void taunt() { +static void taunt() +{ char *text = g_strdup_printf("%c%s\n", 1, g_taunts[g_random_int_range(0, g_num_taunts)]); fs_emu_netplay_say(text); g_free(text); } -void fs_emu_handle_libfsemu_action(int action, int state) { - printf("internal action %d %d\n", action, state); +void fs_emu_handle_libfsemu_action(int action, int state) +{ + if (g_fs_log_input) { + fs_log("fs_emu_handle_libfsemu_action %d %d\n", action, state); + } if (state) { - if (action == FS_EMU_ACTION_TAUNT) { + if (action == FS_EMU_ACTION_MENU_ALT) { + fs_emu_menu_toggle(); + } else if (action == FS_EMU_ACTION_TAUNT) { taunt(); - } - else if (action == FS_EMU_ACTION_SCREENSHOT) { + } else if (action == FS_EMU_ACTION_SCREENSHOT) { g_fs_emu_screenshot = 1; + } else if (action == FS_EMU_ACTION_PAUSE) { + fs_emu_pause(!fs_emu_is_paused()); } } } diff --git a/libfsemu/src/emu/actions.h b/libfsemu/src/emu/actions.h deleted file mode 100644 index 6ea32c609..000000000 --- a/libfsemu/src/emu/actions.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef LIBFSEMU_ACTIONS_H_ -#define LIBFSEMU_ACTIONS_H_ - -#define FS_EMU_ACTION_TAUNT 0xc001 -#define FS_EMU_ACTION_SCREENSHOT 0xc002 - -void fs_emu_handle_libfsemu_action(int action, int state); - -#endif // LIBFSEMU_ACTIONS_H_ diff --git a/libfsemu/src/emu/input.c b/libfsemu/src/emu/input.c index aa6efc273..122cbe6a4 100644 --- a/libfsemu/src/emu/input.c +++ b/libfsemu/src/emu/input.c @@ -8,7 +8,6 @@ #include #include #include "input.h" - #include #include #include @@ -17,8 +16,7 @@ #include #include #include - -#include "actions.h" +#include #include "hud.h" #include "menu.h" #include "netplay.h" @@ -627,13 +625,16 @@ void fs_emu_map_custom_actions() { map_custom_joystick_actions(); } -void fs_emu_set_actions(fs_emu_action *actions) { +void fs_emu_set_actions(fs_emu_action *actions) +{ int k = 0; g_actions[k].name = "action_taunt"; g_actions[k++].input_event = FS_EMU_ACTION_TAUNT; g_actions[k].name = "action_screenshot"; g_actions[k++].input_event = FS_EMU_ACTION_SCREENSHOT; + g_actions[k].name = "action_pause"; + g_actions[k++].input_event = FS_EMU_ACTION_PAUSE; while (actions->name) { if (k == MAX_ACTIONS) { diff --git a/libfsemu/src/emu/menu.c b/libfsemu/src/emu/menu.c index ffa8446e9..15a886547 100644 --- a/libfsemu/src/emu/menu.c +++ b/libfsemu/src/emu/menu.c @@ -181,6 +181,9 @@ void fs_emu_menu_function(int action, int state) { else if (action == ACTION_MENU_BACK) { go_back_in_menu_stack(); } + else if (action == ACTION_MENU_START) { + fs_emu_menu_toggle(); + } else if (action == ACTION_MENU_ESCAPE) { if (!go_back_in_menu_stack()) { // no more menus to back out of, go out of menu mode instead @@ -680,8 +683,9 @@ void fs_emu_menu_render(double transition) { glPopMatrix(); } -void fs_emu_menu_toggle() { - fs_emu_log("fs_emu_toggle_menu\n"); +void fs_emu_menu_toggle() +{ + fs_emu_log("fs_emu_menu_toggle\n"); if (g_fs_emu_menu_mode) { // leave menu g_fs_emu_menu_mode = 0; diff --git a/libfsemu/src/emu/theme.c b/libfsemu/src/emu/theme.c index ad65cce5b..92fa8f201 100644 --- a/libfsemu/src/emu/theme.c +++ b/libfsemu/src/emu/theme.c @@ -81,13 +81,8 @@ char *fs_emu_theme_get_resource_path(const char *name) { return NULL; } -int fs_emu_theme_get_resource_data(const char *name, char **data, int *size) { - // printf("fs_emu_theme_get_resource_data (%s)\n", name); - /* - if (fs_path_exists(name)) { - return g_strdup(name); - } - */ +int fs_emu_theme_get_resource_data(const char *name, char **data, int *size) +{ char *p; p = g_build_filename(g_fs_emu_theme.path, name, NULL); if (fs_path_exists(p)) { @@ -108,13 +103,13 @@ int fs_emu_theme_get_resource_data(const char *name, char **data, int *size) { } *data = malloc(*size); if (fread(*data, *size, 1, f) != 1) { + free(*data); fclose(f); return 3; } fclose(f); return 0; - } - else { + } else { free(p); } diff --git a/libfsemu/src/log.c b/libfsemu/src/log.c index 866ea899c..d5b41f2f7 100644 --- a/libfsemu/src/log.c +++ b/libfsemu/src/log.c @@ -41,7 +41,7 @@ static void initialize() log.initial_path = g_build_filename(dir, "fs-uae.log", NULL); log.file = g_fopen(log.initial_path, "w"); if (log.file) { - printf("logging to %s\n", log.initial_path); + // printf("[LOG] %s\n", log.initial_path); } g_free(dir); } @@ -60,7 +60,7 @@ void fs_config_set_log_file(const char *path) } log.file = g_fopen(path, "w"); if (log.file) { - printf("logging to %s\n", path); + printf("LOG: %s\n", path); if (log.initial_path) { FILE *f = g_fopen(log.initial_path, "r"); if (f) { diff --git a/po/cs.po b/po/cs.po index c12cd0cd7..f71db578c 100644 --- a/po/cs.po +++ b/po/cs.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Czech\n" "Language: cs_CZ\n" diff --git a/po/da.po b/po/da.po index 329cc3715..ad2de2929 100644 --- a/po/da.po +++ b/po/da.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Danish\n" "Language: da_DK\n" @@ -169,28 +169,28 @@ msgid "Option \"%s\" is not enabled" msgstr "Indstilling \"%s\" er ikke aktiveret" msgid "Option chip_memory must be a multiple of 512" -msgstr "Indstilling chip_memory skal været et multiplicum af 512" +msgstr "Indstillingen chip_memory skal været et multiplicum af 512" msgid "Option fast_memory must be a multiple of 1024" -msgstr "Indstilling fast_memory skal været et multiplicum af 1024" +msgstr "Indstillingen fast_memory skal været et multiplicum af 1024" msgid "Option motherboard_ram must be a multiple of 1024" -msgstr "" +msgstr "Indstillingen motherboard_ram skal være et multiplum af 1024" msgid "Option motherboard_ram needs a CPU with 32-bit addressing" -msgstr "" +msgstr "Indstillingen motherboard_ram skal bruge en CPU med 32-bit adressering" msgid "Option slow_memory must be a multiple of 256" -msgstr "Indstilling slow_memory skal været et multiplicum af 256" +msgstr "Indstillingen slow_memory skal været et multiplicum af 256" msgid "Option uaegfx.card needs a CPU with 32-bit addressing" -msgstr "Indstilling uagfx.card kræver en CPU med 32-bits adressering" +msgstr "Indstillingen uagfx.card kræver en CPU med 32-bits adressering" msgid "Option zorro_iii_memory must be a multiple of 1024" -msgstr "Indstilling zorro_iii_memory skal været et multiplicum af 1024" +msgstr "Indstillingen zorro_iii_memory skal været et multiplicum af 1024" msgid "Option zorro_iii_memory needs a CPU with 32-bit addressing" -msgstr "Indstilling zorro_iii_memory kræver en CPU med 32-bits adressering" +msgstr "Indstillingen zorro_iii_memory kræver en CPU med 32-bits adressering" #. / TRANSLATORS: This is a menu entry and must not be too long msgid "Parallel Joystick Ports" diff --git a/po/de.po b/po/de.po index 46295b316..a0c222ebf 100644 --- a/po/de.po +++ b/po/de.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: German\n" "Language: de_DE\n" @@ -74,7 +74,7 @@ msgstr "Emulator-Steuerung" #. / TRANSLATORS: In context "Zoom: Full Frame" msgid "Full Frame" -msgstr "Full Frame" +msgstr "Vollbild" #, c-format msgid "HD not found: %s" @@ -175,10 +175,10 @@ msgid "Option fast_memory must be a multiple of 1024" msgstr "Die Option fast_memory muss ein Vielfaches von 1024 sein" msgid "Option motherboard_ram must be a multiple of 1024" -msgstr "" +msgstr "Die Option motherboard_ram muss ein Vielfaches von 1024 betragen" msgid "Option motherboard_ram needs a CPU with 32-bit addressing" -msgstr "" +msgstr "Die Option Motherboard_ram benötigt eine CPU mit 32-Bit-Adressierung" msgid "Option slow_memory must be a multiple of 256" msgstr "Die Option slow_memory muss ein Vielfaches von 256 sein" @@ -241,7 +241,7 @@ msgstr "Zoom: %s" #, c-format msgid "Zoom: %s + Border" -msgstr "Zoom: %s + Begrenzung" +msgstr "Zoom: %s + Rand" msgid "[ Port 0 ] Switched to joystick mode" msgstr "[ Anschluss 0 ] Auf Joystick-Modus umgestellt" diff --git a/po/el.po b/po/el.po index 103c37669..a2e15486c 100644 --- a/po/el.po +++ b/po/el.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Greek\n" "Language: el_GR\n" diff --git a/po/es.po b/po/es.po index 406d35287..bff1d7a15 100644 --- a/po/es.po +++ b/po/es.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Spanish\n" "Language: es_ES\n" @@ -137,7 +137,7 @@ msgid "Load State" msgstr "Cargar Estado" msgid "Max 1 CD-ROM drive supported currently" -msgstr "" +msgstr "Max 1 CD-ROM disco soportador actualmente" msgid "More..." msgstr "Mas..." @@ -169,16 +169,16 @@ msgid "Option \"%s\" is not enabled" msgstr "Opció \"%s\" no esta activada" msgid "Option chip_memory must be a multiple of 512" -msgstr "Opción chip_memori debe ser mútiplo de 512" +msgstr "Opción chip_memory debe ser mútiplo de 512" msgid "Option fast_memory must be a multiple of 1024" msgstr "Opción fast_memory debe ser mútiplo de 1024" msgid "Option motherboard_ram must be a multiple of 1024" -msgstr "" +msgstr "Opción motherboard_ram debe ser mútiplo de 1024" msgid "Option motherboard_ram needs a CPU with 32-bit addressing" -msgstr "" +msgstr "Opciónmotherboard_ram necesita una CPU con direcciones de 32-bit" msgid "Option slow_memory must be a multiple of 256" msgstr "Opción fast_memory debe ser mútiplo de 256" @@ -190,7 +190,7 @@ msgid "Option zorro_iii_memory must be a multiple of 1024" msgstr "Opción zorro_iii_memory debe ser mútiplo de 1024" msgid "Option zorro_iii_memory needs a CPU with 32-bit addressing" -msgstr "" +msgstr "Opción zorro_iii_memory necesita una CPU con direcciones de 32-bit" #. / TRANSLATORS: This is a menu entry and must not be too long msgid "Parallel Joystick Ports" diff --git a/po/fi.po b/po/fi.po index ac9999bf5..ff8be5ef8 100644 --- a/po/fi.po +++ b/po/fi.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-09 18:14+0200\n" -"PO-Revision-Date: 2015-08-09 12:15-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Finnish\n" "Language: fi_FI\n" diff --git a/po/fr.po b/po/fr.po index cb5b39040..38c745719 100644 --- a/po/fr.po +++ b/po/fr.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: French\n" "Language: fr_FR\n" @@ -175,10 +175,10 @@ msgid "Option fast_memory must be a multiple of 1024" msgstr "L'option mémoire_fast doit être un multiple de 1024" msgid "Option motherboard_ram must be a multiple of 1024" -msgstr "" +msgstr "L'option motherboard_ram doit être un multiple de 1024" msgid "Option motherboard_ram needs a CPU with 32-bit addressing" -msgstr "" +msgstr "L'option motherboard_ram a besoin d'un processeur avec adressage 32 bits" msgid "Option slow_memory must be a multiple of 256" msgstr "L'option mémoire_slow doit être un multiple de 256" diff --git a/po/it.po b/po/it.po index 1d086aeca..017e9d9bb 100644 --- a/po/it.po +++ b/po/it.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Italian\n" "Language: it_IT\n" @@ -27,18 +27,18 @@ msgid "Auto" msgstr "Automatico" msgid "Auto-Fire is Off" -msgstr "Fuoco-Automatico Spento" +msgstr "Fuoco automatico disattivato" msgid "Auto-Fire is On" -msgstr "Fuco-Automatico Attivato" +msgstr "Fuoco automatico attivato" #, c-format msgid "Auto-fire disabled for port %d" -msgstr "Fuoco-Automatico disabilitato sulla porta %d" +msgstr "Fuoco automatico disabilitato sulla porta %d" #, c-format msgid "Auto-fire enabled for port %d" -msgstr "Fuoco-Automatico abilitato sulla porta %d" +msgstr "Fuoco automatico abilitato sulla porta %d" #. / TRANSLATORS: Empty or nothing #, c-format @@ -74,7 +74,7 @@ msgstr "Controllo Emulatore" #. / TRANSLATORS: In context "Zoom: Full Frame" msgid "Full Frame" -msgstr "Fotogramma Completo" +msgstr "Fotogramma completo" #, c-format msgid "HD not found: %s" @@ -91,12 +91,12 @@ msgstr "Opzioni di Input" #. / TRANSLATORS: This is a menu entry and must not be too long #, c-format msgid "Insert Into CD%d" -msgstr "Inserisci in CD%d" +msgstr "Inserisci nel CD%d" #. / TRANSLATORS: This is a menu entry and must not be too long #, c-format msgid "Insert Into DF%d" -msgstr "Inserire nel DF%d" +msgstr "Inserisci nel DF%d" msgid "Joystick Mode" msgstr "Modalità joystick" @@ -159,7 +159,7 @@ msgstr "Nessun Dispositivo Amiga" #. / TRANSLATORS: This is a menu entry and must not be too long: If you struggle #. / to get in short enough, just translate "No Device" instead. msgid "No Host Device" -msgstr "Nessun Dispositivo Ospite" +msgstr "Nessun dispositivo ospite" msgid "No configuration file was found" msgstr "Non è stato trovato alcun file di configurazione" @@ -175,10 +175,10 @@ msgid "Option fast_memory must be a multiple of 1024" msgstr "L'opzione fast_memory deve essere un multiplo di 1024" msgid "Option motherboard_ram must be a multiple of 1024" -msgstr "" +msgstr "L'opzione motherboard_ram deve essere un multiplo di 1024" msgid "Option motherboard_ram needs a CPU with 32-bit addressing" -msgstr "" +msgstr "L'opzione motherboard_ram ha bisogno di una CPU con indirizzamento a 32-bit" msgid "Option slow_memory must be a multiple of 256" msgstr "L'opzione slow_memory deve essere un multiplo di 256" @@ -204,10 +204,10 @@ msgid "Port 0: %s" msgstr "Porta 0: %s" msgid "Port Settings" -msgstr "Impostazioni Porta" +msgstr "Impostazioni porta" msgid "Removable Media" -msgstr "Supporti Rimovibili" +msgstr "Supporti rimovibili" #. / TRANSLATORS: Reset Amiga as in reboot the computer msgid "Reset Amiga" @@ -220,7 +220,7 @@ msgid "Save" msgstr "Salva" msgid "Save State" -msgstr "Salva Stato" +msgstr "Salva stato" #. / TRANSLATORS: Soft reset reboots the computer without a power cycle msgid "Soft Reset" diff --git a/po/nb.po b/po/nb.po index e759d0bee..7d2a5a50b 100644 --- a/po/nb.po +++ b/po/nb.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Norwegian Bokmal\n" "Language: nb_NO\n" diff --git a/po/pl.po b/po/pl.po index 0cf51a294..7635b2240 100644 --- a/po/pl.po +++ b/po/pl.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Polish\n" "Language: pl_PL\n" diff --git a/po/pt.po b/po/pt.po index 896cf2b3c..55dd37aa0 100644 --- a/po/pt.po +++ b/po/pt.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Portuguese\n" "Language: pt_PT\n" diff --git a/po/pt_BR.po b/po/pt_BR.po index e38dae78c..6831fbb46 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Portuguese, Brazilian\n" "Language: pt_BR\n" diff --git a/po/sr.po b/po/sr.po index 4141c2eab..d6bdf0b77 100644 --- a/po/sr.po +++ b/po/sr.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Serbian (Latin)\n" "Language: sr_CS\n" diff --git a/po/sv.po b/po/sv.po index 559ed3372..1440068df 100644 --- a/po/sv.po +++ b/po/sv.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Swedish\n" "Language: sv_SE\n" diff --git a/po/tr.po b/po/tr.po index 7be36ff91..d3e408ee1 100644 --- a/po/tr.po +++ b/po/tr.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: fs-uae\n" "Report-Msgid-Bugs-To: frode@fs-uae.net\n" -"POT-Creation-Date: 2015-08-07 20:13+0200\n" -"PO-Revision-Date: 2015-08-08 12:23-0400\n" +"POT-Creation-Date: 2015-09-19 12:02+0200\n" +"PO-Revision-Date: 2015-09-19 06:02-0400\n" "Last-Translator: FrodeSolheim \n" "Language-Team: Turkish\n" "Language: tr_TR\n" diff --git a/share/fs-uae/aros-amiga-m68k-ext.bin b/share/fs-uae/aros-amiga-m68k-ext.bin index 905cd25b3..89ac6a4f9 100755 Binary files a/share/fs-uae/aros-amiga-m68k-ext.bin and b/share/fs-uae/aros-amiga-m68k-ext.bin differ diff --git a/share/fs-uae/aros-amiga-m68k-rom.bin b/share/fs-uae/aros-amiga-m68k-rom.bin index b3c581dd4..e0f946fc0 100755 Binary files a/share/fs-uae/aros-amiga-m68k-rom.bin and b/share/fs-uae/aros-amiga-m68k-rom.bin differ diff --git a/share/fs-uae/input/030000004f04000015b3000010010000.fs-uae-controller b/share/fs-uae/input/030000004f04000015b3000010010000.fs-uae-controller new file mode 100644 index 000000000..c2e911881 --- /dev/null +++ b/share/fs-uae/input/030000004f04000015b3000010010000.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster Thrustmaster dual analog 3.2 +platform = linux + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 030000004f04000015b3000010010000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/030000006d0400001dc2000014400000.fs-uae-controller b/share/fs-uae/input/030000006d0400001dc2000014400000.fs-uae-controller new file mode 100644 index 000000000..610d5e2c1 --- /dev/null +++ b/share/fs-uae/input/030000006d0400001dc2000014400000.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Logitech Gamepad F310 +platform = linux + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 030000006d0400001dc2000014400000 +buttons = 11 +hats = 1 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = rstick_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_9 = lstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/4f0400000000000015b3000000000000.fs-uae-controller b/share/fs-uae/input/4f0400000000000015b3000000000000.fs-uae-controller new file mode 100644 index 000000000..4f2c50445 --- /dev/null +++ b/share/fs-uae/input/4f0400000000000015b3000000000000.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster dual analog 3.2 +platform = macosx + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 4f0400000000000015b3000000000000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/4f0415b3000000000000504944564944.fs-uae-controller b/share/fs-uae/input/4f0415b3000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..46d7d5e8b --- /dev/null +++ b/share/fs-uae/input/4f0415b3000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster dual analog 3.2 +platform = windows + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 4f0415b3000000000000504944564944 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/5e040000000000008e02000000000000.fs-uae-controller b/share/fs-uae/input/5e040000000000008e02000000000000.fs-uae-controller index fce45db4a..16ff876e6 100644 --- a/share/fs-uae/input/5e040000000000008e02000000000000.fs-uae-controller +++ b/share/fs-uae/input/5e040000000000008e02000000000000.fs-uae-controller @@ -1,10 +1,10 @@ [fs-uae-controller] -name = X360Controller +name = Xbox 360 Wired Controller platform = macosx [device] make = Microsoft -model = Xbox One Pad +model = Xbox 360/One Pad type = gamepad [sdl] @@ -28,6 +28,7 @@ axis_4_pos = rstick_down axis_5_pos = right_trigger button_0 = south_button button_1 = east_button +button_10 = menu_button button_11 = dpad_up button_12 = dpad_down button_13 = dpad_left diff --git a/share/fs-uae/input/5e048e02000000000000504944564944.fs-uae-controller b/share/fs-uae/input/5e048e02000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..24f95c18a --- /dev/null +++ b/share/fs-uae/input/5e048e02000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Controller (XBOX 360 For Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e048e02000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/5e04a102000000000000504944564944.fs-uae-controller b/share/fs-uae/input/5e04a102000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..4fa2a4b70 --- /dev/null +++ b/share/fs-uae/input/5e04a102000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Controller (Xbox 360 Wireless Receiver for Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e04a102000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/5e04d102000000000000504944564944.fs-uae-controller b/share/fs-uae/input/5e04d102000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..bcaf6de96 --- /dev/null +++ b/share/fs-uae/input/5e04d102000000000000504944564944.fs-uae-controller @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Controller (XBOX One For Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox One Pad +type = gamepad + +[sdl] +guid = 5e04d102000000000000504944564944 +buttons = 11 +hats = 1 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = left_shoulder +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_2 = west_button +button_3 = north_button +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/6d0400000000000016c2000000000000.fs-uae-controller b/share/fs-uae/input/6d0400000000000016c2000000000000.fs-uae-controller new file mode 100644 index 000000000..a4af793f8 --- /dev/null +++ b/share/fs-uae/input/6d0400000000000016c2000000000000.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Logitech Dual Action +platform = macosx + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d0400000000000016c2000000000000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = west_button +button_1 = south_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = left_trigger +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/6d040000000000001dc2000000000000.fs-uae-controller b/share/fs-uae/input/6d040000000000001dc2000000000000.fs-uae-controller new file mode 100644 index 000000000..05126b9e0 --- /dev/null +++ b/share/fs-uae/input/6d040000000000001dc2000000000000.fs-uae-controller @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Xbox 360 Wired Controller +platform = macosx + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d040000000000001dc2000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/share/fs-uae/input/6d040000000000001ec2000000000000.fs-uae-controller b/share/fs-uae/input/6d040000000000001ec2000000000000.fs-uae-controller new file mode 100644 index 000000000..20388ebb0 --- /dev/null +++ b/share/fs-uae/input/6d040000000000001ec2000000000000.fs-uae-controller @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Xbox 360 Wired Controller +platform = macosx + +[device] +make = Logitech +model = F510 +type = gamepad + +[sdl] +guid = 6d040000000000001ec2000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/share/fs-uae/input/6d040000000000001fc2000000000000.fs-uae-controller b/share/fs-uae/input/6d040000000000001fc2000000000000.fs-uae-controller new file mode 100644 index 000000000..776c71b55 --- /dev/null +++ b/share/fs-uae/input/6d040000000000001fc2000000000000.fs-uae-controller @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Xbox 360 Wired Controller +platform = macosx + +[device] +make = Logitech +model = F710 +type = gamepad + +[sdl] +guid = 6d040000000000001fc2000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/share/fs-uae/input/6d0416c2000000000000504944564944.fs-uae-controller b/share/fs-uae/input/6d0416c2000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..8ca4e4fca --- /dev/null +++ b/share/fs-uae/input/6d0416c2000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Logitech Dual Action +platform = windows + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d0416c2000000000000504944564944 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = west_button +button_1 = south_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = left_trigger +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/6d041dc2000000000000504944564944.fs-uae-controller b/share/fs-uae/input/6d041dc2000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..ff43b7e22 --- /dev/null +++ b/share/fs-uae/input/6d041dc2000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Controller (Gamepad F310) +platform = windows + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d041dc2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/6d041ec2000000000000504944564944.fs-uae-controller b/share/fs-uae/input/6d041ec2000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..fafe385ec --- /dev/null +++ b/share/fs-uae/input/6d041ec2000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Controller (Rumble Gamepad F510) +platform = windows + +[device] +make = Logitech +model = F510 +type = gamepad + +[sdl] +guid = 6d041ec2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/6d041fc2000000000000504944564944.fs-uae-controller b/share/fs-uae/input/6d041fc2000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..5eeefc569 --- /dev/null +++ b/share/fs-uae/input/6d041fc2000000000000504944564944.fs-uae-controller @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Controller (Wireless Gamepad F710) +platform = windows + +[device] +make = Logitech +model = F710 +type = gamepad + +[sdl] +guid = 6d041fc2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/92125441000000000000504944564944.fs-uae-controller b/share/fs-uae/input/92125441000000000000504944564944.fs-uae-controller new file mode 100644 index 000000000..20c5a7ef4 --- /dev/null +++ b/share/fs-uae/input/92125441000000000000504944564944.fs-uae-controller @@ -0,0 +1,23 @@ +[fs-uae-controller] +name = ATARI Controller USB +platform = windows + +[device] +make = Retro-bit +model = Atari Adapter +type = joystick + +[sdl] +guid = 92125441000000000000504944564944 +buttons = 1 +hats = 0 +axes = 2 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = dpad_left +axis_0_pos = dpad_right +axis_1_neg = dpad_up +axis_1_pos = dpad_down +button_0 = south_button diff --git a/share/fs-uae/input/atari_controller_usb_1_2_0_0_windows.conf b/share/fs-uae/input/atari_controller_usb_1_2_0_0_windows.conf new file mode 100644 index 000000000..20c5a7ef4 --- /dev/null +++ b/share/fs-uae/input/atari_controller_usb_1_2_0_0_windows.conf @@ -0,0 +1,23 @@ +[fs-uae-controller] +name = ATARI Controller USB +platform = windows + +[device] +make = Retro-bit +model = Atari Adapter +type = joystick + +[sdl] +guid = 92125441000000000000504944564944 +buttons = 1 +hats = 0 +axes = 2 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = dpad_left +axis_0_pos = dpad_right +axis_1_neg = dpad_up +axis_1_pos = dpad_down +button_0 = south_button diff --git a/share/fs-uae/input/controller_gamepad_f310_10_5_1_0_windows.conf b/share/fs-uae/input/controller_gamepad_f310_10_5_1_0_windows.conf index f82d7a3f6..ff43b7e22 100644 --- a/share/fs-uae/input/controller_gamepad_f310_10_5_1_0_windows.conf +++ b/share/fs-uae/input/controller_gamepad_f310_10_5_1_0_windows.conf @@ -1,28 +1,42 @@ -# Controller (Gamepad F310) +[fs-uae-controller] +name = Controller (Gamepad F310) +platform = windows + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d041dc2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_8 = lstick_button -axis_4_neg = rstick_left -axis_4_pos = rstick_right -axis_3_neg = rstick_up -axis_3_pos = rstick_down -button_9 = rstick_button +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button button_2 = west_button button_3 = north_button -button_1 = east_button -button_0 = south_button -button_6 = select_button -button_7 = start_button button_4 = left_shoulder -axis_2_pos = left_trigger button_5 = right_shoulder -axis_2_neg = right_trigger +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/controller_rumble_gamepad_f510_10_5_1_0_windows.conf b/share/fs-uae/input/controller_rumble_gamepad_f510_10_5_1_0_windows.conf index ef8eee971..fafe385ec 100644 --- a/share/fs-uae/input/controller_rumble_gamepad_f510_10_5_1_0_windows.conf +++ b/share/fs-uae/input/controller_rumble_gamepad_f510_10_5_1_0_windows.conf @@ -1,28 +1,42 @@ -# Controller (Rumble Gamepad F510) +[fs-uae-controller] +name = Controller (Rumble Gamepad F510) +platform = windows + +[device] +make = Logitech +model = F510 +type = gamepad + +[sdl] +guid = 6d041ec2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_8 = lstick_button -axis_4_neg = rstick_left -axis_4_pos = rstick_right -axis_3_neg = rstick_up -axis_3_pos = rstick_down -button_9 = rstick_button +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button button_2 = west_button button_3 = north_button -button_1 = east_button -button_0 = south_button -button_6 = select_button -button_7 = start_button button_4 = left_shoulder -axis_2_pos = left_trigger button_5 = right_shoulder -axis_2_neg = right_trigger +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/controller_wireless_gamepad_f710_10_5_1_0_windows.conf b/share/fs-uae/input/controller_wireless_gamepad_f710_10_5_1_0_windows.conf index 2cd16ecf1..5eeefc569 100644 --- a/share/fs-uae/input/controller_wireless_gamepad_f710_10_5_1_0_windows.conf +++ b/share/fs-uae/input/controller_wireless_gamepad_f710_10_5_1_0_windows.conf @@ -1,28 +1,42 @@ -# Controller (Wireless Gamepad F710) +[fs-uae-controller] +name = Controller (Wireless Gamepad F710) +platform = windows + +[device] +make = Logitech +model = F710 +type = gamepad + +[sdl] +guid = 6d041fc2000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_8 = lstick_button -axis_4_neg = rstick_left -axis_4_pos = rstick_right -axis_3_neg = rstick_up -axis_3_pos = rstick_down -button_9 = rstick_button +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button button_2 = west_button button_3 = north_button -button_1 = east_button -button_0 = south_button -button_6 = select_button -button_7 = start_button button_4 = left_shoulder -axis_2_pos = left_trigger button_5 = right_shoulder -axis_2_neg = right_trigger +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/controller_xbox_360_for_windows_10_5_1_0_windows.conf b/share/fs-uae/input/controller_xbox_360_for_windows_10_5_1_0_windows.conf index e163ee780..24f95c18a 100644 --- a/share/fs-uae/input/controller_xbox_360_for_windows_10_5_1_0_windows.conf +++ b/share/fs-uae/input/controller_xbox_360_for_windows_10_5_1_0_windows.conf @@ -1,28 +1,42 @@ -# Controller (XBOX 360 For Windows) +[fs-uae-controller] +name = Controller (XBOX 360 For Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e048e02000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_8 = lstick_button -axis_4_neg = rstick_left -axis_4_pos = rstick_right -axis_3_neg = rstick_up -axis_3_pos = rstick_down -button_9 = rstick_button +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button button_2 = west_button button_3 = north_button -button_1 = east_button -button_0 = south_button -button_6 = select_button -button_7 = start_button button_4 = left_shoulder -axis_2_pos = left_trigger button_5 = right_shoulder -axis_2_neg = right_trigger +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/controller_xbox_360_wireless_receiver_for_windows_10_5_1_0_windows.conf b/share/fs-uae/input/controller_xbox_360_wireless_receiver_for_windows_10_5_1_0_windows.conf index 7f383343a..4fa2a4b70 100644 --- a/share/fs-uae/input/controller_xbox_360_wireless_receiver_for_windows_10_5_1_0_windows.conf +++ b/share/fs-uae/input/controller_xbox_360_wireless_receiver_for_windows_10_5_1_0_windows.conf @@ -1,28 +1,42 @@ -# Controller (Xbox 360 Wireless Receiver for Windows) +[fs-uae-controller] +name = Controller (Xbox 360 Wireless Receiver for Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e04a102000000000000504944564944 +buttons = 10 +hats = 1 +axes = 5 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_8 = lstick_button -axis_4_neg = rstick_left -axis_4_pos = rstick_right -axis_3_neg = rstick_up -axis_3_pos = rstick_down -button_9 = rstick_button +axis_2_neg = right_trigger +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +button_0 = south_button +button_1 = east_button button_2 = west_button button_3 = north_button -button_1 = east_button -button_0 = south_button -button_6 = select_button -button_7 = start_button button_4 = left_shoulder -axis_2_pos = left_trigger button_5 = right_shoulder -axis_2_neg = right_trigger +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/controller_xbox_one_for_windows_11_6_1_0_windows.conf b/share/fs-uae/input/controller_xbox_one_for_windows_11_6_1_0_windows.conf new file mode 100644 index 000000000..bcaf6de96 --- /dev/null +++ b/share/fs-uae/input/controller_xbox_one_for_windows_11_6_1_0_windows.conf @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Controller (XBOX One For Windows) +platform = windows + +[device] +make = Microsoft +model = Xbox One Pad +type = gamepad + +[sdl] +guid = 5e04d102000000000000504944564944 +buttons = 11 +hats = 1 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = left_shoulder +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_2 = west_button +button_3 = north_button +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_8 = lstick_button +button_9 = rstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/logitech_dual_action_12_4_1_0_macosx.conf b/share/fs-uae/input/logitech_dual_action_12_4_1_0_macosx.conf index a40af8e98..a4af793f8 100644 --- a/share/fs-uae/input/logitech_dual_action_12_4_1_0_macosx.conf +++ b/share/fs-uae/input/logitech_dual_action_12_4_1_0_macosx.conf @@ -1,28 +1,42 @@ -# Logitech Dual Action +[fs-uae-controller] +name = Logitech Dual Action +platform = macosx + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d0400000000000016c2000000000000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 [default] include = universal_gamepad -hat_0_left = dpad_left -hat_0_right = dpad_right -hat_0_up = dpad_up -hat_0_down = dpad_down axis_0_neg = lstick_left axis_0_pos = lstick_right axis_1_neg = lstick_up axis_1_pos = lstick_down -button_10 = lstick_button axis_2_neg = rstick_left axis_2_pos = rstick_right axis_3_neg = rstick_up axis_3_pos = rstick_down -button_11 = rstick_button button_0 = west_button -button_3 = north_button -button_2 = east_button button_1 = south_button -button_8 = select_button -button_9 = start_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button button_4 = left_shoulder -button_6 = left_trigger button_5 = right_shoulder +button_6 = left_trigger button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/logitech_dual_action_12_4_1_0_windows.conf b/share/fs-uae/input/logitech_dual_action_12_4_1_0_windows.conf new file mode 100644 index 000000000..8ca4e4fca --- /dev/null +++ b/share/fs-uae/input/logitech_dual_action_12_4_1_0_windows.conf @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Logitech Dual Action +platform = windows + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 6d0416c2000000000000504944564944 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = west_button +button_1 = south_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = left_trigger +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/logitech_gamepad_f310_11_6_1_0_linux.conf b/share/fs-uae/input/logitech_gamepad_f310_11_6_1_0_linux.conf new file mode 100644 index 000000000..610d5e2c1 --- /dev/null +++ b/share/fs-uae/input/logitech_gamepad_f310_11_6_1_0_linux.conf @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Logitech Gamepad F310 +platform = linux + +[device] +make = Logitech +model = F310 +type = gamepad + +[sdl] +guid = 030000006d0400001dc2000014400000 +buttons = 11 +hats = 1 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = rstick_button +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = select_button +button_7 = start_button +button_9 = lstick_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_macosx.conf b/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_macosx.conf new file mode 100644 index 000000000..4f2c50445 --- /dev/null +++ b/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_macosx.conf @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster dual analog 3.2 +platform = macosx + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 4f0400000000000015b3000000000000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_windows.conf b/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_windows.conf new file mode 100644 index 000000000..46d7d5e8b --- /dev/null +++ b/share/fs-uae/input/thrustmaster_dual_analog_3_2_12_4_1_0_windows.conf @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster dual analog 3.2 +platform = windows + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 4f0415b3000000000000504944564944 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/thrustmaster_thrustmaster_dual_analog_3_2_12_4_1_0_linux.conf b/share/fs-uae/input/thrustmaster_thrustmaster_dual_analog_3_2_12_4_1_0_linux.conf new file mode 100644 index 000000000..c2e911881 --- /dev/null +++ b/share/fs-uae/input/thrustmaster_thrustmaster_dual_analog_3_2_12_4_1_0_linux.conf @@ -0,0 +1,42 @@ +[fs-uae-controller] +name = Thrustmaster Thrustmaster dual analog 3.2 +platform = linux + +[device] +make = Thrustmaster +model = Dual Analog 4 +type = gamepad + +[sdl] +guid = 030000004f04000015b3000010010000 +buttons = 12 +hats = 1 +axes = 4 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_neg = rstick_left +axis_2_pos = rstick_right +axis_3_neg = rstick_up +axis_3_pos = rstick_down +button_0 = south_button +button_1 = west_button +button_10 = lstick_button +button_11 = rstick_button +button_2 = east_button +button_3 = north_button +button_4 = left_shoulder +button_5 = left_trigger +button_6 = right_shoulder +button_7 = right_trigger +button_8 = select_button +button_9 = start_button +hat_0_down = dpad_down +hat_0_left = dpad_left +hat_0_right = dpad_right +hat_0_up = dpad_up diff --git a/share/fs-uae/input/universal_gamepad.ini b/share/fs-uae/input/universal_gamepad.ini index 0edd59d29..b5e8b3d2a 100644 --- a/share/fs-uae/input/universal_gamepad.ini +++ b/share/fs-uae/input/universal_gamepad.ini @@ -32,7 +32,6 @@ dpad_up = up dpad_down = down south_button = 1 west_button = 2 -left_trigger = toggle_autofire lstick_left = left lstick_right = right @@ -42,6 +41,10 @@ east_button = up north_button = 1 right_shoulder = up left_shoulder = down +left_trigger = toggle_autofire +right_trigger = autofire +select_button = pause +start_button = menu_alt [amigacd32] dpad_left = left @@ -60,6 +63,9 @@ lstick_left = left lstick_right = right lstick_up = up lstick_down = down +left_trigger = toggle_autofire +right_trigger = autofire +select_button = pause [amstradcpc] dpad_left = left diff --git a/share/fs-uae/input/wireless_360_controller_15_6_0_0_macosx.conf b/share/fs-uae/input/wireless_360_controller_15_6_0_0_macosx.conf new file mode 100644 index 000000000..65c055a5b --- /dev/null +++ b/share/fs-uae/input/wireless_360_controller_15_6_0_0_macosx.conf @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Wireless 360 Controller +platform = macosx + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e040000000000008e02000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/share/fs-uae/input/xbox_360_wired_controller_15_6_0_0_macosx.conf b/share/fs-uae/input/xbox_360_wired_controller_15_6_0_0_macosx.conf new file mode 100644 index 000000000..1e735e6d7 --- /dev/null +++ b/share/fs-uae/input/xbox_360_wired_controller_15_6_0_0_macosx.conf @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Xbox 360 Wired Controller +platform = macosx + +[device] +make = Microsoft +model = Xbox 360 Pad +type = gamepad + +[sdl] +guid = 5e040000000000008e02000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/share/fs-uae/input/xbox_one_wired_controller_15_6_0_0_macosx.conf b/share/fs-uae/input/xbox_one_wired_controller_15_6_0_0_macosx.conf new file mode 100644 index 000000000..f84738cb7 --- /dev/null +++ b/share/fs-uae/input/xbox_one_wired_controller_15_6_0_0_macosx.conf @@ -0,0 +1,43 @@ +[fs-uae-controller] +name = Xbox One Wired Controller +platform = macosx + +[device] +make = Microsoft +model = Xbox One Pad +type = gamepad + +[sdl] +guid = 5e040000000000008e02000000000000 +buttons = 15 +hats = 0 +axes = 6 +balls = 0 + +[default] +include = universal_gamepad +axis_0_neg = lstick_left +axis_0_pos = lstick_right +axis_1_neg = lstick_up +axis_1_pos = lstick_down +axis_2_pos = left_trigger +axis_3_neg = rstick_left +axis_3_pos = rstick_right +axis_4_neg = rstick_up +axis_4_pos = rstick_down +axis_5_pos = right_trigger +button_0 = south_button +button_1 = east_button +button_10 = menu_button +button_11 = dpad_up +button_12 = dpad_down +button_13 = dpad_left +button_14 = dpad_right +button_2 = west_button +button_3 = north_button +button_4 = left_shoulder +button_5 = right_shoulder +button_6 = lstick_button +button_7 = rstick_button +button_8 = start_button +button_9 = select_button diff --git a/src/a2091.cpp b/src/a2091.cpp index 551c2031a..213bd6e0c 100644 --- a/src/a2091.cpp +++ b/src/a2091.cpp @@ -3376,7 +3376,7 @@ void gvp_s2_add_scsi_unit(int ch, struct uaedev_config_info *ci, struct romconfi add_scsi_device(&wd->scsis[ch], ch, ci, rc); } -void a2091_free_device (struct wd_state *wd) +static void a2091_free_device (struct wd_state *wd) { freencrunit(wd); } @@ -3552,7 +3552,7 @@ addrbank *a2090_init (struct romconfig *rc) return wd->bank; } -void gvp_free_device (struct wd_state *wd) +static void gvp_free_device (struct wd_state *wd) { freencrunit(wd); } diff --git a/src/blkdev_cdimage.cpp b/src/blkdev_cdimage.cpp index e0c66b6eb..c5962b99b 100644 --- a/src/blkdev_cdimage.cpp +++ b/src/blkdev_cdimage.cpp @@ -435,7 +435,7 @@ static void audio_unpack (struct cdunit *cdu, struct cdtoc *t) static volatile int cda_bufon[2]; static cda_audio *cda; -void next_cd_audio_buffer_callback(int bufnum) +static void next_cd_audio_buffer_callback(int bufnum) { uae_sem_wait(&play_sem); if (bufnum >= 0) { diff --git a/src/bsdsocket.cpp b/src/bsdsocket.cpp index bc9f5c306..f81124454 100644 --- a/src/bsdsocket.cpp +++ b/src/bsdsocket.cpp @@ -43,7 +43,7 @@ Bit iotextptrs are never initialized. Instead, there this this initalization usi #endif #ifdef BSDSOCKET -int log_bsd; +int log_bsd = 0; struct socketbase *socketbases; static uae_u32 SockLibBase; diff --git a/src/cd32_fmv.cpp b/src/cd32_fmv.cpp index 949fbe80d..28f41abc8 100644 --- a/src/cd32_fmv.cpp +++ b/src/cd32_fmv.cpp @@ -1383,7 +1383,7 @@ void cd32_fmv_set_sync(double svpos, double adjust) fmv_syncadjust = adjust; } -void fmv_next_cd_audio_buffer_callback(int bufnum) +static void fmv_next_cd_audio_buffer_callback(int bufnum) { uae_sem_wait(&play_sem); if (bufnum >= 0) { diff --git a/src/cfgfile.cpp b/src/cfgfile.cpp index aecabe75e..37bac6ed9 100644 --- a/src/cfgfile.cpp +++ b/src/cfgfile.cpp @@ -6982,7 +6982,11 @@ int built_in_chipset_prefs (struct uae_prefs *p) p->cs_ksmirror_a8 = 0; p->cs_ciaoverlay = 1; p->cs_ciaatod = 0; +#ifdef FSUAE + /* Allow RTC to be set without disabling cs_compatible */ +#else p->cs_rtc = 0; +#endif p->cs_rtc_adjust_mode = p->cs_rtc_adjust = 0; p->cs_df0idhw = 1; p->cs_resetwarning = 1; diff --git a/src/custom.cpp b/src/custom.cpp index 704ae4300..8c04e6272 100644 --- a/src/custom.cpp +++ b/src/custom.cpp @@ -1954,6 +1954,8 @@ STATIC_INLINE void long_fetch_32 (int plane, int nwords, int weird_number_of_bit outword[plane] = outval; } +#ifndef HAVE_UAE_U128 + STATIC_INLINE void shift32plus (uae_u64 *p, int n) { uae_u64 t = p[1]; @@ -1964,6 +1966,7 @@ STATIC_INLINE void shift32plus (uae_u64 *p, int n) STATIC_INLINE void aga_shift (uae_u64 *p, int n) { + if (n == 0) return; shift32plus (p, n); p[0] <<= n; } @@ -1978,16 +1981,23 @@ STATIC_INLINE void shift32plusn (uae_u64 *p, int n) STATIC_INLINE void aga_shift_n (uae_u64 *p, int n) { + if (n == 0) return; shift32plusn (p, n); p[1] >>= n; } +#endif + STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bits, int dma) { uae_u32 *real_pt = (uae_u32 *)pfield_xlateptr (bplpt[plane], nwords * 2); int delay = toscr_delay_adjusted[plane & 1]; int tmp_nbits = out_nbits; +#ifdef HAVE_UAE_U128 + uae_u128 shiftbuffer; +#else uae_u64 shiftbuffer[2]; +#endif uae_u32 outval = outword[plane]; uae_u64 fetchval = fetched_aga[plane]; uae_u32 *dataptr = (uae_u32 *)(line_data[next_lineno] + 2 * plane * MAX_WORDS_PER_LINE + 4 * out_offs); @@ -2002,19 +2012,30 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit /* @@@ Don't do this, fall back on chipmem_wget instead. */ return; +#ifdef HAVE_UAE_U128 + shiftbuffer = todisplay2_aga[plane] << delay; +#else shiftbuffer[1] = 0; shiftbuffer[0] = todisplay2_aga[plane]; aga_shift (shiftbuffer, delay); +#endif while (nwords > 0) { int i; +#ifdef HAVE_UAE_U128 + shiftbuffer |= fetchval; +#else shiftbuffer[0] |= fetchval; +#endif for (i = 0; i < 4; i++) { uae_u32 t; int bits_left = 32 - tmp_nbits; +#ifdef HAVE_UAE_U128 + t = (shiftbuffer >> shift) & 0xffff; +#else if (64 - shift > 0) { t = shiftbuffer[1] << (64 - shift); t |= shiftbuffer[0] >> shift; @@ -2022,6 +2043,7 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit t = shiftbuffer[1] >> (shift - 64); } t &= 0xffff; +#endif if (weird_number_of_bits && bits_left < 16) { outval <<= bits_left; @@ -2041,7 +2063,11 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit tmp_nbits = 0; } } +#ifdef HAVE_UAE_U128 + shiftbuffer <<= 16; +#else aga_shift (shiftbuffer, 16); +#endif } nwords -= 4; @@ -2057,8 +2083,12 @@ STATIC_INLINE void long_fetch_64 (int plane, int nwords, int weird_number_of_bit } } fetched_aga[plane] = fetchval; +#ifdef HAVE_UAE_U128 + todisplay2_aga[plane] = shiftbuffer >> delay; +#else aga_shift_n (shiftbuffer, delay); todisplay2_aga[plane] = shiftbuffer[0]; +#endif outword[plane] = outval; } #endif diff --git a/src/fs-uae/config.c b/src/fs-uae/config.c index da057f492..3201ea01d 100644 --- a/src/fs-uae/config.c +++ b/src/fs-uae/config.c @@ -194,11 +194,19 @@ void fs_uae_configure_amiga_hardware() fs_emu_log("configuring \"%s\", accuracy=%d\n", c->name, 1); amiga_quickstart(c->quickstart_model, c->quickstart_config, 1); - amiga_set_option("cachesize", "0"); - amiga_set_option("comp_trustbyte", "indirect"); - amiga_set_option("comp_trustword", "indirect"); - amiga_set_option("comp_trustlong", "indirect"); - amiga_set_option("comp_trustnaddr", "indirect"); + + if (fs_config_get_boolean(OPTION_JIT_COMPILER) == 1) { + amiga_set_option("cachesize", "8192"); + } else { + amiga_set_option("cachesize", "0"); + } + const char *jit_memory = fs_config_get_const_string(OPTION_JIT_MEMORY); + if (jit_memory && strcmp(jit_memory, "indirect") == 0) { + amiga_set_option("comp_trustbyte", "indirect"); + amiga_set_option("comp_trustword", "indirect"); + amiga_set_option("comp_trustlong", "indirect"); + amiga_set_option("comp_trustnaddr", "indirect"); + } #if 1 if (cfg->z3realmapping == 0) { diff --git a/src/fs-uae/fs-uae.h b/src/fs-uae/fs-uae.h index cb327995c..2c26a6867 100644 --- a/src/fs-uae/fs-uae.h +++ b/src/fs-uae/fs-uae.h @@ -64,8 +64,6 @@ const char *fs_uae_kickstarts_cache_dir(); #define FS_UAE_CONFIG_TYPE_JOYSTICK "amiga" #define FS_UAE_CONFIG_TYPE_MOUSE "amiga_mouse" -#define FS_UAE_MAX_PORT_ACTIONS 16 - #define FS_UAE_NUM_INPUT_PORTS 5 #define MAX_DEVICE_NAME_LEN 128 typedef struct fs_uae_input_port { diff --git a/src/fs-uae/input.c b/src/fs-uae/input.c index f3c7bd3c7..7c9588bba 100644 --- a/src/fs-uae/input.c +++ b/src/fs-uae/input.c @@ -276,6 +276,12 @@ static fs_emu_action g_actions[] = { { INPUTEVENT_SPC_CDTV_FRONT_PANEL_NEXT, "action_cdtv_front_panel_next", 0 }, { INPUTEVENT_SPC_CDTV_FRONT_PANEL_REW, "action_cdtv_front_panel_rew", 0 }, { INPUTEVENT_SPC_CDTV_FRONT_PANEL_FF, "action_cdtv_front_panel_ff", 0 }, + + { INPUTEVENT_JOY1_AUTOFIRE_BUTTON, "action_joy_0_autofire_button", 0 }, + { INPUTEVENT_JOY2_AUTOFIRE_BUTTON, "action_joy_1_autofire_button", 0 }, + { INPUTEVENT_PAR_JOY1_AUTOFIRE_BUTTON, "action_par_joy_0_autofire_button", 0 }, + { INPUTEVENT_PAR_JOY2_AUTOFIRE_BUTTON, "action_par_joy_1_autofire_button", 0 }, + { INPUTEVENT_SPC_STATESAVE1, "action_save_state_1", 0 }, { INPUTEVENT_SPC_STATESAVE2, "action_save_state_2", 0 }, { INPUTEVENT_SPC_STATESAVE3, "action_save_state_3", 0 }, diff --git a/src/fs-uae/joystick.c b/src/fs-uae/joystick.c index 3b218f0e9..1d0307015 100644 --- a/src/fs-uae/joystick.c +++ b/src/fs-uae/joystick.c @@ -7,116 +7,109 @@ #include #include +#include #include "fs-uae.h" #include "config-common.h" fs_uae_input_port g_fs_uae_input_ports[FS_UAE_NUM_INPUT_PORTS] = {}; -static fs_emu_input_mapping g_joystick_mappings[][FS_UAE_MAX_PORT_ACTIONS] = { - // joystick in joystick port 0 - { - { "left", INPUTEVENT_JOY1_LEFT }, - { "right", INPUTEVENT_JOY1_RIGHT }, - { "up", INPUTEVENT_JOY1_UP }, - { "down", INPUTEVENT_JOY1_DOWN }, - { "1", INPUTEVENT_JOY1_FIRE_BUTTON }, - { "2", INPUTEVENT_JOY1_2ND_BUTTON }, - { "3", INPUTEVENT_JOY1_3RD_BUTTON }, - { "red", INPUTEVENT_JOY1_CD32_RED }, - { "yellow", INPUTEVENT_JOY1_CD32_YELLOW }, - { "green", INPUTEVENT_JOY1_CD32_GREEN }, - { "blue", INPUTEVENT_JOY1_CD32_BLUE }, - { "rewind", INPUTEVENT_JOY1_CD32_RWD }, - { "forward", INPUTEVENT_JOY1_CD32_FFW }, - { "play", INPUTEVENT_JOY1_CD32_PLAY }, - { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_0_AUTOFIRE }, - { NULL, 0 }, - }, - // joystick in joystick port 1 - { - { "left", INPUTEVENT_JOY2_LEFT }, - { "right", INPUTEVENT_JOY2_RIGHT }, - { "up", INPUTEVENT_JOY2_UP }, - { "down", INPUTEVENT_JOY2_DOWN }, - { "1", INPUTEVENT_JOY2_FIRE_BUTTON }, - { "2", INPUTEVENT_JOY2_2ND_BUTTON }, - { "3", INPUTEVENT_JOY2_3RD_BUTTON }, - { "red", INPUTEVENT_JOY2_CD32_RED }, - { "yellow", INPUTEVENT_JOY2_CD32_YELLOW }, - { "green", INPUTEVENT_JOY2_CD32_GREEN }, - { "blue", INPUTEVENT_JOY2_CD32_BLUE }, - { "rewind", INPUTEVENT_JOY2_CD32_RWD }, - { "forward", INPUTEVENT_JOY2_CD32_FFW }, - { "play", INPUTEVENT_JOY2_CD32_PLAY }, - { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_1_AUTOFIRE }, - { NULL, 0 }, - }, - // first parallel port joystick - { - { "left", INPUTEVENT_PAR_JOY1_LEFT }, - { "right", INPUTEVENT_PAR_JOY1_RIGHT }, - { "up", INPUTEVENT_PAR_JOY1_UP }, - { "down", INPUTEVENT_PAR_JOY1_DOWN }, - { "1", INPUTEVENT_PAR_JOY1_FIRE_BUTTON }, - { "2", INPUTEVENT_PAR_JOY1_2ND_BUTTON }, - { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_2_AUTOFIRE }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - }, - // second parallel port joystick - { - { "left", INPUTEVENT_PAR_JOY2_LEFT }, - { "right", INPUTEVENT_PAR_JOY2_RIGHT }, - { "up", INPUTEVENT_PAR_JOY2_UP }, - { "down", INPUTEVENT_PAR_JOY2_DOWN }, - { "1", INPUTEVENT_PAR_JOY2_FIRE_BUTTON }, - { "2", INPUTEVENT_PAR_JOY2_2ND_BUTTON }, - { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_3_AUTOFIRE }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - }, - // custom joystick, 65536 = no action - { - { "left", 65536 }, - { "right", 65536 }, - { "up", 65536 }, - { "down", 65536 }, - { "1", 65536 }, - { "2", 65536 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - { NULL, 0 }, - }, +#define NO_ACTION 65536 + +#define COMMON_ACTIONS \ + { "menu_alt", FS_EMU_ACTION_MENU_ALT }, \ + { "pause", FS_EMU_ACTION_PAUSE }, + +static fs_emu_input_mapping g_joystick_port_0_mapping[] = { + { "left", INPUTEVENT_JOY1_LEFT }, + { "right", INPUTEVENT_JOY1_RIGHT }, + { "up", INPUTEVENT_JOY1_UP }, + { "down", INPUTEVENT_JOY1_DOWN }, + { "1", INPUTEVENT_JOY1_FIRE_BUTTON }, + { "2", INPUTEVENT_JOY1_2ND_BUTTON }, + { "3", INPUTEVENT_JOY1_3RD_BUTTON }, + { "red", INPUTEVENT_JOY1_CD32_RED }, + { "yellow", INPUTEVENT_JOY1_CD32_YELLOW }, + { "green", INPUTEVENT_JOY1_CD32_GREEN }, + { "blue", INPUTEVENT_JOY1_CD32_BLUE }, + { "rewind", INPUTEVENT_JOY1_CD32_RWD }, + { "forward", INPUTEVENT_JOY1_CD32_FFW }, + { "play", INPUTEVENT_JOY1_CD32_PLAY }, + { "autofire", INPUTEVENT_JOY1_AUTOFIRE_BUTTON }, + { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_0_AUTOFIRE }, + COMMON_ACTIONS + { NULL, 0 }, }; -void fs_uae_read_override_actions_for_port(int port) { +static fs_emu_input_mapping g_joystick_port_1_mapping[] = { + { "left", INPUTEVENT_JOY2_LEFT }, + { "right", INPUTEVENT_JOY2_RIGHT }, + { "up", INPUTEVENT_JOY2_UP }, + { "down", INPUTEVENT_JOY2_DOWN }, + { "1", INPUTEVENT_JOY2_FIRE_BUTTON }, + { "2", INPUTEVENT_JOY2_2ND_BUTTON }, + { "3", INPUTEVENT_JOY2_3RD_BUTTON }, + { "red", INPUTEVENT_JOY2_CD32_RED }, + { "yellow", INPUTEVENT_JOY2_CD32_YELLOW }, + { "green", INPUTEVENT_JOY2_CD32_GREEN }, + { "blue", INPUTEVENT_JOY2_CD32_BLUE }, + { "rewind", INPUTEVENT_JOY2_CD32_RWD }, + { "forward", INPUTEVENT_JOY2_CD32_FFW }, + { "play", INPUTEVENT_JOY2_CD32_PLAY }, + { "autofire", INPUTEVENT_JOY2_AUTOFIRE_BUTTON }, + { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_1_AUTOFIRE }, + COMMON_ACTIONS + { NULL, 0 }, +}; + +static fs_emu_input_mapping g_parallel_port_1st_mapping[] = { + { "left", INPUTEVENT_PAR_JOY1_LEFT }, + { "right", INPUTEVENT_PAR_JOY1_RIGHT }, + { "up", INPUTEVENT_PAR_JOY1_UP }, + { "down", INPUTEVENT_PAR_JOY1_DOWN }, + { "1", INPUTEVENT_PAR_JOY1_FIRE_BUTTON }, + { "2", INPUTEVENT_PAR_JOY1_2ND_BUTTON }, + { "autofire", INPUTEVENT_PAR_JOY1_AUTOFIRE_BUTTON }, + { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_2_AUTOFIRE }, + COMMON_ACTIONS + { NULL, 0 }, +}; + +static fs_emu_input_mapping g_parallel_port_2nd_mapping[] = { + { "left", INPUTEVENT_PAR_JOY2_LEFT }, + { "right", INPUTEVENT_PAR_JOY2_RIGHT }, + { "up", INPUTEVENT_PAR_JOY2_UP }, + { "down", INPUTEVENT_PAR_JOY2_DOWN }, + { "1", INPUTEVENT_PAR_JOY2_FIRE_BUTTON }, + { "2", INPUTEVENT_PAR_JOY2_2ND_BUTTON }, + { "autofire", INPUTEVENT_PAR_JOY2_AUTOFIRE_BUTTON }, + { "toggle_autofire", INPUTEVENT_AMIGA_JOYPORT_3_AUTOFIRE }, + COMMON_ACTIONS + { NULL, 0 }, +}; + +static fs_emu_input_mapping g_custom_port_mapping[] = { + { "left", NO_ACTION }, + { "right", NO_ACTION }, + { "up", NO_ACTION }, + { "down", NO_ACTION }, + { "1", NO_ACTION }, + { "2", NO_ACTION }, + { NULL, 0 }, +}; + +static fs_emu_input_mapping *g_joystick_mappings[] = { + g_joystick_port_0_mapping, + g_joystick_port_1_mapping, + g_parallel_port_1st_mapping, + g_parallel_port_2nd_mapping, + g_custom_port_mapping, +}; + +void fs_uae_read_override_actions_for_port(int port) +{ fs_log("fs_uae_read_override_actions_for_port %d\n", port); fs_emu_input_mapping *mapping = g_joystick_mappings[port]; - for (int i = 0; i < FS_UAE_MAX_PORT_ACTIONS; i++) { - if (mapping[i].name == NULL) { - continue; - } + for (int i = 0; mapping[i].name != NULL; i++) { const char* name = mapping[i].name; if (strcmp(name, "1") == 0) { name = "primary"; @@ -139,7 +132,8 @@ void fs_uae_read_override_actions_for_port(int port) { } } -static void map_mouse(const char *device_name, int port) { +static void map_mouse(const char *device_name, int port) +{ fs_log("mapping mouse to port %d\n", port); if (port == 0) { fs_emu_configure_mouse(device_name, INPUTEVENT_MOUSE1_HORIZ, @@ -159,7 +153,8 @@ static void map_mouse(const char *device_name, int port) { } static void configure_joystick_port(int port, const char *value, - const char *port_name, const char *joy_dev) { + const char *port_name, const char *joy_dev) +{ fs_emu_log("configuring joystick port %d (%s)\n", port, value); fs_uae_input_port *p = g_fs_uae_input_ports + port; @@ -316,7 +311,8 @@ void fs_uae_configure_input() g_free(value); } -void fs_uae_reconfigure_input_ports_amiga() { +void fs_uae_reconfigure_input_ports_amiga() +{ fs_emu_log("fs_uae_reconfigure_input_ports_amiga\n"); int modes = INPUTEVENT_AMIGA_JOYPORT_MODE_0_LAST - INPUTEVENT_AMIGA_JOYPORT_MODE_0_NONE + 1; @@ -341,7 +337,8 @@ void fs_uae_reconfigure_input_ports_amiga() { } } -void fs_uae_reconfigure_input_ports_host() { +void fs_uae_reconfigure_input_ports_host() +{ fs_emu_log("fs_uae_reconfigure_input_ports_host\n"); fs_emu_reset_input_mapping(); fs_uae_map_keyboard(); diff --git a/src/fs-uae/main.c b/src/fs-uae/main.c index b1a50f4fc..4e3e7ba68 100644 --- a/src/fs-uae/main.c +++ b/src/fs-uae/main.c @@ -3,28 +3,24 @@ #endif #define _GNU_SOURCE 1 - #include - #ifdef USE_SDL -// we must include SDL first before emu.h, so libfsemu's #definition of main -// is the current one (on Windows) when main is encountered further down +/* We must include SDL first before emu.h, so libfsemu's #definition of main + * is the current one (on Windows) when main is encountered further down. */ #include #endif - #ifdef MACOSX #include #endif - #include #include #include #include #include +#include #include #include #include - #include #include #include @@ -33,10 +29,9 @@ #include "fs-uae.h" #include "recording.h" #include "plugins.h" +#include "options.h" #include "config-drives.h" -//static char *g_default_rom_dir = "."; - static int fs_uae_argc; static char **fs_uae_argv; static int g_warn_about_missing_config_file = 0; @@ -44,7 +39,8 @@ static int g_warn_about_missing_config_file = 0; #define LOG_LINE "---------------------------------------------------------" \ "-------------------\n" -static void change_port_device_mode(int data) { +static void change_port_device_mode(int data) +{ int modes = INPUTEVENT_AMIGA_JOYPORT_MODE_0_LAST - INPUTEVENT_AMIGA_JOYPORT_MODE_0_NONE + 1; int port = data / modes; @@ -62,7 +58,8 @@ static void change_port_device_mode(int data) { } } -static void select_port_0_device(int data) { +static void select_port_0_device(int data) +{ printf("--> device index %d\n", data); int port = 0; if (data == 9) { @@ -106,7 +103,8 @@ int g_fs_uae_last_input_event = 0; int g_fs_uae_last_input_event_state = 0; int g_fs_uae_state_number = 0; -void fs_uae_process_input_event(int line, int action, int state, int playback) { +void fs_uae_process_input_event(int line, int action, int state, int playback) +{ static int first_time = 1; if (first_time == 1) { first_time = 0; @@ -303,7 +301,8 @@ static int input_handler_loop(int line) { return 1; } -static void pause_throttle() { +static void pause_throttle() +{ /* if (fs_emu_get_vblank_sync()) { return; @@ -312,7 +311,8 @@ static void pause_throttle() { fs_emu_msleep(5); } -static void event_handler(int line) { +static void event_handler(int line) +{ // printf("%d\n", line); if (line >= 0) { input_handler_loop(line); @@ -379,11 +379,13 @@ static void event_handler(int line) { } +char *g_fs_uae_disk_file_path = NULL; char *g_fs_uae_config_file_path = NULL; char *g_fs_uae_config_dir_path = NULL; //GKeyFile *g_fs_uae_config = NULL; -static int audio_callback_function(int type, int16_t *buffer, int size) { +static int audio_callback_function(int type, int16_t *buffer, int size) +{ if (type == 0) { return fs_emu_audio_queue_buffer(0, buffer, size); } @@ -406,7 +408,8 @@ static int audio_callback_function(int type, int16_t *buffer, int size) { return -1; } -void fs_uae_load_rom_files(const char *path) { +void fs_uae_load_rom_files(const char *path) +{ fs_log("fs_uae_load_rom_files %s\n", path); GDir *dir = g_dir_open(path, 0, NULL); if (dir == NULL) { @@ -470,13 +473,15 @@ void fs_uae_load_rom_files(const char *path) { //exit(1); } -char *fs_uae_encode_path(const char* path) { +char *fs_uae_encode_path(const char* path) +{ // FIXME: libamiga now always accepts UTF-8, so this function is // deprecated. Simply returning a duplicate now. return g_strdup(path); } -char *fs_uae_decode_path(const char* path) { +char *fs_uae_decode_path(const char* path) +{ // FIXME: libamiga now always accepts UTF-8, so this function is // deprecated. Simply returning a duplicate now. return g_strdup(path); @@ -488,7 +493,8 @@ static void on_gui_message(const char* message) fs_emu_warning("%s", message); } -static void on_init() { +static void on_init() +{ fs_log("\n"); fs_log(LOG_LINE); fs_log("uae configuration\n"); @@ -588,13 +594,15 @@ static void on_init() { fs_log("\n"); } -static void pause_function(int pause) { +static void pause_function(int pause) +{ fs_log("pause_function %d\n", pause); //uae_pause(pause); amiga_pause(pause); } -static int load_config_file() { +static int load_config_file() +{ fs_log("load config file\n"); const char *msg = "checking config file %s\n"; @@ -686,11 +694,13 @@ static int load_config_file() { return 0; } -static void log_to_libfsemu(const char *message) { +static void log_to_libfsemu(const char *message) +{ fs_log_string(message); } -static void main_function() { +static void main_function() +{ amiga_main(); fs_log("amiga_main returned\n"); fs_uae_write_recorded_session(); @@ -701,7 +711,8 @@ static void main_function() { // int _putenv(const char *envstring); #endif -static void init_i18n() { +static void init_i18n() +{ if (fs_config_get_boolean("localization") == 0) { fs_log("localization was forced off\n"); return; @@ -747,15 +758,19 @@ static void init_i18n() { #endif } -static void led_function(int led, int state) { - // floppy led status is custom overlay 0..3 - //if (led >= 0) { - // printf("led %d state %d\n", led, state); - //} +static void led_function(int led, int state) +{ + /* floppy led status is custom overlay 0..3 */ +#if 0 + if (led >= 0) { + printf("led %d state %d\n", led, state); + } +#endif fs_emu_set_custom_overlay_state(led, state); } -static void on_update_leds(void *data) { +static void on_update_leds(void *data) +{ amiga_led_data *leds = (amiga_led_data *) data; for (int i = 0; i < 4; i++) { int led = 12; // df0_d1 @@ -766,7 +781,8 @@ static void on_update_leds(void *data) { } -static void media_function(int drive, const char *path) { +static void media_function(int drive, const char *path) +{ // media insertion status is custom overlay 4..7 fs_emu_set_custom_overlay_state(4 + drive, path && path[0]); } @@ -775,8 +791,9 @@ int ManyMouse_Init(void); void ManyMouse_Quit(void); const char *ManyMouse_DeviceName(unsigned int index); -static void list_joysticks() { - printf("# FS-UAE VERSION %s\n", PACKAGE_VERSION); +static void list_joysticks() +{ + printf("# FS-UAE %s\n", PACKAGE_VERSION); printf("# listing keyboards\n"); printf("K: Keyboard\n"); printf("# listing mice\n"); @@ -822,7 +839,12 @@ extern int g_fsdb_debug; extern int g_random_debug_logging; extern int inputdevice_logging; -static void configure_logging(const char *logstr) { +static void configure_logging(const char *logstr) +{ + if (fs_config_get_int(OPTION_LOG_BSDSOCKET) == 1) { + log_bsd = 1; + } + if (!logstr) { fs_log("configure logging: none\n"); return; @@ -847,7 +869,8 @@ static void configure_logging(const char *logstr) { } } -static void cleanup_old_file(const char *path) { +static void cleanup_old_file(const char *path) +{ char *p = fs_uae_expand_path(path); if (fs_path_exists(p)) { if (fs_path_is_dir(p)) { @@ -862,7 +885,8 @@ static void cleanup_old_file(const char *path) { free(p); } -static void cleanup_old_files() { +static void cleanup_old_files() +{ // Logs are now stored in $BASE/Cache/Logs by default cleanup_old_file("$BASE/Logs/FS-UAE.log"); cleanup_old_file("$BASE/Logs/FS-UAE.log.txt"); @@ -873,6 +897,17 @@ static void cleanup_old_files() { cleanup_old_file("$BASE/Logs"); } +static bool check_extension(const char *path, const char *ext) +{ + if (path == NULL) { + return false; + } + gchar* path_lower = g_ascii_strdown(path, -1); + bool result = g_str_has_suffix(path_lower, ext); + g_free(path_lower); + return result; +} + static const char *overlay_names[] = { "df0_led", // 0 "df1_led", // 1 @@ -898,7 +933,7 @@ static const char *overlay_names[] = { NULL, }; -#define COPYRIGHT_NOTICE "\nFS-UAE VERSION %s\n" \ +#define COPYRIGHT_NOTICE "FS-UAE %s\n" \ "Copyright 1995-2002 Bernd Schmidt, 1999-2015 Toni Wilen,\n" \ "2003-2007 Richard Drummond, 2006-2011 Mustafa 'GnoStiC' Tufan,\n" \ "2011-2015 Frode Solheim, and contributors.\n" \ @@ -994,14 +1029,20 @@ int main(int argc, char* argv[]) while (arg && *arg) { const gchar *test_path = *arg; if (test_path && fs_path_exists(test_path)) { - g_fs_uae_config_file_path = g_strdup(test_path); + if (check_extension(test_path, ".fs-uae")) { + g_fs_uae_config_file_path = g_strdup(test_path); + } else if (check_extension(test_path, ".conf")) { + g_fs_uae_config_file_path = g_strdup(test_path); + } else if (check_extension(test_path, ".adf")) { + g_fs_uae_disk_file_path = g_strdup(test_path); + } } arg++; } } - // parse options first, in case base_dir, logging options etc is - // specified on the command line + /* Parse options first, in case base_dir, logging options etc is + * specified on the command line. */ fs_config_parse_options(argc - 1, argv + 1); fs_log("\n"); @@ -1017,12 +1058,14 @@ int main(int argc, char* argv[]) // then load the config file load_config_file(); - // parse options again, overwriting options loaded from configuration - // file - //fs_config_parse_options(argc - 1, argv + 1); init_i18n(); + if (g_fs_uae_disk_file_path) { + fs_config_set_string(OPTION_FLOPPY_DRIVE_0, g_fs_uae_disk_file_path); + g_warn_about_missing_config_file = 0; + } + if (g_warn_about_missing_config_file) { fs_emu_warning(_("No configuration file was found")); } @@ -1103,16 +1146,13 @@ int main(int argc, char* argv[]) record_file); deterministic_mode = 1; fs_uae_enable_recording(record_file); - } - else { + } else { fs_log("not running in record mode\n"); } - if (fs_emu_netplay_enabled() || - fs_config_get_boolean("deterministic") == 1) { + fs_config_get_boolean(OPTION_DETERMINISTIC) == 1) { deterministic_mode = 1; } - if (deterministic_mode) { amiga_set_deterministic_mode(); } @@ -1174,17 +1214,13 @@ int main(int argc, char* argv[]) if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_RGBA) { amiga_set_video_format(AMIGA_VIDEO_FORMAT_RGBA); - } - else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_BGRA) { + } else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_BGRA) { amiga_set_video_format(AMIGA_VIDEO_FORMAT_BGRA); - } - else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_R5G6B5) { + } else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_R5G6B5) { amiga_set_video_format(AMIGA_VIDEO_FORMAT_R5G6B5); - } - else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_R5G5B5A1) { + } else if (fs_emu_get_video_format() == FS_EMU_VIDEO_FORMAT_R5G5B5A1) { amiga_set_video_format(AMIGA_VIDEO_FORMAT_R5G5B5A1); - } - else { + } else { fs_emu_warning("Unsupported video format requested"); } amiga_add_rtg_resolution(672, 540); diff --git a/src/fs-uae/options.h b/src/fs-uae/options.h index 16e4850fd..92bdf2848 100644 --- a/src/fs-uae/options.h +++ b/src/fs-uae/options.h @@ -13,16 +13,22 @@ //#define OPTION_CURSOR_INTEGRATION "cursor_integration" #define OPTION_CPU "cpu" #define OPTION_CPU_IDLE "cpu_idle" +#define OPTION_DETERMINISTIC "deterministic" #define OPTION_DONGLE_TYPE "dongle_type" #define OPTION_FAST_MEMORY "fast_memory" +#define OPTION_FLOPPY_DRIVE_0 "floppy_drive_0" #define OPTION_FLOPPY_DRIVE_VOLUME "floppy_drive_volume" #define OPTION_FLOPPY_DRIVE_VOLUME_EMPTY "floppy_drive_volume_empty" #define OPTION_FPU "fpu" #define OPTION_GRAPHICS_CARD "graphics_card" #define OPTION_GRAPHICS_CARD_ROM "graphics_card_rom" #define OPTION_GRAPHICS_CARD_MEMORY "graphics_card_memory" +#define OPTION_JIT_COMPILER "jit_compiler" +#define OPTION_JIT_MEMORY "jit_memory" #define OPTION_JOYSTICK_PORT_0_AUTOSWITCH "joystick_port_0_autoswitch" #define OPTION_LINE_DOUBLING "line_doubling" +#define OPTION_LOG_AUTOSCALE "log_autoscale" +#define OPTION_LOG_BSDSOCKET "log_bsdsocket" #define OPTION_LOW_RESOLUTION "low_resolution" #define OPTION_MOTHERBOARD_RAM "motherboard_ram" #define OPTION_MMU "mmu" @@ -31,6 +37,7 @@ #define OPTION_SLOW_MEMORY "slow_memory" #define OPTION_SOUND_CARD "sound_card" #define OPTION_STEREO_SEPARATION "stereo_separation" +#define OPTION_THEME_ZOOM "theme_zoom" #define OPTION_UAENATIVE_LIBRARY "uaenative_library" #define OPTION_WORKBENCH_DISK "workbench_disk" #define OPTION_ZORRO_III_MEMORY "zorro_iii_memory" diff --git a/src/fs-uae/paths.c b/src/fs-uae/paths.c index 2d6cf0e71..8fcb10ae8 100644 --- a/src/fs-uae/paths.c +++ b/src/fs-uae/paths.c @@ -162,22 +162,14 @@ static const char* fs_uae_base_dir(void) if (fs_path_exists(test)) { path = next; fs_log("using portable base dir %s\n", path); - next = NULL; + g_free(orig); break; } g_free(test); - if (orig != NULL) { - g_free(orig); - } + g_free(orig); orig = next; next = g_path_get_dirname(next); } - if (orig != NULL) { - g_free(orig); - } - if (next != NULL) { - g_free(next); - } } if (path == NULL) { path = read_custom_path("base-dir"); diff --git a/src/fs-uae/video.c b/src/fs-uae/video.c index 9ecb154fc..643f6fb31 100644 --- a/src/fs-uae/video.c +++ b/src/fs-uae/video.c @@ -12,11 +12,7 @@ #endif #include #include "fs-uae.h" - -//#define MAX_ZOOM_MODES 5 -static int g_zoom_mode = 0; -static int g_zoom_border = 0; -static double g_last_refresh_rate = 0; +#include "options.h" typedef struct zoom_mode { char *name; @@ -44,8 +40,6 @@ static zoom_mode g_zoom_modes[] = { { NULL, NULL, 0, 0, 0, 0 }, }; -int g_fs_uae_video_zoom = 1; - struct WindowOverride { int sx; int sy; @@ -55,7 +49,6 @@ struct WindowOverride { int dy; int dw; int dh; - int ssx; int ssy; int ssw; @@ -65,19 +58,23 @@ struct WindowOverride { static struct WindowOverride* g_window_override = NULL; static struct WindowOverride* g_last_window_override = NULL; - +int g_fs_uae_video_zoom = 1; +static int g_zoom_mode = 0; +static int g_zoom_border = 0; +static double g_last_refresh_rate = 0; +static bool g_fs_log_autoscale = false; +static int g_remember_last_screen = 0; +static int g_use_rtg_scanlines = 0; +static int g_last_seen_mode_rtg = 0; static int g_frame_seq_no = 0; #ifdef FS_EMU_DRIVERS static fs_emu_buffer *g_buffer = NULL; #else static fs_emu_video_buffer *g_buffer = NULL; #endif -static int g_remember_last_screen = 0; - -static int g_use_rtg_scanlines = 0; -static int g_last_seen_mode_rtg = 0; -static int read_window_override_int(const char* s, int* pos, int* out) { +static int read_window_override_int(const char* s, int* pos, int* out) +{ char temp[4]; int read = 0; while(s[*pos] == ' ') ++(*pos); @@ -99,11 +96,12 @@ static int read_window_override_int(const char* s, int* pos, int* out) { *out = atoi(temp); return 1; } - // read failed + /* read failed */ return 0; } -static int read_window_override(const char* s, int* pos) { +static int read_window_override(const char* s, int* pos) +{ while(s[*pos] == ' ') ++(*pos); int sx, sy, sw, sh; int dx, dy, dw, dh; @@ -129,8 +127,8 @@ static int read_window_override(const char* s, int* pos) { if (!read_window_override_int(s, pos, &dy)) return 0; if (!read_window_override_int(s, pos, &dw)) return 0; if (!read_window_override_int(s, pos, &dh)) return 0; - fs_emu_log("viewport transformation: %3d %3d %3d %3d => %3d %3d %3d %3d\n", - sx, sy, sw, sh, dx, dy, dw, dh); + fs_log("viewport transformation: %3d %3d %3d %3d => %3d %3d %3d %3d\n", + sx, sy, sw, sh, dx, dy, dw, dh); struct WindowOverride* wo = (struct WindowOverride*) malloc(sizeof(struct WindowOverride)); wo->sx = sx; @@ -150,15 +148,15 @@ static int read_window_override(const char* s, int* pos) { if (g_last_window_override == NULL) { g_window_override = wo; - } - else { + } else { g_last_window_override->next = wo; } g_last_window_override = wo; return 1; } -static void init_window_overrides() { +static void init_window_overrides() +{ const char *s = fs_config_get_const_string("viewport"); if (s == NULL) { return; @@ -167,22 +165,21 @@ static void init_window_overrides() { while (1) { int result = read_window_override(s, &pos); if (!result) { - fs_emu_log("error parsing wiewport transformation\n"); + fs_log("error parsing wiewport transformation\n"); + } + while(s[pos] == ' ') { + ++(pos); } - while(s[pos] == ' ') ++(pos); int c = s[(pos)++]; if (c == ';') { continue; - } - else if (c == ',') { + } else if (c == ',') { continue; - } - else if (c == '\0') { + } else if (c == '\0') { break; - } - else { + } else { fs_emu_warning("Unexpected byte (%d) while parsing " - "viewport option\n", c); + "viewport option\n", c); return; } } @@ -191,70 +188,97 @@ static void init_window_overrides() { static int ucx = 0, ucy = 0, ucw = 0, uch = 0; static int rd_width, rd_height; -static int modify_coordinates(int *cx, int *cy, int *cw, int *ch) { +static int modify_coordinates(int *cx, int *cy, int *cw, int *ch) +{ + int ocx = *cx, ocy = *cy, ocw = *cw, och = *ch; int changed = 0; - int ocx = *cx; - int ocy = *cy; - int ocw = *cw; - int och = *ch; - if (*cx == 114 && *cy == 96 && *cw == 560 && *ch == 384) { - fs_log("* amiga 600 kickstart screen?\n"); + if (false) { +#if 0 + } else if (*cx == 114 && *cy == 96 && *cw == 560 && *ch == 384) { + if (g_fs_log_autoscale) { + fs_log("* amiga 600 kickstart screen?\n"); + } *cx = 74; *cy = 92; *cw = 640; *ch = 400; changed = 1; - } - else if (*cx == 114 && *cy == 99 && *cw == 560 && *ch == 384) { - fs_log("* amiga 1200 kickstart screen?\n"); +#endif + } else if (*cx == 74 && *cy == 99 && *cw == 640 && *ch == 384) { + if (g_fs_log_autoscale) { + fs_log("* amiga 600 kickstart screen (pre)?\n"); + } *cx = 74; *cy = 92; *cw = 640; *ch = 400; changed = 1; - } + } else if (*cx == 6 && *cy == 99 && *cw == 724 && *ch == 384) { + if (g_fs_log_autoscale) { + fs_log("* amiga 1200 kickstart screen (pre)?\n"); + } + *cx = 74; *cy = 92; *cw = 640; *ch = 400; changed = 1; + } else if (*cx == 114 && *cy == 99 && *cw == 560 && *ch == 384) { + if (g_fs_log_autoscale) { + fs_log("* amiga 600/1200 kickstart screen?\n"); + } + *cx = 74; *cy = 92; *cw = 640; *ch = 400; changed = 1; +#if 0 // The following interfered with autoscaling for Jim Power - /* - else if (*cx == 74 && *cy == 30 && *cw == 640 && *ch == 518) { - fs_log("* workbench 1.3/2.0 screen?\n"); + } else if (*cx == 74 && *cy == 30 && *cw == 640 && *ch == 518) { + if (g_fs_log_autoscale) { + fs_log("* workbench 1.3/2.0 screen?\n"); + } *cx = 74; *cy = 36; *cw = 640; *ch = 512; changed = 1; - } - else if (*cx == 74 && *cy == 28 && *cw == 640 && *ch == 520) { - fs_log("* workbench 1.3/2.0 screen?\n"); + } else if (*cx == 74 && *cy == 28 && *cw == 640 && *ch == 520) { + if (g_fs_log_autoscale) { + fs_log("* workbench 1.3/2.0 screen?\n"); + } *cx = 74; *cy = 36; *cw = 640; *ch = 512; changed = 1; } - */ - /* - else if (*cx == 6 && *cy == 36 && *cw == 724 && *ch == 512) { - fs_log("* workbench screen with too much border?\n"); +#endif +#if 0 + } else if (*cx == 6 && *cy == 36 && *cw == 724 && *ch == 512) { + if (g_fs_log_autoscale) { + fs_log("* workbench screen with too much border?\n"); + } *cx = 74; *cy = 36; *cw = 640; *ch = 512; changed = 1; - } - */ - else if (*cx == 6 && *cy == 6 && *cw == 724 && *ch == 566) { - fs_log("* workbench screen with overscan incorrectly placed?\n"); +#endif + } else if (*cx == 6 && *cy == 6 && *cw == 724 && *ch == 566) { + if (g_fs_log_autoscale) { + fs_log("* workbench screen with overscan incorrectly placed?\n"); + } *cx = 2; *cy = 6; *cw = 724; *ch = 566; changed = 1; - } - else if (*cx == 10 && *cy == 7 && *cw == 716 && *ch == 566) { - fs_log("* amiga cd32 boot screen?\n"); + } else if (*cx == 10 && *cy == 7 && *cw == 716 && *ch == 566) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 boot screen?\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; - } - else if (*cx == 10 && *cy == 6 && *cw == 716 && *ch == 566) { - fs_log("* amiga cd32 boot screen?\n"); + } else if (*cx == 10 && *cy == 6 && *cw == 716 && *ch == 566) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 boot screen?\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; - } - else if (*cx == 6 && *cy == 96 && *cw == 724 && *ch == 476) { - fs_log("* amiga cd32 boot screen (booting CD)\n"); + } else if (*cx == 6 && *cy == 96 && *cw == 724 && *ch == 476) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 boot screen (booting CD)\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; - } - else if (*cx == 10 && *cy == 96 && *cw == 716 && *ch == 476) { - fs_log("* amiga cd32 boot screen (booting CD)\n"); + } else if (*cx == 10 && *cy == 96 && *cw == 716 && *ch == 476) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 boot screen (booting CD)\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; - } - else if (*cx == 6 && *cy == 82 && *cw == 724 && *ch == 490) { - fs_log("* amiga cd32 boot screen (booting Arcade Pool CD)\n"); + } else if (*cx == 6 && *cy == 82 && *cw == 724 && *ch == 490) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 boot screen (booting Arcade Pool CD)\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; - } - else if (*cx + *cw == 698 && *cy == 6 && *ch == 566) { - fs_log("* amiga cd32 menu\n"); + } else if (*cx + *cw == 698 && *cy == 6 && *ch == 566) { + if (g_fs_log_autoscale) { + fs_log("* amiga cd32 menu\n"); + } *cx = 16; *cy = 6; *cw = 704; *ch = 566; changed = 1; } if (changed) { - fs_log("* %3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", - *cx, *cy, *cw, *ch, ocx, ocy, ocw, och); - printf("* %3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", - *cx, *cy, *cw, *ch, ocx, ocy, ocw, och); + if (g_fs_log_autoscale) { + fs_log("* %3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", + *cx, *cy, *cw, *ch, ocx, ocy, ocw, och); + printf("* %3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", + *cx, *cy, *cw, *ch, ocx, ocy, ocw, och); + } } return changed; } @@ -262,7 +286,8 @@ static int modify_coordinates(int *cx, int *cy, int *cw, int *ch) { #define SUBSCAN #ifdef SUBSCAN -static void narrow_rect(RenderData* rd, int *nx, int *ny, int *nw, int *nh) { +static void narrow_rect(RenderData* rd, int *nx, int *ny, int *nw, int *nh) +{ if (rd->bpp != 4) { // not implemented for 16-bit video. return; @@ -359,8 +384,10 @@ static void narrow_rect(RenderData* rd, int *nx, int *ny, int *nw, int *nh) { static int px = 0, py = 0, pw = 0, ph = 0; if (x != px || y != py || w != pw || h != ph) { - fs_log(" sub: %3d %3d %3d %3d\n", x, y, w, h); - printf(" sub: %3d %3d %3d %3d\n", x, y, w, h); + if (g_fs_log_autoscale) { + fs_log(" sub: %3d %3d %3d %3d\n", x, y, w, h); + printf(" sub: %3d %3d %3d %3d\n", x, y, w, h); + } px = x; py = y; pw = w; @@ -379,7 +406,8 @@ static void narrow_rect(RenderData* rd, int *nx, int *ny, int *nw, int *nh) { } #endif -static void render_screen(RenderData* rd) { +static void render_screen(RenderData* rd) +{ #if 0 static int64_t last_time = 0; int64_t t = fs_emu_monotonic_time(); @@ -446,8 +474,10 @@ static void render_screen(RenderData* rd) { int have_narrowed = 0; #endif if (cchange) { - fs_log("auto: %3d %3d %3d %3d\n", cx, cy, cw, ch); - printf("auto: %3d %3d %3d %3d\n", cx, cy, cw, ch); + if (g_fs_log_autoscale) { + fs_log("auto: %3d %3d %3d %3d\n", cx, cy, cw, ch); + printf("auto: %3d %3d %3d %3d\n", cx, cy, cw, ch); + } } modify_coordinates(&cx, &cy, &cw, &ch); //if (!modify_coordinates(&cx, &cy, &cw, &ch)) { @@ -489,10 +519,12 @@ static void render_screen(RenderData* rd) { } #endif /* - fs_log("%3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", - ucx, ucy, ucw, uch, cx, cy, cw, ch); - printf("%3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", - ucx, ucy, ucw, uch, cx, cy, cw, ch); + * if (g_fs_log_autoscale) { + fs_log("%3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", + ucx, ucy, ucw, uch, cx, cy, cw, ch); + printf("%3d %3d %3d %3d [ %3d %3d %3d %3d ]\n", + ucx, ucy, ucw, uch, cx, cy, cw, ch); + } */ break; } @@ -505,14 +537,18 @@ static void render_screen(RenderData* rd) { ucw = cw; uch = ch; /* - fs_log("%3d %3d %3d %3d\n", ucx, ucy, ucw, uch); - printf("%3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + if (g_fs_log_autoscale) { + fs_log("%3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + printf("%3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + } */ } static int lucx = 0, lucy = 0, lucw = 0, luch = 0; if (ucx != lucx || ucy != lucy || ucw != lucw || uch != luch) { - fs_log(" = %3d %3d %3d %3d\n", ucx, ucy, ucw, uch); - printf(" = %3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + if (g_fs_log_autoscale) { + fs_log(" = %3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + printf(" = %3d %3d %3d %3d\n", ucx, ucy, ucw, uch); + } lucx = ucx; lucy = ucy; lucw = ucw; @@ -642,7 +678,8 @@ static void display_screen() #endif } -static void toggle_zoom(int flags) { +static void toggle_zoom(int flags) +{ if (g_last_seen_mode_rtg) { fs_emu_notification(1511162016, _("Zoom is disabled in RTG mode")); return; @@ -730,7 +767,11 @@ void fs_uae_init_video(void) free(value); } - const char* cvalue = fs_config_get_const_string("theme_zoom"); + if (fs_config_get_boolean(OPTION_LOG_AUTOSCALE) == 1) { + g_fs_log_autoscale = true; + } + + const char* cvalue = fs_config_get_const_string(OPTION_THEME_ZOOM); if (cvalue) { zoom_mode *z = g_zoom_modes + CUSTOM_ZOOM_MODE; //char *name = malloc(strlen(cvalue) + 1); diff --git a/src/include/bsdsocket.h b/src/include/bsdsocket.h index ea7cfa5f2..cce73914d 100644 --- a/src/include/bsdsocket.h +++ b/src/include/bsdsocket.h @@ -219,4 +219,4 @@ void bsdsock_fake_int_handler(void); extern int volatile bsd_int_requested; -#endif // UAE_BSDSOCKET_H +#endif /* UAE_BSDSOCKET_H */ diff --git a/src/include/cpuboard.h b/src/include/cpuboard.h index 76660cc44..5f0cc35fe 100644 --- a/src/include/cpuboard.h +++ b/src/include/cpuboard.h @@ -34,6 +34,7 @@ extern int REGPARAM3 cyberstorm_scsi_ram_check(uaecptr addr, uae_u32 size) REGPA extern uae_u8 *REGPARAM3 cyberstorm_scsi_ram_xlate(uaecptr addr) REGPARAM; void cyberstorm_irq(int level); +void cyberstorm_mk3_ppc_irq(int level); void blizzardppc_irq(int level); #define BOARD_MEMORY_Z2 1 diff --git a/src/include/uae/types.h b/src/include/uae/types.h index e8193a005..b7162f249 100644 --- a/src/include/uae/types.h +++ b/src/include/uae/types.h @@ -34,11 +34,15 @@ typedef uint32_t uae_u32; #ifndef uae_s64 typedef long long int uae_s64; #endif - #ifndef uae_u64 typedef unsigned long long int uae_u64; #endif +#ifdef HAVE___UINT128_T +#define HAVE_UAE_U128 +typedef __uint128_t uae_u128; +#endif + /* Parts of the UAE/WinUAE code uses the bool type (from C++). * Including stdbool.h lets this be valid also when compiling with C. */ diff --git a/src/inputevents.def b/src/inputevents.def index 6db929ec0..44c241256 100644 --- a/src/inputevents.def +++ b/src/inputevents.def @@ -405,6 +405,13 @@ DEFEVENT(SPC_CDTV_FRONT_PANEL_FF,_T("CDTV Front Panel Fast Forward"),AM_K,0,0,AK #ifdef FSUAE +DEFEVENT(AUTOFIRE_BEGIN, _T(""), AM_K, 0, 0, 0) +DEFEVENT(JOY1_AUTOFIRE_BUTTON,_T("Joy1 Fire/Mouse1 Left Button (Autofire)"),AM_K,4,1,JOYBUTTON_1) +DEFEVENT(JOY2_AUTOFIRE_BUTTON,_T("Joy2 Fire/Mouse2 Left Button (Autofire)"),AM_K,4,2,JOYBUTTON_1) +DEFEVENT(PAR_JOY1_AUTOFIRE_BUTTON,_T("Parallel Joy1 Fire Button (Autofire)"),AM_K,4,3,JOYBUTTON_1) +DEFEVENT(PAR_JOY2_AUTOFIRE_BUTTON,_T("Parallel Joy2 Fire Button (Autofire)"),AM_K,4,4,JOYBUTTON_1) +DEFEVENT(AUTOFIRE_END, _T(""), AM_K, 0, 0, 0) + DEFEVENT(SPC_STATESAVE1,_T("Quick save state slot 1"),AM_K,0,0,AKS_STATESAVEQUICK1) DEFEVENT(SPC_STATESAVE2,_T("Quick save state slot 2"),AM_K,0,0,AKS_STATESAVEQUICK2) DEFEVENT(SPC_STATESAVE3,_T("Quick save state slot 3"),AM_K,0,0,AKS_STATESAVEQUICK3) diff --git a/src/jit/compemu.h b/src/jit/compemu.h index a07d883f7..b70e99d0f 100644 --- a/src/jit/compemu.h +++ b/src/jit/compemu.h @@ -323,6 +323,7 @@ DECLARE(setcc_m(IMM d, IMM cc)); DECLARE(cmov_b_rr(RW1 d, R1 s, IMM cc)); DECLARE(cmov_w_rr(RW2 d, R2 s, IMM cc)); DECLARE(cmov_l_rr(RW4 d, R4 s, IMM cc)); +DECLARE(setzflg_l(RW4 r)); DECLARE(cmov_l_rm(RW4 d, IMM s, IMM cc)); DECLARE(bsf_l_rr(W4 d, R4 s)); DECLARE(pop_m(IMM d)); @@ -578,3 +579,10 @@ void comp_fbcc_opp (uae_u32 opcode); void comp_fsave_opp (uae_u32 opcode); void comp_frestore_opp (uae_u32 opcode); void comp_fpp_opp (uae_u32 opcode, uae_u16 extra); + +#ifdef _WIN32 +LONG WINAPI EvalException(LPEXCEPTION_POINTERS info); +#if defined(_MSC_VER) && !defined(NO_WIN32_EXCEPTION_HANDLER) +#define USE_STRUCTURED_EXCEPTION_HANDLING +#endif +#endif diff --git a/src/jit/compemu_raw_x86.cpp b/src/jit/compemu_raw_x86.cpp index 4d5413edb..72bffd7aa 100644 --- a/src/jit/compemu_raw_x86.cpp +++ b/src/jit/compemu_raw_x86.cpp @@ -1,15 +1,6 @@ /* This should eventually end up in machdep/, but for now, x86 is the only target, and it's easier this way... */ -#ifdef FSUAE // NL -extern uae_u8 *natmem_offset, *natmem_offset_end; - -#ifdef WINDOWS -#define _WIN32 -#endif - -#endif - /************************************************************************* * Some basic information about the the target CPU * *************************************************************************/ @@ -1685,611 +1676,15 @@ STATIC_INLINE void raw_inc_sp(int off) raw_add_l_ri(4,off); } + /************************************************************************* * Handling mistaken direct memory access * *************************************************************************/ - -#ifdef NATMEM_OFFSET -#ifdef _WIN32 // %%% BRIAN KING WAS HERE %%% -#include -#else -#ifndef __USE_GNU -#define __USE_GNU -#endif -#include -#endif -#include - -#define SIG_READ 1 -#define SIG_WRITE 2 - -static int in_handler=0; -static uae_u8 *veccode; - -#ifdef _WIN32 - -#if defined(CPU_64_BIT) -#define ctxPC (pContext->Rip) -#else -#define ctxPC (pContext->Eip) -#endif - -int EvalException (LPEXCEPTION_POINTERS blah, int n_except) -{ - PEXCEPTION_RECORD pExceptRecord = NULL; - PCONTEXT pContext = NULL; - - uae_u8* i = NULL; - uae_u32 addr = 0; - int r=-1; - int size=4; - int dir=-1; - int len=0; - - if (n_except != STATUS_ACCESS_VIOLATION || !canbang || currprefs.cachesize == 0) - return EXCEPTION_CONTINUE_SEARCH; - - pExceptRecord = blah->ExceptionRecord; - pContext = blah->ContextRecord; - - if (pContext) - i = (uae_u8 *)ctxPC; - if (pExceptRecord) - addr = (uae_u32)(pExceptRecord->ExceptionInformation[1]); -#ifdef JIT_DEBUG - write_log (_T("JIT: fault address is 0x%x at 0x%x\n"),addr,i); +#ifdef UAE +#include "exception_handler.cpp" #endif - if (!canbang || !currprefs.cachesize) - return EXCEPTION_CONTINUE_SEARCH; - - if (in_handler) - write_log (_T("JIT: Argh --- Am already in a handler. Shouldn't happen!\n")); - if (canbang && i>=compiled_code && i<=current_compile_p) { - if (*i==0x66) { - i++; - size=2; - len++; - } - - switch(i[0]) { - case 0x8a: - if ((i[1]&0xc0)==0x80) { - r=(i[1]>>3)&7; - dir=SIG_READ; - size=1; - len+=6; - break; - } - break; - case 0x88: - if ((i[1]&0xc0)==0x80) { - r=(i[1]>>3)&7; - dir=SIG_WRITE; - size=1; - len+=6; - break; - } - break; - case 0x8b: - switch(i[1]&0xc0) { - case 0x80: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=6; - break; - case 0x40: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=3; - break; - case 0x00: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=2; - break; - default: - break; - } - break; - case 0x89: - switch(i[1]&0xc0) { - case 0x80: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=6; - break; - case 0x40: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=3; - break; - case 0x00: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=2; - break; - } - break; - } - } - - if (r!=-1) { - void* pr=NULL; -#ifdef JIT_DEBUG - write_log (_T("JIT: register was %d, direction was %d, size was %d\n"),r,dir,size); -#endif - - switch(r) { -#if defined(CPU_64_BIT) - case 0: pr=&(pContext->Rax); break; - case 1: pr=&(pContext->Rcx); break; - case 2: pr=&(pContext->Rdx); break; - case 3: pr=&(pContext->Rbx); break; - case 4: pr=(size>1)?NULL:(((uae_u8*)&(pContext->Rax))+1); break; - case 5: pr=(size>1)? - (void*)(&(pContext->Rbp)): - (void*)(((uae_u8*)&(pContext->Rcx))+1); break; - case 6: pr=(size>1)? - (void*)(&(pContext->Rsi)): - (void*)(((uae_u8*)&(pContext->Rdx))+1); break; - case 7: pr=(size>1)? - (void*)(&(pContext->Rdi)): - (void*)(((uae_u8*)&(pContext->Rbx))+1); break; -#else - case 0: pr=&(pContext->Eax); break; - case 1: pr=&(pContext->Ecx); break; - case 2: pr=&(pContext->Edx); break; - case 3: pr=&(pContext->Ebx); break; - case 4: pr=(size>1)?NULL:(((uae_u8*)&(pContext->Eax))+1); break; - case 5: pr=(size>1)? - (void*)(&(pContext->Ebp)): - (void*)(((uae_u8*)&(pContext->Ecx))+1); break; - case 6: pr=(size>1)? - (void*)(&(pContext->Esi)): - (void*)(((uae_u8*)&(pContext->Edx))+1); break; - case 7: pr=(size>1)? - (void*)(&(pContext->Edi)): - (void*)(((uae_u8*)&(pContext->Ebx))+1); break; -#endif - default: abort(); - } - if (pr) { - blockinfo* bi; - - if (currprefs.comp_oldsegv) { - addr-=(uae_u32)NATMEM_OFFSET; - -#ifdef JIT_DEBUG - if ((addr>=0x10000000 && addr<0x40000000) || - (addr>=0x50000000)) { - write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); - } -#endif - if (dir==SIG_READ) { - switch (size) { - case 1: *((uae_u8*)pr)=get_byte (addr); break; - case 2: *((uae_u16*)pr)=swap16(get_word (addr)); break; - case 4: *((uae_u32*)pr)=swap32(get_long (addr)); break; - default: abort(); - } - } - else { /* write */ - switch (size) { - case 1: put_byte (addr,*((uae_u8*)pr)); break; - case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; - case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; - default: abort(); - } - } -#ifdef JIT_DEBUG - write_log (_T("JIT: Handled one access!\n")); -#endif - fflush(stdout); - segvcount++; - ctxPC+=len; - } - else { - void* tmp=target; - int i; - uae_u8 vecbuf[5]; - - addr-=(uae_u32)NATMEM_OFFSET; - -#ifdef JIT_DEBUG - if ((addr>=0x10000000 && addr<0x40000000) || - (addr>=0x50000000)) { - write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); - } -#endif - - target=(uae_u8*)ctxPC; - for (i=0;i<5;i++) - vecbuf[i]=target[i]; - emit_byte(0xe9); - emit_long((uae_u32)veccode-(uae_u32)target-4); -#ifdef JIT_DEBUG - - write_log (_T("JIT: Create jump to %p\n"),veccode); - write_log (_T("JIT: Handled one access!\n")); -#endif - segvcount++; - - target=veccode; - - if (dir==SIG_READ) { - switch(size) { - case 1: raw_mov_b_ri(r,get_byte (addr)); break; - case 2: raw_mov_w_ri(r,swap16(get_word (addr))); break; - case 4: raw_mov_l_ri(r,swap32(get_long (addr))); break; - default: abort(); - } - } - else { /* write */ - switch(size) { - case 1: put_byte (addr,*((uae_u8*)pr)); break; - case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; - case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; - default: abort(); - } - } - for (i=0;i<5;i++) - raw_mov_b_mi(ctxPC+i,vecbuf[i]); - raw_mov_l_mi((uae_u32)&in_handler,0); - emit_byte(0xe9); - emit_long(ctxPC+len-(uae_u32)target-4); - in_handler=1; - target=(uae_u8*)tmp; - } - bi=active; - while (bi) { - if (bi->handler && - (uae_u8*)bi->direct_handler<=i && - (uae_u8*)bi->nexthandler>i) { -#ifdef JIT_DEBUG - write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), - bi->handler, - i, - bi->nexthandler, - bi->pc_p); -#endif - invalidate_block(bi); - raise_in_cl_list(bi); - set_special(0); - return EXCEPTION_CONTINUE_EXECUTION; - } - bi=bi->next; - } - /* Not found in the active list. Might be a rom routine that - is in the dormant list */ - bi=dormant; - while (bi) { - if (bi->handler && - (uae_u8*)bi->direct_handler<=i && - (uae_u8*)bi->nexthandler>i) { -#ifdef JIT_DEBUG - write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), - bi->handler, - i, - bi->nexthandler, - bi->pc_p); -#endif - invalidate_block(bi); - raise_in_cl_list(bi); - set_special(0); - return EXCEPTION_CONTINUE_EXECUTION; - } - bi=bi->next; - } -#ifdef JIT_DEBUG - write_log (_T("JIT: Huh? Could not find trigger!\n")); -#endif - return EXCEPTION_CONTINUE_EXECUTION; - } - } - write_log (_T("JIT: Can't handle access %08X!\n"), i); -#if 0 - if (i) - { - int j; - - for (j=0;j<10;j++) { - write_log (_T("JIT: instruction byte %2d is 0x%02x\n"),j,i[j]); - } - } - write_log (_T("Please send the above info (starting at \"fault address\") to\n")); - write_log (_T("bmeyer@csse.monash.edu.au\n")); - write_log (_T("This shouldn't happen ;-)\n")); -#endif - return EXCEPTION_CONTINUE_SEARCH; -} -#else - -#if defined(__APPLE__) && __DARWIN_UNIX03 -#define CONTEXT_MEMBER(x) __##x -#elif defined(__FreeBSD__) -#define CONTEXT_MEMBER(x) sc_##x -#else -#define CONTEXT_MEMBER(x) x -#endif - -#ifdef __APPLE__ -static void vec(int x, siginfo_t *info, ucontext_t *uap) -{ - _STRUCT_X86_THREAD_STATE32 sc = uap->uc_mcontext->CONTEXT_MEMBER(ss); - uae_u32 addr = 0; -#else -static void vec(int x, struct sigcontext sc) -{ -#endif - uae_u8* i=(uae_u8*)sc.CONTEXT_MEMBER(eip); -#ifdef __APPLE__ - if (i >= compiled_code) { - unsigned int j; - write_log ("JIT_APPLE: can't handle access!\n"); - for (j = 0 ; j < 10; j++) - write_log ("JIT: instruction byte %2d is %02x\n", i, j[i]); - } else { - write_log ("Caught illegal access to (unknown) at eip=%08x\n", i); - } - exit (EXIT_FAILURE); -#elif defined(__FreeBSD__) - //uae_u32 addr=sc.cr2; - uae_u32 addr=sc.CONTEXT_MEMBER(spare2); // UJ: @@@@: ????: -#else - uae_u32 addr=sc.cr2; -#endif - int r=-1; - int size=4; - int dir=-1; - int len=0; - int j; - - write_log (_T("JIT: fault address is %08x at %08x\n"),addr,i); - if (!canbang) - write_log (_T("JIT: Not happy! Canbang is 0 in SIGSEGV handler!\n")); - if (in_handler) - write_log (_T("JIT: Argh --- Am already in a handler. Shouldn't happen!\n")); - - /* - * Decode access opcode - */ - if (canbang && i>=compiled_code && i<=current_compile_p) { - if (*i==0x66) { - i++; - size=2; - len++; - } - - switch(i[0]) { - case 0x8a: - if ((i[1]&0xc0)==0x80) { - r=(i[1]>>3)&7; - dir=SIG_READ; - size=1; - len+=6; - break; - } - break; - case 0x88: - if ((i[1]&0xc0)==0x80) { - r=(i[1]>>3)&7; - dir=SIG_WRITE; - size=1; - len+=6; - break; - } - break; - - case 0x8b: - switch(i[1]&0xc0) { - case 0x80: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=6; - break; - case 0x40: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=3; - break; - case 0x00: - r=(i[1]>>3)&7; - dir=SIG_READ; - len+=2; - break; - default: - break; - } - break; - - case 0x89: - switch(i[1]&0xc0) { - case 0x80: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=6; - break; - case 0x40: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=3; - break; - case 0x00: - r=(i[1]>>3)&7; - dir=SIG_WRITE; - len+=2; - break; - } - break; - } - } - - if (r!=-1) { - void* pr=NULL; - write_log (_T("JIT: register was %d, direction was %d, size was %d\n"),r,dir,size); - - switch(r) { - case 0: pr = &(sc.CONTEXT_MEMBER(eax)); break; - case 1: pr = &(sc.CONTEXT_MEMBER(ecx)); break; - case 2: pr = &(sc.CONTEXT_MEMBER(edx)); break; - case 3: pr = &(sc.CONTEXT_MEMBER(ebx)); break; - case 4: pr = (size>1) ? NULL:(((uae_u8*)&(sc.CONTEXT_MEMBER(eax)))+1); break; - case 5: pr=(size>1)? - (void*)(&(sc.CONTEXT_MEMBER(ebp))): - (void*)(((uae_u8*)&(sc.CONTEXT_MEMBER(ecx)))+1); break; - case 6: pr=(size>1)? - (void*)(&(sc.CONTEXT_MEMBER(esi))): - (void*)(((uae_u8*)&(sc.CONTEXT_MEMBER(edx)))+1); break; - case 7: pr=(size>1)? - (void*)(&(sc.CONTEXT_MEMBER(edi))): - (void*)(((uae_u8*)&(sc.CONTEXT_MEMBER(ebx)))+1); break; - default: abort(); - } - if (pr) { - blockinfo* bi; - - if (currprefs.comp_oldsegv) { -#ifdef FSUAE -// FIXME: check why (uae_u8 was here originally...?) - addr -= (uae_u32)NATMEM_OFFSET; -#else - addr -= (uae_u8)NATMEM_OFFSET; -#endif - - if ((addr>=0x10000000 && addr<0x40000000) || - (addr>=0x50000000)) { - write_log (_T("JIT: Suspicious address in %x SEGV handler.\n"),addr); - } - if (dir==SIG_READ) { - switch(size) { - case 1: *((uae_u8*)pr)=get_byte (addr); break; - case 2: *((uae_u16*)pr)=get_word (addr); break; - case 4: *((uae_u32*)pr)=get_long (addr); break; - default: abort(); - } - } - else { /* write */ - switch(size) { - case 1: put_byte (addr,*((uae_u8*)pr)); break; - case 2: put_word (addr,*((uae_u16*)pr)); break; - case 4: put_long (addr,*((uae_u32*)pr)); break; - default: abort(); - } - } - write_log ("JIT: Handled one access!\n"); - fflush(stdout); - segvcount++; - sc.CONTEXT_MEMBER(eip) += len; - } - else { - uint8_t* tmp=target; - int i; - uae_u8 vecbuf[5]; - -#ifdef FSUAE -// FIXME: check why (uae_u8 was here originally...?) - addr -= (uae_u32)NATMEM_OFFSET; -#else - addr-=(uae_u8)NATMEM_OFFSET; -#endif - - if ((addr>=0x10000000 && addr<0x40000000) || - (addr>=0x50000000)) { - write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); - } - - target = (uae_u8*)sc.CONTEXT_MEMBER(eip); - for (i=0;i<5;i++) - vecbuf[i]=target[i]; - emit_byte(0xe9); - emit_long((uae_u32)veccode-(uae_u32)target-4); - write_log (_T("JIT: Create jump to %p\n"),veccode); - - write_log (_T("JIT: Handled one access!\n")); - segvcount++; - - target=veccode; - - if (dir==SIG_READ) { - switch(size) { - case 1: raw_mov_b_ri(r,get_byte (addr)); break; - case 2: raw_mov_w_ri(r,get_word (addr)); break; - case 4: raw_mov_l_ri(r,get_long (addr)); break; - default: abort(); - } - } - else { /* write */ - switch(size) { - case 1: put_byte (addr,*((uae_u8*)pr)); break; - case 2: put_word (addr,*((uae_u16*)pr)); break; - case 4: put_long (addr,*((uae_u32*)pr)); break; - default: abort(); - } - } - for (i=0;i<5;i++) - raw_mov_b_mi(sc.CONTEXT_MEMBER(eip)+i,vecbuf[i]); - raw_mov_l_mi((uae_u32)&in_handler,0); - emit_byte(0xe9); - emit_long(sc.CONTEXT_MEMBER(eip)+len-(uae_u32)target-4); - in_handler=1; - target=tmp; - } - bi=active; - while (bi) { - if (bi->handler && - (uae_u8*)bi->direct_handler<=i && - (uae_u8*)bi->nexthandler>i) { - write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), - bi->handler, - i, - bi->nexthandler, - bi->pc_p); - invalidate_block(bi); - raise_in_cl_list(bi); - set_special(0); - return; - } - bi=bi->next; - } - /* Not found in the active list. Might be a rom routine that - is in the dormant list */ - bi=dormant; - while (bi) { - if (bi->handler && - (uae_u8*)bi->direct_handler<=i && - (uae_u8*)bi->nexthandler>i) { - write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), - bi->handler, - i, - bi->nexthandler, - bi->pc_p); - invalidate_block(bi); - raise_in_cl_list(bi); - set_special(0); - return; - } - bi=bi->next; - } - write_log (_T("JIT: Huh? Could not find trigger!\n")); - return; - } - } - write_log (_T("JIT: Can't handle access!\n")); - for (j=0;j<10;j++) { - write_log (_T("JIT: instruction byte %2d is %02x\n"),j,i[j]); - } -#if 0 - write_log (_T("Please send the above info (starting at \"fault address\") to\n") - "bmeyer@csse.monash.edu.au\n" - "This shouldn't happen ;-)\n"); - fflush(stdout); -#endif - signal(SIGSEGV,SIG_DFL); /* returning here will cause a "real" SEGV */ -} -#endif -#endif /************************************************************************* * Checking for CPU features * diff --git a/src/jit/compemu_support.cpp b/src/jit/compemu_support.cpp index 8d832abe7..0c08abb8f 100644 --- a/src/jit/compemu_support.cpp +++ b/src/jit/compemu_support.cpp @@ -5015,7 +5015,7 @@ STATIC_INLINE void writemem(int address, int source, int offset, int size, int t void writebyte(int address, int source, int tmp) { int distrust = currprefs.comptrustbyte; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustbyte) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5034,7 +5034,7 @@ STATIC_INLINE void writeword_general(int address, int source, int tmp, int clobber) { int distrust = currprefs.comptrustword; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustword) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5063,7 +5063,7 @@ STATIC_INLINE void writelong_general(int address, int source, int tmp, int clobber) { int distrust = currprefs.comptrustlong; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustlong) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5145,7 +5145,7 @@ STATIC_INLINE void readmem(int address, int dest, int offset, int size, int tmp) void readbyte(int address, int dest, int tmp) { int distrust = currprefs.comptrustbyte; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustbyte) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5163,7 +5163,7 @@ void readbyte(int address, int dest, int tmp) void readword(int address, int dest, int tmp) { int distrust = currprefs.comptrustword; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustword) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5181,7 +5181,7 @@ void readword(int address, int dest, int tmp) void readlong(int address, int dest, int tmp) { int distrust = currprefs.comptrustlong; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustlong) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5228,7 +5228,7 @@ STATIC_INLINE void get_n_addr_real(int address, int dest, int tmp) void get_n_addr(int address, int dest, int tmp) { int distrust = currprefs.comptrustnaddr; -#if 0 +#ifdef FSUAE switch (currprefs.comptrustnaddr) { case 0: distrust=0; break; case 1: distrust=1; break; @@ -5677,19 +5677,7 @@ void build_comp(void) #endif raw_init_cpu(); #ifdef NATMEM_OFFSET - write_log (_T("JIT: Setting signal handler\n")); -#ifndef _WIN32 -#ifdef FSUAE - struct sigaction sa; - sa.sa_handler = (void (*)(int)) vec; - sigemptyset(&sa.sa_mask); - sa.sa_flags = SA_RESTART; - - sigaction(SIGSEGV, &sa, NULL); -#else - signal(SIGSEGV,vec); -#endif -#endif + install_exception_handler(); #endif write_log (_T("JIT: Building Compiler function table\n")); for (opcode = 0; opcode < 65536; opcode++) { diff --git a/src/jit/exception_handler.cpp b/src/jit/exception_handler.cpp new file mode 100644 index 000000000..ed4c32ad2 --- /dev/null +++ b/src/jit/exception_handler.cpp @@ -0,0 +1,440 @@ +/************************************************************************* +* Handling mistaken direct memory access * +*************************************************************************/ + +#ifdef NATMEM_OFFSET +#ifdef _WIN32 // %%% BRIAN KING WAS HERE %%% +#include +#else +#ifndef __USE_GNU +#define __USE_GNU +#endif +#include +#endif +#include + +#define SIG_READ 1 +#define SIG_WRITE 2 + +static int in_handler=0; +static uae_u8 *veccode; + +#ifdef _WIN32 + +typedef LPEXCEPTION_POINTERS CONTEXT_T; +#define HAVE_CONTEXT_T 1 + +#define CONTEXT_EIP(context) (context->ContextRecord->Eip) +#define CONTEXT_EAX(context) (context->ContextRecord->Eax) +#define CONTEXT_ECX(context) (context->ContextRecord->Ecx) +#define CONTEXT_EDX(context) (context->ContextRecord->Edx) +#define CONTEXT_EBX(context) (context->ContextRecord->Ebx) +#define CONTEXT_ESP(context) (context->ContextRecord->Esp) +#define CONTEXT_EBP(context) (context->ContextRecord->Ebp) +#define CONTEXT_ESI(context) (context->ContextRecord->Esi) +#define CONTEXT_EDI(context) (context->ContextRecord->Edi) + +#define CONTEXT_RIP(context) (context->ContextRecord->Rip) +#define CONTEXT_RAX(context) (context->ContextRecord->Rax) +#define CONTEXT_RCX(context) (context->ContextRecord->Rcx) +#define CONTEXT_RDX(context) (context->ContextRecord->Rdx) +#define CONTEXT_RBX(context) (context->ContextRecord->Rbx) +#define CONTEXT_RSP(context) (context->ContextRecord->Rsp) +#define CONTEXT_RBP(context) (context->ContextRecord->Rbp) +#define CONTEXT_RSI(context) (context->ContextRecord->Rsi) +#define CONTEXT_RDI(context) (context->ContextRecord->Rdi) + +#elif HAVE_STRUCT_UCONTEXT_UC_MCONTEXT_GREGS + +typedef void *CONTEXT_T; +#define HAVE_CONTEXT_T 1 + +#define CONTEXT_EIP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EIP]) +#define CONTEXT_EAX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EAX]) +#define CONTEXT_ECX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_ECX]) +#define CONTEXT_EDX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EDX]) +#define CONTEXT_EBX(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EBX]) +#define CONTEXT_ESP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_ESP]) +#define CONTEXT_EBP(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EBP]) +#define CONTEXT_ESI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_ESI]) +#define CONTEXT_EDI(context) (((struct ucontext *) context)->uc_mcontext.gregs[REG_EDI]) + +#elif defined(__DARWIN_UNIX03) && defined(_STRUCT_X86_EXCEPTION_STATE32) + +typedef void *CONTEXT_T; +#define HAVE_CONTEXT_T 1 +#define CONTEXT_EIP(context) (*((unsigned long *) &((ucontext_t *) context)->uc_mcontext->__ss.__eip)) +#define CONTEXT_EAX(context) (((ucontext_t *) context)->uc_mcontext->__ss.__eax) +#define CONTEXT_ECX(context) (((ucontext_t *) context)->uc_mcontext->__ss.__ecx) +#define CONTEXT_EDX(context) (((ucontext_t *) context)->uc_mcontext->__ss.__edx) +#define CONTEXT_EBX(context) (((ucontext_t *) context)->uc_mcontext->__ss.__ebx) +#define CONTEXT_ESP(context) (*((unsigned long *) &((ucontext_t *) context)->uc_mcontext->__ss.__esp)) +#define CONTEXT_EBP(context) (((ucontext_t *) context)->uc_mcontext->__ss.__ebp) +#define CONTEXT_ESI(context) (((ucontext_t *) context)->uc_mcontext->__ss.__esi) +#define CONTEXT_EDI(context) (((ucontext_t *) context)->uc_mcontext->__ss.__edi) + +#endif + +#if defined(CPU_64_BIT) +#ifdef CONTEXT_RIP +#define CONTEXT_PC(context) CONTEXT_RIP(context) +#endif +#else +#ifdef CONTEXT_EIP +#define CONTEXT_PC(context) CONTEXT_EIP(context) +#endif +#endif + +#ifdef HAVE_CONTEXT_T +/* + * Try to handle faulted memory access in compiled code + * + * Returns 1 if handled, 0 otherwise + */ +static int handle_access(uintptr_t fault_addr, CONTEXT_T context) +{ + uae_u8 *i = (uae_u8 *) CONTEXT_EIP(context); + uae_u32 addr = fault_addr; + + int r=-1; + int size=4; + int dir=-1; + int len=0; + +#ifdef JIT_DEBUG + write_log (_T("JIT: fault address is 0x%x at 0x%x\n"),addr,i); +#endif + if (!canbang || !currprefs.cachesize) + return 0; + + if (in_handler) + write_log (_T("JIT: Argh --- Am already in a handler. Shouldn't happen!\n")); + + if (canbang && i>=compiled_code && i<=current_compile_p) { + if (*i==0x66) { + i++; + size=2; + len++; + } + + switch(i[0]) { + case 0x8a: + if ((i[1]&0xc0)==0x80) { + r=(i[1]>>3)&7; + dir=SIG_READ; + size=1; + len+=6; + break; + } + break; + case 0x88: + if ((i[1]&0xc0)==0x80) { + r=(i[1]>>3)&7; + dir=SIG_WRITE; + size=1; + len+=6; + break; + } + break; + case 0x8b: + switch(i[1]&0xc0) { + case 0x80: + r=(i[1]>>3)&7; + dir=SIG_READ; + len+=6; + break; + case 0x40: + r=(i[1]>>3)&7; + dir=SIG_READ; + len+=3; + break; + case 0x00: + r=(i[1]>>3)&7; + dir=SIG_READ; + len+=2; + break; + default: + break; + } + break; + case 0x89: + switch(i[1]&0xc0) { + case 0x80: + r=(i[1]>>3)&7; + dir=SIG_WRITE; + len+=6; + break; + case 0x40: + r=(i[1]>>3)&7; + dir=SIG_WRITE; + len+=3; + break; + case 0x00: + r=(i[1]>>3)&7; + dir=SIG_WRITE; + len+=2; + break; + } + break; + } + } + + if (r!=-1) { + void* pr=NULL; +#ifdef JIT_DEBUG + write_log (_T("JIT: register was %d, direction was %d, size was %d\n"),r,dir,size); +#endif + + switch(r) { +#if defined(CPU_64_BIT) + case 0: pr = &(CONTEXT_RAX(context)); break; + case 1: pr = &(CONTEXT_RCX(context)); break; + case 2: pr = &(CONTEXT_RDX(context)); break; + case 3: pr = &(CONTEXT_RBX(context)); break; + case 4: pr = (size > 1) ? NULL + : (((uae_u8*)&(CONTEXT_RAX(context)))+1); + break; + case 5: pr = (size > 1) ? (void*) (&(CONTEXT_RBP(context))) + : (void*)(((uae_u8*)&(CONTEXT_RCX(context))) + 1); + break; + case 6: pr = (size > 1) ? (void*) (&(CONTEXT_RSI(context))) + : (void*)(((uae_u8*)&(CONTEXT_RDX(context))) + 1); + break; + case 7: pr = (size > 1) ? (void*) (&(CONTEXT_RDI(context))) + : (void*)(((uae_u8*)&(CONTEXT_RBX(context))) + 1); + break; +#else + case 0: pr = &(CONTEXT_EAX(context)); break; + case 1: pr = &(CONTEXT_ECX(context)); break; + case 2: pr = &(CONTEXT_EDX(context)); break; + case 3: pr = &(CONTEXT_EBX(context)); break; + case 4: pr = (size > 1) ? NULL + : (((uae_u8*)&(CONTEXT_EAX(context)))+1); + break; + case 5: pr = (size > 1) ? (void*) (&(CONTEXT_EBP(context))) + : (void*)(((uae_u8*)&(CONTEXT_ECX(context))) + 1); + break; + case 6: pr = (size > 1) ? (void*) (&(CONTEXT_ESI(context))) + : (void*)(((uae_u8*)&(CONTEXT_EDX(context))) + 1); + break; + case 7: pr = (size > 1) ? (void*) (&(CONTEXT_EDI(context))) + : (void*)(((uae_u8*)&(CONTEXT_EBX(context))) + 1); + break; +#endif + default: + abort (); + } + if (pr) { + blockinfo* bi; + + if (currprefs.comp_oldsegv) { + addr-=(uae_u32)NATMEM_OFFSET; + +#ifdef JIT_DEBUG + if ((addr>=0x10000000 && addr<0x40000000) || + (addr>=0x50000000)) { + write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); + } +#endif + if (dir==SIG_READ) { + switch (size) { + case 1: *((uae_u8*)pr)=get_byte (addr); break; + case 2: *((uae_u16*)pr)=swap16(get_word (addr)); break; + case 4: *((uae_u32*)pr)=swap32(get_long (addr)); break; + default: abort(); + } + } + else { /* write */ + switch (size) { + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; + case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; + default: abort(); + } + } +#ifdef JIT_DEBUG + write_log (_T("JIT: Handled one access!\n")); +#endif + fflush(stdout); + segvcount++; + CONTEXT_PC(context) += len; + } + else { + void* tmp=target; + int i; + uae_u8 vecbuf[5]; + + addr-=(uae_u32)NATMEM_OFFSET; + +#ifdef JIT_DEBUG + if ((addr>=0x10000000 && addr<0x40000000) || + (addr>=0x50000000)) { + write_log (_T("JIT: Suspicious address 0x%x in SEGV handler.\n"),addr); + } +#endif + + target = (uae_u8*) CONTEXT_PC(context); + for (i=0;i<5;i++) + vecbuf[i]=target[i]; + emit_byte(0xe9); + emit_long((uae_u32)veccode-(uae_u32)target-4); +#ifdef JIT_DEBUG + + write_log (_T("JIT: Create jump to %p\n"),veccode); + write_log (_T("JIT: Handled one access!\n")); +#endif + segvcount++; + + target=veccode; + + if (dir==SIG_READ) { + switch(size) { + case 1: raw_mov_b_ri(r,get_byte (addr)); break; + case 2: raw_mov_w_ri(r,swap16(get_word (addr))); break; + case 4: raw_mov_l_ri(r,swap32(get_long (addr))); break; + default: abort(); + } + } + else { /* write */ + switch(size) { + case 1: put_byte (addr,*((uae_u8*)pr)); break; + case 2: put_word (addr,swap16(*((uae_u16*)pr))); break; + case 4: put_long (addr,swap32(*((uae_u32*)pr))); break; + default: abort(); + } + } + for (i=0;i<5;i++) + raw_mov_b_mi(CONTEXT_PC(context) + i, vecbuf[i]); + raw_mov_l_mi((uae_u32)&in_handler,0); + emit_byte(0xe9); + emit_long(CONTEXT_PC(context) + len - (uae_u32)target - 4); + in_handler=1; + target=(uae_u8*)tmp; + } + bi=active; + while (bi) { + if (bi->handler && + (uae_u8*)bi->direct_handler<=i && + (uae_u8*)bi->nexthandler>i) { +#ifdef JIT_DEBUG + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), + bi->handler, + i, + bi->nexthandler, + bi->pc_p); +#endif + invalidate_block(bi); + raise_in_cl_list(bi); + set_special(0); + return 1; + } + bi=bi->next; + } + /* Not found in the active list. Might be a rom routine that + is in the dormant list */ + bi=dormant; + while (bi) { + if (bi->handler && + (uae_u8*)bi->direct_handler<=i && + (uae_u8*)bi->nexthandler>i) { +#ifdef JIT_DEBUG + write_log (_T("JIT: deleted trigger (%p<%p<%p) %p\n"), + bi->handler, + i, + bi->nexthandler, + bi->pc_p); +#endif + invalidate_block(bi); + raise_in_cl_list(bi); + set_special(0); + return 1; + } + bi=bi->next; + } +#ifdef JIT_DEBUG + write_log (_T("JIT: Huh? Could not find trigger!\n")); +#endif + return 1; + } + } + write_log (_T("JIT: Can't handle access %08X!\n"), i); +#if 0 + if (i) + { + int j; + + for (j=0;j<10;j++) { + write_log (_T("JIT: instruction byte %2d is 0x%02x\n"),j,i[j]); + } + } + write_log (_T("Please send the above info (starting at \"fault address\") to\n")); + write_log (_T("bmeyer@csse.monash.edu.au\n")); + write_log (_T("This shouldn't happen ;-)\n")); +#endif + return 0; +} +#endif /* CONTEXT_T */ + +#ifdef _WIN32 + +LONG WINAPI EvalException(LPEXCEPTION_POINTERS info) +{ + DWORD code = info->ExceptionRecord->ExceptionCode; + if (code != STATUS_ACCESS_VIOLATION || !canbang || currprefs.cachesize == 0) + return EXCEPTION_CONTINUE_SEARCH; + + uintptr_t address = info->ExceptionRecord->ExceptionInformation[1]; + if (handle_access(address, info)) { + return EXCEPTION_CONTINUE_EXECUTION; + } + return EXCEPTION_CONTINUE_SEARCH; +} + +#elif defined(HAVE_CONTEXT_T) + +static void sigsegv_handler(int signum, siginfo_t *info, void *context) +{ + uae_u8 *i = (uae_u8 *) CONTEXT_EIP(context); + uintptr_t address = (uintptr_t) info->si_addr; + + if (i >= compiled_code) { + if (handle_access(address, context)) + return; + else { + int j; + write_log ("JIT: can't handle access!\n"); + for (j = 0 ; j < 10; j++) + write_log ("JIT: instruction byte %2d is %02x\n", i, j[i]); + } + } else { + write_log ("Caught illegal access to %08lx at eip=%p\n", address, i); + } + + exit (EXIT_FAILURE); +} + +#endif + +static void install_exception_handler(void) +{ +#ifdef USE_STRUCTURED_EXCEPTION_HANDLING + /* Structured exception handler is installed in main.cpp */ +#elif defined(_WIN32) + write_log (_T("JIT: Installing unhandled exception filter\n")); + SetUnhandledExceptionFilter(EvalException); +#elif defined(HAVE_CONTEXT_T) + write_log (_T("JIT: Installing segfault handler\n")); + struct sigaction act; + act.sa_sigaction = (void (*)(int, siginfo_t*, void*)) sigsegv_handler; + sigemptyset (&act.sa_mask); + act.sa_flags = SA_SIGINFO; + sigaction(SIGSEGV, &act, NULL); +#ifdef MACOSX + sigaction(SIGBUS, &act, NULL); +#endif +#else + write_log (_T("JIT: No segfault handler installed\n")); +#endif +} + +#endif /* NATMEM_OFFSET */ diff --git a/src/main.cpp b/src/main.cpp index 56af0498c..95891c558 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -41,6 +41,7 @@ #include "cpuboard.h" #include "uae/ppc.h" #include "devices.h" +#include "jit/compemu.h" #ifdef RETROPLATFORM #include "rp.h" #endif @@ -959,23 +960,15 @@ void do_start_program (void) #ifdef WITH_LUA uae_lua_loadall (); #endif -#ifdef FSUAE - -#else -#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) - extern int EvalException (LPEXCEPTION_POINTERS blah, int n_except); +#ifdef USE_STRUCTURED_EXCEPTION_HANDLING __try -#endif #endif { m68k_go (1); } -#ifdef FSUAE - -#else -#if (defined (_WIN32) || defined (_WIN64)) && !defined (NO_WIN32_EXCEPTION_HANDLER) +#ifdef USE_STRUCTURED_EXCEPTION_HANDLING #ifdef JIT - __except (EvalException (GetExceptionInformation (), GetExceptionCode ())) + __except (EvalException(GetExceptionInformation())) #else __except (DummyException (GetExceptionInformation (), GetExceptionCode ())) #endif @@ -983,7 +976,6 @@ void do_start_program (void) // EvalException does the good stuff... } #endif -#endif } void start_program (void) diff --git a/src/memory.cpp b/src/memory.cpp index 2e75d0e10..8764d7dd7 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -1350,9 +1350,9 @@ static void log_kickstart(uae_u8 *mem, int size) if (rd) { char tmp[MAX_DPATH]; getromname(rd, tmp); - printf("KICKSTART: %s\n", tmp); + printf("UAE: %s\n", tmp); } else { - printf("KICKSTART: Unknown %08x (size %d)\n", crc32, size); + printf("UAE: KS ROM %08x (%d bytes)\n", crc32, size); } } @@ -1691,7 +1691,9 @@ static int load_kickstart (void) if (f != NULL) { #ifdef FSUAE +#if 0 printf("KICKSTART: %s\n", currprefs.romfile); +#endif #endif int filesize, size, maxsize; int kspos = ROM_SIZE_512; diff --git a/src/ncr_scsi.cpp b/src/ncr_scsi.cpp index 3b51c2da0..39172633b 100644 --- a/src/ncr_scsi.cpp +++ b/src/ncr_scsi.cpp @@ -161,9 +161,6 @@ static struct ncr_state *ncr_we; static struct ncr_state *ncr_a4000t; static struct ncr_state *ncra4091[MAX_DUPLICATE_EXPANSION_BOARDS]; -extern void cyberstorm_mk3_ppc_irq(int); -extern void blizzardppc_irq(int); - static void set_irq2(int level) { if (level) diff --git a/src/od-fs/bsdsocket_posix.cpp b/src/od-fs/bsdsocket_posix.cpp index 3b4255480..38134eaf2 100644 --- a/src/od-fs/bsdsocket_posix.cpp +++ b/src/od-fs/bsdsocket_posix.cpp @@ -40,7 +40,8 @@ volatile int bsd_int_requested; -void bsdsock_fake_int_handler(void) { +void bsdsock_fake_int_handler(void) +{ STUB(""); } @@ -61,12 +62,10 @@ void bsdsock_fake_int_handler(void) { #include #include -//#define DEBUG_BSDSOCKET -#ifdef DEBUG_BSDSOCKET -#define DEBUG_LOG write_log -#else -#define DEBUG_LOG(...) do ; while(0) -#endif +#define DEBUG_LOG(format, ...) \ + do { \ + if (log_bsd) write_log(format, ##__VA_ARGS__); \ + } while(0) #define WAITSIGNAL waitsig (context, sb) #ifdef ANDROID @@ -215,6 +214,10 @@ static int mapsockoptname (int level, int optname) return SO_DONTROUTE; case 0x0020: return SO_BROADCAST; +#if 0 + case 0x0023: + return SO_TIMESTAMPNS; +#endif #ifdef SO_USELOOPBACK case 0x0040: return SO_USELOOPBACK; @@ -245,8 +248,8 @@ static int mapsockoptname (int level, int optname) return SO_TYPE; default: - DEBUG_LOG ("Invalid setsockopt option %x for level %d\n", - optname, level); + DEBUG_LOG("Invalid setsockopt option 0x%x for level %d\n", + optname, level); return -1; } break; @@ -277,8 +280,8 @@ static int mapsockoptname (int level, int optname) return IP_ADD_MEMBERSHIP; default: - DEBUG_LOG ("Invalid setsockopt option %x for level %d\n", - optname, level); + DEBUG_LOG("Invalid setsockopt option 0x%x for level %d\n", + optname, level); return -1; } break; @@ -291,19 +294,18 @@ static int mapsockoptname (int level, int optname) return TCP_MAXSEG; default: - DEBUG_LOG ("Invalid setsockopt option %x for level %d\n", - optname, level); + DEBUG_LOG("Invalid setsockopt option 0x%x for level %d\n", + optname, level); return -1; } break; default: - DEBUG_LOG ("Unknown level %d\n", level); + DEBUG_LOG("Unknown level %d\n", level); return -1; } } - /* * Map amiga (s|g)etsockopt return value into the correct form */ @@ -489,16 +491,12 @@ STATIC_INLINE void bsd_amigaside_FD_SET (int n, uae_u32 set) put_long (set, get_long (set) | (1 << (n % 32))); } -#ifdef DEBUG_BSDSOCKET static void printSockAddr (struct sockaddr_in *in) { DEBUG_LOG ("Family %d, ", in->sin_family); DEBUG_LOG ("Port %d,", ntohs (in->sin_port)); DEBUG_LOG ("Address %s,", inet_ntoa (in->sin_addr)); } -#else -#define printSockAddr(sockAddr) -#endif /* * Copy a sockaddr object from amiga space to native space @@ -722,7 +720,7 @@ uae_u32 bsdthr_WaitSelect (SB) if (sb->sets [set] != 0) bsd_amigaside_FD_ZERO (sb->sets [set]); } - DEBUG_LOG ("WaitSelect: %d(%d)\n", r, errno); + DEBUG_LOG ("WaitSelect: r=%d errno=%d\n", r, errno); return r; } diff --git a/src/od-fs/input.cpp b/src/od-fs/input.cpp index de318bb68..e399a6798 100644 --- a/src/od-fs/input.cpp +++ b/src/od-fs/input.cpp @@ -121,7 +121,10 @@ int amiga_send_input_event(int input_event, int state) { g_joystick_port_autofire[3]) { autofire = 1; } - + else if ((input_event > INPUTEVENT_AUTOFIRE_BEGIN) && + (input_event < INPUTEVENT_AUTOFIRE_END)) { + autofire = 1; + } bool canstopplayback = 1; bool playbackevent = 0; diff --git a/src/od-fs/libamiga.cpp b/src/od-fs/libamiga.cpp index 4a86ce364..247cc77fd 100644 --- a/src/od-fs/libamiga.cpp +++ b/src/od-fs/libamiga.cpp @@ -126,11 +126,10 @@ void amiga_floppy_set_writable_images(int writable) { g_fs_uae_writable_disk_images = writable; } -int amiga_init() { - printf("libamiga (based on emulation core from %s) initialized\n", - UAE_BASE_VERSION); - write_log("libamiga (based on emulation core from %s) initialized\n", - UAE_BASE_VERSION); +int amiga_init() +{ + printf("UAE: Initializing core derived from %s\n", UAE_BASE_VERSION); + write_log("UAE: Initializing core derived from %s\n", UAE_BASE_VERSION); // because frame_time_t is sometimes cast to int, we make sure to // start from 0 wo it will work for "a while". Should be fixed @@ -597,8 +596,9 @@ int amiga_set_int_option(const char *option, int value) { return result; } -int amiga_quit() { - printf("amiga_quit\n"); +int amiga_quit() +{ + printf("UAE: Calling uae_quit\n"); uae_quit(); return 1; } diff --git a/src/od-fs/mman.cpp b/src/od-fs/mman.cpp new file mode 100644 index 000000000..1458221c7 --- /dev/null +++ b/src/od-fs/mman.cpp @@ -0,0 +1,190 @@ +#include "sysconfig.h" +#include "sysdeps.h" +#include "uae/memory.h" +#include "uae/mman.h" +#include "options.h" +#include "autoconf.h" +#include "gfxboard.h" +#include "cpuboard.h" +#include "rommgr.h" +#include "newcpu.h" + +#ifdef __x86_64__ +static int os_64bit = 1; +#else +static int os_64bit = 0; +#endif + +#ifndef _WIN32 + +#ifdef HAVE_SYS_PARAM_H +#include +#endif +#if defined(__APPLE__) +#include +#endif +#include + +#define MEM_COMMIT 0x00001000 +#define MEM_RESERVE 0x00002000 +#define MEM_DECOMMIT 0x4000 +#define MEM_RELEASE 0x8000 +#define MEM_WRITE_WATCH 0x00200000 +#define MEM_TOP_DOWN 0x00100000 + +#define PAGE_EXECUTE_READWRITE 0x40 +#define PAGE_READONLY 0x02 +#define PAGE_READWRITE 0x04 + +typedef void * LPVOID; +typedef size_t SIZE_T; + +typedef struct { + int dwPageSize; +} SYSTEM_INFO; + +static void GetSystemInfo(SYSTEM_INFO *si) +{ + si->dwPageSize = sysconf(_SC_PAGESIZE); +} + +#define USE_MMAP + +#ifdef USE_MMAP +#ifdef MACOSX +#define MAP_ANONYMOUS MAP_ANON +#endif +#endif + +static void *VirtualAlloc(void *lpAddress, size_t dwSize, int flAllocationType, + int flProtect) +{ + write_log("- VirtualAlloc addr=%p size=%zu type=%d prot=%d\n", + lpAddress, dwSize, flAllocationType, flProtect); + if (flAllocationType & MEM_RESERVE) { + write_log(" MEM_RESERVE\n"); + } + if (flAllocationType & MEM_COMMIT) { + write_log(" MEM_COMMIT\n"); + } + if (flAllocationType & PAGE_READWRITE) { + write_log(" PAGE_READWRITE\n"); + } + int prot = 0; + if (flProtect == PAGE_READWRITE) { + write_log(" PAGE_READWRITE\n"); + prot = PROT_READ | PROT_WRITE; + } else if (flProtect == PAGE_READONLY) { + write_log(" PAGE_READONLY\n"); + prot = PROT_READ; + } else if (flProtect == PAGE_EXECUTE_READWRITE) { + write_log(" PAGE_EXECUTE_READWRITE\n"); + prot = PROT_READ | PROT_WRITE | PROT_EXEC; + } else { + write_log(" WARNING: unknown protection\n"); + } + + void *memory = NULL; + + if (flAllocationType == MEM_COMMIT && lpAddress == NULL) { + assert(false); + memory = malloc(dwSize); + if (memory == NULL) { + write_log("memory allocated failed errno %d\n", errno); + } + return memory; + } + + if (flAllocationType & MEM_RESERVE) { +#ifdef USE_MMAP + memory = mmap(lpAddress, dwSize, 0, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + if (memory == (void *) -1) { + write_log("mmap failed errno %d\n", errno); + return NULL; + } +#else + memory = malloc(dwSize); + if (memory == NULL) { + write_log("memory allocated failed errno %d\n", errno); + return NULL; + } +#endif + } + else { + memory = lpAddress; + } + + if (flAllocationType & MEM_COMMIT) { +#ifdef USE_MMAP + if (mprotect(memory, dwSize, prot) != 0) { + write_log("mprotect failed errno %d\n", errno); + } +#endif + } + + return memory; +} + +static int VirtualProtect(void *lpAddress, int dwSize, int flNewProtect, + unsigned int *lpflOldProtect) +{ + write_log("- VirtualProtect addr=%p size=%zu prot=%d\n", + lpAddress, dwSize, flNewProtect); + int prot = 0; + if (flNewProtect == PAGE_READWRITE) { + write_log(" PAGE_READWRITE\n"); + prot = PROT_READ | PROT_WRITE; + } else if (flNewProtect == PAGE_READONLY) { + write_log(" PAGE_READONLY\n"); + prot = PROT_READ; + } else { + write_log(" -- unknown protection --\n"); + } + if (mprotect(lpAddress, dwSize, prot) != 0) { + write_log("mprotect failed errno %d\n", errno); + return 0; + } + return 1; +} + +static bool VirtualFree(void *lpAddress, size_t dwSize, int dwFreeType) +{ +#ifdef MMAP + int result = 0; + if (dwFreeType == MEM_DECOMMIT) { + if (mprotect(lpAddress, dwSize, 0) != 0) { + write_log("mprotect failed errno %d\n", errno); + return 0; + } + } + else if (dwFreeType == MEM_RELEASE) { + result = munmap(lpAddress, dwSize); + if (result != 0) { + printf("munmap failed\n"); + } + return result == 0; + } + return 0; +#else + return 1; +#endif +} + +static int GetLastError() +{ + return errno; +} + +static int my_getpagesize (void) +{ + return sysconf(_SC_PAGESIZE); +} + +#define getpagesize my_getpagesize + +#endif + +/* Prevent od-win32/win32.h from being included */ +#define __WIN32_H__ + +#include "../od-win32/mman.cpp" diff --git a/src/od-fs/stubs.cpp b/src/od-fs/stubs.cpp index cd4a94c1a..7f045bc32 100644 --- a/src/od-fs/stubs.cpp +++ b/src/od-fs/stubs.cpp @@ -132,16 +132,20 @@ bool vsync_switchmode (int hz) { } #ifndef AHI -void ahi_hsync (void) { + +#include "uae/ahi.h" + +void ahi_hsync (void) +{ VERBOSE_STUB(""); } -#endif -#ifndef AHI -int enforcer_disable(void) { +int enforcer_disable(void) +{ STUB(""); return 1; } + #endif void refreshtitle (void) { @@ -172,9 +176,10 @@ void target_restart (void) { STUB(""); } -void target_quit (void) { - write_log("UAE emulation core is quitting\n"); - printf("UAE emulation core is quitting\n"); +void target_quit (void) +{ + write_log("UAE: Stopping\n"); + printf("UAE: Stopping\n"); } void target_fixup_options (struct uae_prefs *p) { diff --git a/src/od-win32/mman.cpp b/src/od-win32/mman.cpp index 68bbd91e7..3baba125e 100644 --- a/src/od-win32/mman.cpp +++ b/src/od-win32/mman.cpp @@ -2,13 +2,6 @@ // Copyright (C) 2000, Brian King // GNU Public License -#ifdef FSUAE // NL -#ifdef WINDOWS -#define _WIN32_WINNT 0x0501 -#include -#endif -#endif - #include #include "sysconfig.h" @@ -22,161 +15,6 @@ #include "rommgr.h" #include "newcpu.h" -#ifdef FSUAE // NL - -#ifdef __x86_64__ -static int os_64bit = 1; -#else -static int os_64bit = 0; -#endif - -#ifdef WINDOWS - -#else - -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#if defined(__APPLE__) -#include -#endif -#include - -#define MEM_COMMIT 0x00001000 -#define MEM_RESERVE 0x00002000 -#define MEM_DECOMMIT 0x4000 -#define MEM_RELEASE 0x8000 -#define MEM_WRITE_WATCH 0x00200000 -#define MEM_TOP_DOWN 0x00100000 - -#define PAGE_EXECUTE 0x10 -#define PAGE_EXECUTE_READ 0x20 -#define PAGE_EXECUTE_READWRITE 0x40 -#define PAGE_EXECUTE_WRITECOPY 0x80 -#define PAGE_NOACCESS 0x01 -#define PAGE_READONLY 0x02 -#define PAGE_READWRITE 0x04 -#define PAGE_WRITECOPY 0x08 - -typedef void * LPVOID; -typedef size_t SIZE_T; - -typedef struct { - int dwPageSize; -} SYSTEM_INFO; - -static void GetSystemInfo(SYSTEM_INFO *si) { - si->dwPageSize = sysconf(_SC_PAGESIZE); -} - -static void *VirtualAlloc(void *lpAddress, size_t dwSize, int flAllocationType, - int flProtect) { - write_log("- VirtualAlloc %p %zu %d %d\n", lpAddress, dwSize, - flAllocationType, flProtect); - if (flAllocationType & MEM_RESERVE) { - write_log(" MEM_RESERVE\n"); - } - if (flAllocationType & MEM_COMMIT) { - write_log(" MEM_COMMIT\n"); - } - if (flAllocationType & PAGE_READWRITE) { - write_log(" PAGE_READWRITE\n"); - } - int prot = 0; - void *memory = NULL; - - if (flAllocationType == MEM_COMMIT && lpAddress == NULL) { - memory = malloc(dwSize); - if (memory == NULL) { - write_log("memory allocated failed errno %d\n", errno); - } - return memory; - } - - if (flAllocationType & MEM_RESERVE) { - memory = malloc(dwSize); - if (memory == NULL) { - write_log("memory allocated failed errno %d\n", errno); - } -#if 0 - memory = mmap(lpAddress, dwSize, prot, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - printf("mmap result: %p\n", memory); - if (memory == (void *) -1) { - printf("mmap failed errno %d\n", errno); - } -#endif - } - else { - memory = lpAddress; - } - - if (flAllocationType & MEM_COMMIT) { -#if 0 - int lockresult = mlock(memory, dwSize); - if (lockresult != 0) { - printf("mlock failed errno %d\n", errno); - perror("mlock failed"); - } -#endif - } - - return memory; -} - -static bool VirtualFree(void *lpAddress, size_t dwSize, int dwFreeType) { -#if 0 - int result = 0; - if (dwFreeType == MEM_DECOMMIT) { - result = munlock(lpAddress, dwSize); - if (result != 0) { - printf("munlock failed %d\n", errno); - } - } - else if (dwFreeType == MEM_RELEASE) { - result = munmap(lpAddress, dwSize); - if (result != 0) { - printf("mlock failed\n"); - } - } - return result == 0; -#endif - return 1; -} - -static int GetLastError() { - return errno; -} - -#if 0 -#ifdef HAVE_POSIX_MEMALIGN -// FIXME: Set HAVE_POSIX_MEMALIGN when available in config.h, -// possibly via autoconf -#define valloc my_valloc - -static void *my_valloc(size_t size) { - size_t alignment = sysconf(_SC_PAGESIZE); - void *memptr = NULL; - if (posix_memalign(&memptr, alignment, size) == 0) { - return memptr; - } - return NULL; -} - -#endif -#endif - -static int my_getpagesize (void) { - return sysconf(_SC_PAGESIZE); -} - -#define getpagesize my_getpagesize - -#endif - -#else -#include "win32.h" -#endif - #if defined(NATMEM_OFFSET) uae_u32 max_z3fastmem; @@ -212,7 +50,7 @@ static void virtualfreewithlock (LPVOID addr, SIZE_T size, DWORD freetype) void cache_free (uae_u8 *cache) { -#ifdef WINDOWS +#ifdef _WIN32 virtualfreewithlock (cache, 0, MEM_RELEASE); #else // FIXME: Must add (address, size) to a list in cache_alloc, so the memory @@ -225,7 +63,7 @@ void cache_free (uae_u8 *cache) uae_u8 *cache_alloc (int size) { printf("cache_alloc size = %d\n", size); -#ifdef WINDOWS +#ifdef _WIN32 return virtualallocwithlock (NULL, size, MEM_COMMIT, PAGE_EXECUTE_READWRITE); #else size = size < getpagesize() ? getpagesize() : size; @@ -286,7 +124,7 @@ void mman_ResetWatch (PVOID lpBaseAddress, SIZE_T dwRegionSize) #endif static uae_u64 size64; -#ifdef WINDOWS +#ifdef _WIN32 typedef BOOL (CALLBACK* GLOBALMEMORYSTATUSEX)(LPMEMORYSTATUSEX); #endif @@ -304,7 +142,7 @@ bool preinit_shm (void) write_log("preinit_shm\n"); uae_u64 total64; uae_u64 totalphys64; -#ifdef WINDOWS +#ifdef _WIN32 MEMORYSTATUS memstats; GLOBALMEMORYSTATUSEX pGlobalMemoryStatusEx; MEMORYSTATUSEX memstatsex; @@ -312,7 +150,7 @@ bool preinit_shm (void) uae_u32 max_allowed_mman; if (natmem_offset_allocated) -#ifdef WINDOWS +#ifdef _WIN32 VirtualFree (natmem_offset_allocated, 0, MEM_RELEASE); #else free (natmem_offset_allocated); @@ -320,7 +158,7 @@ bool preinit_shm (void) natmem_offset_allocated = NULL; natmem_offset = NULL; if (p96mem_offset) -#ifdef WINDOWS +#ifdef _WIN32 VirtualFree (p96mem_offset, 0, MEM_RELEASE); #else // Don't free p96mem_offset - it is freed as part of natmem_offset @@ -343,7 +181,7 @@ bool preinit_shm (void) if (maxmem > max_allowed_mman) max_allowed_mman = maxmem; -#ifdef WINDOWS +#ifdef _WIN32 memstats.dwLength = sizeof(memstats); GlobalMemoryStatus(&memstats); totalphys64 = memstats.dwTotalPhys; @@ -1040,14 +878,12 @@ void unprotect_maprom (void) if (shm->maprom <= 0) continue; shm->maprom = -1; -#ifdef WINDOWS DWORD old; if (!VirtualProtect (shm->attached, shm->rosize, protect ? PAGE_READONLY : PAGE_READWRITE, &old)) { write_log (_T("unprotect_maprom VP %08X - %08X %x (%dk) failed %d\n"), (uae_u8*)shm->attached - natmem_offset, (uae_u8*)shm->attached - natmem_offset + shm->size, shm->size, shm->size >> 10, GetLastError ()); } -#endif } } @@ -1066,14 +902,12 @@ void protect_roms (bool protect) continue; if (shm->maprom < 0 && protect) continue; -#ifdef WINDOWS DWORD old; if (!VirtualProtect (shm->attached, shm->rosize, protect ? PAGE_READONLY : PAGE_READWRITE, &old)) { write_log (_T("protect_roms VP %08X - %08X %x (%dk) failed %d\n"), (uae_u8*)shm->attached - natmem_offset, (uae_u8*)shm->attached - natmem_offset + shm->size, shm->size, shm->size >> 10, GetLastError ()); } -#endif } }