diff options
author | Revo <projectrevotpp@hotmail.com> | 2020-05-10 20:02:11 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-10 20:02:11 -0400 |
commit | 49e14283e13c146018f2a2785dfc77e0e1ff5368 (patch) | |
tree | 49e05a9eadfcc449943eabdbf2ddf85edb15c09a /arm9/lib/include/FS_overlay.h | |
parent | 584e6caadd3332e555a40979d98a8fd871d36a23 (diff) | |
parent | 28370e78b2357915fa0bd0c299fa1fbbd91da0b3 (diff) |
Merge pull request #72 from PikalaxALT/pikalax_work
More module disassembly; main.c
Diffstat (limited to 'arm9/lib/include/FS_overlay.h')
-rw-r--r-- | arm9/lib/include/FS_overlay.h | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index 6025d04a..14c7ce66 100644 --- a/arm9/lib/include/FS_overlay.h +++ b/arm9/lib/include/FS_overlay.h @@ -1,6 +1,10 @@ #ifndef NITRO_FS_OVERLAY_H_ #define NITRO_FS_OVERLAY_H_ +#if defined(__cplusplus) +extern "C" { +#endif + #include "nitro.h" #include "MI_exMemory.h" #include "FS_file.h" @@ -8,7 +12,10 @@ typedef u32 FSOverlayID; -typedef void (*FSOverlayInitFunc) (void); +#define FS_EXTERN_OVERLAY(name) extern u32 SDK_OVERLAY_ ## name ## _ID[1] +#define FS_OVERLAY_ID(name) ((u32)&(SDK_OVERLAY_ ## name ## _ID)) + +typedef void (*FSOverlayInitFunc)(void); typedef struct FSOverlayInfoHeader { @@ -19,8 +26,8 @@ typedef struct FSOverlayInfoHeader FSOverlayInitFunc *sinit_init; FSOverlayInitFunc *sinit_init_end; u32 file_id; - u32 compressed:24; - u32 flag:8; + u32 compressed: 24; + u32 flag: 8; } FSOverlayInfoHeader; typedef struct FSOverlayInfo @@ -30,26 +37,35 @@ typedef struct FSOverlayInfo CARDRomRegion file_pos; } FSOverlayInfo; -static inline u8 *const FS_GetOverlayAddress(FSOverlayInfo * p_ovi) +static inline u8 *const FS_GetOverlayAddress(FSOverlayInfo *p_ovi) { return p_ovi->header.ram_address; } -static inline u32 const FS_GetOverlayImageSize(FSOverlayInfo * p_ovi) +static inline u32 const FS_GetOverlayImageSize(FSOverlayInfo *p_ovi) { return p_ovi->header.ram_size; } -static inline u32 const FS_GetOverlayTotalSize(FSOverlayInfo * p_ovi) +static inline u32 const FS_GetOverlayTotalSize(FSOverlayInfo *p_ovi) { return p_ovi->header.ram_size + p_ovi->header.bss_size; } BOOL FS_LoadOverlayInfo(FSOverlayInfo *p_ovi, MIProcessor target, FSOverlayID id); + BOOL FS_LoadOverlay(MIProcessor target, FSOverlayID id); + BOOL FS_UnloadOverlay(MIProcessor target, FSOverlayID id); + BOOL FS_LoadOverlayImage(FSOverlayInfo *p_ovi); + void FS_StartOverlay(FSOverlayInfo *p_ovi); + BOOL FS_LoadOverlayImageAsync(FSOverlayInfo *p_ovi, FSFile *p_file); +#if defined(__cplusplus) +}; +#endif + #endif //NITRO_FS_OVERLAY_H_ |