aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/NDS.cpp2
-rw-r--r--src/Wifi.cpp34
-rw-r--r--src/Wifi.h3
3 files changed, 38 insertions, 1 deletions
diff --git a/src/NDS.cpp b/src/NDS.cpp
index 0280c39..6a83bcf 100644
--- a/src/NDS.cpp
+++ b/src/NDS.cpp
@@ -527,7 +527,7 @@ bool DoSavestate(Savestate* file)
SPU::DoSavestate(file);
SPI::DoSavestate(file);
RTC::DoSavestate(file);
- // wifi
+ Wifi::DoSavestate(file);
if (!file->Saving)
{
diff --git a/src/Wifi.cpp b/src/Wifi.cpp
index 71e8ba3..0e73422 100644
--- a/src/Wifi.cpp
+++ b/src/Wifi.cpp
@@ -213,6 +213,40 @@ void Reset()
WifiAP::Reset();
}
+void DoSavestate(Savestate* file)
+{
+ file->Section("WIFI");
+
+ // berp.
+ // not sure we're saving enough shit at all there.
+ // also: savestate and wifi can't fucking work together!!
+ // or it can but you would be disconnected
+
+ file->VarArray(RAM, 0x2000);
+ file->VarArray(IO, 0x1000);
+
+ file->Var16(&Random);
+
+ file->VarArray(BBRegs, 0x100);
+ file->VarArray(BBRegsRO, 0x100);
+
+ file->Var8(&RFVersion);
+ file->VarArray(RFRegs, 4*0x40);
+
+ file->Var64(&USCounter);
+ file->Var64(&USCompare);
+ file->Var32((u32*)&BlockBeaconIRQ14);
+
+ file->Var32(&ComStatus);
+ file->Var32(&TXCurSlot);
+ file->Var32(&RXCounter);
+
+ file->Var32((u32*)&MPReplyTimer);
+ file->Var32((u32*)&MPNumReplies);
+
+ file->Var32(&CmdCounter);
+}
+
void SetIRQ(u32 irq)
{
diff --git a/src/Wifi.h b/src/Wifi.h
index 81cc3bb..72517a1 100644
--- a/src/Wifi.h
+++ b/src/Wifi.h
@@ -19,6 +19,8 @@
#ifndef WIFI_H
#define WIFI_H
+#include "Savestate.h"
+
namespace Wifi
{
@@ -146,6 +148,7 @@ extern bool MPInited;
bool Init();
void DeInit();
void Reset();
+void DoSavestate(Savestate* file);
void StartTX_Beacon();