summaryrefslogtreecommitdiff
path: root/src/play_time.c
diff options
context:
space:
mode:
authorProjectRevoTPP <projectrevotpp@hotmail.com>2017-08-12 01:26:29 -0400
committerProjectRevoTPP <projectrevotpp@hotmail.com>2017-08-12 01:26:29 -0400
commit1a8fe435e7deabf06029c8e50201136518e3af73 (patch)
tree9746f2f4f4901e81496465da485d0f5c8a647586 /src/play_time.c
parentbb0cad7c072703f5a540e8c22c8e137267331f4d (diff)
split out src/ directory into categorized subdirectories.
Diffstat (limited to 'src/play_time.c')
-rw-r--r--src/play_time.c73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/play_time.c b/src/play_time.c
deleted file mode 100644
index 9882c9c4b..000000000
--- a/src/play_time.c
+++ /dev/null
@@ -1,73 +0,0 @@
-#include "global.h"
-#include "play_time.h"
-
-enum
-{
- STOPPED,
- RUNNING,
- MAXED_OUT
-};
-
-static u8 sPlayTimeCounterState;
-
-void PlayTimeCounter_Reset()
-{
- sPlayTimeCounterState = STOPPED;
-
- gSaveBlock2.playTimeHours = 0;
- gSaveBlock2.playTimeMinutes = 0;
- gSaveBlock2.playTimeSeconds = 0;
- gSaveBlock2.playTimeVBlanks = 0;
-}
-
-void PlayTimeCounter_Start()
-{
- sPlayTimeCounterState = RUNNING;
-
- if (gSaveBlock2.playTimeHours > 999)
- PlayTimeCounter_SetToMax();
-}
-
-void PlayTimeCounter_Stop()
-{
- sPlayTimeCounterState = STOPPED;
-}
-
-void PlayTimeCounter_Update()
-{
- if (sPlayTimeCounterState == RUNNING)
- {
- gSaveBlock2.playTimeVBlanks++;
-
- if (gSaveBlock2.playTimeVBlanks > 59)
- {
- gSaveBlock2.playTimeVBlanks = 0;
- gSaveBlock2.playTimeSeconds++;
-
- if (gSaveBlock2.playTimeSeconds > 59)
- {
- gSaveBlock2.playTimeSeconds = 0;
- gSaveBlock2.playTimeMinutes++;
-
- if (gSaveBlock2.playTimeMinutes > 59)
- {
- gSaveBlock2.playTimeMinutes = 0;
- gSaveBlock2.playTimeHours++;
-
- if (gSaveBlock2.playTimeHours > 999)
- PlayTimeCounter_SetToMax();
- }
- }
- }
- }
-}
-
-void PlayTimeCounter_SetToMax()
-{
- sPlayTimeCounterState = MAXED_OUT;
-
- gSaveBlock2.playTimeHours = 999;
- gSaveBlock2.playTimeMinutes = 59;
- gSaveBlock2.playTimeSeconds = 59;
- gSaveBlock2.playTimeVBlanks = 59;
-}