trunk/src/mess/drivers/atari400.c
| r32076 | r32077 | |
| 244 | 244 | public: |
| 245 | 245 | a400_state(const machine_config &mconfig, device_type type, const char *tag) |
| 246 | 246 | : atari_common_state(mconfig, type, tag), |
| 247 | | m_maincpu(*this, "maincpu"), |
| 248 | 247 | m_ram(*this, RAM_TAG), |
| 249 | 248 | m_pia(*this, "pia"), |
| 249 | m_dac(*this, "dac"), |
| 250 | 250 | m_region_maincpu(*this, "maincpu"), |
| 251 | 251 | m_0000(*this, "0000"), |
| 252 | 252 | m_8000(*this, "8000"), |
| r32076 | r32077 | |
| 266 | 266 | |
| 267 | 267 | DECLARE_WRITE8_MEMBER(a600xl_pia_pb_w); |
| 268 | 268 | DECLARE_WRITE8_MEMBER(a800xl_pia_pb_w); |
| 269 | | |
| 270 | | DECLARE_READ8_MEMBER(atari_pia_pa_r); |
| 271 | | DECLARE_READ8_MEMBER(atari_pia_pb_r); |
| 272 | 269 | |
| 273 | 270 | DECLARE_READ8_MEMBER(read_d5xx); // at least one cart type can enable/disable roms when reading |
| 274 | 271 | DECLARE_WRITE8_MEMBER(disable_cart); |
| r32076 | r32077 | |
| 291 | 288 | TIMER_DEVICE_CALLBACK_MEMBER(a5200_interrupt); |
| 292 | 289 | |
| 293 | 290 | protected: |
| 294 | | required_device<cpu_device> m_maincpu; |
| 291 | //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state |
| 295 | 292 | required_device<ram_device> m_ram; |
| 296 | 293 | required_device<pia6821_device> m_pia; |
| 294 | optional_device<dac_device> m_dac; |
| 297 | 295 | required_memory_region m_region_maincpu; |
| 298 | 296 | optional_memory_bank m_0000; |
| 299 | 297 | optional_memory_bank m_8000; |
| r32076 | r32077 | |
| 718 | 716 | - "Atari" is mapped to 'F3' */ |
| 719 | 717 | |
| 720 | 718 | static INPUT_PORTS_START( atari_keyboard ) |
| 721 | | PORT_START("keyboard_0") |
| 719 | PORT_START("keyboard.0") |
| 722 | 720 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 723 | 721 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 724 | 722 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR(':') |
| r32076 | r32077 | |
| 728 | 726 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('+') PORT_CHAR('\\') |
| 729 | 727 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('*') PORT_CHAR('^') |
| 730 | 728 | |
| 731 | | PORT_START("keyboard_1") |
| 729 | PORT_START("keyboard.1") |
| 732 | 730 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 733 | 731 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) // None! |
| 734 | 732 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| r32076 | r32077 | |
| 738 | 736 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('-') PORT_CHAR('_') |
| 739 | 737 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR('=') PORT_CHAR('|') |
| 740 | 738 | |
| 741 | | PORT_START("keyboard_2") |
| 739 | PORT_START("keyboard.2") |
| 742 | 740 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 743 | 741 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 744 | 742 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| r32076 | r32077 | |
| 748 | 746 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 749 | 747 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 750 | 748 | |
| 751 | | PORT_START("keyboard_3") |
| 749 | PORT_START("keyboard.3") |
| 752 | 750 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 753 | 751 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 754 | 752 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| r32076 | r32077 | |
| 758 | 756 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('\"') |
| 759 | 757 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 760 | 758 | |
| 761 | | PORT_START("keyboard_4") |
| 759 | PORT_START("keyboard.4") |
| 762 | 760 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('[') |
| 763 | 761 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 764 | 762 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') PORT_CHAR(']') |
| r32076 | r32077 | |
| 768 | 766 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') PORT_CHAR('?') |
| 769 | 767 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("Atari") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 770 | 768 | |
| 771 | | PORT_START("keyboard_5") |
| 769 | PORT_START("keyboard.5") |
| 772 | 770 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 773 | 771 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 774 | 772 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| r32076 | r32077 | |
| 778 | 776 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 779 | 777 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 780 | 778 | |
| 781 | | PORT_START("keyboard_6") |
| 779 | PORT_START("keyboard.6") |
| 782 | 780 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 783 | 781 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 784 | 782 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| r32076 | r32077 | |
| 788 | 786 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("< Clear") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('<') PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 789 | 787 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("> Insert") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('>') PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 790 | 788 | |
| 791 | | PORT_START("keyboard_7") |
| 789 | PORT_START("keyboard.7") |
| 792 | 790 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 793 | 791 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 794 | 792 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| r32076 | r32077 | |
| 865 | 863 | PORT_BIT(0x40, 0x40, IPT_BUTTON2) PORT_PLAYER(3) |
| 866 | 864 | PORT_BIT(0x80, 0x80, IPT_BUTTON2) PORT_PLAYER(4) |
| 867 | 865 | |
| 868 | | PORT_START("keypad_0") |
| 866 | PORT_START("keypad.0") |
| 869 | 867 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("(Break)") PORT_CODE(KEYCODE_PAUSE) // is this correct? |
| 870 | 868 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[#]") PORT_CODE(KEYCODE_ENTER_PAD) |
| 871 | 869 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[0]") PORT_CODE(KEYCODE_0_PAD) |
| 872 | 870 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[*]") PORT_CODE(KEYCODE_PLUS_PAD) |
| 873 | 871 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 874 | 872 | |
| 875 | | PORT_START("keypad_1") |
| 873 | PORT_START("keypad.1") |
| 876 | 874 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) |
| 877 | 875 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[9]") PORT_CODE(KEYCODE_9_PAD) |
| 878 | 876 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[8]") PORT_CODE(KEYCODE_8_PAD) |
| 879 | 877 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[7]") PORT_CODE(KEYCODE_7_PAD) |
| 880 | 878 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 881 | 879 | |
| 882 | | PORT_START("keypad_2") |
| 880 | PORT_START("keypad.2") |
| 883 | 881 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_F2) |
| 884 | 882 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[6]") PORT_CODE(KEYCODE_6_PAD) |
| 885 | 883 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[5]") PORT_CODE(KEYCODE_5_PAD) |
| 886 | 884 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[4]") PORT_CODE(KEYCODE_4_PAD) |
| 887 | 885 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 888 | 886 | |
| 889 | | PORT_START("keypad_3") |
| 887 | PORT_START("keypad.3") |
| 890 | 888 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Start") |
| 891 | 889 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[3]") PORT_CODE(KEYCODE_3_PAD) |
| 892 | 890 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[2]") PORT_CODE(KEYCODE_2_PAD) |
| r32076 | r32077 | |
| 2006 | 2004 | |
| 2007 | 2005 | WRITE8_MEMBER(a400_state::gtia_cb) |
| 2008 | 2006 | { |
| 2009 | | dac_device *dac = machine().device<dac_device>("dac"); |
| 2010 | 2007 | if (data & 0x08) |
| 2011 | | dac->write_unsigned8((UINT8)-120); |
| 2008 | m_dac->write_unsigned8((UINT8)-120); |
| 2012 | 2009 | else |
| 2013 | | dac->write_unsigned8(+120); |
| 2010 | m_dac->write_unsigned8(+120); |
| 2014 | 2011 | } |
| 2015 | 2012 | |
| 2016 | 2013 | /************************************************************** |
| r32076 | r32077 | |
| 2033 | 2030 | } |
| 2034 | 2031 | } |
| 2035 | 2032 | |
| 2036 | | READ8_MEMBER(a400_state::atari_pia_pa_r) |
| 2037 | | { |
| 2038 | | return ioport("djoy_0_1")->read_safe(0); |
| 2039 | | } |
| 2040 | | |
| 2041 | | READ8_MEMBER(a400_state::atari_pia_pb_r) |
| 2042 | | { |
| 2043 | | return ioport("djoy_2_3")->read_safe(0); |
| 2044 | | } |
| 2045 | | |
| 2046 | 2033 | /************************************************************** |
| 2047 | 2034 | * |
| 2048 | 2035 | * Machine drivers |
trunk/src/mame/drivers/maxaflex.c
| r32076 | r32077 | |
| 27 | 27 | public: |
| 28 | 28 | maxaflex_state(const machine_config &mconfig, device_type type, const char *tag) |
| 29 | 29 | : atari_common_state(mconfig, type, tag), |
| 30 | | m_maincpu(*this, "maincpu"), |
| 31 | 30 | m_mcu(*this, "mcu"), |
| 32 | | m_speaker(*this, "speaker") { } |
| 31 | m_speaker(*this, "speaker"), |
| 32 | m_region_maincpu(*this, "maincpu"), |
| 33 | m_dsw(*this, "dsw"), |
| 34 | m_coin(*this, "coin"), |
| 35 | m_console(*this, "console"), |
| 36 | m_joy01(*this, "djoy_0_1"), |
| 37 | m_joy23(*this, "djoy_2_3") |
| 38 | { } |
| 33 | 39 | |
| 34 | 40 | UINT8 m_portA_in; |
| 35 | 41 | UINT8 m_portA_out; |
| r32076 | r32077 | |
| 67 | 73 | TIMER_DEVICE_CALLBACK_MEMBER(mcu_timer_proc); |
| 68 | 74 | int atari_input_disabled(); |
| 69 | 75 | virtual void machine_reset(); |
| 70 | | required_device<cpu_device> m_maincpu; |
| 76 | //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state |
| 71 | 77 | required_device<cpu_device> m_mcu; |
| 72 | 78 | required_device<speaker_sound_device> m_speaker; |
| 79 | required_memory_region m_region_maincpu; |
| 80 | required_ioport m_dsw; |
| 81 | required_ioport m_coin; |
| 82 | required_ioport m_console; |
| 83 | required_ioport m_joy01; |
| 84 | required_ioport m_joy23; |
| 73 | 85 | }; |
| 74 | 86 | |
| 75 | 87 | |
| r32076 | r32077 | |
| 79 | 91 | if (new_mmu & 0x80) |
| 80 | 92 | { |
| 81 | 93 | logerror("%s MMU SELFTEST RAM\n", machine().system().name); |
| 82 | | machine().device("maincpu")->memory().space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff); |
| 94 | m_maincpu->space(AS_PROGRAM).nop_readwrite(0x5000, 0x57ff); |
| 83 | 95 | } |
| 84 | 96 | else |
| 85 | 97 | { |
| 86 | 98 | logerror("%s MMU SELFTEST ROM\n", machine().system().name); |
| 87 | | machine().device("maincpu")->memory().space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); |
| 88 | | machine().device("maincpu")->memory().space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); |
| 89 | | machine().root_device().membank("bank2")->set_base(machine().root_device().memregion("maincpu")->base() + 0xd000); |
| 99 | m_maincpu->space(AS_PROGRAM).install_read_bank(0x5000, 0x57ff, "bank2"); |
| 100 | m_maincpu->space(AS_PROGRAM).unmap_write(0x5000, 0x57ff); |
| 101 | machine().root_device().membank("bank2")->set_base(m_region_maincpu->base() + 0xd000); |
| 90 | 102 | } |
| 91 | 103 | } |
| 92 | 104 | |
| r32076 | r32077 | |
| 107 | 119 | |
| 108 | 120 | READ8_MEMBER(maxaflex_state::mcu_portA_r) |
| 109 | 121 | { |
| 110 | | m_portA_in = ioport("dsw")->read() | (ioport("coin")->read() << 4) | (ioport("console")->read() << 5); |
| 122 | m_portA_in = m_dsw->read() | (m_coin->read() << 4) | (m_console->read() << 5); |
| 111 | 123 | return (m_portA_in & ~m_ddrA) | (m_portA_out & m_ddrA); |
| 112 | 124 | } |
| 113 | 125 | |
| r32076 | r32077 | |
| 376 | 388 | |
| 377 | 389 | READ8_MEMBER(maxaflex_state::pia_pa_r) |
| 378 | 390 | { |
| 379 | | return atari_input_disabled() ? 0xff : ioport("djoy_0_1")->read_safe(0); |
| 391 | return atari_input_disabled() ? 0xff : m_joy01->read_safe(0); |
| 380 | 392 | } |
| 381 | 393 | |
| 382 | 394 | READ8_MEMBER(maxaflex_state::pia_pb_r) |
| 383 | 395 | { |
| 384 | | return atari_input_disabled() ? 0xff : ioport("djoy_2_3")->read_safe(0); |
| 396 | return atari_input_disabled() ? 0xff : m_joy23->read_safe(0); |
| 385 | 397 | } |
| 386 | 398 | |
| 387 | 399 | |
trunk/src/mame/drivers/bartop52.c
| r32076 | r32077 | |
| 27 | 27 | { |
| 28 | 28 | public: |
| 29 | 29 | bartop52_state(const machine_config &mconfig, device_type type, const char *tag) |
| 30 | | : atari_common_state(mconfig, type, tag), |
| 31 | | m_maincpu(*this, "maincpu") { } |
| 30 | : atari_common_state(mconfig, type, tag) |
| 31 | { } |
| 32 | 32 | |
| 33 | 33 | TIMER_DEVICE_CALLBACK_MEMBER( bartop_interrupt ); |
| 34 | 34 | |
| 35 | 35 | virtual void machine_reset(); |
| 36 | | required_device<cpu_device> m_maincpu; |
| 36 | //required_device<cpu_device> m_maincpu; // maincpu is already contained in atari_common_state |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | 39 | |
| r32076 | r32077 | |
| 60 | 60 | PORT_BIT(0x40, 0x40, IPT_UNUSED) |
| 61 | 61 | PORT_BIT(0x80, 0x80, IPT_UNUSED) |
| 62 | 62 | |
| 63 | | PORT_START("keypad_0") |
| 63 | PORT_START("keypad.0") |
| 64 | 64 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("(Break)") PORT_CODE(KEYCODE_PAUSE) // is this correct? |
| 65 | 65 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Wind-Up") PORT_CODE(KEYCODE_ENTER_PAD) |
| 66 | 66 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("[0]") PORT_CODE(KEYCODE_0_PAD) |
| 67 | 67 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("No Wind-Up") PORT_CODE(KEYCODE_PLUS_PAD) |
| 68 | 68 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 69 | 69 | |
| 70 | | PORT_START("keypad_1") |
| 70 | PORT_START("keypad.1") |
| 71 | 71 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Reset") PORT_CODE(KEYCODE_F3) |
| 72 | 72 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball Low") PORT_CODE(KEYCODE_9_PAD) |
| 73 | 73 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up Low") PORT_CODE(KEYCODE_8_PAD) |
| 74 | 74 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Curve Low") PORT_CODE(KEYCODE_7_PAD) |
| 75 | 75 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 76 | 76 | |
| 77 | | PORT_START("keypad_2") |
| 77 | PORT_START("keypad.2") |
| 78 | 78 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME(DEF_STR(Pause)) PORT_CODE(KEYCODE_F2) |
| 79 | 79 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball Med.") PORT_CODE(KEYCODE_6_PAD) |
| 80 | 80 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up Med.") PORT_CODE(KEYCODE_5_PAD) |
| 81 | 81 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Curve Med") PORT_CODE(KEYCODE_4_PAD) |
| 82 | 82 | PORT_BIT(0xf0, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 83 | 83 | |
| 84 | | PORT_START("keypad_3") |
| 84 | PORT_START("keypad.3") |
| 85 | 85 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START) PORT_NAME("Start") |
| 86 | 86 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Fast Ball High") PORT_CODE(KEYCODE_3_PAD) |
| 87 | 87 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_KEYPAD) PORT_NAME("Change-Up High") PORT_CODE(KEYCODE_2_PAD) |
trunk/src/mame/machine/atari.c
| r32076 | r32077 | |
| 45 | 45 | logerror("atari interrupt_cb TIMR1\n"); |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | | machine().device("maincpu")->execute().set_input_line(0, HOLD_LINE); |
| 48 | m_maincpu->set_input_line(0, HOLD_LINE); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| r32076 | r32077 | |
| 89 | 89 | POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a800_keyboard) |
| 90 | 90 | { |
| 91 | 91 | int ipt; |
| 92 | | static const char *const tag[] = { |
| 93 | | "keyboard_0", "keyboard_1", "keyboard_2", "keyboard_3", |
| 94 | | "keyboard_4", "keyboard_5", "keyboard_6", "keyboard_7" |
| 95 | | }; |
| 96 | 92 | UINT8 ret = 0x00; |
| 97 | 93 | |
| 98 | 94 | /* decode special */ |
| r32076 | r32077 | |
| 100 | 96 | { |
| 101 | 97 | case pokey_device::POK_KEY_BREAK: |
| 102 | 98 | /* special case ... */ |
| 103 | | ret |= ((machine().root_device().ioport(tag[0])->read_safe(0) & 0x08) ? 0x02 : 0x00); |
| 99 | ret |= ((m_keyboard[0]->read_safe(0) & 0x08) ? 0x02 : 0x00); |
| 104 | 100 | break; |
| 105 | 101 | case pokey_device::POK_KEY_CTRL: |
| 106 | 102 | /* CTRL */ |
| 107 | | ret |= ((machine().root_device().ioport("fake")->read_safe(0) & 0x02) ? 0x02 : 0x00); |
| 103 | ret |= ((m_fake->read_safe(0) & 0x02) ? 0x02 : 0x00); |
| 108 | 104 | break; |
| 109 | 105 | case pokey_device::POK_KEY_SHIFT: |
| 110 | 106 | /* SHIFT */ |
| 111 | | ret |= ((machine().root_device().ioport("fake")->read_safe(0) & 0x01) ? 0x02 : 0x00); |
| 107 | ret |= ((m_fake->read_safe(0) & 0x01) ? 0x02 : 0x00); |
| 112 | 108 | break; |
| 113 | 109 | } |
| 114 | 110 | |
| r32076 | r32077 | |
| 117 | 113 | return ret; |
| 118 | 114 | |
| 119 | 115 | /* decode regular key */ |
| 120 | | ipt = machine().root_device().ioport(tag[k543210 >> 3])->read_safe(0); |
| 116 | ipt = m_keyboard[k543210 >> 3]->read_safe(0); |
| 121 | 117 | |
| 122 | 118 | if (ipt & (1 << (k543210 & 0x07))) |
| 123 | 119 | ret |= 0x01; |
| r32076 | r32077 | |
| 157 | 153 | POKEY_KEYBOARD_CB_MEMBER(atari_common_state::a5200_keypads) |
| 158 | 154 | { |
| 159 | 155 | int ipt; |
| 160 | | static const char *const tag[] = { "keypad_0", "keypad_1", "keypad_2", "keypad_3" }; |
| 161 | 156 | UINT8 ret = 0x00; |
| 162 | 157 | |
| 163 | 158 | /* decode special */ |
| r32076 | r32077 | |
| 165 | 160 | { |
| 166 | 161 | case pokey_device::POK_KEY_BREAK: |
| 167 | 162 | /* special case ... */ |
| 168 | | ret |= ((machine().root_device().ioport(tag[0])->read_safe(0) & 0x01) ? 0x02 : 0x00); |
| 163 | ret |= ((m_keypad[0]->read_safe(0) & 0x01) ? 0x02 : 0x00); |
| 169 | 164 | break; |
| 170 | 165 | case pokey_device::POK_KEY_CTRL: |
| 171 | 166 | break; |
| 172 | 167 | case pokey_device::POK_KEY_SHIFT: |
| 173 | 168 | // button 2 from joypads |
| 174 | | ipt = machine().root_device().ioport("djoy_b")->read() & (0x10 << ((k543210 >> 3) & 0x03)); |
| 169 | ipt = m_djoy_b->read() & (0x10 << ((k543210 >> 3) & 0x03)); |
| 175 | 170 | ret |= !ipt ? 0x02 : 0; |
| 176 | 171 | break; |
| 177 | 172 | } |
| r32076 | r32077 | |
| 187 | 182 | if (k543210 == 0) |
| 188 | 183 | return ret; |
| 189 | 184 | |
| 190 | | ipt = machine().root_device().ioport(tag[k543210 >> 2])->read_safe(0); |
| 185 | ipt = m_keypad[k543210 >> 2]->read_safe(0); |
| 191 | 186 | |
| 192 | 187 | if (ipt & (1 << (k543210 & 0x03))) |
| 193 | 188 | ret |= 0x01; |