shithub: pokecrystal

Download patch

ref: 53926402f8ca40a63bc7243755aba10fedbff912
parent: 3501a0be8cfda7505743051668451b17a0b5337d
author: IIMarckus <[email protected]>
date: Mon Sep 10 17:36:50 EDT 2012

Confirmed: this RAM location represents link battle.

--- a/main.asm
+++ b/main.asm
@@ -376,9 +376,9 @@
 	ld de, $c616
 	jr .asm_126a ; 0x1219 $4f
 	push de
-	ld a, [$c2dc]
+	ld a, [InLinkBattle]
 	and a
-	jr nz, .asm_124d ; 0x1220 $2b
+	jr nz, .linkbattle
 	ld a, [$d233]
 	cp $9
 	jr z, .asm_1248 ; 0x1227 $1f
@@ -400,7 +400,7 @@
 .asm_1248
 	ld de, $d493
 	jr .asm_126a ; 0x124b $1d
-.asm_124d
+.linkbattle
 	ld de, $c656
 	jr .asm_126a ; 0x1250 $18
 	push de
@@ -5697,9 +5697,9 @@
 	jr .done
 
 .othertrainer
-	ld a, [$c2dc]
+	ld a, [InLinkBattle]
 	and a
-	jr nz, .linkbattle ; XXX link battle?
+	jr nz, .linkbattle
 	ld a, BANK(RegionCheck)
 	ld hl, RegionCheck
 	rst $8
--- a/wram.asm
+++ b/wram.asm
@@ -1,3 +1,8 @@
+SECTION "linkbattle",BSS[$c2dc]
+
+InLinkBattle: ; 0xc2dc
+	ds 1 ; nonzero when in a link battle
+
 SECTION "BattleMons",BSS[$c62a]
 
 BattleMonSpecies: ; c62a