int xmame_sound_start( void ) { xmame_func_set(0); if( use_sound ){ sound_enabled = TRUE; sound_stream = TRUE; } else { sound_enabled = FALSE; sound_stream = FALSE; return 1; } if(verbose_proc) printf("Starting sound server: ....."); if( sound_start()==0 ){ sound_enabled = TRUE; xmame_func_set(sound_enabled); sound_reset(); osd_sound_enable(1); }else{ sound_enabled = FALSE; xmame_func_set(sound_enabled); } if(verbose_proc) printf("%s\n", (sound_enabled) ? "...OK" : "...FAILED, Can't use sound"); return 1; }
int init_sdl_audio(void) { #ifdef Z80_EMULATED #ifdef MENU_MUSIC unsigned i; Mix_OpenAudio(SAMPLE_RATE, AUDIO_S16, 2, NB_SAMPLES); for(i=0;i<NUM_SAMPLES;i++) sample[i]=Mix_LoadWAV(sample_filename[i]); #else SDL_AudioSpec desired; desired.freq = SAMPLE_RATE; desired.samples = NB_SAMPLES; #ifdef WORDS_BIGENDIAN desired.format = AUDIO_S16MSB; #else desired.format = AUDIO_S16; #endif desired.channels = 2; desired.callback = update_sdl_stream; desired.userdata = NULL; SDL_OpenAudio(&desired, NULL); #endif SDL_PauseAudio(1); sound_reset(); #endif return 1; }
void driver_device::device_reset() { // reset each piece driver_reset(); machine_reset(); sound_reset(); video_reset(); }
void emu_reset() { hw_reset(); lcd_reset(); cpu_reset(); mbc_reset(); sound_reset(); }
void system_reset(void) { sms_reset(); pio_reset(); vdp_reset(); render_reset(); sound_reset(); system_manage_sram(cart.sram, SLOT_CART, SRAM_LOAD); }
void burnin_exit (void) { time_audit_add (&burnin_total_duration, &burnin_duration); lamp_all_off (); sound_reset (); #ifdef CONFIG_GI gi_leff_free (PINIO_GI_STRINGS); #endif flipper_disable (); }
int main() { ioinit(); timer2_init(); timer2_overflow_hook = timer2_hook; timer1_init(); _delay_ms(100); spi_init(); sound_reset(); usart_init(1);// usart_init(23); // 9600bps spdif_configure(); ad1955_configure(); ad1955_mute(); #define NO_NOISE_MEASURE #ifdef NOISE_MEASURE ad1955_unmute(); cli(); set_sleep_mode(SLEEP_MODE_PWR_DOWN); for(;;) { sleep_mode(); } #endif spdif_selectChannel(1); spdif_dumpRegisters(); printf("\n\nSVODAC V%s\n", idstring); for (;;) { if (main_state_machine() == STATE_READY) { if ((REQUEST_STATUS & _BV(REQUEST_MUTE)) != 0) { ad1955_mute(); } else if ((REQUEST_STATUS & _BV(REQUEST_UNMUTE)) != 0) { ad1955_unmute(); } if ((REQUEST_STATUS & _BV(REQUEST_STOP)) != 0) { //printf("STOP"); spdif_stop(); } else if ((REQUEST_STATUS & _BV(REQUEST_RUN)) != 0) { //printf("RUN"); spdif_run(); } REQUEST_STATUS = 0; sleep_mode(); } } return 0; // make happy }
static void cpu_pre_run(void) { int cpunum; logerror("Machine reset\n"); begin_resource_tracking(); /* read hi scores information from hiscore.dat */ hs_open(Machine->gamedrv->name); hs_init(); /* initialize the various timers (suspends all CPUs at startup) */ cpu_inittimers(); watchdog_counter = -1; /* reset sound chips */ sound_reset(); /* first pass over CPUs */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) { /* enable all CPUs (except for audio CPUs if the sound is off) */ if (!(Machine->drv->cpu[cpunum].cpu_flags & CPU_AUDIO_CPU) || Machine->sample_rate != 0) cpunum_resume(cpunum, SUSPEND_ANY_REASON); else cpunum_suspend(cpunum, SUSPEND_REASON_DISABLE, 1); /* reset the interrupt state */ cpuint_reset_cpu(cpunum); /* reset the total number of cycles */ cpu[cpunum].totalcycles = 0; cpu[cpunum].localtime = 0; } vblank = 0; /* do this AFTER the above so machine_init() can use cpu_halt() to hold the */ /* execution of some CPUs, or disable interrupts */ if (Machine->drv->machine_init) (*Machine->drv->machine_init)(); /* now reset each CPU */ for (cpunum = 0; cpunum < cpu_gettotalcpu(); cpunum++) cpunum_reset(cpunum, Machine->drv->cpu[cpunum].reset_param, cpu_irq_callbacks[cpunum]); /* reset the globals */ cpu_vblankreset(); current_frame = 0; state_save_dump_registry(); }
void neogeo_reset(void) { timer_reset(); input_reset(); neogeo_driver_reset(); neogeo_video_reset(); sound_reset(); blit_clear_all_sprite(); Loop = LOOP_EXEC; }
void emu_reset() { sram_save(); rtc_save(); hw_reset(); lcd_reset(); cpu_reset(); mbc_reset(); sound_reset(); init = 0; }
void debug_respond() { uint8_t dummy8; uint16_t dummy16; uint8_t spdif_reg; switch (inputBuffer[0]) { case 'd': spdif_dumpRegisters(); break; case 'i': dummy8 = (uint8_t)getparam(0); //spdif_selectChannel(dummy8); selectInputChannel(dummy8); printf("CH#%d\n", dummy8); break; case 's': spdif_reg = (uint8_t)getparam(0); dummy8 = (uint8_t)getparam(1); spdif_write(spdif_reg, dummy8); printf("CS8416:%02x=%02x\n", spdif_reg, dummy8); break; case 'S': decodeAndPrintStatus(); break; case 'r': sound_reset(); break; case 'p': ad1955_write(AD1955_REG00 | _BV(AD1955_R0_POWERDOWN)); break; case 'P': _delay_ms(500); ad1955_write(AD1955_REG00 | 0); // all defaults ad1955_write(AD1955_LEFTVOL | 0b1111111111111100); ad1955_write(AD1955_RIGHTVOL | 0b1111111111111100); _delay_ms(500); break; case 'D': dummy16 = getparam(0); printf("DAC<-%04x", dummy16); ad1955_write(dummy16); break; default: printf("?\n"); break; } _delay_ms(500); }
void emu_reset() { hw_reset(); lcd_reset(); cpu_reset(); mbc_reset(); sound_reset(); ccmpl_reset(); //cop_stop_draw(); #ifdef DEBUG debug_file = fopen("/out", "w+"); if(!debug_file) die("no debugging possible... I better die"); if(lcd_file) close(lcd_file); #endif }
static void neogeo_reset(void) { video_set_mode(16); video_clear_screen(); timer_reset(); input_reset(); neogeo_driver_reset(); neogeo_video_reset(); sound_reset(); blit_clear_all_sprite(); autoframeskip_reset(); Loop = LOOP_EXEC; }
CALLSET_ENTRY (tilt, sw_tilt) { extern U8 in_tilt; /* Ignore tilt switch activity while already in tilt state. * But restart the timer that tells us that the tilt is still * moving, so we can delay endball. */ if (in_tilt) { free_timer_restart (TIM_IGNORE_TILT, TIME_2S); return; } /* IDEA : Disable tilt while a ball search is in progress? */ else if (++tilt_warnings == system_config.tilt_warnings) { /* Warnings exceeded... tilt the current ball */ sound_reset (); #ifdef CONFIG_GI gi_disable (PINIO_GI_STRINGS); #endif deff_start (DEFF_TILT); leff_start (LEFF_TILT); free_timer_restart (TIM_IGNORE_TILT, TIME_2S); in_tilt = TRUE; task_remove_duration (TASK_DURATION_LIVE); task_duration_expire (TASK_DURATION_LIVE); flipper_disable (); set_valid_playfield (); audit_increment (&system_audits.tilts); audit_increment (&system_audits.plumb_bob_tilts); callset_invoke (tilt); } else { /* Give a warning this time */ deff_start (DEFF_TILT_WARNING); leff_start (LEFF_TILT_WARNING); callset_invoke (tilt_warning); } }
void driver_device::device_reset_after_children() { // reset each piece driver_reset(); if (!m_callbacks[CB_MACHINE_RESET].isnull()) m_callbacks[CB_MACHINE_RESET](); else machine_reset(); if (!m_callbacks[CB_SOUND_RESET].isnull()) m_callbacks[CB_SOUND_RESET](); else sound_reset(); if (!m_callbacks[CB_VIDEO_RESET].isnull()) m_callbacks[CB_VIDEO_RESET](); else video_reset(); }
void sid_reset(void) { sound_reset(); memset(siddata, 0, sizeof(siddata)); }
void petsound_reset(sound_t *psid, CLOCK cpu_clk) { sound_reset(); }
static void reset(void) { // buffer = 0; sound_reset(); }
static int parse_sound_cmd(int fd, char *msg) /* interpretes messages from the client */ { int sound; int val; int ret; char *cmd; char *cmd_end; int n = 0; ret = 1; if (_audio_fd == -1) return ret; cmd = msg; /* reset message offset */ _msg_offset = 0; /* printf("msg: %s\n", msg);*/ while (ret && *cmd != '\0') { if ((cmd_end = strchr(cmd, ';')) == NULL) { /* if not on the end of string and there is no more semicolons, it means a partial message have arrived, split by pipe bufferings; so, copy the rest of the message to the beginning */ _msg_offset = strlen(cmd); strcpy(msg, cmd); /* printf("Partial msg: %s, %d\n", msg, _msg_offset);*/ break; } /* delimit */ *cmd_end = '\0'; /* printf("cmd: %s\n", cmd);*/ switch (*cmd) { case SOUND_CMD_EXIT: ret = 0; break; case SOUND_CMD_RESET: sound_reset(); break; case SOUND_CMD_LOAD: case SOUND_CMD_LOADBIG: if (cmd[1] == '\0') printf("No sound name?\n"); else sound_cmd_load(cmd + 1); break; case SOUND_CMD_START: sound = (int) cmd[1] - 'A'; val = (int) cmd[2] - 'A'; sound_cmd_start(sound, val); break; case SOUND_CMD_RESPAWN: sound = (int) cmd[1] - 'A'; sound_cmd_respawn(sound); break; case SOUND_CMD_STOP: sound = (int) cmd[1] - 'A'; if (_sounds[sound].data[0]) _sounds[sound].playing = 0; break; case SOUND_CMD_SETPAN: sound = (int) cmd[1] - 'A'; val = (int) cmd[2] - 'A'; if (_sounds[sound].data[0]) _sounds[sound].pan = val; break; case SOUND_CMD_ATTEN: sound = (int) cmd[1] - 'A'; val = (int) cmd[2] - '@'; if (_sounds[sound].data[0]) _sounds[sound].att = 63 - val; break; case SOUND_CMD_DUP: sound = (int) cmd[1] - 'A'; sound_cmd_dup(sound); break; case SOUND_CMD_UNPAUSE: if (_audio_fd != -1) n = 1; /* falls through */ case SOUND_CMD_PAUSE: ioctl(fd, FIONBIO, &n); break; default: printf("Unknown command '%s'\n", cmd); break; } cmd = cmd_end + 1; } return ret; }
int load_state_from_mem(void *stor) { int i; /* Initialize everything */ z80_reset(0); z80_set_irq_callback(sms_irq_callback); system_reset(); if(snd.enabled) sound_reset(); //davex: header is not saved in memory state // Load VDP context memcpy(&vdp, stor, sizeof(vdp_t)); //VDP context stor += sizeof(vdp_t); //Load SMS context (1/3) memcpy(&sms, stor, sizeof(sms_t) ); stor += sizeof(sms_t); //Load SMS context (2/3) memcpy(&cart.fcr[0],stor, 1 ); stor += 1; memcpy(&cart.fcr[1],stor, 1 ); stor += 1; memcpy(&cart.fcr[2],stor, 1 ); stor += 1; memcpy(&cart.fcr[3],stor, 1 ); stor += 1; //Load SMS context (3/3) memcpy(&cart.sram, stor, 0x8000); stor += 0x8000; // Load Z80 context memcpy(Z80_Context, stor, sizeof(Z80_Regs) ); stor += sizeof(Z80_Regs); memcpy(&after_EI, stor, sizeof(int) ); stor += sizeof(int); // Load YM2413 context FM_SetContext(stor); stor += FM_GetContextSize(); // Load SN76489 context SN76489_SetContext(0, stor); /* Restore callbacks */ z80_set_irq_callback(sms_irq_callback); for(i = 0x00; i <= 0x2F; i++) { cpu_readmap[i] = &cart.rom[(i & 0x1F) << 10]; cpu_writemap[i] = dummy_write; } for(i = 0x30; i <= 0x3F; i++) { cpu_readmap[i] = &sms.wram[(i & 0x07) << 10]; cpu_writemap[i] = &sms.wram[(i & 0x07) << 10]; } sms_mapper_w(3, cart.fcr[3]); sms_mapper_w(2, cart.fcr[2]); sms_mapper_w(1, cart.fcr[1]); sms_mapper_w(0, cart.fcr[0]); /* Force full pattern cache update */ bg_list_index = 0x200; for(i = 0; i < 0x200; i++) { bg_name_list[i] = i; bg_name_dirty[i] = -1; } /* Restore palette */ for(i = 0; i < PALETTE_SIZE; i++) palette_sync(i, 1); viewport_check(); return 1; }
void initpc() { char *p; // allegro_init(); get_executable_name(pcempath,511); pclog("executable_name = %s\n", pcempath); p=get_filename(pcempath); *p=0; pclog("path = %s\n", pcempath); fdd_init(); keyboard_init(); mouse_init(); joystick_init(); midi_init(); loadconfig(NULL); pclog("Config loaded\n"); loadfont("mda.rom", 0, cga_fontdat, cga_fontdatm); loadfont("roms/pc1512/40078.ic127", 0, pc1512_fontdat, pc1512_fontdatm); loadfont("roms/pc200/40109.bin", 0, pc200_fontdat, pc200_fontdatm); codegen_init(); cpuspeed2=(AT)?2:1; // cpuspeed2=cpuspeed; atfullspeed=0; device_init(); initvideo(); mem_init(); loadbios(); mem_add_bios(); timer_reset(); sound_reset(); fdc_init(); // #ifdef USE_NETWORKING vlan_reset(); //NETWORK network_card_init(network_card_current); // #endif loaddisc(0,discfns[0]); loaddisc(1,discfns[1]); //loadfont(); loadnvr(); sound_init(); resetide(); #if __unix if (cdrom_drive == -1) cdrom_null_open(cdrom_drive); else #endif ioctl_open(cdrom_drive); pit_reset(); /* if (romset==ROM_AMI386 || romset==ROM_AMI486) */fullspeed(); ali1429_reset(); // CPUID=(is486 && (cpuspeed==7 || cpuspeed>=9)); // pclog("Init - CPUID %i %i\n",CPUID,cpuspeed); shadowbios=0; #if __unix if (cdrom_drive == -1) cdrom_null_reset(); else #endif ioctl_reset(); }
void xmame_sound_reset( void ) { if( sound_enabled ) sound_reset(); }
/* // resume playing, after audio_pause() */ static void audio_resume(void) { sound_reset(); }
/* // stop playing and empty buffers (for seeking/pause) */ static void reset(void) { sound_reset(); }
int statsave_load(const OEMCHAR *filename) { SFFILEH sffh; int ret; BOOL done; const SFENTRY *tbl; const SFENTRY *tblterm; sffh = statflag_open(filename, NULL, 0); if (sffh == NULL) { return(STATFLAG_FAILURE); } // PCCORE read! ret = statflag_readsection(sffh); if ((ret != STATFLAG_SUCCESS) || (memcmp(sffh->sfh.hdr.index, np2tbl[0].index, sizeof(sffh->sfh.hdr.index)))) { statflag_close(sffh); return(STATFLAG_FAILURE); } soundmng_stop(); rs232c_midipanic(); mpu98ii_midipanic(); pc9861k_midipanic(); sxsi_alltrash(); ret |= flagload_common(&sffh->sfh, np2tbl); CPU_RESET(); CPU_SETEXTSIZE((UINT32)pccore.extmem); nevent_allreset(); sound_changeclock(); beep_changeclock(); sound_reset(); fddmtrsnd_bind(); iocore_reset(&np2cfg); // サウンドでpicを呼ぶので… cbuscore_reset(&np2cfg); fmboard_reset(&np2cfg, pccore.sound); done = FALSE; while((!done) && (ret != STATFLAG_FAILURE)) { ret |= statflag_readsection(sffh); tbl = np2tbl + 1; tblterm = np2tbl + NELEMENTS(np2tbl); while(tbl < tblterm) { if (!memcmp(sffh->sfh.hdr.index, tbl->index, sizeof(sffh->sfh.hdr.index))) { break; } tbl++; } if (tbl < tblterm) { switch(tbl->type) { case STATFLAG_BIN: ret |= flagload_common(&sffh->sfh, tbl); break; case STATFLAG_TERM: done = TRUE; break; case STATFLAG_COM: ret |= flagload_com(&sffh->sfh, tbl); break; case STATFLAG_DMA: ret |= flagload_dma(&sffh->sfh, tbl); break; case STATFLAG_EGC: ret |= flagload_egc(&sffh->sfh, tbl); break; case STATFLAG_EPSON: ret |= flagload_epson(&sffh->sfh, tbl); break; case STATFLAG_EVT: ret |= flagload_evt(&sffh->sfh, tbl); break; case STATFLAG_EXT: ret |= flagload_ext(&sffh->sfh, tbl); break; case STATFLAG_FDD: ret |= flagload_fdd(&sffh->sfh, tbl); break; #if !defined(DISABLE_SOUND) case STATFLAG_FM: ret |= flagload_fm(&sffh->sfh, tbl); break; #endif case STATFLAG_GIJ: ret |= flagload_gij(&sffh->sfh, tbl); break; #if defined(SUPPORT_HOSTDRV) case STATFLAG_HDRV: ret |= hostdrv_sfload(&sffh->sfh, tbl); break; #endif case STATFLAG_MEM: ret |= flagload_mem(&sffh->sfh, tbl); break; case STATFLAG_SXSI: ret |= flagload_sxsi(&sffh->sfh, tbl); break; default: ret |= STATFLAG_WARNING; break; } } else { ret |= STATFLAG_WARNING; } } statflag_close(sffh); // I/O作り直し MEMM_ARCH((pccore.model & PCMODEL_EPSON)?1:0); iocore_build(); iocore_bind(); cbuscore_bind(); fmboard_bind(); gdcs.textdisp |= GDCSCRN_EXT; gdcs.textdisp |= GDCSCRN_ALLDRAW2; gdcs.grphdisp |= GDCSCRN_EXT; gdcs.grphdisp |= GDCSCRN_ALLDRAW2; gdcs.palchange = GDCSCRN_REDRAW; tramflag.renewal = 1; cgwindow.writable |= 0x80; #if defined(CPUSTRUC_FONTPTR) FONTPTR_LOW = fontrom + cgwindow.low; FONTPTR_HIGH = fontrom + cgwindow.high; #endif MEMM_VRAM(vramop.operate); fddmtr_reset(); soundmng_play(); return(ret); }
void Formants::reset() { sound_reset(sound, SAMPLE_RATE, CHANNELS); sound_resize(sound, SAMPLES_PER_CHUNK); }
void resetpchard() { if (!modelchanged) device_close_all(); else modelchanged = 0; device_init(); midi_close(); midi_init(); timer_reset(); sound_reset(); mem_resize(); if (pcfirsttime) { fdc_init(); pcfirsttime = 0; } else fdc_hard_reset(); model_init(); video_init(); speaker_init(); // #ifdef USE_NETWORKING vlan_reset(); //NETWORK network_card_init(network_card_current); // #endif sound_card_init(sound_card_current); if (GUS) device_add(&gus_device); if (GAMEBLASTER) device_add(&cms_device); if (SSI2001) device_add(&ssi2001_device); if (voodoo_enabled) device_add(&voodoo_device); pc_reset(); resetide(); loadnvr(); // cpuspeed2 = (AT)?2:1; // atfullspeed = 0; // setpitclock(models[model].cpu[cpu_manufacturer].cpus[cpu].rspeed); shadowbios = 0; ali1429_reset(); keyboard_at_reset(); // output=3; #if __unix if (cdrom_drive == -1) cdrom_null_reset(); else #endif ioctl_reset(); }
void system_load_state(void *fd) { int i; uint8 *buf; char id[4]; uint16 version; /* Initialize everything */ z80_reset(0); z80_set_irq_callback(sms_irq_callback); system_reset(); if(snd.enabled) sound_reset(); /* Read header */ fread(id, 4, 1, fd); fread(&version, 2, 1, fd); /* Load VDP context */ fread(&vdp, sizeof(vdp_t), 1, fd); /* Load SMS context */ fread(&sms, sizeof(sms_t), 1, fd); cart.fcr[0] = fgetc(fd); cart.fcr[1] = fgetc(fd); cart.fcr[2] = fgetc(fd); cart.fcr[3] = fgetc(fd); fread(cart.sram, 0x8000, 1, fd); /* Load Z80 context */ fread(Z80_Context, sizeof(Z80_Regs), 1, fd); fread(&after_EI, sizeof(int), 1, fd); /* Load YM2413 context */ buf = malloc(FM_GetContextSize()); fread(buf, FM_GetContextSize(), 1, fd); FM_SetContext(buf); free(buf); /* Load SN76489 context */ buf = malloc(SN76489_GetContextSize()); fread(buf, SN76489_GetContextSize(), 1, fd); SN76489_SetContext(0, buf); free(buf); /* Restore callbacks */ z80_set_irq_callback(sms_irq_callback); for(i = 0x00; i <= 0x2F; i++) { cpu_readmap[i] = &cart.rom[(i & 0x1F) << 10]; cpu_writemap[i] = dummy_write; } for(i = 0x30; i <= 0x3F; i++) { cpu_readmap[i] = &sms.wram[(i & 0x07) << 10]; cpu_writemap[i] = &sms.wram[(i & 0x07) << 10]; } sms_mapper_w(3, cart.fcr[3]); sms_mapper_w(2, cart.fcr[2]); sms_mapper_w(1, cart.fcr[1]); sms_mapper_w(0, cart.fcr[0]); /* Force full pattern cache update */ bg_list_index = 0x200; for(i = 0; i < 0x200; i++) { bg_name_list[i] = i; bg_name_dirty[i] = -1; } /* Restore palette */ for(i = 0; i < PALETTE_SIZE; i++) palette_sync(i, 1); viewport_check(); }