Previous 15994 Revisions Next

r6946 Wednesday 6th January, 2010 at 00:56:33 UTC by Barry Rodewald
[RF5C68] Added simple end-of-sample callback.
[src/emu/sound]rf5c68.c rf5c68.h

src/emu/sound/rf5c68.c
r6945r6946
3333   UINT8            wbank;
3434   UINT8            enable;
3535   UINT8            data[0x10000];
36   void            (*sample_callback)(const device_config* device,int channel);
37   const device_config* device;
3638};
3739
3840
r6945r6946
9193               /* if we loop to a loop point, we're effectively dead */
9294               if (sample == 0xff)
9395                  break;
96               /* trigger sample callback */
97               if(chip->sample_callback)
98                  chip->sample_callback(chip->device,i);
9499            }
95100            chan->addr += chan->step;
96101
r6945r6946
134139
135140static DEVICE_START( rf5c68 )
136141{
142   const rf5c68_interface* intf = (const rf5c68_interface*)device->static_config;
143   
137144   /* allocate memory for the chip */
138145   rf5c68_state *chip = get_safe_token(device);
139146
140147   /* allocate the stream */
141148   chip->stream = stream_create(device, 0, 2, device->clock / 384, chip, rf5c68_update);
149   
150   chip->device = device;
151   
152   /* set up callback */
153   if(intf != NULL)
154      chip->sample_callback = intf->sample_end_callback;
155   else
156      chip->sample_callback = NULL;
142157}
143158
144159
src/emu/sound/rf5c68.h
r6945r6946
1313READ8_DEVICE_HANDLER( rf5c68_mem_r );
1414WRITE8_DEVICE_HANDLER( rf5c68_mem_w );
1515
16typedef struct _rf5c68_interface rf5c68_interface;
17struct _rf5c68_interface
18{
19   void (*sample_end_callback)(const device_config* device, int channel);
20};
21
1622DEVICE_GET_INFO( rf5c68 );
1723#define SOUND_RF5C68 DEVICE_GET_INFO_NAME( rf5c68 )
1824

Previous 15994 Revisions Next


© 1998-2018 The MESS Team