Reset Movie when resetting emulator

This commit is contained in:
SimoneN64
2024-08-19 23:01:15 +02:00
parent cc8e10745f
commit bd9bcf0bf7
3 changed files with 8 additions and 0 deletions

View File

@@ -10,6 +10,7 @@
namespace n64 { namespace n64 {
void PIF::Reset() { void PIF::Reset() {
movie.Reset();
joybusDevices = {}; joybusDevices = {};
bootrom = {}; bootrom = {};
ram = {}; ram = {};

View File

@@ -71,6 +71,12 @@ MupenMovie::MupenMovie(const fs::path &path) {
} }
} }
void MupenMovie::Reset() {
if(!IsLoaded()) return;
loadedTasMovieIndex = sizeof(TASMovieHeader) - 4; // skip header
}
FORCE_INLINE void LogController(const n64::Controller& controller) { FORCE_INLINE void LogController(const n64::Controller& controller) {
Util::debug("c_right: {}", controller.cRight); Util::debug("c_right: {}", controller.cRight);
Util::debug("c_left: {}", controller.cLeft); Util::debug("c_left: {}", controller.cLeft);

View File

@@ -49,6 +49,7 @@ struct MupenMovie {
MupenMovie() = default; MupenMovie() = default;
MupenMovie(const fs::path&); MupenMovie(const fs::path&);
bool Load(const fs::path&); bool Load(const fs::path&);
void Reset();
n64::Controller NextInputs(); n64::Controller NextInputs();
bool IsLoaded() const { return !loadedTasMovie.empty(); } bool IsLoaded() const { return !loadedTasMovie.empty(); }
private: private: