static INT32 DrvDoReset() { SekOpen(0); SekReset(); SekClose(); // BurnYM3812Reset(); BurnSampleReset(); #ifdef TOAPLAN_SOUND_SAMPLES_HACK StopAllSamples(); for (INT32 i = 0; i <= 0x28; i++) { BurnSampleSetAllRoutes(i, 1.00, BURN_SND_ROUTE_BOTH); BurnSampleSetLoop(i, 0); } HiscoreReset(); FadeoutReady = 0; FadeoutStop = 0; Playing1 = 0xff; Playing2 = 0xff; Play1 = 0; Counter1 = 0; Vol1 = 0; Wait = 0; Start = 0; Start2 = 0; #endif bEnableInterrupts = false; return 0; }
static INT32 DrvDoReset() { SekOpen(0); SekReset(); SekClose(); BurnSampleReset(); #ifdef TOAPLAN_SOUND_SAMPLES_HACK StopAllSamples(); #endif return 0; }
void fronttorture_unload(void) { LbDataFreeAll(torture_load_files); memcpy(&frontend_palette, frontend_backup_palette, PALETTE_SIZE); StopAllSamples(); // Clearing the space used for torture graphics clear_light_system(&game.lish); clear_computer(); clear_things_and_persons_data(); clear_mapmap(); clear_slabs(); clear_rooms(); clear_dungeons(); }
static void tekipakiHD647180Write(UINT16 d) { if (d == 0xfe) { StopAllSamples(); } if (d >= 0x01 && d <= 0x03) { StopSamplesChannel0(); BurnSampleSetLoop(d, 1); BurnSamplePlay(d); } if (d >= 0x04 && d <= 0x05) { StopSamplesChannel0(); BurnSamplePlay(d); } if (d >= 0x06 && d <= 0x07) { StopSamplesChannel1(); BurnSamplePlay(d); } if (d == 0x08 || d == 0x09) { StopSamplesChannel2(); BurnSamplePlay(d); } if (d >= 0x0a && d <= 0x0d) { StopSamplesChannel3(); BurnSamplePlay(d); } if (d == 0x0e || d == 0x12) { StopSamplesChannel4(); BurnSamplePlay(d); } if (d >= 0x13 && d <= 0x14) { StopSamplesChannel5(); BurnSamplePlay(d); } if (d == 0x15) { BurnSampleStop(d); BurnSamplePlay(d); } }
static void samesameSndCmd(UINT16 d) { if (d == 0x00 || d == 0xdf) { StopAllSamples(); } if (d >= 0x01 && d <= 0x05) { StopSamplesChannel0(); SetVolumeSamplesChannel0(1.00); FadeoutStop = 1; Start2 = 0; BurnSampleSetLoop(d, 1); BurnSamplePlay(d); } if (d == 0x06) { StopSamplesChannel0(); BurnSamplePlay(d); Start2 = 72; } if (d == 0x07) { FadeoutReady = 1; Start = 1; } if (d == 0x08 || d == 0x09) { StopSamplesChannel1(); BurnSamplePlay(d); } if (d >= 0x0a && d <= 0x0f) { StopSamplesChannel2(); BurnSamplePlay(d); } if (d == 0x10 || d == 0x11) { StopSamplesChannel3(); BurnSamplePlay(d); } if (d >= 0x12 && d <= 0x16) { StopSamplesChannel4(); BurnSamplePlay(d); } if (d >= 0x17 && d <= 0x1b) { StopSamplesChannel5(); BurnSamplePlay(d); } if (d >= 0x1c && d <= 0x1f) { StopSamplesChannel0(); BurnSamplePlay(d); } if (d == 0x20 || d == 0x21) { StopSamplesChannel6(); BurnSamplePlay(d); } if (d == 0x22) { StopSamplesChannel0(); BurnSamplePlay(d); } if (d == 0x23) { StopSamplesChannel7(); BurnSamplePlay(d); } if (d == 0x24) { StopSamplesChannel7(); BurnSamplePlay(d); FadeoutReady = 1; } if (d == 0x25) { StopSamplesChannel0(); SetVolumeSamplesChannel0(1.00); BurnSamplePlay(d); FadeoutStop = 1; } if (d == 0x26) { StopSamplesChannel2(); BurnSamplePlay(d); } if (d == 0x27) { StopSamplesChannel0(); SetVolumeSamplesChannel0(1.00); BurnSamplePlay(d); FadeoutStop = 1; } if (d == 0x28) { BurnSamplePlay(d); } }
TbBool setup_heaps(void) { TbBool low_memory; char snd_fname[2048]; char *spc_fname; long i; SYNCDBG(8,"Starting"); low_memory = false; if (!SoundDisabled) { StopAllSamples(); close_sound_heap(); if (sound_heap_memory != NULL) { LbMemoryFree(sound_heap_memory); sound_heap_memory = NULL; } } if (heap != NULL) { ERRORLOG("Graphics heap already allocated"); LbMemoryFree(heap); heap = NULL; } // Allocate sound heap if (!SoundDisabled) { i = mem_size; while (sound_heap_memory == NULL) { sound_heap_size = get_best_sound_heap_size(i); i = get_smaller_memory_amount(i); sound_heap_memory = LbMemoryAlloc(sound_heap_size); if ((i <= 8) && (sound_heap_memory == NULL)) { low_memory = true; break; } } } // Allocate graphics heap i = mem_size; while (heap == NULL) { heap_size = get_best_sound_heap_size(i); i = get_smaller_memory_amount(i); heap = LbMemoryAlloc(heap_size); if ((i <= 8) && (heap == NULL)) { low_memory = true; break; } } SYNCMSG("GraphicsHeap Size %d", heap_size); if (low_memory) { SYNCDBG(8,"Low memory mode entered on heap allocation."); while (heap != NULL) { if ((!SoundDisabled) && (sound_heap_memory == NULL)) { break; } if (!SoundDisabled) { if (sound_heap_size < heap_size) { heap_size -= 16384; } else if (sound_heap_size == heap_size) { heap_size -= 16384; sound_heap_size -= 16384; } else { sound_heap_size -= 16384; } if (sound_heap_size < 524288) { ERRORLOG("Unable to allocate heaps (small_mem)"); return false; } } else { heap_size -= 16384; } if (heap_size < 524288) { if (sound_heap_memory != NULL) { LbMemoryFree(sound_heap_memory); sound_heap_memory = NULL; } ERRORLOG("Unable to allocate heaps (small_mem)"); return false; } } if (sound_heap_memory != NULL) { LbMemoryFree(sound_heap_memory); sound_heap_memory = NULL; } if (heap != NULL) { LbMemoryFree(heap); heap = NULL; } if (!SoundDisabled) { sound_heap_memory = LbMemoryAlloc(sound_heap_size); } heap = LbMemoryAlloc(heap_size); } if (!SoundDisabled) { SYNCMSG("SoundHeap Size %d", sound_heap_size); // Prepare sound sample bank file names prepare_file_path_buf(snd_fname,FGrp_LrgSound,sound_fname); // language-specific speech file spc_fname = prepare_file_fmtpath(FGrp_LrgSound,"speech_%s.dat",get_language_lwrstr(install_info.lang_id)); // default speech file if (!LbFileExists(spc_fname)) spc_fname = prepare_file_path(FGrp_LrgSound,speech_fname); // speech file for english if (!LbFileExists(spc_fname)) spc_fname = prepare_file_fmtpath(FGrp_LrgSound,"speech_%s.dat",get_language_lwrstr(1)); // Initialize sample banks if (!init_sound_heap_two_banks(sound_heap_memory, sound_heap_size, snd_fname, spc_fname, 1622)) { LbMemoryFree(sound_heap_memory); sound_heap_memory = NULL; SoundDisabled = true; ERRORLOG("Unable to initialize sound heap. Sound disabled."); } } return true; }