Work around very brittle snapshot code
This commit is contained in:
@@ -54,7 +54,7 @@ void apu_reset(Apu* apu) {
|
||||
}
|
||||
|
||||
void apu_saveload(Apu *apu, SaveLoadFunc *func, void *ctx) {
|
||||
func(ctx, apu->ram, offsetof(Apu, hist) - offsetof(Apu, ram));
|
||||
func(ctx, apu->ram, offsetof(Apu, pad) + 6 - offsetof(Apu, ram));
|
||||
dsp_saveload(apu->dsp, func, ctx);
|
||||
spc_saveload(apu->spc, func, ctx);
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ struct Apu {
|
||||
uint8_t outPorts[4];
|
||||
Timer timer[3];
|
||||
uint8_t cpuCyclesLeft;
|
||||
uint8_t pad[6];
|
||||
|
||||
|
||||
union {
|
||||
struct DspRegWriteHistory hist;
|
||||
|
||||
@@ -65,7 +65,7 @@ void dma_reset(Dma* dma) {
|
||||
}
|
||||
|
||||
void dma_saveload(Dma *dma, SaveLoadFunc *func, void *ctx) {
|
||||
func(ctx, &dma->channel, sizeof(Dma) - offsetof(Dma, channel));
|
||||
func(ctx, &dma->channel, offsetof(Dma, pad) + 7 - offsetof(Dma, channel));
|
||||
}
|
||||
|
||||
uint8_t dma_read(Dma* dma, uint16_t adr) {
|
||||
|
||||
@@ -40,6 +40,7 @@ struct Dma {
|
||||
uint16_t hdmaTimer;
|
||||
uint32_t dmaTimer;
|
||||
bool dmaBusy;
|
||||
uint8_t pad[7];
|
||||
};
|
||||
|
||||
Dma* dma_init(Snes* snes);
|
||||
|
||||
@@ -24,16 +24,19 @@ struct Snes {
|
||||
Ppu* ppu, *snes_ppu, *my_ppu;
|
||||
Dma* dma;
|
||||
Cart* cart;
|
||||
Input *input1;
|
||||
Input *input2;
|
||||
// input
|
||||
bool debug_cycles;
|
||||
bool debug_apu_cycles;
|
||||
bool disableRender;
|
||||
uint8_t runningWhichVersion;
|
||||
Input* input1;
|
||||
Input* input2;
|
||||
|
||||
// ram
|
||||
uint8_t *ram;
|
||||
uint32_t ramAdr;
|
||||
uint8_t *ram;
|
||||
uint8_t padx[4];
|
||||
|
||||
// frame timing
|
||||
uint16_t hPos;
|
||||
uint16_t vPos;
|
||||
@@ -41,6 +44,7 @@ struct Snes {
|
||||
// cpu handling
|
||||
uint8_t cpuCyclesLeft;
|
||||
uint8_t cpuMemOps;
|
||||
uint8_t padpad[2];
|
||||
double apuCatchupCycles;
|
||||
// nmi / irq
|
||||
bool hIrqEnabled;
|
||||
|
||||
Reference in New Issue
Block a user