shithub: pokered

Download patch

ref: 1980a5befc36eecc892daa7264de9d48c714b19e
parent: 32a464b0f0e71ced1e1e6641407012b6f6ee0d55
author: PikalaxALT <PikalaxALT@gmail.com>
date: Fri Jan 29 06:20:47 EST 2016

Macrofy sprite status data in WRA0

--- a/data/hidden_item_coords.asm
+++ b/data/hidden_item_coords.asm
@@ -34,7 +34,7 @@
 	db ROUTE_23,$5a,$08
 	db VICTORY_ROAD_2,$02,$05
 	db VICTORY_ROAD_2,$07,$1a
-	db $6f,$0b,$0e
+	db UNUSED_MAP_6F,$0b,$0e
 	db VIRIDIAN_CITY,$04,$0e
 	db ROUTE_11,$05,$30
 	db ROUTE_12,$3f,$02
--- a/data/trainer_parties.asm
+++ b/data/trainer_parties.asm
@@ -57,6 +57,7 @@
 	; null-terminated
 
 YoungsterData:
+; Route 3
 	db 11,RATTATA,EKANS,0
 	db 14,SPEAROW,0
 	db 10,RATTATA,RATTATA,ZUBAT,0
@@ -71,9 +72,11 @@
 	db 18,NIDORAN_M,NIDORINO,0
 	db 17,SPEAROW,RATTATA,RATTATA,SPEAROW,0
 BugCatcherData:
+; Viridian Forest
 	db 6,WEEDLE,CATERPIE,0
 	db 7,WEEDLE,KAKUNA,WEEDLE,0
 	db 9,WEEDLE,0
+; Route 3
 	db 10,CATERPIE,WEEDLE,CATERPIE,0
 	db 9,WEEDLE,KAKUNA,CATERPIE,METAPOD,0
 	db 11,CATERPIE,METAPOD,0
@@ -86,6 +89,7 @@
 	db 19,BEEDRILL,BEEDRILL,0
 	db 20,CATERPIE,WEEDLE,VENONAT,0
 LassData:
+; Route 3
 	db 9,PIDGEY,PIDGEY,0
 	db 10,RATTATA,NIDORAN_M,0
 	db 14,JIGGLYPUFF,0
--- a/engine/overworld/movement.asm
+++ b/engine/overworld/movement.asm
@@ -95,7 +95,7 @@
 	jr nz, .next2
 	ld a, $80
 .next2
-	ld [wSpriteStateData2 + $07], a
+	ld [wSpriteStateData2 + 7], a
 	ret
 
 UnusedReadSpriteDataFunction: ; 4ec7 (1:4ec7)
@@ -169,7 +169,7 @@
 	call LoadDEPlusA ; a = [wNPCMovementDirections + movement byte 1]
 	cp $e0
 	jp z, ChangeFacingDirection
-	cp $ff
+	cp STAY
 	jr nz, .next
 ; reached end of wNPCMovementDirections list
 	ld [hl], a ; store $ff in movement byte 1, disabling scripted movement
@@ -180,7 +180,7 @@
 	ld [wWastedByteCD3A], a
 	ret
 .next
-	cp $fe
+	cp WALK
 	jr nz, .determineDirection
 ; current NPC movement data is $fe. this seems buggy
 	ld [hl], $1     ; set movement byte 1 to $1
--- a/macros.asm
+++ b/macros.asm
@@ -252,6 +252,11 @@
 	jp PrintPredefTextID
 ENDM
 
+sound0x0A: macro
+	db $11
+endm
+
+
 WALK EQU $FE
 STAY EQU $FF
 
--- a/roms.md5
+++ b/roms.md5
@@ -1,2 +1,2 @@
-3d45c1ee9abd5738df46d2bdda8b57dc  pokered.gbc
-50927e843568814f7ed45ec4f944bd8b  pokeblue.gbc
+3d45c1ee9abd5738df46d2bdda8b57dc  pokered.gb
+50927e843568814f7ed45ec4f944bd8b  pokeblue.gb
--- a/scripts/blueshouse.asm
+++ b/scripts/blueshouse.asm
@@ -1,7 +1,7 @@
 BluesHouseScript: ; 19b3b (6:5b3b)
 	call EnableAutoTextBoxDrawing
-	ld hl,BluesHouseScriptPointers
-	ld a,[wBluesHouseCurScript]
+	ld hl, BluesHouseScriptPointers
+	ld a, [wBluesHouseCurScript]
 	jp CallFunctionInTable
 
 BluesHouseScriptPointers: ; 19b47 (6:5b47)
@@ -12,8 +12,8 @@
 	SetEvent EVENT_ENTERED_BLUES_HOUSE
 
 	; trigger the next script
-	ld a,1
-	ld [wBluesHouseCurScript],a
+	ld a, 1
+	ld [wBluesHouseCurScript], a
 	ret
 
 BluesHouseScript1: ; 19b56 (6:5b56)
@@ -27,31 +27,34 @@
 BluesHouseText1: ; 19b5d (6:5b5d)
 	TX_ASM
 	CheckEvent EVENT_GOT_TOWN_MAP
-	jr nz,.GotMap
+	jr nz, .GotMap
 	CheckEvent EVENT_GOT_POKEDEX
-	jr nz,.GiveMap
-	ld hl,DaisyInitialText
+	jr nz, .GiveMap
+	ld hl, DaisyInitialText
 	call PrintText
 	jr .done
+
 .GiveMap
-	ld hl,DaisyOfferMapText
+	ld hl, DaisyOfferMapText
 	call PrintText
 	lb bc, TOWN_MAP, 1
 	call GiveItem
 	jr nc, .BagFull
-	ld a,HS_TOWN_MAP
-	ld [wMissableObjectIndex],a
+	ld a, HS_TOWN_MAP
+	ld [wMissableObjectIndex], a
 	predef HideObject ; hide table map object
-	ld hl,GotMapText
+	ld hl, GotMapText
 	call PrintText
 	SetEvent EVENT_GOT_TOWN_MAP
 	jr .done
+
 .GotMap
-	ld hl,DaisyUseMapText
+	ld hl, DaisyUseMapText
 	call PrintText
 	jr .done
+
 .BagFull
-	ld hl,DaisyBagFullText
+	ld hl, DaisyBagFullText
 	call PrintText
 .done
 	jp TextScriptEnd
@@ -66,7 +69,8 @@
 
 GotMapText: ; 19bb4 (6:5bb4)
 	TX_FAR _GotMapText
-	db $11,"@"
+	sound0x0A
+	db "@"
 
 DaisyBagFullText: ; 19bba (6:5bba)
 	TX_FAR _DaisyBagFullText
--- a/text/maps/vermilion_dock.asm
+++ b/text/maps/vermilion_dock.asm
@@ -1,3 +1,4 @@
 _VermilionDockText1::
-	db $0, $57
+	text ""
+	done
 
--- a/wram.asm
+++ b/wram.asm
@@ -228,9 +228,41 @@
 ; C1xD
 ; C1xE
 ; C1xF
-	ds $10 * $10
+spritestatedata1: MACRO
+\1SpriteStateData1::
+\1PictureID:: db
+\1MovementStatus:: db
+\1SpriteImageIdx:: db
+\1YStepVector:: db
+\1YPixels:: db
+\1XStepVector:: db
+\1XPixels:: db
+\1IntraAnimFrameCounter:: db
+\1AnimFrameCounter:: db
+\1FacingDirection:: db
+	ds 6
+\1SpriteStateData1End::
+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
 
+
 ;SECTION "Sprite State Data 2", WRAM0[$c200]
 
 wSpriteStateData2:: ; c200
@@ -253,7 +285,40 @@
 ; C2xD
 ; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
 ; C2xF
-	ds $10 * $10
+spritestatedata2: MACRO
+\1SpriteStateData2::
+\1WalkAnimationCounter:: db
+	ds 1
+\1YDisplacement:: db
+\1XDisplacement:: db
+\1MapY:: db
+\1MapX:: db
+\1MovementByte1:: db
+\1GrassPriority:: db
+\1MovementDelay:: db
+	ds 5
+\1SpriteImageBaseOffset:: db
+	ds 1
+\1SpriteStateData2End::
+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
 
 wSpriteDataEnd::