diff options
author | who-knows-who <j.williams97@outlook.com> | 2021-02-27 15:29:36 +0000 |
---|---|---|
committer | who-knows-who <j.williams97@outlook.com> | 2021-02-27 15:29:36 +0000 |
commit | aa968bb2de4d703376af43a0ef32a53ca46f489b (patch) | |
tree | 699d89dda03b1b81b4a0a87b8694073a71157d1a /arm9/lib/include/CTRDG_backup.h | |
parent | e13202e2f19c9f1673a021dbcc062d96b9f0f06c (diff) | |
parent | 75dc81c75dc1dc86053303cdae9decdb2f05557d (diff) |
Merge branch 'master' of github.com:pret/pokediamond
Diffstat (limited to 'arm9/lib/include/CTRDG_backup.h')
-rw-r--r-- | arm9/lib/include/CTRDG_backup.h | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/arm9/lib/include/CTRDG_backup.h b/arm9/lib/include/CTRDG_backup.h new file mode 100644 index 00000000..272744ad --- /dev/null +++ b/arm9/lib/include/CTRDG_backup.h @@ -0,0 +1,45 @@ +#ifndef POKEDIAMOND_CTRDG_BACKUP_H +#define POKEDIAMOND_CTRDG_BACKUP_H + +#include "nitro/types.h" +#include "CTRDG_flash.h" +#include "CTRDG_task.h" + +#define CTRDG_BACKUP_PHASE_PROGRAM 0x0001 +#define CTRDG_BACKUP_PHASE_SECTOR_ERASE 0x0002 +#define CTRDG_BACKUP_PHASE_CHIP_ERASE 0x0003 + +typedef struct CTRDGiFlashTypePlusTag +{ + u16 (*CTRDGi_WriteAgbFlashSector)(u16 secNo, u8 *src); + u16 (*CTRDGi_EraseAgbFlashChip)(void); + u16 (*CTRDGi_EraseAgbFlashSector)(u16 secNo); + void (*CTRDGi_WriteAgbFlashSectorAsync)(u16 secNo, u8 *src, CTRDG_TASK_FUNC callback); + void (*CTRDGi_EraseAgbFlashChipAsync)(CTRDG_TASK_FUNC callback); + void (*CTRDGi_EraseAgbFlashSectorAsync)(u16 secNo, CTRDG_TASK_FUNC callback); + u16 (*CTRDGi_PollingSR)(u16 phase, u8 *adr, u16 lastData); + const u16 (*maxtime); + CTRDGFlashType type; +} CTRDGiFlashTypePlus; + +typedef enum +{ + CTRDG_BACKUP_TYPE_FLASH_512K, + CTRDG_BACKUP_TYPE_FLASH_1M, + CTRDG_BACKUP_TYPE_SRAM +} CTRDGBackupType; + +extern const u16 (*ctrdgi_fl_maxtime); + +extern u16 (*CTRDGi_PollingSR)(u16 phase, u8 *adr, u16 lastData); +extern const CTRDGFlashType *AgbFlash; +extern u16 (*CTRDGi_WriteAgbFlashSector)(u16 secNo, u8 *src); +extern u16 (*CTRDGi_EraseAgbFlashChip)(void); +extern u16 (*CTRDGi_EraseAgbFlashSector)(u16 secNo); +extern void (*CTRDGi_WriteAgbFlashSectorAsync)(u16 secNo, u8 *src, CTRDG_TASK_FUNC callback); +extern void (*CTRDGi_EraseAgbFlashChipAsync)(CTRDG_TASK_FUNC callback); +extern void (*CTRDGi_EraseAgbFlashSectorAsync)(u16 secNo, CTRDG_TASK_FUNC callback); + +u16 CTRDG_IdentifyAgbBackup(CTRDGBackupType type); + +#endif //POKEDIAMOND_CTRDG_BACKUP_H |