From 3c458e8b4893866639734a572a7d8e5ce6c7c1ce Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 5 May 2020 20:13:17 -0400 Subject: Decompile GF funcs responsible for overlays --- arm9/lib/include/CARD_rom.h | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 arm9/lib/include/CARD_rom.h (limited to 'arm9/lib/include/CARD_rom.h') diff --git a/arm9/lib/include/CARD_rom.h b/arm9/lib/include/CARD_rom.h new file mode 100644 index 00000000..327bc995 --- /dev/null +++ b/arm9/lib/include/CARD_rom.h @@ -0,0 +1,11 @@ +#ifndef NITRO_CARD_ROM_H_ +#define NITRO_CARD_ROM_H_ + +typedef struct +{ + u32 offset; + u32 length; +} +CARDRomRegion; + +#endif //NITRO_CARD_ROM_H_ -- cgit v1.2.3 From 9f3c697d9dee85da8c9bf4f708a340d5023194ec Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Wed, 6 May 2020 18:14:26 -0400 Subject: FS_overlay.c --- arm9/lib/include/CARD_rom.h | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'arm9/lib/include/CARD_rom.h') diff --git a/arm9/lib/include/CARD_rom.h b/arm9/lib/include/CARD_rom.h index 327bc995..c43a2f06 100644 --- a/arm9/lib/include/CARD_rom.h +++ b/arm9/lib/include/CARD_rom.h @@ -1,6 +1,8 @@ #ifndef NITRO_CARD_ROM_H_ #define NITRO_CARD_ROM_H_ +#include "MI_exMemory.h" + typedef struct { u32 offset; @@ -8,4 +10,11 @@ typedef struct } 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); +} + #endif //NITRO_CARD_ROM_H_ -- cgit v1.2.3 From 994cfcbc9a1e42043b25ae3ab6471b8ecbd55ff1 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 7 May 2020 19:39:53 -0400 Subject: FS_rom.c --- arm9/lib/include/CARD_rom.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'arm9/lib/include/CARD_rom.h') diff --git a/arm9/lib/include/CARD_rom.h b/arm9/lib/include/CARD_rom.h index c43a2f06..4c2e9dd5 100644 --- a/arm9/lib/include/CARD_rom.h +++ b/arm9/lib/include/CARD_rom.h @@ -2,6 +2,7 @@ #define NITRO_CARD_ROM_H_ #include "MI_exMemory.h" +#include "MI_dma.h" typedef struct { @@ -17,4 +18,22 @@ static inline const CARDRomRegion * CARD_GetRomRegionOVT(MIProcessor target) : (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_ -- cgit v1.2.3