diff options
author | red031000 <rubenru09@aol.com> | 2020-05-12 23:12:35 +0100 |
---|---|---|
committer | red031000 <rubenru09@aol.com> | 2020-05-12 23:12:35 +0100 |
commit | 59171916421e659bcb35b1b47eaf748fac2fea6d (patch) | |
tree | fd5886b4a76002766c94a5d33a1a42fd14335e0e /arm9/lib/include/CARD_rom.h | |
parent | 26b7a78d02b261256e420f149bb7bae66e392ee7 (diff) | |
parent | f4ea052ed0b4e3b0d6a3c12bce46ee53228a9bc0 (diff) |
Merge branch 'master' of https://github.com/martmists/pokediamond into overlay69
Diffstat (limited to 'arm9/lib/include/CARD_rom.h')
-rw-r--r-- | arm9/lib/include/CARD_rom.h | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/arm9/lib/include/CARD_rom.h b/arm9/lib/include/CARD_rom.h new file mode 100644 index 00000000..4c2e9dd5 --- /dev/null +++ b/arm9/lib/include/CARD_rom.h @@ -0,0 +1,39 @@ +#ifndef NITRO_CARD_ROM_H_ +#define NITRO_CARD_ROM_H_ + +#include "MI_exMemory.h" +#include "MI_dma.h" + +typedef struct +{ + u32 offset; + u32 length; +} +CARDRomRegion; + +static inline const CARDRomRegion * CARD_GetRomRegionOVT(MIProcessor target) +{ + return (target == MI_PROCESSOR_ARM9) + ? (const CARDRomRegion *)((const u8 *)HW_ROM_HEADER_BUF + 0x50) + : (const CARDRomRegion *)((const u8 *)HW_ROM_HEADER_BUF + 0x58); +} + +void CARDi_ReadRom(u32 dma, const void * src, void * dst, u32 len, MIDmaCallback done_cb, void * arg, BOOL is_async); + +static inline void CARD_ReadRomAsync(u32 dma, const void * src, void * dst, u32 len, MIDmaCallback callback, void * arg) +{ + CARDi_ReadRom(dma, src, dst, len, callback, arg, TRUE); +} + +void CARD_LockRom(u16 lock_id); +void CARD_UnlockRom(u16 lock_id); + +static inline const CARDRomRegion * CARD_GetRomRegionFNT() { + return (const CARDRomRegion *)((const u8 *)HW_ROM_HEADER_BUF + 0x40); +} + +static inline const CARDRomRegion * CARD_GetRomRegionFAT() { + return (const CARDRomRegion *)((const u8 *)HW_ROM_HEADER_BUF + 0x48); +} + +#endif //NITRO_CARD_ROM_H_ |