shithub: pokecrystal

Download patch

ref: 5faf138dc98ed36be6e8f888fdf71557dda508d1
parent: 4cd354ec3285cb24a0ab468c75e466b670036bbe
author: JimB16 <f1@jimb.de>
date: Fri Aug 28 18:18:41 EDT 2015

changed some labels and added comments

--- a/misc/mobile_45.asm
+++ b/misc/mobile_45.asm
@@ -22874,6 +22874,7 @@
 	ret
 ; 1702b7
 
+; Initialise the BattleTower-Trainer and his Pkmn
 Function1702b7: ; 1702b7
 	call Function1704a2
 	ld de, $c643
@@ -22880,13 +22881,13 @@
 	ld c, $b
 	callba Function17d073
 	jr nc, .asm_1702db
-	ld a, [$c608 + 11]
+	ld a, [BT_OTTempCopy + 11]
 	ld [wd265], a
 	call GetPokemonName
 	ld l, e
 	ld h, d
 	ld de, $c643
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 
 .asm_1702db
@@ -22900,7 +22901,7 @@
 	ld l, e
 	ld h, d
 	ld de, $c67e
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 
 .asm_1702fc
@@ -22914,7 +22915,7 @@
 	ld l, e
 	ld h, d
 	ld de, $c686 + 51
-	ld bc, $000b
+	ld bc, PKMN_NAME_LENGTH
 	call CopyBytes
 
 .asm_17031d
@@ -22923,7 +22924,7 @@
 	ld [$c688], a
 	ld [$c68a + 57], a
 	call Function170c98
-	ld de, $c608
+	ld de, BT_OTTempCopy
 	ld c, $a
 	callba Function17d073
 	jr nc, .asm_17033d
@@ -22931,7 +22932,7 @@
 	jr .asm_170340
 
 .asm_17033d
-	ld hl, $c608
+	ld hl, BT_OTTempCopy ; 0xc608
 
 .asm_170340
 	ld de, wd26b
@@ -22939,7 +22940,7 @@
 	call CopyBytes
 	ld a, $50
 	ld [de], a
-	ld hl, $c608 + 10
+	ld hl, BT_OTTempCopy + $a
 	ld a, [hli]
 	ld [OtherTrainerClass], a
 	ld a, $ea
@@ -22948,9 +22949,11 @@
 	ld [wcd21], a
 	ld de, OTPartyMon1Species
 	ld bc, OTPartyCount
-	ld a, $3
+	ld a, $3				; Number of Pkmn the BattleTower-Trainer has
 	ld [bc], a
 	inc bc
+
+	; Copy Pkmn into Memory from the address in hl
 .asm_170367
 	push af
 	ld a, [hl]
--- a/wram.asm
+++ b/wram.asm
@@ -884,6 +884,16 @@
 wc7e8:: ds 24
 
 
+RSSET $c608 ;$c000+(wc608-wc000) ; compute the address through doesn't seem to work
+BT_OTTempCopy    RW   1
+str_tData     RB   256
+str_bCount    RB   1
+str_SIZEOF    RB   0
+
+GLOBAL BT_OTTempCopy
+
+
+
 SECTION "Overworld Map", WRAM0 [$c800]
 
 wc800::
@@ -1818,6 +1828,7 @@
 wd262:: ds 1
 wd263:: ds 1
 wd264:: ds 1
+GetPokemonName_Parameter::
 wd265:: ds 1
 wd266:: ds 1
 wd267:: ds 1