Save data changes.
This commit is contained in:
@@ -1,23 +1,18 @@
|
|||||||
#ifndef __SAVE_H__
|
#ifndef __SAVE_H__
|
||||||
#define __SAVE_H__
|
#define __SAVE_H__
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
u8 unk0[0x4];
|
|
||||||
u8 unk4[0x14];
|
|
||||||
u8 pad28[0x5C];
|
|
||||||
u32 checksum;
|
|
||||||
}SaveFile;
|
|
||||||
|
|
||||||
typedef struct{
|
typedef struct{
|
||||||
u8 magic;
|
u8 magic;
|
||||||
u8 slotIndex;
|
u8 slotIndex;
|
||||||
u8 pad2[0x76];
|
u8 data[0x70];
|
||||||
|
u8 padding[0x2];
|
||||||
|
u32 checksum;
|
||||||
}SaveData;
|
}SaveData;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u8 unk0[0x04];
|
u32 snsItems;
|
||||||
u8 unk4[0x18];
|
u8 padding[0x18];
|
||||||
u32 checksum;
|
u32 checksum;
|
||||||
}SaveSettings;
|
}GlobalData;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
|
|
||||||
#define ROUND_UP_DIVIDE(a, b) (((a) + (b) - 1) / (b))
|
#define ROUND_UP_DIVIDE(a, b) (((a) + (b) - 1) / (b))
|
||||||
// The round up divide is not technically needed, but will come in handy for modding
|
// The round up divide is not technically needed, but will come in handy for modding
|
||||||
#define gameFile_NUM_BLOCKS ROUND_UP_DIVIDE(sizeof(SaveFile),EEPROM_BLOCK_SIZE)
|
#define gameFile_NUM_BLOCKS ROUND_UP_DIVIDE(sizeof(SaveData),EEPROM_BLOCK_SIZE)
|
||||||
|
|
||||||
s32 write_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) {
|
s32 write_file_blocks(s32 filenum, s32 blockOffset, u8 *buffer, s32 blockCount) {
|
||||||
s32 address = (filenum * gameFile_NUM_BLOCKS) + blockOffset;
|
s32 address = (filenum * gameFile_NUM_BLOCKS) + blockOffset;
|
||||||
|
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "save.h"
|
#include "save.h"
|
||||||
|
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
s16 unk0;
|
s16 unk0;
|
||||||
s16 unk2;
|
s16 unk2;
|
||||||
@@ -401,7 +402,7 @@ int savedata_8033CCD0(s32 filenum){
|
|||||||
|
|
||||||
int savedata_8033CE40(u8 *buffer){
|
int savedata_8033CE40(u8 *buffer){
|
||||||
int out;
|
int out;
|
||||||
savedata_update_crc(buffer, 0x20);
|
savedata_update_crc(buffer, sizeof(GlobalData));
|
||||||
out = write_file_blocks(0, 0x3C, buffer, 4);
|
out = write_file_blocks(0, 0x3C, buffer, 4);
|
||||||
if(out){
|
if(out){
|
||||||
out = 1;
|
out = 1;
|
||||||
|
Reference in New Issue
Block a user