shithub: pokecrystal

Download patch

ref: 315d6c665ea0ee4e103f6d8b9dbfb531659ae381
parent: 8befc889adcaf3988ad63a36de74fa345aeab7ee
author: mid-kid <esteve.varela@gmail.com>
date: Tue Aug 18 18:20:16 EDT 2020

Add wTitleScreenSelectedOption constants

--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -959,6 +959,15 @@
 	db 10 * 8 + 4,  9 * 8, 2
 	db 10 * 8 + 4, 10 * 8, 3
 
+
+	const_def
+	const TITLESCREENOPTION_MAIN_MENU
+	const TITLESCREENOPTION_DELETE_SAVE_DATA
+	const TITLESCREENOPTION_RESTART
+	const TITLESCREENOPTION_UNUSED
+	const TITLESCREENOPTION_RESET_CLOCK
+NUM_TITLESCREENOPTIONS EQU const_value
+
 IntroSequence:
 	callfar Copyright_GameFreakPresents
 	jr c, StartTitleScreen
@@ -1000,7 +1009,7 @@
 	call GetSGBLayout
 	call UpdateTimePals
 	ld a, [wTitleScreenSelectedOption]
-	cp 5
+	cp NUM_TITLESCREENOPTIONS
 	jr c, .ok
 	xor a
 .ok
@@ -1183,7 +1192,7 @@
 	ld a, [hl]
 	and D_LEFT + D_UP
 	cp  D_LEFT + D_UP
-	jr z, .clock_reset
+	jr z, .reset_clock
 
 ; Press Start or A to start the game.
 .check_start
@@ -1193,11 +1202,11 @@
 	ret
 
 .incave
-	ld a, 0
+	ld a, TITLESCREENOPTION_MAIN_MENU
 	jr .done
 
 .delete_save_data
-	ld a, 1
+	ld a, TITLESCREENOPTION_DELETE_SAVE_DATA
 
 .done
 	ld [wTitleScreenSelectedOption], a
@@ -1223,8 +1232,8 @@
 	inc [hl]
 	ret
 
-.clock_reset
-	ld a, 4
+.reset_clock
+	ld a, TITLESCREENOPTION_RESET_CLOCK
 	ld [wTitleScreenSelectedOption], a
 
 ; Return to the intro sequence.
@@ -1242,7 +1251,7 @@
 	and a
 	ret nz
 
-	ld a, 2
+	ld a, TITLESCREENOPTION_RESTART
 	ld [wTitleScreenSelectedOption], a
 
 ; Back to the intro.