mirror of
https://github.com/libretro/RetroArch
synced 2025-02-24 00:39:54 +00:00
:D
This commit is contained in:
parent
0c9891bf7e
commit
4d9fcb9e48
9
ssnes.c
9
ssnes.c
@ -1,3 +1,4 @@
|
|||||||
|
#include <stdbool.h>
|
||||||
#include <GL/glfw.h>
|
#include <GL/glfw.h>
|
||||||
#include <samplerate.h>
|
#include <samplerate.h>
|
||||||
#include "libsnes.hpp"
|
#include "libsnes.hpp"
|
||||||
@ -414,8 +415,10 @@ static void write_state(const char* path, uint8_t* data, size_t size)
|
|||||||
FILE *file = fopen(path, "wb");
|
FILE *file = fopen(path, "wb");
|
||||||
if ( file != NULL )
|
if ( file != NULL )
|
||||||
{
|
{
|
||||||
|
fprintf(stderr, "SSNES: Saving state. Size: %d bytes.\n", (int)size);
|
||||||
snes_serialize(data, size);
|
snes_serialize(data, size);
|
||||||
fwrite(data, 1, size, file);
|
if ( fwrite(data, 1, size, file) != size )
|
||||||
|
fprintf(stderr, "SSNES [WARN]: Did not save state properly.");
|
||||||
fclose(file);
|
fclose(file);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -425,7 +428,9 @@ static void load_state(const char* path, uint8_t* data, size_t size)
|
|||||||
FILE *file = fopen(path, "rb");
|
FILE *file = fopen(path, "rb");
|
||||||
if ( file != NULL )
|
if ( file != NULL )
|
||||||
{
|
{
|
||||||
fread(data, 1, size, file);
|
fprintf(stderr, "SSNES: Loading state. Size: %d bytes.\n", (int)size);
|
||||||
|
if ( fread(data, 1, size, file) != size )
|
||||||
|
fprintf(stderr, "SSNES [WARN]: Did not load state properly.");
|
||||||
fclose(file);
|
fclose(file);
|
||||||
snes_unserialize(data, size);
|
snes_unserialize(data, size);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user