shithub: pokecrystal

Download patch

ref: a849c3557b8ee3dd2b464ccdc646aebd33d7b2a7
parent: a3242b4ad45bc029461166d1aa6151892b60269e
author: Remy Oukaour <remy.oukaour@gmail.com>
date: Tue Jan 9 10:39:48 EST 2018

More comments
Fix some constants

--- a/constants/battle_constants.asm
+++ b/constants/battle_constants.asm
@@ -17,6 +17,9 @@
 REST_SLEEP_TURNS EQU 2
 TREEMON_SLEEP_TURNS EQU 7
 
+; default move priority
+BASE_PRIORITY EQU 1
+
 ; PlayerStatLevels and EnemyStatLevels indexes
 ; used for GetStatName
 	const_def
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -18,7 +18,6 @@
 ; - BitmasksPointers (see gfx/pokemon/bitmask_pointers.asm)
 ; - FramesPointers (see gfx/pokemon/frame_pointers.asm)
 ; - Footprints (see gfx/footprints.asm)
-; - SortedPokemon (see mobile/fixed_words.asm)
 const_value set 1
 	const BULBASAUR  ; 01
 	const IVYSAUR    ; 02
--- a/data/pokemon/pic_pointers.asm
+++ b/data/pokemon/pic_pointers.asm
@@ -1,3 +1,5 @@
+; Pics are defined in gfx/pics.asm
+
 PokemonPicPointers::
 ; entries correspond to Pokémon species, two apiece
 	dba_pic BulbasaurFrontpic
--- a/data/trainers/party_pointers.asm
+++ b/data/trainers/party_pointers.asm
@@ -1,6 +1,7 @@
-; Each trainer class has its own group. See trainers.asm.
+; Groups are defined in data/trainers/parties.asm.
 
 TrainerGroups: ; 0x39999
+; entries correspond to trainer classes (see constants/trainer_constants.asm)
 	dw FalknerGroup
 	dw WhitneyGroup
 	dw BugsyGroup
--- a/data/trainers/pic_pointers.asm
+++ b/data/trainers/pic_pointers.asm
@@ -1,3 +1,5 @@
+; Pics are defined in gfx/pics.asm
+
 TrainerPicPointers::
 ; entries correspond to trainer classes (see constants/trainer_constants.asm)
 	dba_pic FalknerPic
--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -857,7 +857,7 @@
 	cp -1
 	jr nz, .loop
 
-	ld a, 1
+	ld a, BASE_PRIORITY
 	ret
 
 .done
@@ -4808,7 +4808,7 @@
 	ld [de], a
 	ld hl, BattleMonLevel
 	ld de, TempMonLevel
-	ld bc, $0011
+	ld bc, $11
 	call CopyBytes
 	ld a, [CurBattleMon]
 	ld hl, PartyMon1Species
--- a/engine/item_effects.asm
+++ b/engine/item_effects.asm
@@ -1436,7 +1436,7 @@
 	call TextBox
 
 	hlcoord 11, 1
-	ld bc, $0004
+	ld bc, 4
 	predef PrintTempMonStats
 
 	call WaitPressAorB_BlinkCursor
@@ -2572,7 +2572,7 @@
 	cp SKETCH
 	jr z, .CantUsePPUpOnSketch
 
-	ld bc, $0015
+	ld bc, MON_PP - MON_MOVES
 	add hl, bc
 	ld a, [hl]
 	cp 3 << 6 ; have 3 PP Ups already been used?
--- a/home/map.asm
+++ b/home/map.asm
@@ -2106,11 +2106,11 @@
 ; Extract data from the current map's header.
 
 ; inputs:
-; de = offset of desired data within the mapheader
+; de = offset of desired data within the mapheader (a MAPHEADER_* constant)
 
 ; outputs:
 ; bc = data from the current map's header
-; (e.g., de = $0003 would return a pointer to the secondary map header)
+; (e.g., de = MAPHEADER_MAPHEADER2 would return a pointer to the secondary map header)
 
 	ld a, [MapGroup]
 	ld b, a
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -517,7 +517,7 @@
 ; 1ff0
 
 .bytefill ; 1ff0
-	ld bc, $0010
+	ld bc, $10
 	xor a
 	call ByteFill
 	ret