trunk/src/emu/sound/t6721a.c
| r0 | r20799 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Toshiba T6721A C2MOS Voice Synthesizing LSI emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "t6721a.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS / CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define LOG 0 |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // DEVICE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // device type definition |
| 27 | const device_type T6721A = &device_creator<t6721a_device>; |
| 28 | |
| 29 | |
| 30 | |
| 31 | //************************************************************************** |
| 32 | // LIVE DEVICE |
| 33 | //************************************************************************** |
| 34 | |
| 35 | //------------------------------------------------- |
| 36 | // t6721a_device - constructor |
| 37 | //------------------------------------------------- |
| 38 | |
| 39 | t6721a_device::t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 40 | : device_t(mconfig, T6721A, "T6721A", tag, owner, clock), |
| 41 | device_sound_interface(mconfig, *this), |
| 42 | m_eos_handler(*this), |
| 43 | m_dtrd_handler(*this), |
| 44 | m_apd_handler(*this), |
| 45 | m_stream(NULL) |
| 46 | { |
| 47 | } |
| 48 | |
| 49 | |
| 50 | //------------------------------------------------- |
| 51 | // device_start - device-specific startup |
| 52 | //------------------------------------------------- |
| 53 | |
| 54 | void t6721a_device::device_start() |
| 55 | { |
| 56 | // resolve callbacks |
| 57 | m_eos_handler.resolve_safe(); |
| 58 | m_dtrd_handler.resolve_safe(); |
| 59 | m_apd_handler.resolve_safe(); |
| 60 | |
| 61 | // create sound stream |
| 62 | m_stream = machine().sound().stream_alloc(*this, 0, 1, machine().sample_rate()); |
| 63 | } |
| 64 | |
| 65 | |
| 66 | //------------------------------------------------- |
| 67 | // sound_stream_update - handle update requests for |
| 68 | // our sound stream |
| 69 | //------------------------------------------------- |
| 70 | |
| 71 | void t6721a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) |
| 72 | { |
| 73 | } |
| 74 | |
| 75 | |
| 76 | //------------------------------------------------- |
| 77 | // read - |
| 78 | //------------------------------------------------- |
| 79 | |
| 80 | READ8_MEMBER( t6721a_device::read ) |
| 81 | { |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | |
| 86 | //------------------------------------------------- |
| 87 | // write - |
| 88 | //------------------------------------------------- |
| 89 | |
| 90 | WRITE8_MEMBER( t6721a_device::write ) |
| 91 | { |
| 92 | } |
| 93 | |
| 94 | |
| 95 | //------------------------------------------------- |
| 96 | // di_w - data input write |
| 97 | //------------------------------------------------- |
| 98 | |
| 99 | WRITE_LINE_MEMBER( t6721a_device::di_w ) |
| 100 | { |
| 101 | } |
trunk/src/emu/sound/t6721a.h
| r0 | r20799 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Toshiba T6721A C2MOS Voice Synthesizing LSI emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | ********************************************************************** |
| 9 | _____ _____ |
| 10 | SP3 1 |* \_/ | 42 Vdd |
| 11 | LOSS 2 | | 41 SP2 |
| 12 | TS 3 | | 40 SP1 |
| 13 | TSN 4 | | 39 SP0 |
| 14 | W 5 | | 38 TEM |
| 15 | TDAI 6 | | 37 FR |
| 16 | TFIO 7 | | 36 BR |
| 17 | DAO 8 | | 35 OD |
| 18 | APD 9 | | 34 REP |
| 19 | phi2 10 | | 33 EXP |
| 20 | PD 11 | T6721A | 32 CK2 |
| 21 | ROM ADR RST 12 | | 31 CK1 |
| 22 | ROM RST 13 | | 30 M-START |
| 23 | ALD 14 | | 29 TPN |
| 24 | DI 15 | | 28 _ACL |
| 25 | DTRD 16 | | 27 CPUM |
| 26 | D3 17 | | 26 _EOS |
| 27 | D2 18 | | 25 _BSY |
| 28 | D1 19 | | 24 _CE |
| 29 | D0 20 | | 23 _RD |
| 30 | GND 21 |_____________| 22 _WR |
| 31 | |
| 32 | **********************************************************************/ |
| 33 | |
| 34 | #pragma once |
| 35 | |
| 36 | #ifndef __T6721__ |
| 37 | #define __T6721__ |
| 38 | |
| 39 | #include "emu.h" |
| 40 | |
| 41 | |
| 42 | |
| 43 | //************************************************************************** |
| 44 | // INTERFACE CONFIGURATION MACROS |
| 45 | //************************************************************************** |
| 46 | |
| 47 | #define MCFG_T6721A_EOS_HANDLER(_devcb) \ |
| 48 | devcb = &t6721a_device::set_eos_handler(*device, DEVCB2_##_devcb); |
| 49 | |
| 50 | #define MCFG_T6721A_DTRD_HANDLER(_devcb) \ |
| 51 | devcb = &t6721a_device::set_dtrd_handler(*device, DEVCB2_##_devcb); |
| 52 | |
| 53 | #define MCFG_T6721A_APD_HANDLER(_devcb) \ |
| 54 | devcb = &t6721a_device::set_apd_handler(*device, DEVCB2_##_devcb); |
| 55 | |
| 56 | |
| 57 | |
| 58 | //************************************************************************** |
| 59 | // TYPE DEFINITIONS |
| 60 | //************************************************************************** |
| 61 | |
| 62 | // ======================> t6721a_device |
| 63 | |
| 64 | class t6721a_device : public device_t, |
| 65 | public device_sound_interface |
| 66 | { |
| 67 | public: |
| 68 | t6721a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 69 | |
| 70 | // static configuration helpers |
| 71 | template<class _Object> static devcb2_base &set_eos_handler(device_t &device, _Object object) { return downcast<t6721a_device &>(device).m_eos_handler.set_callback(object); } |
| 72 | template<class _Object> static devcb2_base &set_dtrd_handler(device_t &device, _Object object) { return downcast<t6721a_device &>(device).m_dtrd_handler.set_callback(object); } |
| 73 | template<class _Object> static devcb2_base &set_apd_handler(device_t &device, _Object object) { return downcast<t6721a_device &>(device).m_apd_handler.set_callback(object); } |
| 74 | |
| 75 | DECLARE_READ8_MEMBER( read ); |
| 76 | DECLARE_WRITE8_MEMBER( write ); |
| 77 | |
| 78 | DECLARE_WRITE_LINE_MEMBER( di_w ); |
| 79 | |
| 80 | protected: |
| 81 | // device-level overrides |
| 82 | virtual void device_start(); |
| 83 | |
| 84 | // device_sound_interface overrides |
| 85 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); |
| 86 | |
| 87 | private: |
| 88 | devcb2_write_line m_eos_handler; |
| 89 | devcb2_write_line m_dtrd_handler; |
| 90 | devcb2_write_line m_apd_handler; |
| 91 | |
| 92 | sound_stream *m_stream; |
| 93 | }; |
| 94 | |
| 95 | |
| 96 | // device type definition |
| 97 | extern const device_type T6721A; |
| 98 | |
| 99 | |
| 100 | |
| 101 | #endif |
trunk/src/mess/audio/t6721.c
| r20798 | r20799 | |
| 1 | | /*************************************************************************** |
| 2 | | |
| 3 | | toshiba 6721a chip approximation |
| 4 | | (voice output) |
| 5 | | |
| 6 | | not really working |
| 7 | | communication with c364 works, no speech synthesis |
| 8 | | includes c364 interface hardware |
| 9 | | |
| 10 | | PeT mess@utanet.at |
| 11 | | documentation |
| 12 | | www.funet.fi |
| 13 | | |
| 14 | | ***************************************************************************/ |
| 15 | | |
| 16 | | /* |
| 17 | | c364 speech |
| 18 | | say 0 .. 10 |
| 19 | | rate 0 .. 15? |
| 20 | | voc ? |
| 21 | | rdy ? (only c64) |
| 22 | | |
| 23 | | 0 bit 0..3 ??? |
| 24 | | bit 456 0? |
| 25 | | bit 7 writen 0 1 |
| 26 | | reset 9 9 b |
| 27 | | set playback rate |
| 28 | | rate 4: 2 a 4 5 4 6 0 7 a (default) |
| 29 | | 0 0 |
| 30 | | 1 1 |
| 31 | | rate 2: 2 a 4 5 2 6 0 7 a |
| 32 | | rate 3: 3 |
| 33 | | rate 9: |
| 34 | | start: 1 |
| 35 | | 1 bit 01 set to 1 for start ? |
| 36 | | bit 6 polled until set (at $80ec) |
| 37 | | 7 set ready to transmit new byte? |
| 38 | | 2 0..7 sample data |
| 39 | | |
| 40 | | seems to be a toshiba t6721a build in |
| 41 | | (8 kHz 9bit output) |
| 42 | | generates output for 20ms (or 10ms) out of 6 byte voice data! |
| 43 | | (P?ARCOR voice synthesizing and analyzing method |
| 44 | | Nippon Telegraph and Telephon Public Corporation) |
| 45 | | End code also in voice data |
| 46 | | technical info at www.funet.fi covers only the chip, not |
| 47 | | the synthesizing method |
| 48 | | |
| 49 | | magic voice in c64: |
| 50 | | The internal electronics depicted in Danny's picture above are as follows, going from the MOS chip at top and then clockwise: MOS |
| 51 | | 6525B (4383), MOS 251476-01 (8A-06 4341) system ROM, General Instruments 8343SEA (LA05-123), Toshiba T6721A (3L) |
| 52 | | sound generator (?), CD40105BE (RCA H 432) and a 74LS222A logic chip. |
| 53 | | |
| 54 | | */ |
| 55 | | |
| 56 | | #include "emu.h" |
| 57 | | #include "audio/t6721.h" |
| 58 | | |
| 59 | | |
| 60 | | struct t6721_state |
| 61 | | { |
| 62 | | emu_timer *timer; |
| 63 | | |
| 64 | | int busy, end_of_sample; |
| 65 | | int playing; |
| 66 | | int rate; |
| 67 | | |
| 68 | | UINT8 command_data; |
| 69 | | int command_state; |
| 70 | | |
| 71 | | UINT8 sample_data[6], sample_index; |
| 72 | | |
| 73 | | UINT8 state; |
| 74 | | |
| 75 | | int sample_timeindex; |
| 76 | | UINT8 readindex, writeindex; |
| 77 | | UINT64 data[0x10]; |
| 78 | | }; |
| 79 | | |
| 80 | | /***************************************************************************** |
| 81 | | LOGGING |
| 82 | | *****************************************************************************/ |
| 83 | | |
| 84 | | #define VERBOSE_LEVEL 0 |
| 85 | | #define DBG_LOG(N,M,A) \ |
| 86 | | do { \ |
| 87 | | if(VERBOSE_LEVEL >= N) \ |
| 88 | | { \ |
| 89 | | if( M ) \ |
| 90 | | logerror("%11.6f: %-24s", device->machine().time().as_double(), (char*) M ); \ |
| 91 | | logerror A; \ |
| 92 | | } \ |
| 93 | | } while(0) |
| 94 | | |
| 95 | | |
| 96 | | /***************************************************************************** |
| 97 | | INLINE FUNCTIONS |
| 98 | | *****************************************************************************/ |
| 99 | | |
| 100 | | INLINE t6721_state *get_safe_token( device_t *device ) |
| 101 | | { |
| 102 | | assert(device != NULL); |
| 103 | | assert(device->type() == T6721); |
| 104 | | |
| 105 | | return (t6721_state *)downcast<t6721_device *>(device)->token(); |
| 106 | | } |
| 107 | | |
| 108 | | /***************************************************************************** |
| 109 | | IMPLEMENTATION |
| 110 | | *****************************************************************************/ |
| 111 | | |
| 112 | | static TIMER_CALLBACK( t6721_speech_timer ) |
| 113 | | { |
| 114 | | t6721_state *t6721 = (t6721_state *)ptr; |
| 115 | | |
| 116 | | if (!t6721->playing) |
| 117 | | return; |
| 118 | | |
| 119 | | if (t6721->sample_timeindex < 8000 / 50) |
| 120 | | { |
| 121 | | t6721->sample_timeindex++; |
| 122 | | } |
| 123 | | else |
| 124 | | { |
| 125 | | t6721->end_of_sample = (memcmp(t6721->sample_data, "\xff\xff\xff\xff\xff\xff", 6) == 0); |
| 126 | | |
| 127 | | /*t6721->end_of_sample = 1; */ |
| 128 | | t6721->busy = 0; |
| 129 | | } |
| 130 | | } |
| 131 | | |
| 132 | | WRITE8_DEVICE_HANDLER( t6721_speech_w ) |
| 133 | | { |
| 134 | | t6721_state *t6721 = get_safe_token(device); |
| 135 | | |
| 136 | | DBG_LOG(2, "364", ("port write %.2x %.2x\n", offset, data)); |
| 137 | | |
| 138 | | switch (offset) |
| 139 | | { |
| 140 | | case 0: |
| 141 | | if (data & 0x80) |
| 142 | | { |
| 143 | | switch (t6721->command_state) |
| 144 | | { |
| 145 | | case 0: |
| 146 | | switch (t6721->command_data) |
| 147 | | { |
| 148 | | case 9: case 0xb: |
| 149 | | t6721->playing = 0; |
| 150 | | break; |
| 151 | | case 1: /* start */ |
| 152 | | t6721->timer->adjust(attotime::zero, 0, attotime::from_hz(8000)); |
| 153 | | t6721->playing = 1; |
| 154 | | t6721->end_of_sample = 0; |
| 155 | | t6721->sample_timeindex = 0; |
| 156 | | break; |
| 157 | | case 2: |
| 158 | | t6721->end_of_sample = 0; |
| 159 | | /*t6721->busy = 0; */ |
| 160 | | t6721->timer->reset(); |
| 161 | | t6721->playing = 0; |
| 162 | | break; |
| 163 | | case 5: /* set rate (in next nibble) */ |
| 164 | | t6721->command_state = 1; |
| 165 | | break; |
| 166 | | case 6: /* condition */ |
| 167 | | t6721->command_state = 2; |
| 168 | | break; |
| 169 | | } |
| 170 | | break; |
| 171 | | case 1: |
| 172 | | t6721->command_state = 0; |
| 173 | | t6721->rate = t6721->command_data; |
| 174 | | break; |
| 175 | | case 2: |
| 176 | | t6721->command_state = 0; |
| 177 | | break; |
| 178 | | } |
| 179 | | } |
| 180 | | else |
| 181 | | { |
| 182 | | t6721->command_data = data; |
| 183 | | } |
| 184 | | break; |
| 185 | | case 1: |
| 186 | | t6721->state = (t6721->state & ~0x3f) | data; |
| 187 | | break; |
| 188 | | case 2: |
| 189 | | t6721->sample_data[t6721->sample_index++] = data; |
| 190 | | if (t6721->sample_index == sizeof(t6721->sample_data)) |
| 191 | | { |
| 192 | | DBG_LOG(1,"t6721",("%.2x%.2x%.2x%.2x%.2x%.2x\n", |
| 193 | | t6721->sample_data[0], |
| 194 | | t6721->sample_data[1], |
| 195 | | t6721->sample_data[2], |
| 196 | | t6721->sample_data[3], |
| 197 | | t6721->sample_data[4], |
| 198 | | t6721->sample_data[5])); |
| 199 | | t6721->sample_index = 0; |
| 200 | | /*t6721->end_of_sample = false; */ |
| 201 | | t6721->busy = 1; |
| 202 | | t6721->state = 0; |
| 203 | | } |
| 204 | | break; |
| 205 | | } |
| 206 | | } |
| 207 | | |
| 208 | | READ8_DEVICE_HANDLER( t6721_speech_r ) |
| 209 | | { |
| 210 | | t6721_state *t6721 = get_safe_token(device); |
| 211 | | |
| 212 | | int data = 0xff; |
| 213 | | switch (offset) |
| 214 | | { |
| 215 | | case 1: |
| 216 | | data = t6721->state; |
| 217 | | data = 1; |
| 218 | | if (!t6721->end_of_sample) |
| 219 | | { |
| 220 | | data |= 0x41; |
| 221 | | if (!t6721->busy) |
| 222 | | data |= 0x81; |
| 223 | | } |
| 224 | | break; |
| 225 | | } |
| 226 | | DBG_LOG(2, "364", ("port read %.2x %.2x\n", offset, data)); |
| 227 | | |
| 228 | | return data; |
| 229 | | } |
| 230 | | |
| 231 | | /***************************************************************************** |
| 232 | | DEVICE INTERFACE |
| 233 | | *****************************************************************************/ |
| 234 | | |
| 235 | | static DEVICE_START( t6721 ) |
| 236 | | { |
| 237 | | t6721_state *t6721 = get_safe_token(device); |
| 238 | | |
| 239 | | t6721->timer = device->machine().scheduler().timer_alloc(FUNC(t6721_speech_timer), t6721); |
| 240 | | |
| 241 | | device->save_item(NAME(t6721->sample_data)); |
| 242 | | device->save_item(NAME(t6721->data)); |
| 243 | | |
| 244 | | device->save_item(NAME(t6721->sample_index)); |
| 245 | | device->save_item(NAME(t6721->busy)); |
| 246 | | |
| 247 | | device->save_item(NAME(t6721->end_of_sample)); |
| 248 | | device->save_item(NAME(t6721->playing)); |
| 249 | | device->save_item(NAME(t6721->rate)); |
| 250 | | |
| 251 | | device->save_item(NAME(t6721->command_data)); |
| 252 | | device->save_item(NAME(t6721->command_state)); |
| 253 | | device->save_item(NAME(t6721->state)); |
| 254 | | |
| 255 | | device->save_item(NAME(t6721->sample_timeindex)); |
| 256 | | |
| 257 | | device->save_item(NAME(t6721->readindex)); |
| 258 | | device->save_item(NAME(t6721->writeindex)); |
| 259 | | } |
| 260 | | |
| 261 | | |
| 262 | | static DEVICE_RESET( t6721 ) |
| 263 | | { |
| 264 | | t6721_state *t6721 = get_safe_token(device); |
| 265 | | |
| 266 | | memset(t6721->sample_data, 0, ARRAY_LENGTH(t6721->sample_data)); |
| 267 | | memset(t6721->data, 0, ARRAY_LENGTH(t6721->data)); |
| 268 | | |
| 269 | | t6721->sample_index = 0; |
| 270 | | t6721->busy = 0; |
| 271 | | |
| 272 | | t6721->end_of_sample = 0; |
| 273 | | t6721->playing = 0; |
| 274 | | t6721->rate = 0; |
| 275 | | |
| 276 | | t6721->command_data = 0; |
| 277 | | t6721->command_state = 0; |
| 278 | | t6721->state = 0; |
| 279 | | |
| 280 | | t6721->sample_timeindex = 0; |
| 281 | | |
| 282 | | t6721->readindex = 0; |
| 283 | | t6721->writeindex = 0; |
| 284 | | } |
| 285 | | |
| 286 | | const device_type T6721 = &device_creator<t6721_device>; |
| 287 | | |
| 288 | | t6721_device::t6721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 289 | | : device_t(mconfig, T6721, "Toshiba 6721A", tag, owner, clock) |
| 290 | | { |
| 291 | | m_token = global_alloc_clear(t6721_state); |
| 292 | | } |
| 293 | | |
| 294 | | //------------------------------------------------- |
| 295 | | // device_config_complete - perform any |
| 296 | | // operations now that the configuration is |
| 297 | | // complete |
| 298 | | //------------------------------------------------- |
| 299 | | |
| 300 | | void t6721_device::device_config_complete() |
| 301 | | { |
| 302 | | } |
| 303 | | |
| 304 | | //------------------------------------------------- |
| 305 | | // device_start - device-specific startup |
| 306 | | //------------------------------------------------- |
| 307 | | |
| 308 | | void t6721_device::device_start() |
| 309 | | { |
| 310 | | DEVICE_START_NAME( t6721 )(this); |
| 311 | | } |
| 312 | | |
| 313 | | //------------------------------------------------- |
| 314 | | // device_reset - device-specific reset |
| 315 | | //------------------------------------------------- |
| 316 | | |
| 317 | | void t6721_device::device_reset() |
| 318 | | { |
| 319 | | DEVICE_RESET_NAME( t6721 )(this); |
| 320 | | } |
trunk/src/mess/machine/c64_magic_voice.c
| r0 | r20799 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Commodore Magic Voice cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "c64_magic_voice.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS / CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define T6721A_TAG "u5" |
| 19 | #define MOS6525_TAG "u2" |
| 20 | |
| 21 | |
| 22 | |
| 23 | //************************************************************************** |
| 24 | // DEVICE DEFINITIONS |
| 25 | //************************************************************************** |
| 26 | |
| 27 | const device_type C64_MAGIC_VOICE = &device_creator<c64_magic_voice_cartridge_device>; |
| 28 | |
| 29 | |
| 30 | //------------------------------------------------- |
| 31 | // tpi6525_interface tpi_intf |
| 32 | //------------------------------------------------- |
| 33 | |
| 34 | static const tpi6525_interface tpi_intf = |
| 35 | { |
| 36 | DEVCB_NULL, |
| 37 | DEVCB_NULL, |
| 38 | DEVCB_NULL, |
| 39 | DEVCB_NULL, |
| 40 | DEVCB_NULL, |
| 41 | DEVCB_NULL, |
| 42 | DEVCB_NULL, |
| 43 | DEVCB_NULL, |
| 44 | DEVCB_NULL |
| 45 | }; |
| 46 | |
| 47 | |
| 48 | //------------------------------------------------- |
| 49 | // C64_EXPANSION_INTERFACE( expansion_intf ) |
| 50 | //------------------------------------------------- |
| 51 | |
| 52 | READ8_MEMBER( c64_magic_voice_cartridge_device::dma_cd_r ) |
| 53 | { |
| 54 | return m_slot->dma_cd_r(offset); |
| 55 | } |
| 56 | |
| 57 | WRITE8_MEMBER( c64_magic_voice_cartridge_device::dma_cd_w ) |
| 58 | { |
| 59 | m_slot->dma_cd_w(offset, data); |
| 60 | } |
| 61 | |
| 62 | WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::irq_w ) |
| 63 | { |
| 64 | m_slot->irq_w(state); |
| 65 | } |
| 66 | |
| 67 | WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::nmi_w ) |
| 68 | { |
| 69 | m_slot->nmi_w(state); |
| 70 | } |
| 71 | |
| 72 | WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::dma_w ) |
| 73 | { |
| 74 | m_slot->dma_w(state); |
| 75 | } |
| 76 | |
| 77 | WRITE_LINE_MEMBER( c64_magic_voice_cartridge_device::reset_w ) |
| 78 | { |
| 79 | m_slot->reset_w(state); |
| 80 | } |
| 81 | |
| 82 | static C64_EXPANSION_INTERFACE( expansion_intf ) |
| 83 | { |
| 84 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_cd_r), |
| 85 | DEVCB_DEVICE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_cd_w), |
| 86 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, irq_w), |
| 87 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, nmi_w), |
| 88 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, dma_w), |
| 89 | DEVCB_DEVICE_LINE_MEMBER(DEVICE_SELF_OWNER, c64_magic_voice_cartridge_device, reset_w) |
| 90 | }; |
| 91 | |
| 92 | |
| 93 | //------------------------------------------------- |
| 94 | // MACHINE_CONFIG_FRAGMENT( c64_magic_voice ) |
| 95 | //------------------------------------------------- |
| 96 | |
| 97 | static MACHINE_CONFIG_FRAGMENT( c64_magic_voice ) |
| 98 | MCFG_TPI6525_ADD(MOS6525_TAG, tpi_intf) |
| 99 | |
| 100 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 101 | MCFG_SOUND_ADD(T6721A_TAG, T6721A, XTAL_640kHz) |
| 102 | MCFG_T6721A_EOS_HANDLER(DEVWRITELINE(MOS6525_TAG, tpi6525_device, i2_w)) |
| 103 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 104 | |
| 105 | MCFG_C64_EXPANSION_SLOT_ADD(C64_EXPANSION_SLOT_TAG, 0, expansion_intf, c64_expansion_cards, NULL, NULL) |
| 106 | MACHINE_CONFIG_END |
| 107 | |
| 108 | |
| 109 | //------------------------------------------------- |
| 110 | // machine_config_additions - device-specific |
| 111 | // machine configurations |
| 112 | //------------------------------------------------- |
| 113 | |
| 114 | machine_config_constructor c64_magic_voice_cartridge_device::device_mconfig_additions() const |
| 115 | { |
| 116 | return MACHINE_CONFIG_NAME( c64_magic_voice ); |
| 117 | } |
| 118 | |
| 119 | |
| 120 | |
| 121 | //************************************************************************** |
| 122 | // LIVE DEVICE |
| 123 | //************************************************************************** |
| 124 | |
| 125 | //------------------------------------------------- |
| 126 | // c64_magic_voice_cartridge_device - constructor |
| 127 | //------------------------------------------------- |
| 128 | |
| 129 | c64_magic_voice_cartridge_device::c64_magic_voice_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : |
| 130 | device_t(mconfig, C64_MAGIC_VOICE, "C64 Magic Voice cartridge", tag, owner, clock), |
| 131 | device_c64_expansion_card_interface(mconfig, *this), |
| 132 | m_vslsi(*this, T6721A_TAG), |
| 133 | m_tpi(*this, MOS6525_TAG), |
| 134 | m_exp(*this, C64_EXPANSION_SLOT_TAG) |
| 135 | { |
| 136 | } |
| 137 | |
| 138 | |
| 139 | //------------------------------------------------- |
| 140 | // device_start - device-specific startup |
| 141 | //------------------------------------------------- |
| 142 | |
| 143 | void c64_magic_voice_cartridge_device::device_start() |
| 144 | { |
| 145 | } |
| 146 | |
| 147 | |
| 148 | //------------------------------------------------- |
| 149 | // device_reset - device-specific reset |
| 150 | //------------------------------------------------- |
| 151 | |
| 152 | void c64_magic_voice_cartridge_device::device_reset() |
| 153 | { |
| 154 | m_tpi->reset(); |
| 155 | } |
| 156 | |
| 157 | |
| 158 | //------------------------------------------------- |
| 159 | // c64_cd_r - cartridge data read |
| 160 | //------------------------------------------------- |
| 161 | |
| 162 | UINT8 c64_magic_voice_cartridge_device::c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 163 | { |
| 164 | data = m_exp->cd_r(space, offset, data, sphi2, ba, roml, romh, io1, io2); |
| 165 | |
| 166 | if (!io2 && BIT(offset, 7)) |
| 167 | { |
| 168 | m_tpi->read(space, offset & 0x07); |
| 169 | } |
| 170 | |
| 171 | return data; |
| 172 | } |
| 173 | |
| 174 | |
| 175 | //------------------------------------------------- |
| 176 | // c64_cd_w - cartridge data write |
| 177 | //------------------------------------------------- |
| 178 | |
| 179 | void c64_magic_voice_cartridge_device::c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2) |
| 180 | { |
| 181 | if (!io2 && BIT(offset, 7)) |
| 182 | { |
| 183 | m_tpi->write(space, offset & 0x07, data); |
| 184 | } |
| 185 | |
| 186 | m_exp->cd_w(space, offset, data, sphi2, ba, roml, romh, io1, io2); |
| 187 | } |
| 188 | |
| 189 | |
| 190 | //------------------------------------------------- |
| 191 | // c64_game_r - GAME read |
| 192 | //------------------------------------------------- |
| 193 | |
| 194 | int c64_magic_voice_cartridge_device::c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram) |
| 195 | { |
| 196 | return m_exp->game_r(offset, sphi2, ba, rw, hiram); |
| 197 | } |
| 198 | |
| 199 | |
| 200 | //------------------------------------------------- |
| 201 | // c64_exrom_r - EXROM read |
| 202 | //------------------------------------------------- |
| 203 | |
| 204 | int c64_magic_voice_cartridge_device::c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram) |
| 205 | { |
| 206 | return m_exp->exrom_r(offset, sphi2, ba, rw, hiram); |
| 207 | } |
trunk/src/mess/machine/c64_magic_voice.h
| r0 | r20799 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | Commodore Magic Voice cartridge emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #pragma once |
| 11 | |
| 12 | #ifndef __MAGIC_VOICE__ |
| 13 | #define __MAGIC_VOICE__ |
| 14 | |
| 15 | #include "emu.h" |
| 16 | #include "machine/6525tpi.h" |
| 17 | #include "machine/c64exp.h" |
| 18 | #include "machine/cbmipt.h" |
| 19 | #include "sound/t6721a.h" |
| 20 | |
| 21 | |
| 22 | |
| 23 | //************************************************************************** |
| 24 | // TYPE DEFINITIONS |
| 25 | //************************************************************************** |
| 26 | |
| 27 | // ======================> c64_magic_voice_cartridge_device |
| 28 | |
| 29 | class c64_magic_voice_cartridge_device : public device_t, |
| 30 | public device_c64_expansion_card_interface |
| 31 | { |
| 32 | public: |
| 33 | // construction/destruction |
| 34 | c64_magic_voice_cartridge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); |
| 35 | |
| 36 | // optional information overrides |
| 37 | virtual machine_config_constructor device_mconfig_additions() const; |
| 38 | |
| 39 | // not really public |
| 40 | DECLARE_READ8_MEMBER( dma_cd_r ); |
| 41 | DECLARE_WRITE8_MEMBER( dma_cd_w ); |
| 42 | DECLARE_WRITE_LINE_MEMBER( irq_w ); |
| 43 | DECLARE_WRITE_LINE_MEMBER( nmi_w ); |
| 44 | DECLARE_WRITE_LINE_MEMBER( dma_w ); |
| 45 | DECLARE_WRITE_LINE_MEMBER( reset_w ); |
| 46 | |
| 47 | protected: |
| 48 | // device-level overrides |
| 49 | virtual void device_config_complete() { m_shortname = "c64_magic_voice"; } |
| 50 | virtual void device_start(); |
| 51 | virtual void device_reset(); |
| 52 | |
| 53 | // device_c64_expansion_card_interface overrides |
| 54 | virtual UINT8 c64_cd_r(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); |
| 55 | virtual void c64_cd_w(address_space &space, offs_t offset, UINT8 data, int sphi2, int ba, int roml, int romh, int io1, int io2); |
| 56 | virtual int c64_game_r(offs_t offset, int sphi2, int ba, int rw, int hiram); |
| 57 | virtual int c64_exrom_r(offs_t offset, int sphi2, int ba, int rw, int hiram); |
| 58 | |
| 59 | private: |
| 60 | required_device<t6721a_device> m_vslsi; |
| 61 | required_device<tpi6525_device> m_tpi; |
| 62 | required_device<c64_expansion_slot_device> m_exp; |
| 63 | }; |
| 64 | |
| 65 | |
| 66 | // device type definition |
| 67 | extern const device_type C64_MAGIC_VOICE; |
| 68 | |
| 69 | |
| 70 | |
| 71 | #endif |
trunk/src/mess/machine/mos8706.c
| r0 | r20799 | |
| 1 | /********************************************************************** |
| 2 | |
| 3 | MOS 8706 Speech Glue Logic ASIC emulation |
| 4 | |
| 5 | Copyright MESS Team. |
| 6 | Visit http://mamedev.org for licensing and usage restrictions. |
| 7 | |
| 8 | **********************************************************************/ |
| 9 | |
| 10 | #include "mos8706.h" |
| 11 | |
| 12 | |
| 13 | |
| 14 | //************************************************************************** |
| 15 | // MACROS / CONSTANTS |
| 16 | //************************************************************************** |
| 17 | |
| 18 | #define LOG 0 |
| 19 | |
| 20 | |
| 21 | |
| 22 | //************************************************************************** |
| 23 | // DEVICE DEFINITIONS |
| 24 | //************************************************************************** |
| 25 | |
| 26 | // device type definition |
| 27 | const device_type MOS8706 = &device_creator<mos8706_device>; |
| 28 | |
| 29 | |
| 30 | |
| 31 | //************************************************************************** |
| 32 | // LIVE DEVICE |
| 33 | //************************************************************************** |
| 34 | |
| 35 | //------------------------------------------------- |
| 36 | // mos8706_device - constructor |
| 37 | //------------------------------------------------- |
| 38 | |
| 39 | mos8706_device::mos8706_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 40 | : device_t(mconfig, MOS8706, "MOS8706", tag, owner, clock) |
| 41 | { |
| 42 | } |
| 43 | |
| 44 | |
| 45 | //------------------------------------------------- |
| 46 | // device_start - device-specific startup |
| 47 | //------------------------------------------------- |
| 48 | |
| 49 | void mos8706_device::device_start() |
| 50 | { |
| 51 | } |
| 52 | |
| 53 | |
| 54 | //------------------------------------------------- |
| 55 | // device_reset - device-specific reset |
| 56 | //------------------------------------------------- |
| 57 | |
| 58 | void mos8706_device::device_reset() |
| 59 | { |
| 60 | } |
| 61 | |
| 62 | |
| 63 | //------------------------------------------------- |
| 64 | // read - |
| 65 | //------------------------------------------------- |
| 66 | |
| 67 | READ8_MEMBER( mos8706_device::read ) |
| 68 | { |
| 69 | return 0; |
| 70 | } |
| 71 | |
| 72 | |
| 73 | //------------------------------------------------- |
| 74 | // write - |
| 75 | //------------------------------------------------- |
| 76 | |
| 77 | WRITE8_MEMBER( mos8706_device::write ) |
| 78 | { |
| 79 | } |
trunk/src/mess/includes/plus4.h
| r20798 | r20799 | |
| 4 | 4 | #define __PLUS4__ |
| 5 | 5 | |
| 6 | 6 | #include "emu.h" |
| 7 | #include "audio/mos7360.h" |
| 7 | 8 | #include "cpu/m6502/m7501.h" |
| 8 | 9 | #include "formats/cbm_snqk.h" |
| 9 | | #include "audio/t6721.h" |
| 10 | | #include "audio/mos7360.h" |
| 11 | | #include "machine/mos6551.h" |
| 12 | | #include "machine/plus4exp.h" |
| 13 | | #include "machine/plus4user.h" |
| 14 | 10 | #include "machine/cbmiec.h" |
| 15 | 11 | #include "machine/cbmipt.h" |
| 16 | 12 | #include "machine/mos6529.h" |
| 13 | #include "machine/mos6551.h" |
| 14 | #include "machine/mos8706.h" |
| 17 | 15 | #include "machine/petcass.h" |
| 18 | 16 | #include "machine/pla.h" |
| 17 | #include "machine/plus4exp.h" |
| 18 | #include "machine/plus4user.h" |
| 19 | 19 | #include "machine/ram.h" |
| 20 | #include "sound/t6721a.h" |
| 20 | 21 | |
| 21 | 22 | #define MOS7501_TAG "u2" |
| 22 | 23 | #define MOS7360_TAG "u1" |
| 23 | 24 | #define MOS6551_TAG "u3" |
| 24 | 25 | #define MOS6529_USER_TAG "u5" |
| 25 | 26 | #define MOS6529_KB_TAG "u27" |
| 26 | | #define T6721_TAG "t6721" |
| 27 | #define T6721A_TAG "t6721a" |
| 28 | #define MOS8706_TAG "mos8706" |
| 27 | 29 | #define PLA_TAG "u19" |
| 28 | 30 | #define SCREEN_TAG "screen" |
| 29 | 31 | #define CONTROL1_TAG "joy1" |
| r20798 | r20799 | |
| 40 | 42 | m_acia(*this, MOS6551_TAG), |
| 41 | 43 | m_spi_user(*this, MOS6529_USER_TAG), |
| 42 | 44 | m_spi_kb(*this, MOS6529_KB_TAG), |
| 43 | | m_t6721(*this, T6721_TAG), |
| 45 | m_vslsi(*this, MOS8706_TAG), |
| 44 | 46 | m_iec(*this, CBM_IEC_TAG), |
| 45 | 47 | m_joy1(*this, CONTROL1_TAG), |
| 46 | 48 | m_joy2(*this, CONTROL2_TAG), |
| r20798 | r20799 | |
| 72 | 74 | optional_device<mos6551_device> m_acia; |
| 73 | 75 | optional_device<mos6529_device> m_spi_user; |
| 74 | 76 | required_device<mos6529_device> m_spi_kb; |
| 75 | | optional_device<t6721_device> m_t6721; |
| 77 | optional_device<mos8706_device> m_vslsi; |
| 76 | 78 | required_device<cbm_iec_device> m_iec; |
| 77 | 79 | required_device<vcs_control_port_device> m_joy1; |
| 78 | 80 | required_device<vcs_control_port_device> m_joy2; |
trunk/src/mess/drivers/plus4.c
| r20798 | r20799 | |
| 135 | 135 | |
| 136 | 136 | //logerror("offset %04x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,user,_6551,addr_clk,keyport,kernal,cs0,cs1); |
| 137 | 137 | |
| 138 | | if (!scs && m_t6721) |
| 138 | if (!scs && m_vslsi) |
| 139 | 139 | { |
| 140 | | data = t6721_speech_r(m_t6721, space, offset & 0x03); |
| 140 | data = m_vslsi->read(space, offset & 0x03); |
| 141 | 141 | } |
| 142 | 142 | else if (!user) |
| 143 | 143 | { |
| r20798 | r20799 | |
| 264 | 264 | |
| 265 | 265 | //logerror("write offset %04x data %02x user %u 6551 %u addr_clk %u keyport %u kernal %u cs0 %u cs1 %u\n", offset,data,user,_6551,addr_clk,keyport,kernal,cs0,cs1); |
| 266 | 266 | |
| 267 | | if (!scs && m_t6721) |
| 267 | if (!scs && m_vslsi) |
| 268 | 268 | { |
| 269 | | t6721_speech_w(m_t6721, space, offset & 0x03, data); |
| 269 | m_vslsi->write(space, offset & 0x03, data); |
| 270 | 270 | } |
| 271 | 271 | else if (!user && m_spi_user) |
| 272 | 272 | { |
| r20798 | r20799 | |
| 940 | 940 | //------------------------------------------------- |
| 941 | 941 | |
| 942 | 942 | static MACHINE_CONFIG_DERIVED( v364, ntsc ) |
| 943 | | MCFG_T6721_ADD(T6721_TAG) |
| 944 | | //MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 943 | MCFG_SOUND_ADD(T6721A_TAG, T6721A, XTAL_640kHz) |
| 944 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 945 | |
| 946 | MCFG_MOS8706_ADD(MOS8706_TAG, XTAL_14_31818MHz/16) |
| 945 | 947 | MACHINE_CONFIG_END |
| 946 | 948 | |
| 947 | 949 | |