shithub: pokered

Download patch

ref: c085aa4a2a5529f9c82e97ebe7912dfa509787f3
parent: f386dea5d8cb816f3cbc941e81e8acdaae710a99
author: luckytyphlosion <10688458+luckytyphlosion@users.noreply.github.com>
date: Sun Nov 18 12:54:46 EST 2018

Fix spritestatedata macros to be prefixed with w.

--- a/scripts/pewterpokecenter.asm
+++ b/scripts/pewterpokecenter.asm
@@ -29,7 +29,7 @@
 	ld bc, JigglypuffFacingDirectionsEnd - JigglypuffFacingDirections
 	call CopyData
 
-	ld a, [Sprite03SpriteImageIdx]
+	ld a, [wSprite03StateData1ImageIndex]
 	ld hl, wJigglypuffFacingDirections
 .findMatchingFacingDirectionLoop
 	cp [hl]
@@ -43,7 +43,7 @@
 	pop hl
 .loop
 	ld a, [hl]
-	ld [Sprite03SpriteImageIdx], a
+	ld [wSprite03StateData1ImageIndex], a
 
 ; rotate the array
 	push hl
--- a/wram.asm
+++ b/wram.asm
@@ -230,10 +230,9 @@
 ; C1xE
 ; C1xF
 spritestatedata1: MACRO
-\1SpriteStateData1::
 \1PictureID:: db
 \1MovementStatus:: db
-\1SpriteImageIdx:: db
+\1ImageIndex:: db
 \1YStepVector:: db
 \1YPixels:: db
 \1XStepVector:: db
@@ -242,30 +241,26 @@
 \1AnimFrameCounter:: db
 \1FacingDirection:: db
 	ds 6
-\1SpriteStateData1End::
+\1End::
 endm
 
-	spritestatedata1 Player
-	spritestatedata1 Sprite01
-	spritestatedata1 Sprite02
-	spritestatedata1 Sprite03
-	spritestatedata1 Sprite04
-	spritestatedata1 Sprite05
-	spritestatedata1 Sprite06
-	spritestatedata1 Sprite07
-	spritestatedata1 Sprite08
-	spritestatedata1 Sprite09
-	spritestatedata1 Sprite10
-	spritestatedata1 Sprite11
-	spritestatedata1 Sprite12
-	spritestatedata1 Sprite13
-	spritestatedata1 Sprite14
-	spritestatedata1 Sprite15
-	; ds $10 * $10
+wSpritePlayerStateData1::  spritestatedata1 wSpritePlayerStateData1
+wSprite01StateData1::      spritestatedata1 wSprite01StateData1
+wSprite02StateData1::      spritestatedata1 wSprite02StateData1
+wSprite03StateData1::      spritestatedata1 wSprite03StateData1
+wSprite04StateData1::      spritestatedata1 wSprite04StateData1
+wSprite05StateData1::      spritestatedata1 wSprite05StateData1
+wSprite06StateData1::      spritestatedata1 wSprite06StateData1
+wSprite07StateData1::      spritestatedata1 wSprite07StateData1
+wSprite08StateData1::      spritestatedata1 wSprite08StateData1
+wSprite09StateData1::      spritestatedata1 wSprite09StateData1
+wSprite10StateData1::      spritestatedata1 wSprite10StateData1
+wSprite11StateData1::      spritestatedata1 wSprite11StateData1
+wSprite12StateData1::      spritestatedata1 wSprite12StateData1
+wSprite13StateData1::      spritestatedata1 wSprite13StateData1
+wSprite14StateData1::      spritestatedata1 wSprite14StateData1
+wSprite15StateData1::      spritestatedata1 wSprite15StateData1
 
-
-;SECTION "Sprite State Data 2", WRAM0[$c200]
-
 wSpriteStateData2:: ; c200
 ; more data for all sprites on the current map
 ; holds info for 16 sprites with $10 bytes each
@@ -287,7 +282,6 @@
 ; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
 ; C2xF
 spritestatedata2: MACRO
-\1SpriteStateData2::
 \1WalkAnimationCounter:: db
 	ds 1
 \1YDisplacement:: db
@@ -300,26 +294,26 @@
 	ds 5
 \1SpriteImageBaseOffset:: db
 	ds 1
-\1SpriteStateData2End::
+\1End::
 endm
 
-	spritestatedata2 Player
-	spritestatedata2 Sprite01
-	spritestatedata2 Sprite02
-	spritestatedata2 Sprite03
-	spritestatedata2 Sprite04
-	spritestatedata2 Sprite05
-	spritestatedata2 Sprite06
-	spritestatedata2 Sprite07
-	spritestatedata2 Sprite08
-	spritestatedata2 Sprite09
-	spritestatedata2 Sprite10
-	spritestatedata2 Sprite11
-	spritestatedata2 Sprite12
-	spritestatedata2 Sprite13
-	spritestatedata2 Sprite14
-	spritestatedata2 Sprite15
-	; ds $10 * $10
+wSpritePlayerStateData2::  spritestatedata2 wSpritePlayerStateData2
+wSprite01StateData2::      spritestatedata2 wSprite01StateData2
+wSprite02StateData2::      spritestatedata2 wSprite02StateData2
+wSprite03StateData2::      spritestatedata2 wSprite03StateData2
+wSprite04StateData2::      spritestatedata2 wSprite04StateData2
+wSprite05StateData2::      spritestatedata2 wSprite05StateData2
+wSprite06StateData2::      spritestatedata2 wSprite06StateData2
+wSprite07StateData2::      spritestatedata2 wSprite07StateData2
+wSprite08StateData2::      spritestatedata2 wSprite08StateData2
+wSprite09StateData2::      spritestatedata2 wSprite09StateData2
+wSprite10StateData2::      spritestatedata2 wSprite10StateData2
+wSprite11StateData2::      spritestatedata2 wSprite11StateData2
+wSprite12StateData2::      spritestatedata2 wSprite12StateData2
+wSprite13StateData2::      spritestatedata2 wSprite13StateData2
+wSprite14StateData2::      spritestatedata2 wSprite14StateData2
+wSprite15StateData2::      spritestatedata2 wSprite15StateData2
+
 
 wSpriteDataEnd::