trunk/src/emu/sound/es5506.c
| r17618 | r17619 | |
| 1570 | 1570 | } |
| 1571 | 1571 | |
| 1572 | 1572 | |
| 1573 | | |
| 1574 | 1573 | /********************************************************************************************** |
| 1575 | 1574 | |
| 1576 | | DEVICE_STOP( es5505 ) -- stop emulation of the ES5505 |
| 1577 | | |
| 1578 | | ***********************************************************************************************/ |
| 1579 | | |
| 1580 | | static DEVICE_STOP( es5505 ) |
| 1581 | | { |
| 1582 | | DEVICE_STOP_CALL( es5506 ); |
| 1583 | | } |
| 1584 | | |
| 1585 | | |
| 1586 | | static DEVICE_RESET( es5505 ) |
| 1587 | | { |
| 1588 | | DEVICE_RESET_CALL( es5506 ); |
| 1589 | | } |
| 1590 | | |
| 1591 | | |
| 1592 | | |
| 1593 | | /********************************************************************************************** |
| 1594 | | |
| 1595 | 1575 | es5505_reg_write -- handle a write to the selected ES5505 register |
| 1596 | 1576 | |
| 1597 | 1577 | ***********************************************************************************************/ |
| r17618 | r17619 | |
| 2153 | 2133 | chip->voice[voice].exbank=bank; |
| 2154 | 2134 | } |
| 2155 | 2135 | |
| 2156 | | const device_type ES5505 = &device_creator<es5505_device>; |
| 2136 | const device_type ES5506 = &device_creator<es5506_device>; |
| 2157 | 2137 | |
| 2158 | | es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2159 | | : device_t(mconfig, ES5505, "ES5505", tag, owner, clock), |
| 2138 | es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2139 | : device_t(mconfig, ES5506, "ES5506", tag, owner, clock), |
| 2160 | 2140 | device_sound_interface(mconfig, *this) |
| 2161 | 2141 | { |
| 2162 | 2142 | m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state)); |
| 2163 | 2143 | } |
| 2164 | 2144 | |
| 2165 | | es5505_device::es5505_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 2145 | es5506_device::es5506_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) |
| 2166 | 2146 | : device_t(mconfig, type, name, tag, owner, clock), |
| 2167 | 2147 | device_sound_interface(mconfig, *this) |
| 2168 | 2148 | { |
| r17618 | r17619 | |
| 2175 | 2155 | // complete |
| 2176 | 2156 | //------------------------------------------------- |
| 2177 | 2157 | |
| 2178 | | void es5505_device::device_config_complete() |
| 2158 | void es5506_device::device_config_complete() |
| 2179 | 2159 | { |
| 2180 | 2160 | } |
| 2181 | 2161 | |
| r17618 | r17619 | |
| 2183 | 2163 | // device_start - device-specific startup |
| 2184 | 2164 | //------------------------------------------------- |
| 2185 | 2165 | |
| 2186 | | void es5505_device::device_start() |
| 2166 | void es5506_device::device_start() |
| 2187 | 2167 | { |
| 2188 | | DEVICE_START_NAME( es5505 )(this); |
| 2168 | DEVICE_START_NAME( es5506 )(this); |
| 2189 | 2169 | } |
| 2190 | 2170 | |
| 2191 | 2171 | //------------------------------------------------- |
| 2192 | 2172 | // device_reset - device-specific reset |
| 2193 | 2173 | //------------------------------------------------- |
| 2194 | 2174 | |
| 2195 | | void es5505_device::device_reset() |
| 2175 | void es5506_device::device_reset() |
| 2196 | 2176 | { |
| 2197 | | DEVICE_RESET_NAME( es5505 )(this); |
| 2177 | DEVICE_RESET_NAME( es5506 )(this); |
| 2198 | 2178 | } |
| 2199 | 2179 | |
| 2200 | 2180 | //------------------------------------------------- |
| 2201 | 2181 | // device_stop - device-specific stop |
| 2202 | 2182 | //------------------------------------------------- |
| 2203 | 2183 | |
| 2204 | | void es5505_device::device_stop() |
| 2184 | void es5506_device::device_stop() |
| 2205 | 2185 | { |
| 2206 | | DEVICE_STOP_NAME( es5505 )(this); |
| 2186 | DEVICE_STOP_NAME( es5506 )(this); |
| 2207 | 2187 | } |
| 2208 | 2188 | |
| 2209 | 2189 | //------------------------------------------------- |
| 2210 | 2190 | // sound_stream_update - handle a stream update |
| 2211 | 2191 | //------------------------------------------------- |
| 2212 | 2192 | |
| 2213 | | void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 2193 | void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 2214 | 2194 | { |
| 2215 | 2195 | // should never get here |
| 2216 | 2196 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 2217 | 2197 | } |
| 2218 | 2198 | |
| 2219 | 2199 | |
| 2220 | | const device_type ES5506 = &device_creator<es5506_device>; |
| 2200 | const device_type ES5505 = &device_creator<es5505_device>; |
| 2221 | 2201 | |
| 2222 | | es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2223 | | : es5505_device(mconfig, ES5506, "ES5506", tag, owner, clock) |
| 2202 | es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 2203 | : es5506_device(mconfig, ES5505, "ES5505", tag, owner, clock) |
| 2224 | 2204 | { |
| 2225 | 2205 | } |
| 2226 | 2206 | |
| 2227 | 2207 | //------------------------------------------------- |
| 2228 | | // device_config_complete - perform any |
| 2229 | | // operations now that the configuration is |
| 2230 | | // complete |
| 2231 | | //------------------------------------------------- |
| 2232 | | |
| 2233 | | void es5506_device::device_config_complete() |
| 2234 | | { |
| 2235 | | } |
| 2236 | | |
| 2237 | | //------------------------------------------------- |
| 2238 | 2208 | // device_start - device-specific startup |
| 2239 | 2209 | //------------------------------------------------- |
| 2240 | 2210 | |
| 2241 | | void es5506_device::device_start() |
| 2211 | void es5505_device::device_start() |
| 2242 | 2212 | { |
| 2243 | | DEVICE_START_NAME( es5506 )(this); |
| 2213 | DEVICE_START_NAME( es5505 )(this); |
| 2244 | 2214 | } |
| 2245 | | |
| 2246 | | //------------------------------------------------- |
| 2247 | | // device_reset - device-specific reset |
| 2248 | | //------------------------------------------------- |
| 2249 | | |
| 2250 | | void es5506_device::device_reset() |
| 2251 | | { |
| 2252 | | DEVICE_RESET_NAME( es5506 )(this); |
| 2253 | | } |
| 2254 | | |
| 2255 | | //------------------------------------------------- |
| 2256 | | // device_stop - device-specific stop |
| 2257 | | //------------------------------------------------- |
| 2258 | | |
| 2259 | | void es5506_device::device_stop() |
| 2260 | | { |
| 2261 | | DEVICE_STOP_NAME( es5506 )(this); |
| 2262 | | } |
| 2263 | | |
| 2264 | | //------------------------------------------------- |
| 2265 | | // sound_stream_update - handle a stream update |
| 2266 | | //------------------------------------------------- |
| 2267 | | |
| 2268 | | void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 2269 | | { |
| 2270 | | // should never get here |
| 2271 | | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); |
| 2272 | | } |
| 2273 | | |
| 2274 | | |
trunk/src/emu/sound/es5506.h
| r17618 | r17619 | |
| 25 | 25 | WRITE16_DEVICE_HANDLER( es5505_w ); |
| 26 | 26 | void es5505_voice_bank_w(device_t *device, int voice, int bank); |
| 27 | 27 | |
| 28 | | class es5505_device : public device_t, |
| 28 | class es5506_device : public device_t, |
| 29 | 29 | public device_sound_interface |
| 30 | 30 | { |
| 31 | 31 | public: |
| 32 | | es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 33 | | es5505_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 34 | | ~es5505_device() { global_free(m_token); } |
| 32 | es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 33 | es5506_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); |
| 34 | ~es5506_device() { global_free(m_token); } |
| 35 | 35 | |
| 36 | 36 | // access to legacy token |
| 37 | 37 | void *token() const { assert(m_token != NULL); return m_token; } |
| r17618 | r17619 | |
| 49 | 49 | void *m_token; |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | | extern const device_type ES5505; |
| 52 | extern const device_type ES5506; |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | |
| r17618 | r17619 | |
| 68 | 68 | WRITE8_DEVICE_HANDLER( es5506_w ); |
| 69 | 69 | void es5506_voice_bank_w(device_t *device, int voice, int bank); |
| 70 | 70 | |
| 71 | | class es5506_device : public es5505_device |
| 71 | class es5505_device : public es5506_device |
| 72 | 72 | { |
| 73 | 73 | public: |
| 74 | | es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 74 | es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 75 | 75 | protected: |
| 76 | 76 | // device-level overrides |
| 77 | | virtual void device_config_complete(); |
| 78 | 77 | virtual void device_start(); |
| 79 | | virtual void device_stop(); |
| 80 | | virtual void device_reset(); |
| 81 | | |
| 82 | | // sound stream update overrides |
| 83 | | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| 84 | 78 | private: |
| 85 | 79 | // internal state |
| 86 | 80 | }; |
| 87 | 81 | |
| 88 | | extern const device_type ES5506; |
| 82 | extern const device_type ES5505; |
| 89 | 83 | |
| 90 | 84 | |
| 91 | 85 | #endif /* __ES5506_H__ */ |