src/mess/machine/comx35.c
| r2694 | r2695 | |
| 188 | 188 | }
|
| 189 | 189 | }
|
| 190 | 190 | |
| 191 | | /* COMX PL-80 Plotter */
|
| 192 | | |
| 193 | | WRITE8_HANDLER( pl80_port_a_w )
|
| 194 | | {
|
| 195 | | /*
|
| 196 | | |
| 197 | | bit description
|
| 198 | | |
| 199 | | 0 Y motor phase A
|
| 200 | | 1 Y motor phase B
|
| 201 | | 2 Y motor phase C
|
| 202 | | 3 Y motor phase D
|
| 203 | | 4 ROM A12
|
| 204 | | 5 ROM CE /PT5 CK
|
| 205 | | 6 PT4 OE
|
| 206 | | 7 SW & PE ENABLE
|
| 207 | | |
| 208 | | */
|
| 209 | | |
| 210 | | comx35_state *state = machine->driver_data;
|
| 211 | | |
| 212 | | state->y_motor_phase = data & 0x0f;
|
| 213 | | state->font_addr = (BIT(data, 4) << 12) | (state->font_addr & 0xfff);
|
| 214 | | |
| 215 | | state->plotter_data = 0xff;
|
| 216 | | |
| 217 | | if (BIT(data, 5))
|
| 218 | | {
|
| 219 | | // write motor phase data
|
| 220 | | }
|
| 221 | | else
|
| 222 | | {
|
| 223 | | // read data from font ROM
|
| 224 | | int font_rom = (input_port_read(machine, "PL80FONT") & 0x03) * 0x2000;
|
| 225 | | |
| 226 | | state->plotter_data = memory_region(REGION_GFX2)[font_rom | state->font_addr];
|
| 227 | | }
|
| 228 | |
|
| 229 | | if (!BIT(data, 6))
|
| 230 | | {
|
| 231 | | // read data from Centronics bus
|
| 232 | | state->plotter_data = state->centronics_data;
|
| 233 | | }
|
| 234 | | |
| 235 | | if (BIT(data, 7))
|
| 236 | | {
|
| 237 | | // read switches
|
| 238 | | state->plotter_data = input_port_read(machine, "PL80");
|
| 239 | | }
|
| 240 | | }
|
| 241 | | |
| 242 | | WRITE8_HANDLER( pl80_port_b_w )
|
| 243 | | {
|
| 244 | | /*
|
| 245 | | |
| 246 | | bit description
|
| 247 | | |
| 248 | | 0 Z motor phase A
|
| 249 | | 1 Z motor phase B
|
| 250 | | 2 Z motor phase C
|
| 251 | | 3 Z motor phase D
|
| 252 | | 4 ROM A8
|
| 253 | | 5 ROM A9
|
| 254 | | 6 ROM A10
|
| 255 | | 7 ROM A11
|
| 256 | | |
| 257 | | */
|
| 258 | | |
| 259 | | comx35_state *state = machine->driver_data;
|
| 260 | | |
| 261 | | state->z_motor_phase = data & 0x0f;
|
| 262 | | |
| 263 | | state->font_addr = (state->font_addr & 0x10ff) | (data << 4);
|
| 264 | | }
|
| 265 | | |
| 266 | | WRITE8_HANDLER( pl80_port_c_w )
|
| 267 | | {
|
| 268 | | /*
|
| 269 | | |
| 270 | | bit description
|
| 271 | | |
| 272 | | 0 ROM A0 /X motor phase A
|
| 273 | | 1 ROM A1 /X motor phase B
|
| 274 | | 2 ROM A2 /X motor phase C
|
| 275 | | 3 ROM A3 /X motor phase D
|
| 276 | | 4 ROM A4 /ACK
|
| 277 | | 5 ROM A5 /On-line LED
|
| 278 | | 6 ROM A6
|
| 279 | | 7 ROM A7
|
| 280 | | |
| 281 | | */
|
| 282 | | |
| 283 | | comx35_state *state = machine->driver_data;
|
| 284 | | |
| 285 | | state->font_addr = (state->font_addr & 0x1f00) | data;
|
| 286 | | |
| 287 | | state->x_motor_phase = data & 0x0f;
|
| 288 | | |
| 289 | | state->plotter_ack = BIT(data, 4);
|
| 290 | | state->plotter_online = BIT(data, 5);
|
| 291 | | }
|
| 292 | | |
| 293 | | READ8_HANDLER( pl80_port_d_r )
|
| 294 | | {
|
| 295 | | /*
|
| 296 | | |
| 297 | | bit description
|
| 298 | | |
| 299 | | 0 D0 /ROM D0 /DOWN SW
|
| 300 | | 1 D1 /ROM D1 /PEN-SEL SW
|
| 301 | | 2 D2 /ROM D2 /UP SW
|
| 302 | | 3 D3 /ROM D3 /CRSW
|
| 303 | | 4 D4 /ROM D4 /ON LINE SW
|
| 304 | | 5 D5 /ROM D5 /PE Sensor
|
| 305 | | 6 D6 /ROM D6 /RIGHT SW
|
| 306 | | 7 D7 /ROM D7 /LEFT SW
|
| 307 | | |
| 308 | | */
|
| 309 | | |
| 310 | | comx35_state *state = machine->driver_data;
|
| 311 | | |
| 312 | | return state->plotter_data;
|
| 313 | | }
|
| 314 | | |
| 315 | 191 | /* Printer */
|
| 316 | 192 | |
| 317 | 193 | static UINT8 printer_r(running_machine *machine)
|
src/mess/drivers/comxpl80.c
| r0 | r2695 | |
| 1 | #include "driver.h"
|
| 2 | |
| 3 | typedef struct _comxpl80_state comxpl80_state;
|
| 4 | struct _comxpl80_state
|
| 5 | {
|
| 6 | /* printer state */
|
| 7 | UINT8 centronics_data; /* centronics data */
|
| 8 | |
| 9 | /* PL-80 plotter state */
|
| 10 | UINT16 font_addr; /* font ROM pack address latch */
|
| 11 | UINT8 x_motor_phase; /* X motor phase */
|
| 12 | UINT8 y_motor_phase; /* Y motor phase */
|
| 13 | UINT8 z_motor_phase; /* Z motor phase */
|
| 14 | UINT8 plotter_data; /* plotter data bus */
|
| 15 | int plotter_ack; /* plotter acknowledge */
|
| 16 | int plotter_online; /* online LED */
|
| 17 | };
|
| 18 | |
| 19 | /* Read/Write Handlers */
|
| 20 | |
| 21 | WRITE8_HANDLER( pl80_port_a_w )
|
| 22 | {
|
| 23 | /*
|
| 24 | |
| 25 | bit description
|
| 26 | |
| 27 | 0 Y motor phase A
|
| 28 | 1 Y motor phase B
|
| 29 | 2 Y motor phase C
|
| 30 | 3 Y motor phase D
|
| 31 | 4 ROM A12
|
| 32 | 5 ROM CE /PT5 CK
|
| 33 | 6 PT4 OE
|
| 34 | 7 SW & PE ENABLE
|
| 35 | |
| 36 | */
|
| 37 | |
| 38 | comxpl80_state *state = machine->driver_data;
|
| 39 | |
| 40 | state->y_motor_phase = data & 0x0f;
|
| 41 | state->font_addr = (BIT(data, 4) << 12) | (state->font_addr & 0xfff);
|
| 42 | |
| 43 | state->plotter_data = 0xff;
|
| 44 | |
| 45 | if (BIT(data, 5))
|
| 46 | {
|
| 47 | // write motor phase data
|
| 48 | }
|
| 49 | else
|
| 50 | {
|
| 51 | // read data from font ROM
|
| 52 | int font_rom = (input_port_read(machine, "FONT") & 0x03) * 0x2000;
|
| 53 | |
| 54 | state->plotter_data = memory_region(REGION_GFX2)[font_rom | state->font_addr];
|
| 55 | }
|
| 56 |
|
| 57 | if (!BIT(data, 6))
|
| 58 | {
|
| 59 | // read data from Centronics bus
|
| 60 | state->plotter_data = state->centronics_data;
|
| 61 | }
|
| 62 | |
| 63 | if (BIT(data, 7))
|
| 64 | {
|
| 65 | // read switches
|
| 66 | state->plotter_data = input_port_read(machine, "SW");
|
| 67 | }
|
| 68 | }
|
| 69 | |
| 70 | WRITE8_HANDLER( pl80_port_b_w )
|
| 71 | {
|
| 72 | /*
|
| 73 | |
| 74 | bit description
|
| 75 | |
| 76 | 0 Z motor phase A
|
| 77 | 1 Z motor phase B
|
| 78 | 2 Z motor phase C
|
| 79 | 3 Z motor phase D
|
| 80 | 4 ROM A8
|
| 81 | 5 ROM A9
|
| 82 | 6 ROM A10
|
| 83 | 7 ROM A11
|
| 84 | |
| 85 | */
|
| 86 | |
| 87 | comxpl80_state *state = machine->driver_data;
|
| 88 | |
| 89 | state->z_motor_phase = data & 0x0f;
|
| 90 | |
| 91 | state->font_addr = (state->font_addr & 0x10ff) | (data << 4);
|
| 92 | }
|
| 93 | |
| 94 | WRITE8_HANDLER( pl80_port_c_w )
|
| 95 | {
|
| 96 | /*
|
| 97 | |
| 98 | bit description
|
| 99 | |
| 100 | 0 ROM A0 /X motor phase A
|
| 101 | 1 ROM A1 /X motor phase B
|
| 102 | 2 ROM A2 /X motor phase C
|
| 103 | 3 ROM A3 /X motor phase D
|
| 104 | 4 ROM A4 /ACK
|
| 105 | 5 ROM A5 /On-line LED
|
| 106 | 6 ROM A6
|
| 107 | 7 ROM A7
|
| 108 | |
| 109 | */
|
| 110 | |
| 111 | comxpl80_state *state = machine->driver_data;
|
| 112 | |
| 113 | state->font_addr = (state->font_addr & 0x1f00) | data;
|
| 114 | |
| 115 | state->x_motor_phase = data & 0x0f;
|
| 116 | |
| 117 | state->plotter_ack = BIT(data, 4);
|
| 118 | state->plotter_online = BIT(data, 5);
|
| 119 | }
|
| 120 | |
| 121 | READ8_HANDLER( pl80_port_d_r )
|
| 122 | {
|
| 123 | /*
|
| 124 | |
| 125 | bit description
|
| 126 | |
| 127 | 0 D0 /ROM D0 /DOWN SW
|
| 128 | 1 D1 /ROM D1 /PEN-SEL SW
|
| 129 | 2 D2 /ROM D2 /UP SW
|
| 130 | 3 D3 /ROM D3 /CRSW
|
| 131 | 4 D4 /ROM D4 /ON LINE SW
|
| 132 | 5 D5 /ROM D5 /PE Sensor
|
| 133 | 6 D6 /ROM D6 /RIGHT SW
|
| 134 | 7 D7 /ROM D7 /LEFT SW
|
| 135 | |
| 136 | */
|
| 137 | |
| 138 | comxpl80_state *state = machine->driver_data;
|
| 139 | |
| 140 | return state->plotter_data;
|
| 141 | }
|
| 142 | |
| 143 | /* Memory Maps */
|
| 144 | |
| 145 | static ADDRESS_MAP_START( pl80_map, ADDRESS_SPACE_PROGRAM, 8 )
|
| 146 | ADDRESS_MAP_UNMAP_HIGH
|
| 147 | /* AM_RANGE(0x000, 0x000) AM_READWRITE(cx005_port_a_r, cx005_port_a_w)
|
| 148 | AM_RANGE(0x001, 0x001) AM_READWRITE(cx005_port_b_r, cx005_port_b_w)
|
| 149 | AM_RANGE(0x002, 0x002) AM_READWRITE(cx005_port_c_r, cx005_port_c_w)
|
| 150 | AM_RANGE(0x003, 0x003) AM_READ(cx005_port_d_digital_r)
|
| 151 | AM_RANGE(0x004, 0x004) AM_WRITE(cx005_port_a_ddr_w)
|
| 152 | AM_RANGE(0x005, 0x005) AM_WRITE(cx005_port_b_ddr_w)
|
| 153 | AM_RANGE(0x006, 0x006) AM_WRITE(cx005_port_c_ddr_w)
|
| 154 | AM_RANGE(0x007, 0x007) AM_READ(cx005_port_d_analog_r)
|
| 155 | AM_RANGE(0x008, 0x008) AM_READWRITE(cx005_timer_data_r, cx005_timer_data_w)
|
| 156 | AM_RANGE(0x008, 0x008) AM_READWRITE(cx005_timer_ctrl_r, cx005_timer_ctrl_w)*/
|
| 157 | AM_RANGE(0x00a, 0x01f) AM_NOP // Not Used
|
| 158 | AM_RANGE(0x020, 0x07f) AM_RAM // Internal RAM
|
| 159 | AM_RANGE(0x080, 0xf7f) AM_ROM // Internal ROM
|
| 160 | AM_RANGE(0xf80, 0xff7) AM_ROM // Self-Test
|
| 161 | AM_RANGE(0xff8, 0xfff) AM_ROM // Interrupt Vectors
|
| 162 | ADDRESS_MAP_END
|
| 163 | |
| 164 | static ADDRESS_MAP_START( pl80_io_map, ADDRESS_SPACE_IO, 8 )
|
| 165 | ADDRESS_MAP_UNMAP_HIGH
|
| 166 | AM_RANGE(0x00, 0x00) AM_WRITE(pl80_port_a_w)
|
| 167 | AM_RANGE(0x01, 0x01) AM_WRITE(pl80_port_b_w)
|
| 168 | AM_RANGE(0x02, 0x02) AM_WRITE(pl80_port_c_w)
|
| 169 | AM_RANGE(0x03, 0x03) AM_READ(pl80_port_d_r)
|
| 170 | ADDRESS_MAP_END
|
| 171 | |
| 172 | /* Input Ports */
|
| 173 | |
| 174 | static INPUT_PORTS_START( comxpl80 )
|
| 175 | PORT_START_TAG("SW")
|
| 176 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("DOWN")
|
| 177 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("PEN-SEL")
|
| 178 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("UP")
|
| 179 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("CR")
|
| 180 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("ON LINE")
|
| 181 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("PE")
|
| 182 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("RIGHT")
|
| 183 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("LEFT")
|
| 184 | |
| 185 | PORT_START_TAG("FONT")
|
| 186 | PORT_CONFNAME( 0x03, 0x00, "COMX PL-80 Font Pack")
|
| 187 | PORT_CONFSETTING( 0x00, DEF_STR( None ) )
|
| 188 | PORT_CONFSETTING( 0x01, "Italic, Emphasized and Outline" )
|
| 189 | PORT_CONFSETTING( 0x02, "Tiny" )
|
| 190 | INPUT_PORTS_END
|
| 191 | |
| 192 | /* Machine Driver */
|
| 193 | |
| 194 | static MACHINE_DRIVER_START( comxpl80 )
|
| 195 | MDRV_DRIVER_DATA(comxpl80_state)
|
| 196 | |
| 197 | // basic system hardware
|
| 198 | |
| 199 | MDRV_CPU_ADD(M6805, 4000000) // CX005: some kind of MC6805/MC68HC05 clone
|
| 200 | MDRV_CPU_PROGRAM_MAP(pl80_map, 0)
|
| 201 | MDRV_CPU_IO_MAP(pl80_io_map, 0)
|
| 202 | MACHINE_DRIVER_END
|
| 203 | |
| 204 | /* ROMs */
|
| 205 | |
| 206 | ROM_START( comxpl80 )
|
| 207 | ROM_REGION( 0x1000, REGION_CPU1, 0 )
|
| 208 | ROM_LOAD( "pl80.pt6", 0x0080, 0x0e00, CRC(ae059e5b) SHA1(f25812606b0082d32eb603d0a702a2187089d332) )
|
| 209 | |
| 210 | ROM_REGION( 0x6000, REGION_GFX1, ROMREGION_ERASEFF ) // Plotter fonts
|
| 211 | ROM_LOAD( "it.em.ou.bin", 0x2000, 0x2000, CRC(1b4a3198) SHA1(138ff6666a31c2d18cd63e609dd94d9cd1529931) )
|
| 212 | ROM_LOAD( "tiny.bin", 0x4000, 0x0400, CRC(940ec1ed) SHA1(ad83a3b57e2f0fbaa1e40644cd999b3f239635e8) )
|
| 213 | ROM_END
|
| 214 | |
| 215 | /* System Drivers */
|
| 216 | |
| 217 | // YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS
|
| 218 | COMP( 1987, comxpl80, 0, 0, comxpl80, comxpl80, 0, 0, "Comx World Operations Ltd", "COMX PL-80", GAME_NOT_WORKING | GAME_NO_SOUND )
|
src/mess/drivers/comx35.c
| r2694 | r2695 | |
| 51 | 51 | AM_RANGE(0x06, 0x06) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out6_w)
|
| 52 | 52 | AM_RANGE(0x07, 0x07) AM_DEVWRITE(CDP1869_VIDEO, CDP1869_TAG, cdp1869_out7_w)
|
| 53 | 53 | ADDRESS_MAP_END
|
| 54 | | /*
|
| 55 | | static ADDRESS_MAP_START( pl80_map, ADDRESS_SPACE_PROGRAM, 8 )
|
| 56 | | ADDRESS_MAP_UNMAP_HIGH
|
| 57 | | AM_RANGE(0x080, 0xf7f) AM_ROM
|
| 58 | | ADDRESS_MAP_END
|
| 59 | 54 | |
| 60 | | static ADDRESS_MAP_START( pl80_io_map, ADDRESS_SPACE_IO, 8 )
|
| 61 | | ADDRESS_MAP_END
|
| 62 | | */
|
| 63 | 55 | /* Input Ports */
|
| 64 | 56 | |
| 65 | 57 | #define COMX35_DEVICES \
|
| r2694 | r2695 | |
| 206 | 198 | PORT_CONFSETTING( 0x01, "Serial" )
|
| 207 | 199 | PORT_CONFSETTING( 0x02, "Thermal" )
|
| 208 | 200 | PORT_CONFSETTING( 0x03, "COMX PL-80 Plotter" )
|
| 209 | | |
| 210 | | PORT_START_TAG("PL80")
|
| 211 | | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("DOWN")
|
| 212 | | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("PEN-SEL")
|
| 213 | | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("UP")
|
| 214 | | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("CR")
|
| 215 | | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("ON LINE")
|
| 216 | | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("PE")
|
| 217 | | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("RIGHT")
|
| 218 | | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_NAME("LEFT")
|
| 219 | | |
| 220 | | PORT_START_TAG("PL80FONT")
|
| 221 | | PORT_CONFNAME( 0x03, 0x00, "COMX PL-80 Font Pack")
|
| 222 | | PORT_CONFSETTING( 0x00, DEF_STR( None ) )
|
| 223 | | PORT_CONFSETTING( 0x01, "Italic, Emphasized and Outline" )
|
| 224 | | PORT_CONFSETTING( 0x02, "Tiny" )
|
| 225 | 201 | INPUT_PORTS_END
|
| 226 | 202 | |
| 227 | 203 | /* CDP1802 Interface */
|
| r2694 | r2695 | |
| 378 | 354 | |
| 379 | 355 | MDRV_MACHINE_START(comx35p)
|
| 380 | 356 | MDRV_MACHINE_RESET(comx35)
|
| 381 | | /*
|
| 382 | | // COMX PL-80 plotter
|
| 383 | 357 | |
| 384 | | MDRV_CPU_ADD(CX005, 4000000) // some kind of MC6805/MC68HC05 clone
|
| 385 | | MDRV_CPU_PROGRAM_MAP(pl80_map, 0)
|
| 386 | | MDRV_CPU_IO_MAP(pl80_io_map, 0)
|
| 387 | | */
|
| 388 | 358 | // keyboard encoder
|
| 389 | 359 | |
| 390 | 360 | MDRV_DEVICE_ADD(CDP1871_TAG, CDP1871)
|
| r2694 | r2695 | |
| 422 | 392 | |
| 423 | 393 | MDRV_MACHINE_START(comx35n)
|
| 424 | 394 | MDRV_MACHINE_RESET(comx35)
|
| 425 | | /*
|
| 426 | | // COMX PL-80 plotter
|
| 427 | 395 | |
| 428 | | MDRV_CPU_ADD(CX005, 4000000) // some kind of MC6805/MC68HC05 clone
|
| 429 | | MDRV_CPU_PROGRAM_MAP(pl80_map, 0)
|
| 430 | | MDRV_CPU_IO_MAP(pl80_io_map, 0)
|
| 431 | | */
|
| 432 | 396 | // keyboard encoder
|
| 433 | 397 | |
| 434 | 398 | MDRV_DEVICE_ADD(CDP1871_TAG, CDP1871)
|
| r2694 | r2695 | |
| 485 | 449 | |
| 486 | 450 | ROM_REGION( 0x10000, REGION_GFX1, 0 ) // MC6845 font
|
| 487 | 451 | ROM_LOAD( "mc6845.font.u", 0x0000, 0x0800, NO_DUMP )
|
| 488 | | |
| 489 | | ROM_REGION( 0x1000, REGION_CPU2, 0 ) // COMX PL-80 CPU (CX005)
|
| 490 | | ROM_LOAD( "pl80.pt6", 0x0080, 0x0e00, CRC(ae059e5b) SHA1(f25812606b0082d32eb603d0a702a2187089d332) )
|
| 491 | | |
| 492 | | ROM_REGION( 0x6000, REGION_GFX2, ROMREGION_ERASEFF ) // Plotter fonts
|
| 493 | | ROM_LOAD( "pl80.it.em.ou.bin", 0x2000, 0x2000, CRC(1b4a3198) SHA1(138ff6666a31c2d18cd63e609dd94d9cd1529931) )
|
| 494 | | ROM_LOAD( "pl80.tiny.bin", 0x4000, 0x0400, CRC(940ec1ed) SHA1(ad83a3b57e2f0fbaa1e40644cd999b3f239635e8) )
|
| 495 | 452 | ROM_END
|
| 496 | 453 | |
| 497 | 454 | #define rom_comx35n rom_comx35p
|