summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPheenoh <pheenoh@gmail.com>2022-12-22 14:36:27 -0700
committerPheenoh <pheenoh@gmail.com>2022-12-22 14:36:27 -0700
commita15c20dcd79b46e910c95d3981f4465be052d5de (patch)
treeedc2d5df2dd5db3fdb88626fca2fd7268481eb5c
parent9d049c1549175301d2aa5c8e22bcddb13876f997 (diff)
dTimer_c::restart
-rw-r--r--include/d/d_timer.h2
-rw-r--r--src/d/d_timer.cpp22
2 files changed, 16 insertions, 8 deletions
diff --git a/include/d/d_timer.h b/include/d/d_timer.h
index b46a3238b9..569bedfe62 100644
--- a/include/d/d_timer.h
+++ b/include/d/d_timer.h
@@ -87,7 +87,7 @@ public:
/* 8025D7C0 */ int stock_start(s16);
/* 8025D708 */ bool stock_start();
/* 8025D7E8 */ int stop(u8);
- /* 8025D86C */ void restart(u8);
+ /* 8025D86C */ int restart(u8);
/* 8025D920 */ void end(int);
/* 8025D9E0 */ int deleteRequest();
/* 8025D9F0 */ int getTimeMs();
diff --git a/src/d/d_timer.cpp b/src/d/d_timer.cpp
index fa61c2035e..c25872b679 100644
--- a/src/d/d_timer.cpp
+++ b/src/d/d_timer.cpp
@@ -308,14 +308,22 @@ int dTimer_c::stop(u8 param_0) {
}
/* 8025D86C-8025D920 2581AC 00B4+00 1/1 1/1 0/0 .text restart__8dTimer_cFUc */
-#pragma push
-#pragma optimization_level 0
-#pragma optimizewithasm off
-asm void dTimer_c::restart(u8 param_0) {
- nofralloc
-#include "asm/d/d_timer/restart__8dTimer_cFUc.s"
+int dTimer_c::restart(u8 param_0) {
+ if (field_0x16A != 1 || field_0x16B != param_0) {
+ return 0;
+ } else {
+ if (mDeleteCheck != 4 && mDeleteCheck != 2) {
+ return 0;
+ } else {
+ mTime2 = dLib_time_c::getTime();
+ OSTime tmp = mTime2 - mTime3;
+ mTime5 += tmp;
+ field_0x16A = 0;
+ field_0x16B = 0;
+ return 1;
+ }
+ }
}
-#pragma pop
/* 8025D920-8025D9E0 258260 00C0+00 0/0 1/1 0/0 .text end__8dTimer_cFi */
#pragma push