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