aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoraliaspider2014-10-30 06:43:08 +0100
committeraliaspider2014-10-30 06:43:08 +0100
commit21ddea4dfae669fed24448b53dca951a406f0de5 (patch)
tree8a5bb36e2edb30b97cf548924a465ef7818b4bfb
parent1fbc985d61038c52af8559bbac8ce801d2a1f0b8 (diff)
downloadsnesemu-21ddea4dfae669fed24448b53dca951a406f0de5.tar.gz
snesemu-21ddea4dfae669fed24448b53dca951a406f0de5.tar.bz2
snesemu-21ddea4dfae669fed24448b53dca951a406f0de5.zip
remove snapshot.c snaporig.c dependencies.
-rw-r--r--Makefile2
-rw-r--r--libretro.c79
-rw-r--r--source/apu.c21
-rw-r--r--source/apu.h5
-rw-r--r--source/cpuexec.c1
5 files changed, 54 insertions, 54 deletions
diff --git a/Makefile b/Makefile
index 31f8c7d..e63d489 100644
--- a/Makefile
+++ b/Makefile
@@ -153,8 +153,6 @@ CATSFC_SOURCES := source/apu.c source/c4.c \
source/seta011.c \
source/seta018.c \
source/seta.c \
- source/snaporig.c \
- source/snapshot.c \
source/soundux.c \
source/spc700.c source/spc7110.c \
source/srtc.c \
diff --git a/libretro.c b/libretro.c
index 03ea19f..3d6680e 100644
--- a/libretro.c
+++ b/libretro.c
@@ -6,11 +6,11 @@
#include "memmap.h"
#include "apu.h"
#include "cheats.h"
-#include "snapshot.h"
#include "display.h"
#include "gfx.h"
#include "cpuexec.h"
#include "spc7110.h"
+#include "srtc.h"
#include <libretro.h>
@@ -322,31 +322,6 @@ void S9xAutoSaveSRAM()
SaveSRAM(S9xGetFilename(".srm"));
}
-int game_load_state(char* file)
-{
- int flag;
-
- flag = 0;
- if (S9xUnfreezeGame(file) == FALSE)
- flag = -1;
-
- return flag;
-}
-
-int game_save_state(char* file)
-{
- int flag;
-
- flag = 0;
- if (S9xFreezeGame(file) == FALSE)
- flag = -1;
-
- S9xAutoSaveSRAM();
-
- return flag;
-}
-
-
void retro_init(void)
{
struct retro_log_callback log;
@@ -578,7 +553,57 @@ size_t retro_serialize_size(void)
bool retro_serialize(void* data, size_t size)
{
- return false;
+// S9xUpdateRTC();
+// S9xSRTCPreSaveState();
+
+// for (i = 0; i < 8; i++)
+// {
+// SoundData.channels [i].previous16 [0] = (int16)
+// SoundData.channels [i].previous [0];
+// SoundData.channels [i].previous16 [1] = (int16)
+// SoundData.channels [i].previous [1];
+// }
+// sprintf(buffer, "%s:%04d\n", SNAPSHOT_MAGIC, SNAPSHOT_VERSION);
+// WRITE_STREAM(buffer, strlen(buffer), stream);
+// sprintf(buffer, "NAM:%06d:%s%c", strlen(Memory.ROMFilename) + 1,
+// Memory.ROMFilename, 0);
+// WRITE_STREAM(buffer, strlen(buffer) + 1, stream);
+// FreezeStruct(stream, "CPU", &CPU, SnapCPU, COUNT(SnapCPU));
+// FreezeStruct(stream, "REG", &ICPU.Registers, SnapRegisters,
+// COUNT(SnapRegisters));
+// FreezeStruct(stream, "PPU", &PPU, SnapPPU, COUNT(SnapPPU));
+// FreezeStruct(stream, "DMA", DMA, SnapDMA, COUNT(SnapDMA));
+
+// // RAM and VRAM
+// FreezeBlock(stream, "VRA", Memory.VRAM, 0x10000);
+// FreezeBlock(stream, "RAM", Memory.RAM, 0x20000);
+// FreezeBlock(stream, "SRA", Memory.SRAM, 0x20000);
+// FreezeBlock(stream, "FIL", Memory.FillRAM, 0x8000);
+// if (Settings.APUEnabled)
+// {
+// // APU
+// FreezeStruct(stream, "APU", &APU, SnapAPU, COUNT(SnapAPU));
+// FreezeStruct(stream, "ARE", &IAPU.Registers, SnapAPURegisters,
+// COUNT(SnapAPURegisters));
+// FreezeBlock(stream, "ARA", IAPU.RAM, 0x10000);
+// FreezeStruct(stream, "SOU", &SoundData, SnapSoundData,
+// COUNT(SnapSoundData));
+// }
+// if (Settings.SA1)
+// {
+// SA1.Registers.PC = SA1.PC - SA1.PCBase;
+// S9xSA1PackStatus();
+// FreezeStruct(stream, "SA1", &SA1, SnapSA1, COUNT(SnapSA1));
+// FreezeStruct(stream, "SAR", &SA1.Registers, SnapSA1Registers,
+// COUNT(SnapSA1Registers));
+// }
+
+// if (Settings.SPC7110)
+// FreezeStruct(stream, "SP7", &s7r, SnapSPC7110, COUNT(SnapSPC7110));
+// if (Settings.SPC7110RTC)
+// FreezeStruct(stream, "RTC", &rtc_f9, SnapS7RTC, COUNT(SnapS7RTC));
+
+ return true;
}
bool retro_unserialize(const void* data, size_t size)
{
diff --git a/source/apu.c b/source/apu.c
index c816174..56749ce 100644
--- a/source/apu.c
+++ b/source/apu.c
@@ -98,13 +98,6 @@
#include "soundux.h"
#include "cpuexec.h"
-/* For note-triggered SPC dump support */
-#include "snapshot.h"
-
-int spc_is_dumping = 0;
-int spc_is_dumping_temp;
-uint8 spc_dump_dsp[0x100];
-
extern int NoiseFreq [32];
bool8 S9xInitAPU()
@@ -140,7 +133,6 @@ void S9xResetAPU()
Settings.APUEnabled = Settings.NextAPUEnabled;
- ZeroMemory(spc_dump_dsp, 0x100);
ZeroMemory(IAPU.RAM, 0x100);
memset(IAPU.RAM + 0x20, 0xFF, 0x20);
memset(IAPU.RAM + 0x60, 0xFF, 0x20);
@@ -207,8 +199,6 @@ void S9xSetAPUDSP(uint8 byte)
static uint8 KeyOnPrev;
int i;
- spc_dump_dsp[reg] = byte;
-
switch (reg)
{
case APU_FLG:
@@ -320,16 +310,6 @@ void S9xSetAPUDSP(uint8 byte)
APU.DSP [APU_KOFF] = byte;
return;
case APU_KON:
- if (spc_is_dumping)
- {
- if (byte & ~spc_is_dumping_temp)
- {
- IAPU.Registers.PC = IAPU.PC - IAPU.RAM;
- S9xAPUPackStatus();
- S9xSPCDump(".spc");
- spc_is_dumping = 0;
- }
- }
if (byte)
{
int c;
@@ -353,7 +333,6 @@ void S9xSetAPUDSP(uint8 byte)
}
}
}
- spc_is_dumping_temp = byte;
return;
case APU_VOL_LEFT + 0x00:
diff --git a/source/apu.h b/source/apu.h
index 0311c7f..b49d8fe 100644
--- a/source/apu.h
+++ b/source/apu.h
@@ -90,6 +90,7 @@
#ifndef _apu_h_
#define _apu_h_
+#include "port.h"
#include "spc700.h"
typedef struct
@@ -130,9 +131,7 @@ typedef struct
SAPU APU;
SIAPU IAPU;
-extern int spc_is_dumping;
-extern int spc_is_dumping_temp;
-extern uint8 spc_dump_dsp[0x100];
+
STATIC inline void S9xAPUUnpackStatus()
{
IAPU._Zero = ((IAPU.Registers.P & Zero) == 0) | (IAPU.Registers.P & Negative);
diff --git a/source/cpuexec.c b/source/cpuexec.c
index e015863..ccd38ff 100644
--- a/source/cpuexec.c
+++ b/source/cpuexec.c
@@ -95,7 +95,6 @@
#include "cpuops.h"
#include "ppu.h"
#include "cpuexec.h"
-#include "snapshot.h"
#include "gfx.h"
#include "missing.h"
#include "apu.h"