diff --git a/config/GMPE01_00/rels/safDll/symbols.txt b/config/GMPE01_00/rels/safDll/symbols.txt index 11ae3d8d..44b3c3c7 100644 --- a/config/GMPE01_00/rels/safDll/symbols.txt +++ b/config/GMPE01_00/rels/safDll/symbols.txt @@ -1,13 +1,15 @@ fn_1_0 = .text:0x00000000; // type:function size:0x4 -fn_1_4 = .text:0x00000004; // type:function size:0x284 -fn_1_288 = .text:0x00000288; // type:function size:0x124 +safMarioEyeDim = .text:0x00000004; // type:function size:0x284 +safSaveTest = .text:0x00000288; // type:function size:0x124 _ctors = .ctors:0x00000000; // type:label scope:global _dtors = .dtors:0x00000000; // type:label scope:global -lbl_1_rodata_10 = .rodata:0x00000010; // type:object size:0x4 data:float -lbl_1_rodata_14 = .rodata:0x00000014; // type:object size:0x4 data:float -lbl_1_rodata_18 = .rodata:0x00000018; // type:object size:0x8 data:double -lbl_1_rodata_20 = .rodata:0x00000020; // type:object size:0x4 data:float -lbl_1_data_4 = .data:0x00000004; // type:object size:0xE data:string -lbl_1_data_12 = .data:0x00000012; // type:object size:0xB data:string -lbl_1_data_1D = .data:0x0000001D; // type:object size:0xE data:string -lbl_1_data_2B = .data:0x0000002B; // type:object size:0xE data:string +lbl_1_rodata_10 = .rodata:0x00000010; // type:object size:0x4 scope:local data:float +lbl_1_rodata_14 = .rodata:0x00000014; // type:object size:0x4 scope:local data:float +lbl_1_rodata_18 = .rodata:0x00000018; // type:object size:0x8 scope:local data:double +lbl_1_rodata_20 = .rodata:0x00000020; // type:object size:0x4 scope:local data:float +lbl_1_data_0 = .data:0x00000000; // type:object size:0x4 +lbl_1_data_4 = .data:0x00000004; // type:object size:0xE scope:local data:string +lbl_1_data_12 = .data:0x00000012; // type:object size:0xB scope:local data:string +lbl_1_data_1D = .data:0x0000001D; // type:object size:0xE scope:local data:string +lbl_1_data_2B = .data:0x0000002B; // type:object size:0xE scope:local data:string +lbl_1_bss_0 = .bss:0x00000000; // type:object size:0x300 diff --git a/configure.py b/configure.py index dc40d895..4246d6ed 100644 --- a/configure.py +++ b/configure.py @@ -1000,7 +1000,7 @@ config.libs = [ ), Rel('safDll', objects = { - Object(NonMatching, "REL/safDll/main.c"), + Object(Matching, "REL/safDll/main.c"), } ), Rel('selmenuDll', diff --git a/src/REL/bootDll/main.c b/src/REL/bootDll/main.c index 4741b7ba..2282e16c 100644 --- a/src/REL/bootDll/main.c +++ b/src/REL/bootDll/main.c @@ -46,8 +46,6 @@ static BOOL TitleProc(void); void *logoReadNintendo(void); -#define M_PI 3.141592653589793 - void ModuleProlog(void) { omOvlHisData *history; diff --git a/src/REL/safDll/main.c b/src/REL/safDll/main.c index 860ad928..6b58f683 100644 --- a/src/REL/safDll/main.c +++ b/src/REL/safDll/main.c @@ -1,12 +1,63 @@ -#include "common.h" -#include "REL/executor.h" +#include "dolphin.h" +#include "game/hsfman.h" +#include "game/gamework_data.h" +#include "game/printfunc.h" +#include "game/pad.h" +#include "rel_sqrt_consts.h" -void fn_1_0(void) { +s32 lbl_1_data_0 = 100; +s32 lbl_1_bss_0[192]; + +void fn_1_0(void) +{ } -//fn_1_4 -// https://decomp.me/scratch/Ii0sV +void safMarioEyeDim(s16 id) +{ + ModelData *model = &Hu3DData[id]; + HsfData *hsf = model->hsfData; + HsfMaterial *material = hsf->material; + s16 i, j; + for(i=0; imaterialCnt; i++, material++) { + for(j=0; jnumAttrs; j++) { + HsfAttribute *attr = &hsf->attribute[material->attrs[j]]; + if(strcmp(attr->bitmap->name, "s3c000m1_eyes") == 0 || strcmp(attr->bitmap->name, "mario_eyes") == 0) { + break; + } + } + if(j == material->numAttrs) { + material->color[0] *= 0.6f; + material->color[1] *= 0.3f; + material->color[2] *= 0.3f; + material->litColor[0] *= 0.6f; + material->litColor[1] *= 0.3f; + material->litColor[2] *= 0.3f; + } + } +} -// fn_1_288 -// https://decomp.me/scratch/VQ3CT \ No newline at end of file +void safSaveTest(void) +{ + OSTick time_write; + OSTick time_read; + s16 character = GWPlayerCfg[0].character; + SLLoad(); + time_write = time_read = 0; + while(1) { + print8(16, 420, 1.5f, "READ TIME %d", OSTicksToMilliseconds(time_read)); + print8(16, 430, 1.5f, "WRITE TIME %d", OSTicksToMilliseconds(time_write)); + HuPrcVSleep(); + if(HuPadBtnDown[0] & PAD_BUTTON_Y) { + HuAudCharVoicePlayEntry(character, 282); + time_write = OSGetTick(); + SLSave(); + time_write = OSGetTick()-time_write; + } + if(HuPadBtnDown[0] & PAD_BUTTON_X) { + time_read = OSGetTick(); + SLLoad(); + time_read = OSGetTick()-time_read; + } + } +} \ No newline at end of file