Add libpl submodule (#753)

* Add libpl submodule

* Clone libpl submodule automatically while building (if enabled)
This commit is contained in:
Gregory Heskett
2024-02-02 22:08:34 -05:00
committed by GitHub
parent 5064fcfb69
commit b9ba17a4d6
7 changed files with 54 additions and 1 deletions

View File

@@ -9,7 +9,10 @@
#include <string.h>
#include "emutest_vc.h"
#include "float.h"
#include "types.h"
#ifdef LIBPL
#include "lib/libpl/libpl-emu.h"
#endif
extern OSMesgQueue gSIEventMesgQueue;
extern u8 __osContPifRam[];
@@ -20,6 +23,7 @@ extern void __osPiGetAccess(void);
extern void __osPiRelAccess(void);
enum Emulator gEmulator = EMU_CONSOLE;
u8 gSupportsLibpl = FALSE;
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
@@ -140,6 +144,9 @@ void detect_emulator() {
if (magic == 0x00500000u) {
// libpl is supported. Must be ParallelN64
gEmulator = EMU_PARALLELN64;
#ifdef LIBPL
gSupportsLibpl = libpl_is_supported(LPL_ABI_VERSION_CURRENT);
#endif
return;
}

View File

@@ -1,6 +1,8 @@
#ifndef EMUTEST_H
#define EMUTEST_H
#include "types.h"
enum Emulator {
EMU_WIIVC = 0x0001,
EMU_PROJECT64_ANY = 0x001E,
@@ -37,6 +39,9 @@ extern void detect_emulator();
*/
extern enum Emulator gEmulator;
// determines whether libpl is safe to use
extern u8 gSupportsLibpl;
// Included for backwards compatibility when upgrading from HackerSM64 2.0
#define gIsConsole ((gEmulator & EMU_CONSOLE) != 0)