shithub: pokecrystal

Download patch

ref: 3a562f9896959ff9dd257cac18ed9090bf2be990
parent: 1a6b05111934a94a13145705c6f4be2a68412bf3
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed Mar 9 14:42:26 EST 2022

Identify some wMenuJoypad-related button constants

--- a/engine/events/buena.asm
+++ b/engine/events/buena.asm
@@ -234,7 +234,7 @@
 	ld a, [wMenuCursorY]
 	ld [wMenuSelection], a
 	ld a, [wMenuJoypad]
-	cp $2
+	cp B_BUTTON
 	jr z, .cancel
 	ld a, c
 	and a
--- a/engine/items/tmhm.asm
+++ b/engine/items/tmhm.asm
@@ -290,7 +290,7 @@
 TMHM_ExitPack:
 	call TMHM_PlaySFX_ReadText2
 _TMHM_ExitPack:
-	ld a, $2
+	ld a, B_BUTTON
 	ld [wMenuJoypad], a
 	and a
 	ret
--- a/engine/overworld/decorations.asm
+++ b/engine/overworld/decorations.asm
@@ -376,7 +376,7 @@
 	ld [wMenuScrollPosition], a
 	call ScrollingMenu
 	ld a, [wMenuJoypad]
-	cp 2
+	cp B_BUTTON
 	jr z, .no_action_2
 	call DoDecorationAction2
 
--- a/mobile/mobile_22.asm
+++ b/mobile/mobile_22.asm
@@ -2136,9 +2136,9 @@
 	ld hl, wMenuJoypadFilter
 	and [hl]
 	ret z
-	bit 0, a
+	bit A_BUTTON_F, a
 	jr nz, .asm_89dc7
-	bit 1, a
+	bit B_BUTTON_F, a
 	jr nz, .asm_89dd9
 	xor a
 	ret
@@ -2943,9 +2943,9 @@
 	ld hl, wMenuJoypadFilter
 	and [hl]
 	ret z
-	bit 0, a
+	bit A_BUTTON_F, a
 	jr nz, .asm_8a399
-	bit 1, a
+	bit B_BUTTON_F, a
 	jr nz, .asm_8a39e
 	xor a
 	ret
@@ -3664,7 +3664,7 @@
 .asm_8a943
 	call Function8b7bd
 	ld a, [wMenuJoypad]
-	and $1
+	and A_BUTTON
 	jr nz, .asm_8a953
 	ld a, c
 	and a
--- a/mobile/mobile_22_2.asm
+++ b/mobile/mobile_22_2.asm
@@ -800,15 +800,15 @@
 	call ScrollingMenu
 	call Mobile_DisableSpriteUpdates
 	ld a, [wMenuJoypad]
-	cp $2
+	cp B_BUTTON
 	jr z, .asm_8b823
-	cp $20
+	cp D_LEFT
 	jr nz, .asm_8b813
 	call Function8b832
 	jr .asm_8b7ea
 
 .asm_8b813
-	cp $10
+	cp D_RIGHT
 	jr nz, .asm_8b81c
 	call Function8b83e
 	jr .asm_8b7ea