| Previous | 199869 Revisions | Next |
| r17613 Monday 3rd September, 2012 at 13:56:17 UTC by Miodrag Milanović |
|---|
| conversion of legacy devices into modern wip (no whatsnew) |
| [src/emu/machine] | 6525tpi.c 6525tpi.h 68681.c 68681.h 74148.c 74148.h 74153.c 74153.h adc083x.c adc083x.h adc1038.c adc1038.h adc1213x.c adc1213x.h idectrl.c idectrl.h k053252.c k053252.h latch8.c latch8.h mb14241.c mb14241.h mb87078.c mb87078.h pd4990a.c pd4990a.h pic8259.c pic8259.h pit8253.c pit8253.h rp5h01.c rp5h01.h smc91c9x.c smc91c9x.h tms6100.c tms6100.h upd4701.c upd4701.h wd17xx.c wd17xx.h |
| [src/emu/sound] | 2151intf.c 2151intf.h 2203intf.c 2203intf.h 2413intf.c 2413intf.h 2608intf.c 2608intf.h 2610intf.c 2610intf.h 2612intf.c 2612intf.h 262intf.c 262intf.h 3526intf.c 3526intf.h 3812intf.c 3812intf.h 8950intf.c 8950intf.h aica.c aica.h astrocde.c astrocde.h ay8910.c ay8910.h beep.c beep.h c140.c c140.h c6280.c c6280.h cdda.c cdda.h cem3394.c cem3394.h digitalk.c digitalk.h dmadac.c dmadac.h es5506.c es5506.h es8712.c es8712.h flt_rc.c flt_rc.h flt_vol.c flt_vol.h gaelco.c gaelco.h hc55516.c hc55516.h iremga20.c iremga20.h k005289.c k005289.h k007232.c k007232.h k051649.c k051649.h k053260.c k053260.h k056800.c k056800.h mos6560.c mos6560.h msm5205.c msm5205.h msm5232.c msm5232.h multipcm.c multipcm.h n63701x.c n63701x.h namco.c namco.h nes_apu.c nes_apu.h nile.c nile.h okim6258.c okim6258.h okim6376.c okim6376.h qsound.c qsound.h rf5c400.c rf5c400.h rf5c68.c rf5c68.h s14001a.c s14001a.h s2636.c s2636.h saa1099.c saa1099.h scsp.c scsp.h segapcm.c segapcm.h sid6581.c sid6581.h sn76477.c sn76477.h sn76496.c sn76496.h snkwave.c snkwave.h sp0250.c sp0250.h sp0256.c sp0256.h speaker.c speaker.h st0016.c st0016.h t6w28.c t6w28.h tiaintf.c tiaintf.h tms3615.c tms3615.h tms36xx.c tms36xx.h tms5110.c tms5110.h tms5220.c tms5220.h upd7759.c upd7759.h vlm5030.c vlm5030.h vrender0.c vrender0.h wave.c wave.h x1_010.c x1_010.h ymf271.c ymf271.h ymf278b.c ymf278b.h ymz280b.c ymz280b.h zsg2.c zsg2.h |
| [src/emu/video] | hd63484.c hd63484.h i8275.c i8275.h s2636.c s2636.h saa5050.c saa5050.h tlc34076.c tlc34076.h tms9927.c tms9927.h voodoo.c voodoo.h |
| [src/mame/audio] | amiga.c beezer.c cps3.c exidy.c exidy.h exidy440.c flower.c geebee.c gomoku.c gridlee.c hyprolyb.c hyprolyb.h irem.c irem.h leland.c m72.c m72.h micro3d.c namco52.c namco52.h namco54.c namco54.h phoenix.c pleiads.c pleiads.h polepos.c redbaron.c segag80r.c segasnd.c seibu.c seibu.h snes_snd.c snes_snd.h snk6502.c taitosnd.c taitosnd.h tiamc1.c timeplt.c timeplt.h trackfld.c trackfld.h tx1.c warpwarp.c wiping.c wiping.h |
| [src/mame/drivers] | mjkjidai.c ninjaw.c renegade.c |
| [src/mame/includes] | amiga.h beezer.h bzone.h cd32.h cps3.h flower.h gomoku.h gridlee.h leland.h micro3d.h phoenix.h polepos.h snk6502.h tiamc1.h tx1.h warpwarp.h |
| [src/mame/machine] | buggychl.c buggychl.h cd32.c decocass.c decocass.h gaelco3d.c gaelco3d.h mathbox.c mathbox.h namco06.c namco06.h namco50.c namco50.h namco51.c namco51.h namco53.c namco53.h namco62.c namco62.h namcoio.c namcoio.h nmk112.c nmk112.h taitoio.c taitoio.h |
| [src/mame/video] | atarirle.c atarirle.h deco16ic.c deco16ic.h decocomn.c decocomn.h kan_pand.c kan_pand.h konicdev.c konicdev.h taitoic.c taitoic.h vrender0.c vrender0.h |
| [src/mess/audio] | channelf.c dave.c dave.h gb.c gb.h gmaster.c lynx.c mac.c mea8000.c mea8000.h socrates.c socrates.h special.c svision.c t6721.c t6721.h upd1771.c upd1771.h vc4000.c wswan.c |
| [src/mess/drivers] | pv1000.c |
| [src/mess/includes] | apollo.h channelf.h gmaster.h lynx.h mac.h mc68328.h odyssey2.h special.h svision.h vc4000.h wswan.h |
| [src/mess/machine] | 990_tap.c 990_tap.h apollo.c applefdc.c applefdc.h at45dbxx.c at45dbxx.h ataridev.h atarifdc.c ay31015.c ay31015.h beta.c beta.h ds1315.c ds1315.h e05a03.c e05a03.h er59256.c er59256.h hd63450.c hd63450.h i8271.c i8271.h kr2376.c kr2376.h mc68328.c mc68328.h mc6843.c mc6843.h mc6846.c mc6846.h mc6854.c mc6854.h micropolis.c micropolis.h mm58274c.c mm58274c.h mos6530.c mos6530.h omti8621.c omti8621.h pc_lpt.c pc_lpt.h pcf8593.c pcf8593.h pf10.c pf10.h s3c44b0.c s3c44b0.h sst39vfx.c sst39vfx.h strata.c strata.h tf20.c tf20.h upd7002.c upd7002.h upd71071.c upd71071.h upd765.c upd765.h |
| [src/mess/video] | 733_asr.c 733_asr.h 911_vdt.c 911_vdt.h apollo.c crt.c crt.h dl1416.c dl1416.h k1ge.c k1ge.h odyssey2.c saa505x.c saa505x.h vdc8563.c vdc8563.h vic4567.c vic4567.h vic6567.c vic6567.h vtvideo.c vtvideo.h |
| r17612 | r17613 | |
|---|---|---|
| 185 | 185 | if (~data & 8) |
| 186 | 186 | { |
| 187 | 187 | device_t *device = machine.device(data & 4 ? "noise_2" : "noise_1"); |
| 188 | noise_state *nstate = (noise_state *)downcast< | |
| 188 | noise_state *nstate = (noise_state *)downcast<mi | |
| 189 | 189 | |
| 190 | 190 | if (state->m_dac_data != nstate->dac[data & 3]) |
| 191 | 191 | { |
| r17612 | r17613 | |
| 214 | 214 | assert(device != NULL); |
| 215 | 215 | assert(device->type() == MICRO3D); |
| 216 | 216 | |
| 217 | return (noise_state *)downcast< | |
| 217 | return (noise_state *)downcast<mi | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static STREAM_UPDATE( micro3d_stream_update ) |
| r17612 | r17613 | |
| 419 | 419 | } |
| 420 | 420 | |
| 421 | 421 | |
| 422 | DEFINE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound); | |
| 422 | const device_type MICRO3D = &device_creator<micro3d_sound_device>; | |
| 423 | ||
| 424 | micro3d_sound_device::micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 425 | : device_t(mconfig, MICRO3D, "Microprose Custom", tag, owner, clock), | |
| 426 | device_sound_interface(mconfig, *this) | |
| 427 | { | |
| 428 | m_token = global_alloc_array_clear(UINT8, sizeof(noise_state)); | |
| 429 | } | |
| 430 | ||
| 431 | //------------------------------------------------- | |
| 432 | // device_config_complete - perform any | |
| 433 | // operations now that the configuration is | |
| 434 | // complete | |
| 435 | //------------------------------------------------- | |
| 436 | ||
| 437 | void micro3d_sound_device::device_config_complete() | |
| 438 | { | |
| 439 | } | |
| 440 | ||
| 441 | //------------------------------------------------- | |
| 442 | // device_start - device-specific startup | |
| 443 | //------------------------------------------------- | |
| 444 | ||
| 445 | void micro3d_sound_device::device_start() | |
| 446 | { | |
| 447 | DEVICE_START_NAME( micro3d_sound )(this); | |
| 448 | } | |
| 449 | ||
| 450 | //------------------------------------------------- | |
| 451 | // device_reset - device-specific reset | |
| 452 | //------------------------------------------------- | |
| 453 | ||
| 454 | void micro3d_sound_device::device_reset() | |
| 455 | { | |
| 456 | DEVICE_RESET_NAME( micro3d_sound )(this); | |
| 457 | } | |
| 458 | ||
| 459 | //------------------------------------------------- | |
| 460 | // sound_stream_update - handle a stream update | |
| 461 | //------------------------------------------------- | |
| 462 | ||
| 463 | void micro3d_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 464 | { | |
| 465 | // should never get here | |
| 466 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 467 | } | |
| 468 | ||
| 469 |
| r17612 | r17613 | |
|---|---|---|
| 40 | 40 | assert(device != NULL); |
| 41 | 41 | assert(device->type() == WARPWARP); |
| 42 | 42 | |
| 43 | return (warpwarp_sound_state *)downcast< | |
| 43 | return (warpwarp_sound_state *)downcast<w | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static TIMER_CALLBACK( sound_volume_decay ) |
| r17612 | r17613 | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| 261 | DEFINE_LEGACY_SOUND_DEVICE(WARPWARP, warpwarp_sound); | |
| 261 | const device_type WARPWARP = &device_creator<warpwarp_sound_device>; | |
| 262 | ||
| 263 | warpwarp_sound_device::warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 264 | : device_t(mconfig, WARPWARP, "Warp Warp Custom", tag, owner, clock), | |
| 265 | device_sound_interface(mconfig, *this) | |
| 266 | { | |
| 267 | m_token = global_alloc_array_clear(UINT8, sizeof(warpwarp_sound_state)); | |
| 268 | } | |
| 269 | ||
| 270 | //------------------------------------------------- | |
| 271 | // device_config_complete - perform any | |
| 272 | // operations now that the configuration is | |
| 273 | // complete | |
| 274 | //------------------------------------------------- | |
| 275 | ||
| 276 | void warpwarp_sound_device::device_config_complete() | |
| 277 | { | |
| 278 | } | |
| 279 | ||
| 280 | //------------------------------------------------- | |
| 281 | // device_start - device-specific startup | |
| 282 | //------------------------------------------------- | |
| 283 | ||
| 284 | void warpwarp_sound_device::device_start() | |
| 285 | { | |
| 286 | DEVICE_START_NAME( warpwarp_sound )(this); | |
| 287 | } | |
| 288 | ||
| 289 | //------------------------------------------------- | |
| 290 | // sound_stream_update - handle a stream update | |
| 291 | //------------------------------------------------- | |
| 292 | ||
| 293 | void warpwarp_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 294 | { | |
| 295 | // should never get here | |
| 296 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 297 | } | |
| 298 | ||
| 299 |
| r17612 | r17613 | |
|---|---|---|
| 78 | 78 | assert(device != NULL); |
| 79 | 79 | assert(device->type() == PHOENIX); |
| 80 | 80 | |
| 81 | return (phoenix_sound_state *)downcast< | |
| 81 | return (phoenix_sound_state *)downcast<phoenix | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | INLINE int update_c24(phoenix_sound_state *state, int samplerate) |
| r17612 | r17613 | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | |
| 591 | DEFINE_LEGACY_SOUND_DEVICE(PHOENIX, phoenix_sound); | |
| 591 | const device_type PHOENIX = &device_creator<phoenix_sound_device>; | |
| 592 | ||
| 593 | phoenix_sound_device::phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 594 | : device_t(mconfig, PHOENIX, "Phoenix Custom", tag, owner, clock), | |
| 595 | device_sound_interface(mconfig, *this) | |
| 596 | { | |
| 597 | m_token = global_alloc_array_clear(UINT8, sizeof(phoenix_sound_state)); | |
| 598 | } | |
| 599 | ||
| 600 | //------------------------------------------------- | |
| 601 | // device_config_complete - perform any | |
| 602 | // operations now that the configuration is | |
| 603 | // complete | |
| 604 | //------------------------------------------------- | |
| 605 | ||
| 606 | void phoenix_sound_device::device_config_complete() | |
| 607 | { | |
| 608 | } | |
| 609 | ||
| 610 | //------------------------------------------------- | |
| 611 | // device_start - device-specific startup | |
| 612 | //------------------------------------------------- | |
| 613 | ||
| 614 | void phoenix_sound_device::device_start() | |
| 615 | { | |
| 616 | DEVICE_START_NAME( phoenix_sound )(this); | |
| 617 | } | |
| 618 | ||
| 619 | //------------------------------------------------- | |
| 620 | // sound_stream_update - handle a stream update | |
| 621 | //------------------------------------------------- | |
| 622 | ||
| 623 | void phoenix_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 624 | { | |
| 625 | // should never get here | |
| 626 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 627 | } | |
| 628 | ||
| 629 |
| r17612 | r17613 | |
|---|---|---|
| 66 | 66 | assert(device != NULL); |
| 67 | 67 | assert(device->type() == NAMCO_52XX); |
| 68 | 68 | |
| 69 | return (namco_52xx_state *)downcast< | |
| 69 | return (namco_52xx_state *)downcast<n | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| r17612 | r17613 | |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | DEFINE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx); | |
| 249 | const device_type NAMCO_52XX = &device_creator<namco_52xx_device>; | |
| 250 | ||
| 251 | namco_52xx_device::namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 252 | : device_t(mconfig, NAMCO_52XX, "Namco 52xx", tag, owner, clock) | |
| 253 | { | |
| 254 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_52xx_state)); | |
| 255 | } | |
| 256 | ||
| 257 | //------------------------------------------------- | |
| 258 | // device_config_complete - perform any | |
| 259 | // operations now that the configuration is | |
| 260 | // complete | |
| 261 | //------------------------------------------------- | |
| 262 | ||
| 263 | void namco_52xx_device::device_config_complete() | |
| 264 | { | |
| 265 | m_shortname = "namco52"; | |
| 266 | } | |
| 267 | ||
| 268 | //------------------------------------------------- | |
| 269 | // device_start - device-specific startup | |
| 270 | //------------------------------------------------- | |
| 271 | ||
| 272 | void namco_52xx_device::device_start() | |
| 273 | { | |
| 274 | DEVICE_START_NAME( namco_52xx )(this); | |
| 275 | } | |
| 276 | ||
| 277 | //------------------------------------------------- | |
| 278 | // device_mconfig_additions - return a pointer to | |
| 279 | // the device's machine fragment | |
| 280 | //------------------------------------------------- | |
| 281 | ||
| 282 | machine_config_constructor namco_52xx_device::device_mconfig_additions() const | |
| 283 | { | |
| 284 | return MACHINE_CONFIG_NAME( namco_52xx ); | |
| 285 | } | |
| 286 | ||
| 287 | //------------------------------------------------- | |
| 288 | // device_rom_region - return a pointer to the | |
| 289 | // the device's ROM definitions | |
| 290 | //------------------------------------------------- | |
| 291 | ||
| 292 | const rom_entry *namco_52xx_device::device_rom_region() const | |
| 293 | { | |
| 294 | return ROM_NAME(namco_52xx ); | |
| 295 | } | |
| 296 | ||
| 297 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | WRITE8_DEVICE_HANDLER( namco_52xx_write ); |
| 26 | 26 | |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_DEVICE(NAMCO_52XX, namco_52xx); | |
| 28 | class namco_52xx_device : public device_t | |
| 29 | { | |
| 30 | public: | |
| 31 | namco_52xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~namco_52xx_device() { global_free(m_token); } | |
| 29 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual const rom_entry *device_rom_region() const; | |
| 41 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 42 | private: | |
| 43 | // internal state | |
| 44 | void *m_token; | |
| 45 | }; | |
| 30 | 46 | |
| 47 | extern const device_type NAMCO_52XX; | |
| 48 | ||
| 49 | ||
| 50 | ||
| 31 | 51 | /* discrete nodes */ |
| 32 | 52 | #define NAMCO_52XX_P_DATA(base) (base) |
| 33 | 53 |
| r17612 | r17613 | |
|---|---|---|
| 141 | 141 | SPEECH BOARD |
| 142 | 142 | ***************************************************************************/ |
| 143 | 143 | |
| 144 | DECLARE_LEGACY_SOUND_DEVICE(SEGASPEECH, speech_sound); | |
| 144 | class speech_sound_device : public device_t, | |
| 145 | public device_sound_interface | |
| 146 | { | |
| 147 | public: | |
| 148 | speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 149 | ~speech_sound_device() { global_free(m_token); } | |
| 145 | 150 | |
| 151 | // access to legacy token | |
| 152 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 153 | protected: | |
| 154 | // device-level overrides | |
| 155 | virtual void device_config_complete(); | |
| 156 | virtual void device_start(); | |
| 157 | ||
| 158 | // sound stream update overrides | |
| 159 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 160 | private: | |
| 161 | // internal state | |
| 162 | void *m_token; | |
| 163 | }; | |
| 164 | ||
| 165 | extern const device_type SEGASPEECH; | |
| 166 | ||
| 167 | ||
| 146 | 168 | INLINE speech_state *get_safe_speech(device_t *device) |
| 147 | 169 | { |
| 148 | 170 | assert(device != NULL); |
| 149 | 171 | assert(device->type() == SEGASPEECH); |
| 150 | 172 | |
| 151 | return (speech_state *)downcast< | |
| 173 | return (speech_state *)downcast<spee | |
| 152 | 174 | } |
| 153 | 175 | |
| 154 | 176 | static DEVICE_START( speech_sound ) |
| r17612 | r17613 | |
| 175 | 197 | } |
| 176 | 198 | } |
| 177 | 199 | |
| 178 | ||
| 200 | const device_type | |
| 179 | 201 | |
| 202 | speech_sound_device::speech_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 203 | : device_t(mconfig, SEGASPEECH, "Sega Speech Sound Board", tag, owner, clock), | |
| 204 | device_sound_interface(mconfig, *this) | |
| 205 | { | |
| 206 | m_token = global_alloc_array_clear(UINT8, sizeof(speech_state)); | |
| 207 | } | |
| 180 | 208 | |
| 209 | //------------------------------------------------- | |
| 210 | // device_config_complete - perform any | |
| 211 | // operations now that the configuration is | |
| 212 | // complete | |
| 213 | //------------------------------------------------- | |
| 181 | 214 | |
| 215 | void speech_sound_device::device_config_complete() | |
| 216 | { | |
| 217 | } | |
| 218 | ||
| 219 | //------------------------------------------------- | |
| 220 | // device_start - device-specific startup | |
| 221 | //------------------------------------------------- | |
| 222 | ||
| 223 | void speech_sound_device::device_start() | |
| 224 | { | |
| 225 | DEVICE_START_NAME( speech_sound )(this); | |
| 226 | } | |
| 227 | ||
| 228 | //------------------------------------------------- | |
| 229 | // sound_stream_update - handle a stream update | |
| 230 | //------------------------------------------------- | |
| 231 | ||
| 232 | void speech_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 233 | { | |
| 234 | // should never get here | |
| 235 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 236 | } | |
| 237 | ||
| 238 | ||
| 239 | ||
| 240 | ||
| 241 | ||
| 182 | 242 | /************************************* |
| 183 | 243 | * |
| 184 | 244 | * i8035 port accessors |
| r17612 | r17613 | |
| 348 | 408 | UNIVERSAL SOUND BOARD |
| 349 | 409 | ***************************************************************************/ |
| 350 | 410 | |
| 351 | static DECLARE_LEGACY_SOUND_DEVICE(SEGAUSB, usb_sound); | |
| 411 | class usb_sound_device : public device_t, | |
| 412 | public device_sound_interface | |
| 413 | { | |
| 414 | public: | |
| 415 | usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 416 | ~usb_sound_device() { global_free(m_token); } | |
| 352 | 417 | |
| 418 | // access to legacy token | |
| 419 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 420 | protected: | |
| 421 | // device-level overrides | |
| 422 | virtual void device_config_complete(); | |
| 423 | virtual void device_start(); | |
| 424 | virtual void device_reset(); | |
| 425 | ||
| 426 | // sound stream update overrides | |
| 427 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 428 | private: | |
| 429 | // internal state | |
| 430 | void *m_token; | |
| 431 | }; | |
| 432 | ||
| 433 | extern const device_type SEGAUSB; | |
| 434 | ||
| 435 | ||
| 353 | 436 | INLINE usb_state *get_safe_token(device_t *device) |
| 354 | 437 | { |
| 355 | 438 | assert(device != NULL); |
| 356 | 439 | assert(device->type() == SEGAUSB); |
| 357 | 440 | |
| 358 | return (usb_state *)downcast< | |
| 441 | return (usb_state *)downcast<usb | |
| 359 | 442 | } |
| 360 | 443 | |
| 361 | 444 | /************************************* |
| r17612 | r17613 | |
| 817 | 900 | } |
| 818 | 901 | |
| 819 | 902 | |
| 820 | ||
| 903 | ||
| 821 | 904 | { |
| 822 | 905 | switch (state) |
| 823 | 906 | { |
| r17612 | r17613 | |
| 834 | 917 | } |
| 835 | 918 | } |
| 836 | 919 | |
| 837 | ||
| 920 | const device_type | |
| 838 | 921 | |
| 922 | usb_sound_device::usb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 923 | : device_t(mconfig, SEGAUSB, "Sega Universal Sound Board", tag, owner, clock), | |
| 924 | device_sound_interface(mconfig, *this) | |
| 925 | { | |
| 926 | m_token = global_alloc_array_clear(UINT8, sizeof(usb_state)); | |
| 927 | } | |
| 839 | 928 | |
| 929 | //------------------------------------------------- | |
| 930 | // device_config_complete - perform any | |
| 931 | // operations now that the configuration is | |
| 932 | // complete | |
| 933 | //------------------------------------------------- | |
| 840 | 934 | |
| 935 | void usb_sound_device::device_config_complete() | |
| 936 | { | |
| 937 | } | |
| 938 | ||
| 939 | //------------------------------------------------- | |
| 940 | // device_start - device-specific startup | |
| 941 | //------------------------------------------------- | |
| 942 | ||
| 943 | void usb_sound_device::device_start() | |
| 944 | { | |
| 945 | DEVICE_START_NAME( usb_sound )(this); | |
| 946 | } | |
| 947 | ||
| 948 | //------------------------------------------------- | |
| 949 | // device_reset - device-specific reset | |
| 950 | //------------------------------------------------- | |
| 951 | ||
| 952 | void usb_sound_device::device_reset() | |
| 953 | { | |
| 954 | DEVICE_RESET_NAME( usb_sound )(this); | |
| 955 | } | |
| 956 | ||
| 957 | //------------------------------------------------- | |
| 958 | // sound_stream_update - handle a stream update | |
| 959 | //------------------------------------------------- | |
| 960 | ||
| 961 | void usb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 962 | { | |
| 963 | // should never get here | |
| 964 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 965 | } | |
| 966 | ||
| 967 | ||
| 968 | ||
| 969 | ||
| 970 | ||
| 841 | 971 | /************************************* |
| 842 | 972 | * |
| 843 | 973 | * USB timer and envelope controls |
| r17612 | r17613 | |
|---|---|---|
| 39 | 39 | assert(device != NULL); |
| 40 | 40 | assert(device->type() == TC0140SYT); |
| 41 | 41 | |
| 42 | return (tc0140syt_state *)downcast< | |
| 42 | return (tc0140syt_state *)downcast<t | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | INLINE const tc0140syt_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 327 | 327 | } |
| 328 | 328 | } |
| 329 | 329 | |
| 330 | DEFINE_LEGACY_DEVICE(TC0140SYT, tc0140syt); | |
| 330 | const device_type TC0140SYT = &device_creator<tc0140syt_device>; | |
| 331 | ||
| 332 | tc0140syt_device::tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 333 | : device_t(mconfig, TC0140SYT, "Taito TC0140SYT", tag, owner, clock) | |
| 334 | { | |
| 335 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0140syt_state)); | |
| 336 | } | |
| 337 | ||
| 338 | //------------------------------------------------- | |
| 339 | // device_config_complete - perform any | |
| 340 | // operations now that the configuration is | |
| 341 | // complete | |
| 342 | //------------------------------------------------- | |
| 343 | ||
| 344 | void tc0140syt_device::device_config_complete() | |
| 345 | { | |
| 346 | } | |
| 347 | ||
| 348 | //------------------------------------------------- | |
| 349 | // device_start - device-specific startup | |
| 350 | //------------------------------------------------- | |
| 351 | ||
| 352 | void tc0140syt_device::device_start() | |
| 353 | { | |
| 354 | DEVICE_START_NAME( tc0140syt )(this); | |
| 355 | } | |
| 356 | ||
| 357 | //------------------------------------------------- | |
| 358 | // device_reset - device-specific reset | |
| 359 | //------------------------------------------------- | |
| 360 | ||
| 361 | void tc0140syt_device::device_reset() | |
| 362 | { | |
| 363 | DEVICE_RESET_NAME( tc0140syt )(this); | |
| 364 | } | |
| 365 | ||
| 366 |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | const char *slave; |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_DEVICE(TC0140SYT, tc0140syt); | |
| 18 | class tc0140syt_device : public device_t | |
| 19 | { | |
| 20 | public: | |
| 21 | tc0140syt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~tc0140syt_device() { global_free(m_token); } | |
| 19 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type TC0140SYT; | |
| 37 | ||
| 38 | ||
| 20 | 39 | /*************************************************************************** |
| 21 | 40 | DEVICE CONFIGURATION MACROS |
| 22 | 41 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | assert(device != NULL); |
| 62 | 62 | assert(device->type() == WIPING); |
| 63 | 63 | |
| 64 | return (wiping_sound_state *)downcast< | |
| 64 | return (wiping_sound_state *)downcast<wiping | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /* build a table to divide by the number of voices; gain is specified as gain*16 */ |
| r17612 | r17613 | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | |
| 281 | DEFINE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound); | |
| 281 | const device_type WIPING = &device_creator<wiping_sound_device>; | |
| 282 | ||
| 283 | wiping_sound_device::wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 284 | : device_t(mconfig, WIPING, "Wiping Custom", tag, owner, clock), | |
| 285 | device_sound_interface(mconfig, *this) | |
| 286 | { | |
| 287 | m_token = global_alloc_array_clear(UINT8, sizeof(wiping_sound_state)); | |
| 288 | } | |
| 289 | ||
| 290 | //------------------------------------------------- | |
| 291 | // device_config_complete - perform any | |
| 292 | // operations now that the configuration is | |
| 293 | // complete | |
| 294 | //------------------------------------------------- | |
| 295 | ||
| 296 | void wiping_sound_device::device_config_complete() | |
| 297 | { | |
| 298 | } | |
| 299 | ||
| 300 | //------------------------------------------------- | |
| 301 | // device_start - device-specific startup | |
| 302 | //------------------------------------------------- | |
| 303 | ||
| 304 | void wiping_sound_device::device_start() | |
| 305 | { | |
| 306 | DEVICE_START_NAME( wiping_sound )(this); | |
| 307 | } | |
| 308 | ||
| 309 | //------------------------------------------------- | |
| 310 | // sound_stream_update - handle a stream update | |
| 311 | //------------------------------------------------- | |
| 312 | ||
| 313 | void wiping_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 314 | { | |
| 315 | // should never get here | |
| 316 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 317 | } | |
| 318 | ||
| 319 |
| r17612 | r17613 | |
|---|---|---|
| 230 | 230 | assert(device != NULL); |
| 231 | 231 | assert(device->type() == LELAND || device->type() == LELAND_80186 || device->type() == REDLINE_80186); |
| 232 | 232 | |
| 233 | return (leland_sound_state *)downcast<le | |
| 233 | return (leland_sound_state *)downcast<leland_sound_devic | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | static STREAM_UPDATE( leland_update ) |
| r17612 | r17613 | |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | |
| 626 | DEFINE_LEGACY_SOUND_DEVICE(LELAND, leland_sound); | |
| 627 | DEFINE_LEGACY_SOUND_DEVICE(LELAND_80186, leland_80186_sound); | |
| 628 | DEFINE_LEGACY_SOUND_DEVICE(REDLINE_80186, redline_80186_sound); | |
| 626 | const device_type LELAND = &device_creator<leland_sound_device>; | |
| 629 | 627 | |
| 628 | leland_sound_device::leland_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 629 | : device_t(mconfig, LELAND, "Leland DAC", tag, owner, clock), | |
| 630 | device_sound_interface(mconfig, *this) | |
| 631 | { | |
| 632 | m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state)); | |
| 633 | } | |
| 630 | 634 | |
| 635 | leland_sound_device::leland_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 636 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 637 | device_sound_interface(mconfig, *this) | |
| 638 | { | |
| 639 | m_token = global_alloc_array_clear(UINT8, sizeof(leland_sound_state)); | |
| 640 | } | |
| 641 | ||
| 642 | //------------------------------------------------- | |
| 643 | // device_config_complete - perform any | |
| 644 | // operations now that the configuration is | |
| 645 | // complete | |
| 646 | //------------------------------------------------- | |
| 647 | ||
| 648 | void leland_sound_device::device_config_complete() | |
| 649 | { | |
| 650 | } | |
| 651 | ||
| 652 | //------------------------------------------------- | |
| 653 | // device_start - device-specific startup | |
| 654 | //------------------------------------------------- | |
| 655 | ||
| 656 | void leland_sound_device::device_start() | |
| 657 | { | |
| 658 | DEVICE_START_NAME( leland_sound )(this); | |
| 659 | } | |
| 660 | ||
| 661 | //------------------------------------------------- | |
| 662 | // sound_stream_update - handle a stream update | |
| 663 | //------------------------------------------------- | |
| 664 | ||
| 665 | void leland_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 666 | { | |
| 667 | // should never get here | |
| 668 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 669 | } | |
| 670 | ||
| 671 | ||
| 672 | const device_type LELAND_80186 = &device_creator<leland_80186_sound_device>; | |
| 673 | ||
| 674 | leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 675 | : leland_sound_device(mconfig, LELAND_80186, "Leland 80186 DAC", tag, owner, clock) | |
| 676 | { | |
| 677 | } | |
| 678 | ||
| 679 | leland_80186_sound_device::leland_80186_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 680 | : leland_sound_device(mconfig, type, name, tag, owner, clock) | |
| 681 | { | |
| 682 | } | |
| 683 | ||
| 684 | ||
| 685 | //------------------------------------------------- | |
| 686 | // device_config_complete - perform any | |
| 687 | // operations now that the configuration is | |
| 688 | // complete | |
| 689 | //------------------------------------------------- | |
| 690 | ||
| 691 | void leland_80186_sound_device::device_config_complete() | |
| 692 | { | |
| 693 | } | |
| 694 | ||
| 695 | //------------------------------------------------- | |
| 696 | // device_start - device-specific startup | |
| 697 | //------------------------------------------------- | |
| 698 | ||
| 699 | void leland_80186_sound_device::device_start() | |
| 700 | { | |
| 701 | DEVICE_START_NAME( leland_80186_sound )(this); | |
| 702 | } | |
| 703 | ||
| 704 | //------------------------------------------------- | |
| 705 | // device_reset - device-specific reset | |
| 706 | //------------------------------------------------- | |
| 707 | ||
| 708 | void leland_80186_sound_device::device_reset() | |
| 709 | { | |
| 710 | DEVICE_RESET_NAME( leland_80186_sound )(this); | |
| 711 | } | |
| 712 | ||
| 713 | //------------------------------------------------- | |
| 714 | // sound_stream_update - handle a stream update | |
| 715 | //------------------------------------------------- | |
| 716 | ||
| 717 | void leland_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 718 | { | |
| 719 | // should never get here | |
| 720 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 721 | } | |
| 722 | ||
| 723 | ||
| 724 | const device_type REDLINE_80186 = &device_creator<redline_80186_sound_device>; | |
| 725 | ||
| 726 | redline_80186_sound_device::redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 727 | : leland_80186_sound_device(mconfig, REDLINE_80186, "Redline Racer 80186 DAC", tag, owner, clock) | |
| 728 | { | |
| 729 | } | |
| 730 | ||
| 731 | //------------------------------------------------- | |
| 732 | // device_config_complete - perform any | |
| 733 | // operations now that the configuration is | |
| 734 | // complete | |
| 735 | //------------------------------------------------- | |
| 736 | ||
| 737 | void redline_80186_sound_device::device_config_complete() | |
| 738 | { | |
| 739 | } | |
| 740 | ||
| 741 | //------------------------------------------------- | |
| 742 | // device_start - device-specific startup | |
| 743 | //------------------------------------------------- | |
| 744 | ||
| 745 | void redline_80186_sound_device::device_start() | |
| 746 | { | |
| 747 | DEVICE_START_NAME( redline_80186_sound )(this); | |
| 748 | } | |
| 749 | ||
| 750 | //------------------------------------------------- | |
| 751 | // sound_stream_update - handle a stream update | |
| 752 | //------------------------------------------------- | |
| 753 | ||
| 754 | void redline_80186_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 755 | { | |
| 756 | // should never get here | |
| 757 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 758 | } | |
| 759 | ||
| 760 | ||
| 761 | ||
| 762 | ||
| 631 | 763 | static void leland_80186_reset(device_t *device) |
| 632 | 764 | { |
| 633 | 765 | leland_sound_state *state = get_safe_token(device); |
| r17612 | r17613 | |
|---|---|---|
| 57 | 57 | assert(device != NULL); |
| 58 | 58 | assert(device->type() == GOMOKU); |
| 59 | 59 | |
| 60 | return (gomoku_sound_state *)downcast< | |
| 60 | return (gomoku_sound_state *)downcast< | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| r17612 | r17613 | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| 297 | DEFINE_LEGACY_SOUND_DEVICE(GOMOKU, gomoku_sound); | |
| 297 | const device_type GOMOKU = &device_creator<gomoku_sound_device>; | |
| 298 | ||
| 299 | gomoku_sound_device::gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 300 | : device_t(mconfig, GOMOKU, "Gomoku Custom", tag, owner, clock), | |
| 301 | device_sound_interface(mconfig, *this) | |
| 302 | { | |
| 303 | m_token = global_alloc_array_clear(UINT8, sizeof(gomoku_sound_state)); | |
| 304 | } | |
| 305 | ||
| 306 | //------------------------------------------------- | |
| 307 | // device_config_complete - perform any | |
| 308 | // operations now that the configuration is | |
| 309 | // complete | |
| 310 | //------------------------------------------------- | |
| 311 | ||
| 312 | void gomoku_sound_device::device_config_complete() | |
| 313 | { | |
| 314 | } | |
| 315 | ||
| 316 | //------------------------------------------------- | |
| 317 | // device_start - device-specific startup | |
| 318 | //------------------------------------------------- | |
| 319 | ||
| 320 | void gomoku_sound_device::device_start() | |
| 321 | { | |
| 322 | DEVICE_START_NAME( gomoku_sound )(this); | |
| 323 | } | |
| 324 | ||
| 325 | //------------------------------------------------- | |
| 326 | // sound_stream_update - handle a stream update | |
| 327 | //------------------------------------------------- | |
| 328 | ||
| 329 | void gomoku_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 330 | { | |
| 331 | // should never get here | |
| 332 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 333 | } | |
| 334 | ||
| 335 |
| r17612 | r17613 | |
|---|---|---|
| 1 | DECLARE_LEGACY_SOUND_DEVICE(WIPING, wiping_sound); | |
| 1 | class wiping_sound_device : public device_t, | |
| 2 | public device_sound_interface | |
| 3 | { | |
| 4 | public: | |
| 5 | wiping_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 6 | ~wiping_sound_device() { global_free(m_token); } | |
| 2 | 7 | |
| 8 | // access to legacy token | |
| 9 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 10 | protected: | |
| 11 | // device-level overrides | |
| 12 | virtual void device_config_complete(); | |
| 13 | virtual void device_start(); | |
| 14 | ||
| 15 | // sound stream update overrides | |
| 16 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 17 | private: | |
| 18 | // internal state | |
| 19 | void *m_token; | |
| 20 | }; | |
| 21 | ||
| 22 | extern const device_type WIPING; | |
| 23 | ||
| 24 | ||
| 3 | 25 | WRITE8_DEVICE_HANDLER( wiping_sound_w ); |
| r17612 | r17613 | |
|---|---|---|
| 183 | 183 | static DEVICE_START( seibu_adpcm ) |
| 184 | 184 | { |
| 185 | 185 | running_machine &machine = device->machine(); |
| 186 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast< | |
| 186 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_devic | |
| 187 | 187 | const seibu_adpcm_interface *intf; |
| 188 | 188 | |
| 189 | 189 | intf = (const seibu_adpcm_interface *)device->static_config(); |
| r17612 | r17613 | |
| 229 | 229 | |
| 230 | 230 | WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w ) |
| 231 | 231 | { |
| 232 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast< | |
| 232 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_devic | |
| 233 | 233 | |
| 234 | 234 | if (state->m_stream) |
| 235 | 235 | state->m_stream->update(); |
| r17612 | r17613 | |
| 246 | 246 | |
| 247 | 247 | WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w ) |
| 248 | 248 | { |
| 249 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast< | |
| 249 | seibu_adpcm_state *state = (seibu_adpcm_state *)downcast<seibu_adpcm_devic | |
| 250 | 250 | |
| 251 | 251 | // sequence is 00 02 01 each time. |
| 252 | 252 | if (state->m_stream) |
| r17612 | r17613 | |
| 619 | 619 | ADDRESS_MAP_END |
| 620 | 620 | |
| 621 | 621 | |
| 622 | DEFINE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm); | |
| 622 | const device_type SEIBU_ADPCM = &device_creator<seibu_adpcm_device>; | |
| 623 | ||
| 624 | seibu_adpcm_device::seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 625 | : device_t(mconfig, SEIBU_ADPCM, "Seibu ADPCM", tag, owner, clock), | |
| 626 | device_sound_interface(mconfig, *this) | |
| 627 | { | |
| 628 | m_token = global_alloc_array_clear(UINT8, sizeof(seibu_adpcm_state)); | |
| 629 | } | |
| 630 | ||
| 631 | //------------------------------------------------- | |
| 632 | // device_config_complete - perform any | |
| 633 | // operations now that the configuration is | |
| 634 | // complete | |
| 635 | //------------------------------------------------- | |
| 636 | ||
| 637 | void seibu_adpcm_device::device_config_complete() | |
| 638 | { | |
| 639 | } | |
| 640 | ||
| 641 | //------------------------------------------------- | |
| 642 | // device_start - device-specific startup | |
| 643 | //------------------------------------------------- | |
| 644 | ||
| 645 | void seibu_adpcm_device::device_start() | |
| 646 | { | |
| 647 | DEVICE_START_NAME( seibu_adpcm )(this); | |
| 648 | } | |
| 649 | ||
| 650 | //------------------------------------------------- | |
| 651 | // sound_stream_update - handle a stream update | |
| 652 | //------------------------------------------------- | |
| 653 | ||
| 654 | void seibu_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 655 | { | |
| 656 | // should never get here | |
| 657 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 658 | } | |
| 659 | ||
| 660 |
| r17612 | r17613 | |
|---|---|---|
| 41 | 41 | assert(device != NULL); |
| 42 | 42 | assert(device->type() == GRIDLEE); |
| 43 | 43 | |
| 44 | return (gridlee_sound_state *)downcast<le | |
| 44 | return (gridlee_sound_state *)downcast<gridlee | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static STREAM_UPDATE( gridlee_stream_update ) |
| r17612 | r17613 | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| 200 | DEFINE_LEGACY_SOUND_DEVICE(GRIDLEE, gridlee_sound); | |
| 200 | const device_type GRIDLEE = &device_creator<gridlee_sound_device>; | |
| 201 | ||
| 202 | gridlee_sound_device::gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 203 | : device_t(mconfig, GRIDLEE, "Gridlee Custom", tag, owner, clock), | |
| 204 | device_sound_interface(mconfig, *this) | |
| 205 | { | |
| 206 | m_token = global_alloc_array_clear(UINT8, sizeof(gridlee_sound_state)); | |
| 207 | } | |
| 208 | ||
| 209 | //------------------------------------------------- | |
| 210 | // device_config_complete - perform any | |
| 211 | // operations now that the configuration is | |
| 212 | // complete | |
| 213 | //------------------------------------------------- | |
| 214 | ||
| 215 | void gridlee_sound_device::device_config_complete() | |
| 216 | { | |
| 217 | } | |
| 218 | ||
| 219 | //------------------------------------------------- | |
| 220 | // device_start - device-specific startup | |
| 221 | //------------------------------------------------- | |
| 222 | ||
| 223 | void gridlee_sound_device::device_start() | |
| 224 | { | |
| 225 | DEVICE_START_NAME( gridlee_sound )(this); | |
| 226 | } | |
| 227 | ||
| 228 | //------------------------------------------------- | |
| 229 | // sound_stream_update - handle a stream update | |
| 230 | //------------------------------------------------- | |
| 231 | ||
| 232 | void gridlee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 233 | { | |
| 234 | // should never get here | |
| 235 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 236 | } | |
| 237 | ||
| 238 |
| r17612 | r17613 | |
|---|---|---|
| 63 | 63 | WRITE8_DEVICE_HANDLER( seibu_adpcm_adr_w ); |
| 64 | 64 | WRITE8_DEVICE_HANDLER( seibu_adpcm_ctl_w ); |
| 65 | 65 | |
| 66 | DECLARE_LEGACY_SOUND_DEVICE(SEIBU_ADPCM, seibu_adpcm); | |
| 66 | class seibu_adpcm_device : public device_t, | |
| 67 | public device_sound_interface | |
| 68 | { | |
| 69 | public: | |
| 70 | seibu_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 71 | ~seibu_adpcm_device() { global_free(m_token); } | |
| 67 | 72 | |
| 73 | // access to legacy token | |
| 74 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 75 | protected: | |
| 76 | // device-level overrides | |
| 77 | virtual void device_config_complete(); | |
| 78 | virtual void device_start(); | |
| 79 | ||
| 80 | // sound stream update overrides | |
| 81 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 82 | private: | |
| 83 | // internal state | |
| 84 | void *m_token; | |
| 85 | }; | |
| 86 | ||
| 87 | extern const device_type SEIBU_ADPCM; | |
| 88 | ||
| 89 | ||
| 68 | 90 | extern const ym3812_interface seibu_ym3812_interface; |
| 69 | 91 | extern const ym2151_interface seibu_ym2151_interface; |
| 70 | 92 | extern const ym2203_interface seibu_ym2203_interface; |
| r17612 | r17613 | |
|---|---|---|
| 75 | 75 | assert(device != NULL); |
| 76 | 76 | assert(device->type() == TIAMC1); |
| 77 | 77 | |
| 78 | return (tiamc1_sound_state *)downcast< | |
| 78 | return (tiamc1_sound_state *)downcast<ti | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r17612 | r17613 | |
| 348 | 348 | |
| 349 | 349 | |
| 350 | 350 | |
| 351 | DEFINE_LEGACY_SOUND_DEVICE(TIAMC1, tiamc1_sound); | |
| 351 | const device_type TIAMC1 = &device_creator<tiamc1_sound_device>; | |
| 352 | ||
| 353 | tiamc1_sound_device::tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 354 | : device_t(mconfig, TIAMC1, "TIA-MC1 Custom", tag, owner, clock), | |
| 355 | device_sound_interface(mconfig, *this) | |
| 356 | { | |
| 357 | m_token = global_alloc_array_clear(UINT8, sizeof(tiamc1_sound_state)); | |
| 358 | } | |
| 359 | ||
| 360 | //------------------------------------------------- | |
| 361 | // device_config_complete - perform any | |
| 362 | // operations now that the configuration is | |
| 363 | // complete | |
| 364 | //------------------------------------------------- | |
| 365 | ||
| 366 | void tiamc1_sound_device::device_config_complete() | |
| 367 | { | |
| 368 | } | |
| 369 | ||
| 370 | //------------------------------------------------- | |
| 371 | // device_start - device-specific startup | |
| 372 | //------------------------------------------------- | |
| 373 | ||
| 374 | void tiamc1_sound_device::device_start() | |
| 375 | { | |
| 376 | DEVICE_START_NAME( tiamc1_sound )(this); | |
| 377 | } | |
| 378 | ||
| 379 | //------------------------------------------------- | |
| 380 | // sound_stream_update - handle a stream update | |
| 381 | //------------------------------------------------- | |
| 382 | ||
| 383 | void tiamc1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 384 | { | |
| 385 | // should never get here | |
| 386 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 387 | } | |
| 388 | ||
| 389 |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | DEVICE_GET_INFO( sega005_sound ); |
| 31 | 31 | |
| 32 | DECLARE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound); | |
| 33 | DEFINE_LEGACY_SOUND_DEVICE(SEGA005, sega005_sound); | |
| 32 | class sega005_sound_device : public device_t, | |
| 33 | public device_sound_interface | |
| 34 | { | |
| 35 | public: | |
| 36 | sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 34 | 41 | |
| 42 | // sound stream update overrides | |
| 43 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | }; | |
| 35 | 47 | |
| 48 | extern const device_type SEGA005; | |
| 36 | 49 | |
| 50 | const device_type SEGA005 = &device_creator<sega005_sound_device>; | |
| 51 | ||
| 52 | sega005_sound_device::sega005_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 53 | : device_t(mconfig, SEGA005, "005 Custom", tag, owner, clock), | |
| 54 | device_sound_interface(mconfig, *this) | |
| 55 | { | |
| 56 | } | |
| 57 | ||
| 58 | //------------------------------------------------- | |
| 59 | // device_config_complete - perform any | |
| 60 | // operations now that the configuration is | |
| 61 | // complete | |
| 62 | //------------------------------------------------- | |
| 63 | ||
| 64 | void sega005_sound_device::device_config_complete() | |
| 65 | { | |
| 66 | } | |
| 67 | ||
| 68 | //------------------------------------------------- | |
| 69 | // device_start - device-specific startup | |
| 70 | //------------------------------------------------- | |
| 71 | ||
| 72 | static DEVICE_START( sega005_sound ); | |
| 73 | void sega005_sound_device::device_start() | |
| 74 | { | |
| 75 | DEVICE_START_NAME( sega005_sound )(this); | |
| 76 | } | |
| 77 | ||
| 78 | //------------------------------------------------- | |
| 79 | // sound_stream_update - handle a stream update | |
| 80 | //------------------------------------------------- | |
| 81 | ||
| 82 | void sega005_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 83 | { | |
| 84 | // should never get here | |
| 85 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 86 | } | |
| 87 | ||
| 88 | ||
| 89 | ||
| 90 | ||
| 91 | ||
| 37 | 92 | /************************************* |
| 38 | 93 | * |
| 39 | 94 | * Astro Blaster sound hardware |
| r17612 | r17613 | |
|---|---|---|
| 63 | 63 | assert(device != NULL); |
| 64 | 64 | assert(device->type() == FLOWER); |
| 65 | 65 | |
| 66 | return (flower_sound_state *)downcast<le | |
| 66 | return (flower_sound_state *)downcast<flower | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /* build a table to divide by the number of voices; gain is specified as gain*16 */ |
| r17612 | r17613 | |
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | |
| 377 | DEFINE_LEGACY_SOUND_DEVICE(FLOWER, flower_sound); | |
| 377 | const device_type FLOWER = &device_creator<flower_sound_device>; | |
| 378 | ||
| 379 | flower_sound_device::flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 380 | : device_t(mconfig, FLOWER, "Flower Custom", tag, owner, clock), | |
| 381 | device_sound_interface(mconfig, *this) | |
| 382 | { | |
| 383 | m_token = global_alloc_array_clear(UINT8, sizeof(flower_sound_state)); | |
| 384 | } | |
| 385 | ||
| 386 | //------------------------------------------------- | |
| 387 | // device_config_complete - perform any | |
| 388 | // operations now that the configuration is | |
| 389 | // complete | |
| 390 | //------------------------------------------------- | |
| 391 | ||
| 392 | void flower_sound_device::device_config_complete() | |
| 393 | { | |
| 394 | } | |
| 395 | ||
| 396 | //------------------------------------------------- | |
| 397 | // device_start - device-specific startup | |
| 398 | //------------------------------------------------- | |
| 399 | ||
| 400 | void flower_sound_device::device_start() | |
| 401 | { | |
| 402 | DEVICE_START_NAME( flower_sound )(this); | |
| 403 | } | |
| 404 | ||
| 405 | //------------------------------------------------- | |
| 406 | // device_reset - device-specific reset | |
| 407 | //------------------------------------------------- | |
| 408 | ||
| 409 | void flower_sound_device::device_reset() | |
| 410 | { | |
| 411 | DEVICE_RESET_NAME( flower_sound )(this); | |
| 412 | } | |
| 413 | ||
| 414 | //------------------------------------------------- | |
| 415 | // sound_stream_update - handle a stream update | |
| 416 | //------------------------------------------------- | |
| 417 | ||
| 418 | void flower_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 419 | { | |
| 420 | // should never get here | |
| 421 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 422 | } | |
| 423 | ||
| 424 |
| r17612 | r17613 | |
|---|---|---|
| 120 | 120 | assert(device != NULL); |
| 121 | 121 | assert(device->type() == EXIDY || device->type() == EXIDY_VENTURE || device->type() == EXIDY_VICTORY); |
| 122 | 122 | |
| 123 | return (exidy_sound_state *)downcast< | |
| 123 | return (exidy_sound_state *)downcast< | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | /************************************* |
| r17612 | r17613 | |
| 419 | 419 | DEVICE_START_CALL(common_sh_start); |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | ||
| 422 | const device_type E | |
| 423 | 423 | |
| 424 | exidy_sound_device::exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 425 | : device_t(mconfig, EXIDY, "Exidy SFX", tag, owner, clock), | |
| 426 | device_sound_interface(mconfig, *this) | |
| 427 | { | |
| 428 | m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state)); | |
| 429 | } | |
| 430 | ||
| 431 | exidy_sound_device::exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 432 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 433 | device_sound_interface(mconfig, *this) | |
| 434 | { | |
| 435 | m_token = global_alloc_array_clear(UINT8, sizeof(exidy_sound_state)); | |
| 436 | } | |
| 437 | ||
| 438 | //------------------------------------------------- | |
| 439 | // device_config_complete - perform any | |
| 440 | // operations now that the configuration is | |
| 441 | // complete | |
| 442 | //------------------------------------------------- | |
| 443 | ||
| 444 | void exidy_sound_device::device_config_complete() | |
| 445 | { | |
| 446 | } | |
| 447 | ||
| 448 | //------------------------------------------------- | |
| 449 | // device_start - device-specific startup | |
| 450 | //------------------------------------------------- | |
| 451 | ||
| 452 | void exidy_sound_device::device_start() | |
| 453 | { | |
| 454 | DEVICE_START_NAME( exidy_sound )(this); | |
| 455 | } | |
| 456 | ||
| 457 | //------------------------------------------------- | |
| 458 | // device_reset - device-specific reset | |
| 459 | //------------------------------------------------- | |
| 460 | ||
| 461 | static DEVICE_RESET( exidy_sound ); | |
| 462 | ||
| 463 | void exidy_sound_device::device_reset() | |
| 464 | { | |
| 465 | DEVICE_RESET_NAME( exidy_sound )(this); | |
| 466 | } | |
| 467 | ||
| 468 | //------------------------------------------------- | |
| 469 | // sound_stream_update - handle a stream update | |
| 470 | //------------------------------------------------- | |
| 471 | ||
| 472 | void exidy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 473 | { | |
| 474 | // should never get here | |
| 475 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 476 | } | |
| 477 | ||
| 478 | ||
| 479 | ||
| 424 | 480 | /************************************* |
| 425 | 481 | * |
| 426 | 482 | * Audio reset routines |
| r17612 | r17613 | |
| 863 | 919 | } |
| 864 | 920 | } |
| 865 | 921 | |
| 866 | ||
| 922 | const device_type E | |
| 867 | 923 | |
| 924 | venture_sound_device::venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 925 | : exidy_sound_device(mconfig, EXIDY_VENTURE, "Exidy SFX+PSG", tag, owner, clock) | |
| 926 | { | |
| 927 | } | |
| 868 | 928 | |
| 929 | //------------------------------------------------- | |
| 930 | // device_config_complete - perform any | |
| 931 | // operations now that the configuration is | |
| 932 | // complete | |
| 933 | //------------------------------------------------- | |
| 934 | ||
| 935 | void venture_sound_device::device_config_complete() | |
| 936 | { | |
| 937 | } | |
| 938 | ||
| 939 | //------------------------------------------------- | |
| 940 | // device_start - device-specific startup | |
| 941 | //------------------------------------------------- | |
| 942 | ||
| 943 | void venture_sound_device::device_start() | |
| 944 | { | |
| 945 | DEVICE_START_NAME( venture_sound )(this); | |
| 946 | } | |
| 947 | ||
| 948 | //------------------------------------------------- | |
| 949 | // device_reset - device-specific reset | |
| 950 | //------------------------------------------------- | |
| 951 | ||
| 952 | void venture_sound_device::device_reset() | |
| 953 | { | |
| 954 | DEVICE_RESET_NAME( venture_sound )(this); | |
| 955 | } | |
| 956 | ||
| 957 | //------------------------------------------------- | |
| 958 | // sound_stream_update - handle a stream update | |
| 959 | //------------------------------------------------- | |
| 960 | ||
| 961 | void venture_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 962 | { | |
| 963 | // should never get here | |
| 964 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 965 | } | |
| 966 | ||
| 967 | ||
| 968 | ||
| 969 | ||
| 869 | 970 | static ADDRESS_MAP_START( venture_audio_map, AS_PROGRAM, 8, driver_device ) |
| 870 | 971 | ADDRESS_MAP_GLOBAL_MASK(0x7fff) |
| 871 | 972 | AM_RANGE(0x0000, 0x007f) AM_MIRROR(0x0780) AM_RAM |
| r17612 | r17613 | |
| 1102 | 1203 | } |
| 1103 | 1204 | |
| 1104 | 1205 | |
| 1105 | ||
| 1206 | const device_type E | |
| 1106 | 1207 | |
| 1208 | victory_sound_device::victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1209 | : exidy_sound_device(mconfig, EXIDY_VICTORY, "Exidy SFX+PSG+Speech", tag, owner, clock) | |
| 1210 | { | |
| 1211 | } | |
| 1107 | 1212 | |
| 1213 | //------------------------------------------------- | |
| 1214 | // device_config_complete - perform any | |
| 1215 | // operations now that the configuration is | |
| 1216 | // complete | |
| 1217 | //------------------------------------------------- | |
| 1218 | ||
| 1219 | void victory_sound_device::device_config_complete() | |
| 1220 | { | |
| 1221 | } | |
| 1222 | ||
| 1223 | //------------------------------------------------- | |
| 1224 | // device_start - device-specific startup | |
| 1225 | //------------------------------------------------- | |
| 1226 | ||
| 1227 | void victory_sound_device::device_start() | |
| 1228 | { | |
| 1229 | DEVICE_START_NAME( victory_sound )(this); | |
| 1230 | } | |
| 1231 | ||
| 1232 | //------------------------------------------------- | |
| 1233 | // device_reset - device-specific reset | |
| 1234 | //------------------------------------------------- | |
| 1235 | ||
| 1236 | void victory_sound_device::device_reset() | |
| 1237 | { | |
| 1238 | DEVICE_RESET_NAME( victory_sound )(this); | |
| 1239 | } | |
| 1240 | ||
| 1241 | //------------------------------------------------- | |
| 1242 | // sound_stream_update - handle a stream update | |
| 1243 | //------------------------------------------------- | |
| 1244 | ||
| 1245 | void victory_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1246 | { | |
| 1247 | // should never get here | |
| 1248 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1249 | } | |
| 1250 | ||
| 1251 | ||
| 1252 | ||
| 1253 | ||
| 1108 | 1254 | static ADDRESS_MAP_START( victory_audio_map, AS_PROGRAM, 8, driver_device ) |
| 1109 | 1255 | AM_RANGE(0x0000, 0x00ff) AM_MIRROR(0x0f00) AM_RAM |
| 1110 | 1256 | AM_RANGE(0x1000, 0x107f) AM_MIRROR(0x0f80) AM_DEVREADWRITE_LEGACY("riot", riot6532_r, riot6532_w) |
| r17612 | r17613 | |
|---|---|---|
| 1 | DECLARE_LEGACY_SOUND_DEVICE(EXIDY, exidy_sound); | |
| 2 | DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VENTURE, venture_sound); | |
| 3 | DECLARE_LEGACY_SOUND_DEVICE(EXIDY_VICTORY, victory_sound); | |
| 1 | class exidy_sound_device : public device_t, | |
| 2 | public device_sound_interface | |
| 3 | { | |
| 4 | public: | |
| 5 | exidy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 6 | exidy_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 7 | ~exidy_sound_device() { global_free(m_token); } | |
| 4 | 8 | |
| 9 | // access to legacy token | |
| 10 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 11 | protected: | |
| 12 | // device-level overrides | |
| 13 | virtual void device_config_complete(); | |
| 14 | virtual void device_start(); | |
| 15 | virtual void device_reset(); | |
| 16 | ||
| 17 | // sound stream update overrides | |
| 18 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 19 | private: | |
| 20 | // internal state | |
| 21 | void *m_token; | |
| 22 | }; | |
| 23 | ||
| 24 | extern const device_type EXIDY; | |
| 25 | ||
| 26 | class venture_sound_device : public exidy_sound_device | |
| 27 | { | |
| 28 | public: | |
| 29 | venture_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 30 | protected: | |
| 31 | // device-level overrides | |
| 32 | virtual void device_config_complete(); | |
| 33 | virtual void device_start(); | |
| 34 | virtual void device_reset(); | |
| 35 | ||
| 36 | // sound stream update overrides | |
| 37 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | }; | |
| 41 | ||
| 42 | extern const device_type EXIDY_VENTURE; | |
| 43 | ||
| 44 | class victory_sound_device : public exidy_sound_device | |
| 45 | { | |
| 46 | public: | |
| 47 | victory_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 48 | protected: | |
| 49 | // device-level overrides | |
| 50 | virtual void device_config_complete(); | |
| 51 | virtual void device_start(); | |
| 52 | virtual void device_reset(); | |
| 53 | ||
| 54 | // sound stream update overrides | |
| 55 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 56 | private: | |
| 57 | // internal state | |
| 58 | }; | |
| 59 | ||
| 60 | extern const device_type EXIDY_VICTORY; | |
| 61 | ||
| 62 | ||
| 5 | 63 | READ8_DEVICE_HANDLER( exidy_sh6840_r ); |
| 6 | 64 | WRITE8_DEVICE_HANDLER( exidy_sh6840_w ); |
| 7 | 65 | WRITE8_DEVICE_HANDLER( exidy_sfxctrl_w ); |
| r17612 | r17613 | |
|---|---|---|
| 30 | 30 | assert(device != NULL); |
| 31 | 31 | assert(device->type() == CPS3); |
| 32 | 32 | |
| 33 | return (cps3_sound_state *)downcast< | |
| 33 | return (cps3_sound_state *)downcast< | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static STREAM_UPDATE( cps3_stream_update ) |
| r17612 | r17613 | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| 191 | DEFINE_LEGACY_SOUND_DEVICE(CPS3, cps3_sound); | |
| 191 | const device_type CPS3 = &device_creator<cps3_sound_device>; | |
| 192 | ||
| 193 | cps3_sound_device::cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 194 | : device_t(mconfig, CPS3, "CPS3 Custom", tag, owner, clock), | |
| 195 | device_sound_interface(mconfig, *this) | |
| 196 | { | |
| 197 | m_token = global_alloc_array_clear(UINT8, sizeof(cps3_sound_state)); | |
| 198 | } | |
| 199 | ||
| 200 | //------------------------------------------------- | |
| 201 | // device_config_complete - perform any | |
| 202 | // operations now that the configuration is | |
| 203 | // complete | |
| 204 | //------------------------------------------------- | |
| 205 | ||
| 206 | void cps3_sound_device::device_config_complete() | |
| 207 | { | |
| 208 | } | |
| 209 | ||
| 210 | //------------------------------------------------- | |
| 211 | // device_start - device-specific startup | |
| 212 | //------------------------------------------------- | |
| 213 | ||
| 214 | void cps3_sound_device::device_start() | |
| 215 | { | |
| 216 | DEVICE_START_NAME( cps3_sound )(this); | |
| 217 | } | |
| 218 | ||
| 219 | //------------------------------------------------- | |
| 220 | // sound_stream_update - handle a stream update | |
| 221 | //------------------------------------------------- | |
| 222 | ||
| 223 | void cps3_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 224 | { | |
| 225 | // should never get here | |
| 226 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 227 | } | |
| 228 | ||
| 229 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | assert(device != NULL); |
| 19 | 19 | assert(device->type() == HYPROLYB_ADPCM); |
| 20 | 20 | |
| 21 | return (hyprolyb_adpcm_state *)downcast<l | |
| 21 | return (hyprolyb_adpcm_state *)downcast<hyprolyb_adpcm_devic | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | static DEVICE_START( hyprolyb_adpcm ) |
| r17612 | r17613 | |
| 153 | 153 | } |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | DEFINE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm); | |
| 156 | const device_type HYPROLYB_ADPCM = &device_creator<hyprolyb_adpcm_device>; | |
| 157 | ||
| 158 | hyprolyb_adpcm_device::hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 159 | : device_t(mconfig, HYPROLYB_ADPCM, "Hyper Olympics Audio", tag, owner, clock), | |
| 160 | device_sound_interface(mconfig, *this) | |
| 161 | { | |
| 162 | m_token = global_alloc_array_clear(UINT8, sizeof(hyprolyb_adpcm_state)); | |
| 163 | } | |
| 164 | ||
| 165 | //------------------------------------------------- | |
| 166 | // device_config_complete - perform any | |
| 167 | // operations now that the configuration is | |
| 168 | // complete | |
| 169 | //------------------------------------------------- | |
| 170 | ||
| 171 | void hyprolyb_adpcm_device::device_config_complete() | |
| 172 | { | |
| 173 | } | |
| 174 | ||
| 175 | //------------------------------------------------- | |
| 176 | // device_start - device-specific startup | |
| 177 | //------------------------------------------------- | |
| 178 | ||
| 179 | void hyprolyb_adpcm_device::device_start() | |
| 180 | { | |
| 181 | DEVICE_START_NAME( hyprolyb_adpcm )(this); | |
| 182 | } | |
| 183 | ||
| 184 | //------------------------------------------------- | |
| 185 | // device_reset - device-specific reset | |
| 186 | //------------------------------------------------- | |
| 187 | ||
| 188 | void hyprolyb_adpcm_device::device_reset() | |
| 189 | { | |
| 190 | DEVICE_RESET_NAME( hyprolyb_adpcm )(this); | |
| 191 | } | |
| 192 | ||
| 193 | //------------------------------------------------- | |
| 194 | // sound_stream_update - handle a stream update | |
| 195 | //------------------------------------------------- | |
| 196 | ||
| 197 | void hyprolyb_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 198 | { | |
| 199 | // should never get here | |
| 200 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 201 | } | |
| 202 | ||
| 203 |
| r17612 | r17613 | |
|---|---|---|
| 3 | 3 | |
| 4 | 4 | MACHINE_CONFIG_EXTERN( hyprolyb_adpcm ); |
| 5 | 5 | |
| 6 | DECLARE_LEGACY_SOUND_DEVICE(HYPROLYB_ADPCM, hyprolyb_adpcm); | |
| 6 | class hyprolyb_adpcm_device : public device_t, | |
| 7 | public device_sound_interface | |
| 8 | { | |
| 9 | public: | |
| 10 | hyprolyb_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 11 | ~hyprolyb_adpcm_device() { global_free(m_token); } | |
| 12 | ||
| 13 | // access to legacy token | |
| 14 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 15 | protected: | |
| 16 | // device-level overrides | |
| 17 | virtual void device_config_complete(); | |
| 18 | virtual void device_start(); | |
| 19 | virtual void device_reset(); | |
| 20 | ||
| 21 | // sound stream update overrides | |
| 22 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 23 | private: | |
| 24 | // internal state | |
| 25 | void *m_token; | |
| 26 | }; | |
| 27 | ||
| 28 | extern const device_type HYPROLYB_ADPCM; | |
| 29 |
| r17612 | r17613 | |
|---|---|---|
| 38 | 38 | assert(device != NULL); |
| 39 | 39 | assert(device->type() == TIMEPLT_AUDIO); |
| 40 | 40 | |
| 41 | return (timeplt_audio_state *)downcast< | |
| 41 | return (timeplt_audio_state *)downcast<timeplt_audio_devic | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| r17612 | r17613 | |
| 273 | 273 | } |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | DEFINE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio); | |
| 276 | const device_type TIMEPLT_AUDIO = &device_creator<timeplt_audio_device>; | |
| 277 | ||
| 278 | timeplt_audio_device::timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 279 | : device_t(mconfig, TIMEPLT_AUDIO, "Time Pilot Audio", tag, owner, clock), | |
| 280 | device_sound_interface(mconfig, *this) | |
| 281 | { | |
| 282 | m_token = global_alloc_array_clear(UINT8, sizeof(timeplt_audio_state)); | |
| 283 | } | |
| 284 | ||
| 285 | //------------------------------------------------- | |
| 286 | // device_config_complete - perform any | |
| 287 | // operations now that the configuration is | |
| 288 | // complete | |
| 289 | //------------------------------------------------- | |
| 290 | ||
| 291 | void timeplt_audio_device::device_config_complete() | |
| 292 | { | |
| 293 | } | |
| 294 | ||
| 295 | //------------------------------------------------- | |
| 296 | // device_start - device-specific startup | |
| 297 | //------------------------------------------------- | |
| 298 | ||
| 299 | void timeplt_audio_device::device_start() | |
| 300 | { | |
| 301 | DEVICE_START_NAME( timeplt_audio )(this); | |
| 302 | } | |
| 303 | ||
| 304 | //------------------------------------------------- | |
| 305 | // sound_stream_update - handle a stream update | |
| 306 | //------------------------------------------------- | |
| 307 | ||
| 308 | void timeplt_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 309 | { | |
| 310 | // should never get here | |
| 311 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 312 | } | |
| 313 | ||
| 314 |
| r17612 | r17613 | |
|---|---|---|
| 67 | 67 | assert(device != NULL); |
| 68 | 68 | assert(device->type() == AMIGA); |
| 69 | 69 | |
| 70 | return (amiga_audio *)downcast< | |
| 70 | return (amiga_audio *)downcast<amiga | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /************************************* |
| r17612 | r17613 | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
| 298 | DEFINE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound); | |
| 298 | const device_type AMIGA = &device_creator<amiga_sound_device>; | |
| 299 | ||
| 300 | amiga_sound_device::amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 301 | : device_t(mconfig, AMIGA, "Amiga Paula", tag, owner, clock), | |
| 302 | device_sound_interface(mconfig, *this) | |
| 303 | { | |
| 304 | m_token = global_alloc_array_clear(UINT8, sizeof(amiga_audio)); | |
| 305 | } | |
| 306 | ||
| 307 | //------------------------------------------------- | |
| 308 | // device_config_complete - perform any | |
| 309 | // operations now that the configuration is | |
| 310 | // complete | |
| 311 | //------------------------------------------------- | |
| 312 | ||
| 313 | void amiga_sound_device::device_config_complete() | |
| 314 | { | |
| 315 | } | |
| 316 | ||
| 317 | //------------------------------------------------- | |
| 318 | // device_start - device-specific startup | |
| 319 | //------------------------------------------------- | |
| 320 | ||
| 321 | void amiga_sound_device::device_start() | |
| 322 | { | |
| 323 | DEVICE_START_NAME( amiga_sound )(this); | |
| 324 | } | |
| 325 | ||
| 326 | //------------------------------------------------- | |
| 327 | // sound_stream_update - handle a stream update | |
| 328 | //------------------------------------------------- | |
| 329 | ||
| 330 | void amiga_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 331 | { | |
| 332 | // should never get here | |
| 333 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 334 | } | |
| 335 | ||
| 336 |
| r17612 | r17613 | |
|---|---|---|
| 3 | 3 | MACHINE_CONFIG_EXTERN( timeplt_sound ); |
| 4 | 4 | MACHINE_CONFIG_EXTERN( locomotn_sound ); |
| 5 | 5 | |
| 6 | DECLARE_LEGACY_SOUND_DEVICE(TIMEPLT_AUDIO, timeplt_audio); | |
| 6 | class timeplt_audio_device : public device_t, | |
| 7 | public device_sound_interface | |
| 8 | { | |
| 9 | public: | |
| 10 | timeplt_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 11 | ~timeplt_audio_device() { global_free(m_token); } | |
| 12 | ||
| 13 | // access to legacy token | |
| 14 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 15 | protected: | |
| 16 | // device-level overrides | |
| 17 | virtual void device_config_complete(); | |
| 18 | virtual void device_start(); | |
| 19 | ||
| 20 | // sound stream update overrides | |
| 21 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 22 | private: | |
| 23 | // internal state | |
| 24 | void *m_token; | |
| 25 | }; | |
| 26 | ||
| 27 | extern const device_type TIMEPLT_AUDIO; | |
| 28 |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | assert(device != NULL); |
| 27 | 27 | assert(device->type() == TRACKFLD_AUDIO); |
| 28 | 28 | |
| 29 | return (trackfld_audio_state *)downcast< | |
| 29 | return (trackfld_audio_state *)downcast<tr | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | |
| r17612 | r17613 | |
| 175 | 175 | } |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | DEFINE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio); | |
| 178 | const device_type TRACKFLD_AUDIO = &device_creator<trackfld_audio_device>; | |
| 179 | ||
| 180 | trackfld_audio_device::trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 181 | : device_t(mconfig, TRACKFLD_AUDIO, "Track And Field Audio", tag, owner, clock), | |
| 182 | device_sound_interface(mconfig, *this) | |
| 183 | { | |
| 184 | m_token = global_alloc_array_clear(UINT8, sizeof(trackfld_audio_state)); | |
| 185 | } | |
| 186 | ||
| 187 | //------------------------------------------------- | |
| 188 | // device_config_complete - perform any | |
| 189 | // operations now that the configuration is | |
| 190 | // complete | |
| 191 | //------------------------------------------------- | |
| 192 | ||
| 193 | void trackfld_audio_device::device_config_complete() | |
| 194 | { | |
| 195 | } | |
| 196 | ||
| 197 | //------------------------------------------------- | |
| 198 | // device_start - device-specific startup | |
| 199 | //------------------------------------------------- | |
| 200 | ||
| 201 | void trackfld_audio_device::device_start() | |
| 202 | { | |
| 203 | DEVICE_START_NAME( trackfld_audio )(this); | |
| 204 | } | |
| 205 | ||
| 206 | //------------------------------------------------- | |
| 207 | // device_reset - device-specific reset | |
| 208 | //------------------------------------------------- | |
| 209 | ||
| 210 | void trackfld_audio_device::device_reset() | |
| 211 | { | |
| 212 | DEVICE_RESET_NAME( trackfld_audio )(this); | |
| 213 | } | |
| 214 | ||
| 215 | //------------------------------------------------- | |
| 216 | // sound_stream_update - handle a stream update | |
| 217 | //------------------------------------------------- | |
| 218 | ||
| 219 | void trackfld_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 220 | { | |
| 221 | // should never get here | |
| 222 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 223 | } | |
| 224 | ||
| 225 |
| r17612 | r17613 | |
|---|---|---|
| 50 | 50 | assert(device != NULL); |
| 51 | 51 | assert(device->type() == REDBARON); |
| 52 | 52 | |
| 53 | return (redbaron_sound_state *)downcast< | |
| 53 | return (redbaron_sound_state *)downcast<redbaron_sound_devic | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| r17612 | r17613 | |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | 246 | |
| 247 | DEFINE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound); | |
| 247 | const device_type REDBARON = &device_creator<redbaron_sound_device>; | |
| 248 | ||
| 249 | redbaron_sound_device::redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 250 | : device_t(mconfig, REDBARON, "Red Baron Custom", tag, owner, clock), | |
| 251 | device_sound_interface(mconfig, *this) | |
| 252 | { | |
| 253 | m_token = global_alloc_array_clear(UINT8, sizeof(redbaron_sound_state)); | |
| 254 | } | |
| 255 | ||
| 256 | //------------------------------------------------- | |
| 257 | // device_config_complete - perform any | |
| 258 | // operations now that the configuration is | |
| 259 | // complete | |
| 260 | //------------------------------------------------- | |
| 261 | ||
| 262 | void redbaron_sound_device::device_config_complete() | |
| 263 | { | |
| 264 | } | |
| 265 | ||
| 266 | //------------------------------------------------- | |
| 267 | // device_start - device-specific startup | |
| 268 | //------------------------------------------------- | |
| 269 | ||
| 270 | void redbaron_sound_device::device_start() | |
| 271 | { | |
| 272 | DEVICE_START_NAME( redbaron_sound )(this); | |
| 273 | } | |
| 274 | ||
| 275 | //------------------------------------------------- | |
| 276 | // sound_stream_update - handle a stream update | |
| 277 | //------------------------------------------------- | |
| 278 | ||
| 279 | void redbaron_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 280 | { | |
| 281 | // should never get here | |
| 282 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 283 | } | |
| 284 | ||
| 285 |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | WRITE8_HANDLER( konami_SN76496_latch_w ); |
| 8 | 8 | WRITE8_DEVICE_HANDLER( konami_SN76496_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(TRACKFLD_AUDIO, trackfld_audio); | |
| 10 | class trackfld_audio_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | trackfld_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~trackfld_audio_device() { global_free(m_token); } | |
| 16 | ||
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | virtual void device_reset(); | |
| 24 | ||
| 25 | // sound stream update overrides | |
| 26 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type TRACKFLD_AUDIO; | |
| 33 |
| r17612 | r17613 | |
|---|---|---|
| 65 | 65 | assert(device != NULL); |
| 66 | 66 | assert(device->type() == NAMCO_54XX); |
| 67 | 67 | |
| 68 | return (namco_54xx_state *)downcast< | |
| 68 | return (namco_54xx_state *)downcast<n | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| r17612 | r17613 | |
| 203 | 203 | } |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | DEFINE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx); | |
| 206 | const device_type NAMCO_54XX = &device_creator<namco_54xx_device>; | |
| 207 | ||
| 208 | namco_54xx_device::namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 209 | : device_t(mconfig, NAMCO_54XX, "Namco 54xx", tag, owner, clock) | |
| 210 | { | |
| 211 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_54xx_state)); | |
| 212 | } | |
| 213 | ||
| 214 | //------------------------------------------------- | |
| 215 | // device_config_complete - perform any | |
| 216 | // operations now that the configuration is | |
| 217 | // complete | |
| 218 | //------------------------------------------------- | |
| 219 | ||
| 220 | void namco_54xx_device::device_config_complete() | |
| 221 | { | |
| 222 | m_shortname = "namco54"; | |
| 223 | } | |
| 224 | ||
| 225 | //------------------------------------------------- | |
| 226 | // device_start - device-specific startup | |
| 227 | //------------------------------------------------- | |
| 228 | ||
| 229 | void namco_54xx_device::device_start() | |
| 230 | { | |
| 231 | DEVICE_START_NAME( namco_54xx )(this); | |
| 232 | } | |
| 233 | ||
| 234 | //------------------------------------------------- | |
| 235 | // device_mconfig_additions - return a pointer to | |
| 236 | // the device's machine fragment | |
| 237 | //------------------------------------------------- | |
| 238 | ||
| 239 | machine_config_constructor namco_54xx_device::device_mconfig_additions() const | |
| 240 | { | |
| 241 | return MACHINE_CONFIG_NAME( namco_54xx ); | |
| 242 | } | |
| 243 | ||
| 244 | //------------------------------------------------- | |
| 245 | // device_rom_region - return a pointer to the | |
| 246 | // the device's ROM definitions | |
| 247 | //------------------------------------------------- | |
| 248 | ||
| 249 | const rom_entry *namco_54xx_device::device_rom_region() const | |
| 250 | { | |
| 251 | return ROM_NAME(namco_54xx ); | |
| 252 | } | |
| 253 | ||
| 254 |
| r17612 | r17613 | |
|---|---|---|
| 386 | 386 | assert(device != NULL); |
| 387 | 387 | assert(device->type() == SNK6502); |
| 388 | 388 | |
| 389 | return (snk6502_sound_state *)downcast< | |
| 389 | return (snk6502_sound_state *)downcast<snk6502_sound_devic | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | INLINE void validate_tone_channel(snk6502_sound_state *state, int channel) |
| r17612 | r17613 | |
| 1266 | 1266 | } |
| 1267 | 1267 | |
| 1268 | 1268 | |
| 1269 | DEFINE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound); | |
| 1269 | const device_type SNK6502 = &device_creator<snk6502_sound_device>; | |
| 1270 | ||
| 1271 | snk6502_sound_device::snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1272 | : device_t(mconfig, SNK6502, "snk6502 Custom", tag, owner, clock), | |
| 1273 | device_sound_interface(mconfig, *this) | |
| 1274 | { | |
| 1275 | m_token = global_alloc_array_clear(UINT8, sizeof(snk6502_sound_state)); | |
| 1276 | } | |
| 1277 | ||
| 1278 | //------------------------------------------------- | |
| 1279 | // device_config_complete - perform any | |
| 1280 | // operations now that the configuration is | |
| 1281 | // complete | |
| 1282 | //------------------------------------------------- | |
| 1283 | ||
| 1284 | void snk6502_sound_device::device_config_complete() | |
| 1285 | { | |
| 1286 | } | |
| 1287 | ||
| 1288 | //------------------------------------------------- | |
| 1289 | // device_start - device-specific startup | |
| 1290 | //------------------------------------------------- | |
| 1291 | ||
| 1292 | void snk6502_sound_device::device_start() | |
| 1293 | { | |
| 1294 | DEVICE_START_NAME( snk6502_sound )(this); | |
| 1295 | } | |
| 1296 | ||
| 1297 | //------------------------------------------------- | |
| 1298 | // sound_stream_update - handle a stream update | |
| 1299 | //------------------------------------------------- | |
| 1300 | ||
| 1301 | void snk6502_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1302 | { | |
| 1303 | // should never get here | |
| 1304 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1305 | } | |
| 1306 | ||
| 1307 |
| r17612 | r17613 | |
|---|---|---|
| 124 | 124 | static void fir_filter(device_t *device, INT32 *input, INT16 *output, int count); |
| 125 | 125 | |
| 126 | 126 | |
| 127 | DECLARE_LEGACY_SOUND_DEVICE(EXIDY440, exidy440_sound); | |
| 127 | class exidy440_sound_device : public device_t, | |
| 128 | public device_sound_interface | |
| 129 | { | |
| 130 | public: | |
| 131 | exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 132 | ~exidy440_sound_device() { global_free(m_token); } | |
| 128 | 133 | |
| 134 | // access to legacy token | |
| 135 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 136 | protected: | |
| 137 | // device-level overrides | |
| 138 | virtual void device_config_complete(); | |
| 139 | virtual void device_start(); | |
| 140 | virtual void device_stop(); | |
| 141 | ||
| 142 | // sound stream update overrides | |
| 143 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 144 | private: | |
| 145 | // internal state | |
| 146 | void *m_token; | |
| 147 | }; | |
| 148 | ||
| 149 | extern const device_type EXIDY440; | |
| 150 | ||
| 151 | ||
| 129 | 152 | /************************************* |
| 130 | 153 | * |
| 131 | 154 | * Initialize the sound system |
| r17612 | r17613 | |
| 137 | 160 | assert(device != NULL); |
| 138 | 161 | assert(device->type() == EXIDY440); |
| 139 | 162 | |
| 140 | return (exidy440_audio_state *)downcast< | |
| 163 | return (exidy440_audio_state *)downcast< | |
| 141 | 164 | } |
| 142 | 165 | |
| 143 | 166 | static DEVICE_START( exidy440_sound ) |
| r17612 | r17613 | |
| 984 | 1007 | } |
| 985 | 1008 | |
| 986 | 1009 | |
| 987 | ||
| 1010 | const device_type E | |
| 988 | 1011 | |
| 1012 | exidy440_sound_device::exidy440_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1013 | : device_t(mconfig, EXIDY440, "Exidy 440 CVSD", tag, owner, clock), | |
| 1014 | device_sound_interface(mconfig, *this) | |
| 1015 | { | |
| 1016 | m_token = global_alloc_array_clear(UINT8, sizeof(exidy440_audio_state)); | |
| 1017 | } | |
| 989 | 1018 | |
| 1019 | //------------------------------------------------- | |
| 1020 | // device_config_complete - perform any | |
| 1021 | // operations now that the configuration is | |
| 1022 | // complete | |
| 1023 | //------------------------------------------------- | |
| 990 | 1024 | |
| 1025 | void exidy440_sound_device::device_config_complete() | |
| 1026 | { | |
| 1027 | } | |
| 1028 | ||
| 1029 | //------------------------------------------------- | |
| 1030 | // device_start - device-specific startup | |
| 1031 | //------------------------------------------------- | |
| 1032 | ||
| 1033 | void exidy440_sound_device::device_start() | |
| 1034 | { | |
| 1035 | DEVICE_START_NAME( exidy440_sound )(this); | |
| 1036 | } | |
| 1037 | ||
| 1038 | //------------------------------------------------- | |
| 1039 | // device_stop - device-specific stop | |
| 1040 | //------------------------------------------------- | |
| 1041 | ||
| 1042 | void exidy440_sound_device::device_stop() | |
| 1043 | { | |
| 1044 | DEVICE_STOP_NAME( exidy440_sound )(this); | |
| 1045 | } | |
| 1046 | ||
| 1047 | //------------------------------------------------- | |
| 1048 | // sound_stream_update - handle a stream update | |
| 1049 | //------------------------------------------------- | |
| 1050 | ||
| 1051 | void exidy440_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1052 | { | |
| 1053 | // should never get here | |
| 1054 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1055 | } | |
| 1056 | ||
| 1057 | ||
| 1058 | ||
| 1059 | ||
| 1060 | ||
| 991 | 1061 | /************************************* |
| 992 | 1062 | * |
| 993 | 1063 | * Machine driver |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | WRITE8_DEVICE_HANDLER( namco_54xx_write ); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | DECLARE_LEGACY_DEVICE(NAMCO_54XX, namco_54xx); | |
| 24 | class namco_54xx_device : public device_t | |
| 25 | { | |
| 26 | public: | |
| 27 | namco_54xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 28 | ~namco_54xx_device() { global_free(m_token); } | |
| 25 | 29 | |
| 30 | // access to legacy token | |
| 31 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 32 | protected: | |
| 33 | // device-level overrides | |
| 34 | virtual void device_config_complete(); | |
| 35 | virtual void device_start(); | |
| 36 | virtual const rom_entry *device_rom_region() const; | |
| 37 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | void *m_token; | |
| 41 | }; | |
| 26 | 42 | |
| 43 | extern const device_type NAMCO_54XX; | |
| 44 | ||
| 45 | ||
| 46 | ||
| 27 | 47 | /* discrete nodes */ |
| 28 | 48 | #define NAMCO_54XX_0_DATA(base) (NODE_RELATIVE(base, 0)) |
| 29 | 49 | #define NAMCO_54XX_1_DATA(base) (NODE_RELATIVE(base, 1)) |
| r17612 | r17613 | |
|---|---|---|
| 72 | 72 | assert(device != NULL); |
| 73 | 73 | assert(device->type() == TX1 || device->type() == BUGGYBOY); |
| 74 | 74 | |
| 75 | return (tx1_sound_state *)downcast< | |
| 75 | return (tx1_sound_state *)downcast<tx1 | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | WRITE8_DEVICE_HANDLER( tx1_pit8253_w ) |
| r17612 | r17613 | |
| 608 | 608 | } |
| 609 | 609 | |
| 610 | 610 | |
| 611 | DEFINE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound); | |
| 612 | DEFINE_LEGACY_SOUND_DEVICE(TX1, tx1_sound); | |
| 611 | const device_type BUGGYBOY = &device_creator<buggyboy_sound_device>; | |
| 612 | ||
| 613 | buggyboy_sound_device::buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 614 | : device_t(mconfig, BUGGYBOY, "Buggy Boy Custom", tag, owner, clock), | |
| 615 | device_sound_interface(mconfig, *this) | |
| 616 | { | |
| 617 | m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state)); | |
| 618 | } | |
| 619 | ||
| 620 | //------------------------------------------------- | |
| 621 | // device_config_complete - perform any | |
| 622 | // operations now that the configuration is | |
| 623 | // complete | |
| 624 | //------------------------------------------------- | |
| 625 | ||
| 626 | void buggyboy_sound_device::device_config_complete() | |
| 627 | { | |
| 628 | } | |
| 629 | ||
| 630 | //------------------------------------------------- | |
| 631 | // device_start - device-specific startup | |
| 632 | //------------------------------------------------- | |
| 633 | ||
| 634 | void buggyboy_sound_device::device_start() | |
| 635 | { | |
| 636 | DEVICE_START_NAME( buggyboy_sound )(this); | |
| 637 | } | |
| 638 | ||
| 639 | //------------------------------------------------- | |
| 640 | // device_reset - device-specific reset | |
| 641 | //------------------------------------------------- | |
| 642 | ||
| 643 | void buggyboy_sound_device::device_reset() | |
| 644 | { | |
| 645 | DEVICE_RESET_NAME( buggyboy_sound )(this); | |
| 646 | } | |
| 647 | ||
| 648 | //------------------------------------------------- | |
| 649 | // sound_stream_update - handle a stream update | |
| 650 | //------------------------------------------------- | |
| 651 | ||
| 652 | void buggyboy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 653 | { | |
| 654 | // should never get here | |
| 655 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 656 | } | |
| 657 | ||
| 658 | ||
| 659 | const device_type TX1 = &device_creator<tx1_sound_device>; | |
| 660 | ||
| 661 | tx1_sound_device::tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 662 | : device_t(mconfig, TX1, "TX-1 Custom", tag, owner, clock), | |
| 663 | device_sound_interface(mconfig, *this) | |
| 664 | { | |
| 665 | m_token = global_alloc_array_clear(UINT8, sizeof(tx1_sound_state)); | |
| 666 | } | |
| 667 | ||
| 668 | //------------------------------------------------- | |
| 669 | // device_config_complete - perform any | |
| 670 | // operations now that the configuration is | |
| 671 | // complete | |
| 672 | //------------------------------------------------- | |
| 673 | ||
| 674 | void tx1_sound_device::device_config_complete() | |
| 675 | { | |
| 676 | } | |
| 677 | ||
| 678 | //------------------------------------------------- | |
| 679 | // device_start - device-specific startup | |
| 680 | //------------------------------------------------- | |
| 681 | ||
| 682 | void tx1_sound_device::device_start() | |
| 683 | { | |
| 684 | DEVICE_START_NAME( tx1_sound )(this); | |
| 685 | } | |
| 686 | ||
| 687 | //------------------------------------------------- | |
| 688 | // device_reset - device-specific reset | |
| 689 | //------------------------------------------------- | |
| 690 | ||
| 691 | void tx1_sound_device::device_reset() | |
| 692 | { | |
| 693 | DEVICE_RESET_NAME( tx1_sound )(this); | |
| 694 | } | |
| 695 | ||
| 696 | //------------------------------------------------- | |
| 697 | // sound_stream_update - handle a stream update | |
| 698 | //------------------------------------------------- | |
| 699 | ||
| 700 | void tx1_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 701 | { | |
| 702 | // should never get here | |
| 703 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 704 | } | |
| 705 | ||
| 706 |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | assert(device != NULL); |
| 29 | 29 | assert(device->type() == IREM_AUDIO); |
| 30 | 30 | |
| 31 | return (irem_audio_state *)downcast< | |
| 31 | return (irem_audio_state *)downcast<irem_audio_devic | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| r17612 | r17613 | |
| 501 | 501 | } |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | DEFINE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio); | |
| 504 | const device_type IREM_AUDIO = &device_creator<irem_audio_device>; | |
| 505 | ||
| 506 | irem_audio_device::irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 507 | : device_t(mconfig, IREM_AUDIO, "Irem Audio", tag, owner, clock), | |
| 508 | device_sound_interface(mconfig, *this) | |
| 509 | { | |
| 510 | m_token = global_alloc_array_clear(UINT8, sizeof(irem_audio_state)); | |
| 511 | } | |
| 512 | ||
| 513 | //------------------------------------------------- | |
| 514 | // device_config_complete - perform any | |
| 515 | // operations now that the configuration is | |
| 516 | // complete | |
| 517 | //------------------------------------------------- | |
| 518 | ||
| 519 | void irem_audio_device::device_config_complete() | |
| 520 | { | |
| 521 | } | |
| 522 | ||
| 523 | //------------------------------------------------- | |
| 524 | // device_start - device-specific startup | |
| 525 | //------------------------------------------------- | |
| 526 | ||
| 527 | void irem_audio_device::device_start() | |
| 528 | { | |
| 529 | DEVICE_START_NAME( irem_audio )(this); | |
| 530 | } | |
| 531 | ||
| 532 | //------------------------------------------------- | |
| 533 | // sound_stream_update - handle a stream update | |
| 534 | //------------------------------------------------- | |
| 535 | ||
| 536 | void irem_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 537 | { | |
| 538 | // should never get here | |
| 539 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 540 | } | |
| 541 | ||
| 542 |
| r17612 | r17613 | |
|---|---|---|
| 4 | 4 | MACHINE_CONFIG_EXTERN( m52_large_audio ); |
| 5 | 5 | MACHINE_CONFIG_EXTERN( m62_audio ); |
| 6 | 6 | |
| 7 | DECLARE_LEGACY_SOUND_DEVICE(IREM_AUDIO, irem_audio); | |
| 7 | class irem_audio_device : public device_t, | |
| 8 | public device_sound_interface | |
| 9 | { | |
| 10 | public: | |
| 11 | irem_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 12 | ~irem_audio_device() { global_free(m_token); } | |
| 13 | ||
| 14 | // access to legacy token | |
| 15 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 16 | protected: | |
| 17 | // device-level overrides | |
| 18 | virtual void device_config_complete(); | |
| 19 | virtual void device_start(); | |
| 20 | ||
| 21 | // sound stream update overrides | |
| 22 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 23 | private: | |
| 24 | // internal state | |
| 25 | void *m_token; | |
| 26 | }; | |
| 27 | ||
| 28 | extern const device_type IREM_AUDIO; | |
| 29 |
| r17612 | r17613 | |
|---|---|---|
| 83 | 83 | assert(device != NULL); |
| 84 | 84 | assert(device->type() == M72); |
| 85 | 85 | |
| 86 | return (m72_audio_state *)downcast< | |
| 86 | return (m72_audio_state *)downcast<m72_audio_devic | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r17612 | r17613 | |
| 271 | 271 | } |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | DEFINE_LEGACY_SOUND_DEVICE(M72, m72_audio); | |
| 274 | const device_type M72 = &device_creator<m72_audio_device>; | |
| 275 | ||
| 276 | m72_audio_device::m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 277 | : device_t(mconfig, M72, "M72 Custom", tag, owner, clock), | |
| 278 | device_sound_interface(mconfig, *this) | |
| 279 | { | |
| 280 | m_token = global_alloc_array_clear(UINT8, sizeof(m72_audio_state)); | |
| 281 | } | |
| 282 | ||
| 283 | //------------------------------------------------- | |
| 284 | // device_config_complete - perform any | |
| 285 | // operations now that the configuration is | |
| 286 | // complete | |
| 287 | //------------------------------------------------- | |
| 288 | ||
| 289 | void m72_audio_device::device_config_complete() | |
| 290 | { | |
| 291 | } | |
| 292 | ||
| 293 | //------------------------------------------------- | |
| 294 | // device_start - device-specific startup | |
| 295 | //------------------------------------------------- | |
| 296 | ||
| 297 | void m72_audio_device::device_start() | |
| 298 | { | |
| 299 | DEVICE_START_NAME( m72_audio )(this); | |
| 300 | } | |
| 301 | ||
| 302 | //------------------------------------------------- | |
| 303 | // device_reset - device-specific reset | |
| 304 | //------------------------------------------------- | |
| 305 | ||
| 306 | void m72_audio_device::device_reset() | |
| 307 | { | |
| 308 | DEVICE_RESET_NAME( m72_audio )(this); | |
| 309 | } | |
| 310 | ||
| 311 | //------------------------------------------------- | |
| 312 | // sound_stream_update - handle a stream update | |
| 313 | //------------------------------------------------- | |
| 314 | ||
| 315 | void m72_audio_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 316 | { | |
| 317 | // should never get here | |
| 318 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 319 | } | |
| 320 | ||
| 321 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | WRITE8_DEVICE_HANDLER( rtype2_sample_addr_w ); |
| 19 | 19 | WRITE8_DEVICE_HANDLER( poundfor_sample_addr_w ); |
| 20 | 20 | |
| 21 | DECLARE_LEGACY_SOUND_DEVICE(M72, m72_audio); | |
| 21 | class m72_audio_device : public device_t, | |
| 22 | public device_sound_interface | |
| 23 | { | |
| 24 | public: | |
| 25 | m72_audio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 26 | ~m72_audio_device() { global_free(m_token); } | |
| 27 | ||
| 28 | // access to legacy token | |
| 29 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 30 | protected: | |
| 31 | // device-level overrides | |
| 32 | virtual void device_config_complete(); | |
| 33 | virtual void device_start(); | |
| 34 | virtual void device_reset(); | |
| 35 | ||
| 36 | // sound stream update overrides | |
| 37 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | void *m_token; | |
| 41 | }; | |
| 42 | ||
| 43 | extern const device_type M72; | |
| 44 |
| r17612 | r17613 | |
|---|---|---|
| 126 | 126 | assert(device != NULL); |
| 127 | 127 | assert(device->type() == BEEZER); |
| 128 | 128 | |
| 129 | return (beezer_sound_state *)downcast< | |
| 129 | return (beezer_sound_state *)downcast<beezer_sound_devic | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | /************************************* |
| r17612 | r17613 | |
| 395 | 395 | DEVICE_START_CALL(common_sh_start); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | ||
| 398 | const device_type | |
| 399 | 399 | |
| 400 | beezer_sound_device::beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 401 | : device_t(mconfig, BEEZER, "beezer SFX", tag, owner, clock), | |
| 402 | device_sound_interface(mconfig, *this) | |
| 403 | { | |
| 404 | m_token = global_alloc_array_clear(UINT8, sizeof(beezer_sound_state)); | |
| 405 | } | |
| 406 | ||
| 407 | //------------------------------------------------- | |
| 408 | // device_config_complete - perform any | |
| 409 | // operations now that the configuration is | |
| 410 | // complete | |
| 411 | //------------------------------------------------- | |
| 412 | ||
| 413 | void beezer_sound_device::device_config_complete() | |
| 414 | { | |
| 415 | } | |
| 416 | ||
| 417 | //------------------------------------------------- | |
| 418 | // device_start - device-specific startup | |
| 419 | //------------------------------------------------- | |
| 420 | ||
| 421 | void beezer_sound_device::device_start() | |
| 422 | { | |
| 423 | DEVICE_START_NAME( beezer_sound )(this); | |
| 424 | } | |
| 425 | ||
| 426 | //------------------------------------------------- | |
| 427 | // device_reset - device-specific reset | |
| 428 | //------------------------------------------------- | |
| 429 | static DEVICE_RESET( beezer_sound ); | |
| 430 | void beezer_sound_device::device_reset() | |
| 431 | { | |
| 432 | DEVICE_RESET_NAME( beezer_sound )(this); | |
| 433 | } | |
| 434 | ||
| 435 | //------------------------------------------------- | |
| 436 | // sound_stream_update - handle a stream update | |
| 437 | //------------------------------------------------- | |
| 438 | ||
| 439 | void beezer_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 440 | { | |
| 441 | // should never get here | |
| 442 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 443 | } | |
| 444 | ||
| 445 | ||
| 446 | ||
| 400 | 447 | /************************************* |
| 401 | 448 | * |
| 402 | 449 | * Audio reset routines |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | assert(device != NULL); |
| 30 | 30 | assert(device->type() == GEEBEE); |
| 31 | 31 | |
| 32 | return (geebee_sound_state *)downcast< | |
| 32 | return (geebee_sound_state *)downcast< | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | static TIMER_CALLBACK( volume_decay ) |
| r17612 | r17613 | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | DEFINE_LEGACY_SOUND_DEVICE(GEEBEE, geebee_sound); | |
| 163 | const device_type GEEBEE = &device_creator<geebee_sound_device>; | |
| 164 | ||
| 165 | geebee_sound_device::geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 166 | : device_t(mconfig, GEEBEE, "Gee Bee Custom", tag, owner, clock), | |
| 167 | device_sound_interface(mconfig, *this) | |
| 168 | { | |
| 169 | m_token = global_alloc_array_clear(UINT8, sizeof(geebee_sound_state)); | |
| 170 | } | |
| 171 | ||
| 172 | //------------------------------------------------- | |
| 173 | // device_config_complete - perform any | |
| 174 | // operations now that the configuration is | |
| 175 | // complete | |
| 176 | //------------------------------------------------- | |
| 177 | ||
| 178 | void geebee_sound_device::device_config_complete() | |
| 179 | { | |
| 180 | } | |
| 181 | ||
| 182 | //------------------------------------------------- | |
| 183 | // device_start - device-specific startup | |
| 184 | //------------------------------------------------- | |
| 185 | ||
| 186 | void geebee_sound_device::device_start() | |
| 187 | { | |
| 188 | DEVICE_START_NAME( geebee_sound )(this); | |
| 189 | } | |
| 190 | ||
| 191 | //------------------------------------------------- | |
| 192 | // sound_stream_update - handle a stream update | |
| 193 | //------------------------------------------------- | |
| 194 | ||
| 195 | void geebee_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 196 | { | |
| 197 | // should never get here | |
| 198 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 199 | } | |
| 200 | ||
| 201 |
| r17612 | r17613 | |
|---|---|---|
| 238 | 238 | assert(device != NULL); |
| 239 | 239 | assert(device->type() == SNES); |
| 240 | 240 | |
| 241 | return (snes_sound_state *)downcast< | |
| 241 | return (snes_sound_state *)downcast<snes | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | /***************************************************************************** |
| r17612 | r17613 | |
| 1377 | 1377 | } |
| 1378 | 1378 | } |
| 1379 | 1379 | |
| 1380 | DEFINE_LEGACY_SOUND_DEVICE(SNES, snes_sound); | |
| 1380 | const device_type SNES = &device_creator<snes_sound_device>; | |
| 1381 | ||
| 1382 | snes_sound_device::snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1383 | : device_t(mconfig, SNES, "SNES Custom DSP (SPC700)", tag, owner, clock), | |
| 1384 | device_sound_interface(mconfig, *this) | |
| 1385 | { | |
| 1386 | m_token = global_alloc_array_clear(UINT8, sizeof(snes_sound_state)); | |
| 1387 | } | |
| 1388 | ||
| 1389 | //------------------------------------------------- | |
| 1390 | // device_config_complete - perform any | |
| 1391 | // operations now that the configuration is | |
| 1392 | // complete | |
| 1393 | //------------------------------------------------- | |
| 1394 | ||
| 1395 | void snes_sound_device::device_config_complete() | |
| 1396 | { | |
| 1397 | } | |
| 1398 | ||
| 1399 | //------------------------------------------------- | |
| 1400 | // device_start - device-specific startup | |
| 1401 | //------------------------------------------------- | |
| 1402 | ||
| 1403 | void snes_sound_device::device_start() | |
| 1404 | { | |
| 1405 | DEVICE_START_NAME( snes_sound )(this); | |
| 1406 | } | |
| 1407 | ||
| 1408 | //------------------------------------------------- | |
| 1409 | // device_reset - device-specific reset | |
| 1410 | //------------------------------------------------- | |
| 1411 | ||
| 1412 | void snes_sound_device::device_reset() | |
| 1413 | { | |
| 1414 | DEVICE_RESET_NAME( snes_sound )(this); | |
| 1415 | } | |
| 1416 | ||
| 1417 | //------------------------------------------------- | |
| 1418 | // sound_stream_update - handle a stream update | |
| 1419 | //------------------------------------------------- | |
| 1420 | ||
| 1421 | void snes_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1422 | { | |
| 1423 | // should never get here | |
| 1424 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1425 | } | |
| 1426 | ||
| 1427 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | DEVICE CONFIGURATION MACROS |
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(SNES, snes_sound); | |
| 19 | class snes_sound_device : public device_t, | |
| 20 | public device_sound_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | snes_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~snes_sound_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_reset(); | |
| 21 | 33 | |
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type SNES; | |
| 42 | ||
| 43 | ||
| 44 | ||
| 22 | 45 | /*************************************************************************** |
| 23 | 46 | I/O PROTOTYPES |
| 24 | 47 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 75 | 75 | assert(device != NULL); |
| 76 | 76 | assert(device->type() == PLEIADS || device->type() == POPFLAME || device->type() == NAUGHTYB); |
| 77 | 77 | |
| 78 | return (pleiads_sound_state *)downcast<le | |
| 78 | return (pleiads_sound_state *)downcast<pleiads_sound_devic | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r17612 | r17613 | |
| 731 | 731 | } |
| 732 | 732 | |
| 733 | 733 | |
| 734 | DEFINE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound); | |
| 735 | DEFINE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound); | |
| 736 | DEFINE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound); | |
| 734 | const device_type PLEIADS = &device_creator<pleiads_sound_device>; | |
| 735 | ||
| 736 | pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 737 | : device_t(mconfig, PLEIADS, "Pleiads Custom", tag, owner, clock), | |
| 738 | device_sound_interface(mconfig, *this) | |
| 739 | { | |
| 740 | m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state)); | |
| 741 | } | |
| 742 | ||
| 743 | pleiads_sound_device::pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 744 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 745 | device_sound_interface(mconfig, *this) | |
| 746 | { | |
| 747 | m_token = global_alloc_array_clear(UINT8, sizeof(pleiads_sound_state)); | |
| 748 | } | |
| 749 | ||
| 750 | //------------------------------------------------- | |
| 751 | // device_config_complete - perform any | |
| 752 | // operations now that the configuration is | |
| 753 | // complete | |
| 754 | //------------------------------------------------- | |
| 755 | ||
| 756 | void pleiads_sound_device::device_config_complete() | |
| 757 | { | |
| 758 | } | |
| 759 | ||
| 760 | //------------------------------------------------- | |
| 761 | // device_start - device-specific startup | |
| 762 | //------------------------------------------------- | |
| 763 | ||
| 764 | void pleiads_sound_device::device_start() | |
| 765 | { | |
| 766 | DEVICE_START_NAME( pleiads_sound )(this); | |
| 767 | } | |
| 768 | ||
| 769 | //------------------------------------------------- | |
| 770 | // sound_stream_update - handle a stream update | |
| 771 | //------------------------------------------------- | |
| 772 | ||
| 773 | void pleiads_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 774 | { | |
| 775 | // should never get here | |
| 776 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 777 | } | |
| 778 | ||
| 779 | ||
| 780 | const device_type NAUGHTYB = &device_creator<naughtyb_sound_device>; | |
| 781 | ||
| 782 | naughtyb_sound_device::naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 783 | : pleiads_sound_device(mconfig, NAUGHTYB, "Naughty Boy Custom", tag, owner, clock) | |
| 784 | { | |
| 785 | } | |
| 786 | ||
| 787 | //------------------------------------------------- | |
| 788 | // device_config_complete - perform any | |
| 789 | // operations now that the configuration is | |
| 790 | // complete | |
| 791 | //------------------------------------------------- | |
| 792 | ||
| 793 | void naughtyb_sound_device::device_config_complete() | |
| 794 | { | |
| 795 | } | |
| 796 | ||
| 797 | //------------------------------------------------- | |
| 798 | // device_start - device-specific startup | |
| 799 | //------------------------------------------------- | |
| 800 | ||
| 801 | void naughtyb_sound_device::device_start() | |
| 802 | { | |
| 803 | DEVICE_START_NAME( naughtyb_sound )(this); | |
| 804 | } | |
| 805 | ||
| 806 | //------------------------------------------------- | |
| 807 | // sound_stream_update - handle a stream update | |
| 808 | //------------------------------------------------- | |
| 809 | ||
| 810 | void naughtyb_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 811 | { | |
| 812 | // should never get here | |
| 813 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 814 | } | |
| 815 | ||
| 816 | ||
| 817 | const device_type POPFLAME = &device_creator<popflame_sound_device>; | |
| 818 | ||
| 819 | popflame_sound_device::popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 820 | : pleiads_sound_device(mconfig, POPFLAME, "Pop Flamer Custom", tag, owner, clock) | |
| 821 | { | |
| 822 | } | |
| 823 | ||
| 824 | //------------------------------------------------- | |
| 825 | // device_config_complete - perform any | |
| 826 | // operations now that the configuration is | |
| 827 | // complete | |
| 828 | //------------------------------------------------- | |
| 829 | ||
| 830 | void popflame_sound_device::device_config_complete() | |
| 831 | { | |
| 832 | } | |
| 833 | ||
| 834 | //------------------------------------------------- | |
| 835 | // device_start - device-specific startup | |
| 836 | //------------------------------------------------- | |
| 837 | ||
| 838 | void popflame_sound_device::device_start() | |
| 839 | { | |
| 840 | DEVICE_START_NAME( popflame_sound )(this); | |
| 841 | } | |
| 842 | ||
| 843 | //------------------------------------------------- | |
| 844 | // sound_stream_update - handle a stream update | |
| 845 | //------------------------------------------------- | |
| 846 | ||
| 847 | void popflame_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 848 | { | |
| 849 | // should never get here | |
| 850 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 851 | } | |
| 852 | ||
| 853 |
| r17612 | r17613 | |
|---|---|---|
| 2 | 2 | WRITE8_DEVICE_HANDLER( pleiads_sound_control_b_w ); |
| 3 | 3 | WRITE8_DEVICE_HANDLER( pleiads_sound_control_c_w ); |
| 4 | 4 | |
| 5 | DECLARE_LEGACY_SOUND_DEVICE(PLEIADS, pleiads_sound); | |
| 6 | DECLARE_LEGACY_SOUND_DEVICE(NAUGHTYB, naughtyb_sound); | |
| 7 | DECLARE_LEGACY_SOUND_DEVICE(POPFLAME, popflame_sound); | |
| 5 | class pleiads_sound_device : public device_t, | |
| 6 | public device_sound_interface | |
| 7 | { | |
| 8 | public: | |
| 9 | pleiads_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 10 | pleiads_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 11 | ~pleiads_sound_device() { global_free(m_token); } | |
| 12 | ||
| 13 | // access to legacy token | |
| 14 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 15 | protected: | |
| 16 | // device-level overrides | |
| 17 | virtual void device_config_complete(); | |
| 18 | virtual void device_start(); | |
| 19 | ||
| 20 | // sound stream update overrides | |
| 21 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 22 | private: | |
| 23 | // internal state | |
| 24 | void *m_token; | |
| 25 | }; | |
| 26 | ||
| 27 | extern const device_type PLEIADS; | |
| 28 | ||
| 29 | class naughtyb_sound_device : public pleiads_sound_device | |
| 30 | { | |
| 31 | public: | |
| 32 | naughtyb_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | protected: | |
| 34 | // device-level overrides | |
| 35 | virtual void device_config_complete(); | |
| 36 | virtual void device_start(); | |
| 37 | ||
| 38 | // sound stream update overrides | |
| 39 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | }; | |
| 43 | ||
| 44 | extern const device_type NAUGHTYB; | |
| 45 | ||
| 46 | class popflame_sound_device : public pleiads_sound_device | |
| 47 | { | |
| 48 | public: | |
| 49 | popflame_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | protected: | |
| 51 | // device-level overrides | |
| 52 | virtual void device_config_complete(); | |
| 53 | virtual void device_start(); | |
| 54 | ||
| 55 | // sound stream update overrides | |
| 56 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 57 | private: | |
| 58 | // internal state | |
| 59 | }; | |
| 60 | ||
| 61 | extern const device_type POPFLAME; | |
| 62 |
| r17612 | r17613 | |
|---|---|---|
| 51 | 51 | assert(device != NULL); |
| 52 | 52 | assert(device->type() == POLEPOS); |
| 53 | 53 | |
| 54 | return (polepos_sound_state *)downcast<le | |
| 54 | return (polepos_sound_state *)downcast<polepos | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | /************************************/ |
| r17612 | r17613 | |
| 369 | 369 | DISCRETE_SOUND_END |
| 370 | 370 | |
| 371 | 371 | |
| 372 | DEFINE_LEGACY_SOUND_DEVICE(POLEPOS, polepos_sound); | |
| 372 | const device_type POLEPOS = &device_creator<polepos_sound_device>; | |
| 373 | ||
| 374 | polepos_sound_device::polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 375 | : device_t(mconfig, POLEPOS, "Pole Position Custom", tag, owner, clock), | |
| 376 | device_sound_interface(mconfig, *this) | |
| 377 | { | |
| 378 | m_token = global_alloc_array_clear(UINT8, sizeof(polepos_sound_state)); | |
| 379 | } | |
| 380 | ||
| 381 | //------------------------------------------------- | |
| 382 | // device_config_complete - perform any | |
| 383 | // operations now that the configuration is | |
| 384 | // complete | |
| 385 | //------------------------------------------------- | |
| 386 | ||
| 387 | void polepos_sound_device::device_config_complete() | |
| 388 | { | |
| 389 | } | |
| 390 | ||
| 391 | //------------------------------------------------- | |
| 392 | // device_start - device-specific startup | |
| 393 | //------------------------------------------------- | |
| 394 | ||
| 395 | void polepos_sound_device::device_start() | |
| 396 | { | |
| 397 | DEVICE_START_NAME( polepos_sound )(this); | |
| 398 | } | |
| 399 | ||
| 400 | //------------------------------------------------- | |
| 401 | // device_reset - device-specific reset | |
| 402 | //------------------------------------------------- | |
| 403 | ||
| 404 | void polepos_sound_device::device_reset() | |
| 405 | { | |
| 406 | DEVICE_RESET_NAME( polepos_sound )(this); | |
| 407 | } | |
| 408 | ||
| 409 | //------------------------------------------------- | |
| 410 | // sound_stream_update - handle a stream update | |
| 411 | //------------------------------------------------- | |
| 412 | ||
| 413 | void polepos_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 414 | { | |
| 415 | // should never get here | |
| 416 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 417 | } | |
| 418 | ||
| 419 |
| r17612 | r17613 | |
|---|---|---|
| 74 | 74 | assert(device != NULL); |
| 75 | 75 | assert(device->type() == TC0220IOC); |
| 76 | 76 | |
| 77 | return (tc0220ioc_state *)downcast< | |
| 77 | return (tc0220ioc_state *)downcast<t | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | INLINE const tc0220ioc_interface *tc0220ioc_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 231 | 231 | assert(device != NULL); |
| 232 | 232 | assert(device->type() == TC0510NIO); |
| 233 | 233 | |
| 234 | return (tc0510nio_state *)downcast< | |
| 234 | return (tc0510nio_state *)downcast<t | |
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | INLINE const tc0510nio_interface *tc0510nio_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 382 | 382 | assert(device != NULL); |
| 383 | 383 | assert(device->type() == TC0640FIO); |
| 384 | 384 | |
| 385 | return (tc0640fio_state *)downcast< | |
| 385 | return (tc0640fio_state *)downcast<t | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | INLINE const tc0640fio_interface *tc0640fio_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | |
| 577 | DEFINE_LEGACY_DEVICE(TC0220IOC, tc0220ioc); | |
| 578 | DEFINE_LEGACY_DEVICE(TC0510NIO, tc0510nio); | |
| 579 | DEFINE_LEGACY_DEVICE(TC0640FIO, tc0640fio); | |
| 577 | const device_type TC0220IOC = &device_creator<tc0220ioc_device>; | |
| 578 | ||
| 579 | tc0220ioc_device::tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 580 | : device_t(mconfig, TC0220IOC, "Taito TC0220IOC", tag, owner, clock) | |
| 581 | { | |
| 582 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0220ioc_state)); | |
| 583 | } | |
| 584 | ||
| 585 | //------------------------------------------------- | |
| 586 | // device_config_complete - perform any | |
| 587 | // operations now that the configuration is | |
| 588 | // complete | |
| 589 | //------------------------------------------------- | |
| 590 | ||
| 591 | void tc0220ioc_device::device_config_complete() | |
| 592 | { | |
| 593 | } | |
| 594 | ||
| 595 | //------------------------------------------------- | |
| 596 | // device_start - device-specific startup | |
| 597 | //------------------------------------------------- | |
| 598 | ||
| 599 | void tc0220ioc_device::device_start() | |
| 600 | { | |
| 601 | DEVICE_START_NAME( tc0220ioc )(this); | |
| 602 | } | |
| 603 | ||
| 604 | //------------------------------------------------- | |
| 605 | // device_reset - device-specific reset | |
| 606 | //------------------------------------------------- | |
| 607 | ||
| 608 | void tc0220ioc_device::device_reset() | |
| 609 | { | |
| 610 | DEVICE_RESET_NAME( tc0220ioc )(this); | |
| 611 | } | |
| 612 | ||
| 613 | ||
| 614 | const device_type TC0510NIO = &device_creator<tc0510nio_device>; | |
| 615 | ||
| 616 | tc0510nio_device::tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 617 | : device_t(mconfig, TC0510NIO, "Taito TC0510NIO", tag, owner, clock) | |
| 618 | { | |
| 619 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0510nio_state)); | |
| 620 | } | |
| 621 | ||
| 622 | //------------------------------------------------- | |
| 623 | // device_config_complete - perform any | |
| 624 | // operations now that the configuration is | |
| 625 | // complete | |
| 626 | //------------------------------------------------- | |
| 627 | ||
| 628 | void tc0510nio_device::device_config_complete() | |
| 629 | { | |
| 630 | } | |
| 631 | ||
| 632 | //------------------------------------------------- | |
| 633 | // device_start - device-specific startup | |
| 634 | //------------------------------------------------- | |
| 635 | ||
| 636 | void tc0510nio_device::device_start() | |
| 637 | { | |
| 638 | DEVICE_START_NAME( tc0510nio )(this); | |
| 639 | } | |
| 640 | ||
| 641 | //------------------------------------------------- | |
| 642 | // device_reset - device-specific reset | |
| 643 | //------------------------------------------------- | |
| 644 | ||
| 645 | void tc0510nio_device::device_reset() | |
| 646 | { | |
| 647 | DEVICE_RESET_NAME( tc0510nio )(this); | |
| 648 | } | |
| 649 | ||
| 650 | ||
| 651 | const device_type TC0640FIO = &device_creator<tc0640fio_device>; | |
| 652 | ||
| 653 | tc0640fio_device::tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 654 | : device_t(mconfig, TC0640FIO, "Taito TC0640FIO", tag, owner, clock) | |
| 655 | { | |
| 656 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0640fio_state)); | |
| 657 | } | |
| 658 | ||
| 659 | //------------------------------------------------- | |
| 660 | // device_config_complete - perform any | |
| 661 | // operations now that the configuration is | |
| 662 | // complete | |
| 663 | //------------------------------------------------- | |
| 664 | ||
| 665 | void tc0640fio_device::device_config_complete() | |
| 666 | { | |
| 667 | } | |
| 668 | ||
| 669 | //------------------------------------------------- | |
| 670 | // device_start - device-specific startup | |
| 671 | //------------------------------------------------- | |
| 672 | ||
| 673 | void tc0640fio_device::device_start() | |
| 674 | { | |
| 675 | DEVICE_START_NAME( tc0640fio )(this); | |
| 676 | } | |
| 677 | ||
| 678 | //------------------------------------------------- | |
| 679 | // device_reset - device-specific reset | |
| 680 | //------------------------------------------------- | |
| 681 | ||
| 682 | void tc0640fio_device::device_reset() | |
| 683 | { | |
| 684 | DEVICE_RESET_NAME( tc0640fio )(this); | |
| 685 | } | |
| 686 | ||
| 687 |
| r17612 | r17613 | |
|---|---|---|
| 47 | 47 | devcb_read8 read_7; |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | DECLARE_LEGACY_DEVICE(TC0220IOC, tc0220ioc); | |
| 51 | DECLARE_LEGACY_DEVICE(TC0510NIO, tc0510nio); | |
| 52 | DECLARE_LEGACY_DEVICE(TC0640FIO, tc0640fio); | |
| 50 | class tc0220ioc_device : public device_t | |
| 51 | { | |
| 52 | public: | |
| 53 | tc0220ioc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | ~tc0220ioc_device() { global_free(m_token); } | |
| 53 | 55 | |
| 56 | // access to legacy token | |
| 57 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 58 | protected: | |
| 59 | // device-level overrides | |
| 60 | virtual void device_config_complete(); | |
| 61 | virtual void device_start(); | |
| 62 | virtual void device_reset(); | |
| 63 | private: | |
| 64 | // internal state | |
| 65 | void *m_token; | |
| 66 | }; | |
| 67 | ||
| 68 | extern const device_type TC0220IOC; | |
| 69 | ||
| 70 | class tc0510nio_device : public device_t | |
| 71 | { | |
| 72 | public: | |
| 73 | tc0510nio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 74 | ~tc0510nio_device() { global_free(m_token); } | |
| 75 | ||
| 76 | // access to legacy token | |
| 77 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 78 | protected: | |
| 79 | // device-level overrides | |
| 80 | virtual void device_config_complete(); | |
| 81 | virtual void device_start(); | |
| 82 | virtual void device_reset(); | |
| 83 | private: | |
| 84 | // internal state | |
| 85 | void *m_token; | |
| 86 | }; | |
| 87 | ||
| 88 | extern const device_type TC0510NIO; | |
| 89 | ||
| 90 | class tc0640fio_device : public device_t | |
| 91 | { | |
| 92 | public: | |
| 93 | tc0640fio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 94 | ~tc0640fio_device() { global_free(m_token); } | |
| 95 | ||
| 96 | // access to legacy token | |
| 97 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 98 | protected: | |
| 99 | // device-level overrides | |
| 100 | virtual void device_config_complete(); | |
| 101 | virtual void device_start(); | |
| 102 | virtual void device_reset(); | |
| 103 | private: | |
| 104 | // internal state | |
| 105 | void *m_token; | |
| 106 | }; | |
| 107 | ||
| 108 | extern const device_type TC0640FIO; | |
| 109 | ||
| 110 | ||
| 54 | 111 | /*************************************************************************** |
| 55 | 112 | DEVICE CONFIGURATION MACROS |
| 56 | 113 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 110 | 110 | assert(device != NULL); |
| 111 | 111 | assert(device->type() == NAMCO_06XX); |
| 112 | 112 | |
| 113 | return (namco_06xx_state *)downcast< | |
| 113 | return (namco_06xx_state *)downcast<n | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | |
| r17612 | r17613 | |
| 309 | 309 | } |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | DEFINE_LEGACY_DEVICE(NAMCO_06XX, namco_06xx); | |
| 312 | const device_type NAMCO_06XX = &device_creator<namco_06xx_device>; | |
| 313 | ||
| 314 | namco_06xx_device::namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 315 | : device_t(mconfig, NAMCO_06XX, "Namco 06xx", tag, owner, clock) | |
| 316 | { | |
| 317 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_06xx_state)); | |
| 318 | } | |
| 319 | ||
| 320 | //------------------------------------------------- | |
| 321 | // device_config_complete - perform any | |
| 322 | // operations now that the configuration is | |
| 323 | // complete | |
| 324 | //------------------------------------------------- | |
| 325 | ||
| 326 | void namco_06xx_device::device_config_complete() | |
| 327 | { | |
| 328 | m_shortname = "namco06xx"; | |
| 329 | } | |
| 330 | ||
| 331 | //------------------------------------------------- | |
| 332 | // device_start - device-specific startup | |
| 333 | //------------------------------------------------- | |
| 334 | ||
| 335 | void namco_06xx_device::device_start() | |
| 336 | { | |
| 337 | DEVICE_START_NAME( namco_06xx )(this); | |
| 338 | } | |
| 339 | ||
| 340 | //------------------------------------------------- | |
| 341 | // device_reset - device-specific reset | |
| 342 | //------------------------------------------------- | |
| 343 | ||
| 344 | void namco_06xx_device::device_reset() | |
| 345 | { | |
| 346 | DEVICE_RESET_NAME( namco_06xx )(this); | |
| 347 | } | |
| 348 | ||
| 349 |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | /* device get info callback */ |
| 30 | DECLARE_LEGACY_DEVICE(NAMCO_06XX, namco_06xx); | |
| 30 | class namco_06xx_device : public device_t | |
| 31 | { | |
| 32 | public: | |
| 33 | namco_06xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ~namco_06xx_device() { global_free(m_token); } | |
| 31 | 35 | |
| 36 | // access to legacy token | |
| 37 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 38 | protected: | |
| 39 | // device-level overrides | |
| 40 | virtual void device_config_complete(); | |
| 41 | virtual void device_start(); | |
| 42 | virtual void device_reset(); | |
| 43 | private: | |
| 44 | // internal state | |
| 45 | void *m_token; | |
| 46 | }; | |
| 32 | 47 | |
| 48 | extern const device_type NAMCO_06XX; | |
| 49 | ||
| 50 | ||
| 51 | ||
| 33 | 52 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 144 | 144 | assert(device != NULL); |
| 145 | 145 | assert(device->type() == NAMCO56XX || device->type() == NAMCO58XX || device->type() == NAMCO59XX); |
| 146 | 146 | |
| 147 | return (namcoio_state *)downcast< | |
| 147 | return (namcoio_state *)downcast<n | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | INLINE const namcoio_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | |
| 561 | DEFINE_LEGACY_DEVICE(NAMCO56XX, namcoio); | |
| 561 | const device_type NAMCO56XX = &device_creator<namcoio_device>; | |
| 562 | ||
| 563 | namcoio_device::namcoio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 564 | : device_t(mconfig, NAMCO56XX, "Namco 56xx, 58xx & 59xx", tag, owner, clock) | |
| 565 | { | |
| 566 | m_token = global_alloc_array_clear(UINT8, sizeof(namcoio_state)); | |
| 567 | } | |
| 568 | ||
| 569 | //------------------------------------------------- | |
| 570 | // device_config_complete - perform any | |
| 571 | // operations now that the configuration is | |
| 572 | // complete | |
| 573 | //------------------------------------------------- | |
| 574 | ||
| 575 | void namcoio_device::device_config_complete() | |
| 576 | { | |
| 577 | } | |
| 578 | ||
| 579 | //------------------------------------------------- | |
| 580 | // device_start - device-specific startup | |
| 581 | //------------------------------------------------- | |
| 582 | ||
| 583 | void namcoio_device::device_start() | |
| 584 | { | |
| 585 | DEVICE_START_NAME( namcoio )(this); | |
| 586 | } | |
| 587 | ||
| 588 | //------------------------------------------------- | |
| 589 | // device_reset - device-specific reset | |
| 590 | //------------------------------------------------- | |
| 591 | ||
| 592 | void namcoio_device::device_reset() | |
| 593 | { | |
| 594 | DEVICE_RESET_NAME( namcoio )(this); | |
| 595 | } | |
| 596 | ||
| 597 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | device_t *device; |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_DEVICE(NAMCO56XX, namcoio); | |
| 19 | class namcoio_device : public device_t | |
| 20 | { | |
| 21 | public: | |
| 22 | namcoio_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | ~namcoio_device() { global_free(m_token); } | |
| 24 | ||
| 25 | // access to legacy token | |
| 26 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 27 | protected: | |
| 28 | // device-level overrides | |
| 29 | virtual void device_config_complete(); | |
| 30 | virtual void device_start(); | |
| 31 | virtual void device_reset(); | |
| 32 | private: | |
| 33 | // internal state | |
| 34 | void *m_token; | |
| 35 | }; | |
| 36 | ||
| 37 | extern const device_type NAMCO56XX; | |
| 38 | ||
| 20 | 39 | #define NAMCO58XX NAMCO56XX |
| 21 | 40 | #define NAMCO59XX NAMCO56XX |
| 22 | 41 |
| r17612 | r17613 | |
|---|---|---|
| 34 | 34 | assert(device != NULL); |
| 35 | 35 | assert(device->type() == NMK112); |
| 36 | 36 | |
| 37 | return (nmk112_state *)downcast< | |
| 37 | return (nmk112_state *)downcast<nmk112_devic | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | INLINE const nmk112_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | DEFINE_LEGACY_DEVICE(NMK112, nmk112); | |
| 174 | const device_type NMK112 = &device_creator<nmk112_device>; | |
| 175 | ||
| 176 | nmk112_device::nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 177 | : device_t(mconfig, NMK112, "NMK 112", tag, owner, clock) | |
| 178 | { | |
| 179 | m_token = global_alloc_array_clear(UINT8, sizeof(nmk112_state)); | |
| 180 | } | |
| 181 | ||
| 182 | //------------------------------------------------- | |
| 183 | // device_config_complete - perform any | |
| 184 | // operations now that the configuration is | |
| 185 | // complete | |
| 186 | //------------------------------------------------- | |
| 187 | ||
| 188 | void nmk112_device::device_config_complete() | |
| 189 | { | |
| 190 | } | |
| 191 | ||
| 192 | //------------------------------------------------- | |
| 193 | // device_start - device-specific startup | |
| 194 | //------------------------------------------------- | |
| 195 | ||
| 196 | void nmk112_device::device_start() | |
| 197 | { | |
| 198 | DEVICE_START_NAME( nmk112 )(this); | |
| 199 | } | |
| 200 | ||
| 201 | //------------------------------------------------- | |
| 202 | // device_reset - device-specific reset | |
| 203 | //------------------------------------------------- | |
| 204 | ||
| 205 | void nmk112_device::device_reset() | |
| 206 | { | |
| 207 | DEVICE_RESET_NAME( nmk112 )(this); | |
| 208 | } | |
| 209 | ||
| 210 |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | UINT8 disable_page_mask; |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | DECLARE_LEGACY_DEVICE(NMK112, nmk112); | |
| 23 | class nmk112_device : public device_t | |
| 24 | { | |
| 25 | public: | |
| 26 | nmk112_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~nmk112_device() { global_free(m_token); } | |
| 24 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_reset(); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type NMK112; | |
| 42 | ||
| 43 | ||
| 25 | 44 | /*************************************************************************** |
| 26 | 45 | DEVICE CONFIGURATION MACROS |
| 27 | 46 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 149 | 149 | assert(device != NULL); |
| 150 | 150 | assert(device->type() == NAMCO_50XX); |
| 151 | 151 | |
| 152 | return (namco_50xx_state *)downcast< | |
| 152 | return (namco_50xx_state *)downcast<n | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r17612 | r17613 | |
| 314 | 314 | } |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | DEFINE_LEGACY_DEVICE(NAMCO_50XX, namco_50xx); | |
| 317 | const device_type NAMCO_50XX = &device_creator<namco_50xx_device>; | |
| 318 | ||
| 319 | namco_50xx_device::namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 320 | : device_t(mconfig, NAMCO_50XX, "Namco 50xx", tag, owner, clock) | |
| 321 | { | |
| 322 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_50xx_state)); | |
| 323 | } | |
| 324 | ||
| 325 | //------------------------------------------------- | |
| 326 | // device_config_complete - perform any | |
| 327 | // operations now that the configuration is | |
| 328 | // complete | |
| 329 | //------------------------------------------------- | |
| 330 | ||
| 331 | void namco_50xx_device::device_config_complete() | |
| 332 | { | |
| 333 | m_shortname = "namco50"; | |
| 334 | } | |
| 335 | ||
| 336 | //------------------------------------------------- | |
| 337 | // device_start - device-specific startup | |
| 338 | //------------------------------------------------- | |
| 339 | ||
| 340 | void namco_50xx_device::device_start() | |
| 341 | { | |
| 342 | DEVICE_START_NAME( namco_50xx )(this); | |
| 343 | } | |
| 344 | ||
| 345 | //------------------------------------------------- | |
| 346 | // device_mconfig_additions - return a pointer to | |
| 347 | // the device's machine fragment | |
| 348 | //------------------------------------------------- | |
| 349 | ||
| 350 | machine_config_constructor namco_50xx_device::device_mconfig_additions() const | |
| 351 | { | |
| 352 | return MACHINE_CONFIG_NAME( namco_50xx ); | |
| 353 | } | |
| 354 | ||
| 355 | //------------------------------------------------- | |
| 356 | // device_rom_region - return a pointer to the | |
| 357 | // the device's ROM definitions | |
| 358 | //------------------------------------------------- | |
| 359 | ||
| 360 | const rom_entry *namco_50xx_device::device_rom_region() const | |
| 361 | { | |
| 362 | return ROM_NAME(namco_50xx ); | |
| 363 | } | |
| 364 | ||
| 365 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | |
| 16 | 16 | /* device get info callback */ |
| 17 | DECLARE_LEGACY_DEVICE(NAMCO_50XX, namco_50xx); | |
| 17 | class namco_50xx_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | namco_50xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~namco_50xx_device() { global_free(m_token); } | |
| 18 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual const rom_entry *device_rom_region() const; | |
| 30 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 19 | 35 | |
| 36 | extern const device_type NAMCO_50XX; | |
| 37 | ||
| 38 | ||
| 39 | ||
| 20 | 40 | #endif /* NAMCO50_H */ |
| r17612 | r17613 | |
|---|---|---|
| 90 | 90 | assert(device != NULL); |
| 91 | 91 | assert(device->type() == NAMCO_51XX); |
| 92 | 92 | |
| 93 | return (namco_51xx_state *)downcast< | |
| 93 | return (namco_51xx_state *)downcast<n | |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| r17612 | r17613 | |
| 465 | 465 | } |
| 466 | 466 | } |
| 467 | 467 | |
| 468 | DEFINE_LEGACY_DEVICE(NAMCO_51XX, namco_51xx); | |
| 468 | const device_type NAMCO_51XX = &device_creator<namco_51xx_device>; | |
| 469 | ||
| 470 | namco_51xx_device::namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 471 | : device_t(mconfig, NAMCO_51XX, "Namco 51xx", tag, owner, clock) | |
| 472 | { | |
| 473 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_51xx_state)); | |
| 474 | } | |
| 475 | ||
| 476 | //------------------------------------------------- | |
| 477 | // device_config_complete - perform any | |
| 478 | // operations now that the configuration is | |
| 479 | // complete | |
| 480 | //------------------------------------------------- | |
| 481 | ||
| 482 | void namco_51xx_device::device_config_complete() | |
| 483 | { | |
| 484 | m_shortname = "namco51"; | |
| 485 | } | |
| 486 | ||
| 487 | //------------------------------------------------- | |
| 488 | // device_start - device-specific startup | |
| 489 | //------------------------------------------------- | |
| 490 | ||
| 491 | void namco_51xx_device::device_start() | |
| 492 | { | |
| 493 | DEVICE_START_NAME( namco_51xx )(this); | |
| 494 | } | |
| 495 | ||
| 496 | //------------------------------------------------- | |
| 497 | // device_reset - device-specific reset | |
| 498 | //------------------------------------------------- | |
| 499 | ||
| 500 | void namco_51xx_device::device_reset() | |
| 501 | { | |
| 502 | DEVICE_RESET_NAME( namco_51xx )(this); | |
| 503 | } | |
| 504 | ||
| 505 | //------------------------------------------------- | |
| 506 | // device_mconfig_additions - return a pointer to | |
| 507 | // the device's machine fragment | |
| 508 | //------------------------------------------------- | |
| 509 | ||
| 510 | machine_config_constructor namco_51xx_device::device_mconfig_additions() const | |
| 511 | { | |
| 512 | return MACHINE_CONFIG_NAME( namco_51xx ); | |
| 513 | } | |
| 514 | ||
| 515 | //------------------------------------------------- | |
| 516 | // device_rom_region - return a pointer to the | |
| 517 | // the device's ROM definitions | |
| 518 | //------------------------------------------------- | |
| 519 | ||
| 520 | const rom_entry *namco_51xx_device::device_rom_region() const | |
| 521 | { | |
| 522 | return ROM_NAME(namco_51xx ); | |
| 523 | } | |
| 524 | ||
| 525 |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | WRITE8_DEVICE_HANDLER( namco_51xx_write ); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | DECLARE_LEGACY_DEVICE(NAMCO_51XX, namco_51xx); | |
| 24 | class namco_51xx_device : public device_t | |
| 25 | { | |
| 26 | public: | |
| 27 | namco_51xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 28 | ~namco_51xx_device() { global_free(m_token); } | |
| 25 | 29 | |
| 30 | // access to legacy token | |
| 31 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 32 | protected: | |
| 33 | // device-level overrides | |
| 34 | virtual void device_config_complete(); | |
| 35 | virtual void device_start(); | |
| 36 | virtual void device_reset(); | |
| 37 | virtual const rom_entry *device_rom_region() const; | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | private: | |
| 40 | // internal state | |
| 41 | void *m_token; | |
| 42 | }; | |
| 26 | 43 | |
| 44 | extern const device_type NAMCO_51XX; | |
| 45 | ||
| 46 | ||
| 47 | ||
| 27 | 48 | #endif /* NAMCO51_H */ |
| r17612 | r17613 | |
|---|---|---|
| 81 | 81 | assert(device != NULL); |
| 82 | 82 | assert(device->type() == AKIKO); |
| 83 | 83 | |
| 84 | return (akiko_state *)downcast< | |
| 84 | return (akiko_state *)downcast< | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static DEVICE_STOP( akiko ) |
| r17612 | r17613 | |
| 933 | 933 | } |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | DEFINE_LEGACY_DEVICE(AKIKO, akiko); | |
| 936 | const device_type AKIKO = &device_creator<akiko_device>; | |
| 937 | ||
| 938 | akiko_device::akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 939 | : device_t(mconfig, AKIKO, "Akiko", tag, owner, clock) | |
| 940 | { | |
| 941 | m_token = global_alloc_array_clear(UINT8, sizeof(akiko_state)); | |
| 942 | } | |
| 943 | ||
| 944 | //------------------------------------------------- | |
| 945 | // device_config_complete - perform any | |
| 946 | // operations now that the configuration is | |
| 947 | // complete | |
| 948 | //------------------------------------------------- | |
| 949 | ||
| 950 | void akiko_device::device_config_complete() | |
| 951 | { | |
| 952 | } | |
| 953 | ||
| 954 | //------------------------------------------------- | |
| 955 | // device_start - device-specific startup | |
| 956 | //------------------------------------------------- | |
| 957 | ||
| 958 | void akiko_device::device_start() | |
| 959 | { | |
| 960 | DEVICE_START_NAME( akiko )(this); | |
| 961 | } | |
| 962 | ||
| 963 | //------------------------------------------------- | |
| 964 | // device_reset - device-specific reset | |
| 965 | //------------------------------------------------- | |
| 966 | ||
| 967 | void akiko_device::device_reset() | |
| 968 | { | |
| 969 | DEVICE_RESET_NAME( akiko )(this); | |
| 970 | } | |
| 971 | ||
| 972 | //------------------------------------------------- | |
| 973 | // device_stop - device-specific stop | |
| 974 | //------------------------------------------------- | |
| 975 | ||
| 976 | void akiko_device::device_stop() | |
| 977 | { | |
| 978 | DEVICE_STOP_NAME( akiko )(this); | |
| 979 | } | |
| 980 | ||
| 981 |
| r17612 | r17613 | |
|---|---|---|
| 208 | 208 | { |
| 209 | 209 | assert(device != NULL); |
| 210 | 210 | assert(device->type() == GAELCO_SERIAL); |
| 211 | return (gaelco_serial_state *) downcast< | |
| 211 | return (gaelco_serial_state *) downcast< | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | INLINE const gaelco_serial_interface *get_interface(device_t *device) |
| 215 | 215 | { |
| 216 | 216 | assert(device != NULL); |
| 217 | 217 | assert(device->type() == GAELCO_SERIAL); |
| 218 | return (gaelco_serial_interface *) downcast< | |
| 218 | return (gaelco_serial_interface *) downcast< | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | INLINE void shmem_lock(shmem_t *shmem) |
| r17612 | r17613 | |
| 520 | 520 | } |
| 521 | 521 | |
| 522 | 522 | |
| 523 | DEFINE_LEGACY_DEVICE(GAELCO_SERIAL, gaelco_serial); | |
| 523 | const device_type GAELCO_SERIAL = &device_creator<gaelco_serial_device>; | |
| 524 | ||
| 525 | gaelco_serial_device::gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 526 | : device_t(mconfig, GAELCO_SERIAL, "gaelco_serial", tag, owner, clock) | |
| 527 | { | |
| 528 | m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_serial_state)); | |
| 529 | } | |
| 530 | ||
| 531 | //------------------------------------------------- | |
| 532 | // device_config_complete - perform any | |
| 533 | // operations now that the configuration is | |
| 534 | // complete | |
| 535 | //------------------------------------------------- | |
| 536 | ||
| 537 | void gaelco_serial_device::device_config_complete() | |
| 538 | { | |
| 539 | } | |
| 540 | ||
| 541 | //------------------------------------------------- | |
| 542 | // device_start - device-specific startup | |
| 543 | //------------------------------------------------- | |
| 544 | ||
| 545 | void gaelco_serial_device::device_start() | |
| 546 | { | |
| 547 | DEVICE_START_NAME( gaelco_serial )(this); | |
| 548 | } | |
| 549 | ||
| 550 | //------------------------------------------------- | |
| 551 | // device_reset - device-specific reset | |
| 552 | //------------------------------------------------- | |
| 553 | ||
| 554 | void gaelco_serial_device::device_reset() | |
| 555 | { | |
| 556 | DEVICE_RESET_NAME( gaelco_serial )(this); | |
| 557 | } | |
| 558 | ||
| 559 | //------------------------------------------------- | |
| 560 | // device_stop - device-specific stop | |
| 561 | //------------------------------------------------- | |
| 562 | ||
| 563 | void gaelco_serial_device::device_stop() | |
| 564 | { | |
| 565 | DEVICE_STOP_NAME( gaelco_serial )(this); | |
| 566 | } | |
| 567 | ||
| 568 |
| r17612 | r17613 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | /* ----- device interface ----- */ |
| 70 | 70 | |
| 71 | DECLARE_LEGACY_DEVICE(GAELCO_SERIAL, gaelco_serial); | |
| 71 | class gaelco_serial_device : public device_t | |
| 72 | { | |
| 73 | public: | |
| 74 | gaelco_serial_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 75 | ~gaelco_serial_device() { global_free(m_token); } | |
| 72 | 76 | |
| 77 | // access to legacy token | |
| 78 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 79 | protected: | |
| 80 | // device-level overrides | |
| 81 | virtual void device_config_complete(); | |
| 82 | virtual void device_start(); | |
| 83 | virtual void device_stop(); | |
| 84 | virtual void device_reset(); | |
| 85 | private: | |
| 86 | // internal state | |
| 87 | void *m_token; | |
| 88 | }; | |
| 89 | ||
| 90 | extern const device_type GAELCO_SERIAL; | |
| 91 | ||
| 92 | ||
| 73 | 93 | //DEVICE_GET_INFO( gaelco_serial ); |
| r17612 | r17613 | |
|---|---|---|
| 1966 | 1966 | assert(device != NULL); |
| 1967 | 1967 | assert(device->type() == DECOCASS_TAPE); |
| 1968 | 1968 | |
| 1969 | return (tape_state *)downcast< | |
| 1969 | return (tape_state *)downcast<de | |
| 1970 | 1970 | } |
| 1971 | 1971 | |
| 1972 | 1972 | |
| r17612 | r17613 | |
| 2305 | 2305 | } |
| 2306 | 2306 | |
| 2307 | 2307 | |
| 2308 | DEFINE_LEGACY_DEVICE(DECOCASS_TAPE, decocass_tape); | |
| 2308 | const device_type DECOCASS_TAPE = &device_creator<decocass_tape_device>; | |
| 2309 | ||
| 2310 | decocass_tape_device::decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2311 | : device_t(mconfig, DECOCASS_TAPE, "DECO Cassette Tape", tag, owner, clock) | |
| 2312 | { | |
| 2313 | m_token = global_alloc_array_clear(UINT8, sizeof(tape_state)); | |
| 2314 | } | |
| 2315 | ||
| 2316 | //------------------------------------------------- | |
| 2317 | // device_config_complete - perform any | |
| 2318 | // operations now that the configuration is | |
| 2319 | // complete | |
| 2320 | //------------------------------------------------- | |
| 2321 | ||
| 2322 | void decocass_tape_device::device_config_complete() | |
| 2323 | { | |
| 2324 | } | |
| 2325 | ||
| 2326 | //------------------------------------------------- | |
| 2327 | // device_start - device-specific startup | |
| 2328 | //------------------------------------------------- | |
| 2329 | ||
| 2330 | void decocass_tape_device::device_start() | |
| 2331 | { | |
| 2332 | DEVICE_START_NAME( decocass_tape )(this); | |
| 2333 | } | |
| 2334 | ||
| 2335 | //------------------------------------------------- | |
| 2336 | // device_reset - device-specific reset | |
| 2337 | //------------------------------------------------- | |
| 2338 | ||
| 2339 | void decocass_tape_device::device_reset() | |
| 2340 | { | |
| 2341 | DEVICE_RESET_NAME( decocass_tape )(this); | |
| 2342 | } | |
| 2343 | ||
| 2344 |
| r17612 | r17613 | |
|---|---|---|
| 8 | 8 | #define LOG(n,x) do { if (LOGLEVEL >= n) logerror x; } while (0) |
| 9 | 9 | |
| 10 | 10 | |
| 11 | DECLARE_LEGACY_DEVICE(DECOCASS_TAPE, decocass_tape); | |
| 11 | class decocass_tape_device : public device_t | |
| 12 | { | |
| 13 | public: | |
| 14 | decocass_tape_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~decocass_tape_device() { global_free(m_token); } | |
| 12 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | virtual void device_reset(); | |
| 24 | private: | |
| 25 | // internal state | |
| 26 | void *m_token; | |
| 27 | }; | |
| 28 | ||
| 29 | extern const device_type DECOCASS_TAPE; | |
| 30 | ||
| 31 | ||
| 13 | 32 | #define MCFG_DECOCASS_TAPE_ADD(_tag) \ |
| 14 | 33 | MCFG_DEVICE_ADD(_tag, DECOCASS_TAPE, 0) |
| 15 | 34 |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | assert(device != NULL); |
| 28 | 28 | assert(device->type() == BUGGYCHL_MCU); |
| 29 | 29 | |
| 30 | return (buggychl_mcu_state *)downcast< | |
| 30 | return (buggychl_mcu_state *)downcast<bugg | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /*************************************************************************** |
| r17612 | r17613 | |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | DEFINE_LEGACY_DEVICE(BUGGYCHL_MCU, buggychl_mcu); | |
| 257 | const device_type BUGGYCHL_MCU = &device_creator<buggychl_mcu_device>; | |
| 258 | ||
| 259 | buggychl_mcu_device::buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 260 | : device_t(mconfig, BUGGYCHL_MCU, "BuggyChl MCU", tag, owner, clock) | |
| 261 | { | |
| 262 | m_token = global_alloc_array_clear(UINT8, sizeof(buggychl_mcu_state)); | |
| 263 | } | |
| 264 | ||
| 265 | //------------------------------------------------- | |
| 266 | // device_config_complete - perform any | |
| 267 | // operations now that the configuration is | |
| 268 | // complete | |
| 269 | //------------------------------------------------- | |
| 270 | ||
| 271 | void buggychl_mcu_device::device_config_complete() | |
| 272 | { | |
| 273 | } | |
| 274 | ||
| 275 | //------------------------------------------------- | |
| 276 | // device_start - device-specific startup | |
| 277 | //------------------------------------------------- | |
| 278 | ||
| 279 | void buggychl_mcu_device::device_start() | |
| 280 | { | |
| 281 | DEVICE_START_NAME( buggychl_mcu )(this); | |
| 282 | } | |
| 283 | ||
| 284 | //------------------------------------------------- | |
| 285 | // device_reset - device-specific reset | |
| 286 | //------------------------------------------------- | |
| 287 | ||
| 288 | void buggychl_mcu_device::device_reset() | |
| 289 | { | |
| 290 | DEVICE_RESET_NAME( buggychl_mcu )(this); | |
| 291 | } | |
| 292 | ||
| 293 |
| r17612 | r17613 | |
|---|---|---|
| 76 | 76 | assert(device != NULL); |
| 77 | 77 | assert(device->type() == NAMCO_53XX); |
| 78 | 78 | |
| 79 | return (namco_53xx_state *)downcast< | |
| 79 | return (namco_53xx_state *)downcast<n | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| r17612 | r17613 | |
| 214 | 214 | } |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | DEFINE_LEGACY_DEVICE(NAMCO_53XX, namco_53xx); | |
| 217 | const device_type NAMCO_53XX = &device_creator<namco_53xx_device>; | |
| 218 | ||
| 219 | namco_53xx_device::namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 220 | : device_t(mconfig, NAMCO_53XX, "Namco 53xx", tag, owner, clock) | |
| 221 | { | |
| 222 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_53xx_state)); | |
| 223 | } | |
| 224 | ||
| 225 | //------------------------------------------------- | |
| 226 | // device_config_complete - perform any | |
| 227 | // operations now that the configuration is | |
| 228 | // complete | |
| 229 | //------------------------------------------------- | |
| 230 | ||
| 231 | void namco_53xx_device::device_config_complete() | |
| 232 | { | |
| 233 | m_shortname = "namco53"; | |
| 234 | } | |
| 235 | ||
| 236 | //------------------------------------------------- | |
| 237 | // device_start - device-specific startup | |
| 238 | //------------------------------------------------- | |
| 239 | ||
| 240 | void namco_53xx_device::device_start() | |
| 241 | { | |
| 242 | DEVICE_START_NAME( namco_53xx )(this); | |
| 243 | } | |
| 244 | ||
| 245 | //------------------------------------------------- | |
| 246 | // device_mconfig_additions - return a pointer to | |
| 247 | // the device's machine fragment | |
| 248 | //------------------------------------------------- | |
| 249 | ||
| 250 | machine_config_constructor namco_53xx_device::device_mconfig_additions() const | |
| 251 | { | |
| 252 | return MACHINE_CONFIG_NAME( namco_53xx ); | |
| 253 | } | |
| 254 | ||
| 255 | //------------------------------------------------- | |
| 256 | // device_rom_region - return a pointer to the | |
| 257 | // the device's ROM definitions | |
| 258 | //------------------------------------------------- | |
| 259 | ||
| 260 | const rom_entry *namco_53xx_device::device_rom_region() const | |
| 261 | { | |
| 262 | return ROM_NAME(namco_53xx ); | |
| 263 | } | |
| 264 | ||
| 265 |
| r17612 | r17613 | |
|---|---|---|
| 4 | 4 | READ8_DEVICE_HANDLER( buggychl_mcu_r ); |
| 5 | 5 | READ8_DEVICE_HANDLER( buggychl_mcu_status_r ); |
| 6 | 6 | |
| 7 | DECLARE_LEGACY_DEVICE(BUGGYCHL_MCU, buggychl_mcu); | |
| 7 | class buggychl_mcu_device : public device_t | |
| 8 | { | |
| 9 | public: | |
| 10 | buggychl_mcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 11 | ~buggychl_mcu_device() { global_free(m_token); } | |
| 12 | ||
| 13 | // access to legacy token | |
| 14 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 15 | protected: | |
| 16 | // device-level overrides | |
| 17 | virtual void device_config_complete(); | |
| 18 | virtual void device_start(); | |
| 19 | virtual void device_reset(); | |
| 20 | private: | |
| 21 | // internal state | |
| 22 | void *m_token; | |
| 23 | }; | |
| 24 | ||
| 25 | extern const device_type BUGGYCHL_MCU; | |
| 26 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | READ8_DEVICE_HANDLER( namco_53xx_read ); |
| 23 | 23 | |
| 24 | 24 | |
| 25 | DECLARE_LEGACY_DEVICE(NAMCO_53XX, namco_53xx); | |
| 25 | class namco_53xx_device : public device_t | |
| 26 | { | |
| 27 | public: | |
| 28 | namco_53xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 29 | ~namco_53xx_device() { global_free(m_token); } | |
| 26 | 30 | |
| 31 | // access to legacy token | |
| 32 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 33 | protected: | |
| 34 | // device-level overrides | |
| 35 | virtual void device_config_complete(); | |
| 36 | virtual void device_start(); | |
| 37 | virtual const rom_entry *device_rom_region() const; | |
| 38 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 39 | private: | |
| 40 | // internal state | |
| 41 | void *m_token; | |
| 42 | }; | |
| 27 | 43 | |
| 44 | extern const device_type NAMCO_53XX; | |
| 45 | ||
| 46 | ||
| 47 | ||
| 28 | 48 | #endif /* NAMCO53_H */ |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | assert(device != NULL); |
| 30 | 30 | assert(device->type() == NAMCO_62XX); |
| 31 | 31 | |
| 32 | return (namco_62xx_state *)downcast< | |
| 32 | return (namco_62xx_state *)downcast<n | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| r17612 | r17613 | |
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | DEFINE_LEGACY_DEVICE(NAMCO_62XX, namco_62xx); | |
| 110 | const device_type NAMCO_62XX = &device_creator<namco_62xx_device>; | |
| 111 | ||
| 112 | namco_62xx_device::namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 113 | : device_t(mconfig, NAMCO_62XX, "Namco 62xx", tag, owner, clock) | |
| 114 | { | |
| 115 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_62xx_state)); | |
| 116 | } | |
| 117 | ||
| 118 | //------------------------------------------------- | |
| 119 | // device_config_complete - perform any | |
| 120 | // operations now that the configuration is | |
| 121 | // complete | |
| 122 | //------------------------------------------------- | |
| 123 | ||
| 124 | void namco_62xx_device::device_config_complete() | |
| 125 | { | |
| 126 | m_shortname = "namco62"; | |
| 127 | } | |
| 128 | ||
| 129 | //------------------------------------------------- | |
| 130 | // device_start - device-specific startup | |
| 131 | //------------------------------------------------- | |
| 132 | ||
| 133 | void namco_62xx_device::device_start() | |
| 134 | { | |
| 135 | DEVICE_START_NAME( namco_62xx )(this); | |
| 136 | } | |
| 137 | ||
| 138 | //------------------------------------------------- | |
| 139 | // device_mconfig_additions - return a pointer to | |
| 140 | // the device's machine fragment | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | machine_config_constructor namco_62xx_device::device_mconfig_additions() const | |
| 144 | { | |
| 145 | return MACHINE_CONFIG_NAME( namco_62xx ); | |
| 146 | } | |
| 147 | ||
| 148 | //------------------------------------------------- | |
| 149 | // device_rom_region - return a pointer to the | |
| 150 | // the device's ROM definitions | |
| 151 | //------------------------------------------------- | |
| 152 | ||
| 153 | const rom_entry *namco_62xx_device::device_rom_region() const | |
| 154 | { | |
| 155 | return ROM_NAME(namco_62xx ); | |
| 156 | } | |
| 157 | ||
| 158 |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | WRITE8_DEVICE_HANDLER( namco_62xx_write ); |
| 22 | 22 | |
| 23 | 23 | |
| 24 | DECLARE_LEGACY_DEVICE(NAMCO_62XX, namco_62xx); | |
| 24 | class namco_62xx_device : public device_t | |
| 25 | { | |
| 26 | public: | |
| 27 | namco_62xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 28 | ~namco_62xx_device() { global_free(m_token); } | |
| 25 | 29 | |
| 30 | // access to legacy token | |
| 31 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 32 | protected: | |
| 33 | // device-level overrides | |
| 34 | virtual void device_config_complete(); | |
| 35 | virtual void device_start(); | |
| 36 | virtual const rom_entry *device_rom_region() const; | |
| 37 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | void *m_token; | |
| 41 | }; | |
| 26 | 42 | |
| 43 | extern const device_type NAMCO_62XX; | |
| 44 | ||
| 45 | ||
| 46 | ||
| 27 | 47 | #endif /* NAMCO62_H */ |
| r17612 | r17613 | |
|---|---|---|
| 55 | 55 | { |
| 56 | 56 | assert(device != NULL); |
| 57 | 57 | assert(device->type() == MATHBOX); |
| 58 | return (mathbox_state *)downcast< | |
| 58 | return (mathbox_state *)downcast<m | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| r17612 | r17613 | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | |
| 363 | DEFINE_LEGACY_DEVICE(MATHBOX, mathbox); | |
| 363 | const device_type MATHBOX = &device_creator<mathbox_device>; | |
| 364 | ||
| 365 | mathbox_device::mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 366 | : device_t(mconfig, MATHBOX, "MATHBOX", tag, owner, clock) | |
| 367 | { | |
| 368 | m_token = global_alloc_array_clear(UINT8, sizeof(mathbox_state)); | |
| 369 | } | |
| 370 | ||
| 371 | //------------------------------------------------- | |
| 372 | // device_config_complete - perform any | |
| 373 | // operations now that the configuration is | |
| 374 | // complete | |
| 375 | //------------------------------------------------- | |
| 376 | ||
| 377 | void mathbox_device::device_config_complete() | |
| 378 | { | |
| 379 | } | |
| 380 | ||
| 381 | //------------------------------------------------- | |
| 382 | // device_start - device-specific startup | |
| 383 | //------------------------------------------------- | |
| 384 | ||
| 385 | void mathbox_device::device_start() | |
| 386 | { | |
| 387 | DEVICE_START_NAME( mathbox )(this); | |
| 388 | } | |
| 389 | ||
| 390 | //------------------------------------------------- | |
| 391 | // device_reset - device-specific reset | |
| 392 | //------------------------------------------------- | |
| 393 | ||
| 394 | void mathbox_device::device_reset() | |
| 395 | { | |
| 396 | DEVICE_RESET_NAME( mathbox )(this); | |
| 397 | } | |
| 398 | ||
| 399 |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | READ8_DEVICE_HANDLER( mathbox_hi_r ); |
| 27 | 27 | |
| 28 | 28 | /* ----- device interface ----- */ |
| 29 | DECLARE_LEGACY_DEVICE(MATHBOX, mathbox); | |
| 29 | class mathbox_device : public device_t | |
| 30 | { | |
| 31 | public: | |
| 32 | mathbox_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~mathbox_device() { global_free(m_token); } | |
| 34 | ||
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | virtual void device_reset(); | |
| 42 | private: | |
| 43 | // internal state | |
| 44 | void *m_token; | |
| 45 | }; | |
| 46 | ||
| 47 | extern const device_type MATHBOX; | |
| 48 |
| r17612 | r17613 | |
|---|---|---|
| 37 | 37 | |
| 38 | 38 | WRITE8_DEVICE_HANDLER( redbaron_sounds_w ); |
| 39 | 39 | |
| 40 | DECLARE_LEGACY_SOUND_DEVICE(REDBARON, redbaron_sound); | |
| 40 | class redbaron_sound_device : public device_t, | |
| 41 | public device_sound_interface | |
| 42 | { | |
| 43 | public: | |
| 44 | redbaron_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | ~redbaron_sound_device() { global_free(m_token); } | |
| 46 | ||
| 47 | // access to legacy token | |
| 48 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 49 | protected: | |
| 50 | // device-level overrides | |
| 51 | virtual void device_config_complete(); | |
| 52 | virtual void device_start(); | |
| 53 | ||
| 54 | // sound stream update overrides | |
| 55 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 56 | private: | |
| 57 | // internal state | |
| 58 | void *m_token; | |
| 59 | }; | |
| 60 | ||
| 61 | extern const device_type REDBARON; | |
| 62 |
| r17612 | r17613 | |
|---|---|---|
| 466 | 466 | |
| 467 | 467 | /*----------- defined in audio/amiga.c -----------*/ |
| 468 | 468 | |
| 469 | DECLARE_LEGACY_SOUND_DEVICE(AMIGA, amiga_sound); | |
| 469 | class amiga_sound_device : public device_t, | |
| 470 | public device_sound_interface | |
| 471 | { | |
| 472 | public: | |
| 473 | amiga_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 474 | ~amiga_sound_device() { global_free(m_token); } | |
| 470 | 475 | |
| 476 | // access to legacy token | |
| 477 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 478 | protected: | |
| 479 | // device-level overrides | |
| 480 | virtual void device_config_complete(); | |
| 481 | virtual void device_start(); | |
| 482 | ||
| 483 | // sound stream update overrides | |
| 484 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 485 | private: | |
| 486 | // internal state | |
| 487 | void *m_token; | |
| 488 | }; | |
| 489 | ||
| 490 | extern const device_type AMIGA; | |
| 491 | ||
| 492 | ||
| 471 | 493 | void amiga_audio_update(device_t *device); |
| 472 | 494 | void amiga_audio_data_w(device_t *device, int which, UINT16 data); |
| 473 | 495 |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | /*----------- defined in audio/beezer.c -----------*/ |
| 29 | 29 | |
| 30 | DECLARE_LEGACY_SOUND_DEVICE(BEEZER, beezer_sound); | |
| 30 | class beezer_sound_device : public device_t, | |
| 31 | public device_sound_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | beezer_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | ~beezer_sound_device() { global_free(m_token); } | |
| 31 | 36 | |
| 37 | // access to legacy token | |
| 38 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 39 | protected: | |
| 40 | // device-level overrides | |
| 41 | virtual void device_config_complete(); | |
| 42 | virtual void device_start(); | |
| 43 | virtual void device_reset(); | |
| 44 | ||
| 45 | // sound stream update overrides | |
| 46 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 47 | private: | |
| 48 | // internal state | |
| 49 | void *m_token; | |
| 50 | }; | |
| 51 | ||
| 52 | extern const device_type BEEZER; | |
| 53 | ||
| 54 | ||
| 32 | 55 | READ8_DEVICE_HANDLER( beezer_sh6840_r ); |
| 33 | 56 | WRITE8_DEVICE_HANDLER( beezer_sh6840_w ); |
| 34 | 57 | WRITE8_DEVICE_HANDLER( beezer_sfxctrl_w ); |
| r17612 | r17613 | |
|---|---|---|
| 79 | 79 | |
| 80 | 80 | /*----------- defined in audio/polepos.c -----------*/ |
| 81 | 81 | |
| 82 | DECLARE_LEGACY_SOUND_DEVICE(POLEPOS, polepos_sound); | |
| 82 | class polepos_sound_device : public device_t, | |
| 83 | public device_sound_interface | |
| 84 | { | |
| 85 | public: | |
| 86 | polepos_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 87 | ~polepos_sound_device() { global_free(m_token); } | |
| 83 | 88 | |
| 89 | // access to legacy token | |
| 90 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 91 | protected: | |
| 92 | // device-level overrides | |
| 93 | virtual void device_config_complete(); | |
| 94 | virtual void device_start(); | |
| 95 | virtual void device_reset(); | |
| 96 | ||
| 97 | // sound stream update overrides | |
| 98 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 99 | private: | |
| 100 | // internal state | |
| 101 | void *m_token; | |
| 102 | }; | |
| 103 | ||
| 104 | extern const device_type POLEPOS; | |
| 105 | ||
| 106 | ||
| 84 | 107 | WRITE8_DEVICE_HANDLER( polepos_engine_sound_lsb_w ); |
| 85 | 108 | WRITE8_DEVICE_HANDLER( polepos_engine_sound_msb_w ); |
| 86 | 109 |
| r17612 | r17613 | |
|---|---|---|
| 188 | 188 | |
| 189 | 189 | /*----------- defined in audio/leland.c -----------*/ |
| 190 | 190 | |
| 191 | DECLARE_LEGACY_SOUND_DEVICE(LELAND, leland_sound); | |
| 192 | DECLARE_LEGACY_SOUND_DEVICE(LELAND_80186, leland_80186_sound); | |
| 193 | DECLARE_LEGACY_SOUND_DEVICE(REDLINE_80186, redline_80186_sound); | |
| 191 | class leland_sound_device : public device_t, | |
| 192 | public device_sound_interface | |
| 193 | { | |
| 194 | public: | |
| 195 | leland_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 196 | leland_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 197 | ~leland_sound_device() { global_free(m_token); } | |
| 194 | 198 | |
| 199 | // access to legacy token | |
| 200 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 201 | protected: | |
| 202 | // device-level overrides | |
| 203 | virtual void device_config_complete(); | |
| 204 | virtual void device_start(); | |
| 205 | ||
| 206 | // sound stream update overrides | |
| 207 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 208 | private: | |
| 209 | // internal state | |
| 210 | void *m_token; | |
| 211 | }; | |
| 212 | ||
| 213 | extern const device_type LELAND; | |
| 214 | ||
| 215 | class leland_80186_sound_device : public leland_sound_device | |
| 216 | { | |
| 217 | public: | |
| 218 | leland_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 219 | leland_80186_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 220 | protected: | |
| 221 | // device-level overrides | |
| 222 | virtual void device_config_complete(); | |
| 223 | virtual void device_start(); | |
| 224 | virtual void device_reset(); | |
| 225 | ||
| 226 | // sound stream update overrides | |
| 227 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 228 | private: | |
| 229 | // internal state | |
| 230 | }; | |
| 231 | ||
| 232 | extern const device_type LELAND_80186; | |
| 233 | ||
| 234 | class redline_80186_sound_device : public leland_80186_sound_device | |
| 235 | { | |
| 236 | public: | |
| 237 | redline_80186_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 238 | protected: | |
| 239 | // device-level overrides | |
| 240 | virtual void device_config_complete(); | |
| 241 | virtual void device_start(); | |
| 242 | ||
| 243 | // sound stream update overrides | |
| 244 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 245 | private: | |
| 246 | // internal state | |
| 247 | }; | |
| 248 | ||
| 249 | extern const device_type REDLINE_80186; | |
| 250 | ||
| 251 | ||
| 195 | 252 | void leland_dac_update(device_t *device, int dacnum, UINT8 sample); |
| 196 | 253 | |
| 197 | 254 | READ8_DEVICE_HANDLER( leland_80186_response_r ); |
| r17612 | r17613 | |
|---|---|---|
| 33 | 33 | |
| 34 | 34 | /*----------- defined in audio/tiamc1.c -----------*/ |
| 35 | 35 | |
| 36 | DECLARE_LEGACY_SOUND_DEVICE(TIAMC1, tiamc1_sound); | |
| 36 | class tiamc1_sound_device : public device_t, | |
| 37 | public device_sound_interface | |
| 38 | { | |
| 39 | public: | |
| 40 | tiamc1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 41 | ~tiamc1_sound_device() { global_free(m_token); } | |
| 37 | 42 | |
| 43 | // access to legacy token | |
| 44 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 45 | protected: | |
| 46 | // device-level overrides | |
| 47 | virtual void device_config_complete(); | |
| 48 | virtual void device_start(); | |
| 49 | ||
| 50 | // sound stream update overrides | |
| 51 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 52 | private: | |
| 53 | // internal state | |
| 54 | void *m_token; | |
| 55 | }; | |
| 56 | ||
| 57 | extern const device_type TIAMC1; | |
| 58 | ||
| 59 | ||
| 38 | 60 | WRITE8_DEVICE_HANDLER( tiamc1_timer0_w ); |
| 39 | 61 | WRITE8_DEVICE_HANDLER( tiamc1_timer1_w ); |
| 40 | 62 | WRITE8_DEVICE_HANDLER( tiamc1_timer1_gate_w ); |
| r17612 | r17613 | |
|---|---|---|
| 108 | 108 | |
| 109 | 109 | /*----------- defined in audio/cps3.c -----------*/ |
| 110 | 110 | |
| 111 | DECLARE_LEGACY_SOUND_DEVICE(CPS3, cps3_sound); | |
| 111 | class cps3_sound_device : public device_t, | |
| 112 | public device_sound_interface | |
| 113 | { | |
| 114 | public: | |
| 115 | cps3_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 116 | ~cps3_sound_device() { global_free(m_token); } | |
| 112 | 117 | |
| 118 | // access to legacy token | |
| 119 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 120 | protected: | |
| 121 | // device-level overrides | |
| 122 | virtual void device_config_complete(); | |
| 123 | virtual void device_start(); | |
| 124 | ||
| 125 | // sound stream update overrides | |
| 126 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 127 | private: | |
| 128 | // internal state | |
| 129 | void *m_token; | |
| 130 | }; | |
| 131 | ||
| 132 | extern const device_type CPS3; | |
| 133 | ||
| 134 | ||
| 113 | 135 | WRITE32_DEVICE_HANDLER( cps3_sound_w ); |
| 114 | 136 | READ32_DEVICE_HANDLER( cps3_sound_r ); |
| r17612 | r17613 | |
|---|---|---|
| 54 | 54 | |
| 55 | 55 | WRITE8_DEVICE_HANDLER( geebee_sound_w ); |
| 56 | 56 | |
| 57 | DECLARE_LEGACY_SOUND_DEVICE(GEEBEE, geebee_sound); | |
| 57 | class geebee_sound_device : public device_t, | |
| 58 | public device_sound_interface | |
| 59 | { | |
| 60 | public: | |
| 61 | geebee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 62 | ~geebee_sound_device() { global_free(m_token); } | |
| 58 | 63 | |
| 64 | // access to legacy token | |
| 65 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 66 | protected: | |
| 67 | // device-level overrides | |
| 68 | virtual void device_config_complete(); | |
| 69 | virtual void device_start(); | |
| 59 | 70 | |
| 71 | // sound stream update overrides | |
| 72 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 73 | private: | |
| 74 | // internal state | |
| 75 | void *m_token; | |
| 76 | }; | |
| 77 | ||
| 78 | extern const device_type GEEBEE; | |
| 79 | ||
| 80 | ||
| 81 | ||
| 60 | 82 | /*----------- defined in audio/warpwarp.c -----------*/ |
| 61 | 83 | |
| 62 | 84 | WRITE8_DEVICE_HANDLER( warpwarp_sound_w ); |
| 63 | 85 | WRITE8_DEVICE_HANDLER( warpwarp_music1_w ); |
| 64 | 86 | WRITE8_DEVICE_HANDLER( warpwarp_music2_w ); |
| 65 | 87 | |
| 66 | DECLARE_LEGACY_SOUND_DEVICE(WARPWARP, warpwarp_sound); | |
| 88 | class warpwarp_sound_device : public device_t, | |
| 89 | public device_sound_interface | |
| 90 | { | |
| 91 | public: | |
| 92 | warpwarp_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 93 | ~warpwarp_sound_device() { global_free(m_token); } | |
| 94 | ||
| 95 | // access to legacy token | |
| 96 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 97 | protected: | |
| 98 | // device-level overrides | |
| 99 | virtual void device_config_complete(); | |
| 100 | virtual void device_start(); | |
| 101 | ||
| 102 | // sound stream update overrides | |
| 103 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 104 | private: | |
| 105 | // internal state | |
| 106 | void *m_token; | |
| 107 | }; | |
| 108 | ||
| 109 | extern const device_type WARPWARP; | |
| 110 |
| r17612 | r17613 | |
|---|---|---|
| 58 | 58 | |
| 59 | 59 | WRITE8_DEVICE_HANDLER( gridlee_sound_w ); |
| 60 | 60 | |
| 61 | DECLARE_LEGACY_SOUND_DEVICE(GRIDLEE, gridlee_sound); | |
| 61 | class gridlee_sound_device : public device_t, | |
| 62 | public device_sound_interface | |
| 63 | { | |
| 64 | public: | |
| 65 | gridlee_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 66 | ~gridlee_sound_device() { global_free(m_token); } | |
| 62 | 67 | |
| 68 | // access to legacy token | |
| 69 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 70 | protected: | |
| 71 | // device-level overrides | |
| 72 | virtual void device_config_complete(); | |
| 73 | virtual void device_start(); | |
| 63 | 74 | |
| 75 | // sound stream update overrides | |
| 76 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 77 | private: | |
| 78 | // internal state | |
| 79 | void *m_token; | |
| 80 | }; | |
| 81 | ||
| 82 | extern const device_type GRIDLEE; | |
| 83 | ||
| 84 | ||
| 85 | ||
| 64 | 86 | /*----------- defined in video/gridlee.c -----------*/ |
| 65 | 87 | |
| 66 | 88 | /* video driver data & functions */ |
| r17612 | r17613 | |
|---|---|---|
| 43 | 43 | WRITE8_DEVICE_HANDLER( flower_sound1_w ); |
| 44 | 44 | WRITE8_DEVICE_HANDLER( flower_sound2_w ); |
| 45 | 45 | |
| 46 | DECLARE_LEGACY_SOUND_DEVICE(FLOWER, flower_sound); | |
| 46 | class flower_sound_device : public device_t, | |
| 47 | public device_sound_interface | |
| 48 | { | |
| 49 | public: | |
| 50 | flower_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 51 | ~flower_sound_device() { global_free(m_token); } | |
| 47 | 52 | |
| 53 | // access to legacy token | |
| 54 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 55 | protected: | |
| 56 | // device-level overrides | |
| 57 | virtual void device_config_complete(); | |
| 58 | virtual void device_start(); | |
| 59 | virtual void device_reset(); | |
| 48 | 60 | |
| 61 | // sound stream update overrides | |
| 62 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 63 | private: | |
| 64 | // internal state | |
| 65 | void *m_token; | |
| 66 | }; | |
| 67 | ||
| 68 | extern const device_type FLOWER; | |
| 69 | ||
| 70 | ||
| 71 | ||
| 49 | 72 | /*----------- defined in video/flower.c -----------*/ |
| 50 | 73 | |
| 51 | 74 |
| r17612 | r17613 | |
|---|---|---|
| 70 | 70 | extern WRITE8_HANDLER( fantasy_sound_w ); |
| 71 | 71 | extern WRITE8_HANDLER( fantasy_speech_w ); |
| 72 | 72 | |
| 73 | DECLARE_LEGACY_SOUND_DEVICE(SNK6502, snk6502_sound); | |
| 73 | class snk6502_sound_device : public device_t, | |
| 74 | public device_sound_interface | |
| 75 | { | |
| 76 | public: | |
| 77 | snk6502_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 78 | ~snk6502_sound_device() { global_free(m_token); } | |
| 74 | 79 | |
| 80 | // access to legacy token | |
| 81 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 82 | protected: | |
| 83 | // device-level overrides | |
| 84 | virtual void device_config_complete(); | |
| 85 | virtual void device_start(); | |
| 86 | ||
| 87 | // sound stream update overrides | |
| 88 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 89 | private: | |
| 90 | // internal state | |
| 91 | void *m_token; | |
| 92 | }; | |
| 93 | ||
| 94 | extern const device_type SNK6502; | |
| 95 | ||
| 96 | ||
| 75 | 97 | void snk6502_set_music_clock(running_machine &machine, double clock_time); |
| 76 | 98 | void snk6502_set_music_freq(running_machine &machine, int freq); |
| 77 | 99 | int snk6502_music0_playing(running_machine &machine); |
| r17612 | r17613 | |
|---|---|---|
| 178 | 178 | WRITE8_DEVICE_HANDLER( bb_ym2_a_w ); |
| 179 | 179 | WRITE8_DEVICE_HANDLER( bb_ym2_b_w ); |
| 180 | 180 | |
| 181 | DECLARE_LEGACY_SOUND_DEVICE(BUGGYBOY, buggyboy_sound); | |
| 181 | class buggyboy_sound_device : public device_t, | |
| 182 | public device_sound_interface | |
| 183 | { | |
| 184 | public: | |
| 185 | buggyboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 186 | ~buggyboy_sound_device() { global_free(m_token); } | |
| 182 | 187 | |
| 188 | // access to legacy token | |
| 189 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 190 | protected: | |
| 191 | // device-level overrides | |
| 192 | virtual void device_config_complete(); | |
| 193 | virtual void device_start(); | |
| 194 | virtual void device_reset(); | |
| 195 | ||
| 196 | // sound stream update overrides | |
| 197 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 198 | private: | |
| 199 | // internal state | |
| 200 | void *m_token; | |
| 201 | }; | |
| 202 | ||
| 203 | extern const device_type BUGGYBOY; | |
| 204 | ||
| 205 | ||
| 183 | 206 | WRITE8_DEVICE_HANDLER( tx1_ay8910_a_w ); |
| 184 | 207 | WRITE8_DEVICE_HANDLER( tx1_ay8910_b_w ); |
| 185 | 208 | |
| 186 | DECLARE_LEGACY_SOUND_DEVICE(TX1, tx1_sound); | |
| 209 | class tx1_sound_device : public device_t, | |
| 210 | public device_sound_interface | |
| 211 | { | |
| 212 | public: | |
| 213 | tx1_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 214 | ~tx1_sound_device() { global_free(m_token); } | |
| 187 | 215 | |
| 216 | // access to legacy token | |
| 217 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 218 | protected: | |
| 219 | // device-level overrides | |
| 220 | virtual void device_config_complete(); | |
| 221 | virtual void device_start(); | |
| 222 | virtual void device_reset(); | |
| 188 | 223 | |
| 224 | // sound stream update overrides | |
| 225 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 226 | private: | |
| 227 | // internal state | |
| 228 | void *m_token; | |
| 229 | }; | |
| 230 | ||
| 231 | extern const device_type TX1; | |
| 232 | ||
| 233 | ||
| 234 | ||
| 189 | 235 | /*----------- defined in video/tx1.c -----------*/ |
| 190 | 236 | |
| 191 | 237 | PALETTE_INIT( tx1 ); |
| r17612 | r17613 | |
|---|---|---|
| 46 | 46 | READ32_DEVICE_HANDLER( amiga_akiko32_r ); |
| 47 | 47 | WRITE32_DEVICE_HANDLER( amiga_akiko32_w ); |
| 48 | 48 | |
| 49 | DECLARE_LEGACY_DEVICE(AKIKO, akiko); | |
| 49 | class akiko_device : public device_t | |
| 50 | { | |
| 51 | public: | |
| 52 | akiko_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | ~akiko_device() { global_free(m_token); } | |
| 50 | 54 | |
| 55 | // access to legacy token | |
| 56 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 57 | protected: | |
| 58 | // device-level overrides | |
| 59 | virtual void device_config_complete(); | |
| 60 | virtual void device_start(); | |
| 61 | virtual void device_stop(); | |
| 62 | virtual void device_reset(); | |
| 63 | private: | |
| 64 | // internal state | |
| 65 | void *m_token; | |
| 66 | }; | |
| 67 | ||
| 68 | extern const device_type AKIKO; | |
| 69 | ||
| 70 | ||
| 51 | 71 | #endif /* __CUBOCD32_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 135 | 135 | |
| 136 | 136 | void micro3d_noise_sh_w(running_machine &machine, UINT8 data); |
| 137 | 137 | |
| 138 | DECLARE_LEGACY_SOUND_DEVICE(MICRO3D, micro3d_sound); | |
| 138 | class micro3d_sound_device : public device_t, | |
| 139 | public device_sound_interface | |
| 140 | { | |
| 141 | public: | |
| 142 | micro3d_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 143 | ~micro3d_sound_device() { global_free(m_token); } | |
| 139 | 144 | |
| 145 | // access to legacy token | |
| 146 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 147 | protected: | |
| 148 | // device-level overrides | |
| 149 | virtual void device_config_complete(); | |
| 150 | virtual void device_start(); | |
| 151 | virtual void device_reset(); | |
| 140 | 152 | |
| 153 | // sound stream update overrides | |
| 154 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 155 | private: | |
| 156 | // internal state | |
| 157 | void *m_token; | |
| 158 | }; | |
| 159 | ||
| 160 | extern const device_type MICRO3D; | |
| 161 | ||
| 162 | ||
| 163 | ||
| 141 | 164 | /*----------- defined in video/micro3d.c -----------*/ |
| 142 | 165 | |
| 143 | 166 | VIDEO_START( micro3d ); |
| r17612 | r17613 | |
|---|---|---|
| 51 | 51 | WRITE8_DEVICE_HANDLER( phoenix_sound_control_a_w ); |
| 52 | 52 | WRITE8_DEVICE_HANDLER( phoenix_sound_control_b_w ); |
| 53 | 53 | |
| 54 | DECLARE_LEGACY_SOUND_DEVICE(PHOENIX, phoenix_sound); | |
| 54 | class phoenix_sound_device : public device_t, | |
| 55 | public device_sound_interface | |
| 56 | { | |
| 57 | public: | |
| 58 | phoenix_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 59 | ~phoenix_sound_device() { global_free(m_token); } | |
| 55 | 60 | |
| 61 | // access to legacy token | |
| 62 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 63 | protected: | |
| 64 | // device-level overrides | |
| 65 | virtual void device_config_complete(); | |
| 66 | virtual void device_start(); | |
| 56 | 67 | |
| 68 | // sound stream update overrides | |
| 69 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 70 | private: | |
| 71 | // internal state | |
| 72 | void *m_token; | |
| 73 | }; | |
| 74 | ||
| 75 | extern const device_type PHOENIX; | |
| 76 | ||
| 77 | ||
| 78 | ||
| 57 | 79 | /*----------- defined in video/phoenix.c -----------*/ |
| 58 | 80 | |
| 59 | 81 | PALETTE_INIT( phoenix ); |
| r17612 | r17613 | |
|---|---|---|
| 30 | 30 | WRITE8_DEVICE_HANDLER( gomoku_sound1_w ); |
| 31 | 31 | WRITE8_DEVICE_HANDLER( gomoku_sound2_w ); |
| 32 | 32 | |
| 33 | DECLARE_LEGACY_SOUND_DEVICE(GOMOKU, gomoku_sound); | |
| 33 | class gomoku_sound_device : public device_t, | |
| 34 | public device_sound_interface | |
| 35 | { | |
| 36 | public: | |
| 37 | gomoku_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 38 | ~gomoku_sound_device() { global_free(m_token); } | |
| 34 | 39 | |
| 40 | // access to legacy token | |
| 41 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 42 | protected: | |
| 43 | // device-level overrides | |
| 44 | virtual void device_config_complete(); | |
| 45 | virtual void device_start(); | |
| 35 | 46 | |
| 47 | // sound stream update overrides | |
| 48 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 49 | private: | |
| 50 | // internal state | |
| 51 | void *m_token; | |
| 52 | }; | |
| 53 | ||
| 54 | extern const device_type GOMOKU; | |
| 55 | ||
| 56 | ||
| 57 | ||
| 36 | 58 | /*----------- defined in video/gomoku.c -----------*/ |
| 37 | 59 | |
| 38 | 60 | PALETTE_INIT( gomoku ); |
| r17612 | r17613 | |
|---|---|---|
| 572 | 572 | assert(device != NULL); |
| 573 | 573 | assert(device->type() == PC080SN); |
| 574 | 574 | |
| 575 | return (pc080sn_state *)downcast< | |
| 575 | return (pc080sn_state *)downcast<p | |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | INLINE const pc080sn_interface *pc080sn_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1064 | 1064 | assert(device != NULL); |
| 1065 | 1065 | assert(device->type() == PC090OJ); |
| 1066 | 1066 | |
| 1067 | return (pc090oj_state *)downcast< | |
| 1067 | return (pc090oj_state *)downcast<p | |
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 | INLINE const pc090oj_interface *pc090oj_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1272 | 1272 | assert(device != NULL); |
| 1273 | 1273 | assert(device->type() == TC0080VCO); |
| 1274 | 1274 | |
| 1275 | return (tc0080vco_state *)downcast< | |
| 1275 | return (tc0080vco_state *)downcast<t | |
| 1276 | 1276 | } |
| 1277 | 1277 | |
| 1278 | 1278 | INLINE const tc0080vco_interface *tc0080vco_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1955 | 1955 | assert(device != NULL); |
| 1956 | 1956 | assert(device->type() == TC0100SCN); |
| 1957 | 1957 | |
| 1958 | return (tc0100scn_state *)downcast< | |
| 1958 | return (tc0100scn_state *)downcast<t | |
| 1959 | 1959 | } |
| 1960 | 1960 | |
| 1961 | 1961 | INLINE const tc0100scn_interface *tc0100scn_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2559 | 2559 | assert(device != NULL); |
| 2560 | 2560 | assert((device->type() == TC0280GRD) || (device->type() == TC0430GRW)); |
| 2561 | 2561 | |
| 2562 | return (tc0280grd_state *)downcast< | |
| 2562 | return (tc0280grd_state *)downcast<t | |
| 2563 | 2563 | } |
| 2564 | 2564 | |
| 2565 | 2565 | INLINE const tc0280grd_interface *tc0280grd_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2729 | 2729 | assert(device != NULL); |
| 2730 | 2730 | assert(device->type() == TC0360PRI); |
| 2731 | 2731 | |
| 2732 | return (tc0360pri_state *)downcast< | |
| 2732 | return (tc0360pri_state *)downcast<t | |
| 2733 | 2733 | } |
| 2734 | 2734 | |
| 2735 | 2735 | /***************************************************************************** |
| r17612 | r17613 | |
| 2821 | 2821 | assert(device != NULL); |
| 2822 | 2822 | assert(device->type() == TC0480SCP); |
| 2823 | 2823 | |
| 2824 | return (tc0480scp_state *)downcast< | |
| 2824 | return (tc0480scp_state *)downcast<t | |
| 2825 | 2825 | } |
| 2826 | 2826 | |
| 2827 | 2827 | INLINE const tc0480scp_interface *tc0480scp_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 3762 | 3762 | assert(device != NULL); |
| 3763 | 3763 | assert(device->type() == TC0150ROD); |
| 3764 | 3764 | |
| 3765 | return (tc0150rod_state *)downcast< | |
| 3765 | return (tc0150rod_state *)downcast<t | |
| 3766 | 3766 | } |
| 3767 | 3767 | |
| 3768 | 3768 | INLINE const tc0150rod_interface *tc0150rod_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 4574 | 4574 | assert(device != NULL); |
| 4575 | 4575 | assert(device->type() == TC0110PCR); |
| 4576 | 4576 | |
| 4577 | return (tc0110pcr_state *)downcast< | |
| 4577 | return (tc0110pcr_state *)downcast<t | |
| 4578 | 4578 | } |
| 4579 | 4579 | |
| 4580 | 4580 | INLINE const tc0110pcr_interface *tc0110pcr_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 4805 | 4805 | assert(device != NULL); |
| 4806 | 4806 | assert(device->type() == TC0180VCU); |
| 4807 | 4807 | |
| 4808 | return (tc0180vcu_state *)downcast< | |
| 4808 | return (tc0180vcu_state *)downcast<t | |
| 4809 | 4809 | } |
| 4810 | 4810 | |
| 4811 | 4811 | INLINE const tc0180vcu_interface *tc0180vcu_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 5340 | 5340 | } |
| 5341 | 5341 | |
| 5342 | 5342 | |
| 5343 | DEFINE_LEGACY_DEVICE(PC080SN, pc080sn); | |
| 5344 | DEFINE_LEGACY_DEVICE(PC090OJ, pc090oj); | |
| 5345 | DEFINE_LEGACY_DEVICE(TC0080VCO, tc0080vco); | |
| 5346 | DEFINE_LEGACY_DEVICE(TC0100SCN, tc0100scn); | |
| 5347 | DEFINE_LEGACY_DEVICE(TC0280GRD, tc0280grd); | |
| 5348 | DEFINE_LEGACY_DEVICE(TC0360PRI, tc0360pri); | |
| 5349 | DEFINE_LEGACY_DEVICE(TC0480SCP, tc0480scp); | |
| 5350 | DEFINE_LEGACY_DEVICE(TC0150ROD, tc0150rod); | |
| 5351 | DEFINE_LEGACY_DEVICE(TC0110PCR, tc0110pcr); | |
| 5352 | DEFINE_LEGACY_DEVICE(TC0180VCU, tc0180vcu); | |
| 5343 | const device_type PC080SN = &device_creator<pc080sn_device>; | |
| 5344 | ||
| 5345 | pc080sn_device::pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5346 | : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock) | |
| 5347 | { | |
| 5348 | m_token = global_alloc_array_clear(UINT8, sizeof(pc080sn_state)); | |
| 5349 | } | |
| 5350 | ||
| 5351 | //------------------------------------------------- | |
| 5352 | // device_config_complete - perform any | |
| 5353 | // operations now that the configuration is | |
| 5354 | // complete | |
| 5355 | //------------------------------------------------- | |
| 5356 | ||
| 5357 | void pc080sn_device::device_config_complete() | |
| 5358 | { | |
| 5359 | } | |
| 5360 | ||
| 5361 | //------------------------------------------------- | |
| 5362 | // device_start - device-specific startup | |
| 5363 | //------------------------------------------------- | |
| 5364 | ||
| 5365 | void pc080sn_device::device_start() | |
| 5366 | { | |
| 5367 | DEVICE_START_NAME( pc080sn )(this); | |
| 5368 | } | |
| 5369 | ||
| 5370 | ||
| 5371 | const device_type PC090OJ = &device_creator<pc090oj_device>; | |
| 5372 | ||
| 5373 | pc090oj_device::pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5374 | : device_t(mconfig, PC090OJ, "Taito PC090OJ", tag, owner, clock) | |
| 5375 | { | |
| 5376 | m_token = global_alloc_array_clear(UINT8, sizeof(pc090oj_state)); | |
| 5377 | } | |
| 5378 | ||
| 5379 | //------------------------------------------------- | |
| 5380 | // device_config_complete - perform any | |
| 5381 | // operations now that the configuration is | |
| 5382 | // complete | |
| 5383 | //------------------------------------------------- | |
| 5384 | ||
| 5385 | void pc090oj_device::device_config_complete() | |
| 5386 | { | |
| 5387 | } | |
| 5388 | ||
| 5389 | //------------------------------------------------- | |
| 5390 | // device_start - device-specific startup | |
| 5391 | //------------------------------------------------- | |
| 5392 | ||
| 5393 | void pc090oj_device::device_start() | |
| 5394 | { | |
| 5395 | DEVICE_START_NAME( pc090oj )(this); | |
| 5396 | } | |
| 5397 | ||
| 5398 | //------------------------------------------------- | |
| 5399 | // device_reset - device-specific reset | |
| 5400 | //------------------------------------------------- | |
| 5401 | ||
| 5402 | void pc090oj_device::device_reset() | |
| 5403 | { | |
| 5404 | DEVICE_RESET_NAME( pc090oj )(this); | |
| 5405 | } | |
| 5406 | ||
| 5407 | ||
| 5408 | const device_type TC0080VCO = &device_creator<tc0080vco_device>; | |
| 5409 | ||
| 5410 | tc0080vco_device::tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5411 | : device_t(mconfig, TC0080VCO, "Taito TC0080VCO", tag, owner, clock) | |
| 5412 | { | |
| 5413 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0080vco_state)); | |
| 5414 | } | |
| 5415 | ||
| 5416 | //------------------------------------------------- | |
| 5417 | // device_config_complete - perform any | |
| 5418 | // operations now that the configuration is | |
| 5419 | // complete | |
| 5420 | //------------------------------------------------- | |
| 5421 | ||
| 5422 | void tc0080vco_device::device_config_complete() | |
| 5423 | { | |
| 5424 | } | |
| 5425 | ||
| 5426 | //------------------------------------------------- | |
| 5427 | // device_start - device-specific startup | |
| 5428 | //------------------------------------------------- | |
| 5429 | ||
| 5430 | void tc0080vco_device::device_start() | |
| 5431 | { | |
| 5432 | DEVICE_START_NAME( tc0080vco )(this); | |
| 5433 | } | |
| 5434 | ||
| 5435 | ||
| 5436 | const device_type TC0100SCN = &device_creator<tc0100scn_device>; | |
| 5437 | ||
| 5438 | tc0100scn_device::tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5439 | : device_t(mconfig, TC0100SCN, "Taito TC0100SCN", tag, owner, clock) | |
| 5440 | { | |
| 5441 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0100scn_state)); | |
| 5442 | } | |
| 5443 | ||
| 5444 | //------------------------------------------------- | |
| 5445 | // device_config_complete - perform any | |
| 5446 | // operations now that the configuration is | |
| 5447 | // complete | |
| 5448 | //------------------------------------------------- | |
| 5449 | ||
| 5450 | void tc0100scn_device::device_config_complete() | |
| 5451 | { | |
| 5452 | } | |
| 5453 | ||
| 5454 | //------------------------------------------------- | |
| 5455 | // device_start - device-specific startup | |
| 5456 | //------------------------------------------------- | |
| 5457 | ||
| 5458 | void tc0100scn_device::device_start() | |
| 5459 | { | |
| 5460 | DEVICE_START_NAME( tc0100scn )(this); | |
| 5461 | } | |
| 5462 | ||
| 5463 | //------------------------------------------------- | |
| 5464 | // device_reset - device-specific reset | |
| 5465 | //------------------------------------------------- | |
| 5466 | ||
| 5467 | void tc0100scn_device::device_reset() | |
| 5468 | { | |
| 5469 | DEVICE_RESET_NAME( tc0100scn )(this); | |
| 5470 | } | |
| 5471 | ||
| 5472 | ||
| 5473 | const device_type TC0280GRD = &device_creator<tc0280grd_device>; | |
| 5474 | ||
| 5475 | tc0280grd_device::tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5476 | : device_t(mconfig, TC0280GRD, "Taito TC0280GRD & TC0430GRW", tag, owner, clock) | |
| 5477 | { | |
| 5478 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0280grd_state)); | |
| 5479 | } | |
| 5480 | ||
| 5481 | //------------------------------------------------- | |
| 5482 | // device_config_complete - perform any | |
| 5483 | // operations now that the configuration is | |
| 5484 | // complete | |
| 5485 | //------------------------------------------------- | |
| 5486 | ||
| 5487 | void tc0280grd_device::device_config_complete() | |
| 5488 | { | |
| 5489 | } | |
| 5490 | ||
| 5491 | //------------------------------------------------- | |
| 5492 | // device_start - device-specific startup | |
| 5493 | //------------------------------------------------- | |
| 5494 | ||
| 5495 | void tc0280grd_device::device_start() | |
| 5496 | { | |
| 5497 | DEVICE_START_NAME( tc0280grd )(this); | |
| 5498 | } | |
| 5499 | ||
| 5500 | //------------------------------------------------- | |
| 5501 | // device_reset - device-specific reset | |
| 5502 | //------------------------------------------------- | |
| 5503 | ||
| 5504 | void tc0280grd_device::device_reset() | |
| 5505 | { | |
| 5506 | DEVICE_RESET_NAME( tc0280grd )(this); | |
| 5507 | } | |
| 5508 | ||
| 5509 | ||
| 5510 | const device_type TC0360PRI = &device_creator<tc0360pri_device>; | |
| 5511 | ||
| 5512 | tc0360pri_device::tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5513 | : device_t(mconfig, TC0360PRI, "Taito TC0360PRI", tag, owner, clock) | |
| 5514 | { | |
| 5515 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0360pri_state)); | |
| 5516 | } | |
| 5517 | ||
| 5518 | //------------------------------------------------- | |
| 5519 | // device_config_complete - perform any | |
| 5520 | // operations now that the configuration is | |
| 5521 | // complete | |
| 5522 | //------------------------------------------------- | |
| 5523 | ||
| 5524 | void tc0360pri_device::device_config_complete() | |
| 5525 | { | |
| 5526 | } | |
| 5527 | ||
| 5528 | //------------------------------------------------- | |
| 5529 | // device_start - device-specific startup | |
| 5530 | //------------------------------------------------- | |
| 5531 | ||
| 5532 | void tc0360pri_device::device_start() | |
| 5533 | { | |
| 5534 | DEVICE_START_NAME( tc0360pri )(this); | |
| 5535 | } | |
| 5536 | ||
| 5537 | //------------------------------------------------- | |
| 5538 | // device_reset - device-specific reset | |
| 5539 | //------------------------------------------------- | |
| 5540 | ||
| 5541 | void tc0360pri_device::device_reset() | |
| 5542 | { | |
| 5543 | DEVICE_RESET_NAME( tc0360pri )(this); | |
| 5544 | } | |
| 5545 | ||
| 5546 | ||
| 5547 | const device_type TC0480SCP = &device_creator<tc0480scp_device>; | |
| 5548 | ||
| 5549 | tc0480scp_device::tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5550 | : device_t(mconfig, TC0480SCP, "Taito TC0480SCP", tag, owner, clock) | |
| 5551 | { | |
| 5552 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0480scp_state)); | |
| 5553 | } | |
| 5554 | ||
| 5555 | //------------------------------------------------- | |
| 5556 | // device_config_complete - perform any | |
| 5557 | // operations now that the configuration is | |
| 5558 | // complete | |
| 5559 | //------------------------------------------------- | |
| 5560 | ||
| 5561 | void tc0480scp_device::device_config_complete() | |
| 5562 | { | |
| 5563 | } | |
| 5564 | ||
| 5565 | //------------------------------------------------- | |
| 5566 | // device_start - device-specific startup | |
| 5567 | //------------------------------------------------- | |
| 5568 | ||
| 5569 | void tc0480scp_device::device_start() | |
| 5570 | { | |
| 5571 | DEVICE_START_NAME( tc0480scp )(this); | |
| 5572 | } | |
| 5573 | ||
| 5574 | //------------------------------------------------- | |
| 5575 | // device_reset - device-specific reset | |
| 5576 | //------------------------------------------------- | |
| 5577 | ||
| 5578 | void tc0480scp_device::device_reset() | |
| 5579 | { | |
| 5580 | DEVICE_RESET_NAME( tc0480scp )(this); | |
| 5581 | } | |
| 5582 | ||
| 5583 | ||
| 5584 | const device_type TC0150ROD = &device_creator<tc0150rod_device>; | |
| 5585 | ||
| 5586 | tc0150rod_device::tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5587 | : device_t(mconfig, TC0150ROD, "Taito TC0150ROD", tag, owner, clock) | |
| 5588 | { | |
| 5589 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0150rod_state)); | |
| 5590 | } | |
| 5591 | ||
| 5592 | //------------------------------------------------- | |
| 5593 | // device_config_complete - perform any | |
| 5594 | // operations now that the configuration is | |
| 5595 | // complete | |
| 5596 | //------------------------------------------------- | |
| 5597 | ||
| 5598 | void tc0150rod_device::device_config_complete() | |
| 5599 | { | |
| 5600 | } | |
| 5601 | ||
| 5602 | //------------------------------------------------- | |
| 5603 | // device_start - device-specific startup | |
| 5604 | //------------------------------------------------- | |
| 5605 | ||
| 5606 | void tc0150rod_device::device_start() | |
| 5607 | { | |
| 5608 | DEVICE_START_NAME( tc0150rod )(this); | |
| 5609 | } | |
| 5610 | ||
| 5611 | ||
| 5612 | const device_type TC0110PCR = &device_creator<tc0110pcr_device>; | |
| 5613 | ||
| 5614 | tc0110pcr_device::tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5615 | : device_t(mconfig, TC0110PCR, "Taito TC0110PCR", tag, owner, clock) | |
| 5616 | { | |
| 5617 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0110pcr_state)); | |
| 5618 | } | |
| 5619 | ||
| 5620 | //------------------------------------------------- | |
| 5621 | // device_config_complete - perform any | |
| 5622 | // operations now that the configuration is | |
| 5623 | // complete | |
| 5624 | //------------------------------------------------- | |
| 5625 | ||
| 5626 | void tc0110pcr_device::device_config_complete() | |
| 5627 | { | |
| 5628 | } | |
| 5629 | ||
| 5630 | //------------------------------------------------- | |
| 5631 | // device_start - device-specific startup | |
| 5632 | //------------------------------------------------- | |
| 5633 | ||
| 5634 | void tc0110pcr_device::device_start() | |
| 5635 | { | |
| 5636 | DEVICE_START_NAME( tc0110pcr )(this); | |
| 5637 | } | |
| 5638 | ||
| 5639 | //------------------------------------------------- | |
| 5640 | // device_reset - device-specific reset | |
| 5641 | //------------------------------------------------- | |
| 5642 | ||
| 5643 | void tc0110pcr_device::device_reset() | |
| 5644 | { | |
| 5645 | DEVICE_RESET_NAME( tc0110pcr )(this); | |
| 5646 | } | |
| 5647 | ||
| 5648 | ||
| 5649 | const device_type TC0180VCU = &device_creator<tc0180vcu_device>; | |
| 5650 | ||
| 5651 | tc0180vcu_device::tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5652 | : device_t(mconfig, TC0180VCU, "Taito TC0180VCU", tag, owner, clock) | |
| 5653 | { | |
| 5654 | m_token = global_alloc_array_clear(UINT8, sizeof(tc0180vcu_state)); | |
| 5655 | } | |
| 5656 | ||
| 5657 | //------------------------------------------------- | |
| 5658 | // device_config_complete - perform any | |
| 5659 | // operations now that the configuration is | |
| 5660 | // complete | |
| 5661 | //------------------------------------------------- | |
| 5662 | ||
| 5663 | void tc0180vcu_device::device_config_complete() | |
| 5664 | { | |
| 5665 | } | |
| 5666 | ||
| 5667 | //------------------------------------------------- | |
| 5668 | // device_start - device-specific startup | |
| 5669 | //------------------------------------------------- | |
| 5670 | ||
| 5671 | void tc0180vcu_device::device_start() | |
| 5672 | { | |
| 5673 | DEVICE_START_NAME( tc0180vcu )(this); | |
| 5674 | } | |
| 5675 | ||
| 5676 | //------------------------------------------------- | |
| 5677 | // device_reset - device-specific reset | |
| 5678 | //------------------------------------------------- | |
| 5679 | ||
| 5680 | void tc0180vcu_device::device_reset() | |
| 5681 | { | |
| 5682 | DEVICE_RESET_NAME( tc0180vcu )(this); | |
| 5683 | } | |
| 5684 | ||
| 5685 |
| r17612 | r17613 | |
|---|---|---|
| 106 | 106 | int tx_color_base; |
| 107 | 107 | }; |
| 108 | 108 | |
| 109 | DECLARE_LEGACY_DEVICE(PC080SN, pc080sn); | |
| 110 | DECLARE_LEGACY_DEVICE(PC090OJ, pc090oj); | |
| 111 | DECLARE_LEGACY_DEVICE(TC0080VCO, tc0080vco); | |
| 112 | DECLARE_LEGACY_DEVICE(TC0100SCN, tc0100scn); | |
| 113 | DECLARE_LEGACY_DEVICE(TC0280GRD, tc0280grd); | |
| 109 | class pc080sn_device : public device_t | |
| 110 | { | |
| 111 | public: | |
| 112 | pc080sn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 113 | ~pc080sn_device() { global_free(m_token); } | |
| 114 | ||
| 115 | // access to legacy token | |
| 116 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 117 | protected: | |
| 118 | // device-level overrides | |
| 119 | virtual void device_config_complete(); | |
| 120 | virtual void device_start(); | |
| 121 | private: | |
| 122 | // internal state | |
| 123 | void *m_token; | |
| 124 | }; | |
| 125 | ||
| 126 | extern const device_type PC080SN; | |
| 127 | ||
| 128 | class pc090oj_device : public device_t | |
| 129 | { | |
| 130 | public: | |
| 131 | pc090oj_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 132 | ~pc090oj_device() { global_free(m_token); } | |
| 133 | ||
| 134 | // access to legacy token | |
| 135 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 136 | protected: | |
| 137 | // device-level overrides | |
| 138 | virtual void device_config_complete(); | |
| 139 | virtual void device_start(); | |
| 140 | virtual void device_reset(); | |
| 141 | private: | |
| 142 | // internal state | |
| 143 | void *m_token; | |
| 144 | }; | |
| 145 | ||
| 146 | extern const device_type PC090OJ; | |
| 147 | ||
| 148 | class tc0080vco_device : public device_t | |
| 149 | { | |
| 150 | public: | |
| 151 | tc0080vco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 152 | ~tc0080vco_device() { global_free(m_token); } | |
| 153 | ||
| 154 | // access to legacy token | |
| 155 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 156 | protected: | |
| 157 | // device-level overrides | |
| 158 | virtual void device_config_complete(); | |
| 159 | virtual void device_start(); | |
| 160 | private: | |
| 161 | // internal state | |
| 162 | void *m_token; | |
| 163 | }; | |
| 164 | ||
| 165 | extern const device_type TC0080VCO; | |
| 166 | ||
| 167 | class tc0100scn_device : public device_t | |
| 168 | { | |
| 169 | public: | |
| 170 | tc0100scn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 171 | ~tc0100scn_device() { global_free(m_token); } | |
| 172 | ||
| 173 | // access to legacy token | |
| 174 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 175 | protected: | |
| 176 | // device-level overrides | |
| 177 | virtual void device_config_complete(); | |
| 178 | virtual void device_start(); | |
| 179 | virtual void device_reset(); | |
| 180 | private: | |
| 181 | // internal state | |
| 182 | void *m_token; | |
| 183 | }; | |
| 184 | ||
| 185 | extern const device_type TC0100SCN; | |
| 186 | ||
| 187 | class tc0280grd_device : public device_t | |
| 188 | { | |
| 189 | public: | |
| 190 | tc0280grd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 191 | ~tc0280grd_device() { global_free(m_token); } | |
| 192 | ||
| 193 | // access to legacy token | |
| 194 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 195 | protected: | |
| 196 | // device-level overrides | |
| 197 | virtual void device_config_complete(); | |
| 198 | virtual void device_start(); | |
| 199 | virtual void device_reset(); | |
| 200 | private: | |
| 201 | // internal state | |
| 202 | void *m_token; | |
| 203 | }; | |
| 204 | ||
| 205 | extern const device_type TC0280GRD; | |
| 206 | ||
| 114 | 207 | #define TC0430GRW TC0280GRD |
| 115 | DECLARE_LEGACY_DEVICE(TC0360PRI, tc0360pri); | |
| 116 | DECLARE_LEGACY_DEVICE(TC0480SCP, tc0480scp); | |
| 117 | DECLARE_LEGACY_DEVICE(TC0150ROD, tc0150rod); | |
| 118 | DECLARE_LEGACY_DEVICE(TC0110PCR, tc0110pcr); | |
| 119 | DECLARE_LEGACY_DEVICE(TC0180VCU, tc0180vcu); | |
| 208 | class tc0360pri_device : public device_t | |
| 209 | { | |
| 210 | public: | |
| 211 | tc0360pri_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 212 | ~tc0360pri_device() { global_free(m_token); } | |
| 120 | 213 | |
| 214 | // access to legacy token | |
| 215 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 216 | protected: | |
| 217 | // device-level overrides | |
| 218 | virtual void device_config_complete(); | |
| 219 | virtual void device_start(); | |
| 220 | virtual void device_reset(); | |
| 221 | private: | |
| 222 | // internal state | |
| 223 | void *m_token; | |
| 224 | }; | |
| 225 | ||
| 226 | extern const device_type TC0360PRI; | |
| 227 | ||
| 228 | class tc0480scp_device : public device_t | |
| 229 | { | |
| 230 | public: | |
| 231 | tc0480scp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 232 | ~tc0480scp_device() { global_free(m_token); } | |
| 233 | ||
| 234 | // access to legacy token | |
| 235 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 236 | protected: | |
| 237 | // device-level overrides | |
| 238 | virtual void device_config_complete(); | |
| 239 | virtual void device_start(); | |
| 240 | virtual void device_reset(); | |
| 241 | private: | |
| 242 | // internal state | |
| 243 | void *m_token; | |
| 244 | }; | |
| 245 | ||
| 246 | extern const device_type TC0480SCP; | |
| 247 | ||
| 248 | class tc0150rod_device : public device_t | |
| 249 | { | |
| 250 | public: | |
| 251 | tc0150rod_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 252 | ~tc0150rod_device() { global_free(m_token); } | |
| 253 | ||
| 254 | // access to legacy token | |
| 255 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 256 | protected: | |
| 257 | // device-level overrides | |
| 258 | virtual void device_config_complete(); | |
| 259 | virtual void device_start(); | |
| 260 | private: | |
| 261 | // internal state | |
| 262 | void *m_token; | |
| 263 | }; | |
| 264 | ||
| 265 | extern const device_type TC0150ROD; | |
| 266 | ||
| 267 | class tc0110pcr_device : public device_t | |
| 268 | { | |
| 269 | public: | |
| 270 | tc0110pcr_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 271 | ~tc0110pcr_device() { global_free(m_token); } | |
| 272 | ||
| 273 | // access to legacy token | |
| 274 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 275 | protected: | |
| 276 | // device-level overrides | |
| 277 | virtual void device_config_complete(); | |
| 278 | virtual void device_start(); | |
| 279 | virtual void device_reset(); | |
| 280 | private: | |
| 281 | // internal state | |
| 282 | void *m_token; | |
| 283 | }; | |
| 284 | ||
| 285 | extern const device_type TC0110PCR; | |
| 286 | ||
| 287 | class tc0180vcu_device : public device_t | |
| 288 | { | |
| 289 | public: | |
| 290 | tc0180vcu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 291 | ~tc0180vcu_device() { global_free(m_token); } | |
| 292 | ||
| 293 | // access to legacy token | |
| 294 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 295 | protected: | |
| 296 | // device-level overrides | |
| 297 | virtual void device_config_complete(); | |
| 298 | virtual void device_start(); | |
| 299 | virtual void device_reset(); | |
| 300 | private: | |
| 301 | // internal state | |
| 302 | void *m_token; | |
| 303 | }; | |
| 304 | ||
| 305 | extern const device_type TC0180VCU; | |
| 306 | ||
| 307 | ||
| 121 | 308 | /*************************************************************************** |
| 122 | 309 | DEVICE CONFIGURATION MACROS |
| 123 | 310 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 151 | 151 | assert(device != NULL); |
| 152 | 152 | assert(device->type() == ATARIRLE); |
| 153 | 153 | |
| 154 | return (atarirle_data *)downcast<le | |
| 154 | return (atarirle_data *)downcast<atarirle | |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | |
| r17612 | r17613 | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | ||
| 393 | const device_type A | |
| 394 | 394 | |
| 395 | atarirle_device::atarirle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 396 | : device_t(mconfig, ATARIRLE, "Atari RLE", tag, owner, clock) | |
| 397 | { | |
| 398 | m_token = global_alloc_array_clear(UINT8, sizeof(atarirle_data)); | |
| 399 | } | |
| 400 | ||
| 401 | //------------------------------------------------- | |
| 402 | // device_config_complete - perform any | |
| 403 | // operations now that the configuration is | |
| 404 | // complete | |
| 405 | //------------------------------------------------- | |
| 406 | ||
| 407 | void atarirle_device::device_config_complete() | |
| 408 | { | |
| 409 | } | |
| 410 | ||
| 411 | //------------------------------------------------- | |
| 412 | // device_start - device-specific startup | |
| 413 | //------------------------------------------------- | |
| 414 | ||
| 415 | void atarirle_device::device_start() | |
| 416 | { | |
| 417 | DEVICE_START_NAME( atarirle )(this); | |
| 418 | } | |
| 419 | ||
| 420 | ||
| 421 | ||
| 395 | 422 | /*--------------------------------------------------------------- |
| 396 | 423 | atarirle_control_w: Write handler for MO control bits. |
| 397 | 424 | ---------------------------------------------------------------*/ |
| r17612 | r17613 | |
|---|---|---|
| 70 | 70 | FUNCTION PROTOTYPES |
| 71 | 71 | ***************************************************************************/ |
| 72 | 72 | |
| 73 | DECLARE_LEGACY_DEVICE(ATARIRLE, atarirle); | |
| 73 | class atarirle_device : public device_t | |
| 74 | { | |
| 75 | public: | |
| 76 | atarirle_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 77 | ~atarirle_device() { global_free(m_token); } | |
| 78 | ||
| 79 | // access to legacy token | |
| 80 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 81 | protected: | |
| 82 | // device-level overrides | |
| 83 | virtual void device_config_complete(); | |
| 84 | virtual void device_start(); | |
| 85 | private: | |
| 86 | // internal state | |
| 87 | void *m_token; | |
| 88 | }; | |
| 89 | ||
| 90 | extern const device_type ATARIRLE; | |
| 91 | ||
| 74 | 92 | #define MCFG_ATARIRLE_ADD(_tag, _interface) \ |
| 75 | 93 | MCFG_DEVICE_ADD(_tag, ATARIRLE, 0) \ |
| 76 | 94 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 201 | 201 | assert(device != NULL); |
| 202 | 202 | assert(device->type() == DECO16IC); |
| 203 | 203 | |
| 204 | return (deco16ic_state *)downcast< | |
| 204 | return (deco16ic_state *)downcast<de | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | INLINE const deco16ic_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1010 | 1010 | } |
| 1011 | 1011 | |
| 1012 | 1012 | |
| 1013 | DEFINE_LEGACY_DEVICE(DECO16IC, deco16ic); | |
| 1013 | const device_type DECO16IC = &device_creator<deco16ic_device>; | |
| 1014 | ||
| 1015 | deco16ic_device::deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1016 | : device_t(mconfig, DECO16IC, "Data East IC 55 / 56 / 74 / 141", tag, owner, clock) | |
| 1017 | { | |
| 1018 | m_token = global_alloc_array_clear(UINT8, sizeof(deco16ic_state)); | |
| 1019 | } | |
| 1020 | ||
| 1021 | //------------------------------------------------- | |
| 1022 | // device_config_complete - perform any | |
| 1023 | // operations now that the configuration is | |
| 1024 | // complete | |
| 1025 | //------------------------------------------------- | |
| 1026 | ||
| 1027 | void deco16ic_device::device_config_complete() | |
| 1028 | { | |
| 1029 | } | |
| 1030 | ||
| 1031 | //------------------------------------------------- | |
| 1032 | // device_start - device-specific startup | |
| 1033 | //------------------------------------------------- | |
| 1034 | ||
| 1035 | void deco16ic_device::device_start() | |
| 1036 | { | |
| 1037 | DEVICE_START_NAME( deco16ic )(this); | |
| 1038 | } | |
| 1039 | ||
| 1040 | //------------------------------------------------- | |
| 1041 | // device_reset - device-specific reset | |
| 1042 | //------------------------------------------------- | |
| 1043 | ||
| 1044 | void deco16ic_device::device_reset() | |
| 1045 | { | |
| 1046 | DEVICE_RESET_NAME( deco16ic )(this); | |
| 1047 | } | |
| 1048 | ||
| 1049 |
| r17612 | r17613 | |
|---|---|---|
| 35 | 35 | int _8x8_gfxregion, _16x16_gfxregion; |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | DECLARE_LEGACY_DEVICE(DECO16IC, deco16ic); | |
| 38 | class deco16ic_device : public device_t | |
| 39 | { | |
| 40 | public: | |
| 41 | deco16ic_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | ~deco16ic_device() { global_free(m_token); } | |
| 39 | 43 | |
| 44 | // access to legacy token | |
| 45 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_config_complete(); | |
| 49 | virtual void device_start(); | |
| 50 | virtual void device_reset(); | |
| 51 | private: | |
| 52 | // internal state | |
| 53 | void *m_token; | |
| 54 | }; | |
| 40 | 55 | |
| 56 | extern const device_type DECO16IC; | |
| 57 | ||
| 58 | ||
| 59 | ||
| 41 | 60 | /*************************************************************************** |
| 42 | 61 | DEVICE CONFIGURATION MACROS |
| 43 | 62 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | assert(device != NULL); |
| 27 | 27 | assert(device->type() == DECOCOMN); |
| 28 | 28 | |
| 29 | return (decocomn_state *)downcast< | |
| 29 | return (decocomn_state *)downcast<de | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | INLINE const decocomn_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | DEFINE_LEGACY_DEVICE(DECOCOMN, decocomn); | |
| 165 | const device_type DECOCOMN = &device_creator<decocomn_device>; | |
| 166 | ||
| 167 | decocomn_device::decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 168 | : device_t(mconfig, DECOCOMN, "Data East Common Video Functions", tag, owner, clock) | |
| 169 | { | |
| 170 | m_token = global_alloc_array_clear(UINT8, sizeof(decocomn_state)); | |
| 171 | } | |
| 172 | ||
| 173 | //------------------------------------------------- | |
| 174 | // device_config_complete - perform any | |
| 175 | // operations now that the configuration is | |
| 176 | // complete | |
| 177 | //------------------------------------------------- | |
| 178 | ||
| 179 | void decocomn_device::device_config_complete() | |
| 180 | { | |
| 181 | } | |
| 182 | ||
| 183 | //------------------------------------------------- | |
| 184 | // device_start - device-specific startup | |
| 185 | //------------------------------------------------- | |
| 186 | ||
| 187 | void decocomn_device::device_start() | |
| 188 | { | |
| 189 | DEVICE_START_NAME( decocomn )(this); | |
| 190 | } | |
| 191 | ||
| 192 | //------------------------------------------------- | |
| 193 | // device_reset - device-specific reset | |
| 194 | //------------------------------------------------- | |
| 195 | ||
| 196 | void decocomn_device::device_reset() | |
| 197 | { | |
| 198 | DEVICE_RESET_NAME( decocomn )(this); | |
| 199 | } | |
| 200 | ||
| 201 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | const char *screen; |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | DECLARE_LEGACY_DEVICE(DECOCOMN, decocomn); | |
| 25 | class decocomn_device : public device_t | |
| 26 | { | |
| 27 | public: | |
| 28 | decocomn_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 29 | ~decocomn_device() { global_free(m_token); } | |
| 26 | 30 | |
| 31 | // access to legacy token | |
| 32 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 33 | protected: | |
| 34 | // device-level overrides | |
| 35 | virtual void device_config_complete(); | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | void *m_token; | |
| 41 | }; | |
| 27 | 42 | |
| 43 | extern const device_type DECOCOMN; | |
| 44 | ||
| 45 | ||
| 46 | ||
| 28 | 47 | /*************************************************************************** |
| 29 | 48 | DEVICE CONFIGURATION MACROS |
| 30 | 49 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 95 | 95 | assert(device != NULL); |
| 96 | 96 | assert(device->type() == VIDEO_VRENDER0); |
| 97 | 97 | |
| 98 | return (vr0video_state *)downcast< | |
| 98 | return (vr0video_state *)downcast<vr0video | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | INLINE const vr0video_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 614 | 614 | case DEVINFO_STR_NAME: strcpy(info->s, "VRender0"); break; |
| 615 | 615 | } |
| 616 | 616 | } |
| 617 | DEFINE_LEGACY_DEVICE(VIDEO_VRENDER0, vr0video); | |
| 617 | const device_type VIDEO_VRENDER0 = &device_creator<vr0video_device>; | |
| 618 | ||
| 619 | vr0video_device::vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 620 | : device_t(mconfig, VIDEO_VRENDER0, "VRender0", tag, owner, clock) | |
| 621 | { | |
| 622 | m_token = global_alloc_array_clear(UINT8, sizeof(vr0video_state)); | |
| 623 | } | |
| 624 | ||
| 625 | //------------------------------------------------- | |
| 626 | // device_config_complete - perform any | |
| 627 | // operations now that the configuration is | |
| 628 | // complete | |
| 629 | //------------------------------------------------- | |
| 630 | ||
| 631 | void vr0video_device::device_config_complete() | |
| 632 | { | |
| 633 | } | |
| 634 | ||
| 635 | //------------------------------------------------- | |
| 636 | // device_start - device-specific startup | |
| 637 | //------------------------------------------------- | |
| 638 | ||
| 639 | void vr0video_device::device_start() | |
| 640 | { | |
| 641 | DEVICE_START_NAME( vr0video )(this); | |
| 642 | } | |
| 643 | ||
| 644 | //------------------------------------------------- | |
| 645 | // device_reset - device-specific reset | |
| 646 | //------------------------------------------------- | |
| 647 | ||
| 648 | void vr0video_device::device_reset() | |
| 649 | { | |
| 650 | DEVICE_RESET_NAME( vr0video )(this); | |
| 651 | } | |
| 652 | ||
| 653 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | DEVICE CONFIGURATION MACROS |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_DEVICE(VIDEO_VRENDER0, vr0video); | |
| 20 | class vr0video_device : public device_t | |
| 21 | { | |
| 22 | public: | |
| 23 | vr0video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~vr0video_device() { global_free(m_token); } | |
| 21 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_reset(); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 37 | ||
| 38 | extern const device_type VIDEO_VRENDER0; | |
| 39 | ||
| 40 | ||
| 22 | 41 | #define MCFG_VIDEO_VRENDER0_ADD(_tag, _interface) \ |
| 23 | 42 | MCFG_DEVICE_ADD(_tag, VIDEO_VRENDER0, 0) \ |
| 24 | 43 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 71 | 71 | assert(device != NULL); |
| 72 | 72 | assert(device->type() == KANEKO_PANDORA); |
| 73 | 73 | |
| 74 | return (kaneko_pandora_state *)downcast< | |
| 74 | return (kaneko_pandora_state *)downcast<kaneko_pandora_devic | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | INLINE const kaneko_pandora_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 339 | 339 | } |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | DEFINE_LEGACY_DEVICE(KANEKO_PANDORA, kaneko_pandora); | |
| 342 | const device_type KANEKO_PANDORA = &device_creator<kaneko_pandora_device>; | |
| 343 | ||
| 344 | kaneko_pandora_device::kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 345 | : device_t(mconfig, KANEKO_PANDORA, "Kaneko Pandora - PX79C480FP-3", tag, owner, clock) | |
| 346 | { | |
| 347 | m_token = global_alloc_array_clear(UINT8, sizeof(kaneko_pandora_state)); | |
| 348 | } | |
| 349 | ||
| 350 | //------------------------------------------------- | |
| 351 | // device_config_complete - perform any | |
| 352 | // operations now that the configuration is | |
| 353 | // complete | |
| 354 | //------------------------------------------------- | |
| 355 | ||
| 356 | void kaneko_pandora_device::device_config_complete() | |
| 357 | { | |
| 358 | } | |
| 359 | ||
| 360 | //------------------------------------------------- | |
| 361 | // device_start - device-specific startup | |
| 362 | //------------------------------------------------- | |
| 363 | ||
| 364 | void kaneko_pandora_device::device_start() | |
| 365 | { | |
| 366 | DEVICE_START_NAME( kaneko_pandora )(this); | |
| 367 | } | |
| 368 | ||
| 369 | //------------------------------------------------- | |
| 370 | // device_reset - device-specific reset | |
| 371 | //------------------------------------------------- | |
| 372 | ||
| 373 | void kaneko_pandora_device::device_reset() | |
| 374 | { | |
| 375 | DEVICE_RESET_NAME( kaneko_pandora )(this); | |
| 376 | } | |
| 377 | ||
| 378 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | int y; |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_DEVICE(KANEKO_PANDORA, kaneko_pandora); | |
| 27 | class kaneko_pandora_device : public device_t | |
| 28 | { | |
| 29 | public: | |
| 30 | kaneko_pandora_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ~kaneko_pandora_device() { global_free(m_token); } | |
| 28 | 32 | |
| 33 | // access to legacy token | |
| 34 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_config_complete(); | |
| 38 | virtual void device_start(); | |
| 39 | virtual void device_reset(); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type KANEKO_PANDORA; | |
| 46 | ||
| 47 | ||
| 29 | 48 | /*************************************************************************** |
| 30 | 49 | DEVICE CONFIGURATION MACROS |
| 31 | 50 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 1349 | 1349 | assert(device != NULL); |
| 1350 | 1350 | assert(device->type() == K007121); |
| 1351 | 1351 | |
| 1352 | return (k007121_state *)downcast< | |
| 1352 | return (k007121_state *)downcast<k007121_devic | |
| 1353 | 1353 | } |
| 1354 | 1354 | |
| 1355 | 1355 | /***************************************************************************** |
| r17612 | r17613 | |
| 1612 | 1612 | assert(device != NULL); |
| 1613 | 1613 | assert(device->type() == K007342); |
| 1614 | 1614 | |
| 1615 | return (k007342_state *)downcast< | |
| 1615 | return (k007342_state *)downcast<k007342_devic | |
| 1616 | 1616 | } |
| 1617 | 1617 | |
| 1618 | 1618 | INLINE const k007342_interface *k007342_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1896 | 1896 | assert(device != NULL); |
| 1897 | 1897 | assert(device->type() == K007420); |
| 1898 | 1898 | |
| 1899 | return (k007420_state *)downcast< | |
| 1899 | return (k007420_state *)downcast<k007420_devic | |
| 1900 | 1900 | } |
| 1901 | 1901 | |
| 1902 | 1902 | INLINE const k007420_interface *k007420_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2173 | 2173 | assert(device != NULL); |
| 2174 | 2174 | assert(device->type() == K052109); |
| 2175 | 2175 | |
| 2176 | return (k052109_state *)downcast< | |
| 2176 | return (k052109_state *)downcast<k052109_devic | |
| 2177 | 2177 | } |
| 2178 | 2178 | |
| 2179 | 2179 | INLINE const k052109_interface *k052109_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2807 | 2807 | assert(device != NULL); |
| 2808 | 2808 | assert(device->type() == K051960); |
| 2809 | 2809 | |
| 2810 | return (k051960_state *)downcast< | |
| 2810 | return (k051960_state *)downcast<k051960_devic | |
| 2811 | 2811 | } |
| 2812 | 2812 | |
| 2813 | 2813 | INLINE const k051960_interface *k051960_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 3349 | 3349 | assert(device != NULL); |
| 3350 | 3350 | assert((device->type() == K053244 || device->type() == K053245)); |
| 3351 | 3351 | |
| 3352 | return (k05324x_state *)downcast< | |
| 3352 | return (k05324x_state *)downcast<k05324x_devic | |
| 3353 | 3353 | } |
| 3354 | 3354 | |
| 3355 | 3355 | INLINE const k05324x_interface *k05324x_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 4139 | 4139 | assert(device != NULL); |
| 4140 | 4140 | assert((device->type() == K053246 || device->type() == K053247 || device->type() == K055673)); |
| 4141 | 4141 | |
| 4142 | return (k053247_state *)downcast< | |
| 4142 | return (k053247_state *)downcast<k053247_devic | |
| 4143 | 4143 | } |
| 4144 | 4144 | |
| 4145 | 4145 | INLINE const k053247_interface *k053247_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 5137 | 5137 | assert(device != NULL); |
| 5138 | 5138 | assert(device->type() == K051316); |
| 5139 | 5139 | |
| 5140 | return (k051316_state *)downcast< | |
| 5140 | return (k051316_state *)downcast<k051316_devic | |
| 5141 | 5141 | } |
| 5142 | 5142 | |
| 5143 | 5143 | INLINE const k051316_interface *k051316_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 5425 | 5425 | assert(device != NULL); |
| 5426 | 5426 | assert(device->type() == K053936); |
| 5427 | 5427 | |
| 5428 | return (k053936_state *)downcast< | |
| 5428 | return (k053936_state *)downcast<k053936_devic | |
| 5429 | 5429 | } |
| 5430 | 5430 | |
| 5431 | 5431 | INLINE const k053936_interface *k053936_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 5650 | 5650 | assert(device != NULL); |
| 5651 | 5651 | assert(device->type() == K053251); |
| 5652 | 5652 | |
| 5653 | return (k053251_state *)downcast< | |
| 5653 | return (k053251_state *)downcast<k053251_devic | |
| 5654 | 5654 | } |
| 5655 | 5655 | |
| 5656 | 5656 | /***************************************************************************** |
| r17612 | r17613 | |
| 5801 | 5801 | assert(device != NULL); |
| 5802 | 5802 | assert(device->type() == K054000); |
| 5803 | 5803 | |
| 5804 | return (k054000_state *)downcast< | |
| 5804 | return (k054000_state *)downcast<k054000_devic | |
| 5805 | 5805 | } |
| 5806 | 5806 | |
| 5807 | 5807 | /***************************************************************************** |
| r17612 | r17613 | |
| 5913 | 5913 | assert(device != NULL); |
| 5914 | 5914 | assert(device->type() == K051733); |
| 5915 | 5915 | |
| 5916 | return (k051733_state *)downcast< | |
| 5916 | return (k051733_state *)downcast<k051733_devic | |
| 5917 | 5917 | } |
| 5918 | 5918 | |
| 5919 | 5919 | /***************************************************************************** |
| r17612 | r17613 | |
| 6119 | 6119 | assert(device != NULL); |
| 6120 | 6120 | assert(device->type() == K056832); |
| 6121 | 6121 | |
| 6122 | return (k056832_state *)downcast< | |
| 6122 | return (k056832_state *)downcast<k056832_devic | |
| 6123 | 6123 | } |
| 6124 | 6124 | |
| 6125 | 6125 | INLINE const k056832_interface *k056832_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 8032 | 8032 | assert(device != NULL); |
| 8033 | 8033 | assert(device->type() == K055555); |
| 8034 | 8034 | |
| 8035 | return (k055555_state *)downcast< | |
| 8035 | return (k055555_state *)downcast<k055555_devic | |
| 8036 | 8036 | } |
| 8037 | 8037 | |
| 8038 | 8038 | /***************************************************************************** |
| r17612 | r17613 | |
| 8159 | 8159 | assert(device != NULL); |
| 8160 | 8160 | assert(device->type() == K054338); |
| 8161 | 8161 | |
| 8162 | return (k054338_state *)downcast< | |
| 8162 | return (k054338_state *)downcast<k054338_devic | |
| 8163 | 8163 | } |
| 8164 | 8164 | |
| 8165 | 8165 | INLINE const k054338_interface *k054338_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 8471 | 8471 | assert(device != NULL); |
| 8472 | 8472 | assert(device->type() == K001006); |
| 8473 | 8473 | |
| 8474 | return (k001006_state *)downcast< | |
| 8474 | return (k001006_state *)downcast<k001006_devic | |
| 8475 | 8475 | } |
| 8476 | 8476 | |
| 8477 | 8477 | INLINE const k001006_interface *k001006_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 8681 | 8681 | assert(device != NULL); |
| 8682 | 8682 | assert(device->type() == K001005); |
| 8683 | 8683 | |
| 8684 | return (k001005_state *)downcast< | |
| 8684 | return (k001005_state *)downcast<k001005_devic | |
| 8685 | 8685 | } |
| 8686 | 8686 | |
| 8687 | 8687 | INLINE const k001005_interface *k001005_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 9574 | 9574 | assert(device != NULL); |
| 9575 | 9575 | assert(device->type() == K001604); |
| 9576 | 9576 | |
| 9577 | return (k001604_state *)downcast< | |
| 9577 | return (k001604_state *)downcast<k001604_devic | |
| 9578 | 9578 | } |
| 9579 | 9579 | |
| 9580 | 9580 | INLINE const k001604_interface *k001604_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 9987 | 9987 | assert(device != NULL); |
| 9988 | 9988 | assert(device->type() == K037122); |
| 9989 | 9989 | |
| 9990 | return (k037122_state *)downcast< | |
| 9990 | return (k037122_state *)downcast<k037122_devic | |
| 9991 | 9991 | } |
| 9992 | 9992 | |
| 9993 | 9993 | INLINE const k037122_interface *k037122_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 10710 | 10710 | } |
| 10711 | 10711 | |
| 10712 | 10712 | |
| 10713 | DEFINE_LEGACY_DEVICE(K007121, k007121); | |
| 10714 | DEFINE_LEGACY_DEVICE(K007342, k007342); | |
| 10715 | DEFINE_LEGACY_DEVICE(K007420, k007420); | |
| 10716 | DEFINE_LEGACY_DEVICE(K052109, k052109); | |
| 10717 | DEFINE_LEGACY_DEVICE(K051960, k051960); | |
| 10718 | DEFINE_LEGACY_DEVICE(K053244, k05324x); | |
| 10719 | DEFINE_LEGACY_DEVICE(K053246, k053247); | |
| 10720 | DEFINE_LEGACY_DEVICE(K055673, k055673); | |
| 10721 | DEFINE_LEGACY_DEVICE(K051316, k051316); | |
| 10722 | DEFINE_LEGACY_DEVICE(K053936, k053936); | |
| 10723 | DEFINE_LEGACY_DEVICE(K053251, k053251); | |
| 10724 | DEFINE_LEGACY_DEVICE(K054000, k054000); | |
| 10725 | DEFINE_LEGACY_DEVICE(K051733, k051733); | |
| 10726 | DEFINE_LEGACY_DEVICE(K056832, k056832); | |
| 10727 | DEFINE_LEGACY_DEVICE(K055555, k055555); | |
| 10728 | DEFINE_LEGACY_DEVICE(K054338, k054338); | |
| 10729 | DEFINE_LEGACY_DEVICE(K001006, k001006); | |
| 10730 | DEFINE_LEGACY_DEVICE(K001005, k001005); | |
| 10731 | DEFINE_LEGACY_DEVICE(K001604, k001604); | |
| 10732 | DEFINE_LEGACY_DEVICE(K037122, k037122); | |
| 10713 | const device_type K007121 = &device_creator<k007121_device>; | |
| 10714 | ||
| 10715 | k007121_device::k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10716 | : device_t(mconfig, K007121, "Konami 007121", tag, owner, clock) | |
| 10717 | { | |
| 10718 | m_token = global_alloc_array_clear(UINT8, sizeof(k007121_state)); | |
| 10719 | } | |
| 10720 | ||
| 10721 | //------------------------------------------------- | |
| 10722 | // device_config_complete - perform any | |
| 10723 | // operations now that the configuration is | |
| 10724 | // complete | |
| 10725 | //------------------------------------------------- | |
| 10726 | ||
| 10727 | void k007121_device::device_config_complete() | |
| 10728 | { | |
| 10729 | } | |
| 10730 | ||
| 10731 | //------------------------------------------------- | |
| 10732 | // device_start - device-specific startup | |
| 10733 | //------------------------------------------------- | |
| 10734 | ||
| 10735 | void k007121_device::device_start() | |
| 10736 | { | |
| 10737 | DEVICE_START_NAME( k007121 )(this); | |
| 10738 | } | |
| 10739 | ||
| 10740 | //------------------------------------------------- | |
| 10741 | // device_reset - device-specific reset | |
| 10742 | //------------------------------------------------- | |
| 10743 | ||
| 10744 | void k007121_device::device_reset() | |
| 10745 | { | |
| 10746 | DEVICE_RESET_NAME( k007121 )(this); | |
| 10747 | } | |
| 10748 | ||
| 10749 | ||
| 10750 | const device_type K007342 = &device_creator<k007342_device>; | |
| 10751 | ||
| 10752 | k007342_device::k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10753 | : device_t(mconfig, K007342, "Konami 007342", tag, owner, clock) | |
| 10754 | { | |
| 10755 | m_token = global_alloc_array_clear(UINT8, sizeof(k007342_state)); | |
| 10756 | } | |
| 10757 | ||
| 10758 | //------------------------------------------------- | |
| 10759 | // device_config_complete - perform any | |
| 10760 | // operations now that the configuration is | |
| 10761 | // complete | |
| 10762 | //------------------------------------------------- | |
| 10763 | ||
| 10764 | void k007342_device::device_config_complete() | |
| 10765 | { | |
| 10766 | } | |
| 10767 | ||
| 10768 | //------------------------------------------------- | |
| 10769 | // device_start - device-specific startup | |
| 10770 | //------------------------------------------------- | |
| 10771 | ||
| 10772 | void k007342_device::device_start() | |
| 10773 | { | |
| 10774 | DEVICE_START_NAME( k007342 )(this); | |
| 10775 | } | |
| 10776 | ||
| 10777 | //------------------------------------------------- | |
| 10778 | // device_reset - device-specific reset | |
| 10779 | //------------------------------------------------- | |
| 10780 | ||
| 10781 | void k007342_device::device_reset() | |
| 10782 | { | |
| 10783 | DEVICE_RESET_NAME( k007342 )(this); | |
| 10784 | } | |
| 10785 | ||
| 10786 | ||
| 10787 | const device_type K007420 = &device_creator<k007420_device>; | |
| 10788 | ||
| 10789 | k007420_device::k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10790 | : device_t(mconfig, K007420, "Konami 007420", tag, owner, clock) | |
| 10791 | { | |
| 10792 | m_token = global_alloc_array_clear(UINT8, sizeof(k007420_state)); | |
| 10793 | } | |
| 10794 | ||
| 10795 | //------------------------------------------------- | |
| 10796 | // device_config_complete - perform any | |
| 10797 | // operations now that the configuration is | |
| 10798 | // complete | |
| 10799 | //------------------------------------------------- | |
| 10800 | ||
| 10801 | void k007420_device::device_config_complete() | |
| 10802 | { | |
| 10803 | } | |
| 10804 | ||
| 10805 | //------------------------------------------------- | |
| 10806 | // device_start - device-specific startup | |
| 10807 | //------------------------------------------------- | |
| 10808 | ||
| 10809 | void k007420_device::device_start() | |
| 10810 | { | |
| 10811 | DEVICE_START_NAME( k007420 )(this); | |
| 10812 | } | |
| 10813 | ||
| 10814 | //------------------------------------------------- | |
| 10815 | // device_reset - device-specific reset | |
| 10816 | //------------------------------------------------- | |
| 10817 | ||
| 10818 | void k007420_device::device_reset() | |
| 10819 | { | |
| 10820 | DEVICE_RESET_NAME( k007420 )(this); | |
| 10821 | } | |
| 10822 | ||
| 10823 | ||
| 10824 | const device_type K052109 = &device_creator<k052109_device>; | |
| 10825 | ||
| 10826 | k052109_device::k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10827 | : device_t(mconfig, K052109, "Konami 052109", tag, owner, clock) | |
| 10828 | { | |
| 10829 | m_token = global_alloc_array_clear(UINT8, sizeof(k052109_state)); | |
| 10830 | } | |
| 10831 | ||
| 10832 | //------------------------------------------------- | |
| 10833 | // device_config_complete - perform any | |
| 10834 | // operations now that the configuration is | |
| 10835 | // complete | |
| 10836 | //------------------------------------------------- | |
| 10837 | ||
| 10838 | void k052109_device::device_config_complete() | |
| 10839 | { | |
| 10840 | } | |
| 10841 | ||
| 10842 | //------------------------------------------------- | |
| 10843 | // device_start - device-specific startup | |
| 10844 | //------------------------------------------------- | |
| 10845 | ||
| 10846 | void k052109_device::device_start() | |
| 10847 | { | |
| 10848 | DEVICE_START_NAME( k052109 )(this); | |
| 10849 | } | |
| 10850 | ||
| 10851 | //------------------------------------------------- | |
| 10852 | // device_reset - device-specific reset | |
| 10853 | //------------------------------------------------- | |
| 10854 | ||
| 10855 | void k052109_device::device_reset() | |
| 10856 | { | |
| 10857 | DEVICE_RESET_NAME( k052109 )(this); | |
| 10858 | } | |
| 10859 | ||
| 10860 | ||
| 10861 | const device_type K051960 = &device_creator<k051960_device>; | |
| 10862 | ||
| 10863 | k051960_device::k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10864 | : device_t(mconfig, K051960, "Konami 051960", tag, owner, clock) | |
| 10865 | { | |
| 10866 | m_token = global_alloc_array_clear(UINT8, sizeof(k051960_state)); | |
| 10867 | } | |
| 10868 | ||
| 10869 | //------------------------------------------------- | |
| 10870 | // device_config_complete - perform any | |
| 10871 | // operations now that the configuration is | |
| 10872 | // complete | |
| 10873 | //------------------------------------------------- | |
| 10874 | ||
| 10875 | void k051960_device::device_config_complete() | |
| 10876 | { | |
| 10877 | } | |
| 10878 | ||
| 10879 | //------------------------------------------------- | |
| 10880 | // device_start - device-specific startup | |
| 10881 | //------------------------------------------------- | |
| 10882 | ||
| 10883 | void k051960_device::device_start() | |
| 10884 | { | |
| 10885 | DEVICE_START_NAME( k051960 )(this); | |
| 10886 | } | |
| 10887 | ||
| 10888 | //------------------------------------------------- | |
| 10889 | // device_reset - device-specific reset | |
| 10890 | //------------------------------------------------- | |
| 10891 | ||
| 10892 | void k051960_device::device_reset() | |
| 10893 | { | |
| 10894 | DEVICE_RESET_NAME( k051960 )(this); | |
| 10895 | } | |
| 10896 | ||
| 10897 | ||
| 10898 | const device_type K053244 = &device_creator<k05324x_device>; | |
| 10899 | ||
| 10900 | k05324x_device::k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10901 | : device_t(mconfig, K053244, "Konami 053244 & 053245", tag, owner, clock) | |
| 10902 | { | |
| 10903 | m_token = global_alloc_array_clear(UINT8, sizeof(k05324x_state)); | |
| 10904 | } | |
| 10905 | ||
| 10906 | //------------------------------------------------- | |
| 10907 | // device_config_complete - perform any | |
| 10908 | // operations now that the configuration is | |
| 10909 | // complete | |
| 10910 | //------------------------------------------------- | |
| 10911 | ||
| 10912 | void k05324x_device::device_config_complete() | |
| 10913 | { | |
| 10914 | } | |
| 10915 | ||
| 10916 | //------------------------------------------------- | |
| 10917 | // device_start - device-specific startup | |
| 10918 | //------------------------------------------------- | |
| 10919 | ||
| 10920 | void k05324x_device::device_start() | |
| 10921 | { | |
| 10922 | DEVICE_START_NAME( k05324x )(this); | |
| 10923 | } | |
| 10924 | ||
| 10925 | //------------------------------------------------- | |
| 10926 | // device_reset - device-specific reset | |
| 10927 | //------------------------------------------------- | |
| 10928 | ||
| 10929 | void k05324x_device::device_reset() | |
| 10930 | { | |
| 10931 | DEVICE_RESET_NAME( k05324x )(this); | |
| 10932 | } | |
| 10933 | ||
| 10934 | ||
| 10935 | const device_type K053246 = &device_creator<k053247_device>; | |
| 10936 | ||
| 10937 | k053247_device::k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10938 | : device_t(mconfig, K053246, "Konami 053246 & 053247", tag, owner, clock) | |
| 10939 | { | |
| 10940 | m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state)); | |
| 10941 | } | |
| 10942 | ||
| 10943 | //------------------------------------------------- | |
| 10944 | // device_config_complete - perform any | |
| 10945 | // operations now that the configuration is | |
| 10946 | // complete | |
| 10947 | //------------------------------------------------- | |
| 10948 | ||
| 10949 | void k053247_device::device_config_complete() | |
| 10950 | { | |
| 10951 | } | |
| 10952 | ||
| 10953 | //------------------------------------------------- | |
| 10954 | // device_start - device-specific startup | |
| 10955 | //------------------------------------------------- | |
| 10956 | ||
| 10957 | void k053247_device::device_start() | |
| 10958 | { | |
| 10959 | DEVICE_START_NAME( k053247 )(this); | |
| 10960 | } | |
| 10961 | ||
| 10962 | //------------------------------------------------- | |
| 10963 | // device_reset - device-specific reset | |
| 10964 | //------------------------------------------------- | |
| 10965 | ||
| 10966 | void k053247_device::device_reset() | |
| 10967 | { | |
| 10968 | DEVICE_RESET_NAME( k053247 )(this); | |
| 10969 | } | |
| 10970 | ||
| 10971 | ||
| 10972 | const device_type K055673 = &device_creator<k055673_device>; | |
| 10973 | ||
| 10974 | k055673_device::k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 10975 | : device_t(mconfig, K055673, "Konami 055673", tag, owner, clock) | |
| 10976 | { | |
| 10977 | m_token = global_alloc_array_clear(UINT8, sizeof(k053247_state)); | |
| 10978 | } | |
| 10979 | ||
| 10980 | //------------------------------------------------- | |
| 10981 | // device_config_complete - perform any | |
| 10982 | // operations now that the configuration is | |
| 10983 | // complete | |
| 10984 | //------------------------------------------------- | |
| 10985 | ||
| 10986 | void k055673_device::device_config_complete() | |
| 10987 | { | |
| 10988 | } | |
| 10989 | ||
| 10990 | //------------------------------------------------- | |
| 10991 | // device_start - device-specific startup | |
| 10992 | //------------------------------------------------- | |
| 10993 | ||
| 10994 | void k055673_device::device_start() | |
| 10995 | { | |
| 10996 | DEVICE_START_NAME( k055673 )(this); | |
| 10997 | } | |
| 10998 | ||
| 10999 | //------------------------------------------------- | |
| 11000 | // device_reset - device-specific reset | |
| 11001 | //------------------------------------------------- | |
| 11002 | ||
| 11003 | void k055673_device::device_reset() | |
| 11004 | { | |
| 11005 | DEVICE_RESET_NAME( k053247 )(this); | |
| 11006 | } | |
| 11007 | ||
| 11008 | ||
| 11009 | const device_type K051316 = &device_creator<k051316_device>; | |
| 11010 | ||
| 11011 | k051316_device::k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11012 | : device_t(mconfig, K051316, "Konami 051316", tag, owner, clock) | |
| 11013 | { | |
| 11014 | m_token = global_alloc_array_clear(UINT8, sizeof(k051316_state)); | |
| 11015 | } | |
| 11016 | ||
| 11017 | //------------------------------------------------- | |
| 11018 | // device_config_complete - perform any | |
| 11019 | // operations now that the configuration is | |
| 11020 | // complete | |
| 11021 | //------------------------------------------------- | |
| 11022 | ||
| 11023 | void k051316_device::device_config_complete() | |
| 11024 | { | |
| 11025 | } | |
| 11026 | ||
| 11027 | //------------------------------------------------- | |
| 11028 | // device_start - device-specific startup | |
| 11029 | //------------------------------------------------- | |
| 11030 | ||
| 11031 | void k051316_device::device_start() | |
| 11032 | { | |
| 11033 | DEVICE_START_NAME( k051316 )(this); | |
| 11034 | } | |
| 11035 | ||
| 11036 | //------------------------------------------------- | |
| 11037 | // device_reset - device-specific reset | |
| 11038 | //------------------------------------------------- | |
| 11039 | ||
| 11040 | void k051316_device::device_reset() | |
| 11041 | { | |
| 11042 | DEVICE_RESET_NAME( k051316 )(this); | |
| 11043 | } | |
| 11044 | ||
| 11045 | ||
| 11046 | const device_type K053936 = &device_creator<k053936_device>; | |
| 11047 | ||
| 11048 | k053936_device::k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11049 | : device_t(mconfig, K053936, "Konami 053936", tag, owner, clock) | |
| 11050 | { | |
| 11051 | m_token = global_alloc_array_clear(UINT8, sizeof(k053936_state)); | |
| 11052 | } | |
| 11053 | ||
| 11054 | //------------------------------------------------- | |
| 11055 | // device_config_complete - perform any | |
| 11056 | // operations now that the configuration is | |
| 11057 | // complete | |
| 11058 | //------------------------------------------------- | |
| 11059 | ||
| 11060 | void k053936_device::device_config_complete() | |
| 11061 | { | |
| 11062 | } | |
| 11063 | ||
| 11064 | //------------------------------------------------- | |
| 11065 | // device_start - device-specific startup | |
| 11066 | //------------------------------------------------- | |
| 11067 | ||
| 11068 | void k053936_device::device_start() | |
| 11069 | { | |
| 11070 | DEVICE_START_NAME( k053936 )(this); | |
| 11071 | } | |
| 11072 | ||
| 11073 | //------------------------------------------------- | |
| 11074 | // device_reset - device-specific reset | |
| 11075 | //------------------------------------------------- | |
| 11076 | ||
| 11077 | void k053936_device::device_reset() | |
| 11078 | { | |
| 11079 | DEVICE_RESET_NAME( k053936 )(this); | |
| 11080 | } | |
| 11081 | ||
| 11082 | ||
| 11083 | const device_type K053251 = &device_creator<k053251_device>; | |
| 11084 | ||
| 11085 | k053251_device::k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11086 | : device_t(mconfig, K053251, "Konami 053251", tag, owner, clock) | |
| 11087 | { | |
| 11088 | m_token = global_alloc_array_clear(UINT8, sizeof(k053251_state)); | |
| 11089 | } | |
| 11090 | ||
| 11091 | //------------------------------------------------- | |
| 11092 | // device_config_complete - perform any | |
| 11093 | // operations now that the configuration is | |
| 11094 | // complete | |
| 11095 | //------------------------------------------------- | |
| 11096 | ||
| 11097 | void k053251_device::device_config_complete() | |
| 11098 | { | |
| 11099 | } | |
| 11100 | ||
| 11101 | //------------------------------------------------- | |
| 11102 | // device_start - device-specific startup | |
| 11103 | //------------------------------------------------- | |
| 11104 | ||
| 11105 | void k053251_device::device_start() | |
| 11106 | { | |
| 11107 | DEVICE_START_NAME( k053251 )(this); | |
| 11108 | } | |
| 11109 | ||
| 11110 | //------------------------------------------------- | |
| 11111 | // device_reset - device-specific reset | |
| 11112 | //------------------------------------------------- | |
| 11113 | ||
| 11114 | void k053251_device::device_reset() | |
| 11115 | { | |
| 11116 | DEVICE_RESET_NAME( k053251 )(this); | |
| 11117 | } | |
| 11118 | ||
| 11119 | ||
| 11120 | const device_type K054000 = &device_creator<k054000_device>; | |
| 11121 | ||
| 11122 | k054000_device::k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11123 | : device_t(mconfig, K054000, "Konami 054000", tag, owner, clock) | |
| 11124 | { | |
| 11125 | m_token = global_alloc_array_clear(UINT8, sizeof(k054000_state)); | |
| 11126 | } | |
| 11127 | ||
| 11128 | //------------------------------------------------- | |
| 11129 | // device_config_complete - perform any | |
| 11130 | // operations now that the configuration is | |
| 11131 | // complete | |
| 11132 | //------------------------------------------------- | |
| 11133 | ||
| 11134 | void k054000_device::device_config_complete() | |
| 11135 | { | |
| 11136 | } | |
| 11137 | ||
| 11138 | //------------------------------------------------- | |
| 11139 | // device_start - device-specific startup | |
| 11140 | //------------------------------------------------- | |
| 11141 | ||
| 11142 | void k054000_device::device_start() | |
| 11143 | { | |
| 11144 | DEVICE_START_NAME( k054000 )(this); | |
| 11145 | } | |
| 11146 | ||
| 11147 | //------------------------------------------------- | |
| 11148 | // device_reset - device-specific reset | |
| 11149 | //------------------------------------------------- | |
| 11150 | ||
| 11151 | void k054000_device::device_reset() | |
| 11152 | { | |
| 11153 | DEVICE_RESET_NAME( k054000 )(this); | |
| 11154 | } | |
| 11155 | ||
| 11156 | ||
| 11157 | const device_type K051733 = &device_creator<k051733_device>; | |
| 11158 | ||
| 11159 | k051733_device::k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11160 | : device_t(mconfig, K051733, "Konami 051733", tag, owner, clock) | |
| 11161 | { | |
| 11162 | m_token = global_alloc_array_clear(UINT8, sizeof(k051733_state)); | |
| 11163 | } | |
| 11164 | ||
| 11165 | //------------------------------------------------- | |
| 11166 | // device_config_complete - perform any | |
| 11167 | // operations now that the configuration is | |
| 11168 | // complete | |
| 11169 | //------------------------------------------------- | |
| 11170 | ||
| 11171 | void k051733_device::device_config_complete() | |
| 11172 | { | |
| 11173 | } | |
| 11174 | ||
| 11175 | //------------------------------------------------- | |
| 11176 | // device_start - device-specific startup | |
| 11177 | //------------------------------------------------- | |
| 11178 | ||
| 11179 | void k051733_device::device_start() | |
| 11180 | { | |
| 11181 | DEVICE_START_NAME( k051733 )(this); | |
| 11182 | } | |
| 11183 | ||
| 11184 | //------------------------------------------------- | |
| 11185 | // device_reset - device-specific reset | |
| 11186 | //------------------------------------------------- | |
| 11187 | ||
| 11188 | void k051733_device::device_reset() | |
| 11189 | { | |
| 11190 | DEVICE_RESET_NAME( k051733 )(this); | |
| 11191 | } | |
| 11192 | ||
| 11193 | ||
| 11194 | const device_type K056832 = &device_creator<k056832_device>; | |
| 11195 | ||
| 11196 | k056832_device::k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11197 | : device_t(mconfig, K056832, "Konami 056832", tag, owner, clock) | |
| 11198 | { | |
| 11199 | m_token = global_alloc_array_clear(UINT8, sizeof(k056832_state)); | |
| 11200 | } | |
| 11201 | ||
| 11202 | //------------------------------------------------- | |
| 11203 | // device_config_complete - perform any | |
| 11204 | // operations now that the configuration is | |
| 11205 | // complete | |
| 11206 | //------------------------------------------------- | |
| 11207 | ||
| 11208 | void k056832_device::device_config_complete() | |
| 11209 | { | |
| 11210 | } | |
| 11211 | ||
| 11212 | //------------------------------------------------- | |
| 11213 | // device_start - device-specific startup | |
| 11214 | //------------------------------------------------- | |
| 11215 | ||
| 11216 | void k056832_device::device_start() | |
| 11217 | { | |
| 11218 | DEVICE_START_NAME( k056832 )(this); | |
| 11219 | } | |
| 11220 | ||
| 11221 | ||
| 11222 | const device_type K055555 = &device_creator<k055555_device>; | |
| 11223 | ||
| 11224 | k055555_device::k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11225 | : device_t(mconfig, K055555, "Konami 055555", tag, owner, clock) | |
| 11226 | { | |
| 11227 | m_token = global_alloc_array_clear(UINT8, sizeof(k055555_state)); | |
| 11228 | } | |
| 11229 | ||
| 11230 | //------------------------------------------------- | |
| 11231 | // device_config_complete - perform any | |
| 11232 | // operations now that the configuration is | |
| 11233 | // complete | |
| 11234 | //------------------------------------------------- | |
| 11235 | ||
| 11236 | void k055555_device::device_config_complete() | |
| 11237 | { | |
| 11238 | } | |
| 11239 | ||
| 11240 | //------------------------------------------------- | |
| 11241 | // device_start - device-specific startup | |
| 11242 | //------------------------------------------------- | |
| 11243 | ||
| 11244 | void k055555_device::device_start() | |
| 11245 | { | |
| 11246 | DEVICE_START_NAME( k055555 )(this); | |
| 11247 | } | |
| 11248 | ||
| 11249 | //------------------------------------------------- | |
| 11250 | // device_reset - device-specific reset | |
| 11251 | //------------------------------------------------- | |
| 11252 | ||
| 11253 | void k055555_device::device_reset() | |
| 11254 | { | |
| 11255 | DEVICE_RESET_NAME( k055555 )(this); | |
| 11256 | } | |
| 11257 | ||
| 11258 | ||
| 11259 | const device_type K054338 = &device_creator<k054338_device>; | |
| 11260 | ||
| 11261 | k054338_device::k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11262 | : device_t(mconfig, K054338, "Konami 054338", tag, owner, clock) | |
| 11263 | { | |
| 11264 | m_token = global_alloc_array_clear(UINT8, sizeof(k054338_state)); | |
| 11265 | } | |
| 11266 | ||
| 11267 | //------------------------------------------------- | |
| 11268 | // device_config_complete - perform any | |
| 11269 | // operations now that the configuration is | |
| 11270 | // complete | |
| 11271 | //------------------------------------------------- | |
| 11272 | ||
| 11273 | void k054338_device::device_config_complete() | |
| 11274 | { | |
| 11275 | } | |
| 11276 | ||
| 11277 | //------------------------------------------------- | |
| 11278 | // device_start - device-specific startup | |
| 11279 | //------------------------------------------------- | |
| 11280 | ||
| 11281 | void k054338_device::device_start() | |
| 11282 | { | |
| 11283 | DEVICE_START_NAME( k054338 )(this); | |
| 11284 | } | |
| 11285 | ||
| 11286 | //------------------------------------------------- | |
| 11287 | // device_reset - device-specific reset | |
| 11288 | //------------------------------------------------- | |
| 11289 | ||
| 11290 | void k054338_device::device_reset() | |
| 11291 | { | |
| 11292 | DEVICE_RESET_NAME( k054338 )(this); | |
| 11293 | } | |
| 11294 | ||
| 11295 | ||
| 11296 | const device_type K001006 = &device_creator<k001006_device>; | |
| 11297 | ||
| 11298 | k001006_device::k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11299 | : device_t(mconfig, K001006, "Konami 001006", tag, owner, clock) | |
| 11300 | { | |
| 11301 | m_token = global_alloc_array_clear(UINT8, sizeof(k001006_state)); | |
| 11302 | } | |
| 11303 | ||
| 11304 | //------------------------------------------------- | |
| 11305 | // device_config_complete - perform any | |
| 11306 | // operations now that the configuration is | |
| 11307 | // complete | |
| 11308 | //------------------------------------------------- | |
| 11309 | ||
| 11310 | void k001006_device::device_config_complete() | |
| 11311 | { | |
| 11312 | } | |
| 11313 | ||
| 11314 | //------------------------------------------------- | |
| 11315 | // device_start - device-specific startup | |
| 11316 | //------------------------------------------------- | |
| 11317 | ||
| 11318 | void k001006_device::device_start() | |
| 11319 | { | |
| 11320 | DEVICE_START_NAME( k001006 )(this); | |
| 11321 | } | |
| 11322 | ||
| 11323 | //------------------------------------------------- | |
| 11324 | // device_reset - device-specific reset | |
| 11325 | //------------------------------------------------- | |
| 11326 | ||
| 11327 | void k001006_device::device_reset() | |
| 11328 | { | |
| 11329 | DEVICE_RESET_NAME( k001006 )(this); | |
| 11330 | } | |
| 11331 | ||
| 11332 | ||
| 11333 | const device_type K001005 = &device_creator<k001005_device>; | |
| 11334 | ||
| 11335 | k001005_device::k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11336 | : device_t(mconfig, K001005, "Konami 001005", tag, owner, clock) | |
| 11337 | { | |
| 11338 | m_token = global_alloc_array_clear(UINT8, sizeof(k001005_state)); | |
| 11339 | } | |
| 11340 | ||
| 11341 | //------------------------------------------------- | |
| 11342 | // device_config_complete - perform any | |
| 11343 | // operations now that the configuration is | |
| 11344 | // complete | |
| 11345 | //------------------------------------------------- | |
| 11346 | ||
| 11347 | void k001005_device::device_config_complete() | |
| 11348 | { | |
| 11349 | } | |
| 11350 | ||
| 11351 | //------------------------------------------------- | |
| 11352 | // device_start - device-specific startup | |
| 11353 | //------------------------------------------------- | |
| 11354 | ||
| 11355 | void k001005_device::device_start() | |
| 11356 | { | |
| 11357 | DEVICE_START_NAME( k001005 )(this); | |
| 11358 | } | |
| 11359 | ||
| 11360 | //------------------------------------------------- | |
| 11361 | // device_reset - device-specific reset | |
| 11362 | //------------------------------------------------- | |
| 11363 | ||
| 11364 | void k001005_device::device_reset() | |
| 11365 | { | |
| 11366 | DEVICE_RESET_NAME( k001005 )(this); | |
| 11367 | } | |
| 11368 | ||
| 11369 | //------------------------------------------------- | |
| 11370 | // device_stop - device-specific stop | |
| 11371 | //------------------------------------------------- | |
| 11372 | ||
| 11373 | void k001005_device::device_stop() | |
| 11374 | { | |
| 11375 | DEVICE_STOP_NAME( k001005 )(this); | |
| 11376 | } | |
| 11377 | ||
| 11378 | ||
| 11379 | const device_type K001604 = &device_creator<k001604_device>; | |
| 11380 | ||
| 11381 | k001604_device::k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11382 | : device_t(mconfig, K001604, "Konami 001604", tag, owner, clock) | |
| 11383 | { | |
| 11384 | m_token = global_alloc_array_clear(UINT8, sizeof(k001604_state)); | |
| 11385 | } | |
| 11386 | ||
| 11387 | //------------------------------------------------- | |
| 11388 | // device_config_complete - perform any | |
| 11389 | // operations now that the configuration is | |
| 11390 | // complete | |
| 11391 | //------------------------------------------------- | |
| 11392 | ||
| 11393 | void k001604_device::device_config_complete() | |
| 11394 | { | |
| 11395 | } | |
| 11396 | ||
| 11397 | //------------------------------------------------- | |
| 11398 | // device_start - device-specific startup | |
| 11399 | //------------------------------------------------- | |
| 11400 | ||
| 11401 | void k001604_device::device_start() | |
| 11402 | { | |
| 11403 | DEVICE_START_NAME( k001604 )(this); | |
| 11404 | } | |
| 11405 | ||
| 11406 | //------------------------------------------------- | |
| 11407 | // device_reset - device-specific reset | |
| 11408 | //------------------------------------------------- | |
| 11409 | ||
| 11410 | void k001604_device::device_reset() | |
| 11411 | { | |
| 11412 | DEVICE_RESET_NAME( k001604 )(this); | |
| 11413 | } | |
| 11414 | ||
| 11415 | ||
| 11416 | const device_type K037122 = &device_creator<k037122_device>; | |
| 11417 | ||
| 11418 | k037122_device::k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 11419 | : device_t(mconfig, K037122, "Konami 0371222", tag, owner, clock) | |
| 11420 | { | |
| 11421 | m_token = global_alloc_array_clear(UINT8, sizeof(k037122_state)); | |
| 11422 | } | |
| 11423 | ||
| 11424 | //------------------------------------------------- | |
| 11425 | // device_config_complete - perform any | |
| 11426 | // operations now that the configuration is | |
| 11427 | // complete | |
| 11428 | //------------------------------------------------- | |
| 11429 | ||
| 11430 | void k037122_device::device_config_complete() | |
| 11431 | { | |
| 11432 | } | |
| 11433 | ||
| 11434 | //------------------------------------------------- | |
| 11435 | // device_start - device-specific startup | |
| 11436 | //------------------------------------------------- | |
| 11437 | ||
| 11438 | void k037122_device::device_start() | |
| 11439 | { | |
| 11440 | DEVICE_START_NAME( k037122 )(this); | |
| 11441 | } | |
| 11442 | ||
| 11443 | //------------------------------------------------- | |
| 11444 | // device_reset - device-specific reset | |
| 11445 | //------------------------------------------------- | |
| 11446 | ||
| 11447 | void k037122_device::device_reset() | |
| 11448 | { | |
| 11449 | DEVICE_RESET_NAME( k037122 )(this); | |
| 11450 | } | |
| 11451 | ||
| 11452 |
| r17612 | r17613 | |
|---|---|---|
| 158 | 158 | int gfx_index; |
| 159 | 159 | }; |
| 160 | 160 | |
| 161 | DECLARE_LEGACY_DEVICE(K007121, k007121); | |
| 162 | DECLARE_LEGACY_DEVICE(K007342, k007342); | |
| 163 | DECLARE_LEGACY_DEVICE(K007420, k007420); | |
| 164 | DECLARE_LEGACY_DEVICE(K052109, k052109); | |
| 165 | DECLARE_LEGACY_DEVICE(K051960, k051960); | |
| 166 | DECLARE_LEGACY_DEVICE(K053244, k05324x); | |
| 161 | class k007121_device : public device_t | |
| 162 | { | |
| 163 | public: | |
| 164 | k007121_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 165 | ~k007121_device() { global_free(m_token); } | |
| 166 | ||
| 167 | // access to legacy token | |
| 168 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 169 | protected: | |
| 170 | // device-level overrides | |
| 171 | virtual void device_config_complete(); | |
| 172 | virtual void device_start(); | |
| 173 | virtual void device_reset(); | |
| 174 | private: | |
| 175 | // internal state | |
| 176 | void *m_token; | |
| 177 | }; | |
| 178 | ||
| 179 | extern const device_type K007121; | |
| 180 | ||
| 181 | class k007342_device : public device_t | |
| 182 | { | |
| 183 | public: | |
| 184 | k007342_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 185 | ~k007342_device() { global_free(m_token); } | |
| 186 | ||
| 187 | // access to legacy token | |
| 188 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 189 | protected: | |
| 190 | // device-level overrides | |
| 191 | virtual void device_config_complete(); | |
| 192 | virtual void device_start(); | |
| 193 | virtual void device_reset(); | |
| 194 | private: | |
| 195 | // internal state | |
| 196 | void *m_token; | |
| 197 | }; | |
| 198 | ||
| 199 | extern const device_type K007342; | |
| 200 | ||
| 201 | class k007420_device : public device_t | |
| 202 | { | |
| 203 | public: | |
| 204 | k007420_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 205 | ~k007420_device() { global_free(m_token); } | |
| 206 | ||
| 207 | // access to legacy token | |
| 208 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 209 | protected: | |
| 210 | // device-level overrides | |
| 211 | virtual void device_config_complete(); | |
| 212 | virtual void device_start(); | |
| 213 | virtual void device_reset(); | |
| 214 | private: | |
| 215 | // internal state | |
| 216 | void *m_token; | |
| 217 | }; | |
| 218 | ||
| 219 | extern const device_type K007420; | |
| 220 | ||
| 221 | class k052109_device : public device_t | |
| 222 | { | |
| 223 | public: | |
| 224 | k052109_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 225 | ~k052109_device() { global_free(m_token); } | |
| 226 | ||
| 227 | // access to legacy token | |
| 228 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 229 | protected: | |
| 230 | // device-level overrides | |
| 231 | virtual void device_config_complete(); | |
| 232 | virtual void device_start(); | |
| 233 | virtual void device_reset(); | |
| 234 | private: | |
| 235 | // internal state | |
| 236 | void *m_token; | |
| 237 | }; | |
| 238 | ||
| 239 | extern const device_type K052109; | |
| 240 | ||
| 241 | class k051960_device : public device_t | |
| 242 | { | |
| 243 | public: | |
| 244 | k051960_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 245 | ~k051960_device() { global_free(m_token); } | |
| 246 | ||
| 247 | // access to legacy token | |
| 248 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 249 | protected: | |
| 250 | // device-level overrides | |
| 251 | virtual void device_config_complete(); | |
| 252 | virtual void device_start(); | |
| 253 | virtual void device_reset(); | |
| 254 | private: | |
| 255 | // internal state | |
| 256 | void *m_token; | |
| 257 | }; | |
| 258 | ||
| 259 | extern const device_type K051960; | |
| 260 | ||
| 261 | class k05324x_device : public device_t | |
| 262 | { | |
| 263 | public: | |
| 264 | k05324x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 265 | ~k05324x_device() { global_free(m_token); } | |
| 266 | ||
| 267 | // access to legacy token | |
| 268 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 269 | protected: | |
| 270 | // device-level overrides | |
| 271 | virtual void device_config_complete(); | |
| 272 | virtual void device_start(); | |
| 273 | virtual void device_reset(); | |
| 274 | private: | |
| 275 | // internal state | |
| 276 | void *m_token; | |
| 277 | }; | |
| 278 | ||
| 279 | extern const device_type K053244; | |
| 280 | ||
| 167 | 281 | #define K053245 K053244 |
| 168 | DECLARE_LEGACY_DEVICE(K053246, k053247); | |
| 282 | class k053247_device : public device_t | |
| 283 | { | |
| 284 | public: | |
| 285 | k053247_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 286 | ~k053247_device() { global_free(m_token); } | |
| 287 | ||
| 288 | // access to legacy token | |
| 289 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 290 | protected: | |
| 291 | // device-level overrides | |
| 292 | virtual void device_config_complete(); | |
| 293 | virtual void device_start(); | |
| 294 | virtual void device_reset(); | |
| 295 | private: | |
| 296 | // internal state | |
| 297 | void *m_token; | |
| 298 | }; | |
| 299 | ||
| 300 | extern const device_type K053246; | |
| 301 | ||
| 169 | 302 | #define K053247 K053246 |
| 170 | DECLARE_LEGACY_DEVICE(K055673, k055673); | |
| 171 | DECLARE_LEGACY_DEVICE(K051316, k051316); | |
| 172 | DECLARE_LEGACY_DEVICE(K053936, k053936); | |
| 173 | DECLARE_LEGACY_DEVICE(K053251, k053251); | |
| 174 | DECLARE_LEGACY_DEVICE(K054000, k054000); | |
| 175 | DECLARE_LEGACY_DEVICE(K051733, k051733); | |
| 176 | DECLARE_LEGACY_DEVICE(K056832, k056832); | |
| 177 | DECLARE_LEGACY_DEVICE(K055555, k055555); | |
| 178 | DECLARE_LEGACY_DEVICE(K054338, k054338); | |
| 179 | DECLARE_LEGACY_DEVICE(K001006, k001006); | |
| 180 | DECLARE_LEGACY_DEVICE(K001005, k001005); | |
| 181 | DECLARE_LEGACY_DEVICE(K001604, k001604); | |
| 182 | DECLARE_LEGACY_DEVICE(K037122, k037122); | |
| 303 | class k055673_device : public device_t | |
| 304 | { | |
| 305 | public: | |
| 306 | k055673_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 307 | ~k055673_device() { global_free(m_token); } | |
| 183 | 308 | |
| 309 | // access to legacy token | |
| 310 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 311 | protected: | |
| 312 | // device-level overrides | |
| 313 | virtual void device_config_complete(); | |
| 314 | virtual void device_start(); | |
| 315 | virtual void device_reset(); | |
| 316 | private: | |
| 317 | // internal state | |
| 318 | void *m_token; | |
| 319 | }; | |
| 184 | 320 | |
| 321 | extern const device_type K055673; | |
| 322 | ||
| 323 | class k051316_device : public device_t | |
| 324 | { | |
| 325 | public: | |
| 326 | k051316_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 327 | ~k051316_device() { global_free(m_token); } | |
| 328 | ||
| 329 | // access to legacy token | |
| 330 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 331 | protected: | |
| 332 | // device-level overrides | |
| 333 | virtual void device_config_complete(); | |
| 334 | virtual void device_start(); | |
| 335 | virtual void device_reset(); | |
| 336 | private: | |
| 337 | // internal state | |
| 338 | void *m_token; | |
| 339 | }; | |
| 340 | ||
| 341 | extern const device_type K051316; | |
| 342 | ||
| 343 | class k053936_device : public device_t | |
| 344 | { | |
| 345 | public: | |
| 346 | k053936_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 347 | ~k053936_device() { global_free(m_token); } | |
| 348 | ||
| 349 | // access to legacy token | |
| 350 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 351 | protected: | |
| 352 | // device-level overrides | |
| 353 | virtual void device_config_complete(); | |
| 354 | virtual void device_start(); | |
| 355 | virtual void device_reset(); | |
| 356 | private: | |
| 357 | // internal state | |
| 358 | void *m_token; | |
| 359 | }; | |
| 360 | ||
| 361 | extern const device_type K053936; | |
| 362 | ||
| 363 | class k053251_device : public device_t | |
| 364 | { | |
| 365 | public: | |
| 366 | k053251_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 367 | ~k053251_device() { global_free(m_token); } | |
| 368 | ||
| 369 | // access to legacy token | |
| 370 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 371 | protected: | |
| 372 | // device-level overrides | |
| 373 | virtual void device_config_complete(); | |
| 374 | virtual void device_start(); | |
| 375 | virtual void device_reset(); | |
| 376 | private: | |
| 377 | // internal state | |
| 378 | void *m_token; | |
| 379 | }; | |
| 380 | ||
| 381 | extern const device_type K053251; | |
| 382 | ||
| 383 | class k054000_device : public device_t | |
| 384 | { | |
| 385 | public: | |
| 386 | k054000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 387 | ~k054000_device() { global_free(m_token); } | |
| 388 | ||
| 389 | // access to legacy token | |
| 390 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 391 | protected: | |
| 392 | // device-level overrides | |
| 393 | virtual void device_config_complete(); | |
| 394 | virtual void device_start(); | |
| 395 | virtual void device_reset(); | |
| 396 | private: | |
| 397 | // internal state | |
| 398 | void *m_token; | |
| 399 | }; | |
| 400 | ||
| 401 | extern const device_type K054000; | |
| 402 | ||
| 403 | class k051733_device : public device_t | |
| 404 | { | |
| 405 | public: | |
| 406 | k051733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 407 | ~k051733_device() { global_free(m_token); } | |
| 408 | ||
| 409 | // access to legacy token | |
| 410 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 411 | protected: | |
| 412 | // device-level overrides | |
| 413 | virtual void device_config_complete(); | |
| 414 | virtual void device_start(); | |
| 415 | virtual void device_reset(); | |
| 416 | private: | |
| 417 | // internal state | |
| 418 | void *m_token; | |
| 419 | }; | |
| 420 | ||
| 421 | extern const device_type K051733; | |
| 422 | ||
| 423 | class k056832_device : public device_t | |
| 424 | { | |
| 425 | public: | |
| 426 | k056832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 427 | ~k056832_device() { global_free(m_token); } | |
| 428 | ||
| 429 | // access to legacy token | |
| 430 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 431 | protected: | |
| 432 | // device-level overrides | |
| 433 | virtual void device_config_complete(); | |
| 434 | virtual void device_start(); | |
| 435 | private: | |
| 436 | // internal state | |
| 437 | void *m_token; | |
| 438 | }; | |
| 439 | ||
| 440 | extern const device_type K056832; | |
| 441 | ||
| 442 | class k055555_device : public device_t | |
| 443 | { | |
| 444 | public: | |
| 445 | k055555_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 446 | ~k055555_device() { global_free(m_token); } | |
| 447 | ||
| 448 | // access to legacy token | |
| 449 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 450 | protected: | |
| 451 | // device-level overrides | |
| 452 | virtual void device_config_complete(); | |
| 453 | virtual void device_start(); | |
| 454 | virtual void device_reset(); | |
| 455 | private: | |
| 456 | // internal state | |
| 457 | void *m_token; | |
| 458 | }; | |
| 459 | ||
| 460 | extern const device_type K055555; | |
| 461 | ||
| 462 | class k054338_device : public device_t | |
| 463 | { | |
| 464 | public: | |
| 465 | k054338_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 466 | ~k054338_device() { global_free(m_token); } | |
| 467 | ||
| 468 | // access to legacy token | |
| 469 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 470 | protected: | |
| 471 | // device-level overrides | |
| 472 | virtual void device_config_complete(); | |
| 473 | virtual void device_start(); | |
| 474 | virtual void device_reset(); | |
| 475 | private: | |
| 476 | // internal state | |
| 477 | void *m_token; | |
| 478 | }; | |
| 479 | ||
| 480 | extern const device_type K054338; | |
| 481 | ||
| 482 | class k001006_device : public device_t | |
| 483 | { | |
| 484 | public: | |
| 485 | k001006_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 486 | ~k001006_device() { global_free(m_token); } | |
| 487 | ||
| 488 | // access to legacy token | |
| 489 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 490 | protected: | |
| 491 | // device-level overrides | |
| 492 | virtual void device_config_complete(); | |
| 493 | virtual void device_start(); | |
| 494 | virtual void device_reset(); | |
| 495 | private: | |
| 496 | // internal state | |
| 497 | void *m_token; | |
| 498 | }; | |
| 499 | ||
| 500 | extern const device_type K001006; | |
| 501 | ||
| 502 | class k001005_device : public device_t | |
| 503 | { | |
| 504 | public: | |
| 505 | k001005_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 506 | ~k001005_device() { global_free(m_token); } | |
| 507 | ||
| 508 | // access to legacy token | |
| 509 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 510 | protected: | |
| 511 | // device-level overrides | |
| 512 | virtual void device_config_complete(); | |
| 513 | virtual void device_start(); | |
| 514 | virtual void device_stop(); | |
| 515 | virtual void device_reset(); | |
| 516 | private: | |
| 517 | // internal state | |
| 518 | void *m_token; | |
| 519 | }; | |
| 520 | ||
| 521 | extern const device_type K001005; | |
| 522 | ||
| 523 | class k001604_device : public device_t | |
| 524 | { | |
| 525 | public: | |
| 526 | k001604_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 527 | ~k001604_device() { global_free(m_token); } | |
| 528 | ||
| 529 | // access to legacy token | |
| 530 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 531 | protected: | |
| 532 | // device-level overrides | |
| 533 | virtual void device_config_complete(); | |
| 534 | virtual void device_start(); | |
| 535 | virtual void device_reset(); | |
| 536 | private: | |
| 537 | // internal state | |
| 538 | void *m_token; | |
| 539 | }; | |
| 540 | ||
| 541 | extern const device_type K001604; | |
| 542 | ||
| 543 | class k037122_device : public device_t | |
| 544 | { | |
| 545 | public: | |
| 546 | k037122_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 547 | ~k037122_device() { global_free(m_token); } | |
| 548 | ||
| 549 | // access to legacy token | |
| 550 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 551 | protected: | |
| 552 | // device-level overrides | |
| 553 | virtual void device_config_complete(); | |
| 554 | virtual void device_start(); | |
| 555 | virtual void device_reset(); | |
| 556 | private: | |
| 557 | // internal state | |
| 558 | void *m_token; | |
| 559 | }; | |
| 560 | ||
| 561 | extern const device_type K037122; | |
| 562 | ||
| 563 | ||
| 564 | ||
| 185 | 565 | /*************************************************************************** |
| 186 | 566 | DEVICE CONFIGURATION MACROS |
| 187 | 567 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | #include "sound/okiadpcm.h" |
| 28 | 28 | #include "includes/mjkjidai.h" |
| 29 | 29 | |
| 30 | class mjkjidai_adpcm_device : public device_t, | |
| 31 | public device_sound_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | ~mjkjidai_adpcm_device() { global_free(m_token); } | |
| 36 | ||
| 37 | // access to legacy token | |
| 38 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 39 | protected: | |
| 40 | // device-level overrides | |
| 41 | virtual void device_config_complete(); | |
| 42 | virtual void device_start(); | |
| 43 | ||
| 44 | // sound stream update overrides | |
| 45 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 46 | private: | |
| 47 | // internal state | |
| 48 | void *m_token; | |
| 49 | }; | |
| 50 | ||
| 51 | extern const device_type MJKJIDAI; | |
| 52 | ||
| 30 | 53 | /* Start of ADPCM custom chip code */ |
| 31 | 54 | typedef struct _mjkjidai_adpcm_state mjkjidai_adpcm_state; |
| 32 | 55 | struct _mjkjidai_adpcm_state |
| r17612 | r17613 | |
| 70 | 93 | static DEVICE_START( mjkjidai_adpcm ) |
| 71 | 94 | { |
| 72 | 95 | running_machine &machine = device->machine(); |
| 73 | mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast< | |
| 96 | mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_devic | |
| 74 | 97 | |
| 75 | 98 | state->m_playing = 0; |
| 76 | 99 | state->m_stream = device->machine().sound().stream_alloc(*device, 0, 1, device->clock(), state, mjkjidai_adpcm_callback); |
| r17612 | r17613 | |
| 93 | 116 | } |
| 94 | 117 | } |
| 95 | 118 | |
| 96 | DECLARE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm); | |
| 97 | DEFINE_LEGACY_SOUND_DEVICE(MJKJIDAI, mjkjidai_adpcm); | |
| 119 | const device_type MJKJIDAI = &device_creator<mjkjidai_adpcm_device>; | |
| 98 | 120 | |
| 121 | mjkjidai_adpcm_device::mjkjidai_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 122 | : device_t(mconfig, MJKJIDAI, "Custom ADPCM", tag, owner, clock), | |
| 123 | device_sound_interface(mconfig, *this) | |
| 124 | { | |
| 125 | m_token = global_alloc_array_clear(UINT8, sizeof(mjkjidai_adpcm_state)); | |
| 126 | } | |
| 99 | 127 | |
| 128 | //------------------------------------------------- | |
| 129 | // device_config_complete - perform any | |
| 130 | // operations now that the configuration is | |
| 131 | // complete | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | void mjkjidai_adpcm_device::device_config_complete() | |
| 135 | { | |
| 136 | } | |
| 137 | ||
| 138 | //------------------------------------------------- | |
| 139 | // device_start - device-specific startup | |
| 140 | //------------------------------------------------- | |
| 141 | ||
| 142 | void mjkjidai_adpcm_device::device_start() | |
| 143 | { | |
| 144 | DEVICE_START_NAME( mjkjidai_adpcm )(this); | |
| 145 | } | |
| 146 | ||
| 147 | //------------------------------------------------- | |
| 148 | // sound_stream_update - handle a stream update | |
| 149 | //------------------------------------------------- | |
| 150 | ||
| 151 | void mjkjidai_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 152 | { | |
| 153 | // should never get here | |
| 154 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 155 | } | |
| 156 | ||
| 157 | ||
| 158 | ||
| 159 | ||
| 100 | 160 | static void mjkjidai_adpcm_play (mjkjidai_adpcm_state *state, int offset, int length) |
| 101 | 161 | { |
| 102 | 162 | state->m_current = offset; |
| r17612 | r17613 | |
| 108 | 168 | WRITE8_MEMBER(mjkjidai_state::adpcm_w) |
| 109 | 169 | { |
| 110 | 170 | device_t *device = machine().device("adpcm"); |
| 111 | mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast< | |
| 171 | mjkjidai_adpcm_state *state = (mjkjidai_adpcm_state *)downcast<mjkjidai_adpcm_devic | |
| 112 | 172 | mjkjidai_adpcm_play (state, (data & 0x07) * 0x1000, 0x1000 * 2); |
| 113 | 173 | } |
| 114 | 174 | /* End of ADPCM custom chip code */ |
| r17612 | r17613 | |
|---|---|---|
| 123 | 123 | UINT8 *m_base; |
| 124 | 124 | } _renegade_adpcm_state_dummy; |
| 125 | 125 | |
| 126 | DECLARE_LEGACY_SOUND_DEVICE(RENEGADE_ADPCM, renegade_adpcm); | |
| 126 | class renegade_adpcm_device : public device_t, | |
| 127 | public device_sound_interface | |
| 128 | { | |
| 129 | public: | |
| 130 | renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 131 | ~renegade_adpcm_device() { global_free(m_token); } | |
| 127 | 132 | |
| 133 | // access to legacy token | |
| 134 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 135 | protected: | |
| 136 | // device-level overrides | |
| 137 | virtual void device_config_complete(); | |
| 138 | virtual void device_start(); | |
| 139 | ||
| 140 | // sound stream update overrides | |
| 141 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 142 | private: | |
| 143 | // internal state | |
| 144 | void *m_token; | |
| 145 | }; | |
| 146 | ||
| 147 | extern const device_type RENEGADE_ADPCM; | |
| 148 | ||
| 149 | ||
| 128 | 150 | INLINE renegade_adpcm_state *get_safe_token(device_t *device) |
| 129 | 151 | { |
| 130 | 152 | assert(device != NULL); |
| 131 | 153 | assert(device->type() == RENEGADE_ADPCM); |
| 132 | 154 | |
| 133 | return (renegade_adpcm_state *)downcast< | |
| 155 | return (renegade_adpcm_state *)downcast<renegade_adpcm_devic | |
| 134 | 156 | } |
| 135 | 157 | |
| 136 | 158 | static STREAM_UPDATE( renegade_adpcm_callback ) |
| r17612 | r17613 | |
| 185 | 207 | } |
| 186 | 208 | } |
| 187 | 209 | |
| 188 | ||
| 210 | const device_type | |
| 189 | 211 | |
| 212 | renegade_adpcm_device::renegade_adpcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 213 | : device_t(mconfig, RENEGADE_ADPCM, "Renegade Custom ADPCM", tag, owner, clock), | |
| 214 | device_sound_interface(mconfig, *this) | |
| 215 | { | |
| 216 | m_token = global_alloc_array_clear(UINT8, sizeof(renegade_adpcm_state)); | |
| 217 | } | |
| 190 | 218 | |
| 219 | //------------------------------------------------- | |
| 220 | // device_config_complete - perform any | |
| 221 | // operations now that the configuration is | |
| 222 | // complete | |
| 223 | //------------------------------------------------- | |
| 224 | ||
| 225 | void renegade_adpcm_device::device_config_complete() | |
| 226 | { | |
| 227 | } | |
| 228 | ||
| 229 | //------------------------------------------------- | |
| 230 | // device_start - device-specific startup | |
| 231 | //------------------------------------------------- | |
| 232 | ||
| 233 | void renegade_adpcm_device::device_start() | |
| 234 | { | |
| 235 | DEVICE_START_NAME( renegade_adpcm )(this); | |
| 236 | } | |
| 237 | ||
| 238 | //------------------------------------------------- | |
| 239 | // sound_stream_update - handle a stream update | |
| 240 | //------------------------------------------------- | |
| 241 | ||
| 242 | void renegade_adpcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 243 | { | |
| 244 | // should never get here | |
| 245 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 246 | } | |
| 247 | ||
| 248 | ||
| 249 | ||
| 250 | ||
| 191 | 251 | WRITE8_MEMBER(renegade_state::adpcm_play_w) |
| 192 | 252 | { |
| 193 | 253 | device_t *device = machine().device("adpcm"); |
| r17612 | r17613 | |
|---|---|---|
| 686 | 686 | } |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | DECLARE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer); | |
| 690 | DEFINE_LEGACY_SOUND_DEVICE(SUBWOOFER, subwoofer); | |
| 689 | class subwoofer_device : public device_t, | |
| 690 | public device_sound_interface | |
| 691 | { | |
| 692 | public: | |
| 693 | subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 694 | ~subwoofer_device() { global_free(m_token); } | |
| 695 | ||
| 696 | // access to legacy token | |
| 697 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 698 | protected: | |
| 699 | // device-level overrides | |
| 700 | virtual void device_config_complete(); | |
| 701 | virtual void device_start(); | |
| 702 | ||
| 703 | // sound stream update overrides | |
| 704 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 705 | private: | |
| 706 | // internal state | |
| 707 | void *m_token; | |
| 708 | }; | |
| 709 | ||
| 710 | extern const device_type SUBWOOFER; | |
| 711 | ||
| 712 | const device_type SUBWOOFER = &device_creator<subwoofer_device>; | |
| 713 | ||
| 714 | subwoofer_device::subwoofer_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 715 | : device_t(mconfig, SUBWOOFER, "Subwoofer", tag, owner, clock), | |
| 716 | device_sound_interface(mconfig, *this) | |
| 717 | { | |
| 718 | m_token = global_alloc_array_clear(UINT8, sizeof()); | |
| 719 | } | |
| 720 | ||
| 721 | //------------------------------------------------- | |
| 722 | // device_config_complete - perform any | |
| 723 | // operations now that the configuration is | |
| 724 | // complete | |
| 725 | //------------------------------------------------- | |
| 726 | ||
| 727 | void subwoofer_device::device_config_complete() | |
| 728 | { | |
| 729 | } | |
| 730 | ||
| 731 | //------------------------------------------------- | |
| 732 | // device_start - device-specific startup | |
| 733 | //------------------------------------------------- | |
| 734 | ||
| 735 | void subwoofer_device::device_start() | |
| 736 | { | |
| 737 | DEVICE_START_NAME( subwoofer )(this); | |
| 738 | } | |
| 739 | ||
| 740 | //------------------------------------------------- | |
| 741 | // sound_stream_update - handle a stream update | |
| 742 | //------------------------------------------------- | |
| 743 | ||
| 744 | void subwoofer_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 745 | { | |
| 746 | // should never get here | |
| 747 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 748 | } | |
| 749 | ||
| 750 | ||
| 691 | 751 | #endif |
| 692 | 752 | |
| 693 | 753 |
| r17612 | r17613 | |
|---|---|---|
| 58 | 58 | assert(device != NULL); |
| 59 | 59 | assert(device->type() == HD63484); |
| 60 | 60 | |
| 61 | return (hd63484_state *)downcast< | |
| 61 | return (hd63484_state *)downcast<hd63484_devic | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | INLINE const hd63484_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 1591 | 1591 | } |
| 1592 | 1592 | } |
| 1593 | 1593 | |
| 1594 | DEFINE_LEGACY_DEVICE(HD63484, hd63484); | |
| 1594 | const device_type HD63484 = &device_creator<hd63484_device>; | |
| 1595 | ||
| 1596 | hd63484_device::hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1597 | : device_t(mconfig, HD63484, "HD63484", tag, owner, clock) | |
| 1598 | { | |
| 1599 | m_token = global_alloc_array_clear(UINT8, sizeof(hd63484_state)); | |
| 1600 | } | |
| 1601 | ||
| 1602 | //------------------------------------------------- | |
| 1603 | // device_config_complete - perform any | |
| 1604 | // operations now that the configuration is | |
| 1605 | // complete | |
| 1606 | //------------------------------------------------- | |
| 1607 | ||
| 1608 | void hd63484_device::device_config_complete() | |
| 1609 | { | |
| 1610 | } | |
| 1611 | ||
| 1612 | //------------------------------------------------- | |
| 1613 | // device_start - device-specific startup | |
| 1614 | //------------------------------------------------- | |
| 1615 | ||
| 1616 | void hd63484_device::device_start() | |
| 1617 | { | |
| 1618 | DEVICE_START_NAME( hd63484 )(this); | |
| 1619 | } | |
| 1620 | ||
| 1621 | //------------------------------------------------- | |
| 1622 | // device_reset - device-specific reset | |
| 1623 | //------------------------------------------------- | |
| 1624 | ||
| 1625 | void hd63484_device::device_reset() | |
| 1626 | { | |
| 1627 | DEVICE_RESET_NAME( hd63484 )(this); | |
| 1628 | } | |
| 1629 | ||
| 1630 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | TYPE DEFINITIONS |
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_DEVICE(HD63484, hd63484); | |
| 17 | class hd63484_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | hd63484_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~hd63484_device() { global_free(m_token); } | |
| 18 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_reset(); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type HD63484; | |
| 36 | ||
| 37 | ||
| 19 | 38 | #define HD63484_RAM_SIZE 0x100000 |
| 20 | 39 | |
| 21 | 40 | typedef struct _hd63484_interface hd63484_interface; |
| r17612 | r17613 | |
|---|---|---|
| 52 | 52 | assert(device != NULL); |
| 53 | 53 | assert(device->type() == TLC34076); |
| 54 | 54 | |
| 55 | return (tlc34076_state *)downcast<l | |
| 55 | return (tlc34076_state *)downcast<tl | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /************************************* |
| r17612 | r17613 | |
| 295 | 295 | } |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | DEFINE_LEGACY_DEVICE(TLC34076, tlc34076); | |
| 298 | const device_type TLC34076 = &device_creator<tlc34076_device>; | |
| 299 | ||
| 300 | tlc34076_device::tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 301 | : device_t(mconfig, TLC34076, "TLC34076", tag, owner, clock) | |
| 302 | { | |
| 303 | m_token = global_alloc_array_clear(UINT8, sizeof(tlc34076_state)); | |
| 304 | } | |
| 305 | ||
| 306 | //------------------------------------------------- | |
| 307 | // device_config_complete - perform any | |
| 308 | // operations now that the configuration is | |
| 309 | // complete | |
| 310 | //------------------------------------------------- | |
| 311 | ||
| 312 | void tlc34076_device::device_config_complete() | |
| 313 | { | |
| 314 | } | |
| 315 | ||
| 316 | //------------------------------------------------- | |
| 317 | // device_start - device-specific startup | |
| 318 | //------------------------------------------------- | |
| 319 | ||
| 320 | void tlc34076_device::device_start() | |
| 321 | { | |
| 322 | DEVICE_START_NAME( tlc34076 )(this); | |
| 323 | } | |
| 324 | ||
| 325 | //------------------------------------------------- | |
| 326 | // device_reset - device-specific reset | |
| 327 | //------------------------------------------------- | |
| 328 | ||
| 329 | void tlc34076_device::device_reset() | |
| 330 | { | |
| 331 | DEVICE_RESET_NAME( tlc34076 )(this); | |
| 332 | } | |
| 333 | ||
| 334 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | |
| 26 | 26 | extern const tlc34076_config tlc34076_6_bit_intf; |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_DEVICE(TLC34076, tlc34076); | |
| 28 | class tlc34076_device : public device_t | |
| 29 | { | |
| 30 | public: | |
| 31 | tlc34076_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~tlc34076_device() { global_free(m_token); } | |
| 29 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_reset(); | |
| 41 | private: | |
| 42 | // internal state | |
| 43 | void *m_token; | |
| 44 | }; | |
| 30 | 45 | |
| 46 | extern const device_type TLC34076; | |
| 47 | ||
| 48 | ||
| 49 | ||
| 31 | 50 | /*************************************************************************** |
| 32 | 51 | DEVICE CONFIGURATION MACROS |
| 33 | 52 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 316 | 316 | assert(device != NULL); |
| 317 | 317 | assert((device->type() == VOODOO_1) || (device->type() == VOODOO_2) || (device->type() == VOODOO_BANSHEE) || (device->type() == VOODOO_3)); |
| 318 | 318 | |
| 319 | return (voodoo_state *)downcast< | |
| 319 | return (voodoo_state *)downcast<voodoo_devic | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
| r17612 | r17613 | |
| 5713 | 5713 | } |
| 5714 | 5714 | } |
| 5715 | 5715 | |
| 5716 | DEFINE_LEGACY_DEVICE(VOODOO_1, voodoo_1); | |
| 5717 | DEFINE_LEGACY_DEVICE(VOODOO_2, voodoo_2); | |
| 5718 | DEFINE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee); | |
| 5719 | DEFINE_LEGACY_DEVICE(VOODOO_3, voodoo_3); | |
| 5716 | voodoo_device::voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 5717 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 5718 | { | |
| 5719 | m_token = global_alloc_array_clear(UINT8, sizeof(voodoo_state)); | |
| 5720 | } | |
| 5720 | 5721 | |
| 5722 | //------------------------------------------------- | |
| 5723 | // device_config_complete - perform any | |
| 5724 | // operations now that the configuration is | |
| 5725 | // complete | |
| 5726 | //------------------------------------------------- | |
| 5727 | ||
| 5728 | void voodoo_device::device_config_complete() | |
| 5729 | { | |
| 5730 | } | |
| 5731 | ||
| 5732 | //------------------------------------------------- | |
| 5733 | // device_reset - device-specific reset | |
| 5734 | //------------------------------------------------- | |
| 5735 | ||
| 5736 | void voodoo_device::device_reset() | |
| 5737 | { | |
| 5738 | DEVICE_RESET_NAME( voodoo )(this); | |
| 5739 | } | |
| 5740 | ||
| 5741 | //------------------------------------------------- | |
| 5742 | // device_stop - device-specific stop | |
| 5743 | //------------------------------------------------- | |
| 5744 | ||
| 5745 | void voodoo_device::device_stop() | |
| 5746 | { | |
| 5747 | DEVICE_STOP_NAME( voodoo )(this); | |
| 5748 | } | |
| 5749 | ||
| 5750 | ||
| 5751 | const device_type VOODOO_1 = &device_creator<voodoo_1_device>; | |
| 5752 | ||
| 5753 | voodoo_1_device::voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5754 | : voodoo_device(mconfig, VOODOO_1, "3dfx Voodoo Graphics", tag, owner, clock) | |
| 5755 | { | |
| 5756 | } | |
| 5757 | ||
| 5758 | //------------------------------------------------- | |
| 5759 | // device_start - device-specific startup | |
| 5760 | //------------------------------------------------- | |
| 5761 | ||
| 5762 | void voodoo_1_device::device_start() | |
| 5763 | { | |
| 5764 | DEVICE_START_NAME( voodoo_1 )(this); | |
| 5765 | } | |
| 5766 | ||
| 5767 | ||
| 5768 | const device_type VOODOO_2 = &device_creator<voodoo_2_device>; | |
| 5769 | ||
| 5770 | voodoo_2_device::voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5771 | : voodoo_device(mconfig, VOODOO_2, "3dfx Voodoo 2", tag, owner, clock) | |
| 5772 | { | |
| 5773 | } | |
| 5774 | ||
| 5775 | //------------------------------------------------- | |
| 5776 | // device_start - device-specific startup | |
| 5777 | //------------------------------------------------- | |
| 5778 | ||
| 5779 | void voodoo_2_device::device_start() | |
| 5780 | { | |
| 5781 | DEVICE_START_NAME( voodoo_2 )(this); | |
| 5782 | } | |
| 5783 | ||
| 5784 | ||
| 5785 | const device_type VOODOO_BANSHEE = &device_creator<voodoo_banshee_device>; | |
| 5786 | ||
| 5787 | voodoo_banshee_device::voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5788 | : voodoo_device(mconfig, VOODOO_BANSHEE, "3dfx Voodoo Banshee", tag, owner, clock) | |
| 5789 | { | |
| 5790 | } | |
| 5791 | ||
| 5792 | //------------------------------------------------- | |
| 5793 | // device_start - device-specific startup | |
| 5794 | //------------------------------------------------- | |
| 5795 | ||
| 5796 | void voodoo_banshee_device::device_start() | |
| 5797 | { | |
| 5798 | DEVICE_START_NAME( voodoo_banshee )(this); | |
| 5799 | } | |
| 5800 | ||
| 5801 | ||
| 5802 | const device_type VOODOO_3 = &device_creator<voodoo_3_device>; | |
| 5803 | ||
| 5804 | voodoo_3_device::voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 5805 | : voodoo_device(mconfig, VOODOO_3, "3dfx Voodoo 3", tag, owner, clock) | |
| 5806 | { | |
| 5807 | } | |
| 5808 | ||
| 5809 | //------------------------------------------------- | |
| 5810 | // device_start - device-specific startup | |
| 5811 | //------------------------------------------------- | |
| 5812 | ||
| 5813 | void voodoo_3_device::device_start() | |
| 5814 | { | |
| 5815 | DEVICE_START_NAME( voodoo_3 )(this); | |
| 5816 | } | |
| 5817 | ||
| 5818 | ||
| 5819 | ||
| 5721 | 5820 | /*************************************************************************** |
| 5722 | 5821 | GENERIC RASTERIZERS |
| 5723 | 5822 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | /* ----- device interface ----- */ |
| 130 | 130 | |
| 131 | DECLARE_LEGACY_DEVICE(VOODOO_1, voodoo_1); | |
| 132 | DECLARE_LEGACY_DEVICE(VOODOO_2, voodoo_2); | |
| 133 | DECLARE_LEGACY_DEVICE(VOODOO_BANSHEE, voodoo_banshee); | |
| 134 | DECLARE_LEGACY_DEVICE(VOODOO_3, voodoo_3); | |
| 131 | class voodoo_device : public device_t | |
| 132 | { | |
| 133 | public: | |
| 134 | voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 135 | ~voodoo_device() { global_free(m_token); } | |
| 136 | ||
| 137 | // access to legacy token | |
| 138 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 139 | protected: | |
| 140 | // device-level overrides | |
| 141 | virtual void device_config_complete(); | |
| 142 | virtual void device_stop(); | |
| 143 | virtual void device_reset(); | |
| 144 | private: | |
| 145 | // internal state | |
| 146 | void *m_token; | |
| 147 | }; | |
| 148 | ||
| 149 | class voodoo_1_device : public voodoo_device | |
| 150 | { | |
| 151 | public: | |
| 152 | voodoo_1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 153 | protected: | |
| 154 | // device-level overrides | |
| 155 | virtual void device_start(); | |
| 156 | }; | |
| 157 | ||
| 158 | extern const device_type VOODOO_1; | |
| 159 | ||
| 160 | class voodoo_2_device : public voodoo_device | |
| 161 | { | |
| 162 | public: | |
| 163 | voodoo_2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 164 | protected: | |
| 165 | // device-level overrides | |
| 166 | virtual void device_start(); | |
| 167 | }; | |
| 168 | ||
| 169 | extern const device_type VOODOO_2; | |
| 170 | ||
| 171 | class voodoo_banshee_device : public voodoo_device | |
| 172 | { | |
| 173 | public: | |
| 174 | voodoo_banshee_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 175 | protected: | |
| 176 | // device-level overrides | |
| 177 | virtual void device_start(); | |
| 178 | }; | |
| 179 | ||
| 180 | extern const device_type VOODOO_BANSHEE; | |
| 181 | ||
| 182 | class voodoo_3_device : public voodoo_device | |
| 183 | { | |
| 184 | public: | |
| 185 | voodoo_3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 186 | protected: | |
| 187 | // device-level overrides | |
| 188 | virtual void device_start(); | |
| 189 | }; | |
| 190 | ||
| 191 | extern const device_type VOODOO_3; | |
| 192 | ||
| 135 | 193 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 132 | 132 | assert(device != NULL); |
| 133 | 133 | assert(device->type() == I8275); |
| 134 | 134 | |
| 135 | return (i8275_t *)downcast< | |
| 135 | return (i8275_t *)downcast<i8275 | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| r17612 | r17613 | |
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | |
| 612 | DEFINE_LEGACY_DEVICE(I8275, i8275); | |
| 612 | const device_type I8275 = &device_creator<i8275_device>; | |
| 613 | ||
| 614 | i8275_device::i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 615 | : device_t(mconfig, I8275, "Intel 8275", tag, owner, clock) | |
| 616 | { | |
| 617 | m_token = global_alloc_array_clear(UINT8, sizeof(i8275_t)); | |
| 618 | } | |
| 619 | ||
| 620 | //------------------------------------------------- | |
| 621 | // device_config_complete - perform any | |
| 622 | // operations now that the configuration is | |
| 623 | // complete | |
| 624 | //------------------------------------------------- | |
| 625 | ||
| 626 | void i8275_device::device_config_complete() | |
| 627 | { | |
| 628 | } | |
| 629 | ||
| 630 | //------------------------------------------------- | |
| 631 | // device_start - device-specific startup | |
| 632 | //------------------------------------------------- | |
| 633 | ||
| 634 | void i8275_device::device_start() | |
| 635 | { | |
| 636 | DEVICE_START_NAME( i8275 )(this); | |
| 637 | } | |
| 638 | ||
| 639 | //------------------------------------------------- | |
| 640 | // device_reset - device-specific reset | |
| 641 | //------------------------------------------------- | |
| 642 | ||
| 643 | void i8275_device::device_reset() | |
| 644 | { | |
| 645 | DEVICE_RESET_NAME( i8275 )(this); | |
| 646 | } | |
| 647 | ||
| 648 |
| r17612 | r17613 | |
|---|---|---|
| 119 | 119 | assert(device != NULL); |
| 120 | 120 | assert(device->type() == S2636); |
| 121 | 121 | |
| 122 | return (s2636_state *)downcast< | |
| 122 | return (s2636_state *)downcast<s2636 | |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | INLINE const s2636_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 377 | 377 | } |
| 378 | 378 | } |
| 379 | 379 | |
| 380 | DEFINE_LEGACY_DEVICE(S2636, s2636); | |
| 380 | const device_type S2636 = &device_creator<s2636_device>; | |
| 381 | ||
| 382 | s2636_device::s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 383 | : device_t(mconfig, S2636, "Signetics 2636", tag, owner, clock) | |
| 384 | { | |
| 385 | m_token = global_alloc_array_clear(UINT8, sizeof(s2636_state)); | |
| 386 | } | |
| 387 | ||
| 388 | //------------------------------------------------- | |
| 389 | // device_config_complete - perform any | |
| 390 | // operations now that the configuration is | |
| 391 | // complete | |
| 392 | //------------------------------------------------- | |
| 393 | ||
| 394 | void s2636_device::device_config_complete() | |
| 395 | { | |
| 396 | } | |
| 397 | ||
| 398 | //------------------------------------------------- | |
| 399 | // device_start - device-specific startup | |
| 400 | //------------------------------------------------- | |
| 401 | ||
| 402 | void s2636_device::device_start() | |
| 403 | { | |
| 404 | DEVICE_START_NAME( s2636 )(this); | |
| 405 | } | |
| 406 | ||
| 407 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | MACROS |
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | DECLARE_LEGACY_DEVICE(I8275, i8275); | |
| 21 | class i8275_device : public device_t | |
| 22 | { | |
| 23 | public: | |
| 24 | i8275_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~i8275_device() { global_free(m_token); } | |
| 22 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | private: | |
| 35 | // internal state | |
| 36 | void *m_token; | |
| 37 | }; | |
| 38 | ||
| 39 | extern const device_type I8275; | |
| 40 | ||
| 41 | ||
| 23 | 42 | /*************************************************************************** |
| 24 | 43 | TYPE DEFINITIONS |
| 25 | 44 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 35 | 35 | * |
| 36 | 36 | *************************************/ |
| 37 | 37 | |
| 38 | DECLARE_LEGACY_DEVICE(S2636, s2636); | |
| 38 | class s2636_device : public device_t | |
| 39 | { | |
| 40 | public: | |
| 41 | s2636_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | ~s2636_device() { global_free(m_token); } | |
| 39 | 43 | |
| 44 | // access to legacy token | |
| 45 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_config_complete(); | |
| 49 | virtual void device_start(); | |
| 50 | private: | |
| 51 | // internal state | |
| 52 | void *m_token; | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type S2636; | |
| 56 | ||
| 57 | ||
| 40 | 58 | #define MCFG_S2636_ADD(_tag, _interface) \ |
| 41 | 59 | MCFG_DEVICE_ADD(_tag, S2636, 0) \ |
| 42 | 60 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | assert(device != NULL); |
| 66 | 66 | assert(device->type() == TMS9927); |
| 67 | return (tms9927_state *)downcast< | |
| 67 | return (tms9927_state *)downcast<tms9927_devic | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r17612 | r17613 | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | |
| 360 | DEFINE_LEGACY_DEVICE(TMS9927, tms9927); | |
| 361 | DEFINE_LEGACY_DEVICE(CRT5027, crt5027); | |
| 362 | DEFINE_LEGACY_DEVICE(CRT5037, crt5037); | |
| 363 | DEFINE_LEGACY_DEVICE(CRT5057, crt5057); | |
| 360 | const device_type TMS9927 = &device_creator<tms9927_device>; | |
| 361 | ||
| 362 | tms9927_device::tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 363 | : device_t(mconfig, TMS9927, "TMS9927", tag, owner, clock) | |
| 364 | { | |
| 365 | m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state)); | |
| 366 | } | |
| 367 | tms9927_device::tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 368 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 369 | { | |
| 370 | m_token = global_alloc_array_clear(UINT8, sizeof(tms9927_state)); | |
| 371 | } | |
| 372 | ||
| 373 | //------------------------------------------------- | |
| 374 | // device_config_complete - perform any | |
| 375 | // operations now that the configuration is | |
| 376 | // complete | |
| 377 | //------------------------------------------------- | |
| 378 | ||
| 379 | void tms9927_device::device_config_complete() | |
| 380 | { | |
| 381 | } | |
| 382 | ||
| 383 | //------------------------------------------------- | |
| 384 | // device_start - device-specific startup | |
| 385 | //------------------------------------------------- | |
| 386 | ||
| 387 | void tms9927_device::device_start() | |
| 388 | { | |
| 389 | DEVICE_START_NAME( tms9927 )(this); | |
| 390 | } | |
| 391 | ||
| 392 | //------------------------------------------------- | |
| 393 | // device_reset - device-specific reset | |
| 394 | //------------------------------------------------- | |
| 395 | ||
| 396 | void tms9927_device::device_reset() | |
| 397 | { | |
| 398 | DEVICE_RESET_NAME( tms9927 )(this); | |
| 399 | } | |
| 400 | ||
| 401 | //------------------------------------------------- | |
| 402 | // device_stop - device-specific stop | |
| 403 | //------------------------------------------------- | |
| 404 | ||
| 405 | void tms9927_device::device_stop() | |
| 406 | { | |
| 407 | DEVICE_STOP_NAME( tms9927 )(this); | |
| 408 | } | |
| 409 | ||
| 410 | ||
| 411 | const device_type CRT5027 = &device_creator<crt5027_device>; | |
| 412 | ||
| 413 | crt5027_device::crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 414 | : tms9927_device(mconfig, CRT5027, "CRT5027", tag, owner, clock) | |
| 415 | { | |
| 416 | } | |
| 417 | ||
| 418 | ||
| 419 | const device_type CRT5037 = &device_creator<crt5037_device>; | |
| 420 | ||
| 421 | crt5037_device::crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 422 | : tms9927_device(mconfig, CRT5037, "CRT5037", tag, owner, clock) | |
| 423 | { | |
| 424 | } | |
| 425 | ||
| 426 | ||
| 427 | const device_type CRT5057 = &device_creator<crt5057_device>; | |
| 428 | ||
| 429 | crt5057_device::crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 430 | : tms9927_device(mconfig, CRT5057, "CRT5057", tag, owner, clock) | |
| 431 | { | |
| 432 | } | |
| 433 | ||
| 434 |
| r17612 | r17613 | |
|---|---|---|
| 13 | 13 | #include "devlegcy.h" |
| 14 | 14 | |
| 15 | 15 | |
| 16 | DECLARE_LEGACY_DEVICE(TMS9927, tms9927); | |
| 17 | DECLARE_LEGACY_DEVICE(CRT5027, crt5027); | |
| 18 | DECLARE_LEGACY_DEVICE(CRT5037, crt5037); | |
| 19 | DECLARE_LEGACY_DEVICE(CRT5057, crt5057); | |
| 16 | class tms9927_device : public device_t | |
| 17 | { | |
| 18 | public: | |
| 19 | tms9927_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 20 | tms9927_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~tms9927_device() { global_free(m_token); } | |
| 20 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_stop(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 21 | 35 | |
| 36 | extern const device_type TMS9927; | |
| 37 | ||
| 38 | class crt5027_device : public tms9927_device | |
| 39 | { | |
| 40 | public: | |
| 41 | crt5027_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | }; | |
| 43 | ||
| 44 | extern const device_type CRT5027; | |
| 45 | ||
| 46 | class crt5037_device : public tms9927_device | |
| 47 | { | |
| 48 | public: | |
| 49 | crt5037_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | }; | |
| 51 | ||
| 52 | extern const device_type CRT5037; | |
| 53 | ||
| 54 | class crt5057_device : public tms9927_device | |
| 55 | { | |
| 56 | public: | |
| 57 | crt5057_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 58 | }; | |
| 59 | ||
| 60 | extern const device_type CRT5057; | |
| 61 | ||
| 62 | ||
| 63 | ||
| 22 | 64 | #define MCFG_TMS9927_ADD(_tag, _clock, _config) \ |
| 23 | 65 | MCFG_DEVICE_ADD(_tag, TMS9927, _clock) \ |
| 24 | 66 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | assert(device != NULL); |
| 62 | 62 | assert(device->type() == SAA5050); |
| 63 | 63 | |
| 64 | return (saa5050_state *)downcast< | |
| 64 | return (saa5050_state *)downcast<s | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | INLINE const saa5050_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 395 | 395 | } |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | DEFINE_LEGACY_DEVICE(SAA5050, saa5050); | |
| 398 | const device_type SAA5050 = &device_creator<saa5050_device>; | |
| 399 | ||
| 400 | saa5050_device::saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 401 | : device_t(mconfig, SAA5050, "SAA5050", tag, owner, clock) | |
| 402 | { | |
| 403 | m_token = global_alloc_array_clear(UINT8, sizeof(saa5050_state)); | |
| 404 | } | |
| 405 | ||
| 406 | //------------------------------------------------- | |
| 407 | // device_config_complete - perform any | |
| 408 | // operations now that the configuration is | |
| 409 | // complete | |
| 410 | //------------------------------------------------- | |
| 411 | ||
| 412 | void saa5050_device::device_config_complete() | |
| 413 | { | |
| 414 | } | |
| 415 | ||
| 416 | //------------------------------------------------- | |
| 417 | // device_start - device-specific startup | |
| 418 | //------------------------------------------------- | |
| 419 | ||
| 420 | void saa5050_device::device_start() | |
| 421 | { | |
| 422 | DEVICE_START_NAME( saa5050 )(this); | |
| 423 | } | |
| 424 | ||
| 425 | //------------------------------------------------- | |
| 426 | // device_reset - device-specific reset | |
| 427 | //------------------------------------------------- | |
| 428 | ||
| 429 | void saa5050_device::device_reset() | |
| 430 | { | |
| 431 | DEVICE_RESET_NAME( saa5050 )(this); | |
| 432 | } | |
| 433 | ||
| 434 |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | int rev; |
| 27 | 27 | }; |
| 28 | 28 | |
| 29 | DECLARE_LEGACY_DEVICE(SAA5050, saa5050); | |
| 29 | class saa5050_device : public device_t | |
| 30 | { | |
| 31 | public: | |
| 32 | saa5050_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~saa5050_device() { global_free(m_token); } | |
| 30 | 34 | |
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | virtual void device_reset(); | |
| 42 | private: | |
| 43 | // internal state | |
| 44 | void *m_token; | |
| 45 | }; | |
| 46 | ||
| 47 | extern const device_type SAA5050; | |
| 48 | ||
| 49 | ||
| 31 | 50 | /*************************************************************************** |
| 32 | 51 | DEVICE CONFIGURATION MACROS |
| 33 | 52 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | WRITE8_DEVICE_HANDLER( es8712_w ); |
| 15 | 15 | |
| 16 | DECLARE_LEGACY_SOUND_DEVICE(ES8712, es8712); | |
| 16 | class es8712_device : public device_t, | |
| 17 | public device_sound_interface | |
| 18 | { | |
| 19 | public: | |
| 20 | es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~es8712_device() { global_free(m_token); } | |
| 17 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_reset(); | |
| 30 | ||
| 31 | // sound stream update overrides | |
| 32 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 37 | ||
| 38 | extern const device_type ES8712; | |
| 39 | ||
| 40 | ||
| 18 | 41 | #endif /* __ES8712_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 135 | 135 | { |
| 136 | 136 | assert(device != NULL); |
| 137 | 137 | assert(device->type() == SP0256); |
| 138 | return (sp0256_state *)downcast< | |
| 138 | return (sp0256_state *)downcast<sp0256_devic | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| r17612 | r17613 | |
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | |
| 1393 | DEFINE_LEGACY_SOUND_DEVICE(SP0256, sp0256); | |
| 1393 | const device_type SP0256 = &device_creator<sp0256_device>; | |
| 1394 | ||
| 1395 | sp0256_device::sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1396 | : device_t(mconfig, SP0256, "SP0256", tag, owner, clock), | |
| 1397 | device_sound_interface(mconfig, *this) | |
| 1398 | { | |
| 1399 | m_token = global_alloc_array_clear(UINT8, sizeof(sp0256_state)); | |
| 1400 | } | |
| 1401 | ||
| 1402 | //------------------------------------------------- | |
| 1403 | // device_config_complete - perform any | |
| 1404 | // operations now that the configuration is | |
| 1405 | // complete | |
| 1406 | //------------------------------------------------- | |
| 1407 | ||
| 1408 | void sp0256_device::device_config_complete() | |
| 1409 | { | |
| 1410 | } | |
| 1411 | ||
| 1412 | //------------------------------------------------- | |
| 1413 | // device_start - device-specific startup | |
| 1414 | //------------------------------------------------- | |
| 1415 | ||
| 1416 | void sp0256_device::device_start() | |
| 1417 | { | |
| 1418 | DEVICE_START_NAME( sp0256 )(this); | |
| 1419 | } | |
| 1420 | ||
| 1421 | //------------------------------------------------- | |
| 1422 | // device_reset - device-specific reset | |
| 1423 | //------------------------------------------------- | |
| 1424 | ||
| 1425 | void sp0256_device::device_reset() | |
| 1426 | { | |
| 1427 | DEVICE_RESET_NAME( sp0256 )(this); | |
| 1428 | } | |
| 1429 | ||
| 1430 | //------------------------------------------------- | |
| 1431 | // sound_stream_update - handle a stream update | |
| 1432 | //------------------------------------------------- | |
| 1433 | ||
| 1434 | void sp0256_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1435 | { | |
| 1436 | // should never get here | |
| 1437 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1438 | } | |
| 1439 | ||
| 1440 |
| r17612 | r17613 | |
|---|---|---|
| 46 | 46 | READ8_DEVICE_HANDLER( nes_psg_r ); |
| 47 | 47 | WRITE8_DEVICE_HANDLER( nes_psg_w ); |
| 48 | 48 | |
| 49 | DECLARE_LEGACY_SOUND_DEVICE(NES, nesapu); | |
| 49 | class nesapu_device : public device_t, | |
| 50 | public device_sound_interface | |
| 51 | { | |
| 52 | public: | |
| 53 | nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | ~nesapu_device() { global_free(m_token); } | |
| 50 | 55 | |
| 56 | // access to legacy token | |
| 57 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 58 | protected: | |
| 59 | // device-level overrides | |
| 60 | virtual void device_config_complete(); | |
| 61 | virtual void device_start(); | |
| 62 | ||
| 63 | // sound stream update overrides | |
| 64 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 65 | private: | |
| 66 | // internal state | |
| 67 | void *m_token; | |
| 68 | }; | |
| 69 | ||
| 70 | extern const device_type NES; | |
| 71 | ||
| 72 | ||
| 51 | 73 | #endif /* __NES_APU_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 23 | 23 | WRITE8_DEVICE_HANDLER( ymf262_data_b_w ); |
| 24 | 24 | |
| 25 | 25 | |
| 26 | DECLARE_LEGACY_SOUND_DEVICE(YMF262, ymf262); | |
| 26 | class ymf262_device : public device_t, | |
| 27 | public device_sound_interface | |
| 28 | { | |
| 29 | public: | |
| 30 | ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ~ymf262_device() { global_free(m_token); } | |
| 27 | 32 | |
| 33 | // access to legacy token | |
| 34 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_config_complete(); | |
| 38 | virtual void device_start(); | |
| 39 | virtual void device_stop(); | |
| 40 | virtual void device_reset(); | |
| 41 | ||
| 42 | // sound stream update overrides | |
| 43 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | void *m_token; | |
| 47 | }; | |
| 48 | ||
| 49 | extern const device_type YMF262; | |
| 50 | ||
| 51 | ||
| 28 | 52 | #endif /* __262INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 57 | 57 | assert(device->type() == HC55516 || |
| 58 | 58 | device->type() == MC3417 || |
| 59 | 59 | device->type() == MC3418); |
| 60 | return (hc55516_state *)downcast< | |
| 60 | return (hc55516_state *)downcast<h | |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | |
| r17612 | r17613 | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | |
| 347 | DEFINE_LEGACY_SOUND_DEVICE(HC55516, hc55516); | |
| 348 | DEFINE_LEGACY_SOUND_DEVICE(MC3417, mc3417); | |
| 349 | DEFINE_LEGACY_SOUND_DEVICE(MC3418, mc3418); | |
| 347 | const device_type HC55516 = &device_creator<hc55516_device>; | |
| 348 | ||
| 349 | hc55516_device::hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 350 | : device_t(mconfig, HC55516, "HC-55516", tag, owner, clock), | |
| 351 | device_sound_interface(mconfig, *this) | |
| 352 | { | |
| 353 | m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state)); | |
| 354 | } | |
| 355 | hc55516_device::hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 356 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 357 | device_sound_interface(mconfig, *this) | |
| 358 | { | |
| 359 | m_token = global_alloc_array_clear(UINT8, sizeof(hc55516_state)); | |
| 360 | } | |
| 361 | ||
| 362 | //------------------------------------------------- | |
| 363 | // device_config_complete - perform any | |
| 364 | // operations now that the configuration is | |
| 365 | // complete | |
| 366 | //------------------------------------------------- | |
| 367 | ||
| 368 | void hc55516_device::device_config_complete() | |
| 369 | { | |
| 370 | } | |
| 371 | ||
| 372 | //------------------------------------------------- | |
| 373 | // device_start - device-specific startup | |
| 374 | //------------------------------------------------- | |
| 375 | ||
| 376 | void hc55516_device::device_start() | |
| 377 | { | |
| 378 | DEVICE_START_NAME( hc55516 )(this); | |
| 379 | } | |
| 380 | ||
| 381 | //------------------------------------------------- | |
| 382 | // device_reset - device-specific reset | |
| 383 | //------------------------------------------------- | |
| 384 | ||
| 385 | void hc55516_device::device_reset() | |
| 386 | { | |
| 387 | DEVICE_RESET_NAME( hc55516 )(this); | |
| 388 | } | |
| 389 | ||
| 390 | //------------------------------------------------- | |
| 391 | // sound_stream_update - handle a stream update | |
| 392 | //------------------------------------------------- | |
| 393 | ||
| 394 | void hc55516_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 395 | { | |
| 396 | // should never get here | |
| 397 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 398 | } | |
| 399 | ||
| 400 | ||
| 401 | const device_type MC3417 = &device_creator<mc3417_device>; | |
| 402 | ||
| 403 | mc3417_device::mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 404 | : hc55516_device(mconfig, MC3417, "MC3417", tag, owner, clock) | |
| 405 | { | |
| 406 | } | |
| 407 | ||
| 408 | //------------------------------------------------- | |
| 409 | // device_start - device-specific startup | |
| 410 | //------------------------------------------------- | |
| 411 | ||
| 412 | void mc3417_device::device_start() | |
| 413 | { | |
| 414 | DEVICE_START_NAME( mc3417 )(this); | |
| 415 | } | |
| 416 | ||
| 417 | //------------------------------------------------- | |
| 418 | // sound_stream_update - handle a stream update | |
| 419 | //------------------------------------------------- | |
| 420 | ||
| 421 | void mc3417_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 422 | { | |
| 423 | // should never get here | |
| 424 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 425 | } | |
| 426 | ||
| 427 | ||
| 428 | const device_type MC3418 = &device_creator<mc3418_device>; | |
| 429 | ||
| 430 | mc3418_device::mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 431 | : hc55516_device(mconfig, MC3418, "MC3418", tag, owner, clock) | |
| 432 | { | |
| 433 | } | |
| 434 | ||
| 435 | //------------------------------------------------- | |
| 436 | // device_start - device-specific startup | |
| 437 | //------------------------------------------------- | |
| 438 | ||
| 439 | void mc3418_device::device_start() | |
| 440 | { | |
| 441 | DEVICE_START_NAME( mc3418 )(this); | |
| 442 | } | |
| 443 | ||
| 444 | //------------------------------------------------- | |
| 445 | // sound_stream_update - handle a stream update | |
| 446 | //------------------------------------------------- | |
| 447 | ||
| 448 | void mc3418_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 449 | { | |
| 450 | // should never get here | |
| 451 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 452 | } | |
| 453 | ||
| 454 |
| r17612 | r17613 | |
|---|---|---|
| 71 | 71 | READ16_DEVICE_HANDLER( spb640_r ); |
| 72 | 72 | WRITE16_DEVICE_HANDLER( spb640_w ); |
| 73 | 73 | |
| 74 | DECLARE_LEGACY_SOUND_DEVICE(SP0256, sp0256); | |
| 74 | class sp0256_device : public device_t, | |
| 75 | public device_sound_interface | |
| 76 | { | |
| 77 | public: | |
| 78 | sp0256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 79 | ~sp0256_device() { global_free(m_token); } | |
| 75 | 80 | |
| 81 | // access to legacy token | |
| 82 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 83 | protected: | |
| 84 | // device-level overrides | |
| 85 | virtual void device_config_complete(); | |
| 86 | virtual void device_start(); | |
| 87 | virtual void device_reset(); | |
| 88 | ||
| 89 | // sound stream update overrides | |
| 90 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 91 | private: | |
| 92 | // internal state | |
| 93 | void *m_token; | |
| 94 | }; | |
| 95 | ||
| 96 | extern const device_type SP0256; | |
| 97 | ||
| 98 | ||
| 76 | 99 | #endif /* __SP0256_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | /* returns whether the clock is currently LO or HI */ |
| 16 | 16 | int hc55516_clock_state_r(device_t *device); |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_SOUND_DEVICE(HC55516, hc55516); | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(MC3417, mc3417); | |
| 20 | DECLARE_LEGACY_SOUND_DEVICE(MC3418, mc3418); | |
| 18 | class hc55516_device : public device_t, | |
| 19 | public device_sound_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | hc55516_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | hc55516_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~hc55516_device() { global_free(m_token); } | |
| 21 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_reset(); | |
| 33 | ||
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type HC55516; | |
| 42 | ||
| 43 | class mc3417_device : public hc55516_device | |
| 44 | { | |
| 45 | public: | |
| 46 | mc3417_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 47 | protected: | |
| 48 | // device-level overrides | |
| 49 | virtual void device_start(); | |
| 50 | ||
| 51 | // sound stream update overrides | |
| 52 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type MC3417; | |
| 56 | ||
| 57 | class mc3418_device : public hc55516_device | |
| 58 | { | |
| 59 | public: | |
| 60 | mc3418_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 61 | protected: | |
| 62 | // device-level overrides | |
| 63 | virtual void device_start(); | |
| 64 | ||
| 65 | // sound stream update overrides | |
| 66 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 67 | }; | |
| 68 | ||
| 69 | extern const device_type MC3418; | |
| 70 | ||
| 71 | ||
| 22 | 72 | #endif /* __HC55516_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | assert(device != NULL); |
| 62 | 62 | assert(device->type() == IREMGA20); |
| 63 | return (ga20_state *)downcast< | |
| 63 | return (ga20_state *)downcast<iremga20_devic | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r17612 | r17613 | |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | |
| 296 | DEFINE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20); | |
| 296 | const device_type IREMGA20 = &device_creator<iremga20_device>; | |
| 297 | ||
| 298 | iremga20_device::iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 299 | : device_t(mconfig, IREMGA20, "Irem GA20", tag, owner, clock), | |
| 300 | device_sound_interface(mconfig, *this) | |
| 301 | { | |
| 302 | m_token = global_alloc_array_clear(UINT8, sizeof(ga20_state)); | |
| 303 | } | |
| 304 | ||
| 305 | //------------------------------------------------- | |
| 306 | // device_config_complete - perform any | |
| 307 | // operations now that the configuration is | |
| 308 | // complete | |
| 309 | //------------------------------------------------- | |
| 310 | ||
| 311 | void iremga20_device::device_config_complete() | |
| 312 | { | |
| 313 | } | |
| 314 | ||
| 315 | //------------------------------------------------- | |
| 316 | // device_start - device-specific startup | |
| 317 | //------------------------------------------------- | |
| 318 | ||
| 319 | void iremga20_device::device_start() | |
| 320 | { | |
| 321 | DEVICE_START_NAME( iremga20 )(this); | |
| 322 | } | |
| 323 | ||
| 324 | //------------------------------------------------- | |
| 325 | // device_reset - device-specific reset | |
| 326 | //------------------------------------------------- | |
| 327 | ||
| 328 | void iremga20_device::device_reset() | |
| 329 | { | |
| 330 | DEVICE_RESET_NAME( iremga20 )(this); | |
| 331 | } | |
| 332 | ||
| 333 | //------------------------------------------------- | |
| 334 | // sound_stream_update - handle a stream update | |
| 335 | //------------------------------------------------- | |
| 336 | ||
| 337 | void iremga20_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 338 | { | |
| 339 | // should never get here | |
| 340 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 341 | } | |
| 342 | ||
| 343 |
| r17612 | r17613 | |
|---|---|---|
| 204 | 204 | device->type() == TMC0281 || |
| 205 | 205 | device->type() == CD2802 || |
| 206 | 206 | device->type() == M58817); |
| 207 | return (tms5110_state *)downcast< | |
| 207 | return (tms5110_state *)downcast<tms5110_devic | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | INLINE tmsprom_state *get_safe_token_prom(device_t *device) |
| 211 | 211 | { |
| 212 | 212 | assert(device != NULL); |
| 213 | 213 | assert(device->type() == TMSPROM); |
| 214 | return (tmsprom_state *)downcast< | |
| 214 | return (tmsprom_state *)downcast<tmsprom_devic | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | /* Static function prototypes */ |
| r17612 | r17613 | |
| 1586 | 1586 | } |
| 1587 | 1587 | } |
| 1588 | 1588 | |
| 1589 | DEFINE_LEGACY_SOUND_DEVICE(TMS5110, tms5110); | |
| 1590 | DEFINE_LEGACY_SOUND_DEVICE(TMS5100, tms5100); | |
| 1591 | DEFINE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a); | |
| 1592 | DEFINE_LEGACY_SOUND_DEVICE(CD2801, cd2801); | |
| 1593 | DEFINE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281); | |
| 1594 | DEFINE_LEGACY_SOUND_DEVICE(CD2802, cd2802); | |
| 1595 | DEFINE_LEGACY_SOUND_DEVICE(M58817, m58817); | |
| 1589 | const device_type TMS5110 = &device_creator<tms5110_device>; | |
| 1596 | 1590 | |
| 1597 | DEFINE_LEGACY_DEVICE(TMSPROM, tmsprom); | |
| 1591 | tms5110_device::tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1592 | : device_t(mconfig, TMS5110, "TMS5110", tag, owner, clock), | |
| 1593 | device_sound_interface(mconfig, *this) | |
| 1594 | { | |
| 1595 | m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state)); | |
| 1596 | } | |
| 1597 | tms5110_device::tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 1598 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 1599 | device_sound_interface(mconfig, *this) | |
| 1600 | { | |
| 1601 | m_token = global_alloc_array_clear(UINT8, sizeof(tms5110_state)); | |
| 1602 | } | |
| 1603 | ||
| 1604 | //------------------------------------------------- | |
| 1605 | // device_config_complete - perform any | |
| 1606 | // operations now that the configuration is | |
| 1607 | // complete | |
| 1608 | //------------------------------------------------- | |
| 1609 | ||
| 1610 | void tms5110_device::device_config_complete() | |
| 1611 | { | |
| 1612 | } | |
| 1613 | ||
| 1614 | //------------------------------------------------- | |
| 1615 | // device_start - device-specific startup | |
| 1616 | //------------------------------------------------- | |
| 1617 | ||
| 1618 | void tms5110_device::device_start() | |
| 1619 | { | |
| 1620 | DEVICE_START_NAME( tms5110 )(this); | |
| 1621 | } | |
| 1622 | ||
| 1623 | //------------------------------------------------- | |
| 1624 | // device_reset - device-specific reset | |
| 1625 | //------------------------------------------------- | |
| 1626 | ||
| 1627 | void tms5110_device::device_reset() | |
| 1628 | { | |
| 1629 | DEVICE_RESET_NAME( tms5110 )(this); | |
| 1630 | } | |
| 1631 | ||
| 1632 | //------------------------------------------------- | |
| 1633 | // sound_stream_update - handle a stream update | |
| 1634 | //------------------------------------------------- | |
| 1635 | ||
| 1636 | void tms5110_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1637 | { | |
| 1638 | // should never get here | |
| 1639 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1640 | } | |
| 1641 | ||
| 1642 | ||
| 1643 | const device_type TMS5100 = &device_creator<tms5100_device>; | |
| 1644 | ||
| 1645 | tms5100_device::tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1646 | : tms5110_device(mconfig, TMS5100, "TMS5100", tag, owner, clock) | |
| 1647 | { | |
| 1648 | } | |
| 1649 | ||
| 1650 | //------------------------------------------------- | |
| 1651 | // device_start - device-specific startup | |
| 1652 | //------------------------------------------------- | |
| 1653 | ||
| 1654 | void tms5100_device::device_start() | |
| 1655 | { | |
| 1656 | DEVICE_START_NAME( tms5100 )(this); | |
| 1657 | } | |
| 1658 | ||
| 1659 | //------------------------------------------------- | |
| 1660 | // sound_stream_update - handle a stream update | |
| 1661 | //------------------------------------------------- | |
| 1662 | ||
| 1663 | void tms5100_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1664 | { | |
| 1665 | // should never get here | |
| 1666 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1667 | } | |
| 1668 | ||
| 1669 | ||
| 1670 | const device_type TMS5110A = &device_creator<tms5110a_device>; | |
| 1671 | ||
| 1672 | tms5110a_device::tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1673 | : tms5110_device(mconfig, TMS5110A, "TMS5110A", tag, owner, clock) | |
| 1674 | { | |
| 1675 | } | |
| 1676 | ||
| 1677 | //------------------------------------------------- | |
| 1678 | // device_start - device-specific startup | |
| 1679 | //------------------------------------------------- | |
| 1680 | ||
| 1681 | void tms5110a_device::device_start() | |
| 1682 | { | |
| 1683 | DEVICE_START_NAME( tms5110a )(this); | |
| 1684 | } | |
| 1685 | ||
| 1686 | //------------------------------------------------- | |
| 1687 | // sound_stream_update - handle a stream update | |
| 1688 | //------------------------------------------------- | |
| 1689 | ||
| 1690 | void tms5110a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1691 | { | |
| 1692 | // should never get here | |
| 1693 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1694 | } | |
| 1695 | ||
| 1696 | ||
| 1697 | const device_type CD2801 = &device_creator<cd2801_device>; | |
| 1698 | ||
| 1699 | cd2801_device::cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1700 | : tms5110_device(mconfig, CD2801, "CD2801", tag, owner, clock) | |
| 1701 | { | |
| 1702 | } | |
| 1703 | ||
| 1704 | //------------------------------------------------- | |
| 1705 | // device_start - device-specific startup | |
| 1706 | //------------------------------------------------- | |
| 1707 | ||
| 1708 | void cd2801_device::device_start() | |
| 1709 | { | |
| 1710 | DEVICE_START_NAME( cd2801 )(this); | |
| 1711 | } | |
| 1712 | ||
| 1713 | //------------------------------------------------- | |
| 1714 | // sound_stream_update - handle a stream update | |
| 1715 | //------------------------------------------------- | |
| 1716 | ||
| 1717 | void cd2801_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1718 | { | |
| 1719 | // should never get here | |
| 1720 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1721 | } | |
| 1722 | ||
| 1723 | ||
| 1724 | const device_type TMC0281 = &device_creator<tmc0281_device>; | |
| 1725 | ||
| 1726 | tmc0281_device::tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1727 | : tms5110_device(mconfig, TMC0281, "TMC0281", tag, owner, clock) | |
| 1728 | { | |
| 1729 | } | |
| 1730 | ||
| 1731 | //------------------------------------------------- | |
| 1732 | // device_start - device-specific startup | |
| 1733 | //------------------------------------------------- | |
| 1734 | ||
| 1735 | void tmc0281_device::device_start() | |
| 1736 | { | |
| 1737 | DEVICE_START_NAME( tmc0281 )(this); | |
| 1738 | } | |
| 1739 | ||
| 1740 | //------------------------------------------------- | |
| 1741 | // sound_stream_update - handle a stream update | |
| 1742 | //------------------------------------------------- | |
| 1743 | ||
| 1744 | void tmc0281_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1745 | { | |
| 1746 | // should never get here | |
| 1747 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1748 | } | |
| 1749 | ||
| 1750 | ||
| 1751 | const device_type CD2802 = &device_creator<cd2802_device>; | |
| 1752 | ||
| 1753 | cd2802_device::cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1754 | : tms5110_device(mconfig, CD2802, "CD2802", tag, owner, clock) | |
| 1755 | { | |
| 1756 | } | |
| 1757 | ||
| 1758 | //------------------------------------------------- | |
| 1759 | // device_start - device-specific startup | |
| 1760 | //------------------------------------------------- | |
| 1761 | ||
| 1762 | void cd2802_device::device_start() | |
| 1763 | { | |
| 1764 | DEVICE_START_NAME( cd2802 )(this); | |
| 1765 | } | |
| 1766 | ||
| 1767 | //------------------------------------------------- | |
| 1768 | // sound_stream_update - handle a stream update | |
| 1769 | //------------------------------------------------- | |
| 1770 | ||
| 1771 | void cd2802_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1772 | { | |
| 1773 | // should never get here | |
| 1774 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1775 | } | |
| 1776 | ||
| 1777 | ||
| 1778 | const device_type M58817 = &device_creator<m58817_device>; | |
| 1779 | ||
| 1780 | m58817_device::m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1781 | : tms5110_device(mconfig, M58817, "M58817", tag, owner, clock) | |
| 1782 | { | |
| 1783 | } | |
| 1784 | ||
| 1785 | //------------------------------------------------- | |
| 1786 | // device_start - device-specific startup | |
| 1787 | //------------------------------------------------- | |
| 1788 | ||
| 1789 | void m58817_device::device_start() | |
| 1790 | { | |
| 1791 | DEVICE_START_NAME( m58817 )(this); | |
| 1792 | } | |
| 1793 | ||
| 1794 | //------------------------------------------------- | |
| 1795 | // sound_stream_update - handle a stream update | |
| 1796 | //------------------------------------------------- | |
| 1797 | ||
| 1798 | void m58817_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1799 | { | |
| 1800 | // should never get here | |
| 1801 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1802 | } | |
| 1803 | ||
| 1804 | ||
| 1805 | ||
| 1806 | const device_type TMSPROM = &device_creator<tmsprom_device>; | |
| 1807 | ||
| 1808 | tmsprom_device::tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1809 | : device_t(mconfig, TMSPROM, "TMSPROM", tag, owner, clock) | |
| 1810 | { | |
| 1811 | m_token = global_alloc_array_clear(UINT8, sizeof(tmsprom_state)); | |
| 1812 | } | |
| 1813 | ||
| 1814 | //------------------------------------------------- | |
| 1815 | // device_config_complete - perform any | |
| 1816 | // operations now that the configuration is | |
| 1817 | // complete | |
| 1818 | //------------------------------------------------- | |
| 1819 | ||
| 1820 | void tmsprom_device::device_config_complete() | |
| 1821 | { | |
| 1822 | } | |
| 1823 | ||
| 1824 | //------------------------------------------------- | |
| 1825 | // device_start - device-specific startup | |
| 1826 | //------------------------------------------------- | |
| 1827 | ||
| 1828 | void tmsprom_device::device_start() | |
| 1829 | { | |
| 1830 | DEVICE_START_NAME( tmsprom )(this); | |
| 1831 | } | |
| 1832 | ||
| 1833 |
| r17612 | r17613 | |
|---|---|---|
| 31 | 31 | { |
| 32 | 32 | assert(device != NULL); |
| 33 | 33 | assert(device->type() == YM2612 || device->type() == YM3438); |
| 34 | return (ym2612_state *)downcast< | |
| 34 | return (ym2612_state *)downcast< | |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | 37 | |
| r17612 | r17613 | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | |
| 201 | DEFINE_LEGACY_SOUND_DEVICE(YM2612, ym2612); | |
| 202 | DEFINE_LEGACY_SOUND_DEVICE(YM3438, ym3438); | |
| 201 | const device_type YM2612 = &device_creator<ym2612_device>; | |
| 202 | ||
| 203 | ym2612_device::ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 204 | : device_t(mconfig, YM2612, "YM2612", tag, owner, clock), | |
| 205 | device_sound_interface(mconfig, *this) | |
| 206 | { | |
| 207 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state)); | |
| 208 | } | |
| 209 | ym2612_device::ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 210 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 211 | device_sound_interface(mconfig, *this) | |
| 212 | { | |
| 213 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2612_state)); | |
| 214 | } | |
| 215 | ||
| 216 | //------------------------------------------------- | |
| 217 | // device_config_complete - perform any | |
| 218 | // operations now that the configuration is | |
| 219 | // complete | |
| 220 | //------------------------------------------------- | |
| 221 | ||
| 222 | void ym2612_device::device_config_complete() | |
| 223 | { | |
| 224 | } | |
| 225 | ||
| 226 | //------------------------------------------------- | |
| 227 | // device_start - device-specific startup | |
| 228 | //------------------------------------------------- | |
| 229 | ||
| 230 | void ym2612_device::device_start() | |
| 231 | { | |
| 232 | DEVICE_START_NAME( ym2612 )(this); | |
| 233 | } | |
| 234 | ||
| 235 | //------------------------------------------------- | |
| 236 | // device_reset - device-specific reset | |
| 237 | //------------------------------------------------- | |
| 238 | ||
| 239 | void ym2612_device::device_reset() | |
| 240 | { | |
| 241 | DEVICE_RESET_NAME( ym2612 )(this); | |
| 242 | } | |
| 243 | ||
| 244 | //------------------------------------------------- | |
| 245 | // device_stop - device-specific stop | |
| 246 | //------------------------------------------------- | |
| 247 | ||
| 248 | void ym2612_device::device_stop() | |
| 249 | { | |
| 250 | DEVICE_STOP_NAME( ym2612 )(this); | |
| 251 | } | |
| 252 | ||
| 253 | //------------------------------------------------- | |
| 254 | // sound_stream_update - handle a stream update | |
| 255 | //------------------------------------------------- | |
| 256 | ||
| 257 | void ym2612_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 258 | { | |
| 259 | // should never get here | |
| 260 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 261 | } | |
| 262 | ||
| 263 | ||
| 264 | const device_type YM3438 = &device_creator<ym3438_device>; | |
| 265 | ||
| 266 | ym3438_device::ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 267 | : ym2612_device(mconfig, YM3438, "YM3438", tag, owner, clock) | |
| 268 | { | |
| 269 | } | |
| 270 | ||
| 271 | //------------------------------------------------- | |
| 272 | // sound_stream_update - handle a stream update | |
| 273 | //------------------------------------------------- | |
| 274 | ||
| 275 | void ym3438_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 276 | { | |
| 277 | // should never get here | |
| 278 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 279 | } | |
| 280 | ||
| 281 |
| r17612 | r17613 | |
|---|---|---|
| 13 | 13 | WRITE8_DEVICE_HANDLER( irem_ga20_w ); |
| 14 | 14 | READ8_DEVICE_HANDLER( irem_ga20_r ); |
| 15 | 15 | |
| 16 | DECLARE_LEGACY_SOUND_DEVICE(IREMGA20, iremga20); | |
| 16 | class iremga20_device : public device_t, | |
| 17 | public device_sound_interface | |
| 18 | { | |
| 19 | public: | |
| 20 | iremga20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~iremga20_device() { global_free(m_token); } | |
| 17 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_reset(); | |
| 30 | ||
| 31 | // sound stream update overrides | |
| 32 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 37 | ||
| 38 | extern const device_type IREMGA20; | |
| 39 | ||
| 40 | ||
| 18 | 41 | #endif /* __IREMGA20_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | void tms5110_set_frequency(device_t *device, int frequency); |
| 58 | 58 | |
| 59 | DECLARE_LEGACY_SOUND_DEVICE(TMS5110, tms5110); | |
| 60 | DECLARE_LEGACY_SOUND_DEVICE(TMS5100, tms5100); | |
| 61 | DECLARE_LEGACY_SOUND_DEVICE(TMS5110A, tms5110a); | |
| 62 | DECLARE_LEGACY_SOUND_DEVICE(CD2801, cd2801); | |
| 63 | DECLARE_LEGACY_SOUND_DEVICE(TMC0281, tmc0281); | |
| 64 | DECLARE_LEGACY_SOUND_DEVICE(CD2802, cd2802); | |
| 65 | DECLARE_LEGACY_SOUND_DEVICE(M58817, m58817); | |
| 59 | class tms5110_device : public device_t, | |
| 60 | public device_sound_interface | |
| 61 | { | |
| 62 | public: | |
| 63 | tms5110_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 64 | tms5110_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 65 | ~tms5110_device() { global_free(m_token); } | |
| 66 | 66 | |
| 67 | // access to legacy token | |
| 68 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 69 | protected: | |
| 70 | // device-level overrides | |
| 71 | virtual void device_config_complete(); | |
| 72 | virtual void device_start(); | |
| 73 | virtual void device_reset(); | |
| 67 | 74 | |
| 75 | // sound stream update overrides | |
| 76 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 77 | private: | |
| 78 | // internal state | |
| 79 | void *m_token; | |
| 80 | }; | |
| 81 | ||
| 82 | extern const device_type TMS5110; | |
| 83 | ||
| 84 | class tms5100_device : public tms5110_device | |
| 85 | { | |
| 86 | public: | |
| 87 | tms5100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 88 | protected: | |
| 89 | // device-level overrides | |
| 90 | virtual void device_start(); | |
| 91 | ||
| 92 | // sound stream update overrides | |
| 93 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 94 | }; | |
| 95 | ||
| 96 | extern const device_type TMS5100; | |
| 97 | ||
| 98 | class tms5110a_device : public tms5110_device | |
| 99 | { | |
| 100 | public: | |
| 101 | tms5110a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 102 | protected: | |
| 103 | // device-level overrides | |
| 104 | virtual void device_start(); | |
| 105 | ||
| 106 | // sound stream update overrides | |
| 107 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 108 | }; | |
| 109 | ||
| 110 | extern const device_type TMS5110A; | |
| 111 | ||
| 112 | class cd2801_device : public tms5110_device | |
| 113 | { | |
| 114 | public: | |
| 115 | cd2801_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 116 | protected: | |
| 117 | // device-level overrides | |
| 118 | virtual void device_start(); | |
| 119 | ||
| 120 | // sound stream update overrides | |
| 121 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 122 | }; | |
| 123 | ||
| 124 | extern const device_type CD2801; | |
| 125 | ||
| 126 | class tmc0281_device : public tms5110_device | |
| 127 | { | |
| 128 | public: | |
| 129 | tmc0281_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 130 | protected: | |
| 131 | // device-level overrides | |
| 132 | virtual void device_start(); | |
| 133 | ||
| 134 | // sound stream update overrides | |
| 135 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 136 | }; | |
| 137 | ||
| 138 | extern const device_type TMC0281; | |
| 139 | ||
| 140 | class cd2802_device : public tms5110_device | |
| 141 | { | |
| 142 | public: | |
| 143 | cd2802_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 144 | protected: | |
| 145 | // device-level overrides | |
| 146 | virtual void device_start(); | |
| 147 | ||
| 148 | // sound stream update overrides | |
| 149 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 150 | }; | |
| 151 | ||
| 152 | extern const device_type CD2802; | |
| 153 | ||
| 154 | class m58817_device : public tms5110_device | |
| 155 | { | |
| 156 | public: | |
| 157 | m58817_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 158 | protected: | |
| 159 | // device-level overrides | |
| 160 | virtual void device_start(); | |
| 161 | ||
| 162 | // sound stream update overrides | |
| 163 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 164 | }; | |
| 165 | ||
| 166 | extern const device_type M58817; | |
| 167 | ||
| 168 | ||
| 169 | ||
| 68 | 170 | /* PROM controlled TMS5110 interface */ |
| 69 | 171 | |
| 70 | 172 | typedef struct _tmsprom_interface tmsprom_interface; |
| r17612 | r17613 | |
| 92 | 194 | WRITE8_DEVICE_HANDLER( tmsprom_bit_w ); |
| 93 | 195 | WRITE_LINE_DEVICE_HANDLER( tmsprom_enable_w ); |
| 94 | 196 | |
| 95 | DECLARE_LEGACY_DEVICE(TMSPROM, tmsprom); | |
| 197 | class tmsprom_device : public device_t | |
| 198 | { | |
| 199 | public: | |
| 200 | tmsprom_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 201 | ~tmsprom_device() { global_free(m_token); } | |
| 96 | 202 | |
| 203 | // access to legacy token | |
| 204 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 205 | protected: | |
| 206 | // device-level overrides | |
| 207 | virtual void device_config_complete(); | |
| 208 | virtual void device_start(); | |
| 209 | private: | |
| 210 | // internal state | |
| 211 | void *m_token; | |
| 212 | }; | |
| 213 | ||
| 214 | extern const device_type TMSPROM; | |
| 215 | ||
| 216 | ||
| 97 | 217 | #endif /* __TMS5110_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 39 | 39 | { |
| 40 | 40 | assert(device != NULL); |
| 41 | 41 | assert(device->type() == YM3526); |
| 42 | return (ym3526_state *)downcast< | |
| 42 | return (ym3526_state *)downcast< | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| r17612 | r17613 | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
| 174 | DEFINE_LEGACY_SOUND_DEVICE(YM3526, ym3526); | |
| 174 | const device_type YM3526 = &device_creator<ym3526_device>; | |
| 175 | ||
| 176 | ym3526_device::ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 177 | : device_t(mconfig, YM3526, "YM3526", tag, owner, clock), | |
| 178 | device_sound_interface(mconfig, *this) | |
| 179 | { | |
| 180 | m_token = global_alloc_array_clear(UINT8, sizeof(ym3526_state)); | |
| 181 | } | |
| 182 | ||
| 183 | //------------------------------------------------- | |
| 184 | // device_config_complete - perform any | |
| 185 | // operations now that the configuration is | |
| 186 | // complete | |
| 187 | //------------------------------------------------- | |
| 188 | ||
| 189 | void ym3526_device::device_config_complete() | |
| 190 | { | |
| 191 | } | |
| 192 | ||
| 193 | //------------------------------------------------- | |
| 194 | // device_start - device-specific startup | |
| 195 | //------------------------------------------------- | |
| 196 | ||
| 197 | void ym3526_device::device_start() | |
| 198 | { | |
| 199 | DEVICE_START_NAME( ym3526 )(this); | |
| 200 | } | |
| 201 | ||
| 202 | //------------------------------------------------- | |
| 203 | // device_reset - device-specific reset | |
| 204 | //------------------------------------------------- | |
| 205 | ||
| 206 | void ym3526_device::device_reset() | |
| 207 | { | |
| 208 | DEVICE_RESET_NAME( ym3526 )(this); | |
| 209 | } | |
| 210 | ||
| 211 | //------------------------------------------------- | |
| 212 | // device_stop - device-specific stop | |
| 213 | //------------------------------------------------- | |
| 214 | ||
| 215 | void ym3526_device::device_stop() | |
| 216 | { | |
| 217 | DEVICE_STOP_NAME( ym3526 )(this); | |
| 218 | } | |
| 219 | ||
| 220 | //------------------------------------------------- | |
| 221 | // sound_stream_update - handle a stream update | |
| 222 | //------------------------------------------------- | |
| 223 | ||
| 224 | void ym3526_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 225 | { | |
| 226 | // should never get here | |
| 227 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 228 | } | |
| 229 | ||
| 230 |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | WRITE8_DEVICE_HANDLER( ym2612_data_port_b_w ); |
| 28 | 28 | |
| 29 | 29 | |
| 30 | DECLARE_LEGACY_SOUND_DEVICE(YM2612, ym2612); | |
| 30 | class ym2612_device : public device_t, | |
| 31 | public device_sound_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | ym2612_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | ym2612_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ~ym2612_device() { global_free(m_token); } | |
| 31 | 37 | |
| 38 | // access to legacy token | |
| 39 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 40 | protected: | |
| 41 | // device-level overrides | |
| 42 | virtual void device_config_complete(); | |
| 43 | virtual void device_start(); | |
| 44 | virtual void device_stop(); | |
| 45 | virtual void device_reset(); | |
| 32 | 46 | |
| 47 | // sound stream update overrides | |
| 48 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 49 | private: | |
| 50 | // internal state | |
| 51 | void *m_token; | |
| 52 | }; | |
| 53 | ||
| 54 | extern const device_type YM2612; | |
| 55 | ||
| 56 | ||
| 57 | ||
| 33 | 58 | typedef struct _ym3438_interface ym3438_interface; |
| 34 | 59 | struct _ym3438_interface |
| 35 | 60 | { |
| r17612 | r17613 | |
| 51 | 76 | #define ym3438_data_port_b_w ym2612_data_port_b_w |
| 52 | 77 | |
| 53 | 78 | |
| 54 | DECLARE_LEGACY_SOUND_DEVICE(YM3438, ym3438); | |
| 79 | class ym3438_device : public ym2612_device | |
| 80 | { | |
| 81 | public: | |
| 82 | ym3438_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 55 | 83 | |
| 84 | // sound stream update overrides | |
| 85 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 86 | }; | |
| 87 | ||
| 88 | extern const device_type YM3438; | |
| 89 | ||
| 90 | ||
| 56 | 91 | #endif /* __2612INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | assert(device != NULL); |
| 63 | 63 | assert(device->type() == K051649); |
| 64 | return (k051649_state *)downcast< | |
| 64 | return (k051649_state *)downcast<k051649_devic | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /* build a table to divide by the number of voices */ |
| r17612 | r17613 | |
| 310 | 310 | } |
| 311 | 311 | |
| 312 | 312 | |
| 313 | DEFINE_LEGACY_SOUND_DEVICE(K051649, k051649); | |
| 313 | const device_type K051649 = &device_creator<k051649_device>; | |
| 314 | ||
| 315 | k051649_device::k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 316 | : device_t(mconfig, K051649, "K051649", tag, owner, clock), | |
| 317 | device_sound_interface(mconfig, *this) | |
| 318 | { | |
| 319 | m_token = global_alloc_array_clear(UINT8, sizeof(k051649_state)); | |
| 320 | } | |
| 321 | ||
| 322 | //------------------------------------------------- | |
| 323 | // device_config_complete - perform any | |
| 324 | // operations now that the configuration is | |
| 325 | // complete | |
| 326 | //------------------------------------------------- | |
| 327 | ||
| 328 | void k051649_device::device_config_complete() | |
| 329 | { | |
| 330 | } | |
| 331 | ||
| 332 | //------------------------------------------------- | |
| 333 | // device_start - device-specific startup | |
| 334 | //------------------------------------------------- | |
| 335 | ||
| 336 | void k051649_device::device_start() | |
| 337 | { | |
| 338 | DEVICE_START_NAME( k051649 )(this); | |
| 339 | } | |
| 340 | ||
| 341 | //------------------------------------------------- | |
| 342 | // device_reset - device-specific reset | |
| 343 | //------------------------------------------------- | |
| 344 | ||
| 345 | void k051649_device::device_reset() | |
| 346 | { | |
| 347 | DEVICE_RESET_NAME( k051649 )(this); | |
| 348 | } | |
| 349 | ||
| 350 | //------------------------------------------------- | |
| 351 | // sound_stream_update - handle a stream update | |
| 352 | //------------------------------------------------- | |
| 353 | ||
| 354 | void k051649_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 355 | { | |
| 356 | // should never get here | |
| 357 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 358 | } | |
| 359 | ||
| 360 |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | WRITE8_DEVICE_HANDLER( ym3526_control_port_w ); |
| 20 | 20 | WRITE8_DEVICE_HANDLER( ym3526_write_port_w ); |
| 21 | 21 | |
| 22 | DECLARE_LEGACY_SOUND_DEVICE(YM3526, ym3526); | |
| 22 | class ym3526_device : public device_t, | |
| 23 | public device_sound_interface | |
| 24 | { | |
| 25 | public: | |
| 26 | ym3526_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~ym3526_device() { global_free(m_token); } | |
| 23 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_stop(); | |
| 36 | virtual void device_reset(); | |
| 37 | ||
| 38 | // sound stream update overrides | |
| 39 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type YM3526; | |
| 46 | ||
| 47 | ||
| 24 | 48 | #endif /* __3526INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | WRITE8_DEVICE_HANDLER( k052539_waveform_w ); |
| 17 | 17 | READ8_DEVICE_HANDLER ( k052539_waveform_r ); |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(K051649, k051649); | |
| 19 | class k051649_device : public device_t, | |
| 20 | public device_sound_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | k051649_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~k051649_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_reset(); | |
| 33 | ||
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type K051649; | |
| 42 | ||
| 43 | ||
| 21 | 44 | #endif /* __K051649_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 109 | 109 | { |
| 110 | 110 | assert(device != NULL); |
| 111 | 111 | assert(device->type() == C140); |
| 112 | return (c140_state *)downcast< | |
| 112 | return (c140_state *)downcast< | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| r17612 | r17613 | |
| 504 | 504 | } |
| 505 | 505 | |
| 506 | 506 | |
| 507 | DEFINE_LEGACY_SOUND_DEVICE(C140, c140); | |
| 507 | const device_type C140 = &device_creator<c140_device>; | |
| 508 | ||
| 509 | c140_device::c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 510 | : device_t(mconfig, C140, "C140", tag, owner, clock), | |
| 511 | device_sound_interface(mconfig, *this) | |
| 512 | { | |
| 513 | m_token = global_alloc_array_clear(UINT8, sizeof(c140_state)); | |
| 514 | } | |
| 515 | ||
| 516 | //------------------------------------------------- | |
| 517 | // device_config_complete - perform any | |
| 518 | // operations now that the configuration is | |
| 519 | // complete | |
| 520 | //------------------------------------------------- | |
| 521 | ||
| 522 | void c140_device::device_config_complete() | |
| 523 | { | |
| 524 | } | |
| 525 | ||
| 526 | //------------------------------------------------- | |
| 527 | // device_start - device-specific startup | |
| 528 | //------------------------------------------------- | |
| 529 | ||
| 530 | void c140_device::device_start() | |
| 531 | { | |
| 532 | DEVICE_START_NAME( c140 )(this); | |
| 533 | } | |
| 534 | ||
| 535 | //------------------------------------------------- | |
| 536 | // sound_stream_update - handle a stream update | |
| 537 | //------------------------------------------------- | |
| 538 | ||
| 539 | void c140_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 540 | { | |
| 541 | // should never get here | |
| 542 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 543 | } | |
| 544 | ||
| 545 |
| r17612 | r17613 | |
|---|---|---|
| 74 | 74 | { |
| 75 | 75 | assert(device != NULL); |
| 76 | 76 | assert(device->type() == MSM5205); |
| 77 | return (msm5205_state *)downcast< | |
| 77 | return (msm5205_state *)downcast<msm5205_devic | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | |
| r17612 | r17613 | |
| 377 | 377 | } |
| 378 | 378 | |
| 379 | 379 | |
| 380 | DEFINE_LEGACY_SOUND_DEVICE(MSM5205, msm5205); | |
| 381 | DEFINE_LEGACY_SOUND_DEVICE(MSM6585, msm6585); | |
| 380 | const device_type MSM5205 = &device_creator<msm5205_device>; | |
| 381 | ||
| 382 | msm5205_device::msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 383 | : device_t(mconfig, MSM5205, "MSM5205", tag, owner, clock), | |
| 384 | device_sound_interface(mconfig, *this) | |
| 385 | { | |
| 386 | m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state)); | |
| 387 | } | |
| 388 | msm5205_device::msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 389 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 390 | device_sound_interface(mconfig, *this) | |
| 391 | { | |
| 392 | m_token = global_alloc_array_clear(UINT8, sizeof(msm5205_state)); | |
| 393 | } | |
| 394 | ||
| 395 | //------------------------------------------------- | |
| 396 | // device_config_complete - perform any | |
| 397 | // operations now that the configuration is | |
| 398 | // complete | |
| 399 | //------------------------------------------------- | |
| 400 | ||
| 401 | void msm5205_device::device_config_complete() | |
| 402 | { | |
| 403 | } | |
| 404 | ||
| 405 | //------------------------------------------------- | |
| 406 | // device_start - device-specific startup | |
| 407 | //------------------------------------------------- | |
| 408 | ||
| 409 | void msm5205_device::device_start() | |
| 410 | { | |
| 411 | DEVICE_START_NAME( msm5205 )(this); | |
| 412 | } | |
| 413 | ||
| 414 | //------------------------------------------------- | |
| 415 | // device_reset - device-specific reset | |
| 416 | //------------------------------------------------- | |
| 417 | ||
| 418 | void msm5205_device::device_reset() | |
| 419 | { | |
| 420 | DEVICE_RESET_NAME( msm5205 )(this); | |
| 421 | } | |
| 422 | ||
| 423 | //------------------------------------------------- | |
| 424 | // sound_stream_update - handle a stream update | |
| 425 | //------------------------------------------------- | |
| 426 | ||
| 427 | void msm5205_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 428 | { | |
| 429 | // should never get here | |
| 430 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 431 | } | |
| 432 | ||
| 433 | ||
| 434 | const device_type MSM6585 = &device_creator<msm6585_device>; | |
| 435 | ||
| 436 | msm6585_device::msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 437 | : msm5205_device(mconfig, MSM6585, "MSM6585", tag, owner, clock) | |
| 438 | { | |
| 439 | } | |
| 440 | ||
| 441 | //------------------------------------------------- | |
| 442 | // sound_stream_update - handle a stream update | |
| 443 | //------------------------------------------------- | |
| 444 | ||
| 445 | void msm6585_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 446 | { | |
| 447 | // should never get here | |
| 448 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 449 | } | |
| 450 | ||
| 451 |
| r17612 | r17613 | |
|---|---|---|
| 91 | 91 | { |
| 92 | 92 | assert(device != NULL); |
| 93 | 93 | assert(device->type() == QSOUND); |
| 94 | return (qsound_state *)downcast< | |
| 94 | return (qsound_state *)downcast<qsound_devic | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| r17612 | r17613 | |
| 399 | 399 | |
| 400 | 400 | /**************** end of file ****************/ |
| 401 | 401 | |
| 402 | DEFINE_LEGACY_SOUND_DEVICE(QSOUND, qsound); | |
| 402 | const device_type QSOUND = &device_creator<qsound_device>; | |
| 403 | ||
| 404 | qsound_device::qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 405 | : device_t(mconfig, QSOUND, "Q-Sound", tag, owner, clock), | |
| 406 | device_sound_interface(mconfig, *this) | |
| 407 | { | |
| 408 | m_token = global_alloc_array_clear(UINT8, sizeof(qsound_state)); | |
| 409 | } | |
| 410 | ||
| 411 | //------------------------------------------------- | |
| 412 | // device_config_complete - perform any | |
| 413 | // operations now that the configuration is | |
| 414 | // complete | |
| 415 | //------------------------------------------------- | |
| 416 | ||
| 417 | void qsound_device::device_config_complete() | |
| 418 | { | |
| 419 | } | |
| 420 | ||
| 421 | //------------------------------------------------- | |
| 422 | // device_start - device-specific startup | |
| 423 | //------------------------------------------------- | |
| 424 | ||
| 425 | void qsound_device::device_start() | |
| 426 | { | |
| 427 | DEVICE_START_NAME( qsound )(this); | |
| 428 | } | |
| 429 | ||
| 430 | //------------------------------------------------- | |
| 431 | // device_stop - device-specific stop | |
| 432 | //------------------------------------------------- | |
| 433 | ||
| 434 | void qsound_device::device_stop() | |
| 435 | { | |
| 436 | DEVICE_STOP_NAME( qsound )(this); | |
| 437 | } | |
| 438 | ||
| 439 | //------------------------------------------------- | |
| 440 | // sound_stream_update - handle a stream update | |
| 441 | //------------------------------------------------- | |
| 442 | ||
| 443 | void qsound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 444 | { | |
| 445 | // should never get here | |
| 446 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 447 | } | |
| 448 | ||
| 449 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | int banking_type; |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(C140, c140); | |
| 27 | class c140_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | c140_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~c140_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | ||
| 41 | // sound stream update overrides | |
| 42 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 43 | private: | |
| 44 | // internal state | |
| 45 | void *m_token; | |
| 46 | }; | |
| 47 | ||
| 48 | extern const device_type C140; | |
| 49 | ||
| 50 | ||
| 29 | 51 | #endif /* __C140_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 46 | 46 | |
| 47 | 47 | void msm5205_change_clock_w(device_t *device, INT32 clock); |
| 48 | 48 | |
| 49 | DECLARE_LEGACY_SOUND_DEVICE(MSM5205, msm5205); | |
| 50 | DECLARE_LEGACY_SOUND_DEVICE(MSM6585, msm6585); | |
| 49 | class msm5205_device : public device_t, | |
| 50 | public device_sound_interface | |
| 51 | { | |
| 52 | public: | |
| 53 | msm5205_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | msm5205_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 55 | ~msm5205_device() { global_free(m_token); } | |
| 51 | 56 | |
| 57 | // access to legacy token | |
| 58 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 59 | protected: | |
| 60 | // device-level overrides | |
| 61 | virtual void device_config_complete(); | |
| 62 | virtual void device_start(); | |
| 63 | virtual void device_reset(); | |
| 64 | ||
| 65 | // sound stream update overrides | |
| 66 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 67 | private: | |
| 68 | // internal state | |
| 69 | void *m_token; | |
| 70 | }; | |
| 71 | ||
| 72 | extern const device_type MSM5205; | |
| 73 | ||
| 74 | class msm6585_device : public msm5205_device | |
| 75 | { | |
| 76 | public: | |
| 77 | msm6585_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 78 | ||
| 79 | // sound stream update overrides | |
| 80 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 81 | }; | |
| 82 | ||
| 83 | extern const device_type MSM6585; | |
| 84 | ||
| 85 | ||
| 52 | 86 | #endif /* __MSM5205_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | assert(device != NULL); |
| 38 | 38 | assert(device->type() == SNKWAVE); |
| 39 | return (snkwave_state *)downcast< | |
| 39 | return (snkwave_state *)downcast<snkwave_devic | |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | |
| r17612 | r17613 | |
| 186 | 186 | } |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | DEFINE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave); | |
| 189 | const device_type SNKWAVE = &device_creator<snkwave_device>; | |
| 190 | ||
| 191 | snkwave_device::snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 192 | : device_t(mconfig, SNKWAVE, "SNK Wave", tag, owner, clock), | |
| 193 | device_sound_interface(mconfig, *this) | |
| 194 | { | |
| 195 | m_token = global_alloc_array_clear(UINT8, sizeof(snkwave_state)); | |
| 196 | } | |
| 197 | ||
| 198 | //------------------------------------------------- | |
| 199 | // device_config_complete - perform any | |
| 200 | // operations now that the configuration is | |
| 201 | // complete | |
| 202 | //------------------------------------------------- | |
| 203 | ||
| 204 | void snkwave_device::device_config_complete() | |
| 205 | { | |
| 206 | } | |
| 207 | ||
| 208 | //------------------------------------------------- | |
| 209 | // device_start - device-specific startup | |
| 210 | //------------------------------------------------- | |
| 211 | ||
| 212 | void snkwave_device::device_start() | |
| 213 | { | |
| 214 | DEVICE_START_NAME( snkwave )(this); | |
| 215 | } | |
| 216 | ||
| 217 | //------------------------------------------------- | |
| 218 | // sound_stream_update - handle a stream update | |
| 219 | //------------------------------------------------- | |
| 220 | ||
| 221 | void snkwave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 222 | { | |
| 223 | // should never get here | |
| 224 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 225 | } | |
| 226 | ||
| 227 |
| r17612 | r17613 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | assert(device != NULL); |
| 39 | 39 | assert(device->type() == YM3812); |
| 40 | return (ym3812_state *)downcast< | |
| 40 | return (ym3812_state *)downcast< | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| r17612 | r17613 | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | |
| 170 | DEFINE_LEGACY_SOUND_DEVICE(YM3812, ym3812); | |
| 170 | const device_type YM3812 = &device_creator<ym3812_device>; | |
| 171 | ||
| 172 | ym3812_device::ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 173 | : device_t(mconfig, YM3812, "YM3812", tag, owner, clock), | |
| 174 | device_sound_interface(mconfig, *this) | |
| 175 | { | |
| 176 | m_token = global_alloc_array_clear(UINT8, sizeof(ym3812_state)); | |
| 177 | } | |
| 178 | ||
| 179 | //------------------------------------------------- | |
| 180 | // device_config_complete - perform any | |
| 181 | // operations now that the configuration is | |
| 182 | // complete | |
| 183 | //------------------------------------------------- | |
| 184 | ||
| 185 | void ym3812_device::device_config_complete() | |
| 186 | { | |
| 187 | } | |
| 188 | ||
| 189 | //------------------------------------------------- | |
| 190 | // device_start - device-specific startup | |
| 191 | //------------------------------------------------- | |
| 192 | ||
| 193 | void ym3812_device::device_start() | |
| 194 | { | |
| 195 | DEVICE_START_NAME( ym3812 )(this); | |
| 196 | } | |
| 197 | ||
| 198 | //------------------------------------------------- | |
| 199 | // device_reset - device-specific reset | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | void ym3812_device::device_reset() | |
| 203 | { | |
| 204 | DEVICE_RESET_NAME( ym3812 )(this); | |
| 205 | } | |
| 206 | ||
| 207 | //------------------------------------------------- | |
| 208 | // device_stop - device-specific stop | |
| 209 | //------------------------------------------------- | |
| 210 | ||
| 211 | void ym3812_device::device_stop() | |
| 212 | { | |
| 213 | DEVICE_STOP_NAME( ym3812 )(this); | |
| 214 | } | |
| 215 | ||
| 216 | //------------------------------------------------- | |
| 217 | // sound_stream_update - handle a stream update | |
| 218 | //------------------------------------------------- | |
| 219 | ||
| 220 | void ym3812_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 221 | { | |
| 222 | // should never get here | |
| 223 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 224 | } | |
| 225 | ||
| 226 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | WRITE8_DEVICE_HANDLER( qsound_w ); |
| 17 | 17 | READ8_DEVICE_HANDLER( qsound_r ); |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(QSOUND, qsound); | |
| 19 | class qsound_device : public device_t, | |
| 20 | public device_sound_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | qsound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~qsound_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_stop(); | |
| 33 | ||
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type QSOUND; | |
| 42 | ||
| 43 | ||
| 21 | 44 | #endif /* __QSOUND_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | WRITE8_DEVICE_HANDLER( ym3812_control_port_w ); |
| 20 | 20 | WRITE8_DEVICE_HANDLER( ym3812_write_port_w ); |
| 21 | 21 | |
| 22 | DECLARE_LEGACY_SOUND_DEVICE(YM3812, ym3812); | |
| 22 | class ym3812_device : public device_t, | |
| 23 | public device_sound_interface | |
| 24 | { | |
| 25 | public: | |
| 26 | ym3812_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~ym3812_device() { global_free(m_token); } | |
| 23 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_stop(); | |
| 36 | virtual void device_reset(); | |
| 37 | ||
| 38 | // sound stream update overrides | |
| 39 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type YM3812; | |
| 46 | ||
| 47 | ||
| 24 | 48 | #endif /* __3812INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 97 | 97 | { |
| 98 | 98 | assert(device != NULL); |
| 99 | 99 | assert(device->type() == RF5C400); |
| 100 | return (rf5c400_state *)downcast< | |
| 100 | return (rf5c400_state *)downcast<rf5 | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| r17612 | r17613 | |
| 583 | 583 | } |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | DEFINE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400); | |
| 586 | const device_type RF5C400 = &device_creator<rf5c400_device>; | |
| 587 | ||
| 588 | rf5c400_device::rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 589 | : device_t(mconfig, RF5C400, "RF5C400", tag, owner, clock), | |
| 590 | device_sound_interface(mconfig, *this) | |
| 591 | { | |
| 592 | m_token = global_alloc_array_clear(UINT8, sizeof(rf5c400_state)); | |
| 593 | } | |
| 594 | ||
| 595 | //------------------------------------------------- | |
| 596 | // device_config_complete - perform any | |
| 597 | // operations now that the configuration is | |
| 598 | // complete | |
| 599 | //------------------------------------------------- | |
| 600 | ||
| 601 | void rf5c400_device::device_config_complete() | |
| 602 | { | |
| 603 | } | |
| 604 | ||
| 605 | //------------------------------------------------- | |
| 606 | // device_start - device-specific startup | |
| 607 | //------------------------------------------------- | |
| 608 | ||
| 609 | void rf5c400_device::device_start() | |
| 610 | { | |
| 611 | DEVICE_START_NAME( rf5c400 )(this); | |
| 612 | } | |
| 613 | ||
| 614 | //------------------------------------------------- | |
| 615 | // sound_stream_update - handle a stream update | |
| 616 | //------------------------------------------------- | |
| 617 | ||
| 618 | void rf5c400_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 619 | { | |
| 620 | // should never get here | |
| 621 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 622 | } | |
| 623 | ||
| 624 |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | WRITE8_DEVICE_HANDLER( snkwave_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(SNKWAVE, snkwave); | |
| 10 | class snkwave_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | snkwave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~snkwave_device() { global_free(m_token); } | |
| 11 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | ||
| 24 | // sound stream update overrides | |
| 25 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 26 | private: | |
| 27 | // internal state | |
| 28 | void *m_token; | |
| 29 | }; | |
| 30 | ||
| 31 | extern const device_type SNKWAVE; | |
| 32 | ||
| 33 | ||
| 12 | 34 | #endif /* __SNKWAVE_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 141 | 141 | { |
| 142 | 142 | assert(device != NULL); |
| 143 | 143 | assert(device->type() == CEM3394); |
| 144 | return (cem3394_state *)downcast< | |
| 144 | return (cem3394_state *)downcast< | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| r17612 | r17613 | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | |
| 589 | DEFINE_LEGACY_SOUND_DEVICE(CEM3394, cem3394); | |
| 589 | const device_type CEM3394 = &device_creator<cem3394_device>; | |
| 590 | ||
| 591 | cem3394_device::cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 592 | : device_t(mconfig, CEM3394, "CEM3394", tag, owner, clock), | |
| 593 | device_sound_interface(mconfig, *this) | |
| 594 | { | |
| 595 | m_token = global_alloc_array_clear(UINT8, sizeof(cem3394_state)); | |
| 596 | } | |
| 597 | ||
| 598 | //------------------------------------------------- | |
| 599 | // device_config_complete - perform any | |
| 600 | // operations now that the configuration is | |
| 601 | // complete | |
| 602 | //------------------------------------------------- | |
| 603 | ||
| 604 | void cem3394_device::device_config_complete() | |
| 605 | { | |
| 606 | } | |
| 607 | ||
| 608 | //------------------------------------------------- | |
| 609 | // device_start - device-specific startup | |
| 610 | //------------------------------------------------- | |
| 611 | ||
| 612 | void cem3394_device::device_start() | |
| 613 | { | |
| 614 | DEVICE_START_NAME( cem3394 )(this); | |
| 615 | } | |
| 616 | ||
| 617 | //------------------------------------------------- | |
| 618 | // sound_stream_update - handle a stream update | |
| 619 | //------------------------------------------------- | |
| 620 | ||
| 621 | void cem3394_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 622 | { | |
| 623 | // should never get here | |
| 624 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 625 | } | |
| 626 | ||
| 627 |
| r17612 | r17613 | |
|---|---|---|
| 171 | 171 | { |
| 172 | 172 | assert(device != NULL); |
| 173 | 173 | assert(device->type() == SAA1099); |
| 174 | return (saa1099_state *)downcast< | |
| 174 | return (saa1099_state *)downcast<s | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| r17612 | r17613 | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| 466 | DEFINE_LEGACY_SOUND_DEVICE(SAA1099, saa1099); | |
| 466 | const device_type SAA1099 = &device_creator<saa1099_device>; | |
| 467 | ||
| 468 | saa1099_device::saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 469 | : device_t(mconfig, SAA1099, "SAA1099", tag, owner, clock), | |
| 470 | device_sound_interface(mconfig, *this) | |
| 471 | { | |
| 472 | m_token = global_alloc_array_clear(UINT8, sizeof(saa1099_state)); | |
| 473 | } | |
| 474 | ||
| 475 | //------------------------------------------------- | |
| 476 | // device_config_complete - perform any | |
| 477 | // operations now that the configuration is | |
| 478 | // complete | |
| 479 | //------------------------------------------------- | |
| 480 | ||
| 481 | void saa1099_device::device_config_complete() | |
| 482 | { | |
| 483 | } | |
| 484 | ||
| 485 | //------------------------------------------------- | |
| 486 | // device_start - device-specific startup | |
| 487 | //------------------------------------------------- | |
| 488 | ||
| 489 | void saa1099_device::device_start() | |
| 490 | { | |
| 491 | DEVICE_START_NAME( saa1099 )(this); | |
| 492 | } | |
| 493 | ||
| 494 | //------------------------------------------------- | |
| 495 | // sound_stream_update - handle a stream update | |
| 496 | //------------------------------------------------- | |
| 497 | ||
| 498 | void saa1099_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 499 | { | |
| 500 | // should never get here | |
| 501 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 502 | } | |
| 503 | ||
| 504 |
| r17612 | r17613 | |
|---|---|---|
| 288 | 288 | { |
| 289 | 289 | assert(device != NULL); |
| 290 | 290 | assert(device->type() == DIGITALKER); |
| 291 | return (digitalker *)downcast< | |
| 291 | return (digitalker *)downcast<digitalker_devic | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| r17612 | r17613 | |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | |
| 708 | DEFINE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker); | |
| 708 | const device_type DIGITALKER = &device_creator<digitalker_device>; | |
| 709 | ||
| 710 | digitalker_device::digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 711 | : device_t(mconfig, DIGITALKER, "Digitalker", tag, owner, clock), | |
| 712 | device_sound_interface(mconfig, *this) | |
| 713 | { | |
| 714 | m_token = global_alloc_array_clear(UINT8, sizeof(digitalker)); | |
| 715 | } | |
| 716 | ||
| 717 | //------------------------------------------------- | |
| 718 | // device_config_complete - perform any | |
| 719 | // operations now that the configuration is | |
| 720 | // complete | |
| 721 | //------------------------------------------------- | |
| 722 | ||
| 723 | void digitalker_device::device_config_complete() | |
| 724 | { | |
| 725 | } | |
| 726 | ||
| 727 | //------------------------------------------------- | |
| 728 | // device_start - device-specific startup | |
| 729 | //------------------------------------------------- | |
| 730 | ||
| 731 | void digitalker_device::device_start() | |
| 732 | { | |
| 733 | DEVICE_START_NAME( digitalker )(this); | |
| 734 | } | |
| 735 | ||
| 736 | //------------------------------------------------- | |
| 737 | // sound_stream_update - handle a stream update | |
| 738 | //------------------------------------------------- | |
| 739 | ||
| 740 | void digitalker_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 741 | { | |
| 742 | // should never get here | |
| 743 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 744 | } | |
| 745 | ||
| 746 |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | READ16_DEVICE_HANDLER( rf5c400_r ); |
| 11 | 11 | WRITE16_DEVICE_HANDLER( rf5c400_w ); |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(RF5C400, rf5c400); | |
| 13 | class rf5c400_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | rf5c400_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~rf5c400_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | ||
| 27 | // sound stream update overrides | |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type RF5C400; | |
| 35 | ||
| 36 | ||
| 15 | 37 | #endif /* __RF5C400_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 45 | 45 | CEM3394_FINAL_GAIN: gain, in dB */ |
| 46 | 46 | double cem3394_get_parameter(device_t *device, int input); |
| 47 | 47 | |
| 48 | DECLARE_LEGACY_SOUND_DEVICE(CEM3394, cem3394); | |
| 48 | class cem3394_device : public device_t, | |
| 49 | public device_sound_interface | |
| 50 | { | |
| 51 | public: | |
| 52 | cem3394_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | ~cem3394_device() { global_free(m_token); } | |
| 49 | 54 | |
| 55 | // access to legacy token | |
| 56 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 57 | protected: | |
| 58 | // device-level overrides | |
| 59 | virtual void device_config_complete(); | |
| 60 | virtual void device_start(); | |
| 61 | ||
| 62 | // sound stream update overrides | |
| 63 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 64 | private: | |
| 65 | // internal state | |
| 66 | void *m_token; | |
| 67 | }; | |
| 68 | ||
| 69 | extern const device_type CEM3394; | |
| 70 | ||
| 71 | ||
| 50 | 72 | #endif /* __CEM3394_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 12 | 12 | WRITE8_DEVICE_HANDLER( saa1099_control_w ); |
| 13 | 13 | WRITE8_DEVICE_HANDLER( saa1099_data_w ); |
| 14 | 14 | |
| 15 | DECLARE_LEGACY_SOUND_DEVICE(SAA1099, saa1099); | |
| 15 | class saa1099_device : public device_t, | |
| 16 | public device_sound_interface | |
| 17 | { | |
| 18 | public: | |
| 19 | saa1099_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 20 | ~saa1099_device() { global_free(m_token); } | |
| 16 | 21 | |
| 22 | // access to legacy token | |
| 23 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 24 | protected: | |
| 25 | // device-level overrides | |
| 26 | virtual void device_config_complete(); | |
| 27 | virtual void device_start(); | |
| 28 | ||
| 29 | // sound stream update overrides | |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type SAA1099; | |
| 37 | ||
| 38 | ||
| 17 | 39 | #endif /* __SAA1099_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | int digitalker_0_intr_r(device_t *device); |
| 10 | 10 | WRITE8_DEVICE_HANDLER(digitalker_data_w); |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(DIGITALKER, digitalker); | |
| 12 | class digitalker_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | digitalker_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | ~digitalker_device() { global_free(m_token); } | |
| 13 | 18 | |
| 19 | // access to legacy token | |
| 20 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 21 | protected: | |
| 22 | // device-level overrides | |
| 23 | virtual void device_config_complete(); | |
| 24 | virtual void device_start(); | |
| 25 | ||
| 26 | // sound stream update overrides | |
| 27 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 28 | private: | |
| 29 | // internal state | |
| 30 | void *m_token; | |
| 31 | }; | |
| 32 | ||
| 33 | extern const device_type DIGITALKER; | |
| 34 | ||
| 35 | ||
| 14 | 36 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 137 | 137 | { |
| 138 | 138 | assert(device != NULL); |
| 139 | 139 | assert(device->type() == YMZ280B); |
| 140 | return (ymz280b_state *)downcast< | |
| 140 | return (ymz280b_state *)downcast< | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r17612 | r17613 | |
| 1073 | 1073 | } |
| 1074 | 1074 | |
| 1075 | 1075 | |
| 1076 | DEFINE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b); | |
| 1076 | const device_type YMZ280B = &device_creator<ymz280b_device>; | |
| 1077 | ||
| 1078 | ymz280b_device::ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1079 | : device_t(mconfig, YMZ280B, "YMZ280B", tag, owner, clock), | |
| 1080 | device_sound_interface(mconfig, *this) | |
| 1081 | { | |
| 1082 | m_token = global_alloc_array_clear(UINT8, sizeof(ymz280b_state)); | |
| 1083 | } | |
| 1084 | ||
| 1085 | //------------------------------------------------- | |
| 1086 | // device_config_complete - perform any | |
| 1087 | // operations now that the configuration is | |
| 1088 | // complete | |
| 1089 | //------------------------------------------------- | |
| 1090 | ||
| 1091 | void ymz280b_device::device_config_complete() | |
| 1092 | { | |
| 1093 | } | |
| 1094 | ||
| 1095 | //------------------------------------------------- | |
| 1096 | // device_start - device-specific startup | |
| 1097 | //------------------------------------------------- | |
| 1098 | ||
| 1099 | void ymz280b_device::device_start() | |
| 1100 | { | |
| 1101 | DEVICE_START_NAME( ymz280b )(this); | |
| 1102 | } | |
| 1103 | ||
| 1104 | //------------------------------------------------- | |
| 1105 | // device_reset - device-specific reset | |
| 1106 | //------------------------------------------------- | |
| 1107 | ||
| 1108 | void ymz280b_device::device_reset() | |
| 1109 | { | |
| 1110 | DEVICE_RESET_NAME( ymz280b )(this); | |
| 1111 | } | |
| 1112 | ||
| 1113 | //------------------------------------------------- | |
| 1114 | // sound_stream_update - handle a stream update | |
| 1115 | //------------------------------------------------- | |
| 1116 | ||
| 1117 | void ymz280b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1118 | { | |
| 1119 | // should never get here | |
| 1120 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1121 | } | |
| 1122 | ||
| 1123 |
| r17612 | r17613 | |
|---|---|---|
| 40 | 40 | { |
| 41 | 41 | assert(device != NULL); |
| 42 | 42 | assert(device->type() == RF5C68); |
| 43 | return (rf5c68_state *)downcast< | |
| 43 | return (rf5c68_state *)downcast<rf5 | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| r17612 | r17613 | |
| 287 | 287 | |
| 288 | 288 | /**************** end of file ****************/ |
| 289 | 289 | |
| 290 | DEFINE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68); | |
| 290 | const device_type RF5C68 = &device_creator<rf5c68_device>; | |
| 291 | ||
| 292 | rf5c68_device::rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 293 | : device_t(mconfig, RF5C68, "RF5C68", tag, owner, clock), | |
| 294 | device_sound_interface(mconfig, *this) | |
| 295 | { | |
| 296 | m_token = global_alloc_array_clear(UINT8, sizeof(rf5c68_state)); | |
| 297 | } | |
| 298 | ||
| 299 | //------------------------------------------------- | |
| 300 | // device_config_complete - perform any | |
| 301 | // operations now that the configuration is | |
| 302 | // complete | |
| 303 | //------------------------------------------------- | |
| 304 | ||
| 305 | void rf5c68_device::device_config_complete() | |
| 306 | { | |
| 307 | } | |
| 308 | ||
| 309 | //------------------------------------------------- | |
| 310 | // device_start - device-specific startup | |
| 311 | //------------------------------------------------- | |
| 312 | ||
| 313 | void rf5c68_device::device_start() | |
| 314 | { | |
| 315 | DEVICE_START_NAME( rf5c68 )(this); | |
| 316 | } | |
| 317 | ||
| 318 | //------------------------------------------------- | |
| 319 | // sound_stream_update - handle a stream update | |
| 320 | //------------------------------------------------- | |
| 321 | ||
| 322 | void rf5c68_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 323 | { | |
| 324 | // should never get here | |
| 325 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 326 | } | |
| 327 | ||
| 328 |
| r17612 | r17613 | |
|---|---|---|
| 125 | 125 | assert(device != NULL); |
| 126 | 126 | assert(device->type() == MOS656X); |
| 127 | 127 | |
| 128 | return (mos6560_state *)downcast< | |
| 128 | return (mos6560_state *)downcast<mos6560_devic | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | INLINE const mos6560_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 970 | 970 | } |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | DEFINE_LEGACY_SOUND_DEVICE(MOS656X, mos6560); | |
| 973 | const device_type MOS656X = &device_creator<mos6560_device>; | |
| 974 | ||
| 975 | mos6560_device::mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 976 | : device_t(mconfig, MOS656X, "MOS 6560 / 6561 VIC", tag, owner, clock), | |
| 977 | device_sound_interface(mconfig, *this) | |
| 978 | { | |
| 979 | m_token = global_alloc_array_clear(UINT8, sizeof(mos6560_state)); | |
| 980 | } | |
| 981 | ||
| 982 | //------------------------------------------------- | |
| 983 | // device_config_complete - perform any | |
| 984 | // operations now that the configuration is | |
| 985 | // complete | |
| 986 | //------------------------------------------------- | |
| 987 | ||
| 988 | void mos6560_device::device_config_complete() | |
| 989 | { | |
| 990 | } | |
| 991 | ||
| 992 | //------------------------------------------------- | |
| 993 | // device_start - device-specific startup | |
| 994 | //------------------------------------------------- | |
| 995 | ||
| 996 | void mos6560_device::device_start() | |
| 997 | { | |
| 998 | DEVICE_START_NAME( mos6560 )(this); | |
| 999 | } | |
| 1000 | ||
| 1001 | //------------------------------------------------- | |
| 1002 | // device_reset - device-specific reset | |
| 1003 | //------------------------------------------------- | |
| 1004 | ||
| 1005 | void mos6560_device::device_reset() | |
| 1006 | { | |
| 1007 | DEVICE_RESET_NAME( mos6560 )(this); | |
| 1008 | } | |
| 1009 | ||
| 1010 | //------------------------------------------------- | |
| 1011 | // sound_stream_update - handle a stream update | |
| 1012 | //------------------------------------------------- | |
| 1013 | ||
| 1014 | void mos6560_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1015 | { | |
| 1016 | // should never get here | |
| 1017 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1018 | } | |
| 1019 | ||
| 1020 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | READ8_DEVICE_HANDLER ( ymz280b_r ); |
| 25 | 25 | WRITE8_DEVICE_HANDLER( ymz280b_w ); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(YMZ280B, ymz280b); | |
| 27 | class ymz280b_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | ymz280b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~ymz280b_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_reset(); | |
| 41 | ||
| 42 | // sound stream update overrides | |
| 43 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | void *m_token; | |
| 47 | }; | |
| 48 | ||
| 49 | extern const device_type YMZ280B; | |
| 50 | ||
| 51 | ||
| 29 | 52 | #endif /* __YMZ280B_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 64 | 64 | { |
| 65 | 65 | assert(device != NULL); |
| 66 | 66 | assert(device->type() == K005289); |
| 67 | return (k005289_state *)downcast< | |
| 67 | return (k005289_state *)downcast<k005289_devic | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | /* build a table to divide by the number of voices */ |
| r17612 | r17613 | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | DEFINE_LEGACY_SOUND_DEVICE(K005289, k005289); | |
| 277 | const device_type K005289 = &device_creator<k005289_device>; | |
| 278 | ||
| 279 | k005289_device::k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 280 | : device_t(mconfig, K005289, "K005289", tag, owner, clock), | |
| 281 | device_sound_interface(mconfig, *this) | |
| 282 | { | |
| 283 | m_token = global_alloc_array_clear(UINT8, sizeof(k005289_state)); | |
| 284 | } | |
| 285 | ||
| 286 | //------------------------------------------------- | |
| 287 | // device_config_complete - perform any | |
| 288 | // operations now that the configuration is | |
| 289 | // complete | |
| 290 | //------------------------------------------------- | |
| 291 | ||
| 292 | void k005289_device::device_config_complete() | |
| 293 | { | |
| 294 | } | |
| 295 | ||
| 296 | //------------------------------------------------- | |
| 297 | // device_start - device-specific startup | |
| 298 | //------------------------------------------------- | |
| 299 | ||
| 300 | void k005289_device::device_start() | |
| 301 | { | |
| 302 | DEVICE_START_NAME( k005289 )(this); | |
| 303 | } | |
| 304 | ||
| 305 | //------------------------------------------------- | |
| 306 | // sound_stream_update - handle a stream update | |
| 307 | //------------------------------------------------- | |
| 308 | ||
| 309 | void k005289_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 310 | { | |
| 311 | // should never get here | |
| 312 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 313 | } | |
| 314 | ||
| 315 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | void (*sample_end_callback)(device_t* device, int channel); |
| 23 | 23 | }; |
| 24 | 24 | |
| 25 | DECLARE_LEGACY_SOUND_DEVICE(RF5C68, rf5c68); | |
| 25 | class rf5c68_device : public device_t, | |
| 26 | public device_sound_interface | |
| 27 | { | |
| 28 | public: | |
| 29 | rf5c68_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 30 | ~rf5c68_device() { global_free(m_token); } | |
| 26 | 31 | |
| 32 | // access to legacy token | |
| 33 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_config_complete(); | |
| 37 | virtual void device_start(); | |
| 38 | ||
| 39 | // sound stream update overrides | |
| 40 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 41 | private: | |
| 42 | // internal state | |
| 43 | void *m_token; | |
| 44 | }; | |
| 45 | ||
| 46 | extern const device_type RF5C68; | |
| 47 | ||
| 48 | ||
| 27 | 49 | #endif /* __RF5C68_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 88 | 88 | INFO PROTOTYPES |
| 89 | 89 | ***************************************************************************/ |
| 90 | 90 | |
| 91 | DECLARE_LEGACY_SOUND_DEVICE(MOS656X, mos6560); | |
| 91 | class mos6560_device : public device_t, | |
| 92 | public device_sound_interface | |
| 93 | { | |
| 94 | public: | |
| 95 | mos6560_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 96 | ~mos6560_device() { global_free(m_token); } | |
| 92 | 97 | |
| 98 | // access to legacy token | |
| 99 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 100 | protected: | |
| 101 | // device-level overrides | |
| 102 | virtual void device_config_complete(); | |
| 103 | virtual void device_start(); | |
| 104 | virtual void device_reset(); | |
| 105 | ||
| 106 | // sound stream update overrides | |
| 107 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 108 | private: | |
| 109 | // internal state | |
| 110 | void *m_token; | |
| 111 | }; | |
| 112 | ||
| 113 | extern const device_type MOS656X; | |
| 114 | ||
| 115 | ||
| 93 | 116 | /*************************************************************************** |
| 94 | 117 | DEVICE CONFIGURATION MACROS |
| 95 | 118 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 12 | 12 | WRITE8_DEVICE_HANDLER( k005289_keylatch_A_w ); |
| 13 | 13 | WRITE8_DEVICE_HANDLER( k005289_keylatch_B_w ); |
| 14 | 14 | |
| 15 | DECLARE_LEGACY_SOUND_DEVICE(K005289, k005289); | |
| 15 | class k005289_device : public device_t, | |
| 16 | public device_sound_interface | |
| 17 | { | |
| 18 | public: | |
| 19 | k005289_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 20 | ~k005289_device() { global_free(m_token); } | |
| 16 | 21 | |
| 22 | // access to legacy token | |
| 23 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 24 | protected: | |
| 25 | // device-level overrides | |
| 26 | virtual void device_config_complete(); | |
| 27 | virtual void device_start(); | |
| 28 | ||
| 29 | // sound stream update overrides | |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type K005289; | |
| 37 | ||
| 38 | ||
| 17 | 39 | #endif /* __K005289_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 217 | 217 | { |
| 218 | 218 | assert(device != NULL); |
| 219 | 219 | assert(device->type() == AICA); |
| 220 | return (aica_state *)downcast< | |
| 220 | return (aica_state *)downcast< | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | static unsigned char DecodeSCI(aica_state *AICA, unsigned char irq) |
| r17612 | r17613 | |
| 1380 | 1380 | |
| 1381 | 1381 | |
| 1382 | 1382 | |
| 1383 | DEFINE_LEGACY_SOUND_DEVICE(AICA, aica); | |
| 1383 | const device_type AICA = &device_creator<aica_device>; | |
| 1384 | ||
| 1385 | aica_device::aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1386 | : device_t(mconfig, AICA, "AICA", tag, owner, clock), | |
| 1387 | device_sound_interface(mconfig, *this) | |
| 1388 | { | |
| 1389 | m_token = global_alloc_array_clear(UINT8, sizeof(aica_state)); | |
| 1390 | } | |
| 1391 | ||
| 1392 | //------------------------------------------------- | |
| 1393 | // device_config_complete - perform any | |
| 1394 | // operations now that the configuration is | |
| 1395 | // complete | |
| 1396 | //------------------------------------------------- | |
| 1397 | ||
| 1398 | void aica_device::device_config_complete() | |
| 1399 | { | |
| 1400 | } | |
| 1401 | ||
| 1402 | //------------------------------------------------- | |
| 1403 | // device_start - device-specific startup | |
| 1404 | //------------------------------------------------- | |
| 1405 | ||
| 1406 | void aica_device::device_start() | |
| 1407 | { | |
| 1408 | DEVICE_START_NAME( aica )(this); | |
| 1409 | } | |
| 1410 | ||
| 1411 | //------------------------------------------------- | |
| 1412 | // device_stop - device-specific stop | |
| 1413 | //------------------------------------------------- | |
| 1414 | ||
| 1415 | void aica_device::device_stop() | |
| 1416 | { | |
| 1417 | DEVICE_STOP_NAME( aica )(this); | |
| 1418 | } | |
| 1419 | ||
| 1420 | //------------------------------------------------- | |
| 1421 | // sound_stream_update - handle a stream update | |
| 1422 | //------------------------------------------------- | |
| 1423 | ||
| 1424 | void aica_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1425 | { | |
| 1426 | // should never get here | |
| 1427 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1428 | } | |
| 1429 | ||
| 1430 |
| r17612 | r17613 | |
|---|---|---|
| 160 | 160 | device->type() == NCR7496 || |
| 161 | 161 | device->type() == GAMEGEAR || |
| 162 | 162 | device->type() == SEGAPSG); |
| 163 | return (sn76496_state *)downcast< | |
| 163 | return (sn76496_state *)downcast<sn76496_devic | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | READ_LINE_DEVICE_HANDLER( sn76496_ready_r ) |
| r17612 | r17613 | |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | |
| 606 | DEFINE_LEGACY_SOUND_DEVICE(SN76496, sn76496); | |
| 607 | DEFINE_LEGACY_SOUND_DEVICE(U8106, u8106); | |
| 608 | DEFINE_LEGACY_SOUND_DEVICE(Y2404, y2404); | |
| 609 | DEFINE_LEGACY_SOUND_DEVICE(SN76489, sn76489); | |
| 610 | DEFINE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a); | |
| 611 | DEFINE_LEGACY_SOUND_DEVICE(SN76494, sn76494); | |
| 612 | DEFINE_LEGACY_SOUND_DEVICE(SN94624, sn94624); | |
| 613 | DEFINE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496); | |
| 614 | DEFINE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear); | |
| 615 | DEFINE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg); | |
| 606 | const device_type SN76496 = &device_creator<sn76496_device>; | |
| 616 | 607 | |
| 608 | sn76496_device::sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 609 | : device_t(mconfig, SN76496, "SN76496", tag, owner, clock), | |
| 610 | device_sound_interface(mconfig, *this) | |
| 611 | { | |
| 612 | m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state)); | |
| 613 | } | |
| 614 | sn76496_device::sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 615 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 616 | device_sound_interface(mconfig, *this) | |
| 617 | { | |
| 618 | m_token = global_alloc_array_clear(UINT8, sizeof(sn76496_state)); | |
| 619 | } | |
| 620 | ||
| 621 | //------------------------------------------------- | |
| 622 | // device_config_complete - perform any | |
| 623 | // operations now that the configuration is | |
| 624 | // complete | |
| 625 | //------------------------------------------------- | |
| 626 | ||
| 627 | void sn76496_device::device_config_complete() | |
| 628 | { | |
| 629 | } | |
| 630 | ||
| 631 | //------------------------------------------------- | |
| 632 | // device_start - device-specific startup | |
| 633 | //------------------------------------------------- | |
| 634 | ||
| 635 | void sn76496_device::device_start() | |
| 636 | { | |
| 637 | DEVICE_START_NAME( sn76496 )(this); | |
| 638 | } | |
| 639 | ||
| 640 | //------------------------------------------------- | |
| 641 | // sound_stream_update - handle a stream update | |
| 642 | //------------------------------------------------- | |
| 643 | ||
| 644 | void sn76496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 645 | { | |
| 646 | // should never get here | |
| 647 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 648 | } | |
| 649 | ||
| 650 | ||
| 651 | const device_type U8106 = &device_creator<u8106_device>; | |
| 652 | ||
| 653 | u8106_device::u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 654 | : sn76496_device(mconfig, U8106, "U8106", tag, owner, clock) | |
| 655 | { | |
| 656 | } | |
| 657 | ||
| 658 | //------------------------------------------------- | |
| 659 | // device_start - device-specific startup | |
| 660 | //------------------------------------------------- | |
| 661 | ||
| 662 | void u8106_device::device_start() | |
| 663 | { | |
| 664 | DEVICE_START_NAME( u8106 )(this); | |
| 665 | } | |
| 666 | ||
| 667 | //------------------------------------------------- | |
| 668 | // sound_stream_update - handle a stream update | |
| 669 | //------------------------------------------------- | |
| 670 | ||
| 671 | void u8106_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 672 | { | |
| 673 | // should never get here | |
| 674 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 675 | } | |
| 676 | ||
| 677 | ||
| 678 | const device_type Y2404 = &device_creator<y2404_device>; | |
| 679 | ||
| 680 | y2404_device::y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 681 | : sn76496_device(mconfig, Y2404, "Y2404", tag, owner, clock) | |
| 682 | { | |
| 683 | } | |
| 684 | ||
| 685 | //------------------------------------------------- | |
| 686 | // device_start - device-specific startup | |
| 687 | //------------------------------------------------- | |
| 688 | ||
| 689 | void y2404_device::device_start() | |
| 690 | { | |
| 691 | DEVICE_START_NAME( y2404 )(this); | |
| 692 | } | |
| 693 | ||
| 694 | //------------------------------------------------- | |
| 695 | // sound_stream_update - handle a stream update | |
| 696 | //------------------------------------------------- | |
| 697 | ||
| 698 | void y2404_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 699 | { | |
| 700 | // should never get here | |
| 701 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 702 | } | |
| 703 | ||
| 704 | ||
| 705 | const device_type SN76489 = &device_creator<sn76489_device>; | |
| 706 | ||
| 707 | sn76489_device::sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 708 | : sn76496_device(mconfig, SN76489, "SN76489", tag, owner, clock) | |
| 709 | { | |
| 710 | } | |
| 711 | ||
| 712 | //------------------------------------------------- | |
| 713 | // device_start - device-specific startup | |
| 714 | //------------------------------------------------- | |
| 715 | ||
| 716 | void sn76489_device::device_start() | |
| 717 | { | |
| 718 | DEVICE_START_NAME( sn76489 )(this); | |
| 719 | } | |
| 720 | ||
| 721 | //------------------------------------------------- | |
| 722 | // sound_stream_update - handle a stream update | |
| 723 | //------------------------------------------------- | |
| 724 | ||
| 725 | void sn76489_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 726 | { | |
| 727 | // should never get here | |
| 728 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 729 | } | |
| 730 | ||
| 731 | ||
| 732 | const device_type SN76489A = &device_creator<sn76489a_device>; | |
| 733 | ||
| 734 | sn76489a_device::sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 735 | : sn76496_device(mconfig, SN76489A, "SN76489A", tag, owner, clock) | |
| 736 | { | |
| 737 | } | |
| 738 | ||
| 739 | //------------------------------------------------- | |
| 740 | // device_start - device-specific startup | |
| 741 | //------------------------------------------------- | |
| 742 | ||
| 743 | void sn76489a_device::device_start() | |
| 744 | { | |
| 745 | DEVICE_START_NAME( sn76489a )(this); | |
| 746 | } | |
| 747 | ||
| 748 | //------------------------------------------------- | |
| 749 | // sound_stream_update - handle a stream update | |
| 750 | //------------------------------------------------- | |
| 751 | ||
| 752 | void sn76489a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 753 | { | |
| 754 | // should never get here | |
| 755 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 756 | } | |
| 757 | ||
| 758 | ||
| 759 | const device_type SN76494 = &device_creator<sn76494_device>; | |
| 760 | ||
| 761 | sn76494_device::sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 762 | : sn76496_device(mconfig, SN76494, "SN76494", tag, owner, clock) | |
| 763 | { | |
| 764 | } | |
| 765 | ||
| 766 | //------------------------------------------------- | |
| 767 | // device_start - device-specific startup | |
| 768 | //------------------------------------------------- | |
| 769 | ||
| 770 | void sn76494_device::device_start() | |
| 771 | { | |
| 772 | DEVICE_START_NAME( sn76494 )(this); | |
| 773 | } | |
| 774 | ||
| 775 | //------------------------------------------------- | |
| 776 | // sound_stream_update - handle a stream update | |
| 777 | //------------------------------------------------- | |
| 778 | ||
| 779 | void sn76494_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 780 | { | |
| 781 | // should never get here | |
| 782 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 783 | } | |
| 784 | ||
| 785 | ||
| 786 | const device_type SN94624 = &device_creator<sn94624_device>; | |
| 787 | ||
| 788 | sn94624_device::sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 789 | : sn76496_device(mconfig, SN94624, "SN94624", tag, owner, clock) | |
| 790 | { | |
| 791 | } | |
| 792 | ||
| 793 | //------------------------------------------------- | |
| 794 | // device_start - device-specific startup | |
| 795 | //------------------------------------------------- | |
| 796 | ||
| 797 | void sn94624_device::device_start() | |
| 798 | { | |
| 799 | DEVICE_START_NAME( sn94624 )(this); | |
| 800 | } | |
| 801 | ||
| 802 | //------------------------------------------------- | |
| 803 | // sound_stream_update - handle a stream update | |
| 804 | //------------------------------------------------- | |
| 805 | ||
| 806 | void sn94624_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 807 | { | |
| 808 | // should never get here | |
| 809 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 810 | } | |
| 811 | ||
| 812 | ||
| 813 | const device_type NCR7496 = &device_creator<ncr7496_device>; | |
| 814 | ||
| 815 | ncr7496_device::ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 816 | : sn76496_device(mconfig, NCR7496, "NCR7496", tag, owner, clock) | |
| 817 | { | |
| 818 | } | |
| 819 | ||
| 820 | //------------------------------------------------- | |
| 821 | // device_start - device-specific startup | |
| 822 | //------------------------------------------------- | |
| 823 | ||
| 824 | void ncr7496_device::device_start() | |
| 825 | { | |
| 826 | DEVICE_START_NAME( ncr7496 )(this); | |
| 827 | } | |
| 828 | ||
| 829 | //------------------------------------------------- | |
| 830 | // sound_stream_update - handle a stream update | |
| 831 | //------------------------------------------------- | |
| 832 | ||
| 833 | void ncr7496_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 834 | { | |
| 835 | // should never get here | |
| 836 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 837 | } | |
| 838 | ||
| 839 | ||
| 840 | const device_type GAMEGEAR = &device_creator<gamegear_device>; | |
| 841 | ||
| 842 | gamegear_device::gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 843 | : sn76496_device(mconfig, GAMEGEAR, "Game Gear PSG", tag, owner, clock) | |
| 844 | { | |
| 845 | } | |
| 846 | ||
| 847 | //------------------------------------------------- | |
| 848 | // device_start - device-specific startup | |
| 849 | //------------------------------------------------- | |
| 850 | ||
| 851 | void gamegear_device::device_start() | |
| 852 | { | |
| 853 | DEVICE_START_NAME( gamegear )(this); | |
| 854 | } | |
| 855 | ||
| 856 | //------------------------------------------------- | |
| 857 | // sound_stream_update - handle a stream update | |
| 858 | //------------------------------------------------- | |
| 859 | ||
| 860 | void gamegear_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 861 | { | |
| 862 | // should never get here | |
| 863 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 864 | } | |
| 865 | ||
| 866 | ||
| 867 | const device_type SEGAPSG = &device_creator<segapsg_device>; | |
| 868 | ||
| 869 | segapsg_device::segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 870 | : sn76496_device(mconfig, SEGAPSG, "SEGA VDP PSG", tag, owner, clock) | |
| 871 | { | |
| 872 | } | |
| 873 | ||
| 874 | //------------------------------------------------- | |
| 875 | // device_start - device-specific startup | |
| 876 | //------------------------------------------------- | |
| 877 | ||
| 878 | void segapsg_device::device_start() | |
| 879 | { | |
| 880 | DEVICE_START_NAME( segapsg )(this); | |
| 881 | } | |
| 882 | ||
| 883 | //------------------------------------------------- | |
| 884 | // sound_stream_update - handle a stream update | |
| 885 | //------------------------------------------------- | |
| 886 | ||
| 887 | void segapsg_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 888 | { | |
| 889 | // should never get here | |
| 890 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 891 | } | |
| 892 | ||
| 893 | ||
| 894 | ||
| 617 | 895 | /***************************************************************** |
| 618 | 896 | New class implementation |
| 619 | 897 | Michael Zapf, June 2012 |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | WRITE16_DEVICE_HANDLER( aica_midi_in ); |
| 27 | 27 | READ16_DEVICE_HANDLER( aica_midi_out_r ); |
| 28 | 28 | |
| 29 | DECLARE_LEGACY_SOUND_DEVICE(AICA, aica); | |
| 29 | class aica_device : public device_t, | |
| 30 | public device_sound_interface | |
| 31 | { | |
| 32 | public: | |
| 33 | aica_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 34 | ~aica_device() { global_free(m_token); } | |
| 30 | 35 | |
| 36 | // access to legacy token | |
| 37 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 38 | protected: | |
| 39 | // device-level overrides | |
| 40 | virtual void device_config_complete(); | |
| 41 | virtual void device_start(); | |
| 42 | virtual void device_stop(); | |
| 43 | ||
| 44 | // sound stream update overrides | |
| 45 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 46 | private: | |
| 47 | // internal state | |
| 48 | void *m_token; | |
| 49 | }; | |
| 50 | ||
| 51 | extern const device_type AICA; | |
| 52 | ||
| 53 | ||
| 31 | 54 | #endif /* __AICA_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | DEFINE_LEGACY_SOUND_DEVICE(WAVE, wave); | |
| 112 | const device_type WAVE = &device_creator<wave_device>; | |
| 113 | ||
| 114 | wave_device::wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 115 | : device_t(mconfig, WAVE, "Cassette", tag, owner, clock), | |
| 116 | device_sound_interface(mconfig, *this) | |
| 117 | { | |
| 118 | } | |
| 119 | ||
| 120 | //------------------------------------------------- | |
| 121 | // device_config_complete - perform any | |
| 122 | // operations now that the configuration is | |
| 123 | // complete | |
| 124 | //------------------------------------------------- | |
| 125 | ||
| 126 | void wave_device::device_config_complete() | |
| 127 | { | |
| 128 | } | |
| 129 | ||
| 130 | //------------------------------------------------- | |
| 131 | // device_start - device-specific startup | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | void wave_device::device_start() | |
| 135 | { | |
| 136 | DEVICE_START_NAME( wave )(this); | |
| 137 | } | |
| 138 | ||
| 139 | //------------------------------------------------- | |
| 140 | // sound_stream_update - handle a stream update | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | void wave_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 144 | { | |
| 145 | // should never get here | |
| 146 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 147 | } | |
| 148 | ||
| 149 |
| r17612 | r17613 | |
|---|---|---|
| 73 | 73 | { |
| 74 | 74 | assert(device != NULL); |
| 75 | 75 | assert(device->type() == ASTROCADE); |
| 76 | return (astrocade_state *)downcast< | |
| 76 | return (astrocade_state *)downcast< | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| r17612 | r17613 | |
| 331 | 331 | } |
| 332 | 332 | |
| 333 | 333 | |
| 334 | DEFINE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade); | |
| 334 | const device_type ASTROCADE = &device_creator<astrocade_device>; | |
| 335 | ||
| 336 | astrocade_device::astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 337 | : device_t(mconfig, ASTROCADE, "Astrocade", tag, owner, clock), | |
| 338 | device_sound_interface(mconfig, *this) | |
| 339 | { | |
| 340 | m_token = global_alloc_array_clear(UINT8, sizeof(astrocade_state)); | |
| 341 | } | |
| 342 | ||
| 343 | //------------------------------------------------- | |
| 344 | // device_config_complete - perform any | |
| 345 | // operations now that the configuration is | |
| 346 | // complete | |
| 347 | //------------------------------------------------- | |
| 348 | ||
| 349 | void astrocade_device::device_config_complete() | |
| 350 | { | |
| 351 | } | |
| 352 | ||
| 353 | //------------------------------------------------- | |
| 354 | // device_start - device-specific startup | |
| 355 | //------------------------------------------------- | |
| 356 | ||
| 357 | void astrocade_device::device_start() | |
| 358 | { | |
| 359 | DEVICE_START_NAME( astrocade )(this); | |
| 360 | } | |
| 361 | ||
| 362 | //------------------------------------------------- | |
| 363 | // device_reset - device-specific reset | |
| 364 | //------------------------------------------------- | |
| 365 | ||
| 366 | void astrocade_device::device_reset() | |
| 367 | { | |
| 368 | DEVICE_RESET_NAME( astrocade )(this); | |
| 369 | } | |
| 370 | ||
| 371 | //------------------------------------------------- | |
| 372 | // sound_stream_update - handle a stream update | |
| 373 | //------------------------------------------------- | |
| 374 | ||
| 375 | void astrocade_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 376 | { | |
| 377 | // should never get here | |
| 378 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 379 | } | |
| 380 | ||
| 381 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | WRITE8_DEVICE_HANDLER( sn76496_w ); |
| 10 | 10 | WRITE8_DEVICE_HANDLER( sn76496_stereo_w ); |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(SN76496, sn76496); | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(U8106, u8106); | |
| 14 | DECLARE_LEGACY_SOUND_DEVICE(Y2404, y2404); | |
| 15 | DECLARE_LEGACY_SOUND_DEVICE(SN76489, sn76489); | |
| 16 | DECLARE_LEGACY_SOUND_DEVICE(SN76489A, sn76489a); | |
| 17 | DECLARE_LEGACY_SOUND_DEVICE(SN76494, sn76494); | |
| 18 | DECLARE_LEGACY_SOUND_DEVICE(SN94624, sn94624); | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(NCR7496, ncr7496); | |
| 20 | DECLARE_LEGACY_SOUND_DEVICE(GAMEGEAR, gamegear); | |
| 21 | DECLARE_LEGACY_SOUND_DEVICE(SEGAPSG, segapsg); | |
| 12 | class sn76496_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | sn76496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | sn76496_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~sn76496_device() { global_free(m_token); } | |
| 22 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | ||
| 27 | // sound stream update overrides | |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type SN76496; | |
| 35 | ||
| 36 | class u8106_device : public sn76496_device | |
| 37 | { | |
| 38 | public: | |
| 39 | u8106_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 40 | protected: | |
| 41 | // device-level overrides | |
| 42 | virtual void device_start(); | |
| 43 | ||
| 44 | // sound stream update overrides | |
| 45 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 46 | }; | |
| 47 | ||
| 48 | extern const device_type U8106; | |
| 49 | ||
| 50 | class y2404_device : public sn76496_device | |
| 51 | { | |
| 52 | public: | |
| 53 | y2404_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 54 | protected: | |
| 55 | // device-level overrides | |
| 56 | virtual void device_start(); | |
| 57 | ||
| 58 | // sound stream update overrides | |
| 59 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 60 | }; | |
| 61 | ||
| 62 | extern const device_type Y2404; | |
| 63 | ||
| 64 | class sn76489_device : public sn76496_device | |
| 65 | { | |
| 66 | public: | |
| 67 | sn76489_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | protected: | |
| 69 | // device-level overrides | |
| 70 | virtual void device_start(); | |
| 71 | ||
| 72 | // sound stream update overrides | |
| 73 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 74 | }; | |
| 75 | ||
| 76 | extern const device_type SN76489; | |
| 77 | ||
| 78 | class sn76489a_device : public sn76496_device | |
| 79 | { | |
| 80 | public: | |
| 81 | sn76489a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 82 | protected: | |
| 83 | // device-level overrides | |
| 84 | virtual void device_start(); | |
| 85 | ||
| 86 | // sound stream update overrides | |
| 87 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 88 | }; | |
| 89 | ||
| 90 | extern const device_type SN76489A; | |
| 91 | ||
| 92 | class sn76494_device : public sn76496_device | |
| 93 | { | |
| 94 | public: | |
| 95 | sn76494_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 96 | protected: | |
| 97 | // device-level overrides | |
| 98 | virtual void device_start(); | |
| 99 | ||
| 100 | // sound stream update overrides | |
| 101 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 102 | }; | |
| 103 | ||
| 104 | extern const device_type SN76494; | |
| 105 | ||
| 106 | class sn94624_device : public sn76496_device | |
| 107 | { | |
| 108 | public: | |
| 109 | sn94624_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 110 | protected: | |
| 111 | // device-level overrides | |
| 112 | virtual void device_start(); | |
| 113 | ||
| 114 | // sound stream update overrides | |
| 115 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 116 | }; | |
| 117 | ||
| 118 | extern const device_type SN94624; | |
| 119 | ||
| 120 | class ncr7496_device : public sn76496_device | |
| 121 | { | |
| 122 | public: | |
| 123 | ncr7496_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 124 | protected: | |
| 125 | // device-level overrides | |
| 126 | virtual void device_start(); | |
| 127 | ||
| 128 | // sound stream update overrides | |
| 129 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 130 | }; | |
| 131 | ||
| 132 | extern const device_type NCR7496; | |
| 133 | ||
| 134 | class gamegear_device : public sn76496_device | |
| 135 | { | |
| 136 | public: | |
| 137 | gamegear_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 138 | protected: | |
| 139 | // device-level overrides | |
| 140 | virtual void device_start(); | |
| 141 | ||
| 142 | // sound stream update overrides | |
| 143 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 144 | }; | |
| 145 | ||
| 146 | extern const device_type GAMEGEAR; | |
| 147 | ||
| 148 | class segapsg_device : public sn76496_device | |
| 149 | { | |
| 150 | public: | |
| 151 | segapsg_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 152 | protected: | |
| 153 | // device-level overrides | |
| 154 | virtual void device_start(); | |
| 155 | ||
| 156 | // sound stream update overrides | |
| 157 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 158 | }; | |
| 159 | ||
| 160 | extern const device_type SEGAPSG; | |
| 161 | ||
| 162 | ||
| 23 | 163 | /***************************************************************** |
| 24 | 164 | New class implementation |
| 25 | 165 | Michael Zapf, June 2012 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | * CassetteWave interface |
| 10 | 10 | *****************************************************************************/ |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(WAVE, wave); | |
| 12 | class wave_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | wave_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 13 | 17 | |
| 18 | protected: | |
| 19 | // device-level overrides | |
| 20 | virtual void device_config_complete(); | |
| 21 | virtual void device_start(); | |
| 22 | ||
| 23 | // sound stream update overrides | |
| 24 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 25 | private: | |
| 26 | }; | |
| 27 | ||
| 28 | extern const device_type WAVE; | |
| 29 | ||
| 30 | ||
| 14 | 31 | #define WAVE_TAG "wave" |
| 15 | 32 | #define WAVE2_TAG "wave2" |
| 16 | 33 |
| r17612 | r17613 | |
|---|---|---|
| 101 | 101 | { |
| 102 | 102 | assert(device != NULL); |
| 103 | 103 | assert(device->type() == X1_010); |
| 104 | return (x1_010_state *)downcast< | |
| 104 | return (x1_010_state *)downcast<x1 | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| r17612 | r17613 | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | |
| 314 | DEFINE_LEGACY_SOUND_DEVICE(X1_010, x1_010); | |
| 314 | const device_type X1_010 = &device_creator<x1_010_device>; | |
| 315 | ||
| 316 | x1_010_device::x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 317 | : device_t(mconfig, X1_010, "X1-010", tag, owner, clock), | |
| 318 | device_sound_interface(mconfig, *this) | |
| 319 | { | |
| 320 | m_token = global_alloc_array_clear(UINT8, sizeof(x1_010_state)); | |
| 321 | } | |
| 322 | ||
| 323 | //------------------------------------------------- | |
| 324 | // device_config_complete - perform any | |
| 325 | // operations now that the configuration is | |
| 326 | // complete | |
| 327 | //------------------------------------------------- | |
| 328 | ||
| 329 | void x1_010_device::device_config_complete() | |
| 330 | { | |
| 331 | } | |
| 332 | ||
| 333 | //------------------------------------------------- | |
| 334 | // device_start - device-specific startup | |
| 335 | //------------------------------------------------- | |
| 336 | ||
| 337 | void x1_010_device::device_start() | |
| 338 | { | |
| 339 | DEVICE_START_NAME( x1_010 )(this); | |
| 340 | } | |
| 341 | ||
| 342 | //------------------------------------------------- | |
| 343 | // sound_stream_update - handle a stream update | |
| 344 | //------------------------------------------------- | |
| 345 | ||
| 346 | void x1_010_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 347 | { | |
| 348 | // should never get here | |
| 349 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 350 | } | |
| 351 | ||
| 352 |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | WRITE8_DEVICE_HANDLER( astrocade_sound_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(ASTROCADE, astrocade); | |
| 10 | class astrocade_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | astrocade_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~astrocade_device() { global_free(m_token); } | |
| 11 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | virtual void device_reset(); | |
| 24 | ||
| 25 | // sound stream update overrides | |
| 26 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type ASTROCADE; | |
| 33 | ||
| 34 | ||
| 12 | 35 | #endif /* __ASTROCDE_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | void seta_sound_enable_w(device_t *device, int data); |
| 23 | 23 | |
| 24 | DECLARE_LEGACY_SOUND_DEVICE(X1_010, x1_010); | |
| 24 | class x1_010_device : public device_t, | |
| 25 | public device_sound_interface | |
| 26 | { | |
| 27 | public: | |
| 28 | x1_010_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 29 | ~x1_010_device() { global_free(m_token); } | |
| 25 | 30 | |
| 31 | // access to legacy token | |
| 32 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 33 | protected: | |
| 34 | // device-level overrides | |
| 35 | virtual void device_config_complete(); | |
| 36 | virtual void device_start(); | |
| 37 | ||
| 38 | // sound stream update overrides | |
| 39 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type X1_010; | |
| 46 | ||
| 47 | ||
| 26 | 48 | #endif /* __X1_010_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | assert(device != NULL); |
| 30 | 30 | assert(device->type() == K056800); |
| 31 | 31 | |
| 32 | return (k056800_state *)downcast< | |
| 32 | return (k056800_state *)downcast<k056800_devic | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | INLINE const k056800_interface *k056800_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | DEFINE_LEGACY_DEVICE(K056800, k056800); | |
| 182 | const device_type K056800 = &device_creator<k056800_device>; | |
| 183 | ||
| 184 | k056800_device::k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 185 | : device_t(mconfig, K056800, "Konami 056800 MIRAC", tag, owner, clock) | |
| 186 | { | |
| 187 | m_token = global_alloc_array_clear(UINT8, sizeof(k056800_state)); | |
| 188 | } | |
| 189 | ||
| 190 | //------------------------------------------------- | |
| 191 | // device_config_complete - perform any | |
| 192 | // operations now that the configuration is | |
| 193 | // complete | |
| 194 | //------------------------------------------------- | |
| 195 | ||
| 196 | void k056800_device::device_config_complete() | |
| 197 | { | |
| 198 | } | |
| 199 | ||
| 200 | //------------------------------------------------- | |
| 201 | // device_start - device-specific startup | |
| 202 | //------------------------------------------------- | |
| 203 | ||
| 204 | void k056800_device::device_start() | |
| 205 | { | |
| 206 | DEVICE_START_NAME( k056800 )(this); | |
| 207 | } | |
| 208 | ||
| 209 | //------------------------------------------------- | |
| 210 | // device_reset - device-specific reset | |
| 211 | //------------------------------------------------- | |
| 212 | ||
| 213 | void k056800_device::device_reset() | |
| 214 | { | |
| 215 | DEVICE_RESET_NAME( k056800 )(this); | |
| 216 | } | |
| 217 | ||
| 218 |
| r17612 | r17613 | |
|---|---|---|
| 23 | 23 | k056800_irq_cb irq_cb; |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | DECLARE_LEGACY_DEVICE(K056800, k056800); | |
| 26 | class k056800_device : public device_t | |
| 27 | { | |
| 28 | public: | |
| 29 | k056800_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 30 | ~k056800_device() { global_free(m_token); } | |
| 27 | 31 | |
| 32 | // access to legacy token | |
| 33 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 34 | protected: | |
| 35 | // device-level overrides | |
| 36 | virtual void device_config_complete(); | |
| 37 | virtual void device_start(); | |
| 38 | virtual void device_reset(); | |
| 39 | private: | |
| 40 | // internal state | |
| 41 | void *m_token; | |
| 42 | }; | |
| 28 | 43 | |
| 44 | extern const device_type K056800; | |
| 45 | ||
| 46 | ||
| 47 | ||
| 29 | 48 | /*************************************************************************** |
| 30 | 49 | DEVICE CONFIGURATION MACROS |
| 31 | 50 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 224 | 224 | { |
| 225 | 225 | assert(device != NULL); |
| 226 | 226 | assert(device->type() == UPD7759); |
| 227 | return (upd7759_state *)downcast< | |
| 227 | return (upd7759_state *)downcast<upd7759_devic | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| r17612 | r17613 | |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | |
| 770 | DEFINE_LEGACY_SOUND_DEVICE(UPD7759, upd7759); | |
| 770 | const device_type UPD7759 = &device_creator<upd7759_device>; | |
| 771 | ||
| 772 | upd7759_device::upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 773 | : device_t(mconfig, UPD7759, "UPD7759", tag, owner, clock), | |
| 774 | device_sound_interface(mconfig, *this) | |
| 775 | { | |
| 776 | m_token = global_alloc_array_clear(UINT8, sizeof(upd7759_state)); | |
| 777 | } | |
| 778 | ||
| 779 | //------------------------------------------------- | |
| 780 | // device_config_complete - perform any | |
| 781 | // operations now that the configuration is | |
| 782 | // complete | |
| 783 | //------------------------------------------------- | |
| 784 | ||
| 785 | void upd7759_device::device_config_complete() | |
| 786 | { | |
| 787 | } | |
| 788 | ||
| 789 | //------------------------------------------------- | |
| 790 | // device_start - device-specific startup | |
| 791 | //------------------------------------------------- | |
| 792 | ||
| 793 | void upd7759_device::device_start() | |
| 794 | { | |
| 795 | DEVICE_START_NAME( upd7759 )(this); | |
| 796 | } | |
| 797 | ||
| 798 | //------------------------------------------------- | |
| 799 | // device_reset - device-specific reset | |
| 800 | //------------------------------------------------- | |
| 801 | ||
| 802 | void upd7759_device::device_reset() | |
| 803 | { | |
| 804 | DEVICE_RESET_NAME( upd7759 )(this); | |
| 805 | } | |
| 806 | ||
| 807 | //------------------------------------------------- | |
| 808 | // sound_stream_update - handle a stream update | |
| 809 | //------------------------------------------------- | |
| 810 | ||
| 811 | void upd7759_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 812 | { | |
| 813 | // should never get here | |
| 814 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 815 | } | |
| 816 | ||
| 817 |
| r17612 | r17613 | |
|---|---|---|
| 275 | 275 | { |
| 276 | 276 | assert(device != NULL); |
| 277 | 277 | assert(device->type() == YMF271); |
| 278 | return (YMF271Chip *)downcast< | |
| 278 | return (YMF271Chip *)downcast< | |
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | |
| r17612 | r17613 | |
| 1836 | 1836 | } |
| 1837 | 1837 | |
| 1838 | 1838 | |
| 1839 | DEFINE_LEGACY_SOUND_DEVICE(YMF271, ymf271); | |
| 1839 | const device_type YMF271 = &device_creator<ymf271_device>; | |
| 1840 | ||
| 1841 | ymf271_device::ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1842 | : device_t(mconfig, YMF271, "YMF271", tag, owner, clock), | |
| 1843 | device_sound_interface(mconfig, *this) | |
| 1844 | { | |
| 1845 | m_token = global_alloc_array_clear(UINT8, sizeof(YMF271Chip)); | |
| 1846 | } | |
| 1847 | ||
| 1848 | //------------------------------------------------- | |
| 1849 | // device_config_complete - perform any | |
| 1850 | // operations now that the configuration is | |
| 1851 | // complete | |
| 1852 | //------------------------------------------------- | |
| 1853 | ||
| 1854 | void ymf271_device::device_config_complete() | |
| 1855 | { | |
| 1856 | } | |
| 1857 | ||
| 1858 | //------------------------------------------------- | |
| 1859 | // device_start - device-specific startup | |
| 1860 | //------------------------------------------------- | |
| 1861 | ||
| 1862 | void ymf271_device::device_start() | |
| 1863 | { | |
| 1864 | DEVICE_START_NAME( ymf271 )(this); | |
| 1865 | } | |
| 1866 | ||
| 1867 | //------------------------------------------------- | |
| 1868 | // device_reset - device-specific reset | |
| 1869 | //------------------------------------------------- | |
| 1870 | ||
| 1871 | void ymf271_device::device_reset() | |
| 1872 | { | |
| 1873 | DEVICE_RESET_NAME( ymf271 )(this); | |
| 1874 | } | |
| 1875 | ||
| 1876 | //------------------------------------------------- | |
| 1877 | // sound_stream_update - handle a stream update | |
| 1878 | //------------------------------------------------- | |
| 1879 | ||
| 1880 | void ymf271_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1881 | { | |
| 1882 | // should never get here | |
| 1883 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1884 | } | |
| 1885 | ||
| 1886 |
| r17612 | r17613 | |
|---|---|---|
| 50 | 50 | { |
| 51 | 51 | assert(device != NULL); |
| 52 | 52 | assert(device->type() == NAMCO_63701X); |
| 53 | return (namco_63701x *)downcast< | |
| 53 | return (namco_63701x *)downcast<n | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| r17612 | r17613 | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | |
| 188 | DEFINE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x); | |
| 188 | const device_type NAMCO_63701X = &device_creator<namco_63701x_device>; | |
| 189 | ||
| 190 | namco_63701x_device::namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 191 | : device_t(mconfig, NAMCO_63701X, "Namco 63701X", tag, owner, clock), | |
| 192 | device_sound_interface(mconfig, *this) | |
| 193 | { | |
| 194 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_63701x)); | |
| 195 | } | |
| 196 | ||
| 197 | //------------------------------------------------- | |
| 198 | // device_config_complete - perform any | |
| 199 | // operations now that the configuration is | |
| 200 | // complete | |
| 201 | //------------------------------------------------- | |
| 202 | ||
| 203 | void namco_63701x_device::device_config_complete() | |
| 204 | { | |
| 205 | } | |
| 206 | ||
| 207 | //------------------------------------------------- | |
| 208 | // device_start - device-specific startup | |
| 209 | //------------------------------------------------- | |
| 210 | ||
| 211 | void namco_63701x_device::device_start() | |
| 212 | { | |
| 213 | DEVICE_START_NAME( namco_63701x )(this); | |
| 214 | } | |
| 215 | ||
| 216 | //------------------------------------------------- | |
| 217 | // sound_stream_update - handle a stream update | |
| 218 | //------------------------------------------------- | |
| 219 | ||
| 220 | void namco_63701x_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 221 | { | |
| 222 | // should never get here | |
| 223 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 224 | } | |
| 225 | ||
| 226 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | int upd7759_busy_r(device_t *device); |
| 26 | 26 | WRITE8_DEVICE_HANDLER( upd7759_port_w ); |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_SOUND_DEVICE(UPD7759, upd7759); | |
| 28 | class upd7759_device : public device_t, | |
| 29 | public device_sound_interface | |
| 30 | { | |
| 31 | public: | |
| 32 | upd7759_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~upd7759_device() { global_free(m_token); } | |
| 29 | 34 | |
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | virtual void device_reset(); | |
| 42 | ||
| 43 | // sound stream update overrides | |
| 44 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type UPD7759; | |
| 51 | ||
| 52 | ||
| 30 | 53 | #endif /* __UPD7759_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | assert(device != NULL); |
| 62 | 62 | assert(device->type() == SP0250); |
| 63 | return (sp0250_state *)downcast< | |
| 63 | return (sp0250_state *)downcast<sp0250_devic | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| r17612 | r17613 | |
| 266 | 266 | |
| 267 | 267 | |
| 268 | 268 | |
| 269 | DEFINE_LEGACY_SOUND_DEVICE(SP0250, sp0250); | |
| 269 | const device_type SP0250 = &device_creator<sp0250_device>; | |
| 270 | ||
| 271 | sp0250_device::sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 272 | : device_t(mconfig, SP0250, "SP0250", tag, owner, clock), | |
| 273 | device_sound_interface(mconfig, *this) | |
| 274 | { | |
| 275 | m_token = global_alloc_array_clear(UINT8, sizeof(sp0250_state)); | |
| 276 | } | |
| 277 | ||
| 278 | //------------------------------------------------- | |
| 279 | // device_config_complete - perform any | |
| 280 | // operations now that the configuration is | |
| 281 | // complete | |
| 282 | //------------------------------------------------- | |
| 283 | ||
| 284 | void sp0250_device::device_config_complete() | |
| 285 | { | |
| 286 | } | |
| 287 | ||
| 288 | //------------------------------------------------- | |
| 289 | // device_start - device-specific startup | |
| 290 | //------------------------------------------------- | |
| 291 | ||
| 292 | void sp0250_device::device_start() | |
| 293 | { | |
| 294 | DEVICE_START_NAME( sp0250 )(this); | |
| 295 | } | |
| 296 | ||
| 297 | //------------------------------------------------- | |
| 298 | // sound_stream_update - handle a stream update | |
| 299 | //------------------------------------------------- | |
| 300 | ||
| 301 | void sp0250_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 302 | { | |
| 303 | // should never get here | |
| 304 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 305 | } | |
| 306 | ||
| 307 |
| r17612 | r17613 | |
|---|---|---|
| 129 | 129 | { |
| 130 | 130 | assert(device != NULL); |
| 131 | 131 | assert(device->type() == SPEAKER_SOUND); |
| 132 | return (speaker_state *)downcast< | |
| 132 | return (speaker_state *)downcast<spe | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| r17612 | r17613 | |
| 444 | 444 | } |
| 445 | 445 | |
| 446 | 446 | |
| 447 | DEFINE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound); | |
| 447 | const device_type SPEAKER_SOUND = &device_creator<speaker_sound_device>; | |
| 448 | ||
| 449 | speaker_sound_device::speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 450 | : device_t(mconfig, SPEAKER_SOUND, "Speaker", tag, owner, clock), | |
| 451 | device_sound_interface(mconfig, *this) | |
| 452 | { | |
| 453 | m_token = global_alloc_array_clear(UINT8, sizeof(speaker_state)); | |
| 454 | } | |
| 455 | ||
| 456 | //------------------------------------------------- | |
| 457 | // device_config_complete - perform any | |
| 458 | // operations now that the configuration is | |
| 459 | // complete | |
| 460 | //------------------------------------------------- | |
| 461 | ||
| 462 | void speaker_sound_device::device_config_complete() | |
| 463 | { | |
| 464 | } | |
| 465 | ||
| 466 | //------------------------------------------------- | |
| 467 | // device_start - device-specific startup | |
| 468 | //------------------------------------------------- | |
| 469 | ||
| 470 | void speaker_sound_device::device_start() | |
| 471 | { | |
| 472 | DEVICE_START_NAME( speaker )(this); | |
| 473 | } | |
| 474 | ||
| 475 | //------------------------------------------------- | |
| 476 | // sound_stream_update - handle a stream update | |
| 477 | //------------------------------------------------- | |
| 478 | ||
| 479 | void speaker_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 480 | { | |
| 481 | // should never get here | |
| 482 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 483 | } | |
| 484 | ||
| 485 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | READ8_DEVICE_HANDLER( ymf271_r ); |
| 18 | 18 | WRITE8_DEVICE_HANDLER( ymf271_w ); |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_SOUND_DEVICE(YMF271, ymf271); | |
| 20 | class ymf271_device : public device_t, | |
| 21 | public device_sound_interface | |
| 22 | { | |
| 23 | public: | |
| 24 | ymf271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~ymf271_device() { global_free(m_token); } | |
| 21 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | ||
| 35 | // sound stream update overrides | |
| 36 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 37 | private: | |
| 38 | // internal state | |
| 39 | void *m_token; | |
| 40 | }; | |
| 41 | ||
| 42 | extern const device_type YMF271; | |
| 43 | ||
| 44 | ||
| 22 | 45 | #endif /* __YMF271_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | WRITE8_DEVICE_HANDLER( namco_63701x_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(NAMCO_63701X, namco_63701x); | |
| 10 | class namco_63701x_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | namco_63701x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~namco_63701x_device() { global_free(m_token); } | |
| 11 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | ||
| 24 | // sound stream update overrides | |
| 25 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 26 | private: | |
| 27 | // internal state | |
| 28 | void *m_token; | |
| 29 | }; | |
| 30 | ||
| 31 | extern const device_type NAMCO_63701X; | |
| 32 | ||
| 33 | ||
| 12 | 34 | #endif /* __N63701X_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 208 | 208 | device->type() == YM3439 || |
| 209 | 209 | device->type() == YMZ284 || |
| 210 | 210 | device->type() == YMZ294); |
| 211 | return (ay8910_context *)downcast< | |
| 211 | return (ay8910_context *)downcast< | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| r17612 | r17613 | |
| 1000 | 1000 | { |
| 1001 | 1001 | switch (state) |
| 1002 | 1002 | { |
| 1003 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break; | |
| 1004 | 1003 | case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8912A"); break; |
| 1005 | 1004 | default: DEVICE_GET_INFO_CALL(ay8910); break; |
| 1006 | 1005 | } |
| r17612 | r17613 | |
| 1010 | 1009 | { |
| 1011 | 1010 | switch (state) |
| 1012 | 1011 | { |
| 1013 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break; | |
| 1014 | 1012 | case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8913A"); break; |
| 1015 | 1013 | default: DEVICE_GET_INFO_CALL(ay8910); break; |
| 1016 | 1014 | } |
| r17612 | r17613 | |
| 1020 | 1018 | { |
| 1021 | 1019 | switch (state) |
| 1022 | 1020 | { |
| 1023 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break; | |
| 1024 | 1021 | case DEVINFO_STR_NAME: strcpy(info->s, "AY-3-8914"); break; |
| 1025 | 1022 | default: DEVICE_GET_INFO_CALL(ay8910); break; |
| 1026 | 1023 | } |
| r17612 | r17613 | |
| 1030 | 1027 | { |
| 1031 | 1028 | switch (state) |
| 1032 | 1029 | { |
| 1033 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ay8910 ); break; | |
| 1034 | 1030 | case DEVINFO_STR_NAME: strcpy(info->s, "AY8930"); break; |
| 1035 | 1031 | default: DEVICE_GET_INFO_CALL(ay8910); break; |
| 1036 | 1032 | } |
| r17612 | r17613 | |
| 1050 | 1046 | { |
| 1051 | 1047 | switch (state) |
| 1052 | 1048 | { |
| 1053 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break; | |
| 1054 | 1049 | case DEVINFO_STR_NAME: strcpy(info->s, "YM3439"); break; |
| 1055 | default: DEVICE_GET_INFO_CALL( | |
| 1050 | default: DEVICE_GET_INFO_CALL( | |
| 1056 | 1051 | } |
| 1057 | 1052 | } |
| 1058 | 1053 | |
| r17612 | r17613 | |
| 1060 | 1055 | { |
| 1061 | 1056 | switch (state) |
| 1062 | 1057 | { |
| 1063 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break; | |
| 1064 | 1058 | case DEVINFO_STR_NAME: strcpy(info->s, "YMZ284"); break; |
| 1065 | default: DEVICE_GET_INFO_CALL( | |
| 1059 | default: DEVICE_GET_INFO_CALL( | |
| 1066 | 1060 | } |
| 1067 | 1061 | } |
| 1068 | 1062 | |
| r17612 | r17613 | |
| 1070 | 1064 | { |
| 1071 | 1065 | switch (state) |
| 1072 | 1066 | { |
| 1073 | case DEVINFO_FCT_START: info->start = DEVICE_START_NAME( ym2149 ); break; | |
| 1074 | 1067 | case DEVINFO_STR_NAME: strcpy(info->s, "YMZ294"); break; |
| 1075 | default: DEVICE_GET_INFO_CALL( | |
| 1068 | default: DEVICE_GET_INFO_CALL( | |
| 1076 | 1069 | } |
| 1077 | 1070 | } |
| 1078 | 1071 | |
| r17612 | r17613 | |
| 1139 | 1132 | |
| 1140 | 1133 | |
| 1141 | 1134 | |
| 1142 | DEFINE_LEGACY_SOUND_DEVICE(AY8910, ay8910); | |
| 1143 | DEFINE_LEGACY_SOUND_DEVICE(AY8912, ay8912); | |
| 1144 | DEFINE_LEGACY_SOUND_DEVICE(AY8913, ay8913); | |
| 1145 | DEFINE_LEGACY_SOUND_DEVICE(AY8914, ay8914); | |
| 1146 | DEFINE_LEGACY_SOUND_DEVICE(AY8930, ay8930); | |
| 1147 | DEFINE_LEGACY_SOUND_DEVICE(YM2149, ym2149); | |
| 1148 | DEFINE_LEGACY_SOUND_DEVICE(YM3439, ym3439); | |
| 1149 | DEFINE_LEGACY_SOUND_DEVICE(YMZ284, ymz284); | |
| 1150 | DEFINE_LEGACY_SOUND_DEVICE(YMZ294, ymz294); | |
| 1135 | const device_type AY8910 = &device_creator<ay8910_device>; | |
| 1136 | ||
| 1137 | ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1138 | : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock), | |
| 1139 | device_sound_interface(mconfig, *this) | |
| 1140 | { | |
| 1141 | m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context)); | |
| 1142 | } | |
| 1143 | ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 1144 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 1145 | device_sound_interface(mconfig, *this) | |
| 1146 | { | |
| 1147 | m_token = global_alloc_array_clear(UINT8, sizeof(ay8910_context)); | |
| 1148 | } | |
| 1149 | ||
| 1150 | //------------------------------------------------- | |
| 1151 | // device_config_complete - perform any | |
| 1152 | // operations now that the configuration is | |
| 1153 | // complete | |
| 1154 | //------------------------------------------------- | |
| 1155 | ||
| 1156 | void ay8910_device::device_config_complete() | |
| 1157 | { | |
| 1158 | } | |
| 1159 | ||
| 1160 | //------------------------------------------------- | |
| 1161 | // device_start - device-specific startup | |
| 1162 | //------------------------------------------------- | |
| 1163 | ||
| 1164 | void ay8910_device::device_start() | |
| 1165 | { | |
| 1166 | DEVICE_START_NAME( ay8910 )(this); | |
| 1167 | } | |
| 1168 | ||
| 1169 | //------------------------------------------------- | |
| 1170 | // device_reset - device-specific reset | |
| 1171 | //------------------------------------------------- | |
| 1172 | ||
| 1173 | void ay8910_device::device_reset() | |
| 1174 | { | |
| 1175 | DEVICE_RESET_NAME( ay8910 )(this); | |
| 1176 | } | |
| 1177 | ||
| 1178 | //------------------------------------------------- | |
| 1179 | // device_stop - device-specific stop | |
| 1180 | //------------------------------------------------- | |
| 1181 | ||
| 1182 | void ay8910_device::device_stop() | |
| 1183 | { | |
| 1184 | DEVICE_STOP_NAME( ay8910 )(this); | |
| 1185 | } | |
| 1186 | ||
| 1187 | //------------------------------------------------- | |
| 1188 | // sound_stream_update - handle a stream update | |
| 1189 | //------------------------------------------------- | |
| 1190 | ||
| 1191 | void ay8910_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1192 | { | |
| 1193 | // should never get here | |
| 1194 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1195 | } | |
| 1196 | ||
| 1197 | ||
| 1198 | const device_type AY8912 = &device_creator<ay8912_device>; | |
| 1199 | ||
| 1200 | ay8912_device::ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1201 | : ay8910_device(mconfig, AY8912, "AY-3-8912A", tag, owner, clock) | |
| 1202 | { | |
| 1203 | } | |
| 1204 | ||
| 1205 | //------------------------------------------------- | |
| 1206 | // sound_stream_update - handle a stream update | |
| 1207 | //------------------------------------------------- | |
| 1208 | ||
| 1209 | void ay8912_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1210 | { | |
| 1211 | // should never get here | |
| 1212 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1213 | } | |
| 1214 | ||
| 1215 | ||
| 1216 | const device_type AY8913 = &device_creator<ay8913_device>; | |
| 1217 | ||
| 1218 | ay8913_device::ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1219 | : ay8910_device(mconfig, AY8913, "AY-3-8913A", tag, owner, clock) | |
| 1220 | { | |
| 1221 | } | |
| 1222 | ||
| 1223 | //------------------------------------------------- | |
| 1224 | // sound_stream_update - handle a stream update | |
| 1225 | //------------------------------------------------- | |
| 1226 | ||
| 1227 | void ay8913_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1228 | { | |
| 1229 | // should never get here | |
| 1230 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1231 | } | |
| 1232 | ||
| 1233 | ||
| 1234 | const device_type AY8914 = &device_creator<ay8914_device>; | |
| 1235 | ||
| 1236 | ay8914_device::ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1237 | : ay8910_device(mconfig, AY8914, "AY-3-8914", tag, owner, clock) | |
| 1238 | { | |
| 1239 | } | |
| 1240 | ||
| 1241 | //------------------------------------------------- | |
| 1242 | // sound_stream_update - handle a stream update | |
| 1243 | //------------------------------------------------- | |
| 1244 | ||
| 1245 | void ay8914_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1246 | { | |
| 1247 | // should never get here | |
| 1248 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1249 | } | |
| 1250 | ||
| 1251 | ||
| 1252 | const device_type AY8930 = &device_creator<ay8930_device>; | |
| 1253 | ||
| 1254 | ay8930_device::ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1255 | : ay8910_device(mconfig, AY8930, "AY8930", tag, owner, clock) | |
| 1256 | { | |
| 1257 | } | |
| 1258 | ||
| 1259 | //------------------------------------------------- | |
| 1260 | // sound_stream_update - handle a stream update | |
| 1261 | //------------------------------------------------- | |
| 1262 | ||
| 1263 | void ay8930_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1264 | { | |
| 1265 | // should never get here | |
| 1266 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1267 | } | |
| 1268 | ||
| 1269 | ||
| 1270 | const device_type YM2149 = &device_creator<ym2149_device>; | |
| 1271 | ||
| 1272 | ym2149_device::ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1273 | : ay8910_device(mconfig, YM2149, "YM2149", tag, owner, clock) | |
| 1274 | { | |
| 1275 | } | |
| 1276 | ym2149_device::ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 1277 | : ay8910_device(mconfig, type, name, tag, owner, clock) | |
| 1278 | { | |
| 1279 | } | |
| 1280 | ||
| 1281 | //------------------------------------------------- | |
| 1282 | // device_start - device-specific startup | |
| 1283 | //------------------------------------------------- | |
| 1284 | ||
| 1285 | void ym2149_device::device_start() | |
| 1286 | { | |
| 1287 | DEVICE_START_NAME( ym2149 )(this); | |
| 1288 | } | |
| 1289 | ||
| 1290 | //------------------------------------------------- | |
| 1291 | // sound_stream_update - handle a stream update | |
| 1292 | //------------------------------------------------- | |
| 1293 | ||
| 1294 | void ym2149_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1295 | { | |
| 1296 | // should never get here | |
| 1297 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1298 | } | |
| 1299 | ||
| 1300 | ||
| 1301 | const device_type YM3439 = &device_creator<ym3439_device>; | |
| 1302 | ||
| 1303 | ym3439_device::ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1304 | : ym2149_device(mconfig, YM3439, "YM3439", tag, owner, clock) | |
| 1305 | { | |
| 1306 | } | |
| 1307 | ||
| 1308 | //------------------------------------------------- | |
| 1309 | // sound_stream_update - handle a stream update | |
| 1310 | //------------------------------------------------- | |
| 1311 | ||
| 1312 | void ym3439_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1313 | { | |
| 1314 | // should never get here | |
| 1315 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1316 | } | |
| 1317 | ||
| 1318 | ||
| 1319 | const device_type YMZ284 = &device_creator<ymz284_device>; | |
| 1320 | ||
| 1321 | ymz284_device::ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1322 | : ym2149_device(mconfig, YMZ284, "YMZ284", tag, owner, clock) | |
| 1323 | { | |
| 1324 | } | |
| 1325 | ||
| 1326 | //------------------------------------------------- | |
| 1327 | // sound_stream_update - handle a stream update | |
| 1328 | //------------------------------------------------- | |
| 1329 | ||
| 1330 | void ymz284_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1331 | { | |
| 1332 | // should never get here | |
| 1333 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1334 | } | |
| 1335 | ||
| 1336 | ||
| 1337 | const device_type YMZ294 = &device_creator<ymz294_device>; | |
| 1338 | ||
| 1339 | ymz294_device::ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1340 | : ym2149_device(mconfig, YMZ294, "YMZ294", tag, owner, clock) | |
| 1341 | { | |
| 1342 | } | |
| 1343 | ||
| 1344 | //------------------------------------------------- | |
| 1345 | // sound_stream_update - handle a stream update | |
| 1346 | //------------------------------------------------- | |
| 1347 | ||
| 1348 | void ymz294_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1349 | { | |
| 1350 | // should never get here | |
| 1351 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1352 | } | |
| 1353 | ||
| 1354 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | { |
| 26 | 26 | assert(device != NULL); |
| 27 | 27 | assert(device->type() == CDDA); |
| 28 | return (cdda_info *)downcast< | |
| 28 | return (cdda_info *)downcast< | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | #define MAX_SECTORS ( 4 ) |
| r17612 | r17613 | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| 342 | DEFINE_LEGACY_SOUND_DEVICE(CDDA, cdda); | |
| 342 | const device_type CDDA = &device_creator<cdda_device>; | |
| 343 | ||
| 344 | cdda_device::cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 345 | : device_t(mconfig, CDDA, "CD/DA", tag, owner, clock), | |
| 346 | device_sound_interface(mconfig, *this) | |
| 347 | { | |
| 348 | m_token = global_alloc_array_clear(UINT8, sizeof(cdda_info)); | |
| 349 | } | |
| 350 | ||
| 351 | //------------------------------------------------- | |
| 352 | // device_config_complete - perform any | |
| 353 | // operations now that the configuration is | |
| 354 | // complete | |
| 355 | //------------------------------------------------- | |
| 356 | ||
| 357 | void cdda_device::device_config_complete() | |
| 358 | { | |
| 359 | } | |
| 360 | ||
| 361 | //------------------------------------------------- | |
| 362 | // device_start - device-specific startup | |
| 363 | //------------------------------------------------- | |
| 364 | ||
| 365 | void cdda_device::device_start() | |
| 366 | { | |
| 367 | DEVICE_START_NAME( cdda )(this); | |
| 368 | } | |
| 369 | ||
| 370 | //------------------------------------------------- | |
| 371 | // sound_stream_update - handle a stream update | |
| 372 | //------------------------------------------------- | |
| 373 | ||
| 374 | void cdda_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 375 | { | |
| 376 | // should never get here | |
| 377 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 378 | } | |
| 379 | ||
| 380 |
| r17612 | r17613 | |
|---|---|---|
| 344 | 344 | { |
| 345 | 345 | assert(device != NULL); |
| 346 | 346 | assert(device->type() == TMS36XX); |
| 347 | return (tms_state *)downcast< | |
| 347 | return (tms_state *)downcast<tms36xx_devic | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
| r17612 | r17613 | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | |
| 555 | DEFINE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx); | |
| 555 | const device_type TMS36XX = &device_creator<tms36xx_device>; | |
| 556 | ||
| 557 | tms36xx_device::tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 558 | : device_t(mconfig, TMS36XX, "TMS36XX", tag, owner, clock), | |
| 559 | device_sound_interface(mconfig, *this) | |
| 560 | { | |
| 561 | m_token = global_alloc_array_clear(UINT8, sizeof(tms_state)); | |
| 562 | } | |
| 563 | ||
| 564 | //------------------------------------------------- | |
| 565 | // device_config_complete - perform any | |
| 566 | // operations now that the configuration is | |
| 567 | // complete | |
| 568 | //------------------------------------------------- | |
| 569 | ||
| 570 | void tms36xx_device::device_config_complete() | |
| 571 | { | |
| 572 | } | |
| 573 | ||
| 574 | //------------------------------------------------- | |
| 575 | // device_start - device-specific startup | |
| 576 | //------------------------------------------------- | |
| 577 | ||
| 578 | void tms36xx_device::device_start() | |
| 579 | { | |
| 580 | DEVICE_START_NAME( tms36xx )(this); | |
| 581 | } | |
| 582 | ||
| 583 | //------------------------------------------------- | |
| 584 | // sound_stream_update - handle a stream update | |
| 585 | //------------------------------------------------- | |
| 586 | ||
| 587 | void tms36xx_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 588 | { | |
| 589 | // should never get here | |
| 590 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 591 | } | |
| 592 | ||
| 593 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == ST0016); |
| 25 | return (st0016_state *)downcast< | |
| 25 | return (st0016_state *)downcast<st0016_devic | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r17612 | r17613 | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| 176 | DEFINE_LEGACY_SOUND_DEVICE(ST0016, st0016); | |
| 176 | const device_type ST0016 = &device_creator<st0016_device>; | |
| 177 | ||
| 178 | st0016_device::st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 179 | : device_t(mconfig, ST0016, "ST0016", tag, owner, clock), | |
| 180 | device_sound_interface(mconfig, *this) | |
| 181 | { | |
| 182 | m_token = global_alloc_array_clear(UINT8, sizeof(st0016_state)); | |
| 183 | } | |
| 184 | ||
| 185 | //------------------------------------------------- | |
| 186 | // device_config_complete - perform any | |
| 187 | // operations now that the configuration is | |
| 188 | // complete | |
| 189 | //------------------------------------------------- | |
| 190 | ||
| 191 | void st0016_device::device_config_complete() | |
| 192 | { | |
| 193 | } | |
| 194 | ||
| 195 | //------------------------------------------------- | |
| 196 | // device_start - device-specific startup | |
| 197 | //------------------------------------------------- | |
| 198 | ||
| 199 | void st0016_device::device_start() | |
| 200 | { | |
| 201 | DEVICE_START_NAME( st0016 )(this); | |
| 202 | } | |
| 203 | ||
| 204 | //------------------------------------------------- | |
| 205 | // sound_stream_update - handle a stream update | |
| 206 | //------------------------------------------------- | |
| 207 | ||
| 208 | void st0016_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 209 | { | |
| 210 | // should never get here | |
| 211 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 212 | } | |
| 213 | ||
| 214 |
| r17612 | r17613 | |
|---|---|---|
| 12 | 12 | WRITE8_DEVICE_HANDLER( sp0250_w ); |
| 13 | 13 | UINT8 sp0250_drq_r(device_t *device); |
| 14 | 14 | |
| 15 | DECLARE_LEGACY_SOUND_DEVICE(SP0250, sp0250); | |
| 15 | class sp0250_device : public device_t, | |
| 16 | public device_sound_interface | |
| 17 | { | |
| 18 | public: | |
| 19 | sp0250_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 20 | ~sp0250_device() { global_free(m_token); } | |
| 16 | 21 | |
| 22 | // access to legacy token | |
| 23 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 24 | protected: | |
| 25 | // device-level overrides | |
| 26 | virtual void device_config_complete(); | |
| 27 | virtual void device_start(); | |
| 28 | ||
| 29 | // sound stream update overrides | |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type SP0250; | |
| 37 | ||
| 38 | ||
| 17 | 39 | #endif /* __SP0250_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 13 | 13 | { |
| 14 | 14 | assert(device != NULL); |
| 15 | 15 | assert(device->type() == TIA); |
| 16 | return (tia_state *)downcast< | |
| 16 | return (tia_state *)downcast<ti | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| r17612 | r17613 | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | DEFINE_LEGACY_SOUND_DEVICE(TIA, tia); | |
| 79 | const device_type TIA = &device_creator<tia_device>; | |
| 80 | ||
| 81 | tia_device::tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 82 | : device_t(mconfig, TIA, "TIA", tag, owner, clock), | |
| 83 | device_sound_interface(mconfig, *this) | |
| 84 | { | |
| 85 | m_token = global_alloc_array_clear(UINT8, sizeof(tia_state)); | |
| 86 | } | |
| 87 | ||
| 88 | //------------------------------------------------- | |
| 89 | // device_config_complete - perform any | |
| 90 | // operations now that the configuration is | |
| 91 | // complete | |
| 92 | //------------------------------------------------- | |
| 93 | ||
| 94 | void tia_device::device_config_complete() | |
| 95 | { | |
| 96 | } | |
| 97 | ||
| 98 | //------------------------------------------------- | |
| 99 | // device_start - device-specific startup | |
| 100 | //------------------------------------------------- | |
| 101 | ||
| 102 | void tia_device::device_start() | |
| 103 | { | |
| 104 | DEVICE_START_NAME( tia )(this); | |
| 105 | } | |
| 106 | ||
| 107 | //------------------------------------------------- | |
| 108 | // device_stop - device-specific stop | |
| 109 | //------------------------------------------------- | |
| 110 | ||
| 111 | void tia_device::device_stop() | |
| 112 | { | |
| 113 | DEVICE_STOP_NAME( tia )(this); | |
| 114 | } | |
| 115 | ||
| 116 | //------------------------------------------------- | |
| 117 | // sound_stream_update - handle a stream update | |
| 118 | //------------------------------------------------- | |
| 119 | ||
| 120 | void tia_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 121 | { | |
| 122 | // should never get here | |
| 123 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 124 | } | |
| 125 | ||
| 126 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | |
| 25 | 25 | void speaker_level_w (device_t *device, int new_level); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(SPEAKER_SOUND, speaker_sound); | |
| 27 | class speaker_sound_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | speaker_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~speaker_sound_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | ||
| 41 | // sound stream update overrides | |
| 42 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 43 | private: | |
| 44 | // internal state | |
| 45 | void *m_token; | |
| 46 | }; | |
| 47 | ||
| 48 | extern const device_type SPEAKER_SOUND; | |
| 49 | ||
| 50 | ||
| 29 | 51 | #endif /* __SPEAKER_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | int cdda_audio_paused(device_t *device); |
| 20 | 20 | int cdda_audio_ended(device_t *device); |
| 21 | 21 | |
| 22 | DECLARE_LEGACY_SOUND_DEVICE(CDDA, cdda); | |
| 22 | class cdda_device : public device_t, | |
| 23 | public device_sound_interface | |
| 24 | { | |
| 25 | public: | |
| 26 | cdda_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~cdda_device() { global_free(m_token); } | |
| 23 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | ||
| 36 | // sound stream update overrides | |
| 37 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 38 | private: | |
| 39 | // internal state | |
| 40 | void *m_token; | |
| 41 | }; | |
| 42 | ||
| 43 | extern const device_type CDDA; | |
| 44 | ||
| 45 | ||
| 24 | 46 | #endif /* __CDDA_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 119 | 119 | void ay8910_write_ym(void *chip, int addr, int data); |
| 120 | 120 | int ay8910_read_ym(void *chip); |
| 121 | 121 | |
| 122 | DECLARE_LEGACY_SOUND_DEVICE(AY8910, ay8910); | |
| 123 | DECLARE_LEGACY_SOUND_DEVICE(AY8912, ay8912); | |
| 124 | DECLARE_LEGACY_SOUND_DEVICE(AY8913, ay8913); | |
| 125 | DECLARE_LEGACY_SOUND_DEVICE(AY8914, ay8914); | |
| 126 | DECLARE_LEGACY_SOUND_DEVICE(AY8930, ay8930); | |
| 127 | DECLARE_LEGACY_SOUND_DEVICE(YM2149, ym2149); | |
| 128 | DECLARE_LEGACY_SOUND_DEVICE(YM3439, ym3439); | |
| 129 | DECLARE_LEGACY_SOUND_DEVICE(YMZ284, ymz284); | |
| 130 | DECLARE_LEGACY_SOUND_DEVICE(YMZ294, ymz294); | |
| 122 | class ay8910_device : public device_t, | |
| 123 | public device_sound_interface | |
| 124 | { | |
| 125 | public: | |
| 126 | ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 127 | ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 128 | ~ay8910_device() { global_free(m_token); } | |
| 131 | 129 | |
| 130 | // access to legacy token | |
| 131 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 132 | protected: | |
| 133 | // device-level overrides | |
| 134 | virtual void device_config_complete(); | |
| 135 | virtual void device_start(); | |
| 136 | virtual void device_stop(); | |
| 137 | virtual void device_reset(); | |
| 138 | ||
| 139 | // sound stream update overrides | |
| 140 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 141 | private: | |
| 142 | // internal state | |
| 143 | void *m_token; | |
| 144 | }; | |
| 145 | ||
| 146 | extern const device_type AY8910; | |
| 147 | ||
| 148 | class ay8912_device : public ay8910_device | |
| 149 | { | |
| 150 | public: | |
| 151 | ay8912_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 152 | ||
| 153 | // sound stream update overrides | |
| 154 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 155 | }; | |
| 156 | ||
| 157 | extern const device_type AY8912; | |
| 158 | ||
| 159 | class ay8913_device : public ay8910_device | |
| 160 | { | |
| 161 | public: | |
| 162 | ay8913_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 163 | ||
| 164 | // sound stream update overrides | |
| 165 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 166 | }; | |
| 167 | ||
| 168 | extern const device_type AY8913; | |
| 169 | ||
| 170 | class ay8914_device : public ay8910_device | |
| 171 | { | |
| 172 | public: | |
| 173 | ay8914_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 174 | ||
| 175 | // sound stream update overrides | |
| 176 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 177 | }; | |
| 178 | ||
| 179 | extern const device_type AY8914; | |
| 180 | ||
| 181 | class ay8930_device : public ay8910_device | |
| 182 | { | |
| 183 | public: | |
| 184 | ay8930_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 185 | ||
| 186 | // sound stream update overrides | |
| 187 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 188 | }; | |
| 189 | ||
| 190 | extern const device_type AY8930; | |
| 191 | ||
| 192 | class ym2149_device : public ay8910_device | |
| 193 | { | |
| 194 | public: | |
| 195 | ym2149_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 196 | ym2149_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 197 | protected: | |
| 198 | // device-level overrides | |
| 199 | virtual void device_start(); | |
| 200 | ||
| 201 | // sound stream update overrides | |
| 202 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 203 | }; | |
| 204 | ||
| 205 | extern const device_type YM2149; | |
| 206 | ||
| 207 | class ym3439_device : public ym2149_device | |
| 208 | { | |
| 209 | public: | |
| 210 | ym3439_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 211 | ||
| 212 | // sound stream update overrides | |
| 213 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 214 | }; | |
| 215 | ||
| 216 | extern const device_type YM3439; | |
| 217 | ||
| 218 | class ymz284_device : public ym2149_device | |
| 219 | { | |
| 220 | public: | |
| 221 | ymz284_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 222 | ||
| 223 | // sound stream update overrides | |
| 224 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 225 | }; | |
| 226 | ||
| 227 | extern const device_type YMZ284; | |
| 228 | ||
| 229 | class ymz294_device : public ym2149_device | |
| 230 | { | |
| 231 | public: | |
| 232 | ymz294_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 233 | ||
| 234 | // sound stream update overrides | |
| 235 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 236 | }; | |
| 237 | ||
| 238 | extern const device_type YMZ294; | |
| 239 | ||
| 240 | ||
| 132 | 241 | #endif /* __AY8910_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | /* TMS3617 interface functions */ |
| 29 | 29 | extern void tms3617_enable_w(device_t *device, int enable); |
| 30 | 30 | |
| 31 | DECLARE_LEGACY_SOUND_DEVICE(TMS36XX, tms36xx); | |
| 31 | class tms36xx_device : public device_t, | |
| 32 | public device_sound_interface | |
| 33 | { | |
| 34 | public: | |
| 35 | tms36xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ~tms36xx_device() { global_free(m_token); } | |
| 32 | 37 | |
| 38 | // access to legacy token | |
| 39 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 40 | protected: | |
| 41 | // device-level overrides | |
| 42 | virtual void device_config_complete(); | |
| 43 | virtual void device_start(); | |
| 44 | ||
| 45 | // sound stream update overrides | |
| 46 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 47 | private: | |
| 48 | // internal state | |
| 49 | void *m_token; | |
| 50 | }; | |
| 51 | ||
| 52 | extern const device_type TMS36XX; | |
| 53 | ||
| 54 | ||
| 33 | 55 | #endif /* __TMS36XX_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 86 | 86 | { |
| 87 | 87 | assert(device != NULL); |
| 88 | 88 | assert(device->type() == C6280); |
| 89 | return (c6280_t *)downcast< | |
| 89 | return (c6280_t *)downcast< | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r17612 | r17613 | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | |
| 375 | DEFINE_LEGACY_SOUND_DEVICE(C6280, c6280); | |
| 375 | const device_type C6280 = &device_creator<c6280_device>; | |
| 376 | ||
| 377 | c6280_device::c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 378 | : device_t(mconfig, C6280, "HuC6280", tag, owner, clock), | |
| 379 | device_sound_interface(mconfig, *this) | |
| 380 | { | |
| 381 | m_token = global_alloc_array_clear(UINT8, sizeof(c6280_t)); | |
| 382 | } | |
| 383 | ||
| 384 | //------------------------------------------------- | |
| 385 | // device_config_complete - perform any | |
| 386 | // operations now that the configuration is | |
| 387 | // complete | |
| 388 | //------------------------------------------------- | |
| 389 | ||
| 390 | void c6280_device::device_config_complete() | |
| 391 | { | |
| 392 | } | |
| 393 | ||
| 394 | //------------------------------------------------- | |
| 395 | // device_start - device-specific startup | |
| 396 | //------------------------------------------------- | |
| 397 | ||
| 398 | void c6280_device::device_start() | |
| 399 | { | |
| 400 | DEVICE_START_NAME( c6280 )(this); | |
| 401 | } | |
| 402 | ||
| 403 | //------------------------------------------------- | |
| 404 | // sound_stream_update - handle a stream update | |
| 405 | //------------------------------------------------- | |
| 406 | ||
| 407 | void c6280_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 408 | { | |
| 409 | // should never get here | |
| 410 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 411 | } | |
| 412 | ||
| 413 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | READ8_DEVICE_HANDLER( st0016_snd_r ); |
| 15 | 15 | WRITE8_DEVICE_HANDLER( st0016_snd_w ); |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_SOUND_DEVICE(ST0016, st0016); | |
| 17 | class st0016_device : public device_t, | |
| 18 | public device_sound_interface | |
| 19 | { | |
| 20 | public: | |
| 21 | st0016_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~st0016_device() { global_free(m_token); } | |
| 18 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | ||
| 31 | // sound stream update overrides | |
| 32 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 37 | ||
| 38 | extern const device_type ST0016; | |
| 39 | ||
| 40 | ||
| 19 | 41 | #endif /* __ST0016_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | WRITE8_DEVICE_HANDLER( tia_sound_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(TIA, tia); | |
| 10 | class tia_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | tia_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~tia_device() { global_free(m_token); } | |
| 11 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | virtual void device_stop(); | |
| 24 | ||
| 25 | // sound stream update overrides | |
| 26 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type TIA; | |
| 33 | ||
| 34 | ||
| 12 | 35 | #endif /* __TIAINTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | WRITE8_DEVICE_HANDLER( c6280_w ); |
| 16 | 16 | READ8_DEVICE_HANDLER( c6280_r ); |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_SOUND_DEVICE(C6280, c6280); | |
| 18 | class c6280_device : public device_t, | |
| 19 | public device_sound_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | c6280_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | ~c6280_device() { global_free(m_token); } | |
| 19 | 24 | |
| 25 | // access to legacy token | |
| 26 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 27 | protected: | |
| 28 | // device-level overrides | |
| 29 | virtual void device_config_complete(); | |
| 30 | virtual void device_start(); | |
| 31 | ||
| 32 | // sound stream update overrides | |
| 33 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 34 | private: | |
| 35 | // internal state | |
| 36 | void *m_token; | |
| 37 | }; | |
| 38 | ||
| 39 | extern const device_type C6280; | |
| 40 | ||
| 41 | ||
| 20 | 42 | #endif /* __C6280_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 253 | 253 | { |
| 254 | 254 | assert(device != NULL); |
| 255 | 255 | assert(device->type() == SCSP); |
| 256 | return (scsp_state *)downcast< | |
| 256 | return (scsp_state *)downcast<s | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | static unsigned char DecodeSCI(scsp_state *scsp,unsigned char irq) |
| r17612 | r17613 | |
| 1387 | 1387 | } |
| 1388 | 1388 | |
| 1389 | 1389 | |
| 1390 | DEFINE_LEGACY_SOUND_DEVICE(SCSP, scsp); | |
| 1390 | const device_type SCSP = &device_creator<scsp_device>; | |
| 1391 | ||
| 1392 | scsp_device::scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1393 | : device_t(mconfig, SCSP, "SCSP", tag, owner, clock), | |
| 1394 | device_sound_interface(mconfig, *this) | |
| 1395 | { | |
| 1396 | m_token = global_alloc_array_clear(UINT8, sizeof(scsp_state)); | |
| 1397 | } | |
| 1398 | ||
| 1399 | //------------------------------------------------- | |
| 1400 | // device_config_complete - perform any | |
| 1401 | // operations now that the configuration is | |
| 1402 | // complete | |
| 1403 | //------------------------------------------------- | |
| 1404 | ||
| 1405 | void scsp_device::device_config_complete() | |
| 1406 | { | |
| 1407 | } | |
| 1408 | ||
| 1409 | //------------------------------------------------- | |
| 1410 | // device_start - device-specific startup | |
| 1411 | //------------------------------------------------- | |
| 1412 | ||
| 1413 | void scsp_device::device_start() | |
| 1414 | { | |
| 1415 | DEVICE_START_NAME( scsp )(this); | |
| 1416 | } | |
| 1417 | ||
| 1418 | //------------------------------------------------- | |
| 1419 | // sound_stream_update - handle a stream update | |
| 1420 | //------------------------------------------------- | |
| 1421 | ||
| 1422 | void scsp_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1423 | { | |
| 1424 | // should never get here | |
| 1425 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1426 | } | |
| 1427 | ||
| 1428 |
| r17612 | r17613 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | assert(device != NULL); |
| 80 | 80 | assert(device->type() == MSM5232); |
| 81 | return (msm5232_state *)downcast< | |
| 81 | return (msm5232_state *)downcast<msm5232_devic | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | |
| r17612 | r17613 | |
| 878 | 878 | } |
| 879 | 879 | |
| 880 | 880 | |
| 881 | DEFINE_LEGACY_SOUND_DEVICE(MSM5232, msm5232); | |
| 881 | const device_type MSM5232 = &device_creator<msm5232_device>; | |
| 882 | ||
| 883 | msm5232_device::msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 884 | : device_t(mconfig, MSM5232, "MSM5232", tag, owner, clock), | |
| 885 | device_sound_interface(mconfig, *this) | |
| 886 | { | |
| 887 | m_token = global_alloc_array_clear(UINT8, sizeof(msm5232_state)); | |
| 888 | } | |
| 889 | ||
| 890 | //------------------------------------------------- | |
| 891 | // device_config_complete - perform any | |
| 892 | // operations now that the configuration is | |
| 893 | // complete | |
| 894 | //------------------------------------------------- | |
| 895 | ||
| 896 | void msm5232_device::device_config_complete() | |
| 897 | { | |
| 898 | } | |
| 899 | ||
| 900 | //------------------------------------------------- | |
| 901 | // device_start - device-specific startup | |
| 902 | //------------------------------------------------- | |
| 903 | ||
| 904 | void msm5232_device::device_start() | |
| 905 | { | |
| 906 | DEVICE_START_NAME( msm5232 )(this); | |
| 907 | } | |
| 908 | ||
| 909 | //------------------------------------------------- | |
| 910 | // device_reset - device-specific reset | |
| 911 | //------------------------------------------------- | |
| 912 | ||
| 913 | void msm5232_device::device_reset() | |
| 914 | { | |
| 915 | DEVICE_RESET_NAME( msm5232 )(this); | |
| 916 | } | |
| 917 | ||
| 918 | //------------------------------------------------- | |
| 919 | // device_stop - device-specific stop | |
| 920 | //------------------------------------------------- | |
| 921 | ||
| 922 | void msm5232_device::device_stop() | |
| 923 | { | |
| 924 | DEVICE_STOP_NAME( msm5232 )(this); | |
| 925 | } | |
| 926 | ||
| 927 | //------------------------------------------------- | |
| 928 | // sound_stream_update - handle a stream update | |
| 929 | //------------------------------------------------- | |
| 930 | ||
| 931 | void msm5232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 932 | { | |
| 933 | // should never get here | |
| 934 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 935 | } | |
| 936 | ||
| 937 |
| r17612 | r17613 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | assert(device != NULL); |
| 34 | 34 | assert(device->type() == YM2610 || device->type() == YM2610B); |
| 35 | return (ym2610_state *)downcast< | |
| 35 | return (ym2610_state *)downcast< | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r17612 | r17613 | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | |
| 259 | DEFINE_LEGACY_SOUND_DEVICE(YM2610, ym2610); | |
| 260 | DEFINE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b); | |
| 259 | const device_type YM2610 = &device_creator<ym2610_device>; | |
| 260 | ||
| 261 | ym2610_device::ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 262 | : device_t(mconfig, YM2610, "YM2610", tag, owner, clock), | |
| 263 | device_sound_interface(mconfig, *this) | |
| 264 | { | |
| 265 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state)); | |
| 266 | } | |
| 267 | ym2610_device::ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 268 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 269 | device_sound_interface(mconfig, *this) | |
| 270 | { | |
| 271 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2610_state)); | |
| 272 | } | |
| 273 | ||
| 274 | //------------------------------------------------- | |
| 275 | // device_config_complete - perform any | |
| 276 | // operations now that the configuration is | |
| 277 | // complete | |
| 278 | //------------------------------------------------- | |
| 279 | ||
| 280 | void ym2610_device::device_config_complete() | |
| 281 | { | |
| 282 | } | |
| 283 | ||
| 284 | //------------------------------------------------- | |
| 285 | // device_start - device-specific startup | |
| 286 | //------------------------------------------------- | |
| 287 | ||
| 288 | void ym2610_device::device_start() | |
| 289 | { | |
| 290 | DEVICE_START_NAME( ym2610 )(this); | |
| 291 | } | |
| 292 | ||
| 293 | //------------------------------------------------- | |
| 294 | // device_reset - device-specific reset | |
| 295 | //------------------------------------------------- | |
| 296 | ||
| 297 | void ym2610_device::device_reset() | |
| 298 | { | |
| 299 | DEVICE_RESET_NAME( ym2610 )(this); | |
| 300 | } | |
| 301 | ||
| 302 | //------------------------------------------------- | |
| 303 | // device_stop - device-specific stop | |
| 304 | //------------------------------------------------- | |
| 305 | ||
| 306 | void ym2610_device::device_stop() | |
| 307 | { | |
| 308 | DEVICE_STOP_NAME( ym2610 )(this); | |
| 309 | } | |
| 310 | ||
| 311 | //------------------------------------------------- | |
| 312 | // sound_stream_update - handle a stream update | |
| 313 | //------------------------------------------------- | |
| 314 | ||
| 315 | void ym2610_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 316 | { | |
| 317 | // should never get here | |
| 318 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 319 | } | |
| 320 | ||
| 321 | ||
| 322 | const device_type YM2610B = &device_creator<ym2610b_device>; | |
| 323 | ||
| 324 | ym2610b_device::ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 325 | : ym2610_device(mconfig, YM2610B, "YM2610B", tag, owner, clock) | |
| 326 | { | |
| 327 | } | |
| 328 | ||
| 329 | //------------------------------------------------- | |
| 330 | // sound_stream_update - handle a stream update | |
| 331 | //------------------------------------------------- | |
| 332 | ||
| 333 | void ym2610b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 334 | { | |
| 335 | // should never get here | |
| 336 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 337 | } | |
| 338 | ||
| 339 |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | { |
| 16 | 16 | assert(device != NULL); |
| 17 | 17 | assert(device->type() == FILTER_RC); |
| 18 | return (filter_rc_state *)downcast<le | |
| 18 | return (filter_rc_state *)downcast<filter_rc | |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | const flt_rc_config flt_rc_ac_default = {FLT_RC_AC, 10000, 0, 0, CAP_U(1)}; |
| r17612 | r17613 | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
| 140 | DEFINE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc); | |
| 140 | const device_type FILTER_RC = &device_creator<filter_rc_device>; | |
| 141 | ||
| 142 | filter_rc_device::filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 143 | : device_t(mconfig, FILTER_RC, "RC Filter", tag, owner, clock), | |
| 144 | device_sound_interface(mconfig, *this) | |
| 145 | { | |
| 146 | m_token = global_alloc_array_clear(UINT8, sizeof(filter_rc_state)); | |
| 147 | } | |
| 148 | ||
| 149 | //------------------------------------------------- | |
| 150 | // device_config_complete - perform any | |
| 151 | // operations now that the configuration is | |
| 152 | // complete | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | void filter_rc_device::device_config_complete() | |
| 156 | { | |
| 157 | } | |
| 158 | ||
| 159 | //------------------------------------------------- | |
| 160 | // device_start - device-specific startup | |
| 161 | //------------------------------------------------- | |
| 162 | ||
| 163 | void filter_rc_device::device_start() | |
| 164 | { | |
| 165 | DEVICE_START_NAME( filter_rc )(this); | |
| 166 | } | |
| 167 | ||
| 168 | //------------------------------------------------- | |
| 169 | // sound_stream_update - handle a stream update | |
| 170 | //------------------------------------------------- | |
| 171 | ||
| 172 | void filter_rc_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 173 | { | |
| 174 | // should never get here | |
| 175 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 176 | } | |
| 177 | ||
| 178 |
| r17612 | r17613 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | assert(device != NULL); |
| 34 | 34 | assert(device->type() == BEEP); |
| 35 | return (beep_state *)downcast< | |
| 35 | return (beep_state *)downcast<beep | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r17612 | r17613 | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
| 192 | DEFINE_LEGACY_SOUND_DEVICE(BEEP, beep); | |
| 192 | const device_type BEEP = &device_creator<beep_device>; | |
| 193 | ||
| 194 | beep_device::beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 195 | : device_t(mconfig, BEEP, "Beep", tag, owner, clock), | |
| 196 | device_sound_interface(mconfig, *this) | |
| 197 | { | |
| 198 | m_token = global_alloc_array_clear(UINT8, sizeof(beep_state)); | |
| 199 | } | |
| 200 | ||
| 201 | //------------------------------------------------- | |
| 202 | // device_config_complete - perform any | |
| 203 | // operations now that the configuration is | |
| 204 | // complete | |
| 205 | //------------------------------------------------- | |
| 206 | ||
| 207 | void beep_device::device_config_complete() | |
| 208 | { | |
| 209 | } | |
| 210 | ||
| 211 | //------------------------------------------------- | |
| 212 | // device_start - device-specific startup | |
| 213 | //------------------------------------------------- | |
| 214 | ||
| 215 | void beep_device::device_start() | |
| 216 | { | |
| 217 | DEVICE_START_NAME( beep )(this); | |
| 218 | } | |
| 219 | ||
| 220 | //------------------------------------------------- | |
| 221 | // sound_stream_update - handle a stream update | |
| 222 | //------------------------------------------------- | |
| 223 | ||
| 224 | void beep_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 225 | { | |
| 226 | // should never get here | |
| 227 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 228 | } | |
| 229 | ||
| 230 |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | extern UINT32* stv_scu; |
| 31 | 31 | |
| 32 | DECLARE_LEGACY_SOUND_DEVICE(SCSP, scsp); | |
| 32 | class scsp_device : public device_t, | |
| 33 | public device_sound_interface | |
| 34 | { | |
| 35 | public: | |
| 36 | scsp_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | ~scsp_device() { global_free(m_token); } | |
| 33 | 38 | |
| 39 | // access to legacy token | |
| 40 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 41 | protected: | |
| 42 | // device-level overrides | |
| 43 | virtual void device_config_complete(); | |
| 44 | virtual void device_start(); | |
| 45 | ||
| 46 | // sound stream update overrides | |
| 47 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 48 | private: | |
| 49 | // internal state | |
| 50 | void *m_token; | |
| 51 | }; | |
| 52 | ||
| 53 | extern const device_type SCSP; | |
| 54 | ||
| 55 | ||
| 34 | 56 | #endif /* __SCSP_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | void msm5232_set_clock(device_t *device, int clock); |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(MSM5232, msm5232); | |
| 19 | class msm5232_device : public device_t, | |
| 20 | public device_sound_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | msm5232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~msm5232_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_stop(); | |
| 33 | virtual void device_reset(); | |
| 34 | ||
| 35 | // sound stream update overrides | |
| 36 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 37 | private: | |
| 38 | // internal state | |
| 39 | void *m_token; | |
| 40 | }; | |
| 41 | ||
| 42 | extern const device_type MSM5232; | |
| 43 | ||
| 44 | ||
| 21 | 45 | #endif /* __MSM5232_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | void filter_rc_set_RC(device_t *device, int type, double R1, double R2, double R3, double C); |
| 61 | 61 | |
| 62 | DECLARE_LEGACY_SOUND_DEVICE(FILTER_RC, filter_rc); | |
| 62 | class filter_rc_device : public device_t, | |
| 63 | public device_sound_interface | |
| 64 | { | |
| 65 | public: | |
| 66 | filter_rc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 67 | ~filter_rc_device() { global_free(m_token); } | |
| 63 | 68 | |
| 69 | // access to legacy token | |
| 70 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 71 | protected: | |
| 72 | // device-level overrides | |
| 73 | virtual void device_config_complete(); | |
| 74 | virtual void device_start(); | |
| 75 | ||
| 76 | // sound stream update overrides | |
| 77 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 78 | private: | |
| 79 | // internal state | |
| 80 | void *m_token; | |
| 81 | }; | |
| 82 | ||
| 83 | extern const device_type FILTER_RC; | |
| 84 | ||
| 85 | ||
| 64 | 86 | #endif /* __FLT_RC_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | WRITE8_DEVICE_HANDLER( ym2610_data_port_b_w ); |
| 29 | 29 | |
| 30 | 30 | |
| 31 | DECLARE_LEGACY_SOUND_DEVICE(YM2610, ym2610); | |
| 32 | DECLARE_LEGACY_SOUND_DEVICE(YM2610B, ym2610b); | |
| 31 | class ym2610_device : public device_t, | |
| 32 | public device_sound_interface | |
| 33 | { | |
| 34 | public: | |
| 35 | ym2610_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ym2610_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | ~ym2610_device() { global_free(m_token); } | |
| 33 | 38 | |
| 39 | // access to legacy token | |
| 40 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 41 | protected: | |
| 42 | // device-level overrides | |
| 43 | virtual void device_config_complete(); | |
| 44 | virtual void device_start(); | |
| 45 | virtual void device_stop(); | |
| 46 | virtual void device_reset(); | |
| 47 | ||
| 48 | // sound stream update overrides | |
| 49 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 50 | private: | |
| 51 | // internal state | |
| 52 | void *m_token; | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type YM2610; | |
| 56 | ||
| 57 | class ym2610b_device : public ym2610_device | |
| 58 | { | |
| 59 | public: | |
| 60 | ym2610b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 61 | ||
| 62 | // sound stream update overrides | |
| 63 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 64 | }; | |
| 65 | ||
| 66 | extern const device_type YM2610B; | |
| 67 | ||
| 68 | ||
| 34 | 69 | #endif /* __2610INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 11 | 11 | void beep_set_frequency(device_t *device, int frequency); |
| 12 | 12 | void beep_set_volume(device_t *device, int volume); |
| 13 | 13 | |
| 14 | DECLARE_LEGACY_SOUND_DEVICE(BEEP, beep); | |
| 14 | class beep_device : public device_t, | |
| 15 | public device_sound_interface | |
| 16 | { | |
| 17 | public: | |
| 18 | beep_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 19 | ~beep_device() { global_free(m_token); } | |
| 15 | 20 | |
| 21 | // access to legacy token | |
| 22 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 23 | protected: | |
| 24 | // device-level overrides | |
| 25 | virtual void device_config_complete(); | |
| 26 | virtual void device_start(); | |
| 27 | ||
| 28 | // sound stream update overrides | |
| 29 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type BEEP; | |
| 36 | ||
| 37 | ||
| 16 | 38 | #endif /* __BEEP_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | { |
| 25 | 25 | assert(device != NULL); |
| 26 | 26 | assert(device->type() == TMS3615); |
| 27 | return (tms_state *)downcast< | |
| 27 | return (tms_state *)downcast<tms3615_devic | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| r17612 | r17613 | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| 123 | DEFINE_LEGACY_SOUND_DEVICE(TMS3615, tms3615); | |
| 123 | const device_type TMS3615 = &device_creator<tms3615_device>; | |
| 124 | ||
| 125 | tms3615_device::tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 126 | : device_t(mconfig, TMS3615, "TMS3615", tag, owner, clock), | |
| 127 | device_sound_interface(mconfig, *this) | |
| 128 | { | |
| 129 | m_token = global_alloc_array_clear(UINT8, sizeof(tms_state)); | |
| 130 | } | |
| 131 | ||
| 132 | //------------------------------------------------- | |
| 133 | // device_config_complete - perform any | |
| 134 | // operations now that the configuration is | |
| 135 | // complete | |
| 136 | //------------------------------------------------- | |
| 137 | ||
| 138 | void tms3615_device::device_config_complete() | |
| 139 | { | |
| 140 | } | |
| 141 | ||
| 142 | //------------------------------------------------- | |
| 143 | // device_start - device-specific startup | |
| 144 | //------------------------------------------------- | |
| 145 | ||
| 146 | void tms3615_device::device_start() | |
| 147 | { | |
| 148 | DEVICE_START_NAME( tms3615 )(this); | |
| 149 | } | |
| 150 | ||
| 151 | //------------------------------------------------- | |
| 152 | // sound_stream_update - handle a stream update | |
| 153 | //------------------------------------------------- | |
| 154 | ||
| 155 | void tms3615_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 156 | { | |
| 157 | // should never get here | |
| 158 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 159 | } | |
| 160 | ||
| 161 |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | #define TMS3615_FOOTAGE_8 0 |
| 11 | 11 | #define TMS3615_FOOTAGE_16 1 |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(TMS3615, tms3615); | |
| 13 | class tms3615_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | tms3615_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~tms3615_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | ||
| 27 | // sound stream update overrides | |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type TMS3615; | |
| 35 | ||
| 36 | ||
| 15 | 37 | #endif /* __TMS3615_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 268 | 268 | { |
| 269 | 269 | assert(device != NULL); |
| 270 | 270 | assert(device->type() == S14001A); |
| 271 | return (S14001AChip *)downcast< | |
| 271 | return (S14001AChip *)downcast<s14001a | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | |
| r17612 | r17613 | |
| 648 | 648 | } |
| 649 | 649 | } |
| 650 | 650 | |
| 651 | DEFINE_LEGACY_SOUND_DEVICE(S14001A, s14001a); | |
| 651 | const device_type S14001A = &device_creator<s14001a_device>; | |
| 652 | ||
| 653 | s14001a_device::s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 654 | : device_t(mconfig, S14001A, "S14001A", tag, owner, clock), | |
| 655 | device_sound_interface(mconfig, *this) | |
| 656 | { | |
| 657 | m_token = global_alloc_array_clear(UINT8, sizeof(S14001AChip)); | |
| 658 | } | |
| 659 | ||
| 660 | //------------------------------------------------- | |
| 661 | // device_config_complete - perform any | |
| 662 | // operations now that the configuration is | |
| 663 | // complete | |
| 664 | //------------------------------------------------- | |
| 665 | ||
| 666 | void s14001a_device::device_config_complete() | |
| 667 | { | |
| 668 | } | |
| 669 | ||
| 670 | //------------------------------------------------- | |
| 671 | // device_start - device-specific startup | |
| 672 | //------------------------------------------------- | |
| 673 | ||
| 674 | void s14001a_device::device_start() | |
| 675 | { | |
| 676 | DEVICE_START_NAME( s14001a )(this); | |
| 677 | } | |
| 678 | ||
| 679 | //------------------------------------------------- | |
| 680 | // sound_stream_update - handle a stream update | |
| 681 | //------------------------------------------------- | |
| 682 | ||
| 683 | void s14001a_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 684 | { | |
| 685 | // should never get here | |
| 686 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 687 | } | |
| 688 | ||
| 689 |
| r17612 | r17613 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | assert(device != NULL); |
| 80 | 80 | assert(device->type() == GAELCO_GAE1 || device->type() == GAELCO_CG1V); |
| 81 | return (gaelco_sound_state *)downcast< | |
| 81 | return (gaelco_sound_state *)downcast< | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | /*============================================================================ |
| r17612 | r17613 | |
| 339 | 339 | } |
| 340 | 340 | |
| 341 | 341 | |
| 342 | DEFINE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1); | |
| 343 | DEFINE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v); | |
| 342 | const device_type GAELCO_GAE1 = &device_creator<gaelco_gae1_device>; | |
| 343 | ||
| 344 | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 345 | : device_t(mconfig, GAELCO_GAE1, "Gaelco GAE1", tag, owner, clock), | |
| 346 | device_sound_interface(mconfig, *this) | |
| 347 | { | |
| 348 | m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state)); | |
| 349 | } | |
| 350 | ||
| 351 | gaelco_gae1_device::gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 352 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 353 | device_sound_interface(mconfig, *this) | |
| 354 | { | |
| 355 | m_token = global_alloc_array_clear(UINT8, sizeof(gaelco_sound_state)); | |
| 356 | } | |
| 357 | ||
| 358 | //------------------------------------------------- | |
| 359 | // device_config_complete - perform any | |
| 360 | // operations now that the configuration is | |
| 361 | // complete | |
| 362 | //------------------------------------------------- | |
| 363 | ||
| 364 | void gaelco_gae1_device::device_config_complete() | |
| 365 | { | |
| 366 | } | |
| 367 | ||
| 368 | //------------------------------------------------- | |
| 369 | // device_start - device-specific startup | |
| 370 | //------------------------------------------------- | |
| 371 | ||
| 372 | void gaelco_gae1_device::device_start() | |
| 373 | { | |
| 374 | DEVICE_START_NAME( gaelco )(this); | |
| 375 | } | |
| 376 | ||
| 377 | //------------------------------------------------- | |
| 378 | // device_stop - device-specific stop | |
| 379 | //------------------------------------------------- | |
| 380 | ||
| 381 | void gaelco_gae1_device::device_stop() | |
| 382 | { | |
| 383 | DEVICE_STOP_NAME( gaelco )(this); | |
| 384 | } | |
| 385 | ||
| 386 | //------------------------------------------------- | |
| 387 | // sound_stream_update - handle a stream update | |
| 388 | //------------------------------------------------- | |
| 389 | ||
| 390 | void gaelco_gae1_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 391 | { | |
| 392 | // should never get here | |
| 393 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 394 | } | |
| 395 | ||
| 396 | ||
| 397 | const device_type GAELCO_CG1V = &device_creator<gaelco_cg1v_device>; | |
| 398 | ||
| 399 | gaelco_cg1v_device::gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 400 | : gaelco_gae1_device(mconfig, GAELCO_CG1V, "Gaelco CG1V", tag, owner, clock) | |
| 401 | { | |
| 402 | } |
| r17612 | r17613 | |
|---|---|---|
| 11 | 11 | void s14001a_set_clock(device_t *device, int clock); /* set VSU-1000 clock */ |
| 12 | 12 | void s14001a_set_volume(device_t *device, int volume); /* set VSU-1000 volume control */ |
| 13 | 13 | |
| 14 | DECLARE_LEGACY_SOUND_DEVICE(S14001A, s14001a); | |
| 14 | class s14001a_device : public device_t, | |
| 15 | public device_sound_interface | |
| 16 | { | |
| 17 | public: | |
| 18 | s14001a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 19 | ~s14001a_device() { global_free(m_token); } | |
| 15 | 20 | |
| 21 | // access to legacy token | |
| 22 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 23 | protected: | |
| 24 | // device-level overrides | |
| 25 | virtual void device_config_complete(); | |
| 26 | virtual void device_start(); | |
| 27 | ||
| 28 | // sound stream update overrides | |
| 29 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type S14001A; | |
| 36 | ||
| 37 | ||
| 16 | 38 | #endif /* __S14001A_H__ */ |
| 17 | 39 |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | WRITE16_DEVICE_HANDLER( gaelcosnd_w ); |
| 16 | 16 | READ16_DEVICE_HANDLER( gaelcosnd_r ); |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_SOUND_DEVICE(GAELCO_GAE1, gaelco_gae1); | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(GAELCO_CG1V, gaelco_cg1v); | |
| 18 | class gaelco_gae1_device : public device_t, | |
| 19 | public device_sound_interface | |
| 20 | { | |
| 21 | public: | |
| 22 | gaelco_gae1_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | gaelco_gae1_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~gaelco_gae1_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_stop(); | |
| 33 | ||
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type GAELCO_GAE1; | |
| 42 | ||
| 43 | class gaelco_cg1v_device : public gaelco_gae1_device | |
| 44 | { | |
| 45 | public: | |
| 46 | gaelco_cg1v_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 47 | }; | |
| 48 | ||
| 49 | extern const device_type GAELCO_CG1V; | |
| 50 | ||
| 51 | ||
| 21 | 52 | #endif /* __GALELCO_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 59 | 59 | { |
| 60 | 60 | assert(device != NULL); |
| 61 | 61 | assert(device->type() == DMADAC); |
| 62 | return (dmadac_state *)downcast< | |
| 62 | return (dmadac_state *)downcast<dm | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| r17612 | r17613 | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | |
| 265 | DEFINE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound); | |
| 265 | const device_type DMADAC = &device_creator<dmadac_sound_device>; | |
| 266 | ||
| 267 | dmadac_sound_device::dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 268 | : device_t(mconfig, DMADAC, "DMA-driven DAC", tag, owner, clock), | |
| 269 | device_sound_interface(mconfig, *this) | |
| 270 | { | |
| 271 | m_token = global_alloc_array_clear(UINT8, sizeof(dmadac_state)); | |
| 272 | } | |
| 273 | ||
| 274 | //------------------------------------------------- | |
| 275 | // device_config_complete - perform any | |
| 276 | // operations now that the configuration is | |
| 277 | // complete | |
| 278 | //------------------------------------------------- | |
| 279 | ||
| 280 | void dmadac_sound_device::device_config_complete() | |
| 281 | { | |
| 282 | } | |
| 283 | ||
| 284 | //------------------------------------------------- | |
| 285 | // device_start - device-specific startup | |
| 286 | //------------------------------------------------- | |
| 287 | ||
| 288 | void dmadac_sound_device::device_start() | |
| 289 | { | |
| 290 | DEVICE_START_NAME( dmadac )(this); | |
| 291 | } | |
| 292 | ||
| 293 | //------------------------------------------------- | |
| 294 | // sound_stream_update - handle a stream update | |
| 295 | //------------------------------------------------- | |
| 296 | ||
| 297 | void dmadac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 298 | { | |
| 299 | // should never get here | |
| 300 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 301 | } | |
| 302 | ||
| 303 |
| r17612 | r17613 | |
|---|---|---|
| 12 | 12 | |
| 13 | 13 | #include "devlegcy.h" |
| 14 | 14 | |
| 15 | DECLARE_LEGACY_SOUND_DEVICE(DMADAC, dmadac_sound); | |
| 15 | class dmadac_sound_device : public device_t, | |
| 16 | public device_sound_interface | |
| 17 | { | |
| 18 | public: | |
| 19 | dmadac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 20 | ~dmadac_sound_device() { global_free(m_token); } | |
| 16 | 21 | |
| 22 | // access to legacy token | |
| 23 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 24 | protected: | |
| 25 | // device-level overrides | |
| 26 | virtual void device_config_complete(); | |
| 27 | virtual void device_start(); | |
| 28 | ||
| 29 | // sound stream update overrides | |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type DMADAC; | |
| 37 | ||
| 38 | ||
| 17 | 39 | void dmadac_transfer(dmadac_sound_device **devlist, UINT8 num_channels, offs_t channel_spacing, offs_t frame_spacing, offs_t total_frames, INT16 *data); |
| 18 | 40 | void dmadac_enable(dmadac_sound_device **devlist, UINT8 num_channels, UINT8 enable); |
| 19 | 41 | void dmadac_set_frequency(dmadac_sound_device **devlist, UINT8 num_channels, double frequency); |
| r17612 | r17613 | |
|---|---|---|
| 32 | 32 | { |
| 33 | 33 | assert(device != NULL); |
| 34 | 34 | assert(device->type() == YM2608); |
| 35 | return (ym2608_state *)downcast< | |
| 35 | return (ym2608_state *)downcast< | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| r17612 | r17613 | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | |
| 235 | DEFINE_LEGACY_SOUND_DEVICE(YM2608, ym2608); | |
| 235 | const device_type YM2608 = &device_creator<ym2608_device>; | |
| 236 | ||
| 237 | ym2608_device::ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 238 | : device_t(mconfig, YM2608, "YM2608", tag, owner, clock), | |
| 239 | device_sound_interface(mconfig, *this) | |
| 240 | { | |
| 241 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2608_state)); | |
| 242 | } | |
| 243 | ||
| 244 | //------------------------------------------------- | |
| 245 | // device_config_complete - perform any | |
| 246 | // operations now that the configuration is | |
| 247 | // complete | |
| 248 | //------------------------------------------------- | |
| 249 | ||
| 250 | void ym2608_device::device_config_complete() | |
| 251 | { | |
| 252 | } | |
| 253 | ||
| 254 | //------------------------------------------------- | |
| 255 | // device_start - device-specific startup | |
| 256 | //------------------------------------------------- | |
| 257 | ||
| 258 | void ym2608_device::device_start() | |
| 259 | { | |
| 260 | DEVICE_START_NAME( ym2608 )(this); | |
| 261 | } | |
| 262 | ||
| 263 | //------------------------------------------------- | |
| 264 | // device_reset - device-specific reset | |
| 265 | //------------------------------------------------- | |
| 266 | ||
| 267 | void ym2608_device::device_reset() | |
| 268 | { | |
| 269 | DEVICE_RESET_NAME( ym2608 )(this); | |
| 270 | } | |
| 271 | ||
| 272 | //------------------------------------------------- | |
| 273 | // device_stop - device-specific stop | |
| 274 | //------------------------------------------------- | |
| 275 | ||
| 276 | void ym2608_device::device_stop() | |
| 277 | { | |
| 278 | DEVICE_STOP_NAME( ym2608 )(this); | |
| 279 | } | |
| 280 | ||
| 281 | //------------------------------------------------- | |
| 282 | // sound_stream_update - handle a stream update | |
| 283 | //------------------------------------------------- | |
| 284 | ||
| 285 | void ym2608_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 286 | { | |
| 287 | // should never get here | |
| 288 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 289 | } | |
| 290 | ||
| 291 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == S2636_SOUND); |
| 25 | return (s2636_sound *) downcast< | |
| 25 | return (s2636_sound *) downcast<s2636 | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r17612 | r17613 | |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | DEFINE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound); | |
| 102 | const device_type S2636_SOUND = &device_creator<s2636_sound_device>; | |
| 103 | ||
| 104 | s2636_sound_device::s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 105 | : device_t(mconfig, S2636_SOUND, "S2636", tag, owner, clock), | |
| 106 | device_sound_interface(mconfig, *this) | |
| 107 | { | |
| 108 | m_token = global_alloc_array_clear(UINT8, sizeof(s2636_sound)); | |
| 109 | } | |
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // device_config_complete - perform any | |
| 113 | // operations now that the configuration is | |
| 114 | // complete | |
| 115 | //------------------------------------------------- | |
| 116 | ||
| 117 | void s2636_sound_device::device_config_complete() | |
| 118 | { | |
| 119 | } | |
| 120 | ||
| 121 | //------------------------------------------------- | |
| 122 | // device_start - device-specific startup | |
| 123 | //------------------------------------------------- | |
| 124 | ||
| 125 | void s2636_sound_device::device_start() | |
| 126 | { | |
| 127 | DEVICE_START_NAME( s2636_sound )(this); | |
| 128 | } | |
| 129 | ||
| 130 | //------------------------------------------------- | |
| 131 | // sound_stream_update - handle a stream update | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | void s2636_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 135 | { | |
| 136 | // should never get here | |
| 137 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 138 | } | |
| 139 | ||
| 140 |
| r17612 | r17613 | |
|---|---|---|
| 91 | 91 | { |
| 92 | 92 | assert(device != NULL); |
| 93 | 93 | assert(device->type() == OKIM6376); |
| 94 | return (okim6376_state *)downcast< | |
| 94 | return (okim6376_state *)downcast<okim6376_devic | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| r17612 | r17613 | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | |
| 649 | DEFINE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376); | |
| 649 | const device_type OKIM6376 = &device_creator<okim6376_device>; | |
| 650 | ||
| 651 | okim6376_device::okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 652 | : device_t(mconfig, OKIM6376, "OKI6376", tag, owner, clock), | |
| 653 | device_sound_interface(mconfig, *this) | |
| 654 | { | |
| 655 | m_token = global_alloc_array_clear(UINT8, sizeof(okim6376_state)); | |
| 656 | } | |
| 657 | ||
| 658 | //------------------------------------------------- | |
| 659 | // device_config_complete - perform any | |
| 660 | // operations now that the configuration is | |
| 661 | // complete | |
| 662 | //------------------------------------------------- | |
| 663 | ||
| 664 | void okim6376_device::device_config_complete() | |
| 665 | { | |
| 666 | } | |
| 667 | ||
| 668 | //------------------------------------------------- | |
| 669 | // device_start - device-specific startup | |
| 670 | //------------------------------------------------- | |
| 671 | ||
| 672 | void okim6376_device::device_start() | |
| 673 | { | |
| 674 | DEVICE_START_NAME( okim6376 )(this); | |
| 675 | } | |
| 676 | ||
| 677 | //------------------------------------------------- | |
| 678 | // device_reset - device-specific reset | |
| 679 | //------------------------------------------------- | |
| 680 | ||
| 681 | void okim6376_device::device_reset() | |
| 682 | { | |
| 683 | DEVICE_RESET_NAME( okim6376 )(this); | |
| 684 | } | |
| 685 | ||
| 686 | //------------------------------------------------- | |
| 687 | // sound_stream_update - handle a stream update | |
| 688 | //------------------------------------------------- | |
| 689 | ||
| 690 | void okim6376_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 691 | { | |
| 692 | // should never get here | |
| 693 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 694 | } | |
| 695 | ||
| 696 |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | WRITE8_DEVICE_HANDLER( ym2608_data_port_a_w ); |
| 30 | 30 | WRITE8_DEVICE_HANDLER( ym2608_data_port_b_w ); |
| 31 | 31 | |
| 32 | DECLARE_LEGACY_SOUND_DEVICE(YM2608, ym2608); | |
| 32 | class ym2608_device : public device_t, | |
| 33 | public device_sound_interface | |
| 34 | { | |
| 35 | public: | |
| 36 | ym2608_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | ~ym2608_device() { global_free(m_token); } | |
| 33 | 38 | |
| 39 | // access to legacy token | |
| 40 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 41 | protected: | |
| 42 | // device-level overrides | |
| 43 | virtual void device_config_complete(); | |
| 44 | virtual void device_start(); | |
| 45 | virtual void device_stop(); | |
| 46 | virtual void device_reset(); | |
| 47 | ||
| 48 | // sound stream update overrides | |
| 49 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 50 | private: | |
| 51 | // internal state | |
| 52 | void *m_token; | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type YM2608; | |
| 56 | ||
| 57 | ||
| 34 | 58 | #endif /* __2608INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 69 | 69 | { |
| 70 | 70 | assert(device != NULL); |
| 71 | 71 | assert(device->type() == ZSG2); |
| 72 | return (zsg2_state *)downcast< | |
| 72 | return (zsg2_state *)downcast<zsg2 | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static STREAM_UPDATE( update_stereo ) |
| r17612 | r17613 | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | DEFINE_LEGACY_SOUND_DEVICE(ZSG2, zsg2); | |
| 260 | const device_type ZSG2 = &device_creator<zsg2_device>; | |
| 261 | ||
| 262 | zsg2_device::zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 263 | : device_t(mconfig, ZSG2, "ZSG-2", tag, owner, clock), | |
| 264 | device_sound_interface(mconfig, *this) | |
| 265 | { | |
| 266 | m_token = global_alloc_array_clear(UINT8, sizeof(zsg2_state)); | |
| 267 | } | |
| 268 | ||
| 269 | //------------------------------------------------- | |
| 270 | // device_config_complete - perform any | |
| 271 | // operations now that the configuration is | |
| 272 | // complete | |
| 273 | //------------------------------------------------- | |
| 274 | ||
| 275 | void zsg2_device::device_config_complete() | |
| 276 | { | |
| 277 | } | |
| 278 | ||
| 279 | //------------------------------------------------- | |
| 280 | // device_start - device-specific startup | |
| 281 | //------------------------------------------------- | |
| 282 | ||
| 283 | void zsg2_device::device_start() | |
| 284 | { | |
| 285 | DEVICE_START_NAME( zsg2 )(this); | |
| 286 | } | |
| 287 | ||
| 288 | //------------------------------------------------- | |
| 289 | // sound_stream_update - handle a stream update | |
| 290 | //------------------------------------------------- | |
| 291 | ||
| 292 | void zsg2_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 293 | { | |
| 294 | // should never get here | |
| 295 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 296 | } | |
| 297 | ||
| 298 |
| r17612 | r17613 | |
|---|---|---|
| 205 | 205 | { |
| 206 | 206 | assert(device != NULL); |
| 207 | 207 | assert(device->type() == ES5505 || device->type() == ES5506); |
| 208 | return (es5506_state *)downcast< | |
| 208 | return (es5506_state *)downcast< | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| r17612 | r17613 | |
| 2207 | 2207 | } |
| 2208 | 2208 | |
| 2209 | 2209 | |
| 2210 | DEFINE_LEGACY_SOUND_DEVICE(ES5505, es5505); | |
| 2211 | DEFINE_LEGACY_SOUND_DEVICE(ES5506, es5506); | |
| 2210 | const device_type ES5505 = &device_creator<es5505_device>; | |
| 2211 | ||
| 2212 | es5505_device::es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2213 | : device_t(mconfig, ES5505, "ES5505", tag, owner, clock), | |
| 2214 | device_sound_interface(mconfig, *this) | |
| 2215 | { | |
| 2216 | m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state)); | |
| 2217 | } | |
| 2218 | ||
| 2219 | //------------------------------------------------- | |
| 2220 | // device_config_complete - perform any | |
| 2221 | // operations now that the configuration is | |
| 2222 | // complete | |
| 2223 | //------------------------------------------------- | |
| 2224 | ||
| 2225 | void es5505_device::device_config_complete() | |
| 2226 | { | |
| 2227 | } | |
| 2228 | ||
| 2229 | //------------------------------------------------- | |
| 2230 | // device_start - device-specific startup | |
| 2231 | //------------------------------------------------- | |
| 2232 | ||
| 2233 | void es5505_device::device_start() | |
| 2234 | { | |
| 2235 | DEVICE_START_NAME( es5505 )(this); | |
| 2236 | } | |
| 2237 | ||
| 2238 | //------------------------------------------------- | |
| 2239 | // device_reset - device-specific reset | |
| 2240 | //------------------------------------------------- | |
| 2241 | ||
| 2242 | void es5505_device::device_reset() | |
| 2243 | { | |
| 2244 | DEVICE_RESET_NAME( es5505 )(this); | |
| 2245 | } | |
| 2246 | ||
| 2247 | //------------------------------------------------- | |
| 2248 | // device_stop - device-specific stop | |
| 2249 | //------------------------------------------------- | |
| 2250 | ||
| 2251 | void es5505_device::device_stop() | |
| 2252 | { | |
| 2253 | DEVICE_STOP_NAME( es5505 )(this); | |
| 2254 | } | |
| 2255 | ||
| 2256 | //------------------------------------------------- | |
| 2257 | // sound_stream_update - handle a stream update | |
| 2258 | //------------------------------------------------- | |
| 2259 | ||
| 2260 | void es5505_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2261 | { | |
| 2262 | // should never get here | |
| 2263 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2264 | } | |
| 2265 | ||
| 2266 | ||
| 2267 | const device_type ES5506 = &device_creator<es5506_device>; | |
| 2268 | ||
| 2269 | es5506_device::es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2270 | : device_t(mconfig, ES5506, "ES5506", tag, owner, clock), | |
| 2271 | device_sound_interface(mconfig, *this) | |
| 2272 | { | |
| 2273 | m_token = global_alloc_array_clear(UINT8, sizeof(es5506_state)); | |
| 2274 | } | |
| 2275 | ||
| 2276 | //------------------------------------------------- | |
| 2277 | // device_config_complete - perform any | |
| 2278 | // operations now that the configuration is | |
| 2279 | // complete | |
| 2280 | //------------------------------------------------- | |
| 2281 | ||
| 2282 | void es5506_device::device_config_complete() | |
| 2283 | { | |
| 2284 | } | |
| 2285 | ||
| 2286 | //------------------------------------------------- | |
| 2287 | // device_start - device-specific startup | |
| 2288 | //------------------------------------------------- | |
| 2289 | ||
| 2290 | void es5506_device::device_start() | |
| 2291 | { | |
| 2292 | DEVICE_START_NAME( es5506 )(this); | |
| 2293 | } | |
| 2294 | ||
| 2295 | //------------------------------------------------- | |
| 2296 | // device_reset - device-specific reset | |
| 2297 | //------------------------------------------------- | |
| 2298 | ||
| 2299 | void es5506_device::device_reset() | |
| 2300 | { | |
| 2301 | DEVICE_RESET_NAME( es5506 )(this); | |
| 2302 | } | |
| 2303 | ||
| 2304 | //------------------------------------------------- | |
| 2305 | // device_stop - device-specific stop | |
| 2306 | //------------------------------------------------- | |
| 2307 | ||
| 2308 | void es5506_device::device_stop() | |
| 2309 | { | |
| 2310 | DEVICE_STOP_NAME( es5506 )(this); | |
| 2311 | } | |
| 2312 | ||
| 2313 | //------------------------------------------------- | |
| 2314 | // sound_stream_update - handle a stream update | |
| 2315 | //------------------------------------------------- | |
| 2316 | ||
| 2317 | void es5506_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2318 | { | |
| 2319 | // should never get here | |
| 2320 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2321 | } | |
| 2322 | ||
| 2323 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(S2636_SOUND, s2636_sound); | |
| 12 | class s2636_sound_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | s2636_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | ~s2636_sound_device() { global_free(m_token); } | |
| 18 | ||
| 19 | // access to legacy token | |
| 20 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 21 | protected: | |
| 22 | // device-level overrides | |
| 23 | virtual void device_config_complete(); | |
| 24 | virtual void device_start(); | |
| 25 | ||
| 26 | // sound stream update overrides | |
| 27 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 28 | private: | |
| 29 | // internal state | |
| 30 | void *m_token; | |
| 31 | }; | |
| 32 | ||
| 33 | extern const device_type S2636_SOUND; | |
| 34 | ||
| 13 | 35 | void s2636_soundport_w (device_t *device, int mode, int data); |
| 14 | 36 | |
| 15 | 37 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | const char *samplergn; |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_SOUND_DEVICE(ZSG2, zsg2); | |
| 19 | class zsg2_device : public device_t, | |
| 20 | public device_sound_interface | |
| 21 | { | |
| 22 | public: | |
| 23 | zsg2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~zsg2_device() { global_free(m_token); } | |
| 20 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | ||
| 33 | // sound stream update overrides | |
| 34 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 35 | private: | |
| 36 | // internal state | |
| 37 | void *m_token; | |
| 38 | }; | |
| 39 | ||
| 40 | extern const device_type ZSG2; | |
| 41 | ||
| 42 | ||
| 21 | 43 | #endif /* __ZSG2_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | READ8_DEVICE_HANDLER( okim6376_r ); |
| 11 | 11 | WRITE8_DEVICE_HANDLER( okim6376_w ); |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(OKIM6376, okim6376); | |
| 13 | class okim6376_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | okim6376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~okim6376_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | virtual void device_reset(); | |
| 27 | ||
| 28 | // sound stream update overrides | |
| 29 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type OKIM6376; | |
| 36 | ||
| 37 | ||
| 15 | 38 | WRITE_LINE_DEVICE_HANDLER( okim6376_st_w ); |
| 16 | 39 | WRITE_LINE_DEVICE_HANDLER( okim6376_ch2_w ); |
| 17 | 40 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | WRITE16_DEVICE_HANDLER( es5505_w ); |
| 26 | 26 | void es5505_voice_bank_w(device_t *device, int voice, int bank); |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_SOUND_DEVICE(ES5505, es5505); | |
| 28 | class es5505_device : public device_t, | |
| 29 | public device_sound_interface | |
| 30 | { | |
| 31 | public: | |
| 32 | es5505_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~es5505_device() { global_free(m_token); } | |
| 29 | 34 | |
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | virtual void device_stop(); | |
| 42 | virtual void device_reset(); | |
| 30 | 43 | |
| 44 | // sound stream update overrides | |
| 45 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 46 | private: | |
| 47 | // internal state | |
| 48 | void *m_token; | |
| 49 | }; | |
| 50 | ||
| 51 | extern const device_type ES5505; | |
| 52 | ||
| 53 | ||
| 54 | ||
| 31 | 55 | typedef struct _es5506_interface es5506_interface; |
| 32 | 56 | struct _es5506_interface |
| 33 | 57 | { |
| r17612 | r17613 | |
| 43 | 67 | WRITE8_DEVICE_HANDLER( es5506_w ); |
| 44 | 68 | void es5506_voice_bank_w(device_t *device, int voice, int bank); |
| 45 | 69 | |
| 46 | DECLARE_LEGACY_SOUND_DEVICE(ES5506, es5506); | |
| 70 | class es5506_device : public device_t, | |
| 71 | public device_sound_interface | |
| 72 | { | |
| 73 | public: | |
| 74 | es5506_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 75 | ~es5506_device() { global_free(m_token); } | |
| 47 | 76 | |
| 77 | // access to legacy token | |
| 78 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 79 | protected: | |
| 80 | // device-level overrides | |
| 81 | virtual void device_config_complete(); | |
| 82 | virtual void device_start(); | |
| 83 | virtual void device_stop(); | |
| 84 | virtual void device_reset(); | |
| 85 | ||
| 86 | // sound stream update overrides | |
| 87 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 88 | private: | |
| 89 | // internal state | |
| 90 | void *m_token; | |
| 91 | }; | |
| 92 | ||
| 93 | extern const device_type ES5506; | |
| 94 | ||
| 95 | ||
| 48 | 96 | #endif /* __ES5506_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 157 | 157 | { |
| 158 | 158 | assert(device != NULL); |
| 159 | 159 | assert(device->type() == YMF278B); |
| 160 | return (YMF278BChip *)downcast< | |
| 160 | return (YMF278BChip *)downcast< | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | static void ymf278b_write_memory(YMF278BChip *chip, UINT32 offset, UINT8 data) |
| r17612 | r17613 | |
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | |
| 1114 | DEFINE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b); | |
| 1114 | const device_type YMF278B = &device_creator<ymf278b_device>; | |
| 1115 | ||
| 1116 | ymf278b_device::ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1117 | : device_t(mconfig, YMF278B, "YMF278B", tag, owner, clock), | |
| 1118 | device_sound_interface(mconfig, *this) | |
| 1119 | { | |
| 1120 | m_token = global_alloc_array_clear(UINT8, sizeof(YMF278BChip)); | |
| 1121 | } | |
| 1122 | ||
| 1123 | //------------------------------------------------- | |
| 1124 | // device_config_complete - perform any | |
| 1125 | // operations now that the configuration is | |
| 1126 | // complete | |
| 1127 | //------------------------------------------------- | |
| 1128 | ||
| 1129 | void ymf278b_device::device_config_complete() | |
| 1130 | { | |
| 1131 | } | |
| 1132 | ||
| 1133 | //------------------------------------------------- | |
| 1134 | // device_start - device-specific startup | |
| 1135 | //------------------------------------------------- | |
| 1136 | ||
| 1137 | void ymf278b_device::device_start() | |
| 1138 | { | |
| 1139 | DEVICE_START_NAME( ymf278b )(this); | |
| 1140 | } | |
| 1141 | ||
| 1142 | //------------------------------------------------- | |
| 1143 | // device_reset - device-specific reset | |
| 1144 | //------------------------------------------------- | |
| 1145 | ||
| 1146 | void ymf278b_device::device_reset() | |
| 1147 | { | |
| 1148 | DEVICE_RESET_NAME( ymf278b )(this); | |
| 1149 | } | |
| 1150 | ||
| 1151 | //------------------------------------------------- | |
| 1152 | // sound_stream_update - handle a stream update | |
| 1153 | //------------------------------------------------- | |
| 1154 | ||
| 1155 | void ymf278b_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 1156 | { | |
| 1157 | // should never get here | |
| 1158 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 1159 | } | |
| 1160 | ||
| 1161 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | READ8_DEVICE_HANDLER( ymf278b_r ); |
| 18 | 18 | WRITE8_DEVICE_HANDLER( ymf278b_w ); |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_SOUND_DEVICE(YMF278B, ymf278b); | |
| 20 | class ymf278b_device : public device_t, | |
| 21 | public device_sound_interface | |
| 22 | { | |
| 23 | public: | |
| 24 | ymf278b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~ymf278b_device() { global_free(m_token); } | |
| 21 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | ||
| 35 | // sound stream update overrides | |
| 36 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 37 | private: | |
| 38 | // internal state | |
| 39 | void *m_token; | |
| 40 | }; | |
| 41 | ||
| 42 | extern const device_type YMF278B; | |
| 43 | ||
| 44 | ||
| 22 | 45 | #endif /* __YMF278B_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | { |
| 17 | 17 | assert(device != NULL); |
| 18 | 18 | assert((device->type() == SID6581) || (device->type() == SID8580)); |
| 19 | return (_SID6581 *) downcast< | |
| 19 | return (_SID6581 *) downcast<sid6581_devic | |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| r17612 | r17613 | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | DEFINE_LEGACY_SOUND_DEVICE(SID6581, sid6581); | |
| 129 | DEFINE_LEGACY_SOUND_DEVICE(SID8580, sid8580); | |
| 128 | const device_type SID6581 = &device_creator<sid6581_device>; | |
| 129 | ||
| 130 | sid6581_device::sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 131 | : device_t(mconfig, SID6581, "SID6581", tag, owner, clock), | |
| 132 | device_sound_interface(mconfig, *this) | |
| 133 | { | |
| 134 | m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581)); | |
| 135 | } | |
| 136 | sid6581_device::sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 137 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 138 | device_sound_interface(mconfig, *this) | |
| 139 | { | |
| 140 | m_token = global_alloc_array_clear(UINT8, sizeof(_SID6581)); | |
| 141 | } | |
| 142 | ||
| 143 | //------------------------------------------------- | |
| 144 | // device_config_complete - perform any | |
| 145 | // operations now that the configuration is | |
| 146 | // complete | |
| 147 | //------------------------------------------------- | |
| 148 | ||
| 149 | void sid6581_device::device_config_complete() | |
| 150 | { | |
| 151 | } | |
| 152 | ||
| 153 | //------------------------------------------------- | |
| 154 | // device_start - device-specific startup | |
| 155 | //------------------------------------------------- | |
| 156 | ||
| 157 | void sid6581_device::device_start() | |
| 158 | { | |
| 159 | DEVICE_START_NAME( sid6581 )(this); | |
| 160 | } | |
| 161 | ||
| 162 | //------------------------------------------------- | |
| 163 | // device_reset - device-specific reset | |
| 164 | //------------------------------------------------- | |
| 165 | ||
| 166 | void sid6581_device::device_reset() | |
| 167 | { | |
| 168 | DEVICE_RESET_NAME( sid )(this); | |
| 169 | } | |
| 170 | ||
| 171 | //------------------------------------------------- | |
| 172 | // sound_stream_update - handle a stream update | |
| 173 | //------------------------------------------------- | |
| 174 | ||
| 175 | void sid6581_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 176 | { | |
| 177 | // should never get here | |
| 178 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 179 | } | |
| 180 | ||
| 181 | ||
| 182 | const device_type SID8580 = &device_creator<sid8580_device>; | |
| 183 | ||
| 184 | sid8580_device::sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 185 | : sid6581_device(mconfig, SID8580, "SID8580", tag, owner, clock) | |
| 186 | { | |
| 187 | } | |
| 188 | ||
| 189 | //------------------------------------------------- | |
| 190 | // device_start - device-specific startup | |
| 191 | //------------------------------------------------- | |
| 192 | ||
| 193 | void sid8580_device::device_start() | |
| 194 | { | |
| 195 | DEVICE_START_NAME( sid8580 )(this); | |
| 196 | } | |
| 197 | ||
| 198 | //------------------------------------------------- | |
| 199 | // sound_stream_update - handle a stream update | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | void sid8580_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 203 | { | |
| 204 | // should never get here | |
| 205 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 206 | } | |
| 207 | ||
| 208 |
| r17612 | r17613 | |
|---|---|---|
| 13 | 13 | { |
| 14 | 14 | assert(device != NULL); |
| 15 | 15 | assert(device->type() == FILTER_VOLUME); |
| 16 | return (filter_volume_state *)downcast<le | |
| 16 | return (filter_volume_state *)downcast<filter | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
| r17612 | r17613 | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | DEFINE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume); | |
| 75 | const device_type FILTER_VOLUME = &device_creator<filter_volume_device>; | |
| 76 | ||
| 77 | filter_volume_device::filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 78 | : device_t(mconfig, FILTER_VOLUME, "Volume Filter", tag, owner, clock), | |
| 79 | device_sound_interface(mconfig, *this) | |
| 80 | { | |
| 81 | m_token = global_alloc_array_clear(UINT8, sizeof(filter_volume_state)); | |
| 82 | } | |
| 83 | ||
| 84 | //------------------------------------------------- | |
| 85 | // device_config_complete - perform any | |
| 86 | // operations now that the configuration is | |
| 87 | // complete | |
| 88 | //------------------------------------------------- | |
| 89 | ||
| 90 | void filter_volume_device::device_config_complete() | |
| 91 | { | |
| 92 | } | |
| 93 | ||
| 94 | //------------------------------------------------- | |
| 95 | // device_start - device-specific startup | |
| 96 | //------------------------------------------------- | |
| 97 | ||
| 98 | void filter_volume_device::device_start() | |
| 99 | { | |
| 100 | DEVICE_START_NAME( filter_volume )(this); | |
| 101 | } | |
| 102 | ||
| 103 | //------------------------------------------------- | |
| 104 | // sound_stream_update - handle a stream update | |
| 105 | //------------------------------------------------- | |
| 106 | ||
| 107 | void filter_volume_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 108 | { | |
| 109 | // should never get here | |
| 110 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 111 | } | |
| 112 | ||
| 113 |
| r17612 | r17613 | |
|---|---|---|
| 34 | 34 | READ8_DEVICE_HANDLER ( sid6581_r ); |
| 35 | 35 | WRITE8_DEVICE_HANDLER ( sid6581_w ); |
| 36 | 36 | |
| 37 | DECLARE_LEGACY_SOUND_DEVICE(SID6581, sid6581); | |
| 38 | DECLARE_LEGACY_SOUND_DEVICE(SID8580, sid8580); | |
| 37 | class sid6581_device : public device_t, | |
| 38 | public device_sound_interface | |
| 39 | { | |
| 40 | public: | |
| 41 | sid6581_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | sid6581_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 43 | ~sid6581_device() { global_free(m_token); } | |
| 39 | 44 | |
| 45 | // access to legacy token | |
| 46 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 47 | protected: | |
| 48 | // device-level overrides | |
| 49 | virtual void device_config_complete(); | |
| 50 | virtual void device_start(); | |
| 51 | virtual void device_reset(); | |
| 52 | ||
| 53 | // sound stream update overrides | |
| 54 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 55 | private: | |
| 56 | // internal state | |
| 57 | void *m_token; | |
| 58 | }; | |
| 59 | ||
| 60 | extern const device_type SID6581; | |
| 61 | ||
| 62 | class sid8580_device : public sid6581_device | |
| 63 | { | |
| 64 | public: | |
| 65 | sid8580_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 66 | protected: | |
| 67 | // device-level overrides | |
| 68 | virtual void device_start(); | |
| 69 | ||
| 70 | // sound stream update overrides | |
| 71 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 72 | }; | |
| 73 | ||
| 74 | extern const device_type SID8580; | |
| 75 | ||
| 76 | ||
| 40 | 77 | #endif /* __SID6581_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | { |
| 29 | 29 | assert(device != NULL); |
| 30 | 30 | assert(device->type() == YM2151); |
| 31 | return (ym2151_state *)downcast< | |
| 31 | return (ym2151_state *)downcast< | |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | |
| r17612 | r17613 | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| 149 | DEFINE_LEGACY_SOUND_DEVICE(YM2151, ym2151); | |
| 149 | const device_type YM2151 = &device_creator<ym2151_device>; | |
| 150 | ||
| 151 | ym2151_device::ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 152 | : device_t(mconfig, YM2151, "YM2151", tag, owner, clock), | |
| 153 | device_sound_interface(mconfig, *this) | |
| 154 | { | |
| 155 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2151_state)); | |
| 156 | } | |
| 157 | ||
| 158 | //------------------------------------------------- | |
| 159 | // device_config_complete - perform any | |
| 160 | // operations now that the configuration is | |
| 161 | // complete | |
| 162 | //------------------------------------------------- | |
| 163 | ||
| 164 | void ym2151_device::device_config_complete() | |
| 165 | { | |
| 166 | } | |
| 167 | ||
| 168 | //------------------------------------------------- | |
| 169 | // device_start - device-specific startup | |
| 170 | //------------------------------------------------- | |
| 171 | ||
| 172 | void ym2151_device::device_start() | |
| 173 | { | |
| 174 | DEVICE_START_NAME( ym2151 )(this); | |
| 175 | } | |
| 176 | ||
| 177 | //------------------------------------------------- | |
| 178 | // device_reset - device-specific reset | |
| 179 | //------------------------------------------------- | |
| 180 | ||
| 181 | void ym2151_device::device_reset() | |
| 182 | { | |
| 183 | DEVICE_RESET_NAME( ym2151 )(this); | |
| 184 | } | |
| 185 | ||
| 186 | //------------------------------------------------- | |
| 187 | // device_stop - device-specific stop | |
| 188 | //------------------------------------------------- | |
| 189 | ||
| 190 | void ym2151_device::device_stop() | |
| 191 | { | |
| 192 | DEVICE_STOP_NAME( ym2151 )(this); | |
| 193 | } | |
| 194 | ||
| 195 | //------------------------------------------------- | |
| 196 | // sound_stream_update - handle a stream update | |
| 197 | //------------------------------------------------- | |
| 198 | ||
| 199 | void ym2151_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 200 | { | |
| 201 | // should never get here | |
| 202 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 203 | } | |
| 204 | ||
| 205 |
| r17612 | r17613 | |
|---|---|---|
| 47 | 47 | { |
| 48 | 48 | assert(device != NULL); |
| 49 | 49 | assert(device->type() == K053260); |
| 50 | return (k053260_state *)downcast< | |
| 50 | return (k053260_state *)downcast<k053260_devic | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | |
| r17612 | r17613 | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| 466 | DEFINE_LEGACY_SOUND_DEVICE(K053260, k053260); | |
| 466 | const device_type K053260 = &device_creator<k053260_device>; | |
| 467 | ||
| 468 | k053260_device::k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 469 | : device_t(mconfig, K053260, "K053260", tag, owner, clock), | |
| 470 | device_sound_interface(mconfig, *this) | |
| 471 | { | |
| 472 | m_token = global_alloc_array_clear(UINT8, sizeof(k053260_state)); | |
| 473 | } | |
| 474 | ||
| 475 | //------------------------------------------------- | |
| 476 | // device_config_complete - perform any | |
| 477 | // operations now that the configuration is | |
| 478 | // complete | |
| 479 | //------------------------------------------------- | |
| 480 | ||
| 481 | void k053260_device::device_config_complete() | |
| 482 | { | |
| 483 | } | |
| 484 | ||
| 485 | //------------------------------------------------- | |
| 486 | // device_start - device-specific startup | |
| 487 | //------------------------------------------------- | |
| 488 | ||
| 489 | void k053260_device::device_start() | |
| 490 | { | |
| 491 | DEVICE_START_NAME( k053260 )(this); | |
| 492 | } | |
| 493 | ||
| 494 | //------------------------------------------------- | |
| 495 | // device_reset - device-specific reset | |
| 496 | //------------------------------------------------- | |
| 497 | ||
| 498 | void k053260_device::device_reset() | |
| 499 | { | |
| 500 | DEVICE_RESET_NAME( k053260 )(this); | |
| 501 | } | |
| 502 | ||
| 503 | //------------------------------------------------- | |
| 504 | // sound_stream_update - handle a stream update | |
| 505 | //------------------------------------------------- | |
| 506 | ||
| 507 | void k053260_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 508 | { | |
| 509 | // should never get here | |
| 510 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 511 | } | |
| 512 | ||
| 513 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == YM2413); |
| 25 | return (ym2413_state *)downcast< | |
| 25 | return (ym2413_state *)downcast< | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r17612 | r17613 | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | |
| 145 | DEFINE_LEGACY_SOUND_DEVICE(YM2413, ym2413); | |
| 145 | const device_type YM2413 = &device_creator<ym2413_device>; | |
| 146 | ||
| 147 | ym2413_device::ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 148 | : device_t(mconfig, YM2413, "YM2413", tag, owner, clock), | |
| 149 | device_sound_interface(mconfig, *this) | |
| 150 | { | |
| 151 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2413_state)); | |
| 152 | } | |
| 153 | ||
| 154 | //------------------------------------------------- | |
| 155 | // device_config_complete - perform any | |
| 156 | // operations now that the configuration is | |
| 157 | // complete | |
| 158 | //------------------------------------------------- | |
| 159 | ||
| 160 | void ym2413_device::device_config_complete() | |
| 161 | { | |
| 162 | } | |
| 163 | ||
| 164 | //------------------------------------------------- | |
| 165 | // device_start - device-specific startup | |
| 166 | //------------------------------------------------- | |
| 167 | ||
| 168 | void ym2413_device::device_start() | |
| 169 | { | |
| 170 | DEVICE_START_NAME( ym2413 )(this); | |
| 171 | } | |
| 172 | ||
| 173 | //------------------------------------------------- | |
| 174 | // device_reset - device-specific reset | |
| 175 | //------------------------------------------------- | |
| 176 | ||
| 177 | void ym2413_device::device_reset() | |
| 178 | { | |
| 179 | DEVICE_RESET_NAME( ym2413 )(this); | |
| 180 | } | |
| 181 | ||
| 182 | //------------------------------------------------- | |
| 183 | // device_stop - device-specific stop | |
| 184 | //------------------------------------------------- | |
| 185 | ||
| 186 | void ym2413_device::device_stop() | |
| 187 | { | |
| 188 | DEVICE_STOP_NAME( ym2413 )(this); | |
| 189 | } | |
| 190 | ||
| 191 | //------------------------------------------------- | |
| 192 | // sound_stream_update - handle a stream update | |
| 193 | //------------------------------------------------- | |
| 194 | ||
| 195 | void ym2413_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 196 | { | |
| 197 | // should never get here | |
| 198 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 199 | } | |
| 200 | ||
| 201 |
| r17612 | r17613 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | void flt_volume_set_volume(device_t *device, float volume); |
| 10 | 10 | |
| 11 | DECLARE_LEGACY_SOUND_DEVICE(FILTER_VOLUME, filter_volume); | |
| 11 | class filter_volume_device : public device_t, | |
| 12 | public device_sound_interface | |
| 13 | { | |
| 14 | public: | |
| 15 | filter_volume_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 16 | ~filter_volume_device() { global_free(m_token); } | |
| 12 | 17 | |
| 18 | // access to legacy token | |
| 19 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 20 | protected: | |
| 21 | // device-level overrides | |
| 22 | virtual void device_config_complete(); | |
| 23 | virtual void device_start(); | |
| 24 | ||
| 25 | // sound stream update overrides | |
| 26 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type FILTER_VOLUME; | |
| 33 | ||
| 34 | ||
| 13 | 35 | #endif /* __FLT_VOL_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | WRITE8_DEVICE_HANDLER( ym2151_register_port_w ); |
| 20 | 20 | WRITE8_DEVICE_HANDLER( ym2151_data_port_w ); |
| 21 | 21 | |
| 22 | DECLARE_LEGACY_SOUND_DEVICE(YM2151, ym2151); | |
| 22 | class ym2151_device : public device_t, | |
| 23 | public device_sound_interface | |
| 24 | { | |
| 25 | public: | |
| 26 | ym2151_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~ym2151_device() { global_free(m_token); } | |
| 23 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_stop(); | |
| 36 | virtual void device_reset(); | |
| 37 | ||
| 38 | // sound stream update overrides | |
| 39 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type YM2151; | |
| 46 | ||
| 47 | ||
| 24 | 48 | #endif /* __2151INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | WRITE8_DEVICE_HANDLER( ym2413_register_port_w ); |
| 11 | 11 | WRITE8_DEVICE_HANDLER( ym2413_data_port_w ); |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(YM2413, ym2413); | |
| 13 | class ym2413_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | ym2413_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~ym2413_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | virtual void device_stop(); | |
| 27 | virtual void device_reset(); | |
| 28 | ||
| 29 | // sound stream update overrides | |
| 30 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type YM2413; | |
| 37 | ||
| 38 | ||
| 15 | 39 | #endif /* __2413INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | WRITE8_DEVICE_HANDLER( k053260_w ); |
| 22 | 22 | READ8_DEVICE_HANDLER( k053260_r ); |
| 23 | 23 | |
| 24 | DECLARE_LEGACY_SOUND_DEVICE(K053260, k053260); | |
| 24 | class k053260_device : public device_t, | |
| 25 | public device_sound_interface | |
| 26 | { | |
| 27 | public: | |
| 28 | k053260_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 29 | ~k053260_device() { global_free(m_token); } | |
| 25 | 30 | |
| 31 | // access to legacy token | |
| 32 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 33 | protected: | |
| 34 | // device-level overrides | |
| 35 | virtual void device_config_complete(); | |
| 36 | virtual void device_start(); | |
| 37 | virtual void device_reset(); | |
| 38 | ||
| 39 | // sound stream update overrides | |
| 40 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 41 | private: | |
| 42 | // internal state | |
| 43 | void *m_token; | |
| 44 | }; | |
| 45 | ||
| 46 | extern const device_type K053260; | |
| 47 | ||
| 48 | ||
| 26 | 49 | #endif /* __K053260_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 21 | 21 | { |
| 22 | 22 | assert(device != NULL); |
| 23 | 23 | assert(device->type() == SEGAPCM); |
| 24 | return (segapcm_state *)downcast< | |
| 24 | return (segapcm_state *)downcast<segapcm_devic | |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | static STREAM_UPDATE( SEGAPCM_update ) |
| r17612 | r17613 | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | DEFINE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm); | |
| 179 | const device_type SEGAPCM = &device_creator<segapcm_device>; | |
| 180 | ||
| 181 | segapcm_device::segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 182 | : device_t(mconfig, SEGAPCM, "Sega PCM", tag, owner, clock), | |
| 183 | device_sound_interface(mconfig, *this) | |
| 184 | { | |
| 185 | m_token = global_alloc_array_clear(UINT8, sizeof(segapcm_state)); | |
| 186 | } | |
| 187 | ||
| 188 | //------------------------------------------------- | |
| 189 | // device_config_complete - perform any | |
| 190 | // operations now that the configuration is | |
| 191 | // complete | |
| 192 | //------------------------------------------------- | |
| 193 | ||
| 194 | void segapcm_device::device_config_complete() | |
| 195 | { | |
| 196 | } | |
| 197 | ||
| 198 | //------------------------------------------------- | |
| 199 | // device_start - device-specific startup | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | void segapcm_device::device_start() | |
| 203 | { | |
| 204 | DEVICE_START_NAME( segapcm )(this); | |
| 205 | } | |
| 206 | ||
| 207 | //------------------------------------------------- | |
| 208 | // sound_stream_update - handle a stream update | |
| 209 | //------------------------------------------------- | |
| 210 | ||
| 211 | void segapcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 212 | { | |
| 213 | // should never get here | |
| 214 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 215 | } | |
| 216 | ||
| 217 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | WRITE8_DEVICE_HANDLER( sega_pcm_w ); |
| 26 | 26 | READ8_DEVICE_HANDLER( sega_pcm_r ); |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_SOUND_DEVICE(SEGAPCM, segapcm); | |
| 28 | class segapcm_device : public device_t, | |
| 29 | public device_sound_interface | |
| 30 | { | |
| 31 | public: | |
| 32 | segapcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~segapcm_device() { global_free(m_token); } | |
| 29 | 34 | |
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | ||
| 42 | // sound stream update overrides | |
| 43 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | void *m_token; | |
| 47 | }; | |
| 48 | ||
| 49 | extern const device_type SEGAPCM; | |
| 50 | ||
| 51 | ||
| 30 | 52 | #endif /* __SEGAPCM_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | { |
| 27 | 27 | assert(device != NULL); |
| 28 | 28 | assert(device->type() == VRENDER0); |
| 29 | return (vr0_state *)downcast< | |
| 29 | return (vr0_state *)downcast<vrender0_devic | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | static void VR0_RenderAudio(vr0_state *VR0, int nsamples,stream_sample_t *l,stream_sample_t *r); |
| r17612 | r17613 | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
| 270 | DEFINE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0); | |
| 270 | const device_type VRENDER0 = &device_creator<vrender0_device>; | |
| 271 | ||
| 272 | vrender0_device::vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 273 | : device_t(mconfig, VRENDER0, "VRender0", tag, owner, clock), | |
| 274 | device_sound_interface(mconfig, *this) | |
| 275 | { | |
| 276 | m_token = global_alloc_array_clear(UINT8, sizeof(vr0_state)); | |
| 277 | } | |
| 278 | ||
| 279 | //------------------------------------------------- | |
| 280 | // device_config_complete - perform any | |
| 281 | // operations now that the configuration is | |
| 282 | // complete | |
| 283 | //------------------------------------------------- | |
| 284 | ||
| 285 | void vrender0_device::device_config_complete() | |
| 286 | { | |
| 287 | } | |
| 288 | ||
| 289 | //------------------------------------------------- | |
| 290 | // device_start - device-specific startup | |
| 291 | //------------------------------------------------- | |
| 292 | ||
| 293 | void vrender0_device::device_start() | |
| 294 | { | |
| 295 | DEVICE_START_NAME( vrender0 )(this); | |
| 296 | } | |
| 297 | ||
| 298 | //------------------------------------------------- | |
| 299 | // sound_stream_update - handle a stream update | |
| 300 | //------------------------------------------------- | |
| 301 | ||
| 302 | void vrender0_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 303 | { | |
| 304 | // should never get here | |
| 305 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 306 | } | |
| 307 | ||
| 308 |
| r17612 | r17613 | |
|---|---|---|
| 37 | 37 | { |
| 38 | 38 | assert(device != NULL); |
| 39 | 39 | assert(device->type() == Y8950); |
| 40 | return (y8950_state *)downcast< | |
| 40 | return (y8950_state *)downcast< | |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | |
| r17612 | r17613 | |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | |
| 203 | DEFINE_LEGACY_SOUND_DEVICE(Y8950, y8950); | |
| 203 | const device_type Y8950 = &device_creator<y8950_device>; | |
| 204 | ||
| 205 | y8950_device::y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 206 | : device_t(mconfig, Y8950, "Y8950", tag, owner, clock), | |
| 207 | device_sound_interface(mconfig, *this) | |
| 208 | { | |
| 209 | m_token = global_alloc_array_clear(UINT8, sizeof(y8950_state)); | |
| 210 | } | |
| 211 | ||
| 212 | //------------------------------------------------- | |
| 213 | // device_config_complete - perform any | |
| 214 | // operations now that the configuration is | |
| 215 | // complete | |
| 216 | //------------------------------------------------- | |
| 217 | ||
| 218 | void y8950_device::device_config_complete() | |
| 219 | { | |
| 220 | } | |
| 221 | ||
| 222 | //------------------------------------------------- | |
| 223 | // device_start - device-specific startup | |
| 224 | //------------------------------------------------- | |
| 225 | ||
| 226 | void y8950_device::device_start() | |
| 227 | { | |
| 228 | DEVICE_START_NAME( y8950 )(this); | |
| 229 | } | |
| 230 | ||
| 231 | //------------------------------------------------- | |
| 232 | // device_reset - device-specific reset | |
| 233 | //------------------------------------------------- | |
| 234 | ||
| 235 | void y8950_device::device_reset() | |
| 236 | { | |
| 237 | DEVICE_RESET_NAME( y8950 )(this); | |
| 238 | } | |
| 239 | ||
| 240 | //------------------------------------------------- | |
| 241 | // device_stop - device-specific stop | |
| 242 | //------------------------------------------------- | |
| 243 | ||
| 244 | void y8950_device::device_stop() | |
| 245 | { | |
| 246 | DEVICE_STOP_NAME( y8950 )(this); | |
| 247 | } | |
| 248 | ||
| 249 | //------------------------------------------------- | |
| 250 | // sound_stream_update - handle a stream update | |
| 251 | //------------------------------------------------- | |
| 252 | ||
| 253 | void y8950_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 254 | { | |
| 255 | // should never get here | |
| 256 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 257 | } | |
| 258 | ||
| 259 |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | { |
| 62 | 62 | assert(device != NULL); |
| 63 | 63 | assert(device->type() == T6W28); |
| 64 | return (t6w28_state *)downcast< | |
| 64 | return (t6w28_state *)downcast<t6w28 | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r17612 | r17613 | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| 395 | DEFINE_LEGACY_SOUND_DEVICE(T6W28, t6w28); | |
| 395 | const device_type T6W28 = &device_creator<t6w28_device>; | |
| 396 | ||
| 397 | t6w28_device::t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 398 | : device_t(mconfig, T6W28, "T6W28", tag, owner, clock), | |
| 399 | device_sound_interface(mconfig, *this) | |
| 400 | { | |
| 401 | m_token = global_alloc_array_clear(UINT8, sizeof(t6w28_state)); | |
| 402 | } | |
| 403 | ||
| 404 | //------------------------------------------------- | |
| 405 | // device_config_complete - perform any | |
| 406 | // operations now that the configuration is | |
| 407 | // complete | |
| 408 | //------------------------------------------------- | |
| 409 | ||
| 410 | void t6w28_device::device_config_complete() | |
| 411 | { | |
| 412 | } | |
| 413 | ||
| 414 | //------------------------------------------------- | |
| 415 | // device_start - device-specific startup | |
| 416 | //------------------------------------------------- | |
| 417 | ||
| 418 | void t6w28_device::device_start() | |
| 419 | { | |
| 420 | DEVICE_START_NAME( t6w28 )(this); | |
| 421 | } | |
| 422 | ||
| 423 | //------------------------------------------------- | |
| 424 | // sound_stream_update - handle a stream update | |
| 425 | //------------------------------------------------- | |
| 426 | ||
| 427 | void t6w28_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 428 | { | |
| 429 | // should never get here | |
| 430 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 431 | } | |
| 432 | ||
| 433 |
| r17612 | r17613 | |
|---|---|---|
| 130 | 130 | { |
| 131 | 131 | assert(device != NULL); |
| 132 | 132 | assert(device->type() == MULTIPCM); |
| 133 | return (MultiPCM *)downcast<l | |
| 133 | return (MultiPCM *)downcast<multipcm_devic | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| r17612 | r17613 | |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | |
| 703 | DEFINE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm); | |
| 703 | const device_type MULTIPCM = &device_creator<multipcm_device>; | |
| 704 | ||
| 705 | multipcm_device::multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 706 | : device_t(mconfig, MULTIPCM, "Sega/Yamaha 315-5560", tag, owner, clock), | |
| 707 | device_sound_interface(mconfig, *this) | |
| 708 | { | |
| 709 | m_token = global_alloc_array_clear(UINT8, sizeof(MultiPCM)); | |
| 710 | } | |
| 711 | ||
| 712 | //------------------------------------------------- | |
| 713 | // device_config_complete - perform any | |
| 714 | // operations now that the configuration is | |
| 715 | // complete | |
| 716 | //------------------------------------------------- | |
| 717 | ||
| 718 | void multipcm_device::device_config_complete() | |
| 719 | { | |
| 720 | } | |
| 721 | ||
| 722 | //------------------------------------------------- | |
| 723 | // device_start - device-specific startup | |
| 724 | //------------------------------------------------- | |
| 725 | ||
| 726 | void multipcm_device::device_start() | |
| 727 | { | |
| 728 | DEVICE_START_NAME( multipcm )(this); | |
| 729 | } | |
| 730 | ||
| 731 | //------------------------------------------------- | |
| 732 | // sound_stream_update - handle a stream update | |
| 733 | //------------------------------------------------- | |
| 734 | ||
| 735 | void multipcm_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 736 | { | |
| 737 | // should never get here | |
| 738 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 739 | } | |
| 740 | ||
| 741 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | READ32_DEVICE_HANDLER( vr0_snd_read ); |
| 18 | 18 | WRITE32_DEVICE_HANDLER( vr0_snd_write ); |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_SOUND_DEVICE(VRENDER0, vrender0); | |
| 20 | class vrender0_device : public device_t, | |
| 21 | public device_sound_interface | |
| 22 | { | |
| 23 | public: | |
| 24 | vrender0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~vrender0_device() { global_free(m_token); } | |
| 21 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | ||
| 34 | // sound stream update overrides | |
| 35 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type VRENDER0; | |
| 42 | ||
| 43 | ||
| 22 | 44 | #endif /* __VRENDER0_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | WRITE8_DEVICE_HANDLER( y8950_control_port_w ); |
| 25 | 25 | WRITE8_DEVICE_HANDLER( y8950_write_port_w ); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(Y8950, y8950); | |
| 27 | class y8950_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | y8950_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~y8950_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_stop(); | |
| 41 | virtual void device_reset(); | |
| 42 | ||
| 43 | // sound stream update overrides | |
| 44 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type Y8950; | |
| 51 | ||
| 52 | ||
| 29 | 53 | #endif /* __8950INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 80 | 80 | assert(device->type() == NAMCO || |
| 81 | 81 | device->type() == NAMCO_15XX || |
| 82 | 82 | device->type() == NAMCO_CUS30); |
| 83 | return (namco_sound *)downcast< | |
| 83 | return (namco_sound *)downcast<n | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /* update the decoded waveform data */ |
| r17612 | r17613 | |
| 891 | 891 | } |
| 892 | 892 | |
| 893 | 893 | |
| 894 | DEFINE_LEGACY_SOUND_DEVICE(NAMCO, namco); | |
| 895 | DEFINE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx); | |
| 896 | DEFINE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30); | |
| 894 | const device_type NAMCO = &device_creator<namco_device>; | |
| 895 | ||
| 896 | namco_device::namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 897 | : device_t(mconfig, NAMCO, "Namco", tag, owner, clock), | |
| 898 | device_sound_interface(mconfig, *this) | |
| 899 | { | |
| 900 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound)); | |
| 901 | } | |
| 902 | ||
| 903 | namco_device::namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 904 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 905 | device_sound_interface(mconfig, *this) | |
| 906 | { | |
| 907 | m_token = global_alloc_array_clear(UINT8, sizeof(namco_sound)); | |
| 908 | } | |
| 909 | ||
| 910 | //------------------------------------------------- | |
| 911 | // device_config_complete - perform any | |
| 912 | // operations now that the configuration is | |
| 913 | // complete | |
| 914 | //------------------------------------------------- | |
| 915 | ||
| 916 | void namco_device::device_config_complete() | |
| 917 | { | |
| 918 | } | |
| 919 | ||
| 920 | //------------------------------------------------- | |
| 921 | // device_start - device-specific startup | |
| 922 | //------------------------------------------------- | |
| 923 | ||
| 924 | void namco_device::device_start() | |
| 925 | { | |
| 926 | DEVICE_START_NAME( namco )(this); | |
| 927 | } | |
| 928 | ||
| 929 | //------------------------------------------------- | |
| 930 | // sound_stream_update - handle a stream update | |
| 931 | //------------------------------------------------- | |
| 932 | ||
| 933 | void namco_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 934 | { | |
| 935 | // should never get here | |
| 936 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 937 | } | |
| 938 | ||
| 939 | ||
| 940 | const device_type NAMCO_15XX = &device_creator<namco_15xx_device>; | |
| 941 | ||
| 942 | namco_15xx_device::namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 943 | : namco_device(mconfig, NAMCO_15XX, "Namco 15XX", tag, owner, clock) | |
| 944 | { | |
| 945 | } | |
| 946 | ||
| 947 | const device_type NAMCO_CUS30 = &device_creator<namco_cus30_device>; | |
| 948 | ||
| 949 | namco_cus30_device::namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 950 | : namco_device(mconfig, NAMCO_CUS30, "Namco CUS30", tag, owner, clock) | |
| 951 | { | |
| 952 | } |
| r17612 | r17613 | |
|---|---|---|
| 264 | 264 | { |
| 265 | 265 | assert(device != NULL); |
| 266 | 266 | assert(device->type() == SN76477); |
| 267 | return (sn76477_state *)downcast< | |
| 267 | return (sn76477_state *)downcast<sn76477_devic | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| r17612 | r17613 | |
| 2484 | 2484 | } |
| 2485 | 2485 | |
| 2486 | 2486 | |
| 2487 | DEFINE_LEGACY_SOUND_DEVICE(SN76477, sn76477); | |
| 2487 | const device_type SN76477 = &device_creator<sn76477_device>; | |
| 2488 | ||
| 2489 | sn76477_device::sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2490 | : device_t(mconfig, SN76477, "SN76477", tag, owner, clock), | |
| 2491 | device_sound_interface(mconfig, *this) | |
| 2492 | { | |
| 2493 | m_token = global_alloc_array_clear(UINT8, sizeof(sn76477_state)); | |
| 2494 | } | |
| 2495 | ||
| 2496 | //------------------------------------------------- | |
| 2497 | // device_config_complete - perform any | |
| 2498 | // operations now that the configuration is | |
| 2499 | // complete | |
| 2500 | //------------------------------------------------- | |
| 2501 | ||
| 2502 | void sn76477_device::device_config_complete() | |
| 2503 | { | |
| 2504 | } | |
| 2505 | ||
| 2506 | //------------------------------------------------- | |
| 2507 | // device_start - device-specific startup | |
| 2508 | //------------------------------------------------- | |
| 2509 | ||
| 2510 | void sn76477_device::device_start() | |
| 2511 | { | |
| 2512 | DEVICE_START_NAME( sn76477 )(this); | |
| 2513 | } | |
| 2514 | ||
| 2515 | //------------------------------------------------- | |
| 2516 | // device_stop - device-specific stop | |
| 2517 | //------------------------------------------------- | |
| 2518 | ||
| 2519 | void sn76477_device::device_stop() | |
| 2520 | { | |
| 2521 | DEVICE_STOP_NAME( sn76477 )(this); | |
| 2522 | } | |
| 2523 | ||
| 2524 | //------------------------------------------------- | |
| 2525 | // sound_stream_update - handle a stream update | |
| 2526 | //------------------------------------------------- | |
| 2527 | ||
| 2528 | void sn76477_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2529 | { | |
| 2530 | // should never get here | |
| 2531 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2532 | } | |
| 2533 | ||
| 2534 |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | WRITE8_DEVICE_HANDLER( t6w28_w ); |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_SOUND_DEVICE(T6W28, t6w28); | |
| 10 | class t6w28_device : public device_t, | |
| 11 | public device_sound_interface | |
| 12 | { | |
| 13 | public: | |
| 14 | t6w28_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | ~t6w28_device() { global_free(m_token); } | |
| 11 | 16 | |
| 17 | // access to legacy token | |
| 18 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 19 | protected: | |
| 20 | // device-level overrides | |
| 21 | virtual void device_config_complete(); | |
| 22 | virtual void device_start(); | |
| 23 | ||
| 24 | // sound stream update overrides | |
| 25 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 26 | private: | |
| 27 | // internal state | |
| 28 | void *m_token; | |
| 29 | }; | |
| 30 | ||
| 31 | extern const device_type T6W28; | |
| 32 | ||
| 33 | ||
| 12 | 34 | #endif /* __T6W28_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | void multipcm_set_bank(device_t *device, UINT32 leftoffs, UINT32 rightoffs); |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(MULTIPCM, multipcm); | |
| 13 | class multipcm_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | multipcm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~multipcm_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | ||
| 27 | // sound stream update overrides | |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type MULTIPCM; | |
| 35 | ||
| 36 | ||
| 15 | 37 | #endif /* __MULTIPCM_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | READ8_DEVICE_HANDLER( namco_snd_sharedram_r ); |
| 28 | 28 | WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w ); |
| 29 | 29 | |
| 30 | DECLARE_LEGACY_SOUND_DEVICE(NAMCO, namco); | |
| 31 | DECLARE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx); | |
| 32 | DECLARE_LEGACY_SOUND_DEVICE(NAMCO_CUS30, namco_cus30); | |
| 30 | class namco_device : public device_t, | |
| 31 | public device_sound_interface | |
| 32 | { | |
| 33 | public: | |
| 34 | namco_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | namco_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ~namco_device() { global_free(m_token); } | |
| 33 | 37 | |
| 38 | // access to legacy token | |
| 39 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 40 | protected: | |
| 41 | // device-level overrides | |
| 42 | virtual void device_config_complete(); | |
| 43 | virtual void device_start(); | |
| 34 | 44 | |
| 45 | // sound stream update overrides | |
| 46 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 47 | private: | |
| 48 | // internal state | |
| 49 | void *m_token; | |
| 50 | }; | |
| 51 | ||
| 52 | extern const device_type NAMCO; | |
| 53 | ||
| 54 | class namco_15xx_device : public namco_device | |
| 55 | { | |
| 56 | public: | |
| 57 | namco_15xx_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 58 | }; | |
| 59 | ||
| 60 | extern const device_type NAMCO_15XX; | |
| 61 | ||
| 62 | class namco_cus30_device : public namco_device | |
| 63 | { | |
| 64 | public: | |
| 65 | namco_cus30_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 66 | }; | |
| 67 | ||
| 68 | extern const device_type NAMCO_CUS30; | |
| 69 | ||
| 70 | ||
| 71 | ||
| 35 | 72 | #endif /* __NAMCO_H__ */ |
| 36 | 73 |
| r17612 | r17613 | |
|---|---|---|
| 125 | 125 | void sn76477_vco_voltage_w(device_t *device, double data); |
| 126 | 126 | void sn76477_pitch_voltage_w(device_t *device, double data); |
| 127 | 127 | |
| 128 | DECLARE_LEGACY_SOUND_DEVICE(SN76477, sn76477); | |
| 128 | class sn76477_device : public device_t, | |
| 129 | public device_sound_interface | |
| 130 | { | |
| 131 | public: | |
| 132 | sn76477_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 133 | ~sn76477_device() { global_free(m_token); } | |
| 129 | 134 | |
| 135 | // access to legacy token | |
| 136 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 137 | protected: | |
| 138 | // device-level overrides | |
| 139 | virtual void device_config_complete(); | |
| 140 | virtual void device_start(); | |
| 141 | virtual void device_stop(); | |
| 142 | ||
| 143 | // sound stream update overrides | |
| 144 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 145 | private: | |
| 146 | // internal state | |
| 147 | void *m_token; | |
| 148 | }; | |
| 149 | ||
| 150 | extern const device_type SN76477; | |
| 151 | ||
| 152 | ||
| 130 | 153 | #endif/* __SN76477_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 214 | 214 | { |
| 215 | 215 | assert(device != NULL); |
| 216 | 216 | assert(device->type() == VLM5030); |
| 217 | return (vlm5030_state *)downcast<l | |
| 217 | return (vlm5030_state *)downcast<vlm5030_devic | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static int get_bits(vlm5030_state *chip, int sbit,int bits) |
| r17612 | r17613 | |
| 715 | 715 | } |
| 716 | 716 | |
| 717 | 717 | |
| 718 | DEFINE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030); | |
| 718 | const device_type VLM5030 = &device_creator<vlm5030_device>; | |
| 719 | ||
| 720 | vlm5030_device::vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 721 | : device_t(mconfig, VLM5030, "VLM5030", tag, owner, clock), | |
| 722 | device_sound_interface(mconfig, *this) | |
| 723 | { | |
| 724 | m_token = global_alloc_array_clear(UINT8, sizeof(vlm5030_state)); | |
| 725 | } | |
| 726 | ||
| 727 | //------------------------------------------------- | |
| 728 | // device_config_complete - perform any | |
| 729 | // operations now that the configuration is | |
| 730 | // complete | |
| 731 | //------------------------------------------------- | |
| 732 | ||
| 733 | void vlm5030_device::device_config_complete() | |
| 734 | { | |
| 735 | } | |
| 736 | ||
| 737 | //------------------------------------------------- | |
| 738 | // device_start - device-specific startup | |
| 739 | //------------------------------------------------- | |
| 740 | ||
| 741 | void vlm5030_device::device_start() | |
| 742 | { | |
| 743 | DEVICE_START_NAME( vlm5030 )(this); | |
| 744 | } | |
| 745 | ||
| 746 | //------------------------------------------------- | |
| 747 | // device_reset - device-specific reset | |
| 748 | //------------------------------------------------- | |
| 749 | ||
| 750 | void vlm5030_device::device_reset() | |
| 751 | { | |
| 752 | DEVICE_RESET_NAME( vlm5030 )(this); | |
| 753 | } | |
| 754 | ||
| 755 | //------------------------------------------------- | |
| 756 | // sound_stream_update - handle a stream update | |
| 757 | //------------------------------------------------- | |
| 758 | ||
| 759 | void vlm5030_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 760 | { | |
| 761 | // should never get here | |
| 762 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 763 | } | |
| 764 | ||
| 765 |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | assert(device != NULL); |
| 22 | 22 | assert(device->type() == YM2203); |
| 23 | return (ym2203_state *)downcast< | |
| 23 | return (ym2203_state *)downcast< | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | |
| r17612 | r17613 | |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | |
| 211 | DEFINE_LEGACY_SOUND_DEVICE(YM2203, ym2203); | |
| 211 | const device_type YM2203 = &device_creator<ym2203_device>; | |
| 212 | ||
| 213 | ym2203_device::ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 214 | : device_t(mconfig, YM2203, "YM2203", tag, owner, clock), | |
| 215 | device_sound_interface(mconfig, *this) | |
| 216 | { | |
| 217 | m_token = global_alloc_array_clear(UINT8, sizeof(ym2203_state)); | |
| 218 | } | |
| 219 | ||
| 220 | //------------------------------------------------- | |
| 221 | // device_config_complete - perform any | |
| 222 | // operations now that the configuration is | |
| 223 | // complete | |
| 224 | //------------------------------------------------- | |
| 225 | ||
| 226 | void ym2203_device::device_config_complete() | |
| 227 | { | |
| 228 | } | |
| 229 | ||
| 230 | //------------------------------------------------- | |
| 231 | // device_start - device-specific startup | |
| 232 | //------------------------------------------------- | |
| 233 | ||
| 234 | void ym2203_device::device_start() | |
| 235 | { | |
| 236 | DEVICE_START_NAME( ym2203 )(this); | |
| 237 | } | |
| 238 | ||
| 239 | //------------------------------------------------- | |
| 240 | // device_reset - device-specific reset | |
| 241 | //------------------------------------------------- | |
| 242 | ||
| 243 | void ym2203_device::device_reset() | |
| 244 | { | |
| 245 | DEVICE_RESET_NAME( ym2203 )(this); | |
| 246 | } | |
| 247 | ||
| 248 | //------------------------------------------------- | |
| 249 | // device_stop - device-specific stop | |
| 250 | //------------------------------------------------- | |
| 251 | ||
| 252 | void ym2203_device::device_stop() | |
| 253 | { | |
| 254 | DEVICE_STOP_NAME( ym2203 )(this); | |
| 255 | } | |
| 256 | ||
| 257 | //------------------------------------------------- | |
| 258 | // sound_stream_update - handle a stream update | |
| 259 | //------------------------------------------------- | |
| 260 | ||
| 261 | void ym2203_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 262 | { | |
| 263 | // should never get here | |
| 264 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 265 | } | |
| 266 | ||
| 267 |
| r17612 | r17613 | |
|---|---|---|
| 58 | 58 | { |
| 59 | 59 | assert(device != NULL); |
| 60 | 60 | assert(device->type() == K007232); |
| 61 | return (KDAC_A_PCM *)downcast< | |
| 61 | return (KDAC_A_PCM *)downcast<k007232_devic | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| r17612 | r17613 | |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | |
| 476 | DEFINE_LEGACY_SOUND_DEVICE(K007232, k007232); | |
| 476 | const device_type K007232 = &device_creator<k007232_device>; | |
| 477 | ||
| 478 | k007232_device::k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 479 | : device_t(mconfig, K007232, "K007232", tag, owner, clock), | |
| 480 | device_sound_interface(mconfig, *this) | |
| 481 | { | |
| 482 | m_token = global_alloc_array_clear(UINT8, sizeof(KDAC_A_PCM)); | |
| 483 | } | |
| 484 | ||
| 485 | //------------------------------------------------- | |
| 486 | // device_config_complete - perform any | |
| 487 | // operations now that the configuration is | |
| 488 | // complete | |
| 489 | //------------------------------------------------- | |
| 490 | ||
| 491 | void k007232_device::device_config_complete() | |
| 492 | { | |
| 493 | } | |
| 494 | ||
| 495 | //------------------------------------------------- | |
| 496 | // device_start - device-specific startup | |
| 497 | //------------------------------------------------- | |
| 498 | ||
| 499 | void k007232_device::device_start() | |
| 500 | { | |
| 501 | DEVICE_START_NAME( k007232 )(this); | |
| 502 | } | |
| 503 | ||
| 504 | //------------------------------------------------- | |
| 505 | // sound_stream_update - handle a stream update | |
| 506 | //------------------------------------------------- | |
| 507 | ||
| 508 | void k007232_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 509 | { | |
| 510 | // should never get here | |
| 511 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 512 | } | |
| 513 | ||
| 514 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | /* set ST pin level : set table address A0-A7 / start speech */ |
| 26 | 26 | void vlm5030_st(device_t *device, int pin ); |
| 27 | 27 | |
| 28 | DECLARE_LEGACY_SOUND_DEVICE(VLM5030, vlm5030); | |
| 28 | class vlm5030_device : public device_t, | |
| 29 | public device_sound_interface | |
| 30 | { | |
| 31 | public: | |
| 32 | vlm5030_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 33 | ~vlm5030_device() { global_free(m_token); } | |
| 29 | 34 | |
| 35 | // access to legacy token | |
| 36 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 37 | protected: | |
| 38 | // device-level overrides | |
| 39 | virtual void device_config_complete(); | |
| 40 | virtual void device_start(); | |
| 41 | virtual void device_reset(); | |
| 42 | ||
| 43 | // sound stream update overrides | |
| 44 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type VLM5030; | |
| 51 | ||
| 52 | ||
| 30 | 53 | #endif /* __VLM5030_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 472 | 472 | device->type() == TMS5220C || |
| 473 | 473 | device->type() == TMC0285 || |
| 474 | 474 | device->type() == TMS5200); |
| 475 | return (tms5220_state *)downcast< | |
| 475 | return (tms5220_state *)downcast<tms5220_devic | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | /* Static function prototypes */ |
| r17612 | r17613 | |
| 2057 | 2057 | } |
| 2058 | 2058 | } |
| 2059 | 2059 | |
| 2060 | DEFINE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c); | |
| 2061 | DEFINE_LEGACY_SOUND_DEVICE(TMS5220, tms5220); | |
| 2062 | DEFINE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285); | |
| 2063 | DEFINE_LEGACY_SOUND_DEVICE(TMS5200, tms5200); | |
| 2060 | const device_type TMS5220C = &device_creator<tms5220c_device>; | |
| 2064 | 2061 | |
| 2062 | tms5220c_device::tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2063 | : tms5220_device(mconfig, TMS5220C, "TMS5220C", tag, owner, clock) | |
| 2064 | { | |
| 2065 | } | |
| 2065 | 2066 | |
| 2067 | //------------------------------------------------- | |
| 2068 | // device_start - device-specific startup | |
| 2069 | //------------------------------------------------- | |
| 2070 | ||
| 2071 | void tms5220c_device::device_start() | |
| 2072 | { | |
| 2073 | DEVICE_START_NAME( tms5220c )(this); | |
| 2074 | } | |
| 2075 | ||
| 2076 | //------------------------------------------------- | |
| 2077 | // sound_stream_update - handle a stream update | |
| 2078 | //------------------------------------------------- | |
| 2079 | ||
| 2080 | void tms5220c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2081 | { | |
| 2082 | // should never get here | |
| 2083 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2084 | } | |
| 2085 | ||
| 2086 | ||
| 2087 | const device_type TMS5220 = &device_creator<tms5220_device>; | |
| 2088 | ||
| 2089 | tms5220_device::tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2090 | : device_t(mconfig, TMS5220, "TMS5220", tag, owner, clock), | |
| 2091 | device_sound_interface(mconfig, *this) | |
| 2092 | { | |
| 2093 | m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state)); | |
| 2094 | } | |
| 2095 | tms5220_device::tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 2096 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 2097 | device_sound_interface(mconfig, *this) | |
| 2098 | { | |
| 2099 | m_token = global_alloc_array_clear(UINT8, sizeof(tms5220_state)); | |
| 2100 | } | |
| 2101 | ||
| 2102 | //------------------------------------------------- | |
| 2103 | // device_config_complete - perform any | |
| 2104 | // operations now that the configuration is | |
| 2105 | // complete | |
| 2106 | //------------------------------------------------- | |
| 2107 | ||
| 2108 | void tms5220_device::device_config_complete() | |
| 2109 | { | |
| 2110 | } | |
| 2111 | ||
| 2112 | //------------------------------------------------- | |
| 2113 | // device_start - device-specific startup | |
| 2114 | //------------------------------------------------- | |
| 2115 | ||
| 2116 | void tms5220_device::device_start() | |
| 2117 | { | |
| 2118 | DEVICE_START_NAME( tms5220 )(this); | |
| 2119 | } | |
| 2120 | ||
| 2121 | //------------------------------------------------- | |
| 2122 | // device_reset - device-specific reset | |
| 2123 | //------------------------------------------------- | |
| 2124 | ||
| 2125 | void tms5220_device::device_reset() | |
| 2126 | { | |
| 2127 | DEVICE_RESET_NAME( tms5220 )(this); | |
| 2128 | } | |
| 2129 | ||
| 2130 | //------------------------------------------------- | |
| 2131 | // sound_stream_update - handle a stream update | |
| 2132 | //------------------------------------------------- | |
| 2133 | ||
| 2134 | void tms5220_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2135 | { | |
| 2136 | // should never get here | |
| 2137 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2138 | } | |
| 2139 | ||
| 2140 | ||
| 2141 | const device_type TMC0285 = &device_creator<tmc0285_device>; | |
| 2142 | ||
| 2143 | tmc0285_device::tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2144 | : tms5220_device(mconfig, TMC0285, "TMC0285", tag, owner, clock) | |
| 2145 | { | |
| 2146 | } | |
| 2147 | ||
| 2148 | //------------------------------------------------- | |
| 2149 | // device_start - device-specific startup | |
| 2150 | //------------------------------------------------- | |
| 2151 | ||
| 2152 | void tmc0285_device::device_start() | |
| 2153 | { | |
| 2154 | DEVICE_START_NAME( tmc0285 )(this); | |
| 2155 | } | |
| 2156 | ||
| 2157 | //------------------------------------------------- | |
| 2158 | // sound_stream_update - handle a stream update | |
| 2159 | //------------------------------------------------- | |
| 2160 | ||
| 2161 | void tmc0285_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2162 | { | |
| 2163 | // should never get here | |
| 2164 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2165 | } | |
| 2166 | ||
| 2167 | ||
| 2168 | const device_type TMS5200 = &device_creator<tms5200_device>; | |
| 2169 | ||
| 2170 | tms5200_device::tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2171 | : tms5220_device(mconfig, TMS5200, "TMS5200", tag, owner, clock) | |
| 2172 | { | |
| 2173 | } | |
| 2174 | ||
| 2175 | //------------------------------------------------- | |
| 2176 | // device_start - device-specific startup | |
| 2177 | //------------------------------------------------- | |
| 2178 | ||
| 2179 | void tms5200_device::device_start() | |
| 2180 | { | |
| 2181 | DEVICE_START_NAME( tms5200 )(this); | |
| 2182 | } | |
| 2183 | ||
| 2184 | //------------------------------------------------- | |
| 2185 | // sound_stream_update - handle a stream update | |
| 2186 | //------------------------------------------------- | |
| 2187 | ||
| 2188 | void tms5200_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 2189 | { | |
| 2190 | // should never get here | |
| 2191 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 2192 | } | |
| 2193 | ||
| 2194 | ||
| 2195 | ||
| 2196 | ||
| 2066 | 2197 | /****************************************************************************** |
| 2067 | 2198 | New class implementation |
| 2068 | 2199 | ******************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | WRITE8_DEVICE_HANDLER( ym2203_control_port_w ); |
| 25 | 25 | WRITE8_DEVICE_HANDLER( ym2203_write_port_w ); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(YM2203, ym2203); | |
| 27 | class ym2203_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | ym2203_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~ym2203_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_stop(); | |
| 41 | virtual void device_reset(); | |
| 42 | ||
| 43 | // sound stream update overrides | |
| 44 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type YM2203; | |
| 51 | ||
| 52 | ||
| 29 | 53 | #endif /* __2203INTF_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 30 | 30 | */ |
| 31 | 31 | void k007232_set_volume(device_t *device,int channel,int volumeA,int volumeB); |
| 32 | 32 | |
| 33 | DECLARE_LEGACY_SOUND_DEVICE(K007232, k007232); | |
| 33 | class k007232_device : public device_t, | |
| 34 | public device_sound_interface | |
| 35 | { | |
| 36 | public: | |
| 37 | k007232_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 38 | ~k007232_device() { global_free(m_token); } | |
| 34 | 39 | |
| 40 | // access to legacy token | |
| 41 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 42 | protected: | |
| 43 | // device-level overrides | |
| 44 | virtual void device_config_complete(); | |
| 45 | virtual void device_start(); | |
| 46 | ||
| 47 | // sound stream update overrides | |
| 48 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 49 | private: | |
| 50 | // internal state | |
| 51 | void *m_token; | |
| 52 | }; | |
| 53 | ||
| 54 | extern const device_type K007232; | |
| 55 | ||
| 56 | ||
| 35 | 57 | #endif /* __K007232_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 42 | 42 | |
| 43 | 43 | void tms5220_set_frequency(device_t *device, int frequency); |
| 44 | 44 | |
| 45 | DECLARE_LEGACY_SOUND_DEVICE(TMS5220C, tms5220c); | |
| 46 | DECLARE_LEGACY_SOUND_DEVICE(TMS5220, tms5220); | |
| 47 | DECLARE_LEGACY_SOUND_DEVICE(TMC0285, tmc0285); | |
| 48 | DECLARE_LEGACY_SOUND_DEVICE(TMS5200, tms5200); | |
| 45 | class tms5220_device : public device_t, | |
| 46 | public device_sound_interface | |
| 47 | { | |
| 48 | public: | |
| 49 | tms5220_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | tms5220_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 51 | ~tms5220_device() { global_free(m_token); } | |
| 49 | 52 | |
| 53 | // access to legacy token | |
| 54 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 55 | protected: | |
| 56 | // device-level overrides | |
| 57 | virtual void device_config_complete(); | |
| 58 | virtual void device_start(); | |
| 59 | virtual void device_reset(); | |
| 50 | 60 | |
| 61 | // sound stream update overrides | |
| 62 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 63 | private: | |
| 64 | // internal state | |
| 65 | void *m_token; | |
| 66 | }; | |
| 67 | ||
| 68 | extern const device_type TMS5220; | |
| 69 | ||
| 70 | class tms5220c_device : public tms5220_device | |
| 71 | { | |
| 72 | public: | |
| 73 | tms5220c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 74 | protected: | |
| 75 | // device-level overrides | |
| 76 | virtual void device_start(); | |
| 77 | ||
| 78 | // sound stream update overrides | |
| 79 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 80 | }; | |
| 81 | ||
| 82 | extern const device_type TMS5220C; | |
| 83 | ||
| 84 | class tmc0285_device : public tms5220_device | |
| 85 | { | |
| 86 | public: | |
| 87 | tmc0285_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 88 | protected: | |
| 89 | // device-level overrides | |
| 90 | virtual void device_start(); | |
| 91 | ||
| 92 | // sound stream update overrides | |
| 93 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 94 | }; | |
| 95 | ||
| 96 | extern const device_type TMC0285; | |
| 97 | ||
| 98 | class tms5200_device : public tms5220_device | |
| 99 | { | |
| 100 | public: | |
| 101 | tms5200_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 102 | protected: | |
| 103 | // device-level overrides | |
| 104 | virtual void device_start(); | |
| 105 | ||
| 106 | // sound stream update overrides | |
| 107 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 108 | }; | |
| 109 | ||
| 110 | extern const device_type TMS5200; | |
| 111 | ||
| 112 | ||
| 113 | ||
| 51 | 114 | /*************************************************************************** |
| 52 | 115 | New class implementation |
| 53 | 116 | Michael Zapf, June 2012 |
| r17612 | r17613 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | assert(device != NULL); |
| 54 | 54 | assert(device->type() == OKIM6258); |
| 55 | return (okim6258_state *)downcast< | |
| 55 | return (okim6258_state *)downcast<okim6258_devic | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | /********************************************************************************************** |
| r17612 | r17613 | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
| 384 | DEFINE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258); | |
| 384 | const device_type OKIM6258 = &device_creator<okim6258_device>; | |
| 385 | ||
| 386 | okim6258_device::okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 387 | : device_t(mconfig, OKIM6258, "OKI6258", tag, owner, clock), | |
| 388 | device_sound_interface(mconfig, *this) | |
| 389 | { | |
| 390 | m_token = global_alloc_array_clear(UINT8, sizeof(okim6258_state)); | |
| 391 | } | |
| 392 | ||
| 393 | //------------------------------------------------- | |
| 394 | // device_config_complete - perform any | |
| 395 | // operations now that the configuration is | |
| 396 | // complete | |
| 397 | //------------------------------------------------- | |
| 398 | ||
| 399 | void okim6258_device::device_config_complete() | |
| 400 | { | |
| 401 | } | |
| 402 | ||
| 403 | //------------------------------------------------- | |
| 404 | // device_start - device-specific startup | |
| 405 | //------------------------------------------------- | |
| 406 | ||
| 407 | void okim6258_device::device_start() | |
| 408 | { | |
| 409 | DEVICE_START_NAME( okim6258 )(this); | |
| 410 | } | |
| 411 | ||
| 412 | //------------------------------------------------- | |
| 413 | // device_reset - device-specific reset | |
| 414 | //------------------------------------------------- | |
| 415 | ||
| 416 | void okim6258_device::device_reset() | |
| 417 | { | |
| 418 | DEVICE_RESET_NAME( okim6258 )(this); | |
| 419 | } | |
| 420 | ||
| 421 | //------------------------------------------------- | |
| 422 | // sound_stream_update - handle a stream update | |
| 423 | //------------------------------------------------- | |
| 424 | ||
| 425 | void okim6258_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 426 | { | |
| 427 | // should never get here | |
| 428 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 429 | } | |
| 430 | ||
| 431 |
| r17612 | r17613 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | assert(device != NULL); |
| 67 | 67 | assert(device->type() == NILE); |
| 68 | return (nile_state *)downcast<le | |
| 68 | return (nile_state *)downcast<nile | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| r17612 | r17613 | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| 261 | DEFINE_LEGACY_SOUND_DEVICE(NILE, nile); | |
| 261 | const device_type NILE = &device_creator<nile_device>; | |
| 262 | ||
| 263 | nile_device::nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 264 | : device_t(mconfig, NILE, "NiLe", tag, owner, clock), | |
| 265 | device_sound_interface(mconfig, *this) | |
| 266 | { | |
| 267 | m_token = global_alloc_array_clear(UINT8, sizeof(nile_state)); | |
| 268 | } | |
| 269 | ||
| 270 | //------------------------------------------------- | |
| 271 | // device_config_complete - perform any | |
| 272 | // operations now that the configuration is | |
| 273 | // complete | |
| 274 | //------------------------------------------------- | |
| 275 | ||
| 276 | void nile_device::device_config_complete() | |
| 277 | { | |
| 278 | } | |
| 279 | ||
| 280 | //------------------------------------------------- | |
| 281 | // device_start - device-specific startup | |
| 282 | //------------------------------------------------- | |
| 283 | ||
| 284 | void nile_device::device_start() | |
| 285 | { | |
| 286 | DEVICE_START_NAME( nile )(this); | |
| 287 | } | |
| 288 | ||
| 289 | //------------------------------------------------- | |
| 290 | // sound_stream_update - handle a stream update | |
| 291 | //------------------------------------------------- | |
| 292 | ||
| 293 | void nile_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 294 | { | |
| 295 | // should never get here | |
| 296 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 297 | } | |
| 298 | ||
| 299 |
| r17612 | r17613 | |
|---|---|---|
| 51 | 51 | { |
| 52 | 52 | assert(device != NULL); |
| 53 | 53 | assert(device->type() == ES8712); |
| 54 | return (es8712_state *)downcast< | |
| 54 | return (es8712_state *)downcast< | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | |
| r17612 | r17613 | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
| 410 | DEFINE_LEGACY_SOUND_DEVICE(ES8712, es8712); | |
| 410 | const device_type ES8712 = &device_creator<es8712_device>; | |
| 411 | ||
| 412 | es8712_device::es8712_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 413 | : device_t(mconfig, ES8712, "ES8712", tag, owner, clock), | |
| 414 | device_sound_interface(mconfig, *this) | |
| 415 | { | |
| 416 | m_token = global_alloc_array_clear(UINT8, sizeof(es8712_state)); | |
| 417 | } | |
| 418 | ||
| 419 | //------------------------------------------------- | |
| 420 | // device_config_complete - perform any | |
| 421 | // operations now that the configuration is | |
| 422 | // complete | |
| 423 | //------------------------------------------------- | |
| 424 | ||
| 425 | void es8712_device::device_config_complete() | |
| 426 | { | |
| 427 | } | |
| 428 | ||
| 429 | //------------------------------------------------- | |
| 430 | // device_start - device-specific startup | |
| 431 | //------------------------------------------------- | |
| 432 | ||
| 433 | void es8712_device::device_start() | |
| 434 | { | |
| 435 | DEVICE_START_NAME( es8712 )(this); | |
| 436 | } | |
| 437 | ||
| 438 | //------------------------------------------------- | |
| 439 | // device_reset - device-specific reset | |
| 440 | //------------------------------------------------- | |
| 441 | ||
| 442 | void es8712_device::device_reset() | |
| 443 | { | |
| 444 | DEVICE_RESET_NAME( es8712 )(this); | |
| 445 | } | |
| 446 | ||
| 447 | //------------------------------------------------- | |
| 448 | // sound_stream_update - handle a stream update | |
| 449 | //------------------------------------------------- | |
| 450 | ||
| 451 | void es8712_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 452 | { | |
| 453 | // should never get here | |
| 454 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 455 | } | |
| 456 | ||
| 457 |
| r17612 | r17613 | |
|---|---|---|
| 34 | 34 | WRITE8_DEVICE_HANDLER( okim6258_data_w ); |
| 35 | 35 | WRITE8_DEVICE_HANDLER( okim6258_ctrl_w ); |
| 36 | 36 | |
| 37 | DECLARE_LEGACY_SOUND_DEVICE(OKIM6258, okim6258); | |
| 37 | class okim6258_device : public device_t, | |
| 38 | public device_sound_interface | |
| 39 | { | |
| 40 | public: | |
| 41 | okim6258_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | ~okim6258_device() { global_free(m_token); } | |
| 38 | 43 | |
| 44 | // access to legacy token | |
| 45 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_config_complete(); | |
| 49 | virtual void device_start(); | |
| 50 | virtual void device_reset(); | |
| 51 | ||
| 52 | // sound stream update overrides | |
| 53 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 54 | private: | |
| 55 | // internal state | |
| 56 | void *m_token; | |
| 57 | }; | |
| 58 | ||
| 59 | extern const device_type OKIM6258; | |
| 60 | ||
| 61 | ||
| 39 | 62 | #endif /* __OKIM6258_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | assert(device != NULL); |
| 77 | 77 | assert(device->type() == NES); |
| 78 | return (nesapu_state *)downcast< | |
| 78 | return (nesapu_state *)downcast<nesapu_devic | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | /* INTERNAL FUNCTIONS */ |
| r17612 | r17613 | |
| 792 | 792 | } |
| 793 | 793 | |
| 794 | 794 | |
| 795 | DEFINE_LEGACY_SOUND_DEVICE(NES, nesapu); | |
| 795 | const device_type NES = &device_creator<nesapu_device>; | |
| 796 | ||
| 797 | nesapu_device::nesapu_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 798 | : device_t(mconfig, NES, "N2A03", tag, owner, clock), | |
| 799 | device_sound_interface(mconfig, *this) | |
| 800 | { | |
| 801 | m_token = global_alloc_array_clear(UINT8, sizeof(nesapu_state)); | |
| 802 | } | |
| 803 | ||
| 804 | //------------------------------------------------- | |
| 805 | // device_config_complete - perform any | |
| 806 | // operations now that the configuration is | |
| 807 | // complete | |
| 808 | //------------------------------------------------- | |
| 809 | ||
| 810 | void nesapu_device::device_config_complete() | |
| 811 | { | |
| 812 | } | |
| 813 | ||
| 814 | //------------------------------------------------- | |
| 815 | // device_start - device-specific startup | |
| 816 | //------------------------------------------------- | |
| 817 | ||
| 818 | void nesapu_device::device_start() | |
| 819 | { | |
| 820 | DEVICE_START_NAME( nesapu )(this); | |
| 821 | } | |
| 822 | ||
| 823 | //------------------------------------------------- | |
| 824 | // sound_stream_update - handle a stream update | |
| 825 | //------------------------------------------------- | |
| 826 | ||
| 827 | void nesapu_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 828 | { | |
| 829 | // should never get here | |
| 830 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 831 | } | |
| 832 | ||
| 833 |
| r17612 | r17613 | |
|---|---|---|
| 25 | 25 | { |
| 26 | 26 | assert(device != NULL); |
| 27 | 27 | assert(device->type() == YMF262); |
| 28 | return (ymf262_state *)downcast< | |
| 28 | return (ymf262_state *)downcast< | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | |
| r17612 | r17613 | |
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | |
| 161 | DEFINE_LEGACY_SOUND_DEVICE(YMF262, ymf262); | |
| 161 | const device_type YMF262 = &device_creator<ymf262_device>; | |
| 162 | ||
| 163 | ymf262_device::ymf262_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 164 | : device_t(mconfig, YMF262, "YMF262", tag, owner, clock), | |
| 165 | device_sound_interface(mconfig, *this) | |
| 166 | { | |
| 167 | m_token = global_alloc_array_clear(UINT8, sizeof(ymf262_state)); | |
| 168 | } | |
| 169 | ||
| 170 | //------------------------------------------------- | |
| 171 | // device_config_complete - perform any | |
| 172 | // operations now that the configuration is | |
| 173 | // complete | |
| 174 | //------------------------------------------------- | |
| 175 | ||
| 176 | void ymf262_device::device_config_complete() | |
| 177 | { | |
| 178 | } | |
| 179 | ||
| 180 | //------------------------------------------------- | |
| 181 | // device_start - device-specific startup | |
| 182 | //------------------------------------------------- | |
| 183 | ||
| 184 | void ymf262_device::device_start() | |
| 185 | { | |
| 186 | DEVICE_START_NAME( ymf262 )(this); | |
| 187 | } | |
| 188 | ||
| 189 | //------------------------------------------------- | |
| 190 | // device_reset - device-specific reset | |
| 191 | //------------------------------------------------- | |
| 192 | ||
| 193 | void ymf262_device::device_reset() | |
| 194 | { | |
| 195 | DEVICE_RESET_NAME( ymf262 )(this); | |
| 196 | } | |
| 197 | ||
| 198 | //------------------------------------------------- | |
| 199 | // device_stop - device-specific stop | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | void ymf262_device::device_stop() | |
| 203 | { | |
| 204 | DEVICE_STOP_NAME( ymf262 )(this); | |
| 205 | } | |
| 206 | ||
| 207 | //------------------------------------------------- | |
| 208 | // sound_stream_update - handle a stream update | |
| 209 | //------------------------------------------------- | |
| 210 | ||
| 211 | void ymf262_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 212 | { | |
| 213 | // should never get here | |
| 214 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 215 | } | |
| 216 | ||
| 217 |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | WRITE16_DEVICE_HANDLER( nile_sndctrl_w ); |
| 11 | 11 | READ16_DEVICE_HANDLER( nile_sndctrl_r ); |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_SOUND_DEVICE(NILE, nile); | |
| 13 | class nile_device : public device_t, | |
| 14 | public device_sound_interface | |
| 15 | { | |
| 16 | public: | |
| 17 | nile_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~nile_device() { global_free(m_token); } | |
| 14 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | ||
| 27 | // sound stream update overrides | |
| 28 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type NILE; | |
| 35 | ||
| 36 | ||
| 15 | 37 | #endif /* __NILE_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 58 | 58 | { |
| 59 | 59 | assert(device != NULL); |
| 60 | 60 | assert((device->type() == ADC12130) || (device->type() == ADC12132) || (device->type() == ADC12138)); |
| 61 | return (adc12138_state *)downcast< | |
| 61 | return (adc12138_state *)downcast< | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | INLINE const adc12138_interface *get_interface(device_t *device) |
| r17612 | r17613 | |
| 390 | 390 | } |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | DEFINE_LEGACY_DEVICE(ADC12130, adc12130); | |
| 394 | DEFINE_LEGACY_DEVICE(ADC12132, adc12132); | |
| 395 | DEFINE_LEGACY_DEVICE(ADC12138, adc12138); | |
| 393 | const device_type ADC12130 = &device_creator<adc12130_device>; | |
| 394 | ||
| 395 | adc12130_device::adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 396 | : adc12138_device(mconfig, ADC12130, "A/D Converter 12130", tag, owner, clock) | |
| 397 | { | |
| 398 | } | |
| 399 | ||
| 400 | ||
| 401 | const device_type ADC12132 = &device_creator<adc12132_device>; | |
| 402 | ||
| 403 | adc12132_device::adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 404 | : adc12138_device(mconfig, ADC12132, "A/D Converter 12132", tag, owner, clock) | |
| 405 | { | |
| 406 | } | |
| 407 | ||
| 408 | ||
| 409 | const device_type ADC12138 = &device_creator<adc12138_device>; | |
| 410 | ||
| 411 | adc12138_device::adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 412 | : device_t(mconfig, ADC12138, "A/D Converter 12138", tag, owner, clock) | |
| 413 | { | |
| 414 | m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state)); | |
| 415 | } | |
| 416 | adc12138_device::adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 417 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 418 | { | |
| 419 | m_token = global_alloc_array_clear(UINT8, sizeof(adc12138_state)); | |
| 420 | } | |
| 421 | ||
| 422 | //------------------------------------------------- | |
| 423 | // device_config_complete - perform any | |
| 424 | // operations now that the configuration is | |
| 425 | // complete | |
| 426 | //------------------------------------------------- | |
| 427 | ||
| 428 | void adc12138_device::device_config_complete() | |
| 429 | { | |
| 430 | } | |
| 431 | ||
| 432 | //------------------------------------------------- | |
| 433 | // device_start - device-specific startup | |
| 434 | //------------------------------------------------- | |
| 435 | ||
| 436 | void adc12138_device::device_start() | |
| 437 | { | |
| 438 | DEVICE_START_NAME( adc12138 )(this); | |
| 439 | } | |
| 440 | ||
| 441 | //------------------------------------------------- | |
| 442 | // device_reset - device-specific reset | |
| 443 | //------------------------------------------------- | |
| 444 | ||
| 445 | void adc12138_device::device_reset() | |
| 446 | { | |
| 447 | DEVICE_RESET_NAME( adc12138 )(this); | |
| 448 | } | |
| 449 | ||
| 450 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | MACROS / CONSTANTS |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_DEVICE(ADC12130, adc12130); | |
| 21 | DECLARE_LEGACY_DEVICE(ADC12132, adc12132); | |
| 22 | DECLARE_LEGACY_DEVICE(ADC12138, adc12138); | |
| 20 | class adc12138_device : public device_t | |
| 21 | { | |
| 22 | public: | |
| 23 | adc12138_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | adc12138_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~adc12138_device() { global_free(m_token); } | |
| 23 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | private: | |
| 35 | // internal state | |
| 36 | void *m_token; | |
| 37 | }; | |
| 38 | ||
| 39 | extern const device_type ADC12138; | |
| 40 | ||
| 41 | class adc12130_device : public adc12138_device | |
| 42 | { | |
| 43 | public: | |
| 44 | adc12130_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | }; | |
| 46 | ||
| 47 | extern const device_type ADC12130; | |
| 48 | ||
| 49 | class adc12132_device : public adc12138_device | |
| 50 | { | |
| 51 | public: | |
| 52 | adc12132_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type ADC12132; | |
| 56 | ||
| 24 | 57 | #define MCFG_ADC12130_ADD(_tag, _config) \ |
| 25 | 58 | MCFG_DEVICE_ADD(_tag, ADC12130, 0) \ |
| 26 | 59 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | assert(device != NULL); |
| 62 | 62 | assert(device->type() == TTL74153); |
| 63 | 63 | |
| 64 | return (ttl74153_state *)downcast<l | |
| 64 | return (ttl74153_state *)downcast<ttl74153_devic | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r17612 | r17613 | |
| 191 | 191 | } |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | DEFINE_LEGACY_DEVICE(TTL74153, ttl74153); | |
| 194 | const device_type TTL74153 = &device_creator<ttl74153_device>; | |
| 195 | ||
| 196 | ttl74153_device::ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 197 | : device_t(mconfig, TTL74153, "74153", tag, owner, clock) | |
| 198 | { | |
| 199 | m_token = global_alloc_array_clear(UINT8, sizeof(ttl74153_state)); | |
| 200 | } | |
| 201 | ||
| 202 | //------------------------------------------------- | |
| 203 | // device_config_complete - perform any | |
| 204 | // operations now that the configuration is | |
| 205 | // complete | |
| 206 | //------------------------------------------------- | |
| 207 | ||
| 208 | void ttl74153_device::device_config_complete() | |
| 209 | { | |
| 210 | } | |
| 211 | ||
| 212 | //------------------------------------------------- | |
| 213 | // device_start - device-specific startup | |
| 214 | //------------------------------------------------- | |
| 215 | ||
| 216 | void ttl74153_device::device_start() | |
| 217 | { | |
| 218 | DEVICE_START_NAME( ttl74153 )(this); | |
| 219 | } | |
| 220 | ||
| 221 | //------------------------------------------------- | |
| 222 | // device_reset - device-specific reset | |
| 223 | //------------------------------------------------- | |
| 224 | ||
| 225 | void ttl74153_device::device_reset() | |
| 226 | { | |
| 227 | DEVICE_RESET_NAME( ttl74153 )(this); | |
| 228 | } | |
| 229 | ||
| 230 |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | void ttl74153_enable_w(device_t *device, int section, int data); |
| 62 | 62 | int ttl74153_output_r(device_t *device, int section); |
| 63 | 63 | |
| 64 | DECLARE_LEGACY_DEVICE(TTL74153, ttl74153); | |
| 64 | class ttl74153_device : public device_t | |
| 65 | { | |
| 66 | public: | |
| 67 | ttl74153_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | ~ttl74153_device() { global_free(m_token); } | |
| 65 | 69 | |
| 70 | // access to legacy token | |
| 71 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 72 | protected: | |
| 73 | // device-level overrides | |
| 74 | virtual void device_config_complete(); | |
| 75 | virtual void device_start(); | |
| 76 | virtual void device_reset(); | |
| 77 | private: | |
| 78 | // internal state | |
| 79 | void *m_token; | |
| 80 | }; | |
| 81 | ||
| 82 | extern const device_type TTL74153; | |
| 83 | ||
| 84 | ||
| 66 | 85 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 107 | 107 | assert(device != NULL); |
| 108 | 108 | assert(device->type() == TMS6100 || |
| 109 | 109 | device->type() == M58819); |
| 110 | return (tms6100_state *)downcast< | |
| 110 | return (tms6100_state *)downcast<tms6100_devic | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /********************************************************************************************** |
| r17612 | r17613 | |
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | DEFINE_LEGACY_DEVICE(TMS6100, tms6100); | |
| 292 | DEFINE_LEGACY_DEVICE(M58819, m58819); | |
| 291 | const device_type TMS6100 = &device_creator<tms6100_device>; | |
| 292 | ||
| 293 | tms6100_device::tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 294 | : device_t(mconfig, TMS6100, "TMS6100", tag, owner, clock) | |
| 295 | { | |
| 296 | m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state)); | |
| 297 | } | |
| 298 | tms6100_device::tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 299 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 300 | { | |
| 301 | m_token = global_alloc_array_clear(UINT8, sizeof(tms6100_state)); | |
| 302 | } | |
| 303 | ||
| 304 | //------------------------------------------------- | |
| 305 | // device_config_complete - perform any | |
| 306 | // operations now that the configuration is | |
| 307 | // complete | |
| 308 | //------------------------------------------------- | |
| 309 | ||
| 310 | void tms6100_device::device_config_complete() | |
| 311 | { | |
| 312 | } | |
| 313 | ||
| 314 | //------------------------------------------------- | |
| 315 | // device_start - device-specific startup | |
| 316 | //------------------------------------------------- | |
| 317 | ||
| 318 | void tms6100_device::device_start() | |
| 319 | { | |
| 320 | DEVICE_START_NAME( tms6100 )(this); | |
| 321 | } | |
| 322 | ||
| 323 | //------------------------------------------------- | |
| 324 | // device_reset - device-specific reset | |
| 325 | //------------------------------------------------- | |
| 326 | ||
| 327 | void tms6100_device::device_reset() | |
| 328 | { | |
| 329 | DEVICE_RESET_NAME( tms6100 )(this); | |
| 330 | } | |
| 331 | ||
| 332 | ||
| 333 | const device_type M58819 = &device_creator<m58819_device>; | |
| 334 | ||
| 335 | m58819_device::m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 336 | : tms6100_device(mconfig, M58819, "M58819", tag, owner, clock) | |
| 337 | { | |
| 338 | } | |
| 339 | ||
| 340 | //------------------------------------------------- | |
| 341 | // device_start - device-specific startup | |
| 342 | //------------------------------------------------- | |
| 343 | ||
| 344 | void m58819_device::device_start() | |
| 345 | { | |
| 346 | DEVICE_START_NAME( m58819 )(this); | |
| 347 | } | |
| 348 | ||
| 349 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | READ_LINE_DEVICE_HANDLER( tms6100_data_r ); |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_DEVICE(TMS6100, tms6100); | |
| 18 | DECLARE_LEGACY_DEVICE(M58819, m58819); | |
| 17 | class tms6100_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | tms6100_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | tms6100_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~tms6100_device() { global_free(m_token); } | |
| 19 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type TMS6100; | |
| 37 | ||
| 38 | class m58819_device : public tms6100_device | |
| 39 | { | |
| 40 | public: | |
| 41 | m58819_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | protected: | |
| 43 | // device-level overrides | |
| 44 | virtual void device_start(); | |
| 45 | }; | |
| 46 | ||
| 47 | extern const device_type M58819; | |
| 48 | ||
| 49 | ||
| 20 | 50 | #endif /* __TMS6100_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 156 | 156 | assert(device != NULL); |
| 157 | 157 | assert(device->type() == SMC91C94 || device->type() == SMC91C96); |
| 158 | 158 | |
| 159 | return (smc91c9x_state *)downcast< | |
| 159 | return (smc91c9x_state *)downcast<sm | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r17612 | r17613 | |
| 628 | 628 | } |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | smc91c9x_device::smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 632 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 633 | { | |
| 634 | m_token = global_alloc_array_clear(UINT8, sizeof(smc91c9x_state)); | |
| 635 | } | |
| 631 | 636 | |
| 632 | DEFINE_LEGACY_DEVICE(SMC91C94, smc91c94); | |
| 633 | DEFINE_LEGACY_DEVICE(SMC91C96, smc91c96); | |
| 637 | //------------------------------------------------- | |
| 638 | // device_config_complete - perform any | |
| 639 | // operations now that the configuration is | |
| 640 | // complete | |
| 641 | //------------------------------------------------- | |
| 634 | 642 | |
| 643 | void smc91c9x_device::device_config_complete() | |
| 644 | { | |
| 645 | } | |
| 646 | ||
| 647 | //------------------------------------------------- | |
| 648 | // device_start - device-specific startup | |
| 649 | //------------------------------------------------- | |
| 650 | ||
| 651 | void smc91c9x_device::device_start() | |
| 652 | { | |
| 653 | DEVICE_START_NAME( smc91c9x )(this); | |
| 654 | } | |
| 655 | ||
| 656 | //------------------------------------------------- | |
| 657 | // device_reset - device-specific reset | |
| 658 | //------------------------------------------------- | |
| 659 | ||
| 660 | void smc91c9x_device::device_reset() | |
| 661 | { | |
| 662 | DEVICE_RESET_NAME( smc91c9x )(this); | |
| 663 | } | |
| 664 | ||
| 665 | ||
| 666 | const device_type SMC91C94 = &device_creator<smc91c94_device>; | |
| 667 | ||
| 668 | smc91c94_device::smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 669 | : smc91c9x_device(mconfig, SMC91C94, "SMC91C94", tag, owner, clock) | |
| 670 | { | |
| 671 | } | |
| 672 | ||
| 673 | ||
| 674 | const device_type SMC91C96 = &device_creator<smc91c96_device>; | |
| 675 | ||
| 676 | smc91c96_device::smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 677 | : smc91c9x_device(mconfig, SMC91C96, "SMC91C96", tag, owner, clock) | |
| 678 | { | |
| 679 | } | |
| 680 | ||
| 681 | ||
| 682 |
| r17612 | r17613 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | /* ----- device interface ----- */ |
| 53 | class smc91c9x_device : public device_t | |
| 54 | { | |
| 55 | public: | |
| 56 | smc91c9x_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 57 | ~smc91c9x_device() { global_free(m_token); } | |
| 53 | 58 | |
| 54 | DECLARE_LEGACY_DEVICE(SMC91C94, smc91c94); | |
| 55 | DECLARE_LEGACY_DEVICE(SMC91C96, smc91c96); | |
| 59 | // access to legacy token | |
| 60 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 61 | protected: | |
| 62 | // device-level overrides | |
| 63 | virtual void device_config_complete(); | |
| 64 | virtual void device_start(); | |
| 65 | virtual void device_reset(); | |
| 66 | private: | |
| 67 | // internal state | |
| 68 | void *m_token; | |
| 69 | }; | |
| 56 | 70 | |
| 71 | ||
| 72 | class smc91c94_device : public smc91c9x_device | |
| 73 | { | |
| 74 | public: | |
| 75 | smc91c94_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 76 | }; | |
| 77 | ||
| 78 | extern const device_type SMC91C94; | |
| 79 | ||
| 80 | class smc91c96_device : public smc91c9x_device | |
| 81 | { | |
| 82 | public: | |
| 83 | smc91c96_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 84 | }; | |
| 85 | ||
| 86 | extern const device_type SMC91C96; | |
| 87 | ||
| 88 | ||
| 57 | 89 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | assert( device != NULL ); |
| 77 | 77 | assert( ( device->type() == ADC0831 ) || ( device->type() == ADC0832 ) || ( device->type() == ADC0834 ) || ( device->type() == ADC0838 ) ); |
| 78 | return (adc0831_state *) downcast< | |
| 78 | return (adc0831_state *) downcast< | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | INLINE const adc083x_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 550 | 550 | } |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | DEFINE_LEGACY_DEVICE(ADC0831, adc0831); | |
| 554 | DEFINE_LEGACY_DEVICE(ADC0832, adc0832); | |
| 555 | DEFINE_LEGACY_DEVICE(ADC0834, adc0834); | |
| 556 | DEFINE_LEGACY_DEVICE(ADC0838, adc0838); | |
| 553 | const device_type ADC0831 = &device_creator<adc0831_device>; | |
| 554 | ||
| 555 | adc0831_device::adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 556 | : device_t(mconfig, ADC0831, "A/D Converters 0831", tag, owner, clock) | |
| 557 | { | |
| 558 | m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state)); | |
| 559 | } | |
| 560 | adc0831_device::adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 561 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 562 | { | |
| 563 | m_token = global_alloc_array_clear(UINT8, sizeof(adc0831_state)); | |
| 564 | } | |
| 565 | ||
| 566 | //------------------------------------------------- | |
| 567 | // device_config_complete - perform any | |
| 568 | // operations now that the configuration is | |
| 569 | // complete | |
| 570 | //------------------------------------------------- | |
| 571 | ||
| 572 | void adc0831_device::device_config_complete() | |
| 573 | { | |
| 574 | } | |
| 575 | ||
| 576 | //------------------------------------------------- | |
| 577 | // device_start - device-specific startup | |
| 578 | //------------------------------------------------- | |
| 579 | ||
| 580 | void adc0831_device::device_start() | |
| 581 | { | |
| 582 | DEVICE_START_NAME( adc0831 )(this); | |
| 583 | } | |
| 584 | ||
| 585 | //------------------------------------------------- | |
| 586 | // device_reset - device-specific reset | |
| 587 | //------------------------------------------------- | |
| 588 | ||
| 589 | void adc0831_device::device_reset() | |
| 590 | { | |
| 591 | DEVICE_RESET_NAME( adc0831 )(this); | |
| 592 | } | |
| 593 | ||
| 594 | ||
| 595 | const device_type ADC0832 = &device_creator<adc0832_device>; | |
| 596 | ||
| 597 | adc0832_device::adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 598 | : adc0831_device(mconfig, ADC0832, "A/D Converters 0832", tag, owner, clock) | |
| 599 | { | |
| 600 | } | |
| 601 | ||
| 602 | ||
| 603 | const device_type ADC0834 = &device_creator<adc0834_device>; | |
| 604 | ||
| 605 | adc0834_device::adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 606 | : adc0831_device(mconfig, ADC0834, "A/D Converters 0834", tag, owner, clock) | |
| 607 | { | |
| 608 | } | |
| 609 | ||
| 610 | ||
| 611 | const device_type ADC0838 = &device_creator<adc0838_device>; | |
| 612 | ||
| 613 | adc0838_device::adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 614 | : adc0831_device(mconfig, ADC0838, "A/D Converters 0838", tag, owner, clock) | |
| 615 | { | |
| 616 | } | |
| 617 | ||
| 618 |
| r17612 | r17613 | |
|---|---|---|
| 32 | 32 | MACROS / CONSTANTS |
| 33 | 33 | ***************************************************************************/ |
| 34 | 34 | |
| 35 | DECLARE_LEGACY_DEVICE(ADC0831, adc0831); | |
| 36 | DECLARE_LEGACY_DEVICE(ADC0832, adc0832); | |
| 37 | DECLARE_LEGACY_DEVICE(ADC0834, adc0834); | |
| 38 | DECLARE_LEGACY_DEVICE(ADC0838, adc0838); | |
| 35 | class adc0831_device : public device_t | |
| 36 | { | |
| 37 | public: | |
| 38 | adc0831_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 39 | adc0831_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 40 | ~adc0831_device() { global_free(m_token); } | |
| 39 | 41 | |
| 42 | // access to legacy token | |
| 43 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 44 | protected: | |
| 45 | // device-level overrides | |
| 46 | virtual void device_config_complete(); | |
| 47 | virtual void device_start(); | |
| 48 | virtual void device_reset(); | |
| 49 | private: | |
| 50 | // internal state | |
| 51 | void *m_token; | |
| 52 | }; | |
| 53 | ||
| 54 | extern const device_type ADC0831; | |
| 55 | ||
| 56 | class adc0832_device : public adc0831_device | |
| 57 | { | |
| 58 | public: | |
| 59 | adc0832_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 60 | }; | |
| 61 | ||
| 62 | extern const device_type ADC0832; | |
| 63 | ||
| 64 | class adc0834_device : public adc0831_device | |
| 65 | { | |
| 66 | public: | |
| 67 | adc0834_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | }; | |
| 69 | ||
| 70 | extern const device_type ADC0834; | |
| 71 | ||
| 72 | class adc0838_device : public adc0831_device | |
| 73 | { | |
| 74 | public: | |
| 75 | adc0838_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 76 | }; | |
| 77 | ||
| 78 | extern const device_type ADC0838; | |
| 79 | ||
| 80 | ||
| 40 | 81 | #define MCFG_ADC0831_ADD(_tag, _config) \ |
| 41 | 82 | MCFG_DEVICE_ADD(_tag, ADC0831, 0) \ |
| 42 | 83 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 77 | 77 | INLINE pic8259_t *get_safe_token(device_t *device) { |
| 78 | 78 | assert( device != NULL ); |
| 79 | 79 | assert( device->type() == PIC8259 ); |
| 80 | return ( pic8259_t *) downcast< | |
| 80 | return ( pic8259_t *) downcast<pi | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| r17612 | r17613 | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | |
| 472 | DEFINE_LEGACY_DEVICE(PIC8259, pic8259); | |
| 472 | const device_type PIC8259 = &device_creator<pic8259_device>; | |
| 473 | ||
| 474 | pic8259_device::pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 475 | : device_t(mconfig, PIC8259, "Intel PIC8259", tag, owner, clock) | |
| 476 | { | |
| 477 | m_token = global_alloc_array_clear(UINT8, sizeof(pic8259_t)); | |
| 478 | } | |
| 479 | ||
| 480 | //------------------------------------------------- | |
| 481 | // device_config_complete - perform any | |
| 482 | // operations now that the configuration is | |
| 483 | // complete | |
| 484 | //------------------------------------------------- | |
| 485 | ||
| 486 | void pic8259_device::device_config_complete() | |
| 487 | { | |
| 488 | } | |
| 489 | ||
| 490 | //------------------------------------------------- | |
| 491 | // device_start - device-specific startup | |
| 492 | //------------------------------------------------- | |
| 493 | ||
| 494 | void pic8259_device::device_start() | |
| 495 | { | |
| 496 | DEVICE_START_NAME( pic8259 )(this); | |
| 497 | } | |
| 498 | ||
| 499 | //------------------------------------------------- | |
| 500 | // device_reset - device-specific reset | |
| 501 | //------------------------------------------------- | |
| 502 | ||
| 503 | void pic8259_device::device_reset() | |
| 504 | { | |
| 505 | DEVICE_RESET_NAME( pic8259 )(this); | |
| 506 | } | |
| 507 | ||
| 508 |
| r17612 | r17613 | |
|---|---|---|
| 49 | 49 | { |
| 50 | 50 | assert(device != NULL); |
| 51 | 51 | assert((device->type() == UPD4701)); |
| 52 | return (upd4701_state *)downcast< | |
| 52 | return (upd4701_state *)downcast<upd4701_devic | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | |
| r17612 | r17613 | |
| 319 | 319 | } |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | DEFINE_LEGACY_DEVICE(UPD4701, upd4701); | |
| 322 | const device_type UPD4701 = &device_creator<upd4701_device>; | |
| 323 | ||
| 324 | upd4701_device::upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 325 | : device_t(mconfig, UPD4701, "NEC uPD4701 Encoder", tag, owner, clock) | |
| 326 | { | |
| 327 | m_token = global_alloc_array_clear(UINT8, sizeof(upd4701_state)); | |
| 328 | } | |
| 329 | ||
| 330 | //------------------------------------------------- | |
| 331 | // device_config_complete - perform any | |
| 332 | // operations now that the configuration is | |
| 333 | // complete | |
| 334 | //------------------------------------------------- | |
| 335 | ||
| 336 | void upd4701_device::device_config_complete() | |
| 337 | { | |
| 338 | } | |
| 339 | ||
| 340 | //------------------------------------------------- | |
| 341 | // device_start - device-specific startup | |
| 342 | //------------------------------------------------- | |
| 343 | ||
| 344 | void upd4701_device::device_start() | |
| 345 | { | |
| 346 | DEVICE_START_NAME( upd4701 )(this); | |
| 347 | } | |
| 348 | ||
| 349 | //------------------------------------------------- | |
| 350 | // device_reset - device-specific reset | |
| 351 | //------------------------------------------------- | |
| 352 | ||
| 353 | void upd4701_device::device_reset() | |
| 354 | { | |
| 355 | DEVICE_RESET_NAME( upd4701 )(this); | |
| 356 | } | |
| 357 | ||
| 358 |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | #include "devlegcy.h" |
| 29 | 29 | #include "devcb.h" |
| 30 | 30 | |
| 31 | DECLARE_LEGACY_DEVICE(PIC8259, pic8259); | |
| 31 | class pic8259_device : public device_t | |
| 32 | { | |
| 33 | public: | |
| 34 | pic8259_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | ~pic8259_device() { global_free(m_token); } | |
| 32 | 36 | |
| 37 | // access to legacy token | |
| 38 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 39 | protected: | |
| 40 | // device-level overrides | |
| 41 | virtual void device_config_complete(); | |
| 42 | virtual void device_start(); | |
| 43 | virtual void device_reset(); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | void *m_token; | |
| 47 | }; | |
| 48 | ||
| 49 | extern const device_type PIC8259; | |
| 50 | ||
| 51 | ||
| 33 | 52 | /*************************************************************************** |
| 34 | 53 | TYPE DEFINITIONS |
| 35 | 54 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | MACROS / CONSTANTS |
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_DEVICE(UPD4701, upd4701); | |
| 18 | class upd4701_device : public device_t | |
| 19 | { | |
| 20 | public: | |
| 21 | upd4701_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~upd4701_device() { global_free(m_token); } | |
| 19 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type UPD4701; | |
| 37 | ||
| 38 | ||
| 20 | 39 | #define MCFG_UPD4701_ADD(_tag) \ |
| 21 | 40 | MCFG_DEVICE_ADD(_tag, UPD4701, 0) |
| 22 | 41 |
| r17612 | r17613 | |
|---|---|---|
| 411 | 411 | device->type() == WD1770 || device->type() == WD1772 || device->type() == WD1773 || |
| 412 | 412 | device->type() == MB8866 || device->type() == MB8876 || device->type() == MB8877); |
| 413 | 413 | |
| 414 | return (wd1770_state *)downcast< | |
| 414 | return (wd1770_state *)downcast<wd1770_devic | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | |
| r17612 | r17613 | |
| 2328 | 2328 | } |
| 2329 | 2329 | } |
| 2330 | 2330 | |
| 2331 | DEFINE_LEGACY_DEVICE(FD1771, fd1771); | |
| 2332 | DEFINE_LEGACY_DEVICE(FD1781, fd1781); | |
| 2333 | DEFINE_LEGACY_DEVICE(FD1791, fd1791); | |
| 2334 | DEFINE_LEGACY_DEVICE(FD1792, fd1792); | |
| 2335 | DEFINE_LEGACY_DEVICE(FD1793, fd1793); | |
| 2336 | DEFINE_LEGACY_DEVICE(FD1794, fd1794); | |
| 2337 | DEFINE_LEGACY_DEVICE(FD1795, fd1795); | |
| 2338 | DEFINE_LEGACY_DEVICE(FD1797, fd1797); | |
| 2339 | DEFINE_LEGACY_DEVICE(FD1761, fd1761); | |
| 2340 | DEFINE_LEGACY_DEVICE(FD1762, fd1762); | |
| 2341 | DEFINE_LEGACY_DEVICE(FD1763, fd1763); | |
| 2342 | DEFINE_LEGACY_DEVICE(FD1764, fd1764); | |
| 2343 | DEFINE_LEGACY_DEVICE(FD1765, fd1765); | |
| 2344 | DEFINE_LEGACY_DEVICE(FD1767, fd1767); | |
| 2345 | DEFINE_LEGACY_DEVICE(WD2791, wd2791); | |
| 2346 | DEFINE_LEGACY_DEVICE(WD2793, wd2793); | |
| 2347 | DEFINE_LEGACY_DEVICE(WD2795, wd2795); | |
| 2348 | DEFINE_LEGACY_DEVICE(WD2797, wd2797); | |
| 2349 | DEFINE_LEGACY_DEVICE(WD1770, wd1770); | |
| 2350 | DEFINE_LEGACY_DEVICE(WD1772, wd1772); | |
| 2351 | DEFINE_LEGACY_DEVICE(WD1773, wd1773); | |
| 2352 | DEFINE_LEGACY_DEVICE(MB8866, mb8866); | |
| 2353 | DEFINE_LEGACY_DEVICE(MB8876, mb8876); | |
| 2354 | DEFINE_LEGACY_DEVICE(MB8877, mb8877); | |
| 2331 | const device_type FD1771 = &device_creator<fd1771_device>; | |
| 2332 | ||
| 2333 | fd1771_device::fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2334 | : wd1770_device(mconfig, FD1771, "FD1771", tag, owner, clock) | |
| 2335 | { | |
| 2336 | } | |
| 2337 | ||
| 2338 | ||
| 2339 | const device_type FD1781 = &device_creator<fd1781_device>; | |
| 2340 | ||
| 2341 | fd1781_device::fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2342 | : wd1770_device(mconfig, FD1781, "FD1781", tag, owner, clock) | |
| 2343 | { | |
| 2344 | } | |
| 2345 | ||
| 2346 | ||
| 2347 | const device_type FD1791 = &device_creator<fd1791_device>; | |
| 2348 | ||
| 2349 | fd1791_device::fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2350 | : wd1770_device(mconfig, FD1791, "FD1791", tag, owner, clock) | |
| 2351 | { | |
| 2352 | } | |
| 2353 | ||
| 2354 | ||
| 2355 | const device_type FD1792 = &device_creator<fd1792_device>; | |
| 2356 | ||
| 2357 | fd1792_device::fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2358 | : wd1770_device(mconfig, FD1792, "FD1792", tag, owner, clock) | |
| 2359 | { | |
| 2360 | } | |
| 2361 | ||
| 2362 | ||
| 2363 | const device_type FD1793 = &device_creator<fd1793_device>; | |
| 2364 | ||
| 2365 | fd1793_device::fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2366 | : wd1770_device(mconfig, FD1793, "FD1793", tag, owner, clock) | |
| 2367 | { | |
| 2368 | } | |
| 2369 | ||
| 2370 | ||
| 2371 | const device_type FD1794 = &device_creator<fd1794_device>; | |
| 2372 | ||
| 2373 | fd1794_device::fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2374 | : wd1770_device(mconfig, FD1794, "FD1794", tag, owner, clock) | |
| 2375 | { | |
| 2376 | } | |
| 2377 | ||
| 2378 | ||
| 2379 | const device_type FD1795 = &device_creator<fd1795_device>; | |
| 2380 | ||
| 2381 | fd1795_device::fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2382 | : wd1770_device(mconfig, FD1795, "FD1795", tag, owner, clock) | |
| 2383 | { | |
| 2384 | } | |
| 2385 | ||
| 2386 | ||
| 2387 | const device_type FD1797 = &device_creator<fd1797_device>; | |
| 2388 | ||
| 2389 | fd1797_device::fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2390 | : wd1770_device(mconfig, FD1797, "FD1797", tag, owner, clock) | |
| 2391 | { | |
| 2392 | } | |
| 2393 | ||
| 2394 | ||
| 2395 | const device_type FD1761 = &device_creator<fd1761_device>; | |
| 2396 | ||
| 2397 | fd1761_device::fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2398 | : wd1770_device(mconfig, FD1761, "FD1761", tag, owner, clock) | |
| 2399 | { | |
| 2400 | } | |
| 2401 | ||
| 2402 | ||
| 2403 | const device_type FD1762 = &device_creator<fd1762_device>; | |
| 2404 | ||
| 2405 | fd1762_device::fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2406 | : wd1770_device(mconfig, FD1762, "FD1762", tag, owner, clock) | |
| 2407 | { | |
| 2408 | } | |
| 2409 | ||
| 2410 | ||
| 2411 | const device_type FD1763 = &device_creator<fd1763_device>; | |
| 2412 | ||
| 2413 | fd1763_device::fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2414 | : wd1770_device(mconfig, FD1763, "FD1763", tag, owner, clock) | |
| 2415 | { | |
| 2416 | } | |
| 2417 | ||
| 2418 | ||
| 2419 | const device_type FD1764 = &device_creator<fd1764_device>; | |
| 2420 | ||
| 2421 | fd1764_device::fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2422 | : wd1770_device(mconfig, FD1764, "FD1764", tag, owner, clock) | |
| 2423 | { | |
| 2424 | } | |
| 2425 | ||
| 2426 | ||
| 2427 | const device_type FD1765 = &device_creator<fd1765_device>; | |
| 2428 | ||
| 2429 | fd1765_device::fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2430 | : wd1770_device(mconfig, FD1765, "FD1765", tag, owner, clock) | |
| 2431 | { | |
| 2432 | } | |
| 2433 | ||
| 2434 | ||
| 2435 | const device_type FD1767 = &device_creator<fd1767_device>; | |
| 2436 | ||
| 2437 | fd1767_device::fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2438 | : wd1770_device(mconfig, FD1767, "FD1767", tag, owner, clock) | |
| 2439 | { | |
| 2440 | } | |
| 2441 | ||
| 2442 | ||
| 2443 | const device_type WD2791 = &device_creator<wd2791_device>; | |
| 2444 | ||
| 2445 | wd2791_device::wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2446 | : wd1770_device(mconfig, WD2791, "WD2791", tag, owner, clock) | |
| 2447 | { | |
| 2448 | } | |
| 2449 | ||
| 2450 | ||
| 2451 | const device_type WD2793 = &device_creator<wd2793_device>; | |
| 2452 | ||
| 2453 | wd2793_device::wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2454 | : wd1770_device(mconfig, WD2793, "WD2793", tag, owner, clock) | |
| 2455 | { | |
| 2456 | } | |
| 2457 | ||
| 2458 | ||
| 2459 | const device_type WD2795 = &device_creator<wd2795_device>; | |
| 2460 | ||
| 2461 | wd2795_device::wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2462 | : wd1770_device(mconfig, WD2795, "WD2795", tag, owner, clock) | |
| 2463 | { | |
| 2464 | } | |
| 2465 | ||
| 2466 | ||
| 2467 | const device_type WD2797 = &device_creator<wd2797_device>; | |
| 2468 | ||
| 2469 | wd2797_device::wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2470 | : wd1770_device(mconfig, WD2797, "WD2797", tag, owner, clock) | |
| 2471 | { | |
| 2472 | } | |
| 2473 | ||
| 2474 | ||
| 2475 | const device_type WD1770 = &device_creator<wd1770_device>; | |
| 2476 | ||
| 2477 | wd1770_device::wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2478 | : device_t(mconfig, WD1770, "WD1770", tag, owner, clock) | |
| 2479 | { | |
| 2480 | m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state)); | |
| 2481 | } | |
| 2482 | wd1770_device::wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 2483 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 2484 | { | |
| 2485 | m_token = global_alloc_array_clear(UINT8, sizeof(wd1770_state)); | |
| 2486 | } | |
| 2487 | ||
| 2488 | //------------------------------------------------- | |
| 2489 | // device_config_complete - perform any | |
| 2490 | // operations now that the configuration is | |
| 2491 | // complete | |
| 2492 | //------------------------------------------------- | |
| 2493 | ||
| 2494 | void wd1770_device::device_config_complete() | |
| 2495 | { | |
| 2496 | } | |
| 2497 | ||
| 2498 | //------------------------------------------------- | |
| 2499 | // device_start - device-specific startup | |
| 2500 | //------------------------------------------------- | |
| 2501 | ||
| 2502 | void wd1770_device::device_start() | |
| 2503 | { | |
| 2504 | DEVICE_START_NAME( wd1770 )(this); | |
| 2505 | } | |
| 2506 | ||
| 2507 | //------------------------------------------------- | |
| 2508 | // device_reset - device-specific reset | |
| 2509 | //------------------------------------------------- | |
| 2510 | ||
| 2511 | void wd1770_device::device_reset() | |
| 2512 | { | |
| 2513 | DEVICE_RESET_NAME( wd1770 )(this); | |
| 2514 | } | |
| 2515 | ||
| 2516 | ||
| 2517 | const device_type WD1772 = &device_creator<wd1772_device>; | |
| 2518 | ||
| 2519 | wd1772_device::wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2520 | : wd1770_device(mconfig, WD1772, "WD1772", tag, owner, clock) | |
| 2521 | { | |
| 2522 | } | |
| 2523 | ||
| 2524 | //------------------------------------------------- | |
| 2525 | // device_start - device-specific startup | |
| 2526 | //------------------------------------------------- | |
| 2527 | ||
| 2528 | void wd1772_device::device_start() | |
| 2529 | { | |
| 2530 | DEVICE_START_NAME( wd1772 )(this); | |
| 2531 | } | |
| 2532 | ||
| 2533 | ||
| 2534 | const device_type WD1773 = &device_creator<wd1773_device>; | |
| 2535 | ||
| 2536 | wd1773_device::wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2537 | : wd1770_device(mconfig, WD1773, "WD1773", tag, owner, clock) | |
| 2538 | { | |
| 2539 | } | |
| 2540 | ||
| 2541 | ||
| 2542 | const device_type MB8866 = &device_creator<mb8866_device>; | |
| 2543 | ||
| 2544 | mb8866_device::mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2545 | : wd1770_device(mconfig, MB8866, "MB8866", tag, owner, clock) | |
| 2546 | { | |
| 2547 | } | |
| 2548 | ||
| 2549 | ||
| 2550 | const device_type MB8876 = &device_creator<mb8876_device>; | |
| 2551 | ||
| 2552 | mb8876_device::mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2553 | : wd1770_device(mconfig, MB8876, "MB8876", tag, owner, clock) | |
| 2554 | { | |
| 2555 | } | |
| 2556 | ||
| 2557 | ||
| 2558 | const device_type MB8877 = &device_creator<mb8877_device>; | |
| 2559 | ||
| 2560 | mb8877_device::mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2561 | : wd1770_device(mconfig, MB8877, "MB8877", tag, owner, clock) | |
| 2562 | { | |
| 2563 | } | |
| 2564 | ||
| 2565 |
| r17612 | r17613 | |
|---|---|---|
| 38 | 38 | assert(device != NULL); |
| 39 | 39 | assert(device->type() == ADC1038); |
| 40 | 40 | |
| 41 | return (adc1038_state *)downcast< | |
| 41 | return (adc1038_state *)downcast< | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | INLINE const adc1038_interface *adc1038_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | DEFINE_LEGACY_DEVICE(ADC1038, adc1038); | |
| 182 | const device_type ADC1038 = &device_creator<adc1038_device>; | |
| 183 | ||
| 184 | adc1038_device::adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 185 | : device_t(mconfig, ADC1038, "A/D Converters 1038", tag, owner, clock) | |
| 186 | { | |
| 187 | m_token = global_alloc_array_clear(UINT8, sizeof(adc1038_state)); | |
| 188 | } | |
| 189 | ||
| 190 | //------------------------------------------------- | |
| 191 | // device_config_complete - perform any | |
| 192 | // operations now that the configuration is | |
| 193 | // complete | |
| 194 | //------------------------------------------------- | |
| 195 | ||
| 196 | void adc1038_device::device_config_complete() | |
| 197 | { | |
| 198 | } | |
| 199 | ||
| 200 | //------------------------------------------------- | |
| 201 | // device_start - device-specific startup | |
| 202 | //------------------------------------------------- | |
| 203 | ||
| 204 | void adc1038_device::device_start() | |
| 205 | { | |
| 206 | DEVICE_START_NAME( adc1038 )(this); | |
| 207 | } | |
| 208 | ||
| 209 | //------------------------------------------------- | |
| 210 | // device_reset - device-specific reset | |
| 211 | //------------------------------------------------- | |
| 212 | ||
| 213 | void adc1038_device::device_reset() | |
| 214 | { | |
| 215 | DEVICE_RESET_NAME( adc1038 )(this); | |
| 216 | } | |
| 217 | ||
| 218 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | MACROS |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_DEVICE(FD1771, fd1771); | |
| 21 | DECLARE_LEGACY_DEVICE(FD1781, fd1781); | |
| 22 | DECLARE_LEGACY_DEVICE(FD1791, fd1791); | |
| 23 | DECLARE_LEGACY_DEVICE(FD1792, fd1792); | |
| 24 | DECLARE_LEGACY_DEVICE(FD1793, fd1793); | |
| 25 | DECLARE_LEGACY_DEVICE(FD1794, fd1794); | |
| 26 | DECLARE_LEGACY_DEVICE(FD1795, fd1795); | |
| 27 | DECLARE_LEGACY_DEVICE(FD1797, fd1797); | |
| 28 | DECLARE_LEGACY_DEVICE(FD1761, fd1761); | |
| 29 | DECLARE_LEGACY_DEVICE(FD1762, fd1762); | |
| 30 | DECLARE_LEGACY_DEVICE(FD1763, fd1763); | |
| 31 | DECLARE_LEGACY_DEVICE(FD1764, fd1764); | |
| 32 | DECLARE_LEGACY_DEVICE(FD1765, fd1765); | |
| 33 | DECLARE_LEGACY_DEVICE(FD1767, fd1767); | |
| 34 | DECLARE_LEGACY_DEVICE(WD2791, wd2791); | |
| 35 | DECLARE_LEGACY_DEVICE(WD2793, wd2793); | |
| 36 | DECLARE_LEGACY_DEVICE(WD2795, wd2795); | |
| 37 | DECLARE_LEGACY_DEVICE(WD2797, wd2797); | |
| 38 | DECLARE_LEGACY_DEVICE(WD1770, wd1770); | |
| 39 | DECLARE_LEGACY_DEVICE(WD1772, wd1772); | |
| 40 | DECLARE_LEGACY_DEVICE(WD1773, wd1773); | |
| 41 | DECLARE_LEGACY_DEVICE(MB8866, mb8866); | |
| 42 | DECLARE_LEGACY_DEVICE(MB8876, mb8876); | |
| 43 | DECLARE_LEGACY_DEVICE(MB8877, mb8877); | |
| 20 | class wd1770_device : public device_t | |
| 21 | { | |
| 22 | public: | |
| 23 | wd1770_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | wd1770_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~wd1770_device() { global_free(m_token); } | |
| 44 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | private: | |
| 35 | // internal state | |
| 36 | void *m_token; | |
| 37 | }; | |
| 45 | 38 | |
| 39 | extern const device_type WD1770; | |
| 46 | 40 | |
| 41 | class fd1771_device : public wd1770_device | |
| 42 | { | |
| 43 | public: | |
| 44 | fd1771_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | }; | |
| 46 | ||
| 47 | extern const device_type FD1771; | |
| 48 | ||
| 49 | class fd1781_device : public wd1770_device | |
| 50 | { | |
| 51 | public: | |
| 52 | fd1781_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | }; | |
| 54 | ||
| 55 | extern const device_type FD1781; | |
| 56 | ||
| 57 | class fd1791_device : public wd1770_device | |
| 58 | { | |
| 59 | public: | |
| 60 | fd1791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 61 | }; | |
| 62 | ||
| 63 | extern const device_type FD1791; | |
| 64 | ||
| 65 | class fd1792_device : public wd1770_device | |
| 66 | { | |
| 67 | public: | |
| 68 | fd1792_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 69 | }; | |
| 70 | ||
| 71 | extern const device_type FD1792; | |
| 72 | ||
| 73 | class fd1793_device : public wd1770_device | |
| 74 | { | |
| 75 | public: | |
| 76 | fd1793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 77 | }; | |
| 78 | ||
| 79 | extern const device_type FD1793; | |
| 80 | ||
| 81 | class fd1794_device : public wd1770_device | |
| 82 | { | |
| 83 | public: | |
| 84 | fd1794_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 85 | }; | |
| 86 | ||
| 87 | extern const device_type FD1794; | |
| 88 | ||
| 89 | class fd1795_device : public wd1770_device | |
| 90 | { | |
| 91 | public: | |
| 92 | fd1795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 93 | }; | |
| 94 | ||
| 95 | extern const device_type FD1795; | |
| 96 | ||
| 97 | class fd1797_device : public wd1770_device | |
| 98 | { | |
| 99 | public: | |
| 100 | fd1797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 101 | }; | |
| 102 | ||
| 103 | extern const device_type FD1797; | |
| 104 | ||
| 105 | class fd1761_device : public wd1770_device | |
| 106 | { | |
| 107 | public: | |
| 108 | fd1761_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 109 | }; | |
| 110 | ||
| 111 | extern const device_type FD1761; | |
| 112 | ||
| 113 | class fd1762_device : public wd1770_device | |
| 114 | { | |
| 115 | public: | |
| 116 | fd1762_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 117 | }; | |
| 118 | ||
| 119 | extern const device_type FD1762; | |
| 120 | ||
| 121 | class fd1763_device : public wd1770_device | |
| 122 | { | |
| 123 | public: | |
| 124 | fd1763_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 125 | }; | |
| 126 | ||
| 127 | extern const device_type FD1763; | |
| 128 | ||
| 129 | class fd1764_device : public wd1770_device | |
| 130 | { | |
| 131 | public: | |
| 132 | fd1764_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 133 | }; | |
| 134 | ||
| 135 | extern const device_type FD1764; | |
| 136 | ||
| 137 | class fd1765_device : public wd1770_device | |
| 138 | { | |
| 139 | public: | |
| 140 | fd1765_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 141 | }; | |
| 142 | ||
| 143 | extern const device_type FD1765; | |
| 144 | ||
| 145 | class fd1767_device : public wd1770_device | |
| 146 | { | |
| 147 | public: | |
| 148 | fd1767_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 149 | }; | |
| 150 | ||
| 151 | extern const device_type FD1767; | |
| 152 | ||
| 153 | class wd2791_device : public wd1770_device | |
| 154 | { | |
| 155 | public: | |
| 156 | wd2791_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 157 | }; | |
| 158 | ||
| 159 | extern const device_type WD2791; | |
| 160 | ||
| 161 | class wd2793_device : public wd1770_device | |
| 162 | { | |
| 163 | public: | |
| 164 | wd2793_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 165 | }; | |
| 166 | ||
| 167 | extern const device_type WD2793; | |
| 168 | ||
| 169 | class wd2795_device : public wd1770_device | |
| 170 | { | |
| 171 | public: | |
| 172 | wd2795_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 173 | }; | |
| 174 | ||
| 175 | extern const device_type WD2795; | |
| 176 | ||
| 177 | class wd2797_device : public wd1770_device | |
| 178 | { | |
| 179 | public: | |
| 180 | wd2797_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 181 | }; | |
| 182 | ||
| 183 | extern const device_type WD2797; | |
| 184 | ||
| 185 | class wd1772_device : public wd1770_device | |
| 186 | { | |
| 187 | public: | |
| 188 | wd1772_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 189 | protected: | |
| 190 | // device-level overrides | |
| 191 | virtual void device_start(); | |
| 192 | }; | |
| 193 | ||
| 194 | extern const device_type WD1772; | |
| 195 | ||
| 196 | class wd1773_device : public wd1770_device | |
| 197 | { | |
| 198 | public: | |
| 199 | wd1773_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 200 | }; | |
| 201 | ||
| 202 | extern const device_type WD1773; | |
| 203 | ||
| 204 | class mb8866_device : public wd1770_device | |
| 205 | { | |
| 206 | public: | |
| 207 | mb8866_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 208 | }; | |
| 209 | ||
| 210 | extern const device_type MB8866; | |
| 211 | ||
| 212 | class mb8876_device : public wd1770_device | |
| 213 | { | |
| 214 | public: | |
| 215 | mb8876_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 216 | }; | |
| 217 | ||
| 218 | extern const device_type MB8876; | |
| 219 | ||
| 220 | class mb8877_device : public wd1770_device | |
| 221 | { | |
| 222 | public: | |
| 223 | mb8877_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 224 | }; | |
| 225 | ||
| 226 | extern const device_type MB8877; | |
| 227 | ||
| 228 | ||
| 229 | ||
| 230 | ||
| 47 | 231 | /*************************************************************************** |
| 48 | 232 | TYPE DEFINITIONS |
| 49 | 233 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 31 | 31 | MACROS / CONSTANTS |
| 32 | 32 | ***************************************************************************/ |
| 33 | 33 | |
| 34 | DECLARE_LEGACY_DEVICE(ADC1038, adc1038); | |
| 34 | class adc1038_device : public device_t | |
| 35 | { | |
| 36 | public: | |
| 37 | adc1038_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 38 | ~adc1038_device() { global_free(m_token); } | |
| 35 | 39 | |
| 40 | // access to legacy token | |
| 41 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 42 | protected: | |
| 43 | // device-level overrides | |
| 44 | virtual void device_config_complete(); | |
| 45 | virtual void device_start(); | |
| 46 | virtual void device_reset(); | |
| 47 | private: | |
| 48 | // internal state | |
| 49 | void *m_token; | |
| 50 | }; | |
| 51 | ||
| 52 | extern const device_type ADC1038; | |
| 53 | ||
| 54 | ||
| 36 | 55 | #define MCFG_ADC1038_ADD(_tag, _config) \ |
| 37 | 56 | MCFG_DEVICE_ADD(_tag, ADC1038, 0) \ |
| 38 | 57 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 26 | 26 | INLINE latch8_t *get_safe_token(device_t *device) { |
| 27 | 27 | assert( device != NULL ); |
| 28 | 28 | assert( device->type() == LATCH8 ); |
| 29 | return ( latch8_t * ) downcast<l | |
| 29 | return ( latch8_t * ) downcast<l | |
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | static void update(device_t *device, UINT8 new_val, UINT8 mask) |
| r17612 | r17613 | |
| 253 | 253 | } |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | latch8_device::latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock) | |
| 257 | : legacy_device_base(mconfig, type, tag, owner, clock, DEVICE_GET_INFO_NAME(latch8)) | |
| 256 | const device_type LATCH8 = &device_creator<latch8_device>; | |
| 257 | ||
| 258 | latch8_device::latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 259 | : device_t(mconfig, LATCH8, "8 bit latch", tag, owner, clock) | |
| 258 | 260 | { |
| 261 | m_token = global_alloc_array_clear(UINT8, sizeof(latch8_t)); | |
| 259 | 262 | memset((void*)&m_inline_config,0,sizeof(m_inline_config)); |
| 260 | 263 | } |
| 261 | 264 | |
| 262 | const device_type LATCH8 = &legacy_device_creator<latch8_device>; | |
| 265 | //------------------------------------------------- | |
| 266 | // device_config_complete - perform any | |
| 267 | // operations now that the configuration is | |
| 268 | // complete | |
| 269 | //------------------------------------------------- | |
| 270 | ||
| 271 | void latch8_device::device_config_complete() | |
| 272 | { | |
| 273 | } | |
| 274 | ||
| 275 | //------------------------------------------------- | |
| 276 | // device_start - device-specific startup | |
| 277 | //------------------------------------------------- | |
| 278 | ||
| 279 | void latch8_device::device_start() | |
| 280 | { | |
| 281 | DEVICE_START_NAME( latch8 )(this); | |
| 282 | } | |
| 283 | ||
| 284 | //------------------------------------------------- | |
| 285 | // device_reset - device-specific reset | |
| 286 | //------------------------------------------------- | |
| 287 | ||
| 288 | void latch8_device::device_reset() | |
| 289 | { | |
| 290 | DEVICE_RESET_NAME( latch8 )(this); | |
| 291 | } |
| r17612 | r17613 | |
|---|---|---|
| 43 | 43 | latch8_devread devread[8]; |
| 44 | 44 | }; |
| 45 | 45 | |
| 46 | ||
| 47 | DEVICE_GET_INFO( latch8 ); | |
| 48 | ||
| 49 | class latch8_device : public legacy_device_base | |
| 46 | class latch8_device : public device_t | |
| 50 | 47 | { |
| 51 | 48 | public: |
| 52 | latch8_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | ||
| 54 | latch8_config m_inline_config; | |
| 55 | ||
| 56 | void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; } | |
| 57 | void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; } | |
| 58 | void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; } | |
| 59 | ||
| 60 | void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag; m_inline_config.node_map[bit] = node; } | |
| 61 | void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit) | |
| 62 | { | |
| 63 | m_inline_config.devread[bit].from_bit = from_bit; | |
| 64 | m_inline_config.devread[bit].tag = tag; | |
| 65 | m_inline_config.devread[bit].devread_handler = handler; | |
| 66 | } | |
| 67 | void set_read(int bit, read8_space_func handler, int from_bit) | |
| 68 | { | |
| 69 | m_inline_config.devread[bit].from_bit = from_bit; | |
| 70 | m_inline_config.devread[bit].read_handler = handler; | |
| 71 | } | |
| 49 | latch8_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | ~latch8_device() { global_free(m_token); } | |
| 51 | ||
| 52 | // access to legacy token | |
| 53 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 54 | latch8_config m_inline_config; | |
| 55 | ||
| 56 | void set_maskout(UINT32 maskout) { m_inline_config.maskout = maskout; } | |
| 57 | void set_xorvalue(UINT32 xorvalue) { m_inline_config.xorvalue = xorvalue; } | |
| 58 | void set_nosync(UINT32 nosync) { m_inline_config.nosync = nosync; } | |
| 59 | ||
| 60 | void set_discrete_node(const char *dev_tag, int bit, UINT32 node) { m_inline_config.node_device[bit] = dev_tag; m_inline_config.node_map[bit] = node; } | |
| 61 | void set_devread(int bit, const char *tag, read8_device_func handler, int from_bit) | |
| 62 | { | |
| 63 | m_inline_config.devread[bit].from_bit = from_bit; | |
| 64 | m_inline_config.devread[bit].tag = tag; | |
| 65 | m_inline_config.devread[bit].devread_handler = handler; | |
| 66 | } | |
| 67 | void set_read(int bit, read8_space_func handler, int from_bit) | |
| 68 | { | |
| 69 | m_inline_config.devread[bit].from_bit = from_bit; | |
| 70 | m_inline_config.devread[bit].read_handler = handler; | |
| 71 | } | |
| 72 | protected: | |
| 73 | // device-level overrides | |
| 74 | virtual void device_config_complete(); | |
| 75 | virtual void device_start(); | |
| 76 | virtual void device_reset(); | |
| 77 | private: | |
| 78 | // internal state | |
| 79 | void *m_token; | |
| 72 | 80 | }; |
| 73 | 81 | |
| 74 | 82 | extern const device_type LATCH8; |
| r17612 | r17613 | |
|---|---|---|
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == MB14241); |
| 25 | 25 | |
| 26 | return (mb14241_state *)downcast< | |
| 26 | return (mb14241_state *)downcast<mb14241_devic | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | /***************************************************************************** |
| r17612 | r17613 | |
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | DEFINE_LEGACY_DEVICE(MB14241, mb14241); | |
| 85 | const device_type MB14241 = &device_creator<mb14241_device>; | |
| 86 | ||
| 87 | mb14241_device::mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 88 | : device_t(mconfig, MB14241, "MB14241", tag, owner, clock) | |
| 89 | { | |
| 90 | m_token = global_alloc_array_clear(UINT8, sizeof(mb14241_state)); | |
| 91 | } | |
| 92 | ||
| 93 | //------------------------------------------------- | |
| 94 | // device_config_complete - perform any | |
| 95 | // operations now that the configuration is | |
| 96 | // complete | |
| 97 | //------------------------------------------------- | |
| 98 | ||
| 99 | void mb14241_device::device_config_complete() | |
| 100 | { | |
| 101 | } | |
| 102 | ||
| 103 | //------------------------------------------------- | |
| 104 | // device_start - device-specific startup | |
| 105 | //------------------------------------------------- | |
| 106 | ||
| 107 | void mb14241_device::device_start() | |
| 108 | { | |
| 109 | DEVICE_START_NAME( mb14241 )(this); | |
| 110 | } | |
| 111 | ||
| 112 | //------------------------------------------------- | |
| 113 | // device_reset - device-specific reset | |
| 114 | //------------------------------------------------- | |
| 115 | ||
| 116 | void mb14241_device::device_reset() | |
| 117 | { | |
| 118 | DEVICE_RESET_NAME( mb14241 )(this); | |
| 119 | } | |
| 120 | ||
| 121 |
| r17612 | r17613 | |
|---|---|---|
| 10 | 10 | #include "devlegcy.h" |
| 11 | 11 | |
| 12 | 12 | |
| 13 | DECLARE_LEGACY_DEVICE(MB14241, mb14241); | |
| 13 | class mb14241_device : public device_t | |
| 14 | { | |
| 15 | public: | |
| 16 | mb14241_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | ~mb14241_device() { global_free(m_token); } | |
| 14 | 18 | |
| 19 | // access to legacy token | |
| 20 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 21 | protected: | |
| 22 | // device-level overrides | |
| 23 | virtual void device_config_complete(); | |
| 24 | virtual void device_start(); | |
| 25 | virtual void device_reset(); | |
| 26 | private: | |
| 27 | // internal state | |
| 28 | void *m_token; | |
| 29 | }; | |
| 30 | ||
| 31 | extern const device_type MB14241; | |
| 32 | ||
| 33 | ||
| 15 | 34 | /*************************************************************************** |
| 16 | 35 | DEVICE CONFIGURATION MACROS |
| 17 | 36 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 197 | 197 | assert(device != NULL); |
| 198 | 198 | assert(device->type() == IDE_CONTROLLER); |
| 199 | 199 | |
| 200 | return (ide_state *)downcast< | |
| 200 | return (ide_state *)downcast<ide_ | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| r17612 | r17613 | |
| 1968 | 1968 | } |
| 1969 | 1969 | |
| 1970 | 1970 | |
| 1971 | ||
| 1971 | const device_type | |
| 1972 | 1972 | |
| 1973 | ide_controller_device::ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1974 | : device_t(mconfig, IDE_CONTROLLER, "IDE Controller", tag, owner, clock) | |
| 1975 | { | |
| 1976 | m_token = global_alloc_array_clear(UINT8, sizeof(ide_state)); | |
| 1977 | } | |
| 1978 | ||
| 1979 | //------------------------------------------------- | |
| 1980 | // device_config_complete - perform any | |
| 1981 | // operations now that the configuration is | |
| 1982 | // complete | |
| 1983 | //------------------------------------------------- | |
| 1984 | ||
| 1985 | void ide_controller_device::device_config_complete() | |
| 1986 | { | |
| 1987 | } | |
| 1988 | ||
| 1989 | //------------------------------------------------- | |
| 1990 | // device_start - device-specific startup | |
| 1991 | //------------------------------------------------- | |
| 1992 | ||
| 1993 | void ide_controller_device::device_start() | |
| 1994 | { | |
| 1995 | DEVICE_START_NAME( ide_controller )(this); | |
| 1996 | } | |
| 1997 | ||
| 1998 | //------------------------------------------------- | |
| 1999 | // device_reset - device-specific reset | |
| 2000 | //------------------------------------------------- | |
| 2001 | ||
| 2002 | void ide_controller_device::device_reset() | |
| 2003 | { | |
| 2004 | DEVICE_RESET_NAME( ide_controller )(this); | |
| 2005 | } | |
| 2006 | ||
| 2007 | ||
| 2008 | ||
| 1973 | 2009 | //************************************************************************** |
| 1974 | 2010 | // IDE SLOT DEVICE |
| 1975 | 2011 | //************************************************************************** |
| r17612 | r17613 | |
|---|---|---|
| 69 | 69 | assert(device != NULL); |
| 70 | 70 | assert(device->type() == TTL74148); |
| 71 | 71 | |
| 72 | return (ttl74148_state *)downcast<l | |
| 72 | return (ttl74148_state *)downcast<ttl74148_devic | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | void ttl74148_update(device_t *device) |
| r17612 | r17613 | |
| 229 | 229 | } |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | DEFINE_LEGACY_DEVICE(TTL74148, ttl74148); | |
| 232 | const device_type TTL74148 = &device_creator<ttl74148_device>; | |
| 233 | ||
| 234 | ttl74148_device::ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 235 | : device_t(mconfig, TTL74148, "74148", tag, owner, clock) | |
| 236 | { | |
| 237 | m_token = global_alloc_array_clear(UINT8, sizeof(ttl74148_state)); | |
| 238 | } | |
| 239 | ||
| 240 | //------------------------------------------------- | |
| 241 | // device_config_complete - perform any | |
| 242 | // operations now that the configuration is | |
| 243 | // complete | |
| 244 | //------------------------------------------------- | |
| 245 | ||
| 246 | void ttl74148_device::device_config_complete() | |
| 247 | { | |
| 248 | } | |
| 249 | ||
| 250 | //------------------------------------------------- | |
| 251 | // device_start - device-specific startup | |
| 252 | //------------------------------------------------- | |
| 253 | ||
| 254 | void ttl74148_device::device_start() | |
| 255 | { | |
| 256 | DEVICE_START_NAME( ttl74148 )(this); | |
| 257 | } | |
| 258 | ||
| 259 | //------------------------------------------------- | |
| 260 | // device_reset - device-specific reset | |
| 261 | //------------------------------------------------- | |
| 262 | ||
| 263 | void ttl74148_device::device_reset() | |
| 264 | { | |
| 265 | DEVICE_RESET_NAME( ttl74148 )(this); | |
| 266 | } | |
| 267 | ||
| 268 |
| r17612 | r17613 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | /* ----- device interface ----- */ |
| 188 | 188 | |
| 189 | DECLARE_LEGACY_DEVICE(IDE_CONTROLLER, ide_controller); | |
| 189 | class ide_controller_device : public device_t | |
| 190 | { | |
| 191 | public: | |
| 192 | ide_controller_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 193 | ~ide_controller_device() { global_free(m_token); } | |
| 190 | 194 | |
| 195 | // access to legacy token | |
| 196 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 197 | protected: | |
| 198 | // device-level overrides | |
| 199 | virtual void device_config_complete(); | |
| 200 | virtual void device_start(); | |
| 201 | virtual void device_reset(); | |
| 202 | private: | |
| 203 | // internal state | |
| 204 | void *m_token; | |
| 205 | }; | |
| 191 | 206 | |
| 207 | extern const device_type IDE_CONTROLLER; | |
| 208 | ||
| 209 | ||
| 210 | ||
| 192 | 211 | #endif /* __IDECTRL_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 106 | 106 | assert(device != NULL); |
| 107 | 107 | assert(device->type() == DUART68681); |
| 108 | 108 | |
| 109 | return (duart68681_state *)downcast< | |
| 109 | return (duart68681_state *)downcast<du | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | static void duart68681_update_interrupts(duart68681_state *duart68681) |
| r17612 | r17613 | |
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | 930 | |
| 931 | DEFINE_LEGACY_DEVICE(DUART68681, duart68681); | |
| 931 | const device_type DUART68681 = &device_creator<duart68681_device>; | |
| 932 | ||
| 933 | duart68681_device::duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 934 | : device_t(mconfig, DUART68681, "DUART 68681", tag, owner, clock) | |
| 935 | { | |
| 936 | m_token = global_alloc_array_clear(UINT8, sizeof(duart68681_state)); | |
| 937 | } | |
| 938 | ||
| 939 | //------------------------------------------------- | |
| 940 | // device_config_complete - perform any | |
| 941 | // operations now that the configuration is | |
| 942 | // complete | |
| 943 | //------------------------------------------------- | |
| 944 | ||
| 945 | void duart68681_device::device_config_complete() | |
| 946 | { | |
| 947 | } | |
| 948 | ||
| 949 | //------------------------------------------------- | |
| 950 | // device_start - device-specific startup | |
| 951 | //------------------------------------------------- | |
| 952 | ||
| 953 | void duart68681_device::device_start() | |
| 954 | { | |
| 955 | DEVICE_START_NAME( duart68681 )(this); | |
| 956 | } | |
| 957 | ||
| 958 | //------------------------------------------------- | |
| 959 | // device_reset - device-specific reset | |
| 960 | //------------------------------------------------- | |
| 961 | ||
| 962 | void duart68681_device::device_reset() | |
| 963 | { | |
| 964 | DEVICE_RESET_NAME( duart68681 )(this); | |
| 965 | } | |
| 966 | ||
| 967 |
| r17612 | r17613 | |
|---|---|---|
| 65 | 65 | int ttl74148_output_valid_r(device_t *device); |
| 66 | 66 | int ttl74148_enable_output_r(device_t *device); |
| 67 | 67 | |
| 68 | DECLARE_LEGACY_DEVICE(TTL74148, ttl74148); | |
| 68 | class ttl74148_device : public device_t | |
| 69 | { | |
| 70 | public: | |
| 71 | ttl74148_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 72 | ~ttl74148_device() { global_free(m_token); } | |
| 69 | 73 | |
| 74 | // access to legacy token | |
| 75 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 76 | protected: | |
| 77 | // device-level overrides | |
| 78 | virtual void device_config_complete(); | |
| 79 | virtual void device_start(); | |
| 80 | virtual void device_reset(); | |
| 81 | private: | |
| 82 | // internal state | |
| 83 | void *m_token; | |
| 84 | }; | |
| 85 | ||
| 86 | extern const device_type TTL74148; | |
| 87 | ||
| 88 | ||
| 70 | 89 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | INT32 ip3clk, ip4clk, ip5clk, ip6clk; |
| 16 | 16 | }; |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_DEVICE(DUART68681, duart68681); | |
| 18 | class duart68681_device : public device_t | |
| 19 | { | |
| 20 | public: | |
| 21 | duart68681_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~duart68681_device() { global_free(m_token); } | |
| 19 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type DUART68681; | |
| 37 | ||
| 38 | ||
| 20 | 39 | #define MCFG_DUART68681_ADD(_tag, _clock, _config) \ |
| 21 | 40 | MCFG_DEVICE_ADD(_tag, DUART68681, _clock) \ |
| 22 | 41 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 86 | 86 | { |
| 87 | 87 | assert(device != NULL); |
| 88 | 88 | assert((device->type() == UPD4990A)); |
| 89 | return (upd4990a_state *)downcast< | |
| 89 | return (upd4990a_state *)downcast<upd4990a | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | INLINE UINT8 convert_to_bcd(int val) |
| r17612 | r17613 | |
| 539 | 539 | } |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | DEFINE_LEGACY_DEVICE(UPD4990A, upd4990a); | |
| 542 | const device_type UPD4990A = &device_creator<upd4990a_device>; | |
| 543 | ||
| 544 | upd4990a_device::upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 545 | : device_t(mconfig, UPD4990A, "NEC uPD4990A", tag, owner, clock) | |
| 546 | { | |
| 547 | m_token = global_alloc_array_clear(UINT8, sizeof(upd4990a_state)); | |
| 548 | } | |
| 549 | ||
| 550 | //------------------------------------------------- | |
| 551 | // device_config_complete - perform any | |
| 552 | // operations now that the configuration is | |
| 553 | // complete | |
| 554 | //------------------------------------------------- | |
| 555 | ||
| 556 | void upd4990a_device::device_config_complete() | |
| 557 | { | |
| 558 | } | |
| 559 | ||
| 560 | //------------------------------------------------- | |
| 561 | // device_start - device-specific startup | |
| 562 | //------------------------------------------------- | |
| 563 | ||
| 564 | void upd4990a_device::device_start() | |
| 565 | { | |
| 566 | DEVICE_START_NAME( upd4990a )(this); | |
| 567 | } | |
| 568 | ||
| 569 | //------------------------------------------------- | |
| 570 | // device_reset - device-specific reset | |
| 571 | //------------------------------------------------- | |
| 572 | ||
| 573 | void upd4990a_device::device_reset() | |
| 574 | { | |
| 575 | DEVICE_RESET_NAME( upd4990a )(this); | |
| 576 | } | |
| 577 | ||
| 578 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | MACROS / CONSTANTS |
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_DEVICE(UPD4990A, upd4990a); | |
| 19 | class upd4990a_device : public device_t | |
| 20 | { | |
| 21 | public: | |
| 22 | upd4990a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | ~upd4990a_device() { global_free(m_token); } | |
| 20 | 24 | |
| 25 | // access to legacy token | |
| 26 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 27 | protected: | |
| 28 | // device-level overrides | |
| 29 | virtual void device_config_complete(); | |
| 30 | virtual void device_start(); | |
| 31 | virtual void device_reset(); | |
| 32 | private: | |
| 33 | // internal state | |
| 34 | void *m_token; | |
| 35 | }; | |
| 36 | ||
| 37 | extern const device_type UPD4990A; | |
| 38 | ||
| 39 | ||
| 21 | 40 | #define MCFG_UPD4990A_ADD(_tag) \ |
| 22 | 41 | MCFG_DEVICE_ADD(_tag, UPD4990A, 0) |
| 23 | 42 |
| r17612 | r17613 | |
|---|---|---|
| 48 | 48 | { |
| 49 | 49 | assert(device != NULL); |
| 50 | 50 | assert((device->type() == RP5H01)); |
| 51 | return (rp5h01_state *)downcast< | |
| 51 | return (rp5h01_state *)downcast<rp5h01_devic | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | /*************************************************************************** |
| r17612 | r17613 | |
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | DEFINE_LEGACY_DEVICE(RP5H01, rp5h01); | |
| 243 | const device_type RP5H01 = &device_creator<rp5h01_device>; | |
| 244 | ||
| 245 | rp5h01_device::rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 246 | : device_t(mconfig, RP5H01, "RP5H01", tag, owner, clock) | |
| 247 | { | |
| 248 | m_token = global_alloc_array_clear(UINT8, sizeof(rp5h01_state)); | |
| 249 | } | |
| 250 | ||
| 251 | //------------------------------------------------- | |
| 252 | // device_config_complete - perform any | |
| 253 | // operations now that the configuration is | |
| 254 | // complete | |
| 255 | //------------------------------------------------- | |
| 256 | ||
| 257 | void rp5h01_device::device_config_complete() | |
| 258 | { | |
| 259 | } | |
| 260 | ||
| 261 | //------------------------------------------------- | |
| 262 | // device_start - device-specific startup | |
| 263 | //------------------------------------------------- | |
| 264 | ||
| 265 | void rp5h01_device::device_start() | |
| 266 | { | |
| 267 | DEVICE_START_NAME( rp5h01 )(this); | |
| 268 | } | |
| 269 | ||
| 270 | //------------------------------------------------- | |
| 271 | // device_reset - device-specific reset | |
| 272 | //------------------------------------------------- | |
| 273 | ||
| 274 | void rp5h01_device::device_reset() | |
| 275 | { | |
| 276 | DEVICE_RESET_NAME( rp5h01 )(this); | |
| 277 | } | |
| 278 | ||
| 279 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | MACROS / CONSTANTS |
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_DEVICE(RP5H01, rp5h01); | |
| 17 | class rp5h01_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | rp5h01_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~rp5h01_device() { global_free(m_token); } | |
| 18 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_reset(); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type RP5H01; | |
| 36 | ||
| 37 | ||
| 19 | 38 | #define MCFG_RP5H01_ADD(_tag) \ |
| 20 | 39 | MCFG_DEVICE_ADD(_tag, RP5H01, 0) |
| 21 | 40 |
| r17612 | r17613 | |
|---|---|---|
| 141 | 141 | assert(device != NULL); |
| 142 | 142 | assert(device->type() == TPI6525); |
| 143 | 143 | |
| 144 | return (tpi6525_state *)downcast< | |
| 144 | return (tpi6525_state *)downcast<tpi6525_devic | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| r17612 | r17613 | |
| 619 | 619 | return tpi6525->ddr_c; |
| 620 | 620 | } |
| 621 | 621 | |
| 622 | DEFINE_LEGACY_DEVICE(TPI6525, tpi6525); | |
| 622 | const device_type TPI6525 = &device_creator<tpi6525_device>; | |
| 623 | ||
| 624 | tpi6525_device::tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 625 | : device_t(mconfig, TPI6525, "6525 TPI", tag, owner, clock) | |
| 626 | { | |
| 627 | m_token = global_alloc_array_clear(UINT8, sizeof(tpi6525_state)); | |
| 628 | } | |
| 629 | ||
| 630 | //------------------------------------------------- | |
| 631 | // device_config_complete - perform any | |
| 632 | // operations now that the configuration is | |
| 633 | // complete | |
| 634 | //------------------------------------------------- | |
| 635 | ||
| 636 | void tpi6525_device::device_config_complete() | |
| 637 | { | |
| 638 | } | |
| 639 | ||
| 640 | //------------------------------------------------- | |
| 641 | // device_start - device-specific startup | |
| 642 | //------------------------------------------------- | |
| 643 | ||
| 644 | void tpi6525_device::device_start() | |
| 645 | { | |
| 646 | DEVICE_START_NAME( tpi6525 )(this); | |
| 647 | } | |
| 648 | ||
| 649 | //------------------------------------------------- | |
| 650 | // device_reset - device-specific reset | |
| 651 | //------------------------------------------------- | |
| 652 | ||
| 653 | void tpi6525_device::device_reset() | |
| 654 | { | |
| 655 | DEVICE_RESET_NAME( tpi6525 )(this); | |
| 656 | } | |
| 657 | ||
| 658 |
| r17612 | r17613 | |
|---|---|---|
| 57 | 57 | DEVICE CONFIGURATION MACROS |
| 58 | 58 | ***************************************************************************/ |
| 59 | 59 | |
| 60 | DECLARE_LEGACY_DEVICE(TPI6525, tpi6525); | |
| 60 | class tpi6525_device : public device_t | |
| 61 | { | |
| 62 | public: | |
| 63 | tpi6525_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 64 | ~tpi6525_device() { global_free(m_token); } | |
| 61 | 65 | |
| 66 | // access to legacy token | |
| 67 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 68 | protected: | |
| 69 | // device-level overrides | |
| 70 | virtual void device_config_complete(); | |
| 71 | virtual void device_start(); | |
| 72 | virtual void device_reset(); | |
| 73 | private: | |
| 74 | // internal state | |
| 75 | void *m_token; | |
| 76 | }; | |
| 77 | ||
| 78 | extern const device_type TPI6525; | |
| 79 | ||
| 80 | ||
| 62 | 81 | #define MCFG_TPI6525_ADD(_tag, _intrf) \ |
| 63 | 82 | MCFG_DEVICE_ADD(_tag, TPI6525, 0) \ |
| 64 | 83 | MCFG_DEVICE_CONFIG(_intrf) |
| r17612 | r17613 | |
|---|---|---|
| 82 | 82 | assert(device != NULL); |
| 83 | 83 | assert(device->type() == K053252); |
| 84 | 84 | |
| 85 | return (k053252_state *)downcast< | |
| 85 | return (k053252_state *)downcast<k053252_devic | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | INLINE const k053252_interface *k053252_get_interface( device_t *device ) |
| r17612 | r17613 | |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | ||
| 255 | const device_type | |
| 256 | 256 | |
| 257 | k053252_device::k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 258 | : device_t(mconfig, K053252, "Konami 053252", tag, owner, clock) | |
| 259 | { | |
| 260 | m_token = global_alloc_array_clear(UINT8, sizeof(k053252_state)); | |
| 261 | } | |
| 262 | ||
| 263 | //------------------------------------------------- | |
| 264 | // device_config_complete - perform any | |
| 265 | // operations now that the configuration is | |
| 266 | // complete | |
| 267 | //------------------------------------------------- | |
| 268 | ||
| 269 | void k053252_device::device_config_complete() | |
| 270 | { | |
| 271 | } | |
| 272 | ||
| 273 | //------------------------------------------------- | |
| 274 | // device_start - device-specific startup | |
| 275 | //------------------------------------------------- | |
| 276 | ||
| 277 | void k053252_device::device_start() | |
| 278 | { | |
| 279 | DEVICE_START_NAME( k053252 )(this); | |
| 280 | } | |
| 281 | ||
| 282 | //------------------------------------------------- | |
| 283 | // device_reset - device-specific reset | |
| 284 | //------------------------------------------------- | |
| 285 | ||
| 286 | void k053252_device::device_reset() | |
| 287 | { | |
| 288 | DEVICE_RESET_NAME( k053252 )(this); | |
| 289 | } | |
| 290 | ||
| 291 | ||
| 292 |
| r17612 | r17613 | |
|---|---|---|
| 116 | 116 | assert(device != NULL); |
| 117 | 117 | assert(device->type() == MB87078); |
| 118 | 118 | |
| 119 | return (mb87078_state *)downcast< | |
| 119 | return (mb87078_state *)downcast<mb87078_devic | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | INLINE const mb87078_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 280 | 280 | } |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | DEFINE_LEGACY_DEVICE(MB87078, mb87078); | |
| 283 | const device_type MB87078 = &device_creator<mb87078_device>; | |
| 284 | ||
| 285 | mb87078_device::mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 286 | : device_t(mconfig, MB87078, "Fujitsu MB87078", tag, owner, clock) | |
| 287 | { | |
| 288 | m_token = global_alloc_array_clear(UINT8, sizeof(mb87078_state)); | |
| 289 | } | |
| 290 | ||
| 291 | //------------------------------------------------- | |
| 292 | // device_config_complete - perform any | |
| 293 | // operations now that the configuration is | |
| 294 | // complete | |
| 295 | //------------------------------------------------- | |
| 296 | ||
| 297 | void mb87078_device::device_config_complete() | |
| 298 | { | |
| 299 | } | |
| 300 | ||
| 301 | //------------------------------------------------- | |
| 302 | // device_start - device-specific startup | |
| 303 | //------------------------------------------------- | |
| 304 | ||
| 305 | void mb87078_device::device_start() | |
| 306 | { | |
| 307 | DEVICE_START_NAME( mb87078 )(this); | |
| 308 | } | |
| 309 | ||
| 310 | //------------------------------------------------- | |
| 311 | // device_reset - device-specific reset | |
| 312 | //------------------------------------------------- | |
| 313 | ||
| 314 | void mb87078_device::device_reset() | |
| 315 | { | |
| 316 | DEVICE_RESET_NAME( mb87078 )(this); | |
| 317 | } | |
| 318 | ||
| 319 |
| r17612 | r17613 | |
|---|---|---|
| 107 | 107 | assert(device != NULL); |
| 108 | 108 | assert((device->type() == PIT8253) || (device->type() == PIT8254)); |
| 109 | 109 | |
| 110 | return (pit8253_t *) downcast< | |
| 110 | return (pit8253_t *) downcast<pit8253_devic | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r17612 | r17613 | |
| 1188 | 1188 | } |
| 1189 | 1189 | |
| 1190 | 1190 | |
| 1191 | DEFINE_LEGACY_DEVICE(PIT8253, pit8253); | |
| 1192 | DEFINE_LEGACY_DEVICE(PIT8254, pit8254); | |
| 1191 | const device_type PIT8253 = &device_creator<pit8253_device>; | |
| 1192 | ||
| 1193 | pit8253_device::pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1194 | : device_t(mconfig, PIT8253, "Intel PIT8253", tag, owner, clock) | |
| 1195 | { | |
| 1196 | m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t)); | |
| 1197 | } | |
| 1198 | pit8253_device::pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 1199 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 1200 | { | |
| 1201 | m_token = global_alloc_array_clear(UINT8, sizeof(pit8253_t)); | |
| 1202 | } | |
| 1203 | ||
| 1204 | //------------------------------------------------- | |
| 1205 | // device_config_complete - perform any | |
| 1206 | // operations now that the configuration is | |
| 1207 | // complete | |
| 1208 | //------------------------------------------------- | |
| 1209 | ||
| 1210 | void pit8253_device::device_config_complete() | |
| 1211 | { | |
| 1212 | } | |
| 1213 | ||
| 1214 | //------------------------------------------------- | |
| 1215 | // device_start - device-specific startup | |
| 1216 | //------------------------------------------------- | |
| 1217 | ||
| 1218 | void pit8253_device::device_start() | |
| 1219 | { | |
| 1220 | DEVICE_START_NAME( pit8253 )(this); | |
| 1221 | } | |
| 1222 | ||
| 1223 | //------------------------------------------------- | |
| 1224 | // device_reset - device-specific reset | |
| 1225 | //------------------------------------------------- | |
| 1226 | ||
| 1227 | void pit8253_device::device_reset() | |
| 1228 | { | |
| 1229 | DEVICE_RESET_NAME( pit8253 )(this); | |
| 1230 | } | |
| 1231 | ||
| 1232 | ||
| 1233 | const device_type PIT8254 = &device_creator<pit8254_device>; | |
| 1234 | ||
| 1235 | pit8254_device::pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1236 | : pit8253_device(mconfig, PIT8254, "Intel PIT8254", tag, owner, clock) | |
| 1237 | { | |
| 1238 | } | |
| 1239 | ||
| 1240 | //------------------------------------------------- | |
| 1241 | // device_start - device-specific startup | |
| 1242 | //------------------------------------------------- | |
| 1243 | ||
| 1244 | void pit8254_device::device_start() | |
| 1245 | { | |
| 1246 | DEVICE_START_NAME( pit8254 )(this); | |
| 1247 | } | |
| 1248 | ||
| 1249 |
| r17612 | r17613 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | #include "devlegcy.h" |
| 9 | 9 | |
| 10 | DECLARE_LEGACY_DEVICE(K053252, k053252); | |
| 10 | class k053252_device : public device_t | |
| 11 | { | |
| 12 | public: | |
| 13 | k053252_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 14 | ~k053252_device() { global_free(m_token); } | |
| 11 | 15 | |
| 16 | // access to legacy token | |
| 17 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 18 | protected: | |
| 19 | // device-level overrides | |
| 20 | virtual void device_config_complete(); | |
| 21 | virtual void device_start(); | |
| 22 | virtual void device_reset(); | |
| 23 | private: | |
| 24 | // internal state | |
| 25 | void *m_token; | |
| 26 | }; | |
| 12 | 27 | |
| 28 | extern const device_type K053252; | |
| 13 | 29 | |
| 30 | ||
| 31 | ||
| 32 | ||
| 14 | 33 | typedef struct _k053252_interface k053252_interface; |
| 15 | 34 | struct _k053252_interface |
| 16 | 35 | { |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | mb87078_gain_changed_cb gain_changed_cb; |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_DEVICE(MB87078, mb87078); | |
| 27 | class mb87078_device : public device_t | |
| 28 | { | |
| 29 | public: | |
| 30 | mb87078_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ~mb87078_device() { global_free(m_token); } | |
| 28 | 32 | |
| 33 | // access to legacy token | |
| 34 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_config_complete(); | |
| 38 | virtual void device_start(); | |
| 39 | virtual void device_reset(); | |
| 40 | private: | |
| 41 | // internal state | |
| 42 | void *m_token; | |
| 43 | }; | |
| 44 | ||
| 45 | extern const device_type MB87078; | |
| 46 | ||
| 47 | ||
| 29 | 48 | /*************************************************************************** |
| 30 | 49 | DEVICE CONFIGURATION MACROS |
| 31 | 50 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 37 | 37 | } timer[3]; |
| 38 | 38 | }; |
| 39 | 39 | |
| 40 | DECLARE_LEGACY_DEVICE(PIT8253, pit8253); | |
| 41 | DECLARE_LEGACY_DEVICE(PIT8254, pit8254); | |
| 40 | class pit8253_device : public device_t | |
| 41 | { | |
| 42 | public: | |
| 43 | pit8253_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 44 | pit8253_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | ~pit8253_device() { global_free(m_token); } | |
| 42 | 46 | |
| 47 | // access to legacy token | |
| 48 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 49 | protected: | |
| 50 | // device-level overrides | |
| 51 | virtual void device_config_complete(); | |
| 52 | virtual void device_start(); | |
| 53 | virtual void device_reset(); | |
| 54 | private: | |
| 55 | // internal state | |
| 56 | void *m_token; | |
| 57 | }; | |
| 43 | 58 | |
| 59 | extern const device_type PIT8253; | |
| 60 | ||
| 61 | class pit8254_device : public pit8253_device | |
| 62 | { | |
| 63 | public: | |
| 64 | pit8254_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 65 | protected: | |
| 66 | // device-level overrides | |
| 67 | virtual void device_start(); | |
| 68 | }; | |
| 69 | ||
| 70 | extern const device_type PIT8254; | |
| 71 | ||
| 72 | ||
| 73 | ||
| 44 | 74 | /*************************************************************************** |
| 45 | 75 | DEVICE CONFIGURATION MACROS |
| 46 | 76 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | assert(device != NULL); |
| 54 | 54 | assert(device->type() == WSWAN); |
| 55 | return (wswan_sound_state *)downcast< | |
| 55 | return (wswan_sound_state *)downcast<wswan | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | static void wswan_ch_set_freq( running_machine &machine, struct CHAN *ch, UINT16 freq ) |
| r17612 | r17613 | |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | DEFINE_LEGACY_SOUND_DEVICE(WSWAN, wswan_sound); | |
| 268 | const device_type WSWAN = &device_creator<wswan_sound_device>; | |
| 269 | ||
| 270 | wswan_sound_device::wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 271 | : device_t(mconfig, WSWAN, "WonderSwan Custom", tag, owner, clock), | |
| 272 | device_sound_interface(mconfig, *this) | |
| 273 | { | |
| 274 | m_token = global_alloc_array_clear(UINT8, sizeof(wswan_sound_state)); | |
| 275 | } | |
| 276 | ||
| 277 | //------------------------------------------------- | |
| 278 | // device_config_complete - perform any | |
| 279 | // operations now that the configuration is | |
| 280 | // complete | |
| 281 | //------------------------------------------------- | |
| 282 | ||
| 283 | void wswan_sound_device::device_config_complete() | |
| 284 | { | |
| 285 | } | |
| 286 | ||
| 287 | //------------------------------------------------- | |
| 288 | // device_start - device-specific startup | |
| 289 | //------------------------------------------------- | |
| 290 | ||
| 291 | void wswan_sound_device::device_start() | |
| 292 | { | |
| 293 | DEVICE_START_NAME( wswan_sound )(this); | |
| 294 | } | |
| 295 | ||
| 296 | //------------------------------------------------- | |
| 297 | // sound_stream_update - handle a stream update | |
| 298 | //------------------------------------------------- | |
| 299 | ||
| 300 | void wswan_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 301 | { | |
| 302 | // should never get here | |
| 303 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 304 | } | |
| 305 | ||
| 306 |
| r17612 | r17613 | |
|---|---|---|
| 52 | 52 | { |
| 53 | 53 | assert(device != NULL); |
| 54 | 54 | assert(device->type() == MAC_SOUND); |
| 55 | return (mac_sound *) downcast< | |
| 55 | return (mac_sound *) downcast<m | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| r17612 | r17613 | |
| 204 | 204 | } |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | DEFINE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound); | |
| 207 | const device_type MAC_SOUND = &device_creator<mac_sound_device>; | |
| 208 | ||
| 209 | mac_sound_device::mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 210 | : device_t(mconfig, MAC_SOUND, "Mac Custom", tag, owner, clock), | |
| 211 | device_sound_interface(mconfig, *this) | |
| 212 | { | |
| 213 | m_token = global_alloc_array_clear(UINT8, sizeof(mac_sound)); | |
| 214 | } | |
| 215 | ||
| 216 | //------------------------------------------------- | |
| 217 | // device_config_complete - perform any | |
| 218 | // operations now that the configuration is | |
| 219 | // complete | |
| 220 | //------------------------------------------------- | |
| 221 | ||
| 222 | void mac_sound_device::device_config_complete() | |
| 223 | { | |
| 224 | } | |
| 225 | ||
| 226 | //------------------------------------------------- | |
| 227 | // device_start - device-specific startup | |
| 228 | //------------------------------------------------- | |
| 229 | ||
| 230 | void mac_sound_device::device_start() | |
| 231 | { | |
| 232 | DEVICE_START_NAME( mac_sound )(this); | |
| 233 | } | |
| 234 | ||
| 235 | //------------------------------------------------- | |
| 236 | // sound_stream_update - handle a stream update | |
| 237 | //------------------------------------------------- | |
| 238 | ||
| 239 | void mac_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 240 | { | |
| 241 | // should never get here | |
| 242 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 243 | } | |
| 244 | ||
| 245 |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | { |
| 20 | 20 | assert(device != NULL); |
| 21 | 21 | assert(device->type() == GMASTER); |
| 22 | return (gmaster_sound *) downcast< | |
| 22 | return (gmaster_sound *) downcast< | |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | |
| r17612 | r17613 | |
| 83 | 83 | } |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | DEFINE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound); | |
| 86 | const device_type GMASTER = &device_creator<gmaster_sound_device>; | |
| 87 | ||
| 88 | gmaster_sound_device::gmaster_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 89 | : device_t(mconfig, GMASTER, "Game Master Custom", tag, owner, clock), | |
| 90 | device_sound_interface(mconfig, *this) | |
| 91 | { | |
| 92 | m_token = global_alloc_array_clear(UINT8, sizeof(gmaster_sound)); | |
| 93 | } | |
| 94 | ||
| 95 | //------------------------------------------------- | |
| 96 | // device_config_complete - perform any | |
| 97 | // operations now that the configuration is | |
| 98 | // complete | |
| 99 | //------------------------------------------------- | |
| 100 | ||
| 101 | void gmaster_sound_device::device_config_complete() | |
| 102 | { | |
| 103 | } | |
| 104 | ||
| 105 | //------------------------------------------------- | |
| 106 | // device_start - device-specific startup | |
| 107 | //------------------------------------------------- | |
| 108 | ||
| 109 | void gmaster_sound_device::device_start() | |
| 110 | { | |
| 111 | DEVICE_START_NAME( gmaster_sound )(this); | |
| 112 | } | |
| 113 | ||
| 114 | //------------------------------------------------- | |
| 115 | // sound_stream_update - handle a stream update | |
| 116 | //------------------------------------------------- | |
| 117 | ||
| 118 | void gmaster_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 119 | { | |
| 120 | // should never get here | |
| 121 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 122 | } | |
| 123 | ||
| 124 |
| r17612 | r17613 | |
|---|---|---|
| 159 | 159 | { |
| 160 | 160 | assert(device != NULL); |
| 161 | 161 | assert(device->type() == UPD1771C); |
| 162 | return (upd1771_state *)downcast< | |
| 162 | return (upd1771_state *)downcast<upd1771c | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| r17612 | r17613 | |
| 480 | 480 | } |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | ||
| 483 | const device_type | |
| 484 | 484 | |
| 485 | upd1771c_device::upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 486 | : device_t(mconfig, UPD1771C, "NEC uPD1771C 017", tag, owner, clock), | |
| 487 | device_sound_interface(mconfig, *this) | |
| 488 | { | |
| 489 | m_token = global_alloc_array_clear(UINT8, sizeof(upd1771_state)); | |
| 490 | } | |
| 491 | ||
| 492 | //------------------------------------------------- | |
| 493 | // device_config_complete - perform any | |
| 494 | // operations now that the configuration is | |
| 495 | // complete | |
| 496 | //------------------------------------------------- | |
| 497 | ||
| 498 | void upd1771c_device::device_config_complete() | |
| 499 | { | |
| 500 | } | |
| 501 | ||
| 502 | //------------------------------------------------- | |
| 503 | // device_start - device-specific startup | |
| 504 | //------------------------------------------------- | |
| 505 | ||
| 506 | void upd1771c_device::device_start() | |
| 507 | { | |
| 508 | DEVICE_START_NAME( upd1771c )(this); | |
| 509 | } | |
| 510 | ||
| 511 | //------------------------------------------------- | |
| 512 | // device_reset - device-specific reset | |
| 513 | //------------------------------------------------- | |
| 514 | ||
| 515 | void upd1771c_device::device_reset() | |
| 516 | { | |
| 517 | DEVICE_RESET_NAME( upd1771c )(this); | |
| 518 | } | |
| 519 | ||
| 520 | //------------------------------------------------- | |
| 521 | // device_stop - device-specific stop | |
| 522 | //------------------------------------------------- | |
| 523 | ||
| 524 | void upd1771c_device::device_stop() | |
| 525 | { | |
| 526 | DEVICE_STOP_NAME( upd1771c )(this); | |
| 527 | } | |
| 528 | ||
| 529 | //------------------------------------------------- | |
| 530 | // sound_stream_update - handle a stream update | |
| 531 | //------------------------------------------------- | |
| 532 | ||
| 533 | void upd1771c_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 534 | { | |
| 535 | // should never get here | |
| 536 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 537 | } | |
| 538 | ||
| 539 | ||
| 540 |
| r17612 | r17613 | |
|---|---|---|
| 126 | 126 | { |
| 127 | 127 | assert( device != NULL ); |
| 128 | 128 | assert( device->type() == MEA8000); |
| 129 | return (mea8000_t*) downcast< | |
| 129 | return (mea8000_t*) downcast<me | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| r17612 | r17613 | |
| 722 | 722 | } |
| 723 | 723 | } |
| 724 | 724 | |
| 725 | DEFINE_LEGACY_DEVICE(MEA8000, mea8000); | |
| 725 | const device_type MEA8000 = &device_creator<mea8000_device>; | |
| 726 | ||
| 727 | mea8000_device::mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 728 | : device_t(mconfig, MEA8000, "Philips / Signetics MEA 8000 speech synthesizer", tag, owner, clock) | |
| 729 | { | |
| 730 | m_token = global_alloc_array_clear(UINT8, sizeof(mea8000_t)); | |
| 731 | } | |
| 732 | ||
| 733 | //------------------------------------------------- | |
| 734 | // device_config_complete - perform any | |
| 735 | // operations now that the configuration is | |
| 736 | // complete | |
| 737 | //------------------------------------------------- | |
| 738 | ||
| 739 | void mea8000_device::device_config_complete() | |
| 740 | { | |
| 741 | } | |
| 742 | ||
| 743 | //------------------------------------------------- | |
| 744 | // device_start - device-specific startup | |
| 745 | //------------------------------------------------- | |
| 746 | ||
| 747 | void mea8000_device::device_start() | |
| 748 | { | |
| 749 | DEVICE_START_NAME( mea8000 )(this); | |
| 750 | } | |
| 751 | ||
| 752 | //------------------------------------------------- | |
| 753 | // device_reset - device-specific reset | |
| 754 | //------------------------------------------------- | |
| 755 | ||
| 756 | void mea8000_device::device_reset() | |
| 757 | { | |
| 758 | DEVICE_RESET_NAME( mea8000 )(this); | |
| 759 | } | |
| 760 | ||
| 761 |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == VC4000); |
| 25 | return (vc4000_sound *) downcast< | |
| 25 | return (vc4000_sound *) downcast<v | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | |
| r17612 | r17613 | |
| 99 | 99 | } |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | DEFINE_LEGACY_SOUND_DEVICE(VC4000, vc4000_sound); | |
| 102 | const device_type VC4000 = &device_creator<vc4000_sound_device>; | |
| 103 | ||
| 104 | vc4000_sound_device::vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 105 | : device_t(mconfig, VC4000, "VC 4000 Custom", tag, owner, clock), | |
| 106 | device_sound_interface(mconfig, *this) | |
| 107 | { | |
| 108 | m_token = global_alloc_array_clear(UINT8, sizeof(vc4000_sound)); | |
| 109 | } | |
| 110 | ||
| 111 | //------------------------------------------------- | |
| 112 | // device_config_complete - perform any | |
| 113 | // operations now that the configuration is | |
| 114 | // complete | |
| 115 | //------------------------------------------------- | |
| 116 | ||
| 117 | void vc4000_sound_device::device_config_complete() | |
| 118 | { | |
| 119 | } | |
| 120 | ||
| 121 | //------------------------------------------------- | |
| 122 | // device_start - device-specific startup | |
| 123 | //------------------------------------------------- | |
| 124 | ||
| 125 | void vc4000_sound_device::device_start() | |
| 126 | { | |
| 127 | DEVICE_START_NAME( vc4000_sound )(this); | |
| 128 | } | |
| 129 | ||
| 130 | //------------------------------------------------- | |
| 131 | // sound_stream_update - handle a stream update | |
| 132 | //------------------------------------------------- | |
| 133 | ||
| 134 | void vc4000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 135 | { | |
| 136 | // should never get here | |
| 137 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 138 | } | |
| 139 | ||
| 140 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | MACROS / CONSTANTS |
| 25 | 25 | ***************************************************************************/ |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_SOUND_DEVICE(UPD1771C, upd1771c); | |
| 27 | class upd1771c_device : public device_t, | |
| 28 | public device_sound_interface | |
| 29 | { | |
| 30 | public: | |
| 31 | upd1771c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 32 | ~upd1771c_device() { global_free(m_token); } | |
| 28 | 33 | |
| 34 | // access to legacy token | |
| 35 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_config_complete(); | |
| 39 | virtual void device_start(); | |
| 40 | virtual void device_stop(); | |
| 41 | virtual void device_reset(); | |
| 29 | 42 | |
| 43 | // sound stream update overrides | |
| 44 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type UPD1771C; | |
| 51 | ||
| 52 | ||
| 53 | ||
| 30 | 54 | /*************************************************************************** |
| 31 | 55 | PROTOTYPES |
| 32 | 56 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | { |
| 21 | 21 | assert(device != NULL); |
| 22 | 22 | assert(device->type() == CHANNELF); |
| 23 | return (channelf_sound_state *)downcast< | |
| 23 | return (channelf_sound_state *)downcast< | |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | void channelf_sound_w(device_t *device, int mode) |
| r17612 | r17613 | |
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | DEFINE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound); | |
| 152 | const device_type CHANNELF = &device_creator<channelf_sound_device>; | |
| 153 | ||
| 154 | channelf_sound_device::channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 155 | : device_t(mconfig, CHANNELF, "Channel F", tag, owner, clock), | |
| 156 | device_sound_interface(mconfig, *this) | |
| 157 | { | |
| 158 | m_token = global_alloc_array_clear(UINT8, sizeof(channelf_sound_state)); | |
| 159 | } | |
| 160 | ||
| 161 | //------------------------------------------------- | |
| 162 | // device_config_complete - perform any | |
| 163 | // operations now that the configuration is | |
| 164 | // complete | |
| 165 | //------------------------------------------------- | |
| 166 | ||
| 167 | void channelf_sound_device::device_config_complete() | |
| 168 | { | |
| 169 | } | |
| 170 | ||
| 171 | //------------------------------------------------- | |
| 172 | // device_start - device-specific startup | |
| 173 | //------------------------------------------------- | |
| 174 | ||
| 175 | void channelf_sound_device::device_start() | |
| 176 | { | |
| 177 | DEVICE_START_NAME( channelf_sound )(this); | |
| 178 | } | |
| 179 | ||
| 180 | //------------------------------------------------- | |
| 181 | // sound_stream_update - handle a stream update | |
| 182 | //------------------------------------------------- | |
| 183 | ||
| 184 | void channelf_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 185 | { | |
| 186 | // should never get here | |
| 187 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 188 | } | |
| 189 | ||
| 190 |
| r17612 | r17613 | |
|---|---|---|
| 100 | 100 | { |
| 101 | 101 | assert(device != NULL); |
| 102 | 102 | assert(device->type() == DAVE); |
| 103 | return (dave_t *) downcast< | |
| 103 | return (dave_t *) downcast<d | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| r17612 | r17613 | |
| 834 | 834 | } |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | DEFINE_LEGACY_SOUND_DEVICE(DAVE, dave_sound); | |
| 837 | const device_type DAVE = &device_creator<dave_sound_device>; | |
| 838 | ||
| 839 | dave_sound_device::dave_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 840 | : device_t(mconfig, DAVE, "Dave", tag, owner, clock), | |
| 841 | device_sound_interface(mconfig, *this) | |
| 842 | { | |
| 843 | m_token = global_alloc_array_clear(UINT8, sizeof(dave_t)); | |
| 844 | } | |
| 845 | ||
| 846 | //------------------------------------------------- | |
| 847 | // device_config_complete - perform any | |
| 848 | // operations now that the configuration is | |
| 849 | // complete | |
| 850 | //------------------------------------------------- | |
| 851 | ||
| 852 | void dave_sound_device::device_config_complete() | |
| 853 | { | |
| 854 | } | |
| 855 | ||
| 856 | //------------------------------------------------- | |
| 857 | // device_start - device-specific startup | |
| 858 | //------------------------------------------------- | |
| 859 | ||
| 860 | void dave_sound_device::device_start() | |
| 861 | { | |
| 862 | DEVICE_START_NAME( dave_sound )(this); | |
| 863 | } | |
| 864 | ||
| 865 | //------------------------------------------------- | |
| 866 | // device_reset - device-specific reset | |
| 867 | //------------------------------------------------- | |
| 868 | ||
| 869 | void dave_sound_device::device_reset() | |
| 870 | { | |
| 871 | DEVICE_RESET_NAME( dave_sound )(this); | |
| 872 | } | |
| 873 | ||
| 874 | //------------------------------------------------- | |
| 875 | // sound_stream_update - handle a stream update | |
| 876 | //------------------------------------------------- | |
| 877 | ||
| 878 | void dave_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 879 | { | |
| 880 | // should never get here | |
| 881 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 882 | } | |
| 883 | ||
| 884 |
| r17612 | r17613 | |
|---|---|---|
| 11 | 11 | |
| 12 | 12 | #include "devlegcy.h" |
| 13 | 13 | |
| 14 | DECLARE_LEGACY_DEVICE(MEA8000, mea8000); | |
| 14 | class mea8000_device : public device_t | |
| 15 | { | |
| 16 | public: | |
| 17 | mea8000_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~mea8000_device() { global_free(m_token); } | |
| 15 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | virtual void device_reset(); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type MEA8000; | |
| 33 | ||
| 34 | ||
| 16 | 35 | /* ---------- configuration ------------ */ |
| 17 | 36 | |
| 18 | 37 | typedef struct _mea8000_interface mea8000_interface; |
| r17612 | r17613 | |
|---|---|---|
| 22 | 22 | { |
| 23 | 23 | assert(device != NULL); |
| 24 | 24 | assert(device->type() == SPECIMX); |
| 25 | return (specimx_sound_state *)downcast< | |
| 25 | return (specimx_sound_state *)downcast<spe | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | static DEVICE_START(specimx_sound) |
| r17612 | r17613 | |
| 88 | 88 | } |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | DEFINE_LEGACY_SOUND_DEVICE(SPECIMX, specimx_sound); | |
| 91 | const device_type SPECIMX = &device_creator<specimx_sound_device>; | |
| 92 | ||
| 93 | specimx_sound_device::specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 94 | : device_t(mconfig, SPECIMX, "Specialist MX Custom", tag, owner, clock), | |
| 95 | device_sound_interface(mconfig, *this) | |
| 96 | { | |
| 97 | m_token = global_alloc_array_clear(UINT8, sizeof(specimx_sound_state)); | |
| 98 | } | |
| 99 | ||
| 100 | //------------------------------------------------- | |
| 101 | // device_config_complete - perform any | |
| 102 | // operations now that the configuration is | |
| 103 | // complete | |
| 104 | //------------------------------------------------- | |
| 105 | ||
| 106 | void specimx_sound_device::device_config_complete() | |
| 107 | { | |
| 108 | } | |
| 109 | ||
| 110 | //------------------------------------------------- | |
| 111 | // device_start - device-specific startup | |
| 112 | //------------------------------------------------- | |
| 113 | ||
| 114 | void specimx_sound_device::device_start() | |
| 115 | { | |
| 116 | DEVICE_START_NAME( specimx_sound )(this); | |
| 117 | } | |
| 118 | ||
| 119 | //------------------------------------------------- | |
| 120 | // sound_stream_update - handle a stream update | |
| 121 | //------------------------------------------------- | |
| 122 | ||
| 123 | void specimx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 124 | { | |
| 125 | // should never get here | |
| 126 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 127 | } | |
| 128 | ||
| 129 |
| r17612 | r17613 | |
|---|---|---|
| 27 | 27 | { |
| 28 | 28 | assert(device != NULL); |
| 29 | 29 | assert(device->type() == SOCRATES); |
| 30 | return (SocratesASIC *)downcast< | |
| 30 | return (SocratesASIC *)downcast<so | |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | static const UINT8 volumeLUT[16] = |
| r17612 | r17613 | |
| 162 | 162 | } |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | DEFINE_LEGACY_SOUND_DEVICE(SOCRATES, socrates_snd); | |
| 165 | const device_type SOCRATES = &device_creator<socrates_snd_device>; | |
| 166 | ||
| 167 | socrates_snd_device::socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 168 | : device_t(mconfig, SOCRATES, "Socrates Sound", tag, owner, clock), | |
| 169 | device_sound_interface(mconfig, *this) | |
| 170 | { | |
| 171 | m_token = global_alloc_array_clear(UINT8, sizeof(SocratesASIC)); | |
| 172 | } | |
| 173 | ||
| 174 | //------------------------------------------------- | |
| 175 | // device_config_complete - perform any | |
| 176 | // operations now that the configuration is | |
| 177 | // complete | |
| 178 | //------------------------------------------------- | |
| 179 | ||
| 180 | void socrates_snd_device::device_config_complete() | |
| 181 | { | |
| 182 | } | |
| 183 | ||
| 184 | //------------------------------------------------- | |
| 185 | // device_start - device-specific startup | |
| 186 | //------------------------------------------------- | |
| 187 | ||
| 188 | void socrates_snd_device::device_start() | |
| 189 | { | |
| 190 | DEVICE_START_NAME( socrates_snd )(this); | |
| 191 | } | |
| 192 | ||
| 193 | //------------------------------------------------- | |
| 194 | // sound_stream_update - handle a stream update | |
| 195 | //------------------------------------------------- | |
| 196 | ||
| 197 | void socrates_snd_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 198 | { | |
| 199 | // should never get here | |
| 200 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 201 | } | |
| 202 | ||
| 203 |
| r17612 | r17613 | |
|---|---|---|
| 103 | 103 | assert(device != NULL); |
| 104 | 104 | assert(device->type() == T6721); |
| 105 | 105 | |
| 106 | return (t6721_state *)downcast< | |
| 106 | return (t6721_state *)downcast<t6721 | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | /***************************************************************************** |
| r17612 | r17613 | |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | DEFINE_LEGACY_DEVICE(T6721, t6721); | |
| 306 | const device_type T6721 = &device_creator<t6721_device>; | |
| 307 | ||
| 308 | t6721_device::t6721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 309 | : device_t(mconfig, T6721, "Toshiba 6721A", tag, owner, clock) | |
| 310 | { | |
| 311 | m_token = global_alloc_array_clear(UINT8, sizeof(t6721_state)); | |
| 312 | } | |
| 313 | ||
| 314 | //------------------------------------------------- | |
| 315 | // device_config_complete - perform any | |
| 316 | // operations now that the configuration is | |
| 317 | // complete | |
| 318 | //------------------------------------------------- | |
| 319 | ||
| 320 | void t6721_device::device_config_complete() | |
| 321 | { | |
| 322 | } | |
| 323 | ||
| 324 | //------------------------------------------------- | |
| 325 | // device_start - device-specific startup | |
| 326 | //------------------------------------------------- | |
| 327 | ||
| 328 | void t6721_device::device_start() | |
| 329 | { | |
| 330 | DEVICE_START_NAME( t6721 )(this); | |
| 331 | } | |
| 332 | ||
| 333 | //------------------------------------------------- | |
| 334 | // device_reset - device-specific reset | |
| 335 | //------------------------------------------------- | |
| 336 | ||
| 337 | void t6721_device::device_reset() | |
| 338 | { | |
| 339 | DEVICE_RESET_NAME( t6721 )(this); | |
| 340 | } | |
| 341 | ||
| 342 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | MACROS / CONSTANTS |
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_SOUND_DEVICE(DAVE, dave_sound); | |
| 17 | class dave_sound_device : public device_t, | |
| 18 | public device_sound_interface | |
| 19 | { | |
| 20 | public: | |
| 21 | dave_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~dave_sound_device() { global_free(m_token); } | |
| 18 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | ||
| 32 | // sound stream update overrides | |
| 33 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 34 | private: | |
| 35 | // internal state | |
| 36 | void *m_token; | |
| 37 | }; | |
| 38 | ||
| 39 | extern const device_type DAVE; | |
| 40 | ||
| 41 | ||
| 19 | 42 | #define DAVE_INT_SELECTABLE 0 |
| 20 | 43 | #define DAVE_INT_1KHZ_50HZ_TG 1 |
| 21 | 44 | #define DAVE_INT_1HZ 2 |
| r17612 | r17613 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | assert(device != NULL); |
| 182 | 182 | assert(device->type() == GAMEBOY); |
| 183 | return (gb_sound_t *) downcast< | |
| 183 | return (gb_sound_t *) downcast< | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | |
| r17612 | r17613 | |
| 772 | 772 | } |
| 773 | 773 | } |
| 774 | 774 | |
| 775 | DEFINE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound); | |
| 775 | const device_type GAMEBOY = &device_creator<gameboy_sound_device>; | |
| 776 | ||
| 777 | gameboy_sound_device::gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 778 | : device_t(mconfig, GAMEBOY, "LR35902", tag, owner, clock), | |
| 779 | device_sound_interface(mconfig, *this) | |
| 780 | { | |
| 781 | m_token = global_alloc_array_clear(UINT8, sizeof(gb_sound_t)); | |
| 782 | } | |
| 783 | ||
| 784 | //------------------------------------------------- | |
| 785 | // device_config_complete - perform any | |
| 786 | // operations now that the configuration is | |
| 787 | // complete | |
| 788 | //------------------------------------------------- | |
| 789 | ||
| 790 | void gameboy_sound_device::device_config_complete() | |
| 791 | { | |
| 792 | } | |
| 793 | ||
| 794 | //------------------------------------------------- | |
| 795 | // device_start - device-specific startup | |
| 796 | //------------------------------------------------- | |
| 797 | ||
| 798 | void gameboy_sound_device::device_start() | |
| 799 | { | |
| 800 | DEVICE_START_NAME( gameboy_sound )(this); | |
| 801 | } | |
| 802 | ||
| 803 | //------------------------------------------------- | |
| 804 | // sound_stream_update - handle a stream update | |
| 805 | //------------------------------------------------- | |
| 806 | ||
| 807 | void gameboy_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 808 | { | |
| 809 | // should never get here | |
| 810 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 811 | } | |
| 812 | ||
| 813 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | void socrates_snd_reg3_w(device_t *device, int data); |
| 10 | 10 | void socrates_snd_reg4_w(device_t *device, int data); |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(SOCRATES, socrates_snd); | |
| 12 | class socrates_snd_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | socrates_snd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | ~socrates_snd_device() { global_free(m_token); } | |
| 13 | 18 | |
| 19 | // access to legacy token | |
| 20 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 21 | protected: | |
| 22 | // device-level overrides | |
| 23 | virtual void device_config_complete(); | |
| 24 | virtual void device_start(); | |
| 25 | ||
| 26 | // sound stream update overrides | |
| 27 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 28 | private: | |
| 29 | // internal state | |
| 30 | void *m_token; | |
| 31 | }; | |
| 32 | ||
| 33 | extern const device_type SOCRATES; | |
| 34 | ||
| 35 | ||
| 14 | 36 | #endif /* __SOCR_SND_H__ */ |
| 15 | 37 |
| r17612 | r17613 | |
|---|---|---|
| 12 | 12 | DEVICE CONFIGURATION MACROS |
| 13 | 13 | ***************************************************************************/ |
| 14 | 14 | |
| 15 | DECLARE_LEGACY_DEVICE(T6721, t6721); | |
| 15 | class t6721_device : public device_t | |
| 16 | { | |
| 17 | public: | |
| 18 | t6721_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 19 | ~t6721_device() { global_free(m_token); } | |
| 16 | 20 | |
| 21 | // access to legacy token | |
| 22 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 23 | protected: | |
| 24 | // device-level overrides | |
| 25 | virtual void device_config_complete(); | |
| 26 | virtual void device_start(); | |
| 27 | virtual void device_reset(); | |
| 28 | private: | |
| 29 | // internal state | |
| 30 | void *m_token; | |
| 31 | }; | |
| 32 | ||
| 33 | extern const device_type T6721; | |
| 34 | ||
| 35 | ||
| 17 | 36 | #define MCFG_T6721_ADD(_tag) \ |
| 18 | 37 | MCFG_DEVICE_ADD(_tag, T6721, 0) \ |
| 19 | 38 |
| r17612 | r17613 | |
|---|---|---|
| 115 | 115 | { |
| 116 | 116 | assert(device != NULL); |
| 117 | 117 | assert(device->type() == LYNX || device->type() == LYNX2); |
| 118 | return (lynx_sound_state *)downcast<l | |
| 118 | return (lynx_sound_state *)downcast<l | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | static void lynx_audio_reset_channel(LYNX_AUDIO *This) |
| r17612 | r17613 | |
| 536 | 536 | } |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | DEFINE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound); | |
| 540 | DEFINE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound); | |
| 539 | const device_type LYNX = &device_creator<lynx_sound_device>; | |
| 540 | ||
| 541 | lynx_sound_device::lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 542 | : device_t(mconfig, LYNX, "Mikey", tag, owner, clock), | |
| 543 | device_sound_interface(mconfig, *this) | |
| 544 | { | |
| 545 | m_token = global_alloc_array_clear(UINT8, sizeof(lynx_sound_state)); | |
| 546 | } | |
| 547 | ||
| 548 | lynx_sound_device::lynx_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 549 | : device_t(mconfig, type, name, tag, owner, clock), | |
| 550 | device_sound_interface(mconfig, *this) | |
| 551 | { | |
| 552 | m_token = global_alloc_array_clear(UINT8, sizeof(lynx_sound_state)); | |
| 553 | } | |
| 554 | ||
| 555 | //------------------------------------------------- | |
| 556 | // device_config_complete - perform any | |
| 557 | // operations now that the configuration is | |
| 558 | // complete | |
| 559 | //------------------------------------------------- | |
| 560 | ||
| 561 | void lynx_sound_device::device_config_complete() | |
| 562 | { | |
| 563 | } | |
| 564 | ||
| 565 | //------------------------------------------------- | |
| 566 | // device_start - device-specific startup | |
| 567 | //------------------------------------------------- | |
| 568 | ||
| 569 | void lynx_sound_device::device_start() | |
| 570 | { | |
| 571 | DEVICE_START_NAME( lynx_sound )(this); | |
| 572 | } | |
| 573 | ||
| 574 | //------------------------------------------------- | |
| 575 | // device_reset - device-specific reset | |
| 576 | //------------------------------------------------- | |
| 577 | ||
| 578 | void lynx_sound_device::device_reset() | |
| 579 | { | |
| 580 | DEVICE_RESET_NAME( lynx_sound )(this); | |
| 581 | } | |
| 582 | ||
| 583 | //------------------------------------------------- | |
| 584 | // sound_stream_update - handle a stream update | |
| 585 | //------------------------------------------------- | |
| 586 | ||
| 587 | void lynx_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 588 | { | |
| 589 | // should never get here | |
| 590 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 591 | } | |
| 592 | ||
| 593 | ||
| 594 | const device_type LYNX2 = &device_creator<lynx2_sound_device>; | |
| 595 | ||
| 596 | lynx2_sound_device::lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 597 | : lynx_sound_device(mconfig, LYNX2, "Mikey (Lynx II)", tag, owner, clock) | |
| 598 | { | |
| 599 | } | |
| 600 | ||
| 601 | void lynx2_sound_device::device_start() | |
| 602 | { | |
| 603 | DEVICE_START_NAME( lynx2_sound )(this); | |
| 604 | } | |
| 605 | ||
| 606 | //------------------------------------------------- | |
| 607 | // sound_stream_update - handle a stream update | |
| 608 | //------------------------------------------------- | |
| 609 | ||
| 610 | void lynx2_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 611 | { | |
| 612 | // should never get here | |
| 613 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 614 | } | |
| 615 | ||
| 616 |
| r17612 | r17613 | |
|---|---|---|
| 59 | 59 | { |
| 60 | 60 | assert(device != NULL); |
| 61 | 61 | assert(device->type() == SVISION); |
| 62 | return (svision_sound_state *)downcast< | |
| 62 | return (svision_sound_state *)downcast<svision_sound_devic | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | int *svision_dma_finished(device_t *device) |
| r17612 | r17613 | |
| 315 | 315 | } |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | DEFINE_LEGACY_SOUND_DEVICE(SVISION, svision_sound); | |
| 318 | const device_type SVISION = &device_creator<svision_sound_device>; | |
| 319 | ||
| 320 | svision_sound_device::svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 321 | : device_t(mconfig, SVISION, "Super Vision Custom", tag, owner, clock), | |
| 322 | device_sound_interface(mconfig, *this) | |
| 323 | { | |
| 324 | m_token = global_alloc_array_clear(UINT8, sizeof(svision_sound_state)); | |
| 325 | } | |
| 326 | ||
| 327 | //------------------------------------------------- | |
| 328 | // device_config_complete - perform any | |
| 329 | // operations now that the configuration is | |
| 330 | // complete | |
| 331 | //------------------------------------------------- | |
| 332 | ||
| 333 | void svision_sound_device::device_config_complete() | |
| 334 | { | |
| 335 | } | |
| 336 | ||
| 337 | //------------------------------------------------- | |
| 338 | // device_start - device-specific startup | |
| 339 | //------------------------------------------------- | |
| 340 | ||
| 341 | void svision_sound_device::device_start() | |
| 342 | { | |
| 343 | DEVICE_START_NAME( svision_sound )(this); | |
| 344 | } | |
| 345 | ||
| 346 | //------------------------------------------------- | |
| 347 | // sound_stream_update - handle a stream update | |
| 348 | //------------------------------------------------- | |
| 349 | ||
| 350 | void svision_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 351 | { | |
| 352 | // should never get here | |
| 353 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 354 | } | |
| 355 | ||
| 356 |
| r17612 | r17613 | |
|---|---|---|
| 1 | DECLARE_LEGACY_SOUND_DEVICE(GAMEBOY, gameboy_sound); | |
| 1 | class gameboy_sound_device : public device_t, | |
| 2 | public device_sound_interface | |
| 3 | { | |
| 4 | public: | |
| 5 | gameboy_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 6 | ~gameboy_sound_device() { global_free(m_token); } | |
| 2 | 7 | |
| 8 | // access to legacy token | |
| 9 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 10 | protected: | |
| 11 | // device-level overrides | |
| 12 | virtual void device_config_complete(); | |
| 13 | virtual void device_start(); | |
| 14 | ||
| 15 | // sound stream update overrides | |
| 16 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 17 | private: | |
| 18 | // internal state | |
| 19 | void *m_token; | |
| 20 | }; | |
| 21 | ||
| 22 | extern const device_type GAMEBOY; | |
| 23 | ||
| 24 | ||
| 3 | 25 | READ8_DEVICE_HANDLER( gb_sound_r ); |
| 4 | 26 | WRITE8_DEVICE_HANDLER( gb_sound_w ); |
| 5 | 27 | READ8_DEVICE_HANDLER( gb_wave_r ); |
| r17612 | r17613 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | /* ----- device interface ----- */ |
| 52 | 52 | |
| 53 | DECLARE_LEGACY_DEVICE(OMTI8621, omti8621); | |
| 53 | class omti8621_device : public device_t | |
| 54 | { | |
| 55 | public: | |
| 56 | omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 57 | ~omti8621_device() { global_free(m_token); } | |
| 58 | ||
| 59 | // access to legacy token | |
| 60 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 61 | protected: | |
| 62 | // device-level overrides | |
| 63 | virtual void device_config_complete(); | |
| 64 | virtual void device_start(); | |
| 65 | virtual void device_reset(); | |
| 66 | private: | |
| 67 | // internal state | |
| 68 | void *m_token; | |
| 69 | }; | |
| 70 | ||
| 71 | extern const device_type OMTI8621; | |
| 72 | ||
| 54 | 73 | MACHINE_CONFIG_EXTERN( omti_disk ); |
| 55 | 74 | |
| 56 | 75 | //###############################################################NEWNEW |
| r17612 | r17613 | |
|---|---|---|
| 74 | 74 | assert(device != NULL); |
| 75 | 75 | assert(device->type() == STRATAFLASH); |
| 76 | 76 | |
| 77 | return (strata_t *)downcast<l | |
| 77 | return (strata_t *)downcast<stratafl | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | static DEVICE_START( strataflash ) |
| r17612 | r17613 | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | ||
| 121 | const device_type | |
| 122 | 122 | |
| 123 | strataflash_device::strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 124 | : device_t(mconfig, STRATAFLASH, "Intel 28F640J5", tag, owner, clock) | |
| 125 | { | |
| 126 | m_token = global_alloc_array_clear(UINT8, sizeof(strata_t)); | |
| 127 | } | |
| 128 | ||
| 129 | //------------------------------------------------- | |
| 130 | // device_config_complete - perform any | |
| 131 | // operations now that the configuration is | |
| 132 | // complete | |
| 133 | //------------------------------------------------- | |
| 134 | ||
| 135 | void strataflash_device::device_config_complete() | |
| 136 | { | |
| 137 | } | |
| 138 | ||
| 139 | //------------------------------------------------- | |
| 140 | // device_start - device-specific startup | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | void strataflash_device::device_start() | |
| 144 | { | |
| 145 | DEVICE_START_NAME( strataflash )(this); | |
| 146 | } | |
| 147 | ||
| 148 | ||
| 149 | ||
| 123 | 150 | /* |
| 124 | 151 | load the FEEPROM contents from file |
| 125 | 152 | */ |
| r17612 | r17613 | |
|---|---|---|
| 2 | 2 | strata.h: header file for strata.c |
| 3 | 3 | */ |
| 4 | 4 | |
| 5 | DECLARE_LEGACY_DEVICE(STRATAFLASH, strataflash); | |
| 5 | class strataflash_device : public device_t | |
| 6 | { | |
| 7 | public: | |
| 8 | strataflash_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 9 | ~strataflash_device() { global_free(m_token); } | |
| 6 | 10 | |
| 11 | // access to legacy token | |
| 12 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 13 | protected: | |
| 14 | // device-level overrides | |
| 15 | virtual void device_config_complete(); | |
| 16 | virtual void device_start(); | |
| 17 | private: | |
| 18 | // internal state | |
| 19 | void *m_token; | |
| 20 | }; | |
| 21 | ||
| 22 | extern const device_type STRATAFLASH; | |
| 23 | ||
| 24 | ||
| 7 | 25 | #define MCFG_STRATAFLASH_ADD(_tag) \ |
| 8 | 26 | MCFG_DEVICE_ADD(_tag, STRATAFLASH, 0) |
| 9 | 27 |
| r17612 | r17613 | |
|---|---|---|
| 38 | 38 | MACROS |
| 39 | 39 | ***************************************************************************/ |
| 40 | 40 | |
| 41 | DECLARE_LEGACY_DEVICE(ATARI_FDC, atari_fdc); | |
| 41 | class atari_fdc_device : public device_t | |
| 42 | { | |
| 43 | public: | |
| 44 | atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 45 | ~atari_fdc_device() { global_free(m_token); } | |
| 42 | 46 | |
| 47 | // access to legacy token | |
| 48 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 49 | protected: | |
| 50 | // device-level overrides | |
| 51 | virtual void device_config_complete(); | |
| 52 | virtual void device_start(); | |
| 53 | virtual void device_reset(); | |
| 54 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 55 | private: | |
| 56 | // internal state | |
| 57 | void *m_token; | |
| 58 | }; | |
| 59 | ||
| 60 | extern const device_type ATARI_FDC; | |
| 61 | ||
| 62 | ||
| 43 | 63 | #define MCFG_ATARI_FDC_ADD(_tag) \ |
| 44 | 64 | MCFG_DEVICE_ADD((_tag), ATARI_FDC, 0) |
| 45 | 65 |
| r17612 | r17613 | |
|---|---|---|
| 82 | 82 | { |
| 83 | 83 | assert(device != NULL); |
| 84 | 84 | assert(device->type() == MOS6530); |
| 85 | return (mos6530_state *)downcast< | |
| 85 | return (mos6530_state *)downcast<mos6530_devic | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| r17612 | r17613 | |
| 455 | 455 | } |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | DEFINE_LEGACY_DEVICE(MOS6530, mos6530); | |
| 458 | const device_type MOS6530 = &device_creator<mos6530_device>; | |
| 459 | ||
| 460 | mos6530_device::mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 461 | : device_t(mconfig, MOS6530, "MOS6530", tag, owner, clock) | |
| 462 | { | |
| 463 | m_token = global_alloc_array_clear(UINT8, sizeof(mos6530_state)); | |
| 464 | } | |
| 465 | ||
| 466 | //------------------------------------------------- | |
| 467 | // device_config_complete - perform any | |
| 468 | // operations now that the configuration is | |
| 469 | // complete | |
| 470 | //------------------------------------------------- | |
| 471 | ||
| 472 | void mos6530_device::device_config_complete() | |
| 473 | { | |
| 474 | } | |
| 475 | ||
| 476 | //------------------------------------------------- | |
| 477 | // device_start - device-specific startup | |
| 478 | //------------------------------------------------- | |
| 479 | ||
| 480 | void mos6530_device::device_start() | |
| 481 | { | |
| 482 | DEVICE_START_NAME( mos6530 )(this); | |
| 483 | } | |
| 484 | ||
| 485 | //------------------------------------------------- | |
| 486 | // device_reset - device-specific reset | |
| 487 | //------------------------------------------------- | |
| 488 | ||
| 489 | void mos6530_device::device_reset() | |
| 490 | { | |
| 491 | DEVICE_RESET_NAME( mos6530 )(this); | |
| 492 | } | |
| 493 | ||
| 494 |
| r17612 | r17613 | |
|---|---|---|
| 37 | 37 | MACROS / CONSTANTS |
| 38 | 38 | ***************************************************************************/ |
| 39 | 39 | |
| 40 | DECLARE_LEGACY_DEVICE(MOS6530, mos6530); | |
| 40 | class mos6530_device : public device_t | |
| 41 | { | |
| 42 | public: | |
| 43 | mos6530_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 44 | ~mos6530_device() { global_free(m_token); } | |
| 41 | 45 | |
| 46 | // access to legacy token | |
| 47 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 48 | protected: | |
| 49 | // device-level overrides | |
| 50 | virtual void device_config_complete(); | |
| 51 | virtual void device_start(); | |
| 52 | virtual void device_reset(); | |
| 53 | private: | |
| 54 | // internal state | |
| 55 | void *m_token; | |
| 56 | }; | |
| 57 | ||
| 58 | extern const device_type MOS6530; | |
| 59 | ||
| 60 | ||
| 42 | 61 | #define MCFG_MOS6530_ADD(_tag, _clock, _config) \ |
| 43 | 62 | MCFG_DEVICE_ADD((_tag), MOS6530, _clock) \ |
| 44 | 63 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 225 | 225 | { |
| 226 | 226 | assert( device != NULL ); |
| 227 | 227 | assert( device->type() == MC6854 ); |
| 228 | return (mc6854_t*) downcast< | |
| 228 | return (mc6854_t*) downcast<m | |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | 231 | |
| r17612 | r17613 | |
| 1061 | 1061 | } |
| 1062 | 1062 | } |
| 1063 | 1063 | |
| 1064 | DEFINE_LEGACY_DEVICE(MC6854, mc6854); | |
| 1064 | const device_type MC6854 = &device_creator<mc6854_device>; | |
| 1065 | ||
| 1066 | mc6854_device::mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1067 | : device_t(mconfig, MC6854, "Motorola MC6854 ADLC", tag, owner, clock) | |
| 1068 | { | |
| 1069 | m_token = global_alloc_array_clear(UINT8, sizeof(mc6854_t)); | |
| 1070 | } | |
| 1071 | ||
| 1072 | //------------------------------------------------- | |
| 1073 | // device_config_complete - perform any | |
| 1074 | // operations now that the configuration is | |
| 1075 | // complete | |
| 1076 | //------------------------------------------------- | |
| 1077 | ||
| 1078 | void mc6854_device::device_config_complete() | |
| 1079 | { | |
| 1080 | } | |
| 1081 | ||
| 1082 | //------------------------------------------------- | |
| 1083 | // device_start - device-specific startup | |
| 1084 | //------------------------------------------------- | |
| 1085 | ||
| 1086 | void mc6854_device::device_start() | |
| 1087 | { | |
| 1088 | DEVICE_START_NAME( mc6854 )(this); | |
| 1089 | } | |
| 1090 | ||
| 1091 | //------------------------------------------------- | |
| 1092 | // device_reset - device-specific reset | |
| 1093 | //------------------------------------------------- | |
| 1094 | ||
| 1095 | void mc6854_device::device_reset() | |
| 1096 | { | |
| 1097 | DEVICE_RESET_NAME( mc6854 )(this); | |
| 1098 | } | |
| 1099 | ||
| 1100 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | #ifndef MC6854_H |
| 10 | 10 | #define MC6854_H |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_DEVICE(MC6854, mc6854); | |
| 12 | class mc6854_device : public device_t | |
| 13 | { | |
| 14 | public: | |
| 15 | mc6854_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 16 | ~mc6854_device() { global_free(m_token); } | |
| 13 | 17 | |
| 18 | // access to legacy token | |
| 19 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 20 | protected: | |
| 21 | // device-level overrides | |
| 22 | virtual void device_config_complete(); | |
| 23 | virtual void device_start(); | |
| 24 | virtual void device_reset(); | |
| 25 | private: | |
| 26 | // internal state | |
| 27 | void *m_token; | |
| 28 | }; | |
| 29 | ||
| 30 | extern const device_type MC6854; | |
| 31 | ||
| 32 | ||
| 14 | 33 | /* we provide two interfaces: |
| 15 | 34 | - a bit-based interface: out_tx, set_rx |
| 16 | 35 | - a frame-based interface: out_frame, send_frame |
| r17612 | r17613 | |
|---|---|---|
| 87 | 87 | { |
| 88 | 88 | assert( device != NULL ); |
| 89 | 89 | assert( device->type() == MC6846 ); |
| 90 | return (mc6846_t*) downcast< | |
| 90 | return (mc6846_t*) downcast<m | |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r17612 | r17613 | |
| 631 | 631 | } |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | DEFINE_LEGACY_DEVICE(MC6846, mc6846); | |
| 634 | const device_type MC6846 = &device_creator<mc6846_device>; | |
| 635 | ||
| 636 | mc6846_device::mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 637 | : device_t(mconfig, MC6846, "Motorola MC6846 programmable timer", tag, owner, clock) | |
| 638 | { | |
| 639 | m_token = global_alloc_array_clear(UINT8, sizeof(mc6846_t)); | |
| 640 | } | |
| 641 | ||
| 642 | //------------------------------------------------- | |
| 643 | // device_config_complete - perform any | |
| 644 | // operations now that the configuration is | |
| 645 | // complete | |
| 646 | //------------------------------------------------- | |
| 647 | ||
| 648 | void mc6846_device::device_config_complete() | |
| 649 | { | |
| 650 | } | |
| 651 | ||
| 652 | //------------------------------------------------- | |
| 653 | // device_start - device-specific startup | |
| 654 | //------------------------------------------------- | |
| 655 | ||
| 656 | void mc6846_device::device_start() | |
| 657 | { | |
| 658 | DEVICE_START_NAME( mc6846 )(this); | |
| 659 | } | |
| 660 | ||
| 661 | //------------------------------------------------- | |
| 662 | // device_reset - device-specific reset | |
| 663 | //------------------------------------------------- | |
| 664 | ||
| 665 | void mc6846_device::device_reset() | |
| 666 | { | |
| 667 | DEVICE_RESET_NAME( mc6846 )(this); | |
| 668 | } | |
| 669 | ||
| 670 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | #ifndef MC6846_H |
| 10 | 10 | #define MC6846_H |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_DEVICE(MC6846, mc6846); | |
| 12 | class mc6846_device : public device_t | |
| 13 | { | |
| 14 | public: | |
| 15 | mc6846_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 16 | ~mc6846_device() { global_free(m_token); } | |
| 13 | 17 | |
| 18 | // access to legacy token | |
| 19 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 20 | protected: | |
| 21 | // device-level overrides | |
| 22 | virtual void device_config_complete(); | |
| 23 | virtual void device_start(); | |
| 24 | virtual void device_reset(); | |
| 25 | private: | |
| 26 | // internal state | |
| 27 | void *m_token; | |
| 28 | }; | |
| 29 | ||
| 30 | extern const device_type MC6846; | |
| 31 | ||
| 32 | ||
| 14 | 33 | /* ---------- configuration ------------ */ |
| 15 | 34 | |
| 16 | 35 | typedef struct _mc6846_interface mc6846_interface; |
| r17612 | r17613 | |
|---|---|---|
| 41 | 41 | assert(device != NULL); |
| 42 | 42 | assert(device->type() == SST39VF020 || device->type() == SST39VF400A); |
| 43 | 43 | |
| 44 | return (sst39vfx_t *) downcast< | |
| 44 | return (sst39vfx_t *) downcast<sst39vf020_devic | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | INLINE const sst39vfx_config *get_config(device_t *device) |
| r17612 | r17613 | |
| 218 | 218 | } |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | DEFINE_LEGACY_DEVICE(SST39VF020, sst39vf020); | |
| 222 | DEFINE_LEGACY_DEVICE(SST39VF400A, sst39vf400a); | |
| 221 | const device_type SST39VF020 = &device_creator<sst39vf020_device>; | |
| 222 | ||
| 223 | sst39vf020_device::sst39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 224 | : device_t(mconfig, SST39VF020, "SST39VF020", tag, owner, clock) | |
| 225 | { | |
| 226 | m_token = global_alloc_array_clear(UINT8, sizeof(sst39vfx_t)); | |
| 227 | } | |
| 228 | sst39vf020_device::sst39vf020_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 229 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 230 | { | |
| 231 | m_token = global_alloc_array_clear(UINT8, sizeof(sst39vfx_t)); | |
| 232 | } | |
| 233 | ||
| 234 | //------------------------------------------------- | |
| 235 | // device_config_complete - perform any | |
| 236 | // operations now that the configuration is | |
| 237 | // complete | |
| 238 | //------------------------------------------------- | |
| 239 | ||
| 240 | void sst39vf020_device::device_config_complete() | |
| 241 | { | |
| 242 | } | |
| 243 | ||
| 244 | //------------------------------------------------- | |
| 245 | // device_start - device-specific startup | |
| 246 | //------------------------------------------------- | |
| 247 | ||
| 248 | void sst39vf020_device::device_start() | |
| 249 | { | |
| 250 | DEVICE_START_NAME( sst39vf020 )(this); | |
| 251 | } | |
| 252 | ||
| 253 | ||
| 254 | const device_type SST39VF400A = &device_creator<sst39vf400a_device>; | |
| 255 | ||
| 256 | sst39vf400a_device::sst39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 257 | : sst39vf020_device(mconfig, SST39VF400A, "SST39VF400A", tag, owner, clock) | |
| 258 | { | |
| 259 | } | |
| 260 | ||
| 261 | //------------------------------------------------- | |
| 262 | // device_start - device-specific startup | |
| 263 | //------------------------------------------------- | |
| 264 | ||
| 265 | void sst39vf400a_device::device_start() | |
| 266 | { | |
| 267 | DEVICE_START_NAME( sst39vf400a )(this); | |
| 268 | } | |
| 269 | ||
| 270 |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | MACROS |
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | DECLARE_LEGACY_DEVICE(SST39VF020, sst39vf020); | |
| 32 | class sst39vf020_device : public device_t | |
| 33 | { | |
| 34 | public: | |
| 35 | sst39vf020_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | sst39vf020_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 37 | ~sst39vf020_device() { global_free(m_token); } | |
| 33 | 38 | |
| 39 | // access to legacy token | |
| 40 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 41 | protected: | |
| 42 | // device-level overrides | |
| 43 | virtual void device_config_complete(); | |
| 44 | virtual void device_start(); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type SST39VF020; | |
| 51 | ||
| 52 | ||
| 34 | 53 | #define MCFG_SST39VF020_ADD(_tag, _config) \ |
| 35 | 54 | MCFG_DEVICE_ADD(_tag, SST39VF020, 0) \ |
| 36 | 55 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
| 38 | 57 | #define MCFG_SST39VF020_REMOVE(_tag) \ |
| 39 | 58 | MCFG_DEVICE_REMOVE(_tag) |
| 40 | 59 | |
| 41 | DECLARE_LEGACY_DEVICE(SST39VF400A, sst39vf400a); | |
| 60 | class sst39vf400a_device : public sst39vf020_device | |
| 61 | { | |
| 62 | public: | |
| 63 | sst39vf400a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 64 | protected: | |
| 65 | // device-level overrides | |
| 66 | virtual void device_start(); | |
| 67 | }; | |
| 42 | 68 | |
| 69 | extern const device_type SST39VF400A; | |
| 70 | ||
| 71 | ||
| 43 | 72 | #define MCFG_SST39VF400A_ADD(_tag,_config) \ |
| 44 | 73 | MCFG_DEVICE_ADD(_tag, SST39VF400A, 0) \ |
| 45 | 74 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 116 | 116 | assert(device != NULL); |
| 117 | 117 | assert(device->type() == UPD71071); |
| 118 | 118 | |
| 119 | return (upd71071_t*)downcast< | |
| 119 | return (upd71071_t*)downcast<upd71071_devic | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | static TIMER_CALLBACK(dma_transfer_timer) |
| r17612 | r17613 | |
| 441 | 441 | READ8_DEVICE_HANDLER(upd71071_r) { return upd71071_read(device,offset); } |
| 442 | 442 | WRITE8_DEVICE_HANDLER(upd71071_w) { upd71071_write(device,offset,data); } |
| 443 | 443 | |
| 444 | DEFINE_LEGACY_DEVICE(UPD71071, upd71071); | |
| 444 | const device_type UPD71071 = &device_creator<upd71071_device>; | |
| 445 | ||
| 446 | upd71071_device::upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 447 | : device_t(mconfig, UPD71071, "NEC uPD71071", tag, owner, clock) | |
| 448 | { | |
| 449 | m_token = global_alloc_array_clear(UINT8, sizeof(upd71071_t)); | |
| 450 | } | |
| 451 | ||
| 452 | //------------------------------------------------- | |
| 453 | // device_config_complete - perform any | |
| 454 | // operations now that the configuration is | |
| 455 | // complete | |
| 456 | //------------------------------------------------- | |
| 457 | ||
| 458 | void upd71071_device::device_config_complete() | |
| 459 | { | |
| 460 | } | |
| 461 | ||
| 462 | //------------------------------------------------- | |
| 463 | // device_start - device-specific startup | |
| 464 | //------------------------------------------------- | |
| 465 | ||
| 466 | void upd71071_device::device_start() | |
| 467 | { | |
| 468 | DEVICE_START_NAME( upd71071 )(this); | |
| 469 | } | |
| 470 | ||
| 471 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | |
| 15 | 15 | int upd71071_dmarq(device_t* device,int state,int channel); |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_DEVICE(UPD71071, upd71071); | |
| 17 | class upd71071_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | upd71071_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~upd71071_device() { global_free(m_token); } | |
| 18 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | private: | |
| 30 | // internal state | |
| 31 | void *m_token; | |
| 32 | }; | |
| 33 | ||
| 34 | extern const device_type UPD71071; | |
| 35 | ||
| 36 | ||
| 19 | 37 | #define MCFG_UPD71071_ADD(_tag, _config) \ |
| 20 | 38 | MCFG_DEVICE_ADD(_tag, UPD71071, 0) \ |
| 21 | 39 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 56 | 56 | assert(device != NULL); |
| 57 | 57 | assert(device->type() == E05A03); |
| 58 | 58 | |
| 59 | return (e05a03_state *)downcast< | |
| 59 | return (e05a03_state *)downcast< | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| r17612 | r17613 | |
| 238 | 238 | e05a03_resi_w(device, state); |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | DEFINE_LEGACY_DEVICE(E05A03, e05a03); | |
| 241 | const device_type E05A03 = &device_creator<e05a03_device>; | |
| 242 | ||
| 243 | e05a03_device::e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 244 | : device_t(mconfig, E05A03, "E05A03", tag, owner, clock) | |
| 245 | { | |
| 246 | m_token = global_alloc_array_clear(UINT8, sizeof(e05a03_state)); | |
| 247 | } | |
| 248 | ||
| 249 | //------------------------------------------------- | |
| 250 | // device_config_complete - perform any | |
| 251 | // operations now that the configuration is | |
| 252 | // complete | |
| 253 | //------------------------------------------------- | |
| 254 | ||
| 255 | void e05a03_device::device_config_complete() | |
| 256 | { | |
| 257 | } | |
| 258 | ||
| 259 | //------------------------------------------------- | |
| 260 | // device_start - device-specific startup | |
| 261 | //------------------------------------------------- | |
| 262 | ||
| 263 | void e05a03_device::device_start() | |
| 264 | { | |
| 265 | DEVICE_START_NAME( e05a03 )(this); | |
| 266 | } | |
| 267 | ||
| 268 | //------------------------------------------------- | |
| 269 | // device_reset - device-specific reset | |
| 270 | //------------------------------------------------- | |
| 271 | ||
| 272 | void e05a03_device::device_reset() | |
| 273 | { | |
| 274 | DEVICE_RESET_NAME( e05a03 )(this); | |
| 275 | } | |
| 276 | ||
| 277 |
| r17612 | r17613 | |
|---|---|---|
| 44 | 44 | DEVICE CONFIGURATION MACROS |
| 45 | 45 | ***************************************************************************/ |
| 46 | 46 | |
| 47 | DECLARE_LEGACY_DEVICE(E05A03, e05a03); | |
| 47 | class e05a03_device : public device_t | |
| 48 | { | |
| 49 | public: | |
| 50 | e05a03_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 51 | ~e05a03_device() { global_free(m_token); } | |
| 48 | 52 | |
| 53 | // access to legacy token | |
| 54 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 55 | protected: | |
| 56 | // device-level overrides | |
| 57 | virtual void device_config_complete(); | |
| 58 | virtual void device_start(); | |
| 59 | virtual void device_reset(); | |
| 60 | private: | |
| 61 | // internal state | |
| 62 | void *m_token; | |
| 63 | }; | |
| 64 | ||
| 65 | extern const device_type E05A03; | |
| 66 | ||
| 67 | ||
| 49 | 68 | #define MCFG_E05A03_ADD(_tag, _intf) \ |
| 50 | 69 | MCFG_DEVICE_ADD(_tag, E05A03, 0) \ |
| 51 | 70 | MCFG_DEVICE_CONFIG(_intf) |
| r17612 | r17613 | |
|---|---|---|
| 127 | 127 | assert(device != NULL); |
| 128 | 128 | assert(device->type() == TI990_TAPE_CTRL); |
| 129 | 129 | |
| 130 | return (tap_990_t *)downcast< | |
| 130 | return (tap_990_t *)downcast<t | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| r17612 | r17613 | |
| 1089 | 1089 | } |
| 1090 | 1090 | } |
| 1091 | 1091 | |
| 1092 | DEFINE_LEGACY_DEVICE(TI990_TAPE_CTRL, tap_990); | |
| 1092 | const device_type TI990_TAPE_CTRL = &device_creator<tap_990_device>; | |
| 1093 | ||
| 1094 | tap_990_device::tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1095 | : device_t(mconfig, TI990_TAPE_CTRL, "Generic TI990 Tape Controller", tag, owner, clock) | |
| 1096 | { | |
| 1097 | m_token = global_alloc_array_clear(UINT8, sizeof(tap_990_t)); | |
| 1098 | } | |
| 1099 | ||
| 1100 | //------------------------------------------------- | |
| 1101 | // device_config_complete - perform any | |
| 1102 | // operations now that the configuration is | |
| 1103 | // complete | |
| 1104 | //------------------------------------------------- | |
| 1105 | ||
| 1106 | void tap_990_device::device_config_complete() | |
| 1107 | { | |
| 1108 | } | |
| 1109 | ||
| 1110 | //------------------------------------------------- | |
| 1111 | // device_start - device-specific startup | |
| 1112 | //------------------------------------------------- | |
| 1113 | ||
| 1114 | void tap_990_device::device_start() | |
| 1115 | { | |
| 1116 | DEVICE_START_NAME( tap_990 )(this); | |
| 1117 | } | |
| 1118 | ||
| 1119 | //------------------------------------------------- | |
| 1120 | // device_mconfig_additions - return a pointer to | |
| 1121 | // the device's machine fragment | |
| 1122 | //------------------------------------------------- | |
| 1123 | ||
| 1124 | machine_config_constructor tap_990_device::device_mconfig_additions() const | |
| 1125 | { | |
| 1126 | return MACHINE_CONFIG_NAME( tap_990 ); | |
| 1127 | } | |
| 1128 | ||
| 1129 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | MACROS |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_DEVICE(TI990_TAPE_CTRL, tap_990); | |
| 20 | class tap_990_device : public device_t | |
| 21 | { | |
| 22 | public: | |
| 23 | tap_990_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~tap_990_device() { global_free(m_token); } | |
| 21 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 37 | ||
| 38 | extern const device_type TI990_TAPE_CTRL; | |
| 39 | ||
| 40 | ||
| 22 | 41 | #define MCFG_TI990_TAPE_CTRL_ADD(_tag, _intrf) \ |
| 23 | 42 | MCFG_DEVICE_ADD((_tag), TI990_TAPE_CTRL, 0)\ |
| 24 | 43 | MCFG_DEVICE_CONFIG(_intrf) |
| r17612 | r17613 | |
|---|---|---|
| 150 | 150 | device get info callback |
| 151 | 151 | -------------------------------------------------*/ |
| 152 | 152 | |
| 153 | ||
| 153 | ||
| 154 | 154 | { |
| 155 | 155 | switch (state) |
| 156 | 156 | { |
| r17612 | r17613 | |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | static DECLARE_LEGACY_DEVICE(APOLLO_CONF, apollo_config); | |
| 170 | class apollo_config_device : public device_t | |
| 171 | { | |
| 172 | public: | |
| 173 | apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 174 | protected: | |
| 175 | // device-level overrides | |
| 176 | virtual void device_config_complete(); | |
| 177 | virtual void device_start(); | |
| 178 | virtual void device_reset(); | |
| 179 | private: | |
| 180 | // internal state | |
| 181 | }; | |
| 171 | 182 | |
| 172 | ||
| 183 | extern const device_type A | |
| 173 | 184 | |
| 185 | ||
| 186 | const device_type APOLLO_CONF = &device_creator<apollo_config_device>; | |
| 187 | ||
| 188 | apollo_config_device::apollo_config_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 189 | : device_t(mconfig, APOLLO_CONF, "Apollo Configuration", tag, owner, clock) | |
| 190 | { | |
| 191 | } | |
| 192 | ||
| 193 | //------------------------------------------------- | |
| 194 | // device_config_complete - perform any | |
| 195 | // operations now that the configuration is | |
| 196 | // complete | |
| 197 | //------------------------------------------------- | |
| 198 | ||
| 199 | void apollo_config_device::device_config_complete() | |
| 200 | { | |
| 201 | } | |
| 202 | ||
| 203 | //------------------------------------------------- | |
| 204 | // device_start - device-specific startup | |
| 205 | //------------------------------------------------- | |
| 206 | ||
| 207 | void apollo_config_device::device_start() | |
| 208 | { | |
| 209 | DEVICE_START_NAME( apollo_config )(this); | |
| 210 | } | |
| 211 | ||
| 212 | //------------------------------------------------- | |
| 213 | // device_reset - device-specific reset | |
| 214 | //------------------------------------------------- | |
| 215 | ||
| 216 | void apollo_config_device::device_reset() | |
| 217 | { | |
| 218 | DEVICE_RESET_NAME( apollo_config )(this); | |
| 219 | } | |
| 220 | ||
| 221 | ||
| 222 | ||
| 174 | 223 | //########################################################################## |
| 175 | 224 | // machine/apollo_csr.c - APOLLO DS3500 CPU Control and Status registers |
| 176 | 225 | //########################################################################## |
| r17612 | r17613 | |
|---|---|---|
| 65 | 65 | { |
| 66 | 66 | assert(device != NULL); |
| 67 | 67 | assert(device->type() == DS1315); |
| 68 | return (ds1315_t *) downcast< | |
| 68 | return (ds1315_t *) downcast<ds1315_devic | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | |
| r17612 | r17613 | |
| 264 | 264 | } |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | DEFINE_LEGACY_DEVICE(DS1315, ds1315); | |
| 267 | const device_type DS1315 = &device_creator<ds1315_device>; | |
| 268 | ||
| 269 | ds1315_device::ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 270 | : device_t(mconfig, DS1315, "Dallas Semiconductor DS1315", tag, owner, clock) | |
| 271 | { | |
| 272 | m_token = global_alloc_array_clear(UINT8, sizeof(ds1315_t)); | |
| 273 | } | |
| 274 | ||
| 275 | //------------------------------------------------- | |
| 276 | // device_config_complete - perform any | |
| 277 | // operations now that the configuration is | |
| 278 | // complete | |
| 279 | //------------------------------------------------- | |
| 280 | ||
| 281 | void ds1315_device::device_config_complete() | |
| 282 | { | |
| 283 | } | |
| 284 | ||
| 285 | //------------------------------------------------- | |
| 286 | // device_start - device-specific startup | |
| 287 | //------------------------------------------------- | |
| 288 | ||
| 289 | void ds1315_device::device_start() | |
| 290 | { | |
| 291 | DEVICE_START_NAME( ds1315 )(this); | |
| 292 | } | |
| 293 | ||
| 294 |
| r17612 | r17613 | |
|---|---|---|
| 72 | 72 | assert(device != NULL); |
| 73 | 73 | assert(device->type() == PC_LPT); |
| 74 | 74 | |
| 75 | return (pc_lpt_state *)downcast< | |
| 75 | return (pc_lpt_state *)downcast<p | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r17612 | r17613 | |
| 252 | 252 | } |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | ||
| 255 | const device_type | |
| 256 | 256 | |
| 257 | pc_lpt_device::pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 258 | : device_t(mconfig, PC_LPT, "PC-LPT", tag, owner, clock) | |
| 259 | { | |
| 260 | m_token = global_alloc_array_clear(UINT8, sizeof(pc_lpt_state)); | |
| 261 | } | |
| 262 | ||
| 263 | //------------------------------------------------- | |
| 264 | // device_config_complete - perform any | |
| 265 | // operations now that the configuration is | |
| 266 | // complete | |
| 267 | //------------------------------------------------- | |
| 268 | ||
| 269 | void pc_lpt_device::device_config_complete() | |
| 270 | { | |
| 271 | } | |
| 272 | ||
| 273 | //------------------------------------------------- | |
| 274 | // device_start - device-specific startup | |
| 275 | //------------------------------------------------- | |
| 276 | ||
| 277 | void pc_lpt_device::device_start() | |
| 278 | { | |
| 279 | DEVICE_START_NAME( pc_lpt )(this); | |
| 280 | } | |
| 281 | ||
| 282 | //------------------------------------------------- | |
| 283 | // device_reset - device-specific reset | |
| 284 | //------------------------------------------------- | |
| 285 | ||
| 286 | void pc_lpt_device::device_reset() | |
| 287 | { | |
| 288 | DEVICE_RESET_NAME( pc_lpt )(this); | |
| 289 | } | |
| 290 | ||
| 291 | //------------------------------------------------- | |
| 292 | // device_mconfig_additions - return a pointer to | |
| 293 | // the device's machine fragment | |
| 294 | //------------------------------------------------- | |
| 295 | ||
| 296 | machine_config_constructor pc_lpt_device::device_mconfig_additions() const | |
| 297 | { | |
| 298 | return MACHINE_CONFIG_NAME( pc_lpt ); | |
| 299 | } | |
| 300 | ||
| 301 | ||
| 302 | ||
| 257 | 303 | static WRITE_LINE_DEVICE_HANDLER(pc_cpu_line) |
| 258 | 304 | { |
| 259 | 305 | isa8_lpt_device *lpt = downcast<isa8_lpt_device *>(device->owner()); |
| r17612 | r17613 | |
|---|---|---|
| 56 | 56 | INLINE s3c44b0_t *get_token( device_t *device) |
| 57 | 57 | { |
| 58 | 58 | assert(device != NULL); |
| 59 | return (s3c44b0_t *)downcast< | |
| 59 | return (s3c44b0_t *)downcast<s3 | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | /*************************************************************************** |
| r17612 | r17613 | |
| 2054 | 2054 | } |
| 2055 | 2055 | } |
| 2056 | 2056 | |
| 2057 | DEFINE_LEGACY_DEVICE(S3C44B0, s3c44b0); | |
| 2057 | const device_type S3C44B0 = &device_creator<s3c44b0_device>; | |
| 2058 | ||
| 2059 | s3c44b0_device::s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2060 | : device_t(mconfig, S3C44B0, "Samsung S3C44B0", tag, owner, clock) | |
| 2061 | { | |
| 2062 | m_token = global_alloc_array_clear(UINT8, sizeof(s3c44b0_t)); | |
| 2063 | } | |
| 2064 | ||
| 2065 | //------------------------------------------------- | |
| 2066 | // device_config_complete - perform any | |
| 2067 | // operations now that the configuration is | |
| 2068 | // complete | |
| 2069 | //------------------------------------------------- | |
| 2070 | ||
| 2071 | void s3c44b0_device::device_config_complete() | |
| 2072 | { | |
| 2073 | } | |
| 2074 | ||
| 2075 | //------------------------------------------------- | |
| 2076 | // device_start - device-specific startup | |
| 2077 | //------------------------------------------------- | |
| 2078 | ||
| 2079 | void s3c44b0_device::device_start() | |
| 2080 | { | |
| 2081 | DEVICE_START_NAME( s3c44b0 )(this); | |
| 2082 | } | |
| 2083 | ||
| 2084 | //------------------------------------------------- | |
| 2085 | // device_reset - device-specific reset | |
| 2086 | //------------------------------------------------- | |
| 2087 | ||
| 2088 | void s3c44b0_device::device_reset() | |
| 2089 | { | |
| 2090 | DEVICE_RESET_NAME( s3c44b0 )(this); | |
| 2091 | } | |
| 2092 | ||
| 2093 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | MACROS |
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | DECLARE_LEGACY_DEVICE(DS1315, ds1315); | |
| 21 | class ds1315_device : public device_t | |
| 22 | { | |
| 23 | public: | |
| 24 | ds1315_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~ds1315_device() { global_free(m_token); } | |
| 22 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 23 | 37 | |
| 38 | extern const device_type DS1315; | |
| 24 | 39 | |
| 40 | ||
| 41 | ||
| 42 | ||
| 25 | 43 | /*************************************************************************** |
| 26 | 44 | DEVICE CONFIGURATION MACROS |
| 27 | 45 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 39 | 39 | DEVICE CONFIGURATION MACROS |
| 40 | 40 | ***************************************************************************/ |
| 41 | 41 | |
| 42 | DECLARE_LEGACY_DEVICE(PC_LPT, pc_lpt); | |
| 42 | class pc_lpt_device : public device_t | |
| 43 | { | |
| 44 | public: | |
| 45 | pc_lpt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 46 | ~pc_lpt_device() { global_free(m_token); } | |
| 43 | 47 | |
| 48 | // access to legacy token | |
| 49 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 50 | protected: | |
| 51 | // device-level overrides | |
| 52 | virtual void device_config_complete(); | |
| 53 | virtual void device_start(); | |
| 54 | virtual void device_reset(); | |
| 55 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 56 | private: | |
| 57 | // internal state | |
| 58 | void *m_token; | |
| 59 | }; | |
| 60 | ||
| 61 | extern const device_type PC_LPT; | |
| 62 | ||
| 63 | ||
| 44 | 64 | #define MCFG_PC_LPT_ADD(_tag, _intf) \ |
| 45 | 65 | MCFG_DEVICE_ADD(_tag, PC_LPT, 0) \ |
| 46 | 66 | MCFG_DEVICE_CONFIG(_intf) |
| r17612 | r17613 | |
|---|---|---|
| 35 | 35 | S3C44B0_GPIO_PORT_G |
| 36 | 36 | }; |
| 37 | 37 | |
| 38 | DECLARE_LEGACY_DEVICE(S3C44B0, s3c44b0); | |
| 38 | class s3c44b0_device : public device_t | |
| 39 | { | |
| 40 | public: | |
| 41 | s3c44b0_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 42 | ~s3c44b0_device() { global_free(m_token); } | |
| 39 | 43 | |
| 44 | // access to legacy token | |
| 45 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_config_complete(); | |
| 49 | virtual void device_start(); | |
| 50 | virtual void device_reset(); | |
| 51 | private: | |
| 52 | // internal state | |
| 53 | void *m_token; | |
| 54 | }; | |
| 55 | ||
| 56 | extern const device_type S3C44B0; | |
| 57 | ||
| 58 | ||
| 40 | 59 | /******************************************************************************* |
| 41 | 60 | TYPE DEFINITIONS |
| 42 | 61 | *******************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 2829 | 2829 | } |
| 2830 | 2830 | } |
| 2831 | 2831 | |
| 2832 | DEFINE_LEGACY_DEVICE(MC68328, mc68328); | |
| 2832 | const device_type MC68328 = &device_creator<mc68328_device>; | |
| 2833 | ||
| 2834 | mc68328_device::mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2835 | : device_t(mconfig, MC68328, "Motorola MC68328 (DragonBall) Integrated Processor", tag, owner, clock) | |
| 2836 | { | |
| 2837 | m_token = global_alloc_array_clear(UINT8, sizeof(mc68328_t)); | |
| 2838 | } | |
| 2839 | ||
| 2840 | //------------------------------------------------- | |
| 2841 | // device_config_complete - perform any | |
| 2842 | // operations now that the configuration is | |
| 2843 | // complete | |
| 2844 | //------------------------------------------------- | |
| 2845 | ||
| 2846 | void mc68328_device::device_config_complete() | |
| 2847 | { | |
| 2848 | } | |
| 2849 | ||
| 2850 | //------------------------------------------------- | |
| 2851 | // device_start - device-specific startup | |
| 2852 | //------------------------------------------------- | |
| 2853 | ||
| 2854 | void mc68328_device::device_start() | |
| 2855 | { | |
| 2856 | DEVICE_START_NAME( mc68328 )(this); | |
| 2857 | } | |
| 2858 | ||
| 2859 | //------------------------------------------------- | |
| 2860 | // device_reset - device-specific reset | |
| 2861 | //------------------------------------------------- | |
| 2862 | ||
| 2863 | void mc68328_device::device_reset() | |
| 2864 | { | |
| 2865 | DEVICE_RESET_NAME( mc68328 )(this); | |
| 2866 | } | |
| 2867 | ||
| 2868 |
| r17612 | r17613 | |
|---|---|---|
| 535 | 535 | { |
| 536 | 536 | assert( device != NULL ); |
| 537 | 537 | assert( device->type() == MC68328 ); |
| 538 | return (mc68328_t*) downcast< | |
| 538 | return (mc68328_t*) downcast<m | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | #endif // __MC68328_PRIVATE_H_ |
| r17612 | r17613 | |
|---|---|---|
| 113 | 113 | assert(device != NULL); |
| 114 | 114 | assert(device->type() == MICROPOLIS); |
| 115 | 115 | |
| 116 | return (micropolis_state *)downcast< | |
| 116 | return (micropolis_state *)downcast<mi | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| r17612 | r17613 | |
| 396 | 396 | } |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | DEFINE_LEGACY_DEVICE(MICROPOLIS, micropolis); | |
| 399 | const device_type MICROPOLIS = &device_creator<micropolis_device>; | |
| 400 | ||
| 401 | micropolis_device::micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 402 | : device_t(mconfig, MICROPOLIS, "MICROPOLIS", tag, owner, clock) | |
| 403 | { | |
| 404 | m_token = global_alloc_array_clear(UINT8, sizeof(micropolis_state)); | |
| 405 | } | |
| 406 | ||
| 407 | //------------------------------------------------- | |
| 408 | // device_config_complete - perform any | |
| 409 | // operations now that the configuration is | |
| 410 | // complete | |
| 411 | //------------------------------------------------- | |
| 412 | ||
| 413 | void micropolis_device::device_config_complete() | |
| 414 | { | |
| 415 | } | |
| 416 | ||
| 417 | //------------------------------------------------- | |
| 418 | // device_start - device-specific startup | |
| 419 | //------------------------------------------------- | |
| 420 | ||
| 421 | void micropolis_device::device_start() | |
| 422 | { | |
| 423 | DEVICE_START_NAME( micropolis )(this); | |
| 424 | } | |
| 425 | ||
| 426 | //------------------------------------------------- | |
| 427 | // device_reset - device-specific reset | |
| 428 | //------------------------------------------------- | |
| 429 | ||
| 430 | void micropolis_device::device_reset() | |
| 431 | { | |
| 432 | DEVICE_RESET_NAME( micropolis )(this); | |
| 433 | } | |
| 434 | ||
| 435 |
| r17612 | r17613 | |
|---|---|---|
| 17 | 17 | MACROS |
| 18 | 18 | ***************************************************************************/ |
| 19 | 19 | |
| 20 | DECLARE_LEGACY_DEVICE(MICROPOLIS, micropolis); | |
| 20 | class micropolis_device : public device_t | |
| 21 | { | |
| 22 | public: | |
| 23 | micropolis_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 24 | ~micropolis_device() { global_free(m_token); } | |
| 21 | 25 | |
| 26 | // access to legacy token | |
| 27 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 28 | protected: | |
| 29 | // device-level overrides | |
| 30 | virtual void device_config_complete(); | |
| 31 | virtual void device_start(); | |
| 32 | virtual void device_reset(); | |
| 33 | private: | |
| 34 | // internal state | |
| 35 | void *m_token; | |
| 36 | }; | |
| 22 | 37 | |
| 38 | extern const device_type MICROPOLIS; | |
| 23 | 39 | |
| 40 | ||
| 41 | ||
| 42 | ||
| 24 | 43 | /*************************************************************************** |
| 25 | 44 | TYPE DEFINITIONS |
| 26 | 45 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 50 | 50 | assert(device != NULL); |
| 51 | 51 | assert(device->type() == TF20); |
| 52 | 52 | |
| 53 | return (tf20_state *)downcast< | |
| 53 | return (tf20_state *)downcast<tf20 | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | |
| r17612 | r17613 | |
| 384 | 384 | } |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | DEFINE_LEGACY_DEVICE(TF20, tf20); | |
| 387 | const device_type TF20 = &device_creator<tf20_device>; | |
| 388 | ||
| 389 | tf20_device::tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 390 | : device_t(mconfig, TF20, "TF-20", tag, owner, clock) | |
| 391 | { | |
| 392 | m_token = global_alloc_array_clear(UINT8, sizeof(tf20_state)); | |
| 393 | } | |
| 394 | ||
| 395 | //------------------------------------------------- | |
| 396 | // device_config_complete - perform any | |
| 397 | // operations now that the configuration is | |
| 398 | // complete | |
| 399 | //------------------------------------------------- | |
| 400 | ||
| 401 | void tf20_device::device_config_complete() | |
| 402 | { | |
| 403 | m_shortname = "tf20"; | |
| 404 | } | |
| 405 | ||
| 406 | //------------------------------------------------- | |
| 407 | // device_start - device-specific startup | |
| 408 | //------------------------------------------------- | |
| 409 | ||
| 410 | void tf20_device::device_start() | |
| 411 | { | |
| 412 | DEVICE_START_NAME( tf20 )(this); | |
| 413 | } | |
| 414 | ||
| 415 | //------------------------------------------------- | |
| 416 | // device_reset - device-specific reset | |
| 417 | //------------------------------------------------- | |
| 418 | ||
| 419 | void tf20_device::device_reset() | |
| 420 | { | |
| 421 | DEVICE_RESET_NAME( tf20 )(this); | |
| 422 | } | |
| 423 | ||
| 424 | //------------------------------------------------- | |
| 425 | // device_mconfig_additions - return a pointer to | |
| 426 | // the device's machine fragment | |
| 427 | //------------------------------------------------- | |
| 428 | ||
| 429 | machine_config_constructor tf20_device::device_mconfig_additions() const | |
| 430 | { | |
| 431 | return MACHINE_CONFIG_NAME( tf20 ); | |
| 432 | } | |
| 433 | ||
| 434 | //------------------------------------------------- | |
| 435 | // device_rom_region - return a pointer to the | |
| 436 | // the device's ROM definitions | |
| 437 | //------------------------------------------------- | |
| 438 | ||
| 439 | const rom_entry *tf20_device::device_rom_region() const | |
| 440 | { | |
| 441 | return ROM_NAME(tf20 ); | |
| 442 | } | |
| 443 | ||
| 444 |
| r17612 | r17613 | |
|---|---|---|
| 49 | 49 | DEVICE CONFIGURATION MACROS |
| 50 | 50 | ***************************************************************************/ |
| 51 | 51 | |
| 52 | DECLARE_LEGACY_DEVICE(TF20, tf20); | |
| 52 | class tf20_device : public device_t | |
| 53 | { | |
| 54 | public: | |
| 55 | tf20_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 56 | ~tf20_device() { global_free(m_token); } | |
| 53 | 57 | |
| 58 | // access to legacy token | |
| 59 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 60 | protected: | |
| 61 | // device-level overrides | |
| 62 | virtual void device_config_complete(); | |
| 63 | virtual void device_start(); | |
| 64 | virtual void device_reset(); | |
| 65 | virtual const rom_entry *device_rom_region() const; | |
| 66 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 67 | private: | |
| 68 | // internal state | |
| 69 | void *m_token; | |
| 70 | }; | |
| 71 | ||
| 72 | extern const device_type TF20; | |
| 73 | ||
| 74 | ||
| 54 | 75 | #define MCFG_TF20_ADD(_tag) \ |
| 55 | 76 | MCFG_DEVICE_ADD(_tag, TF20, 0) \ |
| 56 | 77 |
| r17612 | r17613 | |
|---|---|---|
| 53 | 53 | assert(device != NULL); |
| 54 | 54 | assert(device->type() == HD63450); |
| 55 | 55 | |
| 56 | return (hd63450_t *)downcast< | |
| 56 | return (hd63450_t *)downcast<hd63450_devic | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | static DEVICE_START(hd63450) |
| r17612 | r17613 | |
| 485 | 485 | READ16_DEVICE_HANDLER(hd63450_r) { return hd63450_read(device,offset,mem_mask); } |
| 486 | 486 | WRITE16_DEVICE_HANDLER(hd63450_w) { hd63450_write(device,offset,data,mem_mask); } |
| 487 | 487 | |
| 488 | DEFINE_LEGACY_DEVICE(HD63450, hd63450); | |
| 488 | const device_type HD63450 = &device_creator<hd63450_device>; | |
| 489 | ||
| 490 | hd63450_device::hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 491 | : device_t(mconfig, HD63450, "Hitachi HD63450", tag, owner, clock) | |
| 492 | { | |
| 493 | m_token = global_alloc_array_clear(UINT8, sizeof(hd63450_t)); | |
| 494 | } | |
| 495 | ||
| 496 | //------------------------------------------------- | |
| 497 | // device_config_complete - perform any | |
| 498 | // operations now that the configuration is | |
| 499 | // complete | |
| 500 | //------------------------------------------------- | |
| 501 | ||
| 502 | void hd63450_device::device_config_complete() | |
| 503 | { | |
| 504 | } | |
| 505 | ||
| 506 | //------------------------------------------------- | |
| 507 | // device_start - device-specific startup | |
| 508 | //------------------------------------------------- | |
| 509 | ||
| 510 | void hd63450_device::device_start() | |
| 511 | { | |
| 512 | DEVICE_START_NAME( hd63450 )(this); | |
| 513 | } | |
| 514 | ||
| 515 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | int hd63450_get_vector(device_t* device, int channel); |
| 25 | 25 | int hd63450_get_error_vector(device_t* device, int channel); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_DEVICE(HD63450, hd63450); | |
| 27 | class hd63450_device : public device_t | |
| 28 | { | |
| 29 | public: | |
| 30 | hd63450_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ~hd63450_device() { global_free(m_token); } | |
| 28 | 32 | |
| 33 | // access to legacy token | |
| 34 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_config_complete(); | |
| 38 | virtual void device_start(); | |
| 39 | private: | |
| 40 | // internal state | |
| 41 | void *m_token; | |
| 42 | }; | |
| 43 | ||
| 44 | extern const device_type HD63450; | |
| 45 | ||
| 46 | ||
| 29 | 47 | #define MCFG_HD63450_ADD(_tag, _config) \ |
| 30 | 48 | MCFG_DEVICE_ADD(_tag, HD63450, 0) \ |
| 31 | 49 | MCFG_DEVICE_CONFIG(_config) |
| r17612 | r17613 | |
|---|---|---|
| 88 | 88 | assert(device != NULL); |
| 89 | 89 | assert(device->type() == KR2376); |
| 90 | 90 | |
| 91 | return (kr2376_t *)downcast< | |
| 91 | return (kr2376_t *)downcast<kr2376_devic | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /*------------------------------------------------- |
| r17612 | r17613 | |
| 393 | 393 | } |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | DEFINE_LEGACY_DEVICE(KR2376, kr2376); | |
| 396 | const device_type KR2376 = &device_creator<kr2376_device>; | |
| 397 | ||
| 398 | kr2376_device::kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 399 | : device_t(mconfig, KR2376, "SMC KR2376", tag, owner, clock) | |
| 400 | { | |
| 401 | m_token = global_alloc_array_clear(UINT8, sizeof(kr2376_t)); | |
| 402 | } | |
| 403 | ||
| 404 | //------------------------------------------------- | |
| 405 | // device_config_complete - perform any | |
| 406 | // operations now that the configuration is | |
| 407 | // complete | |
| 408 | //------------------------------------------------- | |
| 409 | ||
| 410 | void kr2376_device::device_config_complete() | |
| 411 | { | |
| 412 | } | |
| 413 | ||
| 414 | //------------------------------------------------- | |
| 415 | // device_start - device-specific startup | |
| 416 | //------------------------------------------------- | |
| 417 | ||
| 418 | void kr2376_device::device_start() | |
| 419 | { | |
| 420 | DEVICE_START_NAME( kr2376 )(this); | |
| 421 | } | |
| 422 | ||
| 423 |
| r17612 | r17613 | |
|---|---|---|
| 36 | 36 | typedef void (*kr2376_on_strobe_changed_func) (device_t *device, int level); |
| 37 | 37 | #define KR2376_ON_STROBE_CHANGED(name) void name(device_t *device, int level) |
| 38 | 38 | |
| 39 | DECLARE_LEGACY_DEVICE(KR2376, kr2376); | |
| 39 | class kr2376_device : public device_t | |
| 40 | { | |
| 41 | public: | |
| 42 | kr2376_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 43 | ~kr2376_device() { global_free(m_token); } | |
| 40 | 44 | |
| 45 | // access to legacy token | |
| 46 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 47 | protected: | |
| 48 | // device-level overrides | |
| 49 | virtual void device_config_complete(); | |
| 50 | virtual void device_start(); | |
| 51 | private: | |
| 52 | // internal state | |
| 53 | void *m_token; | |
| 54 | }; | |
| 55 | ||
| 56 | extern const device_type KR2376; | |
| 57 | ||
| 58 | ||
| 41 | 59 | #define MCFG_KR2376_ADD(_tag, _intrf) \ |
| 42 | 60 | MCFG_DEVICE_ADD(_tag, KR2376, 0) \ |
| 43 | 61 | MCFG_DEVICE_CONFIG(_intrf) |
| r17612 | r17613 | |
|---|---|---|
| 165 | 165 | INLINE applefdc_token *get_token(device_t *device) |
| 166 | 166 | { |
| 167 | 167 | assert_is_applefdc(device); |
| 168 | return (applefdc_token *) downcast<le | |
| 168 | return (applefdc_token *) downcast<applefdc | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| r17612 | r17613 | |
| 857 | 857 | } |
| 858 | 858 | } |
| 859 | 859 | |
| 860 | DEFINE_LEGACY_DEVICE(APPLEFDC, applefdc); | |
| 861 | DEFINE_LEGACY_DEVICE(IWM, iwm); | |
| 862 | DEFINE_LEGACY_DEVICE(SWIM, swim); | |
| 860 | applefdc_base_device::applefdc_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 861 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 862 | { | |
| 863 | m_token = global_alloc_array_clear(UINT8, sizeof(applefdc_token)); | |
| 864 | } | |
| 865 | ||
| 866 | //------------------------------------------------- | |
| 867 | // device_config_complete - perform any | |
| 868 | // operations now that the configuration is | |
| 869 | // complete | |
| 870 | //------------------------------------------------- | |
| 871 | ||
| 872 | void applefdc_base_device::device_config_complete() | |
| 873 | { | |
| 874 | } | |
| 875 | ||
| 876 | //------------------------------------------------- | |
| 877 | // device_reset - device-specific reset | |
| 878 | //------------------------------------------------- | |
| 879 | ||
| 880 | void applefdc_base_device::device_reset() | |
| 881 | { | |
| 882 | DEVICE_RESET_NAME( applefdc )(this); | |
| 883 | } | |
| 884 | ||
| 885 | ||
| 886 | const device_type APPLEFDC = &device_creator<applefdc_device>; | |
| 887 | ||
| 888 | applefdc_device::applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 889 | : applefdc_base_device(mconfig, APPLEFDC, "Apple FDC", tag, owner, clock) | |
| 890 | { | |
| 891 | } | |
| 892 | ||
| 893 | //------------------------------------------------- | |
| 894 | // device_start - device-specific startup | |
| 895 | //------------------------------------------------- | |
| 896 | ||
| 897 | void applefdc_device::device_start() | |
| 898 | { | |
| 899 | DEVICE_START_NAME( oldfdc )(this); | |
| 900 | } | |
| 901 | ||
| 902 | ||
| 903 | const device_type IWM = &device_creator<iwm_device>; | |
| 904 | ||
| 905 | iwm_device::iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 906 | : applefdc_base_device(mconfig, IWM, "Apple IWM (Integrated Woz Machine)", tag, owner, clock) | |
| 907 | { | |
| 908 | } | |
| 909 | ||
| 910 | //------------------------------------------------- | |
| 911 | // device_start - device-specific startup | |
| 912 | //------------------------------------------------- | |
| 913 | ||
| 914 | void iwm_device::device_start() | |
| 915 | { | |
| 916 | DEVICE_START_NAME( iwm )(this); | |
| 917 | } | |
| 918 | ||
| 919 | ||
| 920 | const device_type SWIM = &device_creator<swim_device>; | |
| 921 | ||
| 922 | swim_device::swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 923 | : applefdc_base_device(mconfig, SWIM, "Apple SWIM (Steve Woz Integrated Machine)", tag, owner, clock) | |
| 924 | { | |
| 925 | } | |
| 926 | ||
| 927 | //------------------------------------------------- | |
| 928 | // device_start - device-specific startup | |
| 929 | //------------------------------------------------- | |
| 930 | ||
| 931 | void swim_device::device_start() | |
| 932 | { | |
| 933 | DEVICE_START_NAME( swim )(this); | |
| 934 | } | |
| 935 | ||
| 936 |
| r17612 | r17613 | |
|---|---|---|
| 28 | 28 | #define APPLEFDC_PH2 0x04 |
| 29 | 29 | #define APPLEFDC_PH3 0x08 |
| 30 | 30 | |
| 31 | DECLARE_LEGACY_DEVICE(APPLEFDC, applefdc); | |
| 32 | DECLARE_LEGACY_DEVICE(IWM, iwm); | |
| 33 | DECLARE_LEGACY_DEVICE(SWIM, swim); | |
| 31 | class applefdc_base_device : public device_t | |
| 32 | { | |
| 33 | public: | |
| 34 | applefdc_base_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 35 | ~applefdc_base_device() { global_free(m_token); } | |
| 34 | 36 | |
| 37 | // access to legacy token | |
| 38 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 39 | protected: | |
| 40 | // device-level overrides | |
| 41 | virtual void device_config_complete(); | |
| 42 | virtual void device_start() { } | |
| 43 | virtual void device_reset(); | |
| 44 | private: | |
| 45 | // internal state | |
| 46 | void *m_token; | |
| 47 | }; | |
| 35 | 48 | |
| 49 | class applefdc_device : public applefdc_base_device | |
| 50 | { | |
| 51 | public: | |
| 52 | applefdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 53 | protected: | |
| 54 | // device-level overrides | |
| 55 | virtual void device_start(); | |
| 56 | }; | |
| 36 | 57 | |
| 58 | extern const device_type APPLEFDC; | |
| 59 | ||
| 60 | class iwm_device : public applefdc_base_device | |
| 61 | { | |
| 62 | public: | |
| 63 | iwm_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 64 | protected: | |
| 65 | // device-level overrides | |
| 66 | virtual void device_start(); | |
| 67 | }; | |
| 68 | ||
| 69 | extern const device_type IWM; | |
| 70 | ||
| 71 | class swim_device : public applefdc_base_device | |
| 72 | { | |
| 73 | public: | |
| 74 | swim_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 75 | protected: | |
| 76 | // device-level overrides | |
| 77 | virtual void device_start(); | |
| 78 | }; | |
| 79 | ||
| 80 | extern const device_type SWIM; | |
| 81 | ||
| 82 | ||
| 83 | ||
| 84 | ||
| 37 | 85 | /*************************************************************************** |
| 38 | 86 | TYPE DEFINITIONS |
| 39 | 87 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 171 | 171 | assert(device->type() == UPD765A || device->type() == UPD765B || |
| 172 | 172 | device->type() == SMC37C78 || device->type() == UPD72065); |
| 173 | 173 | |
| 174 | return (upd765_t *)downcast< | |
| 174 | return (upd765_t *)downcast<upd765a | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | static device_t *current_image(device_t *device) |
| r17612 | r17613 | |
| 2540 | 2540 | } |
| 2541 | 2541 | } |
| 2542 | 2542 | |
| 2543 | DEFINE_LEGACY_DEVICE(UPD765A, upd765a); | |
| 2544 | DEFINE_LEGACY_DEVICE(UPD765B, upd765b); | |
| 2545 | DEFINE_LEGACY_DEVICE(SMC37C78, smc37c78); | |
| 2546 | DEFINE_LEGACY_DEVICE(UPD72065, upd72065); | |
| 2543 | const device_type UPD765A = &device_creator<upd765a_device>; | |
| 2544 | ||
| 2545 | upd765a_device::upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2546 | : device_t(mconfig, UPD765A, "UPD765A", tag, owner, clock) | |
| 2547 | { | |
| 2548 | m_token = global_alloc_array_clear(UINT8, sizeof(upd765_t)); | |
| 2549 | } | |
| 2550 | upd765a_device::upd765a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 2551 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 2552 | { | |
| 2553 | m_token = global_alloc_array_clear(UINT8, sizeof(upd765_t)); | |
| 2554 | } | |
| 2555 | ||
| 2556 | //------------------------------------------------- | |
| 2557 | // device_config_complete - perform any | |
| 2558 | // operations now that the configuration is | |
| 2559 | // complete | |
| 2560 | //------------------------------------------------- | |
| 2561 | ||
| 2562 | void upd765a_device::device_config_complete() | |
| 2563 | { | |
| 2564 | } | |
| 2565 | ||
| 2566 | //------------------------------------------------- | |
| 2567 | // device_start - device-specific startup | |
| 2568 | //------------------------------------------------- | |
| 2569 | ||
| 2570 | void upd765a_device::device_start() | |
| 2571 | { | |
| 2572 | DEVICE_START_NAME( upd765a )(this); | |
| 2573 | } | |
| 2574 | ||
| 2575 | //------------------------------------------------- | |
| 2576 | // device_reset - device-specific reset | |
| 2577 | //------------------------------------------------- | |
| 2578 | ||
| 2579 | void upd765a_device::device_reset() | |
| 2580 | { | |
| 2581 | DEVICE_RESET_NAME( upd765 )(this); | |
| 2582 | } | |
| 2583 | ||
| 2584 | ||
| 2585 | const device_type UPD765B = &device_creator<upd765b_device>; | |
| 2586 | ||
| 2587 | upd765b_device::upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2588 | : upd765a_device(mconfig, UPD765B, "UPD765B", tag, owner, clock) | |
| 2589 | { | |
| 2590 | } | |
| 2591 | ||
| 2592 | //------------------------------------------------- | |
| 2593 | // device_start - device-specific startup | |
| 2594 | //------------------------------------------------- | |
| 2595 | ||
| 2596 | void upd765b_device::device_start() | |
| 2597 | { | |
| 2598 | DEVICE_START_NAME( upd765b )(this); | |
| 2599 | } | |
| 2600 | ||
| 2601 | ||
| 2602 | const device_type SMC37C78 = &device_creator<smc37c78_device>; | |
| 2603 | ||
| 2604 | smc37c78_device::smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2605 | : upd765a_device(mconfig, SMC37C78, "SMC37C78", tag, owner, clock) | |
| 2606 | { | |
| 2607 | } | |
| 2608 | ||
| 2609 | //------------------------------------------------- | |
| 2610 | // device_start - device-specific startup | |
| 2611 | //------------------------------------------------- | |
| 2612 | ||
| 2613 | void smc37c78_device::device_start() | |
| 2614 | { | |
| 2615 | DEVICE_START_NAME( smc37c78 )(this); | |
| 2616 | } | |
| 2617 | ||
| 2618 | ||
| 2619 | const device_type UPD72065 = &device_creator<upd72065_device>; | |
| 2620 | ||
| 2621 | upd72065_device::upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2622 | : upd765a_device(mconfig, UPD72065, "UPD72065", tag, owner, clock) | |
| 2623 | { | |
| 2624 | } | |
| 2625 | ||
| 2626 | //------------------------------------------------- | |
| 2627 | // device_start - device-specific startup | |
| 2628 | //------------------------------------------------- | |
| 2629 | ||
| 2630 | void upd72065_device::device_start() | |
| 2631 | { | |
| 2632 | DEVICE_START_NAME( upd72065 )(this); | |
| 2633 | } | |
| 2634 | ||
| 2635 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | MACROS |
| 19 | 19 | ***************************************************************************/ |
| 20 | 20 | |
| 21 | DECLARE_LEGACY_DEVICE(UPD765A, upd765a); | |
| 22 | DECLARE_LEGACY_DEVICE(UPD765B, upd765b); | |
| 23 | DECLARE_LEGACY_DEVICE(SMC37C78, smc37c78); | |
| 24 | DECLARE_LEGACY_DEVICE(UPD72065, upd72065); | |
| 21 | class upd765a_device : public device_t | |
| 22 | { | |
| 23 | public: | |
| 24 | upd765a_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | upd765a_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 26 | ~upd765a_device() { global_free(m_token); } | |
| 25 | 27 | |
| 28 | // access to legacy token | |
| 29 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 30 | protected: | |
| 31 | // device-level overrides | |
| 32 | virtual void device_config_complete(); | |
| 33 | virtual void device_start(); | |
| 34 | virtual void device_reset(); | |
| 35 | private: | |
| 36 | // internal state | |
| 37 | void *m_token; | |
| 38 | }; | |
| 39 | ||
| 40 | extern const device_type UPD765A; | |
| 41 | ||
| 42 | class upd765b_device : public upd765a_device | |
| 43 | { | |
| 44 | public: | |
| 45 | upd765b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 46 | protected: | |
| 47 | // device-level overrides | |
| 48 | virtual void device_start(); | |
| 49 | }; | |
| 50 | ||
| 51 | extern const device_type UPD765B; | |
| 52 | ||
| 53 | class smc37c78_device : public upd765a_device | |
| 54 | { | |
| 55 | public: | |
| 56 | smc37c78_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 57 | protected: | |
| 58 | // device-level overrides | |
| 59 | virtual void device_start(); | |
| 60 | }; | |
| 61 | ||
| 62 | extern const device_type SMC37C78; | |
| 63 | ||
| 64 | class upd72065_device : public upd765a_device | |
| 65 | { | |
| 66 | public: | |
| 67 | upd72065_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | protected: | |
| 69 | // device-level overrides | |
| 70 | virtual void device_start(); | |
| 71 | }; | |
| 72 | ||
| 73 | extern const device_type UPD72065; | |
| 74 | ||
| 75 | ||
| 26 | 76 | /*************************************************************************** |
| 27 | 77 | TYPE DEFINITIONS |
| 28 | 78 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 81 | 81 | assert(device != NULL); |
| 82 | 82 | assert(device->type() == AT45DB041 || device->type() == AT45DB081 || device->type() == AT45DB161); |
| 83 | 83 | |
| 84 | return (at45dbxx_t *) downcast< | |
| 84 | return (at45dbxx_t *) downcast< | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | |
| r17612 | r17613 | |
| 467 | 467 | } |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | DEFINE_LEGACY_DEVICE(AT45DB041, at45db041); | |
| 471 | DEFINE_LEGACY_DEVICE(AT45DB081, at45db081); | |
| 472 | DEFINE_LEGACY_DEVICE(AT45DB161, at45db161); | |
| 470 | const device_type AT45DB041 = &device_creator<at45db041_device>; | |
| 471 | ||
| 472 | at45db041_device::at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 473 | : device_t(mconfig, AT45DB041, "AT45DB041", tag, owner, clock) | |
| 474 | { | |
| 475 | m_token = global_alloc_array_clear(UINT8, sizeof(at45dbxx_t)); | |
| 476 | } | |
| 477 | at45db041_device::at45db041_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 478 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 479 | { | |
| 480 | m_token = global_alloc_array_clear(UINT8, sizeof(at45dbxx_t)); | |
| 481 | } | |
| 482 | ||
| 483 | //------------------------------------------------- | |
| 484 | // device_config_complete - perform any | |
| 485 | // operations now that the configuration is | |
| 486 | // complete | |
| 487 | //------------------------------------------------- | |
| 488 | ||
| 489 | void at45db041_device::device_config_complete() | |
| 490 | { | |
| 491 | } | |
| 492 | ||
| 493 | //------------------------------------------------- | |
| 494 | // device_start - device-specific startup | |
| 495 | //------------------------------------------------- | |
| 496 | ||
| 497 | void at45db041_device::device_start() | |
| 498 | { | |
| 499 | DEVICE_START_NAME( at45db041 )(this); | |
| 500 | } | |
| 501 | ||
| 502 | //------------------------------------------------- | |
| 503 | // device_reset - device-specific reset | |
| 504 | //------------------------------------------------- | |
| 505 | ||
| 506 | void at45db041_device::device_reset() | |
| 507 | { | |
| 508 | DEVICE_RESET_NAME( at45dbxx )(this); | |
| 509 | } | |
| 510 | ||
| 511 | ||
| 512 | const device_type AT45DB081 = &device_creator<at45db081_device>; | |
| 513 | ||
| 514 | at45db081_device::at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 515 | : at45db041_device(mconfig, AT45DB081, "AT45DB081", tag, owner, clock) | |
| 516 | { | |
| 517 | } | |
| 518 | ||
| 519 | //------------------------------------------------- | |
| 520 | // device_start - device-specific startup | |
| 521 | //------------------------------------------------- | |
| 522 | ||
| 523 | void at45db081_device::device_start() | |
| 524 | { | |
| 525 | DEVICE_START_NAME( at45db081 )(this); | |
| 526 | } | |
| 527 | ||
| 528 | ||
| 529 | const device_type AT45DB161 = &device_creator<at45db161_device>; | |
| 530 | ||
| 531 | at45db161_device::at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 532 | : at45db041_device(mconfig, AT45DB161, "AT45DB161", tag, owner, clock) | |
| 533 | { | |
| 534 | } | |
| 535 | ||
| 536 | //------------------------------------------------- | |
| 537 | // device_start - device-specific startup | |
| 538 | //------------------------------------------------- | |
| 539 | ||
| 540 | void at45db161_device::device_start() | |
| 541 | { | |
| 542 | DEVICE_START_NAME( at45db161 )(this); | |
| 543 | } | |
| 544 | ||
| 545 |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | MACROS |
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | DECLARE_LEGACY_DEVICE(AT45DB041, at45db041); | |
| 23 | class at45db041_device : public device_t | |
| 24 | { | |
| 25 | public: | |
| 26 | at45db041_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | at45db041_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 28 | ~at45db041_device() { global_free(m_token); } | |
| 24 | 29 | |
| 30 | // access to legacy token | |
| 31 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 32 | protected: | |
| 33 | // device-level overrides | |
| 34 | virtual void device_config_complete(); | |
| 35 | virtual void device_start(); | |
| 36 | virtual void device_reset(); | |
| 37 | private: | |
| 38 | // internal state | |
| 39 | void *m_token; | |
| 40 | }; | |
| 41 | ||
| 42 | extern const device_type AT45DB041; | |
| 43 | ||
| 44 | ||
| 25 | 45 | #define MCFG_AT45DB041_ADD(_tag) \ |
| 26 | 46 | MCFG_DEVICE_ADD(_tag, AT45DB041, 0) \ |
| 27 | 47 | |
| 28 | DECLARE_LEGACY_DEVICE(AT45DB081, at45db081); | |
| 48 | class at45db081_device : public at45db041_device | |
| 49 | { | |
| 50 | public: | |
| 51 | at45db081_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 52 | protected: | |
| 53 | // device-level overrides | |
| 54 | virtual void device_start(); | |
| 55 | }; | |
| 29 | 56 | |
| 57 | extern const device_type AT45DB081; | |
| 58 | ||
| 59 | ||
| 30 | 60 | #define MCFG_AT45DB081_ADD(_tag) \ |
| 31 | 61 | MCFG_DEVICE_ADD(_tag, AT45DB081, 0) \ |
| 32 | 62 | |
| 33 | DECLARE_LEGACY_DEVICE(AT45DB161, at45db161); | |
| 63 | class at45db161_device : public at45db041_device | |
| 64 | { | |
| 65 | public: | |
| 66 | at45db161_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 67 | protected: | |
| 68 | // device-level overrides | |
| 69 | virtual void device_start(); | |
| 70 | }; | |
| 34 | 71 | |
| 72 | extern const device_type AT45DB161; | |
| 73 | ||
| 74 | ||
| 35 | 75 | #define MCFG_AT45DB161_ADD(_tag) \ |
| 36 | 76 | MCFG_DEVICE_ADD(_tag, AT45DB161, 0) \ |
| 37 | 77 |
| r17612 | r17613 | |
|---|---|---|
| 61 | 61 | INLINE er59256_t *get_token(device_t *device) |
| 62 | 62 | { |
| 63 | 63 | assert(device->type() == ER59256); |
| 64 | return (er59256_t *) downcast< | |
| 64 | return (er59256_t *) downcast< | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| r17612 | r17613 | |
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | DEFINE_LEGACY_DEVICE(ER59256, er59256); | |
| 251 | const device_type ER59256 = &device_creator<er59256_device>; | |
| 252 | ||
| 253 | er59256_device::er59256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 254 | : device_t(mconfig, ER59256, "Microchip ER59256 serial eeprom.", tag, owner, clock) | |
| 255 | { | |
| 256 | m_token = global_alloc_array_clear(UINT8, sizeof(er59256_t)); | |
| 257 | } | |
| 258 | ||
| 259 | //------------------------------------------------- | |
| 260 | // device_config_complete - perform any | |
| 261 | // operations now that the configuration is | |
| 262 | // complete | |
| 263 | //------------------------------------------------- | |
| 264 | ||
| 265 | void er59256_device::device_config_complete() | |
| 266 | { | |
| 267 | } | |
| 268 | ||
| 269 | //------------------------------------------------- | |
| 270 | // device_start - device-specific startup | |
| 271 | //------------------------------------------------- | |
| 272 | ||
| 273 | void er59256_device::device_start() | |
| 274 | { | |
| 275 | DEVICE_START_NAME( er59256 )(this); | |
| 276 | } | |
| 277 | ||
| 278 | //------------------------------------------------- | |
| 279 | // device_stop - device-specific stop | |
| 280 | //------------------------------------------------- | |
| 281 | ||
| 282 | void er59256_device::device_stop() | |
| 283 | { | |
| 284 | DEVICE_STOP_NAME( er59256 )(this); | |
| 285 | } | |
| 286 | ||
| 287 |
| r17612 | r17613 | |
|---|---|---|
| 14 | 14 | MACROS |
| 15 | 15 | ***************************************************************************/ |
| 16 | 16 | |
| 17 | DECLARE_LEGACY_DEVICE(ER59256, er59256); | |
| 17 | class er59256_device : public device_t | |
| 18 | { | |
| 19 | public: | |
| 20 | er59256_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 21 | ~er59256_device() { global_free(m_token); } | |
| 18 | 22 | |
| 23 | // access to legacy token | |
| 24 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 25 | protected: | |
| 26 | // device-level overrides | |
| 27 | virtual void device_config_complete(); | |
| 28 | virtual void device_start(); | |
| 29 | virtual void device_stop(); | |
| 30 | private: | |
| 31 | // internal state | |
| 32 | void *m_token; | |
| 33 | }; | |
| 34 | ||
| 35 | extern const device_type ER59256; | |
| 36 | ||
| 37 | ||
| 19 | 38 | #define MCFG_ER59256_ADD(_tag) \ |
| 20 | 39 | MCFG_DEVICE_ADD((_tag), ER59256, 0) |
| 21 | 40 |
| r17612 | r17613 | |
|---|---|---|
| 34 | 34 | assert(device != NULL); |
| 35 | 35 | assert(device->type() == PF10); |
| 36 | 36 | |
| 37 | return (pf10_state *)downcast< | |
| 37 | return (pf10_state *)downcast<pf10 | |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | |
| r17612 | r17613 | |
| 158 | 158 | logerror("%s: pf10_rxd2_w %u\n", device->machine().describe_context(), state); |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | DEFINE_LEGACY_DEVICE(PF10, pf10); | |
| 161 | const device_type PF10 = &device_creator<pf10_device>; | |
| 162 | ||
| 163 | pf10_device::pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 164 | : device_t(mconfig, PF10, "PF-10", tag, owner, clock) | |
| 165 | { | |
| 166 | m_token = global_alloc_array_clear(UINT8, sizeof(pf10_state)); | |
| 167 | } | |
| 168 | ||
| 169 | //------------------------------------------------- | |
| 170 | // device_config_complete - perform any | |
| 171 | // operations now that the configuration is | |
| 172 | // complete | |
| 173 | //------------------------------------------------- | |
| 174 | ||
| 175 | void pf10_device::device_config_complete() | |
| 176 | { | |
| 177 | } | |
| 178 | ||
| 179 | //------------------------------------------------- | |
| 180 | // device_start - device-specific startup | |
| 181 | //------------------------------------------------- | |
| 182 | ||
| 183 | void pf10_device::device_start() | |
| 184 | { | |
| 185 | DEVICE_START_NAME( pf10 )(this); | |
| 186 | } | |
| 187 | ||
| 188 | //------------------------------------------------- | |
| 189 | // device_reset - device-specific reset | |
| 190 | //------------------------------------------------- | |
| 191 | ||
| 192 | void pf10_device::device_reset() | |
| 193 | { | |
| 194 | DEVICE_RESET_NAME( pf10 )(this); | |
| 195 | } | |
| 196 | ||
| 197 | //------------------------------------------------- | |
| 198 | // device_mconfig_additions - return a pointer to | |
| 199 | // the device's machine fragment | |
| 200 | //------------------------------------------------- | |
| 201 | ||
| 202 | machine_config_constructor pf10_device::device_mconfig_additions() const | |
| 203 | { | |
| 204 | return MACHINE_CONFIG_NAME( pf10 ); | |
| 205 | } | |
| 206 | ||
| 207 | //------------------------------------------------- | |
| 208 | // device_rom_region - return a pointer to the | |
| 209 | // the device's ROM definitions | |
| 210 | //------------------------------------------------- | |
| 211 | ||
| 212 | const rom_entry *pf10_device::device_rom_region() const | |
| 213 | { | |
| 214 | return ROM_NAME(pf10 ); | |
| 215 | } | |
| 216 | ||
| 217 |
| r17612 | r17613 | |
|---|---|---|
| 40 | 40 | DEVICE CONFIGURATION MACROS |
| 41 | 41 | ***************************************************************************/ |
| 42 | 42 | |
| 43 | DECLARE_LEGACY_DEVICE(PF10, pf10); | |
| 43 | class pf10_device : public device_t | |
| 44 | { | |
| 45 | public: | |
| 46 | pf10_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 47 | ~pf10_device() { global_free(m_token); } | |
| 44 | 48 | |
| 49 | // access to legacy token | |
| 50 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 51 | protected: | |
| 52 | // device-level overrides | |
| 53 | virtual void device_config_complete(); | |
| 54 | virtual void device_start(); | |
| 55 | virtual void device_reset(); | |
| 56 | virtual const rom_entry *device_rom_region() const; | |
| 57 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 58 | private: | |
| 59 | // internal state | |
| 60 | void *m_token; | |
| 61 | }; | |
| 62 | ||
| 63 | extern const device_type PF10; | |
| 64 | ||
| 65 | ||
| 45 | 66 | #define MCFG_PF10_ADD(_tag) \ |
| 46 | 67 | MCFG_DEVICE_ADD(_tag, PF10, 0) \ |
| 47 | 68 |
| r17612 | r17613 | |
|---|---|---|
| 72 | 72 | assert(device != NULL); |
| 73 | 73 | assert(device->type() == PCF8593); |
| 74 | 74 | |
| 75 | return (pcf8593_t *) downcast< | |
| 75 | return (pcf8593_t *) downcast<p | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| r17612 | r17613 | |
| 470 | 470 | } |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | DEFINE_LEGACY_DEVICE(PCF8593, pcf8593); | |
| 473 | const device_type PCF8593 = &device_creator<pcf8593_device>; | |
| 474 | ||
| 475 | pcf8593_device::pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 476 | : device_t(mconfig, PCF8593, "PCF8593 RTC", tag, owner, clock) | |
| 477 | { | |
| 478 | m_token = global_alloc_array_clear(UINT8, sizeof(pcf8593_t)); | |
| 479 | } | |
| 480 | ||
| 481 | //------------------------------------------------- | |
| 482 | // device_config_complete - perform any | |
| 483 | // operations now that the configuration is | |
| 484 | // complete | |
| 485 | //------------------------------------------------- | |
| 486 | ||
| 487 | void pcf8593_device::device_config_complete() | |
| 488 | { | |
| 489 | } | |
| 490 | ||
| 491 | //------------------------------------------------- | |
| 492 | // device_start - device-specific startup | |
| 493 | //------------------------------------------------- | |
| 494 | ||
| 495 | void pcf8593_device::device_start() | |
| 496 | { | |
| 497 | DEVICE_START_NAME( pcf8593 )(this); | |
| 498 | } | |
| 499 | ||
| 500 | //------------------------------------------------- | |
| 501 | // device_reset - device-specific reset | |
| 502 | //------------------------------------------------- | |
| 503 | ||
| 504 | void pcf8593_device::device_reset() | |
| 505 | { | |
| 506 | DEVICE_RESET_NAME( pcf8593 )(this); | |
| 507 | } | |
| 508 | ||
| 509 |
| r17612 | r17613 | |
|---|---|---|
| 16 | 16 | MACROS |
| 17 | 17 | ***************************************************************************/ |
| 18 | 18 | |
| 19 | DECLARE_LEGACY_DEVICE(PCF8593, pcf8593); | |
| 19 | class pcf8593_device : public device_t | |
| 20 | { | |
| 21 | public: | |
| 22 | pcf8593_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 23 | ~pcf8593_device() { global_free(m_token); } | |
| 20 | 24 | |
| 25 | // access to legacy token | |
| 26 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 27 | protected: | |
| 28 | // device-level overrides | |
| 29 | virtual void device_config_complete(); | |
| 30 | virtual void device_start(); | |
| 31 | virtual void device_reset(); | |
| 32 | private: | |
| 33 | // internal state | |
| 34 | void *m_token; | |
| 35 | }; | |
| 36 | ||
| 37 | extern const device_type PCF8593; | |
| 38 | ||
| 39 | ||
| 21 | 40 | #define MCFG_PCF8593_ADD(_tag) \ |
| 22 | 41 | MCFG_DEVICE_ADD(_tag, PCF8593, 0) \ |
| 23 | 42 |
| r17612 | r17613 | |
|---|---|---|
| 183 | 183 | assert(device != NULL); |
| 184 | 184 | assert(device->type() == I8271); |
| 185 | 185 | |
| 186 | return (i8271_t *)downcast< | |
| 186 | return (i8271_t *)downcast<i8271 | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| r17612 | r17613 | |
| 1596 | 1596 | } |
| 1597 | 1597 | } |
| 1598 | 1598 | |
| 1599 | DEFINE_LEGACY_DEVICE(I8271, i8271); | |
| 1599 | const device_type I8271 = &device_creator<i8271_device>; | |
| 1600 | ||
| 1601 | i8271_device::i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1602 | : device_t(mconfig, I8271, "Intel 8271", tag, owner, clock) | |
| 1603 | { | |
| 1604 | m_token = global_alloc_array_clear(UINT8, sizeof(i8271_t)); | |
| 1605 | } | |
| 1606 | ||
| 1607 | //------------------------------------------------- | |
| 1608 | // device_config_complete - perform any | |
| 1609 | // operations now that the configuration is | |
| 1610 | // complete | |
| 1611 | //------------------------------------------------- | |
| 1612 | ||
| 1613 | void i8271_device::device_config_complete() | |
| 1614 | { | |
| 1615 | } | |
| 1616 | ||
| 1617 | //------------------------------------------------- | |
| 1618 | // device_start - device-specific startup | |
| 1619 | //------------------------------------------------- | |
| 1620 | ||
| 1621 | void i8271_device::device_start() | |
| 1622 | { | |
| 1623 | DEVICE_START_NAME( i8271 )(this); | |
| 1624 | } | |
| 1625 | ||
| 1626 | //------------------------------------------------- | |
| 1627 | // device_reset - device-specific reset | |
| 1628 | //------------------------------------------------- | |
| 1629 | ||
| 1630 | void i8271_device::device_reset() | |
| 1631 | { | |
| 1632 | DEVICE_RESET_NAME( i8271 )(this); | |
| 1633 | } | |
| 1634 | ||
| 1635 |
| r17612 | r17613 | |
|---|---|---|
| 11 | 11 | MACROS |
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 | |
| 14 | DECLARE_LEGACY_DEVICE(I8271, i8271); | |
| 14 | class i8271_device : public device_t | |
| 15 | { | |
| 16 | public: | |
| 17 | i8271_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 18 | ~i8271_device() { global_free(m_token); } | |
| 15 | 19 | |
| 20 | // access to legacy token | |
| 21 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 22 | protected: | |
| 23 | // device-level overrides | |
| 24 | virtual void device_config_complete(); | |
| 25 | virtual void device_start(); | |
| 26 | virtual void device_reset(); | |
| 27 | private: | |
| 28 | // internal state | |
| 29 | void *m_token; | |
| 30 | }; | |
| 31 | ||
| 32 | extern const device_type I8271; | |
| 33 | ||
| 34 | ||
| 16 | 35 | /*************************************************************************** |
| 17 | 36 | TYPE DEFINITIONS |
| 18 | 37 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 60 | 60 | assert(device != NULL); |
| 61 | 61 | assert(device->type() == UPD7002); |
| 62 | 62 | |
| 63 | return (uPD7002_t *)downcast< | |
| 63 | return (uPD7002_t *)downcast<uPD7002_devic | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | READ8_DEVICE_HANDLER ( uPD7002_EOC_r ) |
| r17612 | r17613 | |
| 230 | 230 | } |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | DEFINE_LEGACY_DEVICE(UPD7002, uPD7002); | |
| 233 | const device_type UPD7002 = &device_creator<uPD7002_device>; | |
| 234 | ||
| 235 | uPD7002_device::uPD7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 236 | : device_t(mconfig, UPD7002, "uPD7002", tag, owner, clock) | |
| 237 | { | |
| 238 | m_token = global_alloc_array_clear(UINT8, sizeof(uPD7002_t)); | |
| 239 | } | |
| 240 | ||
| 241 | //------------------------------------------------- | |
| 242 | // device_config_complete - perform any | |
| 243 | // operations now that the configuration is | |
| 244 | // complete | |
| 245 | //------------------------------------------------- | |
| 246 | ||
| 247 | void uPD7002_device::device_config_complete() | |
| 248 | { | |
| 249 | } | |
| 250 | ||
| 251 | //------------------------------------------------- | |
| 252 | // device_start - device-specific startup | |
| 253 | //------------------------------------------------- | |
| 254 | ||
| 255 | void uPD7002_device::device_start() | |
| 256 | { | |
| 257 | DEVICE_START_NAME( uPD7002 )(this); | |
| 258 | } | |
| 259 | ||
| 260 | //------------------------------------------------- | |
| 261 | // device_reset - device-specific reset | |
| 262 | //------------------------------------------------- | |
| 263 | ||
| 264 | void uPD7002_device::device_reset() | |
| 265 | { | |
| 266 | DEVICE_RESET_NAME( uPD7002 )(this); | |
| 267 | } | |
| 268 | ||
| 269 |
| r17612 | r17613 | |
|---|---|---|
| 15 | 15 | MACROS |
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 | |
| 18 | DECLARE_LEGACY_DEVICE(UPD7002, uPD7002); | |
| 18 | class uPD7002_device : public device_t | |
| 19 | { | |
| 20 | public: | |
| 21 | uPD7002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 22 | ~uPD7002_device() { global_free(m_token); } | |
| 19 | 23 | |
| 24 | // access to legacy token | |
| 25 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 26 | protected: | |
| 27 | // device-level overrides | |
| 28 | virtual void device_config_complete(); | |
| 29 | virtual void device_start(); | |
| 30 | virtual void device_reset(); | |
| 31 | private: | |
| 32 | // internal state | |
| 33 | void *m_token; | |
| 34 | }; | |
| 35 | ||
| 36 | extern const device_type UPD7002; | |
| 37 | ||
| 38 | ||
| 20 | 39 | /*************************************************************************** |
| 21 | 40 | TYPE DEFINITIONS |
| 22 | 41 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 35 | 35 | assert(device != NULL); |
| 36 | 36 | assert(device->type() == BETA_DISK); |
| 37 | 37 | |
| 38 | return (beta_disk_state *)downcast< | |
| 38 | return (beta_disk_state *)downcast<beta | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r17612 | r17613 | |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | DEFINE_LEGACY_DEVICE(BETA_DISK, beta_disk); | |
| 361 | const device_type BETA_DISK = &device_creator<beta_disk_device>; | |
| 362 | ||
| 363 | beta_disk_device::beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 364 | : device_t(mconfig, BETA_DISK, "Beta Disk Interface", tag, owner, clock) | |
| 365 | { | |
| 366 | m_token = global_alloc_array_clear(UINT8, sizeof(beta_disk_state)); | |
| 367 | } | |
| 368 | ||
| 369 | //------------------------------------------------- | |
| 370 | // device_config_complete - perform any | |
| 371 | // operations now that the configuration is | |
| 372 | // complete | |
| 373 | //------------------------------------------------- | |
| 374 | ||
| 375 | void beta_disk_device::device_config_complete() | |
| 376 | { | |
| 377 | m_shortname = "betadisk"; | |
| 378 | } | |
| 379 | ||
| 380 | //------------------------------------------------- | |
| 381 | // device_start - device-specific startup | |
| 382 | //------------------------------------------------- | |
| 383 | ||
| 384 | void beta_disk_device::device_start() | |
| 385 | { | |
| 386 | DEVICE_START_NAME( beta_disk )(this); | |
| 387 | } | |
| 388 | ||
| 389 | //------------------------------------------------- | |
| 390 | // device_reset - device-specific reset | |
| 391 | //------------------------------------------------- | |
| 392 | ||
| 393 | void beta_disk_device::device_reset() | |
| 394 | { | |
| 395 | DEVICE_RESET_NAME( beta_disk )(this); | |
| 396 | } | |
| 397 | ||
| 398 | //------------------------------------------------- | |
| 399 | // device_mconfig_additions - return a pointer to | |
| 400 | // the device's machine fragment | |
| 401 | //------------------------------------------------- | |
| 402 | ||
| 403 | machine_config_constructor beta_disk_device::device_mconfig_additions() const | |
| 404 | { | |
| 405 | return MACHINE_CONFIG_NAME( beta_disk ); | |
| 406 | } | |
| 407 | ||
| 408 | //------------------------------------------------- | |
| 409 | // device_rom_region - return a pointer to the | |
| 410 | // the device's ROM definitions | |
| 411 | //------------------------------------------------- | |
| 412 | ||
| 413 | const rom_entry *beta_disk_device::device_rom_region() const | |
| 414 | { | |
| 415 | return ROM_NAME(beta_disk ); | |
| 416 | } | |
| 417 | ||
| 418 |
| r17612 | r17613 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | #define BETA_DISK_TAG "beta" |
| 20 | 20 | |
| 21 | DECLARE_LEGACY_DEVICE(BETA_DISK, beta_disk); | |
| 21 | class beta_disk_device : public device_t | |
| 22 | { | |
| 23 | public: | |
| 24 | beta_disk_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 25 | ~beta_disk_device() { global_free(m_token); } | |
| 22 | 26 | |
| 27 | // access to legacy token | |
| 28 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 29 | protected: | |
| 30 | // device-level overrides | |
| 31 | virtual void device_config_complete(); | |
| 32 | virtual void device_start(); | |
| 33 | virtual void device_reset(); | |
| 34 | virtual const rom_entry *device_rom_region() const; | |
| 35 | virtual machine_config_constructor device_mconfig_additions() const; | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type BETA_DISK; | |
| 42 | ||
| 43 | ||
| 23 | 44 | #define MCFG_BETA_DISK_ADD(_tag) \ |
| 24 | 45 | MCFG_DEVICE_ADD(_tag, BETA_DISK, 0) |
| 25 | 46 |
| r17612 | r17613 | |
|---|---|---|
| 141 | 141 | { |
| 142 | 142 | assert(device != NULL); |
| 143 | 143 | assert(device->type() == AY31015); |
| 144 | return (ay31015_t *) downcast< | |
| 144 | return (ay31015_t *) downcast< | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| r17612 | r17613 | |
| 742 | 742 | } |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | DEFINE_LEGACY_DEVICE(AY31015, ay31015); | |
| 745 | const device_type AY31015 = &device_creator<ay31015_device>; | |
| 746 | ||
| 747 | ay31015_device::ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 748 | : device_t(mconfig, AY31015, "AY-3-1015", tag, owner, clock) | |
| 749 | { | |
| 750 | m_token = global_alloc_array_clear(UINT8, sizeof(ay31015_t)); | |
| 751 | } | |
| 752 | ||
| 753 | //------------------------------------------------- | |
| 754 | // device_config_complete - perform any | |
| 755 | // operations now that the configuration is | |
| 756 | // complete | |
| 757 | //------------------------------------------------- | |
| 758 | ||
| 759 | void ay31015_device::device_config_complete() | |
| 760 | { | |
| 761 | } | |
| 762 | ||
| 763 | //------------------------------------------------- | |
| 764 | // device_start - device-specific startup | |
| 765 | //------------------------------------------------- | |
| 766 | ||
| 767 | void ay31015_device::device_start() | |
| 768 | { | |
| 769 | DEVICE_START_NAME( ay31015 )(this); | |
| 770 | } | |
| 771 | ||
| 772 | //------------------------------------------------- | |
| 773 | // device_reset - device-specific reset | |
| 774 | //------------------------------------------------- | |
| 775 | ||
| 776 | void ay31015_device::device_reset() | |
| 777 | { | |
| 778 | DEVICE_RESET_NAME( ay31015 )(this); | |
| 779 | } | |
| 780 | ||
| 781 |
| r17612 | r17613 | |
|---|---|---|
| 104 | 104 | DEVICE INTERFACE |
| 105 | 105 | ***************************************************************************/ |
| 106 | 106 | |
| 107 | DECLARE_LEGACY_DEVICE(AY31015, ay31015); | |
| 107 | class ay31015_device : public device_t | |
| 108 | { | |
| 109 | public: | |
| 110 | ay31015_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 111 | ~ay31015_device() { global_free(m_token); } | |
| 112 | ||
| 113 | // access to legacy token | |
| 114 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 115 | protected: | |
| 116 | // device-level overrides | |
| 117 | virtual void device_config_complete(); | |
| 118 | virtual void device_start(); | |
| 119 | virtual void device_reset(); | |
| 120 | private: | |
| 121 | // internal state | |
| 122 | void *m_token; | |
| 123 | }; | |
| 124 | ||
| 125 | extern const device_type AY31015; | |
| 126 | ||
| 108 | 127 | #endif |
| r17612 | r17613 | |
|---|---|---|
| 111 | 111 | { |
| 112 | 112 | assert( device != NULL ); |
| 113 | 113 | assert( device->type() == MC6843 ); |
| 114 | return (mc6843_t*) downcast< | |
| 114 | return (mc6843_t*) downcast<m | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r17612 | r17613 | |
| 851 | 851 | } |
| 852 | 852 | } |
| 853 | 853 | |
| 854 | ||
| 854 | const device_type | |
| 855 | 855 | |
| 856 | mc6843_device::mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 857 | : device_t(mconfig, MC6843, "Motorola MC6843 floppy controller", tag, owner, clock) | |
| 858 | { | |
| 859 | m_token = global_alloc_array_clear(UINT8, sizeof(mc6843_t)); | |
| 860 | } | |
| 861 | ||
| 862 | //------------------------------------------------- | |
| 863 | // device_config_complete - perform any | |
| 864 | // operations now that the configuration is | |
| 865 | // complete | |
| 866 | //------------------------------------------------- | |
| 867 | ||
| 868 | void mc6843_device::device_config_complete() | |
| 869 | { | |
| 870 | } | |
| 871 | ||
| 872 | //------------------------------------------------- | |
| 873 | // device_start - device-specific startup | |
| 874 | //------------------------------------------------- | |
| 875 | ||
| 876 | void mc6843_device::device_start() | |
| 877 | { | |
| 878 | DEVICE_START_NAME( mc6843 )(this); | |
| 879 | } | |
| 880 | ||
| 881 | //------------------------------------------------- | |
| 882 | // device_reset - device-specific reset | |
| 883 | //------------------------------------------------- | |
| 884 | ||
| 885 | void mc6843_device::device_reset() | |
| 886 | { | |
| 887 | DEVICE_RESET_NAME( mc6843 )(this); | |
| 888 | } | |
| 889 | ||
| 890 | ||
| 891 |
| r17612 | r17613 | |
|---|---|---|
| 78 | 78 | assert(device != NULL); |
| 79 | 79 | assert(device->type() == MM58274C); |
| 80 | 80 | |
| 81 | return (mm58274c_t *)downcast< | |
| 81 | return (mm58274c_t *)downcast<mm58274c | |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | static attotime interrupt_period_table(int val) |
| r17612 | r17613 | |
| 538 | 538 | } |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | DEFINE_LEGACY_DEVICE(MM58274C, mm58274c); | |
| 541 | const device_type MM58274C = &device_creator<mm58274c_device>; | |
| 542 | ||
| 543 | mm58274c_device::mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 544 | : device_t(mconfig, MM58274C, "National Semiconductor MM58274C", tag, owner, clock) | |
| 545 | { | |
| 546 | m_token = global_alloc_array_clear(UINT8, sizeof(mm58274c_t)); | |
| 547 | } | |
| 548 | ||
| 549 | //------------------------------------------------- | |
| 550 | // device_config_complete - perform any | |
| 551 | // operations now that the configuration is | |
| 552 | // complete | |
| 553 | //------------------------------------------------- | |
| 554 | ||
| 555 | void mm58274c_device::device_config_complete() | |
| 556 | { | |
| 557 | } | |
| 558 | ||
| 559 | //------------------------------------------------- | |
| 560 | // device_start - device-specific startup | |
| 561 | //------------------------------------------------- | |
| 562 | ||
| 563 | void mm58274c_device::device_start() | |
| 564 | { | |
| 565 | DEVICE_START_NAME( mm58274c )(this); | |
| 566 | } | |
| 567 | ||
| 568 | //------------------------------------------------- | |
| 569 | // device_reset - device-specific reset | |
| 570 | //------------------------------------------------- | |
| 571 | ||
| 572 | void mm58274c_device::device_reset() | |
| 573 | { | |
| 574 | DEVICE_RESET_NAME( mm58274c )(this); | |
| 575 | } | |
| 576 | ||
| 577 |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | #ifndef MC6843_H |
| 10 | 10 | #define MC6843_H |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_DEVICE(MC6843, mc6843); | |
| 12 | class mc6843_device : public device_t | |
| 13 | { | |
| 14 | public: | |
| 15 | mc6843_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 16 | ~mc6843_device() { global_free(m_token); } | |
| 13 | 17 | |
| 18 | // access to legacy token | |
| 19 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 20 | protected: | |
| 21 | // device-level overrides | |
| 22 | virtual void device_config_complete(); | |
| 23 | virtual void device_start(); | |
| 24 | virtual void device_reset(); | |
| 25 | private: | |
| 26 | // internal state | |
| 27 | void *m_token; | |
| 28 | }; | |
| 14 | 29 | |
| 30 | extern const device_type MC6843; | |
| 31 | ||
| 32 | ||
| 33 | ||
| 15 | 34 | /* ---------- configuration ------------ */ |
| 16 | 35 | |
| 17 | 36 | typedef struct _mc6843_interface mc6843_interface; |
| r17612 | r17613 | |
|---|---|---|
| 5 | 5 | MACROS |
| 6 | 6 | ***************************************************************************/ |
| 7 | 7 | |
| 8 | DECLARE_LEGACY_DEVICE(MM58274C, mm58274c); | |
| 8 | class mm58274c_device : public device_t | |
| 9 | { | |
| 10 | public: | |
| 11 | mm58274c_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 12 | ~mm58274c_device() { global_free(m_token); } | |
| 9 | 13 | |
| 14 | // access to legacy token | |
| 15 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 16 | protected: | |
| 17 | // device-level overrides | |
| 18 | virtual void device_config_complete(); | |
| 19 | virtual void device_start(); | |
| 20 | virtual void device_reset(); | |
| 21 | private: | |
| 22 | // internal state | |
| 23 | void *m_token; | |
| 24 | }; | |
| 25 | ||
| 26 | extern const device_type MM58274C; | |
| 27 | ||
| 28 | ||
| 10 | 29 | /*************************************************************************** |
| 11 | 30 | FUNCTION PROTOTYPES |
| 12 | 31 | ***************************************************************************/ |
| r17612 | r17613 | |
|---|---|---|
| 74 | 74 | assert(device != NULL); |
| 75 | 75 | assert(device->type() == ATARI_FDC); |
| 76 | 76 | |
| 77 | return (atari_fdc_t *)downcast< | |
| 77 | return (atari_fdc_t *)downcast< | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | /***************************************************************************** |
| r17612 | r17613 | |
| 840 | 840 | } |
| 841 | 841 | } |
| 842 | 842 | |
| 843 | DEFINE_LEGACY_DEVICE(ATARI_FDC, atari_fdc); | |
| 843 | const device_type ATARI_FDC = &device_creator<atari_fdc_device>; | |
| 844 | ||
| 845 | atari_fdc_device::atari_fdc_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 846 | : device_t(mconfig, ATARI_FDC, "Atari FDC", tag, owner, clock) | |
| 847 | { | |
| 848 | m_token = global_alloc_array_clear(UINT8, sizeof(atari_fdc_t)); | |
| 849 | } | |
| 850 | ||
| 851 | //------------------------------------------------- | |
| 852 | // device_config_complete - perform any | |
| 853 | // operations now that the configuration is | |
| 854 | // complete | |
| 855 | //------------------------------------------------- | |
| 856 | ||
| 857 | void atari_fdc_device::device_config_complete() | |
| 858 | { | |
| 859 | } | |
| 860 | ||
| 861 | //------------------------------------------------- | |
| 862 | // device_start - device-specific startup | |
| 863 | //------------------------------------------------- | |
| 864 | ||
| 865 | void atari_fdc_device::device_start() | |
| 866 | { | |
| 867 | DEVICE_START_NAME( atari_fdc )(this); | |
| 868 | } | |
| 869 | ||
| 870 | //------------------------------------------------- | |
| 871 | // device_reset - device-specific reset | |
| 872 | //------------------------------------------------- | |
| 873 | ||
| 874 | void atari_fdc_device::device_reset() | |
| 875 | { | |
| 876 | DEVICE_RESET_NAME( atari_fdc )(this); | |
| 877 | } | |
| 878 | ||
| 879 | //------------------------------------------------- | |
| 880 | // device_mconfig_additions - return a pointer to | |
| 881 | // the device's machine fragment | |
| 882 | //------------------------------------------------- | |
| 883 | ||
| 884 | machine_config_constructor atari_fdc_device::device_mconfig_additions() const | |
| 885 | { | |
| 886 | return MACHINE_CONFIG_NAME( atari_fdc ); | |
| 887 | } | |
| 888 | ||
| 889 |
| r17612 | r17613 | |
|---|---|---|
| 199 | 199 | INLINE omti8621_state *get_safe_token(device_t *device) { |
| 200 | 200 | assert(device != NULL); |
| 201 | 201 | assert(device->type() == OMTI8621); |
| 202 | return (omti8621_state *) downcast< | |
| 202 | return (omti8621_state *) downcast<omti8621_devic | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /*************************************************************************** |
| r17612 | r17613 | |
| 1359 | 1359 | } |
| 1360 | 1360 | } |
| 1361 | 1361 | |
| 1362 | DEFINE_LEGACY_DEVICE(OMTI8621, omti8621); | |
| 1362 | const device_type OMTI8621 = &device_creator<omti8621_device>; | |
| 1363 | ||
| 1364 | omti8621_device::omti8621_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 1365 | : device_t(mconfig, OMTI8621, "OMTI 8621", tag, owner, clock) | |
| 1366 | { | |
| 1367 | m_token = global_alloc_array_clear(UINT8, sizeof(omti8621_state)); | |
| 1368 | } | |
| 1369 | ||
| 1370 | //------------------------------------------------- | |
| 1371 | // device_config_complete - perform any | |
| 1372 | // operations now that the configuration is | |
| 1373 | // complete | |
| 1374 | //------------------------------------------------- | |
| 1375 | ||
| 1376 | void omti8621_device::device_config_complete() | |
| 1377 | { | |
| 1378 | } | |
| 1379 | ||
| 1380 | //------------------------------------------------- | |
| 1381 | // device_start - device-specific startup | |
| 1382 | //------------------------------------------------- | |
| 1383 | ||
| 1384 | void omti8621_device::device_start() | |
| 1385 | { | |
| 1386 | DEVICE_START_NAME( omti8621 )(this); | |
| 1387 | } | |
| 1388 | ||
| 1389 | //------------------------------------------------- | |
| 1390 | // device_reset - device-specific reset | |
| 1391 | //------------------------------------------------- | |
| 1392 | ||
| 1393 | void omti8621_device::device_reset() | |
| 1394 | { | |
| 1395 | DEVICE_RESET_NAME( omti8621 )(this); | |
| 1396 | } | |
| 1397 | ||
| 1398 |
| r17612 | r17613 | |
|---|---|---|
| 171 | 171 | |
| 172 | 172 | /*----------- defined in audio/wswan.c -----------*/ |
| 173 | 173 | |
| 174 | DECLARE_LEGACY_SOUND_DEVICE(WSWAN, wswan_sound); | |
| 174 | class wswan_sound_device : public device_t, | |
| 175 | public device_sound_interface | |
| 176 | { | |
| 177 | public: | |
| 178 | wswan_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 179 | ~wswan_sound_device() { global_free(m_token); } | |
| 175 | 180 | |
| 181 | // access to legacy token | |
| 182 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 183 | protected: | |
| 184 | // device-level overrides | |
| 185 | virtual void device_config_complete(); | |
| 186 | virtual void device_start(); | |
| 187 | ||
| 188 | // sound stream update overrides | |
| 189 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 190 | private: | |
| 191 | // internal state | |
| 192 | void *m_token; | |
| 193 | }; | |
| 194 | ||
| 195 | extern const device_type WSWAN; | |
| 196 | ||
| 197 | ||
| 176 | 198 | WRITE8_DEVICE_HANDLER( wswan_sound_port_w ); |
| 177 | 199 | |
| 178 | 200 | #endif /* WSWAN_H_ */ |
| r17612 | r17613 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | /*----------- defined in audio/mac.c -----------*/ |
| 179 | 179 | |
| 180 | DECLARE_LEGACY_SOUND_DEVICE(MAC_SOUND, mac_sound); | |
| 180 | class mac_sound_device : public device_t, | |
| 181 | public device_sound_interface | |
| 182 | { | |
| 183 | public: | |
| 184 | mac_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 185 | ~mac_sound_device() { global_free(m_token); } | |
| 181 | 186 | |
| 187 | // access to legacy token | |
| 188 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 189 | protected: | |
| 190 | // device-level overrides | |
| 191 | virtual void device_config_complete(); | |
| 192 | virtual void device_start(); | |
| 193 | ||
| 194 | // sound stream update overrides | |
| 195 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 196 | private: | |
| 197 | // internal state | |
| 198 | void *m_token; | |
| 199 | }; | |
| 200 | ||
| 201 | extern const device_type MAC_SOUND; | |
| 202 | ||
| 203 | ||
| 182 | 204 | void mac_enable_sound( device_t *device, int on ); |
| 183 | 205 | void mac_set_sound_buffer( device_t *device, int buffer ); |
| 184 | 206 | void mac_set_volume( device_t *device, int volume ); |
| r17612 | r17613 | |
|---|---|---|
| 293 | 293 | void apollo_netserver_init(const char *root_path, apollo_netserver_transmit tx_data); |
| 294 | 294 | |
| 295 | 295 | /*----------- video/apollo.c -----------*/ |
| 296 | class apollo_mono_device : public device_t | |
| 297 | { | |
| 298 | public: | |
| 299 | apollo_mono_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 300 | ~apollo_mono_device() { global_free(m_token); } | |
| 296 | 301 | |
| 302 | // access to legacy token | |
| 303 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 304 | private: | |
| 305 | // internal state | |
| 306 | void *m_token; | |
| 307 | }; | |
| 308 | ||
| 309 | ||
| 297 | 310 | #define APOLLO_SCREEN_TAG "apollo_screen" |
| 298 | 311 | |
| 299 | DECLARE_LEGACY_DEVICE(APOLLO_MONO19I, apollo_mono19i); | |
| 312 | class apollo_mono19i_device : public apollo_mono_device | |
| 313 | { | |
| 314 | public: | |
| 315 | apollo_mono19i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 316 | protected: | |
| 317 | // device-level overrides | |
| 318 | virtual void device_config_complete(); | |
| 319 | virtual void device_start(); | |
| 320 | virtual void device_reset(); | |
| 321 | private: | |
| 322 | // internal state | |
| 323 | }; | |
| 300 | 324 | |
| 325 | extern const device_type APOLLO_MONO19I; | |
| 326 | ||
| 327 | ||
| 301 | 328 | #define MCFG_APOLLO_MONO19I_ADD(_tag) \ |
| 302 | 329 | MCFG_FRAGMENT_ADD(apollo_mono19i) \ |
| 303 | 330 | MCFG_DEVICE_ADD(_tag, APOLLO_MONO19I, 0) |
| r17612 | r17613 | |
| 306 | 333 | |
| 307 | 334 | MACHINE_CONFIG_EXTERN( apollo_mono19i ); |
| 308 | 335 | |
| 309 | DECLARE_LEGACY_DEVICE(APOLLO_MONO15I, apollo_mono15i); | |
| 336 | class apollo_mono15i_device : public apollo_mono_device | |
| 337 | { | |
| 338 | public: | |
| 339 | apollo_mono15i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 340 | protected: | |
| 341 | // device-level overrides | |
| 342 | virtual void device_config_complete(); | |
| 343 | virtual void device_start(); | |
| 344 | virtual void device_reset(); | |
| 345 | private: | |
| 346 | // internal state | |
| 347 | }; | |
| 310 | 348 | |
| 349 | extern const device_type APOLLO_MONO15I; | |
| 350 | ||
| 351 | ||
| 311 | 352 | #define MCFG_APOLLO_MONO15I_ADD( _tag) \ |
| 312 | 353 | MCFG_FRAGMENT_ADD(apollo_mono15i) \ |
| 313 | 354 | MCFG_DEVICE_ADD(_tag, APOLLO_MONO15I, 0) |
| r17612 | r17613 | |
|---|---|---|
| 158 | 158 | |
| 159 | 159 | /*----------- defined in audio/lynx.c -----------*/ |
| 160 | 160 | |
| 161 | DECLARE_LEGACY_SOUND_DEVICE(LYNX, lynx_sound); | |
| 162 | DECLARE_LEGACY_SOUND_DEVICE(LYNX2, lynx2_sound); | |
| 161 | class lynx_sound_device : public device_t, | |
| 162 | public device_sound_interface | |
| 163 | { | |
| 164 | public: | |
| 165 | lynx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 166 | lynx_sound_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 167 | ~lynx_sound_device() { global_free(m_token); } | |
| 163 | 168 | |
| 169 | // access to legacy token | |
| 170 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 171 | protected: | |
| 172 | // device-level overrides | |
| 173 | virtual void device_config_complete(); | |
| 174 | virtual void device_start(); | |
| 175 | virtual void device_reset(); | |
| 176 | ||
| 177 | // sound stream update overrides | |
| 178 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 179 | private: | |
| 180 | // internal state | |
| 181 | void *m_token; | |
| 182 | }; | |
| 183 | ||
| 184 | extern const device_type LYNX; | |
| 185 | ||
| 186 | class lynx2_sound_device : public lynx_sound_device | |
| 187 | { | |
| 188 | public: | |
| 189 | lynx2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 190 | ||
| 191 | protected: | |
| 192 | // device-level overrides | |
| 193 | virtual void device_start(); | |
| 194 | ||
| 195 | // sound stream update overrides | |
| 196 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 197 | }; | |
| 198 | ||
| 199 | extern const device_type LYNX2; | |
| 200 | ||
| 201 | ||
| 164 | 202 | void lynx_audio_write(device_t *device, int offset, UINT8 data); |
| 165 | 203 | UINT8 lynx_audio_read(device_t *device, int offset); |
| 166 | 204 | void lynx_audio_count_down(device_t *device, int nr); |
| r17612 | r17613 | |
|---|---|---|
| 160 | 160 | DEVICE INTERFACE |
| 161 | 161 | ***************************************************************************/ |
| 162 | 162 | |
| 163 | DECLARE_LEGACY_DEVICE(MC68328, mc68328); | |
| 163 | class mc68328_device : public device_t | |
| 164 | { | |
| 165 | public: | |
| 166 | mc68328_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 167 | ~mc68328_device() { global_free(m_token); } | |
| 164 | 168 | |
| 169 | // access to legacy token | |
| 170 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 171 | protected: | |
| 172 | // device-level overrides | |
| 173 | virtual void device_config_complete(); | |
| 174 | virtual void device_start(); | |
| 175 | virtual void device_reset(); | |
| 176 | private: | |
| 177 | // internal state | |
| 178 | void *m_token; | |
| 179 | }; | |
| 180 | ||
| 181 | extern const device_type MC68328; | |
| 182 | ||
| 183 | ||
| 165 | 184 | /*----------- defined in video/mc68328.c -----------*/ |
| 166 | 185 | |
| 167 | 186 | /*************************************************************************** |
| r17612 | r17613 | |
|---|---|---|
| 60 | 60 | |
| 61 | 61 | /*----------- defined in audio/channelf.c -----------*/ |
| 62 | 62 | |
| 63 | DECLARE_LEGACY_SOUND_DEVICE(CHANNELF, channelf_sound); | |
| 63 | class channelf_sound_device : public device_t, | |
| 64 | public device_sound_interface | |
| 65 | { | |
| 66 | public: | |
| 67 | channelf_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 68 | ~channelf_sound_device() { global_free(m_token); } | |
| 64 | 69 | |
| 70 | // access to legacy token | |
| 71 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 72 | protected: | |
| 73 | // device-level overrides | |
| 74 | virtual void device_config_complete(); | |
| 75 | virtual void device_start(); | |
| 76 | ||
| 77 | // sound stream update overrides | |
| 78 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 79 | private: | |
| 80 | // internal state | |
| 81 | void *m_token; | |
| 82 | }; | |
| 83 | ||
| 84 | extern const device_type CHANNELF; | |
| 85 | ||
| 86 | ||
| 65 | 87 | void channelf_sound_w(device_t *device, int mode); |
| 66 | 88 | |
| 67 | 89 |
| r17612 | r17613 | |
|---|---|---|
| 35 | 35 | |
| 36 | 36 | /*----------- defined in audio/gmaster.c -----------*/ |
| 37 | 37 | |
| 38 | DECLARE_LEGACY_SOUND_DEVICE(GMASTER, gmaster_sound); | |
| 38 | class gmaster_sound_device : public device_t, | |
| 39 | public device_sound_interface | |
| 40 | { | |
| 41 | public: | |
| 42 | gmaster_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 43 | ~gmaster_sound_device() { global_free(m_token); } | |
| 39 | 44 | |
| 45 | // access to legacy token | |
| 46 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 47 | protected: | |
| 48 | // device-level overrides | |
| 49 | virtual void device_config_complete(); | |
| 50 | virtual void device_start(); | |
| 51 | ||
| 52 | // sound stream update overrides | |
| 53 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 54 | private: | |
| 55 | // internal state | |
| 56 | void *m_token; | |
| 57 | }; | |
| 58 | ||
| 59 | extern const device_type GMASTER; | |
| 60 | ||
| 61 | ||
| 40 | 62 | int gmaster_io_callback(device_t *device, int ioline, int state); |
| 41 | 63 | |
| 42 | 64 | #endif /* __GMASTER_H__ */ |
| r17612 | r17613 | |
|---|---|---|
| 115 | 115 | |
| 116 | 116 | /*----------- defined in audio/special.c -----------*/ |
| 117 | 117 | |
| 118 | DECLARE_LEGACY_SOUND_DEVICE(SPECIMX, specimx_sound); | |
| 118 | class specimx_sound_device : public device_t, | |
| 119 | public device_sound_interface | |
| 120 | { | |
| 121 | public: | |
| 122 | specimx_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 123 | ~specimx_sound_device() { global_free(m_token); } | |
| 119 | 124 | |
| 125 | // access to legacy token | |
| 126 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 127 | protected: | |
| 128 | // device-level overrides | |
| 129 | virtual void device_config_complete(); | |
| 130 | virtual void device_start(); | |
| 131 | ||
| 132 | // sound stream update overrides | |
| 133 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 134 | private: | |
| 135 | // internal state | |
| 136 | void *m_token; | |
| 137 | }; | |
| 138 | ||
| 139 | extern const device_type SPECIMX; | |
| 140 | ||
| 141 | ||
| 120 | 142 | void specimx_set_input(device_t *device, int index, int state); |
| 121 | 143 | |
| 122 | 144 | #endif /* SPECIAL_H_ */ |
| r17612 | r17613 | |
|---|---|---|
| 127 | 127 | void odyssey2_ef9341_w( running_machine &machine, int command, int b, UINT8 data ); |
| 128 | 128 | UINT8 odyssey2_ef9341_r( running_machine &machine, int command, int b ); |
| 129 | 129 | |
| 130 | DECLARE_LEGACY_SOUND_DEVICE(ODYSSEY2, odyssey2_sound); | |
| 130 | class odyssey2_sound_device : public device_t, | |
| 131 | public device_sound_interface | |
| 132 | { | |
| 133 | public: | |
| 134 | odyssey2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 135 | protected: | |
| 136 | // device-level overrides | |
| 137 | virtual void device_config_complete(); | |
| 138 | virtual void device_start(); | |
| 131 | 139 | |
| 140 | // sound stream update overrides | |
| 141 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 142 | private: | |
| 143 | // internal state | |
| 144 | }; | |
| 145 | ||
| 146 | extern const device_type ODYSSEY2; | |
| 147 | ||
| 148 | ||
| 132 | 149 | /*----------- defined in machine/odyssey2.c -----------*/ |
| 133 | 150 | |
| 134 | 151 | MACHINE_RESET( odyssey2 ); |
| r17612 | r17613 | |
|---|---|---|
| 59 | 59 | |
| 60 | 60 | /*----------- defined in audio/svision.c -----------*/ |
| 61 | 61 | |
| 62 | DECLARE_LEGACY_SOUND_DEVICE(SVISION, svision_sound); | |
| 62 | class svision_sound_device : public device_t, | |
| 63 | public device_sound_interface | |
| 64 | { | |
| 65 | public: | |
| 66 | svision_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 67 | ~svision_sound_device() { global_free(m_token); } | |
| 63 | 68 | |
| 69 | // access to legacy token | |
| 70 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 71 | protected: | |
| 72 | // device-level overrides | |
| 73 | virtual void device_config_complete(); | |
| 74 | virtual void device_start(); | |
| 75 | ||
| 76 | // sound stream update overrides | |
| 77 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 78 | private: | |
| 79 | // internal state | |
| 80 | void *m_token; | |
| 81 | }; | |
| 82 | ||
| 83 | extern const device_type SVISION; | |
| 84 | ||
| 85 | ||
| 64 | 86 | int *svision_dma_finished(device_t *device); |
| 65 | 87 | void svision_sound_decrement(device_t *device); |
| 66 | 88 | void svision_soundport_w(device_t *device, int which, int offset, int data); |
| r17612 | r17613 | |
|---|---|---|
| 106 | 106 | |
| 107 | 107 | /*----------- defined in audio/vc4000.c -----------*/ |
| 108 | 108 | |
| 109 | DECLARE_LEGACY_SOUND_DEVICE(VC4000, vc4000_sound); | |
| 109 | class vc4000_sound_device : public device_t, | |
| 110 | public device_sound_interface | |
| 111 | { | |
| 112 | public: | |
| 113 | vc4000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 114 | ~vc4000_sound_device() { global_free(m_token); } | |
| 115 | ||
| 116 | // access to legacy token | |
| 117 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 118 | protected: | |
| 119 | // device-level overrides | |
| 120 | virtual void device_config_complete(); | |
| 121 | virtual void device_start(); | |
| 122 | ||
| 123 | // sound stream update overrides | |
| 124 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 125 | private: | |
| 126 | // internal state | |
| 127 | void *m_token; | |
| 128 | }; | |
| 129 | ||
| 130 | extern const device_type VC4000; | |
| 131 | ||
| 110 | 132 | void vc4000_soundport_w (device_t *device, int mode, int data); |
| 111 | 133 | |
| 112 | 134 |
| r17612 | r17613 | |
|---|---|---|
| 239 | 239 | assert(device != NULL); |
| 240 | 240 | assert(device->type() == VDT911); |
| 241 | 241 | |
| 242 | return (vdt_t *)downcast< | |
| 242 | return (vdt_t *)downcast<vdt911_devic | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | /* |
| r17612 | r17613 | |
| 287 | 287 | } |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | ||
| 290 | const device_type | |
| 291 | 291 | |
| 292 | vdt911_device::vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 293 | : device_t(mconfig, VDT911, "911 VDT", tag, owner, clock) | |
| 294 | { | |
| 295 | m_token = global_alloc_array_clear(UINT8, sizeof(vdt_t)); | |
| 296 | } | |
| 297 | ||
| 298 | //------------------------------------------------- | |
| 299 | // device_config_complete - perform any | |
| 300 | // operations now that the configuration is | |
| 301 | // complete | |
| 302 | //------------------------------------------------- | |
| 303 | ||
| 304 | void vdt911_device::device_config_complete() | |
| 305 | { | |
| 306 | } | |
| 307 | ||
| 308 | //------------------------------------------------- | |
| 309 | // device_start - device-specific startup | |
| 310 | //------------------------------------------------- | |
| 311 | ||
| 312 | void vdt911_device::device_start() | |
| 313 | { | |
| 314 | DEVICE_START_NAME( vdt911 )(this); | |
| 315 | } | |
| 316 | ||
| 317 | ||
| 318 | ||
| 292 | 319 | /* |
| 293 | 320 | timer callback to toggle blink state |
| 294 | 321 | */ |
| r17612 | r17613 | |
|---|---|---|
| 43 | 43 | PALETTE_INIT( vdt911 ); |
| 44 | 44 | |
| 45 | 45 | void vdt911_init(running_machine &machine); |
| 46 | DECLARE_LEGACY_DEVICE(VDT911, vdt911); | |
| 46 | class vdt911_device : public device_t | |
| 47 | { | |
| 48 | public: | |
| 49 | vdt911_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 50 | ~vdt911_device() { global_free(m_token); } | |
| 47 | 51 | |
| 52 | // access to legacy token | |
| 53 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 54 | protected: | |
| 55 | // device-level overrides | |
| 56 | virtual void device_config_complete(); | |
| 57 | virtual void device_start(); | |
| 58 | private: | |
| 59 | // internal state | |
| 60 | void *m_token; | |
| 61 | }; | |
| 62 | ||
| 63 | extern const device_type VDT911; | |
| 64 | ||
| 65 | ||
| 48 | 66 | #define MCFG_VDT911_VIDEO_ADD(_tag, _intf) \ |
| 49 | 67 | MCFG_DEVICE_ADD(_tag, VDT911, 0) \ |
| 50 | 68 | MCFG_DEVICE_CONFIG(_intf) |
| r17612 | r17613 | |
|---|---|---|
| 3394 | 3394 | assert(device != NULL); |
| 3395 | 3395 | assert(device->type() == SAA505X); |
| 3396 | 3396 | |
| 3397 | return (teletext_t *)downcast< | |
| 3397 | return (teletext_t *)downcast<s | |
| 3398 | 3398 | } |
| 3399 | 3399 | |
| 3400 | 3400 | static DEVICE_START( saa505x ) |
| r17612 | r17613 | |
| 3425 | 3425 | } |
| 3426 | 3426 | } |
| 3427 | 3427 | |
| 3428 | ||
| 3428 | const device_type | |
| 3429 | 3429 | |
| 3430 | saa505x_device::saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 3431 | : device_t(mconfig, SAA505X, "SAA505x Video", tag, owner, clock) | |
| 3432 | { | |
| 3433 | m_token = global_alloc_array_clear(UINT8, sizeof(teletext_t)); | |
| 3434 | } | |
| 3435 | ||
| 3436 | //------------------------------------------------- | |
| 3437 | // device_config_complete - perform any | |
| 3438 | // operations now that the configuration is | |
| 3439 | // complete | |
| 3440 | //------------------------------------------------- | |
| 3441 | ||
| 3442 | void saa505x_device::device_config_complete() | |
| 3443 | { | |
| 3444 | } | |
| 3445 | ||
| 3446 | //------------------------------------------------- | |
| 3447 | // device_start - device-specific startup | |
| 3448 | //------------------------------------------------- | |
| 3449 | ||
| 3450 | void saa505x_device::device_start() | |
| 3451 | { | |
| 3452 | DEVICE_START_NAME( saa505x )(this); | |
| 3453 | } | |
| 3454 | ||
| 3455 | ||
| 3456 | ||
| 3430 | 3457 | void teletext_data_w(device_t *device, int offset, int data) |
| 3431 | 3458 | { |
| 3432 | 3459 | teletext_t *tt = get_safe_token(device); |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | void teletext_data_w(device_t *device, int offset, int data); |
| 21 | 21 | void teletext_F1(device_t *device); |
| 22 | 22 | |
| 23 | DECLARE_LEGACY_DEVICE(SAA505X, saa505x); | |
| 23 | class saa505x_device : public device_t | |
| 24 | { | |
| 25 | public: | |
| 26 | saa505x_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~saa505x_device() { global_free(m_token); } | |
| 24 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | private: | |
| 36 | // internal state | |
| 37 | void *m_token; | |
| 38 | }; | |
| 39 | ||
| 40 | extern const device_type SAA505X; | |
| 41 | ||
| 42 | ||
| 25 | 43 | #define MCFG_SAA505X_VIDEO_ADD(_tag, _intf) \ |
| 26 | 44 | MCFG_DEVICE_ADD(_tag, SAA505X, 0) \ |
| 27 | 45 | MCFG_DEVICE_CONFIG(_intf) |
| r17612 | r17613 | |
|---|---|---|
| 113 | 113 | INLINE screen_data_t *get_safe_token(device_t *device) { |
| 114 | 114 | assert(device != NULL); |
| 115 | 115 | assert(device->type() == APOLLO_MONO15I || device->type() == APOLLO_MONO19I ); |
| 116 | return (screen_data_t *)downcast< | |
| 116 | return (screen_data_t *)downcast< | |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | /*************************************************************************** |
| r17612 | r17613 | |
| 876 | 876 | } |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | DEFINE_LEGACY_DEVICE(APOLLO_MONO19I, apollo_mono19i); | |
| 880 | DEFINE_LEGACY_DEVICE(APOLLO_MONO15I, apollo_mono15i); | |
| 879 | apollo_mono_device::apollo_mono_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 880 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 881 | { | |
| 882 | m_token = global_alloc_array_clear(UINT8, sizeof(screen_data_t)); | |
| 883 | } | |
| 884 | ||
| 885 | const device_type APOLLO_MONO19I = &device_creator<apollo_mono19i_device>; | |
| 886 | ||
| 887 | apollo_mono19i_device::apollo_mono19i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 888 | : apollo_mono_device(mconfig, APOLLO_MONO19I, "Apollo 19\" Monochrome Screen", tag, owner, clock) | |
| 889 | { | |
| 890 | } | |
| 891 | ||
| 892 | //------------------------------------------------- | |
| 893 | // device_config_complete - perform any | |
| 894 | // operations now that the configuration is | |
| 895 | // complete | |
| 896 | //------------------------------------------------- | |
| 897 | ||
| 898 | void apollo_mono19i_device::device_config_complete() | |
| 899 | { | |
| 900 | } | |
| 901 | ||
| 902 | //------------------------------------------------- | |
| 903 | // device_start - device-specific startup | |
| 904 | //------------------------------------------------- | |
| 905 | ||
| 906 | void apollo_mono19i_device::device_start() | |
| 907 | { | |
| 908 | DEVICE_START_NAME( apollo_mono19i )(this); | |
| 909 | } | |
| 910 | ||
| 911 | //------------------------------------------------- | |
| 912 | // device_reset - device-specific reset | |
| 913 | //------------------------------------------------- | |
| 914 | ||
| 915 | void apollo_mono19i_device::device_reset() | |
| 916 | { | |
| 917 | DEVICE_RESET_NAME( apollo_mono19i )(this); | |
| 918 | } | |
| 919 | ||
| 920 | ||
| 921 | const device_type APOLLO_MONO15I = &device_creator<apollo_mono15i_device>; | |
| 922 | ||
| 923 | apollo_mono15i_device::apollo_mono15i_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 924 | : apollo_mono_device(mconfig, APOLLO_MONO15I, "Apollo 15\" Monochrome Screen", tag, owner, clock) | |
| 925 | { | |
| 926 | } | |
| 927 | ||
| 928 | //------------------------------------------------- | |
| 929 | // device_config_complete - perform any | |
| 930 | // operations now that the configuration is | |
| 931 | // complete | |
| 932 | //------------------------------------------------- | |
| 933 | ||
| 934 | void apollo_mono15i_device::device_config_complete() | |
| 935 | { | |
| 936 | } | |
| 937 | ||
| 938 | //------------------------------------------------- | |
| 939 | // device_start - device-specific startup | |
| 940 | //------------------------------------------------- | |
| 941 | ||
| 942 | void apollo_mono15i_device::device_start() | |
| 943 | { | |
| 944 | DEVICE_START_NAME( apollo_mono15i )(this); | |
| 945 | } | |
| 946 | ||
| 947 | //------------------------------------------------- | |
| 948 | // device_reset - device-specific reset | |
| 949 | //------------------------------------------------- | |
| 950 | ||
| 951 | void apollo_mono15i_device::device_reset() | |
| 952 | { | |
| 953 | DEVICE_RESET_NAME( apollo_mono15i )(this); | |
| 954 | } | |
| 955 | ||
| 956 |
| r17612 | r17613 | |
|---|---|---|
| 229 | 229 | assert(device != NULL); |
| 230 | 230 | assert(device->type() == VIC3); |
| 231 | 231 | |
| 232 | return (vic3_state *)downcast< | |
| 232 | return (vic3_state *)downcast<vi | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | INLINE const vic3_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2168 | 2168 | } |
| 2169 | 2169 | } |
| 2170 | 2170 | |
| 2171 | DEFINE_LEGACY_DEVICE(VIC3, vic3); | |
| 2171 | const device_type VIC3 = &device_creator<vic3_device>; | |
| 2172 | ||
| 2173 | vic3_device::vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2174 | : device_t(mconfig, VIC3, "4567 VIC III", tag, owner, clock) | |
| 2175 | { | |
| 2176 | m_token = global_alloc_array_clear(UINT8, sizeof(vic3_state)); | |
| 2177 | } | |
| 2178 | ||
| 2179 | //------------------------------------------------- | |
| 2180 | // device_config_complete - perform any | |
| 2181 | // operations now that the configuration is | |
| 2182 | // complete | |
| 2183 | //------------------------------------------------- | |
| 2184 | ||
| 2185 | void vic3_device::device_config_complete() | |
| 2186 | { | |
| 2187 | } | |
| 2188 | ||
| 2189 | //------------------------------------------------- | |
| 2190 | // device_start - device-specific startup | |
| 2191 | //------------------------------------------------- | |
| 2192 | ||
| 2193 | void vic3_device::device_start() | |
| 2194 | { | |
| 2195 | DEVICE_START_NAME( vic3 )(this); | |
| 2196 | } | |
| 2197 | ||
| 2198 | //------------------------------------------------- | |
| 2199 | // device_reset - device-specific reset | |
| 2200 | //------------------------------------------------- | |
| 2201 | ||
| 2202 | void vic3_device::device_reset() | |
| 2203 | { | |
| 2204 | DEVICE_RESET_NAME( vic3 )(this); | |
| 2205 | } | |
| 2206 | ||
| 2207 |
| r17612 | r17613 | |
|---|---|---|
| 137 | 137 | DEVICE CONFIGURATION MACROS |
| 138 | 138 | ***************************************************************************/ |
| 139 | 139 | |
| 140 | DECLARE_LEGACY_DEVICE(VIC3, vic3); | |
| 140 | class vic3_device : public device_t | |
| 141 | { | |
| 142 | public: | |
| 143 | vic3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 144 | ~vic3_device() { global_free(m_token); } | |
| 141 | 145 | |
| 146 | // access to legacy token | |
| 147 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 148 | protected: | |
| 149 | // device-level overrides | |
| 150 | virtual void device_config_complete(); | |
| 151 | virtual void device_start(); | |
| 152 | virtual void device_reset(); | |
| 153 | private: | |
| 154 | // internal state | |
| 155 | void *m_token; | |
| 156 | }; | |
| 157 | ||
| 158 | extern const device_type VIC3; | |
| 159 | ||
| 160 | ||
| 142 | 161 | #define MCFG_VIC3_ADD(_tag, _interface) \ |
| 143 | 162 | MCFG_DEVICE_ADD(_tag, VIC3, 0) \ |
| 144 | 163 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 58 | 58 | assert(device != NULL); |
| 59 | 59 | assert(device->type() == VT100_VIDEO); |
| 60 | 60 | |
| 61 | return (vt_video_t *)downcast< | |
| 61 | return (vt_video_t *)downcast<vt100_video | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | INLINE const vt_video_interface *get_interface(device_t *device) |
| r17612 | r17613 | |
| 473 | 473 | } |
| 474 | 474 | } |
| 475 | 475 | |
| 476 | DEFINE_LEGACY_DEVICE(VT100_VIDEO, vt100_video); | |
| 476 | const device_type VT100_VIDEO = &device_creator<vt100_video_device>; | |
| 477 | ||
| 478 | vt100_video_device::vt100_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 479 | : device_t(mconfig, VT100_VIDEO, "VT100 Video", tag, owner, clock) | |
| 480 | { | |
| 481 | m_token = global_alloc_array_clear(UINT8, sizeof(vt_video_t)); | |
| 482 | } | |
| 483 | ||
| 484 | //------------------------------------------------- | |
| 485 | // device_config_complete - perform any | |
| 486 | // operations now that the configuration is | |
| 487 | // complete | |
| 488 | //------------------------------------------------- | |
| 489 | ||
| 490 | void vt100_video_device::device_config_complete() | |
| 491 | { | |
| 492 | } | |
| 493 | ||
| 494 | //------------------------------------------------- | |
| 495 | // device_start - device-specific startup | |
| 496 | //------------------------------------------------- | |
| 497 | ||
| 498 | void vt100_video_device::device_start() | |
| 499 | { | |
| 500 | DEVICE_START_NAME( vt_video )(this); | |
| 501 | } | |
| 502 | ||
| 503 | //------------------------------------------------- | |
| 504 | // device_reset - device-specific reset | |
| 505 | //------------------------------------------------- | |
| 506 | ||
| 507 | void vt100_video_device::device_reset() | |
| 508 | { | |
| 509 | DEVICE_RESET_NAME( vt_video )(this); | |
| 510 | } | |
| 511 | ||
| 512 |
| r17612 | r17613 | |
|---|---|---|
| 20 | 20 | MACROS / CONSTANTS |
| 21 | 21 | ***************************************************************************/ |
| 22 | 22 | |
| 23 | DECLARE_LEGACY_DEVICE(VT100_VIDEO, vt100_video); | |
| 23 | class vt100_video_device : public device_t | |
| 24 | { | |
| 25 | public: | |
| 26 | vt100_video_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 27 | ~vt100_video_device() { global_free(m_token); } | |
| 24 | 28 | |
| 29 | // access to legacy token | |
| 30 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 31 | protected: | |
| 32 | // device-level overrides | |
| 33 | virtual void device_config_complete(); | |
| 34 | virtual void device_start(); | |
| 35 | virtual void device_reset(); | |
| 36 | private: | |
| 37 | // internal state | |
| 38 | void *m_token; | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type VT100_VIDEO; | |
| 42 | ||
| 43 | ||
| 25 | 44 | #define MCFG_VT100_VIDEO_ADD(_tag, _intrf) \ |
| 26 | 45 | MCFG_DEVICE_ADD(_tag, VT100_VIDEO, 0) \ |
| 27 | 46 | MCFG_DEVICE_CONFIG(_intrf) |
| r17612 | r17613 | |
|---|---|---|
| 162 | 162 | assert(device != NULL); |
| 163 | 163 | assert(device->type() == VDC8563); |
| 164 | 164 | |
| 165 | return (vdc8563_state *)downcast< | |
| 165 | return (vdc8563_state *)downcast<vd | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | INLINE const vdc8563_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 676 | 676 | } |
| 677 | 677 | } |
| 678 | 678 | |
| 679 | DEFINE_LEGACY_DEVICE(VDC8563, vdc8563); | |
| 679 | const device_type VDC8563 = &device_creator<vdc8563_device>; | |
| 680 | ||
| 681 | vdc8563_device::vdc8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 682 | : device_t(mconfig, VDC8563, "8563 / 8568 VDC", tag, owner, clock) | |
| 683 | { | |
| 684 | m_token = global_alloc_array_clear(UINT8, sizeof(vdc8563_state)); | |
| 685 | } | |
| 686 | ||
| 687 | //------------------------------------------------- | |
| 688 | // device_config_complete - perform any | |
| 689 | // operations now that the configuration is | |
| 690 | // complete | |
| 691 | //------------------------------------------------- | |
| 692 | ||
| 693 | void vdc8563_device::device_config_complete() | |
| 694 | { | |
| 695 | } | |
| 696 | ||
| 697 | //------------------------------------------------- | |
| 698 | // device_start - device-specific startup | |
| 699 | //------------------------------------------------- | |
| 700 | ||
| 701 | void vdc8563_device::device_start() | |
| 702 | { | |
| 703 | DEVICE_START_NAME( vdc8563 )(this); | |
| 704 | } | |
| 705 | ||
| 706 | //------------------------------------------------- | |
| 707 | // device_reset - device-specific reset | |
| 708 | //------------------------------------------------- | |
| 709 | ||
| 710 | void vdc8563_device::device_reset() | |
| 711 | { | |
| 712 | DEVICE_RESET_NAME( vdc8563 )(this); | |
| 713 | } | |
| 714 | ||
| 715 |
| r17612 | r17613 | |
|---|---|---|
| 29 | 29 | DEVICE CONFIGURATION MACROS |
| 30 | 30 | ***************************************************************************/ |
| 31 | 31 | |
| 32 | DECLARE_LEGACY_DEVICE(VDC8563, vdc8563); | |
| 32 | class vdc8563_device : public device_t | |
| 33 | { | |
| 34 | public: | |
| 35 | vdc8563_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | ~vdc8563_device() { global_free(m_token); } | |
| 33 | 37 | |
| 38 | // access to legacy token | |
| 39 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 40 | protected: | |
| 41 | // device-level overrides | |
| 42 | virtual void device_config_complete(); | |
| 43 | virtual void device_start(); | |
| 44 | virtual void device_reset(); | |
| 45 | private: | |
| 46 | // internal state | |
| 47 | void *m_token; | |
| 48 | }; | |
| 49 | ||
| 50 | extern const device_type VDC8563; | |
| 51 | ||
| 52 | ||
| 34 | 53 | #define MCFG_VDC8563_ADD(_tag, _interface) \ |
| 35 | 54 | MCFG_DEVICE_ADD(_tag, VDC8563, 0) \ |
| 36 | 55 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 269 | 269 | assert(device != NULL); |
| 270 | 270 | assert(device->type() == VIC2); |
| 271 | 271 | |
| 272 | return (vic2_state *)downcast< | |
| 272 | return (vic2_state *)downcast<vi | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | INLINE const vic2_interface *get_interface( device_t *device ) |
| r17612 | r17613 | |
| 2818 | 2818 | } |
| 2819 | 2819 | } |
| 2820 | 2820 | |
| 2821 | DEFINE_LEGACY_DEVICE(VIC2, vic2); | |
| 2821 | const device_type VIC2 = &device_creator<vic2_device>; | |
| 2822 | ||
| 2823 | vic2_device::vic2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 2824 | : device_t(mconfig, VIC2, "6567 / 6569 VIC II", tag, owner, clock) | |
| 2825 | { | |
| 2826 | m_token = global_alloc_array_clear(UINT8, sizeof(vic2_state)); | |
| 2827 | } | |
| 2828 | ||
| 2829 | //------------------------------------------------- | |
| 2830 | // device_config_complete - perform any | |
| 2831 | // operations now that the configuration is | |
| 2832 | // complete | |
| 2833 | //------------------------------------------------- | |
| 2834 | ||
| 2835 | void vic2_device::device_config_complete() | |
| 2836 | { | |
| 2837 | } | |
| 2838 | ||
| 2839 | //------------------------------------------------- | |
| 2840 | // device_start - device-specific startup | |
| 2841 | //------------------------------------------------- | |
| 2842 | ||
| 2843 | void vic2_device::device_start() | |
| 2844 | { | |
| 2845 | DEVICE_START_NAME( vic2 )(this); | |
| 2846 | } | |
| 2847 | ||
| 2848 | //------------------------------------------------- | |
| 2849 | // device_reset - device-specific reset | |
| 2850 | //------------------------------------------------- | |
| 2851 | ||
| 2852 | void vic2_device::device_reset() | |
| 2853 | { | |
| 2854 | DEVICE_RESET_NAME( vic2 )(this); | |
| 2855 | } | |
| 2856 | ||
| 2857 |
| r17612 | r17613 | |
|---|---|---|
| 136 | 136 | DEVICE CONFIGURATION MACROS |
| 137 | 137 | ***************************************************************************/ |
| 138 | 138 | |
| 139 | DECLARE_LEGACY_DEVICE(VIC2, vic2); | |
| 139 | class vic2_device : public device_t | |
| 140 | { | |
| 141 | public: | |
| 142 | vic2_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 143 | ~vic2_device() { global_free(m_token); } | |
| 140 | 144 | |
| 145 | // access to legacy token | |
| 146 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 147 | protected: | |
| 148 | // device-level overrides | |
| 149 | virtual void device_config_complete(); | |
| 150 | virtual void device_start(); | |
| 151 | virtual void device_reset(); | |
| 152 | private: | |
| 153 | // internal state | |
| 154 | void *m_token; | |
| 155 | }; | |
| 156 | ||
| 157 | extern const device_type VIC2; | |
| 158 | ||
| 159 | ||
| 141 | 160 | #define MCFG_VIC2_ADD(_tag, _interface) \ |
| 142 | 161 | MCFG_DEVICE_ADD(_tag, VIC2, 0) \ |
| 143 | 162 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 824 | 824 | } |
| 825 | 825 | #endif |
| 826 | 826 | |
| 827 | DEFINE_LEGACY_SOUND_DEVICE(ODYSSEY2, odyssey2_sound); | |
| 827 | const device_type ODYSSEY2 = &device_creator<odyssey2_sound_device>; | |
| 828 | ||
| 829 | odyssey2_sound_device::odyssey2_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 830 | : device_t(mconfig, ODYSSEY2, "P8244/P8245", tag, owner, clock), | |
| 831 | device_sound_interface(mconfig, *this) | |
| 832 | { | |
| 833 | } | |
| 834 | ||
| 835 | //------------------------------------------------- | |
| 836 | // device_config_complete - perform any | |
| 837 | // operations now that the configuration is | |
| 838 | // complete | |
| 839 | //------------------------------------------------- | |
| 840 | ||
| 841 | void odyssey2_sound_device::device_config_complete() | |
| 842 | { | |
| 843 | } | |
| 844 | ||
| 845 | //------------------------------------------------- | |
| 846 | // device_start - device-specific startup | |
| 847 | //------------------------------------------------- | |
| 848 | ||
| 849 | void odyssey2_sound_device::device_start() | |
| 850 | { | |
| 851 | DEVICE_START_NAME( odyssey2_sound )(this); | |
| 852 | } | |
| 853 | ||
| 854 | //------------------------------------------------- | |
| 855 | // sound_stream_update - handle a stream update | |
| 856 | //------------------------------------------------- | |
| 857 | ||
| 858 | void odyssey2_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 859 | { | |
| 860 | // should never get here | |
| 861 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 862 | } | |
| 863 | ||
| 864 |
| r17612 | r17613 | |
|---|---|---|
| 64 | 64 | assert(device != NULL); |
| 65 | 65 | assert(device->type() == CRT); |
| 66 | 66 | |
| 67 | return (crt_t *)downcast< | |
| 67 | return (crt_t *)downcast< | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | static DEVICE_START( crt ) |
| r17612 | r17613 | |
| 118 | 118 | } |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | ||
| 121 | const device_type C | |
| 122 | 122 | |
| 123 | crt_device::crt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 124 | : device_t(mconfig, CRT, "CRT Video", tag, owner, clock) | |
| 125 | { | |
| 126 | m_token = global_alloc_array_clear(UINT8, sizeof(crt_t)); | |
| 127 | } | |
| 128 | ||
| 129 | //------------------------------------------------- | |
| 130 | // device_config_complete - perform any | |
| 131 | // operations now that the configuration is | |
| 132 | // complete | |
| 133 | //------------------------------------------------- | |
| 134 | ||
| 135 | void crt_device::device_config_complete() | |
| 136 | { | |
| 137 | } | |
| 138 | ||
| 139 | //------------------------------------------------- | |
| 140 | // device_start - device-specific startup | |
| 141 | //------------------------------------------------- | |
| 142 | ||
| 143 | void crt_device::device_start() | |
| 144 | { | |
| 145 | DEVICE_START_NAME( crt )(this); | |
| 146 | } | |
| 147 | ||
| 148 | ||
| 149 | ||
| 123 | 150 | /* |
| 124 | 151 | crt_plot |
| 125 | 152 |
| r17612 | r17613 | |
|---|---|---|
| 24 | 24 | void crt_eof(device_t *device); |
| 25 | 25 | void crt_update(device_t *device, bitmap_ind16 &bitmap); |
| 26 | 26 | |
| 27 | DECLARE_LEGACY_DEVICE(CRT, crt); | |
| 27 | class crt_device : public device_t | |
| 28 | { | |
| 29 | public: | |
| 30 | crt_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 31 | ~crt_device() { global_free(m_token); } | |
| 28 | 32 | |
| 33 | // access to legacy token | |
| 34 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 35 | protected: | |
| 36 | // device-level overrides | |
| 37 | virtual void device_config_complete(); | |
| 38 | virtual void device_start(); | |
| 39 | private: | |
| 40 | // internal state | |
| 41 | void *m_token; | |
| 42 | }; | |
| 43 | ||
| 44 | extern const device_type CRT; | |
| 45 | ||
| 46 | ||
| 29 | 47 | #define MCFG_CRT_ADD(_tag, _interface) \ |
| 30 | 48 | MCFG_DEVICE_ADD(_tag, CRT, 0) \ |
| 31 | 49 | MCFG_DEVICE_CONFIG(_interface) |
| r17612 | r17613 | |
|---|---|---|
| 116 | 116 | assert(device != NULL); |
| 117 | 117 | assert(device->type() == DL1416B || device->type() == DL1416T); |
| 118 | 118 | |
| 119 | return (dl1416_state *)downcast<l | |
| 119 | return (dl1416_state *)downcast<dl1416 | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| r17612 | r17613 | |
| 335 | 335 | } |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | DEFINE_LEGACY_DEVICE(DL1416B, dl1416b); | |
| 339 | DEFINE_LEGACY_DEVICE(DL1416T, dl1416t); | |
| 338 | dl1416_device::dl1416_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 339 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 340 | { | |
| 341 | m_token = global_alloc_array_clear(UINT8, sizeof(dl1416_state)); | |
| 342 | } | |
| 343 | ||
| 344 | //------------------------------------------------- | |
| 345 | // device_config_complete - perform any | |
| 346 | // operations now that the configuration is | |
| 347 | // complete | |
| 348 | //------------------------------------------------- | |
| 349 | ||
| 350 | void dl1416_device::device_config_complete() | |
| 351 | { | |
| 352 | } | |
| 353 | ||
| 354 | //------------------------------------------------- | |
| 355 | // device_start - device-specific startup | |
| 356 | //------------------------------------------------- | |
| 357 | ||
| 358 | void dl1416_device::device_start() | |
| 359 | { | |
| 360 | DEVICE_START_NAME( dl1416 )(this); | |
| 361 | } | |
| 362 | ||
| 363 | //------------------------------------------------- | |
| 364 | // device_reset - device-specific reset | |
| 365 | //------------------------------------------------- | |
| 366 | ||
| 367 | void dl1416_device::device_reset() | |
| 368 | { | |
| 369 | DEVICE_RESET_NAME( dl1416 )(this); | |
| 370 | } | |
| 371 | ||
| 372 | ||
| 373 | const device_type DL1416B = &device_creator<dl1416b_device>; | |
| 374 | ||
| 375 | dl1416b_device::dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 376 | : dl1416_device(mconfig, DL1416B, "DL1416B", tag, owner, clock) | |
| 377 | { | |
| 378 | } | |
| 379 | ||
| 380 | ||
| 381 | const device_type DL1416T = &device_creator<dl1416t_device>; | |
| 382 | ||
| 383 | dl1416t_device::dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 384 | : dl1416_device(mconfig, DL1416T, "DL1416T", tag, owner, clock) | |
| 385 | { | |
| 386 | } | |
| 387 | ||
| 388 |
| r17612 | r17613 | |
|---|---|---|
| 53 | 53 | WRITE8_DEVICE_HANDLER( dl1416_data_w ); |
| 54 | 54 | |
| 55 | 55 | /* device get info callback */ |
| 56 | DECLARE_LEGACY_DEVICE(DL1416B, dl1416b); | |
| 57 | DECLARE_LEGACY_DEVICE(DL1416T, dl1416t); | |
| 56 | class dl1416_device : public device_t | |
| 57 | { | |
| 58 | public: | |
| 59 | dl1416_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 60 | ~dl1416_device() { global_free(m_token); } | |
| 58 | 61 | |
| 62 | // access to legacy token | |
| 63 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 64 | protected: | |
| 65 | // device-level overrides | |
| 66 | virtual void device_config_complete(); | |
| 67 | virtual void device_start(); | |
| 68 | virtual void device_reset(); | |
| 69 | private: | |
| 70 | // internal state | |
| 71 | void *m_token; | |
| 72 | }; | |
| 73 | ||
| 74 | class dl1416b_device : public dl1416_device | |
| 75 | { | |
| 76 | public: | |
| 77 | dl1416b_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 78 | }; | |
| 79 | ||
| 80 | extern const device_type DL1416B; | |
| 81 | ||
| 82 | class dl1416t_device : public dl1416_device | |
| 83 | { | |
| 84 | public: | |
| 85 | dl1416t_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 86 | }; | |
| 87 | ||
| 88 | extern const device_type DL1416T; | |
| 89 | ||
| 90 | ||
| 59 | 91 | #endif /* DL1416_H_ */ |
| r17612 | r17613 | |
|---|---|---|
| 167 | 167 | assert(device != NULL); |
| 168 | 168 | assert(device->type() == ASR733); |
| 169 | 169 | |
| 170 | return (asr_t *)downcast< | |
| 170 | return (asr_t *)downcast< | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | static DEVICE_START( asr733 ) |
| r17612 | r17613 | |
| 236 | 236 | } |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | ||
| 239 | const device_type A | |
| 240 | 240 | |
| 241 | asr733_device::asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 242 | : device_t(mconfig, ASR733, "733 ASR", tag, owner, clock) | |
| 243 | { | |
| 244 | m_token = global_alloc_array_clear(UINT8, sizeof(asr_t)); | |
| 245 | } | |
| 246 | ||
| 247 | //------------------------------------------------- | |
| 248 | // device_config_complete - perform any | |
| 249 | // operations now that the configuration is | |
| 250 | // complete | |
| 251 | //------------------------------------------------- | |
| 252 | ||
| 253 | void asr733_device::device_config_complete() | |
| 254 | { | |
| 255 | } | |
| 256 | ||
| 257 | //------------------------------------------------- | |
| 258 | // device_start - device-specific startup | |
| 259 | //------------------------------------------------- | |
| 260 | ||
| 261 | void asr733_device::device_start() | |
| 262 | { | |
| 263 | DEVICE_START_NAME( asr733 )(this); | |
| 264 | } | |
| 265 | ||
| 266 | //------------------------------------------------- | |
| 267 | // device_reset - device-specific reset | |
| 268 | //------------------------------------------------- | |
| 269 | ||
| 270 | void asr733_device::device_reset() | |
| 271 | { | |
| 272 | DEVICE_RESET_NAME( asr733 )(this); | |
| 273 | } | |
| 274 | ||
| 275 | ||
| 276 | ||
| 241 | 277 | /* write a single char on screen */ |
| 242 | 278 | static void asr_draw_char(device_t *device, int character, int x, int y, int color) |
| 243 | 279 | { |
| r17612 | r17613 | |
|---|---|---|
| 19 | 19 | PALETTE_INIT( asr733 ); |
| 20 | 20 | |
| 21 | 21 | void asr733_init(running_machine &machine); |
| 22 | DECLARE_LEGACY_DEVICE(ASR733, asr733); | |
| 22 | class asr733_device : public device_t | |
| 23 | { | |
| 24 | public: | |
| 25 | asr733_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 26 | ~asr733_device() { global_free(m_token); } | |
| 23 | 27 | |
| 28 | // access to legacy token | |
| 29 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 30 | protected: | |
| 31 | // device-level overrides | |
| 32 | virtual void device_config_complete(); | |
| 33 | virtual void device_start(); | |
| 34 | virtual void device_reset(); | |
| 35 | private: | |
| 36 | // internal state | |
| 37 | void *m_token; | |
| 38 | }; | |
| 39 | ||
| 40 | extern const device_type ASR733; | |
| 41 | ||
| 42 | ||
| 24 | 43 | #define MCFG_ASR733_VIDEO_ADD(_tag, _intf) \ |
| 25 | 44 | MCFG_DEVICE_ADD(_tag, ASR733, 0) \ |
| 26 | 45 | MCFG_DEVICE_CONFIG(_intf) |
| r17612 | r17613 | |
|---|---|---|
| 63 | 63 | assert( device != NULL ); |
| 64 | 64 | assert( device->type() == K1GE || device->type() == K2GE ); |
| 65 | 65 | |
| 66 | return ( k1ge_t *) downcast< | |
| 66 | return ( k1ge_t *) downcast<k1ge | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| r17612 | r17613 | |
| 923 | 923 | } |
| 924 | 924 | } |
| 925 | 925 | |
| 926 | DEFINE_LEGACY_DEVICE(K1GE, k1ge); | |
| 927 | DEFINE_LEGACY_DEVICE(K2GE, k2ge); | |
| 926 | const device_type K1GE = &device_creator<k1ge_device>; | |
| 927 | ||
| 928 | k1ge_device::k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 929 | : device_t(mconfig, K1GE, "", tag, owner, clock) | |
| 930 | { | |
| 931 | m_token = global_alloc_array_clear(UINT8, sizeof( k1ge_t )); | |
| 932 | } | |
| 933 | ||
| 934 | k1ge_device::k1ge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock) | |
| 935 | : device_t(mconfig, type, name, tag, owner, clock) | |
| 936 | { | |
| 937 | m_token = global_alloc_array_clear(UINT8, sizeof( k1ge_t )); | |
| 938 | } | |
| 939 | ||
| 940 | //------------------------------------------------- | |
| 941 | // device_config_complete - perform any | |
| 942 | // operations now that the configuration is | |
| 943 | // complete | |
| 944 | //------------------------------------------------- | |
| 945 | ||
| 946 | void k1ge_device::device_config_complete() | |
| 947 | { | |
| 948 | } | |
| 949 | ||
| 950 | //------------------------------------------------- | |
| 951 | // device_start - device-specific startup | |
| 952 | //------------------------------------------------- | |
| 953 | ||
| 954 | void k1ge_device::device_start() | |
| 955 | { | |
| 956 | DEVICE_START_NAME( k1ge )(this); | |
| 957 | } | |
| 958 | ||
| 959 | //------------------------------------------------- | |
| 960 | // device_reset - device-specific reset | |
| 961 | //------------------------------------------------- | |
| 962 | ||
| 963 | void k1ge_device::device_reset() | |
| 964 | { | |
| 965 | DEVICE_RESET_NAME( k1ge )(this); | |
| 966 | } | |
| 967 | ||
| 968 | ||
| 969 | const device_type K2GE = &device_creator<k2ge_device>; | |
| 970 | ||
| 971 | k2ge_device::k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 972 | : k1ge_device(mconfig, K2GE, "", tag, owner, clock) | |
| 973 | { | |
| 974 | } | |
| 975 | ||
| 976 | //------------------------------------------------- | |
| 977 | // device_start - device-specific startup | |
| 978 | //------------------------------------------------- | |
| 979 | ||
| 980 | void k2ge_device::device_start() | |
| 981 | { | |
| 982 | DEVICE_START_NAME( k2ge )(this); | |
| 983 | } | |
| 984 | ||
| 985 |
| r17612 | r17613 | |
|---|---|---|
| 8 | 8 | #define K1GE_SCREEN_HEIGHT 199 |
| 9 | 9 | |
| 10 | 10 | |
| 11 | DECLARE_LEGACY_DEVICE(K1GE, k1ge); | |
| 12 | DECLARE_LEGACY_DEVICE(K2GE, k2ge); | |
| 11 | class k1ge_device : public device_t | |
| 12 | { | |
| 13 | public: | |
| 14 | k1ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 15 | k1ge_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock); | |
| 16 | ~k1ge_device() { global_free(m_token); } | |
| 13 | 17 | |
| 18 | // access to legacy token | |
| 19 | void *token() const { assert(m_token != NULL); return m_token; } | |
| 20 | protected: | |
| 21 | // device-level overrides | |
| 22 | virtual void device_config_complete(); | |
| 23 | virtual void device_start(); | |
| 24 | virtual void device_reset(); | |
| 25 | private: | |
| 26 | // internal state | |
| 27 | void *m_token; | |
| 28 | }; | |
| 14 | 29 | |
| 30 | extern const device_type K1GE; | |
| 31 | ||
| 32 | class k2ge_device : public k1ge_device | |
| 33 | { | |
| 34 | public: | |
| 35 | k2ge_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 36 | protected: | |
| 37 | // device-level overrides | |
| 38 | virtual void device_start(); | |
| 39 | }; | |
| 40 | ||
| 41 | extern const device_type K2GE; | |
| 42 | ||
| 43 | ||
| 44 | ||
| 15 | 45 | #define MCFG_K1GE_ADD(_tag, _clock, _config ) \ |
| 16 | 46 | MCFG_DEVICE_ADD( _tag, K1GE, _clock ) \ |
| 17 | 47 | MCFG_DEVICE_CONFIG( _config ) |
| r17612 | r17613 | |
|---|---|---|
| 9 | 9 | #include "imagedev/cartslot.h" |
| 10 | 10 | |
| 11 | 11 | |
| 12 | DECLARE_LEGACY_SOUND_DEVICE(PV1000,pv1000_sound); | |
| 13 | DEFINE_LEGACY_SOUND_DEVICE(PV1000,pv1000_sound); | |
| 12 | class pv1000_sound_device : public device_t, | |
| 13 | public device_sound_interface | |
| 14 | { | |
| 15 | public: | |
| 16 | pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); | |
| 17 | protected: | |
| 18 | // device-level overrides | |
| 19 | virtual void device_config_complete(); | |
| 20 | virtual void device_start(); | |
| 14 | 21 | |
| 22 | // sound stream update overrides | |
| 23 | virtual void sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples); | |
| 24 | private: | |
| 25 | // internal state | |
| 26 | }; | |
| 15 | 27 | |
| 28 | extern const device_type PV1000; | |
| 29 | ||
| 30 | const device_type PV1000 = &device_creator<pv1000_sound_device>; | |
| 31 | ||
| 32 | pv1000_sound_device::pv1000_sound_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) | |
| 33 | : device_t(mconfig, PV1000, "NEC D65010G031", tag, owner, clock), | |
| 34 | device_sound_interface(mconfig, *this) | |
| 35 | { | |
| 36 | } | |
| 37 | ||
| 38 | //------------------------------------------------- | |
| 39 | // device_config_complete - perform any | |
| 40 | // operations now that the configuration is | |
| 41 | // complete | |
| 42 | //------------------------------------------------- | |
| 43 | ||
| 44 | void pv1000_sound_device::device_config_complete() | |
| 45 | { | |
| 46 | } | |
| 47 | ||
| 48 | //------------------------------------------------- | |
| 49 | // device_start - device-specific startup | |
| 50 | //------------------------------------------------- | |
| 51 | static DEVICE_START( pv1000_sound ); | |
| 52 | void pv1000_sound_device::device_start() | |
| 53 | { | |
| 54 | DEVICE_START_NAME( pv1000_sound )(this); | |
| 55 | } | |
| 56 | ||
| 57 | //------------------------------------------------- | |
| 58 | // sound_stream_update - handle a stream update | |
| 59 | //------------------------------------------------- | |
| 60 | ||
| 61 | void pv1000_sound_device::sound_stream_update(sound_stream &stream, stream_sample_t **inputs, stream_sample_t **outputs, int samples) | |
| 62 | { | |
| 63 | // should never get here | |
| 64 | fatalerror("sound_stream_update called; not applicable to legacy sound devices\n"); | |
| 65 | } | |
| 66 | ||
| 67 | ||
| 68 | ||
| 69 | ||
| 16 | 70 | class pv1000_state : public driver_device |
| 17 | 71 | { |
| 18 | 72 | public: |
| Previous | 199869 Revisions | Next |