shithub: pokered

Download patch

ref: 77c3e22a4ecd3dc81918f00c548cef7c634f3419
parent: 4d61c351726b38b22e0606df23bd2fdfb13640cc
author: YamaArashi <shadow962@live.com>
date: Sat Oct 29 06:32:03 EDT 2016

use more HRAM constants

--- a/engine/battle/core.asm
+++ b/engine/battle/core.asm
@@ -488,8 +488,8 @@
 	jr nc, .playerMovesFirst ; if player is faster
 	jr .enemyMovesFirst ; if enemy is faster
 .speedEqual ; 50/50 chance for both players
-	ld a, [$ffaa]
-	cp $2
+	ld a, [hSerialConnectionStatus]
+	cp USING_INTERNAL_CLOCK
 	jr z, .invertOutcome
 	call BattleRandom
 	cp $80
--- a/engine/battle/experience.asm
+++ b/engine/battle/experience.asm
@@ -119,11 +119,11 @@
 	ld d, MAX_LEVEL
 	callab CalcExperience ; get max exp
 ; compare max exp with current exp
-	ld a, [$ff96]
+	ld a, [hExperience]
 	ld b, a
-	ld a, [$ff97]
+	ld a, [hExperience + 1]
 	ld c, a
-	ld a, [$ff98]
+	ld a, [hExperience + 2]
 	ld d, a
 	pop hl
 	ld a, [hld]
--- a/engine/cable_club.asm
+++ b/engine/cable_club.asm
@@ -551,7 +551,7 @@
 	Coorda 1, 16
 .cancelMenuItem_JoypadLoop
 	call JoypadLowSensitivity
-	ld a, [$ffb5]
+	ld a, [hJoy5]
 	and a ; pressed anything?
 	jr z, .cancelMenuItem_JoypadLoop
 	bit 0, a ; A button pressed?
@@ -914,7 +914,7 @@
 	ld [wGrassRate], a
 	inc a ; LINK_STATE_IN_CABLE_CLUB
 	ld [wLinkState], a
-	ld [$ffb5], a
+	ld [hJoy5], a
 	ld a, 10
 	ld [wAudioFadeOutControl], a
 	ld a, BANK(Music_Celadon)
--- a/scripts/tradecenter.asm
+++ b/scripts/tradecenter.asm
@@ -1,7 +1,7 @@
 TradeCenterScript:
 	call EnableAutoTextBoxDrawing
-	ld a, [$ffaa]
-	cp $2
+	ld a, [hSerialConnectionStatus]
+	cp USING_INTERNAL_CLOCK
 	ld a, SPRITE_FACING_LEFT
 	jr z, .next
 	ld a, SPRITE_FACING_RIGHT
@@ -21,8 +21,8 @@
 	ld [hl], a
 	ld a, SPRITE_FACING_LEFT
 	ld [wSpriteStateData1 + $19], a
-	ld a, [$ffaa]
-	cp $2
+	ld a, [hSerialConnectionStatus]
+	cp USING_INTERNAL_CLOCK
 	ret z
 	ld a, $7
 	ld [wSpriteStateData2 + $15], a