This repository has been archived by the owner on Jun 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Comply with the new CafeLoader version
- Loading branch information
1 parent
bac9242
commit a0eff5e
Showing
3 changed files
with
12 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,6 @@ files/project.ld | |
files/project.gpj | ||
files/Out/* | ||
OutProj/* | ||
*.elf | ||
*.rpx | ||
*.ti |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#pragma once | ||
#ifndef Cemu | ||
#define log_printf(FMT, ARGS...) ((void (*)(const char *format, ...))(*(unsigned int *)(DATA_ADDR + 0x20000)))(FMT, ## ARGS); | ||
#define log_printf(FMT, ARGS...) ((void (*)(const char *format, ...))(*(unsigned int *)(DATA_ADDR - 4)))(FMT, ## ARGS); | ||
#else | ||
#define log_printf(x, ...) | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,14 @@ | ||
typedef void (*InitFunc)(); | ||
extern InitFunc _ctors[]; | ||
|
||
extern "C" { | ||
void callCtors() { | ||
unsigned int *ctors; | ||
|
||
#ifdef Cemu | ||
ctors = (unsigned int *)(*(unsigned int *)(DATA_ADDR - 4)); | ||
#else | ||
ctors = (unsigned int *)(DATA_ADDR + 0x20004); | ||
#endif | ||
static bool initialized = false; | ||
if (initialized) | ||
return; | ||
|
||
unsigned int count = ctors[0]; | ||
for (int i = 0; i < count; i++) { | ||
((void (*)())(ctors[i + 1]))(); | ||
} | ||
initialized = true; | ||
for (int i = 0; _ctors[i]; i++) | ||
(*_ctors[i])(); | ||
} | ||
} |