4 * This work is licensed under the terms of the GNU GPLv2 or later.
5 * See the COPYING file in the top-level directory.
8 #define _GNU_SOURCE 1 // strcasestr
14 #include "../libpcsxcore/misc.h"
15 #include "../libpcsxcore/psxcounters.h"
16 #include "../libpcsxcore/psxmem_map.h"
17 #include "../libpcsxcore/new_dynarec/new_dynarec.h"
18 #include "../libpcsxcore/cdrom.h"
19 #include "../libpcsxcore/cdriso.h"
20 #include "../libpcsxcore/cheat.h"
21 #include "../plugins/dfsound/out.h"
22 #include "../plugins/dfinput/externals.h"
26 #include "plugin_lib.h"
30 static retro_video_refresh_t video_cb;
31 static retro_input_poll_t input_poll_cb;
32 static retro_input_state_t input_state_cb;
33 static retro_environment_t environ_cb;
34 static retro_audio_sample_batch_t audio_batch_cb;
36 static void *vout_buf;
37 static int vout_width, vout_height;
38 static int vout_doffs_old, vout_fb_dirty;
39 static bool vout_can_dupe;
41 static int samples_sent, samples_to_send;
42 static int plugins_opened;
43 static int is_pal_mode;
45 /* memory card data */
46 extern char Mcd1Data[MCD_SIZE];
47 extern char McdDisable[2];
49 /* PCSX ReARMed core calls and stuff */
50 int in_type1, in_type2;
51 int in_a1[2] = { 127, 127 }, in_a2[2] = { 127, 127 };
53 int in_enable_vibration;
55 /* PSX max resolution is 640x512, but with enhancement it's 1024x512 */
56 #define VOUT_MAX_WIDTH 1024
57 #define VOUT_MAX_HEIGHT 512
59 static void init_memcard(char *mcd_data)
64 memset(mcd_data, 0, MCD_SIZE);
66 mcd_data[off++] = 'M';
67 mcd_data[off++] = 'C';
69 mcd_data[off++] = 0x0e;
71 for (i = 0; i < 15; i++) {
72 mcd_data[off++] = 0xa0;
74 mcd_data[off++] = 0xff;
75 mcd_data[off++] = 0xff;
77 mcd_data[off++] = 0xa0;
80 for (i = 0; i < 20; i++) {
81 mcd_data[off++] = 0xff;
82 mcd_data[off++] = 0xff;
83 mcd_data[off++] = 0xff;
84 mcd_data[off++] = 0xff;
86 mcd_data[off++] = 0xff;
87 mcd_data[off++] = 0xff;
92 static int vout_open(void)
97 static void vout_set_mode(int w, int h, int raw_w, int raw_h, int bpp)
103 #ifndef FRONTEND_SUPPORTS_RGB565
104 static void convert(void *buf, size_t bytes)
106 unsigned int i, v, *p = buf;
108 for (i = 0; i < bytes / 4; i++) {
110 p[i] = (v & 0x001f001f) | ((v >> 1) & 0x7fe07fe0);
115 static void vout_flip(const void *vram, int stride, int bgr24, int w, int h)
117 unsigned short *dest = vout_buf;
118 const unsigned short *src = vram;
119 int dstride = vout_width, h1 = h;
124 memset(vout_buf, 0, dstride * h * 2);
128 doffs = (vout_height - h) * dstride;
129 doffs += (dstride - w) / 2 & ~1;
130 if (doffs != vout_doffs_old) {
132 memset(vout_buf, 0, dstride * h * 2);
133 vout_doffs_old = doffs;
139 // XXX: could we switch to RETRO_PIXEL_FORMAT_XRGB8888 here?
140 for (; h1-- > 0; dest += dstride, src += stride)
142 bgr888_to_rgb565(dest, src, w * 3);
147 for (; h1-- > 0; dest += dstride, src += stride)
149 bgr555_to_rgb565(dest, src, w * 2);
154 #ifndef FRONTEND_SUPPORTS_RGB565
155 convert(vout_buf, vout_width * vout_height * 2);
158 pl_rearmed_cbs.flip_cnt++;
161 static void vout_close(void)
165 static void *pl_mmap(unsigned int size)
167 return psxMap(0, size, 0, MAP_TAG_VRAM);
170 static void pl_munmap(void *ptr, unsigned int size)
172 psxUnmap(ptr, size, MAP_TAG_VRAM);
175 struct rearmed_cbs pl_rearmed_cbs = {
176 .pl_vout_open = vout_open,
177 .pl_vout_set_mode = vout_set_mode,
178 .pl_vout_flip = vout_flip,
179 .pl_vout_close = vout_close,
182 /* from psxcounters */
183 .gpu_hcnt = &hSyncCount,
184 .gpu_frame_count = &frame_counter,
187 void pl_frame_limit(void)
189 /* called once per frame, make psxCpu->Execute() above return */
193 void pl_timing_prepare(int is_pal)
195 is_pal_mode = is_pal;
198 void plat_trigger_vibrate(int is_strong)
202 void pl_update_gun(int *xn, int *yn, int *xres, int *yres, int *in)
207 static int snd_init(void)
212 static void snd_finish(void)
216 static int snd_busy(void)
218 if (samples_to_send > samples_sent)
219 return 0; /* give more samples */
224 static void snd_feed(void *buf, int bytes)
226 audio_batch_cb(buf, bytes / 4);
227 samples_sent += bytes / 4;
230 void out_register_libretro(struct out_driver *drv)
232 drv->name = "libretro";
233 drv->init = snd_init;
234 drv->finish = snd_finish;
235 drv->busy = snd_busy;
236 drv->feed = snd_feed;
240 void retro_set_environment(retro_environment_t cb)
242 static const struct retro_variable vars[] = {
243 { "frameskip", "Frameskip; 0|1|2|3" },
244 { "region", "Region; Auto|NTSC|PAL" },
245 { "pad1type", "Pad 1 Type; standard|analog" },
247 { "rearmed_drc", "Dynamic recompiler; enabled|disabled" },
249 #if defined(__ARM_NEON__) || defined(NEON_PC)
250 { "neon_interlace_enable", "Enable interlacing mode(s); disabled|enabled" },
251 { "neon_enhancement_enable", "Enhanced resolution (slow); disabled|enabled" },
252 { "neon_enhancement_no_main", "Enhanced resolution speed hack; disabled|enabled" },
259 cb(RETRO_ENVIRONMENT_SET_VARIABLES, (void*)vars);
262 void retro_set_video_refresh(retro_video_refresh_t cb) { video_cb = cb; }
263 void retro_set_audio_sample(retro_audio_sample_t cb) { (void)cb; }
264 void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) { audio_batch_cb = cb; }
265 void retro_set_input_poll(retro_input_poll_t cb) { input_poll_cb = cb; }
266 void retro_set_input_state(retro_input_state_t cb) { input_state_cb = cb; }
268 unsigned retro_api_version(void)
270 return RETRO_API_VERSION;
273 void retro_set_controller_port_device(unsigned port, unsigned device)
277 void retro_get_system_info(struct retro_system_info *info)
279 memset(info, 0, sizeof(*info));
280 info->library_name = "PCSX-ReARMed";
281 info->library_version = "r19";
282 info->valid_extensions = "bin|cue|img|mdf|pbp|toc|cbn|m3u";
283 info->need_fullpath = true;
286 void retro_get_system_av_info(struct retro_system_av_info *info)
288 memset(info, 0, sizeof(*info));
289 info->timing.fps = is_pal_mode ? 50 : 60;
290 info->timing.sample_rate = 44100;
291 info->geometry.base_width = 320;
292 info->geometry.base_height = 240;
293 info->geometry.max_width = VOUT_MAX_WIDTH;
294 info->geometry.max_height = VOUT_MAX_HEIGHT;
295 info->geometry.aspect_ratio = 4.0 / 3.0;
299 size_t retro_serialize_size(void)
301 // it's currently 4380651 bytes, but have some reserved for future
311 static void *save_open(const char *name, const char *mode)
315 if (name == NULL || mode == NULL)
318 fp = malloc(sizeof(*fp));
322 fp->buf = (char *)name;
324 fp->is_write = (mode[0] == 'w' || mode[1] == 'w');
329 static int save_read(void *file, void *buf, u32 len)
331 struct save_fp *fp = file;
332 if (fp == NULL || buf == NULL)
335 memcpy(buf, fp->buf + fp->pos, len);
340 static int save_write(void *file, const void *buf, u32 len)
342 struct save_fp *fp = file;
343 if (fp == NULL || buf == NULL)
346 memcpy(fp->buf + fp->pos, buf, len);
351 static long save_seek(void *file, long offs, int whence)
353 struct save_fp *fp = file;
369 static void save_close(void *file)
371 struct save_fp *fp = file;
372 size_t r_size = retro_serialize_size();
376 if (fp->pos > r_size)
377 SysPrintf("ERROR: save buffer overflow detected\n");
378 else if (fp->is_write && fp->pos < r_size)
379 // make sure we don't save trash in leftover space
380 memset(fp->buf + fp->pos, 0, r_size - fp->pos);
384 bool retro_serialize(void *data, size_t size)
386 int ret = SaveState(data);
387 return ret == 0 ? true : false;
390 bool retro_unserialize(const void *data, size_t size)
392 int ret = LoadState(data);
393 return ret == 0 ? true : false;
397 void retro_cheat_reset(void)
402 void retro_cheat_set(unsigned index, bool enabled, const char *code)
407 // cheat funcs are destructive, need a copy..
408 strncpy(buf, code, sizeof(buf));
409 buf[sizeof(buf) - 1] = 0;
411 if (index < NumCheats)
412 ret = EditCheat(index, "", buf);
414 ret = AddCheat("", buf);
417 SysPrintf("Failed to set cheat %#u\n", index);
418 else if (index < NumCheats)
419 Cheats[index].Enabled = enabled;
422 /* multidisk support */
423 static bool disk_ejected;
424 static unsigned int disk_current_index;
425 static unsigned int disk_count;
426 static struct disks_state {
428 int internal_index; // for multidisk eboots
431 static bool disk_set_eject_state(bool ejected)
434 SetCdOpenCaseTime(ejected ? -1 : (time(NULL) + 2));
437 disk_ejected = ejected;
441 static bool disk_get_eject_state(void)
443 /* can't be controlled by emulated software */
447 static unsigned int disk_get_image_index(void)
449 return disk_current_index;
452 static bool disk_set_image_index(unsigned int index)
454 if (index >= sizeof(disks) / sizeof(disks[0]))
458 CdromLabel[0] = '\0';
460 if (disks[index].fname == NULL) {
461 SysPrintf("missing disk #%u\n", index);
464 // RetroArch specifies "no disk" with index == count,
465 // so don't fail here..
466 disk_current_index = index;
470 SysPrintf("switching to disk %u: \"%s\" #%d\n", index,
471 disks[index].fname, disks[index].internal_index);
473 cdrIsoMultidiskSelect = disks[index].internal_index;
474 set_cd_image(disks[index].fname);
475 if (ReloadCdromPlugin() < 0) {
476 SysPrintf("failed to load cdr plugin\n");
479 if (CDR_open() < 0) {
480 SysPrintf("failed to open cdr plugin\n");
485 SetCdOpenCaseTime(time(NULL) + 2);
489 disk_current_index = index;
493 static unsigned int disk_get_num_images(void)
498 static bool disk_replace_image_index(unsigned index,
499 const struct retro_game_info *info)
504 if (index >= sizeof(disks) / sizeof(disks[0]))
507 old_fname = disks[index].fname;
508 disks[index].fname = NULL;
509 disks[index].internal_index = 0;
512 disks[index].fname = strdup(info->path);
513 if (index == disk_current_index)
514 ret = disk_set_image_index(index);
517 if (old_fname != NULL)
523 static bool disk_add_image_index(void)
532 static struct retro_disk_control_callback disk_control = {
533 .set_eject_state = disk_set_eject_state,
534 .get_eject_state = disk_get_eject_state,
535 .get_image_index = disk_get_image_index,
536 .set_image_index = disk_set_image_index,
537 .get_num_images = disk_get_num_images,
538 .replace_image_index = disk_replace_image_index,
539 .add_image_index = disk_add_image_index,
542 // just in case, maybe a win-rt port in the future?
549 static char base_dir[PATH_MAX];
551 static bool read_m3u(const char *file)
555 FILE *f = fopen(file, "r");
559 while (fgets(line, sizeof(line), f) && disk_count < sizeof(disks) / sizeof(disks[0])) {
562 char *carrige_return = strchr(line, '\r');
564 *carrige_return = '\0';
565 char *newline = strchr(line, '\n');
571 snprintf(name, sizeof(name), "%s%c%s", base_dir, SLASH, line);
572 disks[disk_count++].fname = strdup(name);
577 return (disk_count != 0);
580 static void extract_directory(char *buf, const char *path, size_t size)
583 strncpy(buf, path, size - 1);
584 buf[size - 1] = '\0';
586 base = strrchr(buf, '/');
588 base = strrchr(buf, '\\');
600 /* Blackberry QNX doesn't have strcasestr */
603 * Find the first occurrence of find in s, ignore case.
606 strcasestr(const char *s, const char*find)
611 if ((c = *find++) != 0) {
612 c = tolower((unsigned char)c);
616 if ((sc = *s++) == 0)
618 } while ((char)tolower((unsigned char)sc) != c);
619 } while (strncasecmp(s, find, len) != 0);
626 bool retro_load_game(const struct retro_game_info *info)
629 bool is_m3u = (strcasestr(info->path, ".m3u") != NULL);
631 #ifdef FRONTEND_SUPPORTS_RGB565
632 enum retro_pixel_format fmt = RETRO_PIXEL_FORMAT_RGB565;
633 if (environ_cb(RETRO_ENVIRONMENT_SET_PIXEL_FORMAT, &fmt)) {
634 SysPrintf("RGB565 supported, using it\n");
638 if (info == NULL || info->path == NULL) {
639 SysPrintf("info->path required\n");
643 if (plugins_opened) {
648 for (i = 0; i < sizeof(disks) / sizeof(disks[0]); i++) {
649 if (disks[i].fname != NULL) {
650 free(disks[i].fname);
651 disks[i].fname = NULL;
653 disks[i].internal_index = 0;
656 disk_current_index = 0;
657 extract_directory(base_dir, info->path, sizeof(base_dir));
660 if (!read_m3u(info->path)) {
661 SysPrintf("failed to read m3u file\n");
666 disks[0].fname = strdup(info->path);
669 set_cd_image(disks[0].fname);
671 /* have to reload after set_cd_image for correct cdr plugin */
672 if (LoadPlugins() == -1) {
673 SysPrintf("failed to load plugins\n");
680 if (OpenPlugins() == -1) {
681 SysPrintf("failed to open plugins\n");
685 plugin_call_rearmed_cbs();
689 if (CheckCdrom() == -1) {
690 SysPrintf("unsupported/invalid CD image: %s\n", info->path);
696 if (LoadCdrom() == -1) {
697 SysPrintf("could not load CD-ROM!\n");
704 disk_count = cdrIsoMultidiskCount < 8 ? cdrIsoMultidiskCount : 8;
705 for (i = 1; i < sizeof(disks) / sizeof(disks[0]) && i < cdrIsoMultidiskCount; i++) {
706 disks[i].fname = strdup(info->path);
707 disks[i].internal_index = i;
714 bool retro_load_game_special(unsigned game_type, const struct retro_game_info *info, size_t num_info)
719 void retro_unload_game(void)
723 unsigned retro_get_region(void)
725 return is_pal_mode ? RETRO_REGION_PAL : RETRO_REGION_NTSC;
728 void *retro_get_memory_data(unsigned id)
730 if (id == RETRO_MEMORY_SAVE_RAM)
736 size_t retro_get_memory_size(unsigned id)
738 if (id == RETRO_MEMORY_SAVE_RAM)
744 void retro_reset(void)
749 static const unsigned short retro_psx_map[] = {
750 [RETRO_DEVICE_ID_JOYPAD_B] = 1 << DKEY_CROSS,
751 [RETRO_DEVICE_ID_JOYPAD_Y] = 1 << DKEY_SQUARE,
752 [RETRO_DEVICE_ID_JOYPAD_SELECT] = 1 << DKEY_SELECT,
753 [RETRO_DEVICE_ID_JOYPAD_START] = 1 << DKEY_START,
754 [RETRO_DEVICE_ID_JOYPAD_UP] = 1 << DKEY_UP,
755 [RETRO_DEVICE_ID_JOYPAD_DOWN] = 1 << DKEY_DOWN,
756 [RETRO_DEVICE_ID_JOYPAD_LEFT] = 1 << DKEY_LEFT,
757 [RETRO_DEVICE_ID_JOYPAD_RIGHT] = 1 << DKEY_RIGHT,
758 [RETRO_DEVICE_ID_JOYPAD_A] = 1 << DKEY_CIRCLE,
759 [RETRO_DEVICE_ID_JOYPAD_X] = 1 << DKEY_TRIANGLE,
760 [RETRO_DEVICE_ID_JOYPAD_L] = 1 << DKEY_L1,
761 [RETRO_DEVICE_ID_JOYPAD_R] = 1 << DKEY_R1,
762 [RETRO_DEVICE_ID_JOYPAD_L2] = 1 << DKEY_L2,
763 [RETRO_DEVICE_ID_JOYPAD_R2] = 1 << DKEY_R2,
764 [RETRO_DEVICE_ID_JOYPAD_L3] = 1 << DKEY_L3,
765 [RETRO_DEVICE_ID_JOYPAD_R3] = 1 << DKEY_R3,
767 #define RETRO_PSX_MAP_LEN (sizeof(retro_psx_map) / sizeof(retro_psx_map[0]))
769 static void update_variables(bool in_flight)
771 struct retro_variable var;
774 var.key = "frameskip";
776 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
777 pl_rearmed_cbs.frameskip = atoi(var.value);
782 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
785 if (strcmp(var.value, "Automatic") == 0)
787 else if (strcmp(var.value, "NTSC") == 0)
789 else if (strcmp(var.value, "PAL") == 0)
794 var.key = "pad1type";
796 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
798 in_type1 = PSE_PAD_TYPE_STANDARD;
799 if (strcmp(var.value, "analog") == 0)
800 in_type1 = PSE_PAD_TYPE_ANALOGPAD;
803 #if defined(__ARM_NEON__) || defined(NEON_PC)
805 var.key = "neon_interlace_enable";
807 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
809 if (strcmp(var.value, "disabled") == 0)
810 pl_rearmed_cbs.gpu_neon.allow_interlace = 0;
811 else if (strcmp(var.value, "enabled") == 0)
812 pl_rearmed_cbs.gpu_neon.allow_interlace = 1;
816 var.key = "neon_enhancement_enable";
818 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
820 if (strcmp(var.value, "disabled") == 0)
821 pl_rearmed_cbs.gpu_neon.enhancement_enable = 0;
822 else if (strcmp(var.value, "enabled") == 0)
823 pl_rearmed_cbs.gpu_neon.enhancement_enable = 1;
827 var.key = "neon_enhancement_no_main";
829 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
831 if (strcmp(var.value, "disabled") == 0)
832 pl_rearmed_cbs.gpu_neon.enhancement_no_main = 0;
833 else if (strcmp(var.value, "enabled") == 0)
834 pl_rearmed_cbs.gpu_neon.enhancement_no_main = 1;
840 var.key = "rearmed_drc";
842 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) || var.value)
844 R3000Acpu *prev_cpu = psxCpu;
846 if (strcmp(var.value, "disabled") == 0)
847 Config.Cpu = CPU_INTERPRETER;
848 else if (strcmp(var.value, "enabled") == 0)
849 Config.Cpu = CPU_DYNAREC;
851 psxCpu = (Config.Cpu == CPU_INTERPRETER) ? &psxInt : &psxRec;
852 if (psxCpu != prev_cpu) {
853 prev_cpu->Shutdown();
855 psxCpu->Reset(); // not really a reset..
861 // inform core things about possible config changes
862 plugin_call_rearmed_cbs();
864 if (GPU_open != NULL && GPU_close != NULL) {
866 GPU_open(&gpuDisp, "PCSX", NULL);
879 bool updated = false;
880 if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE_UPDATE, &updated) && updated)
881 update_variables(true);
884 for (i = 0; i < RETRO_PSX_MAP_LEN; i++)
885 if (input_state_cb(1, RETRO_DEVICE_JOYPAD, 0, i))
886 in_keystate |= retro_psx_map[i];
888 for (i = 0; i < RETRO_PSX_MAP_LEN; i++)
889 if (input_state_cb(0, RETRO_DEVICE_JOYPAD, 0, i))
890 in_keystate |= retro_psx_map[i];
892 if (in_type1 == PSE_PAD_TYPE_ANALOGPAD)
894 in_a1[0] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
895 in_a1[1] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_LEFT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
896 in_a2[0] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_X) / 256) + 128;
897 in_a2[1] = (input_state_cb(0, RETRO_DEVICE_ANALOG, RETRO_DEVICE_INDEX_ANALOG_RIGHT, RETRO_DEVICE_ID_ANALOG_Y) / 256) + 128;
903 samples_to_send += is_pal_mode ? 44100 / 50 : 44100 / 60;
905 video_cb((vout_fb_dirty || !vout_can_dupe) ? vout_buf : NULL,
906 vout_width, vout_height, vout_width * 2);
910 static bool try_use_bios(const char *path)
916 f = fopen(path, "rb");
920 fseek(f, 0, SEEK_END);
924 if (size != 512 * 1024)
927 name = strrchr(path, SLASH);
930 snprintf(Config.Bios, sizeof(Config.Bios), "%s", name);
935 #include <sys/types.h>
938 static bool find_any_bios(const char *dirpath, char *path, size_t path_size)
944 dir = opendir(dirpath);
948 while ((ent = readdir(dir))) {
949 if (strncasecmp(ent->d_name, "scph", 4) != 0)
952 snprintf(path, path_size, "%s/%s", dirpath, ent->d_name);
953 ret = try_use_bios(path);
961 #define find_any_bios(...) false
964 void retro_init(void)
966 const char *bios[] = { "scph1001", "scph5501", "scph7001" };
970 bool found_bios = false;
972 ret = emu_core_preinit();
973 ret |= emu_core_init();
975 SysPrintf("PCSX init failed.\n");
979 vout_buf = malloc(VOUT_MAX_WIDTH * VOUT_MAX_HEIGHT * 2);
981 if (environ_cb(RETRO_ENVIRONMENT_GET_SYSTEM_DIRECTORY, &dir) && dir)
983 snprintf(Config.BiosDir, sizeof(Config.BiosDir), "%s/", dir);
985 for (i = 0; i < sizeof(bios) / sizeof(bios[0]); i++) {
986 snprintf(path, sizeof(path), "%s/%s.bin", dir, bios[i]);
987 found_bios = try_use_bios(path);
993 found_bios = find_any_bios(dir, path, sizeof(path));
996 SysPrintf("found BIOS file: %s\n", Config.Bios);
1000 SysPrintf("no BIOS files found.\n");
1001 struct retro_message msg =
1003 "no BIOS found, expect bugs!",
1006 environ_cb(RETRO_ENVIRONMENT_SET_MESSAGE, (void*)&msg);
1010 environ_cb(RETRO_ENVIRONMENT_SET_PERFORMANCE_LEVEL, &level);
1012 environ_cb(RETRO_ENVIRONMENT_GET_CAN_DUPE, &vout_can_dupe);
1013 environ_cb(RETRO_ENVIRONMENT_SET_DISK_CONTROL_INTERFACE, &disk_control);
1015 /* Set how much slower PSX CPU runs * 100 (so that 200 is 2 times)
1016 * we have to do this because cache misses and some IO penalties
1017 * are not emulated. Warning: changing this may break compatibility. */
1018 #ifdef __ARM_ARCH_7A__
1019 cycle_multiplier = 175;
1021 cycle_multiplier = 200;
1026 init_memcard(Mcd1Data);
1028 SaveFuncs.open = save_open;
1029 SaveFuncs.read = save_read;
1030 SaveFuncs.write = save_write;
1031 SaveFuncs.seek = save_seek;
1032 SaveFuncs.close = save_close;
1034 update_variables(false);
1037 void retro_deinit(void)