mirror of
https://github.com/thornAvery/kep-hack.git
synced 2025-09-17 02:40:50 +12:00
Macrofy sprite status data in WRA0
This commit is contained in:
parent
32a464b0f0
commit
1980a5befc
|
@ -34,7 +34,7 @@ HiddenItemCoords: ; 766b8 (1d:66b8)
|
||||||
db ROUTE_23,$5a,$08
|
db ROUTE_23,$5a,$08
|
||||||
db VICTORY_ROAD_2,$02,$05
|
db VICTORY_ROAD_2,$02,$05
|
||||||
db VICTORY_ROAD_2,$07,$1a
|
db VICTORY_ROAD_2,$07,$1a
|
||||||
db $6f,$0b,$0e
|
db UNUSED_MAP_6F,$0b,$0e
|
||||||
db VIRIDIAN_CITY,$04,$0e
|
db VIRIDIAN_CITY,$04,$0e
|
||||||
db ROUTE_11,$05,$30
|
db ROUTE_11,$05,$30
|
||||||
db ROUTE_12,$3f,$02
|
db ROUTE_12,$3f,$02
|
||||||
|
|
|
@ -57,6 +57,7 @@ TrainerDataPointers: ; 39d3b (e:5d3b)
|
||||||
; null-terminated
|
; null-terminated
|
||||||
|
|
||||||
YoungsterData:
|
YoungsterData:
|
||||||
|
; Route 3
|
||||||
db 11,RATTATA,EKANS,0
|
db 11,RATTATA,EKANS,0
|
||||||
db 14,SPEAROW,0
|
db 14,SPEAROW,0
|
||||||
db 10,RATTATA,RATTATA,ZUBAT,0
|
db 10,RATTATA,RATTATA,ZUBAT,0
|
||||||
|
@ -71,9 +72,11 @@ YoungsterData:
|
||||||
db 18,NIDORAN_M,NIDORINO,0
|
db 18,NIDORAN_M,NIDORINO,0
|
||||||
db 17,SPEAROW,RATTATA,RATTATA,SPEAROW,0
|
db 17,SPEAROW,RATTATA,RATTATA,SPEAROW,0
|
||||||
BugCatcherData:
|
BugCatcherData:
|
||||||
|
; Viridian Forest
|
||||||
db 6,WEEDLE,CATERPIE,0
|
db 6,WEEDLE,CATERPIE,0
|
||||||
db 7,WEEDLE,KAKUNA,WEEDLE,0
|
db 7,WEEDLE,KAKUNA,WEEDLE,0
|
||||||
db 9,WEEDLE,0
|
db 9,WEEDLE,0
|
||||||
|
; Route 3
|
||||||
db 10,CATERPIE,WEEDLE,CATERPIE,0
|
db 10,CATERPIE,WEEDLE,CATERPIE,0
|
||||||
db 9,WEEDLE,KAKUNA,CATERPIE,METAPOD,0
|
db 9,WEEDLE,KAKUNA,CATERPIE,METAPOD,0
|
||||||
db 11,CATERPIE,METAPOD,0
|
db 11,CATERPIE,METAPOD,0
|
||||||
|
@ -86,6 +89,7 @@ BugCatcherData:
|
||||||
db 19,BEEDRILL,BEEDRILL,0
|
db 19,BEEDRILL,BEEDRILL,0
|
||||||
db 20,CATERPIE,WEEDLE,VENONAT,0
|
db 20,CATERPIE,WEEDLE,VENONAT,0
|
||||||
LassData:
|
LassData:
|
||||||
|
; Route 3
|
||||||
db 9,PIDGEY,PIDGEY,0
|
db 9,PIDGEY,PIDGEY,0
|
||||||
db 10,RATTATA,NIDORAN_M,0
|
db 10,RATTATA,NIDORAN_M,0
|
||||||
db 14,JIGGLYPUFF,0
|
db 14,JIGGLYPUFF,0
|
||||||
|
|
|
@ -95,7 +95,7 @@ UpdatePlayerSprite: ; 4e31 (1:4e31)
|
||||||
jr nz, .next2
|
jr nz, .next2
|
||||||
ld a, $80
|
ld a, $80
|
||||||
.next2
|
.next2
|
||||||
ld [wSpriteStateData2 + $07], a
|
ld [wSpriteStateData2 + 7], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
UnusedReadSpriteDataFunction: ; 4ec7 (1:4ec7)
|
UnusedReadSpriteDataFunction: ; 4ec7 (1:4ec7)
|
||||||
|
@ -169,7 +169,7 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
call LoadDEPlusA ; a = [wNPCMovementDirections + movement byte 1]
|
call LoadDEPlusA ; a = [wNPCMovementDirections + movement byte 1]
|
||||||
cp $e0
|
cp $e0
|
||||||
jp z, ChangeFacingDirection
|
jp z, ChangeFacingDirection
|
||||||
cp $ff
|
cp STAY
|
||||||
jr nz, .next
|
jr nz, .next
|
||||||
; reached end of wNPCMovementDirections list
|
; reached end of wNPCMovementDirections list
|
||||||
ld [hl], a ; store $ff in movement byte 1, disabling scripted movement
|
ld [hl], a ; store $ff in movement byte 1, disabling scripted movement
|
||||||
|
@ -180,7 +180,7 @@ UpdateNPCSprite: ; 4ed1 (1:4ed1)
|
||||||
ld [wWastedByteCD3A], a
|
ld [wWastedByteCD3A], a
|
||||||
ret
|
ret
|
||||||
.next
|
.next
|
||||||
cp $fe
|
cp WALK
|
||||||
jr nz, .determineDirection
|
jr nz, .determineDirection
|
||||||
; current NPC movement data is $fe. this seems buggy
|
; current NPC movement data is $fe. this seems buggy
|
||||||
ld [hl], $1 ; set movement byte 1 to $1
|
ld [hl], $1 ; set movement byte 1 to $1
|
||||||
|
|
|
@ -252,6 +252,11 @@ tx_pre_jump: MACRO
|
||||||
jp PrintPredefTextID
|
jp PrintPredefTextID
|
||||||
ENDM
|
ENDM
|
||||||
|
|
||||||
|
sound0x0A: macro
|
||||||
|
db $11
|
||||||
|
endm
|
||||||
|
|
||||||
|
|
||||||
WALK EQU $FE
|
WALK EQU $FE
|
||||||
STAY EQU $FF
|
STAY EQU $FF
|
||||||
|
|
||||||
|
|
4
roms.md5
4
roms.md5
|
@ -1,2 +1,2 @@
|
||||||
3d45c1ee9abd5738df46d2bdda8b57dc pokered.gbc
|
3d45c1ee9abd5738df46d2bdda8b57dc pokered.gb
|
||||||
50927e843568814f7ed45ec4f944bd8b pokeblue.gbc
|
50927e843568814f7ed45ec4f944bd8b pokeblue.gb
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
BluesHouseScript: ; 19b3b (6:5b3b)
|
BluesHouseScript: ; 19b3b (6:5b3b)
|
||||||
call EnableAutoTextBoxDrawing
|
call EnableAutoTextBoxDrawing
|
||||||
ld hl,BluesHouseScriptPointers
|
ld hl, BluesHouseScriptPointers
|
||||||
ld a,[wBluesHouseCurScript]
|
ld a, [wBluesHouseCurScript]
|
||||||
jp CallFunctionInTable
|
jp CallFunctionInTable
|
||||||
|
|
||||||
BluesHouseScriptPointers: ; 19b47 (6:5b47)
|
BluesHouseScriptPointers: ; 19b47 (6:5b47)
|
||||||
|
@ -12,8 +12,8 @@ BluesHouseScript0: ; 19b4b (6:5b4b)
|
||||||
SetEvent EVENT_ENTERED_BLUES_HOUSE
|
SetEvent EVENT_ENTERED_BLUES_HOUSE
|
||||||
|
|
||||||
; trigger the next script
|
; trigger the next script
|
||||||
ld a,1
|
ld a, 1
|
||||||
ld [wBluesHouseCurScript],a
|
ld [wBluesHouseCurScript], a
|
||||||
ret
|
ret
|
||||||
|
|
||||||
BluesHouseScript1: ; 19b56 (6:5b56)
|
BluesHouseScript1: ; 19b56 (6:5b56)
|
||||||
|
@ -27,31 +27,34 @@ BluesHouseTextPointers: ; 19b57 (6:5b57)
|
||||||
BluesHouseText1: ; 19b5d (6:5b5d)
|
BluesHouseText1: ; 19b5d (6:5b5d)
|
||||||
TX_ASM
|
TX_ASM
|
||||||
CheckEvent EVENT_GOT_TOWN_MAP
|
CheckEvent EVENT_GOT_TOWN_MAP
|
||||||
jr nz,.GotMap
|
jr nz, .GotMap
|
||||||
CheckEvent EVENT_GOT_POKEDEX
|
CheckEvent EVENT_GOT_POKEDEX
|
||||||
jr nz,.GiveMap
|
jr nz, .GiveMap
|
||||||
ld hl,DaisyInitialText
|
ld hl, DaisyInitialText
|
||||||
call PrintText
|
call PrintText
|
||||||
jr .done
|
jr .done
|
||||||
|
|
||||||
.GiveMap
|
.GiveMap
|
||||||
ld hl,DaisyOfferMapText
|
ld hl, DaisyOfferMapText
|
||||||
call PrintText
|
call PrintText
|
||||||
lb bc, TOWN_MAP, 1
|
lb bc, TOWN_MAP, 1
|
||||||
call GiveItem
|
call GiveItem
|
||||||
jr nc, .BagFull
|
jr nc, .BagFull
|
||||||
ld a,HS_TOWN_MAP
|
ld a, HS_TOWN_MAP
|
||||||
ld [wMissableObjectIndex],a
|
ld [wMissableObjectIndex], a
|
||||||
predef HideObject ; hide table map object
|
predef HideObject ; hide table map object
|
||||||
ld hl,GotMapText
|
ld hl, GotMapText
|
||||||
call PrintText
|
call PrintText
|
||||||
SetEvent EVENT_GOT_TOWN_MAP
|
SetEvent EVENT_GOT_TOWN_MAP
|
||||||
jr .done
|
jr .done
|
||||||
|
|
||||||
.GotMap
|
.GotMap
|
||||||
ld hl,DaisyUseMapText
|
ld hl, DaisyUseMapText
|
||||||
call PrintText
|
call PrintText
|
||||||
jr .done
|
jr .done
|
||||||
|
|
||||||
.BagFull
|
.BagFull
|
||||||
ld hl,DaisyBagFullText
|
ld hl, DaisyBagFullText
|
||||||
call PrintText
|
call PrintText
|
||||||
.done
|
.done
|
||||||
jp TextScriptEnd
|
jp TextScriptEnd
|
||||||
|
@ -66,7 +69,8 @@ DaisyOfferMapText: ; 19baf (6:5baf)
|
||||||
|
|
||||||
GotMapText: ; 19bb4 (6:5bb4)
|
GotMapText: ; 19bb4 (6:5bb4)
|
||||||
TX_FAR _GotMapText
|
TX_FAR _GotMapText
|
||||||
db $11,"@"
|
sound0x0A
|
||||||
|
db "@"
|
||||||
|
|
||||||
DaisyBagFullText: ; 19bba (6:5bba)
|
DaisyBagFullText: ; 19bba (6:5bba)
|
||||||
TX_FAR _DaisyBagFullText
|
TX_FAR _DaisyBagFullText
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
_VermilionDockText1::
|
_VermilionDockText1::
|
||||||
db $0, $57
|
text ""
|
||||||
|
done
|
||||||
|
|
||||||
|
|
69
wram.asm
69
wram.asm
|
@ -228,7 +228,39 @@ wSpriteStateData1:: ; c100
|
||||||
; C1xD
|
; C1xD
|
||||||
; C1xE
|
; C1xE
|
||||||
; C1xF
|
; 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]
|
;SECTION "Sprite State Data 2", WRAM0[$c200]
|
||||||
|
@ -253,7 +285,40 @@ wSpriteStateData2:: ; c200
|
||||||
; C2xD
|
; C2xD
|
||||||
; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
|
; C2xE: sprite image base offset (in video ram, player always has value 1, used to compute c1x2)
|
||||||
; C2xF
|
; 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::
|
wSpriteDataEnd::
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue