mirror of
https://github.com/holub/mame
synced 2025-04-19 23:12:11 +03:00
bus/rs232: Added a configurable patch box device, and various cleanups.
Added comments with V.24 interchange circuit numbers and names to rs232.h to make the meanings of the abbreviated signal names clearer. Moved a few slot card classes out of headers and into anonymous namespaces to reduce compile depedencies and exported symbols. Transliterated a Korean NES game title.
This commit is contained in:
parent
0eeb918991
commit
299265cc52
@ -63432,7 +63432,7 @@ preliminary proto for the PAL version, still running on NTSC systems) or the gfx
|
||||
</software>
|
||||
|
||||
<software name="flyingsb" cloneof="menaceb">
|
||||
<description>Flying Superboy (Korea)</description>
|
||||
<description>Nar-ara Superboy (Korea)</description>
|
||||
<year>199?</year>
|
||||
<publisher>Haitai</publisher>
|
||||
<info name="alt_title" value="날아라 슈퍼보이"/>
|
||||
|
@ -2689,36 +2689,38 @@ end
|
||||
|
||||
if (BUSES["RS232"]~=null) then
|
||||
files {
|
||||
MAME_DIR .. "src/devices/bus/rs232/exorterm.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/exorterm.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/hlemouse.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/hlemouse.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/ie15.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/ie15.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/keyboard.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/keyboard.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/loopback.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/loopback.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/mboardd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/mboardd.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/null_modem.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/null_modem.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/patchbox.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/patchbox.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/printer.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/printer.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/pty.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/pty.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/hlemouse.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/hlemouse.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232_sync_io.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232_sync_io.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/sun_kbd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/sun_kbd.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/swtpc8212.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/swtpc8212.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/terminal.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/terminal.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/xvd701.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/xvd701.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/ie15.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/ie15.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/swtpc8212.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/swtpc8212.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/exorterm.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/exorterm.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232_sync_io.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/rs232_sync_io.h",
|
||||
MAME_DIR .. "src/devices/bus/rs232/mboardd.cpp",
|
||||
MAME_DIR .. "src/devices/bus/rs232/mboardd.h",
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -80,6 +80,10 @@
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_SLOT, a2bus_slot_device, "a2bus_slot", "Apple II Slot")
|
||||
|
||||
template class device_finder<device_a2bus_card_interface, false>;
|
||||
template class device_finder<device_a2bus_card_interface, true>;
|
||||
|
||||
|
||||
//**************************************************************************
|
||||
// LIVE DEVICE
|
||||
//**************************************************************************
|
||||
|
@ -3,12 +3,52 @@
|
||||
#include "emu.h"
|
||||
#include "a2parprn.h"
|
||||
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
//#define VERBOSE 1
|
||||
//#define LOG_OUTPUT_FUNC osd_printf_info
|
||||
#include "logmacro.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class a2bus_parprn_device : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
a2bus_parprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(update_strobe);
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_ioport m_input_config;
|
||||
required_region_ptr<u8> m_prom;
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u8 m_next_strobe; // B3 pin 13
|
||||
u8 m_ack_latch; // B2 pin 6
|
||||
u8 m_ack_in; // pin 2
|
||||
};
|
||||
|
||||
|
||||
|
||||
// FIXME: get proper PROM dumps.
|
||||
/*
|
||||
There are most likely multiple revisions.
|
||||
@ -62,12 +102,6 @@ INPUT_PORTS_START(parprn)
|
||||
PORT_CONFSETTING( 0x10, "8-bit")
|
||||
INPUT_PORTS_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_PARPRN, a2bus_parprn_device, "a2parprn", "Apple II Parallel Printer Interface Card")
|
||||
|
||||
|
||||
|
||||
a2bus_parprn_device::a2bus_parprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
@ -231,3 +265,9 @@ TIMER_CALLBACK_MEMBER(a2bus_parprn_device::update_strobe)
|
||||
m_strobe_timer->adjust(attotime::from_ticks(1, clock()));
|
||||
}
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_PARPRN, device_a2bus_card_interface, a2bus_parprn_device, "a2parprn", "Apple II Parallel Printer Interface Card")
|
||||
|
@ -53,45 +53,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "a2bus.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
class a2bus_parprn_device : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
a2bus_parprn_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(update_strobe);
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_ioport m_input_config;
|
||||
required_region_ptr<u8> m_prom;
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u8 m_next_strobe; // B3 pin 13
|
||||
u8 m_ack_latch; // B2 pin 6
|
||||
u8 m_ack_in; // pin 2
|
||||
};
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(A2BUS_PARPRN, a2bus_parprn_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_PARPRN, device_a2bus_card_interface)
|
||||
|
||||
#endif // MAME_BUS_A2BUS_A2PARPRN_H
|
||||
|
@ -3,12 +3,85 @@
|
||||
#include "emu.h"
|
||||
#include "a2pic.h"
|
||||
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
//#define VERBOSE 1
|
||||
//#define LOG_OUTPUT_FUNC osd_printf_info
|
||||
#include "logmacro.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class a2bus_pic_device : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
a2bus_pic_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// DIP switch/jumper handlers
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_strobe);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_ack);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_firmware);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_irq);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(x_data_out);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(x_char_width);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(perror_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(select_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(fault_w);
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(release_strobe);
|
||||
|
||||
// synchronised inputs
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
void set_perror_in(void *ptr, s32 param);
|
||||
void set_select_in(void *ptr, s32 param);
|
||||
void set_fault_in(void *ptr, s32 param);
|
||||
void data_write(void *ptr, s32 param);
|
||||
|
||||
// helpers
|
||||
void reset_mode();
|
||||
void set_ack_latch();
|
||||
void clear_ack_latch();
|
||||
void enable_irq();
|
||||
void disable_irq();
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_ioport m_input_sw1;
|
||||
required_ioport m_input_x;
|
||||
required_region_ptr<u8> m_prom;
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u16 m_firmware_base; // controlled by SW6
|
||||
u8 m_data_latch; // 9B
|
||||
u8 m_autostrobe_disable; // 2A pin 8
|
||||
u8 m_ack_latch; // 2A pin 6
|
||||
u8 m_irq_enable; // 2B pin 9
|
||||
u8 m_ack_in;
|
||||
u8 m_perror_in; // DI5
|
||||
u8 m_select_in; // DI6
|
||||
u8 m_fault_in; // DI3
|
||||
};
|
||||
|
||||
|
||||
|
||||
ROM_START(pic)
|
||||
ROM_REGION(0x0200, "prom", 0)
|
||||
ROM_LOAD( "341-0057.7b", 0x0000, 0x0200, CRC(0a6b084b) SHA1(de8aa285dcac88b1cc80ec9128b092833f5174b6) )
|
||||
@ -51,12 +124,6 @@ INPUT_PORTS_START(pic)
|
||||
PORT_CONFSETTING( 0x04, "8-bit (X6)")
|
||||
INPUT_PORTS_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_PIC, a2bus_pic_device, "a2pic", "Apple II Parallel Interface Card")
|
||||
|
||||
|
||||
|
||||
a2bus_pic_device::a2bus_pic_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
@ -529,3 +596,9 @@ void a2bus_pic_device::disable_irq()
|
||||
LOG("IRQ already disabled\n");
|
||||
}
|
||||
}
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_PIC, device_a2bus_card_interface, a2bus_pic_device, "a2pic", "Apple II Parallel Interface Card")
|
||||
|
@ -52,78 +52,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "a2bus.h"
|
||||
#include "bus/centronics/ctronics.h"
|
||||
|
||||
class a2bus_pic_device : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
a2bus_pic_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// DIP switch/jumper handlers
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_strobe);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_ack);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_firmware);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(sw1_irq);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(x_data_out);
|
||||
DECLARE_INPUT_CHANGED_MEMBER(x_char_width);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(perror_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(select_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(fault_w);
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(release_strobe);
|
||||
|
||||
// synchronised inputs
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
void set_perror_in(void *ptr, s32 param);
|
||||
void set_select_in(void *ptr, s32 param);
|
||||
void set_fault_in(void *ptr, s32 param);
|
||||
void data_write(void *ptr, s32 param);
|
||||
|
||||
// helpers
|
||||
void reset_mode();
|
||||
void set_ack_latch();
|
||||
void clear_ack_latch();
|
||||
void enable_irq();
|
||||
void disable_irq();
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_ioport m_input_sw1;
|
||||
required_ioport m_input_x;
|
||||
required_region_ptr<u8> m_prom;
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u16 m_firmware_base; // controlled by SW6
|
||||
u8 m_data_latch; // 9B
|
||||
u8 m_autostrobe_disable; // 2A pin 8
|
||||
u8 m_ack_latch; // 2A pin 6
|
||||
u8 m_irq_enable; // 2B pin 9
|
||||
u8 m_ack_in;
|
||||
u8 m_perror_in; // DI5
|
||||
u8 m_select_in; // DI6
|
||||
u8 m_fault_in; // DI3
|
||||
};
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(A2BUS_PIC, a2bus_pic_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_PIC, device_a2bus_card_interface)
|
||||
|
||||
#endif // MAME_BUS_A2BUS_A2PIC_H
|
||||
|
@ -3,6 +3,9 @@
|
||||
#include "emu.h"
|
||||
#include "grappler.h"
|
||||
|
||||
#include "bus/centronics/ctronics.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
|
||||
//#define VERBOSE 1
|
||||
//#define LOG_OUTPUT_FUNC osd_printf_info
|
||||
#include "logmacro.h"
|
||||
@ -48,48 +51,55 @@ ROM_START(bufgrapplerplus)
|
||||
ROM_END
|
||||
|
||||
|
||||
INPUT_PORTS_START(grapplerplus)
|
||||
PORT_START("S1")
|
||||
PORT_DIPNAME(0x07, 0x00, "Printer Type") PORT_DIPLOCATION("S1:4,3,2")
|
||||
PORT_DIPSETTING( 0x00, "Epson Series")
|
||||
PORT_DIPSETTING( 0x01, "NEC 8023/C. Itoh 8510/DMP 85")
|
||||
PORT_DIPSETTING( 0x02, "Star Gemini")
|
||||
PORT_DIPSETTING( 0x03, "Anadex Printers")
|
||||
PORT_DIPSETTING( 0x04, "Okidata 82A, 83A, 92, 93, 84")
|
||||
PORT_DIPSETTING( 0x06, "Okidata 84 w/o Step II Graphics")
|
||||
PORT_DIPSETTING( 0x05, "Apple Dot Matrix")
|
||||
PORT_DIPSETTING( 0x07, "invalid")
|
||||
PORT_DIPNAME(0x08, 0x08, "Most Significant Bit") PORT_DIPLOCATION("S1:1") PORT_CHANGED_MEMBER(DEVICE_SELF, a2bus_grapplerplus_device_base, sw_msb, 0)
|
||||
PORT_DIPSETTING( 0x08, "Software Control")
|
||||
PORT_DIPSETTING( 0x00, "Not Transmitted")
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
INPUT_PORTS_START(bufgrapplerplus)
|
||||
PORT_INCLUDE(grapplerplus)
|
||||
|
||||
PORT_START("CNF")
|
||||
PORT_CONFNAME(0xff, 0x00, "RAM Size")
|
||||
PORT_CONFSETTING( 0xfc, "16K (2 chips)")
|
||||
PORT_CONFSETTING( 0xf0, "32K (4 chips)")
|
||||
PORT_CONFSETTING( 0x00, "64K (8 chips)")
|
||||
INPUT_PORTS_END
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_GRAPPLER, a2bus_grappler_device, "a2grappler", "Orange Micro Grappler Printer Interface")
|
||||
DEFINE_DEVICE_TYPE(A2BUS_GRAPPLERPLUS, a2bus_grapplerplus_device, "a2grapplerplus", "Orange Micro Grappler+ Printer Interface")
|
||||
DEFINE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUS, a2bus_buf_grapplerplus_device, "a2bufgrapplerplus", "Orange Micro Buffered Grappler+ Printer Interface")
|
||||
DEFINE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUSA, a2bus_buf_grapplerplus_reva_device, "a2bufgrapplerplusa", "Orange Micro Buffered Grappler+ (rev A) Printer Interface")
|
||||
|
||||
|
||||
|
||||
//==============================================================
|
||||
// Grappler base
|
||||
//==============================================================
|
||||
|
||||
class a2bus_grappler_device_base : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c800(u16 offset) override;
|
||||
|
||||
protected:
|
||||
a2bus_grappler_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// signal state
|
||||
u8 busy_in() const { return m_busy_in; }
|
||||
u8 pe_in() const { return m_pe_in; }
|
||||
u8 slct_in() const { return m_slct_in; }
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_region_ptr<u8> m_rom;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
// helpers
|
||||
void set_rom_bank(u16 rom_bank);
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(busy_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(pe_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(slct_w);
|
||||
|
||||
// synchronised printer status inputs
|
||||
void set_busy_in(void *ptr, s32 param);
|
||||
void set_pe_in(void *ptr, s32 param);
|
||||
void set_slct_in(void *ptr, s32 param);
|
||||
|
||||
u16 m_rom_bank; // U2D (pin 13)
|
||||
u8 m_busy_in; // printer connector pin 21 (synchronised)
|
||||
u8 m_pe_in; // printer connector pin 23 (synchronised)
|
||||
u8 m_slct_in; // printer connector pin 25 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
a2bus_grappler_device_base::a2bus_grappler_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) :
|
||||
device_t(mconfig, type, tag, owner, clock),
|
||||
device_a2bus_card_interface(mconfig, *this),
|
||||
@ -217,6 +227,39 @@ void a2bus_grappler_device_base::set_slct_in(void *ptr, s32 param)
|
||||
// Grappler implementation
|
||||
//==============================================================
|
||||
|
||||
class a2bus_grappler_device : public a2bus_grappler_device_base
|
||||
{
|
||||
public:
|
||||
a2bus_grappler_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override { return ROM_NAME(grappler); }
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// synchronised signals
|
||||
void set_data(void *ptr, s32 param);
|
||||
void set_strobe(void *ptr, s32 param);
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
|
||||
u8 m_strobe; // U3 (pin 4)
|
||||
u8 m_ack_latch; // U3 (pin 13)
|
||||
u8 m_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
a2bus_grappler_device::a2bus_grappler_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_grappler_device_base(mconfig, A2BUS_GRAPPLER, tag, owner, clock),
|
||||
m_strobe(1U),
|
||||
@ -290,12 +333,6 @@ void a2bus_grappler_device::write_cnxx(u8 offset, u8 data)
|
||||
// device_t implementation
|
||||
//--------------------------------------------------
|
||||
|
||||
tiny_rom_entry const *a2bus_grappler_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(grappler);
|
||||
}
|
||||
|
||||
|
||||
void a2bus_grappler_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
a2bus_grappler_device_base::device_add_mconfig(config);
|
||||
@ -394,6 +431,47 @@ void a2bus_grappler_device::set_ack_in(void *ptr, s32 param)
|
||||
// Grappler+ base
|
||||
//==============================================================
|
||||
|
||||
class a2bus_grapplerplus_device_base : public a2bus_grappler_device_base
|
||||
{
|
||||
public:
|
||||
// DIP switch handlers
|
||||
virtual DECLARE_INPUT_CHANGED_MEMBER(sw_msb) { }
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
a2bus_grapplerplus_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_t implementation
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// ACK latch set input
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// signal state
|
||||
u8 ack_latch() const { return m_ack_latch; }
|
||||
|
||||
required_ioport m_s1;
|
||||
|
||||
private:
|
||||
// synchronised printer status inputs
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
|
||||
// for derived devices to implement
|
||||
virtual void data_latched(u8 data) = 0;
|
||||
virtual void ack_latch_set() { }
|
||||
virtual void ack_latch_cleared() { }
|
||||
|
||||
u8 m_ack_latch; // U2C (pin 9)
|
||||
u8 m_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
a2bus_grapplerplus_device_base::a2bus_grapplerplus_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_grappler_device_base(mconfig, type, tag, owner, clock),
|
||||
m_s1(*this, "S1"),
|
||||
@ -408,6 +486,23 @@ a2bus_grapplerplus_device_base::a2bus_grapplerplus_device_base(machine_config co
|
||||
// device_t implementation
|
||||
//--------------------------------------------------
|
||||
|
||||
INPUT_PORTS_START(grapplerplus)
|
||||
PORT_START("S1")
|
||||
PORT_DIPNAME(0x07, 0x00, "Printer Type") PORT_DIPLOCATION("S1:4,3,2")
|
||||
PORT_DIPSETTING( 0x00, "Epson Series")
|
||||
PORT_DIPSETTING( 0x01, "NEC 8023/C. Itoh 8510/DMP 85")
|
||||
PORT_DIPSETTING( 0x02, "Star Gemini")
|
||||
PORT_DIPSETTING( 0x03, "Anadex Printers")
|
||||
PORT_DIPSETTING( 0x04, "Okidata 82A, 83A, 92, 93, 84")
|
||||
PORT_DIPSETTING( 0x06, "Okidata 84 w/o Step II Graphics")
|
||||
PORT_DIPSETTING( 0x05, "Apple Dot Matrix")
|
||||
PORT_DIPSETTING( 0x07, "invalid")
|
||||
PORT_DIPNAME(0x08, 0x08, "Most Significant Bit") PORT_DIPLOCATION("S1:1") PORT_CHANGED_MEMBER(DEVICE_SELF, a2bus_grapplerplus_device_base, sw_msb, 0)
|
||||
PORT_DIPSETTING( 0x08, "Software Control")
|
||||
PORT_DIPSETTING( 0x00, "Not Transmitted")
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
ioport_constructor a2bus_grapplerplus_device_base::device_input_ports() const
|
||||
{
|
||||
return INPUT_PORTS_NAME(grapplerplus);
|
||||
@ -521,6 +616,43 @@ void a2bus_grapplerplus_device_base::set_ack_in(void *ptr, s32 param)
|
||||
// Grappler+ implementation
|
||||
//==============================================================
|
||||
|
||||
class a2bus_grapplerplus_device : public a2bus_grapplerplus_device_base
|
||||
{
|
||||
public:
|
||||
a2bus_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// DIP switch handlers
|
||||
virtual DECLARE_INPUT_CHANGED_MEMBER(sw_msb) override;
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override { return ROM_NAME(grapplerplus); }
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// a2bus_grapplerplus_device_base implementation
|
||||
virtual void data_latched(u8 data) override;
|
||||
virtual void ack_latch_set() override;
|
||||
virtual void ack_latch_cleared() override;
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(update_strobe);
|
||||
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u8 m_data_latch; // U10
|
||||
u8 m_irq_disable; // U2A (pin 4)
|
||||
u8 m_irq; // U3D (pin 13)
|
||||
u8 m_next_strobe; // U5A (pin 5)
|
||||
};
|
||||
|
||||
|
||||
a2bus_grapplerplus_device::a2bus_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_grapplerplus_device_base(mconfig, A2BUS_GRAPPLERPLUS, tag, owner, clock),
|
||||
m_strobe_timer(nullptr),
|
||||
@ -602,12 +734,6 @@ void a2bus_grapplerplus_device::write_c0nx(u8 offset, u8 data)
|
||||
// device_t implementation
|
||||
//--------------------------------------------------
|
||||
|
||||
tiny_rom_entry const *a2bus_grapplerplus_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(grapplerplus);
|
||||
}
|
||||
|
||||
|
||||
void a2bus_grapplerplus_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
a2bus_grapplerplus_device_base::device_add_mconfig(config);
|
||||
@ -713,10 +839,60 @@ TIMER_CALLBACK_MEMBER(a2bus_grapplerplus_device::update_strobe)
|
||||
// Buffered Grappler+ implementation
|
||||
//==============================================================
|
||||
|
||||
a2bus_buf_grapplerplus_device::a2bus_buf_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_buf_grapplerplus_device(mconfig, A2BUS_BUFGRAPPLERPLUS, tag, owner, clock)
|
||||
class a2bus_buf_grapplerplus_device : public a2bus_grapplerplus_device_base
|
||||
{
|
||||
}
|
||||
public:
|
||||
a2bus_buf_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_buf_grapplerplus_device(mconfig, A2BUS_BUFGRAPPLERPLUS, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
|
||||
protected:
|
||||
a2bus_buf_grapplerplus_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override { return ROM_NAME(bufgrapplerplus); }
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// helpers
|
||||
template <typename T> void device_add_mconfig(machine_config &config, T &&mcu_clock);
|
||||
|
||||
private:
|
||||
// a2bus_grapplerplus_device_base implementation
|
||||
virtual void data_latched(u8 data) override;
|
||||
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(buf_ack_w);
|
||||
|
||||
// MCU I/O handlers
|
||||
void mcu_io(address_map &map);
|
||||
void mcu_p2_w(u8 data);
|
||||
u8 mcu_bus_r();
|
||||
void mcu_bus_w(u8 data);
|
||||
|
||||
// synchronised signals
|
||||
void set_buf_data(void *ptr, s32 param);
|
||||
void set_buf_ack_in(void *ptr, s32 param);
|
||||
void clear_ibusy(void *ptr, s32 param);
|
||||
|
||||
required_device<mcs48_cpu_device> m_mcu;
|
||||
std::unique_ptr<u8 []> m_ram;
|
||||
|
||||
u16 m_ram_row; // U1-U8
|
||||
u8 m_ram_mask; // mask out chips that are not installed
|
||||
u8 m_mcu_p2; // U10
|
||||
u8 m_data_latch; // U14 (synchronised)
|
||||
u8 m_ibusy; // U12
|
||||
u8 m_buf_ack_latch; // U12
|
||||
u8 m_buf_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
|
||||
a2bus_buf_grapplerplus_device::a2bus_buf_grapplerplus_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock) :
|
||||
@ -755,10 +931,15 @@ u8 a2bus_buf_grapplerplus_device::read_c0nx(u8 offset)
|
||||
// device_t implementation
|
||||
//--------------------------------------------------
|
||||
|
||||
tiny_rom_entry const *a2bus_buf_grapplerplus_device::device_rom_region() const
|
||||
{
|
||||
return ROM_NAME(bufgrapplerplus);
|
||||
}
|
||||
INPUT_PORTS_START(bufgrapplerplus)
|
||||
PORT_INCLUDE(grapplerplus)
|
||||
|
||||
PORT_START("CNF")
|
||||
PORT_CONFNAME(0xff, 0x00, "RAM Size")
|
||||
PORT_CONFSETTING( 0xfc, "16K (2 chips)")
|
||||
PORT_CONFSETTING( 0xf0, "32K (4 chips)")
|
||||
PORT_CONFSETTING( 0x00, "64K (8 chips)")
|
||||
INPUT_PORTS_END
|
||||
|
||||
|
||||
void a2bus_buf_grapplerplus_device::device_add_mconfig(machine_config &config)
|
||||
@ -1039,22 +1220,33 @@ void a2bus_buf_grapplerplus_device::clear_ibusy(void *ptr, s32 param)
|
||||
// Buffered Grappler+ rev A implementation
|
||||
//==============================================================
|
||||
|
||||
a2bus_buf_grapplerplus_reva_device::a2bus_buf_grapplerplus_reva_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_buf_grapplerplus_device(mconfig, A2BUS_BUFGRAPPLERPLUSA, tag, owner, clock)
|
||||
class a2bus_buf_grapplerplus_reva_device : public a2bus_buf_grapplerplus_device
|
||||
{
|
||||
}
|
||||
public:
|
||||
a2bus_buf_grapplerplus_reva_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock) :
|
||||
a2bus_buf_grapplerplus_device(mconfig, A2BUS_BUFGRAPPLERPLUSA, tag, owner, clock)
|
||||
{
|
||||
}
|
||||
|
||||
static auto parent_rom_device_type() { return &A2BUS_BUFGRAPPLERPLUS; }
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual void device_add_mconfig(machine_config &config) override
|
||||
{
|
||||
// boards with 6 MHz clock crystal for MCU have been seen with both UVEPROM and mask ROM parts
|
||||
// ORANGE MICRO INC., 1983
|
||||
// ASSY NO, 72 BGP 00001 REV A
|
||||
// PART NO. 95PCB00003
|
||||
a2bus_buf_grapplerplus_device::device_add_mconfig(config, 6_MHz_XTAL);
|
||||
}
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------
|
||||
// device_t implementation
|
||||
//--------------------------------------------------
|
||||
|
||||
void a2bus_buf_grapplerplus_reva_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
// boards with 6 MHz clock crystal for MCU have been seen with both UVEPROM and mask ROM parts
|
||||
// ORANGE MICRO INC., 1983
|
||||
// ASSY NO, 72 BGP 00001 REV A
|
||||
// PART NO. 95PCB00003
|
||||
a2bus_buf_grapplerplus_device::device_add_mconfig(config, 6_MHz_XTAL);
|
||||
}
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_GRAPPLER, device_a2bus_card_interface, a2bus_grappler_device, "a2grappler", "Orange Micro Grappler Printer Interface")
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_GRAPPLERPLUS, device_a2bus_card_interface, a2bus_grapplerplus_device, "a2grapplerplus", "Orange Micro Grappler+ Printer Interface")
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_BUFGRAPPLERPLUS, device_a2bus_card_interface, a2bus_buf_grapplerplus_device, "a2bufgrapplerplus", "Orange Micro Buffered Grappler+ Printer Interface")
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_BUFGRAPPLERPLUSA, device_a2bus_card_interface, a2bus_buf_grapplerplus_reva_device, "a2bufgrapplerplusa", "Orange Micro Buffered Grappler+ (rev A) Printer Interface")
|
||||
|
@ -54,233 +54,10 @@
|
||||
|
||||
#include "a2bus.h"
|
||||
|
||||
#include "bus/centronics/ctronics.h"
|
||||
#include "cpu/mcs48/mcs48.h"
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(A2BUS_GRAPPLER, a2bus_grappler_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_GRAPPLERPLUS, a2bus_grapplerplus_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUS, a2bus_buf_grapplerplus_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUSA, a2bus_buf_grapplerplus_reva_device)
|
||||
|
||||
|
||||
class a2bus_grappler_device_base : public device_t, public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c800(u16 offset) override;
|
||||
|
||||
protected:
|
||||
a2bus_grappler_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// signal state
|
||||
u8 busy_in() const { return m_busy_in; }
|
||||
u8 pe_in() const { return m_pe_in; }
|
||||
u8 slct_in() const { return m_slct_in; }
|
||||
|
||||
required_device<centronics_device> m_printer_conn;
|
||||
required_device<output_latch_device> m_printer_out;
|
||||
required_region_ptr<u8> m_rom;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
|
||||
// helpers
|
||||
void set_rom_bank(u16 rom_bank);
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(busy_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(pe_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(slct_w);
|
||||
|
||||
// synchronised printer status inputs
|
||||
void set_busy_in(void *ptr, s32 param);
|
||||
void set_pe_in(void *ptr, s32 param);
|
||||
void set_slct_in(void *ptr, s32 param);
|
||||
|
||||
u16 m_rom_bank; // U2D (pin 13)
|
||||
u8 m_busy_in; // printer connector pin 21 (synchronised)
|
||||
u8 m_pe_in; // printer connector pin 23 (synchronised)
|
||||
u8 m_slct_in; // printer connector pin 25 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
class a2bus_grappler_device : public a2bus_grappler_device_base
|
||||
{
|
||||
public:
|
||||
a2bus_grappler_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// synchronised signals
|
||||
void set_data(void *ptr, s32 param);
|
||||
void set_strobe(void *ptr, s32 param);
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
|
||||
u8 m_strobe; // U3 (pin 4)
|
||||
u8 m_ack_latch; // U3 (pin 13)
|
||||
u8 m_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
class a2bus_grapplerplus_device_base : public a2bus_grappler_device_base
|
||||
{
|
||||
public:
|
||||
// DIP switch handlers
|
||||
virtual DECLARE_INPUT_CHANGED_MEMBER(sw_msb) { }
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
virtual u8 read_cnxx(u8 offset) override;
|
||||
virtual void write_cnxx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
a2bus_grapplerplus_device_base(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_t implementation
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// ACK latch set input
|
||||
DECLARE_WRITE_LINE_MEMBER(ack_w);
|
||||
|
||||
// signal state
|
||||
u8 ack_latch() const { return m_ack_latch; }
|
||||
|
||||
required_ioport m_s1;
|
||||
|
||||
private:
|
||||
// synchronised printer status inputs
|
||||
void set_ack_in(void *ptr, s32 param);
|
||||
|
||||
// for derived devices to implement
|
||||
virtual void data_latched(u8 data) = 0;
|
||||
virtual void ack_latch_set() { }
|
||||
virtual void ack_latch_cleared() { }
|
||||
|
||||
u8 m_ack_latch; // U2C (pin 9)
|
||||
u8 m_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
class a2bus_grapplerplus_device : public a2bus_grapplerplus_device_base
|
||||
{
|
||||
public:
|
||||
a2bus_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// DIP switch handlers
|
||||
virtual DECLARE_INPUT_CHANGED_MEMBER(sw_msb) override;
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
virtual void write_c0nx(u8 offset, u8 data) override;
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
private:
|
||||
// a2bus_grapplerplus_device_base implementation
|
||||
virtual void data_latched(u8 data) override;
|
||||
virtual void ack_latch_set() override;
|
||||
virtual void ack_latch_cleared() override;
|
||||
|
||||
// timer handlers
|
||||
TIMER_CALLBACK_MEMBER(update_strobe);
|
||||
|
||||
emu_timer * m_strobe_timer;
|
||||
|
||||
u8 m_data_latch; // U10
|
||||
u8 m_irq_disable; // U2A (pin 4)
|
||||
u8 m_irq; // U3D (pin 13)
|
||||
u8 m_next_strobe; // U5A (pin 5)
|
||||
};
|
||||
|
||||
|
||||
class a2bus_buf_grapplerplus_device : public a2bus_grapplerplus_device_base
|
||||
{
|
||||
public:
|
||||
a2bus_buf_grapplerplus_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_a2bus_card_interface implementation
|
||||
virtual u8 read_c0nx(u8 offset) override;
|
||||
|
||||
protected:
|
||||
a2bus_buf_grapplerplus_device(machine_config const &mconfig, device_type type, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
// device_t implementation
|
||||
virtual tiny_rom_entry const *device_rom_region() const override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// helpers
|
||||
template <typename T> void device_add_mconfig(machine_config &config, T &&mcu_clock);
|
||||
|
||||
private:
|
||||
// a2bus_grapplerplus_device_base implementation
|
||||
virtual void data_latched(u8 data) override;
|
||||
|
||||
// printer status inputs
|
||||
DECLARE_WRITE_LINE_MEMBER(buf_ack_w);
|
||||
|
||||
// MCU I/O handlers
|
||||
void mcu_io(address_map &map);
|
||||
void mcu_p2_w(u8 data);
|
||||
u8 mcu_bus_r();
|
||||
void mcu_bus_w(u8 data);
|
||||
|
||||
// synchronised signals
|
||||
void set_buf_data(void *ptr, s32 param);
|
||||
void set_buf_ack_in(void *ptr, s32 param);
|
||||
void clear_ibusy(void *ptr, s32 param);
|
||||
|
||||
required_device<mcs48_cpu_device> m_mcu;
|
||||
std::unique_ptr<u8 []> m_ram;
|
||||
|
||||
u16 m_ram_row; // U1-U8
|
||||
u8 m_ram_mask; // mask out chips that are not installed
|
||||
u8 m_mcu_p2; // U10
|
||||
u8 m_data_latch; // U14 (synchronised)
|
||||
u8 m_ibusy; // U12
|
||||
u8 m_buf_ack_latch; // U12
|
||||
u8 m_buf_ack_in; // printer connector pin 19 (synchronised)
|
||||
};
|
||||
|
||||
|
||||
class a2bus_buf_grapplerplus_reva_device : public a2bus_buf_grapplerplus_device
|
||||
{
|
||||
public:
|
||||
a2bus_buf_grapplerplus_reva_device(machine_config const &mconfig, char const *tag, device_t *owner, u32 clock);
|
||||
|
||||
static auto parent_rom_device_type() { return &A2BUS_BUFGRAPPLERPLUS; }
|
||||
|
||||
protected:
|
||||
// device_t implementation
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(A2BUS_GRAPPLER, device_a2bus_card_interface)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_GRAPPLERPLUS, device_a2bus_card_interface)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUS, device_a2bus_card_interface)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_BUFGRAPPLERPLUSA, device_a2bus_card_interface)
|
||||
|
||||
#endif // MAME_BUS_A2BUS_GRAPPLERPLUS_H
|
||||
|
@ -66,6 +66,12 @@
|
||||
#include "emu.h"
|
||||
#include "mouse.h"
|
||||
|
||||
#include "machine/6821pia.h"
|
||||
#include "cpu/m6805/m68705.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
/***************************************************************************
|
||||
CONSTANTS
|
||||
***************************************************************************/
|
||||
@ -79,11 +85,59 @@
|
||||
#define MOUSE_YAXIS_TAG "a2mse_y"
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
GLOBAL VARIABLES
|
||||
***************************************************************************/
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class a2bus_mouse_device:
|
||||
public device_t,
|
||||
public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
a2bus_mouse_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// overrides of standard a2bus slot functions
|
||||
virtual uint8_t read_c0nx(uint8_t offset) override;
|
||||
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
|
||||
virtual uint8_t read_cnxx(uint8_t offset) override;
|
||||
|
||||
void pia_out_a(uint8_t data);
|
||||
void pia_out_b(uint8_t data);
|
||||
DECLARE_WRITE_LINE_MEMBER(pia_irqa_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(pia_irqb_w);
|
||||
|
||||
uint8_t mcu_port_a_r();
|
||||
uint8_t mcu_port_b_r();
|
||||
void mcu_port_a_w(uint8_t data);
|
||||
void mcu_port_b_w(uint8_t data);
|
||||
void mcu_port_c_w(uint8_t data);
|
||||
|
||||
required_device<pia6821_device> m_pia;
|
||||
required_device<m68705p_device> m_mcu;
|
||||
required_ioport m_mouseb;
|
||||
required_ioport_array<2> m_mousexy;
|
||||
|
||||
private:
|
||||
template <unsigned AXIS, u8 DIR, u8 CLK> void update_axis();
|
||||
|
||||
required_region_ptr<uint8_t> m_rom;
|
||||
int m_rom_bank;
|
||||
uint8_t m_port_a_in, m_port_b_in;
|
||||
int m_last[2], m_count[2];
|
||||
};
|
||||
|
||||
DEFINE_DEVICE_TYPE(A2BUS_MOUSE, a2bus_mouse_device, "a2mouse", "Apple II Mouse Card")
|
||||
|
||||
ROM_START( mouse )
|
||||
ROM_REGION(0x800, MOUSE_ROM_REGION, 0)
|
||||
@ -97,7 +151,7 @@ ROM_START( mouse )
|
||||
ROM_LOAD( "mmi_pal16r4a,binary.2a", 0x000000, 0x000100, CRC(1da5c745) SHA1(ba267b69a2fda2a2348b140979ece562411bb37b) )
|
||||
ROM_END
|
||||
|
||||
static INPUT_PORTS_START( mouse )
|
||||
INPUT_PORTS_START( mouse )
|
||||
PORT_START(MOUSE_BUTTON_TAG) /* Mouse - button */
|
||||
PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON1) PORT_NAME("Mouse Button") PORT_CODE(MOUSECODE_BUTTON1)
|
||||
|
||||
@ -324,3 +378,12 @@ template <unsigned AXIS, u8 DIR, u8 CLK> void a2bus_mouse_device::update_axis()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************************
|
||||
GLOBAL VARIABLES
|
||||
***************************************************************************/
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(A2BUS_MOUSE, device_a2bus_card_interface, a2bus_mouse_device, "a2mouse", "Apple II Mouse Card")
|
||||
|
@ -14,63 +14,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "a2bus.h"
|
||||
#include "machine/6821pia.h"
|
||||
#include "cpu/m6805/m68705.h"
|
||||
|
||||
//**************************************************************************
|
||||
// TYPE DEFINITIONS
|
||||
//**************************************************************************
|
||||
|
||||
class a2bus_mouse_device:
|
||||
public device_t,
|
||||
public device_a2bus_card_interface
|
||||
{
|
||||
public:
|
||||
// construction/destruction
|
||||
a2bus_mouse_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
// optional information overrides
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
protected:
|
||||
a2bus_mouse_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
// overrides of standard a2bus slot functions
|
||||
virtual uint8_t read_c0nx(uint8_t offset) override;
|
||||
virtual void write_c0nx(uint8_t offset, uint8_t data) override;
|
||||
virtual uint8_t read_cnxx(uint8_t offset) override;
|
||||
|
||||
void pia_out_a(uint8_t data);
|
||||
void pia_out_b(uint8_t data);
|
||||
DECLARE_WRITE_LINE_MEMBER(pia_irqa_w);
|
||||
DECLARE_WRITE_LINE_MEMBER(pia_irqb_w);
|
||||
|
||||
uint8_t mcu_port_a_r();
|
||||
uint8_t mcu_port_b_r();
|
||||
void mcu_port_a_w(uint8_t data);
|
||||
void mcu_port_b_w(uint8_t data);
|
||||
void mcu_port_c_w(uint8_t data);
|
||||
|
||||
required_device<pia6821_device> m_pia;
|
||||
required_device<m68705p_device> m_mcu;
|
||||
required_ioport m_mouseb;
|
||||
required_ioport_array<2> m_mousexy;
|
||||
|
||||
private:
|
||||
template <unsigned AXIS, u8 DIR, u8 CLK> void update_axis();
|
||||
|
||||
required_region_ptr<uint8_t> m_rom;
|
||||
int m_rom_bank;
|
||||
uint8_t m_port_a_in, m_port_b_in;
|
||||
int m_last[2], m_count[2];
|
||||
};
|
||||
|
||||
// device type definition
|
||||
DECLARE_DEVICE_TYPE(A2BUS_MOUSE, a2bus_mouse_device)
|
||||
DECLARE_DEVICE_TYPE(A2BUS_MOUSE, device_a2bus_card_interface)
|
||||
|
||||
#endif // MAME_DEVICES_A2BUS_MOUSE_H
|
||||
|
@ -4,12 +4,32 @@
|
||||
#include "emu.h"
|
||||
#include "ie15.h"
|
||||
|
||||
ie15_terminal_device::ie15_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SERIAL_TERMINAL_IE15, tag, owner, clock)
|
||||
, device_rs232_port_interface(mconfig, *this)
|
||||
, m_ie15(*this, "ie15")
|
||||
#include "machine/ie15.h"
|
||||
|
||||
namespace {
|
||||
|
||||
class ie15_terminal_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
}
|
||||
public:
|
||||
ie15_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SERIAL_TERMINAL_IE15, tag, owner, clock)
|
||||
, device_rs232_port_interface(mconfig, *this)
|
||||
, m_ie15(*this, "ie15")
|
||||
{
|
||||
}
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { m_ie15->rs232_conn_rxd_w(state); }
|
||||
|
||||
protected:
|
||||
virtual void device_start() override { }
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
private:
|
||||
required_device<ie15_device> m_ie15;
|
||||
};
|
||||
|
||||
|
||||
void ie15_terminal_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
@ -28,15 +48,6 @@ ioport_constructor ie15_terminal_device::device_input_ports() const
|
||||
return INPUT_PORTS_NAME(ie15_terminal);
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER(ie15_terminal_device::input_txd)
|
||||
{
|
||||
m_ie15->rs232_conn_rxd_w(state);
|
||||
}
|
||||
|
||||
void ie15_terminal_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
void ie15_terminal_device::device_reset()
|
||||
{
|
||||
output_rxd(1);
|
||||
@ -47,4 +58,7 @@ void ie15_terminal_device::device_reset()
|
||||
output_cts(0);
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_TYPE(SERIAL_TERMINAL_IE15, ie15_terminal_device, "ie15_terminal", "IE15 Terminal")
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(SERIAL_TERMINAL_IE15, device_rs232_port_interface, ie15_terminal_device, "ie15_terminal", "IE15 Terminal")
|
||||
|
@ -7,26 +7,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "rs232.h"
|
||||
#include "machine/ie15.h"
|
||||
|
||||
|
||||
class ie15_terminal_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
public:
|
||||
ie15_terminal_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
private:
|
||||
required_device<ie15_device> m_ie15;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SERIAL_TERMINAL_IE15, ie15_terminal_device)
|
||||
DECLARE_DEVICE_TYPE(SERIAL_TERMINAL_IE15, device_rs232_port_interface)
|
||||
|
||||
#endif // MAME_BUS_RS232_IE15_H
|
||||
|
@ -17,13 +17,50 @@
|
||||
|
||||
#include "emu.h"
|
||||
#include "mboardd.h"
|
||||
|
||||
#include "cpu/m6800/m6801.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
#include "speaker.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
ROM_START(mboardd)
|
||||
ROM_REGION(0x800, "mbcpu", 0)
|
||||
ROM_LOAD("mockingboard d rom.bin", 0x000000, 0x000800, CRC(277b1813) SHA1(e8d20f4b59fe867ff76434d35a14d2cbdc8533e3))
|
||||
ROM_END
|
||||
|
||||
class mockingboard_d_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
public:
|
||||
mockingboard_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override;
|
||||
|
||||
required_device<m6803_cpu_device> m_cpu;
|
||||
required_device<ay8913_device> m_ay1;
|
||||
required_device<ay8913_device> m_ay2;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
||||
private:
|
||||
u8 p2_r() { return m_rx_state<<3; };
|
||||
void p1_w(u8 data);
|
||||
|
||||
void ser_tx_w(int state) { output_rxd(state); }
|
||||
|
||||
void c000_w(u8 data) { m_c000_latch = data; };
|
||||
|
||||
void m6803_mem(address_map &map);
|
||||
int m_rx_state;
|
||||
u8 m_c000_latch;
|
||||
};
|
||||
|
||||
mockingboard_d_device::mockingboard_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
|
||||
: device_t(mconfig, SERIAL_MOCKINGBOARD_D, tag, owner, clock)
|
||||
, device_rs232_port_interface(mconfig, *this)
|
||||
@ -102,4 +139,7 @@ void mockingboard_d_device::p1_w(u8 data)
|
||||
}
|
||||
}
|
||||
|
||||
DEFINE_DEVICE_TYPE(SERIAL_MOCKINGBOARD_D, mockingboard_d_device, "mockingboardd", "Sweet Micro Systems Mockingboard D")
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(SERIAL_MOCKINGBOARD_D, device_rs232_port_interface, mockingboard_d_device, "mockingboardd", "Sweet Micro Systems Mockingboard D")
|
||||
|
@ -1,45 +1,12 @@
|
||||
// license:BSD-3-Clause
|
||||
// copyright-holders:R. Belmont
|
||||
|
||||
#ifndef MAME_BUS_RS232_MBOARDD_H
|
||||
#define MAME_BUS_RS232_MBOARDD_H
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "rs232.h"
|
||||
#include "cpu/m6800/m6801.h"
|
||||
#include "sound/ay8910.h"
|
||||
|
||||
class mockingboard_d_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
public:
|
||||
mockingboard_d_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override;
|
||||
|
||||
required_device<m6803_cpu_device> m_cpu;
|
||||
required_device<ay8913_device> m_ay1;
|
||||
required_device<ay8913_device> m_ay2;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
virtual const tiny_rom_entry *device_rom_region() const override;
|
||||
|
||||
private:
|
||||
u8 p2_r() { return m_rx_state<<3; };
|
||||
void p1_w(u8 data);
|
||||
|
||||
void ser_tx_w(int state) { output_rxd(state); }
|
||||
|
||||
void c000_w(u8 data) { m_c000_latch = data; };
|
||||
|
||||
void m6803_mem(address_map &map);
|
||||
int m_rx_state;
|
||||
u8 m_c000_latch;
|
||||
};
|
||||
|
||||
DECLARE_DEVICE_TYPE(SERIAL_MOCKINGBOARD_D, mockingboard_d_device)
|
||||
DECLARE_DEVICE_TYPE(SERIAL_MOCKINGBOARD_D, device_rs232_port_interface)
|
||||
|
||||
#endif // MAME_BUS_RS232_MBOARDD_H
|
||||
|
@ -42,7 +42,7 @@
|
||||
#include "emu.h"
|
||||
#include "rs232.h"
|
||||
|
||||
DEFINE_DEVICE_TYPE(RS232_PORT, rs232_port_device, "rs232", "RS232 Port")
|
||||
DEFINE_DEVICE_TYPE(RS232_PORT, rs232_port_device, "rs232", "RS-232 Port")
|
||||
|
||||
rs232_port_device::rs232_port_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
|
||||
rs232_port_device(mconfig, RS232_PORT, tag, owner, clock)
|
||||
@ -91,6 +91,13 @@ void rs232_port_device::device_resolve_objects()
|
||||
m_cts_handler.resolve_safe();
|
||||
m_rxc_handler.resolve_safe();
|
||||
m_txc_handler.resolve_safe();
|
||||
|
||||
m_rxd = 1;
|
||||
m_dcd = 1;
|
||||
m_dsr = 1;
|
||||
m_ri = 1;
|
||||
m_si = 1;
|
||||
m_cts = 1;
|
||||
}
|
||||
|
||||
void rs232_port_device::device_reset()
|
||||
@ -113,13 +120,6 @@ void rs232_port_device::device_start()
|
||||
save_item(NAME(m_cts));
|
||||
save_item(NAME(m_dce_rxc));
|
||||
save_item(NAME(m_dce_txc));
|
||||
|
||||
m_rxd = 1;
|
||||
m_dcd = 1;
|
||||
m_dsr = 1;
|
||||
m_ri = 1;
|
||||
m_si = 1;
|
||||
m_cts = 1;
|
||||
}
|
||||
|
||||
WRITE_LINE_MEMBER( rs232_port_device::write_txd )
|
||||
@ -162,31 +162,37 @@ device_rs232_port_interface::~device_rs232_port_interface()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
#include "ie15.h"
|
||||
#include "keyboard.h"
|
||||
#include "loopback.h"
|
||||
#include "mboardd.h"
|
||||
#include "null_modem.h"
|
||||
#include "patchbox.h"
|
||||
#include "printer.h"
|
||||
#include "pty.h"
|
||||
#include "rs232_sync_io.h"
|
||||
#include "sun_kbd.h"
|
||||
#include "swtpc8212.h"
|
||||
#include "terminal.h"
|
||||
#include "ie15.h"
|
||||
#include "rs232_sync_io.h"
|
||||
#include "mboardd.h"
|
||||
|
||||
template class device_finder<device_rs232_port_interface, false>;
|
||||
template class device_finder<device_rs232_port_interface, true>;
|
||||
|
||||
void default_rs232_devices(device_slot_interface &device)
|
||||
{
|
||||
device.option_add("dec_loopback", DEC_RS232_LOOPBACK);
|
||||
device.option_add("ie15", SERIAL_TERMINAL_IE15);
|
||||
device.option_add("keyboard", SERIAL_KEYBOARD);
|
||||
device.option_add("loopback", RS232_LOOPBACK);
|
||||
device.option_add("null_modem", NULL_MODEM);
|
||||
device.option_add("printer", SERIAL_PRINTER);
|
||||
device.option_add("pty", PSEUDO_TERMINAL);
|
||||
device.option_add("rs_printer", RADIO_SHACK_SERIAL_PRINTER);
|
||||
device.option_add("dec_loopback", DEC_RS232_LOOPBACK);
|
||||
device.option_add("ie15", SERIAL_TERMINAL_IE15);
|
||||
device.option_add("keyboard", SERIAL_KEYBOARD);
|
||||
device.option_add("loopback", RS232_LOOPBACK);
|
||||
device.option_add("mockingboard", SERIAL_MOCKINGBOARD_D);
|
||||
device.option_add("null_modem", NULL_MODEM);
|
||||
device.option_add("patch", RS232_PATCH_BOX);
|
||||
device.option_add("printer", SERIAL_PRINTER);
|
||||
device.option_add("pty", PSEUDO_TERMINAL);
|
||||
device.option_add("rs232_sync_io", RS232_SYNC_IO);
|
||||
device.option_add("sunkbd", SUN_KBD_ADAPTOR);
|
||||
device.option_add("swtpc8212", SERIAL_TERMINAL_SWTPC8212);
|
||||
device.option_add("terminal", SERIAL_TERMINAL);
|
||||
device.option_add("mockingboard", SERIAL_MOCKINGBOARD_D);
|
||||
device.option_add("rs_printer", RADIO_SHACK_SERIAL_PRINTER);
|
||||
device.option_add("sunkbd", SUN_KBD_ADAPTOR);
|
||||
device.option_add("swtpc8212", SERIAL_TERMINAL_SWTPC8212);
|
||||
device.option_add("terminal", SERIAL_TERMINAL);
|
||||
}
|
||||
|
@ -128,20 +128,20 @@ public:
|
||||
auto rxc_handler() { return m_rxc_handler.bind(); }
|
||||
auto txc_handler() { return m_txc_handler.bind(); }
|
||||
|
||||
DECLARE_WRITE_LINE_MEMBER( write_txd );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_dtr );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_rts );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_etc );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_spds );
|
||||
DECLARE_WRITE_LINE_MEMBER( write_txd ); // DB25 pin 2 V.24 circuit 103 Transmitted data
|
||||
DECLARE_WRITE_LINE_MEMBER( write_dtr ); // DB25 pin 20 V.24 circuit 108/2 Data terminal ready
|
||||
DECLARE_WRITE_LINE_MEMBER( write_rts ); // DB25 pin 4 V.24 circuit 105 Request to send
|
||||
DECLARE_WRITE_LINE_MEMBER( write_etc ); // DB25 pin 24 V.24 circuit 113 Transmitter signal element timing (DTE)
|
||||
DECLARE_WRITE_LINE_MEMBER( write_spds ); // DB25 pin 23 V.24 circuit 111 Data signal rate selector (DTE)
|
||||
|
||||
DECLARE_READ_LINE_MEMBER( rxd_r ) { return m_rxd; }
|
||||
DECLARE_READ_LINE_MEMBER( dcd_r ) { return m_dcd; }
|
||||
DECLARE_READ_LINE_MEMBER( dsr_r ) { return m_dsr; }
|
||||
DECLARE_READ_LINE_MEMBER( ri_r ) { return m_ri; }
|
||||
DECLARE_READ_LINE_MEMBER( si_r ) { return m_si; }
|
||||
DECLARE_READ_LINE_MEMBER( cts_r ) { return m_cts; }
|
||||
DECLARE_READ_LINE_MEMBER( rxc_r ) { return m_dce_rxc; }
|
||||
DECLARE_READ_LINE_MEMBER( txc_r ) { return m_dce_txc; }
|
||||
DECLARE_READ_LINE_MEMBER( rxd_r ) { return m_rxd; } // DB25 pin 3 V.24 circuit 104 Received data
|
||||
DECLARE_READ_LINE_MEMBER( dcd_r ) { return m_dcd; } // DB25 pin 8 V.24 circuit 109 Data channel received line signal detector
|
||||
DECLARE_READ_LINE_MEMBER( dsr_r ) { return m_dsr; } // DB25 pin 6 V.24 circuit 107 Data set ready
|
||||
DECLARE_READ_LINE_MEMBER( ri_r ) { return m_ri; } // DB25 pin 22 V.24 circuit 125 Calling indicator
|
||||
DECLARE_READ_LINE_MEMBER( si_r ) { return m_si; } // V.24 circuit 112 Data signal rate selector (DCE)
|
||||
DECLARE_READ_LINE_MEMBER( cts_r ) { return m_cts; } // DB25 pin 5 V.24 circuit 106 Ready for sending
|
||||
DECLARE_READ_LINE_MEMBER( rxc_r ) { return m_dce_rxc; } // DB25 pin 17 V.24 circuit 115 Receiver signal element timing (DCE)
|
||||
DECLARE_READ_LINE_MEMBER( txc_r ) { return m_dce_txc; } // DB25 pin 15 V.24 circuit 114 Transmitter signal element timing (DCE)
|
||||
|
||||
protected:
|
||||
rs232_port_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock);
|
||||
|
@ -1,49 +1,51 @@
|
||||
#include "emu.h"
|
||||
#include "sun_kbd.h"
|
||||
|
||||
|
||||
DEFINE_DEVICE_TYPE(SUN_KBD_ADAPTOR, sun_keyboard_adaptor_device, "sunkbd_adaptor", "Sun Keyboard Adaptor")
|
||||
#include "bus/sunkbd/sunkbd.h"
|
||||
|
||||
|
||||
sun_keyboard_adaptor_device::sun_keyboard_adaptor_device(
|
||||
machine_config const &mconfig,
|
||||
char const *tag,
|
||||
device_t *owner,
|
||||
uint32_t clock)
|
||||
: device_t(mconfig, SUN_KBD_ADAPTOR, tag, owner, clock)
|
||||
, device_rs232_port_interface(mconfig, *this)
|
||||
, m_keyboard_port(*this, "keyboard")
|
||||
namespace {
|
||||
|
||||
class sun_keyboard_adaptor_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
}
|
||||
public:
|
||||
sun_keyboard_adaptor_device(
|
||||
machine_config const &mconfig,
|
||||
char const *tag,
|
||||
device_t *owner,
|
||||
uint32_t clock)
|
||||
: device_t(mconfig, SUN_KBD_ADAPTOR, tag, owner, clock)
|
||||
, device_rs232_port_interface(mconfig, *this)
|
||||
, m_keyboard_port(*this, "keyboard")
|
||||
{
|
||||
}
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override { m_keyboard_port->write_txd(state); }
|
||||
|
||||
protected:
|
||||
virtual void device_add_mconfig(machine_config &config) override
|
||||
{
|
||||
SUNKBD_PORT(config, m_keyboard_port, default_sun_keyboard_devices, nullptr);
|
||||
m_keyboard_port->rxd_handler().set(FUNC(sun_keyboard_adaptor_device::output_rxd));
|
||||
}
|
||||
|
||||
virtual void device_start() override
|
||||
{
|
||||
}
|
||||
|
||||
virtual void device_reset() override
|
||||
{
|
||||
output_rxd(1);
|
||||
output_dcd(0);
|
||||
output_dsr(0);
|
||||
output_cts(0);
|
||||
}
|
||||
|
||||
private:
|
||||
required_device<sun_keyboard_port_device> m_keyboard_port;
|
||||
};
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
|
||||
sun_keyboard_adaptor_device::~sun_keyboard_adaptor_device()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void sun_keyboard_adaptor_device::device_add_mconfig(machine_config &config)
|
||||
{
|
||||
SUNKBD_PORT(config, m_keyboard_port, default_sun_keyboard_devices, nullptr);
|
||||
m_keyboard_port->rxd_handler().set(FUNC(sun_keyboard_adaptor_device::output_rxd));
|
||||
}
|
||||
|
||||
|
||||
WRITE_LINE_MEMBER(sun_keyboard_adaptor_device::input_txd)
|
||||
{
|
||||
m_keyboard_port->write_txd(state);
|
||||
}
|
||||
|
||||
|
||||
void sun_keyboard_adaptor_device::device_start()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void sun_keyboard_adaptor_device::device_reset()
|
||||
{
|
||||
output_rxd(1);
|
||||
output_dcd(0);
|
||||
output_dsr(0);
|
||||
output_cts(0);
|
||||
}
|
||||
DEFINE_DEVICE_TYPE_PRIVATE(SUN_KBD_ADAPTOR, device_rs232_port_interface, sun_keyboard_adaptor_device, "sunkbd_adaptor", "Sun Keyboard Adaptor")
|
||||
|
@ -6,28 +6,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "rs232.h"
|
||||
#include "bus/sunkbd/sunkbd.h"
|
||||
|
||||
|
||||
DECLARE_DEVICE_TYPE(SUN_KBD_ADAPTOR, sun_keyboard_adaptor_device)
|
||||
|
||||
|
||||
class sun_keyboard_adaptor_device : public device_t, public device_rs232_port_interface
|
||||
{
|
||||
public:
|
||||
sun_keyboard_adaptor_device(machine_config const &mconfig, char const *tag, device_t *owner, uint32_t clock);
|
||||
virtual ~sun_keyboard_adaptor_device() override;
|
||||
|
||||
virtual DECLARE_WRITE_LINE_MEMBER( input_txd ) override;
|
||||
|
||||
protected:
|
||||
virtual void device_start() override;
|
||||
virtual void device_reset() override;
|
||||
|
||||
virtual void device_add_mconfig(machine_config &config) override;
|
||||
|
||||
private:
|
||||
required_device<sun_keyboard_port_device> m_keyboard_port;
|
||||
};
|
||||
DECLARE_DEVICE_TYPE(SUN_KBD_ADAPTOR, device_rs232_port_interface)
|
||||
|
||||
#endif // MAME_BUS_RS232_SUN_KBD_H
|
||||
|
@ -191,7 +191,7 @@ delegate_generic_function delegate_mfp_msvc::adjust_this_pointer(delegate_generi
|
||||
LOG("redirecting to %p\n", func);
|
||||
continue;
|
||||
}
|
||||
if ((0x40 == func[5]) && (0x48 == func[7]) && (0xff == func[8]) && (0xe0 == func[9]))
|
||||
else if ((0x40 == func[5]) && (0x48 == func[7]) && (0xff == func[8]) && (0xe0 == func[9]))
|
||||
{
|
||||
// 8-bit displacement
|
||||
LOG("Found virtual member function thunk at %p ", func);
|
||||
|
Loading…
Reference in New Issue
Block a user