mirror of
https://github.com/libretro/RetroArch
synced 2025-01-18 13:23:40 +00:00
Replace hokey "hooks" struct with weak symbol annotations
- Did a test build to ensure RA built - Copied over to my FTPservU sources and ensured no compile issues there Looks solid. A lot cleaner, too. @aliaspider
This commit is contained in:
parent
f22c337cfc
commit
8b87a53366
@ -49,7 +49,6 @@
|
||||
#include "../../retroarch.h"
|
||||
#include "../../gfx/video_driver.h"
|
||||
|
||||
#include "wiiu_main.h"
|
||||
#include "hbl.h"
|
||||
#include "wiiu_dbg.h"
|
||||
#include "system/exception_handler.h"
|
||||
@ -68,10 +67,6 @@
|
||||
* The Wii U frontend driver, along with the main() method.
|
||||
*/
|
||||
|
||||
/* TODO: If we want greater control over which filesystems get mounted,
|
||||
* implement callbacks and assign them below. */
|
||||
hooks_t hooks = { NULL, NULL };
|
||||
|
||||
static enum frontend_fork wiiu_fork_mode = FRONTEND_FORK_NONE;
|
||||
static const char *elf_path_cst = WIIU_SD_PATH "retroarch/retroarch.elf";
|
||||
|
||||
|
46
wiiu/main.c
46
wiiu/main.c
@ -188,36 +188,36 @@ static void try_shutdown_iosuhax(void)
|
||||
iosuhaxMount = false;
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void mount_filesystems(void)
|
||||
{
|
||||
if(iosuhaxMount)
|
||||
fatInitDefault();
|
||||
else
|
||||
mount_sd_fat("sd");
|
||||
}
|
||||
|
||||
__attribute__((weak))
|
||||
void unmount_filesystems(void)
|
||||
{
|
||||
if (iosuhaxMount)
|
||||
{
|
||||
fatUnmount("sd:");
|
||||
fatUnmount("usb:");
|
||||
}
|
||||
else
|
||||
unmount_sd_fat("sd");
|
||||
}
|
||||
|
||||
static void fsdev_init(void)
|
||||
{
|
||||
iosuhaxMount = try_init_iosuhax();
|
||||
|
||||
if(hooks.fs_mount != NULL && hooks.fs_unmount != NULL)
|
||||
hooks.fs_mount();
|
||||
else
|
||||
{
|
||||
if(iosuhaxMount)
|
||||
fatInitDefault();
|
||||
else
|
||||
mount_sd_fat("sd");
|
||||
}
|
||||
mount_filesystems();
|
||||
}
|
||||
|
||||
static void fsdev_exit(void)
|
||||
{
|
||||
if(hooks.fs_mount != NULL && hooks.fs_unmount != NULL)
|
||||
|
||||
hooks.fs_unmount();
|
||||
else
|
||||
{
|
||||
if (iosuhaxMount)
|
||||
{
|
||||
fatUnmount("sd:");
|
||||
fatUnmount("usb:");
|
||||
}
|
||||
else
|
||||
unmount_sd_fat("sd");
|
||||
}
|
||||
|
||||
unmount_filesystems();
|
||||
try_shutdown_iosuhax();
|
||||
}
|
||||
|
@ -3,14 +3,8 @@
|
||||
|
||||
#include "wiiu/types.h"
|
||||
|
||||
struct main_hooks {
|
||||
void (*fs_mount)(void);
|
||||
void (*fs_unmount)(void);
|
||||
};
|
||||
|
||||
typedef struct main_hooks hooks_t;
|
||||
|
||||
extern hooks_t hooks;
|
||||
void mount_filesystems(void);
|
||||
void unmount_filesystems(void);
|
||||
extern bool iosuhaxMount;
|
||||
|
||||
#endif /* _MAIN_H */
|
||||
|
Loading…
Reference in New Issue
Block a user