Add files

This commit is contained in:
Cuyler36
2023-05-20 21:14:40 -04:00
parent d60a391a17
commit 29deabc35a
16 changed files with 465 additions and 0 deletions
+72
View File
@@ -0,0 +1,72 @@
#ifndef DOLPHIN_OSMODULE_H
#define DOLPHIN_OSMODULE_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct OSModuleInfo_s OSModuleInfo;
typedef struct OSModuleQueue_s {
OSModuleInfo* head;
OSModuleInfo* tail;
} OSModuleQueue;
typedef struct OSModuleLink_s {
OSModuleInfo* next;
OSModuleInfo* prev;
} OSModuleLink;
typedef struct OSModuleInfo_s {
u32 id;
OSModuleLink link;
u32 numSections;
u32 sectionInfoOfs;
u32 nameOfs;
u32 nameSize;
u32 version;
} OSModuleInfo;
typedef struct OSModuleHeader_s {
OSModuleInfo info;
u32 bssSize;
u32 relOfs;
u32 impOfs;
u32 impSize;
u8 prologSection;
u8 epilogSection;
u8 unresolvedSection;
u8 bssSection;
u32 prolog;
u32 epilog;
u32 unresolved;
/* OS_MODULE_VERSION >= 2 */
u32 align;
u32 bssAlign;
} OSModuleHeader;
typedef struct OSSectionInfo_s {
u32 offset;
u32 size;
} OSSectionInfo;
#define OSGetSectionInfo(module) \
((OSSectionInfo*) (((OSModuleInfo*) (module))->sectionInfoOfs))
#define OS_SECTIONINFO_EXEC 1
#define OS_SECTIONINFO_OFFSET(offset) ((offset) & ~OS_SECTIONINFO_EXEC)
void OSSetStringTable (const void* strTable);
BOOL OSLink(OSModuleInfo* module, void* bss);
BOOL OSUnlink(OSModuleInfo* module);
#ifdef __cplusplus
}
#endif
#endif
+25
View File
@@ -0,0 +1,25 @@
#ifndef OSRESET_H
#define OSRESET_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define OS_RESETCODE_RESTART 0x80000000
#define OS_RESET_RESTART 0
#define OS_RESET_HOTRESET 1 /* Soft reset */
#define OS_RESET_SHUTDOWN 2
u32 OSGetResetCode();
void OSResetSystem(int reset, u32 resetCode, BOOL forceMenu);
BOOL OSGetResetSwitchState();
void OSGetSaveRegion(void** start, void** end);
#ifdef __cplusplus
}
#endif
#endif
+28
View File
@@ -0,0 +1,28 @@
#ifndef DOLPHIN_PAD_H
#define DOLPHIN_PAD_H
#include "types.h"
#ifdef __cplusplus
extern "C" {
#endif
#define PAD_BUTTON_LEFT 0x0001
#define PAD_BUTTON_RIGHT 0x0002
#define PAD_BUTTON_DOWN 0x0004
#define PAD_BUTTON_UP 0x0008
#define PAD_TRIGGER_Z 0x0010
#define PAD_TRIGGER_R 0x0020
#define PAD_TRIGGER_L 0x0040
#define PAD_BUTTON_A 0x0100
#define PAD_BUTTON_B 0x0200
#define PAD_BUTTON_X 0x0400
#define PAD_BUTTON_Y 0x0800
#define PAD_BUTTON_MENU 0x1000
#define PAD_BUTTON_START 0x1000
#ifdef __cplusplus
}
#endif
#endif