shithub: pokecrystal

Download patch

ref: a9941e28cc3beb33742ef072aaa46941606781fa
parent: fc99117d884c906d34923586b78b683220a1bb6d
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Tue Jul 21 07:48:39 EDT 2020

Define NUM_FLYPOINTS

--- a/constants/map_data_constants.asm
+++ b/constants/map_data_constants.asm
@@ -128,5 +128,6 @@
 	const FLY_FUCHSIA
 	const FLY_CINNABAR
 	const FLY_INDIGO
+NUM_FLYPOINTS EQU const_value
 
 MAX_OUTDOOR_SPRITES EQU 23 ; see engine/overworld/overworld.asm
--- a/data/maps/flypoints.asm
+++ b/data/maps/flypoints.asm
@@ -27,4 +27,4 @@
 	db LANDMARK_FUCHSIA_CITY,     SPAWN_FUCHSIA
 	db LANDMARK_CINNABAR_ISLAND,  SPAWN_CINNABAR
 	db LANDMARK_INDIGO_PLATEAU,   SPAWN_INDIGO
-	db -1
+	db -1 ; end
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -65,7 +65,7 @@
 	ldh [hBGMapAddress], a
 	ld a, HIGH(vBGMap0)
 	ldh [hBGMapAddress + 1], a
-	ld a, $90
+	ld a, SCREEN_HEIGHT_PX
 	ldh [hWY], a
 	call ExitPokegearRadio_HandleMusic
 	ret
@@ -269,7 +269,7 @@
 	ld a, HIGH(vBGMap0)
 	ldh [hBGMapAddress + 1], a
 	call .UpdateBGMap
-	ld a, $90
+	ld a, SCREEN_HEIGHT_PX
 	jr .finish
 
 .kanto_0
@@ -2077,7 +2077,7 @@
 	pop af
 	ldh [hInMenu], a
 	call ClearBGPalettes
-	ld a, $90
+	ld a, SCREEN_HEIGHT_PX
 	ldh [hWY], a
 	xor a ; LOW(vBGMap0)
 	ldh [hBGMapAddress], a
@@ -2420,10 +2420,10 @@
 
 .left
 	ldh a, [hWY]
-	cp $90
+	cp SCREEN_HEIGHT_PX
 	ret z
 	call ClearSprites
-	ld a, $90
+	ld a, SCREEN_HEIGHT_PX
 	ldh [hWY], a
 	xor a ; JOHTO_REGION
 	call .GetAndPlaceNest
@@ -2872,7 +2872,7 @@
 	pop af
 	ldh [hInMenu], a
 	call ClearBGPalettes
-	ld a, $90
+	ld a, SCREEN_HEIGHT_PX
 	ldh [hWY], a
 	xor a ; LOW(vBGMap0)
 	ldh [hBGMapAddress], a
@@ -2895,7 +2895,7 @@
 .down_right
 	ld hl, wTownMapPlayerIconLandmark
 	ld a, [hl]
-	cp FLY_INDIGO
+	cp NUM_FLYPOINTS - 1
 	jr c, .okay_dr
 	ld [hl], -1
 .okay_dr
@@ -2907,7 +2907,7 @@
 	ld a, [hl]
 	and a
 	jr nz, .okay_ul
-	ld [hl], FLY_INDIGO + 1
+	ld [hl], NUM_FLYPOINTS
 .okay_ul
 	dec [hl]
 .continue
@@ -2916,13 +2916,13 @@
 	jr c, .johto
 	call FillKantoMap
 	xor a
-	ld b, $9c
+	ld b, HIGH(vBGMap1)
 	jr .finish
 
 .johto
 	call FillJohtoMap
-	ld a, $90
-	ld b, $98
+	ld a, SCREEN_HEIGHT_PX
+	ld b, HIGH(vBGMap0)
 .finish
 	ldh [hWY], a
 	ld a, b