/// <summary> /// If the given movie contains a savestate it will be loaded if /// the given core has savestates, and a framebuffer populated /// if it is contained in the state and the given core supports it /// </summary> public static void ProcessSavestate(this IMovie movie, IEmulator emulator) { if (emulator.HasSavestates() && movie.StartsFromSavestate) { if (movie.TextSavestate != null) { emulator.AsStatable().LoadStateText(movie.TextSavestate); } else { emulator.AsStatable().LoadStateBinary(movie.BinarySavestate); } if (movie.SavestateFramebuffer != null && emulator.HasVideoProvider()) { emulator.AsVideoProvider().PopulateFromBuffer(movie.SavestateFramebuffer); } emulator.ResetCounters(); } }