trunk/src/mess/machine/c64_4tba.c
| r20540 | r20541 | |
| 65 | 65 | |
| 66 | 66 | c64_4tba_device::c64_4tba_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | 67 | device_t(mconfig, C64_4TBA, "C64 Tie Break Adapter", tag, owner, clock), |
| 68 | | device_c64_user_port_interface(mconfig, *this) |
| 68 | device_c64_user_port_interface(mconfig, *this), |
| 69 | m_pb(*this, "PB"), |
| 70 | m_pa2(*this, "PA2") |
| 69 | 71 | { |
| 70 | 72 | } |
| 71 | 73 | |
| r20540 | r20541 | |
| 85 | 87 | |
| 86 | 88 | UINT8 c64_4tba_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | 89 | { |
| 88 | | return ioport("PB")->read(); |
| 90 | return m_pb->read(); |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | |
| r20540 | r20541 | |
| 95 | 97 | |
| 96 | 98 | int c64_4tba_device::c64_pa2_r() |
| 97 | 99 | { |
| 98 | | return BIT(ioport("PA2")->read(), 0); |
| 100 | return BIT(m_pa2->read(), 0); |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | |
trunk/src/mess/machine/c64_sfx_sound_expander.c
| r20540 | r20541 | |
| 216 | 216 | device_t(mconfig, C64_SFX_SOUND_EXPANDER, "C64 SFX Sound Expander cartridge", tag, owner, clock), |
| 217 | 217 | device_c64_expansion_card_interface(mconfig, *this), |
| 218 | 218 | m_opl(*this, YM3526_TAG), |
| 219 | | m_exp(*this, C64_EXPANSION_SLOT_TAG) |
| 219 | m_exp(*this, C64_EXPANSION_SLOT_TAG), |
| 220 | m_kb0(*this, "KB0"), |
| 221 | m_kb1(*this, "KB1"), |
| 222 | m_kb2(*this, "KB2"), |
| 223 | m_kb3(*this, "KB3"), |
| 224 | m_kb4(*this, "KB4"), |
| 225 | m_kb5(*this, "KB5"), |
| 226 | m_kb6(*this, "KB6"), |
| 227 | m_kb7(*this, "KB7") |
| 220 | 228 | { |
| 221 | 229 | } |
| 222 | 230 | |
| r20540 | r20541 | |
| 253 | 261 | { |
| 254 | 262 | switch (offset & 0x07) |
| 255 | 263 | { |
| 256 | | case 0: data = ioport("KB0")->read(); break; |
| 257 | | case 1: data = ioport("KB1")->read(); break; |
| 258 | | case 2: data = ioport("KB2")->read(); break; |
| 259 | | case 3: data = ioport("KB3")->read(); break; |
| 260 | | case 4: data = ioport("KB4")->read(); break; |
| 261 | | case 5: data = ioport("KB5")->read(); break; |
| 262 | | case 6: data = ioport("KB6")->read(); break; |
| 263 | | case 7: data = ioport("KB7")->read(); break; |
| 264 | case 0: data = m_kb0->read(); break; |
| 265 | case 1: data = m_kb1->read(); break; |
| 266 | case 2: data = m_kb2->read(); break; |
| 267 | case 3: data = m_kb3->read(); break; |
| 268 | case 4: data = m_kb4->read(); break; |
| 269 | case 5: data = m_kb5->read(); break; |
| 270 | case 6: data = m_kb6->read(); break; |
| 271 | case 7: data = m_kb7->read(); break; |
| 264 | 272 | } |
| 265 | 273 | } |
| 266 | 274 | else if (BIT(offset, 5)) |
trunk/src/mess/machine/c64_4cga.c
| r20540 | r20541 | |
| 65 | 65 | c64_4cga_device::c64_4cga_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 66 | 66 | device_t(mconfig, C64_4CGA, "C64 Protovision 4 Player Interface", tag, owner, clock), |
| 67 | 67 | device_c64_user_port_interface(mconfig, *this), |
| 68 | m_fire(*this, "FIRE"), |
| 69 | m_joy3(*this, "JOY3"), |
| 70 | m_joy4(*this, "JOY4"), |
| 68 | 71 | m_port(0) |
| 69 | 72 | { |
| 70 | 73 | } |
| r20540 | r20541 | |
| 87 | 90 | |
| 88 | 91 | UINT8 c64_4cga_device::c64_pb_r(address_space &space, offs_t offset) |
| 89 | 92 | { |
| 90 | | UINT8 data = ioport("FIRE")->read(); |
| 93 | UINT8 data = m_fire->read(); |
| 91 | 94 | |
| 92 | 95 | if (m_port) |
| 93 | 96 | { |
| 94 | | data &= ioport("JOY3")->read(); |
| 97 | data &= m_joy3->read(); |
| 95 | 98 | } |
| 96 | 99 | else |
| 97 | 100 | { |
| 98 | | data &= ioport("JOY4")->read(); |
| 101 | data &= m_joy4->read(); |
| 99 | 102 | } |
| 100 | 103 | |
| 101 | 104 | return data; |
trunk/src/mess/machine/c64_4ksa.c
| r20540 | r20541 | |
| 65 | 65 | |
| 66 | 66 | c64_4ksa_device::c64_4ksa_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | 67 | device_t(mconfig, C64_4KSA, "C64 Kingsoft 4-Player Adapter", tag, owner, clock), |
| 68 | | device_c64_user_port_interface(mconfig, *this) |
| 68 | device_c64_user_port_interface(mconfig, *this), |
| 69 | m_pb(*this, "PB"), |
| 70 | m_pa2(*this, "PA2") |
| 69 | 71 | { |
| 70 | 72 | } |
| 71 | 73 | |
| r20540 | r20541 | |
| 85 | 87 | |
| 86 | 88 | UINT8 c64_4ksa_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | 89 | { |
| 88 | | return ioport("PB")->read(); |
| 90 | return m_pb->read(); |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | |
| r20540 | r20541 | |
| 95 | 97 | |
| 96 | 98 | int c64_4ksa_device::c64_pa2_r() |
| 97 | 99 | { |
| 98 | | return BIT(ioport("PA2")->read(), 0); |
| 100 | return BIT(m_pa2->read(), 0); |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | |
trunk/src/mess/machine/c64_4dxh.c
| r20540 | r20541 | |
| 65 | 65 | |
| 66 | 66 | c64_4dxh_device::c64_4dxh_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 67 | 67 | device_t(mconfig, C64_4DXH, "C64 DXH 4-Player Adapter", tag, owner, clock), |
| 68 | | device_c64_user_port_interface(mconfig, *this) |
| 68 | device_c64_user_port_interface(mconfig, *this), |
| 69 | m_pb(*this, "PB"), |
| 70 | m_pa2(*this, "PA2") |
| 69 | 71 | { |
| 70 | 72 | } |
| 71 | 73 | |
| r20540 | r20541 | |
| 85 | 87 | |
| 86 | 88 | UINT8 c64_4dxh_device::c64_pb_r(address_space &space, offs_t offset) |
| 87 | 89 | { |
| 88 | | return ioport("PB")->read(); |
| 90 | return m_pb->read(); |
| 89 | 91 | } |
| 90 | 92 | |
| 91 | 93 | |
| r20540 | r20541 | |
| 95 | 97 | |
| 96 | 98 | int c64_4dxh_device::c64_pa2_r() |
| 97 | 99 | { |
| 98 | | return BIT(ioport("PA2")->read(), 0); |
| 100 | return BIT(m_pa2->read(), 0); |
| 99 | 101 | } |
| 100 | 102 | |
| 101 | 103 | |
trunk/src/mess/machine/pc1512kb.c
| r20540 | r20541 | |
| 260 | 260 | pc1512_keyboard_device::pc1512_keyboard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 261 | 261 | : device_t(mconfig, PC1512_KEYBOARD, "Amstrad PC1512 Keyboard", tag, owner, clock), |
| 262 | 262 | m_maincpu(*this, I8048_TAG), |
| 263 | m_y1(*this, "Y1"), |
| 264 | m_y2(*this, "Y2"), |
| 265 | m_y3(*this, "Y3"), |
| 266 | m_y4(*this, "Y4"), |
| 267 | m_y5(*this, "Y5"), |
| 268 | m_y6(*this, "Y6"), |
| 269 | m_y7(*this, "Y7"), |
| 270 | m_y8(*this, "Y8"), |
| 271 | m_y9(*this, "Y9"), |
| 272 | m_y10(*this, "Y10"), |
| 273 | m_y11(*this, "Y11"), |
| 274 | m_com(*this, "COM"), |
| 263 | 275 | m_data_in(1), |
| 264 | 276 | m_clock_in(1), |
| 265 | 277 | m_kb_y(0xffff), |
| r20540 | r20541 | |
| 391 | 403 | |
| 392 | 404 | UINT8 data = 0xff; |
| 393 | 405 | |
| 394 | | if (!BIT(m_kb_y, 0)) data &= ioport("Y1")->read(); |
| 395 | | if (!BIT(m_kb_y, 1)) data &= ioport("Y2")->read(); |
| 396 | | if (!BIT(m_kb_y, 2)) data &= ioport("Y3")->read(); |
| 397 | | if (!BIT(m_kb_y, 3)) data &= ioport("Y4")->read(); |
| 398 | | if (!BIT(m_kb_y, 4)) data &= ioport("Y5")->read(); |
| 399 | | if (!BIT(m_kb_y, 5)) data &= ioport("Y6")->read(); |
| 400 | | if (!BIT(m_kb_y, 6)) data &= ioport("Y7")->read(); |
| 401 | | if (!BIT(m_kb_y, 7)) data &= ioport("Y8")->read(); |
| 402 | | if (!BIT(m_kb_y, 8)) data &= ioport("Y9")->read(); |
| 403 | | if (!BIT(m_kb_y, 9)) data &= ioport("Y10")->read(); |
| 404 | | if (!BIT(m_kb_y, 10)) data &= ioport("Y11")->read(); |
| 405 | | if (!m_joy_com) data &= ioport("COM")->read(); |
| 406 | if (!BIT(m_kb_y, 0)) data &= m_y1->read(); |
| 407 | if (!BIT(m_kb_y, 1)) data &= m_y2->read(); |
| 408 | if (!BIT(m_kb_y, 2)) data &= m_y3->read(); |
| 409 | if (!BIT(m_kb_y, 3)) data &= m_y4->read(); |
| 410 | if (!BIT(m_kb_y, 4)) data &= m_y5->read(); |
| 411 | if (!BIT(m_kb_y, 5)) data &= m_y6->read(); |
| 412 | if (!BIT(m_kb_y, 6)) data &= m_y7->read(); |
| 413 | if (!BIT(m_kb_y, 7)) data &= m_y8->read(); |
| 414 | if (!BIT(m_kb_y, 8)) data &= m_y9->read(); |
| 415 | if (!BIT(m_kb_y, 9)) data &= m_y10->read(); |
| 416 | if (!BIT(m_kb_y, 10)) data &= m_y11->read(); |
| 417 | if (!m_joy_com) data &= m_com->read(); |
| 406 | 418 | |
| 407 | 419 | return data; |
| 408 | 420 | } |
trunk/src/mess/machine/comx_joy.c
| r20540 | r20541 | |
| 69 | 69 | |
| 70 | 70 | comx_joy_device::comx_joy_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 71 | 71 | device_t(mconfig, COMX_JOY, "COMX JoyCard", tag, owner, clock), |
| 72 | | device_comx_expansion_card_interface(mconfig, *this) |
| 72 | device_comx_expansion_card_interface(mconfig, *this), |
| 73 | m_joy1(*this, "JOY1"), |
| 74 | m_joy2(*this, "JOY2") |
| 73 | 75 | { |
| 74 | 76 | } |
| 75 | 77 | |
| r20540 | r20541 | |
| 102 | 104 | |
| 103 | 105 | if (offset == 2) |
| 104 | 106 | { |
| 105 | | data = ioport("JOY1")->read(); |
| 107 | data = m_joy1->read(); |
| 106 | 108 | } |
| 107 | 109 | else if (offset == 4) |
| 108 | 110 | { |
| 109 | | data = ioport("JOY2")->read(); |
| 111 | data = m_joy2->read(); |
| 110 | 112 | } |
| 111 | 113 | |
| 112 | 114 | return data; |
trunk/src/mess/includes/pc1512.h
| r20540 | r20541 | |
| 57 | 57 | m_floppy0(*this, PC_FDC_XT_TAG ":0:525dd" ), |
| 58 | 58 | m_floppy1(*this, PC_FDC_XT_TAG ":1:525dd" ), |
| 59 | 59 | m_bus(*this, ISA_BUS_TAG), |
| 60 | m_char_rom(*this, AMS40041_TAG), |
| 60 | 61 | m_video_ram(*this, "video_ram"), |
| 62 | m_lk(*this, "LK"), |
| 61 | 63 | m_pit1(0), |
| 62 | 64 | m_pit2(0), |
| 63 | 65 | m_status1(0), |
| r20540 | r20541 | |
| 93 | 95 | required_device<floppy_image_device> m_floppy0; |
| 94 | 96 | optional_device<floppy_image_device> m_floppy1; |
| 95 | 97 | required_device<isa8_device> m_bus; |
| 98 | optional_memory_region m_char_rom; |
| 96 | 99 | optional_shared_ptr<UINT8> m_video_ram; |
| 100 | required_ioport m_lk; |
| 97 | 101 | |
| 98 | 102 | virtual void machine_start(); |
| 99 | 103 | virtual void machine_reset(); |
| r20540 | r20541 | |
| 196 | 200 | UINT8 m_printer_control; |
| 197 | 201 | |
| 198 | 202 | // video state |
| 199 | | const UINT8 *m_char_rom; |
| 200 | 203 | int m_toggle; |
| 201 | 204 | int m_lpen; |
| 202 | 205 | int m_blink; |
| r20540 | r20541 | |
| 210 | 213 | |
| 211 | 214 | // sound state |
| 212 | 215 | int m_speaker_drive; |
| 213 | | UINT32 screen_update_pc1512(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); |
| 214 | 216 | }; |
| 215 | 217 | |
| 216 | 218 | class pc1640_state : public pc1512_state |
| r20540 | r20541 | |
| 218 | 220 | public: |
| 219 | 221 | pc1640_state(const machine_config &mconfig, device_type type, const char *tag) |
| 220 | 222 | : pc1512_state(mconfig, type, tag), |
| 221 | | m_opt(0) |
| 223 | m_sw(*this, "SW"), |
| 224 | m_opt(0) |
| 222 | 225 | { } |
| 223 | 226 | |
| 224 | 227 | virtual void machine_start(); |
| r20540 | r20541 | |
| 236 | 239 | DECLARE_READ8_MEMBER( printer_r ); |
| 237 | 240 | DECLARE_READ8_MEMBER( io_unmapped_r ); |
| 238 | 241 | |
| 242 | required_ioport m_sw; |
| 243 | |
| 239 | 244 | // video state |
| 240 | 245 | int m_opt; |
| 241 | 246 | UINT8 m_egc_ctrl; |
trunk/src/mess/video/pc1512.c
| r20540 | r20541 | |
| 390 | 390 | |
| 391 | 391 | offs_t pc1512_state::get_char_rom_offset() |
| 392 | 392 | { |
| 393 | | return ((ioport("LK")->read() >> 5) & 0x03) << 11; |
| 393 | return ((m_lk->read() >> 5) & 0x03) << 11; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | void pc1512_state::draw_alpha(bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param) |
| r20540 | r20541 | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | offs_t addr = char_rom_offset | (code << 3) | (ra & 0x07); |
| 424 | | UINT8 data = m_char_rom[addr & 0x1fff]; |
| 424 | UINT8 data = m_char_rom->base()[addr & 0x1fff]; |
| 425 | 425 | |
| 426 | 426 | if ((column == cursor_x) && m_cursor) |
| 427 | 427 | { |
| r20540 | r20541 | |
| 548 | 548 | |
| 549 | 549 | void pc1512_state::video_start() |
| 550 | 550 | { |
| 551 | | // find memory regions |
| 552 | | m_char_rom = memregion(AMS40041_TAG)->base(); |
| 553 | | |
| 554 | 551 | // allocate memory |
| 555 | 552 | m_video_ram.allocate(0x10000); |
| 556 | 553 | } |
trunk/src/mess/video/pc1640.c
| r20540 | r20541 | |
| 128 | 128 | */ |
| 129 | 129 | |
| 130 | 130 | // switch sense |
| 131 | | data |= BIT(ioport("SW")->read(), ((m_egc_ctrl >> 2) & 0x03) ^ 0x03); |
| 131 | data |= BIT(m_sw->read(), ((m_egc_ctrl >> 2) & 0x03) ^ 0x03); |
| 132 | 132 | break; |
| 133 | 133 | |
| 134 | 134 | case 0x15: // Sequencer Data Register |
| r20540 | r20541 | |
| 364 | 364 | |
| 365 | 365 | |
| 366 | 366 | //------------------------------------------------- |
| 367 | | // VIDEO_START( pc1640 ) |
| 367 | // VIDEO_START( pc1640 )s |
| 368 | 368 | //------------------------------------------------- |
| 369 | 369 | |
| 370 | 370 | void pc1640_state::video_start() |
| r20540 | r20541 | |
| 380 | 380 | |
| 381 | 381 | UINT32 pc1640_state::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect) |
| 382 | 382 | { |
| 383 | | return false; |
| 383 | return 0; |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
trunk/src/mess/drivers/tmc600.c
| r20540 | r20541 | |
| 206 | 206 | |
| 207 | 207 | READ_LINE_MEMBER( tmc600_state::ef3_r ) |
| 208 | 208 | { |
| 209 | | UINT8 keydata[8] = { m_y0->read(), m_y1->read(), m_y2->read(), m_y3->read(), |
| 210 | | m_y4->read(), m_y5->read(), m_y6->read(), m_y7->read() }; |
| 209 | ioport_port* portnames[8] = { m_y0, m_y1, m_y2, m_y3, m_y4, m_y5, m_y6, m_y7 }; |
| 211 | 210 | |
| 212 | | UINT8 data = ~keydata[m_keylatch / 8]; |
| 211 | UINT8 data = ~portnames[m_keylatch / 8]->read(); |
| 213 | 212 | |
| 214 | 213 | return BIT(data, m_keylatch % 8); |
| 215 | 214 | } |
trunk/src/mess/drivers/pc1512.c
| r20540 | r20541 | |
| 319 | 319 | |
| 320 | 320 | */ |
| 321 | 321 | |
| 322 | | data |= ioport("LK")->read() & 0x07; |
| 322 | data |= m_lk->read() & 0x07; |
| 323 | 323 | |
| 324 | 324 | data |= m_centronics->fault_r() << 3; |
| 325 | 325 | data |= m_centronics->vcc_r() << 4; |
| r20540 | r20541 | |
| 404 | 404 | */ |
| 405 | 405 | data = m_printer_control; |
| 406 | 406 | data |= m_opt << 5; |
| 407 | | data |= (ioport("SW")->read() & 0x60) << 1; |
| 407 | data |= (m_sw->read() & 0x60) << 1; |
| 408 | 408 | break; |
| 409 | 409 | |
| 410 | 410 | default: |
| r20540 | r20541 | |
| 489 | 489 | } |
| 490 | 490 | else if (!BIT(offset, 7)) |
| 491 | 491 | { |
| 492 | | UINT16 sw = ioport("SW")->read(); |
| 492 | UINT16 sw = m_sw->read(); |
| 493 | 493 | |
| 494 | 494 | if (!BIT(offset, 14)) |
| 495 | 495 | { |
| r20540 | r20541 | |
| 1084 | 1084 | FLOPPY_FORMATS_END |
| 1085 | 1085 | |
| 1086 | 1086 | static SLOT_INTERFACE_START( ibmpc_floppies ) |
| 1087 | | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 1087 | SLOT_INTERFACE( "525dd", FLOPPY_525_DD ) |
| 1088 | 1088 | SLOT_INTERFACE_END |
| 1089 | 1089 | |
| 1090 | 1090 | |
trunk/src/mess/drivers/pecom.c
| r20540 | r20541 | |
| 49 | 49 | |
| 50 | 50 | INPUT_CHANGED_MEMBER(pecom_state::ef_w) |
| 51 | 51 | { |
| 52 | | machine().device(CDP1802_TAG)->execute().set_input_line((int)(FPTR)param, newval); |
| 52 | m_cdp1802->set_input_line((int)(FPTR)param, newval); |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static INPUT_PORTS_START( pecom ) |
| r20540 | r20541 | |
| 198 | 198 | |
| 199 | 199 | /* ROM definition */ |
| 200 | 200 | ROM_START( pecom64 ) |
| 201 | | ROM_REGION( 0x10000, CDP1802_TAG, ROMREGION_ERASEFF ) |
| 202 | | ROM_SYSTEM_BIOS(0, "ver4", "version 4") |
| 203 | | ROMX_LOAD( "pecom64-1.bin", 0x8000, 0x4000, CRC(9a433b47) SHA1(dadb8c399e0a25a2693e10e42a2d7fc2ea9ad427), ROM_BIOS(1) ) |
| 204 | | ROMX_LOAD( "pecom64-2.bin", 0xc000, 0x4000, CRC(2116cadc) SHA1(03f11055cd221d438a40a41874af8fba0fa116d9), ROM_BIOS(1) ) |
| 205 | | ROM_SYSTEM_BIOS(1, "ver1", "version 1") |
| 206 | | ROMX_LOAD( "170887-rom1.bin", 0x8000, 0x4000, CRC(43710fb4) SHA1(f84f75061c9ac3e34af93141ecabd3c955881aa2), ROM_BIOS(2) ) |
| 207 | | ROMX_LOAD( "170887-rom2.bin", 0xc000, 0x4000, CRC(d0d34f08) SHA1(7baab17d1e68771b8dcef97d0fffc655beabef28), ROM_BIOS(2) ) |
| 201 | ROM_REGION( 0x10000, CDP1802_TAG, ROMREGION_ERASEFF ) |
| 202 | ROM_SYSTEM_BIOS(0, "ver4", "version 4") |
| 203 | ROMX_LOAD( "pecom64-1.bin", 0x8000, 0x4000, CRC(9a433b47) SHA1(dadb8c399e0a25a2693e10e42a2d7fc2ea9ad427), ROM_BIOS(1) ) |
| 204 | ROMX_LOAD( "pecom64-2.bin", 0xc000, 0x4000, CRC(2116cadc) SHA1(03f11055cd221d438a40a41874af8fba0fa116d9), ROM_BIOS(1) ) |
| 205 | ROM_SYSTEM_BIOS(1, "ver1", "version 1") |
| 206 | ROMX_LOAD( "170887-rom1.bin", 0x8000, 0x4000, CRC(43710fb4) SHA1(f84f75061c9ac3e34af93141ecabd3c955881aa2), ROM_BIOS(2) ) |
| 207 | ROMX_LOAD( "170887-rom2.bin", 0xc000, 0x4000, CRC(d0d34f08) SHA1(7baab17d1e68771b8dcef97d0fffc655beabef28), ROM_BIOS(2) ) |
| 208 | 208 | ROM_END |
| 209 | 209 | |
| 210 | 210 | /* Driver */ |