summaryrefslogtreecommitdiff
path: root/arm9/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'arm9/lib/include')
-rw-r--r--arm9/lib/include/CARD_rom.h9
-rw-r--r--arm9/lib/include/DGT_common.h6
-rw-r--r--arm9/lib/include/DGT_dgt.h6
-rw-r--r--arm9/lib/include/FS_file.h13
-rw-r--r--arm9/lib/include/FS_mw_dtor.h16
-rw-r--r--arm9/lib/include/FS_overlay.h15
-rw-r--r--arm9/lib/include/FS_rom.h7
-rw-r--r--arm9/lib/include/MI_memory.h10
-rw-r--r--arm9/lib/include/MI_uncompress.h6
-rw-r--r--arm9/lib/include/OS_cache.h9
-rw-r--r--arm9/lib/include/OS_system.h5
11 files changed, 102 insertions, 0 deletions
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_
diff --git a/arm9/lib/include/DGT_common.h b/arm9/lib/include/DGT_common.h
new file mode 100644
index 00000000..c74ae7cd
--- /dev/null
+++ b/arm9/lib/include/DGT_common.h
@@ -0,0 +1,6 @@
+#ifndef NITRO_DGT_COMMON_H_
+#define NITRO_DGT_COMMON_H_
+
+#define DGT_HASH2_DIGEST_SIZE (160/8)
+
+#endif //NITRO_DGT_COMMON_H_
diff --git a/arm9/lib/include/DGT_dgt.h b/arm9/lib/include/DGT_dgt.h
new file mode 100644
index 00000000..1c48531c
--- /dev/null
+++ b/arm9/lib/include/DGT_dgt.h
@@ -0,0 +1,6 @@
+#ifndef NITRO_DGT_DGT_H_
+#define NITRO_DGT_DGT_H_
+
+void DGT_Hash2CalcHmac(void* digest, void* bin_ptr, int bin_len, void* key_ptr, int keylen);
+
+#endif //NITRO_DGT_DGT_H_
diff --git a/arm9/lib/include/FS_file.h b/arm9/lib/include/FS_file.h
index 4871b660..89f69d86 100644
--- a/arm9/lib/include/FS_file.h
+++ b/arm9/lib/include/FS_file.h
@@ -175,5 +175,18 @@ FSFile;
u32 FS_SetDefaultDMA(u32 dma_no); // returns the previous selection
void FS_InitFile(FSFile * p_file);
BOOL FS_WaitAsync(FSFile * p_file);
+BOOL FS_OpenFileDirect(FSFile * p_file, FSArchive * p_arc, u32 image_top, u32 image_bottom, u32 file_index);
+int FS_ReadFile(FSFile * p_file, void * dst, s32 len);
+int FS_ReadFileAsync(FSFile * p_file, void * dst, s32 len);
+BOOL FS_OpenFileFast(FSFile * p_file, FSFileID file_id);
+
+static inline u32 const FS_GetFileImageTop(volatile const FSFile * p_file) {
+ return p_file->prop.file.top;
+}
+
+static inline u32 const FS_GetLength(volatile const FSFile * p_file)
+{
+ return p_file->prop.file.bottom - p_file->prop.file.top;
+}
#endif //NITRO_FS_FILE_H_
diff --git a/arm9/lib/include/FS_mw_dtor.h b/arm9/lib/include/FS_mw_dtor.h
new file mode 100644
index 00000000..a746ed19
--- /dev/null
+++ b/arm9/lib/include/FS_mw_dtor.h
@@ -0,0 +1,16 @@
+#ifndef NITRO_FS_MW_DTOR_H_
+#define NITRO_FS_MW_DTOR_H_
+
+typedef void (*MWI_DESTRUCTOR_FUNC) (void *);
+
+typedef struct MWiDestructorChain
+{
+ struct MWiDestructorChain *next;
+ MWI_DESTRUCTOR_FUNC dtor;
+ void *obj;
+}
+MWiDestructorChain;
+
+extern MWiDestructorChain *__global_destructor_chain;
+
+#endif //NITRO_FS_MW_DTOR_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);
diff --git a/arm9/lib/include/FS_rom.h b/arm9/lib/include/FS_rom.h
index fc62b579..0bba46bf 100644
--- a/arm9/lib/include/FS_rom.h
+++ b/arm9/lib/include/FS_rom.h
@@ -1,6 +1,13 @@
#ifndef NITRO_FS_ROM_H_
#define NITRO_FS_ROM_H_
+#include "FS_archive.h"
+#include "CARD_rom.h"
+
+extern FSArchive fsi_arc_rom;
+extern CARDRomRegion fsi_ovt7;
+extern CARDRomRegion fsi_ovt9;
+
void FSi_InitRom(u32 default_dma_no);
#endif //NITRO_FS_ROM_H_
diff --git a/arm9/lib/include/MI_memory.h b/arm9/lib/include/MI_memory.h
new file mode 100644
index 00000000..d9935a5f
--- /dev/null
+++ b/arm9/lib/include/MI_memory.h
@@ -0,0 +1,10 @@
+#ifndef NITRO_MI_MEMORY_H_
+#define NITRO_MI_MEMORY_H_
+
+void MI_CpuFill8(void *dest, u8 data, u32 size);
+void MI_CpuCopy8(void const *src, void *dest, u32 size);
+static inline void MI_CpuClear8(void *dest, u32 size) {
+ MI_CpuFill8(dest, 0, size);
+}
+
+#endif //NITRO_MI_MEMORY_H_
diff --git a/arm9/lib/include/MI_uncompress.h b/arm9/lib/include/MI_uncompress.h
new file mode 100644
index 00000000..55f28e27
--- /dev/null
+++ b/arm9/lib/include/MI_uncompress.h
@@ -0,0 +1,6 @@
+#ifndef NITRO_MI_UNCOMPRESS_H_
+#define NITRO_MI_UNCOMPRESS_H_
+
+void MIi_UncompressBackward(void * bottom);
+
+#endif //NITRO_MI_UNCOMPRESS_H_
diff --git a/arm9/lib/include/OS_cache.h b/arm9/lib/include/OS_cache.h
new file mode 100644
index 00000000..bee42d45
--- /dev/null
+++ b/arm9/lib/include/OS_cache.h
@@ -0,0 +1,9 @@
+#ifndef NITRO_OS_CACHE_H_
+#define NITRO_OS_CACHE_H_
+
+void IC_InvalidateRange(void *startAddr, u32 nBytes);
+void IC_FlushRange(void *startAddr, u32 nBytes);
+void DC_InvalidateRange(void *startAddr, u32 nBytes);
+void DC_FlushRange(void *startAddr, u32 nBytes);
+
+#endif //NITRO_OS_CACHE_H_
diff --git a/arm9/lib/include/OS_system.h b/arm9/lib/include/OS_system.h
index 65c58f57..1b263b19 100644
--- a/arm9/lib/include/OS_system.h
+++ b/arm9/lib/include/OS_system.h
@@ -36,5 +36,10 @@ OSIntrMode OS_GetCpsrIrq();
OSProcMode OS_GetProcMode();
void OS_SpinWait();
void OS_WaitVBlankIntr();
+void OS_Terminate(void);
+static inline void OS_TPanic(const char * message)
+{
+ OS_Terminate();
+}
#endif //POKEDIAMOND_OS_SYSTEM_H