Skip to content

Commit

Permalink
aleck64: add serialization
Browse files Browse the repository at this point in the history
Note: although dip switch settings are restored, the UI currently does not refresh to reflect this.
  • Loading branch information
LukeUsher committed Jan 28, 2025
1 parent 82a805c commit 11f73fa
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions ares/n64/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ares_add_sources(
aleck64/aleck64.hpp
aleck64/controls.cpp
aleck64/debugger.cpp
aleck64/serialization.cpp
aleck64/io.cpp
aleck64/vdp.cpp
aleck64/game-config/11beat.hpp
Expand Down
1 change: 1 addition & 0 deletions ares/n64/aleck64/aleck64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ namespace ares::Nintendo64 {
#include "controls.cpp"
#include "debugger.cpp"
#include "vdp.cpp"
#include "serialization.cpp"

#include "game-config/11beat.hpp"
#include "game-config/starsldr.hpp"
Expand Down
4 changes: 3 additions & 1 deletion ares/n64/aleck64/aleck64.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,9 @@ struct Aleck64 {
auto writePort3(n32 data) -> void;
auto writePort4(n32 data) -> void;

//serialization.cpp
auto serialize(serializer&) -> void;

struct Controls {
Aleck64& self;
Node::Object node;
Expand Down Expand Up @@ -223,7 +226,6 @@ struct Aleck64 {

n8 dipSwitch[2];


struct GameConfig {
virtual ~GameConfig() = default;
virtual auto type() -> BoardType { return BoardType::E92; }
Expand Down
9 changes: 9 additions & 0 deletions ares/n64/aleck64/serialization.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
auto Aleck64::serialize(serializer& s) -> void {
s(sdram);
s(vram);
s(pram);

s(vdp.io.enable);
s(dipSwitch[0]);
s(dipSwitch[1]);
}
3 changes: 2 additions & 1 deletion ares/n64/system/serialization.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
static const string SerializerVersion = "v141.1";
static const string SerializerVersion = "v141.2";

auto System::serialize(bool synchronize) -> serializer {
serializer s;
Expand Down Expand Up @@ -56,4 +56,5 @@ auto System::serialize(serializer& s, bool synchronize) -> void {
s(rdp);
s(rsp);
s(dd);
s(aleck64);
}

0 comments on commit 11f73fa

Please sign in to comment.