trunk/src/emu/bus/centronics/epson_lx800.c
| r0 | r30940 | |
| 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 | |
| 42 | const device_type EPSON_LX800 = &device_creator<epson_lx800_t>; |
| 43 | const device_type EPSON_LX810L = &device_creator<epson_lx810l_t>; |
| 44 | const device_type EPSON_AP2000 = &device_creator<epson_ap2000_t>; |
| 45 | |
| 46 | |
| 47 | //------------------------------------------------- |
| 48 | // ROM( lx800 ) |
| 49 | //------------------------------------------------- |
| 50 | |
| 51 | ROM_START( lx800 ) |
| 52 | ROM_REGION(0x8000, "maincpu", 0) |
| 53 | ROM_LOAD("lx800.ic3c", 0x0000, 0x8000, CRC(da06c45b) SHA1(9618c940dd10d5b43cd1edd5763b90e6447de667) ) |
| 54 | ROM_END |
| 55 | |
| 56 | |
| 57 | //------------------------------------------------- |
| 58 | // ROM( lx810l ) |
| 59 | //------------------------------------------------- |
| 60 | |
| 61 | ROM_START( lx810l ) |
| 62 | ROM_REGION(0x8000, "maincpu", 0) |
| 63 | ROM_LOAD("lx810l.ic3c", 0x0000, 0x8000, CRC(a66454e1) SHA1(8e6f2f98abcbd8af6e34b9ba746edf0d18aef843) ) |
| 64 | ROM_END |
| 65 | |
| 66 | |
| 67 | //------------------------------------------------- |
| 68 | // ROM( ap2000 ) |
| 69 | //------------------------------------------------- |
| 70 | |
| 71 | ROM_START( ap2000 ) |
| 72 | ROM_REGION(0x8000, "maincpu", 0) |
| 73 | ROM_LOAD("ap2k.ic3c", 0x0000, 0x8000, CRC(ee7294b7) SHA1(219ffa6ff661ce95d5772c9fc1967093718f04e9) ) |
| 74 | ROM_END |
| 75 | |
| 76 | |
| 77 | //------------------------------------------------- |
| 78 | // rom_region - device-specific ROM region |
| 79 | //------------------------------------------------- |
| 80 | |
| 81 | const 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 | |
| 91 | const 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 | |
| 101 | const 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 | |
| 111 | static 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 */ |
| 118 | ADDRESS_MAP_END |
| 119 | |
| 120 | |
| 121 | //------------------------------------------------- |
| 122 | // ADDRESS_MAP( lx800_io ) |
| 123 | //------------------------------------------------- |
| 124 | |
| 125 | static 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) |
| 129 | ADDRESS_MAP_END |
| 130 | |
| 131 | |
| 132 | //------------------------------------------------- |
| 133 | // MACHINE_DRIVER( epson_lx800 ) |
| 134 | //------------------------------------------------- |
| 135 | |
| 136 | static 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)) |
| 161 | MACHINE_CONFIG_END |
| 162 | |
| 163 | |
| 164 | //------------------------------------------------- |
| 165 | // machine_config_additions - device-specific |
| 166 | // machine configurations |
| 167 | //------------------------------------------------- |
| 168 | |
| 169 | machine_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 | |
| 179 | INPUT_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") |
| 238 | INPUT_PORTS_END |
| 239 | |
| 240 | |
| 241 | //------------------------------------------------- |
| 242 | // input_ports - device-specific input ports |
| 243 | //------------------------------------------------- |
| 244 | |
| 245 | ioport_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 | |
| 260 | epson_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 | |
| 268 | epson_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 | |
| 276 | epson_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 | |
| 279 | epson_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 | |
| 287 | void 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 | */ |
| 307 | READ8_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 | |
| 322 | WRITE8_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 | */ |
| 337 | READ8_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 | |
| 348 | WRITE8_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 | |
| 357 | READ_LINE_MEMBER( epson_lx800_t::an0_r ) |
| 358 | { |
| 359 | return BIT(ioport("DIPSW2")->read(), 0); |
| 360 | } |
| 361 | |
| 362 | READ_LINE_MEMBER( epson_lx800_t::an1_r ) |
| 363 | { |
| 364 | return BIT(ioport("DIPSW2")->read(), 1); |
| 365 | } |
| 366 | |
| 367 | READ_LINE_MEMBER( epson_lx800_t::an2_r ) |
| 368 | { |
| 369 | return BIT(ioport("DIPSW2")->read(), 2); |
| 370 | } |
| 371 | |
| 372 | READ_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 | |
| 377 | READ_LINE_MEMBER( epson_lx800_t::an4_r ) |
| 378 | { |
| 379 | return 0; // Printer select line (0=always selected) |
| 380 | } |
| 381 | |
| 382 | READ_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 | |
| 392 | READ8_MEMBER( epson_lx800_t::centronics_data_r ) |
| 393 | { |
| 394 | logerror("centronics: data read\n"); |
| 395 | return 0x55; |
| 396 | } |
| 397 | |
| 398 | WRITE_LINE_MEMBER( epson_lx800_t::centronics_pe_w ) |
| 399 | { |
| 400 | logerror("centronics: pe = %d\n", state); |
| 401 | } |
| 402 | |
| 403 | WRITE_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 | |
| 409 | WRITE_LINE_MEMBER( epson_lx800_t::reset_w ) |
| 410 | { |
| 411 | logerror("cpu reset"); |
| 412 | m_maincpu->reset(); |
| 413 | } |
trunk/src/mess/drivers/lx800.c
| r30939 | r30940 | |
| 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 | | |
| 43 | | class lx800_state : public driver_device |
| 44 | | { |
| 45 | | public: |
| 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); |
| 66 | | private: |
| 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 | | */ |
| 86 | | READ8_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 | | |
| 101 | | WRITE8_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 | | */ |
| 116 | | READ8_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 | | |
| 127 | | WRITE8_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 | | |
| 136 | | READ_LINE_MEMBER( lx800_state::an0_r ) |
| 137 | | { |
| 138 | | return BIT(ioport("DIPSW2")->read(), 0); |
| 139 | | } |
| 140 | | |
| 141 | | READ_LINE_MEMBER( lx800_state::an1_r ) |
| 142 | | { |
| 143 | | return BIT(ioport("DIPSW2")->read(), 1); |
| 144 | | } |
| 145 | | |
| 146 | | READ_LINE_MEMBER( lx800_state::an2_r ) |
| 147 | | { |
| 148 | | return BIT(ioport("DIPSW2")->read(), 2); |
| 149 | | } |
| 150 | | |
| 151 | | READ_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 | | |
| 156 | | READ_LINE_MEMBER( lx800_state::an4_r ) |
| 157 | | { |
| 158 | | return 0; // Printer select line (0=always selected) |
| 159 | | } |
| 160 | | |
| 161 | | READ_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 | | |
| 171 | | READ8_MEMBER( lx800_state::lx800_centronics_data_r ) |
| 172 | | { |
| 173 | | logerror("centronics: data read\n"); |
| 174 | | return 0x55; |
| 175 | | } |
| 176 | | |
| 177 | | WRITE_LINE_MEMBER( lx800_state::lx800_centronics_pe_w ) |
| 178 | | { |
| 179 | | logerror("centronics: pe = %d\n", state); |
| 180 | | } |
| 181 | | |
| 182 | | WRITE_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 | | |
| 188 | | WRITE_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 | | |
| 199 | | void 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 | | |
| 210 | | static 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 */ |
| 217 | | ADDRESS_MAP_END |
| 218 | | |
| 219 | | static 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) |
| 223 | | ADDRESS_MAP_END |
| 224 | | |
| 225 | | |
| 226 | | /*************************************************************************** |
| 227 | | INPUT PORTS |
| 228 | | ***************************************************************************/ |
| 229 | | |
| 230 | | static 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") |
| 289 | | INPUT_PORTS_END |
| 290 | | |
| 291 | | |
| 292 | | /*************************************************************************** |
| 293 | | MACHINE DRIVERS |
| 294 | | ***************************************************************************/ |
| 295 | | |
| 296 | | static 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)) |
| 321 | | MACHINE_CONFIG_END |
| 322 | | |
| 323 | | |
| 324 | | /*************************************************************************** |
| 325 | | ROM DEFINITIONS |
| 326 | | ***************************************************************************/ |
| 327 | | |
| 328 | | ROM_START( lx800 ) |
| 329 | | ROM_REGION(0x8000, "maincpu", 0) |
| 330 | | ROM_LOAD("lx800.ic3c", 0x0000, 0x8000, CRC(da06c45b) SHA1(9618c940dd10d5b43cd1edd5763b90e6447de667) ) |
| 331 | | ROM_END |
| 332 | | |
| 333 | | ROM_START( lx810l ) |
| 334 | | ROM_REGION(0x8000, "maincpu", 0) |
| 335 | | ROM_LOAD("lx810l.ic3c", 0x0000, 0x8000, CRC(a66454e1) SHA1(8e6f2f98abcbd8af6e34b9ba746edf0d18aef843) ) |
| 336 | | ROM_END |
| 337 | | |
| 338 | | ROM_START( ap2000 ) |
| 339 | | ROM_REGION(0x8000, "maincpu", 0) |
| 340 | | ROM_LOAD("ap2k.ic3c", 0x0000, 0x8000, CRC(ee7294b7) SHA1(219ffa6ff661ce95d5772c9fc1967093718f04e9) ) |
| 341 | | ROM_END |
| 342 | | |
| 343 | | |
| 344 | | /*************************************************************************** |
| 345 | | GAME DRIVERS |
| 346 | | ***************************************************************************/ |
| 347 | | |
| 348 | | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 349 | | COMP( 1987, lx800, 0, 0, lx800, lx800, driver_device, 0, "Epson", "LX-800 Printer", GAME_NOT_WORKING ) |
| 350 | | COMP( 19??, lx810l,lx800, 0, lx800, lx800, driver_device, 0, "Epson", "LX-810L Printer", GAME_NOT_WORKING ) |
| 351 | | COMP( 19??, ap2000,lx800, 0, lx800, lx800, driver_device, 0, "Epson", "Action Printer 2000", GAME_NOT_WORKING ) |