mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
More work interpreting the sprite engine
This commit is contained in:
parent
92a8c491c3
commit
be082943ed
101
battle/core.asm
101
battle/core.asm
@ -5225,11 +5225,11 @@ LoadBattleMenu2: ; 3e19b
|
||||
BattleMenu_Pack: ; 3e1c7
|
||||
ld a, [wLinkMode]
|
||||
and a
|
||||
jp nz, ItemsCantBeUsed
|
||||
jp nz, .ItemsCantBeUsed
|
||||
|
||||
ld a, [InBattleTowerBattle]
|
||||
and a
|
||||
jp nz, ItemsCantBeUsed
|
||||
jp nz, .ItemsCantBeUsed
|
||||
|
||||
call LoadStandardMenuDataHeader
|
||||
|
||||
@ -5258,7 +5258,7 @@ BattleMenu_Pack: ; 3e1c7
|
||||
call DoItemEffect
|
||||
|
||||
.got_item
|
||||
call Function3e234
|
||||
call .UseItem
|
||||
ret
|
||||
|
||||
.didnt_use_item
|
||||
@ -5274,33 +5274,33 @@ BattleMenu_Pack: ; 3e1c7
|
||||
jp BattleMenu
|
||||
; 3e22b
|
||||
|
||||
ItemsCantBeUsed: ; 3e22b
|
||||
.ItemsCantBeUsed: ; 3e22b
|
||||
ld hl, BattleText_ItemsCantBeUsedHere
|
||||
call StdBattleTextBox
|
||||
jp BattleMenu
|
||||
; 3e234
|
||||
|
||||
Function3e234: ; 3e234
|
||||
.UseItem: ; 3e234
|
||||
ld a, [wc64e]
|
||||
and a
|
||||
jr nz, .asm_3e279
|
||||
jr nz, .run
|
||||
callab CheckItemPocket
|
||||
ld a, [wItemAttributeParamBuffer]
|
||||
cp $3
|
||||
jr z, .asm_3e24a
|
||||
cp BALL
|
||||
jr z, .ball
|
||||
call ClearBGPalettes
|
||||
|
||||
.asm_3e24a
|
||||
.ball
|
||||
xor a
|
||||
ld [hBGMapMode], a
|
||||
call _LoadBattleFontsHPBar
|
||||
call ClearSprites
|
||||
ld a, [BattleType]
|
||||
cp BATTLETYPE_TUTORIAL
|
||||
jr z, .asm_3e25d
|
||||
jr z, .tutorial2
|
||||
call GetMonBackpic
|
||||
|
||||
.asm_3e25d
|
||||
.tutorial2
|
||||
call GetMonFrontpic
|
||||
ld a, $1
|
||||
ld [MenuSelection2], a
|
||||
@ -5313,7 +5313,7 @@ Function3e234: ; 3e234
|
||||
and a
|
||||
ret
|
||||
|
||||
.asm_3e279
|
||||
.run
|
||||
xor a
|
||||
ld [wc64e], a
|
||||
ld a, [wBattleResult]
|
||||
@ -5331,39 +5331,39 @@ Function3e290:
|
||||
call ExitMenu
|
||||
call LoadStandardMenuDataHeader
|
||||
call ClearBGPalettes
|
||||
Function3e299:
|
||||
BattleMenuPKMN_Loop:
|
||||
call Function3d2fa
|
||||
xor a
|
||||
ld [PartyMenuActionText], a
|
||||
call Function3d313
|
||||
call Function3d329
|
||||
jr c, .asm_3e2da
|
||||
.asm_3e2a8
|
||||
jr c, .Cancel
|
||||
.loop
|
||||
callba Function8ea4a
|
||||
call Function3e2f5
|
||||
jr c, .asm_3e2c8
|
||||
call .GetMenu
|
||||
jr c, .PressedB
|
||||
call Function1bee
|
||||
ld a, [MenuSelection2]
|
||||
cp $1
|
||||
jp z, Function3e358
|
||||
cp $2
|
||||
jr z, .asm_3e2cf
|
||||
cp $3
|
||||
jr z, .asm_3e2da
|
||||
jr .asm_3e2a8
|
||||
cp $1 ; SWITCH
|
||||
jp z, TryPlayerSwitch
|
||||
cp $2 ; STATS
|
||||
jr z, .Stats
|
||||
cp $3 ; CANCEL
|
||||
jr z, .Cancel
|
||||
jr .loop
|
||||
|
||||
.asm_3e2c8
|
||||
.PressedB
|
||||
call CheckMobileBattleError
|
||||
jr c, .asm_3e2da
|
||||
jr Function3e299
|
||||
jr c, .Cancel
|
||||
jr BattleMenuPKMN_Loop
|
||||
|
||||
.asm_3e2cf
|
||||
.Stats
|
||||
call Function3e308
|
||||
call CheckMobileBattleError
|
||||
jr c, .asm_3e2da
|
||||
jr c, .Cancel
|
||||
jp Function3e290
|
||||
|
||||
.asm_3e2da
|
||||
.Cancel
|
||||
call ClearSprites
|
||||
call ClearPalettes
|
||||
call DelayFrame
|
||||
@ -5375,14 +5375,14 @@ Function3e299:
|
||||
jp BattleMenu
|
||||
; 3e2f5
|
||||
|
||||
Function3e2f5: ; 3e2f5
|
||||
.GetMenu: ; 3e2f5
|
||||
call IsMobileBattle
|
||||
jr z, .asm_3e301
|
||||
callba Function24e99
|
||||
jr z, .mobile
|
||||
callba BattleMonMenu
|
||||
ret
|
||||
|
||||
.asm_3e301
|
||||
callba Function100d22
|
||||
.mobile
|
||||
callba MobileBattleMonMenu
|
||||
ret
|
||||
; 3e308
|
||||
|
||||
@ -5394,7 +5394,7 @@ Function3e308: ; 3e308
|
||||
call CopyBytes
|
||||
ld hl, VTiles2
|
||||
ld de, VTiles0 tile $11
|
||||
ld bc, $0310
|
||||
ld bc, $31 tiles
|
||||
call CopyBytes
|
||||
call EnableLCD
|
||||
call ClearSprites
|
||||
@ -5406,43 +5406,43 @@ Function3e308: ; 3e308
|
||||
call DisableLCD
|
||||
ld hl, VTiles0
|
||||
ld de, VTiles2 tile $31
|
||||
ld bc, $0110
|
||||
ld bc, $11 tiles
|
||||
call CopyBytes
|
||||
ld hl, VTiles0 tile $11
|
||||
ld de, VTiles2
|
||||
ld bc, $0310
|
||||
ld bc, $31 tiles
|
||||
call CopyBytes
|
||||
call EnableLCD
|
||||
ret
|
||||
; 3e358
|
||||
|
||||
|
||||
Function3e358: ; 3e358
|
||||
TryPlayerSwitch: ; 3e358
|
||||
ld a, [CurBattleMon]
|
||||
ld d, a
|
||||
ld a, [CurPartyMon]
|
||||
cp d
|
||||
jr nz, .asm_3e36b
|
||||
jr nz, .check_trapped
|
||||
ld hl, BattleText_PkmnIsAlreadyOut
|
||||
call StdBattleTextBox
|
||||
jp Function3e299
|
||||
jp BattleMenuPKMN_Loop
|
||||
|
||||
.asm_3e36b
|
||||
.check_trapped
|
||||
ld a, [wPlayerWrapCount]
|
||||
and a
|
||||
jr nz, .asm_3e378
|
||||
jr nz, .trapped
|
||||
ld a, [EnemySubStatus5]
|
||||
bit SUBSTATUS_CANT_RUN, a
|
||||
jr z, .asm_3e381
|
||||
jr z, .try_switch
|
||||
|
||||
.asm_3e378
|
||||
.trapped
|
||||
ld hl, BattleText_PkmnCantBeRecalled
|
||||
call StdBattleTextBox
|
||||
jp Function3e299
|
||||
jp BattleMenuPKMN_Loop
|
||||
|
||||
.asm_3e381
|
||||
.try_switch
|
||||
call CheckIfPartyHasPkmnToBattleWith
|
||||
jp z, Function3e299
|
||||
jp z, BattleMenuPKMN_Loop
|
||||
ld a, [CurBattleMon]
|
||||
ld [LastPlayerMon], a
|
||||
ld a, $2
|
||||
@ -5456,9 +5456,6 @@ Function3e358: ; 3e358
|
||||
call SetPalettes
|
||||
ld a, [CurPartyMon]
|
||||
ld [CurBattleMon], a
|
||||
; fallthrough
|
||||
; 3e3ad
|
||||
|
||||
PlayerSwitch: ; 3e3ad
|
||||
ld a, 1
|
||||
ld [wPlayerIsSwitching], a
|
||||
@ -9479,7 +9476,7 @@ InitBattleDisplay: ; 3fb6c
|
||||
|
||||
|
||||
GetTrainerBackpic: ; 3fbff
|
||||
; Load the player character's backpic (6x6) into VRAM starting from $9310.
|
||||
; Load the player character's backpic (6x6) into VRAM starting from VTiles2 tile $31.
|
||||
|
||||
; Special exception for Dude.
|
||||
ld b, BANK(DudeBackpic)
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -191,30 +191,30 @@ DoEggStep:: ; 16f3e
|
||||
OverworldHatchEgg:: ; 16f5e
|
||||
call ResetWindow
|
||||
call LoadStandardMenuDataHeader
|
||||
call Function16f70
|
||||
call HatchEggs
|
||||
call ExitAllMenus
|
||||
call RestartMapMusic
|
||||
jp CloseText
|
||||
; 16f70
|
||||
|
||||
Function16f70: ; 16f70 (5:6f70)
|
||||
HatchEggs: ; 16f70 (5:6f70)
|
||||
ld de, PartySpecies
|
||||
ld hl, PartyMon1Happiness
|
||||
xor a
|
||||
ld [CurPartyMon], a
|
||||
|
||||
Function16f7a: ; 16f7a (5:6f7a)
|
||||
.loop: ; 16f7a (5:6f7a)
|
||||
ld a, [de]
|
||||
inc de
|
||||
cp -1
|
||||
jp z, Function1708a
|
||||
jp z, .done
|
||||
push de
|
||||
push hl
|
||||
cp EGG
|
||||
jp nz, Function1707d
|
||||
jp nz, .next
|
||||
ld a, [hl]
|
||||
and a
|
||||
jp nz, Function1707d
|
||||
jp nz, .next
|
||||
ld [hl], $78
|
||||
|
||||
push de
|
||||
@ -304,7 +304,7 @@ Function16f7a: ; 16f7a (5:6f7a)
|
||||
ld e, l
|
||||
ld hl, PlayerName
|
||||
call CopyBytes
|
||||
ld hl, UnknownText_0x1708b
|
||||
ld hl, .Text_HatchEgg
|
||||
call PrintText
|
||||
ld a, [CurPartyMon]
|
||||
ld hl, PartyMonNicknames
|
||||
@ -313,11 +313,12 @@ Function16f7a: ; 16f7a (5:6f7a)
|
||||
ld d, h
|
||||
ld e, l
|
||||
push de
|
||||
ld hl, UnknownText_0x170ba
|
||||
ld hl, .Text_NicknameHatchling
|
||||
call PrintText
|
||||
call YesNoBox
|
||||
pop de
|
||||
jr c, .nonickname
|
||||
|
||||
ld a, $1
|
||||
ld [wd26b], a
|
||||
xor a
|
||||
@ -328,32 +329,30 @@ Function16f7a: ; 16f7a (5:6f7a)
|
||||
pop hl
|
||||
ld de, StringBuffer1
|
||||
call InitName
|
||||
jr Function1707d
|
||||
jr .next
|
||||
|
||||
.nonickname
|
||||
ld hl, StringBuffer1
|
||||
ld bc, PKMN_NAME_LENGTH
|
||||
call CopyBytes
|
||||
|
||||
Function1707d: ; 1707d (5:707d)
|
||||
.next: ; 1707d (5:707d)
|
||||
ld hl, CurPartyMon
|
||||
inc [hl]
|
||||
pop hl
|
||||
ld de, PARTYMON_STRUCT_LENGTH
|
||||
add hl, de
|
||||
pop de
|
||||
jp Function16f7a
|
||||
jp .loop
|
||||
|
||||
Function1708a: ; 1708a (5:708a)
|
||||
.done: ; 1708a (5:708a)
|
||||
ret
|
||||
; 1708b (5:708b)
|
||||
|
||||
UnknownText_0x1708b: ; 0x1708b
|
||||
.Text_HatchEgg: ; 0x1708b
|
||||
; Huh? @ @
|
||||
text_jump UnknownText_0x1c0db0
|
||||
start_asm
|
||||
; 0x17090
|
||||
|
||||
Function17090: ; 17090
|
||||
ld hl, VramState
|
||||
res 0, [hl]
|
||||
push hl
|
||||
@ -361,38 +360,38 @@ Function17090: ; 17090
|
||||
push bc
|
||||
ld a, [CurPartySpecies]
|
||||
push af
|
||||
call Function1728f
|
||||
ld hl, UnknownText_0x170b0
|
||||
call EggHatch_AnimationSequence
|
||||
ld hl, .ClearTextbox
|
||||
call PrintText
|
||||
pop af
|
||||
ld [CurPartySpecies], a
|
||||
pop bc
|
||||
pop de
|
||||
pop hl
|
||||
ld hl, UnknownText_0x170b5
|
||||
ld hl, .CameOutOfItsEgg
|
||||
ret
|
||||
; 170b0 (5:70b0)
|
||||
|
||||
UnknownText_0x170b0: ; 0x170b0
|
||||
.ClearTextbox: ; 0x170b0
|
||||
;
|
||||
text_jump UnknownText_0x1c0db8
|
||||
db "@"
|
||||
; 0x170b5
|
||||
|
||||
UnknownText_0x170b5: ; 0x170b5
|
||||
.CameOutOfItsEgg: ; 0x170b5
|
||||
; came out of its EGG!@ @
|
||||
text_jump UnknownText_0x1c0dba
|
||||
db "@"
|
||||
; 0x170ba
|
||||
|
||||
UnknownText_0x170ba: ; 0x170ba
|
||||
.Text_NicknameHatchling: ; 0x170ba
|
||||
; Give a nickname to @ ?
|
||||
text_jump UnknownText_0x1c0dd8
|
||||
db "@"
|
||||
; 0x170bf
|
||||
|
||||
Function170bf: ; 170bf
|
||||
call Function17197
|
||||
InitEggMoves: ; 170bf
|
||||
call GetHeritableMoves
|
||||
ld d, h
|
||||
ld e, l
|
||||
ld b, NUM_MOVES
|
||||
@ -409,9 +408,9 @@ Function170bf: ; 170bf
|
||||
inc hl
|
||||
dec c
|
||||
jr nz, .next
|
||||
call Function170e4
|
||||
call GetEggMove
|
||||
jr nc, .skip
|
||||
call Function17169
|
||||
call LoadEggMove
|
||||
|
||||
.skip
|
||||
inc de
|
||||
@ -422,7 +421,7 @@ Function170bf: ; 170bf
|
||||
ret
|
||||
; 170e4
|
||||
|
||||
Function170e4: ; 170e4
|
||||
GetEggMove: ; 170e4
|
||||
GLOBAL EggMoves
|
||||
|
||||
push bc
|
||||
@ -440,7 +439,7 @@ endr
|
||||
ld a, BANK(EggMoves)
|
||||
call GetFarByte
|
||||
cp -1
|
||||
jr z, .found_mon
|
||||
jr z, .reached_end
|
||||
ld b, a
|
||||
ld a, [de]
|
||||
cp b
|
||||
@ -448,7 +447,7 @@ endr
|
||||
inc hl
|
||||
jr .loop
|
||||
|
||||
.found_mon
|
||||
.reached_end
|
||||
call Function1720b
|
||||
ld b, NUM_MOVES
|
||||
.loop2
|
||||
@ -504,7 +503,7 @@ endr
|
||||
ld a, [de]
|
||||
cp b
|
||||
jr nz, .loop5
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
predef CanLearnTMHMMove
|
||||
ld a, c
|
||||
and a
|
||||
@ -521,7 +520,7 @@ endr
|
||||
ret
|
||||
; 17169
|
||||
|
||||
Function17169: ; 17169
|
||||
LoadEggMove: ; 17169
|
||||
push de
|
||||
push bc
|
||||
ld a, [de]
|
||||
@ -556,7 +555,7 @@ Function17169: ; 17169
|
||||
ret
|
||||
; 17197
|
||||
|
||||
Function17197: ; 17197
|
||||
GetHeritableMoves: ; 17197
|
||||
ld hl, wBreedMon2Moves
|
||||
ld a, [wBreedMon1Species]
|
||||
cp DITTO
|
||||
@ -579,7 +578,7 @@ Function17197: ; 17197
|
||||
ld [TempMonDVs], a
|
||||
ld a, [wBreedMon2DVs + 1]
|
||||
ld [TempMonDVs + 1], a
|
||||
ld a, $3
|
||||
ld a, BREEDMON
|
||||
ld [MonType], a
|
||||
predef GetGender
|
||||
jr c, .inherit_mon2_moves
|
||||
@ -595,7 +594,7 @@ Function17197: ; 17197
|
||||
ld [TempMonDVs], a
|
||||
ld a, [wBreedMon1DVs + 1]
|
||||
ld [TempMonDVs + 1], a
|
||||
ld a, $3
|
||||
ld a, BREEDMON
|
||||
ld [MonType], a
|
||||
predef GetGender
|
||||
jr c, .inherit_mon1_moves
|
||||
@ -674,7 +673,7 @@ Function17254: ; 17254 (5:7254)
|
||||
call SetPalettes
|
||||
jp WaitBGMap
|
||||
|
||||
Function1727f: ; 1727f (5:727f)
|
||||
EggHatch_DoAnimFrame: ; 1727f (5:727f)
|
||||
push hl
|
||||
push de
|
||||
push bc
|
||||
@ -685,7 +684,7 @@ Function1727f: ; 1727f (5:727f)
|
||||
pop hl
|
||||
ret
|
||||
|
||||
Function1728f: ; 1728f (5:728f)
|
||||
EggHatch_AnimationSequence: ; 1728f (5:728f)
|
||||
ld a, [wd265]
|
||||
ld [wJumptableIndex], a
|
||||
ld a, [CurSpecies]
|
||||
@ -710,45 +709,47 @@ Function1728f: ; 1728f (5:728f)
|
||||
call PlayMusic
|
||||
call EnableLCD
|
||||
hlcoord 7, 4
|
||||
ld b, $98
|
||||
ld c, $31
|
||||
ld b, (VBGMap0 + 1 * $20 + 17) / $100
|
||||
ld c, (VBGMap0 + 1 * $20 + 17) % $100
|
||||
ld a, EGG
|
||||
call Function17254
|
||||
ld c, $50
|
||||
ld c, 80
|
||||
call DelayFrames
|
||||
xor a
|
||||
ld [wcf64], a
|
||||
ld a, [hSCX]
|
||||
ld b, a
|
||||
.asm_172ee
|
||||
.outerloop
|
||||
ld hl, wcf64
|
||||
ld a, [hl]
|
||||
inc [hl]
|
||||
cp $8
|
||||
jr nc, .asm_17327
|
||||
cp 8
|
||||
jr nc, .done
|
||||
ld e, [hl]
|
||||
.asm_172f8
|
||||
ld a, $2
|
||||
.loop
|
||||
; wobble e times
|
||||
ld a, 2
|
||||
ld [hSCX], a
|
||||
ld a, $fe
|
||||
ld a, -2
|
||||
ld [wc3c0], a
|
||||
call Function1727f
|
||||
ld c, $2
|
||||
call EggHatch_DoAnimFrame
|
||||
ld c, 2
|
||||
call DelayFrames
|
||||
ld a, $fe
|
||||
ld a, -2
|
||||
ld [hSCX], a
|
||||
ld a, $2
|
||||
ld a, 2
|
||||
ld [wc3c0], a
|
||||
call Function1727f
|
||||
ld c, $2
|
||||
call EggHatch_DoAnimFrame
|
||||
ld c, 2
|
||||
call DelayFrames
|
||||
dec e
|
||||
jr nz, .asm_172f8
|
||||
ld c, $10
|
||||
jr nz, .loop
|
||||
ld c, 16
|
||||
call DelayFrames
|
||||
call Function1736d
|
||||
jr .asm_172ee
|
||||
.asm_17327
|
||||
call EggHatch_CrackShell
|
||||
jr .outerloop
|
||||
|
||||
.done
|
||||
ld de, SFX_EGG_HATCH
|
||||
call PlaySFX
|
||||
xor a
|
||||
@ -757,8 +758,8 @@ Function1728f: ; 1728f (5:728f)
|
||||
call ClearSprites
|
||||
call Function173b3
|
||||
hlcoord 6, 3
|
||||
ld b, $98
|
||||
ld c, $0
|
||||
ld b, VBGMap0 / $100
|
||||
ld c, VBGMap0 % $100
|
||||
ld a, [wJumptableIndex]
|
||||
call Function17254
|
||||
call Function17418
|
||||
@ -779,7 +780,7 @@ Function17363: ; 17363 (5:7363)
|
||||
ld c, $0
|
||||
jp GetSGBLayout
|
||||
|
||||
Function1736d: ; 1736d (5:736d)
|
||||
EggHatch_CrackShell: ; 1736d (5:736d)
|
||||
ld a, [wcf64]
|
||||
dec a
|
||||
and $7
|
||||
@ -794,7 +795,7 @@ Function1736d: ; 1736d (5:736d)
|
||||
ld e, 11 * 8
|
||||
ld a, SPRITE_ANIM_INDEX_19
|
||||
call _InitSpriteAnimStruct
|
||||
ld hl, $3
|
||||
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
||||
add hl, bc
|
||||
ld [hl], $0
|
||||
ld de, SFX_EGG_CRACK
|
||||
@ -840,7 +841,7 @@ Function173b3: ; 173b3 (5:73b3)
|
||||
.done
|
||||
ld de, SFX_EGG_HATCH
|
||||
call PlaySFX
|
||||
call Function1727f
|
||||
call EggHatch_DoAnimFrame
|
||||
ret
|
||||
; 173ef (5:73ef)
|
||||
|
||||
@ -862,7 +863,7 @@ Function173b3: ; 173b3 (5:73b3)
|
||||
Function17418: ; 17418 (5:7418)
|
||||
ld c, $81
|
||||
.asm_1741a
|
||||
call Function1727f
|
||||
call EggHatch_DoAnimFrame
|
||||
dec c
|
||||
jr nz, .asm_1741a
|
||||
ret
|
||||
|
@ -828,7 +828,7 @@ Function81df4: ; 81df4
|
||||
ld [wd265], a
|
||||
predef GetTMHMMove
|
||||
ld a, [wd265]
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
call GetMoveName
|
||||
hlcoord 10, 12
|
||||
call PlaceString
|
||||
|
@ -485,7 +485,7 @@ endr
|
||||
|
||||
.learn
|
||||
ld a, d
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
ld [wd265], a
|
||||
call GetMoveName
|
||||
call CopyName1
|
||||
|
@ -57,7 +57,7 @@ LearnMove: ; 6508
|
||||
pop hl
|
||||
|
||||
.learn
|
||||
ld a, [wd262]
|
||||
ld a, [wPutativeTMHMMove]
|
||||
ld [hl], a
|
||||
ld bc, MON_PP - MON_MOVES
|
||||
add hl, bc
|
||||
|
@ -100,7 +100,7 @@ Function927af: ; 927af (24:67af)
|
||||
call Function92844
|
||||
call Function92b0f
|
||||
xor a
|
||||
ld [wc3b5], a
|
||||
ld [wOAMRetentionSize], a
|
||||
callab DoNextFrameForFirst16Sprites
|
||||
call Function927f8
|
||||
call Function927d3
|
||||
|
@ -23,8 +23,8 @@ PlaySpriteAnimations: ; 8cf69
|
||||
push bc
|
||||
push af
|
||||
|
||||
ld a, $0
|
||||
ld [wc3b5], a
|
||||
ld a, 0 * 4
|
||||
ld [wOAMRetentionSize], a
|
||||
call DoNextFrameForAllSprites
|
||||
|
||||
pop af
|
||||
@ -58,11 +58,11 @@ DoNextFrameForAllSprites: ; 8cf7a
|
||||
dec e
|
||||
jr nz, .loop
|
||||
|
||||
ld a, [wc3b5]
|
||||
ld a, [wOAMRetentionSize]
|
||||
ld l, a
|
||||
ld h, Sprites / $0100
|
||||
|
||||
.loop2 ; Clear (Sprites + [wc3b5] --> SpritesEnd)
|
||||
.loop2 ; Clear (Sprites + [wOAMRetentionSize] --> SpritesEnd)
|
||||
ld a, l
|
||||
cp SpritesEnd % $100
|
||||
jr nc, .done
|
||||
@ -98,11 +98,11 @@ DoNextFrameForFirst16Sprites: ; 8cfa8 (23:4fa8)
|
||||
dec e
|
||||
jr nz, .loop
|
||||
|
||||
ld a, [wc3b5]
|
||||
ld a, [wOAMRetentionSize]
|
||||
ld l, a
|
||||
ld h, (Sprites + $40) / $100
|
||||
|
||||
.loop2 ; Clear (Sprites + [wc3b5] --> Sprites + $40)
|
||||
.loop2 ; Clear (Sprites + [wOAMRetentionSize] --> Sprites + $40)
|
||||
ld a, l
|
||||
cp (Sprites + 16 * 4) % $100
|
||||
jr nc, .done
|
||||
@ -213,7 +213,7 @@ endr
|
||||
|
||||
Function8d036: ; 8d036
|
||||
; Clear the index field of the struct in bc.
|
||||
ld hl, 0
|
||||
ld hl, SPRITEANIMSTRUCT_INDEX
|
||||
add hl, bc
|
||||
ld [hl], $0
|
||||
ret
|
||||
@ -240,25 +240,29 @@ Function8d04c: ; 8d04c
|
||||
cp -3
|
||||
jr z, .done
|
||||
cp -4
|
||||
jr z, .almost
|
||||
jr z, .delete
|
||||
call Function8d1a2 ; OAM?
|
||||
ld a, [wc3ba]
|
||||
; add byte to [wCurrAnimVTile]
|
||||
ld a, [wCurrAnimVTile]
|
||||
add [hl]
|
||||
ld [wc3ba], a
|
||||
ld [wCurrAnimVTile], a
|
||||
inc hl
|
||||
; load pointer into hl
|
||||
ld a, [hli]
|
||||
ld h, [hl]
|
||||
ld l, a
|
||||
push bc
|
||||
ld a, [wc3b5]
|
||||
ld a, [wOAMRetentionSize]
|
||||
ld e, a
|
||||
ld d, Sprites / $100
|
||||
ld a, [hli]
|
||||
ld c, a
|
||||
ld c, a ; number of objects
|
||||
.loop
|
||||
ld a, [wc3bc]
|
||||
; first byte: y (px)
|
||||
; [de] = [wCurrAnimYCoord] + [wCurrAnimYOffset] + [wc3bf] + Function8d0be([hl])
|
||||
ld a, [wCurrAnimYCoord]
|
||||
ld b, a
|
||||
ld a, [wc3be]
|
||||
ld a, [wCurrAnimYOffset]
|
||||
add b
|
||||
ld b, a
|
||||
ld a, [wc3bf]
|
||||
@ -269,9 +273,11 @@ Function8d04c: ; 8d04c
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [wc3bb]
|
||||
; second byte: x (px)
|
||||
; [de] = [wCurrAnimXCoord] + [wCurrAnimXOffset] + [wc3c0] + Function8d0ce([hl])
|
||||
ld a, [wCurrAnimXCoord]
|
||||
ld b, a
|
||||
ld a, [wc3bd]
|
||||
ld a, [wCurrAnimXOffset]
|
||||
add b
|
||||
ld b, a
|
||||
ld a, [wc3c0]
|
||||
@ -282,32 +288,36 @@ Function8d04c: ; 8d04c
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
ld a, [wc3ba]
|
||||
; third byte: vtile
|
||||
; [de] = [wCurrAnimVTile] + [hl]
|
||||
ld a, [wCurrAnimVTile]
|
||||
add [hl]
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
; fourth byte: attributes
|
||||
; [de] = Function8d0de([hl])
|
||||
call Function8d0de
|
||||
ld [de], a
|
||||
inc hl
|
||||
inc de
|
||||
ld a, e
|
||||
ld [wc3b5], a
|
||||
ld [wOAMRetentionSize], a
|
||||
cp SpritesEnd % $100
|
||||
jr nc, .outofroom
|
||||
jr nc, .reached_the_end
|
||||
dec c
|
||||
jr nz, .loop
|
||||
pop bc
|
||||
jr .done
|
||||
|
||||
.almost
|
||||
.delete
|
||||
call Function8d036
|
||||
|
||||
.done
|
||||
and a
|
||||
ret
|
||||
|
||||
.outofroom
|
||||
.reached_the_end
|
||||
pop bc
|
||||
scf
|
||||
ret
|
||||
@ -359,18 +369,18 @@ Function8d0de: ; 8d0de
|
||||
Function8d0ec: ; 8d0ec
|
||||
xor a
|
||||
ld [wc3b8], a
|
||||
ld hl, $3
|
||||
ld hl, SPRITEANIMSTRUCT_TILE_ID
|
||||
add hl, bc
|
||||
ld a, [hli]
|
||||
ld [wc3ba], a
|
||||
ld [wCurrAnimVTile], a
|
||||
ld a, [hli]
|
||||
ld [wc3bb], a
|
||||
ld [wCurrAnimXCoord], a
|
||||
ld a, [hli]
|
||||
ld [wc3bc], a
|
||||
ld [wCurrAnimYCoord], a
|
||||
ld a, [hli]
|
||||
ld [wc3bd], a
|
||||
ld [wCurrAnimXOffset], a
|
||||
ld a, [hli]
|
||||
ld [wc3be], a
|
||||
ld [wCurrAnimYOffset], a
|
||||
ret
|
||||
; 8d109
|
||||
|
||||
@ -420,22 +430,22 @@ Function8d132: ; 8d132
|
||||
add hl, bc
|
||||
ld a, [hl]
|
||||
and a
|
||||
jr z, .done ; finished the current sequence
|
||||
jr z, .next_frame ; finished the current sequence
|
||||
dec [hl]
|
||||
call Function8d189 ; load pointer from Unknown_8d6e6
|
||||
ld a, [hli]
|
||||
push af
|
||||
jr .okay
|
||||
|
||||
.done
|
||||
.next_frame
|
||||
ld hl, SPRITEANIMSTRUCT_FRAME
|
||||
add hl, bc
|
||||
inc [hl]
|
||||
call Function8d189 ; load pointer from Unknown_8d6e6
|
||||
ld a, [hli]
|
||||
cp $fe
|
||||
cp -2
|
||||
jr z, .minus_2
|
||||
cp $ff
|
||||
cp -1
|
||||
jr z, .minus_1
|
||||
|
||||
push af
|
||||
@ -486,7 +496,7 @@ endr
|
||||
Function8d189: ; 8d189
|
||||
; Get the data for the current frame for the current animation sequence
|
||||
|
||||
; Unknown_8d6e6 + 2 * SpriteAnim[SPRITEANIMSTRUCT_01] + 3 * SpriteAnim[SPRITEANIMSTRUCT_FRAME]
|
||||
; Unknown_8d6e6[SpriteAnim[SPRITEANIMSTRUCT_01]][SpriteAnim[SPRITEANIMSTRUCT_FRAME]]
|
||||
ld hl, SPRITEANIMSTRUCT_01
|
||||
add hl, bc
|
||||
ld e, [hl]
|
||||
@ -508,6 +518,7 @@ endr
|
||||
; 8d1a2
|
||||
|
||||
Function8d1a2: ; 8d1a2
|
||||
; Load OAM data pointer
|
||||
ld e, a
|
||||
ld d, 0
|
||||
ld hl, Unknown_8d94d
|
||||
|
@ -5,7 +5,7 @@ CanLearnTMHMMove: ; 11639
|
||||
ld hl, BaseTMHM
|
||||
push hl
|
||||
|
||||
ld a, [wd262]
|
||||
ld a, [wPutativeTMHMMove]
|
||||
ld b, a
|
||||
ld c, 0
|
||||
ld hl, TMHMMoves
|
||||
|
@ -30,7 +30,7 @@ Special_CelebiShrineEvent: ; 4989a
|
||||
inc d
|
||||
push de
|
||||
ld a, $90
|
||||
ld [wc3b5], a
|
||||
ld [wOAMRetentionSize], a
|
||||
callba DoNextFrameForAllSprites
|
||||
call Function49935
|
||||
ld c, 2
|
||||
|
@ -660,7 +660,7 @@ Function16a66: ; 16a66
|
||||
xor a
|
||||
ld [Buffer1], a
|
||||
predef FillMoves
|
||||
callba Function170bf
|
||||
callba InitEggMoves
|
||||
ld hl, wEggMonID
|
||||
ld a, [PlayerID]
|
||||
ld [hli], a
|
||||
|
@ -36,7 +36,7 @@ ShakeHeadbuttTree: ; 8c80a
|
||||
add hl, bc
|
||||
ld [hl], $84
|
||||
ld a, 36 * 4
|
||||
ld [wc3b5], a
|
||||
ld [wOAMRetentionSize], a
|
||||
callba DoNextFrameForAllSprites
|
||||
call GetHeadbuttTreeRelativeLocation
|
||||
ld a, $20
|
||||
@ -51,7 +51,7 @@ ShakeHeadbuttTree: ; 8c80a
|
||||
jr z, .done
|
||||
dec [hl]
|
||||
ld a, 36 * 4
|
||||
ld [wc3b5], a
|
||||
ld [wOAMRetentionSize], a
|
||||
callba DoNextFrameForAllSprites
|
||||
call DelayFrame
|
||||
jr .loop
|
||||
@ -68,7 +68,7 @@ ShakeHeadbuttTree: ; 8c80a
|
||||
call ByteFill
|
||||
ld de, Font
|
||||
ld hl, VTiles1
|
||||
lb bc, BANK(Font), $c
|
||||
lb bc, BANK(Font), 12
|
||||
call Get1bpp
|
||||
call ReplaceKrisSprite
|
||||
ret
|
||||
@ -124,8 +124,8 @@ OWCutAnimation: ; 8c940
|
||||
ld a, [wJumptableIndex]
|
||||
bit 7, a
|
||||
jr nz, .finish
|
||||
ld a, $90
|
||||
ld [wc3b5], a
|
||||
ld a, 36 * 4
|
||||
ld [wOAMRetentionSize], a
|
||||
callab DoNextFrameForAllSprites
|
||||
call OWCutJumptable
|
||||
call DelayFrame
|
||||
@ -341,8 +341,8 @@ FlyFromAnim: ; 8caed
|
||||
ld a, [wJumptableIndex]
|
||||
bit 7, a
|
||||
jr nz, .exit
|
||||
ld a, $0
|
||||
ld [wc3b5], a
|
||||
ld a, 0 * 4
|
||||
ld [wOAMRetentionSize], a
|
||||
callab DoNextFrameForAllSprites
|
||||
call Function8cbc8
|
||||
call DelayFrame
|
||||
@ -379,8 +379,8 @@ FlyToAnim: ; 8cb33
|
||||
ld a, [wJumptableIndex]
|
||||
bit 7, a
|
||||
jr nz, .exit
|
||||
ld a, $0
|
||||
ld [wc3b5], a
|
||||
ld a, 0 * 4
|
||||
ld [wOAMRetentionSize], a
|
||||
callab DoNextFrameForAllSprites
|
||||
call Function8cbc8
|
||||
call DelayFrame
|
||||
|
@ -248,5 +248,5 @@ palgreen EQUS "$0020 *"
|
||||
palblue EQUS "$0001 *"
|
||||
|
||||
dsprite: MACRO
|
||||
db \1 * 8 + \2, \3 * 8 + \4, \5, \6
|
||||
db (\1 * 8) % $100 + \2, (\3 * 8) % $100 + \4, \5, \6
|
||||
endm
|
||||
|
35
main.asm
35
main.asm
@ -8528,26 +8528,26 @@ WobbleChances: ; f9ba
|
||||
KnowsMove: ; f9ea
|
||||
ld a, MON_MOVES
|
||||
call GetPartyParamLocation
|
||||
ld a, [wd262]
|
||||
ld a, [wPutativeTMHMMove]
|
||||
ld b, a
|
||||
ld c, NUM_MOVES
|
||||
.asm_f9f5
|
||||
.loop
|
||||
ld a, [hli]
|
||||
cp b
|
||||
jr z, .asm_f9fe
|
||||
jr z, .knows_move
|
||||
dec c
|
||||
jr nz, .asm_f9f5
|
||||
jr nz, .loop
|
||||
and a
|
||||
ret
|
||||
|
||||
.asm_f9fe
|
||||
ld hl, UnknownText_0xfa06
|
||||
.knows_move
|
||||
ld hl, .Text_knows
|
||||
call PrintText
|
||||
scf
|
||||
ret
|
||||
; fa06
|
||||
|
||||
UnknownText_0xfa06: ; 0xfa06
|
||||
.Text_knows: ; 0xfa06
|
||||
; knows @ .
|
||||
text_jump UnknownText_0x1c5ea8
|
||||
db "@"
|
||||
@ -10983,8 +10983,7 @@ AddMonMenuItem: ; 24e83
|
||||
ret
|
||||
; 24e99
|
||||
|
||||
Function24e99: ; 24e99
|
||||
; BattleMonMenu
|
||||
BattleMonMenu: ; 24e99
|
||||
ld hl, MenuDataHeader_0x24ed4
|
||||
call CopyMenuDataHeader
|
||||
xor a
|
||||
@ -10996,7 +10995,7 @@ Function24e99: ; 24e99
|
||||
call CopyMenuData2
|
||||
ld a, [wMenuData2Flags]
|
||||
bit 7, a
|
||||
jr z, .asm_24ed0
|
||||
jr z, .set_carry
|
||||
call Function1c10
|
||||
ld hl, wcfa5
|
||||
set 6, [hl]
|
||||
@ -11004,15 +11003,15 @@ Function24e99: ; 24e99
|
||||
ld de, SFX_READ_TEXT_2
|
||||
call PlaySFX
|
||||
ld a, [hJoyPressed]
|
||||
bit 1, a
|
||||
jr z, .asm_24ed2
|
||||
bit B_BUTTON_F, a
|
||||
jr z, .clear_carry
|
||||
ret z
|
||||
|
||||
.asm_24ed0
|
||||
.set_carry
|
||||
scf
|
||||
ret
|
||||
|
||||
.asm_24ed2
|
||||
.clear_carry
|
||||
and a
|
||||
ret
|
||||
; 24ed4
|
||||
@ -12863,7 +12862,7 @@ Function2c7bf: ; 2c7bf (b:47bf)
|
||||
jr c, .NotTMHM
|
||||
call GetTMHMItemMove
|
||||
ld a, [wCurTMHM]
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
call GetMoveName
|
||||
call CopyName1
|
||||
ld hl, UnknownText_0x2c8bf ; Booted up a TM
|
||||
@ -13206,7 +13205,7 @@ Function2c9e2: ; 2c9e2 (b:49e2)
|
||||
.okay
|
||||
predef GetTMHMMove
|
||||
ld a, [wd265]
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
call GetMoveName
|
||||
pop hl
|
||||
ld bc, $3
|
||||
@ -13270,7 +13269,7 @@ Function2ca95: ; 2ca95
|
||||
add hl, bc
|
||||
predef GetTMHMMove
|
||||
ld a, [wd265]
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
call GetMoveName
|
||||
push hl
|
||||
call PlaceString
|
||||
@ -14410,7 +14409,7 @@ Special_MoveTutor: ; 4925b
|
||||
ld [wItemAttributeParamBuffer], a
|
||||
call Function492a5
|
||||
ld [wd265], a
|
||||
ld [wd262], a
|
||||
ld [wPutativeTMHMMove], a
|
||||
call GetMoveName
|
||||
call CopyName1
|
||||
callba Function2c7fb
|
||||
|
@ -2054,7 +2054,7 @@ Function100cb5: ; 100cb5
|
||||
ret
|
||||
; 100d22
|
||||
|
||||
Function100d22: ; 100d22
|
||||
MobileBattleMonMenu: ; 100d22
|
||||
call Function100dd8
|
||||
ret c
|
||||
call Function100d67
|
||||
|
@ -5884,8 +5884,8 @@ Function11ac51: ; 11ac51
|
||||
call Function11b314
|
||||
call Function11acb7
|
||||
call Function11ad6e
|
||||
ld a, $78
|
||||
ld [wc3b5], a
|
||||
ld a, 30 * 4
|
||||
ld [wOAMRetentionSize], a
|
||||
callba DoNextFrameForAllSprites
|
||||
callba ReloadMapPart
|
||||
jr .asm_11ac82
|
||||
|
19
wram.asm
19
wram.asm
@ -463,19 +463,19 @@ wSpriteAnimationStructsEnd::
|
||||
wc3ac:: ds 8 ; c3ac
|
||||
wSpriteAnimCount::
|
||||
wc3b4:: ds 1
|
||||
wc3b5:: ds 1
|
||||
wOAMRetentionSize:: ds 1
|
||||
|
||||
CurIcon:: ; c3b6
|
||||
ds 1
|
||||
|
||||
|
||||
wc3b7:: ds 1
|
||||
wc3b8:: dw
|
||||
wc3ba:: ds 1
|
||||
wc3bb:: ds 1
|
||||
wc3bc:: ds 1
|
||||
wc3bd:: ds 1
|
||||
wc3be:: ds 1
|
||||
wc3b8:: ds 2
|
||||
wCurrAnimVTile:: ds 1
|
||||
wCurrAnimXCoord:: ds 1
|
||||
wCurrAnimYCoord:: ds 1
|
||||
wCurrAnimXOffset:: ds 1
|
||||
wCurrAnimYOffset:: ds 1
|
||||
wc3bf:: ds 1
|
||||
wc3c0:: ds 1
|
||||
wSpriteAnimsEnd::
|
||||
@ -1838,8 +1838,7 @@ wd13f:: ds 2
|
||||
PartyMenuActionText:: ; d141
|
||||
ds 1
|
||||
|
||||
wItemAttributeParamBuffer::
|
||||
wd142::
|
||||
wItemAttributeParamBuffer:: ; d142
|
||||
ds 1
|
||||
|
||||
CurPartyLevel:: ; d143
|
||||
@ -2155,7 +2154,7 @@ CurDamage:: ; d256
|
||||
wd25a:: ds 3
|
||||
wd25d:: ds 1
|
||||
wListMoves_MoveIndicesBuffer:: ds 4
|
||||
wd262:: ds 1
|
||||
wPutativeTMHMMove:: ds 1
|
||||
wd263:: ds 1
|
||||
wd264:: ds 1
|
||||
wFoundMatchingIDInParty::
|
||||
|
Loading…
Reference in New Issue
Block a user