2021-04-06 16:58:19 +02:00
|
|
|
#include "modpackSelector.h"
|
2022-02-04 15:05:17 +01:00
|
|
|
#include "utils/logger.h"
|
2022-04-22 17:37:16 +02:00
|
|
|
#include <content_redirection/redirection.h>
|
2021-04-06 16:58:19 +02:00
|
|
|
#include <coreinit/title.h>
|
2022-02-04 15:05:17 +01:00
|
|
|
#include <wups.h>
|
2021-04-06 16:58:19 +02:00
|
|
|
|
|
|
|
WUPS_PLUGIN_NAME("SDCafiine");
|
2022-04-22 17:37:16 +02:00
|
|
|
WUPS_PLUGIN_DESCRIPTION("SDCafiine");
|
2021-04-06 16:58:19 +02:00
|
|
|
WUPS_PLUGIN_VERSION("0.1");
|
|
|
|
WUPS_PLUGIN_AUTHOR("Maschell");
|
|
|
|
WUPS_PLUGIN_LICENSE("GPL");
|
|
|
|
|
2021-10-02 11:43:15 +02:00
|
|
|
WUPS_USE_WUT_DEVOPTAB();
|
2021-04-06 16:58:19 +02:00
|
|
|
|
2022-04-22 17:37:16 +02:00
|
|
|
CRLayerHandle contentLayerHandle __attribute__((section(".data"))) = 0;
|
|
|
|
|
|
|
|
INITIALIZE_PLUGIN() {
|
|
|
|
// But then use libcontentredirection instead.
|
|
|
|
ContentRedirectionStatus error;
|
2022-09-18 00:29:12 +02:00
|
|
|
if ((error = ContentRedirection_InitLibrary()) != CONTENT_REDIRECTION_RESULT_SUCCESS) {
|
2022-04-22 17:37:16 +02:00
|
|
|
DEBUG_FUNCTION_LINE_ERR("Failed to init ContentRedirection. Error %d", error);
|
|
|
|
OSFatal("Failed to init ContentRedirection.");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-04-06 16:58:19 +02:00
|
|
|
/* Entry point */
|
|
|
|
ON_APPLICATION_START() {
|
2022-01-30 20:47:29 +01:00
|
|
|
initLogging();
|
2021-04-06 16:58:19 +02:00
|
|
|
HandleMultiModPacks(OSGetTitleID());
|
2022-01-30 20:47:29 +01:00
|
|
|
}
|
2022-04-22 17:37:16 +02:00
|
|
|
|
2022-02-04 15:05:17 +01:00
|
|
|
ON_APPLICATION_ENDS() {
|
2022-04-22 17:37:16 +02:00
|
|
|
if (contentLayerHandle != 0) {
|
|
|
|
ContentRedirection_RemoveFSLayer(contentLayerHandle);
|
|
|
|
contentLayerHandle = 0;
|
|
|
|
}
|
2022-01-30 20:47:29 +01:00
|
|
|
deinitLogging();
|
2021-04-06 16:58:19 +02:00
|
|
|
}
|