Files
86Box/src/mouse.c
OBattler fc2a293536 CD-ROM images are now working correctly again;
Fixed all the reported bugs regarding the Settings dialog;
MIDI out device is now no longer reset to 0 after hard reset;
Removed all vestiges of the old disk activity flash;
The configuration file is no longer saved when it shouldn't be;
Redone the status bar icon updating so it is only done in win.c;
Made sure all variables in ibm.h are extern;
A lot of other bugfixes;
Added Mouse Systems Mouse emulation (patch from TheCollector1995);
Added IBM PS/1 Model 2133 (486) emulation (patch from TheCollector1995);
Tweaked the CPU dynamic recompiler cycle periods - 486SX 33 and 486DX 33 now work;
Increased compatibility with configuration files from before the previous commit.
2017-05-29 01:18:32 +02:00

98 lines
1.6 KiB
C

#include "ibm.h"
#include "mouse.h"
#include "mouse_serial.h"
#include "mouse_ps2.h"
#include "mouse_bus.h"
#include "amstrad.h"
#include "keyboard_olim24.h"
static mouse_t *mouse_list[] = {
&mouse_serial_microsoft, /* 0 Microsoft Serial Mouse */
&mouse_ps2_2_button, /* 1 PS/2 Mouse 2-button */
&mouse_intellimouse, /* 2 PS/2 Intellimouse 3-button */
&mouse_bus, /* 3 Logitech Bus Mouse 2-button */
&mouse_amstrad, /* 4 Amstrad PC System Mouse */
&mouse_olim24, /* 5 Olivetti M24 System Mouse */
&mouse_msystems, /* 6 Mouse Systems */
#if 0
&mouse_genius, /* 7 Genius Bus Mouse */
#endif
NULL
};
static mouse_t *cur_mouse;
static void *mouse_p;
int mouse_type = 0;
void
mouse_emu_init(void)
{
cur_mouse = mouse_list[mouse_type];
mouse_p = cur_mouse->init();
}
void
mouse_emu_close(void)
{
if (cur_mouse)
cur_mouse->close(mouse_p);
cur_mouse = NULL;
}
void
mouse_poll(int x, int y, int z, int b)
{
if (cur_mouse)
cur_mouse->poll(x, y, z, b, mouse_p);
}
char *
mouse_get_name(int mouse)
{
if (!mouse_list[mouse])
return(NULL);
return(mouse_list[mouse]->name);
}
char *
mouse_get_internal_name(int mouse)
{
return(mouse_list[mouse]->internal_name);
}
int
mouse_get_from_internal_name(char *s)
{
int c = 0;
while (mouse_list[c] != NULL) {
if (!strcmp(mouse_list[c]->internal_name, s))
return(c);
c++;
}
return(0);
}
int
mouse_get_type(int mouse)
{
return(mouse_list[mouse]->type);
}
/* Return number of MOUSE types we know about. */
int
mouse_get_ndev(void)
{
return(sizeof(mouse_list)/sizeof(mouse_t *) - 1);
}