Skip to content

Commit

Permalink
Fixed load/save state for Coleco.
Browse files Browse the repository at this point in the history
  • Loading branch information
FluBBaOfWard committed Oct 18, 2021
1 parent b0a317a commit 5100228
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ S8DS revision history
-=-=-=-=-=-=-=-=-=-=-=-


V1.1.6 - 2021-10-18 (FluBBa)
Fixed load/save state for Coleco.

V1.1.5 - 2021-10-17 (FluBBa)
Fixed load/save state.

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# S8DS V1.1.5
# S8DS V1.1.6

This is a SEGA 8Bit emulator for the NDS, it support the following systems:

Expand Down
16 changes: 9 additions & 7 deletions source/Cart.s
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,7 @@ ss0:
saveLst:
.long EMU_SRAM,0x8000
.long EMU_RAM,0x2000
.long VDPRAM,0x4000
.long romInfo,12
.long VDP0+vdpState,VDPSTATESIZE
.long BankState,24
lstEnd:

Expand All @@ -1047,6 +1045,14 @@ ls0:
subs r12,r12,#1
bne ls1

ldrb r0,g_machine
cmp r0,#HW_MARK3
cmpne r0,#HW_SMS1
cmpne r0,#HW_SMS2
cmpne r0,#HW_GG
cmpne r0,#HW_MEGADRIVE
bne dontInitMappers

ldrb r0,BankMap4
ldr r1,biosBase
tst r0,#0x40 ;@ ROM?
Expand All @@ -1060,11 +1066,7 @@ ls0:
bl reBankSwitch0_W
bl reBankSwitch1_W
bl reBankSwitch2_W

bl paletteTxAll
ldr vdpptr,=VDP0
bl VDPClearDirtyTiles

dontInitMappers:
mov r0,r5
ldmfd sp!,{r4-r5,z80pc,z80optbl,lr}
bx lr
Expand Down
3 changes: 3 additions & 0 deletions source/Gfx.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
extern "C" {
#endif

#include "SegaVDP/SegaVDP.h"

extern u8 g_flicker;
extern u8 g_twitch;
extern u8 g_gfxMask;
Expand All @@ -13,6 +15,7 @@ extern u8 g_3DEnable;
extern u8 bColor;
extern u8 SPRS;

extern SegaVDP VDP0;
extern u16 EMUPALBUFF[200];

void gfxInit(void);
Expand Down
2 changes: 1 addition & 1 deletion source/Gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "AY38910/Version.h"
#include "SCC/Version.h"

#define EMUVERSION "V1.1.5 2021-10-17"
#define EMUVERSION "V1.1.6 2021-10-18"

extern u8 sordM5Input; // SordM5.s

Expand Down
5 changes: 4 additions & 1 deletion source/MasterSystem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
#include "MasterSystem.h"
#include "Cart.h"
#include "Sound.h"
#include "SN76496/SN76496.h"
#include "Gfx.h"
#include "ARMZ80/ARMZ80.h"


int packState(void *statePtr) {
int size = 0;
size += cartSaveState(statePtr+size);
size += sn76496SaveState(statePtr+size, &SN76496_0);
size += VDPSaveState(statePtr+size, &VDP0);
size += Z80SaveState(statePtr+size, &Z80OpTable);
return size;
}
Expand All @@ -19,13 +20,15 @@ void unpackState(const void *statePtr) {
int size = 0;
size += cartLoadState(statePtr+size);
size += sn76496LoadState(&SN76496_0, statePtr+size);
size += VDPLoadState(&VDP0, statePtr+size);
size += Z80LoadState(&Z80OpTable, statePtr+size);
}

int getStateSize() {
int size = 0;
size += cartGetStateSize();
size += sn76496GetStateSize();
size += VDPGetStateSize();
size += Z80GetStateSize();
return size;
}
2 changes: 1 addition & 1 deletion source/SegaVDP
Submodule SegaVDP updated 5 files
+3 −0 History.txt
+23 −0 SegaVDP.h
+51 −0 SegaVDP.s
+2 −4 SegaVDP_todo.txt
+1 −1 Version.h

0 comments on commit 5100228

Please sign in to comment.