summaryrefslogtreecommitdiff
path: root/src/memmap.c
diff options
context:
space:
mode:
authortwinaphex2016-08-05 21:02:26 +0200
committertwinaphex2016-08-05 21:02:26 +0200
commitaa13ea42720d21e6312ac4dafa6c51a959225f4c (patch)
tree5946aa99fa1cecb542de1a7ee6c59792698d6649 /src/memmap.c
parent2bf3516c5a61e64ccf267501624bcb30637374ec (diff)
downloadsnes9x2002-aa13ea42720d21e6312ac4dafa6c51a959225f4c.tar.gz
snes9x2002-aa13ea42720d21e6312ac4dafa6c51a959225f4c.tar.bz2
snes9x2002-aa13ea42720d21e6312ac4dafa6c51a959225f4c.zip
Cleanups
Diffstat (limited to 'src/memmap.c')
-rw-r--r--src/memmap.c69
1 files changed, 23 insertions, 46 deletions
diff --git a/src/memmap.c b/src/memmap.c
index 066b7aa..ee58cef 100644
--- a/src/memmap.c
+++ b/src/memmap.c
@@ -63,9 +63,6 @@ static uint8 bytes0x2000 [0x2000];
extern bool8 ROMAPUEnabled;
-extern char *rom_filename;
-extern bool8 LoadZip(const char* , int32 *, int32 *);
-
bool8_32 AllASCII (uint8 *b, int size)
{
int i;
@@ -289,21 +286,6 @@ void FreeSDD1Data ()
}
/**********************************************************************************************/
-/* checkext() */
-/**********************************************************************************************/
-int checkzip( char * fn )
-{
- int cnt = strlen(fn);
- if( ( (fn[cnt-1] == 'p') || (fn[cnt-1] == 'P') ) &&
- ( (fn[cnt-2] == 'i') || (fn[cnt-2] == 'I') ) &&
- ( (fn[cnt-3] == 'z') || (fn[cnt-3] == 'Z') ) ){
- return true;
-
- }
- return false;
-}
-
-/**********************************************************************************************/
/* LoadROM() */
/* This function loads a Snes-Backup image */
/**********************************************************************************************/
@@ -625,7 +607,6 @@ again:
FreeSDD1Data ();
InitROM (Tales);
- S9xLoadCheatFile (S9xGetFilename(".cht"));
S9xInitCheatData ();
S9xApplyCheats ();
@@ -994,33 +975,29 @@ bool8_32 LoadSRAM (const char *filename)
bool8_32 SaveSRAM (const char *filename)
{
- int size = Memory.SRAMSize ?
- (1 << (Memory.SRAMSize + 3)) * 128 : 0;
- if (Settings.SRTC)
- {
- size += SRTC_SRAM_PAD;
- S9xSRTCPreSaveState ();
- }
-
-
- if (size > 0x20000)
- size = 0x20000;
-
- if (size && *Memory.ROMFilename)
- {
- FILE *file;
- if ((file = fopen (filename, "wb")))
- {
- fwrite ((char *) SRAM, size, 1, file);
- fclose (file);
- //sync();
-#if defined(__linux)
- //chown (filename, getuid (), getgid ());
-#endif
- return (TRUE);
- }
- }
- return (FALSE);
+ int size = Memory.SRAMSize ?
+ (1 << (Memory.SRAMSize + 3)) * 128 : 0;
+ if (Settings.SRTC)
+ {
+ size += SRTC_SRAM_PAD;
+ S9xSRTCPreSaveState ();
+ }
+
+
+ if (size > 0x20000)
+ size = 0x20000;
+
+ if (size && *Memory.ROMFilename)
+ {
+ FILE *file;
+ if ((file = fopen (filename, "wb")))
+ {
+ fwrite ((char *) SRAM, size, 1, file);
+ fclose (file);
+ return (TRUE);
+ }
+ }
+ return (FALSE);
}
void FixROMSpeed ()