summaryrefslogtreecommitdiff
path: root/engine/events/checktime.asm
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2018-03-25 16:18:33 +0200
committermid-kid <esteve.varela@gmail.com>2018-03-25 16:18:33 +0200
commit0d9241889fc8a2f047b9fd6db25e55de1e721877 (patch)
tree4ae588ae9d97639b456e6d2ba64a94676ddcf703 /engine/events/checktime.asm
parent60e21a86638cad5fd25133cda1c545461304d902 (diff)
Organize the engine/ directory, take 3
Renamed `title` to `movies`. Moved some functions from `engine/routines/` to their fitting directories, and cleaned up the base `engine/` directory. Moved `engine/pokemon/tmhm.asm` back to `engine/items/`. Made a new subdirectory: * engine/tilesets: Contains all map-related graphics routines.
Diffstat (limited to 'engine/events/checktime.asm')
-rw-r--r--engine/events/checktime.asm19
1 files changed, 19 insertions, 0 deletions
diff --git a/engine/events/checktime.asm b/engine/events/checktime.asm
new file mode 100644
index 000000000..4c7d033ff
--- /dev/null
+++ b/engine/events/checktime.asm
@@ -0,0 +1,19 @@
+CheckTime:: ; c000
+ ld a, [wTimeOfDay]
+ 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