shithub: pokecrystal

Download patch

ref: 1c0fff7668dffccbc498bdaddfe4dcdf6fb08c7e
parent: eb1e3636bb71509546c274bf2a5910d8e71a9600
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Sat Aug 25 10:34:25 EDT 2018

hLabel - $ff00 -> LOW(hLabel)

--- a/engine/battle/battle_transition.asm
+++ b/engine/battle/battle_transition.asm
@@ -315,7 +315,7 @@
 
 	call StartTrainerBattle_NextScene
 
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	xor a
 	ldh [hLYOverrideStart], a
--- a/engine/battle/sliding_intro.asm
+++ b/engine/battle/sliding_intro.asm
@@ -4,7 +4,7 @@
 	ld a, BANK(wLYOverrides)
 	ldh [rSVBK], a
 	call .subfunction1
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	call .subfunction2
 	xor a
--- a/engine/battle_anims/bg_effects.asm
+++ b/engine/battle_anims/bg_effects.asm
@@ -978,7 +978,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	ldh [hLCDCPointer], a
 	xor a
 	ldh [hLYOverrideStart], a
@@ -998,7 +998,7 @@
 
 BattleBGEffect_30:
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms1
 	call EndBattleBGEffect
 	ret
@@ -1051,7 +1051,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	xor a
 	ldh [hLYOverrideStart], a
@@ -1088,7 +1088,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	lb de, 6, 5
 	call Functionc8f2e
@@ -1112,7 +1112,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ld hl, BG_EFFECT_STRUCT_03
 	add hl, bc
@@ -1142,7 +1142,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1233,7 +1233,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ld hl, BG_EFFECT_STRUCT_03
 	add hl, bc
@@ -1295,7 +1295,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1344,7 +1344,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1410,7 +1410,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1444,7 +1444,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms2
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1575,7 +1575,7 @@
 BGEffect2d_2f_zero:
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1618,7 +1618,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1656,7 +1656,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1710,7 +1710,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ret
 
@@ -1752,7 +1752,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	call BattleBGEffect_SetLCDStatCustoms2
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -1909,7 +1909,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ld hl, BG_EFFECT_STRUCT_BATTLE_TURN
 	add hl, bc
@@ -1950,7 +1950,7 @@
 	call BattleBGEffects_IncrementJumptable
 	ld a, $e4
 	call BattleBGEffects_SetLYOverrides
-	ld a, rBGP - $ff00
+	ld a, LOW(rBGP)
 	ldh [hLCDCPointer], a
 	xor a
 	ldh [hLYOverrideStart], a
@@ -2175,7 +2175,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	call BattleBGEffect_SetLCDStatCustoms1
 	ldh a, [hLYOverrideEnd]
 	inc a
@@ -2220,7 +2220,7 @@
 .zero
 	call BattleBGEffects_IncrementJumptable
 	call BattleBGEffects_ClearLYOverrides
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	xor a
 	ldh [hLYOverrideStart], a
--- a/engine/battle_anims/functions.asm
+++ b/engine/battle_anims/functions.asm
@@ -1137,7 +1137,7 @@
 	dw .four
 .zero
 	call BattleAnim_IncAnonJumptableIndex
-	ld a, rSCY - $ff00
+	ld a, LOW(rSCY)
 	ldh [hLCDCPointer], a
 	ld a, $58
 	ldh [hLYOverrideStart], a
--- a/engine/events/magnet_train.asm
+++ b/engine/events/magnet_train.asm
@@ -242,7 +242,7 @@
 	ld bc, wLYOverridesBackupEnd - wLYOverridesBackup
 	ld a, [wMagnetTrainInitPosition]
 	call ByteFill
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	ret
 
--- a/engine/gfx/load_push_oam.asm
+++ b/engine/gfx/load_push_oam.asm
@@ -1,5 +1,5 @@
 WriteOAMDMACodeToHRAM::
-	ld c, hTransferVirtualOAM - $ff00
+	ld c, LOW(hTransferVirtualOAM)
 	ld b, .PushOAMEnd - .PushOAM
 	ld hl, .PushOAM
 .loop
--- a/engine/movie/credits.asm
+++ b/engine/movie/credits.asm
@@ -68,7 +68,7 @@
 	xor a
 	call ByteFill
 
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 
 	call GetCreditsPalette
--- a/engine/movie/crystal_intro.asm
+++ b/engine/movie/crystal_intro.asm
@@ -1994,7 +1994,7 @@
 
 	pop af
 	ldh [rSVBK], a
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 	ret
 
--- a/engine/movie/title.asm
+++ b/engine/movie/title.asm
@@ -177,7 +177,7 @@
 	call ByteFill
 
 ; Let LCD Stat know we're messing around with SCX
-	ld a, rSCX - $ff00
+	ld a, LOW(rSCX)
 	ldh [hLCDCPointer], a
 
 	pop af
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -2,7 +2,7 @@
 
 Unreferenced_Function547::
 	ldh a, [hLCDCPointer]
-	cp rSCX - $ff00
+	cp LOW(rSCX)
 	ret nz
 	ld c, a
 	ld a, [wLYOverrides]