named animation functions/variables

This commit is contained in:
YamaArashi 2015-07-24 14:39:45 -07:00
parent e6d02b4b7b
commit 82512e4491
41 changed files with 781 additions and 642 deletions

View file

@ -6,7 +6,7 @@ const_value = $D8
const SE_WAVY_SCREEN ; $D8 used in Psywave/Night Shade/Psychic etc.
const SE_SUBSTITUTE_MON ; $D9 used in Substitute (turns the pokemon into a mini sprite)
const SE_SHAKE_BACK_AND_FORTH ; $DA used in Double Team
const SE_SLIDE_ENEMY_MON_OUT ; $DB used in Whirlwind
const SE_SLIDE_ENEMY_MON_OFF ; $DB used in Whirlwind
const SE_SHOW_ENEMY_MON_PIC ; $DC used in Seismic Toss
const SE_SHOW_MON_PIC ; $DD used in Low Kick/Quick Attack/Seismic Toss etc.
const SE_BLINK_ENEMY_MON ; $DE used in Seismic Toss
@ -16,7 +16,7 @@ const_value = $D8
const SE_SPIRAL_BALLS_INWARD ; $E2 used in Growth/Focus Energy/Hyper Beam etc.
const SE_SHAKE_ENEMY_HUD_2 ; $E3 unused
const SE_SHAKE_ENEMY_HUD ; $E4
const SE_SLIDE_MON_HALF_LEFT ; $E5 used in Softboiled
const SE_SLIDE_MON_HALF_OFF ; $E5 used in Softboiled
const SE_PETALS_FALLING ; $E6 used in Petal Dance
const SE_LEAVES_FALLING ; $E7 used in Razor Leaf
const SE_TRANSFORM_MON ; $E8 used in Transform
@ -31,7 +31,7 @@ const_value = $D8
const SE_RESET_MON_POSITION ; $F1 used in Tackle/Body Slam/etc.
const SE_MOVE_MON_HORIZONTALLY ; $F2 used in Tackle/Body Slam/etc.
const SE_BLINK_MON ; $F3 used in Recover
const SE_SLIDE_MON_OUT ; $F4 used in Seismic Toss/Low Kick/etc.
const SE_SLIDE_MON_OFF ; $F4 used in Seismic Toss/Low Kick/etc.
const SE_FLASH_MON_PIC ; $F5
const SE_SLIDE_MON_DOWN ; $F6 used in Withdraw/Waterfall/fainting
const SE_SLIDE_MON_UP ; $F7 used in Dig/Waterfall/etc.

View file

@ -296,7 +296,7 @@ WingAttackAnim: ; 7a277 (1e:6277)
WhirlwindAnim: ; 7a27b (1e:627b)
db $46,$11,$10
db SE_SLIDE_ENEMY_MON_OUT, $FF
db SE_SLIDE_ENEMY_MON_OFF, $FF
db $FF
FlyAnim: ; 7a281 (1e:6281)
@ -550,19 +550,19 @@ DrillPeckAnim: ; 7a3c8 (1e:63c8)
db $FF
SubmissionAnim: ; 7a3cc (1e:63cc)
db SE_SLIDE_MON_OUT, $41
db SE_SLIDE_MON_OFF, $41
db $06,$FF,$01
db SE_SHOW_MON_PIC, $FF
db $FF
LowKickAnim: ; 7a3d4 (1e:63d4)
db SE_SLIDE_MON_OUT, $42
db SE_SLIDE_MON_OFF, $42
db $46,$FF,$04
db SE_SHOW_MON_PIC, $FF
db $FF
CounterAnim: ; 7a3dc (1e:63dc)
db SE_SLIDE_MON_OUT, $43
db SE_SLIDE_MON_OFF, $43
db $46,$FF,$04
db SE_SHOW_MON_PIC, $FF
db $FF
@ -571,7 +571,7 @@ SeismicTossAnim: ; 7a3e4 (1e:63e4)
db SE_BLINK_ENEMY_MON, $FF
db $41,$8B,$4E
db SE_HIDE_ENEMY_MON_PIC, $FF
db SE_SLIDE_MON_OUT, $FF
db SE_SLIDE_MON_OFF, $FF
db $42,$44,$4F
db SE_DELAY_ANIMATION_10, $FF
db SE_DELAY_ANIMATION_10, $FF
@ -736,7 +736,7 @@ AgilityAnim: ; 7a4c3 (1e:64c3)
db $FF
QuickAttackAnim: ; 7a4c8 (1e:64c8)
db SE_SLIDE_MON_OUT, $61
db SE_SLIDE_MON_OFF, $61
db $46,$FF,$04
db SE_SHOW_MON_PIC, $FF
db $FF
@ -960,7 +960,7 @@ KinesisAnim: ; 7a5fa (1e:65fa)
db $FF
SoftboiledAnim: ; 7a5fe (1e:65fe)
db SE_SLIDE_MON_HALF_LEFT, $48
db SE_SLIDE_MON_HALF_OFF, $48
db $08,$86,$4C
db SE_LIGHT_SCREEN_PALETTE, $FF
db SE_SPIRAL_BALLS_INWARD, $FF
@ -1119,7 +1119,7 @@ SlashAnim: ; 7a6cd (1e:66cd)
db $FF
SubstituteAnim: ; 7a6d1 (1e:66d1)
db SE_SLIDE_MON_OUT, $A3
db SE_SLIDE_MON_OFF, $A3
db $08,$FF,$47
db SE_SUBSTITUTE_MON, $FF
db $FF

View file

@ -65,16 +65,16 @@ DisplayCreditsMon: ; 740cb (1d:40cb)
call GetMonHeader
call LoadFrontSpriteByMonIndex
ld hl,vBGMap0 + $c
call CopyTileMapToVRAM
call CreditsCopyTileMapToVRAM
xor a
ld [H_AUTOBGTRANSFERENABLED],a
call LoadScreenTilesFromBuffer1
ld hl,vBGMap0
call CopyTileMapToVRAM
call CreditsCopyTileMapToVRAM
ld a,$A7
ld [rWX],a
ld hl,vBGMap1
call CopyTileMapToVRAM
call CreditsCopyTileMapToVRAM
call FillMiddleOfScreenWithWhite
ld a,%11111100 ; make the mon a black silhouette
ld [rBGP],a
@ -136,12 +136,12 @@ HoFGBPalettes: ; 74160 (1d:4160)
db %11100000
db %11110000
CopyTileMapToVRAM: ; 74164 (1d:4164)
CreditsCopyTileMapToVRAM: ; 74164 (1d:4164)
ld a, l
ld [H_AUTOBGTRANSFERDEST], a
ld a, h
ld [H_AUTOBGTRANSFERDEST + 1], a
ld a, $1
ld a, 1
ld [H_AUTOBGTRANSFERENABLED], a
jp Delay3

File diff suppressed because it is too large Load diff

View file

@ -210,28 +210,28 @@ BattleTransition_Spiral: ; 70a72 (1c:4a72)
.outwardSpiral
coord hl, 10, 10
ld a, $3
ld [wd09f], a
ld [wOutwardSpiralCurrentDirection], a
ld a, l
ld [wd09b], a
ld [wOutwardSpiralTileMapPointer + 1], a
ld a, h
ld [wd09a], a
ld b, $78
.loop1
ld c, $3
.loop2
ld [wOutwardSpiralTileMapPointer], a
ld b, 120
.loop
ld c, 3
.innerLoop
push bc
call BattleTransition_OutwardSpiral_
pop bc
dec c
jr nz, .loop2
jr nz, .innerLoop
call DelayFrame
dec b
jr nz, .loop1
jr nz, .loop
.done
call BattleTransition_BlackScreen
xor a
ld [wd09b], a
ld [wd09a], a
ld [wOutwardSpiralTileMapPointer + 1], a
ld [wOutwardSpiralTileMapPointer], a
ret
BattleTransition_InwardSpiral: ; 70aaa (1c:4aaa)
@ -286,69 +286,69 @@ BattleTransition_InwardSpiral_: ; 70ae0 (1c:4ae0)
BattleTransition_OutwardSpiral_: ; 70af9 (1c:4af9)
ld bc, -SCREEN_WIDTH
ld de, SCREEN_WIDTH
ld a, [wd09b]
ld a, [wOutwardSpiralTileMapPointer + 1]
ld l, a
ld a, [wd09a]
ld a, [wOutwardSpiralTileMapPointer]
ld h, a
ld a, [wd09f]
ld a, [wOutwardSpiralCurrentDirection]
cp $0
jr z, .zero
jr z, .up
cp $1
jr z, .one
jr z, .left
cp $2
jr z, .two
jr z, .down
cp $3
jr z, .three
.done1
jr z, .right
.keepSameDirection
ld [hl], $ff
.done2_
.done
ld a, l
ld [wd09b], a
ld [wOutwardSpiralTileMapPointer + 1], a
ld a, h
ld [wd09a], a
ld [wOutwardSpiralTileMapPointer], a
ret
.zero
.up
dec hl
ld a, [hl]
cp $ff
jr nz, .done2
jr nz, .changeDirection
inc hl
add hl, bc
jr .done1
.one
jr .keepSameDirection
.left
add hl, de
ld a, [hl]
cp $ff
jr nz, .done2
jr nz, .changeDirection
add hl, bc
dec hl
jr .done1
.two
jr .keepSameDirection
.down
inc hl
ld a, [hl]
cp $ff
jr nz, .done2
jr nz, .changeDirection
dec hl
add hl, de
jr .done1
.three
jr .keepSameDirection
.right
add hl, bc
ld a, [hl]
cp $ff
jr nz, .done2
jr nz, .changeDirection
add hl, de
inc hl
jr .done1
.done2
jr .keepSameDirection
.changeDirection
ld [hl], $ff
ld a, [wd09f]
ld a, [wOutwardSpiralCurrentDirection]
inc a
cp $4
jr nz, .skip
xor a
.skip
ld [wd09f], a
jr .done2_
ld [wOutwardSpiralCurrentDirection], a
jr .done
FlashScreen:
BattleTransition_FlashScreen_: ; 70b5d (1c:4b5d)

View file

@ -357,7 +357,7 @@ EnemyRan: ; 3c202 (f:4202)
call PlaySoundWaitForCurrent
xor a
ld [H_WHOSETURN], a
jpab AnimationSlideEnemyMonOut
jpab AnimationSlideEnemyMonOff
WildRanText: ; 3c229 (f:4229)
TX_FAR _WildRanText

View file

@ -12,10 +12,10 @@ MarowakAnim: ; 708ca (1c:48ca)
ld [H_AUTOBGTRANSFERENABLED], a ; disable BG transfer so we don't see the Marowak too soon
; replace ghost pic with Marowak in BG
ld a, MAROWAK
ld [wHPBarMaxHP], a
ld [wChangeMonPicEnemyTurnSpecies], a
ld a, $1
ld [H_WHOSETURN], a
callab Func_79793
callab ChangeMonPic
; alternate between black and light grey 8 times.
; this makes the ghost's body appear to flash
ld d, $80

View file

@ -293,7 +293,7 @@ UpdateCinnabarGymGateTileBlocks_: ; 1eb0a (7:6b0a)
ld a, $e
.next
pop bc
ld [wd09f], a
ld [wNewTileBlockID], a
predef ReplaceTileBlock
ld hl, $ffdb
dec [hl]

View file

@ -38,7 +38,7 @@ PlayIntroScene: ; 4169d (10:569d)
ld a, SFX_INTRO_HIP
call PlaySound
xor a
ld [wd09f], a
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation1
call AnimateIntroNidorino
; hop
@ -86,7 +86,7 @@ PlayIntroScene: ; 4169d (10:569d)
ld a, SFX_INTRO_HIP
call PlaySound
ld a, $24
ld [wd09f], a
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation3
call AnimateIntroNidorino
ld c, $1e
@ -105,7 +105,7 @@ PlayIntroScene: ; 4169d (10:569d)
ld a, SFX_INTRO_HIP
call PlaySound
xor a
ld [wd09f], a
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation4
call AnimateIntroNidorino
; hop
@ -118,7 +118,7 @@ PlayIntroScene: ; 4169d (10:569d)
ret c
ld a, $24
ld [wd09f], a
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation6
call AnimateIntroNidorino
ld c, $1e
@ -129,7 +129,7 @@ PlayIntroScene: ; 4169d (10:569d)
ld a, SFX_INTRO_LUNGE
call PlaySound
ld a, $48
ld [wd09f], a
ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation7
jp AnimateIntroNidorino
@ -152,17 +152,17 @@ AnimateIntroNidorino: ; 41793 (10:5793)
UpdateIntroNidorinoOAM: ; 417ae (10:57ae)
ld hl, wOAMBuffer
ld a, [wd09f]
ld a, [wIntroNidorinoBaseTile]
ld d, a
.loop
ld a, [W_BASECOORDY]
add [hl]
ld [hli], a
ld [hli], a ; Y
ld a, [W_BASECOORDX]
add [hl]
ld [hli], a
ld [hli], a ; X
ld a, d
ld [hli], a
ld [hli], a ; tile
inc hl
inc d
dec c

View file

@ -319,7 +319,7 @@ ItemUseBall: ; d687 (3:5687)
ld a,TOSS_ANIM
ld [W_ANIMATIONID],a
xor a
ld [$fff3],a
ld [H_WHOSETURN],a
ld [wAnimationType],a
ld [wDamageMultipliers],a
ld a,[wWhichPokemon]

View file

@ -47,7 +47,7 @@ PrintCardKeyText: ; 52673 (14:6673)
.notSilphCo11F
ld a, $e
.replaceCardKeyDoorTileBlock
ld [wd09f], a
ld [wNewTileBlockID], a
predef ReplaceTileBlock
ld hl, wd126
set 5, [hl]

View file

@ -3,21 +3,21 @@ UsedCut: ; ef54 (3:6f54)
ld [wActionResultOrTookBattleTurn], a ; initialise to failure value
ld a, [W_CURMAPTILESET]
and a ; OVERWORLD
jr z, .asm_ef6b
jr z, .overworld
cp GYM
jr nz, .asm_ef77
jr nz, .nothingToCut
ld a, [wTileInFrontOfPlayer]
cp $50 ; gym cut tree
jr nz, .asm_ef77
jr .asm_ef82
.asm_ef6b
jr nz, .nothingToCut
jr .canCut
.overworld
dec a
ld a, [wTileInFrontOfPlayer]
cp $3d ; cut tree
jr z, .asm_ef82
jr z, .canCut
cp $52 ; grass
jr z, .asm_ef82
.asm_ef77
jr z, .canCut
.nothingToCut
ld hl, .NothingToCutText
jp PrintText
@ -25,9 +25,9 @@ UsedCut: ; ef54 (3:6f54)
TX_FAR _NothingToCutText
db "@"
.asm_ef82
.canCut
ld [wCutTile], a
ld a, $1
ld a, 1
ld [wActionResultOrTookBattleTurn], a ; used cut
ld a, [wWhichPokemon]
ld hl, wPartyMonNicks
@ -37,7 +37,7 @@ UsedCut: ; ef54 (3:6f54)
call GBPalWhiteOutWithDelay3
call ClearSprites
call RestoreScreenTilesAndReloadTilePatterns
ld a, $90
ld a, SCREEN_HEIGHT_PIXELS
ld [hWY], a
call Delay3
call LoadGBPal
@ -53,11 +53,11 @@ UsedCut: ; ef54 (3:6f54)
res 6, [hl]
ld a, $ff
ld [wUpdateSpritesEnabled], a
call AnimateCutTree
call InitCutAnimOAM
ld de, CutTreeBlockSwaps
call Func_f09f
call ReplaceTreeTileBlock
call RedrawMapView
callba Func_79e96
callba AnimCut
ld a, $1
ld [wUpdateSpritesEnabled], a
ld a, SFX_CUT
@ -71,14 +71,15 @@ UsedCutText: ; eff2 (3:6ff2)
TX_FAR _UsedCutText
db "@"
AnimateCutTree: ; eff7 (3:6ff7)
InitCutAnimOAM: ; eff7 (3:6ff7)
xor a
ld [wWhichAnimationOffsets], a
ld a, $e4
ld [rOBP1], a
ld a, [wCutTile]
cp $52
jr z, .asm_f020
jr z, .grass
; tree
ld de, Overworld_GFX + $2d0 ; cuttable tree sprite top row
ld hl, vChars1 + $7c0
ld bc, (BANK(Overworld_GFX) << 8) + $02
@ -87,45 +88,45 @@ AnimateCutTree: ; eff7 (3:6ff7)
ld hl, vChars1 + $7e0
ld bc, (BANK(Overworld_GFX) << 8) + $02
call CopyVideoData
jr WriteCutTreeBoulderDustAnimationOAMBlock
.asm_f020
jr WriteCutOrBoulderDustAnimationOAMBlock
.grass
ld hl, vChars1 + $7c0
call LoadCutTreeAnimationTilePattern
call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7d0
call LoadCutTreeAnimationTilePattern
call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7e0
call LoadCutTreeAnimationTilePattern
call LoadCutGrassAnimationTilePattern
ld hl, vChars1 + $7f0
call LoadCutTreeAnimationTilePattern
call WriteCutTreeBoulderDustAnimationOAMBlock
call LoadCutGrassAnimationTilePattern
call WriteCutOrBoulderDustAnimationOAMBlock
ld hl, wOAMBuffer + $93
ld de, $4
ld de, 4
ld a, $30
ld c, e
.asm_f044
.loop
ld [hl], a
add hl, de
xor $60
dec c
jr nz, .asm_f044
jr nz, .loop
ret
LoadCutTreeAnimationTilePattern: ; f04c (3:704c)
LoadCutGrassAnimationTilePattern: ; f04c (3:704c)
ld de, AnimationTileset2 + $60 ; tile depicting a leaf
ld bc, (BANK(AnimationTileset2) << 8) + $01
jp CopyVideoData
WriteCutTreeBoulderDustAnimationOAMBlock: ; f055 (3:7055)
call GetCutTreeBoulderDustAnimationOffsets
WriteCutOrBoulderDustAnimationOAMBlock: ; f055 (3:7055)
call GetCutOrBoulderDustAnimationOffsets
ld a, $9
ld de, CutTreeBoulderDustAnimationTilesAndAttributes
ld de, CutOrBoulderDustAnimationTilesAndAttributes
jp WriteOAMBlock
CutTreeBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060)
CutOrBoulderDustAnimationTilesAndAttributes: ; f060 (3:7060)
db $FC,$10,$FD,$10
db $FE,$10,$FF,$10
GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
GetCutOrBoulderDustAnimationOffsets: ; f068 (3:7068)
ld hl, wSpriteStateData1 + 4
ld a, [hli] ; player's sprite screen Y position
ld b, a
@ -140,10 +141,10 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
ld d, $0 ; de holds direction (00: down, 02: up, 04: left, 06: right)
ld a, [wWhichAnimationOffsets]
and a
ld hl, CutTreeAnimationOffsets
jr z, .asm_f084
ld hl, CutAnimationOffsets
jr z, .next
ld hl, BoulderDustAnimationOffsets
.asm_f084
.next
add hl, de
ld e, [hl]
inc hl
@ -156,7 +157,7 @@ GetCutTreeBoulderDustAnimationOffsets: ; f068 (3:7068)
ld c, a
ret
CutTreeAnimationOffsets: ; f08f (3:708f)
CutAnimationOffsets: ; f08f (3:708f)
; Each pair represents the x and y pixels offsets from the player of where the cut tree animation should be drawn
db 8, 36 ; player is facing down
db 8, 4 ; player is facing up
@ -171,75 +172,79 @@ BoulderDustAnimationOffsets: ; f097 (3:7097)
db -24, 20 ; player is facing left
db 40, 20 ; player is facing right
Func_f09f: ; f09f (3:709f)
ReplaceTreeTileBlock: ; f09f (3:709f)
; Determine the address of the tile block that contains the tile in front of the
; player (i.e. where the tree is) and replace it with the corresponding tile
; block that doesn't have the tree.
push de
ld a, [W_CURMAPWIDTH]
add $6
add 6
ld c, a
ld b, $0
ld d, $0
ld b, 0
ld d, 0
ld hl, wCurrentTileBlockMapViewPointer
ld a, [hli]
ld h, [hl]
ld l, a
add hl, bc
ld a, [wSpriteStateData1 + 9]
ld a, [wSpriteStateData1 + 9] ; player sprite's facing direction
and a
jr z, .down
cp SPRITE_FACING_UP
jr z, .up
cp SPRITE_FACING_LEFT
jr z, .left
; right
ld a, [W_XBLOCKCOORD]
and a
jr z, .asm_f0e0
jr .asm_f0ec
jr z, .centerTileBlock
jr .rightOfCenter
.down
ld a, [W_YBLOCKCOORD]
and a
jr z, .asm_f0e0
jr .asm_f0df
jr z, .centerTileBlock
jr .belowCenter
.up
ld a, [W_YBLOCKCOORD]
and a
jr z, .asm_f0e1
jr .asm_f0e0
jr z, .aboveCenter
jr .centerTileBlock
.left
ld a, [W_XBLOCKCOORD]
and a
jr z, .asm_f0e6
jr .asm_f0e0
.asm_f0df
jr z, .leftOfCenter
jr .centerTileBlock
.belowCenter
add hl, bc
.asm_f0e0
.centerTileBlock
add hl, bc
.asm_f0e1
.aboveCenter
ld e, $2
add hl, de
jr .asm_f0f0
.asm_f0e6
jr .next
.leftOfCenter
ld e, $1
add hl, bc
add hl, de
jr .asm_f0f0
.asm_f0ec
jr .next
.rightOfCenter
ld e, $3
add hl, bc
add hl, de
.asm_f0f0
.next
pop de
ld a, [hl]
ld c, a
.asm_f0f3
.loop ; find the matching tile block in the array
ld a, [de]
inc de
inc de
cp $ff
ret z
cp c
jr nz, .asm_f0f3
jr nz, .loop
dec de
ld a, [de]
ld a, [de] ; replacement tile block from matching array entry
ld [hl], a
ret

View file

@ -1,19 +1,19 @@
Func_79e96: ; 79e96 (1e:5e96)
AnimCut: ; 79e96 (1e:5e96)
ld a, [wCutTile]
cp $52
jr z, .asm_79ec8
jr z, .grass
ld c, $8
.asm_79e9f
.cutTreeLoop
push bc
ld hl, wOAMBuffer + $91
ld a, $1
ld [wd08a], a
ld c, $2
ld a, 1
ld [wCoordAdjustmentAmount], a
ld c, 2
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99
ld a, $ff
ld [wd08a], a
ld c, $2
ld a, -1
ld [wCoordAdjustmentAmount], a
ld c, 2
call AdjustOAMBlockXPos2
ld a, [rOBP1]
xor $64
@ -21,49 +21,49 @@ Func_79e96: ; 79e96 (1e:5e96)
call DelayFrame
pop bc
dec c
jr nz, .asm_79e9f
jr nz, .cutTreeLoop
ret
.asm_79ec8
ld c, $2
.asm_79eca
.grass
ld c, 2
.cutGrassLoop
push bc
ld c, $8
call Func_79eed
call Func_79f30
call AnimCutGrass_UpdateOAMEntries
call AnimCutGrass_SwapOAMEntries
ld c, $8
call Func_79eed
call Func_79f30
call AnimCutGrass_UpdateOAMEntries
call AnimCutGrass_SwapOAMEntries
ld hl, wOAMBuffer + $90
ld a, $2
ld [wd08a], a
ld c, $4
ld a, 2
ld [wCoordAdjustmentAmount], a
ld c, 4
call AdjustOAMBlockYPos2
pop bc
dec c
jr nz, .asm_79eca
jr nz, .cutGrassLoop
ret
Func_79eed: ; 79eed (1e:5eed)
AnimCutGrass_UpdateOAMEntries: ; 79eed (1e:5eed)
push bc
ld hl, wOAMBuffer + $91
ld a, $1
ld [wd08a], a
ld c, $1
ld a, 1
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $95
ld a, $2
ld [wd08a], a
ld c, $1
ld a, 2
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $99
ld a, $fe
ld [wd08a], a
ld c, $1
ld a, -2
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld hl, wOAMBuffer + $9d
ld a, $ff
ld [wd08a], a
ld c, $1
ld a, -1
ld [wCoordAdjustmentAmount], a
ld c, 1
call AdjustOAMBlockXPos2
ld a, [rOBP1]
xor $64
@ -71,19 +71,19 @@ Func_79eed: ; 79eed (1e:5eed)
call DelayFrame
pop bc
dec c
jr nz, Func_79eed
jr nz, AnimCutGrass_UpdateOAMEntries
ret
Func_79f30: ; 79f30 (1e:5f30)
AnimCutGrass_SwapOAMEntries: ; 79f30 (1e:5f30)
ld hl, wOAMBuffer + $90
ld de, wHPBarMaxHP
ld de, wBuffer
ld bc, $8
call CopyData
ld hl, wOAMBuffer + $98
ld de, wOAMBuffer + $90
ld bc, $8
call CopyData
ld hl, wHPBarMaxHP
ld hl, wBuffer
ld de, wOAMBuffer + $98
ld bc, $8
jp CopyData

View file

@ -8,14 +8,14 @@ AnimateBoulderDust: ; 79f54 (1e:5f54)
ld a, %11100100
ld [rOBP1], a
call LoadSmokeTileFourTimes
callba WriteCutTreeBoulderDustAnimationOAMBlock
callba WriteCutOrBoulderDustAnimationOAMBlock
ld c, 8 ; number of steps in animation
.loop
push bc
call GetMoveBoulderDustFunctionPointer
ld bc, .returnAddress
push bc
ld c, $4
ld c, 4
jp [hl]
.returnAddress
ld a, [rOBP1]
@ -36,7 +36,7 @@ GetMoveBoulderDustFunctionPointer: ; 79f92 (1e:5f92)
ld b, $0
add hl, bc
ld a, [hli]
ld [wd08a], a
ld [wCoordAdjustmentAmount], a
ld a, [hli]
ld e, a
ld a, [hli]

View file

@ -711,12 +711,12 @@ SlotMachine_PayCoinsToPlayer: ; 3776b (d:776b)
SlotMachine_PutOutLitBalls: ; 377ce (d:77ce)
ld a, $23
ld [wd08a], a
ld [wNewSlotMachineBallTile], a
jr SlotMachine_UpdateThreeCoinBallTiles
SlotMachine_LightBalls: ; 377d5 (d:77d5)
ld a, $14
ld [wd08a], a
ld [wNewSlotMachineBallTile], a
ld a, [wSlotMachineBet]
dec a
jr z, SlotMachine_UpdateOneCoinBallTiles
@ -739,7 +739,7 @@ SlotMachine_UpdateOneCoinBallTiles: ; 377fb (d:77fb)
coord hl, 3, 6
SlotMachine_UpdateBallTiles: ; 377fe (d:77fe)
ld a, [wd08a]
ld a, [wNewSlotMachineBallTile]
ld [hl], a
ld bc, 13
add hl, bc

View file

@ -304,25 +304,25 @@ Trade_AnimateBallEnteringLinkCable: ; 412d2 (10:52d2)
ld a, %11100100
ld [rOBP0], a
xor a
ld [wd09f], a
ld [wLinkCableAnimBulgeToggle], a
ld bc, $2060
.moveBallInsideLinkCableLoop
push bc
xor a
ld de, Trade_BallInsideLinkCableOAM
call WriteOAMBlock
ld a, [wd09f]
ld a, [wLinkCableAnimBulgeToggle]
xor $1
ld [wd09f], a
ld [wLinkCableAnimBulgeToggle], a
add $7e
ld hl, wOAMBuffer + $02
ld de, $4
ld de, 4
ld c, e
.cycleSpriteFramesLoop
.cycleLinkCableBulgeTile
ld [hl], a
add hl, de
dec c
jr nz, .cycleSpriteFramesLoop
jr nz, .cycleLinkCableBulgeTile
call Delay3
pop bc
ld a, c

View file

@ -411,12 +411,12 @@ HandlePartyMenuInput:: ; 145a (0:145a)
ld a,1
ld [wMenuWrappingEnabled],a
ld a,$40
ld [wd09b],a
call HandleMenuInputPokemonSelection
ld [wPartyMenuAnimMonEnabled],a
call HandleMenuInput_
call PlaceUnfilledArrowMenuCursor
ld b,a
xor a
ld [wd09b],a
ld [wPartyMenuAnimMonEnabled],a
ld a,[wCurrentMenuItem]
ld [wPartyAndBillsPCSavedMenuItem],a
ld hl,wd730
@ -3897,9 +3897,9 @@ WriteOAMBlock:: ; 3a97 (0:3a97)
HandleMenuInput:: ; 3abe (0:3abe)
xor a
ld [wd09b],a
ld [wPartyMenuAnimMonEnabled],a
HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2)
HandleMenuInput_:: ; 3ac2 (0:3ac2)
ld a,[H_DOWNARROWBLINKCNT1]
push af
ld a,[H_DOWNARROWBLINKCNT2]
@ -3915,7 +3915,7 @@ HandleMenuInputPokemonSelection:: ; 3ac2 (0:3ac2)
call Delay3
.loop2
push hl
ld a,[wd09b]
ld a,[wPartyMenuAnimMonEnabled]
and a ; is it a pokemon selection menu?
jr z,.getJoypadState
callba AnimatePartyMon ; shake mini sprite of selected pokemon

View file

@ -21,7 +21,7 @@ AgathaScript_76443: ; 76443 (1d:6443)
ld a, $3b
AgathaScript_76459: ; 76459 (1d:6459)
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $2
predef_jump ReplaceTileBlock

View file

@ -21,7 +21,7 @@ BrunoScript_762ec: ; 762ec (1d:62ec)
ld a, $24
BrunoScript_76302: ; 76302 (1d:6302)
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $2
predef_jump ReplaceTileBlock

View file

@ -31,7 +31,7 @@ CeladonGameCornerScript_48bec: ; 48bec (12:4bec)
CheckEvent EVENT_FOUND_ROCKET_HIDEOUT
ret nz
ld a, $2a
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0208
predef_jump ReplaceTileBlock
@ -451,7 +451,7 @@ CeladonGameCornerText12: ; 48edd (12:4edd)
call WaitForSoundToFinish
SetEvent EVENT_FOUND_ROCKET_HIDEOUT
ld a, $43
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0208
predef ReplaceTileBlock
jp TextScriptEnd

View file

@ -24,12 +24,12 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4)
LanceScript_5a2de: ; 5a2de (16:62de)
push bc
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $602
call LanceScript_5a2f0
pop bc
ld a, b
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $603
LanceScript_5a2f0: ; 5a2f0 (16:62f0)

View file

@ -22,7 +22,7 @@ LoreleiScript_76191: ; 76191 (1d:6191)
.asm_761a9
ld a, $24
.asm_761ab
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $2
predef_jump ReplaceTileBlock

View file

@ -35,12 +35,12 @@ Mansion1Subscript1: ; 442c5 (11:42c5)
Mansion1Script_44304: ; 44304 (11:4304)
ld a, $2d
ld [wd09f], a
ld [wNewTileBlockID], a
jr Mansion1ReplaceBlock
Mansion1Script_4430b: ; 4430b (11:430b)
ld a, $e
ld [wd09f], a
ld [wNewTileBlockID], a
Mansion1ReplaceBlock: ; 44310 (11:4310)
predef ReplaceTileBlock
ret

View file

@ -38,7 +38,7 @@ Mansion2Script_51fee: ; 51fee (14:5fee)
ret
Mansion2Script_5202f: ; 5202f (14:602f)
ld [wd09f], a
ld [wNewTileBlockID], a
predef_jump ReplaceTileBlock
Mansion2Script_Switches: ; 52037 (14:6037)

View file

@ -26,7 +26,7 @@ RocketHideout1Script_44be0: ; 44be0 (11:4be0)
.asm_44c01
ld a, $e
.asm_44c03
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $080c
predef_jump ReplaceTileBlock

View file

@ -26,7 +26,7 @@ RocketHideout4Script_45473: ; 45473 (11:5473)
.asm_45496
ld a, $e
.asm_45498
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $050c
predef_jump ReplaceTileBlock

View file

@ -19,7 +19,7 @@ SilphCo10Script_5a14f: ; 5a14f (16:614f)
CheckEvent EVENT_SILPH_CO_10_UNLOCKED_DOOR
ret nz
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $405
predef_jump ReplaceTileBlock

View file

@ -19,7 +19,7 @@ SilphCo11Script_62110: ; 62110 (18:6110)
CheckEvent EVENT_SILPH_CO_11_UNLOCKED_DOOR
ret nz
ld a, $20
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $603
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07)
jr nz, .asm_59d2e
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0202
predef ReplaceTileBlock
pop af
@ -28,7 +28,7 @@ SilphCo2Script_59d07: ; 59d07 (16:5d07)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_2_UNLOCKED_DOOR2, EVENT_SILPH_CO_2_UNLOCKED_DOOR1
ret nz
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0502
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71)
jr nz, .asm_59f98
push af
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $404
predef ReplaceTileBlock
pop af
@ -28,7 +28,7 @@ SilphCo3Script_59f71: ; 59f71 (16:5f71)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_3_UNLOCKED_DOOR2, EVENT_SILPH_CO_3_UNLOCKED_DOOR1
ret nz
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $408
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21)
jr nz, .asm_19d48
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0602
predef ReplaceTileBlock
pop af
@ -28,7 +28,7 @@ SilphCo4Script_19d21: ; 19d21 (6:5d21)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_4_UNLOCKED_DOOR2, EVENT_SILPH_CO_4_UNLOCKED_DOOR1
ret nz
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0406
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d)
jr nz, .asm_19f74
push af
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0203
predef ReplaceTileBlock
pop af
@ -29,7 +29,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d)
jr nz, .asm_19f87
push af
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0603
predef ReplaceTileBlock
pop af
@ -37,7 +37,7 @@ SilphCo5Script_19f4d: ; 19f4d (6:5f4d)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_5_UNLOCKED_DOOR3, EVENT_SILPH_CO_5_UNLOCKED_DOOR2
ret nz
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0507
predef_jump ReplaceTileBlock

View file

@ -19,7 +19,7 @@ SilphCo6Script_1a1bf: ; 1a1bf (6:61bf)
CheckEvent EVENT_SILPH_CO_6_UNLOCKED_DOOR
ret nz
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $0602
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77)
jr nz, .asm_51b9e
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $305
predef ReplaceTileBlock
pop af
@ -29,7 +29,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77)
jr nz, .asm_51bb1
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $20a
predef ReplaceTileBlock
pop af
@ -37,7 +37,7 @@ SilphCo7Script_51b77: ; 51b77 (14:5b77)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_7_UNLOCKED_DOOR3, EVENT_SILPH_CO_7_UNLOCKED_DOOR2
ret nz
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $60a
predef_jump ReplaceTileBlock

View file

@ -19,7 +19,7 @@ SilphCo8Script_5651a: ; 5651a (15:651a)
CheckEvent EVENT_SILPH_CO_8_UNLOCKED_DOOR
ret nz
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $403
predef_jump ReplaceTileBlock

View file

@ -20,7 +20,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
jr nz, .asm_5d7f8
push af
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $401
predef ReplaceTileBlock
pop af
@ -29,7 +29,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
jr nz, .asm_5d80b
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $209
predef ReplaceTileBlock
pop af
@ -38,7 +38,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
jr nz, .asm_5d81e
push af
ld a, $54
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $509
predef ReplaceTileBlock
pop af
@ -46,7 +46,7 @@ SilphCo9Script_5d7d1: ; 5d7d1 (17:57d1)
CheckEventAfterBranchReuseA EVENT_SILPH_CO_9_UNLOCKED_DOOR4, EVENT_SILPH_CO_9_UNLOCKED_DOOR3
ret nz
ld a, $5f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $605
predef_jump ReplaceTileBlock

View file

@ -37,7 +37,7 @@ VermilionGymScript_5ca6d: ; 5ca6d (17:4a6d)
call PlaySound
ld a, $5
.asm_5ca7f
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $202
predef_jump ReplaceTileBlock

View file

@ -14,7 +14,7 @@ VictoryRoad1Script: ; 5da0a (17:5a0a)
CheckEvent EVENT_VICTORY_ROAD_1_BOULDER_ON_SWITCH
ret z
ld a, $1d
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $604
predef_jump ReplaceTileBlock

View file

@ -33,7 +33,7 @@ VictoryRoad2Script_517c9: ; 517c9 (14:57c9)
ld bc, $70b
VictoryRoad2Script_517e2: ; 517e2 (14:57e2)
ld [wd09f], a
ld [wNewTileBlockID], a
predef ReplaceTileBlock
ret

View file

@ -16,7 +16,7 @@ VictoryRoad3Script_44996: ; 44996 (11:4996)
CheckEventHL EVENT_VICTORY_ROAD_3_BOULDER_ON_SWITCH1
ret z
ld a, $1d
ld [wd09f], a
ld [wNewTileBlockID], a
ld bc, $503
predef_jump ReplaceTileBlock

View file

@ -409,7 +409,11 @@ wSlotMachineSavedROMBank:: ; cc5e
ds 12
wcc6b:: ds 14 ; doesn't seem to be used for anything, probably just more storage
wcc79:: ds 30 ; used in battle animations
wAnimPalette:: ; cc79
ds 1
ds 29
wNPCMovementDirections2:: ; cc97
@ -647,6 +651,13 @@ wOverrideSimulatedJoypadStatesMask:: ; cd3b
ds 1
wFallingObjectsMovementData:: ; cd3d
; up to 20 bytes (one byte for each falling object)
wSavedY:: ; cd3d
wTempSCX:: ; cd3d
wBattleTransitionCircleScreenQuadrantY:: ; cd3d
; 0 = upper half (Y < 9)
; 1 = lower half (Y >= 9)
@ -1050,9 +1061,13 @@ wLearningMovesFromDayCare:: ; cee9
; whether WriteMonMoves is being used to make a mon learn moves from day care
; non-zero if so
wChangeMonPicEnemyTurnSpecies:: ; cee9
wHPBarMaxHP:: ; cee9
ds 1
wChangeMonPicPlayerTurnSpecies:: ; ceea
wEvoNewSpecies:: ; ceea
ds 1
@ -1554,12 +1569,34 @@ W_NUMFBTILES:: ; d089
; number of tiles in current battle animation frame block
ds 1
wFlashScreenLongCounter:: ; d08a
wSpiralBallsBaseY:: ; d08a
wFallingObjectMovementByte:: ; d08a
; bits 0-6: index into FallingObjects_DeltaXs array (0 - 8)
; bit 7: direction; 0 = right, 1 = left
wNumShootingBalls:: ; d08a
wTradedMonMovingRight:: ; d08a
; $01 if mon is moving from left gameboy to right gameboy; $00 if vice versa
wOptionsInitialized:: ; d08a
wd08a:: ds 1 ; used with sprites and displaying the option menu on the main menu screen?
wNewSlotMachineBallTile:: ; d08a
wCoordAdjustmentAmount:: ; d08a
; how much to add to the X/Y coord
wUnusedD08A:: ; d08a
ds 1
wSpiralBallsBaseX:: ; d08b
wNumFallingObjects:: ; d08b
wSlideMonDelay:: ; d08b
wAnimCounter:: ; d08b
; generic counter variable for various animations
@ -1601,13 +1638,17 @@ W_SUBANIMSUBENTRYADDR:: ; d096
ds 2
wd09a:: ds 1 ; used with the battle transition screen when entering a battle (screen slowly draws into black)
wOutwardSpiralTileMapPointer:: ; d09a
ds 1
wPartyMenuAnimMonEnabled:: ; d09b
wTownMapSpriteBlinkingEnabled:: ; d09b
; non-zero when enabled. causes nest locations to blink on and off.
; the town selection cursor will blink regardless of what this value is
wd09b:: ds 1 ; also used with battle transition screen and move animations
wUnusedD09B:: ; d09b
ds 1
W_FBDESTADDR:: ; d09c
; current destination address in OAM for frame blocks (big endian)
@ -1625,9 +1666,28 @@ W_FBMODE:: ; d09e
; contain the upper and lower bit of each of the 8 pixels, respectively
ds 1
wLinkCableAnimBulgeToggle:: ; d09f
; 0 = small
; 1 = big
wIntroNidorinoBaseTile:: ; d09f
wOutwardSpiralCurrentDirection:: ; d09f
wDropletTile:: ; d09f
wNewTileBlockID:: ; d09f
wd09f:: ds 1 ; used with predef ReplaceTileBlock
wWhichBattleAnimTileset:: ; d09f
wSquishMonCurrentDirection:: ; d09f
; 0 = left
; 1 = right
wSlideMonUpBottomRowLeftTile:: ; d09f
; the tile ID of the leftmost tile in the bottom row in AnimationSlideMonUp_
ds 1
wDisableVBlankWYUpdate:: ds 1 ; if non-zero, don't update WY during V-blank
W_SPRITECURPOSX:: ; d0a1