-
Notifications
You must be signed in to change notification settings - Fork 44
100% Match / Linked Dolphin SDK #736
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,86 @@ | ||
| #ifndef DOL2ASM | ||
| #define DOL2ASM | ||
|
|
||
| #ifdef __MWERKS__ | ||
|
|
||
| #ifdef __cplusplus | ||
| #define SECTION_INIT extern "C" __declspec(section ".init") | ||
| #define SECTION_RODATA __declspec(section ".rodata") | ||
| #define SECTION_DATA __declspec(section ".data") | ||
| #define SECTION_SDATA __declspec(section ".sdata") | ||
| #define SECTION_SDATA2 __declspec(section ".sdata2") | ||
| #define SECTION_BSS __declspec(section ".data") | ||
| #define SECTION_SBSS __declspec(section ".sdata") | ||
| #define SECTION_SBSS2 __declspec(section ".sdata2") | ||
| #define SECTION_CTORS extern "C" __declspec(section ".ctors") | ||
| #define SECTION_DTORS extern "C" __declspec(section ".dtors") | ||
| #define SECTION_EXTAB extern "C" __declspec(section "extab_") | ||
| #define SECTION_EXTABINDEX extern "C" __declspec(section "extabindex_") | ||
| #define SECTION_DEAD extern "C" __declspec(section ".dead") | ||
| #define SECTION_CTORS10 __declspec(section ".ctors$10") | ||
| #define SECTION_CTORS15 __declspec(section ".ctors$15") | ||
| #define SECTION_DTORS10 __declspec(section ".dtors$10") | ||
| #define SECTION_DTORS15 __declspec(section ".dtors$15") | ||
| #define COMPILER_STRIP_GATE(NAME, VALUE) SECTION_DEAD void* const cg_##NAME = (void*)(VALUE) | ||
| #define REGISTER_CTORS(ADDR, FUNCTION) SECTION_CTORS void* const _ctors_##ADDR = (void*)(FUNCTION); | ||
| #else | ||
| #define SECTION_INIT __declspec(section ".init") | ||
| #define SECTION_RODATA __declspec(section ".rodata") | ||
| #define SECTION_DATA __declspec(section ".data") | ||
| #define SECTION_SDATA __declspec(section ".sdata") | ||
| #define SECTION_SDATA2 __declspec(section ".sdata2") | ||
| #define SECTION_BSS __declspec(section ".data") | ||
| #define SECTION_SBSS __declspec(section ".sdata") | ||
| #define SECTION_SBSS2 __declspec(section ".sdata2") | ||
| #define SECTION_CTORS __declspec(section ".ctors") | ||
| #define SECTION_DTORS __declspec(section ".dtors") | ||
| #define SECTION_EXTAB __declspec(section "extab_") | ||
| #define SECTION_EXTABINDEX __declspec(section "extabindex_") | ||
| #define SECTION_DEAD __declspec(section ".dead") | ||
| #define SECTION_CTORS10 __declspec(section ".ctors$10") | ||
| #define SECTION_CTORS15 __declspec(section ".ctors$15") | ||
| #define SECTION_DTORS10 __declspec(section ".dtors$10") | ||
| #define SECTION_DTORS15 __declspec(section ".dtors$15") | ||
| #define COMPILER_STRIP_GATE(NAME, VALUE) SECTION_DEAD void* const cg_##NAME = (void*)(VALUE) | ||
| #define REGISTER_CTORS(ADDR, FUNCTION) SECTION_CTORS void* const _ctors_##ADDR = (void*)(FUNCTION); | ||
| #endif | ||
|
|
||
| #else | ||
| #define SECTION_INIT | ||
| #define SECTION_RODATA | ||
| #define SECTION_DATA | ||
| #define SECTION_SDATA | ||
| #define SECTION_SDATA2 | ||
| #define SECTION_BSS | ||
| #define SECTION_SBSS | ||
| #define SECTION_SBSS2 | ||
| #define SECTION_CTORS | ||
| #define SECTION_DTORS | ||
| #define SECTION_EXTAB | ||
| #define SECTION_EXTABINDEX | ||
| #define SECTION_DEAD | ||
| #define SECTION_CTORS10 | ||
| #define SECTION_CTORS15 | ||
| #define SECTION_DTORS10 | ||
| #define SECTION_DTORS15 | ||
| #define COMPILER_STRIP_GATE(...) | ||
| #define REGISTER_CTORS(...) | ||
|
|
||
| #define asm | ||
| #define nofralloc | ||
| #endif | ||
|
|
||
| #define _HUGE_ENUF 1e+300 | ||
| #define INFINITY ((float)(_HUGE_ENUF * _HUGE_ENUF)) | ||
| #define HUGE_VAL ((double)INFINITY) | ||
| #define HUGE_VALL ((long double)INFINITY) | ||
|
|
||
| #define DOUBLE_INF HUGE_VAL | ||
|
|
||
| #pragma section ".dead" | ||
| #pragma section ".ctors$10" | ||
| #pragma section ".ctors$15" | ||
| #pragma section ".dtors$10" | ||
| #pragma section ".dtors$15" | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| #ifndef _DOLPHIN_PPCARCH_WRAPPER_H | ||
| #define _DOLPHIN_PPCARCH_WRAPPER_H | ||
|
|
||
| #include <dolphin/base/PPCArch.h> | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #ifndef _DOLPHIN_H_ | ||
| #define _DOLPHIN_H_ | ||
|
|
||
| #include <dolphin/types.h> | ||
| #include <dolphin/os.h> | ||
| #include <dolphin/dsp.h> | ||
| #include <dolphin/dvd.h> | ||
| #include <dolphin/gx.h> | ||
| #include <dolphin/hio.h> | ||
| #include <dolphin/mtx.h> | ||
| #include <dolphin/vi.h> | ||
| #include <dolphin/card.h> | ||
| #include <dolphin/perf.h> | ||
| #include <dolphin/ar.h> | ||
| #include <dolphin/PPCArch.h> | ||
| #include <dolphin/db.h> | ||
| #include <dolphin/pad.h> | ||
| #include <dolphin/dtk.h> | ||
| #include <dolphin/ai.h> | ||
| #include <dolphin/demo.h> | ||
| #include <dolphin/exi.h> | ||
| #include <dolphin/si.h> | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #ifndef _DOLPHIN_OS___PPC_EABI_INIT_H | ||
| #define _DOLPHIN_OS___PPC_EABI_INIT_H | ||
|
|
||
| #ifdef __cplusplus | ||
| extern "C" { | ||
| #endif | ||
|
|
||
| __declspec(section ".init") extern void __init_hardware(void); | ||
| __declspec(section ".init") extern void __flush_cache(register void* address, register unsigned int size); | ||
|
|
||
| #ifdef __cplusplus | ||
| } | ||
| #endif | ||
|
|
||
| #endif |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ extern OSTime __OSGetSystemTime(); | |
| static const char* __OSVersion = | ||
| "<< Dolphin SDK - OS\trelease build: Apr 17 2003 12:33:06 (0x2301) >>"; | ||
| // needs to be "<< Dolphin SDK - DSP\trelease build: Apr 17 2003 12:34:16 (0x2301) >>"? | ||
| extern char _db_stack_end[]; | ||
| extern char _db_stack_end[] AT_ADDRESS(0x803D8A50); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address should not be hardcoded. It gets pulled from the linker script. |
||
|
|
||
| #define OS_BI2_DEBUG_ADDRESS 0x800000F4 | ||
| #define DEBUGFLAG_ADDR 0x800030E8 | ||
|
|
@@ -32,8 +32,8 @@ static __OSExceptionHandler* OSExceptionTable; | |
| OSTime __OSStartTime; | ||
| BOOL __OSInIPL; | ||
|
|
||
| extern u8 __ArenaHi[]; | ||
| extern u8 __ArenaLo[]; | ||
| extern u8 __ArenaHi[] AT_ADDRESS(0x81800000); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address should not be hardcoded. It gets pulled from the linker script. |
||
| extern u8 __ArenaLo[] AT_ADDRESS(0x803D9A60); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address should not be hardcoded. It gets pulled from the linker script. |
||
| extern u32 __DVDLongFileNameFlag; | ||
| extern u32 __PADSpec; | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,7 +20,7 @@ static void DefaultSwitchThreadCallback(OSThread* from, OSThread* to) | |
| { | ||
| } | ||
|
|
||
| extern u8 _stack_addr[]; | ||
| extern u8 _stack_addr[] AT_ADDRESS(0x803D8A50); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Address should not be hardcoded. It gets pulled from the linker script. |
||
| extern u8 _stack_end[]; | ||
|
|
||
| #define AddTail(queue, thread, link) \ | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this needed?
Using __declspec regularly is perfectly fine for us.