diff --git a/src/input/game/js_standard.c b/src/input/game/js_standard.c index a8d3b2f..3331d2a 100644 --- a/src/input/game/js_standard.c +++ b/src/input/game/js_standard.c @@ -8,7 +8,7 @@ * * Implementation of a standard joystick. * - * Version: @(#)js_standard.c 1.0.7 2018/04/26 + * Version: @(#)js_standard.c 1.0.8 2018/05/03 * * Authors: Fred N. van Kempen, * Sarah Walker, @@ -184,7 +184,7 @@ js_axis_6button(void *priv, int axis) break; } - return(0); + return(ret); } diff --git a/src/ports/game.c b/src/ports/game.c index 74f5681..ee83159 100644 --- a/src/ports/game.c +++ b/src/ports/game.c @@ -8,7 +8,7 @@ * * Implementation of a generic Game Port. * - * Version: @(#)game.c 1.0.11 2018/04/30 + * Version: @(#)game.c 1.0.12 2018/05/03 * * Authors: Fred N. van Kempen, * Sarah Walker, @@ -47,7 +47,6 @@ #include "../io.h" #include "../timer.h" #include "../device.h" -#include "../input/game/joystick.h" #include "game.h" #include "game_dev.h" @@ -122,7 +121,7 @@ game_write(uint16_t addr, uint8_t val, void *priv) dev->axis[i].count = game_time(dev->joystick->read_axis(dev->joystick_priv, i)); } -//FIXME: removed too much stuff here! --FvK + dev->joystick->write(dev->joystick_priv); cycles -= ISA_CYCLES(8); @@ -172,8 +171,6 @@ game_init(const device_t *info) pclog("GAME: initializing, type=%d\n", joystick_type); - if (joystick_type == JOYSTICK_NONE) return(NULL); - dev = (game_t *)malloc(sizeof(game_t)); memset(dev, 0x00, sizeof(game_t)); game_global = dev; @@ -181,6 +178,9 @@ game_init(const device_t *info) for (i = 0; i < 4; i++) { dev->axis[i].game = dev; dev->axis[i].axis_nr = i; + + timer_add(game_over, + &dev->axis[i].count, &dev->axis[i].count, &dev->axis[i]); } dev->joystick = gamedev_get_device(joystick_type); @@ -199,15 +199,6 @@ game_init(const device_t *info) } - timer_add(game_over, - &dev->axis[0].count, &dev->axis[0].count, &dev->axis[0]); - timer_add(game_over, - &dev->axis[1].count, &dev->axis[1].count, &dev->axis[1]); - timer_add(game_over, - &dev->axis[2].count, &dev->axis[2].count, &dev->axis[2]); - timer_add(game_over, - &dev->axis[3].count, &dev->axis[3].count, &dev->axis[3]); - return(dev); } diff --git a/src/sound/sound_dev.c b/src/sound/sound_dev.c index 590f199..35d1380 100644 --- a/src/sound/sound_dev.c +++ b/src/sound/sound_dev.c @@ -8,7 +8,7 @@ * * Sound devices support module. * - * Version: @(#)sound_dev.c 1.0.4 2018/04/14 + * Version: @(#)sound_dev.c 1.0.5 2018/05/03 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -59,7 +59,6 @@ typedef struct { #ifdef ENABLE_SOUND_DEV_LOG int sound_dev_do_log = ENABLE_SOUND_DEV_LOG; #endif -int sound_card_current = 0; /* Sound card devices. */ @@ -131,8 +130,8 @@ snddev_log(const char *fmt, ...) void snddev_reset(void) { - if (sound_cards[sound_card_current].device != NULL) - device_add(sound_cards[sound_card_current].device); + if (sound_cards[sound_card].device != NULL) + device_add(sound_cards[sound_card].device); } diff --git a/src/win/win_joystick.cpp b/src/win/win_joystick.cpp index a88ac1c..89d776e 100644 --- a/src/win/win_joystick.cpp +++ b/src/win/win_joystick.cpp @@ -13,7 +13,7 @@ * NOTE: Hacks currently needed to compile with MSVC; DX needs to * be updated to 11 or 12 or so. --FvK * - * Version: @(#)win_joystick.cpp 1.0.11 2018/05/02 + * Version: @(#)win_joystick.cpp 1.0.12 2018/05/03 * * Authors: Fred N. van Kempen, * Miran Grca, @@ -174,6 +174,9 @@ joystick_init(void) { int c; + /* Only initialize if the game port is enabled. */ + if (! game_enabled) return; + pclog("JOYSTICK: initializing (type=%d)\n", joystick_type); atexit(joystick_close);