aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRaphaël Zumer <rzumer@tebako.net>2019-12-08 17:13:56 -0500
committerRaphaël Zumer <rzumer@tebako.net>2019-12-08 17:13:56 -0500
commit48a8a25548a9aa0ed73e4d0cb2d30471326481af (patch)
tree5a4dcffcdbbad0d2e2a0f883b7c3379c0af77be2 /src
parent91bf62a1d45fd8e81c6c77cb7072898f184c3a1c (diff)
Reset GBA cartridge state when loading a new ROM
Diffstat (limited to 'src')
-rw-r--r--src/GBACart.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/GBACart.cpp b/src/GBACart.cpp
index 7c2faad..8ce76ab 100644
--- a/src/GBACart.cpp
+++ b/src/GBACart.cpp
@@ -156,6 +156,11 @@ bool LoadROM(const char* path, const char* sram)
return false;
}
+ if (CartInserted)
+ {
+ Reset();
+ }
+
fseek(f, 0, SEEK_END);
u32 len = (u32)ftell(f);