shithub: pokecrystal

Download patch

ref: d05adc4f9881c2d5516a8884740a3c4128c29642
parent: 705e6824687ed247a28cfbaedd47bf33bd1da32a
author: yenatch <[email protected]>
date: Sat Sep 7 20:46:25 EDT 2013

Function2f17 -> IsInJohto

--- a/main.asm
+++ b/main.asm
@@ -768,16 +768,21 @@
 INCLUDE "common/string.asm"
 
 
-Function2f17: ; 2f17
+IsInJohto: ; 2f17
+; Return 0 if the player is in Johto, and 1 in Kanto.
+
 	ld a, [MapGroup]
 	ld b, a
 	ld a, [MapNumber]
 	ld c, a
 	call GetWorldMapLocation
-	cp $5f
-	jr z, .asm_2f39
-	cp $0
-	jr nz, .asm_2f35
+
+	cp $5f ; SS Aqua
+	jr z, .Johto
+
+	cp $0 ; Poke Center 2F
+	jr nz, .CheckRegion
+
 	ld a, [BackupMapGroup]
 	ld b, a
 	ld a, [BackupMapNumber]
@@ -784,16 +789,16 @@
 	ld c, a
 	call GetWorldMapLocation
 
-.asm_2f35
-	cp $2f
-	jr nc, .asm_2f3b
+.CheckRegion
+	cp $2f ; Pallet Town
+	jr nc, .Kanto
 
-.asm_2f39
+.Johto
 	xor a
 	ret
 
-.asm_2f3b
-	ld a, $1
+.Kanto
+	ld a, 1
 	ret
 ; 2f3e
 
@@ -36055,7 +36060,7 @@
 	jr .asm_2a27a
 
 .asm_2a235
-	call Function2f17
+	call IsInJohto
 	and a
 	ret z
 	ld h, d