trunk/src/emu/sound/samples.h
| r31905 | r31906 | |
| 18 | 18 | // INTERFACE CONFIGURATION MACROS |
| 19 | 19 | //************************************************************************** |
| 20 | 20 | |
| 21 | | #define MCFG_SAMPLES_ADD(_tag, _interface) \ |
| 22 | | MCFG_DEVICE_ADD(_tag, SAMPLES, 0) \ |
| 23 | | samples_device::static_set_interface(*device, _interface); |
| 21 | #define MCFG_SAMPLES_CHANNELS(_channels) \ |
| 22 | samples_device::static_set_channels(*device, _channels); |
| 24 | 23 | |
| 25 | | #define MCFG_SAMPLES_REPLACE(_tag, _interface) \ |
| 26 | | MCFG_DEVICE_REPLACE(_tag, SAMPLES, 0) \ |
| 27 | | samples_device::static_set_interface(*device, _interface); |
| 24 | #define MCFG_SAMPLES_NAMES(_names) \ |
| 25 | samples_device::static_set_samples_names(*device, _names); |
| 26 | |
| 27 | typedef device_delegate<void ()> samples_start_cb_delegate; |
| 28 | 28 | |
| 29 | #define SAMPLES_START_CB_MEMBER(_name) void _name() |
| 30 | |
| 31 | #define MCFG_SAMPLES_START_CB(_class, _method) \ |
| 32 | samples_device::set_samples_start_callback(*device, samples_start_cb_delegate(&_class::_method, #_class "::" #_method, downcast<_class *>(owner))); |
| 29 | 33 | |
| 30 | | #define SAMPLES_START(name) void name(samples_device &device) |
| 31 | | |
| 32 | | |
| 33 | | |
| 34 | 34 | //************************************************************************** |
| 35 | 35 | // TYPE DEFINITIONS |
| 36 | 36 | //************************************************************************** |
| 37 | 37 | |
| 38 | | class samples_device; |
| 39 | | |
| 40 | | |
| 41 | | // ======================> samples_interface sample |
| 42 | | |
| 43 | | struct samples_interface |
| 44 | | { |
| 45 | | UINT8 m_channels; // number of discrete audio channels needed |
| 46 | | const char *const *m_names; // array of sample names |
| 47 | | void (*m_start)(samples_device &device); // optional callback |
| 48 | | }; |
| 49 | | |
| 50 | | |
| 51 | 38 | // ======================> samples_device |
| 52 | 39 | |
| 53 | 40 | class samples_device : public device_t, |
| 54 | | public device_sound_interface, |
| 55 | | public samples_interface |
| 41 | public device_sound_interface |
| 56 | 42 | { |
| 57 | 43 | public: |
| 58 | 44 | // construction/destruction |
| 59 | 45 | samples_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 60 | 46 | |
| 61 | 47 | // static configuration helpers |
| 62 | | static void static_set_interface(device_t &device, const samples_interface &interface); |
| 48 | static void static_set_channels(device_t &device, UINT8 channels) { downcast<samples_device &>(device).m_channels = channels; } |
| 49 | static void static_set_samples_names(device_t &device, const char *const *names) { downcast<samples_device &>(device).m_names = names; } |
| 50 | static void set_samples_start_callback(device_t &device, samples_start_cb_delegate callback) { downcast<samples_device &>(device).m_samples_start_cb = callback; } |
| 63 | 51 | |
| 64 | 52 | // getters |
| 65 | 53 | bool playing(UINT8 channel) const; |
| r31905 | r31906 | |
| 86 | 74 | dynamic_array<INT16> data; // 16-bit signed data |
| 87 | 75 | }; |
| 88 | 76 | static bool read_sample(emu_file &file, sample_t &sample); |
| 77 | |
| 78 | // interface |
| 79 | UINT8 m_channels; // number of discrete audio channels needed |
| 80 | const char *const *m_names; // array of sample names |
| 81 | samples_start_cb_delegate m_samples_start_cb; // optional callback |
| 89 | 82 | |
| 90 | 83 | protected: |
| 91 | 84 | // subclasses can do it this way |
| r31905 | r31906 | |
| 140 | 133 | { |
| 141 | 134 | public: |
| 142 | 135 | // construction/destruction |
| 143 | | samples_iterator(samples_interface &intf) |
| 144 | | : m_intf(intf), |
| 136 | samples_iterator(samples_device &device) |
| 137 | : m_samples(device), |
| 145 | 138 | m_current(-1) { } |
| 146 | 139 | |
| 147 | 140 | // getters |
| 148 | | const char *altbasename() const { return (m_intf.m_names != NULL && m_intf.m_names[0] != NULL && m_intf.m_names[0][0] == '*') ? &m_intf.m_names[0][1] : NULL; } |
| 141 | const char *altbasename() const { return (m_samples.m_names != NULL && m_samples.m_names[0] != NULL && m_samples.m_names[0][0] == '*') ? &m_samples.m_names[0][1] : NULL; } |
| 149 | 142 | |
| 150 | 143 | // iteration |
| 151 | 144 | const char *first() |
| 152 | 145 | { |
| 153 | | if (m_intf.m_names == NULL || m_intf.m_names[0] == NULL) |
| 146 | if (m_samples.m_names == NULL || m_samples.m_names[0] == NULL) |
| 154 | 147 | return NULL; |
| 155 | 148 | m_current = 0; |
| 156 | | if (m_intf.m_names[0][0] == '*') |
| 149 | if (m_samples.m_names[0][0] == '*') |
| 157 | 150 | m_current++; |
| 158 | | return m_intf.m_names[m_current++]; |
| 151 | return m_samples.m_names[m_current++]; |
| 159 | 152 | } |
| 160 | 153 | |
| 161 | 154 | const char *next() |
| 162 | 155 | { |
| 163 | | if (m_current == -1 || m_intf.m_names[m_current] == NULL) |
| 156 | if (m_current == -1 || m_samples.m_names[m_current] == NULL) |
| 164 | 157 | return NULL; |
| 165 | | return m_intf.m_names[m_current++]; |
| 158 | return m_samples.m_names[m_current++]; |
| 166 | 159 | } |
| 167 | 160 | |
| 168 | 161 | // counting |
| r31905 | r31906 | |
| 178 | 171 | |
| 179 | 172 | private: |
| 180 | 173 | // internal state |
| 181 | | samples_interface & m_intf; |
| 174 | samples_device &m_samples; |
| 182 | 175 | int m_current; |
| 183 | 176 | }; |
| 184 | 177 | |
trunk/src/emu/bus/nes/jaleco.c
| r31905 | r31906 | |
| 766 | 766 | 0 |
| 767 | 767 | }; |
| 768 | 768 | |
| 769 | | static const samples_interface jf13_samples_interface = |
| 770 | | { |
| 771 | | 16, /* channels */ |
| 772 | | jf13_sample_names |
| 773 | | }; |
| 774 | | |
| 775 | | static const samples_interface jf17_samples_interface = |
| 776 | | { |
| 777 | | 20, /* channels */ |
| 778 | | jf17_sample_names |
| 779 | | }; |
| 780 | | |
| 781 | | static const samples_interface jf19_samples_interface = |
| 782 | | { |
| 783 | | 20, /* channels */ |
| 784 | | jf19_sample_names |
| 785 | | }; |
| 786 | | |
| 787 | | static const samples_interface jf23_samples_interface = |
| 788 | | { |
| 789 | | 20, /* channels */ |
| 790 | | jf23_sample_names |
| 791 | | }; |
| 792 | | |
| 793 | | static const samples_interface jf24_samples_interface = |
| 794 | | { |
| 795 | | 6, /* channels */ |
| 796 | | jf24_sample_names |
| 797 | | }; |
| 798 | | |
| 799 | | static const samples_interface jf29_samples_interface = |
| 800 | | { |
| 801 | | 20, /* channels */ |
| 802 | | jf29_sample_names |
| 803 | | }; |
| 804 | | |
| 805 | | static const samples_interface jf33_samples_interface = |
| 806 | | { |
| 807 | | 20, /* channels */ |
| 808 | | jf33_sample_names |
| 809 | | }; |
| 810 | | |
| 811 | | |
| 812 | 769 | //------------------------------------------------- |
| 813 | 770 | // MACHINE_DRIVER |
| 814 | 771 | //------------------------------------------------- |
| r31905 | r31906 | |
| 818 | 775 | // additional sound hardware |
| 819 | 776 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 820 | 777 | |
| 821 | | MCFG_SAMPLES_ADD("samples", jf13_samples_interface) |
| 778 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 779 | MCFG_SAMPLES_CHANNELS(16) |
| 780 | MCFG_SAMPLES_NAMES(jf13_sample_names) |
| 822 | 781 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 823 | 782 | MACHINE_CONFIG_END |
| 824 | 783 | |
| r31905 | r31906 | |
| 827 | 786 | // additional sound hardware |
| 828 | 787 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 829 | 788 | |
| 830 | | MCFG_SAMPLES_ADD("samples", jf17_samples_interface) |
| 789 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 790 | MCFG_SAMPLES_CHANNELS(20) |
| 791 | MCFG_SAMPLES_NAMES(jf17_sample_names) |
| 831 | 792 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 832 | 793 | MACHINE_CONFIG_END |
| 833 | 794 | |
| r31905 | r31906 | |
| 836 | 797 | // additional sound hardware |
| 837 | 798 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 838 | 799 | |
| 839 | | MCFG_SAMPLES_ADD("samples", jf19_samples_interface) |
| 800 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 801 | MCFG_SAMPLES_CHANNELS(20) |
| 802 | MCFG_SAMPLES_NAMES(jf19_sample_names) |
| 840 | 803 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 841 | 804 | MACHINE_CONFIG_END |
| 842 | 805 | |
| r31905 | r31906 | |
| 845 | 808 | // additional sound hardware |
| 846 | 809 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 847 | 810 | |
| 848 | | MCFG_SAMPLES_ADD("samples", jf23_samples_interface) |
| 811 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 812 | MCFG_SAMPLES_CHANNELS(20) |
| 813 | MCFG_SAMPLES_NAMES(jf23_sample_names) |
| 849 | 814 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 850 | 815 | MACHINE_CONFIG_END |
| 851 | 816 | |
| r31905 | r31906 | |
| 854 | 819 | // additional sound hardware |
| 855 | 820 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 856 | 821 | |
| 857 | | MCFG_SAMPLES_ADD("samples", jf24_samples_interface) |
| 822 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 823 | MCFG_SAMPLES_CHANNELS(6) |
| 824 | MCFG_SAMPLES_NAMES(jf24_sample_names) |
| 858 | 825 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 859 | 826 | MACHINE_CONFIG_END |
| 860 | 827 | |
| r31905 | r31906 | |
| 863 | 830 | // additional sound hardware |
| 864 | 831 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 865 | 832 | |
| 866 | | MCFG_SAMPLES_ADD("samples", jf29_samples_interface) |
| 833 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 834 | MCFG_SAMPLES_CHANNELS(20) |
| 835 | MCFG_SAMPLES_NAMES(jf29_sample_names) |
| 867 | 836 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 868 | 837 | MACHINE_CONFIG_END |
| 869 | 838 | |
| r31905 | r31906 | |
| 872 | 841 | // additional sound hardware |
| 873 | 842 | MCFG_SPEAKER_STANDARD_MONO("addon") |
| 874 | 843 | |
| 875 | | MCFG_SAMPLES_ADD("samples", jf33_samples_interface) |
| 844 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 845 | MCFG_SAMPLES_CHANNELS(20) |
| 846 | MCFG_SAMPLES_NAMES(jf33_sample_names) |
| 876 | 847 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "addon", 0.50) |
| 877 | 848 | MACHINE_CONFIG_END |
| 878 | 849 | |
trunk/src/mame/audio/mw8080bw.c
| r31905 | r31906 | |
| 140 | 140 | 0 |
| 141 | 141 | }; |
| 142 | 142 | |
| 143 | | |
| 144 | | static const samples_interface seawolf_samples_interface = |
| 145 | | { |
| 146 | | 5, /* 5 channels */ |
| 147 | | seawolf_sample_names |
| 148 | | }; |
| 149 | | |
| 150 | | |
| 151 | 143 | MACHINE_CONFIG_FRAGMENT( seawolf_audio ) |
| 152 | 144 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 153 | 145 | |
| 154 | 146 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 155 | | MCFG_SAMPLES_ADD("samples", seawolf_samples_interface) |
| 147 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 148 | MCFG_SAMPLES_CHANNELS(5) |
| 149 | MCFG_SAMPLES_NAMES(seawolf_sample_names) |
| 156 | 150 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.6) |
| 157 | 151 | MACHINE_CONFIG_END |
| 158 | 152 | |
| r31905 | r31906 | |
| 200 | 194 | }; |
| 201 | 195 | |
| 202 | 196 | |
| 203 | | static const samples_interface gunfight_samples_interface = |
| 204 | | { |
| 205 | | 1, /* 1 channel */ |
| 206 | | gunfight_sample_names |
| 207 | | }; |
| 208 | | |
| 209 | | |
| 210 | 197 | MACHINE_CONFIG_FRAGMENT( gunfight_audio ) |
| 211 | 198 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 212 | 199 | |
| 213 | 200 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 214 | 201 | |
| 215 | | MCFG_SAMPLES_ADD("samples1", gunfight_samples_interface) |
| 202 | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 203 | MCFG_SAMPLES_CHANNELS(1) |
| 204 | MCFG_SAMPLES_NAMES(gunfight_sample_names) |
| 216 | 205 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 217 | 206 | |
| 218 | | MCFG_SAMPLES_ADD("samples2", gunfight_samples_interface) |
| 207 | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 208 | MCFG_SAMPLES_CHANNELS(1) |
| 209 | MCFG_SAMPLES_NAMES(gunfight_sample_names) |
| 219 | 210 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 220 | 211 | MACHINE_CONFIG_END |
| 221 | 212 | |
| r31905 | r31906 | |
| 1552 | 1543 | 0 |
| 1553 | 1544 | }; |
| 1554 | 1545 | |
| 1555 | | |
| 1556 | | static const samples_interface gmissile_samples_interface = |
| 1557 | | { |
| 1558 | | 1, /* 1 channel */ |
| 1559 | | gmissile_sample_names |
| 1560 | | }; |
| 1561 | | |
| 1562 | | |
| 1563 | 1546 | MACHINE_CONFIG_FRAGMENT( gmissile_audio ) |
| 1564 | 1547 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 1565 | 1548 | |
| 1566 | 1549 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1567 | 1550 | |
| 1568 | | MCFG_SAMPLES_ADD("samples1", gmissile_samples_interface) |
| 1551 | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 1552 | MCFG_SAMPLES_CHANNELS(1) |
| 1553 | MCFG_SAMPLES_NAMES(gmissile_sample_names) |
| 1569 | 1554 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1.9) |
| 1570 | 1555 | |
| 1571 | | MCFG_SAMPLES_ADD("samples2", gmissile_samples_interface) |
| 1556 | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 1557 | MCFG_SAMPLES_CHANNELS(1) |
| 1558 | MCFG_SAMPLES_NAMES(gmissile_sample_names) |
| 1572 | 1559 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1.9) |
| 1573 | 1560 | MACHINE_CONFIG_END |
| 1574 | 1561 | |
| r31905 | r31906 | |
| 1649 | 1636 | }; |
| 1650 | 1637 | |
| 1651 | 1638 | |
| 1652 | | static const samples_interface m4_samples_interface = |
| 1653 | | { |
| 1654 | | 2, /* 2 channels */ |
| 1655 | | m4_sample_names |
| 1656 | | }; |
| 1657 | | |
| 1658 | | |
| 1659 | 1639 | MACHINE_CONFIG_FRAGMENT( m4_audio ) |
| 1660 | 1640 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 1661 | 1641 | |
| 1662 | 1642 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1663 | 1643 | |
| 1664 | | MCFG_SAMPLES_ADD("samples1", m4_samples_interface) |
| 1644 | MCFG_SOUND_ADD("samples1", SAMPLES, 0) |
| 1645 | MCFG_SAMPLES_CHANNELS(2) |
| 1646 | MCFG_SAMPLES_NAMES(m4_sample_names) |
| 1665 | 1647 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 1) |
| 1666 | 1648 | |
| 1667 | | MCFG_SAMPLES_ADD("samples2", m4_samples_interface) |
| 1649 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1650 | MCFG_SAMPLES_CHANNELS(2) |
| 1651 | MCFG_SAMPLES_NAMES(m4_sample_names) |
| 1668 | 1652 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 1) |
| 1669 | 1653 | MACHINE_CONFIG_END |
| 1670 | 1654 | |
| r31905 | r31906 | |
| 1907 | 1891 | 0 |
| 1908 | 1892 | }; |
| 1909 | 1893 | |
| 1910 | | static const samples_interface clowns_samples_interface = |
| 1911 | | { |
| 1912 | | 1, /* 1 channel */ |
| 1913 | | clowns_sample_names |
| 1914 | | }; |
| 1915 | | |
| 1916 | | |
| 1917 | 1894 | MACHINE_CONFIG_FRAGMENT( clowns_audio ) |
| 1918 | 1895 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 1919 | 1896 | |
| 1920 | 1897 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1921 | 1898 | |
| 1922 | | MCFG_SAMPLES_ADD("samples", clowns_samples_interface) |
| 1899 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1900 | MCFG_SAMPLES_CHANNELS(1) |
| 1901 | MCFG_SAMPLES_NAMES(clowns_sample_names) |
| 1923 | 1902 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.70) |
| 1924 | 1903 | |
| 1925 | 1904 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r31905 | r31906 | |
| 3301 | 3280 | 0 |
| 3302 | 3281 | }; |
| 3303 | 3282 | |
| 3304 | | |
| 3305 | | static const samples_interface phantom2_samples_interface = |
| 3306 | | { |
| 3307 | | 2, /* 2 channels */ |
| 3308 | | phantom2_sample_names |
| 3309 | | }; |
| 3310 | | |
| 3311 | | |
| 3312 | 3283 | MACHINE_CONFIG_FRAGMENT( phantom2_audio ) |
| 3313 | 3284 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| 3314 | 3285 | |
| 3315 | 3286 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 3316 | | MCFG_SAMPLES_ADD("samples", phantom2_samples_interface) |
| 3287 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 3288 | MCFG_SAMPLES_CHANNELS(2) |
| 3289 | MCFG_SAMPLES_NAMES(phantom2_sample_names) |
| 3317 | 3290 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1) |
| 3318 | 3291 | MACHINE_CONFIG_END |
| 3319 | 3292 | |
| r31905 | r31906 | |
| 3580 | 3553 | }; |
| 3581 | 3554 | |
| 3582 | 3555 | |
| 3583 | | static const samples_interface invaders_samples_interface = |
| 3584 | | { |
| 3585 | | 6, /* 6 channels */ |
| 3586 | | invaders_sample_names |
| 3587 | | }; |
| 3588 | | |
| 3589 | | |
| 3590 | 3556 | /* left in for all games that hack into invaders samples for audio */ |
| 3591 | 3557 | MACHINE_CONFIG_FRAGMENT( invaders_samples_audio ) |
| 3592 | 3558 | MCFG_SOUND_START_OVERRIDE(mw8080bw_state, samples) |
| r31905 | r31906 | |
| 3597 | 3563 | MCFG_SOUND_CONFIG(invaders_sn76477_interface) |
| 3598 | 3564 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 3599 | 3565 | |
| 3600 | | MCFG_SAMPLES_ADD("samples", invaders_samples_interface) |
| 3566 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 3567 | MCFG_SAMPLES_CHANNELS(6) |
| 3568 | MCFG_SAMPLES_NAMES(invaders_sample_names) |
| 3601 | 3569 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 3602 | 3570 | MACHINE_CONFIG_END |
| 3603 | 3571 | |
trunk/src/mame/audio/cinemat.c
| r31905 | r31906 | |
| 129 | 129 | 0 |
| 130 | 130 | }; |
| 131 | 131 | |
| 132 | | static const samples_interface spacewar_samples_interface = |
| 133 | | { |
| 134 | | 8, |
| 135 | | spacewar_sample_names |
| 136 | | }; |
| 137 | | |
| 138 | 132 | void cinemat_state::spacewar_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 139 | 133 | { |
| 140 | 134 | /* Explosion - rising edge */ |
| r31905 | r31906 | |
| 184 | 178 | |
| 185 | 179 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 186 | 180 | |
| 187 | | MCFG_SAMPLES_ADD("samples", spacewar_samples_interface) |
| 181 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 182 | MCFG_SAMPLES_CHANNELS(8) |
| 183 | MCFG_SAMPLES_NAMES(spacewar_sample_names) |
| 188 | 184 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 189 | 185 | MACHINE_CONFIG_END |
| 190 | 186 | |
| r31905 | r31906 | |
| 205 | 201 | 0 |
| 206 | 202 | }; |
| 207 | 203 | |
| 208 | | static const samples_interface barrier_samples_interface = |
| 209 | | { |
| 210 | | 3, |
| 211 | | barrier_sample_names |
| 212 | | }; |
| 213 | | |
| 214 | 204 | void cinemat_state::barrier_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 215 | 205 | { |
| 216 | 206 | /* Player die - rising edge */ |
| r31905 | r31906 | |
| 236 | 226 | |
| 237 | 227 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 238 | 228 | |
| 239 | | MCFG_SAMPLES_ADD("samples", barrier_samples_interface) |
| 229 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 230 | MCFG_SAMPLES_CHANNELS(3) |
| 231 | MCFG_SAMPLES_NAMES(barrier_sample_names) |
| 240 | 232 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 241 | 233 | MACHINE_CONFIG_END |
| 242 | 234 | |
| r31905 | r31906 | |
| 255 | 247 | NULL |
| 256 | 248 | }; |
| 257 | 249 | |
| 258 | | static const samples_interface speedfrk_samples_interface = |
| 259 | | { |
| 260 | | 1, |
| 261 | | speedfrk_sample_names |
| 262 | | }; |
| 263 | | |
| 264 | 250 | void cinemat_state::speedfrk_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 265 | 251 | { |
| 266 | 252 | /* on the falling edge of bit 0x08, clock the inverse of bit 0x04 into the top of the shiftreg */ |
| r31905 | r31906 | |
| 293 | 279 | |
| 294 | 280 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 295 | 281 | |
| 296 | | MCFG_SAMPLES_ADD("samples", speedfrk_samples_interface) |
| 282 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 283 | MCFG_SAMPLES_CHANNELS(1) |
| 284 | MCFG_SAMPLES_NAMES(speedfrk_sample_names) |
| 297 | 285 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 298 | 286 | MACHINE_CONFIG_END |
| 299 | 287 | |
| r31905 | r31906 | |
| 317 | 305 | NULL |
| 318 | 306 | }; |
| 319 | 307 | |
| 320 | | static const samples_interface starhawk_samples_interface = |
| 321 | | { |
| 322 | | 5, |
| 323 | | starhawk_sample_names |
| 324 | | }; |
| 325 | | |
| 326 | 308 | void cinemat_state::starhawk_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 327 | 309 | { |
| 328 | 310 | /* explosion - falling edge */ |
| r31905 | r31906 | |
| 366 | 348 | |
| 367 | 349 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 368 | 350 | |
| 369 | | MCFG_SAMPLES_ADD("samples", starhawk_samples_interface) |
| 351 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 352 | MCFG_SAMPLES_CHANNELS(5) |
| 353 | MCFG_SAMPLES_NAMES(starhawk_sample_names) |
| 370 | 354 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 371 | 355 | MACHINE_CONFIG_END |
| 372 | 356 | |
| r31905 | r31906 | |
| 390 | 374 | 0 |
| 391 | 375 | }; |
| 392 | 376 | |
| 393 | | static const samples_interface sundance_samples_interface = |
| 394 | | { |
| 395 | | 6, |
| 396 | | sundance_sample_names |
| 397 | | }; |
| 398 | | |
| 399 | 377 | void cinemat_state::sundance_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 400 | 378 | { |
| 401 | 379 | /* bong - falling edge */ |
| r31905 | r31906 | |
| 433 | 411 | |
| 434 | 412 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 435 | 413 | |
| 436 | | MCFG_SAMPLES_ADD("samples", sundance_samples_interface) |
| 414 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 415 | MCFG_SAMPLES_CHANNELS(6) |
| 416 | MCFG_SAMPLES_NAMES(sundance_sample_names) |
| 437 | 417 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 438 | 418 | MACHINE_CONFIG_END |
| 439 | 419 | |
| r31905 | r31906 | |
| 457 | 437 | NULL |
| 458 | 438 | }; |
| 459 | 439 | |
| 460 | | static const samples_interface tailg_samples_interface = |
| 461 | | { |
| 462 | | 6, |
| 463 | | tailg_sample_names |
| 464 | | }; |
| 465 | | |
| 466 | 440 | void cinemat_state::tailg_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 467 | 441 | { |
| 468 | 442 | /* the falling edge of bit 0x10 clocks bit 0x08 into the mux selected by bits 0x07 */ |
| r31905 | r31906 | |
| 519 | 493 | |
| 520 | 494 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 521 | 495 | |
| 522 | | MCFG_SAMPLES_ADD("samples", tailg_samples_interface) |
| 496 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 497 | MCFG_SAMPLES_CHANNELS(6) |
| 498 | MCFG_SAMPLES_NAMES(tailg_sample_names) |
| 523 | 499 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 524 | 500 | MACHINE_CONFIG_END |
| 525 | 501 | |
| r31905 | r31906 | |
| 542 | 518 | NULL |
| 543 | 519 | }; |
| 544 | 520 | |
| 545 | | static const samples_interface warrior_samples_interface = |
| 546 | | { |
| 547 | | 5, |
| 548 | | warrior_sample_names |
| 549 | | }; |
| 550 | | |
| 551 | 521 | void cinemat_state::warrior_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 552 | 522 | { |
| 553 | 523 | /* normal level - 0=on, 1=off */ |
| r31905 | r31906 | |
| 585 | 555 | |
| 586 | 556 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 587 | 557 | |
| 588 | | MCFG_SAMPLES_ADD("samples", warrior_samples_interface) |
| 558 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 559 | MCFG_SAMPLES_CHANNELS(5) |
| 560 | MCFG_SAMPLES_NAMES(warrior_sample_names) |
| 589 | 561 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 590 | 562 | MACHINE_CONFIG_END |
| 591 | 563 | |
| r31905 | r31906 | |
| 610 | 582 | NULL |
| 611 | 583 | }; |
| 612 | 584 | |
| 613 | | static const samples_interface armora_samples_interface = |
| 614 | | { |
| 615 | | 7, |
| 616 | | armora_sample_names |
| 617 | | }; |
| 618 | | |
| 619 | 585 | void cinemat_state::armora_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 620 | 586 | { |
| 621 | 587 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r31905 | r31906 | |
| 677 | 643 | |
| 678 | 644 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 679 | 645 | |
| 680 | | MCFG_SAMPLES_ADD("samples", armora_samples_interface) |
| 646 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 647 | MCFG_SAMPLES_CHANNELS(7) |
| 648 | MCFG_SAMPLES_NAMES(armora_sample_names) |
| 681 | 649 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 682 | 650 | MACHINE_CONFIG_END |
| 683 | 651 | |
| r31905 | r31906 | |
| 708 | 676 | NULL |
| 709 | 677 | }; |
| 710 | 678 | |
| 711 | | static const samples_interface ripoff_samples_interface = |
| 712 | | { |
| 713 | | 6, |
| 714 | | ripoff_sample_names |
| 715 | | }; |
| 716 | | |
| 717 | 679 | void cinemat_state::ripoff_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 718 | 680 | { |
| 719 | 681 | /* on the rising edge of bit 0x02, clock bit 0x01 into the shift register */ |
| r31905 | r31906 | |
| 766 | 728 | |
| 767 | 729 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 768 | 730 | |
| 769 | | MCFG_SAMPLES_ADD("samples", ripoff_samples_interface) |
| 731 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 732 | MCFG_SAMPLES_CHANNELS(6) |
| 733 | MCFG_SAMPLES_NAMES(ripoff_sample_names) |
| 770 | 734 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 771 | 735 | MACHINE_CONFIG_END |
| 772 | 736 | |
| r31905 | r31906 | |
| 792 | 756 | 0 |
| 793 | 757 | }; |
| 794 | 758 | |
| 795 | | static const samples_interface starcas_samples_interface = |
| 796 | | { |
| 797 | | 8, |
| 798 | | starcas_sample_names |
| 799 | | }; |
| 800 | | |
| 801 | 759 | void cinemat_state::starcas_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 802 | 760 | { |
| 803 | 761 | UINT32 target_pitch; |
| r31905 | r31906 | |
| 877 | 835 | |
| 878 | 836 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 879 | 837 | |
| 880 | | MCFG_SAMPLES_ADD("samples", starcas_samples_interface) |
| 838 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 839 | MCFG_SAMPLES_CHANNELS(8) |
| 840 | MCFG_SAMPLES_NAMES(starcas_sample_names) |
| 881 | 841 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 882 | 842 | MACHINE_CONFIG_END |
| 883 | 843 | |
| r31905 | r31906 | |
| 903 | 863 | NULL |
| 904 | 864 | }; |
| 905 | 865 | |
| 906 | | static const samples_interface solarq_samples_interface = |
| 907 | | { |
| 908 | | 8, |
| 909 | | solarq_sample_names |
| 910 | | }; |
| 911 | | |
| 912 | 866 | void cinemat_state::solarq_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 913 | 867 | { |
| 914 | 868 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r31905 | r31906 | |
| 1009 | 963 | |
| 1010 | 964 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1011 | 965 | |
| 1012 | | MCFG_SAMPLES_ADD("samples", solarq_samples_interface) |
| 966 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 967 | MCFG_SAMPLES_CHANNELS(8) |
| 968 | MCFG_SAMPLES_NAMES(solarq_sample_names) |
| 1013 | 969 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1014 | 970 | MACHINE_CONFIG_END |
| 1015 | 971 | |
| r31905 | r31906 | |
| 1039 | 995 | NULL |
| 1040 | 996 | }; |
| 1041 | 997 | |
| 1042 | | static const samples_interface boxingb_samples_interface = |
| 1043 | | { |
| 1044 | | 12, |
| 1045 | | boxingb_sample_names |
| 1046 | | }; |
| 1047 | | |
| 1048 | 998 | void cinemat_state::boxingb_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 1049 | 999 | { |
| 1050 | 1000 | /* on the rising edge of bit 0x10, clock bit 0x80 into the shift register */ |
| r31905 | r31906 | |
| 1141 | 1091 | |
| 1142 | 1092 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1143 | 1093 | |
| 1144 | | MCFG_SAMPLES_ADD("samples", boxingb_samples_interface) |
| 1094 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1095 | MCFG_SAMPLES_CHANNELS(12) |
| 1096 | MCFG_SAMPLES_NAMES(boxingb_sample_names) |
| 1145 | 1097 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1146 | 1098 | MACHINE_CONFIG_END |
| 1147 | 1099 | |
| r31905 | r31906 | |
| 1167 | 1119 | 0 |
| 1168 | 1120 | }; |
| 1169 | 1121 | |
| 1170 | | static const samples_interface wotw_samples_interface = |
| 1171 | | { |
| 1172 | | 8, |
| 1173 | | wotw_sample_names |
| 1174 | | }; |
| 1175 | | |
| 1176 | 1122 | void cinemat_state::wotw_sound_w(UINT8 sound_val, UINT8 bits_changed) |
| 1177 | 1123 | { |
| 1178 | 1124 | UINT32 target_pitch; |
| r31905 | r31906 | |
| 1252 | 1198 | |
| 1253 | 1199 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1254 | 1200 | |
| 1255 | | MCFG_SAMPLES_ADD("samples", wotw_samples_interface) |
| 1201 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1202 | MCFG_SAMPLES_CHANNELS(8) |
| 1203 | MCFG_SAMPLES_NAMES(wotw_sample_names) |
| 1256 | 1204 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1257 | 1205 | MACHINE_CONFIG_END |
| 1258 | 1206 | |
trunk/src/mame/audio/meadows.c
| r31905 | r31906 | |
| 28 | 28 | /************************************/ |
| 29 | 29 | /* Sound handler start */ |
| 30 | 30 | /************************************/ |
| 31 | | SAMPLES_START( meadows_sh_start ) |
| 31 | SAMPLES_START_CB_MEMBER(meadows_state::meadows_sh_start) |
| 32 | 32 | { |
| 33 | | meadows_state *state = device.machine().driver_data<meadows_state>(); |
| 34 | | state->m_0c00 = state->m_0c01 = state->m_0c02 = state->m_0c03 = 0; |
| 35 | | state->m_dac_data = 0; |
| 36 | | state->m_dac_enable = 0; |
| 37 | | state->m_channel = 0; |
| 38 | | state->m_freq1 = state->m_freq2 = 1000; |
| 39 | | state->m_latched_0c01 = state->m_latched_0c02 = state->m_latched_0c03 = 0; |
| 33 | m_0c00 = m_0c01 = m_0c02 = m_0c03 = 0; |
| 34 | m_dac_data = 0; |
| 35 | m_dac_enable = 0; |
| 36 | m_channel = 0; |
| 37 | m_freq1 = m_freq2 = 1000; |
| 38 | m_latched_0c01 = m_latched_0c02 = m_latched_0c03 = 0; |
| 40 | 39 | |
| 41 | | device.set_volume(0,0); |
| 42 | | device.start_raw(0,waveform,ARRAY_LENGTH(waveform),state->m_freq1,true); |
| 43 | | device.set_volume(1,0); |
| 44 | | device.start_raw(1,waveform,ARRAY_LENGTH(waveform),state->m_freq2,true); |
| 40 | m_samples->set_volume(0,0); |
| 41 | m_samples->start_raw(0,waveform,ARRAY_LENGTH(waveform),m_freq1,true); |
| 42 | m_samples->set_volume(1,0); |
| 43 | m_samples->start_raw(1,waveform,ARRAY_LENGTH(waveform),m_freq2,true); |
| 45 | 44 | } |
| 46 | 45 | |
| 47 | 46 | /************************************/ |
| 48 | 47 | /* Sound handler update */ |
| 49 | 48 | /************************************/ |
| 50 | | void meadows_sh_update(running_machine &machine) |
| 49 | void meadows_state::meadows_sh_update() |
| 51 | 50 | { |
| 52 | | meadows_state *state = machine.driver_data<meadows_state>(); |
| 53 | 51 | int preset, amp; |
| 54 | 52 | |
| 55 | | if (state->m_latched_0c01 != state->m_0c01 || state->m_latched_0c03 != state->m_0c03) |
| 53 | if (m_latched_0c01 != m_0c01 || m_latched_0c03 != m_0c03) |
| 56 | 54 | { |
| 57 | 55 | /* amplitude is a combination of the upper 4 bits of 0c01 */ |
| 58 | 56 | /* and bit 4 merged from S2650's flag output */ |
| 59 | | amp = ((state->m_0c03 & ENABLE_CTR1) == 0) ? 0 : (state->m_0c01 & 0xf0) >> 1; |
| 60 | | if( state->m_maincpu->state_int(S2650_FO) ) |
| 57 | amp = ((m_0c03 & ENABLE_CTR1) == 0) ? 0 : (m_0c01 & 0xf0) >> 1; |
| 58 | if( m_maincpu->state_int(S2650_FO) ) |
| 61 | 59 | amp += 0x80; |
| 62 | 60 | /* calculate frequency for counter #1 */ |
| 63 | 61 | /* bit 0..3 of 0c01 are ctr preset */ |
| 64 | | preset = (state->m_0c01 & 15) ^ 15; |
| 62 | preset = (m_0c01 & 15) ^ 15; |
| 65 | 63 | if (preset) |
| 66 | | state->m_freq1 = BASE_CTR1 / (preset + 1); |
| 64 | m_freq1 = BASE_CTR1 / (preset + 1); |
| 67 | 65 | else amp = 0; |
| 68 | | logerror("meadows ctr1 channel #%d preset:%3d freq:%5d amp:%d\n", state->m_channel, preset, state->m_freq1, amp); |
| 69 | | state->m_samples->set_frequency(0, state->m_freq1 * sizeof(waveform)/2); |
| 70 | | state->m_samples->set_volume(0,amp/255.0); |
| 66 | logerror("meadows ctr1 channel #%d preset:%3d freq:%5d amp:%d\n", m_channel, preset, m_freq1, amp); |
| 67 | m_samples->set_frequency(0, m_freq1 * sizeof(waveform)/2); |
| 68 | m_samples->set_volume(0,amp/255.0); |
| 71 | 69 | } |
| 72 | 70 | |
| 73 | | if (state->m_latched_0c02 != state->m_0c02 || state->m_latched_0c03 != state->m_0c03) |
| 71 | if (m_latched_0c02 != m_0c02 || m_latched_0c03 != m_0c03) |
| 74 | 72 | { |
| 75 | 73 | /* calculate frequency for counter #2 */ |
| 76 | 74 | /* 0c02 is ctr preset, 0c03 bit 0 enables division by 2 */ |
| 77 | | amp = ((state->m_0c03 & ENABLE_CTR2) != 0) ? 0xa0 : 0; |
| 78 | | preset = state->m_0c02 ^ 0xff; |
| 75 | amp = ((m_0c03 & ENABLE_CTR2) != 0) ? 0xa0 : 0; |
| 76 | preset = m_0c02 ^ 0xff; |
| 79 | 77 | if (preset) |
| 80 | 78 | { |
| 81 | | state->m_freq2 = BASE_CTR2 / (preset + 1) / 2; |
| 82 | | if ((state->m_0c03 & DIV2OR4_CTR2) == 0) |
| 83 | | state->m_freq2 >>= 1; |
| 79 | m_freq2 = BASE_CTR2 / (preset + 1) / 2; |
| 80 | if ((m_0c03 & DIV2OR4_CTR2) == 0) |
| 81 | m_freq2 >>= 1; |
| 84 | 82 | } |
| 85 | 83 | else amp = 0; |
| 86 | | logerror("meadows ctr2 channel #%d preset:%3d freq:%5d amp:%d\n", state->m_channel+1, preset, state->m_freq2, amp); |
| 87 | | state->m_samples->set_frequency(1, state->m_freq2 * sizeof(waveform)); |
| 88 | | state->m_samples->set_volume(1,amp/255.0); |
| 84 | logerror("meadows ctr2 channel #%d preset:%3d freq:%5d amp:%d\n", m_channel+1, preset, m_freq2, amp); |
| 85 | m_samples->set_frequency(1, m_freq2 * sizeof(waveform)); |
| 86 | m_samples->set_volume(1,amp/255.0); |
| 89 | 87 | } |
| 90 | 88 | |
| 91 | | if (state->m_latched_0c03 != state->m_0c03) |
| 89 | if (m_latched_0c03 != m_0c03) |
| 92 | 90 | { |
| 93 | | state->m_dac_enable = state->m_0c03 & ENABLE_DAC; |
| 91 | m_dac_enable = m_0c03 & ENABLE_DAC; |
| 94 | 92 | |
| 95 | | if (state->m_dac_enable) |
| 96 | | state->m_dac->write_unsigned8(state->m_dac_data); |
| 93 | if (m_dac_enable) |
| 94 | m_dac->write_unsigned8(m_dac_data); |
| 97 | 95 | else |
| 98 | | state->m_dac->write_unsigned8(0); |
| 96 | m_dac->write_unsigned8(0); |
| 99 | 97 | } |
| 100 | 98 | |
| 101 | | state->m_latched_0c01 = state->m_0c01; |
| 102 | | state->m_latched_0c02 = state->m_0c02; |
| 103 | | state->m_latched_0c03 = state->m_0c03; |
| 99 | m_latched_0c01 = m_0c01; |
| 100 | m_latched_0c02 = m_0c02; |
| 101 | m_latched_0c03 = m_0c03; |
| 104 | 102 | } |
| 105 | 103 | |
| 106 | 104 | /************************************/ |
| 107 | 105 | /* Write DAC value */ |
| 108 | 106 | /************************************/ |
| 109 | | void meadows_sh_dac_w(running_machine &machine, int data) |
| 107 | void meadows_state::meadows_sh_dac_w(int data) |
| 110 | 108 | { |
| 111 | | meadows_state *state = machine.driver_data<meadows_state>(); |
| 112 | | state->m_dac_data = data; |
| 113 | | if (state->m_dac_enable) |
| 114 | | state->m_dac->write_unsigned8(state->m_dac_data); |
| 109 | m_dac_data = data; |
| 110 | if (m_dac_enable) |
| 111 | m_dac->write_unsigned8(m_dac_data); |
| 115 | 112 | else |
| 116 | | state->m_dac->write_unsigned8(0); |
| 113 | m_dac->write_unsigned8(0); |
| 117 | 114 | } |
trunk/src/mame/audio/segag80r.c
| r31905 | r31906 | |
| 239 | 239 | }; |
| 240 | 240 | |
| 241 | 241 | |
| 242 | | static const samples_interface astrob_samples_interface = |
| 243 | | { |
| 244 | | 11, |
| 245 | | astrob_sample_names |
| 246 | | }; |
| 247 | | |
| 248 | | |
| 249 | 242 | MACHINE_CONFIG_FRAGMENT( astrob_sound_board ) |
| 250 | 243 | |
| 251 | 244 | /* sound hardware */ |
| 252 | | MCFG_SAMPLES_ADD("samples", astrob_samples_interface) |
| 245 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 246 | MCFG_SAMPLES_CHANNELS(11) |
| 247 | MCFG_SAMPLES_NAMES(astrob_sample_names) |
| 253 | 248 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 254 | 249 | MACHINE_CONFIG_END |
| 255 | 250 | |
| r31905 | r31906 | |
| 431 | 426 | }; |
| 432 | 427 | |
| 433 | 428 | |
| 434 | | static const samples_interface sega005_samples_interface = |
| 435 | | { |
| 436 | | 7, |
| 437 | | sega005_sample_names |
| 438 | | }; |
| 439 | | |
| 440 | | |
| 441 | 429 | MACHINE_CONFIG_FRAGMENT( 005_sound_board ) |
| 442 | 430 | |
| 443 | 431 | MCFG_DEVICE_ADD("ppi8255", I8255A, 0) |
| r31905 | r31906 | |
| 446 | 434 | |
| 447 | 435 | /* sound hardware */ |
| 448 | 436 | |
| 449 | | MCFG_SAMPLES_ADD("samples", sega005_samples_interface) |
| 437 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 438 | MCFG_SAMPLES_CHANNELS(7) |
| 439 | MCFG_SAMPLES_NAMES(sega005_sample_names) |
| 450 | 440 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 451 | 441 | |
| 452 | 442 | MCFG_SOUND_ADD("005", SEGA005, 0) |
| r31905 | r31906 | |
| 598 | 588 | }; |
| 599 | 589 | |
| 600 | 590 | |
| 601 | | static const samples_interface spaceod_samples_interface = |
| 602 | | { |
| 603 | | 11, |
| 604 | | spaceod_sample_names |
| 605 | | }; |
| 606 | | |
| 607 | | |
| 608 | 591 | MACHINE_CONFIG_FRAGMENT( spaceod_sound_board ) |
| 609 | 592 | |
| 610 | 593 | /* sound hardware */ |
| 611 | 594 | |
| 612 | | MCFG_SAMPLES_ADD("samples", spaceod_samples_interface) |
| 595 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 596 | MCFG_SAMPLES_CHANNELS(11) |
| 597 | MCFG_SAMPLES_NAMES(spaceod_sample_names) |
| 613 | 598 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 614 | 599 | MACHINE_CONFIG_END |
| 615 | 600 | |
| r31905 | r31906 | |
| 695 | 680 | }; |
| 696 | 681 | |
| 697 | 682 | |
| 698 | | static const samples_interface monsterb_samples_interface = |
| 699 | | { |
| 700 | | 2, |
| 701 | | monsterb_sample_names |
| 702 | | }; |
| 703 | | |
| 704 | | |
| 705 | 683 | /************************************* |
| 706 | 684 | * |
| 707 | 685 | * N7751 memory maps |
| r31905 | r31906 | |
| 740 | 718 | |
| 741 | 719 | /* sound hardware */ |
| 742 | 720 | |
| 743 | | MCFG_SAMPLES_ADD("samples", monsterb_samples_interface) |
| 721 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 722 | MCFG_SAMPLES_CHANNELS(2) |
| 723 | MCFG_SAMPLES_NAMES(monsterb_sample_names) |
| 744 | 724 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 745 | 725 | |
| 746 | 726 | MCFG_TMS36XX_ADD("music", 247) |
trunk/src/mame/audio/targ.c
| r31905 | r31906 | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | |
| 147 | | static SAMPLES_START( spectar_audio_start ) |
| 147 | SAMPLES_START_CB_MEMBER(exidy_state::spectar_audio_start) |
| 148 | 148 | { |
| 149 | | running_machine &machine = device.machine(); |
| 150 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 151 | | |
| 152 | | state->common_audio_start(SPECTAR_MAXFREQ); |
| 149 | common_audio_start(SPECTAR_MAXFREQ); |
| 153 | 150 | } |
| 154 | 151 | |
| 155 | 152 | |
| 156 | | static SAMPLES_START( targ_audio_start ) |
| 153 | SAMPLES_START_CB_MEMBER(exidy_state::targ_audio_start) |
| 157 | 154 | { |
| 158 | | running_machine &machine = device.machine(); |
| 159 | | exidy_state *state = machine.driver_data<exidy_state>(); |
| 155 | common_audio_start(TARG_MAXFREQ); |
| 160 | 156 | |
| 161 | | state->common_audio_start(TARG_MAXFREQ); |
| 157 | m_tone_pointer = 0; |
| 162 | 158 | |
| 163 | | state->m_tone_pointer = 0; |
| 164 | | |
| 165 | | state->save_item(NAME(state->m_tone_pointer)); |
| 159 | save_item(NAME(m_tone_pointer)); |
| 166 | 160 | } |
| 167 | 161 | |
| 168 | 162 | |
| 169 | | static const samples_interface spectar_samples_interface = |
| 170 | | { |
| 171 | | 4, /* number of channel */ |
| 172 | | sample_names, |
| 173 | | spectar_audio_start |
| 174 | | }; |
| 175 | | |
| 176 | | |
| 177 | | static const samples_interface targ_samples_interface = |
| 178 | | { |
| 179 | | 4, /* number of channel */ |
| 180 | | sample_names, |
| 181 | | targ_audio_start |
| 182 | | }; |
| 183 | | |
| 184 | | |
| 185 | 163 | MACHINE_CONFIG_FRAGMENT( spectar_audio ) |
| 186 | 164 | |
| 187 | 165 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 188 | 166 | |
| 189 | | MCFG_SAMPLES_ADD("samples", spectar_samples_interface) |
| 167 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 168 | MCFG_SAMPLES_CHANNELS(4) |
| 169 | MCFG_SAMPLES_NAMES(sample_names) |
| 170 | MCFG_SAMPLES_START_CB(exidy_state, spectar_audio_start) |
| 190 | 171 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 191 | 172 | |
| 192 | 173 | MCFG_DAC_ADD("dac") |
| r31905 | r31906 | |
| 198 | 179 | |
| 199 | 180 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 200 | 181 | |
| 201 | | MCFG_SAMPLES_ADD("samples", targ_samples_interface) |
| 182 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 183 | MCFG_SAMPLES_CHANNELS(4) |
| 184 | MCFG_SAMPLES_NAMES(sample_names) |
| 185 | MCFG_SAMPLES_START_CB(exidy_state, targ_audio_start) |
| 202 | 186 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 203 | 187 | |
| 204 | 188 | MCFG_DAC_ADD("dac") |
trunk/src/mame/audio/turbo.c
| r31905 | r31906 | |
| 21 | 21 | * |
| 22 | 22 | *************************************/ |
| 23 | 23 | |
| 24 | | static void turbo_update_samples(turbo_state *state, samples_device *samples) |
| 24 | void turbo_state::turbo_update_samples() |
| 25 | 25 | { |
| 26 | 26 | /* accelerator sounds */ |
| 27 | 27 | /* BSEL == 3 --> off */ |
| 28 | 28 | /* BSEL == 2 --> standard */ |
| 29 | 29 | /* BSEL == 1 --> tunnel */ |
| 30 | 30 | /* BSEL == 0 --> ??? */ |
| 31 | | if (state->m_turbo_bsel == 3 && samples->playing(5)) |
| 32 | | samples->stop(5); |
| 33 | | else if (state->m_turbo_bsel != 3 && !samples->playing(5)) |
| 34 | | samples->start(5, 7, true); |
| 35 | | if (samples->playing(5)) |
| 36 | | samples->set_frequency(5, samples->base_frequency(5) * ((state->m_turbo_accel & 0x3f) / 5.25 + 1)); |
| 31 | if (m_turbo_bsel == 3 && m_samples->playing(5)) |
| 32 | m_samples->stop(5); |
| 33 | else if (m_turbo_bsel != 3 && !m_samples->playing(5)) |
| 34 | m_samples->start(5, 7, true); |
| 35 | if (m_samples->playing(5)) |
| 36 | m_samples->set_frequency(5, m_samples->base_frequency(5) * ((m_turbo_accel & 0x3f) / 5.25 + 1)); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| r31905 | r31906 | |
| 107 | 107 | if ((diff & 0x80) && !(data & 0x80)) m_samples->start(3, 5); |
| 108 | 108 | |
| 109 | 109 | /* update any samples */ |
| 110 | | turbo_update_samples(this, m_samples); |
| 110 | turbo_update_samples(); |
| 111 | 111 | |
| 112 | 112 | #else |
| 113 | 113 | |
| r31905 | r31906 | |
| 139 | 139 | if ((diff & 0x80) && !(data & 0x80)) m_samples->start(2, 6); |
| 140 | 140 | |
| 141 | 141 | /* update any samples */ |
| 142 | | turbo_update_samples(this, m_samples); |
| 142 | turbo_update_samples(); |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r31905 | r31906 | |
| 155 | 155 | output_set_value("speed", (data >> 4) & 0x0f); |
| 156 | 156 | |
| 157 | 157 | /* update any samples */ |
| 158 | | turbo_update_samples(this, m_samples); |
| 158 | turbo_update_samples(); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r31905 | r31906 | |
| 182 | 182 | }; |
| 183 | 183 | |
| 184 | 184 | |
| 185 | | static const samples_interface turbo_samples_interface = |
| 186 | | { |
| 187 | | 10, |
| 188 | | turbo_sample_names |
| 189 | | }; |
| 190 | | |
| 191 | | |
| 192 | 185 | MACHINE_CONFIG_FRAGMENT( turbo_samples ) |
| 193 | 186 | |
| 194 | 187 | /* this is the cockpit speaker configuration */ |
| r31905 | r31906 | |
| 197 | 190 | MCFG_SPEAKER_ADD("lspeaker", -0.2, 0.0, 1.0) /* left */ |
| 198 | 191 | MCFG_SPEAKER_ADD("rspeaker", 0.2, 0.0, 1.0) /* right */ |
| 199 | 192 | |
| 200 | | MCFG_SAMPLES_ADD("samples", turbo_samples_interface) |
| 193 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 194 | MCFG_SAMPLES_CHANNELS(10) |
| 195 | MCFG_SAMPLES_NAMES(turbo_sample_names) |
| 201 | 196 | |
| 202 | 197 | /* channel 0 = CRASH.S -> CRASH.S/SM */ |
| 203 | 198 | MCFG_SOUND_ROUTE(0, "fspeaker", 0.25) |
| r31905 | r31906 | |
| 299 | 294 | } |
| 300 | 295 | |
| 301 | 296 | |
| 302 | | INLINE void subroc3d_update_volume(samples_device *samples, int leftchan, UINT8 dis, UINT8 dir) |
| 297 | inline void turbo_state::subroc3d_update_volume(int leftchan, UINT8 dis, UINT8 dir) |
| 303 | 298 | { |
| 304 | 299 | float volume = (float)(15 - dis) / 16.0f; |
| 305 | 300 | float lvol, rvol; |
| r31905 | r31906 | |
| 314 | 309 | lvol = rvol = 0; |
| 315 | 310 | |
| 316 | 311 | /* if the sample is playing, adjust it */ |
| 317 | | samples->set_volume(leftchan + 0, lvol); |
| 318 | | samples->set_volume(leftchan + 1, rvol); |
| 312 | m_samples->set_volume(leftchan + 0, lvol); |
| 313 | m_samples->set_volume(leftchan + 1, rvol); |
| 319 | 314 | } |
| 320 | 315 | |
| 321 | 316 | |
| r31905 | r31906 | |
| 334 | 329 | m_samples->start(0, 0, true); |
| 335 | 330 | m_samples->start(1, 0, true); |
| 336 | 331 | } |
| 337 | | subroc3d_update_volume(m_samples, 0, m_subroc3d_mdis, m_subroc3d_mdir); |
| 332 | subroc3d_update_volume(0, m_subroc3d_mdis, m_subroc3d_mdir); |
| 338 | 333 | } |
| 339 | 334 | |
| 340 | 335 | /* bit 1 latches direction/volume for torpedo */ |
| r31905 | r31906 | |
| 347 | 342 | m_samples->start(2, 1, true); |
| 348 | 343 | m_samples->start(3, 1, true); |
| 349 | 344 | } |
| 350 | | subroc3d_update_volume(m_samples, 2, m_subroc3d_tdis, m_subroc3d_tdir); |
| 345 | subroc3d_update_volume(2, m_subroc3d_tdis, m_subroc3d_tdir); |
| 351 | 346 | } |
| 352 | 347 | |
| 353 | 348 | /* bit 2 latches direction/volume for fighter */ |
| r31905 | r31906 | |
| 360 | 355 | m_samples->start(4, 2, true); |
| 361 | 356 | m_samples->start(5, 2, true); |
| 362 | 357 | } |
| 363 | | subroc3d_update_volume(m_samples, 4, m_subroc3d_fdis, m_subroc3d_fdir); |
| 358 | subroc3d_update_volume(4, m_subroc3d_fdis, m_subroc3d_fdir); |
| 364 | 359 | } |
| 365 | 360 | |
| 366 | 361 | /* bit 3 latches direction/volume for hit */ |
| r31905 | r31906 | |
| 368 | 363 | { |
| 369 | 364 | m_subroc3d_hdis = m_sound_state[0] & 0x0f; |
| 370 | 365 | m_subroc3d_hdir = (m_sound_state[0] >> 4) & 0x07; |
| 371 | | subroc3d_update_volume(m_samples, 6, m_subroc3d_hdis, m_subroc3d_hdir); |
| 366 | subroc3d_update_volume(6, m_subroc3d_hdis, m_subroc3d_hdir); |
| 372 | 367 | } |
| 373 | 368 | } |
| 374 | 369 | |
| r31905 | r31906 | |
| 433 | 428 | 0 |
| 434 | 429 | }; |
| 435 | 430 | |
| 436 | | |
| 437 | | static const samples_interface subroc3d_samples_interface = |
| 438 | | { |
| 439 | | 12, |
| 440 | | subroc3d_sample_names |
| 441 | | }; |
| 442 | | |
| 443 | | |
| 444 | 431 | MACHINE_CONFIG_FRAGMENT( subroc3d_samples ) |
| 445 | 432 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 446 | 433 | |
| 447 | | MCFG_SAMPLES_ADD("samples", subroc3d_samples_interface) |
| 434 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 435 | MCFG_SAMPLES_CHANNELS(12) |
| 436 | MCFG_SAMPLES_NAMES(subroc3d_sample_names) |
| 448 | 437 | |
| 449 | 438 | /* MISSILE in channels 0 and 1 */ |
| 450 | 439 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| r31905 | r31906 | |
| 487 | 476 | * |
| 488 | 477 | *************************************/ |
| 489 | 478 | |
| 490 | | static void buckrog_update_samples(turbo_state *state, samples_device *samples) |
| 479 | void turbo_state::buckrog_update_samples() |
| 491 | 480 | { |
| 492 | 481 | /* accelerator sounds */ |
| 493 | | if (samples->playing(5)) |
| 494 | | samples->set_frequency(5, samples->base_frequency(5) * (state->m_buckrog_myship / 100.25 + 1)); |
| 482 | if (m_samples->playing(5)) |
| 483 | m_samples->set_frequency(5, m_samples->base_frequency(5) * (m_buckrog_myship / 100.25 + 1)); |
| 495 | 484 | } |
| 496 | 485 | |
| 497 | 486 | |
| r31905 | r31906 | |
| 508 | 497 | if ((diff & 0x20) && (data & 0x20)) |
| 509 | 498 | { |
| 510 | 499 | m_buckrog_myship = data & 0x0f; |
| 511 | | buckrog_update_samples(this, m_samples); |
| 500 | buckrog_update_samples(); |
| 512 | 501 | } |
| 513 | 502 | |
| 514 | 503 | /* /ALARM0: channel 0 */ |
| r31905 | r31906 | |
| 540 | 529 | if ((diff & 0x10) && !(data & 0x10)) |
| 541 | 530 | { |
| 542 | 531 | m_samples->start(3, 7); |
| 543 | | buckrog_update_samples(this, m_samples); |
| 532 | buckrog_update_samples(); |
| 544 | 533 | } |
| 545 | 534 | |
| 546 | 535 | /* /REBOUND: channel 4 */ |
| r31905 | r31906 | |
| 550 | 539 | if ((diff & 0x40) && (data & 0x40) && !m_samples->playing(5)) |
| 551 | 540 | { |
| 552 | 541 | m_samples->start(5, 8, true); |
| 553 | | buckrog_update_samples(this, m_samples); |
| 542 | buckrog_update_samples(); |
| 554 | 543 | } |
| 555 | 544 | if ((diff & 0x40) && !(data & 0x40) && m_samples->playing(5)) m_samples->stop(5); |
| 556 | 545 | |
| r31905 | r31906 | |
| 584 | 573 | }; |
| 585 | 574 | |
| 586 | 575 | |
| 587 | | static const samples_interface buckrog_samples_interface = |
| 588 | | { |
| 589 | | 6, /* 6 channels */ |
| 590 | | buckrog_sample_names |
| 591 | | }; |
| 592 | | |
| 593 | | |
| 594 | 576 | MACHINE_CONFIG_FRAGMENT( buckrog_samples ) |
| 595 | 577 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 596 | | MCFG_SAMPLES_ADD("samples", buckrog_samples_interface) |
| 578 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 579 | MCFG_SAMPLES_CHANNELS(6) |
| 580 | MCFG_SAMPLES_NAMES(buckrog_sample_names) |
| 597 | 581 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 598 | 582 | MACHINE_CONFIG_END |
| 599 | 583 | |
trunk/src/mame/audio/polyplay.c
| r31905 | r31906 | |
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | |
| 21 | | SAMPLES_START( polyplay_sh_start ) |
| 21 | SAMPLES_START_CB_MEMBER(polyplay_state::sh_start) |
| 22 | 22 | { |
| 23 | | polyplay_state *state = device.machine().driver_data<polyplay_state>(); |
| 24 | 23 | int i; |
| 25 | 24 | |
| 26 | 25 | for (i = 0; i < SAMPLE_LENGTH / 2; i++) { |
| 27 | | state->m_backgroundwave[i] = + SAMPLE_AMPLITUDE; |
| 26 | m_backgroundwave[i] = + SAMPLE_AMPLITUDE; |
| 28 | 27 | } |
| 29 | 28 | for (i = SAMPLE_LENGTH / 2; i < SAMPLE_LENGTH; i++) { |
| 30 | | state->m_backgroundwave[i] = - SAMPLE_AMPLITUDE; |
| 29 | m_backgroundwave[i] = - SAMPLE_AMPLITUDE; |
| 31 | 30 | } |
| 32 | | state->m_freq1 = state->m_freq2 = 110; |
| 33 | | state->m_channel_playing1 = 0; |
| 34 | | state->m_channel_playing2 = 0; |
| 31 | m_freq1 = m_freq2 = 110; |
| 32 | m_channel_playing1 = 0; |
| 33 | m_channel_playing2 = 0; |
| 35 | 34 | } |
| 36 | 35 | |
| 37 | | void polyplay_set_channel1(running_machine &machine, int active) |
| 36 | void polyplay_state::set_channel1(int active) |
| 38 | 37 | { |
| 39 | | polyplay_state *state = machine.driver_data<polyplay_state>(); |
| 40 | | state->m_channel_playing1 = active; |
| 38 | m_channel_playing1 = active; |
| 41 | 39 | } |
| 42 | 40 | |
| 43 | | void polyplay_set_channel2(running_machine &machine, int active) |
| 41 | void polyplay_state::set_channel2(int active) |
| 44 | 42 | { |
| 45 | | polyplay_state *state = machine.driver_data<polyplay_state>(); |
| 46 | | state->m_channel_playing2 = active; |
| 43 | m_channel_playing2 = active; |
| 47 | 44 | } |
| 48 | 45 | |
| 49 | | void polyplay_play_channel1(running_machine &machine, int data) |
| 46 | void polyplay_state::play_channel1(int data) |
| 50 | 47 | { |
| 51 | | polyplay_state *state = machine.driver_data<polyplay_state>(); |
| 52 | 48 | if (data) { |
| 53 | | state->m_freq1 = 2457600 / 16 / data / 8; |
| 54 | | state->m_samples->set_volume(0, state->m_channel_playing1 * 1.0); |
| 55 | | state->m_samples->start_raw(0, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq1,true); |
| 49 | m_freq1 = 2457600 / 16 / data / 8; |
| 50 | m_samples->set_volume(0, m_channel_playing1 * 1.0); |
| 51 | m_samples->start_raw(0, m_backgroundwave, ARRAY_LENGTH(m_backgroundwave), sizeof(m_backgroundwave)*m_freq1,true); |
| 56 | 52 | } |
| 57 | 53 | else { |
| 58 | | state->m_samples->stop(0); |
| 59 | | state->m_samples->stop(1); |
| 54 | m_samples->stop(0); |
| 55 | m_samples->stop(1); |
| 60 | 56 | } |
| 61 | 57 | } |
| 62 | 58 | |
| 63 | | void polyplay_play_channel2(running_machine &machine, int data) |
| 59 | void polyplay_state::play_channel2(int data) |
| 64 | 60 | { |
| 65 | | polyplay_state *state = machine.driver_data<polyplay_state>(); |
| 66 | 61 | if (data) { |
| 67 | | state->m_freq2 = 2457600 / 16 / data / 8; |
| 68 | | state->m_samples->set_volume(1, state->m_channel_playing2 * 1.0); |
| 69 | | state->m_samples->start_raw(1, state->m_backgroundwave, ARRAY_LENGTH(state->m_backgroundwave), sizeof(state->m_backgroundwave)*state->m_freq2,true); |
| 62 | m_freq2 = 2457600 / 16 / data / 8; |
| 63 | m_samples->set_volume(1, m_channel_playing2 * 1.0); |
| 64 | m_samples->start_raw(1, m_backgroundwave, ARRAY_LENGTH(m_backgroundwave), sizeof(m_backgroundwave)*m_freq2,true); |
| 70 | 65 | } |
| 71 | 66 | else { |
| 72 | | state->m_samples->stop(0); |
| 73 | | state->m_samples->stop(1); |
| 67 | m_samples->stop(0); |
| 68 | m_samples->stop(1); |
| 74 | 69 | } |
| 75 | 70 | } |
trunk/src/mame/audio/cclimber.c
| r31905 | r31906 | |
| 8 | 8 | |
| 9 | 9 | #define SND_CLOCK 3072000 /* 3.072 MHz */ |
| 10 | 10 | |
| 11 | | static INT16 *samplebuf; /* buffer to decode samples at run time */ |
| 12 | | |
| 13 | | static SAMPLES_START( cclimber_sh_start ) |
| 11 | SAMPLES_START_CB_MEMBER( cclimber_audio_device::sh_start ) |
| 14 | 12 | { |
| 15 | | running_machine &machine = device.machine(); |
| 16 | | samplebuf = 0; |
| 17 | | if (machine.root_device().memregion("samples")->base()) |
| 18 | | samplebuf = auto_alloc_array(machine, INT16, 2 * machine.root_device().memregion("samples")->bytes()); |
| 13 | if (machine().root_device().memregion("samples")->base()) |
| 14 | m_sample_buf = auto_alloc_array(machine(), INT16, 2 * machine().root_device().memregion("samples")->bytes()); |
| 19 | 15 | } |
| 20 | 16 | |
| 21 | | const samples_interface cclimber_samples_interface = |
| 22 | | { |
| 23 | | 1, |
| 24 | | NULL, |
| 25 | | cclimber_sh_start |
| 26 | | }; |
| 27 | | |
| 28 | 17 | MACHINE_CONFIG_FRAGMENT( cclimber_audio ) |
| 29 | 18 | MCFG_SOUND_ADD("aysnd", AY8910, SND_CLOCK/2) |
| 30 | 19 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(cclimber_audio_device, sample_select_w)) |
| 31 | 20 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.50) |
| 32 | 21 | |
| 33 | | MCFG_SAMPLES_ADD("samples", cclimber_samples_interface) |
| 22 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 23 | MCFG_SAMPLES_CHANNELS(1) |
| 24 | MCFG_SAMPLES_START_CB(cclimber_audio_device, sh_start) |
| 34 | 25 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, ":mono", 0.5) |
| 35 | 26 | MACHINE_CONFIG_END |
| 36 | 27 | |
| r31905 | r31906 | |
| 51 | 42 | |
| 52 | 43 | cclimber_audio_device::cclimber_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 53 | 44 | : device_t(mconfig, CCLIMBER_AUDIO, "Crazy Climber Sound Board", tag, owner, clock, "cclimber_audio", __FILE__), |
| 45 | m_sample_buf(NULL), |
| 54 | 46 | m_sample_num(0), |
| 55 | 47 | m_sample_freq(0), |
| 56 | 48 | m_sample_volume(0), |
| r31905 | r31906 | |
| 116 | 108 | int sample; |
| 117 | 109 | |
| 118 | 110 | sample = (rom[start + len] & 0xf0) >> 4; |
| 119 | | samplebuf[2*len] = SAMPLE_CONV4(sample) * volume / 31; |
| 111 | m_sample_buf[2*len] = SAMPLE_CONV4(sample) * volume / 31; |
| 120 | 112 | |
| 121 | 113 | sample = rom[start + len] & 0x0f; |
| 122 | | samplebuf[2*len + 1] = SAMPLE_CONV4(sample) * volume / 31; |
| 114 | m_sample_buf[2*len + 1] = SAMPLE_CONV4(sample) * volume / 31; |
| 123 | 115 | |
| 124 | 116 | len++; |
| 125 | 117 | } |
| 126 | 118 | |
| 127 | | m_samples->start_raw(0,samplebuf,2 * len,freq); |
| 119 | m_samples->start_raw(0,m_sample_buf,2 * len,freq); |
| 128 | 120 | } |
trunk/src/mame/includes/meadows.h
| r31905 | r31906 | |
| 13 | 13 | public: |
| 14 | 14 | meadows_state(const machine_config &mconfig, device_type type, const char *tag) |
| 15 | 15 | : driver_device(mconfig, type, tag), |
| 16 | | m_spriteram(*this, "spriteram"), |
| 17 | | m_videoram(*this, "videoram"), |
| 18 | 16 | m_maincpu(*this, "maincpu"), |
| 19 | 17 | m_audiocpu(*this, "audiocpu"), |
| 20 | 18 | m_dac(*this, "dac"), |
| 21 | 19 | m_samples(*this, "samples"), |
| 22 | 20 | m_gfxdecode(*this, "gfxdecode"), |
| 23 | 21 | m_screen(*this, "screen"), |
| 24 | | m_palette(*this, "palette") |
| 22 | m_palette(*this, "palette"), |
| 23 | m_spriteram(*this, "spriteram"), |
| 24 | m_videoram(*this, "videoram") |
| 25 | 25 | { |
| 26 | 26 | } |
| 27 | |
| 28 | required_device<s2650_device> m_maincpu; |
| 29 | optional_device<s2650_device> m_audiocpu; |
| 30 | optional_device<dac_device> m_dac; |
| 31 | optional_device<samples_device> m_samples; |
| 32 | required_device<gfxdecode_device> m_gfxdecode; |
| 33 | required_device<screen_device> m_screen; |
| 34 | required_device<palette_device> m_palette; |
| 27 | 35 | |
| 28 | 36 | optional_shared_ptr<UINT8> m_spriteram; |
| 29 | 37 | required_shared_ptr<UINT8> m_videoram; |
| 38 | |
| 30 | 39 | UINT8 m_dac_data; |
| 31 | 40 | int m_dac_enable; |
| 32 | 41 | int m_channel; |
| r31905 | r31906 | |
| 60 | 69 | INTERRUPT_GEN_MEMBER(minferno_interrupt); |
| 61 | 70 | INTERRUPT_GEN_MEMBER(audio_interrupt); |
| 62 | 71 | void draw_sprites(bitmap_ind16 &bitmap, const rectangle &clip); |
| 63 | | required_device<s2650_device> m_maincpu; |
| 64 | | optional_device<s2650_device> m_audiocpu; |
| 65 | | optional_device<dac_device> m_dac; |
| 66 | | optional_device<samples_device> m_samples; |
| 67 | | required_device<gfxdecode_device> m_gfxdecode; |
| 68 | | required_device<screen_device> m_screen; |
| 69 | | required_device<palette_device> m_palette; |
| 72 | void meadows_sh_dac_w(int data); |
| 73 | void meadows_sh_update(); |
| 74 | SAMPLES_START_CB_MEMBER(meadows_sh_start); |
| 70 | 75 | }; |
| 71 | | |
| 72 | | |
| 73 | | /*----------- defined in audio/meadows.c -----------*/ |
| 74 | | |
| 75 | | SAMPLES_START( meadows_sh_start ); |
| 76 | | void meadows_sh_dac_w(running_machine &machine, int data); |
| 77 | | void meadows_sh_update(running_machine &machine); |
trunk/src/mame/includes/polyplay.h
| r31905 | r31906 | |
| 15 | 15 | m_palette(*this, "palette") { } |
| 16 | 16 | |
| 17 | 17 | required_shared_ptr<UINT8> m_videoram; |
| 18 | required_shared_ptr<UINT8> m_characterram; |
| 19 | |
| 20 | required_device<cpu_device> m_maincpu; |
| 21 | required_device<samples_device> m_samples; |
| 22 | required_device<gfxdecode_device> m_gfxdecode; |
| 23 | required_device<palette_device> m_palette; |
| 24 | |
| 18 | 25 | int m_freq1; |
| 19 | 26 | int m_freq2; |
| 20 | 27 | int m_channel_playing1; |
| r31905 | r31906 | |
| 28 | 35 | int m_channel2_const; |
| 29 | 36 | timer_device* m_timer; |
| 30 | 37 | int m_last; |
| 31 | | required_shared_ptr<UINT8> m_characterram; |
| 38 | |
| 32 | 39 | DECLARE_WRITE8_MEMBER(polyplay_sound_channel); |
| 33 | 40 | DECLARE_WRITE8_MEMBER(polyplay_start_timer2); |
| 34 | 41 | DECLARE_READ8_MEMBER(polyplay_random_read); |
| 35 | 42 | DECLARE_WRITE8_MEMBER(polyplay_characterram_w); |
| 43 | SAMPLES_START_CB_MEMBER(sh_start); |
| 44 | void set_channel1(int active); |
| 45 | void set_channel2(int active); |
| 46 | void play_channel1(int data); |
| 47 | void play_channel2(int data); |
| 36 | 48 | virtual void machine_reset(); |
| 37 | 49 | virtual void video_start(); |
| 38 | 50 | DECLARE_PALETTE_INIT(polyplay); |
| r31905 | r31906 | |
| 40 | 52 | INTERRUPT_GEN_MEMBER(periodic_interrupt); |
| 41 | 53 | INTERRUPT_GEN_MEMBER(coin_interrupt); |
| 42 | 54 | TIMER_DEVICE_CALLBACK_MEMBER(polyplay_timer_callback); |
| 43 | | required_device<cpu_device> m_maincpu; |
| 44 | | required_device<samples_device> m_samples; |
| 45 | | required_device<gfxdecode_device> m_gfxdecode; |
| 46 | | required_device<palette_device> m_palette; |
| 47 | 55 | }; |
| 48 | | |
| 49 | | |
| 50 | | /*----------- defined in audio/polyplay.c -----------*/ |
| 51 | | |
| 52 | | void polyplay_set_channel1(running_machine &machine, int active); |
| 53 | | void polyplay_set_channel2(running_machine &machine, int active); |
| 54 | | void polyplay_play_channel1(running_machine &machine, int data); |
| 55 | | void polyplay_play_channel2(running_machine &machine, int data); |
| 56 | | SAMPLES_START( polyplay_sh_start ); |
trunk/src/mame/drivers/8080bw.c
| r31905 | r31906 | |
| 1059 | 1059 | /* sound hardware */ |
| 1060 | 1060 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1061 | 1061 | |
| 1062 | | MCFG_SAMPLES_ADD("samples", lrescue_samples_interface) |
| 1062 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1063 | MCFG_SAMPLES_CHANNELS(4) |
| 1064 | MCFG_SAMPLES_NAMES(lrescue_sample_names) |
| 1063 | 1065 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 1064 | 1066 | |
| 1065 | 1067 | /* extra audio channel */ |
| r31905 | r31906 | |
| 1663 | 1665 | MCFG_SOUND_CONFIG(lupin3_sn76477_interface) |
| 1664 | 1666 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1665 | 1667 | |
| 1666 | | MCFG_SAMPLES_ADD("samples", lupin3_samples_interface) |
| 1668 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1669 | MCFG_SAMPLES_CHANNELS(4) |
| 1670 | MCFG_SAMPLES_NAMES(lupin3_sample_names) |
| 1667 | 1671 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1668 | 1672 | |
| 1669 | 1673 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r31905 | r31906 | |
| 1693 | 1697 | MCFG_SOUND_CONFIG(lupin3_sn76477_interface) |
| 1694 | 1698 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 1695 | 1699 | |
| 1696 | | MCFG_SAMPLES_ADD("samples", lupin3_samples_interface) |
| 1700 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1701 | MCFG_SAMPLES_CHANNELS(4) |
| 1702 | MCFG_SAMPLES_NAMES(lupin3_sample_names) |
| 1697 | 1703 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1698 | 1704 | |
| 1699 | 1705 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
trunk/src/mame/drivers/snk6502.c
| r31905 | r31906 | |
| 827 | 827 | MCFG_SOUND_ADD("snk6502", SNK6502, 0) |
| 828 | 828 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 829 | 829 | |
| 830 | | MCFG_SAMPLES_ADD("samples", sasuke_samples_interface) |
| 830 | |
| 831 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 832 | MCFG_SAMPLES_CHANNELS(4) |
| 833 | MCFG_SAMPLES_NAMES(sasuke_sample_names) |
| 831 | 834 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.12) |
| 832 | 835 | |
| 833 | 836 | MCFG_SOUND_ADD("sn76477.1", SN76477, 0) |
| r31905 | r31906 | |
| 854 | 857 | MCFG_GFXDECODE_MODIFY("gfxdecode", satansat) |
| 855 | 858 | |
| 856 | 859 | // sound hardware |
| 857 | | MCFG_SAMPLES_REPLACE("samples", vanguard_samples_interface) |
| 860 | MCFG_SOUND_MODIFY("samples") |
| 861 | MCFG_SAMPLES_CHANNELS(3) |
| 862 | MCFG_SAMPLES_NAMES(vanguard_sample_names) |
| 858 | 863 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 859 | 864 | |
| 860 | 865 | MCFG_SOUND_REPLACE("sn76477.1", SN76477, 0) |
| r31905 | r31906 | |
| 901 | 906 | MCFG_SOUND_ADD("snk6502", SNK6502, 0) |
| 902 | 907 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 903 | 908 | |
| 904 | | MCFG_SAMPLES_ADD("samples", vanguard_samples_interface) |
| 909 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 910 | MCFG_SAMPLES_CHANNELS(3) |
| 911 | MCFG_SAMPLES_NAMES(vanguard_sample_names) |
| 905 | 912 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 906 | 913 | |
| 907 | 914 | MCFG_SOUND_ADD("sn76477.1", SN76477, 0) |
| r31905 | r31906 | |
| 919 | 926 | MCFG_CPU_PROGRAM_MAP(fantasy_map) |
| 920 | 927 | |
| 921 | 928 | // sound hardware |
| 922 | | MCFG_SAMPLES_REPLACE("samples", fantasy_samples_interface) |
| 929 | MCFG_SOUND_MODIFY("samples") |
| 930 | MCFG_SAMPLES_CHANNELS(1) |
| 931 | MCFG_SAMPLES_NAMES(fantasy_sample_names) |
| 923 | 932 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 924 | 933 | |
| 925 | 934 | MCFG_SOUND_REPLACE("sn76477.1", SN76477, 0) |
trunk/src/mame/drivers/segag80v.c
| r31905 | r31906 | |
| 814 | 814 | 0 /* end of array */ |
| 815 | 815 | }; |
| 816 | 816 | |
| 817 | | static const samples_interface elim2_samples_interface = |
| 818 | | { |
| 819 | | 8, /* 8 channels */ |
| 820 | | elim_sample_names |
| 821 | | }; |
| 822 | 817 | |
| 823 | | |
| 824 | | |
| 825 | 818 | /************************************* |
| 826 | 819 | * |
| 827 | 820 | * Space Fury sound interfaces |
| r31905 | r31906 | |
| 845 | 838 | 0 /* end of array */ |
| 846 | 839 | }; |
| 847 | 840 | |
| 848 | | |
| 849 | | static const samples_interface spacfury_samples_interface = |
| 850 | | { |
| 851 | | 8, /* 8 channels */ |
| 852 | | spacfury_sample_names |
| 853 | | }; |
| 854 | | |
| 855 | | |
| 856 | 841 | /************************************* |
| 857 | 842 | * |
| 858 | 843 | * Zektor sound interfaces |
| r31905 | r31906 | |
| 877 | 862 | }; |
| 878 | 863 | |
| 879 | 864 | |
| 880 | | static const samples_interface zektor_samples_interface = |
| 881 | | { |
| 882 | | 8, |
| 883 | | zektor_sample_names |
| 884 | | }; |
| 885 | | |
| 886 | | |
| 887 | | |
| 888 | 865 | /************************************* |
| 889 | 866 | * |
| 890 | 867 | * Machine drivers |
| r31905 | r31906 | |
| 918 | 895 | static MACHINE_CONFIG_DERIVED( elim2, g80v_base ) |
| 919 | 896 | |
| 920 | 897 | /* custom sound board */ |
| 921 | | MCFG_SAMPLES_ADD("samples", elim2_samples_interface) |
| 898 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 899 | MCFG_SAMPLES_CHANNELS(8) |
| 900 | MCFG_SAMPLES_NAMES(elim_sample_names) |
| 922 | 901 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 923 | 902 | MACHINE_CONFIG_END |
| 924 | 903 | |
| r31905 | r31906 | |
| 926 | 905 | static MACHINE_CONFIG_DERIVED( spacfury, g80v_base ) |
| 927 | 906 | |
| 928 | 907 | /* custom sound board */ |
| 929 | | MCFG_SAMPLES_ADD("samples", spacfury_samples_interface) |
| 908 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 909 | MCFG_SAMPLES_CHANNELS(8) |
| 910 | MCFG_SAMPLES_NAMES(spacfury_sample_names) |
| 930 | 911 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 931 | 912 | |
| 932 | 913 | /* speech board */ |
| r31905 | r31906 | |
| 937 | 918 | static MACHINE_CONFIG_DERIVED( zektor, g80v_base ) |
| 938 | 919 | |
| 939 | 920 | /* custom sound board */ |
| 940 | | MCFG_SAMPLES_ADD("samples", zektor_samples_interface) |
| 921 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 922 | MCFG_SAMPLES_CHANNELS(8) |
| 923 | MCFG_SAMPLES_NAMES(zektor_sample_names) |
| 941 | 924 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 942 | 925 | |
| 943 | 926 | MCFG_SOUND_ADD("aysnd", AY8910, CPU_CLOCK/2/2) |
trunk/src/mame/drivers/astrocde.c
| r31905 | r31906 | |
| 1206 | 1206 | 0 |
| 1207 | 1207 | }; |
| 1208 | 1208 | |
| 1209 | | static const samples_interface seawolf2_samples_interface = |
| 1210 | | { |
| 1211 | | 10, /* 5*2 channels */ |
| 1212 | | seawolf_sample_names |
| 1213 | | }; |
| 1214 | | |
| 1215 | | static const samples_interface wow_samples_interface = |
| 1216 | | { |
| 1217 | | 1, |
| 1218 | | wow_sample_names |
| 1219 | | }; |
| 1220 | | |
| 1221 | | static const samples_interface gorf_samples_interface = |
| 1222 | | { |
| 1223 | | 1, |
| 1224 | | gorf_sample_names |
| 1225 | | }; |
| 1226 | | |
| 1227 | | |
| 1228 | | |
| 1229 | 1209 | /************************************* |
| 1230 | 1210 | * |
| 1231 | 1211 | * CPU configurations |
| r31905 | r31906 | |
| 1322 | 1302 | /* sound hardware */ |
| 1323 | 1303 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1324 | 1304 | |
| 1325 | | MCFG_SAMPLES_ADD("samples", seawolf2_samples_interface) |
| 1305 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1306 | MCFG_SAMPLES_CHANNELS(10) /* 5*2 channels */ |
| 1307 | MCFG_SAMPLES_NAMES(seawolf_sample_names) |
| 1326 | 1308 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.25) |
| 1327 | 1309 | MCFG_SOUND_ROUTE(1, "lspeaker", 0.25) |
| 1328 | 1310 | MCFG_SOUND_ROUTE(2, "lspeaker", 0.25) |
| r31905 | r31906 | |
| 1355 | 1337 | MCFG_CPU_IO_MAP(port_map_mono_pattern) |
| 1356 | 1338 | MACHINE_CONFIG_END |
| 1357 | 1339 | |
| 1358 | | |
| 1359 | | #if !USE_FAKE_VOTRAX |
| 1360 | | static votrax_sc01_interface votrax_interface = |
| 1361 | | { |
| 1362 | | DEVCB_NULL |
| 1363 | | }; |
| 1364 | | #endif |
| 1365 | | |
| 1366 | 1340 | static MACHINE_CONFIG_DERIVED( wow, astrocade_base ) |
| 1367 | 1341 | MCFG_FRAGMENT_ADD(astrocade_stereo_sound) |
| 1368 | 1342 | |
| r31905 | r31906 | |
| 1380 | 1354 | MCFG_SPEAKER_ADD("center", 0.0, 0.0, 1.0) |
| 1381 | 1355 | |
| 1382 | 1356 | #if USE_FAKE_VOTRAX |
| 1383 | | MCFG_SAMPLES_ADD("samples", wow_samples_interface) |
| 1357 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1358 | MCFG_SAMPLES_CHANNELS(1) |
| 1359 | MCFG_SAMPLES_NAMES(wow_sample_names) |
| 1384 | 1360 | #else |
| 1385 | | MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrax_interface) |
| 1361 | MCFG_VOTRAX_SC01_ADD("votrax", VOTRAX_SC01, 720000) |
| 1386 | 1362 | #endif |
| 1387 | 1363 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "center", 0.85) |
| 1388 | 1364 | MACHINE_CONFIG_END |
| r31905 | r31906 | |
| 1410 | 1386 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lower", 1.0) |
| 1411 | 1387 | |
| 1412 | 1388 | #if USE_FAKE_VOTRAX |
| 1413 | | MCFG_SAMPLES_ADD("samples", gorf_samples_interface) |
| 1389 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1390 | MCFG_SAMPLES_CHANNELS(1) |
| 1391 | MCFG_SAMPLES_NAMES(gorf_sample_names) |
| 1414 | 1392 | #else |
| 1415 | | MCFG_VOTRAX_SC01_ADD("votrax", 720000, votrax_interface) |
| 1393 | MCFG_VOTRAX_SC01_ADD("votrax", VOTRAX_SC01, 720000) |
| 1416 | 1394 | #endif |
| 1417 | 1395 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "upper", 0.85) |
| 1418 | 1396 | MACHINE_CONFIG_END |
trunk/src/mame/drivers/circus.c
| r31905 | r31906 | |
| 300 | 300 | /* sound hardware */ |
| 301 | 301 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 302 | 302 | |
| 303 | | MCFG_SAMPLES_ADD("samples", circus_samples_interface) |
| 303 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 304 | MCFG_SAMPLES_CHANNELS(3) |
| 305 | MCFG_SAMPLES_NAMES(circus_sample_names) |
| 304 | 306 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 305 | 307 | |
| 306 | 308 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r31905 | r31906 | |
| 333 | 335 | /* sound hardware */ |
| 334 | 336 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 335 | 337 | |
| 336 | | MCFG_SAMPLES_ADD("samples", robotbwl_samples_interface) |
| 338 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 339 | MCFG_SAMPLES_CHANNELS(5) |
| 340 | MCFG_SAMPLES_NAMES(robotbwl_sample_names) |
| 337 | 341 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 338 | 342 | |
| 339 | 343 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r31905 | r31906 | |
| 373 | 377 | /* sound hardware */ |
| 374 | 378 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 375 | 379 | |
| 376 | | MCFG_SAMPLES_ADD("samples", crash_samples_interface) |
| 380 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 381 | MCFG_SAMPLES_CHANNELS(1) |
| 382 | MCFG_SAMPLES_NAMES(crash_sample_names) |
| 377 | 383 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 378 | 384 | |
| 379 | 385 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
| r31905 | r31906 | |
| 405 | 411 | /* sound hardware */ |
| 406 | 412 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 407 | 413 | |
| 408 | | MCFG_SAMPLES_ADD("samples", ripcord_samples_interface) |
| 414 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 415 | MCFG_SAMPLES_CHANNELS(4) |
| 416 | MCFG_SAMPLES_NAMES(ripcord_sample_names) |
| 409 | 417 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 410 | 418 | |
| 411 | 419 | MCFG_SOUND_ADD("discrete", DISCRETE, 0) |
trunk/src/mame/drivers/cosmic.c
| r31905 | r31906 | |
| 901 | 901 | }; |
| 902 | 902 | |
| 903 | 903 | |
| 904 | | static const samples_interface cosmica_samples_interface = |
| 905 | | { |
| 906 | | 13, /* 12 channels */ |
| 907 | | cosmica_sample_names |
| 908 | | }; |
| 909 | | |
| 910 | | |
| 911 | 904 | static const char *const panic_sample_names[] = |
| 912 | 905 | { |
| 913 | 906 | "*panic", |
| r31905 | r31906 | |
| 925 | 918 | 0 |
| 926 | 919 | }; |
| 927 | 920 | |
| 928 | | static const samples_interface panic_samples_interface = |
| 929 | | { |
| 930 | | 9, /* 9 channels */ |
| 931 | | panic_sample_names |
| 932 | | }; |
| 933 | 921 | |
| 934 | 922 | static const char *const cosmicg_sample_names[] = |
| 935 | 923 | { |
| r31905 | r31906 | |
| 952 | 940 | 0 |
| 953 | 941 | }; |
| 954 | 942 | |
| 955 | | static const samples_interface cosmicg_samples_interface = |
| 956 | | { |
| 957 | | 9, /* 9 channels */ |
| 958 | | cosmicg_sample_names |
| 959 | | }; |
| 960 | 943 | |
| 961 | | |
| 962 | 944 | MACHINE_START_MEMBER(cosmic_state,cosmic) |
| 963 | 945 | { |
| 964 | 946 | save_item(NAME(m_sound_enabled)); |
| r31905 | r31906 | |
| 1038 | 1020 | /* sound hardware */ |
| 1039 | 1021 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1040 | 1022 | |
| 1041 | | MCFG_SAMPLES_ADD("samples", panic_samples_interface) |
| 1023 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1024 | MCFG_SAMPLES_CHANNELS(9) |
| 1025 | MCFG_SAMPLES_NAMES(panic_sample_names) |
| 1042 | 1026 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1043 | 1027 | |
| 1044 | 1028 | MCFG_DAC_ADD("dac") |
| r31905 | r31906 | |
| 1064 | 1048 | /* sound hardware */ |
| 1065 | 1049 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1066 | 1050 | |
| 1067 | | MCFG_SAMPLES_ADD("samples", cosmica_samples_interface) |
| 1051 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1052 | MCFG_SAMPLES_CHANNELS(13) |
| 1053 | MCFG_SAMPLES_NAMES(cosmica_sample_names) |
| 1068 | 1054 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1069 | 1055 | |
| 1070 | 1056 | MCFG_DAC_ADD("dac") |
| r31905 | r31906 | |
| 1098 | 1084 | /* sound hardware */ |
| 1099 | 1085 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 1100 | 1086 | |
| 1101 | | MCFG_SAMPLES_ADD("samples", cosmicg_samples_interface) |
| 1087 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1088 | MCFG_SAMPLES_CHANNELS(9) |
| 1089 | MCFG_SAMPLES_NAMES(cosmicg_sample_names) |
| 1102 | 1090 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1103 | 1091 | |
| 1104 | 1092 | MCFG_DAC_ADD("dac") |
trunk/src/mame/drivers/ninjakd2.c
| r31905 | r31906 | |
| 151 | 151 | #include "emu.h" |
| 152 | 152 | #include "cpu/z80/z80.h" |
| 153 | 153 | #include "sound/2203intf.h" |
| 154 | | #include "sound/samples.h" |
| 155 | 154 | #include "machine/mc8123.h" |
| 156 | 155 | #include "includes/ninjakd2.h" |
| 157 | 156 | |
| r31905 | r31906 | |
| 169 | 168 | #define NE555_FREQUENCY 16300 // measured on PCB |
| 170 | 169 | //#define NE555_FREQUENCY (1.0f / (0.693 * (560 + 2*51) * 0.1e-6)) // theoretical: this gives 21.8kHz which is too high |
| 171 | 170 | |
| 172 | | static SAMPLES_START( ninjakd2_init_samples ) |
| 171 | SAMPLES_START_CB_MEMBER(ninjakd2_state::ninjakd2_init_samples) |
| 173 | 172 | { |
| 174 | | ninjakd2_state *state = device.machine().driver_data<ninjakd2_state>(); |
| 175 | | running_machine &machine = device.machine(); |
| 176 | | const UINT8* const rom = state->memregion("pcm")->base(); |
| 177 | | const int length = state->memregion("pcm")->bytes(); |
| 178 | | INT16* sampledata = auto_alloc_array(machine, INT16, length); |
| 173 | const UINT8* const rom = memregion("pcm")->base(); |
| 174 | const int length = memregion("pcm")->bytes(); |
| 175 | INT16* sampledata = auto_alloc_array(machine(), INT16, length); |
| 179 | 176 | |
| 180 | 177 | // convert unsigned 8-bit PCM to signed 16-bit |
| 181 | 178 | for (int i = 0; i < length; ++i) |
| 182 | 179 | sampledata[i] = rom[i] << 7; |
| 183 | 180 | |
| 184 | | state->m_sampledata = sampledata; |
| 181 | m_sampledata = sampledata; |
| 185 | 182 | } |
| 186 | 183 | |
| 187 | 184 | WRITE8_MEMBER(ninjakd2_state::ninjakd2_pcm_play_w) |
| 188 | 185 | { |
| 189 | | samples_device *samples = machine().device<samples_device>("pcm"); |
| 190 | 186 | const UINT8* const rom = memregion("pcm")->base(); |
| 191 | 187 | |
| 192 | 188 | // only Ninja Kid II uses this |
| r31905 | r31906 | |
| 201 | 197 | ++end; |
| 202 | 198 | |
| 203 | 199 | if (end - start) |
| 204 | | samples->start_raw(0, &m_sampledata[start], end - start, NE555_FREQUENCY); |
| 200 | m_pcm->start_raw(0, &m_sampledata[start], end - start, NE555_FREQUENCY); |
| 205 | 201 | else |
| 206 | | samples->stop(0); |
| 202 | m_pcm->stop(0); |
| 207 | 203 | } |
| 208 | 204 | } |
| 209 | 205 | |
| r31905 | r31906 | |
| 870 | 866 | m_soundcpu->set_input_line(0, state ? ASSERT_LINE : CLEAR_LINE); |
| 871 | 867 | } |
| 872 | 868 | |
| 873 | | static const samples_interface ninjakd2_samples_interface = |
| 874 | | { |
| 875 | | 1, /* 1 channel */ |
| 876 | | NULL, |
| 877 | | ninjakd2_init_samples |
| 878 | | }; |
| 879 | | |
| 880 | | |
| 881 | | |
| 882 | 869 | /************************************* |
| 883 | 870 | * |
| 884 | 871 | * Machine drivers |
| r31905 | r31906 | |
| 961 | 948 | MCFG_SOUND_ROUTE(2, "mono", 0.10) |
| 962 | 949 | MCFG_SOUND_ROUTE(3, "mono", 0.50) |
| 963 | 950 | |
| 964 | | MCFG_SAMPLES_ADD("pcm", ninjakd2_samples_interface) |
| 951 | MCFG_SOUND_ADD("pcm", SAMPLES, 0) |
| 952 | MCFG_SAMPLES_CHANNELS(1) |
| 953 | MCFG_SAMPLES_START_CB(ninjakd2_state, ninjakd2_init_samples) |
| 965 | 954 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.80) |
| 966 | 955 | MACHINE_CONFIG_END |
| 967 | 956 | |
trunk/src/mame/drivers/meadows.c
| r31905 | r31906 | |
| 240 | 240 | switch (offset & 3) |
| 241 | 241 | { |
| 242 | 242 | case 0: /* DAC */ |
| 243 | | meadows_sh_dac_w(machine(), data ^ 0xff); |
| 243 | meadows_sh_dac_w(data ^ 0xff); |
| 244 | 244 | break; |
| 245 | 245 | |
| 246 | 246 | case 1: /* counter clk 5 MHz / 256 */ |
| r31905 | r31906 | |
| 248 | 248 | break; |
| 249 | 249 | logerror("audio_w ctr1 preset $%x amp %d\n", data & 15, data >> 4); |
| 250 | 250 | m_0c01 = data; |
| 251 | | meadows_sh_update(machine()); |
| 251 | meadows_sh_update(); |
| 252 | 252 | break; |
| 253 | 253 | |
| 254 | 254 | case 2: /* counter clk 5 MHz / 32 (/ 2 or / 4) */ |
| r31905 | r31906 | |
| 256 | 256 | break; |
| 257 | 257 | logerror("audio_w ctr2 preset $%02x\n", data); |
| 258 | 258 | m_0c02 = data; |
| 259 | | meadows_sh_update(machine()); |
| 259 | meadows_sh_update(); |
| 260 | 260 | break; |
| 261 | 261 | |
| 262 | 262 | case 3: /* audio enable */ |
| r31905 | r31906 | |
| 264 | 264 | break; |
| 265 | 265 | logerror("audio_w enable ctr2/2:%d ctr2:%d dac:%d ctr1:%d\n", data&1, (data>>1)&1, (data>>2)&1, (data>>3)&1); |
| 266 | 266 | m_0c03 = data; |
| 267 | | meadows_sh_update(machine()); |
| 267 | meadows_sh_update(); |
| 268 | 268 | break; |
| 269 | 269 | } |
| 270 | 270 | } |
| r31905 | r31906 | |
| 598 | 598 | 0 |
| 599 | 599 | }; |
| 600 | 600 | |
| 601 | | |
| 602 | | static const samples_interface meadows_samples_interface = |
| 603 | | { |
| 604 | | 2, |
| 605 | | NULL, |
| 606 | | meadows_sh_start |
| 607 | | }; |
| 608 | | |
| 609 | | |
| 610 | | static const samples_interface bowl3d_samples_interface = |
| 611 | | { |
| 612 | | 1, |
| 613 | | bowl3d_sample_names |
| 614 | | }; |
| 615 | | |
| 616 | | |
| 617 | | |
| 618 | 601 | /************************************* |
| 619 | 602 | * |
| 620 | 603 | * Machine drivers |
| r31905 | r31906 | |
| 651 | 634 | MCFG_DAC_ADD("dac") |
| 652 | 635 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 653 | 636 | |
| 654 | | MCFG_SAMPLES_ADD("samples", meadows_samples_interface) |
| 637 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 638 | MCFG_SAMPLES_CHANNELS(2) |
| 639 | MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start) |
| 655 | 640 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 656 | 641 | MACHINE_CONFIG_END |
| 657 | 642 | |
| r31905 | r31906 | |
| 710 | 695 | MCFG_DAC_ADD("dac") |
| 711 | 696 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 712 | 697 | |
| 713 | | MCFG_SAMPLES_ADD("samples", meadows_samples_interface) |
| 698 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 699 | MCFG_SAMPLES_CHANNELS(2) |
| 700 | MCFG_SAMPLES_START_CB(meadows_state, meadows_sh_start) |
| 714 | 701 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 715 | 702 | |
| 716 | | MCFG_SAMPLES_ADD("samples2", bowl3d_samples_interface) |
| 703 | MCFG_SOUND_ADD("samples2", SAMPLES, 0) |
| 704 | MCFG_SAMPLES_CHANNELS(1) |
| 705 | MCFG_SAMPLES_NAMES(bowl3d_sample_names) |
| 717 | 706 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 718 | 707 | MACHINE_CONFIG_END |
| 719 | 708 | |
trunk/src/mame/drivers/safarir.c
| r31905 | r31906 | |
| 243 | 243 | |
| 244 | 244 | WRITE8_MEMBER(safarir_state::safarir_audio_w) |
| 245 | 245 | { |
| 246 | | samples_device *samples = m_samples; |
| 247 | 246 | UINT8 rising_bits = data & ~m_port_last; |
| 248 | 247 | |
| 249 | | if (rising_bits == 0x12) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_1); |
| 250 | | if (rising_bits == 0x02) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_2); |
| 251 | | if (rising_bits == 0x95) samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6); |
| 248 | if (rising_bits == 0x12) m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_1); |
| 249 | if (rising_bits == 0x02) m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND1_2); |
| 250 | if (rising_bits == 0x95) m_samples->start(CHANNEL_SOUND1, SAMPLE_SOUND6); |
| 252 | 251 | |
| 253 | | if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) samples->start(CHANNEL_SOUND2, SAMPLE_SOUND2); |
| 252 | if (rising_bits == 0x04 && (data == 0x15 || data ==0x16)) m_samples->start(CHANNEL_SOUND2, SAMPLE_SOUND2); |
| 254 | 253 | |
| 255 | | if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) samples->start(CHANNEL_SOUND3, SAMPLE_SOUND3, true); |
| 256 | | if (data == 0x00 || rising_bits == 0x01) samples->stop(CHANNEL_SOUND3); |
| 254 | if (data == 0x5f && (rising_bits == 0x49 || rising_bits == 0x5f)) m_samples->start(CHANNEL_SOUND3, SAMPLE_SOUND3, true); |
| 255 | if (data == 0x00 || rising_bits == 0x01) m_samples->stop(CHANNEL_SOUND3); |
| 257 | 256 | |
| 258 | 257 | if (data == 0x13) |
| 259 | 258 | { |
| 260 | 259 | if ((rising_bits == 0x13 && m_port_last != 0x04) || (rising_bits == 0x01 && m_port_last == 0x12)) |
| 261 | 260 | { |
| 262 | | samples->start(CHANNEL_SOUND4, SAMPLE_SOUND7); |
| 261 | m_samples->start(CHANNEL_SOUND4, SAMPLE_SOUND7); |
| 263 | 262 | } |
| 264 | | else if (rising_bits == 0x03 && m_port_last2 == 0x15 && !samples->playing(CHANNEL_SOUND4)) |
| 263 | else if (rising_bits == 0x03 && m_port_last2 == 0x15 && !m_samples->playing(CHANNEL_SOUND4)) |
| 265 | 264 | { |
| 266 | | samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_1); |
| 265 | m_samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_1); |
| 267 | 266 | } |
| 268 | 267 | } |
| 269 | | if (data == 0x53 && m_port_last == 0x55) samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_2); |
| 268 | if (data == 0x53 && m_port_last == 0x55) m_samples->start(CHANNEL_SOUND4, SAMPLE_SOUND4_2); |
| 270 | 269 | |
| 271 | | if (data == 0x1f && rising_bits == 0x1f) samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_1); |
| 272 | | if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_2); |
| 270 | if (data == 0x1f && rising_bits == 0x1f) m_samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_1); |
| 271 | if (data == 0x14 && (rising_bits == 0x14 || rising_bits == 0x04)) m_samples->start(CHANNEL_SOUND5, SAMPLE_SOUND5_2); |
| 273 | 272 | |
| 274 | | if (data == 0x07 && rising_bits == 0x07 && !samples->playing(CHANNEL_SOUND6)) |
| 275 | | samples->start(CHANNEL_SOUND6, SAMPLE_SOUND8); |
| 273 | if (data == 0x07 && rising_bits == 0x07 && !m_samples->playing(CHANNEL_SOUND6)) |
| 274 | m_samples->start(CHANNEL_SOUND6, SAMPLE_SOUND8); |
| 276 | 275 | |
| 277 | 276 | m_port_last2 = m_port_last; |
| 278 | 277 | m_port_last = data; |
| r31905 | r31906 | |
| 297 | 296 | }; |
| 298 | 297 | |
| 299 | 298 | |
| 300 | | static const samples_interface safarir_samples_interface = |
| 301 | | { |
| 302 | | 6, /* 6 channels */ |
| 303 | | safarir_sample_names |
| 304 | | }; |
| 305 | | |
| 306 | | |
| 307 | 299 | static MACHINE_CONFIG_FRAGMENT( safarir_audio ) |
| 308 | 300 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 309 | | MCFG_SAMPLES_ADD("samples", safarir_samples_interface) |
| 301 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 302 | MCFG_SAMPLES_CHANNELS(6) |
| 303 | MCFG_SAMPLES_NAMES(safarir_sample_names) |
| 310 | 304 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 311 | 305 | MACHINE_CONFIG_END |
| 312 | 306 | |
trunk/src/mame/drivers/polyplay.c
| r31905 | r31906 | |
| 90 | 90 | /* timer handling */ |
| 91 | 91 | |
| 92 | 92 | |
| 93 | | |
| 94 | | |
| 95 | | |
| 96 | | /* Polyplay Sound Interface */ |
| 97 | | static const samples_interface polyplay_samples_interface = |
| 98 | | { |
| 99 | | 2, |
| 100 | | NULL, |
| 101 | | polyplay_sh_start |
| 102 | | }; |
| 103 | | |
| 104 | | |
| 105 | 93 | void polyplay_state::machine_reset() |
| 106 | 94 | { |
| 107 | 95 | m_channel1_active = 0; |
| r31905 | r31906 | |
| 109 | 97 | m_channel2_active = 0; |
| 110 | 98 | m_channel2_const = 0; |
| 111 | 99 | |
| 112 | | polyplay_set_channel1(machine(), 0); |
| 113 | | polyplay_play_channel1(machine(), 0); |
| 114 | | polyplay_set_channel2(machine(), 0); |
| 115 | | polyplay_play_channel2(machine(), 0); |
| 100 | set_channel1(0); |
| 101 | play_channel1(0); |
| 102 | set_channel2(0); |
| 103 | play_channel2(0); |
| 116 | 104 | |
| 117 | 105 | m_timer = machine().device<timer_device>("timer"); |
| 118 | 106 | } |
| r31905 | r31906 | |
| 178 | 166 | case 0x00: |
| 179 | 167 | if (m_channel1_const) { |
| 180 | 168 | if (data <= 1) { |
| 181 | | polyplay_set_channel1(machine(), 0); |
| 169 | set_channel1(0); |
| 182 | 170 | } |
| 183 | 171 | m_channel1_const = 0; |
| 184 | | polyplay_play_channel1(machine(), data*m_prescale1); |
| 172 | play_channel1(data*m_prescale1); |
| 185 | 173 | |
| 186 | 174 | } |
| 187 | 175 | else { |
| 188 | 176 | m_prescale1 = (data & 0x20) ? 16 : 1; |
| 189 | 177 | if (data & 0x04) { |
| 190 | | polyplay_set_channel1(machine(), 1); |
| 178 | set_channel1(1); |
| 191 | 179 | m_channel1_const = 1; |
| 192 | 180 | } |
| 193 | 181 | if ((data == 0x41) || (data == 0x65) || (data == 0x45)) { |
| 194 | | polyplay_set_channel1(machine(), 0); |
| 195 | | polyplay_play_channel1(machine(), 0); |
| 182 | set_channel1(0); |
| 183 | play_channel1(0); |
| 196 | 184 | } |
| 197 | 185 | } |
| 198 | 186 | break; |
| 199 | 187 | case 0x01: |
| 200 | 188 | if (m_channel2_const) { |
| 201 | 189 | if (data <= 1) { |
| 202 | | polyplay_set_channel2(machine(), 0); |
| 190 | set_channel2(0); |
| 203 | 191 | } |
| 204 | 192 | m_channel2_const = 0; |
| 205 | | polyplay_play_channel2(machine(), data*m_prescale2); |
| 193 | play_channel2(data*m_prescale2); |
| 206 | 194 | |
| 207 | 195 | } |
| 208 | 196 | else { |
| 209 | 197 | m_prescale2 = (data & 0x20) ? 16 : 1; |
| 210 | 198 | if (data & 0x04) { |
| 211 | | polyplay_set_channel2(machine(), 1); |
| 199 | set_channel2(1); |
| 212 | 200 | m_channel2_const = 1; |
| 213 | 201 | } |
| 214 | 202 | if ((data == 0x41) || (data == 0x65) || (data == 0x45)) { |
| 215 | | polyplay_set_channel2(machine(), 0); |
| 216 | | polyplay_play_channel2(machine(), 0); |
| 203 | set_channel2(0); |
| 204 | play_channel2(0); |
| 217 | 205 | } |
| 218 | 206 | } |
| 219 | 207 | break; |
| r31905 | r31906 | |
| 293 | 281 | /* sound hardware */ |
| 294 | 282 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 295 | 283 | |
| 296 | | MCFG_SAMPLES_ADD("samples", polyplay_samples_interface) |
| 284 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 285 | MCFG_SAMPLES_CHANNELS(2) |
| 286 | MCFG_SAMPLES_START_CB(polyplay_state, sh_start) |
| 297 | 287 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 298 | 288 | MACHINE_CONFIG_END |
| 299 | 289 | |
trunk/src/mame/drivers/thief.c
| r31905 | r31906 | |
| 58 | 58 | kTalkTrack, kCrashTrack |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | | void thief_state::tape_set_audio( samples_device *samples, int track, int bOn ) |
| 61 | void thief_state::tape_set_audio( int track, int bOn ) |
| 62 | 62 | { |
| 63 | | samples->set_volume(track, bOn ? 1.0 : 0.0 ); |
| 63 | m_samples->set_volume(track, bOn ? 1.0 : 0.0 ); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | | void thief_state::tape_set_motor( samples_device *samples, int bOn ) |
| 66 | void thief_state::tape_set_motor( int bOn ) |
| 67 | 67 | { |
| 68 | 68 | if( bOn ) |
| 69 | 69 | { |
| 70 | 70 | /* If talk track is not playing, start it. */ |
| 71 | | if (! samples->playing( kTalkTrack )) |
| 72 | | samples->start( 0, kTalkTrack, true ); |
| 71 | if (! m_samples->playing( kTalkTrack )) |
| 72 | m_samples->start( 0, kTalkTrack, true ); |
| 73 | 73 | |
| 74 | 74 | /* Resume playback of talk track. */ |
| 75 | | samples->pause( kTalkTrack, false); |
| 75 | m_samples->pause( kTalkTrack, false); |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | /* If crash track is not playing, start it. */ |
| 79 | | if (! samples->playing( kCrashTrack )) |
| 80 | | samples->start( 1, kCrashTrack, true ); |
| 79 | if (! m_samples->playing( kCrashTrack )) |
| 80 | m_samples->start( 1, kCrashTrack, true ); |
| 81 | 81 | |
| 82 | 82 | /* Resume playback of crash track. */ |
| 83 | | samples->pause( kCrashTrack, false); |
| 83 | m_samples->pause( kCrashTrack, false); |
| 84 | 84 | } |
| 85 | 85 | else |
| 86 | 86 | { |
| 87 | 87 | /* Pause both the talk and crash tracks. */ |
| 88 | | samples->pause( kTalkTrack, true ); |
| 89 | | samples->pause( kCrashTrack, true ); |
| 88 | m_samples->pause( kTalkTrack, true ); |
| 89 | m_samples->pause( kCrashTrack, true ); |
| 90 | 90 | } |
| 91 | 91 | } |
| 92 | 92 | |
| r31905 | r31906 | |
| 111 | 111 | break; |
| 112 | 112 | |
| 113 | 113 | case 0x08: /* talk track on */ |
| 114 | | tape_set_audio( m_samples, kTalkTrack, 1 ); |
| 114 | tape_set_audio( kTalkTrack, 1 ); |
| 115 | 115 | break; |
| 116 | 116 | |
| 117 | 117 | case 0x09: /* talk track off */ |
| 118 | | tape_set_audio( m_samples, kTalkTrack, 0 ); |
| 118 | tape_set_audio( kTalkTrack, 0 ); |
| 119 | 119 | break; |
| 120 | 120 | |
| 121 | 121 | case 0x0a: /* motor on */ |
| 122 | | tape_set_motor( m_samples, 1 ); |
| 122 | tape_set_motor( 1 ); |
| 123 | 123 | break; |
| 124 | 124 | |
| 125 | 125 | case 0x0b: /* motor off */ |
| 126 | | tape_set_motor( m_samples, 0 ); |
| 126 | tape_set_motor( 0 ); |
| 127 | 127 | break; |
| 128 | 128 | |
| 129 | 129 | case 0x0c: /* crash track on */ |
| 130 | | tape_set_audio( m_samples, kCrashTrack, 1 ); |
| 130 | tape_set_audio( kCrashTrack, 1 ); |
| 131 | 131 | break; |
| 132 | 132 | |
| 133 | 133 | case 0x0d: /* crash track off */ |
| 134 | | tape_set_audio( m_samples, kCrashTrack, 0 ); |
| 134 | tape_set_audio( kCrashTrack, 0 ); |
| 135 | 135 | break; |
| 136 | 136 | } |
| 137 | 137 | } |
| r31905 | r31906 | |
| 386 | 386 | 0 /* end of array */ |
| 387 | 387 | }; |
| 388 | 388 | |
| 389 | | static const samples_interface sharkatt_samples_interface = |
| 390 | | { |
| 391 | | 2, /* number of channels */ |
| 392 | | sharkatt_sample_names |
| 393 | | }; |
| 394 | | |
| 395 | 389 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 396 | 390 | |
| 397 | 391 | static const char *const thief_sample_names[] = |
| r31905 | r31906 | |
| 402 | 396 | 0 /* end of array */ |
| 403 | 397 | }; |
| 404 | 398 | |
| 405 | | static const samples_interface thief_samples_interface = |
| 406 | | { |
| 407 | | 2, /* number of channels */ |
| 408 | | thief_sample_names |
| 409 | | }; |
| 410 | | |
| 411 | 399 | /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
| 412 | 400 | |
| 413 | 401 | static const char *const natodef_sample_names[] = |
| r31905 | r31906 | |
| 418 | 406 | 0 /* end of array */ |
| 419 | 407 | }; |
| 420 | 408 | |
| 421 | | static const samples_interface natodef_samples_interface = |
| 422 | | { |
| 423 | | 2, /* number of channels */ |
| 424 | | natodef_sample_names |
| 425 | | }; |
| 426 | 409 | |
| 427 | 410 | static MACHINE_CONFIG_START( sharkatt, thief_state ) |
| 428 | 411 | |
| r31905 | r31906 | |
| 455 | 438 | MCFG_SOUND_ADD("ay2", AY8910, 4000000/4) |
| 456 | 439 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 457 | 440 | |
| 458 | | MCFG_SAMPLES_ADD("samples", sharkatt_samples_interface) |
| 441 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 442 | MCFG_SAMPLES_CHANNELS(2) |
| 443 | MCFG_SAMPLES_NAMES(sharkatt_sample_names) |
| 459 | 444 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 460 | 445 | MACHINE_CONFIG_END |
| 461 | 446 | |
| r31905 | r31906 | |
| 491 | 476 | MCFG_SOUND_ADD("ay2", AY8910, 4000000/4) |
| 492 | 477 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 493 | 478 | |
| 494 | | MCFG_SAMPLES_ADD("samples", thief_samples_interface) |
| 479 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 480 | MCFG_SAMPLES_CHANNELS(2) |
| 481 | MCFG_SAMPLES_NAMES(thief_sample_names) |
| 495 | 482 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 496 | 483 | MACHINE_CONFIG_END |
| 497 | 484 | |
| r31905 | r31906 | |
| 527 | 514 | MCFG_SOUND_ADD("ay2", AY8910, 4000000/4) |
| 528 | 515 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 529 | 516 | |
| 530 | | MCFG_SAMPLES_ADD("samples", natodef_samples_interface) |
| 517 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 518 | MCFG_SAMPLES_CHANNELS(2) |
| 519 | MCFG_SAMPLES_NAMES(natodef_sample_names) |
| 531 | 520 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 532 | 521 | MACHINE_CONFIG_END |
| 533 | 522 | |
trunk/src/mame/drivers/superqix.c
| r31905 | r31906 | |
| 108 | 108 | #include "includes/superqix.h" |
| 109 | 109 | |
| 110 | 110 | |
| 111 | | static SAMPLES_START( pbillian_sh_start ) |
| 111 | SAMPLES_START_CB_MEMBER(superqix_state::pbillian_sh_start) |
| 112 | 112 | { |
| 113 | | superqix_state *state = device.machine().driver_data<superqix_state>(); |
| 114 | | running_machine &machine = device.machine(); |
| 115 | | UINT8 *src = state->memregion("samples")->base(); |
| 116 | | int i, len = state->memregion("samples")->bytes(); |
| 113 | UINT8 *src = memregion("samples")->base(); |
| 114 | int i, len = memregion("samples")->bytes(); |
| 117 | 115 | |
| 118 | 116 | /* convert 8-bit unsigned samples to 8-bit signed */ |
| 119 | | state->m_samplebuf = auto_alloc_array(machine, INT16, len); |
| 117 | m_samplebuf = auto_alloc_array(machine(), INT16, len); |
| 120 | 118 | for (i = 0;i < len;i++) |
| 121 | | state->m_samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256; |
| 119 | m_samplebuf[i] = (INT8)(src[i] ^ 0x80) * 256; |
| 122 | 120 | } |
| 123 | 121 | |
| 124 | 122 | WRITE8_MEMBER(superqix_state::pbillian_sample_trigger_w) |
| r31905 | r31906 | |
| 908 | 906 | GFXDECODE_END |
| 909 | 907 | |
| 910 | 908 | |
| 911 | | |
| 912 | | static const samples_interface pbillian_samples_interface = |
| 913 | | { |
| 914 | | 1, |
| 915 | | NULL, |
| 916 | | pbillian_sh_start |
| 917 | | }; |
| 918 | | |
| 919 | 909 | INTERRUPT_GEN_MEMBER(superqix_state::vblank_irq) |
| 920 | 910 | { |
| 921 | 911 | if(m_nmi_mask) |
| r31905 | r31906 | |
| 960 | 950 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("SYSTEM")) |
| 961 | 951 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 962 | 952 | |
| 963 | | MCFG_SAMPLES_ADD("samples", pbillian_samples_interface) |
| 953 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 954 | MCFG_SAMPLES_CHANNELS(1) |
| 955 | MCFG_SAMPLES_START_CB(superqix_state, pbillian_sh_start) |
| 964 | 956 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 965 | 957 | MACHINE_CONFIG_END |
| 966 | 958 | |
| r31905 | r31906 | |
| 997 | 989 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("SYSTEM")) |
| 998 | 990 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.30) |
| 999 | 991 | |
| 1000 | | MCFG_SAMPLES_ADD("samples", pbillian_samples_interface) |
| 992 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 993 | MCFG_SAMPLES_CHANNELS(1) |
| 994 | MCFG_SAMPLES_START_CB(superqix_state, pbillian_sh_start) |
| 1001 | 995 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1002 | 996 | MACHINE_CONFIG_END |
| 1003 | 997 | |
trunk/src/mame/drivers/tmnt.c
| r31905 | r31906 | |
| 221 | 221 | return m_upd7759->busy_r() ? 1 : 0; |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | | |
| 225 | | static SAMPLES_START( tmnt_decode_sample ) |
| 224 | SAMPLES_START_CB_MEMBER(tmnt_state::tmnt_decode_sample) |
| 226 | 225 | { |
| 227 | | running_machine &machine = device.machine(); |
| 228 | | tmnt_state *state = machine.driver_data<tmnt_state>(); |
| 229 | 226 | int i; |
| 230 | | UINT8 *source = state->memregion("title")->base(); |
| 227 | UINT8 *source = memregion("title")->base(); |
| 231 | 228 | |
| 232 | | state->save_item(NAME(state->m_sampledata)); |
| 229 | save_item(NAME(m_sampledata)); |
| 233 | 230 | |
| 234 | 231 | /* Sound sample for TMNT.D05 is stored in the following mode (ym3012 format): |
| 235 | 232 | * |
| r31905 | r31906 | |
| 249 | 246 | |
| 250 | 247 | val <<= (expo - 3); |
| 251 | 248 | |
| 252 | | state->m_sampledata[i] = val; |
| 249 | m_sampledata[i] = val; |
| 253 | 250 | } |
| 254 | 251 | } |
| 255 | 252 | |
| r31905 | r31906 | |
| 1950 | 1947 | m_k007232->set_volume(1, 0, (data & 0x0f) * 0x11); |
| 1951 | 1948 | } |
| 1952 | 1949 | |
| 1953 | | static const samples_interface tmnt_samples_interface = |
| 1954 | | { |
| 1955 | | 1, /* 1 channel for the title music */ |
| 1956 | | NULL, |
| 1957 | | tmnt_decode_sample |
| 1958 | | }; |
| 1959 | | |
| 1960 | 1950 | MACHINE_START_MEMBER(tmnt_state,common) |
| 1961 | 1951 | { |
| 1962 | 1952 | save_item(NAME(m_toggle)); |
| r31905 | r31906 | |
| 2143 | 2133 | MCFG_SOUND_ADD("upd", UPD7759, XTAL_640kHz) |
| 2144 | 2134 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.60) |
| 2145 | 2135 | |
| 2146 | | MCFG_SAMPLES_ADD("samples", tmnt_samples_interface) |
| 2136 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 2137 | MCFG_SAMPLES_CHANNELS(1) /* 1 channel for the title music */ |
| 2138 | MCFG_SAMPLES_START_CB(tmnt_state, tmnt_decode_sample) |
| 2147 | 2139 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 2148 | 2140 | MACHINE_CONFIG_END |
| 2149 | 2141 | |
trunk/src/mame/drivers/suna8.c
| r31905 | r31906 | |
| 1802 | 1802 | |
| 1803 | 1803 | /* 1 x 24 MHz crystal */ |
| 1804 | 1804 | |
| 1805 | | static const samples_interface suna8_samples_interface = |
| 1806 | | { |
| 1807 | | 1, |
| 1808 | | NULL, |
| 1809 | | suna8_sh_start |
| 1810 | | }; |
| 1811 | 1805 | |
| 1812 | 1806 | static MACHINE_CONFIG_START( hardhead, suna8_state ) |
| 1813 | 1807 | |
| r31905 | r31906 | |
| 1851 | 1845 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) |
| 1852 | 1846 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) |
| 1853 | 1847 | |
| 1854 | | MCFG_SAMPLES_ADD("samples", suna8_samples_interface) |
| 1848 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1849 | MCFG_SAMPLES_CHANNELS(1) |
| 1850 | MCFG_SAMPLES_START_CB(suna8_state, sh_start) |
| 1855 | 1851 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 1856 | 1852 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 1857 | 1853 | MACHINE_CONFIG_END |
| r31905 | r31906 | |
| 1906 | 1902 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.90) |
| 1907 | 1903 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.90) |
| 1908 | 1904 | |
| 1909 | | MCFG_SAMPLES_ADD("samples", suna8_samples_interface) |
| 1905 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1906 | MCFG_SAMPLES_CHANNELS(1) |
| 1907 | MCFG_SAMPLES_START_CB(suna8_state, sh_start) |
| 1910 | 1908 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 1911 | 1909 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 1912 | 1910 | MACHINE_CONFIG_END |
| r31905 | r31906 | |
| 2066 | 2064 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 2067 | 2065 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 2068 | 2066 | |
| 2069 | | MCFG_SAMPLES_ADD("samples", suna8_samples_interface) |
| 2067 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 2068 | MCFG_SAMPLES_CHANNELS(1) |
| 2069 | MCFG_SAMPLES_START_CB(suna8_state, sh_start) |
| 2070 | 2070 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 2071 | 2071 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 2072 | 2072 | MACHINE_CONFIG_END |
| r31905 | r31906 | |
| 2117 | 2117 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.30) |
| 2118 | 2118 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.30) |
| 2119 | 2119 | |
| 2120 | | MCFG_SAMPLES_ADD("samples", suna8_samples_interface) |
| 2120 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 2121 | MCFG_SAMPLES_CHANNELS(1) |
| 2122 | MCFG_SAMPLES_START_CB(suna8_state, sh_start) |
| 2121 | 2123 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "lspeaker", 0.50) |
| 2122 | 2124 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "rspeaker", 0.50) |
| 2123 | 2125 | MACHINE_CONFIG_END |
trunk/src/mame/drivers/tnzs.c
| r31905 | r31906 | |
| 629 | 629 | #include "includes/tnzs.h" |
| 630 | 630 | #include "sound/2151intf.h" |
| 631 | 631 | |
| 632 | | static SAMPLES_START( kageki_init_samples ) |
| 632 | SAMPLES_START_CB_MEMBER(tnzs_state::kageki_init_samples) |
| 633 | 633 | { |
| 634 | | running_machine &machine = device.machine(); |
| 635 | | tnzs_state *state = machine.driver_data<tnzs_state>(); |
| 636 | 634 | UINT8 *scan, *src; |
| 637 | 635 | INT16 *dest; |
| 638 | 636 | int start, size; |
| 639 | 637 | int i, n; |
| 640 | 638 | |
| 641 | | src = state->memregion("samples")->base() + 0x0090; |
| 639 | src = memregion("samples")->base() + 0x0090; |
| 642 | 640 | for (i = 0; i < MAX_SAMPLES; i++) |
| 643 | 641 | { |
| 644 | 642 | start = (src[(i * 2) + 1] * 256) + src[(i * 2)]; |
| r31905 | r31906 | |
| 655 | 653 | } |
| 656 | 654 | |
| 657 | 655 | /* 2009-11 FP: should these be saved? */ |
| 658 | | state->m_sampledata[i] = auto_alloc_array(machine, INT16, size); |
| 659 | | state->m_samplesize[i] = size; |
| 656 | m_sampledata[i] = auto_alloc_array(machine(), INT16, size); |
| 657 | m_samplesize[i] = size; |
| 660 | 658 | |
| 661 | 659 | |
| 662 | 660 | if (start < 0x100) |
| 663 | 661 | start = size = 0; |
| 664 | 662 | |
| 665 | 663 | // signed 8-bit sample to unsigned 8-bit sample convert |
| 666 | | dest = state->m_sampledata[i]; |
| 664 | dest = m_sampledata[i]; |
| 667 | 665 | scan = &src[start]; |
| 668 | 666 | for (n = 0; n < size; n++) |
| 669 | 667 | { |
| r31905 | r31906 | |
| 1533 | 1531 | m_audiocpu->set_input_line(INPUT_LINE_NMI, state ? ASSERT_LINE : CLEAR_LINE); |
| 1534 | 1532 | } |
| 1535 | 1533 | |
| 1536 | | static const samples_interface tnzs_samples_interface = |
| 1537 | | { |
| 1538 | | 1, |
| 1539 | | NULL, |
| 1540 | | kageki_init_samples |
| 1541 | | }; |
| 1542 | | |
| 1543 | 1534 | static MACHINE_CONFIG_START( arknoid2, tnzs_state ) |
| 1544 | 1535 | |
| 1545 | 1536 | /* basic machine hardware */ |
| r31905 | r31906 | |
| 1767 | 1758 | MCFG_SOUND_ROUTE(2, "mono", 0.15) |
| 1768 | 1759 | MCFG_SOUND_ROUTE(3, "mono", 0.35) |
| 1769 | 1760 | |
| 1770 | | MCFG_SAMPLES_ADD("samples", tnzs_samples_interface) |
| 1761 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 1762 | MCFG_SAMPLES_CHANNELS(1) |
| 1763 | MCFG_SAMPLES_START_CB(tnzs_state, kageki_init_samples) |
| 1771 | 1764 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1772 | 1765 | MACHINE_CONFIG_END |
| 1773 | 1766 | |
trunk/src/mame/drivers/m63.c
| r31905 | r31906 | |
| 181 | 181 | DECLARE_READ8_MEMBER(irq_r); |
| 182 | 182 | DECLARE_READ8_MEMBER(snddata_r); |
| 183 | 183 | DECLARE_WRITE8_MEMBER(fghtbskt_samples_w); |
| 184 | SAMPLES_START_CB_MEMBER(fghtbskt_sh_start); |
| 184 | 185 | DECLARE_WRITE8_MEMBER(nmi_mask_w); |
| 185 | 186 | DECLARE_DRIVER_INIT(wilytowr); |
| 186 | 187 | DECLARE_DRIVER_INIT(fghtbskt); |
| r31905 | r31906 | |
| 696 | 697 | GFXDECODE_END |
| 697 | 698 | |
| 698 | 699 | |
| 699 | | static SAMPLES_START( fghtbskt_sh_start ) |
| 700 | SAMPLES_START_CB_MEMBER(m63_state::fghtbskt_sh_start) |
| 700 | 701 | { |
| 701 | | running_machine &machine = device.machine(); |
| 702 | | m63_state *state = machine.driver_data<m63_state>(); |
| 703 | | int i, len = state->memregion("samples")->bytes(); |
| 704 | | UINT8 *ROM = state->memregion("samples")->base(); |
| 702 | int i, len = memregion("samples")->bytes(); |
| 703 | UINT8 *ROM = memregion("samples")->base(); |
| 705 | 704 | |
| 706 | | state->m_samplebuf = auto_alloc_array(machine, INT16, len); |
| 707 | | state->save_pointer(NAME(state->m_samplebuf), len); |
| 705 | m_samplebuf = auto_alloc_array(machine(), INT16, len); |
| 706 | save_pointer(NAME(m_samplebuf), len); |
| 708 | 707 | |
| 709 | 708 | for(i = 0; i < len; i++) |
| 710 | | state->m_samplebuf[i] = ((INT8)(ROM[i] ^ 0x80)) * 256; |
| 709 | m_samplebuf[i] = ((INT8)(ROM[i] ^ 0x80)) * 256; |
| 711 | 710 | } |
| 712 | 711 | |
| 713 | | static const samples_interface fghtbskt_samples_interface = |
| 714 | | { |
| 715 | | 1, |
| 716 | | NULL, |
| 717 | | fghtbskt_sh_start |
| 718 | | }; |
| 719 | | |
| 720 | 712 | INTERRUPT_GEN_MEMBER(m63_state::snd_irq) |
| 721 | 713 | { |
| 722 | 714 | m_sound_irq = 1; |
| r31905 | r31906 | |
| 831 | 823 | MCFG_SOUND_ADD("ay1", AY8910, XTAL_12MHz/8) |
| 832 | 824 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 833 | 825 | |
| 834 | | MCFG_SAMPLES_ADD("samples", fghtbskt_samples_interface) |
| 826 | MCFG_SOUND_ADD("samples", SAMPLES, 0) |
| 827 | MCFG_SAMPLES_CHANNELS(1) |
| 828 | MCFG_SAMPLES_START_CB(m63_state, fghtbskt_sh_start) |
| 835 | 829 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 836 | 830 | MACHINE_CONFIG_END |
| 837 | 831 | |