Skip to content

Commit

Permalink
2.6.0beta2
Browse files Browse the repository at this point in the history
Merge branch 'master' into stable

Conflicts:
	configure.ac
	debian/changelog
	fs-uae.spec
  • Loading branch information
FrodeSolheim committed Aug 9, 2015
2 parents 808222d + eee2515 commit 12f633e
Show file tree
Hide file tree
Showing 113 changed files with 2,962 additions and 338 deletions.
15 changes: 15 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
Version 2.5.38dev:

* Several new and update 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.
* Imported updated translations from crowdin.com.

Version 2.5.37dev:

* Fixed a joystick issue where SDL_JoystickID was not used properly.
* Added new option log_input (replaces environment variable FS_DEBUG_INPUT).
* Also log joystick button and hat events when log_input is enabled.
* Imported updated translations from crowdin.com.

Version 2.5.36dev:

* Fixed a crash (floating point exception) if audio device cannot be opened.
Expand Down
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ libfsemu_a_SOURCES = \
libfsemu/include/fs/image.h \
libfsemu/include/fs/inifile.h \
libfsemu/include/fs/init.h \
libfsemu/include/fs/lazyness.h \
libfsemu/include/fs/log.h \
libfsemu/include/fs/main.h \
libfsemu/include/fs/malloc.h \
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.67])
AC_INIT([FS-UAE], [2.6.0beta1],
AC_INIT([FS-UAE], [2.6.0beta2],
[[email protected]], [fs-uae], [http://fs-uae.net])
AC_CONFIG_AUX_DIR([.])
AC_CANONICAL_HOST
Expand Down
4 changes: 2 additions & 2 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fs-uae (2.6.0~beta1-0) unstable; urgency=low
fs-uae (2.6.0~beta2-0) unstable; urgency=low

* Dummy changelog entry.

-- Frode Solheim <[email protected]> Fri, 7 Aug 2015 18:21:26 +0200
-- Frode Solheim <[email protected]> Sun, 9 Aug 2015 19:22:41 +0200
3 changes: 0 additions & 3 deletions dist/windows/sign.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import sys
import subprocess

print("a")
if os.path.exists("c:/signtool.py"):
assert os.system("python c:/signtool.py \"{}\"".format(
sys.argv[1])) == 0
# p = subprocess.Popen(["python", "c:/signtool.py", sys.argv[1]])
# assert p.wait() == 0
8 changes: 8 additions & 0 deletions doc/options/log_input
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Summary: Log Input Events
Type: boolean
Default: 0
Example: 1

This option will cause a lot of debug messages to be logged to
fs-uae.log.txt. It is not recommended to enable this unless needed for
testing and debugging.
11 changes: 5 additions & 6 deletions doc/options/stereo_separation
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
Description: Stereo Separation
Default: 100
Example: 70
Default: 70
Example: 100
Since: 2.3.12
Type: choice

Controls the amount of mixing of the stereo channels. The default is that the
channels are not mixed together, but especially if you are usng headphones,
and your operating system does not automatically mix channels somewhat when
headphones are plugged in, you may want to choose a lower value (say 70%).
Controls the amount of mixing of the stereo channels. 100% means that
the left and right channels are not mixed together at all, and 0% means
that you get mono sound output on stereo speaker.

Value: 100 (100%)
Value: 90 (90%)
Expand Down
4 changes: 2 additions & 2 deletions fs-uae.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define name fs-uae
%define version 2.6.0beta1
%define unmangled_version 2.6.0beta1
%define version 2.6.0beta2
%define unmangled_version 2.6.0beta2
%define release 1%{?dist}

Summary: Amiga emulator with on-screen GUI and online play support
Expand Down
6 changes: 6 additions & 0 deletions libfsemu/include/fs/lazyness.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef FS_LAZYNESS_H
#define FS_LAZYNESS_H

extern int g_fs_log_input;

#endif /* FS_LAZYNESS_H */
1 change: 1 addition & 0 deletions libfsemu/include/fs/ml/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#define FS_ML_OPTIONS_H

#define OPTION_CURSOR "cursor"
#define OPTION_LOG_INPUT "log_input"
#define OPTION_MOUSE_INTEGRATION "mouse_integration"

/* Deprecated options */
Expand Down
20 changes: 8 additions & 12 deletions libfsemu/src/emu/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#include <fs/emu.h>
#include <fs/emu/input.h>
#include <fs/emu/options.h>
#include <fs/lazyness.h>
#include "input.h"

#include <stdio.h>
Expand Down Expand Up @@ -54,8 +55,6 @@ keyboard is MAX_DEVICES - 1
*/


static int g_debug_input = 0;

#define MAX_DEVICES 64
#define KEYBOARD 0
#define MOUSE 1
Expand Down Expand Up @@ -419,7 +418,7 @@ static void map_custom_joystick_action(int joy, const char *name,
int axis, int hat, int button, int value, const char *n1,
int n2, const char *n3) {
char *config_key = g_strdup_printf("%s%s%d%s", name, n1, n2, n3);
if (g_debug_input) {
if (g_fs_log_input) {
fs_log("%s\n", config_key);
}
const char *config_value = fs_config_get_const_string(config_key);
Expand Down Expand Up @@ -570,7 +569,7 @@ static void map_custom_gamepad_actions(int joy, const char *name,
for (int j = 0; config[j].config_key != NULL; j++) {
char *config_key = g_strdup_printf("%s_%s", name,
config[j].config_value);
if (g_debug_input) {
if (g_fs_log_input) {
fs_log("%s\n", config_key);
}
const char *config_value = fs_config_get_const_string(config_key);
Expand Down Expand Up @@ -1127,21 +1126,21 @@ int fs_emu_process_key_event(int key_code, int key_mod, int state) {
g_key_modifiers_at_pressed_state[key_code] = key_mod;
}

if (g_debug_input) {
if (g_fs_log_input) {
fs_log("--> key_code %d key_mod %d state %d: \"%s\"\n",
key_code, key_mod, state, g_fs_emu_key_names[key_code]);
}
// 65536 is also used as null event
if (input_event > 0 && input_event < 65536) {
if (g_debug_input) {
if (g_fs_log_input) {
fs_log(" = press (index %d) => "
"input event %d\n", index, input_event);
}
// encode both state and input event in input_event
input_event = input_event | (state << 16);
fs_emu_queue_input_event(input_event);
}
else if (g_debug_input) {
else if (g_fs_log_input) {
fs_log(" = press (index %d) => NO INPUT EVENT\n", index);
}
return 1;
Expand Down Expand Up @@ -1532,7 +1531,7 @@ static int input_function(fs_ml_event *event)
}

int state = event->button.state;
if (g_debug_input) {
if (g_fs_log_input) {
fs_log(" => mouse button %d, %d\n", event->button.button, state);
}
if (event->button.button == FS_ML_BUTTON_WHEELUP) {
Expand All @@ -1544,7 +1543,7 @@ static int input_function(fs_ml_event *event)
int input_event = g_input_action_table[mouse_index(
event->button.device, 0, 0, event->button.button)];
if (input_event > 0) {
if (g_debug_input) {
if (g_fs_log_input) {
fs_log(" => button input_event %d state %d\n",
input_event, state);
}
Expand All @@ -1565,9 +1564,6 @@ void fs_emu_input_init(void)
{
fs_log("fs_emu_input_init\n");

g_debug_input = getenv("FS_DEBUG_INPUT") && \
getenv("FS_DEBUG_INPUT")[0] == '1';

g_input_event_mutex = fs_mutex_create();
g_input_event_queue = g_queue_new();

Expand Down
53 changes: 53 additions & 0 deletions libfsemu/src/ml/input.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <SDL.h>
#include <stdlib.h>
#include <fs/conf.h>
#include <fs/lazyness.h>
#include <fs/log.h>
#include <fs/glib.h>
#include <fs/ml/options.h>
Expand All @@ -17,10 +18,14 @@ static GQueue *g_input_queue = NULL;
static fs_mutex *g_input_mutex = NULL;
static fs_ml_input_function g_input_function = NULL;

int g_fs_log_input = 0;
int g_fs_ml_first_keyboard_index = 0;
int g_fs_ml_first_mouse_index = 0;
int g_fs_ml_first_joystick_index = 0;

/* maps SDL joystick indices to fs_ml indices */
SDL_JoystickID g_fs_ml_sdl_joystick_index_map[MAX_SDL_JOYSTICK_IDS];

static int g_cursor_mode = 1;
static int g_mouse_integration = 0;

Expand Down Expand Up @@ -113,6 +118,23 @@ char *fs_ml_input_fix_joystick_name(const char *name, int upper)
return n;
}

static int fs_ml_check_joystick_blacklist_by_guid(const char *guid)
{
if (false) {
#if 0
} else if (strcasecmp(guid, "efbeedfe000000000000504944564944") == 0) {
/* VIRTUAL HID DEVICE */
return 1;
#endif
#if 0
} else if (strcasecmp(guid, "030000000b0400003365000000010000") == 0) {
/* MOSIC SPEED-LINK COMPETITION PRO */
return 1;
#endif
}
return 0;
}

void fs_ml_input_init()
{
FS_ML_INIT_ONCE;
Expand All @@ -121,6 +143,14 @@ void fs_ml_input_init()

fs_log("fs_ml_input_init\n");

g_fs_log_input = getenv("FS_DEBUG_INPUT") && \
getenv("FS_DEBUG_INPUT")[0] == '1';

if (fs_config_get_boolean(OPTION_LOG_INPUT) == 1) {
fs_log("Logging: enable input event logging\n");
g_fs_log_input = 1;
}

if (fs_config_get_boolean(OPTION_MOUSE_INTEGRATION) == 1) {
g_mouse_integration = 1;
}
Expand Down Expand Up @@ -173,7 +203,19 @@ void fs_ml_input_init()
fs_log("WARNING: reached max num devices\n");
break;
}

char guid_str[33];
SDL_JoystickGUID guid = SDL_JoystickGetDeviceGUID(i);
SDL_JoystickGetGUIDString(guid, guid_str, 33);
guid_str[32] = '\0';
fs_log("SDL_JoystickGetDeviceGUID(%d) = %s\n", i, guid_str);
if (fs_ml_check_joystick_blacklist_by_guid(guid_str)) {
fs_log("- blacklisted, not opening!\n");
continue;
}

SDL_Joystick *joystick = SDL_JoystickOpen(i);
fs_log("SDL_JoystickOpen(%d)\n", i);

#ifdef USE_SDL2
char *name = fs_ml_input_fix_joystick_name(
Expand Down Expand Up @@ -209,6 +251,17 @@ void fs_ml_input_init()
g_fs_ml_input_devices[k].hats,
g_fs_ml_input_devices[k].axes,
g_fs_ml_input_devices[k].balls);

SDL_JoystickID instance_id = SDL_JoystickInstanceID(joystick);
fs_log("- instance ID = %d\n", instance_id);
if (instance_id >= MAX_SDL_JOYSTICK_IDS) {
fs_log("SDL_JoystickID > %d\n", MAX_SDL_JOYSTICK_IDS);
fs_log("- closing joystick\n");
SDL_JoystickClose(joystick);
continue;
}

g_fs_ml_sdl_joystick_index_map[instance_id] = k;
k += 1;
}

Expand Down
7 changes: 6 additions & 1 deletion libfsemu/src/ml/ml_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ extern fs_ml_input_device *g_fs_ml_input_devices;
extern int g_fs_ml_input_device_count;
extern int g_fs_ml_first_keyboard_index;
extern int g_fs_ml_first_mouse_index;
extern int g_fs_ml_first_joystick_index;
// extern int g_fs_ml_first_joystick_index;
#define MAX_SDL_JOYSTICK_IDS 1024
#ifdef USE_SDL2
#include <SDL.h>
extern SDL_JoystickID g_fs_ml_sdl_joystick_index_map[MAX_SDL_JOYSTICK_IDS];
#endif

extern int g_fs_ml_running;

Expand Down
7 changes: 2 additions & 5 deletions libfsemu/src/ml/mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <fs/lazyness.h>
#include <fs/log.h>
#include <fs/thread.h>

Expand All @@ -15,10 +16,9 @@
static fs_thread *g_manymouse_thread = NULL;
static int g_first_manymouse_index = 0;
static volatile int g_manymouse_last_index = -1;
static int g_debug_input = 0;

#define db_log(name, format, ...) \
if (g_debug_ ## name) { \
if (g_fs_log_ ## name) { \
fs_log(format, ## __VA_ARGS__); \
}

Expand Down Expand Up @@ -160,9 +160,6 @@ void fs_ml_mouse_init(void)
FS_ML_INIT_ONCE;
fs_log("fs_ml_mouse_init\n");

g_debug_input = getenv("FS_DEBUG_INPUT") && \
getenv("FS_DEBUG_INPUT")[0] == '1';

g_fs_ml_first_mouse_index = g_fs_ml_input_device_count;
int k = g_fs_ml_input_device_count;

Expand Down
8 changes: 2 additions & 6 deletions libfsemu/src/ml/rawinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <stddef.h>
#include <glib.h>

#include <fs/lazyness.h>
#include <fs/log.h>
#include "fs/ml.h"
#include "ml_internal.h"
Expand All @@ -38,8 +39,6 @@ static HWND g_window = 0;
//static HGLRC g_hglrc = 0;
static HKL g_keyboard_layout = 0;

static int g_debug_keys = 0;

static int g_mod_lalt = 0;
static int g_mod_ralt = 0;
static int g_mod_lctrl = 0;
Expand Down Expand Up @@ -71,7 +70,7 @@ static void process_keyboard_input(LPRAWINPUT raw_input) {
int vkey = raw_input->data.keyboard.VKey;
int flags = raw_input->data.keyboard.Flags;
int make_code = raw_input->data.keyboard.MakeCode;
if (g_debug_keys) {
if (g_fs_log_input) {
fs_log("vkey...: %d (0x%x) make %d extra %d flags %d E0 %d E1 %d\n",
vkey, vkey, raw_input->data.keyboard.MakeCode,
raw_input->data.keyboard.ExtraInformation, flags,
Expand Down Expand Up @@ -532,9 +531,6 @@ static void init_key_mapping() {
void fs_ml_init_raw_input() {
fs_log("fs_ml_init_raw_input\n");

g_debug_keys = getenv("FS_DEBUG_INPUT") && \
getenv("FS_DEBUG_INPUT")[0] == '1';

//list_input_devices();
init_key_mapping();

Expand Down
Loading

0 comments on commit 12f633e

Please sign in to comment.