Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed load/save state for Master System.
- Loading branch information
1 parent
49c2f29
commit b0a317a
Showing
11 changed files
with
132 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include <nds.h> | ||
|
||
#include "MasterSystem.h" | ||
#include "Cart.h" | ||
#include "Sound.h" | ||
#include "SN76496/SN76496.h" | ||
#include "ARMZ80/ARMZ80.h" | ||
|
||
|
||
int packState(void *statePtr) { | ||
int size = 0; | ||
size += cartSaveState(statePtr+size); | ||
size += sn76496SaveState(statePtr+size, &SN76496_0); | ||
size += Z80SaveState(statePtr+size, &Z80OpTable); | ||
return size; | ||
} | ||
|
||
void unpackState(const void *statePtr) { | ||
int size = 0; | ||
size += cartLoadState(statePtr+size); | ||
size += sn76496LoadState(&SN76496_0, statePtr+size); | ||
size += Z80LoadState(&Z80OpTable, statePtr+size); | ||
} | ||
|
||
int getStateSize() { | ||
int size = 0; | ||
size += cartGetStateSize(); | ||
size += sn76496GetStateSize(); | ||
size += Z80GetStateSize(); | ||
return size; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#ifndef MASTERSYSTEM_HEADER | ||
#define MASTERSYSTEM_HEADER | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
/// This runs all save state functions for each chip. | ||
int packState(void *statePtr); | ||
|
||
/// This runs all load state functions for each chip. | ||
void unpackState(const void *statePtr); | ||
|
||
/// Gets the total state size in bytes. | ||
int getStateSize(void); | ||
|
||
#ifdef __cplusplus | ||
} // extern "C" | ||
#endif | ||
|
||
#endif // MASTERSYSTEM_HEADER |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters