Previous 199869 Revisions Next

r30940 Wednesday 11th June, 2014 at 11:47:08 UTC by Curt Coder
(MESS) lx800: Refactored Epson LX-800 from a driver into a Centronics device. (nw)
[src/emu/bus]bus.mak
[src/emu/bus/centronics]ctronics.c epson_lx800.c* epson_lx800.h*
[src/emu/layout]lx800.lay*
[src/mess]mess.lst mess.mak
[src/mess/drivers]lx800.c
[src/mess/layout]lx800.lay

trunk/src/emu/bus/bus.mak
r30939r30940
738738BUSOBJS += $(BUSOBJ)/centronics/comxpl80.o
739739BUSOBJS += $(BUSOBJ)/centronics/covox.o
740740BUSOBJS += $(BUSOBJ)/centronics/dsjoy.o
741BUSOBJS += $(BUSOBJ)/centronics/epson_lx800.o
741742BUSOBJS += $(BUSOBJ)/centronics/printer.o
743$(BUSOBJ)/centronics/epson_lx800.o:    $(EMUOBJ)/layout/lx800.lh
742744endif
743745
744746#-------------------------------------------------
trunk/src/emu/bus/centronics/ctronics.c
r30939r30940
116116}
117117
118118
119#include "comxpl80.h"
120#include "epson_lx800.h"
119121#include "printer.h"
120122
121123SLOT_INTERFACE_START(centronics_printers)
124   SLOT_INTERFACE("pl80", COMX_PL80)
125   SLOT_INTERFACE("lx800", EPSON_LX800)
126   SLOT_INTERFACE("lx810l", EPSON_LX810L)
127   SLOT_INTERFACE("ap2000", EPSON_AP2000)
122128   SLOT_INTERFACE("printer", CENTRONICS_PRINTER)
123129SLOT_INTERFACE_END
trunk/src/emu/bus/centronics/epson_lx800.h
r0r30940
1// license:MAME, GPL-2.0+
2// copyright-holders:Dirk Best
3/**********************************************************************
4
5    Epson LX-800 dot matrix printer emulation
6
7    Copyright MESS Team.
8    Visit http://mamedev.org for licensing and usage restrictions.
9
10**********************************************************************/
11
12#pragma once
13
14#ifndef __EPSON_LX800__
15#define __EPSON_LX800__
16
17#include "emu.h"
18#include "ctronics.h"
19#include "cpu/upd7810/upd7810.h"
20#include "machine/e05a03.h"
21#include "sound/beep.h"
22
23
24
25//**************************************************************************
26//  TYPE DEFINITIONS
27//**************************************************************************
28
29// ======================> epson_lx800_t
30
31class epson_lx800_t :  public device_t,
32                  public device_centronics_peripheral_interface
33{
34public:
35   // construction/destruction
36   epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
37   epson_lx800_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source);
38
39   // optional information overrides
40   virtual const rom_entry *device_rom_region() const;
41   virtual machine_config_constructor device_mconfig_additions() const;
42   virtual ioport_constructor device_input_ports() const;
43
44   DECLARE_READ8_MEMBER(porta_r);
45   DECLARE_WRITE8_MEMBER(porta_w);
46   DECLARE_READ8_MEMBER(portc_r);
47   DECLARE_WRITE8_MEMBER(portc_w);
48   DECLARE_READ8_MEMBER(centronics_data_r);
49   DECLARE_WRITE_LINE_MEMBER(centronics_pe_w);
50   DECLARE_WRITE_LINE_MEMBER(paperempty_led_w);
51   DECLARE_WRITE_LINE_MEMBER(reset_w);
52   DECLARE_READ_LINE_MEMBER(an0_r);
53   DECLARE_READ_LINE_MEMBER(an1_r);
54   DECLARE_READ_LINE_MEMBER(an2_r);
55   DECLARE_READ_LINE_MEMBER(an3_r);
56   DECLARE_READ_LINE_MEMBER(an4_r);
57   DECLARE_READ_LINE_MEMBER(an5_r);
58
59protected:
60   // device-level overrides
61   virtual void device_start();
62
63private:
64   required_device<cpu_device> m_maincpu;
65   required_device<beep_device> m_beep;
66};
67
68
69// ======================> epson_lx810l_t
70
71class epson_lx810l_t :  public epson_lx800_t
72{
73public:
74   // construction/destruction
75   epson_lx810l_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
76
77   // optional information overrides
78   virtual const rom_entry *device_rom_region() const;
79};
80
81
82// ======================> epson_ap2000_t
83
84class epson_ap2000_t :  public epson_lx800_t
85{
86public:
87   // construction/destruction
88   epson_ap2000_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
89
90   // optional information overrides
91   virtual const rom_entry *device_rom_region() const;
92};
93
94
95
96// device type definition
97extern const device_type EPSON_LX800;
98extern const device_type EPSON_LX810L;
99extern const device_type EPSON_AP2000;
100
101
102
103#endif
Property changes on: trunk/src/emu/bus/centronics/epson_lx800.h
Added: svn:eol-style
   + native
Added: svn:mime-type
   + text/plain
trunk/src/emu/bus/centronics/epson_lx800.c
r0r30940
1// license:MAME, GPL-2.0+
2// copyright-holders:Dirk Best
3/**********************************************************************
4
5   Epson LX-800 dot matrix printer
6
7    license: MAME, GPL-2.0+
8    copyright-holders: Dirk Best
9
10    Skeleton driver
11
12    - CPU type uPD7810HG
13    - CPU PORTD and PORTF are connected to the Gate Array
14    - processing gets stuck in a loop, and never gets to scan the
15      input buttons and switches.
16    - CPU disassembly doesn't seem to indicate conditional JR or RET.
17
18
19    2014-06-10 Added LX810L, gets caught in a loop almost immediately.
20               IC list:
21               * uPD7810HG (cpu)
22               * E05A30 (gate array)
23               * 2064C (8k RAM)
24               * ER59256 (EEP-ROM - serial nvram)
25               * SLA7020M (step motor driver)
26               * uPC494C (pulse width modulation control)
27               May need to be split off to another driver.
28
29    2014-06-10 Added AP2000, gets caught in the same place as LX810L.
30
31**********************************************************************/
32
33#include "epson_lx800.h"
34#include "lx800.lh"
35
36
37
38//**************************************************************************
39//  DEVICE DEFINITIONS
40//**************************************************************************
41
42const device_type EPSON_LX800 = &device_creator<epson_lx800_t>;
43const device_type EPSON_LX810L = &device_creator<epson_lx810l_t>;
44const device_type EPSON_AP2000 = &device_creator<epson_ap2000_t>;
45
46
47//-------------------------------------------------
48//  ROM( lx800 )
49//-------------------------------------------------
50
51ROM_START( lx800 )
52   ROM_REGION(0x8000, "maincpu", 0)
53   ROM_LOAD("lx800.ic3c", 0x0000, 0x8000, CRC(da06c45b) SHA1(9618c940dd10d5b43cd1edd5763b90e6447de667) )
54ROM_END
55
56
57//-------------------------------------------------
58//  ROM( lx810l )
59//-------------------------------------------------
60
61ROM_START( lx810l )
62   ROM_REGION(0x8000, "maincpu", 0)
63   ROM_LOAD("lx810l.ic3c", 0x0000, 0x8000, CRC(a66454e1) SHA1(8e6f2f98abcbd8af6e34b9ba746edf0d18aef843) )
64ROM_END
65
66
67//-------------------------------------------------
68//  ROM( ap2000 )
69//-------------------------------------------------
70
71ROM_START( ap2000 )
72   ROM_REGION(0x8000, "maincpu", 0)
73   ROM_LOAD("ap2k.ic3c", 0x0000, 0x8000, CRC(ee7294b7) SHA1(219ffa6ff661ce95d5772c9fc1967093718f04e9) )
74ROM_END
75
76
77//-------------------------------------------------
78//  rom_region - device-specific ROM region
79//-------------------------------------------------
80
81const rom_entry *epson_lx800_t::device_rom_region() const
82{
83   return ROM_NAME( lx800 );
84}
85
86
87//-------------------------------------------------
88//  rom_region - device-specific ROM region
89//-------------------------------------------------
90
91const rom_entry *epson_lx810l_t::device_rom_region() const
92{
93   return ROM_NAME( lx810l );
94}
95
96
97//-------------------------------------------------
98//  rom_region - device-specific ROM region
99//-------------------------------------------------
100
101const rom_entry *epson_ap2000_t::device_rom_region() const
102{
103   return ROM_NAME( ap2000 );
104}
105
106
107//-------------------------------------------------
108//  ADDRESS_MAP( lx800_mem )
109//-------------------------------------------------
110
111static ADDRESS_MAP_START( lx800_mem, AS_PROGRAM, 8, epson_lx800_t )
112   AM_RANGE(0x0000, 0x7fff) AM_ROM /* 32k firmware */
113   AM_RANGE(0x8000, 0x9fff) AM_RAM /* 8k external RAM */
114   AM_RANGE(0xa000, 0xbfff) AM_NOP /* not used */
115   AM_RANGE(0xc000, 0xdfff) AM_MIRROR(0x1ff8) AM_DEVREADWRITE("ic3b", e05a03_device, read, write)
116   AM_RANGE(0xe000, 0xfeff) AM_NOP /* not used */
117   AM_RANGE(0xff00, 0xffff) AM_RAM /* internal CPU RAM */
118ADDRESS_MAP_END
119
120
121//-------------------------------------------------
122//  ADDRESS_MAP( lx800_io )
123//-------------------------------------------------
124
125static ADDRESS_MAP_START( lx800_io, AS_IO, 8, epson_lx800_t )
126   AM_RANGE(UPD7810_PORTA, UPD7810_PORTA) AM_READWRITE(porta_r, porta_w)
127   AM_RANGE(UPD7810_PORTB, UPD7810_PORTB) AM_READ_PORT("DIPSW1")
128   AM_RANGE(UPD7810_PORTC, UPD7810_PORTC) AM_READWRITE(portc_r, portc_w)
129ADDRESS_MAP_END
130
131
132//-------------------------------------------------
133//  MACHINE_DRIVER( epson_lx800 )
134//-------------------------------------------------
135
136static MACHINE_CONFIG_FRAGMENT( epson_lx800 )
137   /* basic machine hardware */
138   MCFG_CPU_ADD("maincpu", UPD7810, XTAL_14_7456MHz)
139   MCFG_CPU_PROGRAM_MAP(lx800_mem)
140   MCFG_CPU_IO_MAP(lx800_io)
141   MCFG_UPD7810_AN0(READLINE(epson_lx800_t, an0_r))
142   MCFG_UPD7810_AN1(READLINE(epson_lx800_t, an1_r))
143   MCFG_UPD7810_AN2(READLINE(epson_lx800_t, an2_r))
144   MCFG_UPD7810_AN3(READLINE(epson_lx800_t, an3_r))
145   MCFG_UPD7810_AN4(READLINE(epson_lx800_t, an4_r))
146   MCFG_UPD7810_AN5(READLINE(epson_lx800_t, an5_r))
147
148   MCFG_DEFAULT_LAYOUT(layout_lx800)
149
150   /* audio hardware */
151   MCFG_SPEAKER_STANDARD_MONO("mono")
152   MCFG_SOUND_ADD("beeper", BEEP, 0)
153   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
154
155   /* gate array */
156   MCFG_DEVICE_ADD("ic3b", E05A03, 0)
157   MCFG_E05A03_PE_LP_CALLBACK(WRITELINE(epson_lx800_t, paperempty_led_w))
158   MCFG_E05A03_RESO_CALLBACK(WRITELINE(epson_lx800_t, reset_w))
159   MCFG_E05A03_PE_CALLBACK(WRITELINE(epson_lx800_t, centronics_pe_w))
160   MCFG_E05A03_DATA_CALLBACK(READ8(epson_lx800_t, centronics_data_r))
161MACHINE_CONFIG_END
162
163
164//-------------------------------------------------
165//  machine_config_additions - device-specific
166//  machine configurations
167//-------------------------------------------------
168
169machine_config_constructor epson_lx800_t::device_mconfig_additions() const
170{
171   return MACHINE_CONFIG_NAME( epson_lx800 );
172}
173
174
175//-------------------------------------------------
176//  INPUT_PORTS( epson_lx800 )
177//-------------------------------------------------
178
179INPUT_PORTS_START( epson_lx800 )
180   PORT_START("ONLINE")
181   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("On Line") PORT_CODE(KEYCODE_O)
182
183   PORT_START("FORMFEED")
184   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Form Feed") PORT_CODE(KEYCODE_F)
185
186   PORT_START("LINEFEED")
187   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_L)
188
189   PORT_START("DIPSW1")
190   PORT_DIPNAME(0x01, 0x00, "Typeface")
191   PORT_DIPLOCATION("DIP:8")
192   PORT_DIPSETTING(0x01, "Condensed")
193   PORT_DIPSETTING(0x00, DEF_STR(Normal))
194   PORT_DIPNAME(0x02, 0x00, "ZERO font")
195   PORT_DIPLOCATION("DIP:7")
196   PORT_DIPSETTING(0x02, "0")
197   PORT_DIPSETTING(0x00, "0")
198   PORT_DIPNAME(0x04, 0x00, "Character Table")
199   PORT_DIPLOCATION("DIP:6")
200   PORT_DIPSETTING(0x04, "Graphic")
201   PORT_DIPSETTING(0x00, "Italic")
202   PORT_DIPNAME(0x08, 0x00, "Paper-out detection")
203   PORT_DIPLOCATION("DIP:5")
204   PORT_DIPSETTING(0x08, "Valid")
205   PORT_DIPSETTING(0x00, "Invalid")
206   PORT_DIPNAME(0x10, 0x00, "Printing quality")
207   PORT_DIPLOCATION("DIP:4")
208   PORT_DIPSETTING(0x10, "NLQ")
209   PORT_DIPSETTING(0x00, "Draft")
210   PORT_DIPNAME(0xe0, 0xe0, "International character set")
211   PORT_DIPLOCATION("DIP:3,2,1")
212   PORT_DIPSETTING(0xe0, "U.S.A.")
213   PORT_DIPSETTING(0x60, "France")
214   PORT_DIPSETTING(0xa0, "Germany")
215   PORT_DIPSETTING(0x20, "U.K.")
216   PORT_DIPSETTING(0xc0, "Denmark")
217   PORT_DIPSETTING(0x40, "Sweden")
218   PORT_DIPSETTING(0x80, "Italy")
219   PORT_DIPSETTING(0x00, "Spain")
220
221   PORT_START("DIPSW2")
222   PORT_DIPNAME(0x01, 0x00, "Page length")
223   PORT_DIPLOCATION("DIP:4")
224   PORT_DIPSETTING(0x01, "12\"")
225   PORT_DIPSETTING(0x00, "11\"")
226   PORT_DIPNAME(0x02, 0x00, "Cut sheet feeder mode")
227   PORT_DIPLOCATION("DIP:3")
228   PORT_DIPSETTING(0x02, "Valid")
229   PORT_DIPSETTING(0x00, "Invalid")
230   PORT_DIPNAME(0x04, 0x00, "1\" skip over perforation")
231   PORT_DIPLOCATION("DIP:2")
232   PORT_DIPSETTING(0x04, "Valid")
233   PORT_DIPSETTING(0x00, "Invalid")
234   PORT_DIPNAME(0x08, 0x00, "AUTO FEED XT control")
235   PORT_DIPLOCATION("DIP:1")
236   PORT_DIPSETTING(0x08, "Fix to LOW")
237   PORT_DIPSETTING(0x00, "Depends on external signal")
238INPUT_PORTS_END
239
240
241//-------------------------------------------------
242//  input_ports - device-specific input ports
243//-------------------------------------------------
244
245ioport_constructor epson_lx800_t::device_input_ports() const
246{
247   return INPUT_PORTS_NAME( epson_lx800 );
248}
249
250
251
252//**************************************************************************
253//  LIVE DEVICE
254//**************************************************************************
255
256//-------------------------------------------------
257//  epson_lx800_t - constructor
258//-------------------------------------------------
259
260epson_lx800_t::epson_lx800_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) :
261   device_t(mconfig, EPSON_LX800, "Epson LX-800", tag, owner, clock, "lx800", __FILE__),
262   device_centronics_peripheral_interface(mconfig, *this),
263   m_maincpu(*this, "maincpu"),
264   m_beep(*this, "beeper")
265{
266}
267
268epson_lx800_t::epson_lx800_t(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) :
269   device_t(mconfig, type, name, tag, owner, clock, shortname, __FILE__),
270   device_centronics_peripheral_interface(mconfig, *this),
271   m_maincpu(*this, "maincpu"),
272   m_beep(*this, "beeper")
273{
274}
275
276epson_lx810l_t::epson_lx810l_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
277   : epson_lx800_t(mconfig, EPSON_LX810L, "Epson LX-810L", tag, owner, clock, "lx810l", __FILE__) { }
278
279epson_ap2000_t::epson_ap2000_t(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock)
280   : epson_lx800_t(mconfig, EPSON_AP2000, "Epson ActionPrinter 2000", tag, owner, clock, "ap2000", __FILE__) { }
281
282
283//-------------------------------------------------
284//  device_start - device-specific startup
285//-------------------------------------------------
286
287void epson_lx800_t::device_start()
288{
289   m_beep->set_state(0);
290   m_beep->set_frequency(4000); /* ? */
291}
292
293
294/***************************************************************************
295    I/O PORTS
296***************************************************************************/
297
298/* PA0   W  CRCOM  carriage motor, 0 = holding voltage, 1 = drive voltage
299 * PA1             not used
300 * PA2   W  PFCOM  paper feed motor, 0 = holding voltage, 1 = drive voltage
301 * PA3  R   LF SW  line feed switch
302 * PA4  R   FF SW  form feed switch
303 * PA5  R   PE SW  paper end sensor, 0 = no paper, 1 = paper
304 * PA6             not used
305 * PA7  R   P/S    P/S signal from the optional interface
306 */
307READ8_MEMBER( epson_lx800_t::porta_r )
308{
309   UINT8 result = 0;
310
311   logerror("%s: lx800_porta_r(%02x)\n", machine().describe_context(), offset);
312
313   result |= ioport("LINEFEED")->read() << 3;
314   result |= ioport("FORMFEED")->read() << 4;
315   result |= 1 << 5;
316
317   result |= 1 << 7;
318
319   return result;
320}
321
322WRITE8_MEMBER( epson_lx800_t::porta_w )
323{
324   logerror("%s: lx800_porta_w(%02x): %02x\n", machine().describe_context(), offset, data);
325   logerror("--> carriage: %d, paper feed: %d\n", BIT(data, 0), BIT(data, 2));
326}
327
328/* PC0   W  TXD        serial i/o txd
329 * PC1  R   RXD        serial i/o rxd
330 * PC2   W  ONLINE LP  online led
331 * PC3  R   ONLINE SW  online switch
332 * PC4   W  ERR        centronics error
333 * PC5   W  ACK        centronics acknowledge
334 * PC6   W  FIRE       drive pulse width signal
335 * PC7   W  BUZZER     buzzer signal
336 */
337READ8_MEMBER( epson_lx800_t::portc_r )
338{
339   UINT8 result = 0;
340
341   logerror("%s: lx800_portc_r(%02x)\n", machine().describe_context(), offset);
342
343   result |= ioport("ONLINE")->read() << 3;
344
345   return result;
346}
347
348WRITE8_MEMBER( epson_lx800_t::portc_w )
349{
350   logerror("%s: lx800_portc_w(%02x): %02x\n", machine().describe_context(), offset, data);
351   logerror("--> err: %d, ack: %d, fire: %d, buzzer: %d\n", BIT(data, 4), BIT(data, 5), BIT(data, 6), BIT(data, 7));
352
353   output_set_value("online_led", !BIT(data, 2));
354   m_beep->set_state(!BIT(data, 7));
355}
356
357READ_LINE_MEMBER( epson_lx800_t::an0_r )
358{
359   return BIT(ioport("DIPSW2")->read(), 0);
360}
361
362READ_LINE_MEMBER( epson_lx800_t::an1_r )
363{
364   return BIT(ioport("DIPSW2")->read(), 1);
365}
366
367READ_LINE_MEMBER( epson_lx800_t::an2_r )
368{
369   return BIT(ioport("DIPSW2")->read(), 2);
370}
371
372READ_LINE_MEMBER( epson_lx800_t::an3_r )
373{
374   return BIT(ioport("DIPSW2")->read(), 3); // can also read an external line AUTO_FEED_XT
375}
376
377READ_LINE_MEMBER( epson_lx800_t::an4_r )
378{
379   return 0; // Printer select line (0=always selected)
380}
381
382READ_LINE_MEMBER( epson_lx800_t::an5_r )
383{
384   return 1; // Monitors 24v line, should return 4.08 volts
385}
386
387
388/***************************************************************************
389    GATE ARRAY
390***************************************************************************/
391
392READ8_MEMBER( epson_lx800_t::centronics_data_r )
393{
394   logerror("centronics: data read\n");
395   return 0x55;
396}
397
398WRITE_LINE_MEMBER( epson_lx800_t::centronics_pe_w )
399{
400   logerror("centronics: pe = %d\n", state);
401}
402
403WRITE_LINE_MEMBER( epson_lx800_t::paperempty_led_w )
404{
405   logerror("setting paperout led: %d\n", state);
406   output_set_value("paperout_led", state);
407}
408
409WRITE_LINE_MEMBER( epson_lx800_t::reset_w )
410{
411   logerror("cpu reset");
412   m_maincpu->reset();
413}
Property changes on: trunk/src/emu/bus/centronics/epson_lx800.c
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native
trunk/src/emu/layout/lx800.lay
r0r30940
1<?xml version="1.0"?>
2
3<!-- license: MAME, GPL-2.0+ -->
4<!-- copyright-holders: Dirk Best -->
5
6<mamelayout version="2">
7   <element name="background">
8      <rect>
9         <color red="0.1" green="0.1" blue="0.1" />
10      </rect>
11   </element>
12
13   <element name="power_led" defstate="1">
14      <rect state="0">
15         <color red="0" green="0.2" blue="0" />
16      </rect>
17      <rect state="1">
18         <color red="0" green="0.8" blue="0" />
19      </rect>
20   </element>
21   <element name="green_led" defstate="0">
22      <rect state="0">
23         <color red="0" green="0.2" blue="0" />
24      </rect>
25      <rect state="1">
26         <color red="0" green="0.8" blue="0" />
27      </rect>
28   </element>
29   <element name="red_led" defstate="0">
30      <rect state="0">
31         <color red="0.2" green="0" blue="0" />
32      </rect>
33      <rect state="1">
34         <color red="0.8" green="0" blue="0" />
35      </rect>
36   </element>
37
38   <element name="power_str" defstate="0">
39      <text string="POWER">
40         <color red="1.0" green="1.0" blue="1.0" />
41         <bounds x="0" y="0" width="25" height="4" />
42      </text>
43   </element>
44   <element name="ready_str" defstate="0">
45      <text string="READY">
46         <color red="1.0" green="1.0" blue="1.0" />
47         <bounds x="0" y="0" width="25" height="4" />
48      </text>
49   </element>
50   <element name="paperout_str" defstate="0">
51      <text string="PAPER OUT">
52         <color red="1.0" green="1.0" blue="1.0" />
53         <bounds x="0" y="0" width="35" height="4" />
54      </text>
55   </element>
56   <element name="online_str" defstate="0">
57      <text string="ONLINE">
58         <color red="1.0" green="1.0" blue="1.0" />
59         <bounds x="0" y="0" width="35" height="4" />
60      </text>
61   </element>
62
63   <view name="Control panel">
64      <bezel element="background">
65         <bounds x="0" y="0" width="67" height="52" />
66      </bezel>
67      <bezel name="power_led" element="power_led">
68         <bounds x="8" y="9" width="8" height="4" />
69      </bezel>
70      <bezel name="power_str" element="power_str">
71         <bounds x="18" y="9" width="17" height="4" />
72      </bezel>
73      <bezel name="ready_led" element="green_led">
74         <bounds x="8" y="20" width="8" height="4" />
75      </bezel>
76      <bezel name="ready_str" element="ready_str">
77         <bounds x="18" y="20" width="17" height="4" />
78      </bezel>
79      <bezel name="paperout_led" element="red_led">
80         <bounds x="8" y="31" width="8" height="4" />
81      </bezel>
82      <bezel name="paperout_str" element="paperout_str">
83         <bounds x="18" y="31" width="25" height="4" />
84      </bezel>
85      <bezel name="online_led" element="green_led">
86         <bounds x="8" y="42" width="8" height="4" />
87      </bezel>
88      <bezel name="online_str" element="online_str">
89         <bounds x="18" y="42" width="18" height="4" />
90      </bezel>
91   </view>
92</mamelayout>
Property changes on: trunk/src/emu/layout/lx800.lay
Added: svn:mime-type
   + text/xml
Added: svn:eol-style
   + native
trunk/src/mess/mess.lst
r30939r30940
19861986//********** Misc **********************************************************
19871987
19881988ex800 // Epson EX-800 printer
1989lx800 // Epson LX-800 printer
1990lx810l // Epson LX-810L printer
1991ap2000 // Epson Action Printer 2000
19921989ssem // Manchester Small-Scale Experimental Machine, "Baby"
19931990craft // Craft, by [lft]
19941991
trunk/src/mess/layout/lx800.lay
r30939r30940
1<?xml version="1.0"?>
2
3<!-- license: MAME, GPL-2.0+ -->
4<!-- copyright-holders: Dirk Best -->
5
6<mamelayout version="2">
7   <element name="background">
8      <rect>
9         <color red="0.1" green="0.1" blue="0.1" />
10      </rect>
11   </element>
12
13   <element name="power_led" defstate="1">
14      <rect state="0">
15         <color red="0" green="0.2" blue="0" />
16      </rect>
17      <rect state="1">
18         <color red="0" green="0.8" blue="0" />
19      </rect>
20   </element>
21   <element name="green_led" defstate="0">
22      <rect state="0">
23         <color red="0" green="0.2" blue="0" />
24      </rect>
25      <rect state="1">
26         <color red="0" green="0.8" blue="0" />
27      </rect>
28   </element>
29   <element name="red_led" defstate="0">
30      <rect state="0">
31         <color red="0.2" green="0" blue="0" />
32      </rect>
33      <rect state="1">
34         <color red="0.8" green="0" blue="0" />
35      </rect>
36   </element>
37
38   <element name="power_str" defstate="0">
39      <text string="POWER">
40         <color red="1.0" green="1.0" blue="1.0" />
41         <bounds x="0" y="0" width="25" height="4" />
42      </text>
43   </element>
44   <element name="ready_str" defstate="0">
45      <text string="READY">
46         <color red="1.0" green="1.0" blue="1.0" />
47         <bounds x="0" y="0" width="25" height="4" />
48      </text>
49   </element>
50   <element name="paperout_str" defstate="0">
51      <text string="PAPER OUT">
52         <color red="1.0" green="1.0" blue="1.0" />
53         <bounds x="0" y="0" width="35" height="4" />
54      </text>
55   </element>
56   <element name="online_str" defstate="0">
57      <text string="ONLINE">
58         <color red="1.0" green="1.0" blue="1.0" />
59         <bounds x="0" y="0" width="35" height="4" />
60      </text>
61   </element>
62
63   <view name="Control panel">
64      <bezel element="background">
65         <bounds x="0" y="0" width="67" height="52" />
66      </bezel>
67      <bezel name="power_led" element="power_led">
68         <bounds x="8" y="9" width="8" height="4" />
69      </bezel>
70      <bezel name="power_str" element="power_str">
71         <bounds x="18" y="9" width="17" height="4" />
72      </bezel>
73      <bezel name="ready_led" element="green_led">
74         <bounds x="8" y="20" width="8" height="4" />
75      </bezel>
76      <bezel name="ready_str" element="ready_str">
77         <bounds x="18" y="20" width="17" height="4" />
78      </bezel>
79      <bezel name="paperout_led" element="red_led">
80         <bounds x="8" y="31" width="8" height="4" />
81      </bezel>
82      <bezel name="paperout_str" element="paperout_str">
83         <bounds x="18" y="31" width="25" height="4" />
84      </bezel>
85      <bezel name="online_led" element="green_led">
86         <bounds x="8" y="42" width="8" height="4" />
87      </bezel>
88      <bezel name="online_str" element="online_str">
89         <bounds x="18" y="42" width="18" height="4" />
90      </bezel>
91   </view>
92</mamelayout>
trunk/src/mess/drivers/lx800.c
r30939r30940
1/***************************************************************************
2
3    Epson LX-800 dot matrix printer
4
5    license: MAME, GPL-2.0+
6    copyright-holders: Dirk Best
7
8    Skeleton driver
9
10    - CPU type uPD7810HG
11    - CPU PORTD and PORTF are connected to the Gate Array
12    - processing gets stuck in a loop, and never gets to scan the
13      input buttons and switches.
14    - CPU disassembly doesn't seem to indicate conditional JR or RET.
15
16
17    2014-06-10 Added LX810L, gets caught in a loop almost immediately.
18               IC list:
19               * uPD7810HG (cpu)
20               * E05A30 (gate array)
21               * 2064C (8k RAM)
22               * ER59256 (EEP-ROM - serial nvram)
23               * SLA7020M (step motor driver)
24               * uPC494C (pulse width modulation control)
25               May need to be split off to another driver.
26
27    2014-06-10 Added AP2000, gets caught in the same place as LX810L.
28
29
30***************************************************************************/
31
32#include "emu.h"
33#include "cpu/upd7810/upd7810.h"
34#include "machine/e05a03.h"
35#include "sound/beep.h"
36#include "lx800.lh"
37
38
39/***************************************************************************
40    TYPE DEFINITIONS
41***************************************************************************/
42
43class lx800_state : public driver_device
44{
45public:
46   lx800_state(const machine_config &mconfig, device_type type, const char *tag)
47      : driver_device(mconfig, type, tag)
48      , m_maincpu(*this, "maincpu")
49      , m_beep(*this, "beeper")
50   { }
51
52   DECLARE_READ8_MEMBER(lx800_porta_r);
53   DECLARE_WRITE8_MEMBER(lx800_porta_w);
54   DECLARE_READ8_MEMBER(lx800_portc_r);
55   DECLARE_WRITE8_MEMBER(lx800_portc_w);
56   DECLARE_READ8_MEMBER(lx800_centronics_data_r);
57   DECLARE_WRITE_LINE_MEMBER(lx800_centronics_pe_w);
58   DECLARE_WRITE_LINE_MEMBER(lx800_paperempty_led_w);
59   DECLARE_WRITE_LINE_MEMBER(lx800_reset_w);
60   DECLARE_READ_LINE_MEMBER(an0_r);
61   DECLARE_READ_LINE_MEMBER(an1_r);
62   DECLARE_READ_LINE_MEMBER(an2_r);
63   DECLARE_READ_LINE_MEMBER(an3_r);
64   DECLARE_READ_LINE_MEMBER(an4_r);
65   DECLARE_READ_LINE_MEMBER(an5_r);
66private:
67   required_device<cpu_device> m_maincpu;
68   required_device<beep_device> m_beep;
69   virtual void machine_start();
70};
71
72
73/***************************************************************************
74    I/O PORTS
75***************************************************************************/
76
77/* PA0   W  CRCOM  carriage motor, 0 = holding voltage, 1 = drive voltage
78 * PA1             not used
79 * PA2   W  PFCOM  paper feed motor, 0 = holding voltage, 1 = drive voltage
80 * PA3  R   LF SW  line feed switch
81 * PA4  R   FF SW  form feed switch
82 * PA5  R   PE SW  paper end sensor, 0 = no paper, 1 = paper
83 * PA6             not used
84 * PA7  R   P/S    P/S signal from the optional interface
85 */
86READ8_MEMBER( lx800_state::lx800_porta_r )
87{
88   UINT8 result = 0;
89
90   logerror("%s: lx800_porta_r(%02x)\n", machine().describe_context(), offset);
91
92   result |= ioport("LINEFEED")->read() << 3;
93   result |= ioport("FORMFEED")->read() << 4;
94   result |= 1 << 5;
95
96   result |= 1 << 7;
97
98   return result;
99}
100
101WRITE8_MEMBER( lx800_state::lx800_porta_w )
102{
103   logerror("%s: lx800_porta_w(%02x): %02x\n", machine().describe_context(), offset, data);
104   logerror("--> carriage: %d, paper feed: %d\n", BIT(data, 0), BIT(data, 2));
105}
106
107/* PC0   W  TXD        serial i/o txd
108 * PC1  R   RXD        serial i/o rxd
109 * PC2   W  ONLINE LP  online led
110 * PC3  R   ONLINE SW  online switch
111 * PC4   W  ERR        centronics error
112 * PC5   W  ACK        centronics acknowledge
113 * PC6   W  FIRE       drive pulse width signal
114 * PC7   W  BUZZER     buzzer signal
115 */
116READ8_MEMBER( lx800_state::lx800_portc_r )
117{
118   UINT8 result = 0;
119
120   logerror("%s: lx800_portc_r(%02x)\n", machine().describe_context(), offset);
121
122   result |= ioport("ONLINE")->read() << 3;
123
124   return result;
125}
126
127WRITE8_MEMBER( lx800_state::lx800_portc_w )
128{
129   logerror("%s: lx800_portc_w(%02x): %02x\n", machine().describe_context(), offset, data);
130   logerror("--> err: %d, ack: %d, fire: %d, buzzer: %d\n", BIT(data, 4), BIT(data, 5), BIT(data, 6), BIT(data, 7));
131
132   output_set_value("online_led", !BIT(data, 2));
133   m_beep->set_state(!BIT(data, 7));
134}
135
136READ_LINE_MEMBER( lx800_state::an0_r )
137{
138   return BIT(ioport("DIPSW2")->read(), 0);
139}
140
141READ_LINE_MEMBER( lx800_state::an1_r )
142{
143   return BIT(ioport("DIPSW2")->read(), 1);
144}
145
146READ_LINE_MEMBER( lx800_state::an2_r )
147{
148   return BIT(ioport("DIPSW2")->read(), 2);
149}
150
151READ_LINE_MEMBER( lx800_state::an3_r )
152{
153   return BIT(ioport("DIPSW2")->read(), 3); // can also read an external line AUTO_FEED_XT
154}
155
156READ_LINE_MEMBER( lx800_state::an4_r )
157{
158   return 0; // Printer select line (0=always selected)
159}
160
161READ_LINE_MEMBER( lx800_state::an5_r )
162{
163   return 1; // Monitors 24v line, should return 4.08 volts
164}
165
166
167/***************************************************************************
168    GATE ARRAY
169***************************************************************************/
170
171READ8_MEMBER( lx800_state::lx800_centronics_data_r )
172{
173   logerror("centronics: data read\n");
174   return 0x55;
175}
176
177WRITE_LINE_MEMBER( lx800_state::lx800_centronics_pe_w )
178{
179   logerror("centronics: pe = %d\n", state);
180}
181
182WRITE_LINE_MEMBER( lx800_state::lx800_paperempty_led_w )
183{
184   logerror("setting paperout led: %d\n", state);
185   output_set_value("paperout_led", state);
186}
187
188WRITE_LINE_MEMBER( lx800_state::lx800_reset_w )
189{
190   logerror("cpu reset");
191   m_maincpu->reset();
192}
193
194
195/***************************************************************************
196    MACHINE EMULATION
197***************************************************************************/
198
199void lx800_state::machine_start()
200{
201   m_beep->set_state(0);
202   m_beep->set_frequency(4000); /* ? */
203}
204
205
206/***************************************************************************
207    ADDRESS MAPS
208***************************************************************************/
209
210static ADDRESS_MAP_START( lx800_mem, AS_PROGRAM, 8, lx800_state )
211   AM_RANGE(0x0000, 0x7fff) AM_ROM /* 32k firmware */
212   AM_RANGE(0x8000, 0x9fff) AM_RAM /* 8k external RAM */
213   AM_RANGE(0xa000, 0xbfff) AM_NOP /* not used */
214   AM_RANGE(0xc000, 0xdfff) AM_MIRROR(0x1ff8) AM_DEVREADWRITE("ic3b", e05a03_device, read, write)
215   AM_RANGE(0xe000, 0xfeff) AM_NOP /* not used */
216   AM_RANGE(0xff00, 0xffff) AM_RAM /* internal CPU RAM */
217ADDRESS_MAP_END
218
219static ADDRESS_MAP_START( lx800_io, AS_IO, 8, lx800_state )
220   AM_RANGE(UPD7810_PORTA, UPD7810_PORTA) AM_READWRITE(lx800_porta_r, lx800_porta_w)
221   AM_RANGE(UPD7810_PORTB, UPD7810_PORTB) AM_READ_PORT("DIPSW1")
222   AM_RANGE(UPD7810_PORTC, UPD7810_PORTC) AM_READWRITE(lx800_portc_r, lx800_portc_w)
223ADDRESS_MAP_END
224
225
226/***************************************************************************
227    INPUT PORTS
228***************************************************************************/
229
230static INPUT_PORTS_START( lx800 )
231   PORT_START("ONLINE")
232   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("On Line") PORT_CODE(KEYCODE_O)
233
234   PORT_START("FORMFEED")
235   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Form Feed") PORT_CODE(KEYCODE_F)
236
237   PORT_START("LINEFEED")
238   PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Line Feed") PORT_CODE(KEYCODE_L)
239
240   PORT_START("DIPSW1")
241   PORT_DIPNAME(0x01, 0x00, "Typeface")
242   PORT_DIPLOCATION("DIP:8")
243   PORT_DIPSETTING(0x01, "Condensed")
244   PORT_DIPSETTING(0x00, DEF_STR(Normal))
245   PORT_DIPNAME(0x02, 0x00, "ZERO font")
246   PORT_DIPLOCATION("DIP:7")
247   PORT_DIPSETTING(0x02, "0")
248   PORT_DIPSETTING(0x00, "0")
249   PORT_DIPNAME(0x04, 0x00, "Character Table")
250   PORT_DIPLOCATION("DIP:6")
251   PORT_DIPSETTING(0x04, "Graphic")
252   PORT_DIPSETTING(0x00, "Italic")
253   PORT_DIPNAME(0x08, 0x00, "Paper-out detection")
254   PORT_DIPLOCATION("DIP:5")
255   PORT_DIPSETTING(0x08, "Valid")
256   PORT_DIPSETTING(0x00, "Invalid")
257   PORT_DIPNAME(0x10, 0x00, "Printing quality")
258   PORT_DIPLOCATION("DIP:4")
259   PORT_DIPSETTING(0x10, "NLQ")
260   PORT_DIPSETTING(0x00, "Draft")
261   PORT_DIPNAME(0xe0, 0xe0, "International character set")
262   PORT_DIPLOCATION("DIP:3,2,1")
263   PORT_DIPSETTING(0xe0, "U.S.A.")
264   PORT_DIPSETTING(0x60, "France")
265   PORT_DIPSETTING(0xa0, "Germany")
266   PORT_DIPSETTING(0x20, "U.K.")
267   PORT_DIPSETTING(0xc0, "Denmark")
268   PORT_DIPSETTING(0x40, "Sweden")
269   PORT_DIPSETTING(0x80, "Italy")
270   PORT_DIPSETTING(0x00, "Spain")
271
272   PORT_START("DIPSW2")
273   PORT_DIPNAME(0x01, 0x00, "Page length")
274   PORT_DIPLOCATION("DIP:4")
275   PORT_DIPSETTING(0x01, "12\"")
276   PORT_DIPSETTING(0x00, "11\"")
277   PORT_DIPNAME(0x02, 0x00, "Cut sheet feeder mode")
278   PORT_DIPLOCATION("DIP:3")
279   PORT_DIPSETTING(0x02, "Valid")
280   PORT_DIPSETTING(0x00, "Invalid")
281   PORT_DIPNAME(0x04, 0x00, "1\" skip over perforation")
282   PORT_DIPLOCATION("DIP:2")
283   PORT_DIPSETTING(0x04, "Valid")
284   PORT_DIPSETTING(0x00, "Invalid")
285   PORT_DIPNAME(0x08, 0x00, "AUTO FEED XT control")
286   PORT_DIPLOCATION("DIP:1")
287   PORT_DIPSETTING(0x08, "Fix to LOW")
288   PORT_DIPSETTING(0x00, "Depends on external signal")
289INPUT_PORTS_END
290
291
292/***************************************************************************
293    MACHINE DRIVERS
294***************************************************************************/
295
296static MACHINE_CONFIG_START( lx800, lx800_state )
297   /* basic machine hardware */
298   MCFG_CPU_ADD("maincpu", UPD7810, XTAL_14_7456MHz)
299   MCFG_CPU_PROGRAM_MAP(lx800_mem)
300   MCFG_CPU_IO_MAP(lx800_io)
301   MCFG_UPD7810_AN0(READLINE(lx800_state, an0_r))
302   MCFG_UPD7810_AN1(READLINE(lx800_state, an1_r))
303   MCFG_UPD7810_AN2(READLINE(lx800_state, an2_r))
304   MCFG_UPD7810_AN3(READLINE(lx800_state, an3_r))
305   MCFG_UPD7810_AN4(READLINE(lx800_state, an4_r))
306   MCFG_UPD7810_AN5(READLINE(lx800_state, an5_r))
307
308   MCFG_DEFAULT_LAYOUT(layout_lx800)
309
310   /* audio hardware */
311   MCFG_SPEAKER_STANDARD_MONO("mono")
312   MCFG_SOUND_ADD("beeper", BEEP, 0)
313   MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.05)
314
315   /* gate array */
316   MCFG_DEVICE_ADD("ic3b", E05A03, 0)
317   MCFG_E05A03_PE_LP_CALLBACK(WRITELINE(lx800_state, lx800_paperempty_led_w))
318   MCFG_E05A03_RESO_CALLBACK(WRITELINE(lx800_state, lx800_reset_w))
319   MCFG_E05A03_PE_CALLBACK(WRITELINE(lx800_state, lx800_centronics_pe_w))
320   MCFG_E05A03_DATA_CALLBACK(READ8(lx800_state, lx800_centronics_data_r))
321MACHINE_CONFIG_END
322
323
324/***************************************************************************
325    ROM DEFINITIONS
326***************************************************************************/
327
328ROM_START( lx800 )
329   ROM_REGION(0x8000, "maincpu", 0)
330   ROM_LOAD("lx800.ic3c", 0x0000, 0x8000, CRC(da06c45b) SHA1(9618c940dd10d5b43cd1edd5763b90e6447de667) )
331ROM_END
332
333ROM_START( lx810l )
334   ROM_REGION(0x8000, "maincpu", 0)
335   ROM_LOAD("lx810l.ic3c", 0x0000, 0x8000, CRC(a66454e1) SHA1(8e6f2f98abcbd8af6e34b9ba746edf0d18aef843) )
336ROM_END
337
338ROM_START( ap2000 )
339   ROM_REGION(0x8000, "maincpu", 0)
340   ROM_LOAD("ap2k.ic3c", 0x0000, 0x8000, CRC(ee7294b7) SHA1(219ffa6ff661ce95d5772c9fc1967093718f04e9) )
341ROM_END
342
343
344/***************************************************************************
345    GAME DRIVERS
346***************************************************************************/
347
348/*    YEAR  NAME   PARENT  COMPAT  MACHINE  INPUT  INIT  COMPANY  FULLNAME  FLAGS */
349COMP( 1987, lx800, 0,      0,      lx800,   lx800, driver_device, 0,    "Epson", "LX-800 Printer", GAME_NOT_WORKING )
350COMP( 19??, lx810l,lx800,  0,      lx800,   lx800, driver_device, 0,    "Epson", "LX-810L Printer", GAME_NOT_WORKING )
351COMP( 19??, ap2000,lx800,  0,      lx800,   lx800, driver_device, 0,    "Epson", "Action Printer 2000", GAME_NOT_WORKING )
trunk/src/mess/mess.mak
r30939r30940
12681268$(MESSOBJ)/epson.a:             \
12691269   $(MESS_DRIVERS)/ex800.o     \
12701270   $(MESS_DRIVERS)/hx20.o      \
1271   $(MESS_DRIVERS)/lx800.o     \
12721271   $(MESS_MACHINE)/e05a03.o    \
12731272   $(MESS_DRIVERS)/px4.o       \
12741273   $(MESS_DRIVERS)/px8.o       \
r30939r30940
22862285$(MESS_DRIVERS)/lc80.o:     $(MESS_LAYOUT)/lc80.lh
22872286$(MESS_DRIVERS)/llc.o:      $(MESS_LAYOUT)/llc1.lh
22882287$(MESS_DRIVERS)/lynx.o:     $(MESS_LAYOUT)/lynx.lh
2289$(MESS_DRIVERS)/lx800.o:    $(MESS_LAYOUT)/lx800.lh
22902288$(MESS_DRIVERS)/mac.o:      $(MESS_LAYOUT)/mac.lh
22912289$(MESS_MACHINE)/megacd.o:   $(MESS_LAYOUT)/megacd.lh
22922290$(MESS_DRIVERS)/mekd2.o:    $(MESS_LAYOUT)/mekd2.lh

Previous 199869 Revisions Next


© 1997-2024 The MAME Team