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/FS_overlay.h | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 arm9/lib/include/FS_overlay.h (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h new file mode 100644 index 00000000..967169aa --- /dev/null +++ b/arm9/lib/include/FS_overlay.h @@ -0,0 +1,42 @@ +#ifndef NITRO_FS_OVERLAY_H_ +#define NITRO_FS_OVERLAY_H_ + +#include "nitro.h" +#include "MI_exMemory.h" +#include "FS_file.h" +#include "CARD_rom.h" + +typedef u32 FSOverlayID; + +typedef void (*FSOverlayInitFunc) (void); + +typedef struct FSOverlayInfoHeader +{ + u32 id; + u8 *ram_address; + u32 ram_size; + u32 bss_size; + FSOverlayInitFunc *sinit_init; + FSOverlayInitFunc *sinit_init_end; + u32 file_id; + u32 compressed:24; + u32 flag:8; +} FSOverlayInfoHeader; + +typedef struct FSOverlayInfo +{ + FSOverlayInfoHeader header; + MIProcessor target; + CARDRomRegion file_pos; +} FSOverlayInfo; + +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); +void FS_WaitAsync(FSFile *p_file); +void FS_CloseFile(FSFile *p_file); + +#endif //NITRO_FS_OVERLAY_H_ -- cgit v1.2.3 From c8230ac1a65a367f7796a2c8afed9533ba135faf Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Tue, 5 May 2020 22:08:55 -0400 Subject: Fix matching --- arm9/lib/include/FS_overlay.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index 967169aa..c2634509 100644 --- a/arm9/lib/include/FS_overlay.h +++ b/arm9/lib/include/FS_overlay.h @@ -36,7 +36,6 @@ 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); -void FS_WaitAsync(FSFile *p_file); void FS_CloseFile(FSFile *p_file); #endif //NITRO_FS_OVERLAY_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/FS_overlay.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index c2634509..1ef6469c 100644 --- a/arm9/lib/include/FS_overlay.h +++ b/arm9/lib/include/FS_overlay.h @@ -30,6 +30,21 @@ typedef struct FSOverlayInfo CARDRomRegion file_pos; } FSOverlayInfo; +static inline u8 *const FS_GetOverlayAddress(FSOverlayInfo * p_ovi) +{ + return p_ovi->header.ram_address; +} + +static inline u32 const FS_GetOverlayImageSize(FSOverlayInfo * p_ovi) +{ + return p_ovi->header.ram_size; +} + +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); -- cgit v1.2.3 From 34ec05f983cec0517765640d084f58e86aa20d79 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Thu, 7 May 2020 17:53:16 -0400 Subject: Finish FS_archive.c --- arm9/lib/include/FS_overlay.h | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index 1ef6469c..6025d04a 100644 --- a/arm9/lib/include/FS_overlay.h +++ b/arm9/lib/include/FS_overlay.h @@ -45,12 +45,11 @@ 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); -void FS_CloseFile(FSFile *p_file); +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); #endif //NITRO_FS_OVERLAY_H_ -- cgit v1.2.3 From aa6e5b3edc83c5223199fc52e8d92f2f0f4c338e Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sat, 9 May 2020 16:09:08 -0400 Subject: Module 01 static initializer; split module 04 ro/data --- arm9/lib/include/FS_overlay.h | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index 6025d04a..fd1e2900 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,7 @@ typedef u32 FSOverlayID; -typedef void (*FSOverlayInitFunc) (void); +typedef void (*FSOverlayInitFunc)(void); typedef struct FSOverlayInfoHeader { @@ -19,8 +23,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 +34,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_ -- cgit v1.2.3 From 7b8a6275ebdbb2b6d5023fe8769e08be074f032a Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Sun, 10 May 2020 14:12:15 -0400 Subject: Tocuh up main.c; key input --- arm9/lib/include/FS_overlay.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'arm9/lib/include/FS_overlay.h') diff --git a/arm9/lib/include/FS_overlay.h b/arm9/lib/include/FS_overlay.h index fd1e2900..14c7ce66 100644 --- a/arm9/lib/include/FS_overlay.h +++ b/arm9/lib/include/FS_overlay.h @@ -12,6 +12,9 @@ extern "C" { typedef u32 FSOverlayID; +#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 -- cgit v1.2.3