Consistency and naming

This commit is contained in:
Jasmine Iwanek
2021-12-19 21:21:34 -05:00
parent 948624b6f4
commit 149666b54b
5 changed files with 21 additions and 21 deletions

View File

@@ -129,7 +129,7 @@ serial_update_ints(serial_t *dev)
} }
if (stat && (dev->irq != 0xff) && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) { if (stat && (dev->irq != 0xff) && ((dev->mctrl & 8) || (dev->type == SERIAL_8250_PCJR))) {
if (dev->type >= SERIAL_NS16450) if (dev->type >= SERIAL_16450)
picintlevel(1 << dev->irq); picintlevel(1 << dev->irq);
else else
picint(1 << dev->irq); picint(1 << dev->irq);
@@ -151,9 +151,9 @@ serial_clear_timeout(serial_t *dev)
static void static void
write_fifo(serial_t *dev, uint8_t dat) write_fifo(serial_t *dev, uint8_t dat)
{ {
serial_log("write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_NS16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f); serial_log("write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled) { if ((dev->type >= SERIAL_16550) && dev->fifo_enabled) {
/* FIFO mode. */ /* FIFO mode. */
timer_disable(&dev->timeout_timer); timer_disable(&dev->timeout_timer);
/* Indicate overrun. */ /* Indicate overrun. */
@@ -189,7 +189,7 @@ write_fifo(serial_t *dev, uint8_t dat)
void void
serial_write_fifo(serial_t *dev, uint8_t dat) serial_write_fifo(serial_t *dev, uint8_t dat)
{ {
serial_log("serial_write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_NS16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f); serial_log("serial_write_fifo(%08X, %02X, %i, %i)\n", dev, dat, (dev->type >= SERIAL_16550) && dev->fifo_enabled, dev->rcvr_fifo_pos & 0x0f);
if (!(dev->mctrl & 0x10)) if (!(dev->mctrl & 0x10))
write_fifo(dev, dat); write_fifo(dev, dat);
@@ -371,7 +371,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
dev->int_status &= ~SERIAL_INT_TRANSMIT; dev->int_status &= ~SERIAL_INT_TRANSMIT;
serial_update_ints(dev); serial_update_ints(dev);
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled && (dev->xmit_fifo_pos < 16)) { if ((dev->type >= SERIAL_16550) && dev->fifo_enabled && (dev->xmit_fifo_pos < 16)) {
/* FIFO mode, begin transmitting. */ /* FIFO mode, begin transmitting. */
timer_on_auto(&dev->transmit_timer, dev->transmit_period); timer_on_auto(&dev->transmit_timer, dev->transmit_period);
dev->transmit_enabled |= 1; /* Start moving. */ dev->transmit_enabled |= 1; /* Start moving. */
@@ -396,7 +396,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
serial_update_ints(dev); serial_update_ints(dev);
break; break;
case 2: case 2:
if (dev->type >= SERIAL_NS16550) { if (dev->type >= SERIAL_16550) {
if ((val ^ dev->fcr) & 0x01) if ((val ^ dev->fcr) & 0x01)
serial_reset_fifo(dev); serial_reset_fifo(dev);
dev->fcr = val & 0xf9; dev->fcr = val & 0xf9;
@@ -500,7 +500,7 @@ serial_write(uint16_t addr, uint8_t val, void *p)
serial_update_ints(dev); serial_update_ints(dev);
break; break;
case 7: case 7:
if (dev->type >= SERIAL_NS16450) if (dev->type >= SERIAL_16450)
dev->scratch = val; dev->scratch = val;
break; break;
} }
@@ -522,7 +522,7 @@ serial_read(uint16_t addr, void *p)
break; break;
} }
if ((dev->type >= SERIAL_NS16550) && dev->fifo_enabled) { if ((dev->type >= SERIAL_16550) && dev->fifo_enabled) {
/* FIFO mode. */ /* FIFO mode. */
serial_clear_timeout(dev); serial_clear_timeout(dev);
@@ -722,8 +722,8 @@ serial_standalone_init(void) {
}; };
const device_t i8250_device = { const device_t ns8250_device = {
"Intel 8250(-compatible) UART", "National Semiconductor 8250(-compatible) UART",
0, 0,
SERIAL_8250, SERIAL_8250,
serial_init, serial_close, NULL, serial_init, serial_close, NULL,
@@ -732,7 +732,7 @@ const device_t i8250_device = {
}; };
const device_t i8250_pcjr_device = { const device_t i8250_pcjr_device = {
"Intel 8250(-compatible) UART for PCjr", "National Semiconductor 8250(-compatible) UART for PCjr",
DEVICE_PCJR, DEVICE_PCJR,
SERIAL_8250_PCJR, SERIAL_8250_PCJR,
serial_init, serial_close, NULL, serial_init, serial_close, NULL,
@@ -743,7 +743,7 @@ const device_t i8250_pcjr_device = {
const device_t ns16450_device = { const device_t ns16450_device = {
"National Semiconductor NS16450(-compatible) UART", "National Semiconductor NS16450(-compatible) UART",
0, 0,
SERIAL_NS16450, SERIAL_16450,
serial_init, serial_close, NULL, serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL, { NULL }, serial_speed_changed, NULL,
NULL NULL
@@ -752,7 +752,7 @@ const device_t ns16450_device = {
const device_t ns16550_device = { const device_t ns16550_device = {
"National Semiconductor NS16550(-compatible) UART", "National Semiconductor NS16550(-compatible) UART",
0, 0,
SERIAL_NS16550, SERIAL_16550,
serial_init, serial_close, NULL, serial_init, serial_close, NULL,
{ NULL }, serial_speed_changed, NULL, { NULL }, serial_speed_changed, NULL,
NULL NULL

View File

@@ -23,10 +23,10 @@
# define EMU_SERIAL_H # define EMU_SERIAL_H
#define SERIAL_8250 0 #define SERIAL_8250 0
#define SERIAL_8250_PCJR 1 #define SERIAL_8250_PCJR 1
#define SERIAL_NS16450 2 #define SERIAL_16450 2
#define SERIAL_NS16550 3 #define SERIAL_16550 3
#define SERIAL_16650 4 #define SERIAL_16650 4
#define SERIAL_16750 5 #define SERIAL_16750 5
#define SERIAL_16850 6 #define SERIAL_16850 6
@@ -92,8 +92,8 @@ extern void serial_standalone_init(void);
extern void serial_set_clock_src(serial_t *dev, double clock_src); extern void serial_set_clock_src(serial_t *dev, double clock_src);
extern void serial_reset_port(serial_t *dev); extern void serial_reset_port(serial_t *dev);
extern const device_t i8250_device; extern const device_t ns8250_device;
extern const device_t i8250_pcjr_device; extern const device_t ns8250_pcjr_device;
extern const device_t ns16450_device; extern const device_t ns16450_device;
extern const device_t ns16550_device; extern const device_t ns16550_device;
extern const device_t ns16650_device; extern const device_t ns16650_device;

View File

@@ -112,7 +112,7 @@ machine_at_cmdpc_init(const machine_t *model)
if (fdc_type == FDC_INTERNAL) if (fdc_type == FDC_INTERNAL)
device_add(&fdc_at_device); device_add(&fdc_at_device);
cmd_uart = device_add(&i8250_device); cmd_uart = device_add(&ns8250_device);
cbm_io_init(); cbm_io_init();

View File

@@ -866,7 +866,7 @@ machine_pcjr_init(const machine_t *model)
device_add(&fdc_pcjr_device); device_add(&fdc_pcjr_device);
device_add(&i8250_pcjr_device); device_add(&ns8250_pcjr_device);
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */ serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
return ret; return ret;

View File

@@ -153,7 +153,7 @@ machine_xt_z184_init(const machine_t *model)
lpt1_remove(); /* only one parallel port */ lpt1_remove(); /* only one parallel port */
lpt2_remove(); lpt2_remove();
lpt1_init(0x278); lpt1_init(0x278);
device_add(&i8250_device); device_add(&ns8250_device);
serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */ serial_set_next_inst(SERIAL_MAX); /* So that serial_standalone_init() won't do anything. */
device_add(&cga_device); device_add(&cga_device);