summaryrefslogtreecommitdiff
path: root/engine/check_time.asm
diff options
context:
space:
mode:
authoryenatch <yenatch@gmail.com>2017-12-23 13:17:46 -0500
committerGitHub <noreply@github.com>2017-12-23 13:17:46 -0500
commit878092004956418bfd77bfdb9fc9dd7f640f80d2 (patch)
tree3a97e3eb15d5c545977038e67589f92158e5bf23 /engine/check_time.asm
parenta6656a986bf9dde51561cab090648e0117b173ad (diff)
parent3c37bfc6fa2570a0a77c1230673910257ecf32df (diff)
Merge pull request #419 from roukaour/master
More reorganization and documentation
Diffstat (limited to 'engine/check_time.asm')
-rw-r--r--engine/check_time.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/engine/check_time.asm b/engine/check_time.asm
new file mode 100644
index 000000000..615b51d29
--- /dev/null
+++ b/engine/check_time.asm
@@ -0,0 +1,19 @@
+CheckTime:: ; c000
+ ld a, [TimeOfDay]
+ ld hl, TimeOfDayTable
+ ld de, 2
+ call IsInArray
+ inc hl
+ ld c, [hl]
+ ret c
+
+ xor a
+ ld c, a
+ ret
+
+TimeOfDayTable: ; c012
+ db MORN_F, MORN
+ db DAY_F, DAY
+ db NITE_F, NITE
+ db NITE_F, NITE
+ db -1