Added mouse=none, fixed serial mice, reverted serial driver (again).

This commit is contained in:
waltje
2017-06-21 00:41:34 -04:00
parent 6af04e38d7
commit 0170d594e3
10 changed files with 235 additions and 130 deletions

23
src/H Normal file
View File

@@ -0,0 +1,23 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Handling of the emulated machines.
*
* Version: @(#)xxx.h 1.0.1 2017/06/21
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/
#ifndef EMU_xxx_H
# define EMU_xxx_H
#endif /*EMU_xxx_H*/

18
src/M Normal file
View File

@@ -0,0 +1,18 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Handling of the emulated machines.
*
* Version: @(#)xxx.c 1.0.1 2017/06/21
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/

View File

@@ -8,7 +8,7 @@
# #
# Modified Makefile for Win32 (MinGW32) environment. # Modified Makefile for Win32 (MinGW32) environment.
# #
# Version: @(#)Makefile.mingw 1.0.30 2017/06/17 # Version: @(#)Makefile.mingw 1.0.31 2017/06/19
# #
# Authors: Miran Grca, <mgrca8@gmail.com> # Authors: Miran Grca, <mgrca8@gmail.com>
# Fred N. van Kempen, <decwiz@yahoo.com> # Fred N. van Kempen, <decwiz@yahoo.com>
@@ -62,7 +62,12 @@ endif
######################################################################### #########################################################################
# Nothing should need changing from here on.. # # Nothing should need changing from here on.. #
######################################################################### #########################################################################
VPATH = . cpu sound sound/munt sound/munt/c_interface sound/munt/sha1 sound/munt/srchelper sound/resid-fp video lzf network network/slirp win VPATH = . cpu \
sound \
sound/munt sound/munt/c_interface sound/munt/sha1 \
sound/munt/srchelper \
sound/resid-fp \
video lzf network network/slirp win
PLAT = win/ PLAT = win/
ifeq ($(X64), y) ifeq ($(X64), y)
CPP = g++.exe -m64 CPP = g++.exe -m64
@@ -185,12 +190,14 @@ SNDOBJ = sound.o \
wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \ wave6581_P_T.o wave6581_PS_.o wave6581_PST.o \
wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \ wave8580__ST.o wave8580_P_T.o wave8580_PS_.o \
wave8580_PST.o wave.o \ wave8580_PST.o wave.o \
midi.o \
midi_mt32.o \
Analog.o BReverbModel.o File.o FileStream.o LA32Ramp.o \ Analog.o BReverbModel.o File.o FileStream.o LA32Ramp.o \
LA32FloatWaveGenerator.o LA32WaveGenerator.o \ LA32FloatWaveGenerator.o LA32WaveGenerator.o \
MidiStreamParser.o Part.o Partial.o PartialManager.o \ MidiStreamParser.o Part.o Partial.o PartialManager.o \
Poly.o ROMInfo.o Synth.o Tables.o TVA.o TVF.o TVP.o \ Poly.o ROMInfo.o Synth.o Tables.o TVA.o TVF.o TVP.o \
sha1.o c_interface.o \ sha1.o c_interface.o \
midi.o midi_mt32.o midi_system.o \ midi_system.o \
snd_speaker.o snd_ps1.o snd_pssj.o \ snd_speaker.o snd_ps1.o snd_pssj.o \
snd_adlib.o snd_adlibgold.o snd_ad1848.o \ snd_adlib.o snd_adlibgold.o snd_ad1848.o \
snd_sb.o snd_sb_dsp.o snd_cms.o snd_dbopl.o \ snd_sb.o snd_sb_dsp.o snd_cms.o snd_dbopl.o \

View File

@@ -8,37 +8,39 @@
* *
* Mouse interface to host device. * Mouse interface to host device.
* *
* Version: @(#)win_mouse.cc 1.0.0 2017/05/30 * Version: @(#)win_mouse.cc 1.0.1 2017/06/21
* *
* Author: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>
* Copyright 2008-2017 Sarah Walker. * Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca. * Copyright 2016-2017 Miran Grca.
*/ */
#define DIRECTINPUT_VERSION 0x0800 #define DIRECTINPUT_VERSION 0x0800
#include <dinput.h> #include <dinput.h>
#include <stdint.h> #include <stdint.h>
#include "plat_mouse.h" #include "plat_mouse.h"
#include "win.h" #include "win.h"
extern "C" int video_fullscreen; extern "C" int video_fullscreen;
extern "C" void fatal(const char *format, ...); extern "C" void fatal(const char *format, ...);
extern "C" void pclog(const char *format, ...); extern "C" void pclog(const char *format, ...);
extern "C" void mouse_init(); extern "C" void mouse_init(void);
extern "C" void mouse_close(); extern "C" void mouse_close(void);
extern "C" void mouse_poll_host(); extern "C" void mouse_poll_host(void);
extern "C" void mouse_get_mickeys(int *x, int *y, int *z); extern "C" void mouse_get_mickeys(int *x, int *y, int *z);
static LPDIRECTINPUT8 lpdi; static LPDIRECTINPUT8 lpdi;
static LPDIRECTINPUTDEVICE8 lpdi_mouse = NULL; static LPDIRECTINPUTDEVICE8 lpdi_mouse = NULL;
static DIMOUSESTATE mousestate; static DIMOUSESTATE mousestate;
static int mouse_x = 0, mouse_y = 0, mouse_z = 0; static int mouse_x = 0, mouse_y = 0, mouse_z = 0;
int mouse_buttons = 0; int mouse_buttons = 0;
void mouse_init()
void mouse_init(void)
{ {
atexit(mouse_close); atexit(mouse_close);
@@ -52,7 +54,8 @@ void mouse_init()
fatal("mouse_init : SetDataFormat failed\n"); fatal("mouse_init : SetDataFormat failed\n");
} }
void mouse_close()
void mouse_close(void)
{ {
if (lpdi_mouse) if (lpdi_mouse)
{ {
@@ -61,7 +64,8 @@ void mouse_close()
} }
} }
void mouse_poll_host()
void mouse_poll_host(void)
{ {
if (FAILED(lpdi_mouse->GetDeviceState(sizeof(DIMOUSESTATE), (LPVOID)&mousestate))) if (FAILED(lpdi_mouse->GetDeviceState(sizeof(DIMOUSESTATE), (LPVOID)&mousestate)))
{ {
@@ -82,6 +86,7 @@ void mouse_poll_host()
mouse_x = mouse_y = mouse_buttons = 0; mouse_x = mouse_y = mouse_buttons = 0;
} }
void mouse_get_mickeys(int *x, int *y, int *z) void mouse_get_mickeys(int *x, int *y, int *z)
{ {
*x = mouse_x; *x = mouse_x;

View File

@@ -8,7 +8,7 @@
* *
* Windows 86Box Settings dialog handler. * Windows 86Box Settings dialog handler.
* *
* Version: @(#)win_settings.c 1.0.4 2017/06/19 * Version: @(#)win_settings.c 1.0.5 2017/06/21
* *
* Author: Miran Grca, <mgrca8@gmail.com> * Author: Miran Grca, <mgrca8@gmail.com>
* Copyright 2016-2017 Miran Grca. * Copyright 2016-2017 Miran Grca.
@@ -902,32 +902,35 @@ static BOOL CALLBACK win_settings_input_proc(HWND hdlg, UINT message, WPARAM wPa
{ {
switch(c) switch(c)
{ {
case 0: /* MS Serial */ case 0: /* none */
str_id = IDS_2151;
break;
case 1: /* MS Serial */
default: default:
str_id = IDS_2139; str_id = IDS_2139;
break; break;
case 1: /* PS2 2b */ case 2: /* PS2 2b */
str_id = IDS_2141; str_id = IDS_2141;
break; break;
case 2: /* PS2 intelli 3b */ case 3: /* PS2 intelli 3b */
str_id = IDS_2142; str_id = IDS_2142;
break; break;
case 3: /* MS/logi bus 2b */ case 4: /* MS/logi bus 2b */
str_id = IDS_2143; str_id = IDS_2143;
break; break;
case 4: /* Amstrad */ case 5: /* Amstrad */
str_id = IDS_2162; str_id = IDS_2162;
break; break;
case 5: /* Olivetti M24 */ case 6: /* Olivetti M24 */
str_id = IDS_2177; str_id = IDS_2177;
break; break;
case 6: /* MouseSystems */ case 7: /* MouseSystems */
str_id = IDS_2140; str_id = IDS_2140;
break; break;
case 7: /* Logitech Serial */ case 8: /* Logitech Serial */
str_id = IDS_2224; str_id = IDS_2224;
break; break;
case 8: /* Genius Bus */ case 9: /* Genius Bus */
str_id = IDS_2161; str_id = IDS_2161;
break; break;
} }

View File

@@ -8,7 +8,7 @@
* *
* Handling of the emulated machines. * Handling of the emulated machines.
* *
* Version: @(#)model.c 1.0.2 2017/06/17 * Version: @(#)model.c 1.0.4 2017/06/21
* *
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/> * Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com> * Miran Grca, <mgrca8@gmail.com>

View File

@@ -1,3 +1,21 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Common driver module for MOUSE devices.
*
* Version: @(#)mouse.c 1.0.3 2017/06/21
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/
#include "ibm.h" #include "ibm.h"
#include "cpu/cpu.h" #include "cpu/cpu.h"
#include "device.h" #include "device.h"
@@ -6,20 +24,27 @@
#include "mouse_ps2.h" #include "mouse_ps2.h"
#include "mouse_bus.h" #include "mouse_bus.h"
#include "model.h" #include "model.h"
//#include "keyboard_olim24.h"
static mouse_t mouse_none = {
"Disabled", "none",
MOUSE_TYPE_NONE,
NULL, NULL, NULL
};
static mouse_t *mouse_list[] = { static mouse_t *mouse_list[] = {
&mouse_serial_microsoft, /* 0 Microsoft Serial Mouse */ &mouse_none,
&mouse_ps2_2_button, /* 1 PS/2 Mouse 2-button */ &mouse_serial_microsoft, /* 1 Microsoft Serial Mouse */
&mouse_intellimouse, /* 2 PS/2 Intellimouse 3-button */ &mouse_ps2_2_button, /* 2 PS/2 Mouse 2-button */
&mouse_bus, /* 3 Logitech Bus Mouse 2-button */ &mouse_intellimouse, /* 3 PS/2 Intellimouse 3-button */
&mouse_amstrad, /* 4 Amstrad PC System Mouse */ &mouse_bus, /* 4 Logitech Bus Mouse 2-button */
&mouse_olim24, /* 5 Olivetti M24 System Mouse */ &mouse_amstrad, /* 5 Amstrad PC System Mouse */
&mouse_msystems, /* 6 Mouse Systems */ &mouse_olim24, /* 6 Olivetti M24 System Mouse */
&mouse_serial_logitech, /* 0 Logitech 3-button Serial Mouse */ &mouse_msystems, /* 7 Mouse Systems */
&mouse_serial_logitech, /* 1 Logitech 3-button Serial Mouse */
#if 0 #if 0
&mouse_genius, /* 7 Genius Bus Mouse */ &mouse_genius, /* 8 Genius Bus Mouse */
#endif #endif
NULL NULL
}; };
@@ -33,6 +58,9 @@ void
mouse_emu_init(void) mouse_emu_init(void)
{ {
cur_mouse = mouse_list[mouse_type]; cur_mouse = mouse_list[mouse_type];
if (cur_mouse == NULL || cur_mouse->init == NULL) return;
mouse_p = cur_mouse->init(); mouse_p = cur_mouse->init();
} }
@@ -40,16 +68,20 @@ mouse_emu_init(void)
void void
mouse_emu_close(void) mouse_emu_close(void)
{ {
if (cur_mouse) if (cur_mouse == NULL || cur_mouse->close == NULL) return;
cur_mouse->close(mouse_p); cur_mouse->close(mouse_p);
cur_mouse = NULL; cur_mouse = NULL;
mouse_p = NULL;
} }
void void
mouse_poll(int x, int y, int z, int b) mouse_poll(int x, int y, int z, int b)
{ {
if (cur_mouse) if (cur_mouse == NULL || cur_mouse->init == NULL) return;
cur_mouse->poll(x, y, z, b, mouse_p); cur_mouse->poll(x, y, z, b, mouse_p);
} }
@@ -59,6 +91,7 @@ mouse_get_name(int mouse)
{ {
if (!mouse_list[mouse]) if (!mouse_list[mouse])
return(NULL); return(NULL);
return(mouse_list[mouse]->name); return(mouse_list[mouse]->name);
} }

View File

@@ -1,15 +1,34 @@
/*
* 86Box A hypervisor and IBM PC system emulator that specializes in
* running old operating systems and software designed for IBM
* PC systems and compatibles from 1981 through fairly recent
* system designs based on the PCI bus.
*
* This file is part of the 86Box distribution.
*
* Definitions for the MOUSE driver.
*
* Version: @(#)mouse.h 1.0.3 2017/06/21
*
* Authors: Sarah Walker, <http://pcem-emulator.co.uk/>
* Miran Grca, <mgrca8@gmail.com>
* Fred N. van Kempen, <decwiz@yahoo.com>
* Copyright 2008-2017 Sarah Walker.
* Copyright 2016-2017 Miran Grca.
*/
#ifndef EMU_MOUSE_H #ifndef EMU_MOUSE_H
# define EMU_MOUSE_H # define EMU_MOUSE_H
#define MOUSE_TYPE_SERIAL 0 /* Serial Mouse */ #define MOUSE_TYPE_NONE 0
#define MOUSE_TYPE_PS2 1 /* IBM PS/2 series Bus Mouse */ #define MOUSE_TYPE_SERIAL 1 /* Serial Mouse */
#define MOUSE_TYPE_PS2_MS 2 /* Microsoft Intellimouse PS/2 */ #define MOUSE_TYPE_PS2 2 /* IBM PS/2 series Bus Mouse */
#define MOUSE_TYPE_BUS 3 /* Logitech/ATI Bus Mouse */ #define MOUSE_TYPE_PS2_MS 3 /* Microsoft Intellimouse PS/2 */
#define MOUSE_TYPE_AMSTRAD 4 /* Amstrad PC system mouse */ #define MOUSE_TYPE_BUS 4 /* Logitech/ATI Bus Mouse */
#define MOUSE_TYPE_OLIM24 5 /* Olivetti M24 system mouse */ #define MOUSE_TYPE_AMSTRAD 5 /* Amstrad PC system mouse */
#define MOUSE_TYPE_MSYSTEMS 6 /* Mouse Systems mouse */ #define MOUSE_TYPE_OLIM24 6 /* Olivetti M24 system mouse */
#define MOUSE_TYPE_GENIUS 7 /* Genius Bus Mouse */ #define MOUSE_TYPE_MSYSTEMS 7 /* Mouse Systems mouse */
#define MOUSE_TYPE_GENIUS 8 /* Genius Bus Mouse */
#define MOUSE_TYPE_MASK 0x0f #define MOUSE_TYPE_MASK 0x0f
#define MOUSE_TYPE_3BUTTON (1<<7) /* device has 3+ buttons */ #define MOUSE_TYPE_3BUTTON (1<<7) /* device has 3+ buttons */

View File

@@ -10,7 +10,7 @@
* *
* Based on the 86Box Serial Mouse driver as a framework. * Based on the 86Box Serial Mouse driver as a framework.
* *
* Version: @(#)mouse_serial.c 1.0.5 2017/06/18 * Version: @(#)mouse_serial.c 1.0.6 2017/06/19
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
*/ */
@@ -127,13 +127,10 @@ sermouse_poll(int x, int y, int z, int b, void *priv)
if (b&0x02) buff[0] |= 0x10; if (b&0x02) buff[0] |= 0x10;
buff[1] = x & 0x3F; buff[1] = x & 0x3F;
buff[2] = y & 0x3F; buff[2] = y & 0x3F;
if (b&0x04) if (b&0x04) {
{
buff[3] = 0x20; buff[3] = 0x20;
len = 4; len = 4;
} } else {
else
{
len = 3; len = 3;
} }
break; break;

View File

@@ -10,7 +10,7 @@
* *
* Definitions for the Serial Mouse driver. * Definitions for the Serial Mouse driver.
* *
* Version: @(#)mouse_serial.h 1.0.2 2017/05/06 * Version: @(#)mouse_serial.h 1.0.3 2017/06/19
* *
* Author: Fred N. van Kempen, <decwiz@yahoo.com> * Author: Fred N. van Kempen, <decwiz@yahoo.com>
*/ */