trunk/src/mess/drivers/simon.c
| r241726 | r241727 | |
| 5 | 5 | Milton Bradley Simon |
| 6 | 6 | |
| 7 | 7 | Revision A hardware: |
| 8 | | * TMS1000 (has internal ROM), SN75494 lamp driver |
| 8 | * TMS1000 (has internal ROM), DS75494 lamp driver |
| 9 | 9 | |
| 10 | 10 | Newer revisions have a smaller 16-pin MB4850 chip instead of the TMS1000. |
| 11 | 11 | This one has been decapped too, but we couldn't yet find the internal ROM. |
| r241726 | r241727 | |
| 13 | 13 | Other games assumed to be on similar hardware: |
| 14 | 14 | - Pocket Simon |
| 15 | 15 | - Super Simon |
| 16 | | |
| 17 | 16 | |
| 18 | | TODO: |
| 19 | | - accurate rc osc |
| 20 | | - where's the skill switch? |
| 21 | | |
| 22 | 17 | ***************************************************************************/ |
| 23 | 18 | |
| 24 | 19 | #include "emu.h" |
| r241726 | r241727 | |
| 27 | 22 | |
| 28 | 23 | #include "simon.lh" |
| 29 | 24 | |
| 30 | | // master clock is a single stage RC oscillator: R=?, C=? |
| 31 | | // this is an approximation compared with old recordings |
| 32 | | #define SIMON_RC_CLOCK (330000) |
| 25 | // master clock is a single stage RC oscillator: R=33K, C=100pf, |
| 26 | // according to the TMS 1000 series data manual this is around 350kHz |
| 27 | #define SIMON_RC_CLOCK (350000) |
| 33 | 28 | |
| 34 | 29 | |
| 35 | 30 | class simon_state : public driver_device |
| r241726 | r241727 | |
| 38 | 33 | simon_state(const machine_config &mconfig, device_type type, const char *tag) |
| 39 | 34 | : driver_device(mconfig, type, tag), |
| 40 | 35 | m_maincpu(*this, "maincpu"), |
| 41 | | m_button_matrix(*this, "R"), |
| 36 | m_button_matrix(*this, "IN"), |
| 42 | 37 | m_speaker(*this, "speaker") |
| 43 | 38 | { } |
| 44 | 39 | |
| 45 | 40 | required_device<cpu_device> m_maincpu; |
| 46 | | required_ioport_array<3> m_button_matrix; |
| 41 | required_ioport_array<4> m_button_matrix; |
| 47 | 42 | required_device<speaker_sound_device> m_speaker; |
| 48 | 43 | |
| 49 | 44 | UINT16 m_r; |
| r241726 | r241727 | |
| 67 | 62 | UINT8 k = 0; |
| 68 | 63 | |
| 69 | 64 | // read selected button rows |
| 70 | | for (int i = 0; i < 3; i++) |
| 71 | | if (m_r & (1 << i)) |
| 65 | for (int i = 0; i < 4; i++) |
| 66 | { |
| 67 | static int r[4] = { 0, 1, 2, 9 }; |
| 68 | if (m_r & (1 << r[i])) |
| 72 | 69 | k |= m_button_matrix[i]->read(); |
| 70 | } |
| 73 | 71 | |
| 74 | 72 | return k; |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | WRITE16_MEMBER(simon_state::write_r) |
| 78 | 76 | { |
| 79 | | // R4-R7: lamps, through 75494 IC |
| 77 | // R4-R8 go through an 75494 IC first: |
| 78 | // R4 -> 75494 IN6 -> green lamp |
| 79 | // R5 -> 75494 IN3 -> red lamp |
| 80 | // R6 -> 75494 IN5 -> yellow lamp |
| 81 | // R7 -> 75494 IN2 -> blue lamp |
| 80 | 82 | for (int i = 0; i < 4; i++) |
| 81 | 83 | output_set_lamp_value(i, data >> (4 + i) & 1); |
| 82 | 84 | |
| 83 | | // R8: speaker |
| 85 | // R8 -> 75494 IN0 -> speaker |
| 84 | 86 | m_speaker->level_w(data >> 8 & 1); |
| 85 | 87 | |
| 86 | | // R0-R2: input mux |
| 88 | // R0,R1,R2,R9: input mux |
| 87 | 89 | // R3: GND |
| 88 | 90 | // other bits: N/C |
| 89 | 91 | m_r = data; |
| r241726 | r241727 | |
| 103 | 105 | ***************************************************************************/ |
| 104 | 106 | |
| 105 | 107 | static INPUT_PORTS_START( simon ) |
| 106 | | PORT_START("R.0") |
| 108 | PORT_START("IN.0") |
| 107 | 109 | PORT_CONFNAME( 0x07, 0x02, "Game Select") |
| 108 | 110 | PORT_CONFSETTING( 0x02, "1" ) |
| 109 | 111 | PORT_CONFSETTING( 0x01, "2" ) |
| 110 | 112 | PORT_CONFSETTING( 0x04, "3" ) |
| 111 | 113 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 112 | 114 | |
| 113 | | PORT_START("R.1") |
| 115 | PORT_START("IN.1") |
| 114 | 116 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_BUTTON5 ) PORT_NAME("Green Button") |
| 115 | 117 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON6 ) PORT_NAME("Red Button") |
| 116 | 118 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON7 ) PORT_NAME("Yellow Button") |
| 117 | 119 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON8 ) PORT_NAME("Blue Button") |
| 118 | 120 | |
| 119 | | PORT_START("R.2") |
| 121 | PORT_START("IN.2") |
| 120 | 122 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START ) PORT_NAME("Start") |
| 121 | 123 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 ) PORT_NAME("Last") |
| 122 | 124 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_BUTTON2 ) PORT_NAME("Longest") |
| 123 | 125 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 126 | |
| 127 | PORT_START("IN.3") |
| 128 | PORT_CONFNAME( 0x0f, 0x01, "Skill Level") |
| 129 | PORT_CONFSETTING( 0x02, "1" ) |
| 130 | PORT_CONFSETTING( 0x04, "2" ) |
| 131 | PORT_CONFSETTING( 0x08, "3" ) |
| 132 | PORT_CONFSETTING( 0x01, "4" ) |
| 124 | 133 | INPUT_PORTS_END |
| 125 | 134 | |
| 126 | 135 | |
| r241726 | r241727 | |
| 177 | 186 | |
| 178 | 187 | ROM_START( simon ) |
| 179 | 188 | ROM_REGION( 0x0800, "maincpu", ROMREGION_ERASE00 ) |
| 180 | | ROM_LOAD( "simon.bin", 0x0000, 0x0400, CRC(9961719d) SHA1(35dddb018a8a2b31f377ab49c1f0cb76951b81c0) ) |
| 189 | ROM_LOAD( "tms1000.u1", 0x0000, 0x0400, CRC(9961719d) SHA1(35dddb018a8a2b31f377ab49c1f0cb76951b81c0) ) |
| 181 | 190 | ROM_END |
| 182 | 191 | |
| 183 | 192 | |
trunk/src/mess/layout/simon.lay
| r241726 | r241727 | |
| 93 | 93 | |
| 94 | 94 | <!-- big lamps --> |
| 95 | 95 | |
| 96 | | <bezel name="lamp0" element="lamp_g" inputtag="R.1" inputmask="0x01" > |
| 96 | <bezel name="lamp0" element="lamp_g" inputtag="IN.1" inputmask="0x01" > |
| 97 | 97 | <bounds left="0" right="91" top="0" bottom="50" /> |
| 98 | 98 | </bezel> |
| 99 | | <bezel name="lamp0" element="lamp_g" inputtag="R.1" inputmask="0x01" > |
| 99 | <bezel name="lamp0" element="lamp_g" inputtag="IN.1" inputmask="0x01" > |
| 100 | 100 | <bounds left="0" right="50" top="0" bottom="91" /> |
| 101 | 101 | </bezel> |
| 102 | | <bezel name="lamp0" element="lamp_g" inputtag="R.1" inputmask="0x01" > |
| 102 | <bezel name="lamp0" element="lamp_g" inputtag="IN.1" inputmask="0x01" > |
| 103 | 103 | <bounds x="40" y="40" width="20" height="20" /> |
| 104 | 104 | </bezel> |
| 105 | 105 | |
| 106 | | <bezel name="lamp1" element="lamp_r" inputtag="R.1" inputmask="0x02" > |
| 106 | <bezel name="lamp1" element="lamp_r" inputtag="IN.1" inputmask="0x02" > |
| 107 | 107 | <bounds left="109" right="200" top="0" bottom="50" /> |
| 108 | 108 | </bezel> |
| 109 | | <bezel name="lamp1" element="lamp_r" inputtag="R.1" inputmask="0x02" > |
| 109 | <bezel name="lamp1" element="lamp_r" inputtag="IN.1" inputmask="0x02" > |
| 110 | 110 | <bounds left="150" right="200" top="0" bottom="91" /> |
| 111 | 111 | </bezel> |
| 112 | | <bezel name="lamp1" element="lamp_r" inputtag="R.1" inputmask="0x02" > |
| 112 | <bezel name="lamp1" element="lamp_r" inputtag="IN.1" inputmask="0x02" > |
| 113 | 113 | <bounds x="140" y="40" width="20" height="20" /> |
| 114 | 114 | </bezel> |
| 115 | 115 | |
| 116 | | <bezel name="lamp2" element="lamp_y" inputtag="R.1" inputmask="0x04" > |
| 116 | <bezel name="lamp2" element="lamp_y" inputtag="IN.1" inputmask="0x04" > |
| 117 | 117 | <bounds left="0" right="91" top="150" bottom="200" /> |
| 118 | 118 | </bezel> |
| 119 | | <bezel name="lamp2" element="lamp_y" inputtag="R.1" inputmask="0x04" > |
| 119 | <bezel name="lamp2" element="lamp_y" inputtag="IN.1" inputmask="0x04" > |
| 120 | 120 | <bounds left="0" right="50" top="109" bottom="200" /> |
| 121 | 121 | </bezel> |
| 122 | | <bezel name="lamp2" element="lamp_y" inputtag="R.1" inputmask="0x04" > |
| 122 | <bezel name="lamp2" element="lamp_y" inputtag="IN.1" inputmask="0x04" > |
| 123 | 123 | <bounds x="40" y="140" width="20" height="20" /> |
| 124 | 124 | </bezel> |
| 125 | 125 | |
| 126 | | <bezel name="lamp3" element="lamp_b" inputtag="R.1" inputmask="0x08" > |
| 126 | <bezel name="lamp3" element="lamp_b" inputtag="IN.1" inputmask="0x08" > |
| 127 | 127 | <bounds left="109" right="200" top="150" bottom="200" /> |
| 128 | 128 | </bezel> |
| 129 | | <bezel name="lamp3" element="lamp_b" inputtag="R.1" inputmask="0x08" > |
| 129 | <bezel name="lamp3" element="lamp_b" inputtag="IN.1" inputmask="0x08" > |
| 130 | 130 | <bounds left="150" right="200" top="109" bottom="200" /> |
| 131 | 131 | </bezel> |
| 132 | | <bezel name="lamp3" element="lamp_b" inputtag="R.1" inputmask="0x08" > |
| 132 | <bezel name="lamp3" element="lamp_b" inputtag="IN.1" inputmask="0x08" > |
| 133 | 133 | <bounds x="140" y="140" width="20" height="20" /> |
| 134 | 134 | </bezel> |
| 135 | 135 | |
| r241726 | r241727 | |
| 157 | 157 | <bezel element="text_last"> |
| 158 | 158 | <bounds x="65" y="110" width="20" height="4" /> |
| 159 | 159 | </bezel> |
| 160 | | <bezel element="button_y" inputtag="R.2" inputmask="0x02"> |
| 160 | <bezel element="button_y" inputtag="IN.2" inputmask="0x02"> |
| 161 | 161 | <bounds x="71" y="115" width="8" height="8" /> |
| 162 | 162 | </bezel> |
| 163 | 163 | |
| 164 | 164 | <bezel element="text_start"> |
| 165 | 165 | <bounds x="90" y="110" width="20" height="4" /> |
| 166 | 166 | </bezel> |
| 167 | | <bezel element="button_r" inputtag="R.2" inputmask="0x01"> |
| 167 | <bezel element="button_r" inputtag="IN.2" inputmask="0x01"> |
| 168 | 168 | <bounds x="96" y="115" width="8" height="8" /> |
| 169 | 169 | </bezel> |
| 170 | 170 | |
| 171 | 171 | <bezel element="text_long"> |
| 172 | 172 | <bounds x="115" y="110" width="20" height="4" /> |
| 173 | 173 | </bezel> |
| 174 | | <bezel element="button_y" inputtag="R.2" inputmask="0x04"> |
| 174 | <bezel element="button_y" inputtag="IN.2" inputmask="0x04"> |
| 175 | 175 | <bounds x="121" y="115" width="8" height="8" /> |
| 176 | 176 | </bezel> |
| 177 | 177 | |