src/emu/sound/rf5c68.c
| r6945 | r6946 | |
| 33 | 33 | UINT8 wbank; |
| 34 | 34 | UINT8 enable; |
| 35 | 35 | UINT8 data[0x10000]; |
| 36 | void (*sample_callback)(const device_config* device,int channel); |
| 37 | const device_config* device; |
| 36 | 38 | }; |
| 37 | 39 | |
| 38 | 40 | |
| r6945 | r6946 | |
| 91 | 93 | /* if we loop to a loop point, we're effectively dead */ |
| 92 | 94 | if (sample == 0xff) |
| 93 | 95 | break; |
| 96 | /* trigger sample callback */ |
| 97 | if(chip->sample_callback) |
| 98 | chip->sample_callback(chip->device,i); |
| 94 | 99 | } |
| 95 | 100 | chan->addr += chan->step; |
| 96 | 101 | |
| r6945 | r6946 | |
| 134 | 139 | |
| 135 | 140 | static DEVICE_START( rf5c68 ) |
| 136 | 141 | { |
| 142 | const rf5c68_interface* intf = (const rf5c68_interface*)device->static_config; |
| 143 | |
| 137 | 144 | /* allocate memory for the chip */ |
| 138 | 145 | rf5c68_state *chip = get_safe_token(device); |
| 139 | 146 | |
| 140 | 147 | /* allocate the stream */ |
| 141 | 148 | 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; |
| 142 | 157 | } |
| 143 | 158 | |
| 144 | 159 | |