Skip to content

Commit 72daadc

Browse files
authored
bus/centronics: Added a skeleton Epson RX-80 printer device to allow the CPU ROM to be debugged. (#13391)
1 parent 93b81fe commit 72daadc

File tree

4 files changed

+194
-0
lines changed

4 files changed

+194
-0
lines changed

scripts/src/bus.lua

+2
Original file line numberDiff line numberDiff line change
@@ -3304,6 +3304,8 @@ if (BUSES["CENTRONICS"]~=null) then
33043304
MAME_DIR .. "src/devices/bus/centronics/epson_lx800.h",
33053305
MAME_DIR .. "src/devices/bus/centronics/epson_lx810l.cpp",
33063306
MAME_DIR .. "src/devices/bus/centronics/epson_lx810l.h",
3307+
MAME_DIR .. "src/devices/bus/centronics/epson_rx80.cpp",
3308+
MAME_DIR .. "src/devices/bus/centronics/epson_rx80.h",
33073309
MAME_DIR .. "src/devices/bus/centronics/nec_p72.cpp",
33083310
MAME_DIR .. "src/devices/bus/centronics/nec_p72.h",
33093311
MAME_DIR .. "src/devices/bus/centronics/nlq401.cpp",

src/devices/bus/centronics/ctronics.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ device_centronics_peripheral_interface::~device_centronics_peripheral_interface(
122122
#include "epson_ex800.h"
123123
#include "epson_lx800.h"
124124
#include "epson_lx810l.h"
125+
#include "epson_rx80.h"
125126
#include "nec_p72.h"
126127
#include "printer.h"
127128
#include "digiblst.h"
@@ -139,6 +140,7 @@ void centronics_devices(device_slot_interface &device)
139140
device.option_add("lx800", EPSON_LX800);
140141
device.option_add("lx810l", EPSON_LX810L);
141142
device.option_add("ap2000", EPSON_AP2000);
143+
device.option_add("rx80", EPSON_RX80);
142144
device.option_add("p72", NEC_P72);
143145
device.option_add("printer", CENTRONICS_PRINTER);
144146
device.option_add("digiblst", CENTRONICS_DIGIBLASTER);
+171
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Golden Child
3+
/***************************************************************************
4+
5+
Epson RX-80 Dot Matrix printer (skeleton)
6+
7+
Main CPU is a UPD7810 running at 11 MHz.
8+
8K of mask ROM (marked EPSON M64200CA)
9+
uses 256 bytes of ram inside upd7810, no external ram chips
10+
has a limited line buffer of 137 bytes maximum from ff00 to ff88,
11+
used for character buffer as well as during graphic print operation.
12+
137 bytes is approximate maximum line length during condensed print.
13+
14+
*****************************************************************************/
15+
16+
#include "emu.h"
17+
#include "epson_rx80.h"
18+
19+
#include "cpu/upd7810/upd7810.h"
20+
21+
22+
namespace {
23+
24+
//**************************************************************************
25+
// TYPE DEFINITIONS
26+
//**************************************************************************
27+
28+
class epson_rx80_device : public device_t, public device_centronics_peripheral_interface
29+
{
30+
public:
31+
// construction/destruction
32+
epson_rx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
33+
34+
static constexpr feature_type unemulated_features() { return feature::PRINTER; }
35+
36+
/* Centronics stuff */
37+
virtual void input_init(int state) override;
38+
virtual void input_strobe(int state) override;
39+
virtual void input_data0(int state) override { if (state) m_centronics_data |= 0x01; else m_centronics_data &= ~0x01; }
40+
virtual void input_data1(int state) override { if (state) m_centronics_data |= 0x02; else m_centronics_data &= ~0x02; }
41+
virtual void input_data2(int state) override { if (state) m_centronics_data |= 0x04; else m_centronics_data &= ~0x04; }
42+
virtual void input_data3(int state) override { if (state) m_centronics_data |= 0x08; else m_centronics_data &= ~0x08; }
43+
virtual void input_data4(int state) override { if (state) m_centronics_data |= 0x10; else m_centronics_data &= ~0x10; }
44+
virtual void input_data5(int state) override { if (state) m_centronics_data |= 0x20; else m_centronics_data &= ~0x20; }
45+
virtual void input_data6(int state) override { if (state) m_centronics_data |= 0x40; else m_centronics_data &= ~0x40; }
46+
virtual void input_data7(int state) override { if (state) m_centronics_data |= 0x80; else m_centronics_data &= ~0x80; }
47+
48+
protected:
49+
virtual void device_start() override ATTR_COLD;
50+
virtual void device_reset() override ATTR_COLD;
51+
52+
virtual const tiny_rom_entry *device_rom_region() const override ATTR_COLD;
53+
virtual void device_add_mconfig(machine_config &config) override ATTR_COLD;
54+
virtual ioport_constructor device_input_ports() const override ATTR_COLD;
55+
56+
virtual bool supports_pin35_5v() override { return true; }
57+
58+
private:
59+
uint8_t centronics_data_r(offs_t offset) { return m_centronics_data; };
60+
61+
void epson_rx80_mem(address_map &map) ATTR_COLD;
62+
63+
required_device<upd7810_device> m_maincpu;
64+
65+
uint8_t m_centronics_data;
66+
};
67+
68+
//-------------------------------------------------
69+
// ROM( epson_rx80 )
70+
//-------------------------------------------------
71+
72+
ROM_START( epson_rx80 )
73+
ROM_REGION(0x2000, "maincpu", 0) // 8K rom for upd7810
74+
ROM_LOAD("rx80_2764.bin", 0x0000, 0x2000, CRC(5206104a) SHA1(3e304f5331181aedb321d3db23a9387e3cfacf0c))
75+
ROM_END
76+
77+
78+
//-------------------------------------------------
79+
// rom_region - device-specific ROM region
80+
//-------------------------------------------------
81+
82+
const tiny_rom_entry *epson_rx80_device::device_rom_region() const
83+
{
84+
return ROM_NAME( epson_rx80 );
85+
}
86+
87+
88+
//-------------------------------------------------
89+
// ADDRESS_MAP( epson_rx80_mem )
90+
//-------------------------------------------------
91+
92+
void epson_rx80_device::epson_rx80_mem(address_map &map)
93+
{
94+
map(0x0000, 0x1fff).rom().region("maincpu", 0);
95+
map(0xd800, 0xd800).r(FUNC(epson_rx80_device::centronics_data_r));
96+
}
97+
98+
99+
//-------------------------------------------------
100+
// device_add_mconfig - add device configuration
101+
//-------------------------------------------------
102+
103+
void epson_rx80_device::device_add_mconfig(machine_config &config)
104+
{
105+
upd7810_device &upd(UPD7810(config, m_maincpu, 11000000)); // 11 Mhz
106+
upd.set_addrmap(AS_PROGRAM, &epson_rx80_device::epson_rx80_mem);
107+
108+
}
109+
110+
111+
//-------------------------------------------------
112+
// INPUT_PORTS( epson_rx80 )
113+
//-------------------------------------------------
114+
115+
INPUT_PORTS_START( epson_rx80 )
116+
INPUT_PORTS_END
117+
118+
119+
//-------------------------------------------------
120+
// input_ports - device-specific input ports
121+
//-------------------------------------------------
122+
123+
ioport_constructor epson_rx80_device::device_input_ports() const
124+
{
125+
return INPUT_PORTS_NAME( epson_rx80 );
126+
}
127+
128+
129+
//-------------------------------------------------
130+
// epson_rx80_device - constructor
131+
//-------------------------------------------------
132+
133+
epson_rx80_device::epson_rx80_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) :
134+
device_t(mconfig, EPSON_RX80, tag, owner, clock),
135+
device_centronics_peripheral_interface(mconfig, *this),
136+
m_maincpu(*this, "maincpu")
137+
{
138+
}
139+
140+
//-------------------------------------------------
141+
// device_start - device-specific startup
142+
//-------------------------------------------------
143+
144+
void epson_rx80_device::device_start()
145+
{
146+
}
147+
148+
//-------------------------------------------------
149+
// device_reset - device-specific reset
150+
//-------------------------------------------------
151+
152+
void epson_rx80_device::device_reset()
153+
{
154+
}
155+
156+
/***************************************************************************
157+
Centronics
158+
***************************************************************************/
159+
160+
void epson_rx80_device::input_strobe(int state)
161+
{
162+
}
163+
164+
void epson_rx80_device::input_init(int state)
165+
{
166+
}
167+
168+
} // anonymous namespace
169+
170+
// GLOBAL
171+
DEFINE_DEVICE_TYPE_PRIVATE(EPSON_RX80, device_centronics_peripheral_interface, epson_rx80_device, "epson_rx80", "Epson RX-80")
+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// license:BSD-3-Clause
2+
// copyright-holders:Golden Child
3+
/**********************************************************************
4+
5+
Epson RX-80 dot matrix printer emulation (skeleton)
6+
7+
**********************************************************************/
8+
9+
#ifndef MAME_BUS_CENTRONICS_EPSON_RX80_H
10+
#define MAME_BUS_CENTRONICS_EPSON_RX80_H
11+
12+
#pragma once
13+
14+
#include "ctronics.h"
15+
16+
// device type declaration
17+
DECLARE_DEVICE_TYPE(EPSON_RX80, device_centronics_peripheral_interface)
18+
19+
#endif // MAME_BUS_CENTRONICS_EPSON_RX80_H

0 commit comments

Comments
 (0)