static int set_digiblaster_enabled(int value, void *param) { int val = value ? 1 : 0; if (digiblaster_sound_chip.chip_enabled == val) { return 0; } if (val) { if (sidcart_address == 0xfd40) { digiblaster_list_item = io_source_register(&digiblaster_fd5e_device); } else { digiblaster_list_item = io_source_register(&digiblaster_fe9e_device); } sampler_start(SAMPLER_OPEN_MONO, "DigiBlaster"); } else { io_source_unregister(digiblaster_list_item); digiblaster_list_item = NULL; sampler_stop(); } digiblaster_sound_chip.chip_enabled = val ? 1 : 0; return 0; }
void tim1_cc_isr(void) { if (TIM_SR(TIM1) & TIM_SR_CC1IF) { sampler_stop(&sampler); sampler_save_buffer(&sampler); /* Do not start again, otherwise we overwrite old data. * There is no buffer management yet. */ } }
static int set_userport_4bit_sampler_enabled(int value, void *param) { int val = value ? 1 : 0; if (userport_4bit_sampler_enabled == val) { return 0; } if (val) { sampler_start(SAMPLER_OPEN_MONO, "4bit userport sampler"); userport_4bit_sampler_list_item = userport_device_register(&sampler_device); if (userport_4bit_sampler_list_item == NULL) { sampler_stop(); return -1; } } else { userport_device_unregister(userport_4bit_sampler_list_item); userport_4bit_sampler_list_item = NULL; sampler_stop(); } userport_4bit_sampler_enabled = val; return 0; }
void renderer_stop(void) { struct patch *p; rsswall_stop(); sampler_stop(); eval_stop(); raster_stop(); while(mashup_head != NULL) { p = mashup_head->next; patch_free(mashup_head); mashup_head = p; } current_patch = NULL; }
static int set_sfx_soundsampler_enabled(int value, void *param) { int val = value ? 1 : 0; if (sfx_soundsampler_sound_chip.chip_enabled != val) { if (val) { if (c64export_add(&export_res) < 0) { return -1; } if (machine_class == VICE_MACHINE_VIC20) { if (sfx_soundsampler_io_swap) { sfx_soundsampler_io1_device.start_address = 0x9800; sfx_soundsampler_io1_device.end_address = 0x9bff; sfx_soundsampler_io2_device.start_address = 0x9c00; sfx_soundsampler_io2_device.end_address = 0x9fff; } else { sfx_soundsampler_io1_device.start_address = 0x9c00; sfx_soundsampler_io1_device.end_address = 0x9fff; sfx_soundsampler_io2_device.start_address = 0x9800; sfx_soundsampler_io2_device.end_address = 0x9bff; } } sfx_soundsampler_io1_list_item = io_source_register(&sfx_soundsampler_io1_device); sfx_soundsampler_io2_list_item = io_source_register(&sfx_soundsampler_io2_device); sfx_soundsampler_sound_chip.chip_enabled = 1; sampler_start(SAMPLER_OPEN_MONO); } else { c64export_remove(&export_res); io_source_unregister(sfx_soundsampler_io1_list_item); io_source_unregister(sfx_soundsampler_io2_list_item); sfx_soundsampler_io1_list_item = NULL; sfx_soundsampler_io2_list_item = NULL; sfx_soundsampler_sound_chip.chip_enabled = 0; sampler_stop(); } } return 0; }