You've already forked HackerSM64
mirror of
https://github.com/HackerN64/HackerSM64.git
synced 2026-01-21 10:35:32 -08:00
11
asm/emux.s
Normal file
11
asm/emux.s
Normal file
@@ -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
|
||||
1
sm64.ld
1
sm64.ld
@@ -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*));
|
||||
|
||||
@@ -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