trunk/src/mess/includes/tmc2000e.h
| r20634 | r20635 | |
| 6 | 6 | |
| 7 | 7 | #include "emu.h" |
| 8 | 8 | #include "cpu/cosmac/cosmac.h" |
| 9 | | #include "formats/basicdsk.h" |
| 10 | 9 | #include "imagedev/cassette.h" |
| 11 | | #include "imagedev/flopdrv.h" |
| 12 | | #include "imagedev/printer.h" |
| 13 | | #include "machine/rescap.h" |
| 14 | 10 | #include "machine/ram.h" |
| 11 | #include "machine/rescap.h" |
| 15 | 12 | #include "sound/cdp1864.h" |
| 16 | 13 | |
| 17 | 14 | #define SCREEN_TAG "screen" |
| r20634 | r20635 | |
| 24 | 21 | { |
| 25 | 22 | public: |
| 26 | 23 | tmc2000e_state(const machine_config &mconfig, device_type type, const char *tag) |
| 27 | | : driver_device(mconfig, type, tag) |
| 28 | | , m_maincpu(*this, CDP1802_TAG) |
| 29 | | , m_cti(*this, CDP1864_TAG) |
| 30 | | , m_cassette(*this, CASSETTE_TAG) |
| 31 | | , m_colorram(*this, "colorram") |
| 32 | | , m_io_in0(*this, "IN0") |
| 33 | | , m_io_in1(*this, "IN1") |
| 34 | | , m_io_in2(*this, "IN2") |
| 35 | | , m_io_in3(*this, "IN3") |
| 36 | | , m_io_in4(*this, "IN4") |
| 37 | | , m_io_in5(*this, "IN5") |
| 38 | | , m_io_in6(*this, "IN6") |
| 39 | | , m_io_in7(*this, "IN7") |
| 40 | | , m_io_run(*this, "RUN") |
| 24 | : driver_device(mconfig, type, tag), |
| 25 | m_maincpu(*this, CDP1802_TAG), |
| 26 | m_cti(*this, CDP1864_TAG), |
| 27 | m_cassette(*this, CASSETTE_TAG), |
| 28 | m_colorram(*this, "colorram"), |
| 29 | m_y0(*this, "Y0"), |
| 30 | m_y1(*this, "Y1"), |
| 31 | m_y2(*this, "Y2"), |
| 32 | m_y3(*this, "Y3"), |
| 33 | m_y4(*this, "Y4"), |
| 34 | m_y5(*this, "Y5"), |
| 35 | m_y6(*this, "Y6"), |
| 36 | m_y7(*this, "Y7"), |
| 37 | m_run(*this, "RUN") |
| 41 | 38 | { } |
| 42 | 39 | |
| 43 | 40 | required_device<cpu_device> m_maincpu; |
| 44 | 41 | required_device<cdp1864_device> m_cti; |
| 45 | 42 | required_device<cassette_image_device> m_cassette; |
| 43 | required_shared_ptr<UINT8> m_colorram; |
| 44 | required_ioport m_y0; |
| 45 | required_ioport m_y1; |
| 46 | required_ioport m_y2; |
| 47 | required_ioport m_y3; |
| 48 | required_ioport m_y4; |
| 49 | required_ioport m_y5; |
| 50 | required_ioport m_y6; |
| 51 | required_ioport m_y7; |
| 52 | required_ioport m_run; |
| 46 | 53 | |
| 47 | 54 | virtual void machine_start(); |
| 48 | 55 | virtual void machine_reset(); |
| r20634 | r20635 | |
| 69 | 76 | |
| 70 | 77 | /* video state */ |
| 71 | 78 | int m_cdp1864_efx; /* EFx */ |
| 72 | | required_shared_ptr<UINT8> m_colorram; /* color memory */ |
| 73 | 79 | UINT8 m_color; |
| 74 | 80 | |
| 75 | 81 | /* keyboard state */ |
| 82 | ioport_port* m_key_row[8]; |
| 76 | 83 | int m_keylatch; /* key latch */ |
| 77 | 84 | int m_reset; /* reset activated */ |
| 78 | | |
| 79 | | protected: |
| 80 | | required_ioport m_io_in0; |
| 81 | | required_ioport m_io_in1; |
| 82 | | required_ioport m_io_in2; |
| 83 | | required_ioport m_io_in3; |
| 84 | | required_ioport m_io_in4; |
| 85 | | required_ioport m_io_in5; |
| 86 | | required_ioport m_io_in6; |
| 87 | | required_ioport m_io_in7; |
| 88 | | required_ioport m_io_run; |
| 89 | 85 | }; |
| 90 | 86 | |
| 91 | 87 | #endif |
trunk/src/mess/drivers/huebler.c
| r20634 | r20635 | |
| 24 | 24 | |
| 25 | 25 | void amu880_state::scan_keyboard() |
| 26 | 26 | { |
| 27 | | ioport_port* ports[16] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7, |
| 28 | | m_y8, m_y9, m_y10, m_y11, m_y12, m_y13, m_y14, m_y15 }; |
| 27 | UINT8 data = m_key_row[m_key_a8 ? m_key_d6 : m_key_d7]->read(); |
| 29 | 28 | |
| 30 | | UINT8 data = ports[m_key_a8 ? m_key_d6 : m_key_d7]->read(); |
| 31 | | |
| 32 | 29 | int a8 = (data & 0x0f) == 0x0f; |
| 33 | 30 | |
| 34 | 31 | if (m_key_a8 && !a8) |
| r20634 | r20635 | |
| 210 | 207 | |
| 211 | 208 | /* Video */ |
| 212 | 209 | |
| 213 | | UINT32 amu880_state::screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 210 | UINT32 amu880_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 214 | 211 | { |
| 215 | 212 | int y, sx, x, line; |
| 216 | 213 | |
| r20634 | r20635 | |
| 230 | 227 | { |
| 231 | 228 | int color = ((line > 7) ? 0 : BIT(data, 7)) ^ BIT(videoram_data, 7); |
| 232 | 229 | |
| 233 | | bitmap.pix16(y, (sx * 6) + x) = color; |
| 230 | bitmap.pix32(y, (sx * 6) + x) = RGB_MONOCHROME_WHITE[color]; |
| 234 | 231 | |
| 235 | 232 | data <<= 1; |
| 236 | 233 | } |
| r20634 | r20635 | |
| 335 | 332 | |
| 336 | 333 | void amu880_state::machine_start() |
| 337 | 334 | { |
| 335 | // find keyboard rows |
| 336 | m_key_row[0] = m_y0; |
| 337 | m_key_row[1] = m_y1; |
| 338 | m_key_row[2] = m_y2; |
| 339 | m_key_row[3] = m_y3; |
| 340 | m_key_row[4] = m_y4; |
| 341 | m_key_row[5] = m_y5; |
| 342 | m_key_row[6] = m_y6; |
| 343 | m_key_row[7] = m_y7; |
| 344 | m_key_row[8] = m_y8; |
| 345 | m_key_row[9] = m_y9; |
| 346 | m_key_row[10] = m_y10; |
| 347 | m_key_row[11] = m_y11; |
| 348 | m_key_row[12] = m_y12; |
| 349 | m_key_row[13] = m_y13; |
| 350 | m_key_row[14] = m_y14; |
| 351 | m_key_row[15] = m_y15; |
| 352 | |
| 338 | 353 | /* register for state saving */ |
| 339 | 354 | save_item(NAME(m_key_d6)); |
| 340 | 355 | save_item(NAME(m_key_d7)); |
| r20634 | r20635 | |
| 388 | 403 | MCFG_SCREEN_RAW_PARAMS(9000000, 576, 0*6, 64*6, 320, 0*10, 24*10) |
| 389 | 404 | |
| 390 | 405 | MCFG_GFXDECODE(amu880) |
| 391 | | MCFG_PALETTE_LENGTH(2) |
| 392 | | MCFG_PALETTE_INIT(black_and_white) |
| 393 | 406 | |
| 394 | 407 | /* devices */ |
| 395 | 408 | MCFG_Z80CTC_ADD(Z80CTC_TAG, XTAL_10MHz/4, ctc_intf) |
trunk/src/mess/drivers/sg1000.c
| r20634 | r20635 | |
| 522 | 522 | |
| 523 | 523 | static TMS9928A_INTERFACE(sg1000_tms9918a_interface) |
| 524 | 524 | { |
| 525 | | "screen", |
| 525 | SCREEN_TAG, |
| 526 | 526 | 0x4000, |
| 527 | 527 | DEVCB_DRIVER_LINE_MEMBER(sg1000_state,sg1000_vdp_interrupt) |
| 528 | 528 | }; |
| r20634 | r20635 | |
| 546 | 546 | PA7 Keyboard input |
| 547 | 547 | */ |
| 548 | 548 | |
| 549 | | ioport_port *ports[8] = { m_pa0, m_pa1, m_pa2, m_pa3, m_pa4, m_pa5, m_pa6, m_pa7 }; |
| 550 | | |
| 551 | | return ports[m_keylatch]->read(); |
| 549 | return m_key_row[m_keylatch]->read(); |
| 552 | 550 | } |
| 553 | 551 | |
| 554 | 552 | READ8_MEMBER( sc3000_state::ppi_pb_r ) |
| r20634 | r20635 | |
| 566 | 564 | PB7 Cassette tape input |
| 567 | 565 | */ |
| 568 | 566 | |
| 569 | | ioport_port *ports[8] = { m_pb0, m_pb1, m_pb2, m_pb3, m_pb4, m_pb5, m_pb6, m_pb7 }; |
| 570 | | |
| 571 | 567 | /* keyboard */ |
| 572 | | UINT8 data = ports[m_keylatch]->read(); |
| 568 | UINT8 data = m_key_row[m_keylatch + 8]->read(); |
| 573 | 569 | |
| 574 | 570 | /* cartridge contact */ |
| 575 | 571 | data |= 0x10; |
| r20634 | r20635 | |
| 1022 | 1018 | /* toggle light gun crosshair */ |
| 1023 | 1019 | machine().scheduler().timer_set(attotime::zero, timer_expired_delegate(FUNC(sg1000_state::lightgun_tick),this)); |
| 1024 | 1020 | |
| 1021 | // find keyboard rows |
| 1022 | m_key_row[0] = m_pa0; |
| 1023 | m_key_row[1] = m_pa1; |
| 1024 | m_key_row[2] = m_pa2; |
| 1025 | m_key_row[3] = m_pa3; |
| 1026 | m_key_row[4] = m_pa4; |
| 1027 | m_key_row[5] = m_pa5; |
| 1028 | m_key_row[6] = m_pa6; |
| 1029 | m_key_row[7] = m_pa7; |
| 1030 | m_key_row[8] = m_pb0; |
| 1031 | m_key_row[9] = m_pb1; |
| 1032 | m_key_row[10] = m_pb2; |
| 1033 | m_key_row[11] = m_pb3; |
| 1034 | m_key_row[12] = m_pb4; |
| 1035 | m_key_row[13] = m_pb5; |
| 1036 | m_key_row[14] = m_pb6; |
| 1037 | m_key_row[15] = m_pb7; |
| 1038 | |
| 1025 | 1039 | /* register for state saving */ |
| 1026 | 1040 | save_item(NAME(m_tvdraw_data)); |
| 1027 | 1041 | save_item(NAME(m_keylatch)); |
| r20634 | r20635 | |
| 1069 | 1083 | |
| 1070 | 1084 | /* video hardware */ |
| 1071 | 1085 | MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface ) |
| 1072 | | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 1086 | MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) |
| 1073 | 1087 | MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update ) |
| 1074 | 1088 | |
| 1075 | 1089 | /* sound hardware */ |
| r20634 | r20635 | |
| 1123 | 1137 | |
| 1124 | 1138 | /* video hardware */ |
| 1125 | 1139 | MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface ) |
| 1126 | | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 1140 | MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) |
| 1127 | 1141 | MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update ) |
| 1128 | 1142 | |
| 1129 | 1143 | /* sound hardware */ |
| r20634 | r20635 | |
| 1164 | 1178 | |
| 1165 | 1179 | /* video hardware */ |
| 1166 | 1180 | MCFG_TMS9928A_ADD( TMS9918A_TAG, TMS9918A, sg1000_tms9918a_interface ) |
| 1167 | | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 1181 | MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) |
| 1168 | 1182 | MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update ) |
| 1169 | 1183 | |
| 1170 | 1184 | /* sound hardware */ |
trunk/src/mess/drivers/tmc2000e.c
| r20634 | r20635 | |
| 95 | 95 | /* Input Ports */ |
| 96 | 96 | |
| 97 | 97 | static INPUT_PORTS_START( tmc2000e ) |
| 98 | PORT_START("Y0") |
| 99 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 100 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 101 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 102 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 103 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 104 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 105 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 106 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 107 | |
| 108 | PORT_START("Y1") |
| 109 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 110 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 111 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 112 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 113 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 114 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 115 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 116 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 117 | |
| 118 | PORT_START("Y2") |
| 119 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 120 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 121 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 122 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 123 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 124 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 125 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 126 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 127 | |
| 128 | PORT_START("Y3") |
| 129 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 130 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 131 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 132 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 133 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 134 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 135 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 136 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 137 | |
| 138 | PORT_START("Y4") |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 140 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 141 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 142 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 143 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 144 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 145 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 146 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 147 | |
| 148 | PORT_START("Y5") |
| 149 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 150 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 151 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 152 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 153 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 154 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 155 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 156 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 157 | |
| 158 | PORT_START("Y6") |
| 159 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 160 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 161 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 162 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 163 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 164 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 165 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 166 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 167 | |
| 168 | PORT_START("Y7") |
| 169 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 170 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 171 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 172 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 173 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 174 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 175 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 176 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 177 | |
| 98 | 178 | PORT_START("DSW0") // System Configuration DIPs |
| 99 | 179 | PORT_DIPNAME( 0x80, 0x00, "Keyboard Type" ) |
| 100 | 180 | PORT_DIPSETTING( 0x00, "ASCII" ) |
| r20634 | r20635 | |
| 152 | 232 | |
| 153 | 233 | READ_LINE_MEMBER( tmc2000e_state::clear_r ) |
| 154 | 234 | { |
| 155 | | return BIT(m_io_run->read(), 0); |
| 235 | return BIT(m_run->read(), 0); |
| 156 | 236 | } |
| 157 | 237 | |
| 158 | 238 | READ_LINE_MEMBER( tmc2000e_state::ef2_r ) |
| 159 | 239 | { |
| 160 | | return (m_cassette)->input() < 0; |
| 240 | return m_cassette->input() < 0; |
| 161 | 241 | } |
| 162 | 242 | |
| 163 | 243 | READ_LINE_MEMBER( tmc2000e_state::ef3_r ) |
| 164 | 244 | { |
| 165 | | ioport_port *keynames[] = { m_io_in0, m_io_in1, m_io_in2, m_io_in3, m_io_in4, m_io_in5, m_io_in6, m_io_in7 }; |
| 166 | | UINT8 data = ~(keynames[m_keylatch / 8])->read(); |
| 245 | UINT8 data = ~(m_key_row[m_keylatch / 8])->read(); |
| 167 | 246 | |
| 168 | 247 | return BIT(data, m_keylatch % 8); |
| 169 | 248 | } |
| r20634 | r20635 | |
| 210 | 289 | |
| 211 | 290 | void tmc2000e_state::machine_start() |
| 212 | 291 | { |
| 292 | // find keyboard rows |
| 293 | m_key_row[0] = m_y0; |
| 294 | m_key_row[1] = m_y1; |
| 295 | m_key_row[2] = m_y2; |
| 296 | m_key_row[3] = m_y3; |
| 297 | m_key_row[4] = m_y4; |
| 298 | m_key_row[5] = m_y5; |
| 299 | m_key_row[6] = m_y6; |
| 300 | m_key_row[7] = m_y7; |
| 301 | |
| 213 | 302 | /* register for state saving */ |
| 214 | | save_pointer(NAME(m_colorram.target()), TMC2000E_COLORRAM_SIZE); |
| 215 | 303 | save_item(NAME(m_cdp1864_efx)); |
| 216 | 304 | save_item(NAME(m_keylatch)); |
| 217 | 305 | } |
| r20634 | r20635 | |
| 234 | 322 | NULL |
| 235 | 323 | }; |
| 236 | 324 | |
| 237 | | static const floppy_interface tmc2000e_floppy_interface = |
| 238 | | { |
| 239 | | DEVCB_NULL, |
| 240 | | DEVCB_NULL, |
| 241 | | DEVCB_NULL, |
| 242 | | DEVCB_NULL, |
| 243 | | DEVCB_NULL, |
| 244 | | FLOPPY_STANDARD_5_25_DSDD, |
| 245 | | LEGACY_FLOPPY_OPTIONS_NAME(default), |
| 246 | | NULL, |
| 247 | | NULL |
| 248 | | }; |
| 249 | | |
| 250 | 325 | static MACHINE_CONFIG_START( tmc2000e, tmc2000e_state ) |
| 251 | 326 | // basic system hardware |
| 252 | 327 | MCFG_CPU_ADD(CDP1802_TAG, COSMAC, XTAL_1_75MHz) |
| r20634 | r20635 | |
| 264 | 339 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 265 | 340 | |
| 266 | 341 | /* devices */ |
| 267 | | MCFG_PRINTER_ADD("printer") |
| 268 | 342 | MCFG_CASSETTE_ADD(CASSETTE_TAG, tmc2000_cassette_interface) |
| 269 | 343 | |
| 270 | | MCFG_LEGACY_FLOPPY_2_DRIVES_ADD(tmc2000e_floppy_interface) |
| 271 | | |
| 272 | 344 | /* internal ram */ |
| 273 | 345 | MCFG_RAM_ADD(RAM_TAG) |
| 274 | 346 | MCFG_RAM_DEFAULT_SIZE("8K") |
trunk/src/mess/drivers/tmc1800.c
| r20634 | r20635 | |
| 298 | 298 | /* Input Ports */ |
| 299 | 299 | |
| 300 | 300 | static INPUT_PORTS_START( tmc1800 ) |
| 301 | | PORT_START("IN0") |
| 301 | PORT_START("Y0") |
| 302 | 302 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0') |
| 303 | 303 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') |
| 304 | 304 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2') |
| r20634 | r20635 | |
| 308 | 308 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') |
| 309 | 309 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') |
| 310 | 310 | |
| 311 | | PORT_START("IN1") |
| 311 | PORT_START("Y1") |
| 312 | 312 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8') |
| 313 | 313 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9') |
| 314 | 314 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| r20634 | r20635 | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | static INPUT_PORTS_START( tmc2000 ) |
| 334 | | PORT_START("IN0") |
| 334 | PORT_START("Y0") |
| 335 | 335 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR('0') |
| 336 | 336 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_1) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') |
| 337 | 337 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_2) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR('2') |
| r20634 | r20635 | |
| 341 | 341 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_6) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') |
| 342 | 342 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_7) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') |
| 343 | 343 | |
| 344 | | PORT_START("IN1") |
| 344 | PORT_START("Y1") |
| 345 | 345 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_8) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR('8') |
| 346 | 346 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR('9') |
| 347 | 347 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| r20634 | r20635 | |
| 354 | 354 | PORT_START("RUN") |
| 355 | 355 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYPAD ) PORT_NAME("Run/Reset") PORT_CODE(KEYCODE_R) PORT_TOGGLE PORT_CHANGED_MEMBER(DEVICE_SELF, tmc2000_state, run_pressed, 0) |
| 356 | 356 | |
| 357 | | PORT_START("IN2") |
| 357 | PORT_START("Y2") |
| 358 | 358 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 359 | 359 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 360 | 360 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| r20634 | r20635 | |
| 364 | 364 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 365 | 365 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 366 | 366 | |
| 367 | | PORT_START("IN3") |
| 367 | PORT_START("Y3") |
| 368 | 368 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 369 | 369 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 370 | 370 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| r20634 | r20635 | |
| 374 | 374 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 375 | 375 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 376 | 376 | |
| 377 | | PORT_START("IN4") |
| 377 | PORT_START("Y4") |
| 378 | 378 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 379 | 379 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 380 | 380 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| r20634 | r20635 | |
| 384 | 384 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 385 | 385 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 386 | 386 | |
| 387 | | PORT_START("IN5") |
| 387 | PORT_START("Y5") |
| 388 | 388 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 389 | 389 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 390 | 390 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| r20634 | r20635 | |
| 394 | 394 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 395 | 395 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 396 | 396 | |
| 397 | | PORT_START("IN6") |
| 397 | PORT_START("Y6") |
| 398 | 398 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 399 | 399 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 400 | 400 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| r20634 | r20635 | |
| 404 | 404 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 405 | 405 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 406 | 406 | |
| 407 | | PORT_START("IN7") |
| 407 | PORT_START("Y7") |
| 408 | 408 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 409 | 409 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| 410 | 410 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYBOARD ) |
| r20634 | r20635 | |
| 559 | 559 | |
| 560 | 560 | READ_LINE_MEMBER( tmc2000_state::ef3_r ) |
| 561 | 561 | { |
| 562 | | ioport_port *ports[] = { m_in0, m_in1, m_in2, m_in3, m_in4, m_in5, m_in6, m_in7 }; |
| 563 | | UINT8 data = ~ports[m_keylatch / 8]->read(); |
| 562 | UINT8 data = ~m_key_row[m_keylatch / 8]->read(); |
| 564 | 563 | |
| 565 | 564 | return BIT(data, m_keylatch % 8); |
| 566 | 565 | } |
| r20634 | r20635 | |
| 695 | 694 | { |
| 696 | 695 | m_colorram[addr] = machine().rand() & 0xff; |
| 697 | 696 | } |
| 697 | |
| 698 | // find keyboard rows |
| 699 | m_key_row[0] = m_y0; |
| 700 | m_key_row[1] = m_y1; |
| 701 | m_key_row[2] = m_y2; |
| 702 | m_key_row[3] = m_y3; |
| 703 | m_key_row[4] = m_y4; |
| 704 | m_key_row[5] = m_y5; |
| 705 | m_key_row[6] = m_y6; |
| 706 | m_key_row[7] = m_y7; |
| 698 | 707 | |
| 699 | 708 | // state saving |
| 700 | 709 | save_item(NAME(m_keylatch)); |