mirror of
https://github.com/dborth/snes9xgx.git
synced 2024-11-01 00:15:14 +01:00
fix snapshot loading problem, update readme
This commit is contained in:
parent
14ba3c3abf
commit
c69b4fc58f
18
README.txt
18
README.txt
@ -10,10 +10,14 @@
|
||||
———————————————————————————————————————————————————————————————————————•ßrK•
|
||||
|
||||
×—–—–—–—– –—–—–—–—–—–—–—–—–—–— —–—–—–—–—–—–—–—-—–-–•¬
|
||||
|0O×øo· SNES9XGX v005 ·oø×O0|
|
||||
|0O×øo· SNES9X GX ·oø×O0|
|
||||
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
|
||||
|
||||
PLEASE NOTE: THIS DOCUMENT IS A WORK IN PROGRESS
|
||||
SNES9x GX is a Super Nintendo emulator for the Wii based on the PC emulator
|
||||
SNES9x 1.50 (http://snes9x.ipherswipsite.com/). SoftDev is responsible for
|
||||
the original SNES9x 1.50 GameCube port, whose work was continued by crunchy2.
|
||||
It was updated for the Wii by michniewski and is currently being maintained
|
||||
by michniewski and Tantric.
|
||||
|
||||
[What's New 005]
|
||||
|
||||
@ -189,7 +193,8 @@ on these topics is the tehskeen forums: http://www.tehskeen.com/forums/
|
||||
×—–—–—–—– –—–—–—–—–—–—–—–—–—–— —–—–—–—–—–—–—–—-—–-–•¬
|
||||
|0O×øo· ABOUT SNES9X ·oø×O0|
|
||||
`¨•¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨¨ ¨¨¨¨¨¨¨¨¨¨¨¨¨'
|
||||
Welcome to the revolution in GameCube emulators! SNES9X is by far the most
|
||||
|
||||
Welcome to the revolution in Wii/GameCube emulators! SNES9X is by far the most
|
||||
complete and accurate Super Nintendo Entertainment System emulator to date.
|
||||
Taking full power of the ATi-GX chipset and packed full of features that are
|
||||
to die for after playing your games you'll never want to come back to
|
||||
@ -197,10 +202,9 @@ reality.
|
||||
|
||||
SNES9X is a very popular open source emulator mainly for the PC platform, but
|
||||
has seen many ports to other consoles such as the Nintendo DS, Microsoft XBOX
|
||||
and now thanks to SoftDev the Nintendo GameCube! This is a straight port and
|
||||
is not based on any previous SNES emulators that have existed for the
|
||||
GameCube. You can get more information on SNES9X here from the URL below:
|
||||
http://snes9x.ipherswipsite.com/
|
||||
,
|
||||
and, thanks to SoftDev, the Nintendo GameCube. SoftDev's 1.50 port is not based
|
||||
on any previous SNES emulators that have existed for the GameCube.
|
||||
|
||||
×—–—–—–—– –—–—–—–—–—–—–—–—–—–— —–—–—–—–—–—–—–—-—–-–•¬
|
||||
|0O×øo· DEFAULT CONTROLLER MAPPING ·oø×O0|
|
||||
|
@ -40,15 +40,12 @@
|
||||
#include "fileop.h"
|
||||
#include "memcardop.h"
|
||||
|
||||
#define MEMBUFFER (512 * 1024)
|
||||
|
||||
extern void S9xSRTCPreSaveState ();
|
||||
extern void NGCFreezeStruct ();
|
||||
extern bool8 S9xUnfreezeGame (const char *filename);
|
||||
extern unsigned char savebuffer[];
|
||||
|
||||
static int bufoffset;
|
||||
static char membuffer[MEMBUFFER];
|
||||
|
||||
char freezecomment[2][32];
|
||||
|
||||
@ -61,7 +58,7 @@ char freezecomment[2][32];
|
||||
int
|
||||
GetMem (char *buffer, int len)
|
||||
{
|
||||
memcpy (buffer, membuffer + bufoffset, len);
|
||||
memcpy (buffer, savebuffer + bufoffset, len);
|
||||
bufoffset += len;
|
||||
|
||||
return len;
|
||||
@ -75,7 +72,7 @@ GetMem (char *buffer, int len)
|
||||
static void
|
||||
PutMem (char *buffer, int len)
|
||||
{
|
||||
memcpy (membuffer + bufoffset, buffer, len);
|
||||
memcpy (savebuffer + bufoffset, buffer, len);
|
||||
bufoffset += len;
|
||||
}
|
||||
|
||||
@ -112,7 +109,7 @@ NGCFreezeMemBuffer ()
|
||||
|
||||
sprintf (buffer, "%s:%04d\n", SNAPSHOT_MAGIC, SNAPSHOT_VERSION);
|
||||
PutMem (buffer, strlen (buffer));
|
||||
sprintf (buffer, "NAM:%06d:%s%c", (int) strlen (Memory.ROMFilename) + 1,
|
||||
sprintf (buffer, "NAM:%06d:%s%c", (int) strlen (Memory.ROMFilename) + 1,
|
||||
Memory.ROMFilename, 0);
|
||||
|
||||
PutMem (buffer, strlen (buffer) + 1);
|
||||
@ -143,10 +140,8 @@ NGCFreezeGame (int method, bool8 silent)
|
||||
S9xSetSoundMute (TRUE);
|
||||
S9xPrepareSoundForSnapshotSave (FALSE);
|
||||
|
||||
NGCFreezeMemBuffer (); // copy freeze mem into membuffer
|
||||
|
||||
ClearSaveBuffer ();
|
||||
memcpy (savebuffer, membuffer, bufoffset);
|
||||
NGCFreezeMemBuffer (); // copy freeze mem into savebuffer
|
||||
|
||||
S9xPrepareSoundForSnapshotSave (TRUE);
|
||||
S9xSetSoundMute (FALSE);
|
||||
@ -168,8 +163,6 @@ NGCFreezeGame (int method, bool8 silent)
|
||||
{
|
||||
sprintf (filename, "%s.snz", Memory.ROMName);
|
||||
|
||||
ClearSaveBuffer ();
|
||||
|
||||
/*** Copy in save icon ***/
|
||||
int woffset = sizeof (saveicon);
|
||||
memcpy (savebuffer, saveicon, woffset);
|
||||
@ -182,7 +175,7 @@ NGCFreezeGame (int method, bool8 silent)
|
||||
|
||||
/*** Zip and copy in the freeze ***/
|
||||
uLongf DestBuffSize = (uLongf) SAVEBUFFERSIZE;
|
||||
int err= compress2((Bytef*)(savebuffer+woffset+8), (uLongf*)&DestBuffSize, (const Bytef*)membuffer, (uLongf)bufoffset, Z_BEST_COMPRESSION);
|
||||
int err= compress2((Bytef*)(savebuffer+woffset+8), (uLongf*)&DestBuffSize, (const Bytef*)savebuffer, (uLongf)bufoffset, Z_BEST_COMPRESSION);
|
||||
|
||||
if(err!=Z_OK)
|
||||
{
|
||||
@ -295,7 +288,7 @@ NGCUnfreezeGame (int method, bool8 silent)
|
||||
|
||||
if (ret)
|
||||
{
|
||||
char zipbuffer[MEMBUFFER];
|
||||
char zipbuffer[SAVEBUFFERSIZE];
|
||||
|
||||
// skip the saveicon and comment
|
||||
offset = (sizeof(saveicon) + 64);
|
||||
@ -308,9 +301,7 @@ NGCUnfreezeGame (int method, bool8 silent)
|
||||
memcpy (&decompressedsize, savebuffer+offset, 4);
|
||||
offset += 4;
|
||||
|
||||
memset(membuffer, 0, MEMBUFFER);
|
||||
|
||||
uLongf DestBuffSize = MEMBUFFER;
|
||||
uLongf DestBuffSize = SAVEBUFFERSIZE;
|
||||
int err= uncompress((Bytef*)zipbuffer, (uLongf*)&DestBuffSize, (const Bytef*)(savebuffer + offset), zipsize);
|
||||
|
||||
if ( err!=Z_OK )
|
||||
@ -326,17 +317,14 @@ NGCUnfreezeGame (int method, bool8 silent)
|
||||
}
|
||||
else
|
||||
{
|
||||
offset = MEMBUFFER;
|
||||
memcpy (savebuffer, zipbuffer, MEMBUFFER);
|
||||
offset = SAVEBUFFERSIZE;
|
||||
memcpy (savebuffer, zipbuffer, SAVEBUFFERSIZE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(offset > 0)
|
||||
{
|
||||
memcpy (membuffer, savebuffer, offset);
|
||||
ClearSaveBuffer ();
|
||||
|
||||
if (S9xUnfreezeGame ("AGAME") == SUCCESS)
|
||||
return 1;
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user