diff options
author | red031000 <rubenru09@aol.com> | 2021-07-23 01:11:15 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2021-07-23 01:12:27 +0100 |
commit | 5bf13c7f48fe91c7902ce50250bc1a5a2398a2ae (patch) | |
tree | 2e91e60bdb7a9174b16d8ca1b532809d4ae2e5b6 /arm9/lib/src/CTRDG_backup.c | |
parent | c2d91a2d997afd01fa4f40e1e16d5ee85557c9a8 (diff) |
separate out libs to libc, libnns and NitroSDK
Diffstat (limited to 'arm9/lib/src/CTRDG_backup.c')
-rw-r--r-- | arm9/lib/src/CTRDG_backup.c | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/arm9/lib/src/CTRDG_backup.c b/arm9/lib/src/CTRDG_backup.c deleted file mode 100644 index dc1a3f4b..00000000 --- a/arm9/lib/src/CTRDG_backup.c +++ /dev/null @@ -1,94 +0,0 @@ -#include "CTRDG_backup.h" -#include "function_target.h" -#include "OS_spinLock.h" - -extern u16 ctrdgi_flash_lock_id; -extern u16 ctrdgi_sram_lock_id; - -extern u16 CTRDGi_ReadFlashID(void); - -extern const CTRDGiFlashTypePlus defaultFlash1M; -extern const CTRDGiFlashTypePlus MX29L010; -extern const CTRDGiFlashTypePlus LE26FV10N1TS_10; - -extern const CTRDGiFlashTypePlus defaultFlash512; -extern const CTRDGiFlashTypePlus LE39FW512; -extern const CTRDGiFlashTypePlus AT29LV512_lib; -extern const CTRDGiFlashTypePlus MN63F805MNP; - -static const CTRDGiFlashTypePlus *const flash1M_list[] = { - &MX29L010, - &LE26FV10N1TS_10, - &defaultFlash1M -}; - -static const CTRDGiFlashTypePlus *const flash512_list[] = { - &LE39FW512, - &AT29LV512_lib, - &MN63F805MNP, - &defaultFlash512 -}; - -static const u16 readidtime[] = { - 20 -}; - -ARM_FUNC u16 CTRDG_IdentifyAgbBackup(CTRDGBackupType type) -{ - u16 result = 1; - u16 flashID; - const CTRDGiFlashTypePlus *const *flp; - MICartridgeRamCycle ram_cycle; - - if (type == CTRDG_BACKUP_TYPE_FLASH_512K || type == CTRDG_BACKUP_TYPE_FLASH_1M) - { - ctrdgi_flash_lock_id = (u16)OS_GetLockID(); - - (void)OS_LockCartridge(ctrdgi_flash_lock_id); - - ram_cycle = MI_GetCartridgeRamCycle(); - MI_SetCartridgeRamCycle(MI_CTRDG_RAMCYCLE_18); - - ctrdgi_fl_maxtime = readidtime; - flashID = CTRDGi_ReadFlashID(); - - if (type == CTRDG_BACKUP_TYPE_FLASH_512K) - { - flp = flash512_list; - } - - if (type == CTRDG_BACKUP_TYPE_FLASH_1M) - { - flp = flash1M_list; - } - - MI_SetCartridgeRamCycle(ram_cycle); - (void)OS_UnlockCartridge(ctrdgi_flash_lock_id); - - result = 1; - while ((*flp)->type.makerID != 0) - { - if ((flashID & 0xff) == *(u16 *)&((*flp)->type.makerID)) - { - result = 0; - break; - } - flp++; - } - CTRDGi_WriteAgbFlashSector = (*flp)->CTRDGi_WriteAgbFlashSector; - CTRDGi_EraseAgbFlashChip = (*flp)->CTRDGi_EraseAgbFlashChip; - CTRDGi_EraseAgbFlashSector = (*flp)->CTRDGi_EraseAgbFlashSector; - CTRDGi_WriteAgbFlashSectorAsync = (*flp)->CTRDGi_WriteAgbFlashSectorAsync; - CTRDGi_EraseAgbFlashChipAsync = (*flp)->CTRDGi_EraseAgbFlashChipAsync; - CTRDGi_EraseAgbFlashSectorAsync = (*flp)->CTRDGi_EraseAgbFlashSectorAsync; - CTRDGi_PollingSR = (*flp)->CTRDGi_PollingSR; - ctrdgi_fl_maxtime = (*flp)->maxtime; - AgbFlash = &(*flp)->type; - } - else if (type == CTRDG_BACKUP_TYPE_SRAM) - { - ctrdgi_sram_lock_id = (u16)OS_GetLockID(); - result = 0; - } - return result; -} |