shithub: pokecrystal

Download patch

ref: 9772c722ac8fc6c41c5427ce7ca0d106a19db36e
parent: a129ba7b43b743efacf2926f4443b5f1d6305ef8
author: JimB16 <f1@jimb.de>
date: Sun Aug 23 03:09:36 EDT 2015

added comments and labels to BattleTower-Code

--- a/data/battle_tower.asm
+++ b/data/battle_tower.asm
@@ -1,4 +1,4 @@
-Function1f8000: ; 1f8000
+Function_LoadOpponentTrainerAndPokemons: ; 1f8000
 	ld a, [rSVBK]
 	push af
 	ld a, $3
@@ -52,7 +52,7 @@
 	call AddNTimes
 	ld bc, 11
 	call CopyBytes
-	call Function1f8081
+	call Function_LoadRandomBattleTowerPkmn
 	pop af
 	ld hl, Unknown_1f0000
 	ld bc, $0024
@@ -73,8 +73,8 @@
 	ret
 ; 1f8081
 
-Function1f8081: ; 1f8081
-	ld c, $3
+Function_LoadRandomBattleTowerPkmn: ; 1f8081
+	ld c, $3		
 .loop
 	push bc
 	ld a, BANK(sbe51)
@@ -81,6 +81,8 @@
 	call GetSRAMBank
 
 .asm_1f8089
+	; From Which LevelGroup are the Pkmn loaded
+	; a = 1..10
 	ld a, [$d800]
 	dec a
 	ld hl, BattleTowerMons
@@ -97,7 +99,9 @@
 	and $1f
 	cp (BattleTowerMons2 - BattleTowerMons1) / ($3b)
 	jr nc, .asm_1f8099
+	; in register 'a' is the chosen Pkmn of the LevelGroup
 
+	; Check if Pkmn was already loaded before
 	ld bc, $3b
 	call AddNTimes
 	ld a, [hli]
--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -24179,7 +24179,7 @@
 	ret
 
 Function170b44: ; 170b44
-	callba Function1f8000
+	callba Function_LoadOpponentTrainerAndPokemons
 	ld a, [rSVBK]
 	push af
 	ld a, $3