mirror of
https://github.com/ekeeke/Genesis-Plus-GX.git
synced 2024-12-28 12:11:50 +01:00
filestream
This commit is contained in:
parent
d1076a911e
commit
7d6e45733a
@ -190,7 +190,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "shared.h"
|
#include "shared.h"
|
||||||
|
#include "streams/file_stream.h"
|
||||||
|
|
||||||
#define u32 unsigned int
|
#define u32 unsigned int
|
||||||
|
|
||||||
@ -1016,13 +1016,13 @@ static void debug_dump_mem(void)
|
|||||||
|
|
||||||
static void debug_dump2file(const char *fname, void *mem, int len)
|
static void debug_dump2file(const char *fname, void *mem, int len)
|
||||||
{
|
{
|
||||||
FILE *f = fopen(fname, "wb");
|
RFILE *f = filestream_open(fname, RFILE_MODE_WRITE, -1);
|
||||||
unsigned short *p = mem;
|
unsigned short *p = mem;
|
||||||
int i;
|
int i;
|
||||||
if (f) {
|
if (f) {
|
||||||
for (i = 0; i < len/2; i++) p[i] = (p[i]<<8) | (p[i]>>8);
|
for (i = 0; i < len/2; i++) p[i] = (p[i]<<8) | (p[i]>>8);
|
||||||
fwrite(mem, 1, len, f);
|
filestream_write(f, mem, len);
|
||||||
fclose(f);
|
filestream_close(f);
|
||||||
for (i = 0; i < len/2; i++) p[i] = (p[i]<<8) | (p[i]>>8);
|
for (i = 0; i < len/2; i++) p[i] = (p[i]<<8) | (p[i]>>8);
|
||||||
printf("dumped to %s\n", fname);
|
printf("dumped to %s\n", fname);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user