shithub: pokecrystal

Download patch

ref: 133e2fb7a7bcc914fa179a18bf0ed18a2099d0e8
parent: 1a2784d4142572487fdf10a44aa4752de287e89f
author: yenatch <yenatch@gmail.com>
date: Mon Dec 29 03:47:47 EST 2014

Use "- $ff00" instead of "& $ff" when dealing with hram.

--- a/engine/credits.asm
+++ b/engine/credits.asm
@@ -183,7 +183,7 @@
 	xor a
 	call ByteFill
 
-	ld a, rSCX & $ff
+	ld a, rSCX - $ff00
 	ld [hLCDStatCustom], a
 
 	call GetCreditsPalette
--- a/home/lcd.asm
+++ b/home/lcd.asm
@@ -3,7 +3,7 @@
 
 Function547:: ; 547
 	ld a, [hLCDStatCustom]
-	cp rSCX & $ff
+	cp rSCX - $ff00
 	ret nz
 	ld c, a
 	ld a, [LYOverrides]
--- a/main.asm
+++ b/main.asm
@@ -32,7 +32,7 @@
 ; 4031
 
 LoadPushOAM:: ; 4031
-	ld c, hPushOAM & $ff
+	ld c, hPushOAM - $ff00
 	ld b, PushOAMEnd - PushOAM
 	ld hl, PushOAM
 .loop
@@ -3941,10 +3941,15 @@
 	ld [Coins], a
 	ld [Coins + 1], a
 
+START_MONEY EQU 3000
+
+IF START_MONEY / $10000
+	ld a, START_MONEY / $10000
+ENDC
 	ld [Money], a
-	ld a, 3000 >> 8
+	ld a, START_MONEY / $100 % $100
 	ld [Money + 1], a
-	ld a, 3000 & $ff
+	ld a, START_MONEY % $100
 	ld [Money + 2], a
 
 	xor a
@@ -3951,11 +3956,11 @@
 	ld [$dc17], a
 
 	ld hl, $dc19
-	ld [hl], $0
+	ld [hl], 2300 / $10000
 	inc hl
-	ld [hl], $8
+	ld [hl], 2300 / $100 % $100
 	inc hl
-	ld [hl], $fc
+	ld [hl], 2300 % $100
 
 	call Function5ce9
 
@@ -57533,7 +57538,7 @@
 	ld a, $5
 	ld [rSVBK], a
 	call Function4e998
-	ld a, rSCX & $ff
+	ld a, rSCX - $ff00
 	ld [hLCDStatCustom], a
 	call Function4e9ab
 	xor a