trunk/src/mame/layout/spectra.lay
| r18172 | r18173 | |
| 34 | 34 | |
| 35 | 35 | <!-- Player 1 Score --> |
| 36 | 36 | |
| 37 | | <bezel name="digit32" element="digit"> |
| 37 | <bezel name="digit24" element="digit"> |
| 38 | 38 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 39 | 39 | </bezel> |
| 40 | | <bezel name="digit33" element="digit"> |
| 40 | <bezel name="digit25" element="digit"> |
| 41 | 41 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 42 | 42 | </bezel> |
| 43 | | <bezel name="digit34" element="digit"> |
| 43 | <bezel name="digit26" element="digit"> |
| 44 | 44 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 45 | 45 | </bezel> |
| 46 | | <bezel name="digit35" element="digit"> |
| 46 | <bezel name="digit27" element="digit"> |
| 47 | 47 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 48 | 48 | </bezel> |
| 49 | | <bezel name="digit36" element="digit"> |
| 49 | <bezel name="digit28" element="digit"> |
| 50 | 50 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 51 | 51 | </bezel> |
| 52 | | <bezel name="digit37" element="digit"> |
| 52 | <bezel name="digit29" 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="digit24" element="digit"> |
| 57 | <bezel name="digit16" element="digit"> |
| 58 | 58 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 59 | 59 | </bezel> |
| 60 | | <bezel name="digit25" element="digit"> |
| 60 | <bezel name="digit17" element="digit"> |
| 61 | 61 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 62 | 62 | </bezel> |
| 63 | | <bezel name="digit26" element="digit"> |
| 63 | <bezel name="digit18" element="digit"> |
| 64 | 64 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 65 | 65 | </bezel> |
| 66 | | <bezel name="digit27" element="digit"> |
| 66 | <bezel name="digit19" element="digit"> |
| 67 | 67 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 68 | 68 | </bezel> |
| 69 | | <bezel name="digit28" element="digit"> |
| 69 | <bezel name="digit20" element="digit"> |
| 70 | 70 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 71 | 71 | </bezel> |
| 72 | | <bezel name="digit29" element="digit"> |
| 72 | <bezel name="digit21" 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="digit16" element="digit"> |
| 77 | <bezel name="digit8" element="digit"> |
| 78 | 78 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 79 | 79 | </bezel> |
| 80 | | <bezel name="digit17" element="digit"> |
| 80 | <bezel name="digit9" element="digit"> |
| 81 | 81 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 82 | 82 | </bezel> |
| 83 | | <bezel name="digit18" element="digit"> |
| 83 | <bezel name="digit10" element="digit"> |
| 84 | 84 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 85 | 85 | </bezel> |
| 86 | | <bezel name="digit19" element="digit"> |
| 86 | <bezel name="digit11" element="digit"> |
| 87 | 87 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 88 | 88 | </bezel> |
| 89 | | <bezel name="digit20" element="digit"> |
| 89 | <bezel name="digit12" element="digit"> |
| 90 | 90 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 91 | 91 | </bezel> |
| 92 | | <bezel name="digit21" element="digit"> |
| 92 | <bezel name="digit13" 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="digit8" element="digit"> |
| 97 | <bezel name="digit0" element="digit"> |
| 98 | 98 | <bounds left="10" top="225" right="44" bottom="264" /> |
| 99 | 99 | </bezel> |
| 100 | | <bezel name="digit9" element="digit"> |
| 100 | <bezel name="digit1" element="digit"> |
| 101 | 101 | <bounds left="54" top="225" right="88" bottom="264" /> |
| 102 | 102 | </bezel> |
| 103 | | <bezel name="digit10" element="digit"> |
| 103 | <bezel name="digit2" element="digit"> |
| 104 | 104 | <bounds left="98" top="225" right="132" bottom="264" /> |
| 105 | 105 | </bezel> |
| 106 | | <bezel name="digit11" element="digit"> |
| 106 | <bezel name="digit3" element="digit"> |
| 107 | 107 | <bounds left="142" top="225" right="176" bottom="264" /> |
| 108 | 108 | </bezel> |
| 109 | | <bezel name="digit12" element="digit"> |
| 109 | <bezel name="digit4" element="digit"> |
| 110 | 110 | <bounds left="186" top="225" right="220" bottom="264" /> |
| 111 | 111 | </bezel> |
| 112 | | <bezel name="digit13" element="digit"> |
| 112 | <bezel name="digit5" 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="digit0" element="digit"> |
| 117 | <bezel name="digit32" element="digit"> |
| 118 | 118 | <bounds left="10" top="345" right="44" bottom="384" /> |
| 119 | 119 | </bezel> |
| 120 | | <bezel name="digit1" element="digit"> |
| 120 | <bezel name="digit33" element="digit"> |
| 121 | 121 | <bounds left="54" top="345" right="88" bottom="384" /> |
| 122 | 122 | </bezel> |
| 123 | | <bezel name="digit2" element="digit"> |
| 123 | <bezel name="digit34" element="digit"> |
| 124 | 124 | <bounds left="98" top="345" right="132" bottom="384" /> |
| 125 | 125 | </bezel> |
| 126 | | <bezel name="digit3" element="digit"> |
| 126 | <bezel name="digit35" element="digit"> |
| 127 | 127 | <bounds left="142" top="345" right="176" bottom="384" /> |
| 128 | 128 | </bezel> |
| 129 | | <bezel name="digit4" element="digit"> |
| 129 | <bezel name="digit36" element="digit"> |
| 130 | 130 | <bounds left="186" top="345" right="220" bottom="384" /> |
| 131 | 131 | </bezel> |
| 132 | | <bezel name="digit5" element="digit"> |
| 132 | <bezel name="digit37" 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/spectra.c
| r18172 | r18173 | |
| 43 | 43 | // driver_device overrides |
| 44 | 44 | virtual void machine_reset(); |
| 45 | 45 | private: |
| 46 | UINT8 m_porta; |
| 47 | UINT8 m_portb; |
| 46 | 48 | UINT8 m_t_c; |
| 47 | 49 | UINT8 m_out_offs; |
| 48 | 50 | }; |
| r18172 | r18173 | |
| 58 | 60 | ADDRESS_MAP_END |
| 59 | 61 | |
| 60 | 62 | static INPUT_PORTS_START( spectra ) |
| 63 | PORT_START("X0") |
| 64 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) |
| 65 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) |
| 66 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) |
| 67 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) |
| 68 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) |
| 69 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) |
| 70 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) |
| 71 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) |
| 72 | PORT_START("X1") |
| 73 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) |
| 74 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) |
| 75 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) |
| 76 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) |
| 77 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) |
| 78 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) |
| 79 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) |
| 80 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) |
| 81 | PORT_START("X2") |
| 82 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) |
| 83 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) |
| 84 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) |
| 85 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) |
| 86 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) |
| 87 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) |
| 88 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) |
| 89 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) |
| 90 | PORT_START("X3") |
| 91 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) |
| 92 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) |
| 93 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) |
| 94 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_COIN1) |
| 95 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_START1) |
| 96 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_TILT) |
| 97 | PORT_DIPNAME( 0x60, 0x60, "Test Switch" ) // 3-position slide switch |
| 98 | PORT_DIPSETTING( 0x60, "Play" ) |
| 99 | PORT_DIPSETTING( 0x20, "Setup" ) |
| 100 | PORT_DIPSETTING( 0x40, "Test" ) |
| 61 | 101 | INPUT_PORTS_END |
| 62 | 102 | |
| 63 | 103 | void spectra_state::machine_reset() |
| r18172 | r18173 | |
| 66 | 106 | } |
| 67 | 107 | |
| 68 | 108 | READ8_MEMBER( spectra_state::porta_r ) |
| 69 | | {printf("ReadA "); |
| 70 | | return 0; |
| 109 | { |
| 110 | char kbdrow[6]; |
| 111 | sprintf(kbdrow,"X%X",(m_porta & 0x18) >> 3); |
| 112 | UINT8 data = ioport(kbdrow)->read(); |
| 113 | return ((BIT(data, m_porta & 7)) ? 0x40 : 0) | (m_porta & 0xbf); |
| 71 | 114 | } |
| 72 | 115 | |
| 73 | 116 | READ8_MEMBER( spectra_state::portb_r ) |
| 74 | | {printf("ReadB "); |
| 75 | | return 0x5a; |
| 117 | { |
| 118 | if (m_p_ram[0xf0] != 1) |
| 119 | return 0x5a; // factory reset if first time |
| 120 | else |
| 121 | return m_portb; |
| 76 | 122 | } |
| 77 | 123 | |
| 78 | 124 | WRITE8_MEMBER( spectra_state::porta_w ) |
| 79 | | {printf("A=%X ",data); |
| 125 | { |
| 126 | m_porta = data; |
| 80 | 127 | } |
| 81 | 128 | |
| 129 | // sound port |
| 82 | 130 | WRITE8_MEMBER( spectra_state::portb_w ) |
| 83 | | {printf("B=%X ",data); |
| 131 | { |
| 132 | m_portb = data; |
| 84 | 133 | } |
| 85 | 134 | |
| 86 | 135 | |
| r18172 | r18173 | |
| 101 | 150 | m_t_c++; |
| 102 | 151 | } |
| 103 | 152 | |
| 153 | // 00-27 displays |
| 154 | // 40-6F lamps |
| 155 | // 70-7F solenoids (73=outhole) no knocker |
| 104 | 156 | TIMER_DEVICE_CALLBACK_MEMBER( spectra_state::outtimer) |
| 105 | 157 | { |
| 106 | | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x38, 0x63, 0x01, 0x40, 0x08, 0 }; // 74C912 |
| 158 | static const UINT8 patterns[16] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f, 0x5c, 0x63, 0x01, 0x40, 0x08, 0 }; // 74C912 |
| 107 | 159 | m_out_offs++; |
| 108 | 160 | |
| 109 | 161 | if (m_out_offs < 0x28) |
| 110 | | output_set_digit_value(m_out_offs, patterns[m_p_ram[m_out_offs]&15]); |
| 162 | { |
| 163 | UINT8 data = m_p_ram[m_out_offs]; |
| 164 | UINT8 segments = patterns[data&15] | (BIT(data, 4) ? 0x80 : 0); |
| 165 | output_set_digit_value(m_out_offs, segments); |
| 166 | } |
| 111 | 167 | else |
| 112 | 168 | m_out_offs = 0xff; |
| 113 | 169 | } |
| r18172 | r18173 | |
| 117 | 173 | MCFG_CPU_ADD("maincpu", M6502, 3579545/4) // actually a 6503 |
| 118 | 174 | MCFG_CPU_PROGRAM_MAP(spectra_map) |
| 119 | 175 | MCFG_RIOT6532_ADD("riot", 3579545/4, riot6532_intf) // R6532 |
| 120 | | MCFG_NVRAM_ADD_0FILL("ram") |
| 176 | MCFG_NVRAM_ADD_1FILL("ram") |
| 121 | 177 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", spectra_state, nmitimer, attotime::from_hz(120)) |
| 122 | 178 | MCFG_TIMER_DRIVER_ADD_PERIODIC("outtimer", spectra_state, outtimer, attotime::from_hz(1200)) |
| 123 | 179 | |