aboutsummaryrefslogtreecommitdiff
path: root/src/GBACart.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/GBACart.cpp')
-rw-r--r--src/GBACart.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/GBACart.cpp b/src/GBACart.cpp
index 3f42326..86effc9 100644
--- a/src/GBACart.cpp
+++ b/src/GBACart.cpp
@@ -100,6 +100,15 @@ void CartCommon::SRAMWrite(u32 addr, u8 val)
{
}
+u8* CartCommon::GetSaveMemory() const
+{
+ return nullptr;
+}
+
+u32 CartCommon::GetSaveMemoryLength() const
+{
+ return 0;
+}
CartGame::CartGame(u8* rom, u32 len) : CartCommon()
{
@@ -334,6 +343,16 @@ void CartGame::SRAMWrite(u32 addr, u8 val)
}
}
+u8* CartGame::GetSaveMemory() const
+{
+ return SRAM;
+}
+
+u32 CartGame::GetSaveMemoryLength() const
+{
+ return SRAMLength;
+}
+
void CartGame::ProcessGPIO()
{
}
@@ -878,4 +897,14 @@ void SRAMWrite(u32 addr, u8 val)
if (Cart) Cart->SRAMWrite(addr, val);
}
+u8* GetSaveMemory()
+{
+ return Cart ? Cart->GetSaveMemory() : nullptr;
+}
+
+u32 GetSaveMemoryLength()
+{
+ return Cart ? Cart->GetSaveMemoryLength() : 0;
+}
+
}