shithub: pokered

Download patch

ref: 71e161da53f92e1de194986a79e5a8dafdb343b1
parent: 3426db1c09ba576dd67b0db9f4bdd7f02c8823f4
author: IIMarckus <iimarckus@gmail.com>
date: Sat Apr 9 19:30:24 EDT 2011

Use human-readable names instead of memory addresses.

hg-commit-id: da67afc569e2


--- a/constants.asm
+++ b/constants.asm
@@ -101,6 +101,11 @@
 
 W_ENEMYMON6MOVE3 EQU $D98A
 
+; hardware registers, from the pandocs http://nocash.emubase.de/pandocs.htm
+rBGP EQU $FF47
+rOBP0 EQU $FF48
+rOBP1 EQU $FF49
+
 
 ; pokemon name constants
 RHYDON     EQU $01
--- a/pokered.asm
+++ b/pokered.asm
@@ -423,11 +423,11 @@
 	dec h
 .jr0\@
 	ld a,[hli]
-	ld [$ff47],a
+	ld [rBGP],a
 	ld a,[hli]
-	ld [$ff48],a
+	ld [rOBP0],a
 	ld a,[hli]
-	ld [$ff49],a
+	ld [rOBP1],a
 	ret
 
 GBFadeOut1: ; 20D1
@@ -441,11 +441,11 @@
 
 GBFadeOutCommon:
 	ld a,[hli]
-	ld [$ff47],a
+	ld [rBGP],a
 	ld a,[hli]
-	ld [$ff48],a
+	ld [rOBP0],a
 	ld a,[hli]
-	ld [$ff49],a
+	ld [rOBP1],a
 	ld c,8
 	call DelayFrames
 	dec b
@@ -463,11 +463,11 @@
 
 GBFadeInCommon:
 	ld a,[hld]
-	ld [$ff49],a
+	ld [rOBP1],a
 	ld a,[hld]
-	ld [$ff48],a
+	ld [rOBP0],a
 	ld a,[hld]
-	ld [$ff47],a
+	ld [rBGP],a
 	ld c,8
 	call DelayFrames
 	dec b
@@ -892,7 +892,7 @@
 	ld b,6
 .next\@
 	ld a,[hli]
-	ld [$FF47],a
+	ld [rBGP],a
 	ld c,10
 	call DelayFrames
 	dec b
@@ -913,7 +913,7 @@
 	call DelayFrame
 
 	ld a,$E4
-	ld [$FF47],a
+	ld [rBGP],a
 .next\@
 	call DelayFrame
 	ld a,[$FF4B]