added RS232 loopback [smf]

This commit is contained in:
smf- 2014-04-06 08:48:33 +00:00
parent 487efaf26f
commit 37c2d0587d
5 changed files with 47 additions and 1 deletions

2
.gitattributes vendored
View File

@ -1160,6 +1160,8 @@ src/emu/bus/plus4/user.c svneol=native#text/plain
src/emu/bus/plus4/user.h svneol=native#text/plain
src/emu/bus/rs232/keyboard.c svneol=native#text/plain
src/emu/bus/rs232/keyboard.h svneol=native#text/plain
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/rs232.c svneol=native#text/plain

View File

@ -703,6 +703,7 @@ endif
ifneq ($(filter RS232,$(BUSES)),)
OBJDIRS += $(BUSOBJ)/rs232
BUSOBJS += $(BUSOBJ)/rs232/keyboard.o
BUSOBJS += $(BUSOBJ)/rs232/loopback.o
BUSOBJS += $(BUSOBJ)/rs232/null_modem.o
BUSOBJS += $(BUSOBJ)/rs232/rs232.o
BUSOBJS += $(BUSOBJ)/rs232/ser_mouse.o

View File

@ -0,0 +1,16 @@
// license:MAME
// copyright-holders:smf
#include "loopback.h"
const device_type RS232_LOOPBACK = &device_creator<rs232_loopback_device>;
rs232_loopback_device::rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
: device_t(mconfig, RS232_LOOPBACK, "RS232 Loopback", tag, owner, clock, "rs232_loopback", __FILE__),
device_rs232_port_interface(mconfig, *this)
{
}
void rs232_loopback_device::device_start()
{
}

View File

@ -0,0 +1,25 @@
// license:MAME
// copyright-holders:smf
#ifndef RS232_LOOPBACK_H_
#define RS232_LOOPBACK_H_
#include "bus/rs232/rs232.h"
class rs232_loopback_device : public device_t,
public device_rs232_port_interface
{
public:
rs232_loopback_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual WRITE_LINE_MEMBER( input_txd ) { output_rxd(state); }
virtual WRITE_LINE_MEMBER( input_rts ) { output_ri(state); output_cts(state); }
virtual WRITE_LINE_MEMBER( input_dtr ) { output_dsr(state); output_dcd(state); }
protected:
virtual void device_start();
};
extern const device_type RS232_LOOPBACK;
#endif

View File

@ -96,10 +96,12 @@ device_rs232_port_interface::~device_rs232_port_interface()
{
}
#include "loopback.h"
#include "null_modem.h"
#include "terminal.h"
SLOT_INTERFACE_START( default_rs232_devices )
SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL)
SLOT_INTERFACE("loopback", SERIAL_LOOPBACK)
SLOT_INTERFACE("null_modem", NULL_MODEM)
SLOT_INTERFACE("serial_terminal", SERIAL_TERMINAL)
SLOT_INTERFACE_END