1 parent
544fcaf038
commit
c9533d18ff
3 files changed
+14
-1
No files matched your search
+11
@@ -0,0 +1,11 @@
|
||||
// Detect if the emux emulator extension is supported
|
||||
// https://hackmd.io/@rasky/r1k7na6Jn
|
||||
|
||||
.include "macros.inc"
|
||||
.section .text, "ax"
|
||||
.set noreorder
|
||||
|
||||
glabel emux_detect
|
||||
or $v0, $0, $0
|
||||
jr $ra
|
||||
tne $v0, $v0, 0x0
|
||||
@@ -160,6 +160,7 @@ SECTIONS
|
||||
#ifdef EEP
|
||||
KEEP(BUILD_DIR/asm/vc_bin.o(.text*));
|
||||
#endif
|
||||
KEEP(BUILD_DIR/asm/emux.o(.text*));
|
||||
KEEP(BUILD_DIR/asm/pj64_get_count_factor_asm.o(.text*));
|
||||
KEEP(BUILD_DIR/asm/round.o(.text*));
|
||||
KEEP(BUILD_DIR/asm/fcr31.o(.text*));
|
||||
|
||||
+2
-1
@@ -22,6 +22,7 @@ extern void __osPiRelAccess(void);
|
||||
enum Emulator gEmulator = EMU_CONSOLE;
|
||||
|
||||
u32 pj64_get_count_factor_asm(void); // defined in asm/pj64_get_count_factor_asm.s
|
||||
u32 emux_detect(void); // defined in asm/emux.s
|
||||
|
||||
static inline u32 check_count_factor() {
|
||||
const u32 saved = __osDisableInt();
|
||||
@@ -86,7 +87,7 @@ static u8 check_cache_emulation() {
|
||||
|
||||
void detect_emulator() {
|
||||
if ((u32)IO_READ(DPC_PIPEBUSY_REG) | (u32)IO_READ(DPC_TMEM_REG) | (u32)IO_READ(DPC_BUFBUSY_REG)) {
|
||||
gEmulator = EMU_CONSOLE;
|
||||
gEmulator = emux_detect() ? EMU_ARES : EMU_CONSOLE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user