mirror of
https://github.com/pret/pokediamond.git
synced 2026-09-30 12:26:48 -05:00
unk_02015E30 -> play_timer
This commit is contained in:
1
Makefile
1
Makefile
@@ -301,3 +301,4 @@ diamond: ; @$(HOST_VARS) $(MAKE) GAME_VERSION=DIAMOND
|
||||
pearl: ; @$(HOST_VARS) $(MAKE) GAME_VERSION=PEARL
|
||||
compare_diamond: ; @$(HOST_VARS) $(MAKE) GAME_VERSION=DIAMOND COMPARE=1
|
||||
compare_pearl: ; @$(HOST_VARS) $(MAKE) GAME_VERSION=PEARL COMPARE=1
|
||||
compare: compare_diamond
|
||||
|
||||
@@ -51,7 +51,7 @@ Static arm9
|
||||
Object unk_02014BF4.o
|
||||
Object unk_02015CC0.o
|
||||
Object rs_migrate_string.o
|
||||
Object unk_02015E30.o
|
||||
Object play_timer.o
|
||||
Object game_init.o
|
||||
Object heap.o
|
||||
Object bg_window.o
|
||||
|
||||
@@ -1003,9 +1003,9 @@
|
||||
.extern FUN_02015CE0
|
||||
.extern FUN_02015CF8
|
||||
.extern ConvertRSStringToDPStringInternational
|
||||
.extern FUN_02015E30
|
||||
.extern FUN_02015E3C
|
||||
.extern FUN_02015E60
|
||||
.extern PlayTimerInit
|
||||
.extern PlayTimerStart
|
||||
.extern PlayTimerUpdate
|
||||
.extern FUN_02015EF4
|
||||
.extern Main_SetVBlankIntrCB
|
||||
.extern FUN_02015F1C
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "module_52.h"
|
||||
#include "heap.h"
|
||||
#include "unk_0205FA2C.h"
|
||||
#include "unk_02015E30.h"
|
||||
#include "play_timer.h"
|
||||
|
||||
|
||||
extern struct Unk21DBE18 UNK_020FD144;
|
||||
@@ -202,7 +202,7 @@ THUMB_FUNC BOOL MOD52_021D7540(struct UnkStruct_02006234 *param0, u32 *unused)
|
||||
|
||||
MOD52_021D7604(0x4d, sav2, 1);
|
||||
struct IGT *igt = Sav2_PlayerData_GetIGTAddr(sav2);
|
||||
FUN_02015E3C(igt);
|
||||
PlayTimerStart(igt);
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -243,7 +243,7 @@ THUMB_FUNC BOOL MOD52_021D7594(struct UnkStruct_02006234 *param0, u32 *unused)
|
||||
Sav2_SysInfo_InitFromSystem(sav2_info);
|
||||
}
|
||||
|
||||
FUN_02015E3C(Sav2_PlayerData_GetIGTAddr(sav2));
|
||||
PlayTimerStart(Sav2_PlayerData_GetIGTAddr(sav2));
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -33,10 +33,10 @@ struct UnkStruct_02016FA8 UNK_02016FA8;
|
||||
extern void FUN_02022294(void);
|
||||
extern void GF_InitRTCWork(void);
|
||||
extern int FUN_020337E8(int);
|
||||
extern void FUN_02015E30(void);
|
||||
extern void PlayTimerInit(void);
|
||||
extern void FUN_0201B5CC(void *);
|
||||
extern void GF_RTC_UpdateOnFrame(void);
|
||||
extern void FUN_02015E60(void);
|
||||
extern void PlayTimerUpdate(void);
|
||||
extern void FUN_020222C4(void);
|
||||
extern void FUN_0200E2D8(void);
|
||||
|
||||
@@ -97,7 +97,7 @@ THUMB_FUNC void NitroMain(void)
|
||||
gMain.unk30 = 0;
|
||||
InitializeMainRNG();
|
||||
InitAllScreenBrightnessData();
|
||||
FUN_02015E30();
|
||||
PlayTimerInit();
|
||||
UNK_02016FA4 = 0;
|
||||
for (;;)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ THUMB_FUNC void NitroMain(void)
|
||||
}
|
||||
}
|
||||
GF_RTC_UpdateOnFrame();
|
||||
FUN_02015E60();
|
||||
PlayTimerUpdate();
|
||||
FUN_020222C4();
|
||||
FUN_0201B5CC(gMain.unk24);
|
||||
OS_WaitIrq(1, 1);
|
||||
|
||||
37
arm9/src/play_timer.c
Normal file
37
arm9/src/play_timer.c
Normal file
@@ -0,0 +1,37 @@
|
||||
|
||||
#include "play_timer.h"
|
||||
|
||||
u64 sTimer3Start;
|
||||
u64 sUnused;
|
||||
u64 sDuration;
|
||||
struct IGT * sIGT_p;
|
||||
BOOL sTimerActive;
|
||||
|
||||
THUMB_FUNC void PlayTimerInit()
|
||||
{
|
||||
sTimerActive = FALSE;
|
||||
}
|
||||
|
||||
THUMB_FUNC void PlayTimerStart(struct IGT *igt)
|
||||
{
|
||||
sTimerActive = TRUE;
|
||||
sUnused = 0;
|
||||
sDuration = 0;
|
||||
sIGT_p = igt;
|
||||
|
||||
sTimer3Start = GetTimer3Count();
|
||||
}
|
||||
|
||||
THUMB_FUNC void PlayTimerUpdate(void)
|
||||
{
|
||||
if (sTimerActive)
|
||||
{
|
||||
u64 res = Timer3CountToSeconds(GetTimer3Count() - sTimer3Start);
|
||||
|
||||
if (sDuration < res)
|
||||
{
|
||||
AddIGTSeconds(sIGT_p, (u32)(res - sDuration));
|
||||
sDuration = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
|
||||
#include "unk_02015E30.h"
|
||||
|
||||
u64 UNK_021C48B0;
|
||||
u64 UNK_021C48A8;
|
||||
u64 UNK_021C48A0;
|
||||
struct IGT * UNK_021C489C;
|
||||
u32 UNK_021C4898;
|
||||
|
||||
THUMB_FUNC void FUN_02015E30()
|
||||
{
|
||||
UNK_021C4898 = 0;
|
||||
}
|
||||
|
||||
THUMB_FUNC void FUN_02015E3C(struct IGT *igt)
|
||||
{
|
||||
UNK_021C4898 = 1;
|
||||
UNK_021C48A8 = 0;
|
||||
UNK_021C48A0 = 0;
|
||||
UNK_021C489C = igt;
|
||||
|
||||
UNK_021C48B0 = GetTimer3Count();
|
||||
}
|
||||
|
||||
THUMB_FUNC void FUN_02015E60()
|
||||
{
|
||||
if (UNK_021C4898 != 0)
|
||||
{
|
||||
u64 res = Timer3CountToSeconds(GetTimer3Count() - UNK_021C48B0);
|
||||
|
||||
if (UNK_021C48A0 < res)
|
||||
{
|
||||
AddIGTSeconds(UNK_021C489C, (u32)(res - UNK_021C48A0));
|
||||
UNK_021C48A0 = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
8
include/constants/trdata.h
Normal file
8
include/constants/trdata.h
Normal file
@@ -0,0 +1,8 @@
|
||||
//
|
||||
// Created by scott on 16-Sep-21.
|
||||
//
|
||||
|
||||
#ifndef POKEDIAMOND_TRDATA_H
|
||||
#define POKEDIAMOND_TRDATA_H
|
||||
|
||||
#endif //POKEDIAMOND_TRDATA_H
|
||||
@@ -26,19 +26,6 @@ struct UnkStruct_02006234
|
||||
u32 unk24;
|
||||
};
|
||||
|
||||
struct Unk2106FA0
|
||||
{
|
||||
PMBackLightSwitch unk0;
|
||||
s32 unk4;
|
||||
FSOverlayID unk8;
|
||||
struct UnkStruct_02006234 *unkC;
|
||||
FSOverlayID unk10;
|
||||
const struct Unk21DBE18 * unk14;
|
||||
s32 unk18;
|
||||
s32 unk1C;
|
||||
struct SaveBlock2 * unk20;
|
||||
};
|
||||
|
||||
struct Unk21C4818
|
||||
{
|
||||
u32 unk0;
|
||||
|
||||
12
include/play_timer.h
Normal file
12
include/play_timer.h
Normal file
@@ -0,0 +1,12 @@
|
||||
#ifndef POKEDIAMOND_PLAY_TIMER_H
|
||||
#define POKEDIAMOND_PLAY_TIMER_H
|
||||
|
||||
#include "global.h"
|
||||
#include "igt.h"
|
||||
#include "timer3.h"
|
||||
|
||||
void PlayTimerInit(void);
|
||||
void PlayTimerStart(struct IGT *igt);
|
||||
void PlayTimerUpdate(void);
|
||||
|
||||
#endif //POKEDIAMOND_PLAY_TIMER_H
|
||||
@@ -1,22 +0,0 @@
|
||||
#ifndef POKEDIAMOND_UNK_02015E30_H
|
||||
#define POKEDIAMOND_UNK_02015E30_H
|
||||
|
||||
#include "global.h"
|
||||
#include "igt.h"
|
||||
#include "timer3.h"
|
||||
|
||||
struct UnkStruct_02015E30
|
||||
{
|
||||
u32 unk00;
|
||||
struct IGT *unk04;
|
||||
u64 unk08;
|
||||
u32 unk10;
|
||||
u32 unk14;
|
||||
u64 unk18;
|
||||
};
|
||||
|
||||
void FUN_02015E30();
|
||||
void FUN_02015E3C(struct IGT *igt);
|
||||
void FUN_02015E60();
|
||||
|
||||
#endif //POKEDIAMOND_UNK_02015E30_H
|
||||
Reference in New Issue
Block a user