Merge branch 'master' into qt-scroll-states
This commit is contained in:
@@ -84,7 +84,10 @@ static uint8_t bug_spcfg; /* serial port configuration */
|
||||
#define FIFO_LEN 256
|
||||
static uint8_t bug_buff[FIFO_LEN]; /* serial port data buffer */
|
||||
static uint8_t *bug_bptr;
|
||||
#define UISTR_LEN 24
|
||||
|
||||
static char LED_R[] = "<font color=\"#EE0000\">R</font>";
|
||||
static char LED_G[] = "<font color=\"#00CC00\">G</font>";
|
||||
#define UISTR_LEN (17 + 8 * sizeof(LED_G) + 8 * sizeof(LED_R))
|
||||
static char bug_str[UISTR_LEN]; /* UI output string */
|
||||
|
||||
extern void ui_sb_bugui(char *__str);
|
||||
@@ -112,16 +115,16 @@ static void
|
||||
bug_setui(void)
|
||||
{
|
||||
/* Format all current info in a string. */
|
||||
sprintf(bug_str, "%02X:%02X %c%c%c%c%c%c%c%c-%c%c%c%c%c%c%c%c",
|
||||
sprintf(bug_str, "<tt>%02X:%02X %s%s%s%s%s%s%s%s-%s%s%s%s%s%s%s%s</tt>",
|
||||
bug_seg2, bug_seg1,
|
||||
(bug_ledg & 0x80) ? 'G' : 'g', (bug_ledg & 0x40) ? 'G' : 'g',
|
||||
(bug_ledg & 0x20) ? 'G' : 'g', (bug_ledg & 0x10) ? 'G' : 'g',
|
||||
(bug_ledg & 0x08) ? 'G' : 'g', (bug_ledg & 0x04) ? 'G' : 'g',
|
||||
(bug_ledg & 0x02) ? 'G' : 'g', (bug_ledg & 0x01) ? 'G' : 'g',
|
||||
(bug_ledr & 0x80) ? 'R' : 'r', (bug_ledr & 0x40) ? 'R' : 'r',
|
||||
(bug_ledr & 0x20) ? 'R' : 'r', (bug_ledr & 0x10) ? 'R' : 'r',
|
||||
(bug_ledr & 0x08) ? 'R' : 'r', (bug_ledr & 0x04) ? 'R' : 'r',
|
||||
(bug_ledr & 0x02) ? 'R' : 'r', (bug_ledr & 0x01) ? 'R' : 'r');
|
||||
(bug_ledg & 0x80) ? LED_G : "g", (bug_ledg & 0x40) ? LED_G : "g",
|
||||
(bug_ledg & 0x20) ? LED_G : "g", (bug_ledg & 0x10) ? LED_G : "g",
|
||||
(bug_ledg & 0x08) ? LED_G : "g", (bug_ledg & 0x04) ? LED_G : "g",
|
||||
(bug_ledg & 0x02) ? LED_G : "g", (bug_ledg & 0x01) ? LED_G : "g",
|
||||
(bug_ledr & 0x80) ? LED_R : "r", (bug_ledr & 0x40) ? LED_R : "r",
|
||||
(bug_ledr & 0x20) ? LED_R : "r", (bug_ledr & 0x10) ? LED_R : "r",
|
||||
(bug_ledr & 0x08) ? LED_R : "r", (bug_ledr & 0x04) ? LED_R : "r",
|
||||
(bug_ledr & 0x02) ? LED_R : "r", (bug_ledr & 0x01) ? LED_R : "r");
|
||||
|
||||
/* Send formatted string to the UI. */
|
||||
ui_sb_bugui(bug_str);
|
||||
|
||||
@@ -509,9 +509,6 @@ kbc_scan_kbd_at(atkbc_t *dev)
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
write_p2(atkbc_t *dev, uint8_t val);
|
||||
|
||||
static void
|
||||
kbc_at_poll_at(atkbc_t *dev)
|
||||
{
|
||||
@@ -778,6 +775,7 @@ static void
|
||||
write_p2(atkbc_t *dev, uint8_t val)
|
||||
{
|
||||
uint8_t old = dev->p2;
|
||||
|
||||
kbc_at_log("ATkbc: write P2: %02X (old: %02X)\n", val, dev->p2);
|
||||
|
||||
uint8_t kbc_ven = dev->flags & KBC_VEN_MASK;
|
||||
@@ -851,6 +849,25 @@ write_p2(atkbc_t *dev, uint8_t val)
|
||||
}
|
||||
}
|
||||
|
||||
uint8_t
|
||||
kbc_at_read_p(void *priv, uint8_t port, uint8_t mask)
|
||||
{
|
||||
atkbc_t *dev = (atkbc_t *) priv;
|
||||
uint8_t *p = (port == 2) ? &dev->p2 : &dev->p1;
|
||||
uint8_t ret = *p & mask;
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void
|
||||
kbc_at_write_p(void *priv, uint8_t port, uint8_t mask, uint8_t val)
|
||||
{
|
||||
atkbc_t *dev = (atkbc_t *) priv;
|
||||
uint8_t *p = (port == 2) ? &dev->p2 : &dev->p1;
|
||||
|
||||
*p = (*p & mask) | val;
|
||||
}
|
||||
|
||||
static void
|
||||
write_p2_fast_a20(atkbc_t *dev, uint8_t val)
|
||||
{
|
||||
@@ -1070,10 +1087,14 @@ write64_generic(void *priv, uint8_t val)
|
||||
fixed_bits |= 8;
|
||||
/* (B0 or F0) | (0x04 or 0x0c) */
|
||||
kbc_delay_to_ob(dev, dev->p1 | fixed_bits, 0, 0x00);
|
||||
} else if (((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) && ((dev->flags & KBC_TYPE_MASK) < KBC_TYPE_GREEN))
|
||||
} else if (((dev->flags & KBC_TYPE_MASK) >= KBC_TYPE_PS2_1) && ((dev->flags & KBC_TYPE_MASK) < KBC_TYPE_GREEN)) {
|
||||
/* (B0 or F0) | (0x08 or 0x0c) */
|
||||
kbc_delay_to_ob(dev, ((dev->p1 | fixed_bits) & 0xf0) | (((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0x08 : 0x0c), 0, 0x00);
|
||||
else if (kbc_ven == KBC_VEN_COMPAQ)
|
||||
uint8_t p1_out = ((dev->p1 | fixed_bits) & 0xf0) |
|
||||
(((dev->flags & KBC_VEN_MASK) == KBC_VEN_ACER) ? 0x08 : 0x0c);
|
||||
if (!strcmp(machine_get_internal_name(), "alfredo"))
|
||||
p1_out &= 0xef;
|
||||
kbc_delay_to_ob(dev, p1_out, 0, 0x00);
|
||||
} else if (kbc_ven == KBC_VEN_COMPAQ)
|
||||
kbc_delay_to_ob(dev, dev->p1 | (hasfpu ? 0x00 : 0x04), 0, 0x00);
|
||||
else
|
||||
/* (B0 or F0) | (0x04 or 0x44) */
|
||||
@@ -1578,8 +1599,13 @@ write64_phoenix(void *priv, uint8_t val)
|
||||
case 0xd5: /* Read MultiKey code revision level */
|
||||
kbc_at_log("ATkbc: Phoenix - Read MultiKey code revision level\n");
|
||||
if (dev->misc_flags & FLAG_PS2) {
|
||||
kbc_at_queue_add(dev, 0x04);
|
||||
kbc_at_queue_add(dev, 0x16);
|
||||
if (dev->flags & DEVICE_PCI) {
|
||||
kbc_at_queue_add(dev, 0x04);
|
||||
kbc_at_queue_add(dev, 0x16);
|
||||
} else {
|
||||
kbc_at_queue_add(dev, 0x01);
|
||||
kbc_at_queue_add(dev, 0x38);
|
||||
}
|
||||
} else {
|
||||
kbc_at_queue_add(dev, 0x01);
|
||||
kbc_at_queue_add(dev, 0x29);
|
||||
@@ -1598,9 +1624,15 @@ write64_phoenix(void *priv, uint8_t val)
|
||||
case 0xd7: /* Read MultiKey model numbers */
|
||||
kbc_at_log("ATkbc: Phoenix - Read MultiKey model numbers\n");
|
||||
if (dev->misc_flags & FLAG_PS2) {
|
||||
kbc_at_queue_add(dev, 0x02);
|
||||
kbc_at_queue_add(dev, 0x87);
|
||||
kbc_at_queue_add(dev, 0x02);
|
||||
if (dev->flags & DEVICE_PCI) {
|
||||
kbc_at_queue_add(dev, 0x02);
|
||||
kbc_at_queue_add(dev, 0x87);
|
||||
kbc_at_queue_add(dev, 0x02);
|
||||
} else {
|
||||
kbc_at_queue_add(dev, 0x99);
|
||||
kbc_at_queue_add(dev, 0x75);
|
||||
kbc_at_queue_add(dev, 0x01);
|
||||
}
|
||||
} else {
|
||||
kbc_at_queue_add(dev, 0x90);
|
||||
kbc_at_queue_add(dev, 0x88);
|
||||
@@ -2608,6 +2640,20 @@ const device_t keyboard_ps2_ami_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_compaq_device = {
|
||||
.name = "PS/2 Keyboard (Compaq)",
|
||||
.internal_name = "keyboard_at_compaq",
|
||||
.flags = DEVICE_KBC,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_COMPAQ,
|
||||
.init = kbc_at_init,
|
||||
.close = kbc_at_close,
|
||||
.reset = kbc_at_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_holtek_device = {
|
||||
.name = "PS/2 Keyboard (Holtek)",
|
||||
.internal_name = "keyboard_ps2_holtek",
|
||||
@@ -2775,3 +2821,17 @@ const device_t keyboard_ps2_acer_pci_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
const device_t keyboard_ps2_phoenix_pci_device = {
|
||||
.name = "PS/2 Keyboard (Phoenix)",
|
||||
.internal_name = "keyboard_ps2_phoenix_pci",
|
||||
.flags = DEVICE_KBC | DEVICE_PCI,
|
||||
.local = KBC_TYPE_PS2_1 | KBC_VEN_PHOENIX,
|
||||
.init = kbc_at_init,
|
||||
.close = kbc_at_close,
|
||||
.reset = kbc_at_reset,
|
||||
.available = NULL,
|
||||
.speed_changed = NULL,
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
@@ -36,14 +36,6 @@ uint16_t scancode_map[768] = { 0 };
|
||||
|
||||
int keyboard_scan;
|
||||
|
||||
/* F8+F12 */
|
||||
uint16_t key_prefix_1_1 = 0x042; /* F8 */
|
||||
uint16_t key_prefix_1_2 = 0x000; /* Invalid */
|
||||
uint16_t key_prefix_2_1 = 0x000; /* Invalid */
|
||||
uint16_t key_prefix_2_2 = 0x000; /* Invalid */
|
||||
uint16_t key_uncapture_1 = 0x058; /* F12 */
|
||||
uint16_t key_uncapture_2 = 0x000; /* Invalid */
|
||||
|
||||
#ifdef ENABLE_KBC_AT_LOG
|
||||
int kbc_at_do_log = ENABLE_KBC_AT_LOG;
|
||||
|
||||
@@ -484,19 +476,6 @@ keyboard_isfsexit_up(void)
|
||||
return (!recv_key_ui[0x01d] && !recv_key_ui[0x11d] && !recv_key_ui[0x038] && !recv_key_ui[0x138] && !recv_key_ui[0x051] && !recv_key_ui[0x151]);
|
||||
}
|
||||
|
||||
/* Do we have the mouse uncapture combination in the keyboard buffer? */
|
||||
int
|
||||
keyboard_ismsexit(void)
|
||||
{
|
||||
if ((key_prefix_2_1 != 0x000) || (key_prefix_2_2 != 0x000))
|
||||
return ((recv_key_ui[key_prefix_1_1] || recv_key_ui[key_prefix_1_2]) &&
|
||||
(recv_key_ui[key_prefix_2_1] || recv_key_ui[key_prefix_2_2]) &&
|
||||
(recv_key_ui[key_uncapture_1] || recv_key_ui[key_uncapture_2]));
|
||||
else
|
||||
return ((recv_key_ui[key_prefix_1_1] || recv_key_ui[key_prefix_1_2]) &&
|
||||
(recv_key_ui[key_uncapture_1] || recv_key_ui[key_uncapture_2]));
|
||||
}
|
||||
|
||||
/* This is so we can disambiguate scan codes that would otherwise conflict and get
|
||||
passed on incorrectly. */
|
||||
uint16_t
|
||||
|
||||
@@ -1312,7 +1312,6 @@ const device_t keyboard_xt_t1x00_device = {
|
||||
.config = NULL
|
||||
};
|
||||
|
||||
#ifdef USE_LASERXT
|
||||
const device_t keyboard_xt_lxt3_device = {
|
||||
.name = "VTech Laser Turbo XT Keyboard",
|
||||
.internal_name = "keyboard_xt_lxt",
|
||||
@@ -1326,7 +1325,6 @@ const device_t keyboard_xt_lxt3_device = {
|
||||
.force_redraw = NULL,
|
||||
.config = NULL
|
||||
};
|
||||
#endif /* USE_LASERXT */
|
||||
|
||||
const device_t keyboard_xt_olivetti_device = {
|
||||
.name = "Olivetti XT Keyboard",
|
||||
|
||||
@@ -83,23 +83,24 @@ static const device_t mouse_internal_device = {
|
||||
|
||||
static mouse_t mouse_devices[] = {
|
||||
// clang-format off
|
||||
{ &mouse_none_device },
|
||||
{ &mouse_internal_device },
|
||||
{ &mouse_logibus_device },
|
||||
{ &mouse_msinport_device },
|
||||
{ &mouse_none_device },
|
||||
{ &mouse_internal_device },
|
||||
{ &mouse_logibus_device },
|
||||
{ &mouse_msinport_device },
|
||||
#ifdef USE_GENIBUS
|
||||
{ &mouse_genibus_device },
|
||||
{ &mouse_genibus_device },
|
||||
#endif
|
||||
{ &mouse_mssystems_device },
|
||||
{ &mouse_msserial_device },
|
||||
{ &mouse_ltserial_device },
|
||||
{ &mouse_ps2_device },
|
||||
{ &mouse_mssystems_device },
|
||||
{ &mouse_mssystems_bus_device },
|
||||
{ &mouse_msserial_device },
|
||||
{ &mouse_ltserial_device },
|
||||
{ &mouse_ps2_device },
|
||||
#ifdef USE_WACOM
|
||||
{ &mouse_wacom_device },
|
||||
{ &mouse_wacom_artpad_device },
|
||||
{ &mouse_wacom_device },
|
||||
{ &mouse_wacom_artpad_device },
|
||||
#endif
|
||||
{ &mouse_mtouch_device },
|
||||
{ NULL }
|
||||
{ &mouse_mtouch_device },
|
||||
{ NULL }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
|
||||
@@ -146,7 +146,11 @@ sermouse_transmit_byte(mouse_t *dev, int do_next)
|
||||
serial_write_fifo(dev->serial, dev->buf[dev->buf_pos]);
|
||||
|
||||
if (do_next) {
|
||||
dev->buf_pos = (dev->buf_pos + 1) % dev->buf_len;
|
||||
/* If we have a buffer length of 0, pretend the state is STATE_SKIP_PACKET. */
|
||||
if (dev->buf_len == 0)
|
||||
dev->buf_pos = 0;
|
||||
else
|
||||
dev->buf_pos = (dev->buf_pos + 1) % dev->buf_len;
|
||||
|
||||
if (dev->buf_pos != 0)
|
||||
sermouse_set_period(dev, dev->transmit_period);
|
||||
@@ -747,7 +751,7 @@ sermouse_timer(void *priv)
|
||||
if (!dev->prompt && !dev->continuous)
|
||||
sermouse_transmit_report(dev, (dev->state == STATE_TRANSMIT_REPORT));
|
||||
else
|
||||
dev->state = STATE_IDLE;
|
||||
dev->state = STATE_IDLE;
|
||||
break;
|
||||
case STATE_TRANSMIT_REPORT:
|
||||
case STATE_TRANSMIT:
|
||||
@@ -829,10 +833,6 @@ sermouse_close(void *priv)
|
||||
{
|
||||
mouse_t *dev = (mouse_t *) priv;
|
||||
|
||||
/* Detach serial port from the mouse. */
|
||||
if (dev && dev->serial && dev->serial->sd)
|
||||
memset(dev->serial->sd, 0, sizeof(serial_device_t));
|
||||
|
||||
free(dev);
|
||||
}
|
||||
|
||||
@@ -843,7 +843,15 @@ 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;
|
||||
device_add_params(&ns16450_device, (void*)irqbase);
|
||||
}
|
||||
|
||||
dev = (mouse_t *) calloc(1, sizeof(mouse_t));
|
||||
dev->name = info->name;
|
||||
@@ -858,7 +866,7 @@ sermouse_init(const device_t *info)
|
||||
if (dev->but > 2)
|
||||
dev->flags |= FLAG_3BTN;
|
||||
|
||||
if (info->local == MOUSE_TYPE_MSYSTEMS) {
|
||||
if (info->local == MOUSE_TYPE_MSYSTEMS || info->local == MOUSE_TYPE_MSYSTEMSB) {
|
||||
dev->format = 0;
|
||||
dev->type = info->local;
|
||||
dev->id_len = 1;
|
||||
@@ -889,7 +897,7 @@ sermouse_init(const device_t *info)
|
||||
}
|
||||
}
|
||||
|
||||
dev->port = 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;
|
||||
@@ -964,6 +972,78 @@ static const device_config_t msssermouse_config[] = {
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t mssbusmouse_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
.name = "addr",
|
||||
.description = "Address",
|
||||
.type = CONFIG_HEX16,
|
||||
.default_string = NULL,
|
||||
.default_int = 0x238,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "0x338", .value = 0x338 },
|
||||
{ .description = "0x238", .value = 0x238 },
|
||||
{ .description = "0x3f8", .value = 0x3f8 },
|
||||
{ .description = "0x2f8", .value = 0x2f8 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
|
||||
{
|
||||
.name = "irq",
|
||||
.description = "IRQ",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 5,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "IRQ 2", .value = 2 },
|
||||
{ .description = "IRQ 3", .value = 3 },
|
||||
{ .description = "IRQ 4", .value = 4 },
|
||||
{ .description = "IRQ 5", .value = 5 },
|
||||
{ .description = "IRQ 7", .value = 7 },
|
||||
{ .description = "IRQ 10", .value = 10 },
|
||||
{ .description = "IRQ 11", .value = 11 },
|
||||
{ .description = "IRQ 12", .value = 12 },
|
||||
{ .description = "IRQ 15", .value = 15 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "buttons",
|
||||
.description = "Buttons",
|
||||
.type = CONFIG_SELECTION,
|
||||
.default_string = NULL,
|
||||
.default_int = 2,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = {
|
||||
{ .description = "Two", .value = 2 },
|
||||
{ .description = "Three", .value = 3 },
|
||||
{ .description = "" }
|
||||
},
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{
|
||||
.name = "rts_toggle",
|
||||
.description = "RTS toggle",
|
||||
.type = CONFIG_BINARY,
|
||||
.default_string = NULL,
|
||||
.default_int = 0,
|
||||
.file_filter = NULL,
|
||||
.spinner = { 0 },
|
||||
.selection = { { 0 } },
|
||||
.bios = { { 0 } }
|
||||
},
|
||||
{ .name = "", .description = "", .type = CONFIG_END }
|
||||
// clang-format on
|
||||
};
|
||||
|
||||
static const device_config_t mssermouse_config[] = {
|
||||
// clang-format off
|
||||
{
|
||||
@@ -1083,6 +1163,20 @@ const device_t mouse_mssystems_device = {
|
||||
.config = msssermouse_config
|
||||
};
|
||||
|
||||
const device_t mouse_mssystems_bus_device = {
|
||||
.name = "Mouse Systems Bus Mouse",
|
||||
.internal_name = "mssystems_bus",
|
||||
.flags = DEVICE_ISA,
|
||||
.local = MOUSE_TYPE_MSYSTEMSB,
|
||||
.init = sermouse_init,
|
||||
.close = sermouse_close,
|
||||
.reset = NULL,
|
||||
.available = NULL,
|
||||
.speed_changed = sermouse_speed_changed,
|
||||
.force_redraw = NULL,
|
||||
.config = mssbusmouse_config
|
||||
};
|
||||
|
||||
const device_t mouse_msserial_device = {
|
||||
.name = "Microsoft Serial Mouse",
|
||||
.internal_name = "msserial",
|
||||
|
||||
@@ -884,10 +884,10 @@ serial_close(void *priv)
|
||||
{
|
||||
serial_t *dev = (serial_t *) priv;
|
||||
|
||||
next_inst--;
|
||||
|
||||
if (com_ports[dev->inst].enabled)
|
||||
if (dev->sd) {
|
||||
memset(dev->sd, 0, sizeof(serial_device_t));
|
||||
fifo_close(dev->rcvr_fifo);
|
||||
}
|
||||
|
||||
free(dev);
|
||||
}
|
||||
@@ -897,7 +897,7 @@ serial_reset(void *priv)
|
||||
{
|
||||
serial_t *dev = (serial_t *) priv;
|
||||
|
||||
if (com_ports[dev->inst].enabled) {
|
||||
if (dev->sd) {
|
||||
timer_disable(&dev->transmit_timer);
|
||||
timer_disable(&dev->timeout_timer);
|
||||
timer_disable(&dev->receive_timer);
|
||||
@@ -930,16 +930,26 @@ static void *
|
||||
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 - 1;
|
||||
|
||||
dev->inst = next_inst;
|
||||
|
||||
if (com_ports[next_inst].enabled) {
|
||||
if (com_ports[next_inst].enabled || (info->local & 0xFFF00000)) {
|
||||
serial_log("Adding serial port %i...\n", next_inst);
|
||||
dev->type = info->local;
|
||||
memset(&(serial_devices[next_inst]), 0, sizeof(serial_device_t));
|
||||
dev->sd = &(serial_devices[next_inst]);
|
||||
dev->sd->serial = dev;
|
||||
if (next_inst == 6)
|
||||
|
||||
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)
|
||||
serial_setup(dev, COM7_ADDR, COM7_IRQ);
|
||||
else if (next_inst == 5)
|
||||
serial_setup(dev, COM6_ADDR, COM6_IRQ);
|
||||
@@ -984,7 +994,8 @@ serial_init(const device_t *info)
|
||||
serial_reset_port(dev);
|
||||
}
|
||||
|
||||
next_inst++;
|
||||
if (!(info->local & 0xfff00000))
|
||||
next_inst++;
|
||||
|
||||
return dev;
|
||||
}
|
||||
@@ -998,9 +1009,8 @@ serial_set_next_inst(int ni)
|
||||
void
|
||||
serial_standalone_init(void)
|
||||
{
|
||||
while (next_inst < SERIAL_MAX)
|
||||
device_add_inst(!strcmp(machine_get_internal_name(), "if386sx") ? &ns16450_device :
|
||||
&ns8250_device, next_inst + 1);
|
||||
while (next_inst < (SERIAL_MAX - 1))
|
||||
device_add_inst(&ns8250_device, next_inst + 1);
|
||||
};
|
||||
|
||||
const device_t ns8250_device = {
|
||||
|
||||
@@ -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