summaryrefslogtreecommitdiff
path: root/home/unknown.asm
diff options
context:
space:
mode:
Diffstat (limited to 'home/unknown.asm')
-rw-r--r--home/unknown.asm87
1 files changed, 87 insertions, 0 deletions
diff --git a/home/unknown.asm b/home/unknown.asm
index e2046e3..c216f62 100644
--- a/home/unknown.asm
+++ b/home/unknown.asm
@@ -1,6 +1,10 @@
INCLUDE "constants.asm"
+if DEBUG
SECTION "Empty function", ROM0[$2F97]
+else
+SECTION "Empty function", ROM0[$2F5B]
+endc
InexplicablyEmptyFunction:: ; 2f97
REPT 16
@@ -34,3 +38,86 @@ _2007:: ; 2007
ld [wce5f], a
call CloseSRAM
ret
+
+SECTION "Unknown functions 2", ROM0[$2075]
+
+_2075:: ; 2075
+; Prepares a buffer for the clock display, which in the Debug ROM is displayed on the bottom of the screen.
+; This function is called every frame, and loads special tiles into the $66-$7a space.
+ ld hl, wcbd2
+ ld bc, $14
+ ld a, " "
+ call ByteFill
+
+if DEBUG
+ ld hl, $d153
+ bit 0, [hl]
+ jr z, ._209e
+ ld hl, $d65b
+ ld de, wcbd2 + 4
+ ld c, $01
+ call _20CD
+ ld hl, $d65a
+ ld de, wcbd2 + 8
+ ld c, $01
+ call _20CD
+ ret
+._209e:
+endc
+
+ ld hl, hHours
+ ld de, wcbd2
+ call _20DC
+ ld hl, hMinutes
+ ld de, wcbd2 + 3
+ call _20DC
+ ldh a, [hDays]
+ and 7
+ add $71 ; Sunday
+ ld [wcbd2 + 6], a
+ ld a, $78 ; power
+ ld [wcbd2 + 9], a
+ inc a ; mobile
+ ld [wcbd2 + 11], a
+ ldh a, [hSeconds]
+ and 1
+ ret z
+ ld a, $70 ; :
+ ld [wcbd2 + 2], a
+ ret
+
+_20CD:: ; 20cd
+; PrintAsHex
+ ld a, [hli]
+ ld b, a
+ swap a
+ call _20F1
+ ld a, b
+ call _20F1
+ dec c
+ jr nz, _20CD
+ ret
+
+_20DC:: ; 20dc
+; PrintAsDec
+ ld a, [hli]
+ ld b, 0
+._20df:
+ inc b
+ sub 10
+ jr nc, ._20df
+ dec b
+ add 10
+ push af
+ ld a, b
+ call _20F1
+ pop af
+ call _20F1
+ ret
+
+_20F1:: ; 20f1
+ and %1111
+ add $66 ; digit 0
+ ld [de], a
+ inc de
+ ret