Header file for fio (#505)

* just putting this unmatched function here for now

* fio header file.

* Fixed some stuff for the fio header file.

* More fixes for fio header file.

* Final fix for fio header file.

* FINAL final fix.

Co-authored-by: Ponmander <ponderman@DESKTOP-8JAKKAV.localdomain>
Co-authored-by: Alex Bates <hi@imalex.xyz>
This commit is contained in:
Ponmander 2021-10-29 22:03:38 -05:00 committed by GitHub
parent fbc901ac49
commit 3ae962f064
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 61 additions and 11 deletions

View File

@ -1,4 +1,5 @@
#include "common.h"
#include "fio.h"
typedef struct struct802E10F4 {
char unk_0[4];

View File

@ -1,17 +1,7 @@
#include "common.h"
#include "fio.h"
char magicSaveString[] = "Mario Story 006";
extern s32 logicalSaveInfo[4][2]; // 0x8009BA30
extern s32 physicalSaveInfo[6][2]; // 0x8009BA50
extern s32 nextAvailableSavePage; // 0x8009BA80
extern s32 D_800D95E8[];
extern s32 D_8009A6B0[];
void fio_serialize_state(void);
void fio_erase_flash(s32 pageNum);
void fio_write_flash(s32 pageNum, s32* readBuffer, s32 numBytes);
s32 get_spirits_rescued(void) {
s32 storyProgress = evt_get_variable(NULL, EVT_STORY_PROGRESS);
s32 ret = 7;

58
src/fio.h Normal file
View File

@ -0,0 +1,58 @@
#ifndef _FIO_H_
#define _FIO_H_
#include "common.h"
extern char magicSaveString[];
void fio_serialize_state(void);
void fio_erase_flash(s32 pageNum);
void fio_write_flash(s32 pageNum, s32* readBuffer, s32 numBytes);
s32 get_spirits_rescued(void);
s32 fio_calc_header_checksum(void);
s32 fio_validate_header_checksums(void);
s32 fio_has_valid_backup(void);
s32 fio_flush_backups(void);
s32 fio_calc_file_checksum(SaveData* saveData);
s32 fio_validate_file_checksum(SaveData* saveData);
s32 fio_fetch_saved_file_info(void);
s32 fio_load_game(s32 saveSlot);
void fio_save_game(s32 saveSlot);
void fio_erase_game(s32 saveSlot);
//fio_deserialize_state;
void func_8002B608(void);
//fio_init_flash;
//fio_serialize_state;
//fio_read_flash;
//fio_write_flash;
extern s32 logicalSaveInfo[4][2];
extern s32 physicalSaveInfo[6][2];
extern s32 nextAvailableSavePage;
extern s32 D_800D95E8[];
extern s32 D_8009A6B0[];
#endif

View File

@ -1,5 +1,6 @@
#include "common.h"
#include "hud_element.h"
#include "fio.h"
#include "sprite.h"
void state_init_startup(void) {