Previous 199869 Revisions Next

r34420 Friday 16th January, 2015 at 17:16:35 UTC by Osso
tiasound.c: added save state support (nw)
[src/emu/sound]tiaintf.c tiasound.c tiasound.h

trunk/src/emu/sound/tiaintf.c
r242931r242932
3030void tia_device::device_start()
3131{
3232   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);
3434   assert_always(m_chip != NULL, "Error creating TIA chip");
3535}
3636
trunk/src/emu/sound/tiasound.c
r242931r242932
526526   }
527527}
528528
529static 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
529545/*****************************************************************************/
530546/* Module:  tia_sh_start()                                                   */
531547/* Purpose: to handle the power-up initialization functions                  */
r242931r242932
541557/*                                                                           */
542558/*****************************************************************************/
543559
544void *tia_sound_init(int clock, int sample_rate, int gain)
560void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain)
545561{
546562   struct tia *chip;
547563   int chan;
r242931r242932
581597      chip->P5[chan] = 0;
582598      chip->P9[chan] = 0;
583599   }
600   
601   tia_save_state(device, chip);
584602
585603   return chip;
586604}
trunk/src/emu/sound/tiasound.h
r242931r242932
3737#ifndef __TIASOUND_H__
3838#define __TIASOUND_H__
3939
40void *tia_sound_init(int clock, int sample_rate, int gain);
40void *tia_sound_init(device_t *device, int clock, int sample_rate, int gain);
4141void tia_sound_free(void *chip);
4242void tia_process (void *chip, stream_sample_t *buffer, int length);
4343void tia_write(void *chip, offs_t offset, UINT8 data);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team