trunk/src/mame/layout/st_mp100.lay
| r31685 | r31686 | |
| 37 | 37 | |
| 38 | 38 | <!-- Player 1 Score --> |
| 39 | 39 | |
| 40 | | <bezel name="digit0" element="digit"> |
| 40 | <bezel name="digit5" element="digit"> |
| 41 | 41 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 42 | 42 | </bezel> |
| 43 | | <bezel name="digit5" element="digit"> |
| 43 | <bezel name="digit4" element="digit"> |
| 44 | 44 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 45 | 45 | </bezel> |
| 46 | | <bezel name="digit4" element="digit"> |
| 46 | <bezel name="digit3" element="digit"> |
| 47 | 47 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 48 | 48 | </bezel> |
| 49 | | <bezel name="digit3" element="digit"> |
| 49 | <bezel name="digit2" element="digit"> |
| 50 | 50 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 51 | 51 | </bezel> |
| 52 | | <bezel name="digit2" element="digit"> |
| 52 | <bezel name="digit1" element="digit"> |
| 53 | 53 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 54 | 54 | </bezel> |
| 55 | | <bezel name="digit1" element="digit"> |
| 55 | <bezel name="digit0" element="digit"> |
| 56 | 56 | <bounds left="230" top="45" right="264" bottom="84" /> |
| 57 | 57 | </bezel> |
| 58 | 58 | |
| 59 | 59 | <!-- Player 2 Score --> |
| 60 | | <bezel name="digit10" element="digit"> |
| 60 | <bezel name="digit15" element="digit"> |
| 61 | 61 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 62 | 62 | </bezel> |
| 63 | | <bezel name="digit15" element="digit"> |
| 63 | <bezel name="digit14" element="digit"> |
| 64 | 64 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 65 | 65 | </bezel> |
| 66 | | <bezel name="digit14" element="digit"> |
| 66 | <bezel name="digit13" element="digit"> |
| 67 | 67 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 68 | 68 | </bezel> |
| 69 | | <bezel name="digit13" element="digit"> |
| 69 | <bezel name="digit12" element="digit"> |
| 70 | 70 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 71 | 71 | </bezel> |
| 72 | | <bezel name="digit12" element="digit"> |
| 72 | <bezel name="digit11" element="digit"> |
| 73 | 73 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 74 | 74 | </bezel> |
| 75 | | <bezel name="digit11" element="digit"> |
| 75 | <bezel name="digit10" element="digit"> |
| 76 | 76 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 77 | 77 | </bezel> |
| 78 | 78 | |
| 79 | 79 | <!-- Player 3 Score --> |
| 80 | | <bezel name="digit20" element="digit"> |
| 80 | <bezel name="digit25" element="digit"> |
| 81 | 81 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 82 | 82 | </bezel> |
| 83 | | <bezel name="digit25" element="digit"> |
| 83 | <bezel name="digit24" element="digit"> |
| 84 | 84 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 85 | 85 | </bezel> |
| 86 | | <bezel name="digit24" element="digit"> |
| 86 | <bezel name="digit23" element="digit"> |
| 87 | 87 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 88 | 88 | </bezel> |
| 89 | | <bezel name="digit23" element="digit"> |
| 89 | <bezel name="digit22" element="digit"> |
| 90 | 90 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 91 | 91 | </bezel> |
| 92 | | <bezel name="digit22" element="digit"> |
| 92 | <bezel name="digit21" element="digit"> |
| 93 | 93 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 94 | 94 | </bezel> |
| 95 | | <bezel name="digit21" element="digit"> |
| 95 | <bezel name="digit20" element="digit"> |
| 96 | 96 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 97 | 97 | </bezel> |
| 98 | 98 | |
trunk/src/mame/layout/st_mp200.lay
| r31685 | r31686 | |
| 37 | 37 | |
| 38 | 38 | <!-- Player 1 Score --> |
| 39 | 39 | |
| 40 | | <bezel name="digit0" element="digit"> |
| 40 | <bezel name="digit6" element="digit"> |
| 41 | 41 | <bounds left="10" top="45" right="44" bottom="84" /> |
| 42 | 42 | </bezel> |
| 43 | | <bezel name="digit6" element="digit"> |
| 43 | <bezel name="digit5" element="digit"> |
| 44 | 44 | <bounds left="54" top="45" right="88" bottom="84" /> |
| 45 | 45 | </bezel> |
| 46 | | <bezel name="digit5" element="digit"> |
| 46 | <bezel name="digit4" element="digit"> |
| 47 | 47 | <bounds left="98" top="45" right="132" bottom="84" /> |
| 48 | 48 | </bezel> |
| 49 | | <bezel name="digit4" element="digit"> |
| 49 | <bezel name="digit3" element="digit"> |
| 50 | 50 | <bounds left="142" top="45" right="176" bottom="84" /> |
| 51 | 51 | </bezel> |
| 52 | | <bezel name="digit3" element="digit"> |
| 52 | <bezel name="digit2" element="digit"> |
| 53 | 53 | <bounds left="186" top="45" right="220" bottom="84" /> |
| 54 | 54 | </bezel> |
| 55 | | <bezel name="digit2" element="digit"> |
| 55 | <bezel name="digit1" element="digit"> |
| 56 | 56 | <bounds left="230" top="45" right="264" bottom="84" /> |
| 57 | 57 | </bezel> |
| 58 | | <bezel name="digit1" element="digit"> |
| 58 | <bezel name="digit0" element="digit"> |
| 59 | 59 | <bounds left="274" top="45" right="308" bottom="84" /> |
| 60 | 60 | </bezel> |
| 61 | 61 | |
| 62 | 62 | <!-- Player 2 Score --> |
| 63 | | <bezel name="digit10" element="digit"> |
| 63 | <bezel name="digit16" element="digit"> |
| 64 | 64 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 65 | 65 | </bezel> |
| 66 | | <bezel name="digit16" element="digit"> |
| 66 | <bezel name="digit15" element="digit"> |
| 67 | 67 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 68 | 68 | </bezel> |
| 69 | | <bezel name="digit15" element="digit"> |
| 69 | <bezel name="digit14" element="digit"> |
| 70 | 70 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 71 | 71 | </bezel> |
| 72 | | <bezel name="digit14" element="digit"> |
| 72 | <bezel name="digit13" element="digit"> |
| 73 | 73 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 74 | 74 | </bezel> |
| 75 | | <bezel name="digit13" element="digit"> |
| 75 | <bezel name="digit12" element="digit"> |
| 76 | 76 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 77 | 77 | </bezel> |
| 78 | | <bezel name="digit12" element="digit"> |
| 78 | <bezel name="digit11" element="digit"> |
| 79 | 79 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 80 | 80 | </bezel> |
| 81 | | <bezel name="digit11" element="digit"> |
| 81 | <bezel name="digit10" element="digit"> |
| 82 | 82 | <bounds left="274" top="105" right="308" bottom="144" /> |
| 83 | 83 | </bezel> |
| 84 | 84 | |
| 85 | 85 | <!-- Player 3 Score --> |
| 86 | | <bezel name="digit20" element="digit"> |
| 86 | <bezel name="digit26" element="digit"> |
| 87 | 87 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 88 | 88 | </bezel> |
| 89 | | <bezel name="digit26" element="digit"> |
| 89 | <bezel name="digit25" element="digit"> |
| 90 | 90 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 91 | 91 | </bezel> |
| 92 | | <bezel name="digit25" element="digit"> |
| 92 | <bezel name="digit24" element="digit"> |
| 93 | 93 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 94 | 94 | </bezel> |
| 95 | | <bezel name="digit24" element="digit"> |
| 95 | <bezel name="digit23" element="digit"> |
| 96 | 96 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 97 | 97 | </bezel> |
| 98 | | <bezel name="digit23" element="digit"> |
| 98 | <bezel name="digit22" element="digit"> |
| 99 | 99 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 100 | 100 | </bezel> |
| 101 | | <bezel name="digit22" element="digit"> |
| 101 | <bezel name="digit21" element="digit"> |
| 102 | 102 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 103 | 103 | </bezel> |
| 104 | | <bezel name="digit21" element="digit"> |
| 104 | <bezel name="digit20" element="digit"> |
| 105 | 105 | <bounds left="274" top="165" right="308" bottom="204" /> |
| 106 | 106 | </bezel> |
| 107 | 107 | |
trunk/src/mame/layout/by17.lay
| r31685 | r31686 | |
| 57 | 57 | </bezel> |
| 58 | 58 | |
| 59 | 59 | <!-- Player 2 Score --> |
| 60 | | <bezel name="digit13" element="digit"> |
| 60 | <bezel name="digit15" element="digit"> |
| 61 | 61 | <bounds left="10" top="105" right="44" bottom="144" /> |
| 62 | 62 | </bezel> |
| 63 | | <bezel name="digit12" element="digit"> |
| 63 | <bezel name="digit14" element="digit"> |
| 64 | 64 | <bounds left="54" top="105" right="88" bottom="144" /> |
| 65 | 65 | </bezel> |
| 66 | | <bezel name="digit11" element="digit"> |
| 66 | <bezel name="digit13" element="digit"> |
| 67 | 67 | <bounds left="98" top="105" right="132" bottom="144" /> |
| 68 | 68 | </bezel> |
| 69 | | <bezel name="digit10" element="digit"> |
| 69 | <bezel name="digit12" element="digit"> |
| 70 | 70 | <bounds left="142" top="105" right="176" bottom="144" /> |
| 71 | 71 | </bezel> |
| 72 | | <bezel name="digit9" element="digit"> |
| 72 | <bezel name="digit11" element="digit"> |
| 73 | 73 | <bounds left="186" top="105" right="220" bottom="144" /> |
| 74 | 74 | </bezel> |
| 75 | | <bezel name="digit8" element="digit"> |
| 75 | <bezel name="digit10" element="digit"> |
| 76 | 76 | <bounds left="230" top="105" right="264" bottom="144" /> |
| 77 | 77 | </bezel> |
| 78 | 78 | |
| 79 | 79 | <!-- Player 3 Score --> |
| 80 | | <bezel name="digit21" element="digit"> |
| 80 | <bezel name="digit25" element="digit"> |
| 81 | 81 | <bounds left="10" top="165" right="44" bottom="204" /> |
| 82 | 82 | </bezel> |
| 83 | | <bezel name="digit20" element="digit"> |
| 83 | <bezel name="digit24" element="digit"> |
| 84 | 84 | <bounds left="54" top="165" right="88" bottom="204" /> |
| 85 | 85 | </bezel> |
| 86 | | <bezel name="digit19" element="digit"> |
| 86 | <bezel name="digit23" element="digit"> |
| 87 | 87 | <bounds left="98" top="165" right="132" bottom="204" /> |
| 88 | 88 | </bezel> |
| 89 | | <bezel name="digit18" element="digit"> |
| 89 | <bezel name="digit22" element="digit"> |
| 90 | 90 | <bounds left="142" top="165" right="176" bottom="204" /> |
| 91 | 91 | </bezel> |
| 92 | | <bezel name="digit17" element="digit"> |
| 92 | <bezel name="digit21" element="digit"> |
| 93 | 93 | <bounds left="186" top="165" right="220" bottom="204" /> |
| 94 | 94 | </bezel> |
| 95 | | <bezel name="digit16" element="digit"> |
| 95 | <bezel name="digit20" element="digit"> |
| 96 | 96 | <bounds left="230" top="165" right="264" bottom="204" /> |
| 97 | 97 | </bezel> |
| 98 | 98 | |
| 99 | 99 | <!-- Player 4 Score --> |
| 100 | | <bezel name="digit28" element="digit"> |
| 100 | <bezel name="digit35" element="digit"> |
| 101 | 101 | <bounds left="10" top="225" right="44" bottom="264" /> |
| 102 | 102 | </bezel> |
| 103 | | <bezel name="digit27" element="digit"> |
| 103 | <bezel name="digit34" element="digit"> |
| 104 | 104 | <bounds left="54" top="225" right="88" bottom="264" /> |
| 105 | 105 | </bezel> |
| 106 | | <bezel name="digit26" element="digit"> |
| 106 | <bezel name="digit33" element="digit"> |
| 107 | 107 | <bounds left="98" top="225" right="132" bottom="264" /> |
| 108 | 108 | </bezel> |
| 109 | | <bezel name="digit25" element="digit"> |
| 109 | <bezel name="digit32" element="digit"> |
| 110 | 110 | <bounds left="142" top="225" right="176" bottom="264" /> |
| 111 | 111 | </bezel> |
| 112 | | <bezel name="digit24" element="digit"> |
| 112 | <bezel name="digit31" element="digit"> |
| 113 | 113 | <bounds left="186" top="225" right="220" bottom="264" /> |
| 114 | 114 | </bezel> |
| 115 | | <bezel name="digit29" element="digit"> |
| 115 | <bezel name="digit30" element="digit"> |
| 116 | 116 | <bounds left="230" top="225" right="264" bottom="264" /> |
| 117 | 117 | </bezel> |
| 118 | 118 | |
| 119 | 119 | <!-- Credits and Balls --> |
| 120 | | <bezel name="digit35" element="digit"> |
| 120 | <bezel name="digit44" element="digit"> |
| 121 | 121 | <bounds left="10" top="345" right="44" bottom="384" /> |
| 122 | 122 | </bezel> |
| 123 | | <bezel name="digit34" element="digit"> |
| 123 | <bezel name="digit43" element="digit"> |
| 124 | 124 | <bounds left="54" top="345" right="88" bottom="384" /> |
| 125 | 125 | </bezel> |
| 126 | | <bezel name="digit32" element="digit"> |
| 126 | <bezel name="digit41" element="digit"> |
| 127 | 127 | <bounds left="186" top="345" right="220" bottom="384" /> |
| 128 | 128 | </bezel> |
| 129 | | <bezel name="digit37" element="digit"> |
| 129 | <bezel name="digit40" element="digit"> |
| 130 | 130 | <bounds left="230" top="345" right="264" bottom="384" /> |
| 131 | 131 | </bezel> |
| 132 | 132 | |
trunk/src/mame/drivers/hankin.c
| r31685 | r31686 | |
| 7 | 7 | |
| 8 | 8 | ToDo: |
| 9 | 9 | - High score isn't saved or remembered |
| 10 | | - Display should be flouro blue 9-segment |
| 10 | - Display should be flouro blue 12-segment |
| 11 | 11 | - Sound |
| 12 | 12 | - Mechanical |
| 13 | 13 | |
| r31685 | r31686 | |
| 52 | 52 | TIMER_DEVICE_CALLBACK_MEMBER(timer_x); |
| 53 | 53 | private: |
| 54 | 54 | bool m_timer_x; |
| 55 | UINT8 m_ic10a; |
| 56 | UINT8 m_ic11a; |
| 55 | 57 | bool m_ic11_ca2; |
| 56 | 58 | bool m_ic10_cb2; |
| 57 | 59 | UINT8 m_counter; |
| 58 | 60 | UINT8 m_digit; |
| 59 | | UINT8 m_segment; |
| 60 | | UINT8 m_ic10a; |
| 61 | | UINT8 m_ic11a; |
| 61 | UINT8 m_segment[5]; |
| 62 | 62 | virtual void machine_reset(); |
| 63 | 63 | required_device<m6802_cpu_device> m_maincpu; |
| 64 | 64 | required_device<m6802_cpu_device> m_audiocpu; |
| r31685 | r31686 | |
| 254 | 254 | if BIT(data, 7) |
| 255 | 255 | m_digit = 0; |
| 256 | 256 | |
| 257 | | m_counter++; |
| 257 | if (BIT(data, 0) && (m_counter > 8)) |
| 258 | { |
| 259 | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 260 | output_set_digit_value(m_digit, patterns[m_segment[0]]); |
| 261 | output_set_digit_value(10+m_digit, patterns[m_segment[1]]); |
| 262 | output_set_digit_value(20+m_digit, patterns[m_segment[2]]); |
| 263 | output_set_digit_value(30+m_digit, patterns[m_segment[3]]); |
| 264 | output_set_digit_value(40+m_digit, patterns[m_segment[4]]); |
| 265 | } |
| 258 | 266 | } |
| 259 | 267 | } |
| 260 | 268 | |
| r31685 | r31686 | |
| 298 | 306 | |
| 299 | 307 | WRITE8_MEMBER( hankin_state::ic11_a_w ) |
| 300 | 308 | { |
| 301 | | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 302 | 309 | m_ic11a = data; |
| 303 | 310 | |
| 304 | 311 | if (!m_ic11_ca2) |
| 305 | 312 | { |
| 306 | | if (m_counter==3) |
| 307 | | output_set_digit_value(m_digit, patterns[m_segment]); |
| 308 | | |
| 309 | 313 | m_counter++; |
| 310 | | m_segment = data >> 4; |
| 311 | 314 | |
| 312 | | if (m_counter==4) |
| 313 | | output_set_digit_value(10+m_digit, patterns[m_segment]); |
| 315 | if (m_counter==1) |
| 316 | m_segment[0] = data>>4; |
| 314 | 317 | else |
| 315 | | if (m_counter==6) |
| 316 | | output_set_digit_value(20+m_digit, patterns[m_segment]); |
| 318 | if (m_counter==3) |
| 319 | m_segment[1] = data>>4; |
| 317 | 320 | else |
| 318 | | if (m_counter==8) |
| 319 | | output_set_digit_value(30+m_digit, patterns[m_segment]); |
| 321 | if (m_counter==5) |
| 322 | m_segment[2] = data>>4; |
| 320 | 323 | else |
| 321 | | if (m_counter==10) |
| 322 | | output_set_digit_value(40+m_digit, patterns[m_segment]); |
| 324 | if (m_counter==7) |
| 325 | m_segment[3] = data>>4; |
| 326 | else |
| 327 | if (m_counter==9) |
| 328 | m_segment[4] = data>>4; |
| 323 | 329 | } |
| 324 | 330 | } |
| 325 | 331 | |
trunk/src/mame/drivers/st_mp200.c
| r31685 | r31686 | |
| 72 | 72 | bool m_timer_x; |
| 73 | 73 | bool m_u11_timer; |
| 74 | 74 | bool m_su; // speech unit fitted yes/no |
| 75 | | bool m_6d; // 6-digit display yes/no |
| 75 | bool m_7d; // 7-digit display yes/no |
| 76 | 76 | UINT8 m_digit; |
| 77 | 77 | UINT8 m_counter; |
| 78 | UINT8 m_segment[5]; |
| 78 | 79 | virtual void machine_reset(); |
| 79 | 80 | required_device<m6800_cpu_device> m_maincpu; |
| 80 | 81 | optional_device<s14001a_device> m_s14001a; |
| r31685 | r31686 | |
| 362 | 363 | |
| 363 | 364 | WRITE8_MEMBER( st_mp200_state::u10_a_w ) |
| 364 | 365 | { |
| 365 | | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 366 | 366 | m_u10a = data; |
| 367 | 367 | |
| 368 | 368 | if (!m_u10_ca2) |
| 369 | 369 | { |
| 370 | 370 | m_counter++; |
| 371 | | UINT8 segment = data >> 4; |
| 372 | 371 | |
| 373 | | if (m_6d && !m_digit && (m_counter < 6)) |
| 374 | | m_digit = 6; // handle 6-digit display |
| 375 | | |
| 376 | 372 | if (m_counter==1) |
| 377 | | output_set_digit_value(m_digit, patterns[segment]); |
| 373 | m_segment[0] = data>>4; |
| 378 | 374 | else |
| 379 | 375 | if (m_counter==3) |
| 380 | | output_set_digit_value(10+m_digit, patterns[segment]); |
| 376 | m_segment[1] = data>>4; |
| 381 | 377 | else |
| 382 | 378 | if (m_counter==5) |
| 383 | | output_set_digit_value(20+m_digit, patterns[segment]); |
| 379 | m_segment[2] = data>>4; |
| 384 | 380 | else |
| 385 | | if (m_counter==8) |
| 386 | | output_set_digit_value(30+m_digit, patterns[segment]); |
| 381 | if (m_counter==7) |
| 382 | m_segment[3] = data>>4; |
| 387 | 383 | else |
| 388 | | if (m_counter==10) |
| 389 | | output_set_digit_value(40+m_digit, patterns[segment]); |
| 384 | if (m_counter==9) |
| 385 | m_segment[4] = data>>4; |
| 390 | 386 | } |
| 391 | 387 | } |
| 392 | 388 | |
| r31685 | r31686 | |
| 440 | 436 | |
| 441 | 437 | if (!m_u10_ca2) |
| 442 | 438 | { |
| 443 | | if BIT(data, 1) |
| 439 | if (m_7d & BIT(data, 1)) |
| 444 | 440 | m_digit = 6; |
| 445 | 441 | else |
| 446 | 442 | if BIT(data, 2) |
| r31685 | r31686 | |
| 461 | 457 | if BIT(data, 7) |
| 462 | 458 | m_digit = 0; |
| 463 | 459 | |
| 464 | | m_counter++; |
| 460 | if (BIT(data, 0) && (m_counter > 8)) |
| 461 | { |
| 462 | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 463 | output_set_digit_value(m_digit, patterns[m_segment[0]]); |
| 464 | output_set_digit_value(10+m_digit, patterns[m_segment[1]]); |
| 465 | output_set_digit_value(20+m_digit, patterns[m_segment[2]]); |
| 466 | output_set_digit_value(30+m_digit, patterns[m_segment[3]]); |
| 467 | output_set_digit_value(40+m_digit, patterns[m_segment[4]]); |
| 468 | } |
| 465 | 469 | } |
| 466 | 470 | } |
| 467 | 471 | |
| r31685 | r31686 | |
| 531 | 535 | |
| 532 | 536 | DRIVER_INIT_MEMBER( st_mp200_state, st_mp200 ) |
| 533 | 537 | { |
| 534 | | m_6d = 0; |
| 538 | m_7d = 1; |
| 535 | 539 | m_su = 0; |
| 536 | 540 | } |
| 537 | 541 | |
| 538 | 542 | DRIVER_INIT_MEMBER( st_mp200_state, st_mp201 ) |
| 539 | 543 | { |
| 540 | | m_6d = 0; |
| 544 | m_7d = 1; |
| 541 | 545 | m_su = 1; |
| 542 | 546 | } |
| 543 | 547 | |
| 544 | 548 | DRIVER_INIT_MEMBER( st_mp200_state, st_mp202 ) |
| 545 | 549 | { |
| 546 | | m_6d = 1; |
| 550 | m_7d = 0; |
| 547 | 551 | m_su = 0; |
| 548 | 552 | } |
| 549 | 553 | |
trunk/src/mame/drivers/by17.c
| r31685 | r31686 | |
| 42 | 42 | , m_io_x4(*this, "X4") |
| 43 | 43 | { } |
| 44 | 44 | |
| 45 | | DECLARE_DRIVER_INIT(by17); |
| 46 | 45 | DECLARE_READ8_MEMBER(u10_a_r); |
| 47 | 46 | DECLARE_WRITE8_MEMBER(u10_a_w); |
| 48 | 47 | DECLARE_READ8_MEMBER(u10_b_r); |
| r31685 | r31686 | |
| 56 | 55 | DECLARE_WRITE_LINE_MEMBER(u11_cb2_w); |
| 57 | 56 | DECLARE_INPUT_CHANGED_MEMBER(activity_test); |
| 58 | 57 | DECLARE_INPUT_CHANGED_MEMBER(self_test); |
| 59 | | TIMER_DEVICE_CALLBACK_MEMBER(u10_timer); |
| 58 | TIMER_DEVICE_CALLBACK_MEMBER(timer_x); |
| 60 | 59 | TIMER_DEVICE_CALLBACK_MEMBER(u11_timer); |
| 61 | 60 | private: |
| 62 | | UINT8 m_u10; |
| 63 | | UINT8 m_u10_a; |
| 64 | | UINT8 m_u10_b; |
| 65 | | UINT8 m_u11_a; |
| 66 | | UINT8 m_u11_b; |
| 61 | UINT8 m_u10a; |
| 62 | UINT8 m_u10b; |
| 63 | UINT8 m_u11a; |
| 64 | UINT8 m_u11b; |
| 67 | 65 | bool m_u10_ca2; |
| 68 | 66 | bool m_u10_cb2; |
| 69 | | bool m_u10_timer; |
| 67 | bool m_u11_cb2; |
| 68 | bool m_timer_x; |
| 70 | 69 | bool m_u11_timer; |
| 71 | 70 | UINT8 m_digit; |
| 72 | | UINT8 m_segment; |
| 71 | UINT8 m_counter; |
| 72 | UINT8 m_segment[5]; |
| 73 | 73 | virtual void machine_reset(); |
| 74 | 74 | required_device<m6800_cpu_device> m_maincpu; |
| 75 | 75 | required_device<pia6821_device> m_pia_u10; |
| r31685 | r31686 | |
| 308 | 308 | WRITE_LINE_MEMBER( by17_state::u10_ca2_w ) |
| 309 | 309 | { |
| 310 | 310 | m_u10_ca2 = state; |
| 311 | if (!state) |
| 312 | m_counter = 0; |
| 311 | 313 | } |
| 312 | | |
| 314 | |
| 313 | 315 | WRITE_LINE_MEMBER( by17_state::u10_cb2_w ) |
| 314 | 316 | { |
| 315 | 317 | } |
| r31685 | r31686 | |
| 321 | 323 | |
| 322 | 324 | WRITE_LINE_MEMBER( by17_state::u11_cb2_w ) |
| 323 | 325 | { |
| 326 | m_u11_cb2 = state; |
| 324 | 327 | } |
| 325 | 328 | |
| 326 | 329 | READ8_MEMBER( by17_state::u10_a_r ) |
| 327 | 330 | { |
| 328 | | return m_u10_a; |
| 331 | return m_u10a; |
| 329 | 332 | } |
| 330 | 333 | |
| 331 | 334 | WRITE8_MEMBER( by17_state::u10_a_w ) |
| 332 | 335 | { |
| 333 | | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 334 | | m_segment = data >> 4; |
| 335 | | m_u10_a = data; |
| 336 | | m_u10 = (data & 15) | (BIT(m_u11_a, 0) << 4); |
| 336 | m_u10a = data; |
| 337 | 337 | |
| 338 | 338 | if (!m_u10_ca2) |
| 339 | 339 | { |
| 340 | | if (!BIT(m_u10, 0)) |
| 341 | | output_set_digit_value(m_digit, patterns[m_segment]); |
| 340 | m_counter++; |
| 341 | |
| 342 | if (m_counter==1) |
| 343 | m_segment[0] = data>>4; |
| 342 | 344 | else |
| 343 | | if (m_u10==0x1d) |
| 344 | | output_set_digit_value(8+m_digit, patterns[m_segment]); |
| 345 | if (m_counter==3) |
| 346 | m_segment[1] = data>>4; |
| 345 | 347 | else |
| 346 | | if (m_u10==0x1b) |
| 347 | | output_set_digit_value(16+m_digit, patterns[m_segment]); |
| 348 | if (m_counter==5) |
| 349 | m_segment[2] = data>>4; |
| 348 | 350 | else |
| 349 | | if (m_u10==0x07) |
| 350 | | output_set_digit_value(24+m_digit, patterns[m_segment]); |
| 351 | if (m_counter==7) |
| 352 | m_segment[3] = data>>4; |
| 351 | 353 | else |
| 352 | | if (!BIT(m_u10, 4)) |
| 353 | | output_set_digit_value(32+m_digit, patterns[m_segment]); |
| 354 | if (m_counter==9) |
| 355 | m_segment[4] = data>>4; |
| 354 | 356 | } |
| 355 | 357 | } |
| 356 | 358 | |
| r31685 | r31686 | |
| 358 | 360 | { |
| 359 | 361 | UINT8 data = 0; |
| 360 | 362 | |
| 361 | | if (BIT(m_u10_a, 0)) |
| 363 | if (BIT(m_u10a, 0)) |
| 362 | 364 | data |= m_io_x0->read(); |
| 363 | 365 | |
| 364 | | if (BIT(m_u10_a, 1)) |
| 366 | if (BIT(m_u10a, 1)) |
| 365 | 367 | data |= m_io_x1->read(); |
| 366 | 368 | |
| 367 | | if (BIT(m_u10_a, 2)) |
| 369 | if (BIT(m_u10a, 2)) |
| 368 | 370 | data |= m_io_x2->read(); |
| 369 | 371 | |
| 370 | | if (BIT(m_u10_a, 3)) |
| 372 | if (BIT(m_u10a, 3)) |
| 371 | 373 | data |= m_io_x3->read(); |
| 372 | 374 | |
| 373 | | if (BIT(m_u10_a, 4)) |
| 375 | if (BIT(m_u10a, 4)) |
| 374 | 376 | data |= m_io_x4->read(); |
| 375 | 377 | |
| 376 | | if (BIT(m_u10_a, 5)) |
| 378 | if (BIT(m_u10a, 5)) |
| 377 | 379 | data |= m_io_dsw0->read(); |
| 378 | 380 | |
| 379 | | if (BIT(m_u10_a, 6)) |
| 381 | if (BIT(m_u10a, 6)) |
| 380 | 382 | data |= m_io_dsw1->read(); |
| 381 | 383 | |
| 382 | | if (BIT(m_u10_a, 7)) |
| 384 | if (BIT(m_u10a, 7)) |
| 383 | 385 | data |= m_io_dsw2->read(); |
| 384 | 386 | |
| 385 | 387 | if (m_u10_cb2) |
| r31685 | r31686 | |
| 390 | 392 | |
| 391 | 393 | WRITE8_MEMBER( by17_state::u10_b_w ) |
| 392 | 394 | { |
| 393 | | m_u10_b = data; |
| 395 | m_u10b = data; |
| 394 | 396 | } |
| 395 | 397 | |
| 396 | 398 | READ8_MEMBER( by17_state::u11_a_r ) |
| 397 | 399 | { |
| 398 | | return m_u11_a; |
| 400 | return m_u11a; |
| 399 | 401 | } |
| 400 | 402 | |
| 401 | 403 | WRITE8_MEMBER( by17_state::u11_a_w ) |
| 402 | 404 | { |
| 403 | | m_u11_a = data; |
| 405 | m_u11a = data; |
| 404 | 406 | |
| 405 | | m_digit = 0xff; |
| 406 | | if BIT(data, 2) |
| 407 | | m_digit = 4; |
| 408 | | else |
| 409 | | if BIT(data, 3) |
| 410 | | m_digit = 3; |
| 411 | | else |
| 412 | | if BIT(data, 4) |
| 413 | | m_digit = 2; |
| 414 | | else |
| 415 | | if BIT(data, 5) |
| 416 | | m_digit = 1; |
| 417 | | else |
| 418 | | if BIT(data, 6) |
| 419 | | m_digit = 0; |
| 420 | | else |
| 421 | | if BIT(data, 7) |
| 422 | | m_digit = 5; |
| 407 | if (!m_u10_ca2) |
| 408 | { |
| 409 | if BIT(data, 2) |
| 410 | m_digit = 5; |
| 411 | else |
| 412 | if BIT(data, 3) |
| 413 | m_digit = 4; |
| 414 | else |
| 415 | if BIT(data, 4) |
| 416 | m_digit = 3; |
| 417 | else |
| 418 | if BIT(data, 5) |
| 419 | m_digit = 2; |
| 420 | else |
| 421 | if BIT(data, 6) |
| 422 | m_digit = 1; |
| 423 | else |
| 424 | if BIT(data, 7) |
| 425 | m_digit = 0; |
| 426 | |
| 427 | if (BIT(data, 0) && (m_counter > 8)) |
| 428 | { |
| 429 | static const UINT8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0,0,0,0,0,0 }; // MC14543 |
| 430 | output_set_digit_value(m_digit, patterns[m_segment[0]]); |
| 431 | output_set_digit_value(10+m_digit, patterns[m_segment[1]]); |
| 432 | output_set_digit_value(20+m_digit, patterns[m_segment[2]]); |
| 433 | output_set_digit_value(30+m_digit, patterns[m_segment[3]]); |
| 434 | output_set_digit_value(40+m_digit, patterns[m_segment[4]]); |
| 435 | } |
| 436 | } |
| 423 | 437 | } |
| 424 | 438 | |
| 425 | 439 | WRITE8_MEMBER( by17_state::u11_b_w ) |
| 426 | 440 | { |
| 427 | | m_u11_b = data; |
| 428 | | switch (data & 15) |
| 441 | m_u11b = data; |
| 442 | if (!m_u11_cb2) |
| 429 | 443 | { |
| 430 | | case 0x0: // chime 10 |
| 431 | | m_samples->start(1, 1); |
| 432 | | break; |
| 433 | | case 0x1: // chime 100 |
| 434 | | m_samples->start(2, 2); |
| 435 | | break; |
| 436 | | case 0x2: // chime 1000 |
| 437 | | m_samples->start(3, 3); |
| 438 | | break; |
| 439 | | case 0x3: // chime 10000 |
| 440 | | m_samples->start(0, 4); |
| 441 | | break; |
| 442 | | case 0x4: |
| 443 | | break; |
| 444 | | case 0x5: // knocker |
| 445 | | m_samples->start(0, 6); |
| 446 | | break; |
| 447 | | case 0x6: // outhole |
| 448 | | m_samples->start(0, 5); |
| 449 | | break; |
| 450 | | // from here, vary per game |
| 451 | | case 0x7: |
| 452 | | case 0x8: |
| 453 | | case 0x9: |
| 454 | | break; |
| 455 | | case 0xa: |
| 456 | | case 0xb: |
| 457 | | case 0xc: // bumpers |
| 458 | | m_samples->start(0, 0); |
| 459 | | break; |
| 460 | | case 0xd: |
| 461 | | case 0xe: |
| 462 | | case 0xf: |
| 463 | | break; |
| 444 | switch (data & 15) |
| 445 | { |
| 446 | case 0x0: // chime 10 |
| 447 | m_samples->start(1, 1); |
| 448 | break; |
| 449 | case 0x1: // chime 100 |
| 450 | m_samples->start(2, 2); |
| 451 | break; |
| 452 | case 0x2: // chime 1000 |
| 453 | m_samples->start(3, 3); |
| 454 | break; |
| 455 | case 0x3: // chime 10000 |
| 456 | m_samples->start(0, 4); |
| 457 | break; |
| 458 | case 0x4: |
| 459 | break; |
| 460 | case 0x5: // knocker |
| 461 | m_samples->start(0, 6); |
| 462 | break; |
| 463 | case 0x6: // outhole |
| 464 | m_samples->start(0, 5); |
| 465 | break; |
| 466 | // from here, vary per game |
| 467 | case 0x7: |
| 468 | case 0x8: |
| 469 | case 0x9: |
| 470 | break; |
| 471 | case 0xa: |
| 472 | case 0xb: |
| 473 | case 0xc: // bumpers |
| 474 | m_samples->start(0, 0); |
| 475 | break; |
| 476 | case 0xd: |
| 477 | case 0xe: |
| 478 | case 0xf: |
| 479 | break; |
| 480 | } |
| 464 | 481 | } |
| 465 | 482 | } |
| 466 | 483 | |
| 467 | 484 | void by17_state::machine_reset() |
| 468 | 485 | { |
| 469 | | m_u10_a = 0; |
| 470 | | m_u10_b = 0; |
| 486 | m_u10a = 0; |
| 487 | m_u10b = 0; |
| 471 | 488 | m_u10_cb2 = 0; |
| 472 | | m_u11_a = 0; |
| 473 | | m_u11_b = 0; |
| 474 | | m_u10_timer = 0; |
| 489 | m_u11a = 0; |
| 490 | m_u11b = 0; |
| 491 | m_timer_x = 0; |
| 475 | 492 | m_u11_timer = 0; |
| 476 | 493 | } |
| 477 | 494 | |
| 478 | | DRIVER_INIT_MEMBER( by17_state, by17 ) |
| 479 | | { |
| 480 | | } |
| 481 | | |
| 482 | 495 | // zero-cross detection |
| 483 | | TIMER_DEVICE_CALLBACK_MEMBER( by17_state::u10_timer ) |
| 496 | TIMER_DEVICE_CALLBACK_MEMBER( by17_state::timer_x ) |
| 484 | 497 | { |
| 485 | | m_u10_timer ^= 1; |
| 486 | | m_pia_u10->cb1_w(m_u10_timer); |
| 498 | m_timer_x ^= 1; |
| 499 | m_pia_u10->cb1_w(m_timer_x); |
| 487 | 500 | } |
| 488 | 501 | |
| 489 | 502 | // 555 timer for display refresh |
| r31685 | r31686 | |
| 516 | 529 | MCFG_PIA_CB2_HANDLER(WRITELINE(by17_state, u10_cb2_w)) |
| 517 | 530 | MCFG_PIA_IRQA_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line)) |
| 518 | 531 | MCFG_PIA_IRQB_HANDLER(DEVWRITELINE("maincpu", m6800_cpu_device, irq_line)) |
| 519 | | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_z", by17_state, u10_timer, attotime::from_hz(120)) // mains freq*2 |
| 532 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_x", by17_state, timer_x, attotime::from_hz(120)) // mains freq*2 |
| 520 | 533 | |
| 521 | 534 | MCFG_DEVICE_ADD("pia_u11", PIA6821, 0) |
| 522 | 535 | MCFG_PIA_READPA_HANDLER(READ8(by17_state, u11_a_r)) |
| r31685 | r31686 | |
| 627 | 640 | /---------------------------------------------------------------*/ |
| 628 | 641 | |
| 629 | 642 | |
| 630 | | GAME( 1976, bowarrow, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Bow & Arrow (Prototype)", GAME_IS_SKELETON_MECHANICAL) |
| 631 | | GAME( 1977, freedom, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Freedom", GAME_MECHANICAL) |
| 632 | | GAME( 1977, nightrdr, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Night Rider (rev. 21)", GAME_MECHANICAL) |
| 633 | | GAME( 1977, nightr20, nightrdr, by17, by17, by17_state, by17, ROT0, "Bally", "Night Rider (rev. 20)", GAME_MECHANICAL) |
| 634 | | GAME( 1978, blackjck, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Black Jack (Pinball)", GAME_MECHANICAL) |
| 635 | | GAME( 1977, evelknie, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Evel Knievel", GAME_MECHANICAL) |
| 636 | | GAME( 1978, matahari, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Mata Hari", GAME_MECHANICAL) |
| 637 | | GAME( 1977, eightbll, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Eight Ball", GAME_MECHANICAL) |
| 638 | | GAME( 1978, pwerplay, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Power Play (Pinball)", GAME_MECHANICAL) |
| 639 | | GAME( 1978, stk_sprs, 0, by17, by17, by17_state, by17, ROT0, "Bally", "Strikes and Spares", GAME_MECHANICAL) |
| 643 | GAME( 1976, bowarrow, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Bow & Arrow (Prototype)", GAME_IS_SKELETON_MECHANICAL) |
| 644 | GAME( 1977, freedom, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Freedom", GAME_MECHANICAL) |
| 645 | GAME( 1977, nightrdr, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Night Rider (rev. 21)", GAME_MECHANICAL) |
| 646 | GAME( 1977, nightr20, nightrdr, by17, by17, driver_device, 0, ROT0, "Bally", "Night Rider (rev. 20)", GAME_MECHANICAL) |
| 647 | GAME( 1978, blackjck, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Black Jack (Pinball)", GAME_MECHANICAL) |
| 648 | GAME( 1977, evelknie, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Evel Knievel", GAME_MECHANICAL) |
| 649 | GAME( 1978, matahari, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Mata Hari", GAME_MECHANICAL) |
| 650 | GAME( 1977, eightbll, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Eight Ball", GAME_MECHANICAL) |
| 651 | GAME( 1978, pwerplay, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Power Play (Pinball)", GAME_MECHANICAL) |
| 652 | GAME( 1978, stk_sprs, 0, by17, by17, driver_device, 0, ROT0, "Bally", "Strikes and Spares", GAME_MECHANICAL) |