}\r
\r
if (preserve_state) {\r
- state = malloc(0x200);\r
+ state = malloc(0x204);\r
if (state == NULL) return;\r
- memcpy(state, YM2612GetRegs(), 0x200);\r
+ ym2612_pack_state();\r
+ memcpy(state, YM2612GetRegs(), 0x204);\r
}\r
YM2612Init(Pico.m.pal ? OSC_PAL/7 : OSC_NTSC/7, PsndRate);\r
if (preserve_state) {\r
// feed it back it's own registers, just like after loading state\r
- memcpy(YM2612GetRegs(), state, 0x200);\r
+ memcpy(YM2612GetRegs(), state, 0x204);\r
ym2612_unpack_state();\r
if ((PicoAHW & PAHW_MCD) && !(Pico_mcd->s68k_regs[0x36] & 1) && (Pico_mcd->scd.Status_CDC & 1))\r
cdda_start_play();\r
// read global config, and apply game_def.cfg on top\r
make_config_cfg(cfg);\r
config_readsect(cfg, NULL);\r
- ret = config_readsect("game_def.cfg", sect);\r
+ emu_make_path(cfg, "game_def.cfg", sizeof(cfg));\r
+ ret = config_readsect(cfg, sect);\r
}\r
\r
if (ret == 0)\r
perror("in_evdev: F_GETFL fcntl failed");
return;
}
+
+ if (flags & O_NONBLOCK) {
+ /* flush the event queue */
+ struct input_event ev;
+ do {
+ ret = read(dev->fd, &ev, sizeof(ev));
+ }
+ while (ret == sizeof(ev));
+ }
+
if (y)
flags &= ~O_NONBLOCK;
else