diff options
author | 2014-04-16 07:53:39 +0000 | |
---|---|---|
committer | 2014-04-16 07:53:39 +0000 | |
commit | 72d93bb509f7ba670c27850f58fe10ce09844a93 (patch) | |
tree | 37a23297e60928c97d312f4fedc800582b5cb98f | |
parent | 0bd507725175d4694f4e201ebf573e6f28703aae (diff) |
Added serial printer, renamed centronics printer to match. Standardised the configuration of rs232 devices. All serial devices are now connected using an rs232 port. [smf]
135 files changed, 957 insertions, 1410 deletions
diff --git a/.gitattributes b/.gitattributes index d33b4f5d264..fe441cd07df 100644 --- a/.gitattributes +++ b/.gitattributes @@ -697,8 +697,8 @@ src/emu/bus/centronics/ctronics.c svneol=native#text/plain src/emu/bus/centronics/ctronics.h svneol=native#text/plain src/emu/bus/centronics/dsjoy.c svneol=native#text/plain src/emu/bus/centronics/dsjoy.h svneol=native#text/plain -src/emu/bus/centronics/image.c svneol=native#text/plain -src/emu/bus/centronics/image.h svneol=native#text/plain +src/emu/bus/centronics/printer.c svneol=native#text/plain +src/emu/bus/centronics/printer.h svneol=native#text/plain src/emu/bus/coco/coco_232.c svneol=native#text/plain src/emu/bus/coco/coco_232.h svneol=native#text/plain src/emu/bus/coco/coco_fdc.c svneol=native#text/plain @@ -1172,6 +1172,8 @@ src/emu/bus/rs232/loopback.c svneol=native#text/plain src/emu/bus/rs232/loopback.h svneol=native#text/plain src/emu/bus/rs232/null_modem.c svneol=native#text/plain src/emu/bus/rs232/null_modem.h svneol=native#text/plain +src/emu/bus/rs232/printer.c svneol=native#text/plain +src/emu/bus/rs232/printer.h svneol=native#text/plain src/emu/bus/rs232/rs232.c svneol=native#text/plain src/emu/bus/rs232/rs232.h svneol=native#text/plain src/emu/bus/rs232/ser_mouse.c svneol=native#text/plain @@ -3077,8 +3079,6 @@ src/emu/timer.c svneol=native#text/plain src/emu/timer.h svneol=native#text/plain src/emu/ui/barcode.c svneol=native#text/plain src/emu/ui/barcode.h svneol=native#text/plain -src/emu/ui/bbcontrl.c svneol=native#text/plain -src/emu/ui/bbcontrl.h svneol=native#text/plain src/emu/ui/devctrl.h svneol=native#text/plain src/emu/ui/emenubar.c svneol=native#text/plain src/emu/ui/emenubar.h svneol=native#text/plain diff --git a/src/emu/bus/a2bus/a2pic.c b/src/emu/bus/a2bus/a2pic.c index 73d87d0b84b..f22f89177c5 100644 --- a/src/emu/bus/a2bus/a2pic.c +++ b/src/emu/bus/a2bus/a2pic.c @@ -22,7 +22,7 @@ const device_type A2BUS_PIC = &device_creator<a2bus_pic_device>; #define PIC_CENTRONICS_TAG "pic_ctx" MACHINE_CONFIG_FRAGMENT( pic ) - MCFG_CENTRONICS_ADD(PIC_CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(PIC_CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("ctx_data_in") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(a2bus_pic_device, ack_w)) diff --git a/src/emu/bus/a2bus/a2pic.h b/src/emu/bus/a2bus/a2pic.h index 291452404be..b8813a55ce9 100644 --- a/src/emu/bus/a2bus/a2pic.h +++ b/src/emu/bus/a2bus/a2pic.h @@ -11,7 +11,6 @@ #include "a2bus.h" #include "bus/centronics/ctronics.h" -#include "bus/centronics/image.h" //************************************************************************** // TYPE DEFINITIONS diff --git a/src/emu/bus/adam/ide.c b/src/emu/bus/adam/ide.c index 5c24aaa9c8a..8b8772b3292 100644 --- a/src/emu/bus/adam/ide.c +++ b/src/emu/bus/adam/ide.c @@ -65,7 +65,7 @@ const rom_entry *powermate_ide_device::device_rom_region() const //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( adam_ata ) MCFG_ATA_INTERFACE_ADD(ATA_TAG, ata_devices, "hdd", NULL, false) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) MACHINE_CONFIG_END diff --git a/src/emu/bus/adamnet/spi.c b/src/emu/bus/adamnet/spi.c index b7248b4a0c9..f45abbe2672 100644 --- a/src/emu/bus/adamnet/spi.c +++ b/src/emu/bus/adamnet/spi.c @@ -85,7 +85,7 @@ static MACHINE_CONFIG_FRAGMENT( adam_spi ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_DEVICE_ADD("cent_data_in", INPUT_BUFFER, 0) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/emu/bus/bus.mak b/src/emu/bus/bus.mak index c3c6cea78aa..e40b5e57890 100644 --- a/src/emu/bus/bus.mak +++ b/src/emu/bus/bus.mak @@ -693,7 +693,7 @@ BUSOBJS += $(BUSOBJ)/centronics/ctronics.o BUSOBJS += $(BUSOBJ)/centronics/comxpl80.o BUSOBJS += $(BUSOBJ)/centronics/covox.o BUSOBJS += $(BUSOBJ)/centronics/dsjoy.o -BUSOBJS += $(BUSOBJ)/centronics/image.o +BUSOBJS += $(BUSOBJ)/centronics/printer.o endif #------------------------------------------------- @@ -706,6 +706,7 @@ OBJDIRS += $(BUSOBJ)/rs232 BUSOBJS += $(BUSOBJ)/rs232/keyboard.o BUSOBJS += $(BUSOBJ)/rs232/loopback.o BUSOBJS += $(BUSOBJ)/rs232/null_modem.o +BUSOBJS += $(BUSOBJ)/rs232/printer.o BUSOBJS += $(BUSOBJ)/rs232/rs232.o BUSOBJS += $(BUSOBJ)/rs232/ser_mouse.o BUSOBJS += $(BUSOBJ)/rs232/terminal.o diff --git a/src/emu/bus/c64/geocable.c b/src/emu/bus/c64/geocable.c index f583a43c8ae..3f7b9f0f719 100644 --- a/src/emu/bus/c64/geocable.c +++ b/src/emu/bus/c64/geocable.c @@ -33,7 +33,7 @@ const device_type C64_GEOCABLE = &device_creator<c64_geocable_device>; //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( c64_geocable ) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(c64_geocable_device, output_b)) MACHINE_CONFIG_END diff --git a/src/emu/bus/cbmiec/c1541.c b/src/emu/bus/cbmiec/c1541.c index f0f8277861f..7f00594f35c 100644 --- a/src/emu/bus/cbmiec/c1541.c +++ b/src/emu/bus/cbmiec/c1541.c @@ -887,7 +887,7 @@ static MACHINE_CONFIG_FRAGMENT( c1541pdc ) MCFG_PIA_WRITEPB_HANDLER(WRITE8(c1541_prologic_dos_classic_device, pia_pb_w)) MCFG_PIA_CA2_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_strobe)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(MC6821_TAG, pia6821_device, ca1_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") MACHINE_CONFIG_END diff --git a/src/emu/bus/centronics/ctronics.c b/src/emu/bus/centronics/ctronics.c index c60de320a90..d1e4e38fc7a 100644 --- a/src/emu/bus/centronics/ctronics.c +++ b/src/emu/bus/centronics/ctronics.c @@ -116,8 +116,8 @@ device_centronics_peripheral_interface::~device_centronics_peripheral_interface( } -#include "image.h" +#include "printer.h" SLOT_INTERFACE_START(centronics_printers) - SLOT_INTERFACE("image", CENTRONICS_PRINTER_IMAGE) + SLOT_INTERFACE("printer", CENTRONICS_PRINTER) SLOT_INTERFACE_END diff --git a/src/emu/bus/centronics/image.c b/src/emu/bus/centronics/printer.c index 10fe3306fe6..27b8f6f413a 100644 --- a/src/emu/bus/centronics/image.c +++ b/src/emu/bus/centronics/printer.c @@ -1,17 +1,17 @@ #include "emu.h" -#include "image.h" +#include "printer.h" //************************************************************************** // CENTRONICS PRINTER DEVICE //************************************************************************** // device type definition -const device_type CENTRONICS_PRINTER_IMAGE = &device_creator<centronics_printer_image_device>; +const device_type CENTRONICS_PRINTER = &device_creator<centronics_printer_device>; static MACHINE_CONFIG_FRAGMENT( centronics_printer ) MCFG_DEVICE_ADD("printer", PRINTER, 0) - MCFG_PRINTER_ONLINE_CB(WRITELINE(centronics_printer_image_device, printer_online)) + MCFG_PRINTER_ONLINE_CB(WRITELINE(centronics_printer_device, printer_online)) MACHINE_CONFIG_END @@ -19,12 +19,13 @@ MACHINE_CONFIG_END IMPLEMENTATION ***************************************************************************/ //------------------------------------------------- -// centronics_printer_image_device - constructor +// centronics_printer_device - constructor //------------------------------------------------- -centronics_printer_image_device::centronics_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, CENTRONICS_PRINTER_IMAGE, "Centronics Printer", tag, owner, clock, "centronics_printer", __FILE__), - device_centronics_peripheral_interface( mconfig, *this ) +centronics_printer_device::centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, CENTRONICS_PRINTER, "Centronics Printer", tag, owner, clock, "centronics_printer", __FILE__), + device_centronics_peripheral_interface( mconfig, *this ), + m_printer(*this, "printer") { } //------------------------------------------------- @@ -32,7 +33,7 @@ centronics_printer_image_device::centronics_printer_image_device(const machine_c // machine configurations //------------------------------------------------- -machine_config_constructor centronics_printer_image_device::device_mconfig_additions() const +machine_config_constructor centronics_printer_device::device_mconfig_additions() const { return MACHINE_CONFIG_NAME( centronics_printer ); } @@ -42,12 +43,12 @@ machine_config_constructor centronics_printer_image_device::device_mconfig_addit sets us busy when the printer goes offline -------------------------------------------------*/ -WRITE_LINE_MEMBER(centronics_printer_image_device::printer_online) +WRITE_LINE_MEMBER(centronics_printer_device::printer_online) { output_perror(!state); } -void centronics_printer_image_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +void centronics_printer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) { switch (id) { @@ -81,20 +82,15 @@ void centronics_printer_image_device::device_timer(emu_timer &timer, device_time } } -void centronics_printer_image_device::device_start() +void centronics_printer_device::device_start() { - m_owner = dynamic_cast<centronics_device *>(owner()); - - /* get printer device */ - m_printer = subdevice<printer_image_device>("printer"); - /* register for state saving */ save_item(NAME(m_strobe)); save_item(NAME(m_data)); save_item(NAME(m_busy)); } -void centronics_printer_image_device::device_reset() +void centronics_printer_device::device_reset() { m_busy = FALSE; output_busy(m_busy); @@ -107,7 +103,7 @@ void centronics_printer_image_device::device_reset() ready -------------------------------------------------*/ -WRITE_LINE_MEMBER( centronics_printer_image_device::input_strobe ) +WRITE_LINE_MEMBER( centronics_printer_device::input_strobe ) { /* look for a high -> low transition */ if (m_strobe == TRUE && state == FALSE && m_busy == FALSE) @@ -125,7 +121,7 @@ WRITE_LINE_MEMBER( centronics_printer_image_device::input_strobe ) printer (centronics mode) -------------------------------------------------*/ -WRITE_LINE_MEMBER(centronics_printer_image_device::input_init) +WRITE_LINE_MEMBER(centronics_printer_device::input_init) { /* reset printer if line is low */ if (state == FALSE) diff --git a/src/emu/bus/centronics/image.h b/src/emu/bus/centronics/printer.h index 0c6ab85abec..4b0ae50cd1e 100644 --- a/src/emu/bus/centronics/image.h +++ b/src/emu/bus/centronics/printer.h @@ -6,17 +6,14 @@ #include "ctronics.h" #include "imagedev/printer.h" -// ======================> centronics_printer_image_device +// ======================> centronics_printer_device -class centronics_printer_image_device : public device_t, +class centronics_printer_device : public device_t, public device_centronics_peripheral_interface { public: // construction/destruction - centronics_printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - - // optional information overrides - virtual machine_config_constructor device_mconfig_additions() const; + centronics_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual DECLARE_WRITE_LINE_MEMBER( input_strobe ); virtual DECLARE_WRITE_LINE_MEMBER( input_data0 ) { if (state) m_data |= 0x01; else m_data &= ~0x01; } @@ -33,6 +30,7 @@ public: protected: // device-level overrides + virtual machine_config_constructor device_mconfig_additions() const; virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); @@ -49,10 +47,10 @@ private: UINT8 m_data; int m_busy; - printer_image_device *m_printer; + required_device<printer_image_device> m_printer; }; // device type definition -extern const device_type CENTRONICS_PRINTER_IMAGE; +extern const device_type CENTRONICS_PRINTER; #endif diff --git a/src/emu/bus/comx35/printer.c b/src/emu/bus/comx35/printer.c index 568a534324b..82bbe30fe44 100644 --- a/src/emu/bus/comx35/printer.c +++ b/src/emu/bus/comx35/printer.c @@ -10,7 +10,7 @@ **********************************************************************/ #include "printer.h" -#include "bus/centronics/image.h" +#include "bus/centronics/printer.h" @@ -58,7 +58,7 @@ const rom_entry *comx_prn_device::device_rom_region() const //------------------------------------------------- SLOT_INTERFACE_START(comx_centronics_printer) - SLOT_INTERFACE("image", CENTRONICS_PRINTER_IMAGE) + SLOT_INTERFACE("printer", CENTRONICS_PRINTER) //SLOT_INTERFACE("pl80", COMX_PL80) SLOT_INTERFACE_END @@ -68,7 +68,7 @@ SLOT_INTERFACE_END //------------------------------------------------- static MACHINE_CONFIG_FRAGMENT( comx_prn ) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, comx_centronics_printer, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, comx_centronics_printer, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit0)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1)) MCFG_CENTRONICS_PERROR_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit2)) diff --git a/src/emu/bus/ecbbus/grip.c b/src/emu/bus/ecbbus/grip.c index ca1697f43bd..38462cabdaf 100644 --- a/src/emu/bus/ecbbus/grip.c +++ b/src/emu/bus/ecbbus/grip.c @@ -558,7 +558,7 @@ static MACHINE_CONFIG_FRAGMENT( grip ) MCFG_I8255A_ADD(I8255A_TAG, ppi_intf) MCFG_Z80STI_ADD(Z80STI_TAG, XTAL_16MHz/4, sti_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(grip_device, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(grip_device, write_centronics_fault)) diff --git a/src/emu/bus/econet/e01.c b/src/emu/bus/econet/e01.c index be0b9ae7c32..b051537c025 100644 --- a/src/emu/bus/econet/e01.c +++ b/src/emu/bus/econet/e01.c @@ -272,7 +272,7 @@ static MACHINE_CONFIG_FRAGMENT( e01 ) MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":0", e01_floppies, "35dd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD2793_TAG":1", e01_floppies, "35dd", floppy_image_device::default_floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_ca1)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/emu/bus/ieee488/softbox.c b/src/emu/bus/ieee488/softbox.c index 1fec2c0cca7..1842cc14910 100644 --- a/src/emu/bus/ieee488/softbox.c +++ b/src/emu/bus/ieee488/softbox.c @@ -240,12 +240,12 @@ static I8255A_INTERFACE( ppi1_intf ) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -268,7 +268,7 @@ static MACHINE_CONFIG_FRAGMENT( softbox ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_I8255A_ADD(I8255_0_TAG, ppi0_intf) MCFG_I8255A_ADD(I8255_1_TAG, ppi1_intf) diff --git a/src/emu/bus/isa/com.c b/src/emu/bus/isa/com.c index c4b1d292d28..1b494cc97bf 100644 --- a/src/emu/bus/isa/com.c +++ b/src/emu/bus/isa/com.c @@ -50,7 +50,7 @@ static const ins8250_interface genpc_com_interface[2]= static SLOT_INTERFACE_START(isa_com) SLOT_INTERFACE("microsoft_mouse", MSFT_SERIAL_MOUSE) SLOT_INTERFACE("msystems_mouse", MSYSTEM_SERIAL_MOUSE) - SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL) + SLOT_INTERFACE("terminal", SERIAL_TERMINAL) SLOT_INTERFACE("null_modem", NULL_MODEM) SLOT_INTERFACE_END diff --git a/src/emu/bus/isa/lpt.c b/src/emu/bus/isa/lpt.c index 6dc19606a49..50388be4f58 100644 --- a/src/emu/bus/isa/lpt.c +++ b/src/emu/bus/isa/lpt.c @@ -8,7 +8,7 @@ #include "lpt.h" #include "machine/pc_lpt.h" #include "bus/centronics/covox.h" -#include "bus/centronics/image.h" +#include "bus/centronics/printer.h" const device_type ISA8_LPT = &device_creator<isa8_lpt_device>; diff --git a/src/emu/bus/rs232/keyboard.c b/src/emu/bus/rs232/keyboard.c index 3437344a7de..41f725a51a9 100644 --- a/src/emu/bus/rs232/keyboard.c +++ b/src/emu/bus/rs232/keyboard.c @@ -1,82 +1,14 @@ -/*************************************************************************** -Generic ASCII Serial Keyboard - -Use MCFG_SERIAL_KEYBOARD_ADD to attach this as a serial device to a terminal -or computer. - - -Example of usage in a driver. - -In MACHINE_CONFIG - MCFG_SERIAL_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf, 0) -or - MCFG_SERIAL_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf, initial_baud_rate) - - -In the code: - -WRITE8_MEMBER( xxx_state::kbd_put ) -{ - (code to capture the key as it is pressed) -} - -static ASCII_KEYBOARD_INTERFACE( keyboard_intf ) -{ - DEVCB_DRIVER_MEMBER(xxx_state, kbd_put) -}; - -If a baud_rate is specified, it will be the initial baud rate, with -8 bits, no parity, 1 stop bit. However you can override this with the -config switches. (Note that the config switch will specify 9600 initially, -even though it isn't). - -If a baud_rate is not specified, the rate will be solely determined -by the config switches. (Default 9600 baud) - - -***************************************************************************/ - #include "keyboard.h" -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -static INPUT_PORTS_START(serial_keyboard) - PORT_INCLUDE(generic_keyboard) - PORT_START("TERM_FRAME") - PORT_CONFNAME(0x0f, 0x06, "Baud") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x0d, "110") - PORT_CONFSETTING( 0x00, "150") - PORT_CONFSETTING( 0x01, "300") - PORT_CONFSETTING( 0x02, "600") - PORT_CONFSETTING( 0x03, "1200") - PORT_CONFSETTING( 0x04, "2400") - PORT_CONFSETTING( 0x05, "4800") - PORT_CONFSETTING( 0x06, "9600") - PORT_CONFSETTING( 0x07, "14400") - PORT_CONFSETTING( 0x08, "19200") - PORT_CONFSETTING( 0x09, "28800") - PORT_CONFSETTING( 0x0a, "38400") - PORT_CONFSETTING( 0x0b, "57600") - PORT_CONFSETTING( 0x0c, "115200") - PORT_CONFNAME(0x30, 0x00, "Format") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x00, "8N1") - PORT_CONFSETTING( 0x10, "7E1") - PORT_CONFSETTING( 0x20, "8N2") - PORT_CONFSETTING( 0x30, "8E1") -INPUT_PORTS_END - -ioport_constructor serial_keyboard_device::device_input_ports() const -{ - return INPUT_PORTS_NAME(serial_keyboard); -} - serial_keyboard_device::serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : generic_keyboard_device(mconfig, SERIAL_KEYBOARD, "Serial Keyboard", tag, owner, clock, "serial_keyboard", __FILE__), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), - m_io_term_frame(*this, "TERM_FRAME") + m_rs232_txbaud(*this, "RS232_TXBAUD"), + m_rs232_startbits(*this, "RS232_STARTBITS"), + m_rs232_databits(*this, "RS232_DATABITS"), + m_rs232_parity(*this, "RS232_PARITY"), + m_rs232_stopbits(*this, "RS232_STOPBITS") { } @@ -84,75 +16,60 @@ serial_keyboard_device::serial_keyboard_device(const machine_config &mconfig, de : generic_keyboard_device(mconfig, type, name, tag, owner, clock, shortname, source), device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), - m_io_term_frame(*this, "TERM_FRAME") + m_rs232_txbaud(*this, "RS232_TXBAUD"), + m_rs232_startbits(*this, "RS232_STARTBITS"), + m_rs232_databits(*this, "RS232_DATABITS"), + m_rs232_parity(*this, "RS232_PARITY"), + m_rs232_stopbits(*this, "RS232_STOPBITS") { } -void serial_keyboard_device::device_config_complete() +static INPUT_PORTS_START(serial_keyboard) + PORT_INCLUDE(generic_keyboard) + + MCFG_RS232_BAUD("RS232_TXBAUD", RS232_BAUD_9600, "TX Baud", serial_keyboard_device, update_serial) + MCFG_RS232_STARTBITS("RS232_STARTBITS", RS232_STARTBITS_1, "Start Bits", serial_keyboard_device, update_serial) + MCFG_RS232_DATABITS("RS232_DATABITS", RS232_DATABITS_8, "Data Bits", serial_keyboard_device, update_serial) + MCFG_RS232_PARITY("RS232_PARITY", RS232_PARITY_NONE, "Parity", serial_keyboard_device, update_serial) + MCFG_RS232_STOPBITS("RS232_STOPBITS", RS232_STOPBITS_1, "Stop Bits", serial_keyboard_device, update_serial) +INPUT_PORTS_END + +ioport_constructor serial_keyboard_device::device_input_ports() const { - const serial_keyboard_interface *intf = reinterpret_cast<const serial_keyboard_interface *>(static_config()); - if(intf != NULL) - { - *static_cast<serial_keyboard_interface *>(this) = *intf; - } - else - { - memset(&m_out_tx_cb, 0, sizeof(m_out_tx_cb)); - } + return INPUT_PORTS_NAME(serial_keyboard); } -static int rates[] = {150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200, 110}; - void serial_keyboard_device::device_start() { - m_baud = clock(); - m_out_tx_func.resolve(m_out_tx_cb, *this); + /// HACK: the base class resolves a handler in device_start() m_timer = timer_alloc(); - - if (m_baud) - { - set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); - set_tra_rate(m_baud); - } } -INPUT_CHANGED_MEMBER(serial_keyboard_device::update_frame) +WRITE_LINE_MEMBER(serial_keyboard_device::update_serial) { - m_baud = 0; reset(); } void serial_keyboard_device::device_reset() { generic_keyboard_device::device_reset(); - m_rbit = 1; - if (m_port) - output_rxd(m_rbit); - else - m_out_tx_func(m_rbit); - if (m_baud == 0) - { - UINT8 val = m_io_term_frame->read(); - set_tra_rate(rates[val & 0x0f]); - - switch(val & 0x30) - { - case 0x10: - set_data_frame(1, 7, PARITY_EVEN, STOP_BITS_1); - break; - case 0x00: - default: - set_data_frame(1, 8, PARITY_NONE, STOP_BITS_1); - break; - case 0x20: - set_data_frame(1, 8, PARITY_NONE, STOP_BITS_2); - break; - case 0x30: - set_data_frame(1, 8, PARITY_EVEN, STOP_BITS_1); - break; - } - } + int startbits = convert_startbits(m_rs232_startbits->read()); + int databits = convert_databits(m_rs232_databits->read()); + parity_t parity = convert_parity(m_rs232_parity->read()); + stop_bits_t stopbits = convert_stopbits(m_rs232_stopbits->read()); + + set_data_frame(startbits, databits, parity, stopbits); + + int txbaud = convert_baud(m_rs232_txbaud->read()); + set_tra_rate(txbaud); + + output_rxd(1); + + // TODO: make this configurable + output_dcd(0); + output_dsr(0); + output_cts(0); } void serial_keyboard_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) @@ -176,11 +93,7 @@ void serial_keyboard_device::send_key(UINT8 code) void serial_keyboard_device::tra_callback() { - m_rbit = transmit_register_get_data_bit(); - if(m_port) - output_rxd(m_rbit); - else - m_out_tx_func(m_rbit); + output_rxd(transmit_register_get_data_bit()); } void serial_keyboard_device::tra_complete() @@ -192,9 +105,4 @@ void serial_keyboard_device::tra_complete() } } -READ_LINE_MEMBER(serial_keyboard_device::tx_r) -{ - return m_rbit; -} - const device_type SERIAL_KEYBOARD = &device_creator<serial_keyboard_device>; diff --git a/src/emu/bus/rs232/keyboard.h b/src/emu/bus/rs232/keyboard.h index 65d83670453..9923d04d160 100644 --- a/src/emu/bus/rs232/keyboard.h +++ b/src/emu/bus/rs232/keyboard.h @@ -1,35 +1,15 @@ #ifndef __RS232_KEYBOARD_H__ #define __RS232_KEYBOARD_H__ +#pragma once + #include "rs232.h" #include "machine/keyboard.h" -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -struct serial_keyboard_interface -{ - devcb_write_line m_out_tx_cb; -}; - -/*************************************************************************** - DEVICE CONFIGURATION MACROS -***************************************************************************/ - -#define MCFG_SERIAL_KEYBOARD_ADD(_tag, _intrf, _clock) \ - MCFG_DEVICE_ADD(_tag, SERIAL_KEYBOARD, _clock) \ - MCFG_DEVICE_CONFIG(_intrf) - -/*************************************************************************** - FUNCTION PROTOTYPES -***************************************************************************/ - class serial_keyboard_device : public generic_keyboard_device, public device_serial_interface, - public device_rs232_port_interface, - public serial_keyboard_interface + public device_rs232_port_interface { public: serial_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); @@ -40,23 +20,25 @@ public: virtual ioport_constructor device_input_ports() const; - DECLARE_INPUT_CHANGED_MEMBER(update_frame); + DECLARE_WRITE_LINE_MEMBER(update_serial); protected: virtual void device_start(); - virtual void device_config_complete(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); virtual void tra_callback(); virtual void tra_complete(); virtual void send_key(UINT8 code); + private: - int m_rbit; - int m_baud; UINT8 m_curr_key; bool m_key_valid; - devcb_resolved_write_line m_out_tx_func; - required_ioport m_io_term_frame; + + required_ioport m_rs232_txbaud; + required_ioport m_rs232_startbits; + required_ioport m_rs232_databits; + required_ioport m_rs232_parity; + required_ioport m_rs232_stopbits; }; extern const device_type SERIAL_KEYBOARD; diff --git a/src/emu/bus/rs232/loopback.h b/src/emu/bus/rs232/loopback.h index c7eaf22b994..a5d131ee981 100644 --- a/src/emu/bus/rs232/loopback.h +++ b/src/emu/bus/rs232/loopback.h @@ -4,7 +4,7 @@ #ifndef RS232_LOOPBACK_H_ #define RS232_LOOPBACK_H_ -#include "bus/rs232/rs232.h" +#include "rs232.h" class rs232_loopback_device : public device_t, public device_rs232_port_interface diff --git a/src/emu/bus/rs232/null_modem.c b/src/emu/bus/rs232/null_modem.c index ed67584a106..ea8dfb1c79f 100644 --- a/src/emu/bus/rs232/null_modem.c +++ b/src/emu/bus/rs232/null_modem.c @@ -1,23 +1,129 @@ #include "null_modem.h" -const device_type NULL_MODEM = &device_creator<null_modem_device>; - null_modem_device::null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : device_t(mconfig, NULL_MODEM, "Null Modem", tag, owner, clock, "null_modem", __FILE__), + device_serial_interface(mconfig, *this), device_rs232_port_interface(mconfig, *this), - m_bitbanger(*this, "bitbanger") + m_stream(*this, "stream"), + m_rs232_txbaud(*this, "RS232_TXBAUD"), + m_rs232_rxbaud(*this, "RS232_RXBAUD"), + m_rs232_startbits(*this, "RS232_STARTBITS"), + m_rs232_databits(*this, "RS232_DATABITS"), + m_rs232_parity(*this, "RS232_PARITY"), + m_rs232_stopbits(*this, "RS232_STOPBITS"), + m_input_count(0), + m_input_index(0) { } -static MACHINE_CONFIG_FRAGMENT(null_modem_config) - MCFG_DEVICE_ADD("bitbanger", BITBANGER, 0) - MCFG_BITBANGER_INPUT_CB(WRITELINE(null_modem_device, read)) /* callback */ - MCFG_BITBANGER_DEFAULT_MODE(BITBANGER_MODEM) /* default mode */ - MCFG_BITBANGER_DEFAULT_BAUD(BITBANGER_9600) /* default output baud */ - MCFG_BITBANGER_DEFAULT_TUNE(BITBANGER_0PERCENT) /* default fine tune adjustment */ +static MACHINE_CONFIG_FRAGMENT(null_modem) + MCFG_DEVICE_ADD("stream", BITBANGER, 0) MACHINE_CONFIG_END machine_config_constructor null_modem_device::device_mconfig_additions() const { - return MACHINE_CONFIG_NAME(null_modem_config); + return MACHINE_CONFIG_NAME(null_modem); +} + +static INPUT_PORTS_START(null_modem) + MCFG_RS232_BAUD("RS232_TXBAUD", RS232_BAUD_9600, "TX Baud", null_modem_device, update_serial) + MCFG_RS232_BAUD("RS232_RXBAUD", RS232_BAUD_9600, "RX Baud", null_modem_device, update_serial) + MCFG_RS232_STARTBITS("RS232_STARTBITS", RS232_STARTBITS_1, "Start Bits", null_modem_device, update_serial) + MCFG_RS232_DATABITS("RS232_DATABITS", RS232_DATABITS_8, "Data Bits", null_modem_device, update_serial) + MCFG_RS232_PARITY("RS232_PARITY", RS232_PARITY_NONE, "Parity", null_modem_device, update_serial) + MCFG_RS232_STOPBITS("RS232_STOPBITS", RS232_STOPBITS_1, "Stop Bits", null_modem_device, update_serial) +INPUT_PORTS_END + +ioport_constructor null_modem_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(null_modem); +} + +void null_modem_device::device_start() +{ + m_timer_poll = timer_alloc(TIMER_POLL); +} + +WRITE_LINE_MEMBER(null_modem_device::update_serial) +{ + int startbits = convert_startbits(m_rs232_startbits->read()); + int databits = convert_databits(m_rs232_databits->read()); + parity_t parity = convert_parity(m_rs232_parity->read()); + stop_bits_t stopbits = convert_stopbits(m_rs232_stopbits->read()); + + set_data_frame(startbits, databits, parity, stopbits); + + int txbaud = convert_baud(m_rs232_txbaud->read()); + set_tra_rate(txbaud); + + int rxbaud = convert_baud(m_rs232_rxbaud->read()); + set_rcv_rate(rxbaud); + + output_rxd(1); + + // TODO: make this configurable + output_dcd(0); + output_dsr(0); + output_cts(0); +} + +void null_modem_device::device_reset() +{ + update_serial(0); + queue(); } + +void null_modem_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + switch (id) + { + case TIMER_POLL: + queue(); + break; + + default: + device_serial_interface::device_timer(timer, id, param, ptr); + } +} + +void null_modem_device::queue() +{ + if (is_transmit_register_empty()) + { + if (m_input_index == m_input_count) + { + m_input_index = 0; + m_input_count = m_stream->input(m_input_buffer, sizeof(m_input_buffer)); + } + + if (m_input_count != 0) + { + transmit_register_setup(m_input_buffer[m_input_index++]); + + m_timer_poll->adjust(attotime::never); + } + else + { + int txbaud = convert_baud(m_rs232_txbaud->read()); + m_timer_poll->adjust(attotime::from_hz(txbaud)); + } + } +} + +void null_modem_device::tra_callback() +{ + output_rxd(transmit_register_get_data_bit()); +} + +void null_modem_device::tra_complete() +{ + queue(); +} + +void null_modem_device::rcv_complete() +{ + receive_register_extract(); + m_stream->output(get_received_char()); +} + +const device_type NULL_MODEM = &device_creator<null_modem_device>; diff --git a/src/emu/bus/rs232/null_modem.h b/src/emu/bus/rs232/null_modem.h index ea79fd7b688..d94a6cc7a9f 100644 --- a/src/emu/bus/rs232/null_modem.h +++ b/src/emu/bus/rs232/null_modem.h @@ -1,25 +1,49 @@ #ifndef NULL_MODEM_H_ #define NULL_MODEM_H_ -#include "bus/rs232/rs232.h" +#include "rs232.h" #include "imagedev/bitbngr.h" class null_modem_device : public device_t, + public device_serial_interface, public device_rs232_port_interface { public: null_modem_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); virtual machine_config_constructor device_mconfig_additions() const; - WRITE_LINE_MEMBER( read ) { output_rxd(state); } /// HACK for DEVCB - virtual WRITE_LINE_MEMBER( input_txd ) { if (started()) m_bitbanger->output(state); } + virtual WRITE_LINE_MEMBER( input_txd ) { device_serial_interface::rx_w(state); } + + DECLARE_WRITE_LINE_MEMBER(update_serial); protected: - virtual void device_start() { output_dcd(0); output_dsr(0); output_cts(0); } - virtual void device_reset() { output_rxd(1); } + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + virtual void tra_callback(); + virtual void tra_complete(); + virtual void rcv_complete(); private: - required_device<bitbanger_device> m_bitbanger; + void queue(); + + static const int TIMER_POLL = 1; + + required_device<bitbanger_device> m_stream; + + required_ioport m_rs232_txbaud; + required_ioport m_rs232_rxbaud; + required_ioport m_rs232_startbits; + required_ioport m_rs232_databits; + required_ioport m_rs232_parity; + required_ioport m_rs232_stopbits; + + UINT8 m_input_buffer[1000]; + UINT32 m_input_count; + UINT32 m_input_index; + emu_timer *m_timer_poll; }; extern const device_type NULL_MODEM; diff --git a/src/emu/bus/rs232/printer.c b/src/emu/bus/rs232/printer.c new file mode 100644 index 00000000000..2215d4dd1bd --- /dev/null +++ b/src/emu/bus/rs232/printer.c @@ -0,0 +1,83 @@ +#include "printer.h" + +serial_printer_device::serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : device_t(mconfig, SERIAL_PRINTER, "Serial Printer", tag, owner, clock, "serial_printer", __FILE__), + device_serial_interface(mconfig, *this), + device_rs232_port_interface(mconfig, *this), + m_printer(*this, "printer"), + m_rs232_rxbaud(*this, "RS232_RXBAUD"), + m_rs232_startbits(*this, "RS232_STARTBITS"), + m_rs232_databits(*this, "RS232_DATABITS"), + m_rs232_parity(*this, "RS232_PARITY"), + m_rs232_stopbits(*this, "RS232_STOPBITS") +{ +} + +static MACHINE_CONFIG_FRAGMENT(serial_printer) + MCFG_DEVICE_ADD("printer", PRINTER, 0) + MCFG_PRINTER_ONLINE_CB(WRITELINE(serial_printer_device, printer_online)) +MACHINE_CONFIG_END + +machine_config_constructor serial_printer_device::device_mconfig_additions() const +{ + return MACHINE_CONFIG_NAME(serial_printer); +} + +static INPUT_PORTS_START(serial_printer) + MCFG_RS232_BAUD("RS232_RXBAUD", RS232_BAUD_9600, "RX Baud", serial_printer_device, update_serial) + MCFG_RS232_STARTBITS("RS232_STARTBITS", RS232_STARTBITS_1, "Start Bits", serial_printer_device, update_serial) + MCFG_RS232_DATABITS("RS232_DATABITS", RS232_DATABITS_8, "Data Bits", serial_printer_device, update_serial) + MCFG_RS232_PARITY("RS232_PARITY", RS232_PARITY_NONE, "Parity", serial_printer_device, update_serial) + MCFG_RS232_STOPBITS("RS232_STOPBITS", RS232_STOPBITS_1, "Stop Bits", serial_printer_device, update_serial) +INPUT_PORTS_END + +ioport_constructor serial_printer_device::device_input_ports() const +{ + return INPUT_PORTS_NAME(serial_printer); +} + +void serial_printer_device::device_start() +{ +} + +WRITE_LINE_MEMBER(serial_printer_device::update_serial) +{ + int startbits = convert_startbits(m_rs232_startbits->read()); + int databits = convert_databits(m_rs232_databits->read()); + parity_t parity = convert_parity(m_rs232_parity->read()); + stop_bits_t stopbits = convert_stopbits(m_rs232_stopbits->read()); + + set_data_frame(startbits, databits, parity, stopbits); + + int rxbaud = convert_baud(m_rs232_rxbaud->read()); + set_rcv_rate(rxbaud); + + // TODO: make this configurable + output_rxd(0); + output_dcd(0); + output_dsr(0); + output_cts(0); +} + +void serial_printer_device::device_reset() +{ + update_serial(0); +} + +WRITE_LINE_MEMBER(serial_printer_device::printer_online) +{ + /// TODO: ? +} + +void serial_printer_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + device_serial_interface::device_timer(timer, id, param, ptr); +} + +void serial_printer_device::rcv_complete() +{ + receive_register_extract(); + m_printer->output(get_received_char()); +} + +const device_type SERIAL_PRINTER = &device_creator<serial_printer_device>; diff --git a/src/emu/bus/rs232/printer.h b/src/emu/bus/rs232/printer.h new file mode 100644 index 00000000000..0d2c03b24bf --- /dev/null +++ b/src/emu/bus/rs232/printer.h @@ -0,0 +1,42 @@ +#ifndef __RS232_PRINTER_H__ +#define __RS232_PRINTER_H__ + +#pragma once + +#include "rs232.h" +#include "imagedev/printer.h" + +class serial_printer_device : public device_t, + public device_serial_interface, + public device_rs232_port_interface +{ +public: + serial_printer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) { device_serial_interface::rx_w(state); } + + DECLARE_WRITE_LINE_MEMBER(update_serial); + DECLARE_WRITE_LINE_MEMBER(printer_online); + +protected: + virtual machine_config_constructor device_mconfig_additions() const; + virtual ioport_constructor device_input_ports() const; + virtual void device_start(); + virtual void device_reset(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + + virtual void rcv_complete(); + +private: + required_device<printer_image_device> m_printer; + + required_ioport m_rs232_rxbaud; + required_ioport m_rs232_startbits; + required_ioport m_rs232_databits; + required_ioport m_rs232_parity; + required_ioport m_rs232_stopbits; +}; + +extern const device_type SERIAL_PRINTER; + +#endif diff --git a/src/emu/bus/rs232/rs232.c b/src/emu/bus/rs232/rs232.c index 8e046dc06fb..26a0a4ecdd8 100644 --- a/src/emu/bus/rs232/rs232.c +++ b/src/emu/bus/rs232/rs232.c @@ -96,12 +96,16 @@ device_rs232_port_interface::~device_rs232_port_interface() { } +#include "keyboard.h" #include "loopback.h" #include "null_modem.h" +#include "printer.h" #include "terminal.h" SLOT_INTERFACE_START( default_rs232_devices ) + SLOT_INTERFACE("keyboard", SERIAL_KEYBOARD) SLOT_INTERFACE("loopback", RS232_LOOPBACK) SLOT_INTERFACE("null_modem", NULL_MODEM) - SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL) + SLOT_INTERFACE("printer", SERIAL_PRINTER) + SLOT_INTERFACE("terminal", SERIAL_TERMINAL) SLOT_INTERFACE_END diff --git a/src/emu/bus/rs232/rs232.h b/src/emu/bus/rs232/rs232.h index 1a17d9b35d5..863bf7468ee 100644 --- a/src/emu/bus/rs232/rs232.h +++ b/src/emu/bus/rs232/rs232.h @@ -1,6 +1,8 @@ #ifndef __BUS_RS232_H__ #define __BUS_RS232_H__ +#pragma once + #include "emu.h" #define MCFG_RS232_PORT_ADD(_tag, _slot_intf, _def_slot) \ @@ -22,6 +24,89 @@ #define MCFG_RS232_CTS_HANDLER(_devcb) \ devcb = &rs232_port_device::set_cts_handler(*device, DEVCB2_##_devcb); +#define RS232_BAUD_110 (0x00) +#define RS232_BAUD_150 (0x01) +#define RS232_BAUD_300 (0x02) +#define RS232_BAUD_600 (0x03) +#define RS232_BAUD_1200 (0x04) +#define RS232_BAUD_2400 (0x05) +#define RS232_BAUD_4800 (0x06) +#define RS232_BAUD_9600 (0x07) +#define RS232_BAUD_14400 (0x08) +#define RS232_BAUD_19200 (0x09) +#define RS232_BAUD_28800 (0x0a) +#define RS232_BAUD_38400 (0x0b) +#define RS232_BAUD_57600 (0x0c) +#define RS232_BAUD_115200 (0x0d) + +#define MCFG_RS232_BAUD(_tag, _default_baud, _description, _class, _write_line) \ + PORT_START(_tag) \ + PORT_CONFNAME(0xff, _default_baud, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ + PORT_CONFSETTING( RS232_BAUD_110, "110") \ + PORT_CONFSETTING( RS232_BAUD_150, "150") \ + PORT_CONFSETTING( RS232_BAUD_300, "300") \ + PORT_CONFSETTING( RS232_BAUD_600, "600") \ + PORT_CONFSETTING( RS232_BAUD_1200, "1200") \ + PORT_CONFSETTING( RS232_BAUD_2400, "2400") \ + PORT_CONFSETTING( RS232_BAUD_4800, "4800") \ + PORT_CONFSETTING( RS232_BAUD_9600, "9600") \ + PORT_CONFSETTING( RS232_BAUD_14400, "14400") \ + PORT_CONFSETTING( RS232_BAUD_19200, "19200") \ + PORT_CONFSETTING( RS232_BAUD_28800, "28800") \ + PORT_CONFSETTING( RS232_BAUD_38400, "38400") \ + PORT_CONFSETTING( RS232_BAUD_57600, "57600") \ + PORT_CONFSETTING( RS232_BAUD_115200, "115200") + +#define RS232_STARTBITS_0 (0x00) +#define RS232_STARTBITS_1 (0x01) + +#define MCFG_RS232_STARTBITS(_tag, _default_startbits, _description, _class, _write_line) \ + PORT_START(_tag) \ + PORT_CONFNAME(0xff, _default_startbits, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ + PORT_CONFSETTING( RS232_STARTBITS_0, "0") \ + PORT_CONFSETTING( RS232_STARTBITS_1, "1") + +#define RS232_DATABITS_5 (0x00) +#define RS232_DATABITS_6 (0x01) +#define RS232_DATABITS_7 (0x02) +#define RS232_DATABITS_8 (0x03) + +#define MCFG_RS232_DATABITS(_tag, _default_databits, _description, _class, _write_line) \ + PORT_START(_tag) \ + PORT_CONFNAME(0xff, _default_databits, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ + PORT_CONFSETTING( RS232_DATABITS_5, "5") \ + PORT_CONFSETTING( RS232_DATABITS_6, "6") \ + PORT_CONFSETTING( RS232_DATABITS_7, "7") \ + PORT_CONFSETTING( RS232_DATABITS_8, "8") + +#define RS232_PARITY_NONE (0x00) +#define RS232_PARITY_ODD (0x01) +#define RS232_PARITY_EVEN (0x02) +#define RS232_PARITY_MARK (0x03) +#define RS232_PARITY_SPACE (0x04) + +#define MCFG_RS232_PARITY(_tag, _default_parity, _description, _class, _write_line) \ + PORT_START(_tag) \ + PORT_CONFNAME(0xff, _default_parity, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ + PORT_CONFSETTING( RS232_PARITY_NONE, "None") \ + PORT_CONFSETTING( RS232_PARITY_ODD, "Odd") \ + PORT_CONFSETTING( RS232_PARITY_EVEN, "Even") \ + PORT_CONFSETTING( RS232_PARITY_MARK, "Mark") \ + PORT_CONFSETTING( RS232_PARITY_SPACE, "Space") + +#define RS232_STOPBITS_0 (0x00) +#define RS232_STOPBITS_1 (0x01) +#define RS232_STOPBITS_1_5 (0x02) +#define RS232_STOPBITS_2 (0x03) + +#define MCFG_RS232_STOPBITS(_tag, _default_stopbits, _description, _class, _write_line) \ + PORT_START(_tag) \ + PORT_CONFNAME(0xff, 0x01, _description) PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, _class, _write_line) \ + PORT_CONFSETTING( RS232_STOPBITS_0, "0") \ + PORT_CONFSETTING( RS232_STOPBITS_1, "1") \ + PORT_CONFSETTING( RS232_STOPBITS_1_5, "1.5") \ + PORT_CONFSETTING( RS232_STOPBITS_2, "2") + class device_rs232_port_interface; class rs232_port_device : public device_t, @@ -93,6 +178,80 @@ public: protected: rs232_port_device *m_port; + + static int convert_baud(UINT8 baud) + { + static const int values[] = + { + 110, + 150, + 300, + 600, + 1200, + 2400, + 4800, + 9600, + 14400, + 19200, + 28800, + 38400, + 57600, + 115200 + }; + + return values[baud]; + } + + static int convert_startbits(UINT8 startbits) + { + static const int values[] = + { + 0, + 1 + }; + + return values[startbits]; + } + + static int convert_databits(UINT8 databits) + { + static const int values[] = + { + 5, + 6, + 7, + 8 + }; + + return values[databits]; + } + + static device_serial_interface::parity_t convert_parity(UINT8 parity) + { + static const device_serial_interface::parity_t values[] = + { + device_serial_interface::PARITY_NONE, + device_serial_interface::PARITY_ODD, + device_serial_interface::PARITY_EVEN, + device_serial_interface::PARITY_MARK, + device_serial_interface::PARITY_SPACE + }; + + return values[parity]; + } + + static device_serial_interface::stop_bits_t convert_stopbits(UINT8 stopbits) + { + static const device_serial_interface::stop_bits_t values[] = + { + device_serial_interface::STOP_BITS_0, + device_serial_interface::STOP_BITS_1, + device_serial_interface::STOP_BITS_1_5, + device_serial_interface::STOP_BITS_2 + }; + + return values[stopbits]; + } }; extern const device_type RS232_PORT; diff --git a/src/emu/bus/rs232/terminal.c b/src/emu/bus/rs232/terminal.c index b2ba0692743..7f8a9b83e41 100644 --- a/src/emu/bus/rs232/terminal.c +++ b/src/emu/bus/rs232/terminal.c @@ -1,68 +1,27 @@ #include "terminal.h" +serial_terminal_device::serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : generic_terminal_device(mconfig, SERIAL_TERMINAL, "Serial Terminal", tag, owner, clock, "serial_terminal", __FILE__), + device_serial_interface(mconfig, *this), + device_rs232_port_interface(mconfig, *this), + m_rs232_txbaud(*this, "RS232_TXBAUD"), + m_rs232_rxbaud(*this, "RS232_RXBAUD"), + m_rs232_startbits(*this, "RS232_STARTBITS"), + m_rs232_databits(*this, "RS232_DATABITS"), + m_rs232_parity(*this, "RS232_PARITY"), + m_rs232_stopbits(*this, "RS232_STOPBITS") +{ +} + static INPUT_PORTS_START(serial_terminal) PORT_INCLUDE(generic_terminal) - PORT_START("TERM_TXBAUD") - PORT_CONFNAME(0xff, 0x06, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x0d, "110") - PORT_CONFSETTING( 0x00, "150") - PORT_CONFSETTING( 0x01, "300") - PORT_CONFSETTING( 0x02, "600") - PORT_CONFSETTING( 0x03, "1200") - PORT_CONFSETTING( 0x04, "2400") - PORT_CONFSETTING( 0x05, "4800") - PORT_CONFSETTING( 0x06, "9600") - PORT_CONFSETTING( 0x07, "14400") - PORT_CONFSETTING( 0x08, "19200") - PORT_CONFSETTING( 0x09, "28800") - PORT_CONFSETTING( 0x0a, "38400") - PORT_CONFSETTING( 0x0b, "57600") - PORT_CONFSETTING( 0x0c, "115200") - - PORT_START("TERM_RXBAUD") - PORT_CONFNAME(0xff, 0x06, "RX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x0d, "110") - PORT_CONFSETTING( 0x00, "150") - PORT_CONFSETTING( 0x01, "300") - PORT_CONFSETTING( 0x02, "600") - PORT_CONFSETTING( 0x03, "1200") - PORT_CONFSETTING( 0x04, "2400") - PORT_CONFSETTING( 0x05, "4800") - PORT_CONFSETTING( 0x06, "9600") - PORT_CONFSETTING( 0x07, "14400") - PORT_CONFSETTING( 0x08, "19200") - PORT_CONFSETTING( 0x09, "28800") - PORT_CONFSETTING( 0x0a, "38400") - PORT_CONFSETTING( 0x0b, "57600") - PORT_CONFSETTING( 0x0c, "115200") - - PORT_START("TERM_STARTBITS") - PORT_CONFNAME(0xff, 0x01, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x00, "0") - PORT_CONFSETTING( 0x01, "1") - - PORT_START("TERM_DATABITS") - PORT_CONFNAME(0xff, 0x03, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x00, "5") - PORT_CONFSETTING( 0x01, "6") - PORT_CONFSETTING( 0x02, "7") - PORT_CONFSETTING( 0x03, "8") - PORT_CONFSETTING( 0x04, "9") - - PORT_START("TERM_PARITY") - PORT_CONFNAME(0xff, 0x00, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x00, "None") - PORT_CONFSETTING( 0x01, "Odd") - PORT_CONFSETTING( 0x02, "Even") - PORT_CONFSETTING( 0x03, "Mark") - PORT_CONFSETTING( 0x04, "Space") - - PORT_START("TERM_STOPBITS") - PORT_CONFNAME(0xff, 0x01, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_terminal_device, update_serial) - PORT_CONFSETTING( 0x00, "0") - PORT_CONFSETTING( 0x01, "1") - PORT_CONFSETTING( 0x02, "1.5") - PORT_CONFSETTING( 0x03, "2") + + MCFG_RS232_BAUD("RS232_TXBAUD", RS232_BAUD_9600, "TX Baud", serial_terminal_device, update_serial) + MCFG_RS232_BAUD("RS232_RXBAUD", RS232_BAUD_9600, "RX Baud", serial_terminal_device, update_serial) + MCFG_RS232_STARTBITS("RS232_STARTBITS", RS232_STARTBITS_1, "Start Bits", serial_terminal_device, update_serial) + MCFG_RS232_DATABITS("RS232_DATABITS", RS232_DATABITS_8, "Data Bits", serial_terminal_device, update_serial) + MCFG_RS232_PARITY("RS232_PARITY", RS232_PARITY_NONE, "Parity", serial_terminal_device, update_serial) + MCFG_RS232_STOPBITS("RS232_STOPBITS", RS232_STOPBITS_1, "Stop Bits", serial_terminal_device, update_serial) INPUT_PORTS_END ioport_constructor serial_terminal_device::device_input_ports() const @@ -70,51 +29,37 @@ ioport_constructor serial_terminal_device::device_input_ports() const return INPUT_PORTS_NAME(serial_terminal); } -serial_terminal_device::serial_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : generic_terminal_device(mconfig, SERIAL_TERMINAL, "Serial Terminal", tag, owner, clock, "serial_terminal", __FILE__), - device_serial_interface(mconfig, *this), - device_rs232_port_interface(mconfig, *this), - m_io_term_txbaud(*this, "TERM_TXBAUD"), - m_io_term_rxbaud(*this, "TERM_RXBAUD"), - m_io_term_startbits(*this, "TERM_STARTBITS"), - m_io_term_databits(*this, "TERM_DATABITS"), - m_io_term_parity(*this, "TERM_PARITY"), - m_io_term_stopbits(*this, "TERM_STOPBITS") -{ -} - void serial_terminal_device::device_start() { } WRITE_LINE_MEMBER(serial_terminal_device::update_serial) { - static const int m_baud[] = {150, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 28800, 38400, 57600, 115200, 110}; - static const int m_startbits[] = {0, 1}; - static const int m_databits[] = {5, 6, 7, 8, 9}; - static const parity_t m_parity[] = {PARITY_NONE, PARITY_ODD, PARITY_EVEN, PARITY_MARK, PARITY_SPACE}; - static const stop_bits_t m_stopbits[] = {STOP_BITS_0, STOP_BITS_1, STOP_BITS_1_5, STOP_BITS_2}; + int startbits = convert_startbits(m_rs232_startbits->read()); + int databits = convert_databits(m_rs232_databits->read()); + parity_t parity = convert_parity(m_rs232_parity->read()); + stop_bits_t stopbits = convert_stopbits(m_rs232_stopbits->read()); - UINT8 startbits = m_io_term_startbits->read(); - UINT8 databits = m_io_term_databits->read(); - UINT8 parity = m_io_term_parity->read(); - UINT8 stopbits = m_io_term_stopbits->read(); + set_data_frame(startbits, databits, parity, stopbits); - set_data_frame(m_startbits[startbits], m_databits[databits], m_parity[parity], m_stopbits[stopbits]); + int txbaud = convert_baud(m_rs232_txbaud->read()); + set_tra_rate(txbaud); - UINT8 txbaud = m_io_term_txbaud->read(); - set_tra_rate(m_baud[txbaud]); + int rxbaud = convert_baud(m_rs232_rxbaud->read()); + set_rcv_rate(rxbaud); - UINT8 rxbaud = m_io_term_rxbaud->read(); - set_rcv_rate(m_baud[rxbaud]); + output_rxd(1); + + // TODO: make this configurable + output_dcd(0); + output_dsr(0); + output_cts(0); } void serial_terminal_device::device_reset() { generic_terminal_device::device_reset(); - output_rxd(1); - update_serial(0); } @@ -125,11 +70,12 @@ void serial_terminal_device::device_timer(emu_timer &timer, device_timer_id id, void serial_terminal_device::send_key(UINT8 code) { - if(is_transmit_register_empty()) + if (is_transmit_register_empty()) { transmit_register_setup(code); return; } + m_key_valid = true; m_curr_key = code; } @@ -141,7 +87,7 @@ void serial_terminal_device::tra_callback() void serial_terminal_device::tra_complete() { - if(m_key_valid) + if (m_key_valid) { transmit_register_setup(m_curr_key); m_key_valid = false; diff --git a/src/emu/bus/rs232/terminal.h b/src/emu/bus/rs232/terminal.h index 03708712513..eb1c72c1c35 100644 --- a/src/emu/bus/rs232/terminal.h +++ b/src/emu/bus/rs232/terminal.h @@ -17,25 +17,23 @@ public: DECLARE_WRITE_LINE_MEMBER(update_serial); protected: + virtual ioport_constructor device_input_ports() const; virtual void device_start(); virtual void device_reset(); virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); - virtual ioport_constructor device_input_ports() const; virtual void tra_callback(); virtual void tra_complete(); virtual void rcv_complete(); virtual void send_key(UINT8 code); - virtual DECLARE_WRITE_LINE_MEMBER( input_dtr ) { if (started()) { output_dsr(state); } } - private: - required_ioport m_io_term_txbaud; - required_ioport m_io_term_rxbaud; - required_ioport m_io_term_startbits; - required_ioport m_io_term_databits; - required_ioport m_io_term_parity; - required_ioport m_io_term_stopbits; + required_ioport m_rs232_txbaud; + required_ioport m_rs232_rxbaud; + required_ioport m_rs232_startbits; + required_ioport m_rs232_databits; + required_ioport m_rs232_parity; + required_ioport m_rs232_stopbits; UINT8 m_curr_key; bool m_key_valid; diff --git a/src/emu/bus/s100/wunderbus.c b/src/emu/bus/s100/wunderbus.c index 91523037b82..fa6c531a74c 100644 --- a/src/emu/bus/s100/wunderbus.c +++ b/src/emu/bus/s100/wunderbus.c @@ -107,12 +107,12 @@ static ins8250_interface ace3_intf = static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x0d ) // 110 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x0d ) // 110 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x03 ) // 2 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 ) DEVICE_INPUT_DEFAULTS_END @@ -140,13 +140,13 @@ static MACHINE_CONFIG_FRAGMENT( s100_wunderbus ) MCFG_INS8250_ADD(INS8250_2_TAG, ace2_intf, XTAL_18_432MHz/10) MCFG_INS8250_ADD(INS8250_3_TAG, ace3_intf, XTAL_18_432MHz/10) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, rx_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, dcd_w)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, dsr_w)) MCFG_RS232_RI_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, ri_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(INS8250_1_TAG, ins8250_uart_device, cts_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(INS8250_2_TAG, ins8250_uart_device, rx_w)) diff --git a/src/emu/emu.mak b/src/emu/emu.mak index 54a0ea9b60a..0da81554044 100644 --- a/src/emu/emu.mak +++ b/src/emu/emu.mak @@ -124,7 +124,6 @@ EMUOBJS = \ $(EMUOBJ)/ui/filesel.o \ $(EMUOBJ)/ui/imgcntrl.o \ $(EMUOBJ)/ui/imginfo.o \ - $(EMUOBJ)/ui/bbcontrl.o \ $(EMUOBJ)/ui/barcode.o \ $(EMUOBJ)/ui/tapectrl.o \ $(EMUOBJ)/ui/viewgfx.o \ diff --git a/src/emu/imagedev/bitbngr.c b/src/emu/imagedev/bitbngr.c index 1e7835eb576..dbd5f3dae11 100644 --- a/src/emu/imagedev/bitbngr.c +++ b/src/emu/imagedev/bitbngr.c @@ -2,8 +2,6 @@ bitbngr.c - TRS style "bitbanger" serial port - *********************************************************************/ #include "emu.h" @@ -21,25 +19,10 @@ const device_type BITBANGER = &device_creator<bitbanger_device>; ctor -------------------------------------------------*/ -bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, BITBANGER, "Bitbanger", tag, owner, clock, "bitbanger", __FILE__), - device_image_interface(mconfig, *this), - m_input_cb(*this) +bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, BITBANGER, "Bitbanger", tag, owner, clock, "bitbanger", __FILE__), + device_image_interface(mconfig, *this) { - m_output_timer = NULL; - m_input_timer = NULL; - m_output_value = 1; - m_build_count = 0; - m_build_byte = 0; - m_idle_delay = attotime::zero; - m_current_baud = attotime::zero; - m_input_buffer_size = 0; - m_input_buffer_cursor = 0; - m_mode = 0; - m_baud = 0; - m_tune = 0; - m_current_input = 0; - memset(m_input_buffer, 0, sizeof(m_input_buffer)); } @@ -48,7 +31,7 @@ bitbanger_device::bitbanger_device(const machine_config &mconfig, const char *ta native_output - outputs data to a file -------------------------------------------------*/ -void bitbanger_device::native_output(UINT8 data) +void bitbanger_device::output(UINT8 data) { if (exists()) { @@ -61,7 +44,7 @@ void bitbanger_device::native_output(UINT8 data) native_input - inputs data from a file -------------------------------------------------*/ -UINT32 bitbanger_device::native_input(void *buffer, UINT32 length) +UINT32 bitbanger_device::input(void *buffer, UINT32 length) { if (exists()) { @@ -73,252 +56,11 @@ UINT32 bitbanger_device::native_input(void *buffer, UINT32 length) /*------------------------------------------------- - mode_string --------------------------------------------------*/ - -const char *bitbanger_device::mode_string(void) -{ - static const char *const modes[] = {"Printer", "Modem"}; - return modes[m_mode]; -} - - - -/*------------------------------------------------- - inc_mode --------------------------------------------------*/ - -bool bitbanger_device::inc_mode(bool test) -{ - int adjust_mode = (int)m_mode + 1; - - if( adjust_mode >= BITBANGER_MODE_MAX ) - return FALSE; - - if( !test) - m_mode = adjust_mode; - - return TRUE; -} - - - -/*------------------------------------------------- - dec_mode --------------------------------------------------*/ - -bool bitbanger_device::dec_mode(bool test) -{ - int adjust_mode = m_mode - 1; - - if( adjust_mode < 0 ) - return FALSE; - - if( !test) - m_mode = adjust_mode; - - return TRUE; -} - - - -/*------------------------------------------------- - tune_string --------------------------------------------------*/ - -const char *bitbanger_device::tune_string(void) -{ - static const char *const tunes[] = {"-2.0%", "-1.75%", "-1.5%", "-1.25%", "-1.0%", "-0.75%", "-0.5", "-0.25%", "\xc2\xb1""0%", - "+0.25%", "+0.5%", "+0.75%", "+1.0%", "+1.25%", "+1.5%", "+1.75%", "+2.0%"}; - return tunes[m_tune]; -} - - - -/*------------------------------------------------- - tune_value --------------------------------------------------*/ - -float bitbanger_device::tune_value(void) -{ - static const float tunes[] = {0.97f, 0.9825f, 0.985f, 0.9875f, 0.99f, 0.9925f, 0.995f, 0.9975f, 1.0f, - 1.0025f, 1.005f, 1.0075f, 1.01f, 1.0125f, 1.015f, 1.0175f, 1.02f}; - return tunes[m_tune]; -} - - - -/*------------------------------------------------- - baud_value --------------------------------------------------*/ - -UINT32 bitbanger_device::baud_value(void) -{ - static const float bauds[] = { 150.0f, 300.0f, 600.0f, 1200.0f, 2400.0f, 4800.0f, 9600.0f, - 14400.0f, 19200.0f, 28800.0f, 38400.0f, 57600.0f, 115200.0f}; - float result = tune_value() * bauds[m_baud]; - return (UINT32)result; -} - - -/*------------------------------------------------- - baud_string --------------------------------------------------*/ - -const char *bitbanger_device::baud_string(void) -{ - static const char *const bauds[] = { "150", "300", "600", "1200", "2400", "4800", - "9600", "14400", "19200", "28800", "38400", "57600", "115200"}; - - return(bauds[m_baud]); -} - - - -/*------------------------------------------------- - inc_baud --------------------------------------------------*/ - -bool bitbanger_device::inc_baud(bool test) -{ - int adjust_baud = (int)m_baud + 1; - - if( adjust_baud >= BITBANGER_BAUD_MAX ) - return FALSE; - - if( !test) - { - m_baud = adjust_baud; - m_current_baud = attotime::from_hz(baud_value()); - } - - return TRUE; -} - - -/*------------------------------------------------- - dec_baud --------------------------------------------------*/ - -bool bitbanger_device::dec_baud(bool test) -{ - int adjust_baud = m_baud - 1; - - if( adjust_baud < 0 ) - return FALSE; - - if( !test) - { - m_baud = adjust_baud; - m_current_baud = attotime::from_hz(baud_value()); - } - - return TRUE; -} - - -/*------------------------------------------------- - inc_tune --------------------------------------------------*/ - -bool bitbanger_device::inc_tune(bool test) -{ - int adjust_tune = (int)m_tune + 1; - - if( adjust_tune >= BITBANGER_TUNE_MAX ) - return FALSE; - - if (!test) - { - m_tune = adjust_tune; - m_current_baud = attotime::from_hz(baud_value()); - } - - return TRUE; -} - - - -/*------------------------------------------------- - dec_tune --------------------------------------------------*/ - -bool bitbanger_device::dec_tune(bool test) -{ - int adjust_tune = m_tune - 1; - - if( adjust_tune < 0 ) - return FALSE; - - if( !test) - { - m_tune = adjust_tune; - m_current_baud = attotime::from_hz(baud_value()); - } - - return TRUE; -} - - - -/*------------------------------------------------- - bytes_to_bits_81N --------------------------------------------------*/ - -void bitbanger_device::bytes_to_bits_81N(void) -{ - UINT8 byte_buffer[100]; - UINT32 byte_buffer_size, bit_buffer_size; - int i, j; - static const UINT8 bitmask[8] = {0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; - - bit_buffer_size = 0; - byte_buffer_size = native_input(byte_buffer, sizeof(byte_buffer)); - - /* Translate byte buffer into bit buffer using: 1 start bit, 8 data bits, 1 stop bit, no parity */ - - for( i=0; i<byte_buffer_size; i++ ) - { - m_input_buffer[bit_buffer_size++] = 0; - - for( j=0; j<8; j++ ) - { - if( byte_buffer[i] & bitmask[j] ) - m_input_buffer[bit_buffer_size++] = 1; - else - m_input_buffer[bit_buffer_size++] = 0; - } - - m_input_buffer[bit_buffer_size++] = 1; - } - - m_input_buffer_size = bit_buffer_size; - m_input_buffer_cursor = 0; -} - - - -/*------------------------------------------------- device_start -------------------------------------------------*/ void bitbanger_device::device_start(void) { - /* output config */ - m_build_count = 0; - m_output_timer = timer_alloc(TIMER_OUTPUT); - - /* input config */ - m_input_timer = timer_alloc(TIMER_INPUT); - m_idle_delay = attotime::from_seconds(1); - m_input_buffer_size = 0; - m_input_buffer_cursor = 0; - - /* defaults */ - m_current_baud = attotime::from_hz(baud_value()); - - /* callback */ - m_input_cb.resolve_safe(); } @@ -335,149 +77,17 @@ void bitbanger_device::device_config_complete(void) /*------------------------------------------------- - device_timer --------------------------------------------------*/ - -void bitbanger_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) -{ - switch(id) - { - case TIMER_OUTPUT: - timer_output(); - break; - - case TIMER_INPUT: - timer_input(); - break; - } -} - - - -/*------------------------------------------------- - timer_output --------------------------------------------------*/ - -void bitbanger_device::timer_output(void) -{ - /* this ia harded coded for 8-1-N */ - if( m_output_value ) - m_build_byte |= 0x200; - - m_build_byte >>= 1; - m_build_count--; - - if(m_build_count == 0) - { - if( m_output_value == 1 ) - native_output(m_build_byte); - else - logerror("Bitbanger: Output framing error.\n" ); - - m_output_timer->reset(); - } -} - - - -/*------------------------------------------------- - timer_input --------------------------------------------------*/ - -void bitbanger_device::timer_input(void) -{ - if(m_input_buffer_cursor == m_input_buffer_size) - { - /* get more data */ - bytes_to_bits_81N(); - - if(m_input_buffer_size == 0) - { - /* no more data, wait and try again */ - m_idle_delay = min(m_idle_delay + attotime::from_msec(100), attotime::from_seconds(1)); - m_input_timer->adjust(m_idle_delay); - - if( m_mode == BITBANGER_MODEM ) - set_input_line(1); - else - set_input_line(0); - return; - } - else - { - m_idle_delay = m_current_baud; - m_input_timer->adjust(m_idle_delay, 0, m_idle_delay); - } - } - - /* send bit to driver */ - set_input_line(m_input_buffer[(m_input_buffer_cursor)++]); -} - - - -/*------------------------------------------------- - set_input_line --------------------------------------------------*/ - -void bitbanger_device::set_input_line(UINT8 line) -{ - /* normalize */ - line = line ? ASSERT_LINE : CLEAR_LINE; - - /* only act when the state changes */ - if (m_current_input != line) - { - m_current_input = line; - m_input_cb(line ? ASSERT_LINE : CLEAR_LINE); - } -} - - - -/*------------------------------------------------- - output - outputs data to a bitbanger port --------------------------------------------------*/ - -void bitbanger_device::output(int value) -{ - attotime one_point_five_baud; - - if( m_build_count == 0 && m_output_value == 1 && value == 0 ) - { - /* we found our start bit */ - /* eight bits of data, plus one of stop */ - m_build_count = 9; - m_build_byte = 0; - - one_point_five_baud = m_current_baud + m_current_baud / 2; - m_output_timer->adjust(one_point_five_baud, 0, m_current_baud); - } - - //fprintf(stderr,"%s, %d\n", device->machine().time().as_string(9), value); - m_output_value = value; -} - - - -/*------------------------------------------------- call_load -------------------------------------------------*/ bool bitbanger_device::call_load(void) { - m_input_timer->enable(true); - m_input_timer->adjust(attotime::zero, 0, attotime::from_seconds(1)); - /* we don't need to do anything special */ return IMAGE_INIT_PASS; } bool bitbanger_device::call_create(int format_type, option_resolution *format_options) { - m_input_timer->enable(true); - m_input_timer->adjust(attotime::zero, 0, attotime::from_seconds(1)); - /* we don't need to do anything special */ return IMAGE_INIT_PASS; } @@ -488,5 +98,4 @@ bool bitbanger_device::call_create(int format_type, option_resolution *format_op void bitbanger_device::call_unload(void) { - m_input_timer->enable(false); } diff --git a/src/emu/imagedev/bitbngr.h b/src/emu/imagedev/bitbngr.h index 6e5d811abcf..895eacd70dd 100644 --- a/src/emu/imagedev/bitbngr.h +++ b/src/emu/imagedev/bitbngr.h @@ -2,92 +2,22 @@ bitbngr.h - TRS style "bitbanger" serial port - *********************************************************************/ #ifndef __BITBNGR_H__ #define __BITBNGR_H__ - -enum -{ - BITBANGER_PRINTER = 0, - BITBANGER_MODEM, - BITBANGER_MODE_MAX, - - BITBANGER_150 = 0, - BITBANGER_300, - BITBANGER_600, - BITBANGER_1200, - BITBANGER_2400, - BITBANGER_4800, - BITBANGER_9600, - BITBANGER_14400, - BITBANGER_19200, - BITBANGER_28800, - BITBANGER_38400, - BITBANGER_57600, - BITBANGER_115200, - BITBANGER_BAUD_MAX, - - BITBANGER_NEG40PERCENT = 0, - BITBANGER_NEG35PERCENT, - BITBANGER_NEG30PERCENT, - BITBANGER_NEG25PERCENT, - BITBANGER_NEG20PERCENT, - BITBANGER_NEG15PERCENT, - BITBANGER_NEG10PERCENT, - BITBANGER_NEG5PERCENT, - BITBANGER_0PERCENT, - BITBANGER_POS5PERCENT, - BITBANGER_POS10PERCENT, - BITBANGER_POS15PERCENT, - BITBANGER_POS20PERCENT, - BITBANGER_POS25PERCENT, - BITBANGER_POS30PERCENT, - BITBANGER_POS35PERCENT, - BITBANGER_POS40PERCENT, - BITBANGER_TUNE_MAX -}; - -/*************************************************************************** - CONSTANTS -***************************************************************************/ - -#define MCFG_BITBANGER_INPUT_CB(_devcb) \ - devcb = &bitbanger_device::set_input_callback(*device, DEVCB2_##_devcb); - -#define MCFG_BITBANGER_DEFAULT_MODE(_mode) \ - bitbanger_device::set_default_mode(*device, _mode); - -#define MCFG_BITBANGER_DEFAULT_BAUD(_baud) \ - bitbanger_device::set_default_baud(*device, _baud); - -#define MCFG_BITBANGER_DEFAULT_TUNE(_tune) \ - bitbanger_device::set_default_tune(*device, _tune); - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - - -class bitbanger_device : public device_t, - public device_image_interface +class bitbanger_device : public device_t, + public device_image_interface { public: // construction/destruction bitbanger_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - template<class _Object> static devcb2_base &set_input_callback(device_t &device, _Object object) { return downcast<bitbanger_device &>(device).m_input_cb.set_callback(object); } - static void set_default_mode(device_t &device, int default_mode) { downcast<bitbanger_device &>(device).m_mode = default_mode; } - static void set_default_baud(device_t &device, int default_baud) { downcast<bitbanger_device &>(device).m_baud = default_baud; } - static void set_default_tune(device_t &device, int default_tune) { downcast<bitbanger_device &>(device).m_tune = default_tune; } - // image-level overrides virtual bool call_load(); - virtual void call_unload(); virtual bool call_create(int format_type, option_resolution *format_options); + virtual void call_unload(); // image device virtual iodevice_t image_type() const { return IO_SERIAL; } @@ -99,67 +29,16 @@ public: virtual const char *file_extensions() const { return ""; } virtual const option_guide *create_option_guide() const { return NULL; } - // outputs data to a bitbanger port - void output(int value); - - // reads the current input value - int input(void) const { return m_current_input; } - - // ui functions - const char *mode_string(void); - const char *baud_string(void); - const char *tune_string(void); - bool inc_mode(bool test); - bool dec_mode(bool test); - bool inc_tune(bool test); - bool dec_tune(bool test); - bool inc_baud(bool test); - bool dec_baud(bool test); + void output(UINT8 data); + UINT32 input(void *buffer, UINT32 length); protected: // device-level overrides virtual void device_start(); - virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); virtual void device_config_complete(); - -private: - // constants - static const device_timer_id TIMER_OUTPUT = 0; - static const device_timer_id TIMER_INPUT = 1; - - // methods - void native_output(UINT8 data); - UINT32 native_input(void *buffer, UINT32 length); - void bytes_to_bits_81N(void); - void timer_input(void); - void timer_output(void); - float tune_value(void); - UINT32 baud_value(void); - void set_input_line(UINT8 line); - - // variables - emu_timer * m_output_timer; - emu_timer * m_input_timer; - - devcb2_write_line m_input_cb; /* callback to driver */ - int m_output_value; - int m_build_count; - int m_build_byte; - attotime m_idle_delay; - attotime m_current_baud; - UINT32 m_input_buffer_size; - UINT32 m_input_buffer_cursor; - int m_mode; /* emulating a printer or modem */ - int m_baud; /* output bits per second */ - int m_tune; /* fine tune adjustment to the baud */ - UINT8 m_current_input; - UINT8 m_input_buffer[1000]; }; // device type definition extern const device_type BITBANGER; -// device iterator -typedef device_type_iterator<&device_creator<bitbanger_device>, bitbanger_device> bitbanger_device_iterator; - #endif /* __BITBNGR_H__ */ diff --git a/src/emu/imagedev/printer.c b/src/emu/imagedev/printer.c index 5c4dfff9317..85f239239e8 100644 --- a/src/emu/imagedev/printer.c +++ b/src/emu/imagedev/printer.c @@ -17,18 +17,10 @@ const device_type PRINTER = &device_creator<printer_image_device>; // printer_image_device - constructor //------------------------------------------------- -printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : device_t(mconfig, PRINTER, "Printer", tag, owner, clock, "printer_image", __FILE__), - device_image_interface(mconfig, *this), - m_online_cb(*this) -{ -} - -//------------------------------------------------- -// printer_image_device - destructor -//------------------------------------------------- - -printer_image_device::~printer_image_device() +printer_image_device::printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : + device_t(mconfig, PRINTER, "Printer", tag, owner, clock, "printer_image", __FILE__), + device_image_interface(mconfig, *this), + m_online_cb(*this) { } diff --git a/src/emu/imagedev/printer.h b/src/emu/imagedev/printer.h index c2d73f409b1..a5f5ffabf52 100644 --- a/src/emu/imagedev/printer.h +++ b/src/emu/imagedev/printer.h @@ -9,10 +9,8 @@ #ifndef __PRINTER_H__ #define __PRINTER_H__ - #define MCFG_PRINTER_ONLINE_CB(_devcb) \ devcb = &printer_image_device::set_online_callback(*device, DEVCB2_##_devcb); - /*************************************************************************** TYPE DEFINITIONS @@ -20,14 +18,13 @@ // ======================> printer_image_device -class printer_image_device : public device_t, - public device_image_interface +class printer_image_device : public device_t, + public device_image_interface { public: // construction/destruction printer_image_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); - virtual ~printer_image_device(); - + template<class _Object> static devcb2_base &set_online_callback(device_t &device, _Object object) { return downcast<printer_image_device &>(device).m_online_cb.set_callback(object); } // image-level overrides @@ -35,14 +32,13 @@ public: virtual bool call_create(int format_type, option_resolution *format_options); virtual void call_unload(); + // image device virtual iodevice_t image_type() const { return IO_PRINTER; } - virtual bool is_readable() const { return 0; } virtual bool is_writeable() const { return 1; } virtual bool is_creatable() const { return 1; } virtual bool must_be_loaded() const { return 0; } virtual bool is_reset_on_load() const { return 0; } - virtual const char *image_interface() const { return NULL; } virtual const char *file_extensions() const { return "prn"; } virtual const option_guide *create_option_guide() const { return NULL; } diff --git a/src/emu/machine/keyboard.c b/src/emu/machine/keyboard.c index 26d1c08f9c2..da65b30f7ea 100644 --- a/src/emu/machine/keyboard.c +++ b/src/emu/machine/keyboard.c @@ -1,7 +1,7 @@ /*************************************************************************** Generic ASCII Keyboard -Use MCFG_ASCII_KEYBOARD_ADD to attach as a generic ascii input device in +Use GENERIC_KEYBOARD to attach as a generic ascii input device in cases where either the driver isn't developed enough yet; or for testing; or for the case of a computer with an inbuilt (not serial) ascii keyboard. diff --git a/src/emu/machine/pc_lpt.c b/src/emu/machine/pc_lpt.c index 266ad2aa992..d489ad02361 100644 --- a/src/emu/machine/pc_lpt.c +++ b/src/emu/machine/pc_lpt.c @@ -7,7 +7,7 @@ #include "emu.h" #include "pc_lpt.h" #include "bus/centronics/covox.h" -#include "bus/centronics/image.h" +#include "bus/centronics/printer.h" const device_type PC_LPT = &device_creator<pc_lpt_device>; @@ -47,13 +47,13 @@ void pc_lpt_device::device_reset() } static SLOT_INTERFACE_START(pc_centronics) - SLOT_INTERFACE("image", CENTRONICS_PRINTER_IMAGE) + SLOT_INTERFACE("printer", CENTRONICS_PRINTER) SLOT_INTERFACE("covox", CENTRONICS_COVOX) SLOT_INTERFACE("covox_stereo", CENTRONICS_COVOX_STEREO) SLOT_INTERFACE_END static MACHINE_CONFIG_FRAGMENT( pc_lpt ) - MCFG_CENTRONICS_ADD("centronics", pc_centronics, "image") + MCFG_CENTRONICS_ADD("centronics", pc_centronics, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_FAULT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit3)) MCFG_CENTRONICS_SELECT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit4)) diff --git a/src/emu/ui/bbcontrl.c b/src/emu/ui/bbcontrl.c deleted file mode 100644 index 7a55b13a968..00000000000 --- a/src/emu/ui/bbcontrl.c +++ /dev/null @@ -1,142 +0,0 @@ -/*************************************************************************** - - ui/bbcontrl.c - - MESS's "bit banger" control - - Copyright Nicola Salmoria and the MAME Team. - Visit http://mamedev.org for licensing and usage restrictions. - -***************************************************************************/ - -#include "emu.h" -#include "ui/menu.h" -#include "ui/bbcontrl.h" - - -/*************************************************************************** - TYPE DEFINITIONS -***************************************************************************/ - -#define BITBANGERCMD_SELECT ((void *) 0x0000) -#define BITBANGERCMD_MODE ((void *) 0x0001) -#define BITBANGERCMD_BAUD ((void *) 0x0002) -#define BITBANGERCMD_TUNE ((void *) 0x0003) - - -/*************************************************************************** - IMPLEMENTATION -***************************************************************************/ - -//------------------------------------------------- -// ctor -//------------------------------------------------- - -ui_menu_mess_bitbanger_control::ui_menu_mess_bitbanger_control(running_machine &machine, render_container *container, bitbanger_device *device) - : ui_menu_device_control<bitbanger_device>(machine, container, device) -{ -} - - -//------------------------------------------------- -// dtor -//------------------------------------------------- - -ui_menu_mess_bitbanger_control::~ui_menu_mess_bitbanger_control() -{ -} - - -//------------------------------------------------- -// populate - populates the main bitbanger control menu -//------------------------------------------------- - -void ui_menu_mess_bitbanger_control::populate() -{ - UINT32 flags = 0, mode_flags = 0, baud_flags = 0, tune_flags = 0; - - if( count() > 0 ) - { - int index = current_index(); - - if( index == (count()-1) ) - flags |= MENU_FLAG_LEFT_ARROW; - else - flags |= MENU_FLAG_RIGHT_ARROW; - } - - if ((current_device() != NULL) && (current_device()->exists())) - { - if (current_device()->inc_mode(TRUE)) - mode_flags |= MENU_FLAG_RIGHT_ARROW; - - if (current_device()->dec_mode(TRUE)) - mode_flags |= MENU_FLAG_LEFT_ARROW; - - if (current_device()->inc_baud(TRUE)) - baud_flags |= MENU_FLAG_RIGHT_ARROW; - - if (current_device()->dec_baud(TRUE)) - baud_flags |= MENU_FLAG_LEFT_ARROW; - - if (current_device()->inc_tune(TRUE)) - tune_flags |= MENU_FLAG_RIGHT_ARROW; - - if (current_device()->dec_tune(TRUE)) - tune_flags |= MENU_FLAG_LEFT_ARROW; - - // name of bitbanger file - item_append(current_device()->device().name(), current_device()->filename(), flags, BITBANGERCMD_SELECT); - item_append("Device Mode:", current_device()->mode_string(), mode_flags, BITBANGERCMD_MODE); - item_append("Baud:", current_device()->baud_string(), baud_flags, BITBANGERCMD_BAUD); - item_append("Baud Tune:", current_device()->tune_string(), tune_flags, BITBANGERCMD_TUNE); - item_append("Protocol:", "8-1-N", 0, NULL); - } - else - { - // no bitbanger loaded - item_append("No Bitbanger Image loaded", NULL, flags, NULL); - } -} - - -//------------------------------------------------- -// handle -//------------------------------------------------- - -void ui_menu_mess_bitbanger_control::handle() -{ - // rebuild the menu - reset(UI_MENU_RESET_REMEMBER_POSITION); - populate(); - - // process the menu - const ui_menu_event *event = process(UI_MENU_PROCESS_LR_REPEAT); - if (event != NULL) - { - switch(event->iptkey) - { - case IPT_UI_LEFT: - if (event->itemref==BITBANGERCMD_SELECT) - previous(); - else if (event->itemref==BITBANGERCMD_MODE) - current_device()->dec_mode(false); - else if (event->itemref==BITBANGERCMD_BAUD) - current_device()->dec_baud(false); - else if (event->itemref==BITBANGERCMD_TUNE) - current_device()->dec_tune(false); - break; - - case IPT_UI_RIGHT: - if (event->itemref==BITBANGERCMD_SELECT) - next(); - else if (event->itemref==BITBANGERCMD_MODE) - current_device()->inc_mode(false); - else if (event->itemref==BITBANGERCMD_BAUD) - current_device()->inc_baud(false); - else if (event->itemref==BITBANGERCMD_TUNE) - current_device()->inc_tune(false); - break; - } - } -} diff --git a/src/emu/ui/bbcontrl.h b/src/emu/ui/bbcontrl.h deleted file mode 100644 index 852a423ff7c..00000000000 --- a/src/emu/ui/bbcontrl.h +++ /dev/null @@ -1,28 +0,0 @@ -/*************************************************************************** - - ui/bbcontrl.h - - MESS's "bit banger" control - - Copyright Nicola Salmoria and the MAME Team. - Visit http://mamedev.org for licensing and usage restrictions. - -***************************************************************************/ - -#pragma once - -#ifndef __UI_BBCONTRL_H__ -#define __UI_BBCONTRL_H__ - -#include "imagedev/bitbngr.h" -#include "ui/devctrl.h" - -class ui_menu_mess_bitbanger_control : public ui_menu_device_control<bitbanger_device> { -public: - ui_menu_mess_bitbanger_control(running_machine &machine, render_container *container, bitbanger_device *bitbanger); - virtual ~ui_menu_mess_bitbanger_control(); - virtual void populate(); - virtual void handle(); -}; - -#endif // __UI_BBCONTRL_H__ diff --git a/src/emu/ui/devctrl.h b/src/emu/ui/devctrl.h index 24a7b743d8b..9be4b7f2127 100644 --- a/src/emu/ui/devctrl.h +++ b/src/emu/ui/devctrl.h @@ -2,7 +2,7 @@ ui/devctrl.h - Device specific control (base class for tapectrl and bbcontrl) + Device specific control (base class for tapectrl) Copyright Nicola Salmoria and the MAME Team. Visit http://mamedev.org for licensing and usage restrictions. diff --git a/src/emu/ui/emenubar.c b/src/emu/ui/emenubar.c index 683df35fa2b..00af8721dcc 100644 --- a/src/emu/ui/emenubar.c +++ b/src/emu/ui/emenubar.c @@ -16,7 +16,6 @@ #include "ui/filesel.h" #include "ui/imginfo.h" #include "ui/tapectrl.h" -#include "ui/bbcontrl.h" #include "ui/swlist.h" #include "ui/viewgfx.h" #include "ui/barcode.h" @@ -266,14 +265,6 @@ void ui_emu_menubar::build_images_menu() menu_item &control_menu = menu.append("Tape Control...", &ui_emu_menubar::tape_control, *this, cassette); control_menu.set_enabled(is_loaded); } - - // bitbanger control - bitbanger_device *bitbanger = dynamic_cast<bitbanger_device *>(image); - if (bitbanger != NULL) - { - menu_item &control_menu = menu.append("Bitbanger Control...", &ui_emu_menubar::bitbanger_control, *this, bitbanger); - control_menu.set_enabled(is_loaded); - } } } @@ -621,16 +612,6 @@ void ui_emu_menubar::tape_control(cassette_image_device *image) //------------------------------------------------- -// bitbanger_control -//------------------------------------------------- - -void ui_emu_menubar::bitbanger_control(bitbanger_device *image) -{ - start_menu(auto_alloc_clear(machine(), ui_menu_mess_bitbanger_control(machine(), container(), image))); -} - - -//------------------------------------------------- // load //------------------------------------------------- diff --git a/src/emu/ui/emenubar.h b/src/emu/ui/emenubar.h index 3ea09746d30..c2274db16c5 100644 --- a/src/emu/ui/emenubar.h +++ b/src/emu/ui/emenubar.h @@ -49,7 +49,6 @@ private: void select_new_game(); void select_from_software_list(device_image_interface *image, software_list_device *swlist); void tape_control(cassette_image_device *image); - void bitbanger_control(bitbanger_device *image); void load(device_image_interface *image); bool has_images(); void set_throttle_rate(float throttle_rate); diff --git a/src/mess/drivers/68ksbc.c b/src/mess/drivers/68ksbc.c index 3a29ece498e..b526c762896 100644 --- a/src/mess/drivers/68ksbc.c +++ b/src/mess/drivers/68ksbc.c @@ -78,7 +78,7 @@ static MACHINE_CONFIG_START( c68ksbc, c68ksbc_state ) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) diff --git a/src/mess/drivers/ace.c b/src/mess/drivers/ace.c index 9145d6007e4..7aa33072eef 100644 --- a/src/mess/drivers/ace.c +++ b/src/mess/drivers/ace.c @@ -753,7 +753,7 @@ static MACHINE_CONFIG_START( ace, ace_state ) MCFG_SNAPSHOT_ADD("snapshot", ace_state, ace, "ace", 1) MCFG_I8255A_ADD(I8255_TAG, ppi_intf) MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_6_5MHz/2, pio_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/altair.c b/src/mess/drivers/altair.c index b70c3f7dbd7..273cbdb99ce 100644 --- a/src/mess/drivers/altair.c +++ b/src/mess/drivers/altair.c @@ -107,7 +107,7 @@ static MACHINE_CONFIG_START( altair, altair_state ) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("mc6850", acia6850_device, write_rxd)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("mc6850", acia6850_device, write_dcd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("mc6850", acia6850_device, write_cts)) diff --git a/src/mess/drivers/altos5.c b/src/mess/drivers/altos5.c index acd440b2cdb..0d1826f8a4f 100644 --- a/src/mess/drivers/altos5.c +++ b/src/mess/drivers/altos5.c @@ -486,7 +486,7 @@ static MACHINE_CONFIG_START( altos5, altos5_state ) MCFG_Z80DART_ADD("z80dart", XTAL_8MHz / 2, dart_intf ) MCFG_Z80SIO0_ADD("z80sio", XTAL_8MHz / 2, sio_intf ) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("z80sio", z80dart_device, rxb_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("z80sio", z80dart_device, dcdb_w)) MCFG_RS232_RI_HANDLER(DEVWRITELINE("z80sio", z80dart_device, rib_w)) diff --git a/src/mess/drivers/amiga.c b/src/mess/drivers/amiga.c index ad5a2bb8f2a..e84ecd42681 100644 --- a/src/mess/drivers/amiga.c +++ b/src/mess/drivers/amiga.c @@ -580,7 +580,7 @@ static MACHINE_CONFIG_START( ntsc, amiga_state ) /* devices */ MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(amiga_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amiga_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(amiga_state, write_centronics_perror)) @@ -802,7 +802,7 @@ static MACHINE_CONFIG_START( a1200n, a1200_state ) /* devices */ MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(amiga_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amiga_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(amiga_state, write_centronics_perror)) @@ -921,7 +921,7 @@ static MACHINE_CONFIG_START( a3000n, amiga_state ) /* devices */ MCFG_DEVICE_ADD("rtc", MSM6242, XTAL_32_768kHz) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(amiga_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amiga_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(amiga_state, write_centronics_perror)) diff --git a/src/mess/drivers/ampro.c b/src/mess/drivers/ampro.c index aba74a481a1..7b2e3a6f27c 100644 --- a/src/mess/drivers/ampro.c +++ b/src/mess/drivers/ampro.c @@ -197,7 +197,7 @@ static MACHINE_CONFIG_START( ampro, ampro_state ) /* Devices */ MCFG_Z80CTC_ADD( "z80ctc", XTAL_16MHz / 4, ctc_intf ) MCFG_Z80DART_ADD("z80dart", XTAL_16MHz / 4, dart_intf ) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("z80dart", z80dart_device, rxa_w)) MCFG_TIMER_DRIVER_ADD_PERIODIC("ctc_tick", ampro_state, ctc_tick, attotime::from_hz(XTAL_16MHz / 8)) diff --git a/src/mess/drivers/amstrad.c b/src/mess/drivers/amstrad.c index 2a721f0a5e2..cbfe321dc01 100644 --- a/src/mess/drivers/amstrad.c +++ b/src/mess/drivers/amstrad.c @@ -895,7 +895,7 @@ static MACHINE_CONFIG_START( amstrad_nofdc, amstrad_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amstrad_state, write_centronics_busy)) /* snapshot */ @@ -976,7 +976,7 @@ static MACHINE_CONFIG_START( cpcplus, amstrad_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(amstrad_state, write_centronics_busy)) /* snapshot */ diff --git a/src/mess/drivers/amust.c b/src/mess/drivers/amust.c index e9ad95789da..03df68e319c 100644 --- a/src/mess/drivers/amust.c +++ b/src/mess/drivers/amust.c @@ -452,7 +452,7 @@ static MACHINE_CONFIG_START( amust, amust_state ) //MCFG_I8251_DTR_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_dtr)) //MCFG_I8251_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - //MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + //MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") //MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_rxd)) //MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_cts)) //MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_dsr)) diff --git a/src/mess/drivers/applix.c b/src/mess/drivers/applix.c index df982bd792e..6cea23d6ac3 100644 --- a/src/mess/drivers/applix.c +++ b/src/mess/drivers/applix.c @@ -896,7 +896,7 @@ static MACHINE_CONFIG_START( applix, applix_state ) MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(applix_state, applix_pb_w)) MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m68000_device, write_irq2)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("via6522", via6522_device, write_ca1)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("via6522", via6522_device, write_pa0)) diff --git a/src/mess/drivers/apricot.c b/src/mess/drivers/apricot.c index 0da6f42a04a..46e23d2316f 100644 --- a/src/mess/drivers/apricot.c +++ b/src/mess/drivers/apricot.c @@ -423,7 +423,7 @@ static MACHINE_CONFIG_START( apricot, apricot_state ) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("ic15", z80dart_device, ctsa_w)) // centronics printer - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("ic15", z80dart_device, ctsb_w)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("ic15", z80dart_device, dcdb_w)) diff --git a/src/mess/drivers/apricotf.c b/src/mess/drivers/apricotf.c index a532c4aa035..0c2cb84beab 100644 --- a/src/mess/drivers/apricotf.c +++ b/src/mess/drivers/apricotf.c @@ -321,7 +321,7 @@ static MACHINE_CONFIG_START( act_f1, f1_state ) MCFG_Z80SIO2_ADD(Z80SIO2_TAG, 2500000, sio_intf) MCFG_Z80CTC_ADD(Z80CTC_TAG, 2500000, ctc_intf) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(Z80SIO2_TAG, z80dart_device, ctsa_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/apricotp.c b/src/mess/drivers/apricotp.c index de7307a4972..c9c71041f51 100644 --- a/src/mess/drivers/apricotp.c +++ b/src/mess/drivers/apricotp.c @@ -606,7 +606,7 @@ static MACHINE_CONFIG_START( fp, fp_state ) MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":0", fp_floppies, "35dd", floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD2797_TAG":1", fp_floppies, NULL, floppy_image_device::default_floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fp_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(fp_state, write_centronics_select)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fp_state, write_centronics_fault)) diff --git a/src/mess/drivers/atarist.c b/src/mess/drivers/atarist.c index a8b141a898b..8cf6985e2c0 100644 --- a/src/mess/drivers/atarist.c +++ b/src/mess/drivers/atarist.c @@ -2126,7 +2126,7 @@ static MACHINE_CONFIG_START( st, st_state ) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, st_state::floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(MC68901_TAG, mc68901_device, i0_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -2213,7 +2213,7 @@ static MACHINE_CONFIG_START( megast, megast_state ) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, st_state::floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(MC68901_TAG, mc68901_device, i0_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -2307,7 +2307,7 @@ static MACHINE_CONFIG_START( ste, ste_state ) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", st_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, st_state::floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(MC68901_TAG, mc68901_device, i0_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -2416,7 +2416,7 @@ static MACHINE_CONFIG_START( stbook, stbook_state ) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":0", atari_floppies, "35dd", 0, st_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1772_TAG ":1", atari_floppies, 0, 0, st_state::floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(MC68901_TAG, mc68901_device, i0_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/atom.c b/src/mess/drivers/atom.c index d661d984dc1..8b031ed9e3c 100644 --- a/src/mess/drivers/atom.c +++ b/src/mess/drivers/atom.c @@ -833,7 +833,7 @@ static MACHINE_CONFIG_START( atom, atom_state ) MCFG_I8271_IRQ_CALLBACK(WRITELINE(atom_state, atom_8271_interrupt_callback)) MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(atom_floppy_interface) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_ca1)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_pa7)) @@ -913,7 +913,7 @@ static MACHINE_CONFIG_START( atombb, atom_state ) MCFG_I8255_ADD(INS8255_TAG, ppi_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_ca1)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE(R6522_TAG, via6522_device, write_pa7)) diff --git a/src/mess/drivers/bbc.c b/src/mess/drivers/bbc.c index 25b2c8db32f..30b0ba92d78 100644 --- a/src/mess/drivers/bbc.c +++ b/src/mess/drivers/bbc.c @@ -769,7 +769,7 @@ static MACHINE_CONFIG_DERIVED( bbcb, bbca ) MCFG_UPD7002_EOC_CB(bbc_state, BBC_uPD7002_EOC) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_ca1)) MCFG_DEVCB_INVERT /* ack seems to be inverted? */ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -828,7 +828,7 @@ static MACHINE_CONFIG_DERIVED( bbcb_us, bbca ) MCFG_UPD7002_EOC_CB(bbc_state, BBC_uPD7002_EOC) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_ca1)) MCFG_DEVCB_INVERT /* ack seems to be inverted? */ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -928,7 +928,7 @@ static MACHINE_CONFIG_START( bbcm, bbc_state ) MCFG_MC146818_ADD( "rtc", XTAL_32_768kHz ) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("via6522_1", via6522_device, write_ca1)) MCFG_DEVCB_INVERT /* ack seems to be inverted? */ MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/binbug.c b/src/mess/drivers/binbug.c index b3577266db1..640eec11754 100644 --- a/src/mess/drivers/binbug.c +++ b/src/mess/drivers/binbug.c @@ -63,7 +63,7 @@ class binbug_state : public driver_device public: binbug_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), - m_keyboard(*this, KEYBOARD_TAG), + m_rs232(*this, KEYBOARD_TAG), m_cass(*this, "cassette"), m_p_videoram(*this, "videoram"), m_p_attribram(*this, "attribram"), @@ -78,7 +78,7 @@ public: UINT8 m_framecnt; virtual void video_start(); UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); - optional_device<serial_keyboard_device> m_keyboard; + optional_device<rs232_port_device> m_rs232; required_device<cassette_image_device> m_cass; required_shared_ptr<UINT8> m_p_videoram; required_shared_ptr<UINT8> m_p_attribram; @@ -92,7 +92,7 @@ WRITE8_MEMBER( binbug_state::binbug_ctrl_w ) READ8_MEMBER( binbug_state::binbug_serial_r ) { - return m_keyboard->tx_r() & (m_cass->input() < 0.03); + return m_rs232->rxd_r() & (m_cass->input() < 0.03); } WRITE_LINE_MEMBER( binbug_state::binbug_serial_w ) @@ -118,11 +118,6 @@ ADDRESS_MAP_END static INPUT_PORTS_START( binbug ) INPUT_PORTS_END -static const serial_keyboard_interface keyboard_intf = -{ - DEVCB_NULL -}; - void binbug_state::video_start() { m_p_chargen = memregion("chargen")->base(); @@ -286,6 +281,14 @@ QUICKLOAD_LOAD_MEMBER( binbug_state, binbug ) return result; } +static DEVICE_INPUT_DEFAULTS_START( keyboard ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_300 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + static MACHINE_CONFIG_START( binbug, binbug_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",S2650, XTAL_1MHz) @@ -306,7 +309,8 @@ static MACHINE_CONFIG_START( binbug, binbug_state ) MCFG_PALETTE_ADD_MONOCHROME_AMBER("palette") /* Keyboard */ - MCFG_SERIAL_KEYBOARD_ADD(KEYBOARD_TAG, keyboard_intf, 300) + MCFG_RS232_PORT_ADD(KEYBOARD_TAG, default_rs232_devices, "keyboard") + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("keyboard", keyboard) /* Cassette */ MCFG_CASSETTE_ADD( "cassette", default_cassette_interface ) diff --git a/src/mess/drivers/bullet.c b/src/mess/drivers/bullet.c index 242cf480763..31725fc8883 100644 --- a/src/mess/drivers/bullet.c +++ b/src/mess/drivers/bullet.c @@ -1052,12 +1052,12 @@ WRITE_LINE_MEMBER( bulletf_state::req_w ) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -1208,7 +1208,7 @@ static MACHINE_CONFIG_START( bullet, bullet_state ) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":6", bullet_8_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":7", bullet_8_floppies, NULL, floppy_image_device::default_floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(bullet_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(bullet_state, write_centronics_perror)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(bullet_state, write_centronics_select)) @@ -1216,9 +1216,9 @@ static MACHINE_CONFIG_START( bullet, bullet_state ) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxa_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w)) @@ -1263,14 +1263,14 @@ static MACHINE_CONFIG_START( bulletf, bulletf_state ) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":8", bullet_35_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(MB8877_TAG":9", bullet_35_floppies, NULL, floppy_image_device::default_floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(bullet_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxa_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w)) diff --git a/src/mess/drivers/bw12.c b/src/mess/drivers/bw12.c index 0ecceaa2365..6ff2a062d2b 100644 --- a/src/mess/drivers/bw12.c +++ b/src/mess/drivers/bw12.c @@ -644,7 +644,7 @@ static MACHINE_CONFIG_START( common, bw12_state ) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(Z80SIO_TAG, z80dart_device, ctsb_w)) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(PIA6821_TAG, pia6821_device, ca1_w)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(bw12_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(bw12_state, write_centronics_fault)) diff --git a/src/mess/drivers/bw2.c b/src/mess/drivers/bw2.c index 62b012d1da7..5d0ca64b2ba 100644 --- a/src/mess/drivers/bw2.c +++ b/src/mess/drivers/bw2.c @@ -622,7 +622,7 @@ static MACHINE_CONFIG_START( bw2, bw2_state ) MCFG_I8255A_ADD(I8255A_TAG, ppi_intf) MCFG_MSM6255_ADD(MSM6255_TAG, XTAL_16MHz, 0, SCREEN_TAG, lcdc_map) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(bw2_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/cat.c b/src/mess/drivers/cat.c index b34bb7f15f8..4b64d263996 100644 --- a/src/mess/drivers/cat.c +++ b/src/mess/drivers/cat.c @@ -370,7 +370,6 @@ ToDo: #include "machine/nvram.h" #include "sound/speaker.h" #include "bus/centronics/ctronics.h" -#include "bus/centronics/image.h" class cat_state : public driver_device { @@ -1245,7 +1244,7 @@ static MACHINE_CONFIG_START( cat, cat_state ) MCFG_MC68681_B_TX_CALLBACK(WRITELINE(cat_state, cat_duart_txb)) MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(cat_state, cat_duart_output)) - MCFG_CENTRONICS_ADD("ctx", centronics_printers, "image") + MCFG_CENTRONICS_ADD("ctx", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(cat_state, prn_ack_ff)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("duartn68681", mc68681_device, ip4_w)) MCFG_DEVCB_XOR(1) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("ctx_data_out", "ctx") diff --git a/src/mess/drivers/coco12.c b/src/mess/drivers/coco12.c index 5dd1780d9bf..6673473c615 100644 --- a/src/mess/drivers/coco12.c +++ b/src/mess/drivers/coco12.c @@ -261,6 +261,13 @@ MACHINE_CONFIG_FRAGMENT( coco_sound ) MACHINE_CONFIG_END +static DEVICE_INPUT_DEFAULTS_START( printer ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END //------------------------------------------------- // MACHINE_CONFIG @@ -293,11 +300,11 @@ static MACHINE_CONFIG_START( coco, coco12_state ) MCFG_SAM6883_ADD(SAM_TAG, XTAL_3_579545MHz, coco12_state::sam6883_config) MCFG_SAM6883_RES_CALLBACK(READ8(coco12_state, sam_read)) MCFG_CASSETTE_ADD("cassette", coco_state::coco_cassette_interface) - MCFG_DEVICE_ADD(BITBANGER_TAG, BITBANGER, 0) - MCFG_BITBANGER_INPUT_CB(WRITELINE(coco_state, bitbanger_callback)) /* callback */ - MCFG_BITBANGER_DEFAULT_MODE(BITBANGER_PRINTER) /* default mode */ - MCFG_BITBANGER_DEFAULT_BAUD(BITBANGER_600) /* default output baud */ - MCFG_BITBANGER_DEFAULT_TUNE(BITBANGER_0PERCENT) /* default fine tune adjustment */ + + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "printer") + MCFG_RS232_DCD_HANDLER(DEVWRITELINE(PIA1_TAG, pia6821_device, ca1_w)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("printer", printer) + MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "pak") // video hardware diff --git a/src/mess/drivers/coco3.c b/src/mess/drivers/coco3.c index 88ed89d2cd2..a928a0054b9 100644 --- a/src/mess/drivers/coco3.c +++ b/src/mess/drivers/coco3.c @@ -223,6 +223,14 @@ static INPUT_PORTS_START( coco3 ) PORT_INCLUDE( coco_rtc ) INPUT_PORTS_END +static DEVICE_INPUT_DEFAULTS_START( printer ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END + //************************************************************************** // MACHINE CONFIGURATION @@ -262,11 +270,11 @@ static MACHINE_CONFIG_START( coco3, coco3_state ) MCFG_PIA_IRQB_HANDLER(WRITELINE(coco_state, pia1_firq_b)) MCFG_CASSETTE_ADD("cassette", coco_state::coco_cassette_interface) - MCFG_DEVICE_ADD(BITBANGER_TAG, BITBANGER, 0) - MCFG_BITBANGER_INPUT_CB(WRITELINE(coco_state, bitbanger_callback)) /* callback */ - MCFG_BITBANGER_DEFAULT_MODE(BITBANGER_PRINTER) /* default mode */ - MCFG_BITBANGER_DEFAULT_BAUD(BITBANGER_600) /* default output baud */ - MCFG_BITBANGER_DEFAULT_TUNE(BITBANGER_0PERCENT) /* default fine tune adjustment */ + + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "printer") + MCFG_RS232_DCD_HANDLER(DEVWRITELINE(PIA1_TAG, pia6821_device, ca1_w)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("printer", printer) + MCFG_COCO_CARTRIDGE_ADD(CARTRIDGE_TAG, coco_state::cartridge_config, coco_cart, "fdcv11") MCFG_COCO_VHD_ADD(VHD0_TAG) MCFG_COCO_VHD_ADD(VHD1_TAG) diff --git a/src/mess/drivers/compis.c b/src/mess/drivers/compis.c index 1c02da02310..236da449794 100644 --- a/src/mess/drivers/compis.c +++ b/src/mess/drivers/compis.c @@ -752,7 +752,7 @@ static MACHINE_CONFIG_START( compis, compis_state ) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, dcdb_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(I8274_TAG, z80dart_device, ctsb_w)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(compis_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(compis_state, write_centronics_select)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/crvision.c b/src/mess/drivers/crvision.c index e6d2ca385ff..88e773d4800 100644 --- a/src/mess/drivers/crvision.c +++ b/src/mess/drivers/crvision.c @@ -886,7 +886,7 @@ static MACHINE_CONFIG_START( creativision, crvision_state ) MCFG_PIA_WRITEPB_HANDLER(DEVWRITE8(SN76489_TAG, sn76496_base_device, write)) MCFG_CASSETTE_ADD("cassette", crvision_cassette_interface) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_DEVICE_ADD("cent_status_in", INPUT_BUFFER, 0) @@ -964,7 +964,7 @@ static MACHINE_CONFIG_START( lasr2001, laser2001_state ) MCFG_CASSETTE_ADD("cassette", lasr2001_cassette_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(laser2001_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/dectalk.c b/src/mess/drivers/dectalk.c index 6a78e8e8bc6..a96901fdcee 100644 --- a/src/mess/drivers/dectalk.c +++ b/src/mess/drivers/dectalk.c @@ -908,7 +908,7 @@ static MACHINE_CONFIG_START( dectalk, dectalk_state ) /* Y2 is a 3.579545 MHz xtal for the dtmf decoder chip */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duartn68681", mc68681_device, rx_b_w)) MACHINE_CONFIG_END diff --git a/src/mess/drivers/einstein.c b/src/mess/drivers/einstein.c index c7052536777..951a64fc4cf 100644 --- a/src/mess/drivers/einstein.c +++ b/src/mess/drivers/einstein.c @@ -775,7 +775,7 @@ static MACHINE_CONFIG_START( einstein, einstein_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(IC_I063, z80pio_device, strobe_a)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(einstein_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(einstein_state, write_centronics_perror)) diff --git a/src/mess/drivers/elwro800.c b/src/mess/drivers/elwro800.c index bc0b88ee755..ffd5d8e411a 100644 --- a/src/mess/drivers/elwro800.c +++ b/src/mess/drivers/elwro800.c @@ -586,7 +586,7 @@ static MACHINE_CONFIG_START( elwro800, elwro800_state ) MCFG_I8255A_ADD( "ppi8255", elwro800jr_ppi8255_interface) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(elwro800_state, write_centronics_ack)) diff --git a/src/mess/drivers/ep64.c b/src/mess/drivers/ep64.c index c71b195ff0f..5efee2561bb 100644 --- a/src/mess/drivers/ep64.c +++ b/src/mess/drivers/ep64.c @@ -539,7 +539,7 @@ static MACHINE_CONFIG_START( ep64, ep64_state ) MCFG_EP64_EXPANSION_BUS_SLOT_NMI_CALLBACK(INPUTLINE(Z80_TAG, INPUT_LINE_NMI)) MCFG_EP64_EXPANSION_BUS_SLOT_WAIT_CALLBACK(INPUTLINE(Z80_TAG, Z80_INPUT_LINE_WAIT)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(ep64_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/exp85.c b/src/mess/drivers/exp85.c index bb574febb38..674edc2d784 100644 --- a/src/mess/drivers/exp85.c +++ b/src/mess/drivers/exp85.c @@ -164,12 +164,12 @@ WRITE_LINE_MEMBER( exp85_state::sod_w ) /* Terminal Interface */ static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END /* Machine Initialization */ @@ -217,8 +217,8 @@ static MACHINE_CONFIG_START( exp85, exp85_state ) MCFG_I8355_OUT_PA_CB(WRITE8(exp85_state, i8355_a_w)) MCFG_CASSETTE_ADD("cassette", exp85_cassette_interface) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/drivers/fm7.c b/src/mess/drivers/fm7.c index fd694d2b626..5dc31695774 100644 --- a/src/mess/drivers/fm7.c +++ b/src/mess/drivers/fm7.c @@ -2052,7 +2052,7 @@ static MACHINE_CONFIG_START( fm7, fm7_state ) MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_SLOT_OPTION_ADD( "dsjoy", DEMPA_SHINBUNSHA_JOYSTICK ) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fm7_state, write_centronics_fault)) @@ -2101,7 +2101,7 @@ static MACHINE_CONFIG_START( fm8, fm7_state ) MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fm7_state, write_centronics_fault)) MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(fm7_state, write_centronics_ack)) @@ -2151,7 +2151,7 @@ static MACHINE_CONFIG_START( fm77av, fm7_state ) MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fm7_state, write_centronics_fault)) MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(fm7_state, write_centronics_ack)) @@ -2204,7 +2204,7 @@ static MACHINE_CONFIG_START( fm11, fm7_state ) MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fm7_state, write_centronics_fault)) MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(fm7_state, write_centronics_ack)) @@ -2251,7 +2251,7 @@ static MACHINE_CONFIG_START( fm16beta, fm7_state ) MCFG_MB8877_ADD("fdc",fm7_mb8877a_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(fm7_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(fm7_state, write_centronics_fault)) MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(fm7_state, write_centronics_ack)) diff --git a/src/mess/drivers/h89.c b/src/mess/drivers/h89.c index 656e1bcee92..f9768fd18c9 100644 --- a/src/mess/drivers/h89.c +++ b/src/mess/drivers/h89.c @@ -109,12 +109,12 @@ WRITE8_MEMBER( h89_state::port_f2_w ) } static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END static const ins8250_interface h89_ins8250_interface = @@ -135,9 +135,9 @@ static MACHINE_CONFIG_START( h89, h89_state ) MCFG_INS8250_ADD( "ins8250", h89_ins8250_interface, XTAL_1_8432MHz ) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("ins8250", ins8250_uart_device, rx_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_TIMER_DRIVER_ADD_PERIODIC("irq_timer", h89_state, h89_irq_timer, attotime::from_hz(100)) MACHINE_CONFIG_END diff --git a/src/mess/drivers/horizon.c b/src/mess/drivers/horizon.c index 3d7d080dd87..3ccb0be3edd 100644 --- a/src/mess/drivers/horizon.c +++ b/src/mess/drivers/horizon.c @@ -97,12 +97,12 @@ INPUT_PORTS_END //************************************************************************** static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -149,10 +149,10 @@ static MACHINE_CONFIG_START( horizon, horizon_state ) MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_dtr)) MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_L_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_L_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_DEVICE_ADD(I8251_R_TAG, I8251, 0) MCFG_I8251_TXD_HANDLER(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_txd)) diff --git a/src/mess/drivers/ht68k.c b/src/mess/drivers/ht68k.c index 96c4e31117c..1bdb9011bfb 100644 --- a/src/mess/drivers/ht68k.c +++ b/src/mess/drivers/ht68k.c @@ -132,7 +132,7 @@ static MACHINE_CONFIG_START( ht68k, ht68k_state ) MCFG_MC68681_B_TX_CALLBACK(WRITELINE(ht68k_state, duart_txb)) MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(ht68k_state, duart_output)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart68681", mc68681_device, rx_a_w)) MCFG_WD1770x_ADD("wd1770", XTAL_8MHz ) diff --git a/src/mess/drivers/indiana.c b/src/mess/drivers/indiana.c index 49baf38afb9..0bc285e4314 100644 --- a/src/mess/drivers/indiana.c +++ b/src/mess/drivers/indiana.c @@ -71,10 +71,13 @@ SLOT_INTERFACE_START( indiana_isa_cards ) SLOT_INTERFACE("ide", ISA16_IDE) SLOT_INTERFACE_END -static struct serial_keyboard_interface keyboard_interface = -{ - DEVCB_DEVICE_LINE_MEMBER(MFP_TAG, mc68901_device, write_rx) -}; +static DEVICE_INPUT_DEFAULTS_START( keyboard ) + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_1200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) +DEVICE_INPUT_DEFAULTS_END static MACHINE_CONFIG_START( indiana, indiana_state ) /* basic machine hardware */ @@ -93,9 +96,11 @@ static MACHINE_CONFIG_START( indiana, indiana_state ) MCFG_MC68901_TIMER_CLOCK(XTAL_16MHz/4) MCFG_MC68901_RX_CLOCK(0) MCFG_MC68901_TX_CLOCK(0) - MCFG_MC68901_OUT_SO_CB(DEVWRITELINE("keyboard", serial_keyboard_device, input_txd)) + MCFG_MC68901_OUT_SO_CB(DEVWRITELINE("keyboard", rs232_port_device, write_txd)) - MCFG_SERIAL_KEYBOARD_ADD("keyboard", keyboard_interface, 1200) + MCFG_RS232_PORT_ADD("keyboard", default_rs232_devices, "keyboard") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MFP_TAG, mc68901_device, write_rx)) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("keyboard", keyboard) MACHINE_CONFIG_END /* ROM definition */ diff --git a/src/mess/drivers/isbc.c b/src/mess/drivers/isbc.c index 11258b5e27d..2225230783b 100644 --- a/src/mess/drivers/isbc.c +++ b/src/mess/drivers/isbc.c @@ -136,21 +136,21 @@ static INPUT_PORTS_START( isbc ) INPUT_PORTS_END static DEVICE_INPUT_DEFAULTS_START( isbc86_terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x01 ) // 300 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x01 ) // 300 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x03 ) // 2 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_300 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_300 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 ) DEVICE_INPUT_DEFAULTS_END static DEVICE_INPUT_DEFAULTS_START( isbc286_terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END WRITE_LINE_MEMBER( isbc_state::isbc86_tmr2_w ) @@ -261,11 +261,11 @@ static MACHINE_CONFIG_START( isbc86, isbc_state ) MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE("pic_0", pic8259_device, ir6_w)) /* video hardware */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_cts)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE("uart8251", i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", isbc86_terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", isbc86_terminal) MACHINE_CONFIG_END static MACHINE_CONFIG_START( rpc86, isbc_state ) @@ -319,7 +319,7 @@ static MACHINE_CONFIG_START( isbc286, isbc_state ) MCFG_I8255A_ADD("ppi", isbc286_ppi_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(isbc_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_CENTRONICS_FAULT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit6)) @@ -335,11 +335,11 @@ static MACHINE_CONFIG_START( isbc286, isbc_state ) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart8274", z80dart_device, dcda_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart8274", z80dart_device, ctsa_w)) - MCFG_RS232_PORT_ADD("rs232b", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232b", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("uart8274", z80dart_device, rxb_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE("uart8274", z80dart_device, dcdb_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("uart8274", z80dart_device, ctsb_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", isbc286_terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", isbc286_terminal) MCFG_ISBX_SLOT_ADD("sbx1", 0, isbx_cards, NULL) MCFG_ISBX_SLOT_MINTR0_CALLBACK(DEVWRITELINE("pic_1", pic8259_device, ir3_w)) diff --git a/src/mess/drivers/jtc.c b/src/mess/drivers/jtc.c index 5b589773841..72165607cfb 100644 --- a/src/mess/drivers/jtc.c +++ b/src/mess/drivers/jtc.c @@ -743,7 +743,7 @@ static MACHINE_CONFIG_START( basic, jtc_state ) MCFG_CASSETTE_ADD("cassette", jtc_cassette_interface) /* printer */ - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(jtc_state, write_centronics_busy)) MACHINE_CONFIG_END diff --git a/src/mess/drivers/kaypro.c b/src/mess/drivers/kaypro.c index aae03beb043..eaa6186e7a4 100644 --- a/src/mess/drivers/kaypro.c +++ b/src/mess/drivers/kaypro.c @@ -222,7 +222,7 @@ static MACHINE_CONFIG_START( kayproii, kaypro_state ) /* devices */ MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro, "com,cpm", 3) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(kaypro_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -281,7 +281,7 @@ static MACHINE_CONFIG_START( kaypro2x, kaypro_state ) MCFG_MC6845_ADD("crtc", MC6845, "screen", 2000000, kaypro2x_crtc) /* comes out of ULA - needs to be measured */ MCFG_QUICKLOAD_ADD("quickload", kaypro_state, kaypro, "com,cpm", 3) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(kaypro_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/kyocera.c b/src/mess/drivers/kyocera.c index cd6df8220a8..1d65c8cfe01 100644 --- a/src/mess/drivers/kyocera.c +++ b/src/mess/drivers/kyocera.c @@ -1392,7 +1392,7 @@ static MACHINE_CONFIG_START( kc85, kc85_state ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IM6402_TAG, im6402_device, write_rri)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(kc85_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(kc85_state, write_centronics_select)) @@ -1438,7 +1438,7 @@ static MACHINE_CONFIG_START( pc8201, pc8201_state ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IM6402_TAG, im6402_device, write_rri)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(kc85_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(kc85_state, write_centronics_select)) @@ -1496,7 +1496,7 @@ static MACHINE_CONFIG_START( trsm100, trsm100_state ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(IM6402_TAG, im6402_device, write_rri)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CASSETTE_ADD("cassette", kc85_cassette_interface) // MCFG_MC14412_ADD(MC14412_TAG, XTAL_1MHz) @@ -1555,7 +1555,7 @@ static MACHINE_CONFIG_START( tandy200, tandy200_state ) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) // MCFG_MC14412_ADD(MC14412_TAG, XTAL_1MHz) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(tandy200_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(tandy200_state, write_centronics_select)) diff --git a/src/mess/drivers/m5.c b/src/mess/drivers/m5.c index 5c8f960c4e1..c7f3fb67a93 100644 --- a/src/mess/drivers/m5.c +++ b/src/mess/drivers/m5.c @@ -640,7 +640,7 @@ static MACHINE_CONFIG_START( m5, m5_state ) // devices MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_14_31818MHz/4, ctc_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(m5_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/mbee.c b/src/mess/drivers/mbee.c index 76ea6a35020..daa8cf051b9 100644 --- a/src/mess/drivers/mbee.c +++ b/src/mess/drivers/mbee.c @@ -765,7 +765,7 @@ static MACHINE_CONFIG_START( mbee, mbee_state ) MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com,bee", 2) MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -811,7 +811,7 @@ static MACHINE_CONFIG_START( mbeeic, mbee_state ) MCFG_QUICKLOAD_ADD("quickload", mbee_state, mbee, "mwb,com,bee", 2) MCFG_QUICKLOAD_ADD("quickload2", mbee_state, mbee_z80bin, "bin", 2) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/mc1000.c b/src/mess/drivers/mc1000.c index 96f27d6ad50..78d0997e2ae 100644 --- a/src/mess/drivers/mc1000.c +++ b/src/mess/drivers/mc1000.c @@ -468,7 +468,7 @@ static MACHINE_CONFIG_START( mc1000, mc1000_state ) /* devices */ MCFG_CASSETTE_ADD("cassette", mc1000_cassette_interface) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(mc1000_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/mc1502.c b/src/mess/drivers/mc1502.c index 39214f7c5b8..e04c63d6f38 100644 --- a/src/mess/drivers/mc1502.c +++ b/src/mess/drivers/mc1502.c @@ -320,7 +320,7 @@ static MACHINE_CONFIG_START( mc1502, mc1502_state ) MCFG_SOUND_ADD("speaker", SPEAKER_SOUND, 0) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit6)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_CENTRONICS_FAULT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit4)) diff --git a/src/mess/drivers/msx.c b/src/mess/drivers/msx.c index cba950ede8b..c224dca1c7e 100644 --- a/src/mess/drivers/msx.c +++ b/src/mess/drivers/msx.c @@ -1110,7 +1110,7 @@ static MACHINE_CONFIG_START( msx, msx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_SLOT_OPTION_ADD( "covox", CENTRONICS_COVOX ) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1)) @@ -1208,7 +1208,7 @@ static MACHINE_CONFIG_START( msx2, msx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_SLOT_OPTION_ADD( "covox", CENTRONICS_COVOX ) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1)) @@ -1278,7 +1278,7 @@ static MACHINE_CONFIG_START( msx2p, msx_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.40) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_SLOT_OPTION_ADD( "covox", CENTRONICS_COVOX ) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit1)) diff --git a/src/mess/drivers/mtx.c b/src/mess/drivers/mtx.c index 40d63672171..feb642f42d2 100644 --- a/src/mess/drivers/mtx.c +++ b/src/mess/drivers/mtx.c @@ -363,7 +363,7 @@ static MACHINE_CONFIG_START( mtx512, mtx_state ) MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_4MHz, ctc_intf ) MCFG_TIMER_DRIVER_ADD_PERIODIC("z80ctc_timer", mtx_state, ctc_tick, attotime::from_hz(XTAL_4MHz/13)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(mtx_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(mtx_state, write_centronics_fault)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(mtx_state, write_centronics_perror)) diff --git a/src/mess/drivers/mz700.c b/src/mess/drivers/mz700.c index 3b62320d44b..05248c74997 100644 --- a/src/mess/drivers/mz700.c +++ b/src/mess/drivers/mz700.c @@ -404,7 +404,7 @@ static MACHINE_CONFIG_DERIVED( mz800, mz700 ) MCFG_Z80PIO_ADD("z80pio", XTAL_17_73447MHz/5, mz800_z80pio_config) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") MACHINE_CONFIG_END diff --git a/src/mess/drivers/nc.c b/src/mess/drivers/nc.c index c8c24c7043b..1457c9de8a9 100644 --- a/src/mess/drivers/nc.c +++ b/src/mess/drivers/nc.c @@ -1428,7 +1428,7 @@ static MACHINE_CONFIG_START( nc100, nc_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(nc_state, write_nc100_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(nc_state, write_centronics_busy)) diff --git a/src/mess/drivers/ob68k1a.c b/src/mess/drivers/ob68k1a.c index f34f3a0cbd6..85574a81491 100644 --- a/src/mess/drivers/ob68k1a.c +++ b/src/mess/drivers/ob68k1a.c @@ -244,7 +244,7 @@ static MACHINE_CONFIG_START( ob68k1a, ob68k1a_state ) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE(RS232_A_TAG, rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MC6850_0_TAG, acia6850_device, write_rxd)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(MC6850_0_TAG, acia6850_device, write_dcd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(MC6850_0_TAG, acia6850_device, write_cts)) diff --git a/src/mess/drivers/oric.c b/src/mess/drivers/oric.c index b1a09433cd0..0692ea83602 100644 --- a/src/mess/drivers/oric.c +++ b/src/mess/drivers/oric.c @@ -811,7 +811,7 @@ static MACHINE_CONFIG_START( oric, oric_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("via6522", via6522_device, write_ca1)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/pc1512.c b/src/mess/drivers/pc1512.c index aa5250bc6c7..24456da71e9 100644 --- a/src/mess/drivers/pc1512.c +++ b/src/mess/drivers/pc1512.c @@ -1291,7 +1291,7 @@ static MACHINE_CONFIG_START( pc1512, pc1512_state ) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", pc1512_floppies, NULL, pc1512_state::floppy_formats) MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc1512_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(pc1512_state, write_centronics_perror)) @@ -1391,7 +1391,7 @@ static MACHINE_CONFIG_START( pc1640, pc1640_state ) MCFG_FLOPPY_DRIVE_ADD(PC_FDC_XT_TAG ":1", pc1512_floppies, NULL, pc1512_state::floppy_formats) MCFG_INS8250_ADD(INS8250_TAG, uart_intf, XTAL_1_8432MHz) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc1512_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(pc1512_state, write_centronics_perror)) diff --git a/src/mess/drivers/pc8001.c b/src/mess/drivers/pc8001.c index 56f1422dca5..378e87679d3 100644 --- a/src/mess/drivers/pc8001.c +++ b/src/mess/drivers/pc8001.c @@ -555,7 +555,7 @@ static MACHINE_CONFIG_START( pc8001, pc8001_state ) MCFG_UPD3301_DRAW_CHARACTER_CALLBACK_OWNER(pc8001_state, pc8001_display_pixels) MCFG_UPD3301_VRTC_CALLBACK(DEVWRITELINE(I8257_TAG, i8257_device, i8257_drq2_w)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc8001_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc8001_state, write_centronics_busy)) @@ -611,7 +611,7 @@ static MACHINE_CONFIG_START( pc8001mk2, pc8001mk2_state ) MCFG_UPD3301_DRAW_CHARACTER_CALLBACK_OWNER(pc8001_state, pc8001_display_pixels) MCFG_UPD3301_VRTC_CALLBACK(DEVWRITELINE(I8257_TAG, i8257_device, i8257_drq2_w)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/pc8801.c b/src/mess/drivers/pc8801.c index 813884feb60..1bcd9d3b7f9 100644 --- a/src/mess/drivers/pc8801.c +++ b/src/mess/drivers/pc8801.c @@ -2650,7 +2650,7 @@ static MACHINE_CONFIG_START( pc8801, pc8801_state ) MCFG_I8214_ADD(I8214_TAG, MASTER_CLOCK, pic_intf) #endif MCFG_UPD1990A_ADD(UPD1990A_TAG, XTAL_32_768kHz, NULL, NULL) - //MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + //MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CASSETTE_ADD("cassette", pc8801_cassette_interface) MCFG_SOFTWARE_LIST_ADD("tape_list","pc8801_cass") diff --git a/src/mess/drivers/pencil2.c b/src/mess/drivers/pencil2.c index c5f1c2c84a6..b7fc3fefc0c 100644 --- a/src/mess/drivers/pencil2.c +++ b/src/mess/drivers/pencil2.c @@ -322,7 +322,7 @@ static MACHINE_CONFIG_START( pencil2, pencil2_state ) // MCFG_CARTSLOT_INTERFACE("pencil2_cart") /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pencil2_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pencil2_state, write_centronics_busy)) diff --git a/src/mess/drivers/phc25.c b/src/mess/drivers/phc25.c index 734e8d2e84c..fb77b46202f 100644 --- a/src/mess/drivers/phc25.c +++ b/src/mess/drivers/phc25.c @@ -380,7 +380,7 @@ static MACHINE_CONFIG_START( phc25, phc25_state ) /* devices */ MCFG_CASSETTE_ADD("cassette", phc25_cassette_interface) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(phc25_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/pipbug.c b/src/mess/drivers/pipbug.c index 06e3452e406..b4ff3876ffb 100644 --- a/src/mess/drivers/pipbug.c +++ b/src/mess/drivers/pipbug.c @@ -81,12 +81,12 @@ static INPUT_PORTS_START( pipbug ) INPUT_PORTS_END static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x0d ) // 110 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x0d ) // 110 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_110 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END QUICKLOAD_LOAD_MEMBER( pipbug_state, pipbug ) @@ -161,9 +161,9 @@ static MACHINE_CONFIG_START( pipbug, pipbug_state ) MCFG_S2650_FLAG_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) /* video hardware */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("maincpu", s2650_device, write_sense)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) /* quickload */ MCFG_QUICKLOAD_ADD("quickload", pipbug_state, pipbug, "pgm", 1) diff --git a/src/mess/drivers/portfoli.c b/src/mess/drivers/portfoli.c index 6131e182ee9..852e8fdf151 100644 --- a/src/mess/drivers/portfoli.c +++ b/src/mess/drivers/portfoli.c @@ -864,7 +864,7 @@ static MACHINE_CONFIG_START( portfolio, portfolio_state ) /* devices */ MCFG_I8255A_ADD(M82C55A_TAG, ppi_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit5)) MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit4)) MCFG_CENTRONICS_FAULT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit3)) diff --git a/src/mess/drivers/prof180x.c b/src/mess/drivers/prof180x.c index 0af303f058a..bb96eb6fe7c 100644 --- a/src/mess/drivers/prof180x.c +++ b/src/mess/drivers/prof180x.c @@ -254,7 +254,7 @@ static MACHINE_CONFIG_START( prof180x, prof180x_state ) MCFG_FLOPPY_DRIVE_ADD(FDC9268_TAG ":3", prof180x_floppies, "35dd", floppy_image_device::default_floppy_formats) //MCFG_RTC8583_ADD(MK3835_TAG, rtc_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/pulsar.c b/src/mess/drivers/pulsar.c index 34831f88abe..9acc5b0341c 100644 --- a/src/mess/drivers/pulsar.c +++ b/src/mess/drivers/pulsar.c @@ -186,12 +186,12 @@ static I8255_INTERFACE( ppi_intf ) }; static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END static Z80DART_INTERFACE( dart_intf ) @@ -262,10 +262,10 @@ static MACHINE_CONFIG_START( pulsar, pulsar_state ) MCFG_Z80DART_ADD("z80dart", XTAL_4MHz, dart_intf ) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("z80dart", z80dart_device, rxa_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("z80dart", z80dart_device, ctsa_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_DEVICE_ADD("brg", COM8116, XTAL_5_0688MHz) MCFG_COM8116_FR_HANDLER(WRITELINE(pulsar_state, fr_w)) diff --git a/src/mess/drivers/px4.c b/src/mess/drivers/px4.c index c10316aff21..60ecfb711c5 100644 --- a/src/mess/drivers/px4.c +++ b/src/mess/drivers/px4.c @@ -1400,7 +1400,7 @@ static MACHINE_CONFIG_START( px4, px4_state ) MCFG_RAM_DEFAULT_SIZE("64k") // centronics printer - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(px4_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(px4_state, write_centronics_perror)) diff --git a/src/mess/drivers/qx10.c b/src/mess/drivers/qx10.c index f3ac3327ea2..0d0915726cb 100644 --- a/src/mess/drivers/qx10.c +++ b/src/mess/drivers/qx10.c @@ -85,7 +85,7 @@ public: required_device<upd765a_device> m_fdc; required_device<upd7220_device> m_hgdc; required_device<mc146818_device> m_rtc; - required_device<qx10_keyboard_device> m_kbd; + required_device<rs232_port_device> m_kbd; UINT8 m_vram_bank; //required_shared_ptr<UINT8> m_video_ram; UINT8 *m_video_ram; @@ -462,7 +462,7 @@ static UPD7201_INTERFACE(qx10_upd7201_interface) { 0, 0, 0, 0, // channel b clock set by pit2 channel 2 - DEVCB_DEVICE_LINE_MEMBER("kbd", serial_keyboard_device, input_txd), + DEVCB_DEVICE_LINE_MEMBER("kbd", rs232_port_device, write_txd), DEVCB_NULL, DEVCB_NULL, DEVCB_NULL, @@ -481,11 +481,6 @@ static UPD7201_INTERFACE(qx10_upd7201_interface) DEVCB_NULL }; -static struct serial_keyboard_interface qx10_keyboard_interface = -{ - DEVCB_DEVICE_LINE_MEMBER("upd7201", z80dart_device, rxa_w) -}; - WRITE_LINE_MEMBER(qx10_state::keyboard_irq) { m_scc->m1_r(); // always set @@ -797,6 +792,10 @@ static ADDRESS_MAP_START( upd7220_map, AS_0, 8, qx10_state ) AM_RANGE(0x00000, 0x5ffff) AM_READWRITE(vram_r,vram_w) ADDRESS_MAP_END +static SLOT_INTERFACE_START(keyboard) + SLOT_INTERFACE("qx10", QX10_KEYBOARD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_START( qx10, qx10_state ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu",Z80, MAIN_CLK / 4) @@ -867,7 +866,8 @@ static MACHINE_CONFIG_START( qx10, qx10_state ) MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE("upd7201", upd7201_device, rxb_w)) - MCFG_QX10_KEYBOARD_ADD("kbd", qx10_keyboard_interface) + MCFG_RS232_PORT_ADD("kbd", keyboard, "qx10") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE("upd7201", z80dart_device, rxa_w)) /* internal ram */ MCFG_RAM_ADD(RAM_TAG) diff --git a/src/mess/drivers/rmnimbus.c b/src/mess/drivers/rmnimbus.c index 6f5c812d839..6fba0afbf90 100644 --- a/src/mess/drivers/rmnimbus.c +++ b/src/mess/drivers/rmnimbus.c @@ -331,7 +331,7 @@ static MACHINE_CONFIG_START( nimbus, rmnimbus_state ) MCFG_VIA6522_CA2_HANDLER(DEVWRITELINE(CENTRONICS_TAG, centronics_device, write_strobe)) MCFG_VIA6522_IRQ_HANDLER(WRITELINE(rmnimbus_state,nimbus_via_irq_w)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(rmnimbus_state, nimbus_ack_w)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/sage2.c b/src/mess/drivers/sage2.c index 38bbdbb4994..0e21d5b9c7b 100644 --- a/src/mess/drivers/sage2.c +++ b/src/mess/drivers/sage2.c @@ -417,12 +417,12 @@ WRITE_LINE_MEMBER( sage2_state::fdc_irq ) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -490,10 +490,10 @@ static MACHINE_CONFIG_START( sage2, sage2_state ) MCFG_I8251_RXRDY_HANDLER(DEVWRITELINE(M68000_TAG, m68000_base_device, write_irq5)) MCFG_I8251_TXRDY_HANDLER(DEVWRITELINE(I8259_TAG, pic8259_device, ir2_w)) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_0_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_0_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_DEVICE_ADD(I8251_1_TAG, I8251, 0) MCFG_I8251_TXD_HANDLER(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_txd)) @@ -509,7 +509,7 @@ static MACHINE_CONFIG_START( sage2, sage2_state ) MCFG_UPD765A_ADD(UPD765_TAG, false, false) MCFG_UPD765_INTRQ_CALLBACK(WRITELINE(sage2_state, fdc_irq)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(sage2_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(sage2_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(sage2_state, write_centronics_perror)) diff --git a/src/mess/drivers/samcoupe.c b/src/mess/drivers/samcoupe.c index 5b2bf820979..0e45a08ceaa 100644 --- a/src/mess/drivers/samcoupe.c +++ b/src/mess/drivers/samcoupe.c @@ -552,12 +552,12 @@ static MACHINE_CONFIG_START( samcoupe, samcoupe_state ) MCFG_PALETTE_INIT_OWNER(samcoupe_state, samcoupe) /* devices */ - MCFG_CENTRONICS_ADD("lpt1", centronics_printers, "image") + MCFG_CENTRONICS_ADD("lpt1", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(samcoupe_state, write_lpt1_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("lpt1_data_out", "lpt1") - MCFG_CENTRONICS_ADD("lpt2", centronics_printers, "image") + MCFG_CENTRONICS_ADD("lpt2", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(samcoupe_state, write_lpt2_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("lpt2_data_out", "lpt2") diff --git a/src/mess/drivers/sdk86.c b/src/mess/drivers/sdk86.c index af26134794e..f993fb8157a 100644 --- a/src/mess/drivers/sdk86.c +++ b/src/mess/drivers/sdk86.c @@ -138,12 +138,12 @@ WRITE_LINE_MEMBER( sdk86_state::write_usart_clock ) } static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x05 ) // 4800 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x05 ) // 4800 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x03 ) // 2 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_4800 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_4800 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_2 ) DEVICE_INPUT_DEFAULTS_END static MACHINE_CONFIG_START( sdk86, sdk86_state ) @@ -161,10 +161,10 @@ static MACHINE_CONFIG_START( sdk86, sdk86_state ) MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) MCFG_I8251_RTS_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_cts)) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_DEVICE_ADD("usart_clock", CLOCK, 307200) MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk86_state, write_usart_clock)) diff --git a/src/mess/drivers/sg1000.c b/src/mess/drivers/sg1000.c index fb139a2986a..9a821d1d754 100644 --- a/src/mess/drivers/sg1000.c +++ b/src/mess/drivers/sg1000.c @@ -879,7 +879,7 @@ static MACHINE_CONFIG_START( sf7000, sf7000_state ) MCFG_UPD765A_ADD(UPD765_TAG, false, false) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", sf7000_floppies, "3ssdd", sf7000_state::floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/sgi_ip2.c b/src/mess/drivers/sgi_ip2.c index 24cdc3ea419..9f2faab7c8c 100644 --- a/src/mess/drivers/sgi_ip2.c +++ b/src/mess/drivers/sgi_ip2.c @@ -37,11 +37,11 @@ ****************************************************************************/ #include "emu.h" +#include "bus/rs232/rs232.h" #include "sound/dac.h" #include "cpu/m68000/m68000.h" #include "machine/mc146818.h" /* TOD clock */ #include "machine/mc68681.h" /* DUART0, DUART1 */ -#include "bus/rs232/rs232.h" #include "machine/terminal.h" #define TERMINAL_TAG "terminal" @@ -409,12 +409,12 @@ WRITE_LINE_MEMBER(sgi_ip2_state::duartb_irq_handler) }; static DEVICE_INPUT_DEFAULTS_START( ip2_terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END static MACHINE_CONFIG_START( sgi_ip2, sgi_ip2_state ) @@ -431,9 +431,9 @@ static MACHINE_CONFIG_START( sgi_ip2, sgi_ip2_state ) MCFG_MC146818_ADD( "rtc", XTAL_4_194304Mhz ) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("duart68681a", mc68681_device, rx_b_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", ip2_terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", ip2_terminal) /* sound hardware */ MCFG_SPEAKER_STANDARD_MONO("mono") diff --git a/src/mess/drivers/softbox.c b/src/mess/drivers/softbox.c index 31dcb6375ac..ff4640f1c6d 100644 --- a/src/mess/drivers/softbox.c +++ b/src/mess/drivers/softbox.c @@ -319,12 +319,12 @@ static I8255A_INTERFACE( ppi1_intf ) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x02 ) // 7 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x02 ) // E - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_7 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_EVEN ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -400,10 +400,10 @@ static MACHINE_CONFIG_START( softbox, softbox_state ) MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_I8255A_ADD(I8255_0_TAG, ppi0_intf) MCFG_I8255A_ADD(I8255_1_TAG, ppi1_intf) diff --git a/src/mess/drivers/super6.c b/src/mess/drivers/super6.c index 0d9c2320d0b..935b84d08db 100644 --- a/src/mess/drivers/super6.c +++ b/src/mess/drivers/super6.c @@ -498,12 +498,12 @@ static const z80_daisy_config super6_daisy_chain[] = static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x08 ) // 19200 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_19200 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -568,9 +568,9 @@ static MACHINE_CONFIG_START( super6, super6_state ) MCFG_Z80DART_ADD(Z80DART_TAG, XTAL_24MHz/4, dart_intf) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxa_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w)) diff --git a/src/mess/drivers/super80.c b/src/mess/drivers/super80.c index 9239649b3a6..b0631e8bf62 100644 --- a/src/mess/drivers/super80.c +++ b/src/mess/drivers/super80.c @@ -664,7 +664,7 @@ static MACHINE_CONFIG_START( super80, super80_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -740,7 +740,7 @@ static MACHINE_CONFIG_START( super80v, super80_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/superslave.c b/src/mess/drivers/superslave.c index 68853d585f9..3af36db8f92 100644 --- a/src/mess/drivers/superslave.c +++ b/src/mess/drivers/superslave.c @@ -341,12 +341,12 @@ static Z80PIO_INTERFACE( pio_intf ) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END @@ -409,11 +409,11 @@ static MACHINE_CONFIG_START( superslave, superslave_state ) MCFG_Z80DART_ADD(Z80DART_0_TAG, XTAL_8MHz/2, dart0_intf) - MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, rxa_w)) MCFG_RS232_DCD_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, dcda_w)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, ctsa_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_0_TAG, z80dart_device, rxb_w)) diff --git a/src/mess/drivers/svi318.c b/src/mess/drivers/svi318.c index 1cb6e61b277..501f87495b4 100644 --- a/src/mess/drivers/svi318.c +++ b/src/mess/drivers/svi318.c @@ -336,7 +336,7 @@ static MACHINE_CONFIG_START( svi318, svi318_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(svi318_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -469,7 +469,7 @@ static MACHINE_CONFIG_START( svi328_806, svi318_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(svi318_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/swtpc09.c b/src/mess/drivers/swtpc09.c index 7737b479308..e5820033d48 100644 --- a/src/mess/drivers/swtpc09.c +++ b/src/mess/drivers/swtpc09.c @@ -151,7 +151,7 @@ static MACHINE_CONFIG_START( swtpc09, swtpc09_state ) MCFG_CPU_PROGRAM_MAP(swtpc09_mem) /* video hardware */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) @@ -183,7 +183,7 @@ static MACHINE_CONFIG_START( swtpc09i, swtpc09_state ) MCFG_CPU_PROGRAM_MAP(swtpc09_mem) /* video hardware */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) @@ -225,7 +225,7 @@ static MACHINE_CONFIG_START( swtpc09d3, swtpc09_state ) MCFG_CPU_PROGRAM_MAP(swtpc09_mem) /* video hardware */ - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) diff --git a/src/mess/drivers/tandy2k.c b/src/mess/drivers/tandy2k.c index 8b779140efe..84ad7b5c5ec 100644 --- a/src/mess/drivers/tandy2k.c +++ b/src/mess/drivers/tandy2k.c @@ -840,7 +840,7 @@ static MACHINE_CONFIG_START( tandy2k, tandy2k_state ) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":0", tandy2k_floppies, "525qd", tandy2k_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(I8272A_TAG ":1", tandy2k_floppies, "525qd", tandy2k_state::floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(tandy2k_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(tandy2k_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(tandy2k_state, write_centronics_perror)) diff --git a/src/mess/drivers/tavernie.c b/src/mess/drivers/tavernie.c index 8b525779a6f..6dd97bb79e3 100644 --- a/src/mess/drivers/tavernie.c +++ b/src/mess/drivers/tavernie.c @@ -350,7 +350,7 @@ static MACHINE_CONFIG_START( cpu09, tavernie_state ) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) diff --git a/src/mess/drivers/thomson.c b/src/mess/drivers/thomson.c index cfba620d8de..4e8ad9251ac 100644 --- a/src/mess/drivers/thomson.c +++ b/src/mess/drivers/thomson.c @@ -1496,7 +1496,7 @@ static MACHINE_CONFIG_DERIVED( to9, to7 ) MCFG_DEVICE_MODIFY("mc6846") MCFG_MC6846_OUT_PORT_CB(WRITE8(thomson_state, to9_timer_port_out)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(thomson_state, write_centronics_busy)) /* internal ram */ @@ -1715,7 +1715,7 @@ static MACHINE_CONFIG_DERIVED( to8, to7 ) MCFG_PIA_CB2_HANDLER(NULL) MCFG_PIA_IRQA_HANDLER(NULL) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(thomson_state, write_centronics_busy)) MCFG_DEVICE_MODIFY("mc6846") @@ -1871,7 +1871,7 @@ static MACHINE_CONFIG_DERIVED( to9p, to7 ) MCFG_PIA_IRQA_HANDLER(NULL) MCFG_PIA_IRQB_HANDLER(WRITELINE(thomson_state, thom_firq_1)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(thomson_state, write_centronics_busy)) MCFG_DEVICE_MODIFY("mc6846") @@ -2220,7 +2220,7 @@ static MACHINE_CONFIG_DERIVED( mo6, to7 ) MCFG_PIA_WRITEPA_HANDLER(WRITE8(thomson_state, mo6_game_porta_out)) MCFG_PIA_CB2_HANDLER(WRITELINE(thomson_state, mo6_game_cb2_out)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(thomson_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") @@ -2459,7 +2459,7 @@ static MACHINE_CONFIG_DERIVED( mo5nr, to7 ) MCFG_DEVICE_MODIFY(THOM_PIA_GAME) MCFG_PIA_WRITEPA_HANDLER(WRITE8(thomson_state, mo6_game_porta_out)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(thomson_state, write_centronics_busy)) diff --git a/src/mess/drivers/tiki100.c b/src/mess/drivers/tiki100.c index 09ebfa24a90..e13bb952858 100644 --- a/src/mess/drivers/tiki100.c +++ b/src/mess/drivers/tiki100.c @@ -731,7 +731,7 @@ static MACHINE_CONFIG_START( tiki100, tiki100_state ) MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, NULL) MCFG_RS232_RXD_HANDLER(DEVWRITELINE(Z80DART_TAG, z80dart_device, rxb_w)) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(tiki100_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(tiki100_state, write_centronics_busy)) diff --git a/src/mess/drivers/tmc600.c b/src/mess/drivers/tmc600.c index 23eb76e59ca..65903982034 100644 --- a/src/mess/drivers/tmc600.c +++ b/src/mess/drivers/tmc600.c @@ -276,7 +276,7 @@ static MACHINE_CONFIG_START( tmc600, tmc600_state ) MCFG_FRAGMENT_ADD(tmc600_video) /* devices */ - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) diff --git a/src/mess/drivers/trs80.c b/src/mess/drivers/trs80.c index 2bf14cfd6e3..aee78ec01c3 100644 --- a/src/mess/drivers/trs80.c +++ b/src/mess/drivers/trs80.c @@ -610,7 +610,7 @@ static MACHINE_CONFIG_DERIVED( model1, trs80 ) // model I, level II MCFG_FD1793_ADD("wd179x", trs80_wd17xx_interface ) // should be FD1771 or FD1791 but inverted data lines are too tricky to fix now MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(trs80_floppy_interface) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) MCFG_CENTRONICS_PERROR_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit6)) MCFG_CENTRONICS_SELECT_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit5)) diff --git a/src/mess/drivers/trs80m2.c b/src/mess/drivers/trs80m2.c index ec1eea77028..544f91878ae 100644 --- a/src/mess/drivers/trs80m2.c +++ b/src/mess/drivers/trs80m2.c @@ -827,7 +827,7 @@ static MACHINE_CONFIG_START( trs80m2, trs80m2_state ) MCFG_Z80PIO_ADD(Z80PIO_TAG, XTAL_8MHz/2, pio_intf) MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(Z80PIO_TAG, z80pio_device, strobe_b)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(trs80m2_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(trs80m2_state, write_centronics_fault)) @@ -892,7 +892,7 @@ static MACHINE_CONFIG_START( trs80m16, trs80m16_state ) MCFG_Z80SIO0_ADD(Z80SIO_TAG, XTAL_8MHz/2, sio_intf) MCFG_PIC8259_ADD(AM9519A_TAG, INPUTLINE(M68000_TAG, M68K_IRQ_5), VCC, NULL ) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(Z80PIO_TAG, z80pio_device, strobe_b)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(trs80m2_state, write_centronics_busy)) MCFG_CENTRONICS_FAULT_HANDLER(WRITELINE(trs80m2_state, write_centronics_fault)) diff --git a/src/mess/drivers/tutor.c b/src/mess/drivers/tutor.c index 15b016c89fc..8e533f304ec 100644 --- a/src/mess/drivers/tutor.c +++ b/src/mess/drivers/tutor.c @@ -774,7 +774,7 @@ static MACHINE_CONFIG_START( tutor, tutor_state ) MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(tutor_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/tvc.c b/src/mess/drivers/tvc.c index 1e069f30cdb..47230c3bb87 100644 --- a/src/mess/drivers/tvc.c +++ b/src/mess/drivers/tvc.c @@ -692,7 +692,7 @@ static MACHINE_CONFIG_START( tvc, tvc_state ) MCFG_TVC_SOUND_SNDINT_CALLBACK(WRITELINE(tvc_state, tvc_int_ff_set)) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(tvc_state, tvc_centronics_ack)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/v1050.c b/src/mess/drivers/v1050.c index 432a65c2193..79d839844a1 100644 --- a/src/mess/drivers/v1050.c +++ b/src/mess/drivers/v1050.c @@ -1154,7 +1154,7 @@ static MACHINE_CONFIG_START( v1050, v1050_state ) MCFG_SOFTWARE_LIST_ADD("hdd_list", "v1050_hdd") // printer - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(v1050_state, write_centronics_busy)) MCFG_CENTRONICS_PERROR_HANDLER(WRITELINE(v1050_state, write_centronics_perror)) diff --git a/src/mess/drivers/votrtnt.c b/src/mess/drivers/votrtnt.c index 0c58ed43111..6d289338cd9 100644 --- a/src/mess/drivers/votrtnt.c +++ b/src/mess/drivers/votrtnt.c @@ -115,7 +115,7 @@ static MACHINE_CONFIG_START( votrtnt, votrtnt_state ) MCFG_ACIA6850_TXD_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_txd)) MCFG_ACIA6850_RTS_HANDLER(DEVWRITELINE("rs232", rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE("acia", acia6850_device, write_rxd)) MCFG_RS232_CTS_HANDLER(DEVWRITELINE("acia", acia6850_device, write_cts)) diff --git a/src/mess/drivers/vtech1.c b/src/mess/drivers/vtech1.c index b91a5fa528e..3d11484fcb0 100644 --- a/src/mess/drivers/vtech1.c +++ b/src/mess/drivers/vtech1.c @@ -974,7 +974,7 @@ static MACHINE_CONFIG_START( laser110, vtech1_state ) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) /* printer */ - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(vtech1_state, write_centronics_busy)) MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", "centronics") diff --git a/src/mess/drivers/wangpc.c b/src/mess/drivers/wangpc.c index f228c55f066..66ff6d034c2 100644 --- a/src/mess/drivers/wangpc.c +++ b/src/mess/drivers/wangpc.c @@ -1147,7 +1147,7 @@ static MACHINE_CONFIG_START( wangpc, wangpc_state ) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":0", wangpc_floppies, "525dd", wangpc_state::floppy_formats) MCFG_FLOPPY_DRIVE_ADD(UPD765_TAG ":1", wangpc_floppies, "525dd", wangpc_state::floppy_formats) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_DATA_INPUT_BUFFER("cent_data_in") MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(wangpc_state, write_centronics_ack)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(wangpc_state, write_centronics_busy)) diff --git a/src/mess/drivers/x68k.c b/src/mess/drivers/x68k.c index 4c3f6654454..033fb6cfb68 100644 --- a/src/mess/drivers/x68k.c +++ b/src/mess/drivers/x68k.c @@ -1337,11 +1337,6 @@ WRITE_LINE_MEMBER( x68k_state::mfp_tbo_w ) m_mfpdev->clock_w(state); } -static struct serial_keyboard_interface x68k_keyboard_interface = -{ - DEVCB_DEVICE_LINE_MEMBER(MC68901_TAG, mc68901_device, write_rx) -}; - static I8255A_INTERFACE( ppi_interface ) { DEVCB_DRIVER_MEMBER(x68k_state,ppi_port_a_r), @@ -1795,6 +1790,10 @@ static SLOT_INTERFACE_START( x68k_floppies ) SLOT_INTERFACE( "525hd", FLOPPY_525_HD ) SLOT_INTERFACE_END +static SLOT_INTERFACE_START(keyboard) + SLOT_INTERFACE("x68k", X68K_KEYBOARD) +SLOT_INTERFACE_END + static MACHINE_CONFIG_FRAGMENT( x68000_base ) /* basic machine hardware */ MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */ @@ -1811,9 +1810,10 @@ static MACHINE_CONFIG_FRAGMENT( x68000_base ) MCFG_MC68901_TX_CLOCK(0) MCFG_MC68901_OUT_IRQ_CB(WRITELINE(x68k_state, mfp_irq_callback)) MCFG_MC68901_OUT_TBO_CB(WRITELINE(x68k_state, mfp_tbo_w)) - MCFG_MC68901_OUT_SO_CB(DEVWRITELINE("keyboard", serial_keyboard_device, input_txd)) + MCFG_MC68901_OUT_SO_CB(DEVWRITELINE("keyboard", rs232_port_device, write_txd)) - MCFG_X68K_KEYBOARD_ADD("keyboard", x68k_keyboard_interface) + MCFG_RS232_PORT_ADD("keyboard", keyboard, "x68k") + MCFG_RS232_RXD_HANDLER(DEVWRITELINE(MC68901_TAG, mc68901_device, write_rx)) MCFG_I8255A_ADD( "ppi8255", ppi_interface ) diff --git a/src/mess/drivers/xor100.c b/src/mess/drivers/xor100.c index 40f6fb7d70e..f21246eaecc 100644 --- a/src/mess/drivers/xor100.c +++ b/src/mess/drivers/xor100.c @@ -474,12 +474,12 @@ void xor100_state::fdc_drq_w(bool state) static DEVICE_INPUT_DEFAULTS_START( terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END static SLOT_INTERFACE_START( xor100_s100_cards ) @@ -539,10 +539,10 @@ static MACHINE_CONFIG_START( xor100, xor100_state ) MCFG_I8251_DTR_HANDLER(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_dtr)) MCFG_I8251_RTS_HANDLER(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_rts)) - MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD(RS232_B_TAG, default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(I8251_B_TAG, i8251_device, write_rxd)) MCFG_RS232_DSR_HANDLER(DEVWRITELINE(I8251_B_TAG, i8251_device, write_dsr)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", terminal) MCFG_DEVICE_ADD(COM5016_TAG, COM8116, XTAL_5_0688MHz) MCFG_COM8116_FR_HANDLER(WRITELINE(xor100_state, com5016_fr_w)) @@ -556,7 +556,7 @@ static MACHINE_CONFIG_START( xor100, xor100_state ) MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":2", xor100_floppies, NULL, floppy_image_device::default_floppy_formats) MCFG_FLOPPY_DRIVE_ADD(WD1795_TAG":3", xor100_floppies, NULL, floppy_image_device::default_floppy_formats) - MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "image") + MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(I8255A_TAG, i8255_device, pc4_w)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(xor100_state, write_centronics_busy)) MCFG_CENTRONICS_SELECT_HANDLER(WRITELINE(xor100_state, write_centronics_select)) diff --git a/src/mess/includes/coco.h b/src/mess/includes/coco.h index 92e622a9dec..065c628c3e5 100644 --- a/src/mess/includes/coco.h +++ b/src/mess/includes/coco.h @@ -14,7 +14,7 @@ #include "emu.h" #include "imagedev/cassette.h" -#include "imagedev/bitbngr.h" +#include "bus/rs232/rs232.h" #include "machine/6821pia.h" #include "bus/coco/cococart.h" #include "machine/coco_vhd.h" @@ -47,7 +47,7 @@ SLOT_INTERFACE_EXTERN( coco_cart ); #define SCREEN_TAG "screen" #define DAC_TAG "dac" #define CARTRIDGE_TAG "ext" -#define BITBANGER_TAG "bitbanger" +#define RS232_TAG "rs232" #define VHD0_TAG "vhd0" #define VHD1_TAG "vhd1" @@ -92,7 +92,7 @@ public: required_device<cococart_slot_device> m_cococart; required_device<ram_device> m_ram; required_device<cassette_image_device> m_cassette; - optional_device<bitbanger_device> m_bitbanger; + optional_device<rs232_port_device> m_rs232; optional_device<coco_vhd_image_device> m_vhd_0; optional_device<coco_vhd_image_device> m_vhd_1; @@ -102,7 +102,6 @@ public: // driver update handlers DECLARE_INPUT_CHANGED_MEMBER(keyboard_changed); DECLARE_INPUT_CHANGED_MEMBER(joystick_mode_changed); - static void bitbanger_callback(running_machine &machine, UINT8 bit); // IO virtual DECLARE_READ8_MEMBER( ff00_read ); @@ -135,9 +134,6 @@ public: // floating bus DECLARE_READ8_MEMBER( floating_bus_read ) { return floating_bus_read(); } - // bitbanger - DECLARE_WRITE_LINE_MEMBER( bitbanger_callback ); - protected: // device-level overrides virtual void device_start(); @@ -153,7 +149,6 @@ protected: // changed handlers virtual void pia1_pa_changed(void); virtual void pia1_pb_changed(void); - virtual void bitbanger_changed(bool newvalue); // miscellaneous virtual void update_keyboard_input(UINT8 value, UINT8 z); diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c index e062f65b65c..d2b830c0b2b 100644 --- a/src/mess/machine/apollo.c +++ b/src/mess/machine/apollo.c @@ -846,12 +846,12 @@ MACHINE_CONFIG_FRAGMENT( apollo ) MACHINE_CONFIG_END static DEVICE_INPUT_DEFAULTS_START( apollo_terminal ) - DEVICE_INPUT_DEFAULTS( "TERM_TXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_RXBAUD", 0xff, 0x06 ) // 9600 - DEVICE_INPUT_DEFAULTS( "TERM_STARTBITS", 0xff, 0x01 ) // 1 - DEVICE_INPUT_DEFAULTS( "TERM_DATABITS", 0xff, 0x03 ) // 8 - DEVICE_INPUT_DEFAULTS( "TERM_PARITY", 0xff, 0x00 ) // N - DEVICE_INPUT_DEFAULTS( "TERM_STOPBITS", 0xff, 0x01 ) // 1 + DEVICE_INPUT_DEFAULTS( "RS232_TXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_RXBAUD", 0xff, RS232_BAUD_9600 ) + DEVICE_INPUT_DEFAULTS( "RS232_STARTBITS", 0xff, RS232_STARTBITS_1 ) + DEVICE_INPUT_DEFAULTS( "RS232_DATABITS", 0xff, RS232_DATABITS_8 ) + DEVICE_INPUT_DEFAULTS( "RS232_PARITY", 0xff, RS232_PARITY_NONE ) + DEVICE_INPUT_DEFAULTS( "RS232_STOPBITS", 0xff, RS232_STOPBITS_1 ) DEVICE_INPUT_DEFAULTS_END // for headless machines using a serial console @@ -863,9 +863,9 @@ MACHINE_CONFIG_FRAGMENT( apollo_terminal ) MCFG_MC68681_OUTPORT_CALLBACK(WRITE8(apollo_state, sio_output)) MCFG_MC68681_B_TX_CALLBACK(DEVWRITELINE("rs232", rs232_port_device, write_txd)) - MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "serial_terminal") + MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") MCFG_RS232_RXD_HANDLER(DEVWRITELINE(APOLLO_SIO_TAG, mc68681_device, rx_b_w)) - MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("serial_terminal", apollo_terminal) + MCFG_DEVICE_CARD_DEVICE_INPUT_DEFAULTS("terminal", apollo_terminal) MACHINE_CONFIG_END DRIVER_INIT_MEMBER(apollo_state,apollo) diff --git a/src/mess/machine/coco.c b/src/mess/machine/coco.c index efd32826169..a20827733ff 100644 --- a/src/mess/machine/coco.c +++ b/src/mess/machine/coco.c @@ -88,7 +88,7 @@ coco_state::coco_state(const machine_config &mconfig, device_type type, const ch m_cococart(*this, CARTRIDGE_TAG), m_ram(*this, RAM_TAG), m_cassette(*this, "cassette"), - m_bitbanger(*this, BITBANGER_TAG), + m_rs232(*this, RS232_TAG), m_vhd_0(*this, VHD0_TAG), m_vhd_1(*this, VHD1_TAG) { @@ -479,7 +479,7 @@ READ8_MEMBER( coco_state::pia1_pb_r ) || (ram_size >= 0x8000 && (m_pia_0->b_output() & 0x80)); // serial in (PB0) - bool serial_in = (m_bitbanger != NULL) && (m_bitbanger->input() ? true : false); + bool serial_in = (m_rs232 != NULL) && (m_rs232->rxd_r() ? true : false); // composite the results return (memory_sense ? 0x04 : 0x00) @@ -963,9 +963,9 @@ void coco_state::update_prinout(bool prinout) else { /* output bitbanger if present (only on CoCos) */ - if (m_bitbanger != NULL) + if (m_rs232 != NULL) { - m_bitbanger->output(prinout ? 1 : 0); + m_rs232->write_txd(prinout ? 1 : 0); } } } @@ -1020,26 +1020,6 @@ INPUT_CHANGED_MEMBER(coco_state::joystick_mode_changed) //------------------------------------------------- -// bitbanger_changed -//------------------------------------------------- - -void coco_state::bitbanger_changed(bool newvalue) -{ - // do nothing -} - - - -//------------------------------------------------- -// bitbanger_callback -//------------------------------------------------- - -WRITE_LINE_MEMBER( coco_state::bitbanger_callback ) -{ - bitbanger_changed(state ? true : false); -} - -//------------------------------------------------- // poll_hires_joystick //------------------------------------------------- diff --git a/src/mess/machine/qx10kbd.c b/src/mess/machine/qx10kbd.c index 13a5a702468..3087a7835c1 100644 --- a/src/mess/machine/qx10kbd.c +++ b/src/mess/machine/qx10kbd.c @@ -257,11 +257,25 @@ static INPUT_PORTS_START( qx10_keyboard ) PORT_BIT(0x40,IP_ACTIVE_HIGH,IPT_KEYBOARD) PORT_NAME("CLS/LINE") PORT_BIT(0x80,IP_ACTIVE_HIGH,IPT_UNUSED) - PORT_START("TERM_FRAME") - PORT_CONFNAME(0x0f, 0x03, "Baud") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x03, "1200") - PORT_CONFNAME(0x30, 0x30, "Format") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x30, "8E1") + PORT_START("RS232_TXBAUD") + PORT_CONFNAME(0xff, RS232_BAUD_1200, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_BAUD_1200, "1200") + + PORT_START("RS232_STARTBITS") + PORT_CONFNAME(0xff, RS232_STARTBITS_1, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STARTBITS_1, "1") + + PORT_START("RS232_DATABITS") + PORT_CONFNAME(0xff, RS232_DATABITS_8, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_DATABITS_8, "8") + + PORT_START("RS232_PARITY") + PORT_CONFNAME(0xff, RS232_PARITY_EVEN, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_PARITY_EVEN, "Even") + + PORT_START("RS232_STOPBITS") + PORT_CONFNAME(0xff, RS232_STOPBITS_1, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STOPBITS_1, "1") INPUT_PORTS_END ioport_constructor qx10_keyboard_device::device_input_ports() const diff --git a/src/mess/machine/qx10kbd.h b/src/mess/machine/qx10kbd.h index 07e83a397da..b548e6d2c53 100644 --- a/src/mess/machine/qx10kbd.h +++ b/src/mess/machine/qx10kbd.h @@ -1,13 +1,8 @@ #ifndef QX10KBD_H_ #define QX10KBD_H_ -#include "emu.h" #include "bus/rs232/keyboard.h" -#define MCFG_QX10_KEYBOARD_ADD(_tag, _intrf) \ - MCFG_DEVICE_ADD(_tag, QX10_KEYBOARD, 1200) \ - MCFG_DEVICE_CONFIG(_intrf) - class qx10_keyboard_device : public serial_keyboard_device { public: diff --git a/src/mess/machine/thomson.c b/src/mess/machine/thomson.c index 118d8d19f1b..e2896a81e03 100644 --- a/src/mess/machine/thomson.c +++ b/src/mess/machine/thomson.c @@ -638,7 +638,7 @@ static MACHINE_CONFIG_FRAGMENT( to7_io_line ) MCFG_RS232_CTS_HANDLER(WRITELINE(to7_io_line_device, write_cts)) MCFG_RS232_DSR_HANDLER(WRITELINE(to7_io_line_device, write_dsr)) - MCFG_CENTRONICS_ADD("centronics", centronics_printers, "image") + MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") MCFG_CENTRONICS_ACK_HANDLER(DEVWRITELINE(THOM_PIA_IO, pia6821_device, cb1_w)) MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(to7_io_line_device, write_centronics_busy)) diff --git a/src/mess/machine/x68k_kbd.c b/src/mess/machine/x68k_kbd.c index 6888867c092..775955743e7 100644 --- a/src/mess/machine/x68k_kbd.c +++ b/src/mess/machine/x68k_kbd.c @@ -304,11 +304,25 @@ static INPUT_PORTS_START( x68k_keyboard ) PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Opt. 1") PORT_CODE(KEYCODE_PRTSCR) /* Opt1 */ PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Opt. 2") PORT_CODE(KEYCODE_PAUSE) /* Opt2 */ - PORT_START("TERM_FRAME") - PORT_CONFNAME(0x0f, 0x0a, "Baud") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x0a, "38400") // TODO: Should be 2400 but MC68901 doesn't support divide by 16 - PORT_CONFNAME(0x30, 0x00, "Format") PORT_CHANGED_MEMBER(DEVICE_SELF, serial_keyboard_device, update_frame, 0) - PORT_CONFSETTING( 0x00, "8N1") + PORT_START("RS232_TXBAUD") + PORT_CONFNAME(0xff, RS232_BAUD_38400, "TX Baud") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_BAUD_38400, "38400") // TODO: Should be 2400 but MC68901 doesn't support divide by 16 + + PORT_START("RS232_STARTBITS") + PORT_CONFNAME(0xff, RS232_STARTBITS_1, "Start Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STARTBITS_1, "1") + + PORT_START("RS232_DATABITS") + PORT_CONFNAME(0xff, RS232_DATABITS_8, "Data Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_DATABITS_8, "8") + + PORT_START("RS232_PARITY") + PORT_CONFNAME(0xff, RS232_PARITY_NONE, "Parity") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_PARITY_NONE, "None") + + PORT_START("RS232_STOPBITS") + PORT_CONFNAME(0xff, RS232_STOPBITS_1, "Stop Bits") PORT_WRITE_LINE_DEVICE_MEMBER(DEVICE_SELF, serial_keyboard_device, update_serial) + PORT_CONFSETTING( RS232_STOPBITS_1, "1") INPUT_PORTS_END ioport_constructor x68k_keyboard_device::device_input_ports() const diff --git a/src/mess/machine/x68k_kbd.h b/src/mess/machine/x68k_kbd.h index 81917fba18b..fb47f920487 100644 --- a/src/mess/machine/x68k_kbd.h +++ b/src/mess/machine/x68k_kbd.h @@ -1,13 +1,8 @@ #ifndef X68K_KBD_H_ #define X68K_KBD_H_ -#include "emu.h" #include "bus/rs232/keyboard.h" -#define MCFG_X68K_KEYBOARD_ADD(_tag, _intrf) \ - MCFG_DEVICE_ADD(_tag, X68K_KEYBOARD, 1200) \ - MCFG_DEVICE_CONFIG(_intrf) - class x68k_keyboard_device : public serial_keyboard_device { public: |