Skip to content

Commit

Permalink
add save tools
Browse files Browse the repository at this point in the history
  • Loading branch information
tpunix committed Jan 18, 2024
1 parent 756c19e commit 3fb1d9a
Show file tree
Hide file tree
Showing 8 changed files with 1,467 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Firm_Saturn/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

/obj/*
/ramimage.bin
/ramimage.elf
/ssfirm.bin
/ssfirm.elf
/dump.txt

3 changes: 3 additions & 0 deletions tools/savetool/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

/*.exe

7 changes: 7 additions & 0 deletions tools/savetool/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


all:
gcc -Wall -g -o sst main.c sr_bup.c ss_bup.c sr_mems.c

clean:
rm -f *.exe
65 changes: 65 additions & 0 deletions tools/savetool/bup.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@

#ifndef _BUP_H_
#define _BUP_H_

/*****************************************************************************/

typedef unsigned char u8;
typedef unsigned short u16;
typedef unsigned int u32;
typedef unsigned long long u64;


typedef struct {
char file_name[12];
char comment[11];
char language;
u32 date;
u32 data_size;
u8 *dbuf;
}SAVEINFO;

extern u8 save_buf[0x100000];

/*****************************************************************************/



u8 *load_file(char *name, int *size);
int write_file(char *file, void *buf, int size);

u32 get_be32(void *p);
u32 get_be16(void *p);
void put_be32(void *p, u32 v);
void put_be16(void *p, u32 v);

void set_bitmap(u8 *bmp, int index, int val);
SAVEINFO *load_saveraw(char *save_name);
void bup_flush(void);

int sr_bup_init(u8 *buf);
int sr_bup_list(int slot_id);
int sr_bup_export(int slot_id, int save_id);
int sr_bup_import(int slot_id, int save_id, char *save_name);
int sr_bup_delete(int slot_id, int save_id);
int sr_bup_create(char *game_id);

int ss_bup_init(u8 *buf);
int ss_bup_list(int slot_id);
int ss_bup_export(int slot_id, int save_id);
int ss_bup_import(int slot_id, int save_id, char *save_name);
int ss_bup_delete(int slot_id, int save_id);
int ss_bup_create(char *game_id);

int sr_mems_init(u8 *buf);
int sr_mems_list(int slot_id);
int sr_mems_export(int slot_id, int save_id);
int sr_mems_import(int slot_id, int save_id, char *save_name);
int sr_mems_delete(int slot_id, int save_id);
int sr_mems_create(char *game_id);


/*****************************************************************************/

#endif

Loading

0 comments on commit 3fb1d9a

Please sign in to comment.