mirror of
https://github.com/zeldaret/tww.git
synced 2026-06-26 01:34:39 -04:00
Add AT_ADDRESS macro
This commit is contained in:
@@ -3,9 +3,10 @@
|
||||
|
||||
#include "dolphin/os/OS.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
volatile u16 __DSPRegs[32] : 0xCC005000;
|
||||
volatile u32 __AIRegs[8] : 0xCC006C00;
|
||||
volatile u16 __DSPRegs[32] AT_ADDRESS(0xCC005000);
|
||||
volatile u32 __AIRegs[8] AT_ADDRESS(0xCC006C00);
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -2,8 +2,9 @@
|
||||
#define DVDLOW_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
typedef void (*DVDLowCallback)(u32 intType);
|
||||
vu32 __DIRegs[16] : 0xCC006000;
|
||||
vu32 __DIRegs[16] AT_ADDRESS(0xCC006000);
|
||||
|
||||
#endif /* DVDLOW_H */
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define EXIBIOS_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -9,7 +10,7 @@ extern "C" {
|
||||
|
||||
typedef struct OSContext OSContext;
|
||||
|
||||
vu32 __EXIRegs[16] : 0xCC006800;
|
||||
vu32 __EXIRegs[16] AT_ADDRESS(0xCC006800);
|
||||
|
||||
#define EXI_MEMORY_CARD_59 0x00000004
|
||||
#define EXI_MEMORY_CARD_123 0x00000008
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "dolphin/gx/GXTev.h"
|
||||
#include "dolphin/gx/GXTexture.h"
|
||||
#include "dolphin/gx/GXTransform.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -41,7 +42,7 @@ typedef union {
|
||||
f64 f64;
|
||||
} PPCWGPipe;
|
||||
|
||||
volatile PPCWGPipe GXFIFO : 0xCC008000;
|
||||
volatile PPCWGPipe GXFIFO AT_ADDRESS(0xCC008000);
|
||||
|
||||
// Direct
|
||||
inline void GXPosition2f32(f32 x, f32 z) {
|
||||
|
||||
+12
-11
@@ -24,6 +24,7 @@
|
||||
#include "dolphin/os/OSSync.h"
|
||||
#include "dolphin/os/OSThread.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -59,19 +60,19 @@ extern "C" {
|
||||
#define OS_CONSOLE_PC_EMULATOR 0x10000001
|
||||
#define OS_CONSOLE_EMULATOR 0x10000000
|
||||
|
||||
volatile u16 __OSDeviceCode : 0x800030E6;
|
||||
volatile u16 __OSDeviceCode AT_ADDRESS(0x800030E6);
|
||||
|
||||
volatile u32 OS_PI_INTR_CAUSE : 0xCC003000;
|
||||
volatile u32 OS_PI_INTR_MASK : 0xCC003004;
|
||||
volatile u32 OS_PI_INTR_CAUSE AT_ADDRESS(0xCC003000);
|
||||
volatile u32 OS_PI_INTR_MASK AT_ADDRESS(0xCC003004);
|
||||
|
||||
volatile u16 OS_MI_INTR_MASK : 0xCC00401C;
|
||||
volatile u16 OS_MI_INTR_MASK AT_ADDRESS(0xCC00401C);
|
||||
|
||||
volatile u16 OS_DSP_DMA_ADDR_HI : 0xCC005030;
|
||||
volatile u16 OS_DSP_DMA_ADDR_LO : 0xCC005032;
|
||||
volatile u16 OS_DSP_INTR_MASK : 0xCC00500A;
|
||||
volatile u16 OS_DSP_DMA_ADDR_HI AT_ADDRESS(0xCC005030);
|
||||
volatile u16 OS_DSP_DMA_ADDR_LO AT_ADDRESS(0xCC005032);
|
||||
volatile u16 OS_DSP_INTR_MASK AT_ADDRESS(0xCC00500A);
|
||||
|
||||
volatile u16 OS_ARAM_DMA_ADDR_HI : 0xCC005020;
|
||||
volatile u16 OS_ARAM_DMA_ADDR_LO : 0xCC005022;
|
||||
volatile u16 OS_ARAM_DMA_ADDR_HI AT_ADDRESS(0xCC005020);
|
||||
volatile u16 OS_ARAM_DMA_ADDR_LO AT_ADDRESS(0xCC005022);
|
||||
|
||||
BOOL OSIsThreadSuspended(OSThread* thread);
|
||||
|
||||
@@ -89,8 +90,8 @@ extern u8 __OSReport_enable;
|
||||
|
||||
extern BOOL __OSIsGcam;
|
||||
|
||||
extern u32 BOOT_REGION_START : 0x812FDFF0;
|
||||
extern u32 BOOT_REGION_END : 0x812FDFEC;
|
||||
extern u32 BOOT_REGION_START AT_ADDRESS(0x812FDFF0);
|
||||
extern u32 BOOT_REGION_END AT_ADDRESS(0x812FDFEC);
|
||||
|
||||
void OSReportInit__Fv(void); // needed for inline asm
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define OSCONTEXT_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -151,8 +152,8 @@ typedef struct OSContext {
|
||||
/* 0x1C4 */ f64 ps[32];
|
||||
} OSContext;
|
||||
|
||||
OSContext* OS_CURRENT_CONTEXT : 0x800000D4;
|
||||
OSContext* OS_CURRENT_FPU_CONTEXT : 0x800000D8;
|
||||
OSContext* OS_CURRENT_CONTEXT AT_ADDRESS(0x800000D4);
|
||||
OSContext* OS_CURRENT_FPU_CONTEXT AT_ADDRESS(0x800000D8);
|
||||
|
||||
void __OSLoadFPUContext(void);
|
||||
void __OSSaveFPUContext(s32 unused0, s32 unused1, OSContext* context);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef OSLINK_H
|
||||
#define OSLINK_H
|
||||
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -18,8 +19,8 @@ typedef struct OSSectionInfo OSSectionInfo;
|
||||
typedef struct OSImportInfo OSImportInfo;
|
||||
typedef struct OSRel OSRel;
|
||||
|
||||
OSModuleQueue __OSModuleList : 0x800030C8;
|
||||
void* __OSStringTable : 0x800030D0;
|
||||
OSModuleQueue __OSModuleList AT_ADDRESS(0x800030C8);
|
||||
void* __OSStringTable AT_ADDRESS(0x800030D0);
|
||||
|
||||
struct OSModuleQueue {
|
||||
OSModuleInfo* head;
|
||||
|
||||
@@ -2,12 +2,13 @@
|
||||
#define OSRESET_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
vu32 __PIRegs[12] : 0xCC003000;
|
||||
vu32 __PIRegs[12] AT_ADDRESS(0xCC003000);
|
||||
|
||||
#define OS_RESETCODE_RESTART 0x80000000
|
||||
#define OS_RESETCODE_SYSTEM 0x40000000
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define OSTHREAD_H
|
||||
|
||||
#include "dolphin/os/OSContext.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -75,8 +76,8 @@ struct OSThread {
|
||||
|
||||
typedef void (*OSSwitchThreadCallback)(OSThread* from, OSThread* to);
|
||||
|
||||
OSThreadQueue OS_THREAD_QUEUE : 0x800000DC;
|
||||
OSThread* OS_CURRENT_THREAD : 0x800000E4;
|
||||
OSThreadQueue OS_THREAD_QUEUE AT_ADDRESS(0x800000DC);
|
||||
OSThread* OS_CURRENT_THREAD AT_ADDRESS(0x800000E4);
|
||||
|
||||
static void DefaultSwitchThreadCallback(OSThread* from, OSThread* to);
|
||||
OSSwitchThreadCallback OSSetSwitchThreadCallback(OSSwitchThreadCallback func);
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define OSTIME_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -10,7 +11,7 @@ extern "C" {
|
||||
typedef s64 OSTime;
|
||||
typedef u32 OSTick;
|
||||
|
||||
OSTime OS_SYSTEM_TIME : 0x800030D8;
|
||||
OSTime OS_SYSTEM_TIME AT_ADDRESS(0x800030D8);
|
||||
|
||||
typedef struct OSCalendarTime {
|
||||
/* 0x00 */ s32 seconds;
|
||||
@@ -32,7 +33,7 @@ OSTime __OSTimeToSystemTime(OSTime time);
|
||||
void GetDates(s32 days, OSCalendarTime* ct);
|
||||
void OSTicksToCalendarTime(OSTime ticks, OSCalendarTime* ct);
|
||||
|
||||
extern u32 __OSBusClock : 0x800000F8;
|
||||
extern u32 __OSBusClock AT_ADDRESS(0x800000F8);
|
||||
|
||||
#define OS_BUS_CLOCK (__OSBusClock)
|
||||
#define OS_CORE_CLOCK (*(u32*)0x800000FC)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
#ifndef _DOLPHIN_OS_OSUTIL_H
|
||||
#define _DOLPHIN_OS_OSUTIL_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
// Macro to make it more clear when something is an address, and to prevent intellisense errors.
|
||||
#ifdef __MWERKS__
|
||||
#define AT_ADDRESS(addr) : (addr)
|
||||
#else
|
||||
#define AT_ADDRESS(addr)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif // ifdef __cplusplus
|
||||
|
||||
#endif
|
||||
@@ -2,6 +2,7 @@
|
||||
#define __START_H
|
||||
|
||||
#include "global.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -21,7 +22,7 @@ extern "C" {
|
||||
|
||||
extern void InitMetroTRK();
|
||||
|
||||
u16 Pad3Button : PAD3_BUTTON_ADDR;
|
||||
u16 Pad3Button AT_ADDRESS(PAD3_BUTTON_ADDR);
|
||||
|
||||
extern int main(int argc, char* argv[]);
|
||||
extern void exit(int);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "dolphin/os/OSInterrupt.h"
|
||||
#include "dolphin/os/OSTime.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -121,7 +122,7 @@ u32 SIGetType(s32 chan);
|
||||
u32 SIGetTypeAsync(s32 chan, SITypeAndStatusCallback callback);
|
||||
u32 SIProbe(s32 chan);
|
||||
|
||||
vu32 __SIRegs[64] : 0xCC006400;
|
||||
vu32 __SIRegs[64] AT_ADDRESS(0xCC006400);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define VI_H
|
||||
|
||||
#include "dolphin/types.h"
|
||||
#include "dolphin/os/OSUtil.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -54,7 +55,7 @@ void VISetBlack(BOOL);
|
||||
u32 VIGetRetraceCount();
|
||||
u32 VIGetDTVStatus();
|
||||
|
||||
vu16 __VIRegs[59] : 0xCC002000;
|
||||
vu16 __VIRegs[59] AT_ADDRESS(0xCC002000);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user