shithub: pokecrystal

Download patch

ref: 12412713fdcf1639b4df6d9965215815866e30c3
parent: 992a9e506cba96b8420857c2cce56249f9a14691
author: yenatch <[email protected]>
date: Thu Apr 17 18:06:02 EDT 2014

Fix static banks for monster icons.

--- a/main.asm
+++ b/main.asm
@@ -74964,7 +74964,7 @@
 	ld a, e
 	call ReadMonMenuIcon
 	ld l, a
-	ld h, $0
+	ld h, 0
 	add hl, hl
 	ld de, IconPointers
 	add hl, de
@@ -74971,8 +74971,8 @@
 	ld a, [hli]
 	ld e, a
 	ld d, [hl]
-	ld b, $23
-	ld c, $8
+	ld b, BANK(Icons)
+	ld c, 8
 	ret
 ; 8e83f
 
@@ -75261,7 +75261,7 @@
 	ld de, $80 ; 8 tiles
 	add hl, de
 	ld de, HeldItemIcons
-	ld bc, $2302
+	lb bc, BANK(HeldItemIcons), 2
 	call GetGFXUnlessMobile
 	ld a, [$c3b7]
 	add 10
@@ -75274,20 +75274,20 @@
 ; 8ea17
 
 GetIcon_de: ; 8ea17
-; Load icon graphics into VRAM starting from tile de
+; Load icon graphics into VRAM starting from tile de.
 	ld l, e
 	ld h, d
 	jr GetIcon
 	
 GetIcon_a: ; 8ea1b
-; Load icon graphics into VRAM starting from tile a
+; Load icon graphics into VRAM starting from tile a.
 	ld l, a
 	ld h, 0
 	
 GetIcon: ; 8ea1e
-; Load icon graphics into VRAM starting from tile hl
+; Load icon graphics into VRAM starting from tile hl.
 
-; One tile is 16 bytes long
+; One tile is 16 bytes long.
 	add hl, hl
 	add hl, hl
 	add hl, hl
@@ -75296,9 +75296,9 @@
 	ld de, VTiles0
 	add hl, de
 	push hl
-	
-; Reading the icon pointer table would only make sense if they were
-; scattered. However, the icons are contiguous and in-order.
+
+; The icons are contiguous, in order and of the same
+; size, so the pointer table is somewhat redundant.
 	ld a, [CurIcon]
 	push hl
 	ld l, a
@@ -75311,8 +75311,9 @@
 	ld d, [hl]
 	pop hl
 	
-	ld bc, $2308
+	lb bc, BANK(Icons), 8
 	call GetGFXUnlessMobile
+
 	pop hl
 	ret
 ; 8ea3f
--- a/menu/mon_icons.asm
+++ b/menu/mon_icons.asm
@@ -307,6 +307,7 @@
 	dw SudowoodoIcon
 	dw BigmonIcon
 
+Icons:
 NullIcon:
 PoliwagIcon:      INCBIN "gfx/icon/poliwag.2bpp" ; 0x8ec0d
 JigglypuffIcon:   INCBIN "gfx/icon/jigglypuff.2bpp" ; 0x8ec8d