trunk/src/mame/layout/atari_s2.lay
| r18405 | r18406 | |
| 34 | 34 | |
| 35 | 35 | <!-- Player 1 Score --> |
| 36 | 36 | |
| 37 | | <bezel name="digit28" element="digit"> |
| 37 | <bezel name="digit11" element="digit"> |
| 38 | 38 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 39 | 39 | </bezel> |
| 40 | | <bezel name="digit29" element="digit"> |
| 40 | <bezel name="digit12" element="digit"> |
| 41 | 41 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 42 | 42 | </bezel> |
| 43 | | <bezel name="digit26" element="digit"> |
| 43 | <bezel name="digit13" element="digit"> |
| 44 | 44 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 45 | 45 | </bezel> |
| 46 | | <bezel name="digit27" element="digit"> |
| 46 | <bezel name="digit14" element="digit"> |
| 47 | 47 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 48 | 48 | </bezel> |
| 49 | | <bezel name="digit24" element="digit"> |
| 49 | <bezel name="digit15" element="digit"> |
| 50 | 50 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 51 | 51 | </bezel> |
| 52 | | <bezel name="digit25" element="digit"> |
| 52 | <bezel name="digit16" element="digit"> |
| 53 | 53 | <bounds left="230" top="45" right="264" bottom="84" /> |
| 54 | 54 | </bezel> |
| 55 | 55 | |
| 56 | 56 | <!-- Player 2 Score --> |
| 57 | | <bezel name="digit20" element="digit"> |
| 57 | <bezel name="digit21" element="digit"> |
| 58 | 58 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 59 | 59 | </bezel> |
| 60 | | <bezel name="digit21" element="digit"> |
| 60 | <bezel name="digit22" element="digit"> |
| 61 | 61 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 62 | 62 | </bezel> |
| 63 | | <bezel name="digit18" element="digit"> |
| 63 | <bezel name="digit23" element="digit"> |
| 64 | 64 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 65 | 65 | </bezel> |
| 66 | | <bezel name="digit19" element="digit"> |
| 66 | <bezel name="digit24" element="digit"> |
| 67 | 67 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 68 | 68 | </bezel> |
| 69 | | <bezel name="digit16" element="digit"> |
| 69 | <bezel name="digit25" element="digit"> |
| 70 | 70 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 71 | 71 | </bezel> |
| 72 | | <bezel name="digit17" element="digit"> |
| 72 | <bezel name="digit26" element="digit"> |
| 73 | 73 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 74 | 74 | </bezel> |
| 75 | 75 | |
| 76 | 76 | <!-- Player 3 Score --> |
| 77 | | <bezel name="digit12" element="digit"> |
| 77 | <bezel name="digit31" element="digit"> |
| 78 | 78 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 79 | 79 | </bezel> |
| 80 | | <bezel name="digit13" element="digit"> |
| 80 | <bezel name="digit32" element="digit"> |
| 81 | 81 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 82 | 82 | </bezel> |
| 83 | | <bezel name="digit10" element="digit"> |
| 83 | <bezel name="digit33" element="digit"> |
| 84 | 84 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 85 | 85 | </bezel> |
| 86 | | <bezel name="digit11" element="digit"> |
| 86 | <bezel name="digit34" element="digit"> |
| 87 | 87 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 88 | 88 | </bezel> |
| 89 | | <bezel name="digit8" element="digit"> |
| 89 | <bezel name="digit35" element="digit"> |
| 90 | 90 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 91 | 91 | </bezel> |
| 92 | | <bezel name="digit9" element="digit"> |
| 92 | <bezel name="digit36" element="digit"> |
| 93 | 93 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 94 | 94 | </bezel> |
| 95 | 95 | |
| 96 | 96 | <!-- Player 4 Score --> |
| 97 | | <bezel name="digit4" element="digit"> |
| 97 | <bezel name="digit41" element="digit"> |
| 98 | 98 | <bounds left="10" top="225" right="44" bottom="264" /> |
| 99 | 99 | </bezel> |
| 100 | | <bezel name="digit5" element="digit"> |
| 100 | <bezel name="digit42" element="digit"> |
| 101 | 101 | <bounds left="54" top="225" right="88" bottom="264" /> |
| 102 | 102 | </bezel> |
| 103 | | <bezel name="digit2" element="digit"> |
| 103 | <bezel name="digit43" element="digit"> |
| 104 | 104 | <bounds left="98" top="225" right="132" bottom="264" /> |
| 105 | 105 | </bezel> |
| 106 | | <bezel name="digit3" element="digit"> |
| 106 | <bezel name="digit44" element="digit"> |
| 107 | 107 | <bounds left="142" top="225" right="176" bottom="264" /> |
| 108 | 108 | </bezel> |
| 109 | | <bezel name="digit0" element="digit"> |
| 109 | <bezel name="digit45" element="digit"> |
| 110 | 110 | <bounds left="186" top="225" right="220" bottom="264" /> |
| 111 | 111 | </bezel> |
| 112 | | <bezel name="digit1" element="digit"> |
| 112 | <bezel name="digit46" element="digit"> |
| 113 | 113 | <bounds left="230" top="225" right="264" bottom="264" /> |
| 114 | 114 | </bezel> |
| 115 | 115 | |
| 116 | 116 | <!-- Credits and Balls --> |
| 117 | | <bezel name="digit58" element="digit"> |
| 117 | <bezel name="digit51" element="digit"> |
| 118 | 118 | <bounds left="10" top="345" right="44" bottom="384" /> |
| 119 | 119 | </bezel> |
| 120 | | <bezel name="digit59" element="digit"> |
| 120 | <bezel name="digit52" element="digit"> |
| 121 | 121 | <bounds left="54" top="345" right="88" bottom="384" /> |
| 122 | 122 | </bezel> |
| 123 | | <bezel name="digit70" element="digit"> |
| 123 | <bezel name="digit53" element="digit"> |
| 124 | 124 | <bounds left="98" top="345" right="132" bottom="384" /> |
| 125 | 125 | </bezel> |
| 126 | | <bezel name="digit71" element="digit"> |
| 126 | <bezel name="digit54" element="digit"> |
| 127 | 127 | <bounds left="142" top="345" right="176" bottom="384" /> |
| 128 | 128 | </bezel> |
| 129 | | <bezel name="digit56" element="digit"> |
| 129 | <bezel name="digit55" element="digit"> |
| 130 | 130 | <bounds left="186" top="345" right="220" bottom="384" /> |
| 131 | 131 | </bezel> |
| 132 | | <bezel name="digit57" element="digit"> |
| 132 | <bezel name="digit56" element="digit"> |
| 133 | 133 | <bounds left="230" top="345" right="264" bottom="384" /> |
| 134 | 134 | </bezel> |
| 135 | 135 | <bezel element="P0"><bounds left="200" right="258" top="330" bottom="342" /></bezel> |
trunk/src/mame/drivers/atari_s2.c
| r18405 | r18406 | |
| 23 | 23 | m_samples(*this, "samples") |
| 24 | 24 | { } |
| 25 | 25 | |
| 26 | DECLARE_WRITE8_HANDLER(sound0_w) { }; |
| 27 | DECLARE_WRITE8_HANDLER(sound1_w) { }; |
| 28 | DECLARE_WRITE8_HANDLER(lamp_w) { }; |
| 29 | DECLARE_WRITE8_HANDLER(sol0_w) { }; |
| 30 | DECLARE_WRITE8_HANDLER(sol1_w) { }; |
| 26 | 31 | DECLARE_WRITE8_HANDLER(intack_w); |
| 32 | DECLARE_WRITE8_HANDLER(display_w); |
| 33 | DECLARE_READ8_MEMBER(switch_r); |
| 27 | 34 | |
| 28 | | |
| 29 | 35 | TIMER_DEVICE_CALLBACK_MEMBER(irq); |
| 30 | 36 | protected: |
| 31 | 37 | |
| r18405 | r18406 | |
| 37 | 43 | virtual void machine_reset(); |
| 38 | 44 | private: |
| 39 | 45 | UINT8 m_t_c; |
| 46 | UINT8 m_segment[7]; |
| 40 | 47 | }; |
| 41 | 48 | |
| 42 | 49 | |
| r18405 | r18406 | |
| 44 | 51 | ADDRESS_MAP_GLOBAL_MASK(0x3fff) |
| 45 | 52 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0700) AM_RAM |
| 46 | 53 | AM_RANGE(0x0800, 0x08ff) AM_MIRROR(0x0700) AM_RAM AM_SHARE("nvram") // battery backed |
| 47 | | //AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07F8) AM_READ(sw_r) |
| 48 | | //AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x071F) AM_WRITE(sound0_w) |
| 49 | | //AM_RANGE(0x1820, 0x1820) AM_MIRROR(0x071F) AM_WRITE(sound1_w) |
| 50 | | //AM_RANGE(0x1840, 0x1847) AM_MIRROR(0x0718) AM_WRITE(disp_w) |
| 51 | | //AM_RANGE(0x1860, 0x1867) AM_MIRROR(0x0718) AM_WRITE(lamp_w) |
| 52 | | //AM_RANGE(0x1880, 0x1880) AM_MIRROR(0x071F) AM_WRITE(sol0_w) |
| 53 | | //AM_RANGE(0x18a0, 0x18a7) AM_MIRROR(0x0718) AM_WRITE(sol1_w) |
| 54 | AM_RANGE(0x1000, 0x1007) AM_MIRROR(0x07F8) AM_READ(switch_r) |
| 55 | AM_RANGE(0x1800, 0x1800) AM_MIRROR(0x071F) AM_WRITE(sound0_w) |
| 56 | AM_RANGE(0x1820, 0x1820) AM_MIRROR(0x071F) AM_WRITE(sound1_w) |
| 57 | AM_RANGE(0x1840, 0x1847) AM_MIRROR(0x0718) AM_WRITE(display_w) |
| 58 | AM_RANGE(0x1860, 0x1867) AM_MIRROR(0x0718) AM_WRITE(lamp_w) |
| 59 | AM_RANGE(0x1880, 0x1880) AM_MIRROR(0x071F) AM_WRITE(sol0_w) |
| 60 | AM_RANGE(0x18a0, 0x18a7) AM_MIRROR(0x0718) AM_WRITE(sol1_w) |
| 54 | 61 | AM_RANGE(0x18c0, 0x18c0) AM_MIRROR(0x071F) AM_WRITE(watchdog_reset_w) |
| 55 | 62 | AM_RANGE(0x18e0, 0x18e0) AM_MIRROR(0x071F) AM_WRITE(intack_w) |
| 56 | | //AM_RANGE(0x2000, 0x2003) AM_MIRROR(0x07FC) AM_READWRITE(dip_r,dip_w) |
| 63 | AM_RANGE(0x2000, 0x2000) AM_MIRROR(0x07FC) AM_READ_PORT("DSW0") |
| 64 | AM_RANGE(0x2001, 0x2001) AM_MIRROR(0x07FC) AM_READ_PORT("DSW1") |
| 65 | AM_RANGE(0x2002, 0x2002) AM_MIRROR(0x07FC) AM_READ_PORT("DSW2") |
| 66 | AM_RANGE(0x2003, 0x2003) AM_MIRROR(0x07FC) AM_READ_PORT("DSW3") |
| 57 | 67 | AM_RANGE(0x2800, 0x3fff) AM_ROM |
| 58 | 68 | ADDRESS_MAP_END |
| 59 | 69 | |
| 60 | 70 | static INPUT_PORTS_START( atari_s2 ) |
| 71 | // dipswitches still to be described |
| 72 | PORT_START("DSW0") |
| 73 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 74 | |
| 75 | PORT_START("DSW1") |
| 76 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 77 | |
| 78 | PORT_START("DSW2") |
| 79 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 80 | |
| 81 | PORT_START("DSW3") |
| 82 | PORT_BIT( 0xff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 83 | |
| 84 | PORT_START("X0") // 1000 |
| 85 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Test") PORT_CODE(KEYCODE_0) |
| 86 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Outhole") PORT_CODE(KEYCODE_X) |
| 87 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_START ) |
| 88 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) |
| 89 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) |
| 90 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) |
| 91 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 92 | |
| 93 | PORT_START("X1") // 1001 |
| 94 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) |
| 95 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) |
| 96 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) |
| 97 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) |
| 98 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Q) |
| 99 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_W) |
| 100 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 101 | |
| 102 | PORT_START("X2") // 1002 |
| 103 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) |
| 104 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) |
| 105 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_E) |
| 106 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_R) |
| 107 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Y) |
| 108 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_U) |
| 109 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 110 | |
| 111 | PORT_START("X3") // 1003 |
| 112 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_I) |
| 113 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_O) |
| 114 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) |
| 115 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) |
| 116 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_S) |
| 117 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_D) |
| 118 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 119 | |
| 120 | PORT_START("X4") // 1004 |
| 121 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_F) |
| 122 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_G) |
| 123 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) |
| 124 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_H) |
| 125 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_J) |
| 126 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_K) |
| 127 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 128 | |
| 129 | PORT_START("X5") // 1005 |
| 130 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_L) |
| 131 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) |
| 132 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) |
| 133 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) |
| 134 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) |
| 135 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) |
| 136 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 137 | |
| 138 | PORT_START("X6") // 1006 |
| 139 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_TILT ) |
| 140 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) |
| 141 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) |
| 142 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) |
| 143 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_Z) |
| 144 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_C) |
| 145 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 146 | |
| 147 | PORT_START("X7") // 1007 |
| 148 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_V) |
| 149 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_B) |
| 150 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) |
| 151 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) |
| 152 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) |
| 153 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) |
| 154 | PORT_BIT( 0xc0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 61 | 155 | INPUT_PORTS_END |
| 62 | 156 | |
| 157 | WRITE8_MEMBER( atari_s2_state::display_w ) |
| 158 | { |
| 159 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 |
| 160 | if (offset<7) |
| 161 | m_segment[offset] = patterns[data&15]; |
| 162 | else |
| 163 | { |
| 164 | data &= 7; |
| 165 | for (UINT8 i = 0; i < 7; i++) |
| 166 | output_set_digit_value(i * 10 + data, m_segment[i]); |
| 167 | } |
| 168 | } |
| 169 | |
| 63 | 170 | WRITE8_MEMBER( atari_s2_state::intack_w ) |
| 64 | 171 | { |
| 65 | 172 | m_maincpu->set_input_line(M6800_IRQ_LINE, CLEAR_LINE); |
| 66 | 173 | } |
| 67 | 174 | |
| 175 | READ8_MEMBER( atari_s2_state::switch_r ) |
| 176 | { |
| 177 | char kbdrow[8]; |
| 178 | sprintf(kbdrow,"X%X",offset); |
| 179 | return ioport(kbdrow)->read(); |
| 180 | } |
| 181 | |
| 68 | 182 | TIMER_DEVICE_CALLBACK_MEMBER( atari_s2_state::irq ) |
| 69 | 183 | { |
| 70 | | // static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7c, 0x07, 0x7f, 0x67, 0, 0, 0, 0, 0, 0 }; // 4511 |
| 71 | | // m_bit6++; |
| 72 | 184 | if (m_t_c > 0x40) |
| 73 | 185 | m_maincpu->set_input_line(M6800_IRQ_LINE, HOLD_LINE); |
| 74 | 186 | else |
| 75 | 187 | m_t_c++; |
| 76 | | |
| 77 | | // m_out_offs++; |
| 78 | | // m_out_offs &= 0x1f; |
| 79 | | // if ((m_out_offs & 3) == 3) |
| 80 | | // { |
| 81 | | // // Player number |
| 82 | | // char wordnum[8]; |
| 83 | | // sprintf(wordnum,"text%d",m_out_offs>>2); |
| 84 | | // output_set_value(wordnum, !BIT(patterns[m_p_ram[m_out_offs]&15], 6)); // uses 'g' segment |
| 85 | | // } |
| 86 | | // else |
| 87 | | // { |
| 88 | | // // Digits |
| 89 | | // output_set_digit_value(m_out_offs << 1, patterns[m_p_ram[m_out_offs]>>4]); |
| 90 | | // output_set_digit_value((m_out_offs << 1)+1, patterns[m_p_ram[m_out_offs]&15]); |
| 91 | | // } |
| 92 | 188 | } |
| 93 | 189 | |
| 94 | 190 | void atari_s2_state::machine_reset() |