void retro_init() { MDFN_PixelFormat pix_fmt(MDFN_COLORSPACE_RGB, 16, 8, 0, 24); surf = new MDFN_Surface(mednafen_buf, 384, 224, 384, pix_fmt); std::vector<MDFNGI*> ext; MDFNI_InitializeModules(ext); const char *dir = NULL; const char *saves = NULL; std::vector<MDFNSetting> settings; environ_cb(RETRO_ENVIRONMENT_GET_SAVES_DIRECTORY, &saves); if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) { std::string save_path = saves; //dox http://mednafen.sourceforge.net/documentation/09x/vb.html MDFNSetting vb_parallax = { "vb.disable_parallax", MDFNSF_EMU_STATE, "Disable parallax for BG and OBJ rendering", NULL, MDFNST_BOOL, "1", NULL, NULL, NULL }; MDFNSetting vb_anaglyph_preset = { "vb.anaglyph.preset", MDFNSF_EMU_STATE, "Disable anaglyph preset", NULL, MDFNST_BOOL, "disabled", NULL, NULL, NULL }; MDFNSetting vb_anaglyph_lcolor = { "vb.anaglyph.lcolor", MDFNSF_EMU_STATE, "Anaglyph l color", NULL, MDFNST_BOOL, "0xFF0000", NULL, NULL, NULL }; //MDFNSetting vb_anaglyph_lcolor = { "vb.anaglyph.lcolor", MDFNSF_EMU_STATE, "Anaglyph l color", NULL, MDFNST_BOOL, "0xFFFFFF", NULL, NULL, NULL }; MDFNSetting vb_anaglyph_rcolor = { "vb.anaglyph.rcolor", MDFNSF_EMU_STATE, "Anaglyph r color", NULL, MDFNST_BOOL, "0x000000", NULL, NULL, NULL }; //MDFNSetting vb_allow_draw_skip = { "vb.allow_draw_skip", MDFNSF_EMU_STATE, "Allow draw skipping", NULL, MDFNST_BOOL, "1", NULL, NULL, NULL }; //MDFNSetting vb_instant_display_hack = { "vb.instant_display_hack", MDFNSF_EMU_STATE, "ADisplay latency reduction hack", NULL, MDFNST_BOOL, "1", NULL, NULL, NULL }; MDFNSetting filesys = { "filesys.path_sav", MDFNSF_NOFLAGS, "Memcards", NULL, MDFNST_STRING, save_path.c_str() }; settings.push_back(vb_parallax); settings.push_back(vb_anaglyph_preset); settings.push_back(vb_anaglyph_lcolor); settings.push_back(vb_anaglyph_rcolor); //settings.push_back(vb_allow_draw_skip); //settings.push_back(vb_instant_display_hack); settings.push_back(filesys); MDFNI_Initialize(dir, settings); } else { fprintf(stderr, "System directory is not defined. Cannot continue ...\n"); failed_init = true; } // Hints that we need a fairly powerful system to run this. unsigned level = 3; environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level); }
void retro_init() { MDFN_PixelFormat pix_fmt(MDFN_COLORSPACE_RGB, 16, 8, 0, 24); surf = new MDFN_Surface(mednafen_buf, 680, 480, 680, pix_fmt); std::vector<MDFNGI*> ext; MDFNI_InitializeModules(ext); const char *dir = NULL; std::vector<MDFNSetting> settings; if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) { std::string eu_path = dir; eu_path += "/scph5502.bin"; std::string jp_path = dir; jp_path += "/scph5500.bin"; std::string na_path = dir; na_path += "/scph5501.bin"; MDFNSetting jp_setting = { "psx.bios_jp", MDFNSF_EMU_STATE, "SCPH-5500 BIOS", NULL, MDFNST_STRING, jp_path.c_str() }; MDFNSetting eu_setting = { "psx.bios_eu", MDFNSF_EMU_STATE, "SCPH-5502 BIOS", NULL, MDFNST_STRING, eu_path.c_str() }; MDFNSetting na_setting = { "psx.bios_na", MDFNSF_EMU_STATE, "SCPH-5501 BIOS", NULL, MDFNST_STRING, na_path.c_str() }; MDFNSetting filesys = { "filesys.path_sav", MDFNSF_NOFLAGS, "Memcards", NULL, MDFNST_STRING, "." }; settings.push_back(jp_setting); settings.push_back(eu_setting); settings.push_back(na_setting); settings.push_back(filesys); MDFNI_Initialize(dir, settings); } else { fprintf(stderr, "System directory is not defined. Cannot continue ...\n"); failed_init = true; } // Hints that we need a fairly powerful system to run this. unsigned level = 3; environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level); }
void retro_init() { MDFN_PixelFormat pix_fmt(MDFN_COLORSPACE_RGB, 16, 8, 0, 24); surf = new MDFN_Surface(mednafen_buf, 1365, 265, 1365, pix_fmt); std::vector<MDFNGI*> ext; MDFNI_InitializeModules(ext); const char *dir = NULL; const char *saves = NULL; std::vector<MDFNSetting> settings; environ_cb(RETRO_ENVIRONMENT_GET_SAVES_DIRECTORY, &saves); if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) { std::string pce_path = dir; pce_path += "/syscard3.pce"; std::string save_path = saves; MDFNSetting pce_setting = { "pce.cdbios", MDFNSF_EMU_STATE, "PCE CD BIOS", NULL, MDFNST_STRING, pce_path.c_str() }; MDFNSetting filesys = { "filesys.path_sav", MDFNSF_NOFLAGS, "Memcards", NULL, MDFNST_STRING, save_path.c_str() }; settings.push_back(pce_setting); settings.push_back(filesys); MDFNI_Initialize(dir, settings); } else { fprintf(stderr, "System directory is not defined. Cannot continue ...\n"); failed_init = true; } // Hints that we need a fairly powerful system to run this. unsigned level = 3; environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level); }
void retro_init(void) { struct retro_log_callback log; if (environ_cb(RETRO_ENVIRONMENT_GET_LOG_INTERFACE, &log)) log_cb = log.log; else log_cb = NULL; MDFNI_InitializeModule(); const char *dir = NULL; if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir) { retro_base_directory = dir; // Make sure that we don't have any lingering slashes, etc, as they break Windows. size_t last = retro_base_directory.find_last_not_of("/\\"); if (last != std::string::npos) last++; retro_base_directory = retro_base_directory.substr(0, last); MDFNI_Initialize(retro_base_directory.c_str()); } else { /* TODO: Add proper fallback */ if (log_cb) log_cb(RETRO_LOG_WARN, "System directory is not defined. Fallback on using same dir as ROM for system directory later ...\n"); failed_init = true; } if (environ_cb(RETRO_ENVIRONMENT_GET_SAVE_DIRECTORY, &dir) && dir) { // If save directory is defined use it, otherwise use system directory retro_save_directory = *dir ? dir : retro_base_directory; // Make sure that we don't have any lingering slashes, etc, as they break Windows. size_t last = retro_save_directory.find_last_not_of("/\\"); if (last != std::string::npos) last++; retro_save_directory = retro_save_directory.substr(0, last); } else { /* TODO: Add proper fallback */ if (log_cb) log_cb(RETRO_LOG_WARN, "Save directory is not defined. Fallback on using SYSTEM directory ...\n"); retro_save_directory = retro_base_directory; } #if defined(FRONTEND_SUPPORTS_RGB565) enum retro_pixel_format rgb565 = RETRO_PIXEL_FORMAT_RGB565; if (environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &rgb565) && log_cb) log_cb(RETRO_LOG_INFO, "Frontend supports RGB565 - will use that instead of XRGB1555.\n"); #endif if (environ_cb(RETRO_ENVIRONMENT_GET_PERF_INTERFACE, &perf_cb)) perf_get_cpu_features_cb = perf_cb.get_cpu_features; else perf_get_cpu_features_cb = NULL; check_system_specs(); }