diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index ec6605db..bfe0bb47 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -135,13 +135,13 @@ _bss_init_info = .init:0x800066FC; // type:object size:0x20 scope:global data:4b @eti_80006BD8 = extabindex:0x80006BD8; // type:object size:0xC scope:local hidden @eti_80006BE4 = extabindex:0x80006BE4; // type:object size:0xC scope:local hidden _eti_init_info = extabindex:0x80006BF0; // type:object size:0x20 scope:global -fn_80006C20__Fv = .text:0x80006C20; // type:function size:0x4 +unknownStub__4dLibFv = .text:0x80006C20; // type:function size:0x4 strequals = .text:0x80006C30; // type:function size:0x90 findSMA2 = .text:0x80006CC0; // type:function size:0x10 findSMA3 = .text:0x80006CD0; // type:function size:0x10 -fn_80006CE0__FiPPc = .text:0x80006CE0; // type:function size:0x80 -fn_80006D60__Fv = .text:0x80006D60; // type:function size:0x60 -fn_80006DC0__Fv = .text:0x80006DC0; // type:function size:0x48 +initialize__4MplsFiPPc = .text:0x80006CE0; // type:function size:0x80 +tryLaunchMovie__4MplsFv = .text:0x80006D60; // type:function size:0x60 +forceLaunchMovie__4MplsFv = .text:0x80006DC0; // type:function size:0x48 fn_80006E10 = .text:0x80006E10; // type:function size:0x3C fn_80006E50 = .text:0x80006E50; // type:function size:0x58 printGameInfo__Fv = .text:0x80006EB0; // type:function size:0xBC scope:local @@ -42061,9 +42061,9 @@ __float_huge = .sdata:0x80574F8C; // type:object size:0x4 align:4 data:float __double_huge = .sdata:0x80574F90; // type:object size:0x8 align:8 data:double lbl_80574FA0 = .sbss:0x80574FA0; // type:object size:0x4 data:4byte lbl_80574FA4 = .sbss:0x80574FA4; // type:object size:0x4 data:4byte -lbl_80574FA8 = .sbss:0x80574FA8; // type:object size:0x1 data:byte -lbl_80574FA9 = .sbss:0x80574FA9; // type:object size:0x1 data:byte -lbl_80574FAA = .sbss:0x80574FAA; // type:object size:0x1 data:byte +sMplsInitialized = .sbss:0x80574FA8; // type:object size:0x1 data:byte +sSkipMplsMovie = .sbss:0x80574FA9; // type:object size:0x1 data:byte +sIsNormalMode = .sbss:0x80574FAA; // type:object size:0x1 data:byte sButtonSequencePtr = .sbss:0x80574FB0; // type:object size:0x4 scope:local data:4byte sAsserted = .sbss:0x80574FB4; // type:object size:0x1 scope:local data:byte @GUARD@exceptionCreate__FPQ23EGG4Heap@mapFile = .sbss:0x80574FB5; // type:object size:0x1 scope:local data:byte diff --git a/include/toBeSorted/d_lib.h b/include/toBeSorted/d_lib.h index 0a4787ca..b9f7c26d 100644 --- a/include/toBeSorted/d_lib.h +++ b/include/toBeSorted/d_lib.h @@ -1,6 +1,11 @@ #ifndef D_LIB_H #define D_LIB_H -void fn_80006C20(); +namespace dLib { + +void unknownStub(); +bool strequals(const char *str1, const char *str2); + +}; // namespace dLib #endif // D_LIB_H diff --git a/include/toBeSorted/mpls.h b/include/toBeSorted/mpls.h index c7820a31..71283297 100644 --- a/include/toBeSorted/mpls.h +++ b/include/toBeSorted/mpls.h @@ -1,8 +1,12 @@ #ifndef MPLS_H #define MPLS_H -void fn_80006CE0(int, char **); -void fn_80006D60(); -void fn_80006DC0(); +namespace Mpls { + +void initialize(int argc, char **argv); +void tryLaunchMovie(); +void forceLaunchMovie(); + +}; // namespace Mpls #endif // MPLS_H diff --git a/src/d/d_main.cpp b/src/d/d_main.cpp index a2092237..91d88f42 100644 --- a/src/d/d_main.cpp +++ b/src/d/d_main.cpp @@ -58,11 +58,12 @@ static OSThread MAIN_THREAD; void main(int argc, char **argv) { u8 pStackBase[STACK_SIZE] __attribute__((aligned(32))); - fn_80006C20(); + dLib::unknownStub(); dMain::g_InitialTime = OSGetTime(); dSystem::fixHeaps(); - fn_80006CE0(argc, argv); - fn_80006D60(); + + Mpls::initialize(argc, argv); + Mpls::tryLaunchMovie(); OSThread *curThread = OSGetCurrentThread(); OSPriority curPrio = OSGetThreadPriority(curThread); diff --git a/src/toBeSorted/d_lib.cpp b/src/toBeSorted/d_lib.cpp new file mode 100644 index 00000000..9c374a13 --- /dev/null +++ b/src/toBeSorted/d_lib.cpp @@ -0,0 +1,16 @@ +#include "toBeSorted/d_lib.h" + +#include + +void dLib::unknownStub() {} + +bool dLib::strequals(const char *lhs, const char *rhs) { + if (!rhs) { + return false; + } + + size_t lhs_len = strlen(lhs); + size_t rhs_len = strlen(rhs); + + return (lhs_len == rhs_len) && strncmp(lhs, rhs, lhs_len) == 0; +} diff --git a/src/toBeSorted/mpls.cpp b/src/toBeSorted/mpls.cpp index e5ae1804..20c23e1c 100644 --- a/src/toBeSorted/mpls.cpp +++ b/src/toBeSorted/mpls.cpp @@ -7,31 +7,31 @@ #include -bool lbl_80574FA8; -bool lbl_80574FA9; -bool lbl_80574FAA; +bool sMplsInitialized; +bool sSkipMplsMovie; +bool sIsNormalMode; -void fn_80006CE0(int argc, char **argv) { +void Mpls::initialize(int argc, char **argv) { if (argc == 2) { if (strcmp("MPLS_FIRST", argv[1]) == 0) { - lbl_80574FA9 = true; + sSkipMplsMovie = true; } else if (strcmp("MPLS_NORMAL", argv[1]) == 0) { - lbl_80574FA9 = true; - lbl_80574FAA = true; + sSkipMplsMovie = true; + sIsNormalMode = true; } } - lbl_80574FA8 = true; + sMplsInitialized = true; } -void fn_80006D60() { - if (!lbl_80574FA9 && !SCGetMplsMoviePlay()) { +void Mpls::tryLaunchMovie() { + if (!sSkipMplsMovie && !SCGetMplsMoviePlay()) { OSExecl("/sys/mpls_movie/player.dol", "", "", "ASPECT_RATIO_AUTO", "DEFAULT", nullptr); sAssert::assert(); } } -void fn_80006DC0() { +void Mpls::forceLaunchMovie() { OSExecl("/sys/mpls_movie/player.dol", "", "", "ASPECT_RATIO_AUTO", "FORCE_MENU", nullptr); sAssert::assert(); }