summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2019-02-26 15:12:02 -0500
committerluckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>2019-02-26 15:12:02 -0500
commit6e2bc25eb54c4e182b5a02e68755d672902b9855 (patch)
treed8b83b0b6eb5016da8162896027485d60f13670e
parentf2f261a8e7827fbeb4c133520e6f7b9adafa1b44 (diff)
Disassemble SetTime.
-rw-r--r--engine/menu/set_time.asm83
-rw-r--r--maps/Route1P1.asm11
-rw-r--r--pokegold-spaceworld.link2
-rwxr-xr-xshim.sym2
4 files changed, 95 insertions, 3 deletions
diff --git a/engine/menu/set_time.asm b/engine/menu/set_time.asm
new file mode 100644
index 0000000..c7c4aa3
--- /dev/null
+++ b/engine/menu/set_time.asm
@@ -0,0 +1,83 @@
+INCLUDE "constants.asm"
+
+SECTION "engine/menu/set_time.asm", ROMX
+
+SetTime: ; 36:7ae4
+ ld hl, wStartHour
+ ldh a, [hRTCHours]
+ ld [hli], a
+ ldh a, [hRTCMinutes]
+ ld [hl], a
+ ld hl, Textdbaf4
+ call PrintText
+ ret
+
+Textdbaf4: ; 36:7af4
+ deciram wStartHour, 1, 2
+ text " じ"
+ line "@"
+ deciram wStartMinute, 1, 2
+ text " ふん?@"
+ start_asm
+.loop
+ call ClearJoypad
+ call GetJoypad
+ ldh a, [hJoyState]
+ and a
+ jr z, .loop
+ bit 0, a
+ jp nz, .sub_dbb63
+ bit 6, a
+ jr nz, .sub_dbb2a
+ bit 7, a
+ jr nz, .sub_dbb37
+ bit 4, a
+ jr nz, .sub_dbb43
+ bit 5, a
+ jr nz, .sub_dbb50
+ jr .loop
+.sub_dbb2a
+ ld a, [wStartHour]
+ cp $17
+ jr z, .sub_dbb5a
+ inc a
+ ld [wStartHour], a
+ jr .sub_dbb5a
+.sub_dbb37
+ ld a, [wStartHour]
+ and a
+ jr z, .sub_dbb5a
+ dec a
+ ld [wStartHour], a
+ jr .sub_dbb5a
+.sub_dbb43
+ ld a, [wStartMinute]
+ cp $3b
+ jr z, .sub_dbb5a
+ inc a
+ ld [wStartMinute], a
+ jr .sub_dbb5a
+.sub_dbb50
+ ld a, [wStartMinute]
+ and a
+ jr z, .sub_dbb5a
+ dec a
+ ld [wStartMinute], a
+.sub_dbb5a
+ ld hl, Textdbaf4 ; meant Textdbb6c?
+ call PrintText
+ jp .loop
+.sub_dbb63
+ call Function04ac
+ call Function0502
+ jp Function3036
+
+Textdbb6c: ; 36:7b6c
+ deciram wStartHour, 1, 2
+ text " じ"
+ line "@"
+ deciram wStartMinute, 1, 2
+ text " ふん?"
+ done
+
+; 36:7b98
diff --git a/maps/Route1P1.asm b/maps/Route1P1.asm
index 62ed0cd..7b23aec 100644
--- a/maps/Route1P1.asm
+++ b/maps/Route1P1.asm
@@ -2,6 +2,17 @@ include "constants.asm"
SECTION "maps/Route1P1.asm", ROMX
+ ret
+
+ dw Textdbb82
+Textdbb82: ; 36:7b82
+ text "べんりな よのなかだね"
+ done
+
+ rept 9
+ ret
+ endr
+
Route1P1ScriptLoader:: ; 7B98
ld hl, Route1P1ScriptPointers
call RunMapScript
diff --git a/pokegold-spaceworld.link b/pokegold-spaceworld.link
index 650c64f..7939ebf 100644
--- a/pokegold-spaceworld.link
+++ b/pokegold-spaceworld.link
@@ -862,7 +862,7 @@ ROMX $36
"data/maps/attributes/placeholder/BullForestRoute3.asm"
"maps/placeholder/BullForestRoute3.asm"
"maps/SilentHill.asm"
- org $7b98
+ "engine/menu/set_time.asm"
"maps/Route1P1.asm"
"maps/Route1P2.asm"
ROMX $37
diff --git a/shim.sym b/shim.sym
index 476461e..178b3ff 100755
--- a/shim.sym
+++ b/shim.sym
@@ -156,8 +156,6 @@
33:625D BattleAnim_Sine_e
33:6263 BattleAnim_Cosine_e
-36:7AE4 SetTime
-
38:4000 PikachuMiniGame
39:4000 GameFreakIntro
39:432F OpeningCutscene