#include <ctype.h>
#include <stdlib.h>
-#if defined(__unix) || defined(__linux) || defined(__sun) || defined(__DJGPP)
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#endif
-
#include "snapshot.h"
#include "memmap.h"
#include "snes9x.h"
#define dprintf(...) /* disabled */
-extern uint8 *SRAM;
-
#ifdef ZSNES_FX
START_EXTERN_C
void S9xSuperFXPreSaveState ();
static void Freeze ();
static int Unfreeze ();
+
+static void FreezeSnapshot (const char *name);
static void FreezeStruct (const char *name, void *base, FreezeData *fields,
int num_fields);
static void FreezeBlock (const char *name, uint8 *block, int size);
return (SUCCESS);
}
-int FreezeSize (int size, int type)
+static int FreezeSize (int size, int type)
{
switch (type)
{
fields [i].type);
}
-// uint8 *block = new uint8 [len];
- uint8 *block = (uint8*)malloc(len);
+ uint8 *block = new uint8[len];
uint8 *ptr = block;
uint16 word;
uint32 dword;
FreezeBlock (name, block, len);
- free(block);
+ delete block;
}
void FreezeBlock (const char *name, uint8 *block, int size)
fields [i].type);
}
- uint8 *block = (uint8*)malloc(len);
+ uint8 *block = new uint8 [len];
uint8 *ptr = block;
uint16 word;
uint32 dword;
}
}
-// delete block;
- free(block);
+ delete block;
+
return (result);
}