Fixed a few minor things with how the Mouse Systems Bus Mouse as added.
This commit is contained in:
@@ -843,10 +843,13 @@ sermouse_init(const device_t *info)
|
||||
mouse_t *dev;
|
||||
void (*rcr_callback)(struct serial_s *serial, void *priv);
|
||||
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data);
|
||||
void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period);
|
||||
void (*transmit_period_callback)(struct serial_s *serial, void *priv,
|
||||
double transmit_period);
|
||||
|
||||
if (info->local == MOUSE_TYPE_MSYSTEMSB) {
|
||||
uintptr_t irqbase = ((device_get_config_int("irq") << 16) | (device_get_config_hex16("addr") << 20)) | ns16450_device.local;
|
||||
uintptr_t irqbase = ((device_get_config_int("irq") << 16) |
|
||||
(device_get_config_hex16("addr") << 20)) |
|
||||
ns16450_device.local;
|
||||
device_add_params(&ns16450_device, (void*)irqbase);
|
||||
}
|
||||
|
||||
@@ -894,7 +897,7 @@ sermouse_init(const device_t *info)
|
||||
}
|
||||
}
|
||||
|
||||
dev->port = (info->local == MOUSE_TYPE_MSYSTEMSB) ? SERIAL_MAX : device_get_config_int("port");
|
||||
dev->port = (info->local == MOUSE_TYPE_MSYSTEMSB) ? (SERIAL_MAX - 1) : device_get_config_int("port");
|
||||
|
||||
/* Attach a serial port to the mouse. */
|
||||
rcr_callback = dev->rts_toggle ? sermouse_callback : NULL;
|
||||
@@ -982,6 +985,8 @@ static const device_config_t mssbusmouse_config[] = {
|
||||
.selection = {
|
||||
{ .description = "0x338", .value = 0x338 },
|
||||
{ .description = "0x238", .value = 0x238 },
|
||||
{ .description = "0x3f8", .value = 0x3f8 },
|
||||
{ .description = "0x2f8", .value = 0x2f8 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
#include <86box/serial.h>
|
||||
#include <86box/mouse.h>
|
||||
|
||||
serial_port_t com_ports[SERIAL_MAX + 1];
|
||||
serial_port_t com_ports[SERIAL_MAX];
|
||||
|
||||
enum {
|
||||
SERIAL_INT_LSR = 1,
|
||||
@@ -53,7 +53,7 @@ enum {
|
||||
void serial_update_ints(serial_t *dev);
|
||||
|
||||
static int next_inst = 0;
|
||||
static serial_device_t serial_devices[SERIAL_MAX + 1];
|
||||
static serial_device_t serial_devices[SERIAL_MAX];
|
||||
|
||||
static void serial_xmit_d_empty_evt(void *priv);
|
||||
|
||||
@@ -932,9 +932,8 @@ serial_init(const device_t *info)
|
||||
serial_t *dev = (serial_t *) calloc(1, sizeof(serial_t));
|
||||
int orig_inst = next_inst;
|
||||
|
||||
if (info->local & 0xFFF00000) {
|
||||
next_inst = SERIAL_MAX;
|
||||
}
|
||||
if (info->local & 0xFFF00000)
|
||||
next_inst = SERIAL_MAX - 1;
|
||||
|
||||
dev->inst = next_inst;
|
||||
|
||||
@@ -945,13 +944,12 @@ serial_init(const device_t *info)
|
||||
dev->sd = &(serial_devices[next_inst]);
|
||||
dev->sd->serial = dev;
|
||||
|
||||
if (info->local & 0xFFF00000) {
|
||||
if (info->local & 0xfff00000) {
|
||||
dev->base_address = info->local >> 20;
|
||||
dev->irq = (info->local >> 16) & 0xF;
|
||||
io_sethandler(dev->base_address, 0x0008, serial_read, NULL, NULL, serial_write, NULL, NULL, dev);
|
||||
next_inst = orig_inst;
|
||||
}
|
||||
else if (next_inst == 6)
|
||||
} else if (next_inst == 6)
|
||||
serial_setup(dev, COM7_ADDR, COM7_IRQ);
|
||||
else if (next_inst == 5)
|
||||
serial_setup(dev, COM6_ADDR, COM6_IRQ);
|
||||
@@ -996,7 +994,7 @@ serial_init(const device_t *info)
|
||||
serial_reset_port(dev);
|
||||
}
|
||||
|
||||
if (!(info->local & 0xFFF00000))
|
||||
if (!(info->local & 0xfff00000))
|
||||
next_inst++;
|
||||
|
||||
return dev;
|
||||
@@ -1011,7 +1009,7 @@ serial_set_next_inst(int ni)
|
||||
void
|
||||
serial_standalone_init(void)
|
||||
{
|
||||
while (next_inst < SERIAL_MAX)
|
||||
while (next_inst < (SERIAL_MAX - 1))
|
||||
device_add_inst(&ns8250_device, next_inst + 1);
|
||||
};
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ serial_passthrough_log(const char *fmt, ...)
|
||||
void
|
||||
serial_passthrough_init(void)
|
||||
{
|
||||
for (uint8_t c = 0; c < SERIAL_MAX; c++) {
|
||||
for (uint8_t c = 0; c < (SERIAL_MAX - 1); c++) {
|
||||
if (serial_passthrough_enabled[c]) {
|
||||
/* Instance n for COM n */
|
||||
device_add_inst(&serial_passthrough_device, c + 1);
|
||||
|
||||
Reference in New Issue
Block a user