summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorLuke Street <luke@street.dev>2024-10-12 22:43:10 -0600
committerGitHub <noreply@github.com>2024-10-12 21:43:10 -0700
commit0db466edfa84378d1450abbef25b378f4664528c (patch)
tree354dfe63a65baf6f9fe83b69a938d8cb9313a581 /include
parent7ec2d804142b0809ddd9893fd54169805467ab26 (diff)
Add clangd support for VS Code (#2207)
* Add clangd support for VS Code * Revert accidental change
Diffstat (limited to 'include')
-rw-r--r--include/JSystem/JGadget/linklist.h14
-rw-r--r--include/dol2asm.h2
-rw-r--r--include/dolphin/dsp.h4
-rw-r--r--include/dolphin/dvd/dvdlow.h2
-rw-r--r--include/dolphin/exi/EXIBios.h2
-rw-r--r--include/dolphin/gx.h2
-rw-r--r--include/dolphin/os.h18
-rw-r--r--include/dolphin/os/OSContext.h4
-rw-r--r--include/dolphin/os/OSLink.h7
-rw-r--r--include/dolphin/os/OSReset.h2
-rw-r--r--include/dolphin/os/OSThread.h4
-rw-r--r--include/dolphin/os/OSTime.h4
-rw-r--r--include/dolphin/si/SIBios.h2
-rw-r--r--include/dolphin/types.h8
-rw-r--r--include/dolphin/vi.h2
-rw-r--r--include/global.h2
16 files changed, 43 insertions, 36 deletions
diff --git a/include/JSystem/JGadget/linklist.h b/include/JSystem/JGadget/linklist.h
index bb334f57f9..70a15a1276 100644
--- a/include/JSystem/JGadget/linklist.h
+++ b/include/JSystem/JGadget/linklist.h
@@ -249,9 +249,9 @@ struct TLinkList_factory : public TLinkList<T, I> {
virtual T* Do_create() = 0;
virtual void Do_destroy(T*) = 0;
void Clear_destroy() {
- while (!empty()) {
- T* item = &front();
- pop_front();
+ while (!this->empty()) {
+ T* item = &this->front();
+ this->pop_front();
Do_destroy(item);
}
}
@@ -298,16 +298,16 @@ struct TEnumerator2 {
};
template <typename T, int I>
-struct TContainerEnumerator : public TEnumerator2<TLinkList<T, I>::iterator, T> {
+struct TContainerEnumerator : public TEnumerator2<typename TLinkList<T, I>::iterator, T> {
inline TContainerEnumerator(TLinkList<T, I>* param_0)
- : TEnumerator2<TLinkList<T, I>::iterator, T>(param_0->begin(), param_0->end()) {}
+ : TEnumerator2<typename TLinkList<T, I>::iterator, T>(param_0->begin(), param_0->end()) {}
};
template <typename T, int I>
-struct TContainerEnumerator_const : public TEnumerator2<TLinkList<T, I>::const_iterator, const T> {
+struct TContainerEnumerator_const : public TEnumerator2<typename TLinkList<T, I>::const_iterator, const T> {
inline TContainerEnumerator_const(const TLinkList<T, I>* param_0)
- : TEnumerator2<TLinkList<T, I>::const_iterator, const T>(param_0->begin(), param_0->end()) {}
+ : TEnumerator2<typename TLinkList<T, I>::const_iterator, const T>(param_0->begin(), param_0->end()) {}
};
}; // namespace JGadget
diff --git a/include/dol2asm.h b/include/dol2asm.h
index 86665c181d..3b28a7740e 100644
--- a/include/dol2asm.h
+++ b/include/dol2asm.h
@@ -2,7 +2,7 @@
#define DOL2ASM
// this helps remove useless error from the linter when using vscode.
-#ifndef IN_VSCODE_EDITOR
+#ifdef __MWERKS__
#ifdef __cplusplus
#define SECTION_INIT extern "C" __declspec(section ".init")
diff --git a/include/dolphin/dsp.h b/include/dolphin/dsp.h
index 7e676489b1..bf091c414c 100644
--- a/include/dolphin/dsp.h
+++ b/include/dolphin/dsp.h
@@ -8,8 +8,8 @@
extern "C" {
#endif
-volatile u16 __DSPRegs[32] : 0xCC005000;
-volatile u32 __AIRegs[8] : 0xCC006C00;
+volatile u16 __DSPRegs[32] AT_ADDRESS(0xCC005000);
+volatile u32 __AIRegs[8] AT_ADDRESS(0xCC006C00);
#define DSP_TASK_FLAG_CLEARALL 0x00000000
#define DSP_TASK_FLAG_ATTACHED 0x00000001
diff --git a/include/dolphin/dvd/dvdlow.h b/include/dolphin/dvd/dvdlow.h
index a7645d901c..1d70757805 100644
--- a/include/dolphin/dvd/dvdlow.h
+++ b/include/dolphin/dvd/dvdlow.h
@@ -4,6 +4,6 @@
#include "dolphin/types.h"
typedef void (*DVDLowCallback)(u32 intType);
-vu32 __DIRegs[16] : 0xCC006000;
+vu32 __DIRegs[16] AT_ADDRESS(0xCC006000);
#endif /* DVDLOW_H */
diff --git a/include/dolphin/exi/EXIBios.h b/include/dolphin/exi/EXIBios.h
index 00099f62b1..3e7178e275 100644
--- a/include/dolphin/exi/EXIBios.h
+++ b/include/dolphin/exi/EXIBios.h
@@ -9,7 +9,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
diff --git a/include/dolphin/gx.h b/include/dolphin/gx.h
index 12d80c77cb..8dc15f688e 100644
--- a/include/dolphin/gx.h
+++ b/include/dolphin/gx.h
@@ -58,7 +58,7 @@ typedef union {
} PPCWGPipe;
#define GXFIFO_ADDR 0xCC008000
-volatile PPCWGPipe GXWGFifo : GXFIFO_ADDR;
+volatile PPCWGPipe GXWGFifo AT_ADDRESS(GXFIFO_ADDR);
#define GX_WRITE_U8(data) GXWGFifo.u8 = data;
#define GX_WRITE_U32(data) GXWGFifo.u32 = data;
diff --git a/include/dolphin/os.h b/include/dolphin/os.h
index 4d20b105f0..dce02c47c3 100644
--- a/include/dolphin/os.h
+++ b/include/dolphin/os.h
@@ -65,19 +65,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);
diff --git a/include/dolphin/os/OSContext.h b/include/dolphin/os/OSContext.h
index 78562a353d..4137d90b2c 100644
--- a/include/dolphin/os/OSContext.h
+++ b/include/dolphin/os/OSContext.h
@@ -151,8 +151,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);
diff --git a/include/dolphin/os/OSLink.h b/include/dolphin/os/OSLink.h
index 55e63d5e2f..311cc0090f 100644
--- a/include/dolphin/os/OSLink.h
+++ b/include/dolphin/os/OSLink.h
@@ -1,6 +1,7 @@
#ifndef OSLINK_H
#define OSLINK_H
+#include "dolphin/types.h"
#ifdef __cplusplus
extern "C" {
@@ -18,14 +19,14 @@ typedef struct OSSectionInfo OSSectionInfo;
typedef struct OSImportInfo OSImportInfo;
typedef struct OSRel OSRel;
-OSModuleQueue __OSModuleList : 0x800030C8;
-void* __OSStringTable : 0x800030D0;
-
struct OSModuleQueue {
OSModuleInfo* head;
OSModuleInfo* tail;
};
+OSModuleQueue __OSModuleList AT_ADDRESS(0x800030C8);
+void* __OSStringTable AT_ADDRESS(0x800030D0);
+
struct OSModuleLink {
OSModuleInfo* next;
OSModuleInfo* prev;
diff --git a/include/dolphin/os/OSReset.h b/include/dolphin/os/OSReset.h
index 54678e53d2..754d517361 100644
--- a/include/dolphin/os/OSReset.h
+++ b/include/dolphin/os/OSReset.h
@@ -7,7 +7,7 @@
extern "C" {
#endif
-vu32 __PIRegs[12] : 0xCC003000;
+vu32 __PIRegs[12] AT_ADDRESS(0xCC003000);
#define OS_RESETCODE_RESTART 0x80000000
#define OS_RESETCODE_SYSTEM 0x40000000
diff --git a/include/dolphin/os/OSThread.h b/include/dolphin/os/OSThread.h
index 4b1b6cb72c..68061c6e83 100644
--- a/include/dolphin/os/OSThread.h
+++ b/include/dolphin/os/OSThread.h
@@ -75,8 +75,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);
diff --git a/include/dolphin/os/OSTime.h b/include/dolphin/os/OSTime.h
index c0df3585fa..3cd474bf30 100644
--- a/include/dolphin/os/OSTime.h
+++ b/include/dolphin/os/OSTime.h
@@ -10,7 +10,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 +32,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)
diff --git a/include/dolphin/si/SIBios.h b/include/dolphin/si/SIBios.h
index 1ea637b7fa..3e6c48acd9 100644
--- a/include/dolphin/si/SIBios.h
+++ b/include/dolphin/si/SIBios.h
@@ -120,7 +120,7 @@ BOOL SITransfer(s32 chan, void* output, u32 outputBytes, void* input, u32 inputB
u32 SIGetType(s32 chan);
u32 SIGetTypeAsync(s32 chan, SITypeAndStatusCallback callback);
-vu32 __SIRegs[64] : 0xCC006400;
+vu32 __SIRegs[64] AT_ADDRESS(0xCC006400);
#ifdef __cplusplus
}
diff --git a/include/dolphin/types.h b/include/dolphin/types.h
index b72532c118..dc06598ce5 100644
--- a/include/dolphin/types.h
+++ b/include/dolphin/types.h
@@ -42,4 +42,10 @@ typedef int BOOL;
#define FLOAT_MIN (1.175494351e-38f)
#define FLOAT_MAX (3.40282346638528860e+38f)
-#endif \ No newline at end of file
+#ifdef __MWERKS__
+#define AT_ADDRESS(xyz) : (xyz)
+#else
+#define AT_ADDRESS(xyz)
+#endif
+
+#endif
diff --git a/include/dolphin/vi.h b/include/dolphin/vi.h
index c30e6f3a55..9c7712e746 100644
--- a/include/dolphin/vi.h
+++ b/include/dolphin/vi.h
@@ -138,7 +138,7 @@ u32 VIGetRetraceCount();
u32 VIGetDTVStatus();
u32 VIGetTvFormat(void);
-vu16 __VIRegs[59] : 0xCC002000;
+vu16 __VIRegs[59] AT_ADDRESS(0xCC002000);
#ifdef __cplusplus
};
diff --git a/include/global.h b/include/global.h
index cab5763ef9..cc16a8a504 100644
--- a/include/global.h
+++ b/include/global.h
@@ -24,7 +24,7 @@
#define _SDA_BASE_(dummy) 0
#define _SDA2_BASE_(dummy) 0
-#ifndef IN_VSCODE_EDITOR
+#ifdef __MWERKS__
#define GLUE(a, b) a##b
#define GLUE2(a, b) GLUE(a, b)
#define STATIC_ASSERT(cond) typedef char GLUE2(static_assertion_failed, __LINE__)[(cond) ? 1 : -1]