aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluckytyphlosion <alan.rj.huang@gmail.com>2015-05-10 15:02:46 -0400
committerluckytyphlosion <alan.rj.huang@gmail.com>2015-05-10 15:02:46 -0400
commitb234b9eebf84e4966b7785469ee5f52d7b0539d6 (patch)
tree058590b9b5666eeca8ee8fcd81795fbfc6614dbf
parentAddresses for functions. (diff)
downloadpokeyellow-b234b9eebf84e4966b7785469ee5f52d7b0539d6.tar.gz
pokeyellow-b234b9eebf84e4966b7785469ee5f52d7b0539d6.tar.xz
pokeyellow-b234b9eebf84e4966b7785469ee5f52d7b0539d6.zip
Move play_time.asm to homebank.
-rw-r--r--home/play_time.asm61
1 files changed, 61 insertions, 0 deletions
diff --git a/home/play_time.asm b/home/play_time.asm
new file mode 100644
index 00000000..74da9c59
--- /dev/null
+++ b/home/play_time.asm
@@ -0,0 +1,61 @@
+TrackPlayTime: ; 18dee (6:4dee)
+ call CountDownIgnoreInputBitReset
+ ld a, [wd732]
+ bit 0, a
+ ret z
+ ld a, [W_PLAYTIMEMINUTES]
+ and a
+ ret nz
+ ld a, [W_PLAYTIMEFRAMES]
+ inc a
+ ld [W_PLAYTIMEFRAMES], a
+ cp 60
+ ret nz
+ xor a
+ ld [W_PLAYTIMEFRAMES], a
+ ld a, [W_PLAYTIMESECONDS]
+ inc a
+ ld [W_PLAYTIMESECONDS], a
+ cp 60
+ ret nz
+ xor a
+ ld [W_PLAYTIMESECONDS], a
+ ld a, [W_PLAYTIMEMINUTES + 1]
+ inc a
+ ld [W_PLAYTIMEMINUTES + 1], a
+ cp 60
+ ret nz
+ xor a
+ ld [W_PLAYTIMEMINUTES + 1], a
+ ld a, [W_PLAYTIMEHOURS + 1]
+ inc a
+ ld [W_PLAYTIMEHOURS + 1], a
+ cp $ff
+ ret nz
+ ld a, $ff
+ ld [W_PLAYTIMEMINUTES], a
+ ret
+
+CountDownIgnoreInputBitReset: ; 18e36 (6:4e36)
+ ld a, [wIgnoreInputCounter]
+ and a
+ jr nz, .asm_18e40
+ ld a, $ff
+ jr .asm_18e41
+.asm_18e40
+ dec a
+.asm_18e41
+ ld [wIgnoreInputCounter], a
+ and a
+ ret nz
+ ld a, [wd730]
+ res 1, a
+ res 2, a
+ bit 5, a
+ res 5, a
+ ld [wd730], a
+ ret z
+ xor a
+ ld [hJoyPressed], a
+ ld [hJoyHeld], a
+ ret