Fixed some stuff found while testing the installer.

This commit is contained in:
waltje
2018-03-29 03:05:07 -04:00
parent 6366c1bc31
commit bfc507d5f4
6 changed files with 173 additions and 175 deletions

View File

@@ -8,7 +8,7 @@
* *
* Implementation of a generic Game Port. * Implementation of a generic Game Port.
* *
* Version: @(#)gameport.c 1.0.5 2018/03/27 * Version: @(#)gameport.c 1.0.6 2018/03/28
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk> * Sarah Walker, <tommowalker@tommowalker.co.uk>
@@ -173,7 +173,6 @@ gameport_write(uint16_t addr, uint8_t val, void *priv)
timer_clock(); timer_clock();
p->state |= 0x0f; p->state |= 0x0f;
pclog("gameport_write : joysticks_present=%i\n", joysticks_present);
p->axis[0].count = gameport_time(p->joystick->read_axis(p->joystick_dat, 0)); p->axis[0].count = gameport_time(p->joystick->read_axis(p->joystick_dat, 0));
p->axis[1].count = gameport_time(p->joystick->read_axis(p->joystick_dat, 1)); p->axis[1].count = gameport_time(p->joystick->read_axis(p->joystick_dat, 1));

View File

@@ -1,148 +1,148 @@
/* /*
* VARCem Virtual ARchaeological Computer EMulator. * VARCem Virtual ARchaeological Computer EMulator.
* An emulator of (mostly) x86-based PC systems and devices, * An emulator of (mostly) x86-based PC systems and devices,
* using the ISA,EISA,VLB,MCA and PCI system buses, roughly * using the ISA,EISA,VLB,MCA and PCI system buses, roughly
* spanning the era between 1981 and 1995. * spanning the era between 1981 and 1995.
* *
* This file is part of the VARCem Project. * This file is part of the VARCem Project.
* *
* Definitions for the generic game port handlers. * Definitions for the generic game port handlers.
* *
* NOTE: This module needs a good cleanup someday. * NOTE: This module needs a good cleanup someday.
* *
* Version: @(#)gameport.h 1.0.4 2018/03/19 * Version: @(#)gameport.h 1.0.5 2018/03/28
* *
* Authors: Miran Grca, <mgrca8@gmail.com> * Authors: Miran Grca, <mgrca8@gmail.com>
* Sarah Walker, <tommowalker@tommowalker.co.uk> * Sarah Walker, <tommowalker@tommowalker.co.uk>
* *
* Copyright 2016-2018 Miran Grca. * Copyright 2016-2018 Miran Grca.
* Copyright 2008-2017 Sarah Walker. * Copyright 2008-2017 Sarah Walker.
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or * the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version. * (at your option) any later version.
* *
* This program is distributed in the hope that it will be useful, but * This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the: * along with this program; if not, write to the:
* *
* Free Software Foundation, Inc. * Free Software Foundation, Inc.
* 59 Temple Place - Suite 330 * 59 Temple Place - Suite 330
* Boston, MA 02111-1307 * Boston, MA 02111-1307
* USA. * USA.
*/ */
#ifndef EMU_GAMEPORT_H #ifndef EMU_GAMEPORT_H
# define EMU_GAMEPORT_H # define EMU_GAMEPORT_H
#define JOYSTICK_TYPE_NONE 0 #define JOYSTICK_TYPE_NONE 0 /* no joystick defined */
/* no joystick defined */
#define MAX_PLAT_JOYSTICKS 8
#define MAX_PLAT_JOYSTICKS 8 #define MAX_JOYSTICKS 4
#define MAX_JOYSTICKS 4
#define POV_X 0x80000000
#define POV_X 0x80000000 #define POV_Y 0x40000000
#define POV_Y 0x40000000
#define AXIS_NOT_PRESENT -99999
#define AXIS_NOT_PRESENT -99999
#define JOYSTICK_PRESENT(n) (joystick_state[n].plat_joystick_nr != 0)
#define JOYSTICK_PRESENT(n) (joystick_state[n].plat_joystick_nr != 0)
typedef struct {
typedef struct { char name[64];
char name[64];
int a[8];
int a[8]; int b[32];
int b[32]; int p[4];
int p[4];
struct {
struct { char name[32];
char name[32]; int id;
int id; } axis[8];
} axis[8];
struct {
struct { char name[32];
char name[32]; int id;
int id; } button[32];
} button[32];
struct {
struct { char name[32];
char name[32]; int id;
int id; } pov[4];
} pov[4];
int nr_axes;
int nr_axes; int nr_buttons;
int nr_buttons; int nr_povs;
int nr_povs; } plat_joystick_t;
} plat_joystick_t;
typedef struct {
typedef struct { int axis[8];
int axis[8]; int button[32];
int button[32]; int pov[4];
int pov[4];
int plat_joystick_nr;
int plat_joystick_nr; int axis_mapping[8];
int axis_mapping[8]; int button_mapping[32];
int button_mapping[32]; int pov_mapping[4][2];
int pov_mapping[4][2]; } joystick_t;
} joystick_t;
typedef struct {
typedef struct { const char *name;
const char *name;
void *(*init)(void);
void *(*init)(void); void (*close)(void *p);
void (*close)(void *p); uint8_t (*read)(void *p);
uint8_t (*read)(void *p); void (*write)(void *p);
void (*write)(void *p); int (*read_axis)(void *p, int axis);
int (*read_axis)(void *p, int axis); void (*a0_over)(void *p);
void (*a0_over)(void *p);
int axis_count,
int axis_count, button_count,
button_count, pov_count;
pov_count; int max_joysticks;
int max_joysticks; const char *axis_names[8];
const char *axis_names[8]; const char *button_names[32];
const char *button_names[32]; const char *pov_names[4];
const char *pov_names[4]; } joystick_if_t;
} joystick_if_t;
#ifdef __cplusplus
#ifdef __cplusplus extern "C" {
extern "C" { #endif
#endif
#ifdef EMU_DEVICE_H
#ifdef EMU_DEVICE_H extern const device_t gameport_device;
extern const device_t gameport_device; extern const device_t gameport_201_device;
extern const device_t gameport_201_device; #endif
#endif
extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS];
extern plat_joystick_t plat_joystick_state[MAX_PLAT_JOYSTICKS]; extern joystick_t joystick_state[MAX_JOYSTICKS];
extern joystick_t joystick_state[MAX_JOYSTICKS]; extern int joysticks_present;
extern int joysticks_present;
extern void joystick_init(void);
extern void joystick_init(void); extern void joystick_close(void);
extern void joystick_close(void); extern void joystick_process(void);
extern void joystick_process(void);
extern char *joystick_get_name(int js);
extern char *joystick_get_name(int js); extern int joystick_get_max_joysticks(int js);
extern int joystick_get_max_joysticks(int js); extern int joystick_get_axis_count(int js);
extern int joystick_get_axis_count(int js); extern int joystick_get_button_count(int js);
extern int joystick_get_button_count(int js); extern int joystick_get_pov_count(int js);
extern int joystick_get_pov_count(int js); extern char *joystick_get_axis_name(int js, int id);
extern char *joystick_get_axis_name(int js, int id); extern char *joystick_get_button_name(int js, int id);
extern char *joystick_get_button_name(int js, int id); extern char *joystick_get_pov_name(int js, int id);
extern char *joystick_get_pov_name(int js, int id);
extern void gameport_update_joystick_type(void);
extern void gameport_update_joystick_type(void);
#ifdef __cplusplus
#ifdef __cplusplus }
} #endif
#endif
#endif /*EMU_GAMEPORT_H*/

View File

@@ -10,7 +10,7 @@
* *
* NOTE: FIXME: Strings 2176 and 2193 are same. * NOTE: FIXME: Strings 2176 and 2193 are same.
* *
* Version: @(#)language.h 1.0.4 2018/03/08 * Version: @(#)language.h 1.0.5 2018/03/28
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
* *
@@ -147,14 +147,14 @@
#define IDS_2141 2141 // "Invalid PCap device" #define IDS_2141 2141 // "Invalid PCap device"
#define IDS_2142 2142 // "&Notify disk change" #define IDS_2142 2142 // "&Notify disk change"
#define IDS_2143 2143 // "Type" #define IDS_2143 2143 // "Type"
#define IDS_2144 2144 // "Standard 2-button joystick(s)" #define IDS_2144 2144 // "Disabled"
#define IDS_2145 2145 // "Standard 4-button joystick" #define IDS_2145 2145 // "Standard 2-button joystick(s)"
#define IDS_2146 2146 // "Standard 6-button joystick" #define IDS_2146 2146 // "Standard 4-button joystick"
#define IDS_2147 2147 // "Standard 8-button joystick" #define IDS_2147 2147 // "Standard 6-button joystick"
#define IDS_2148 2148 // "CH Flightstick Pro" #define IDS_2148 2148 // "Standard 8-button joystick"
#define IDS_2149 2149 // "Microsoft SideWinder Pad" #define IDS_2149 2149 // "CH Flightstick Pro"
#define IDS_2150 2150 // "Thrustmaster Flight Cont.." #define IDS_2150 2150 // "Microsoft SideWinder Pad"
#define IDS_2151 2151 // "Disabled" #define IDS_2151 2151 // "Thrustmaster Flight Cont.."
#define IDS_2152 2152 // "None" #define IDS_2152 2152 // "None"
#define IDS_2153 2153 // "Unable to load Accelerators" #define IDS_2153 2153 // "Unable to load Accelerators"
#define IDS_2154 2154 // "Unable to register Raw Input" #define IDS_2154 2154 // "Unable to register Raw Input"

View File

@@ -160,7 +160,7 @@ typedef struct {
typedef struct { typedef struct {
int w, h; int w, h;
uint8_t *dat; uint8_t *dat;
uint8_t **line; uint8_t *line[];
} bitmap_t; } bitmap_t;
typedef struct { typedef struct {

View File

@@ -8,7 +8,7 @@
* *
* Application resource script for Windows. * Application resource script for Windows.
* *
* Version: @(#)VARCem.rc 1.0.8 2018/03/25 * Version: @(#)VARCem.rc 1.0.9 2018/03/28
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -953,14 +953,14 @@ BEGIN
IDS_2141 "Invalid PCap device" IDS_2141 "Invalid PCap device"
IDS_2142 "&Notify disk change" IDS_2142 "&Notify disk change"
IDS_2143 "Type" IDS_2143 "Type"
IDS_2144 "Standard 2-button joystick(s)" IDS_2144 "Disabled"
IDS_2145 "Standard 4-button joystick" IDS_2145 "Standard 2-button joystick(s)"
IDS_2146 "Standard 6-button joystick" IDS_2146 "Standard 4-button joystick"
IDS_2147 "Standard 8-button joystick" IDS_2147 "Standard 6-button joystick"
IDS_2148 "CH Flightstick Pro" IDS_2148 "Standard 8-button joystick"
IDS_2149 "Microsoft SideWinder Pad" IDS_2149 "CH Flightstick Pro"
IDS_2150 "Thrustmaster Flight Control System" IDS_2150 "Microsoft SideWinder Pad"
IDS_2151 "Disabled" IDS_2151 "Thrustmaster Flight Control System"
IDS_2152 "None" IDS_2152 "None"
IDS_2153 "Unable to load Keyboard Accelerators!" IDS_2153 "Unable to load Keyboard Accelerators!"
IDS_2154 "Unable to register Raw Input!" IDS_2154 "Unable to register Raw Input!"

View File

@@ -11,7 +11,7 @@
* NOTE: Hacks currently needed to compile with MSVC; DX needs to * NOTE: Hacks currently needed to compile with MSVC; DX needs to
* be updated to 11 or 12 or so. --FvK * be updated to 11 or 12 or so. --FvK
* *
* Version: @(#)win_joystick.cpp 1.0.7 2018/03/26 * Version: @(#)win_joystick.cpp 1.0.8 2018/03/28
* *
* Authors: Fred N. van Kempen, <decwiz@yahoo.com> * Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
@@ -125,11 +125,11 @@ BOOL CALLBACK DIEnumDeviceObjectsCallback(
return DIENUM_CONTINUE; return DIENUM_CONTINUE;
} }
void joystick_init() void joystick_init(void)
{ {
int c; int c;
if (joystick_type == 7) return; if (joystick_type == JOYSTICK_TYPE_NONE) return;
atexit(joystick_close); atexit(joystick_close);
@@ -203,7 +203,7 @@ void joystick_init()
} }
} }
void joystick_close() void joystick_close(void)
{ {
if (lpdi_joystick[1]) if (lpdi_joystick[1])
{ {
@@ -245,7 +245,7 @@ void joystick_process(void)
{ {
int c, d; int c, d;
if (joystick_type == 7) return; if (joystick_type == JOYSTICK_TYPE_NONE) return;
for (c = 0; c < joysticks_present; c++) for (c = 0; c < joysticks_present; c++)
{ {
@@ -318,4 +318,3 @@ void joystick_process(void)
} }
} }
} }