From 4fbb9ddc665db697b991c886a388d018d5df4c81 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 31 Jan 2022 04:36:39 -0500 Subject: [PATCH] A bit more preperation for serial devices --- src/device.c | 10 ++++++---- src/include/86box/device.h | 25 +++++++++++++------------ 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/src/device.c b/src/device.c index 7b9d4c167..9a05cce88 100644 --- a/src/device.c +++ b/src/device.c @@ -378,9 +378,7 @@ device_get_name(const device_t *d, int bus, char *name) name[0] = 0x00; if (bus) { - if (d->flags & DEVICE_LPT) - sbus = "LPT"; - else if (d->flags & DEVICE_ISA) + if (d->flags & DEVICE_ISA) sbus = (d->flags & DEVICE_AT) ? "ISA16" : "ISA"; else if (d->flags & DEVICE_CBUS) sbus = "C-BUS"; @@ -396,6 +394,10 @@ device_get_name(const device_t *d, int bus, char *name) sbus = "AGP"; else if (d->flags & DEVICE_AC97) sbus = "AMR"; + else if (d->flags & DEVICE_COM) + sbus = "COM"; + else if (d->flags & DEVICE_LPT) + sbus = "LPT"; if (sbus != NULL) { /* First concatenate [] before the device's name. */ @@ -406,7 +408,7 @@ device_get_name(const device_t *d, int bus, char *name) /* Then change string from ISA16 to ISA if applicable. */ if (!strcmp(sbus, "ISA16")) sbus = "ISA"; - else if (!strcmp(sbus, "LPT")) { + else if (!strcmp(sbus, "LPT")|| !strcmp(sbus, "COM")) { sbus = NULL; strcat(name, d->name); return; diff --git a/src/include/86box/device.h b/src/include/86box/device.h index 040dc3830..4771c87b7 100644 --- a/src/include/86box/device.h +++ b/src/include/86box/device.h @@ -55,18 +55,19 @@ enum { DEVICE_NOT_WORKING = 1, /* does not currently work correctly and will be disabled in a release build */ - DEVICE_LPT = 2, /* requires a parallel port */ - DEVICE_PCJR = 4, /* requires an IBM PCjr */ - DEVICE_AT = 8, /* requires an AT-compatible system */ - DEVICE_PS2 = 0x10, /* requires a PS/1 or PS/2 system */ - DEVICE_ISA = 0x20, /* requires the ISA bus */ - DEVICE_CBUS = 0x40, /* requires the C-BUS bus */ - DEVICE_MCA = 0x80, /* requires the MCA bus */ - DEVICE_EISA = 0x100, /* requires the EISA bus */ - DEVICE_VLB = 0x200, /* requires the PCI bus */ - DEVICE_PCI = 0x400, /* requires the VLB bus */ - DEVICE_AGP = 0x800, /* requires the AGP bus */ - DEVICE_AC97 = 0x1000 /* requires the AC'97 bus */ + DEVICE_PCJR = 2, /* requires an IBM PCjr */ + DEVICE_AT = 4, /* requires an AT-compatible system */ + DEVICE_PS2 = 8, /* requires a PS/1 or PS/2 system */ + DEVICE_ISA = 0x10, /* requires the ISA bus */ + DEVICE_CBUS = 0x20, /* requires the C-BUS bus */ + DEVICE_MCA = 0x40, /* requires the MCA bus */ + DEVICE_EISA = 0x80, /* requires the EISA bus */ + DEVICE_VLB = 0x100, /* requires the PCI bus */ + DEVICE_PCI = 0x200, /* requires the VLB bus */ + DEVICE_AGP = 0x400, /* requires the AGP bus */ + DEVICE_AC97 = 0x800, /* requires the AC'97 bus */ + DEVICE_COM = 0x1000 /* requires a serial port */ + DEVICE_LPT = 0x2000, /* requires a parallel port */ };