bsv_movie_t *bsv_movie_init(const char *path, enum rarch_movie_type type) { bsv_movie_t *handle = (bsv_movie_t*)calloc(1, sizeof(*handle)); if (!handle) return NULL; if (type == RARCH_MOVIE_PLAYBACK) { if (!init_playback(handle, path)) goto error; } else if (!init_record(handle, path)) goto error; /* Just pick something really large * ~1 million frames rewind should do the trick. */ if (!(handle->frame_pos = (size_t*)calloc((1 << 20), sizeof(size_t)))) goto error; handle->frame_pos[0] = handle->min_file_pos; handle->frame_mask = (1 << 20) - 1; return handle; error: bsv_movie_free(handle); return NULL; }
/*returns:(0,2)=>(success,success no convert*/ static long init_bo(boRecord* pbo) { epicsStatus ret = init_record((dbCommon*)pbo, &pbo->out); if(ret == 0) ret = 2; return ret; }
static long ai_init_record(aiRecord *rec) { long status = init_record((dbCommon *)rec, &rec->inp); /* Make sure record processing routine does not perform any conversion*/ if (rec->linr != menuConvertSLOPE) rec->linr = 0; return status; }
void init_sound(void) { int audiodevice ; char *ptr ; init_record() ; if (!isSound) return ; audiodevice = detect_audiodevice() ; if (!audiodevice) { printf("Unable to found any suported soundcard.\n") ; isSound = FALSE ; return ; } if (!allocdosmem(samples_to_generate*2+65536+32, &lowmemsample)) { printf("*** Can't allocate lowmem area for sound emulation.\n") ; isSound = FALSE ; return ; } if (isMIDI&&(audiodevice == AUDIODEVICE_SOUNDBLASTER)) { printf("ST MIDI emulation enabled.\n") ; isSound = FALSE ; return ; } isMIDI = FALSE ; ptr = (char *)((lowmemsample.linear_base+65536)&0xffff0000) ; audio_buffer1 = ptr ; audio_buffer2 = audio_buffer1 + samples_to_generate ; memset(audio_buffer1,0x80,(samples_to_generate*2)+32) ; AudioDevice = audiodevice ; Reset_Sound() ; Ym2149Init() ; init_soundcard() ; if (AudioDevice == AUDIODEVICE_SOUNDBLASTER) { audio.vector = (audio.irq<8) ? audio.irq+8 : audio.irq+0x68 ; audio.picport= (audio.irq<8) ? 0x20 : 0xa0 ; audio.maskirq=1<<(audio.irq&7) ; prev_sound_handler = _dos_getvect(audio.vector) ; _dos_setvect(audio.vector,inthandler) ; outp(audio.picport+1,inp(audio.picport+1)&~audio.maskirq) ; } pause_sound() ; printf("soundchip emulation initialized. (c) Arnaud Carre.\n") ; if (isSamples) printf("STF samples support added (still *very* buggy - you've been warned)\n") ; else printf("no STF samples support.\n") ; printf("MIDI emulation disabled.\n") ; }
static long init_li(longinRecord* pli) { return init_record((dbCommon*)pli, &pli->inp); }
static long init_bi(biRecord* pbi) { return init_record((dbCommon*)pbi, &pbi->inp); }
/*returns: (-1,0)=>(failure,success)*/ static long init_mbbi(mbbiRecord* pmbbi) { return init_record((dbCommon*)pmbbi, &pmbbi->inp); }
/*returns: (-1,0)=>(failure,success)*/ static long init_wf(waveformRecord* pwf) { return init_record((dbCommon*)pwf, &pwf->inp); }
/*returns: (-1,0)=>(failure,success)*/ static long init_si(stringinRecord* psi) { return init_record((dbCommon*)psi, &psi->inp); }