void mi::Init(CMachineDataInput * const pi) { #ifndef _MSC_VER DSP_Init(pMasterInfo->SamplesPerSec); #endif numTracks = 1; DryThru = true; for (int c = 0; c < MAX_TAPS; c++) { Tracks[c].Buffer = NULL; Tracks[c].Unit = UNIT_TICK; Tracks[c].Length = pMasterInfo->SamplesPerTick * 3; Tracks[c].Pos = 0; Tracks[c].Feedback = 0.3f; Tracks[c].WetOut = 0; Tracks[c].FilterType = 1; Tracks[c].FilterCutoff = 1000; Tracks[c].FilterBandwidth = 1000; DSP_BW_Reset(Tracks[c].Filter); SetFilter(Tracks[c]); } Tracks[0].WetOut = 0.3f; // enable first track IdleMode = true; IdleCount = 0; }
static bool Drivers_Voice_Init(bool enable) { Driver *voice; voice = g_driverVoice; voice->index = 0xFFFF; if (!enable) return false; if (!DSP_Init()) return false; if (!Drivers_Init(voice, "VOC")) return false; return true; }
int main(void) { CBWState s; float samples[500]; int i; memset(samples, 0, sizeof(float)*500); samples[0] = 1; DSP_Init(44100); DSP_BW_InitBandreject(s, 500, 500); DSP_BW_Reset(s); DSP_BW_WorkStereo(s, samples, 100, WM_READWRITE); for(i = 0; i < 20; i++) printf("%.10f\n", samples[i]); }
int main(int argc, char *argv[]) { s32 res; #if defined(USE_WII_DI) && !defined(GAMECUBE) DI_Init(); #endif VIDEO_Init(); PAD_Init(); DSP_Init(); AUDIO_Init(NULL); gfx_video_init(NULL); gfx_init(); gfx_con_init(NULL); #ifdef DEBUG_WII_GDB DEBUG_Init(GDBSTUB_DEVICE_USB, 1); #endif printf("startup as "); if (argc > 0) printf("'%s'\n", argv[0]); else printf("<unknown>\n"); SYS_RegisterResetFunc(&resetinfo); SYS_SetResetCallback(reset_cb); #ifndef GAMECUBE SYS_SetPowerCallback(power_cb); #endif if (!fatInitDefault()) { printf("fatInitDefault failed\n"); } else { // set the default path if libfat couldnt set it // this allows loading over tcp/usbgecko char cwd[MAXPATHLEN]; if (getcwd(cwd, MAXPATHLEN)) { size_t len = strlen(cwd); if (len > 2 && (cwd[len - 1] == ':' || cwd[len - 2] == ':')) { printf("chdir to default\n"); chdir("/apps/scummvm"); } } } g_system = new OSystem_Wii(); assert(g_system); #ifdef DYNAMIC_MODULES PluginManager::instance().addPluginProvider(new WiiPluginProvider()); #endif res = scummvm_main(argc, argv); g_system->quit(); printf("shutdown\n"); SYS_UnregisterResetFunc(&resetinfo); fatUnmountDefault(); if (res) show_console(res); if (power_btn_pressed) { printf("shutting down\n"); SYS_ResetSystem(SYS_POWEROFF, 0, 0); } printf("reloading\n"); gfx_con_deinit(); gfx_deinit(); gfx_video_deinit(); return res; }
static int __devinit omap34xx_bridge_probe(struct platform_device *pdev) { int status; u32 initStatus; u32 temp; dev_t dev = 0 ; int result; struct dspbridge_platform_data *pdata = pdev->dev.platform_data; omap_dspbridge_dev = pdev; /* use 2.6 device model */ result = alloc_chrdev_region(&dev, 0, 1, driver_name); if (result < 0) { pr_err("%s: Can't get major %d\n", __func__, driver_major); goto err1; } driver_major = MAJOR(dev); cdev_init(&bridge_cdev, &bridge_fops); bridge_cdev.owner = THIS_MODULE; status = cdev_add(&bridge_cdev, dev, 1); if (status) { pr_err("%s: Failed to add bridge device\n", __func__); goto err2; } /* udev support */ bridge_class = class_create(THIS_MODULE, "ti_bridge"); if (IS_ERR(bridge_class)) pr_err("%s: Error creating bridge class\n", __func__); device_create(bridge_class, NULL, MKDEV(driver_major, 0), NULL, "DspBridge"); bridge_create_sysfs(); GT_init(); GT_create(&driverTrace, "LD"); #ifdef CONFIG_BRIDGE_DEBUG if (GT_str) GT_set(GT_str); #elif defined(DDSP_DEBUG_PRODUCT) && GT_TRACE GT_set("**=67"); #endif #ifdef CONFIG_PM /* Initialize the wait queue */ bridge_suspend_data.suspended = 0; init_waitqueue_head(&bridge_suspend_data.suspend_wq); #endif SERVICES_Init(); /* Autostart flag. This should be set to true if the DSP image should * be loaded and run during bridge module initialization */ if (base_img) { temp = true; REG_SetValue(AUTOSTART, (u8 *)&temp, sizeof(temp)); REG_SetValue(DEFEXEC, (u8 *)base_img, strlen(base_img) + 1); } else { temp = false; REG_SetValue(AUTOSTART, (u8 *)&temp, sizeof(temp)); REG_SetValue(DEFEXEC, (u8 *) "\0", (u32)2); } if (shm_size >= 0x10000) { /* 64 KB */ initStatus = REG_SetValue(SHMSIZE, (u8 *)&shm_size, sizeof(shm_size)); } else { initStatus = DSP_EINVALIDARG; status = -1; pr_err("%s: SHM size must be at least 64 KB\n", __func__); } GT_1trace(driverTrace, GT_7CLASS, "requested shm_size = 0x%x\n", shm_size); if (pdata->phys_mempool_base && pdata->phys_mempool_size) { phys_mempool_base = pdata->phys_mempool_base; phys_mempool_size = pdata->phys_mempool_size; } GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_base = 0x%x \n", phys_mempool_base); GT_1trace(driverTrace, GT_7CLASS, "phys_mempool_size = 0x%x\n", phys_mempool_base); if ((phys_mempool_base > 0x0) && (phys_mempool_size > 0x0)) MEM_ExtPhysPoolInit(phys_mempool_base, phys_mempool_size); if (tc_wordswapon) { GT_0trace(driverTrace, GT_7CLASS, "TC Word Swap is enabled\n"); REG_SetValue(TCWORDSWAP, (u8 *)&tc_wordswapon, sizeof(tc_wordswapon)); } else { GT_0trace(driverTrace, GT_7CLASS, "TC Word Swap is disabled\n"); REG_SetValue(TCWORDSWAP, (u8 *)&tc_wordswapon, sizeof(tc_wordswapon)); } if (DSP_SUCCEEDED(initStatus)) { #ifdef CONFIG_BRIDGE_DVFS clk_handle = clk_get(NULL, "iva2_ck"); if (!clk_handle) pr_err("%s: clk_get failed to get iva2_ck\n", __func__); if (clk_notifier_register(clk_handle, &iva_clk_notifier)) pr_err("%s: clk_notifier_register failed for iva2_ck\n", __func__); if (!min_dsp_freq) min_dsp_freq = pdata->mpu_min_speed; #endif driverContext = DSP_Init(&initStatus); if (DSP_FAILED(initStatus)) { status = -1; pr_err("DSP Bridge driver initialization failed\n"); } else { pr_info("DSP Bridge driver loaded\n"); } } #ifdef CONFIG_BRIDGE_RECOVERY bridge_rec_queue = create_workqueue("bridge_rec_queue"); INIT_WORK(&bridge_recovery_work, bridge_recover); INIT_COMPLETION(bridge_comp); #endif DBC_Assert(status == 0); DBC_Assert(DSP_SUCCEEDED(initStatus)); return 0; err2: unregister_chrdev_region(dev, 1); err1: return result; }
/** * Initialise emulation */ static void Main_Init(void) { /* Open debug log file */ if (!Log_Init()) { fprintf(stderr, "Logging/tracing initialization failed\n"); exit(-1); } Log_Printf(LOG_INFO, PROG_NAME ", compiled on: " __DATE__ ", " __TIME__ "\n"); /* Init SDL's video subsystem. Note: Audio and joystick subsystems will be initialized later (failures there are not fatal). */ if (SDL_Init(SDL_INIT_VIDEO | Opt_GetNoParachuteFlag()) < 0) { fprintf(stderr, "Could not initialize the SDL library:\n %s\n", SDL_GetError() ); exit(-1); } ClocksTimings_InitMachine ( ConfigureParams.System.nMachineType ); Resolution_Init(); SDLGui_Init(); Screen_Init(); Main_SetTitle(NULL); // HostScreen_Init(); DSP_Init(); // Floppy_Init(); M68000_Init(); /* Init CPU emulation */ // Audio_Init(); // DmaSnd_Init(); Keymap_Init(); /* call menu at startup */ if (!File_Exists(sConfigFileName) || ConfigureParams.ConfigDialog.bShowConfigDialogAtStartup) Dialog_DoProperty(); else Dialog_CheckFiles(); if (bQuitProgram) { SDL_Quit(); exit(-2); } // const char *err_msg; // // while ((err_msg=Reset_Cold())!=NULL) // { // DlgMissing_Rom(); // if (bQuitProgram) { // Main_RequestQuit(); // break; // } // } Reset_Cold(); // if (bQuitProgram) { // SDL_Quit(); // exit(-2); // } IoMem_Init(); /* done as last, needs CPU & DSP running... */ DebugUI_Init(); }