trunk/src/emu/sound/tiaintf.c
| r242931 | r242932 | |
| 30 | 30 | void tia_device::device_start() |
| 31 | 31 | { |
| 32 | 32 | m_channel = stream_alloc(0, 1, clock()); |
| 33 | | m_chip = tia_sound_init(clock(), clock(), 16); |
| 33 | m_chip = tia_sound_init(this, clock(), clock(), 16); |
| 34 | 34 | assert_always(m_chip != NULL, "Error creating TIA chip"); |
| 35 | 35 | } |
| 36 | 36 | |
trunk/src/emu/sound/tiasound.c
| r242931 | r242932 | |
| 526 | 526 | } |
| 527 | 527 | } |
| 528 | 528 | |
| 529 | static void tia_save_state(device_t *device, tia *tia) |
| 530 | { |
| 531 | device->save_item(NAME(tia->AUDC)); |
| 532 | device->save_item(NAME(tia->AUDF)); |
| 533 | device->save_item(NAME(tia->AUDV)); |
| 534 | device->save_item(NAME(tia->Outvol)); |
| 535 | device->save_item(NAME(tia->P4)); |
| 536 | device->save_item(NAME(tia->P5)); |
| 537 | device->save_item(NAME(tia->P9)); |
| 538 | device->save_item(NAME(tia->Div_n_cnt)); |
| 539 | device->save_item(NAME(tia->Div_n_max)); |
| 540 | device->save_item(NAME(tia->Div_3_cnt)); |
| 541 | device->save_item(NAME(tia->Samp_n_cnt)); |
| 542 | device->save_item(NAME(tia->oversampling)); |
| 543 | } |
| 544 | |
| 529 | 545 | /*****************************************************************************/ |
| 530 | 546 | /* Module: tia_sh_start() */ |
| 531 | 547 | /* Purpose: to handle the power-up initialization functions */ |
| r242931 | r242932 | |
| 541 | 557 | /* */ |
| 542 | 558 | /*****************************************************************************/ |
| 543 | 559 | |
| 544 | | void *tia_sound_init(int clock, int sample_rate, int gain) |
| 560 | void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain) |
| 545 | 561 | { |
| 546 | 562 | struct tia *chip; |
| 547 | 563 | int chan; |
| r242931 | r242932 | |
| 581 | 597 | chip->P5[chan] = 0; |
| 582 | 598 | chip->P9[chan] = 0; |
| 583 | 599 | } |
| 600 | |
| 601 | tia_save_state(device, chip); |
| 584 | 602 | |
| 585 | 603 | return chip; |
| 586 | 604 | } |
trunk/src/emu/sound/tiasound.h
| r242931 | r242932 | |
| 37 | 37 | #ifndef __TIASOUND_H__ |
| 38 | 38 | #define __TIASOUND_H__ |
| 39 | 39 | |
| 40 | | void *tia_sound_init(int clock, int sample_rate, int gain); |
| 40 | void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain); |
| 41 | 41 | void tia_sound_free(void *chip); |
| 42 | 42 | void tia_process (void *chip, stream_sample_t *buffer, int length); |
| 43 | 43 | void tia_write(void *chip, offs_t offset, UINT8 data); |