Skip to content

Instantly share code, notes, and snippets.

@Lusamine
Created July 24, 2022 18:19
Show Gist options
  • Save Lusamine/02266079fd16fab0544b9cb3f5d3e1d1 to your computer and use it in GitHub Desktop.
Save Lusamine/02266079fd16fab0544b9cb3f5d3e1d1 to your computer and use it in GitHub Desktop.
int32_t __fastcall GameManager__get_currentPeriodOfDay(const MethodInfo *method)
{
float elapsedTimeOfDay; // s0
const MethodInfo *v3; // x0
if ( (byte_7104ED3C2B & 1) == 0 )
{
sub_710009AD20(20299LL);
byte_7104ED3C2B = 1;
}
if ( (GameManager_TypeInfo->_2.bitflags2 & 2) == 0 || GameManager_TypeInfo->_2.cctor_finished )
{
elapsedTimeOfDay = GameManager__get_elapsedTimeOfDay((const MethodInfo *)GameManager_TypeInfo);
if ( elapsedTimeOfDay >= 2.0 )
goto LABEL_6;
return 3;
}
v3 = (const MethodInfo *)sub_710009AE30((__int64)GameManager_TypeInfo);
elapsedTimeOfDay = GameManager__get_elapsedTimeOfDay(v3);
if ( elapsedTimeOfDay < 2.0 )
return 3;
LABEL_6:
if ( elapsedTimeOfDay < 4.0 )
return 4;
if ( elapsedTimeOfDay < 10.0 )
return 0;
if ( elapsedTimeOfDay < 17.0 )
return 1;
if ( elapsedTimeOfDay < 20.0 )
return 2;
return 3;
}
-----
.text.1:0000007101E09E30 ; int32_t __fastcall GameManager__get_currentPeriodOfDay(const MethodInfo *method)
.text.1:0000007101E09E30 GameManager$$get_currentPeriodOfDay ; CODE XREF: Dpr.EvScript.EvDataManager$$EvCmdGetTimeZone+6C↑p
.text.1:0000007101E09E30 ; FieldManager$$GetMapBgmState+50↑p ...
.text.1:0000007101E09E30
.text.1:0000007101E09E30 var_10 = -0x10
.text.1:0000007101E09E30 var_s0 = 0
.text.1:0000007101E09E30
.text.1:0000007101E09E30 STR X19, [SP,#-0x10+var_10]!
.text.1:0000007101E09E34 STP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09E38 ADD X29, SP, #0x10
.text.1:0000007101E09E3C ADRP X19, #byte_7104ED3C2B@PAGE
.text.1:0000007101E09E40 LDRB W8, [X19,#byte_7104ED3C2B@PAGEOFF]
.text.1:0000007101E09E44 TBNZ W8, #0, loc_7101E09E60
.text.1:0000007101E09E48 ADRP X8, #off_7104BB6E00@PAGE
.text.1:0000007101E09E4C LDR X8, [X8,#off_7104BB6E00@PAGEOFF]
.text.1:0000007101E09E50 LDR W0, [X8]
.text.1:0000007101E09E54 BL sub_710009AD20
.text.1:0000007101E09E58 MOV W8, #1
.text.1:0000007101E09E5C STRB W8, [X19,#byte_7104ED3C2B@PAGEOFF]
.text.1:0000007101E09E60
.text.1:0000007101E09E60 loc_7101E09E60 ; CODE XREF: GameManager$$get_currentPeriodOfDay+14↑j
.text.1:0000007101E09E60 ADRP X8, #off_7104B98EB0@PAGE
.text.1:0000007101E09E64 LDR X8, [X8,#off_7104B98EB0@PAGEOFF]
.text.1:0000007101E09E68 LDR X0, [X8] ; method
.text.1:0000007101E09E6C LDRB W8, [X0,#0x12F]
.text.1:0000007101E09E70 TBZ W8, #1, loc_7101E09E7C
.text.1:0000007101E09E74 LDR W8, [X0,#0xE0]
.text.1:0000007101E09E78 CBZ W8, loc_7101E09EE0
.text.1:0000007101E09E7C
.text.1:0000007101E09E7C loc_7101E09E7C ; CODE XREF: GameManager$$get_currentPeriodOfDay+40↑j
.text.1:0000007101E09E7C BL GameManager$$get_elapsedTimeOfDay
.text.1:0000007101E09E80 FMOV S1, #2.0
.text.1:0000007101E09E84 FCMP S0, S1
.text.1:0000007101E09E88 B.MI loc_7101E09EF4
.text.1:0000007101E09E8C
.text.1:0000007101E09E8C loc_7101E09E8C ; CODE XREF: GameManager$$get_currentPeriodOfDay+C0↓j
.text.1:0000007101E09E8C FMOV S1, #4.0
.text.1:0000007101E09E90 FCMP S0, S1
.text.1:0000007101E09E94 B.MI loc_7101E09ED0
.text.1:0000007101E09E98 FMOV S1, #10.0
.text.1:0000007101E09E9C FCMP S0, S1
.text.1:0000007101E09EA0 B.MI loc_7101E09F04
.text.1:0000007101E09EA4 FMOV S1, #17.0
.text.1:0000007101E09EA8 FCMP S0, S1
.text.1:0000007101E09EAC B.MI loc_7101E09F14
.text.1:0000007101E09EB0 FMOV S1, #20.0
.text.1:0000007101E09EB4 FCMP S0, S1
.text.1:0000007101E09EB8 MOV W8, #2
.text.1:0000007101E09EBC MOV W9, #3
.text.1:0000007101E09EC0 CSEL W0, W9, W8, PL
.text.1:0000007101E09EC4 LDP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09EC8 LDR X19, [SP+0x10+var_10],#0x20
.text.1:0000007101E09ECC RET
.text.1:0000007101E09ED0 ; ---------------------------------------------------------------------------
.text.1:0000007101E09ED0
.text.1:0000007101E09ED0 loc_7101E09ED0 ; CODE XREF: GameManager$$get_currentPeriodOfDay+64↑j
.text.1:0000007101E09ED0 MOV W0, #4
.text.1:0000007101E09ED4 LDP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09ED8 LDR X19, [SP+0x10+var_10],#0x20
.text.1:0000007101E09EDC RET
.text.1:0000007101E09EE0 ; ---------------------------------------------------------------------------
.text.1:0000007101E09EE0
.text.1:0000007101E09EE0 loc_7101E09EE0 ; CODE XREF: GameManager$$get_currentPeriodOfDay+48↑j
.text.1:0000007101E09EE0 BL sub_710009AE30
.text.1:0000007101E09EE4 BL GameManager$$get_elapsedTimeOfDay
.text.1:0000007101E09EE8 FMOV S1, #2.0
.text.1:0000007101E09EEC FCMP S0, S1
.text.1:0000007101E09EF0 B.PL loc_7101E09E8C
.text.1:0000007101E09EF4
.text.1:0000007101E09EF4 loc_7101E09EF4 ; CODE XREF: GameManager$$get_currentPeriodOfDay+58↑j
.text.1:0000007101E09EF4 MOV W0, #3
.text.1:0000007101E09EF8 LDP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09EFC LDR X19, [SP+0x10+var_10],#0x20
.text.1:0000007101E09F00 RET
.text.1:0000007101E09F04 ; ---------------------------------------------------------------------------
.text.1:0000007101E09F04
.text.1:0000007101E09F04 loc_7101E09F04 ; CODE XREF: GameManager$$get_currentPeriodOfDay+70↑j
.text.1:0000007101E09F04 MOV W0, WZR
.text.1:0000007101E09F08 LDP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09F0C LDR X19, [SP+0x10+var_10],#0x20
.text.1:0000007101E09F10 RET
.text.1:0000007101E09F14 ; ---------------------------------------------------------------------------
.text.1:0000007101E09F14
.text.1:0000007101E09F14 loc_7101E09F14 ; CODE XREF: GameManager$$get_currentPeriodOfDay+7C↑j
.text.1:0000007101E09F14 MOV W0, #1
.text.1:0000007101E09F18 LDP X29, X30, [SP,#0x10+var_s0]
.text.1:0000007101E09F1C LDR X19, [SP+0x10+var_10],#0x20
.text.1:0000007101E09F20 RET
.text.1:0000007101E09F20 ; ---------------------------------------------------------------------------
.text.1:0000007101E09F24 ALIGN 0x10
.text.1:0000007101E09F24 ; End of function GameManager$$get_currentPeriodOfDay
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment