mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Finish function labels in battle core
This commit is contained in:
parent
2ed6c357af
commit
7cc2571529
266
battle/core.asm
266
battle/core.asm
@ -2158,14 +2158,14 @@ HandleEnemyMonFaint: ; 3cd55
|
|||||||
|
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wPlayerAction], a
|
ld [wPlayerAction], a
|
||||||
call Function3cf4a
|
call HandleEnemySwitch
|
||||||
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
||||||
jr DoubleSwitch
|
jr DoubleSwitch
|
||||||
|
|
||||||
.player_mon_not_fainted
|
.player_mon_not_fainted
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wPlayerAction], a
|
ld [wPlayerAction], a
|
||||||
call Function3cf4a
|
call HandleEnemySwitch
|
||||||
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
||||||
xor a
|
xor a
|
||||||
ld [wPlayerAction], a
|
ld [wPlayerAction], a
|
||||||
@ -2406,7 +2406,7 @@ CheckEnemyTrainerDefeated: ; 3cf35
|
|||||||
ret
|
ret
|
||||||
; 3cf4a
|
; 3cf4a
|
||||||
|
|
||||||
Function3cf4a: ; 3cf4a
|
HandleEnemySwitch: ; 3cf4a
|
||||||
ld hl, EnemyHPPal
|
ld hl, EnemyHPPal
|
||||||
ld e, HP_BAR_LENGTH_PX
|
ld e, HP_BAR_LENGTH_PX
|
||||||
call UpdateHPPal
|
call UpdateHPPal
|
||||||
@ -2442,15 +2442,13 @@ EnemyPartyMonEntrance: ; 3cf78
|
|||||||
call BreakAttraction
|
call BreakAttraction
|
||||||
pop af
|
pop af
|
||||||
and a
|
and a
|
||||||
jr nz, .asm_3cf8f
|
jr nz, .set
|
||||||
|
|
||||||
call EnemySwitch
|
call EnemySwitch
|
||||||
jr .asm_3cf92
|
jr .done_switch
|
||||||
|
|
||||||
.asm_3cf8f
|
.set
|
||||||
call EnemySwitch_SetMode
|
call EnemySwitch_SetMode
|
||||||
|
.done_switch
|
||||||
.asm_3cf92
|
|
||||||
call ResetBattleParticipants
|
call ResetBattleParticipants
|
||||||
call SetEnemyTurn
|
call SetEnemyTurn
|
||||||
call SpikesDamage
|
call SpikesDamage
|
||||||
@ -2499,7 +2497,7 @@ WinTrainerBattle: ; 3cfa4
|
|||||||
call PrintWinLossText
|
call PrintWinLossText
|
||||||
|
|
||||||
.skip_win_loss_text
|
.skip_win_loss_text
|
||||||
jp Function3d02b
|
jp HandleBattleReward
|
||||||
|
|
||||||
.mobile
|
.mobile
|
||||||
call BattleWinSlideInEnemyTrainerFrontpic
|
call BattleWinSlideInEnemyTrainerFrontpic
|
||||||
@ -2528,7 +2526,7 @@ WinTrainerBattle: ; 3cfa4
|
|||||||
ret
|
ret
|
||||||
; 3d02b
|
; 3d02b
|
||||||
|
|
||||||
Function3d02b: ; 3d02b
|
HandleBattleReward: ; 3d02b
|
||||||
ld a, [wAmuletCoin]
|
ld a, [wAmuletCoin]
|
||||||
and a
|
and a
|
||||||
call nz, .DoubleReward
|
call nz, .DoubleReward
|
||||||
@ -2809,7 +2807,7 @@ HandlePlayerMonFaint: ; 3d14e
|
|||||||
ret nz
|
ret nz
|
||||||
ld a, $1
|
ld a, $1
|
||||||
ld [wPlayerAction], a
|
ld [wPlayerAction], a
|
||||||
call Function3cf4a
|
call HandleEnemySwitch
|
||||||
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
jp z, WildFled_EnemyFled_LinkBattleCanceled
|
||||||
jp DoubleSwitch
|
jp DoubleSwitch
|
||||||
; 3d1aa
|
; 3d1aa
|
||||||
@ -2999,7 +2997,7 @@ SetUpBattlePartyMenu: ; switch to fullscreen menu?
|
|||||||
ret
|
ret
|
||||||
; 3d313
|
; 3d313
|
||||||
|
|
||||||
Function3d313: ; 3d313
|
JumpToPartyMenuAndPrintText: ; 3d313
|
||||||
callba WritePartyMenuTilemap
|
callba WritePartyMenuTilemap
|
||||||
callba PrintPartyMenuText
|
callba PrintPartyMenuText
|
||||||
call WaitBGMap
|
call WaitBGMap
|
||||||
@ -3008,14 +3006,14 @@ Function3d313: ; 3d313
|
|||||||
ret
|
ret
|
||||||
; 3d329
|
; 3d329
|
||||||
|
|
||||||
Function3d329: ; 3d329
|
SelectBattleMon: ; 3d329
|
||||||
call IsMobileBattle
|
call IsMobileBattle
|
||||||
jr z, .mobile
|
jr z, .mobile
|
||||||
callba PartyMenuSelect
|
callba PartyMenuSelect
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.mobile
|
.mobile
|
||||||
callba Function100cb5
|
callba Mobile_PartyMenuSelect
|
||||||
ret
|
ret
|
||||||
; 3d33c
|
; 3d33c
|
||||||
|
|
||||||
@ -3023,8 +3021,8 @@ PickPartyMonInBattle: ; 3d33c
|
|||||||
.loop
|
.loop
|
||||||
ld a, $2 ; Which PKMN?
|
ld a, $2 ; Which PKMN?
|
||||||
ld [PartyMenuActionText], a
|
ld [PartyMenuActionText], a
|
||||||
call Function3d313
|
call JumpToPartyMenuAndPrintText
|
||||||
call Function3d329
|
call SelectBattleMon
|
||||||
ret c
|
ret c
|
||||||
call CheckIfPartyHasPkmnToBattleWith
|
call CheckIfPartyHasPkmnToBattleWith
|
||||||
jr z, .loop
|
jr z, .loop
|
||||||
@ -3434,7 +3432,7 @@ FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
|
|||||||
ld a, $1
|
ld a, $1
|
||||||
ld [Buffer1], a
|
ld [Buffer1], a
|
||||||
ld [Buffer2], a
|
ld [Buffer2], a
|
||||||
.asm_3d5a3
|
.loop
|
||||||
ld hl, Buffer1
|
ld hl, Buffer1
|
||||||
sla [hl]
|
sla [hl]
|
||||||
inc hl
|
inc hl
|
||||||
@ -3442,10 +3440,10 @@ FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
|
|||||||
inc b
|
inc b
|
||||||
ld a, [OTPartyCount]
|
ld a, [OTPartyCount]
|
||||||
cp b
|
cp b
|
||||||
jp z, Function3d672
|
jp z, ScoreMonTypeMatchups
|
||||||
ld a, [CurOTMon]
|
ld a, [CurOTMon]
|
||||||
cp b
|
cp b
|
||||||
jr z, .asm_3d5d0
|
jr z, .discourage
|
||||||
ld hl, OTPartyMon1HP
|
ld hl, OTPartyMon1HP
|
||||||
push bc
|
push bc
|
||||||
ld a, b
|
ld a, b
|
||||||
@ -3455,15 +3453,15 @@ FindPkmnInOTPartyToSwitchIntoBattle: ; 3d599
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
or c
|
or c
|
||||||
pop bc
|
pop bc
|
||||||
jr z, .asm_3d5d0
|
jr z, .discourage
|
||||||
call LookUpTheEffectivenessOfEveryMove
|
call LookUpTheEffectivenessOfEveryMove
|
||||||
call IsThePlayerPkmnTypesEffectiveAgainstOTPkmn
|
call IsThePlayerPkmnTypesEffectiveAgainstOTPkmn
|
||||||
jr .asm_3d5a3
|
jr .loop
|
||||||
|
|
||||||
.asm_3d5d0
|
.discourage
|
||||||
ld hl, Buffer2
|
ld hl, Buffer2
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
jr .asm_3d5a3
|
jr .loop
|
||||||
; 3d5d7
|
; 3d5d7
|
||||||
|
|
||||||
LookUpTheEffectivenessOfEveryMove: ; 3d5d7
|
LookUpTheEffectivenessOfEveryMove: ; 3d5d7
|
||||||
@ -3517,7 +3515,7 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618
|
|||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
dec a
|
dec a
|
||||||
ld hl, BaseData + 7 ; type
|
ld hl, BaseData + 7 ; type
|
||||||
ld bc, $20
|
ld bc, BaseData1 - BaseData0
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
ld de, EnemyMonType
|
ld de, EnemyMonType
|
||||||
ld bc, 2
|
ld bc, 2
|
||||||
@ -3529,80 +3527,80 @@ IsThePlayerPkmnTypesEffectiveAgainstOTPkmn: ; 3d618
|
|||||||
callab BattleCheckTypeMatchup
|
callab BattleCheckTypeMatchup
|
||||||
ld a, [wd265]
|
ld a, [wd265]
|
||||||
cp 10 + 1 ; 1.0 + 0.1
|
cp 10 + 1 ; 1.0 + 0.1
|
||||||
jr nc, .asm_3d663
|
jr nc, .super_effective
|
||||||
ld a, [BattleMonType2]
|
ld a, [BattleMonType2]
|
||||||
ld [wPlayerMoveStruct + MOVE_TYPE], a
|
ld [wPlayerMoveStruct + MOVE_TYPE], a
|
||||||
callab BattleCheckTypeMatchup
|
callab BattleCheckTypeMatchup
|
||||||
ld a, [wd265]
|
ld a, [wd265]
|
||||||
cp 10 + 1 ; 1.0 + 0.1
|
cp 10 + 1 ; 1.0 + 0.1
|
||||||
jr nc, .asm_3d663
|
jr nc, .super_effective
|
||||||
pop bc
|
pop bc
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_3d663
|
.super_effective
|
||||||
pop bc
|
pop bc
|
||||||
ld hl, Buffer1
|
ld hl, Buffer1
|
||||||
bit 0, [hl]
|
bit 0, [hl]
|
||||||
jr nz, .asm_3d66f
|
jr nz, .reset
|
||||||
inc hl
|
inc hl
|
||||||
set 0, [hl]
|
set 0, [hl]
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_3d66f
|
.reset
|
||||||
res 0, [hl]
|
res 0, [hl]
|
||||||
ret
|
ret
|
||||||
; 3d672
|
; 3d672
|
||||||
|
|
||||||
Function3d672: ; 3d672
|
ScoreMonTypeMatchups: ; 3d672
|
||||||
.asm_3d672
|
.loop1
|
||||||
ld hl, Buffer1
|
ld hl, Buffer1
|
||||||
sla [hl]
|
sla [hl]
|
||||||
inc hl
|
inc hl
|
||||||
sla [hl]
|
sla [hl]
|
||||||
jr nc, .asm_3d672
|
jr nc, .loop1
|
||||||
ld a, [OTPartyCount]
|
ld a, [OTPartyCount]
|
||||||
ld b, a
|
ld b, a
|
||||||
ld c, [hl]
|
ld c, [hl]
|
||||||
.asm_3d681
|
.loop2
|
||||||
sla c
|
sla c
|
||||||
jr nc, .asm_3d68a
|
jr nc, .okay
|
||||||
dec b
|
dec b
|
||||||
jr z, .asm_3d6a7
|
jr z, .loop5
|
||||||
jr .asm_3d681
|
jr .loop2
|
||||||
|
|
||||||
.asm_3d68a
|
.okay
|
||||||
ld a, [Buffer1]
|
ld a, [Buffer1]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3d69a
|
jr z, .okay2
|
||||||
ld b, $ff
|
ld b, $ff
|
||||||
ld c, a
|
ld c, a
|
||||||
.asm_3d693
|
.loop3
|
||||||
inc b
|
inc b
|
||||||
sla c
|
sla c
|
||||||
jr nc, .asm_3d693
|
jr nc, .loop3
|
||||||
jr .asm_3d6c9
|
jr .quit
|
||||||
|
|
||||||
.asm_3d69a
|
.okay2
|
||||||
ld b, $ff
|
ld b, $ff
|
||||||
ld a, [Buffer2]
|
ld a, [Buffer2]
|
||||||
ld c, a
|
ld c, a
|
||||||
.asm_3d6a0
|
.loop4
|
||||||
inc b
|
inc b
|
||||||
sla c
|
sla c
|
||||||
jr c, .asm_3d6a0
|
jr c, .loop4
|
||||||
jr .asm_3d6c9
|
jr .quit
|
||||||
|
|
||||||
.asm_3d6a7
|
.loop5
|
||||||
ld a, [OTPartyCount]
|
ld a, [OTPartyCount]
|
||||||
ld b, a
|
ld b, a
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
and $7
|
and $7
|
||||||
cp b
|
cp b
|
||||||
jr nc, .asm_3d6a7
|
jr nc, .loop5
|
||||||
ld b, a
|
ld b, a
|
||||||
ld a, [CurOTMon]
|
ld a, [CurOTMon]
|
||||||
cp b
|
cp b
|
||||||
jr z, .asm_3d6a7
|
jr z, .loop5
|
||||||
ld hl, OTPartyMon1HP
|
ld hl, OTPartyMon1HP
|
||||||
push bc
|
push bc
|
||||||
ld a, b
|
ld a, b
|
||||||
@ -3612,9 +3610,9 @@ Function3d672: ; 3d672
|
|||||||
ld c, a
|
ld c, a
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
or c
|
or c
|
||||||
jr z, .asm_3d6a7
|
jr z, .loop5
|
||||||
|
|
||||||
.asm_3d6c9
|
.quit
|
||||||
ret
|
ret
|
||||||
; 3d6ca
|
; 3d6ca
|
||||||
|
|
||||||
@ -4163,7 +4161,7 @@ ResetPlayerStatLevels: ; 3dab1
|
|||||||
; 3dabd
|
; 3dabd
|
||||||
|
|
||||||
|
|
||||||
Function3dabd: ; 3dabd
|
InitEnemyMon: ; 3dabd
|
||||||
ld a, [CurPartyMon]
|
ld a, [CurPartyMon]
|
||||||
ld hl, OTPartyMon1Species
|
ld hl, OTPartyMon1Species
|
||||||
call GetPartyLocation
|
call GetPartyLocation
|
||||||
@ -4205,12 +4203,12 @@ endr
|
|||||||
ld hl, BaseStats
|
ld hl, BaseStats
|
||||||
ld de, EnemyMonBaseStats
|
ld de, EnemyMonBaseStats
|
||||||
ld b, 5
|
ld b, 5
|
||||||
.asm_3db25
|
.loop
|
||||||
ld a, [hli]
|
ld a, [hli]
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_3db25
|
jr nz, .loop
|
||||||
ld a, [CurPartyMon]
|
ld a, [CurPartyMon]
|
||||||
ld [CurOTMon], a
|
ld [CurOTMon], a
|
||||||
ret
|
ret
|
||||||
@ -4452,7 +4450,7 @@ PursuitSwitch: ; 3dc5b
|
|||||||
ret
|
ret
|
||||||
; 3dce6
|
; 3dce6
|
||||||
|
|
||||||
Function3dce6: ; 3dce6
|
RecallPlayerMon: ; 3dce6
|
||||||
ld a, [hBattleTurn]
|
ld a, [hBattleTurn]
|
||||||
push af
|
push af
|
||||||
xor a
|
xor a
|
||||||
@ -5322,7 +5320,7 @@ BattleMenu_Pack: ; 3e1c7
|
|||||||
|
|
||||||
BattleMenu_PKMN: ; 3e28d
|
BattleMenu_PKMN: ; 3e28d
|
||||||
call LoadStandardMenuDataHeader
|
call LoadStandardMenuDataHeader
|
||||||
Function3e290:
|
BattleMenuPKMN_ReturnFromStats:
|
||||||
call ExitMenu
|
call ExitMenu
|
||||||
call LoadStandardMenuDataHeader
|
call LoadStandardMenuDataHeader
|
||||||
call ClearBGPalettes
|
call ClearBGPalettes
|
||||||
@ -5330,8 +5328,8 @@ BattleMenuPKMN_Loop:
|
|||||||
call SetUpBattlePartyMenu
|
call SetUpBattlePartyMenu
|
||||||
xor a
|
xor a
|
||||||
ld [PartyMenuActionText], a
|
ld [PartyMenuActionText], a
|
||||||
call Function3d313
|
call JumpToPartyMenuAndPrintText
|
||||||
call Function3d329
|
call SelectBattleMon
|
||||||
jr c, .Cancel
|
jr c, .Cancel
|
||||||
.loop
|
.loop
|
||||||
callba FreezeMonIcons
|
callba FreezeMonIcons
|
||||||
@ -5356,7 +5354,7 @@ BattleMenuPKMN_Loop:
|
|||||||
call Battle_StatsScreen
|
call Battle_StatsScreen
|
||||||
call CheckMobileBattleError
|
call CheckMobileBattleError
|
||||||
jr c, .Cancel
|
jr c, .Cancel
|
||||||
jp Function3e290
|
jp BattleMenuPKMN_ReturnFromStats
|
||||||
|
|
||||||
.Cancel
|
.Cancel
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
@ -5519,7 +5517,7 @@ BattleMonEntrance: ; 3e40b
|
|||||||
call SetEnemyTurn
|
call SetEnemyTurn
|
||||||
call PursuitSwitch
|
call PursuitSwitch
|
||||||
jr c, .ok
|
jr c, .ok
|
||||||
call Function3dce6
|
call RecallPlayerMon
|
||||||
.ok
|
.ok
|
||||||
|
|
||||||
hlcoord 9, 7
|
hlcoord 9, 7
|
||||||
@ -6258,12 +6256,12 @@ LoadEnemyMon: ; 3e8eb
|
|||||||
; We don't need to be here if we're in a link battle
|
; We don't need to be here if we're in a link battle
|
||||||
ld a, [wLinkMode]
|
ld a, [wLinkMode]
|
||||||
and a
|
and a
|
||||||
jp nz, Function3dabd
|
jp nz, InitEnemyMon
|
||||||
|
|
||||||
; and also not in a BattleTower-Battle
|
; and also not in a BattleTower-Battle
|
||||||
ld a, [InBattleTowerBattle] ; ????
|
ld a, [InBattleTowerBattle] ; ????
|
||||||
bit 0, a
|
bit 0, a
|
||||||
jp nz, Function3dabd
|
jp nz, InitEnemyMon
|
||||||
|
|
||||||
; Make sure everything knows what species we're working with
|
; Make sure everything knows what species we're working with
|
||||||
ld a, [TempEnemyMonSpecies]
|
ld a, [TempEnemyMonSpecies]
|
||||||
@ -6848,7 +6846,8 @@ CheckUnownLetter: ; 3eb75
|
|||||||
; 3ebc7
|
; 3ebc7
|
||||||
|
|
||||||
|
|
||||||
Function3ebc7: ; 3ebc7
|
SwapBattlerLevels: ; 3ebc7
|
||||||
|
; unreferenced
|
||||||
push bc
|
push bc
|
||||||
ld a, [BattleMonLevel]
|
ld a, [BattleMonLevel]
|
||||||
ld b, a
|
ld b, a
|
||||||
@ -8184,7 +8183,7 @@ TextJump_GoodComeBack: ; 3f352
|
|||||||
db "@"
|
db "@"
|
||||||
; 3f357
|
; 3f357
|
||||||
|
|
||||||
Function_TextJump_ComeBack: ; 3f357
|
UnusedFunction_TextJump_ComeBack: ; 3f357
|
||||||
; this function doesn't seem to be used
|
; this function doesn't seem to be used
|
||||||
ld hl, TextJump_ComeBack
|
ld hl, TextJump_ComeBack
|
||||||
ret
|
ret
|
||||||
@ -8648,6 +8647,7 @@ InitEnemyWildmon: ; 3f607
|
|||||||
; 3f662
|
; 3f662
|
||||||
|
|
||||||
Function3f662: ; 3f662
|
Function3f662: ; 3f662
|
||||||
|
; XXX
|
||||||
ld hl, EnemyMonMoves
|
ld hl, EnemyMonMoves
|
||||||
ld de, wListMoves_MoveIndicesBuffer
|
ld de, wListMoves_MoveIndicesBuffer
|
||||||
ld b, NUM_MOVES
|
ld b, NUM_MOVES
|
||||||
@ -8852,8 +8852,8 @@ DetermineMobileBattleResult: ; 3f77c
|
|||||||
ld a, BANK(sLinkBattleStats)
|
ld a, BANK(sLinkBattleStats)
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
|
|
||||||
call Function3fa42
|
call AddLastMobileBattleToLinkRecord
|
||||||
call Function3f85f
|
call ReadAndPrintLinkBattleRecord
|
||||||
|
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
|
|
||||||
@ -8905,7 +8905,7 @@ DisplayLinkRecord: ; 3f836
|
|||||||
ld a, BANK(sLinkBattleStats)
|
ld a, BANK(sLinkBattleStats)
|
||||||
call GetSRAMBank
|
call GetSRAMBank
|
||||||
|
|
||||||
call Function3f85f
|
call ReadAndPrintLinkBattleRecord
|
||||||
|
|
||||||
call CloseSRAM
|
call CloseSRAM
|
||||||
hlcoord 0, 0, AttrMap
|
hlcoord 0, 0, AttrMap
|
||||||
@ -8916,86 +8916,85 @@ DisplayLinkRecord: ; 3f836
|
|||||||
ld b, SCGB_08
|
ld b, SCGB_08
|
||||||
call GetSGBLayout
|
call GetSGBLayout
|
||||||
call SetPalettes
|
call SetPalettes
|
||||||
ld c, $8
|
ld c, 8
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
call WaitPressAorB_BlinkCursor
|
call WaitPressAorB_BlinkCursor
|
||||||
ret
|
ret
|
||||||
; 3f85f
|
; 3f85f
|
||||||
|
|
||||||
|
|
||||||
Function3f85f: ; 3f85f
|
ReadAndPrintLinkBattleRecord: ; 3f85f
|
||||||
call ClearTileMap
|
call ClearTileMap
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
call .asm_3f8e0
|
call .PrintBattleRecord
|
||||||
hlcoord 0, 8
|
hlcoord 0, 8
|
||||||
ld b, $5
|
ld b, 5
|
||||||
ld de, sLinkBattleStats + $8
|
ld de, sLinkBattleRecord + 2
|
||||||
.asm_3f870
|
.loop
|
||||||
push bc
|
push bc
|
||||||
push hl
|
push hl
|
||||||
push de
|
push de
|
||||||
ld a, [de]
|
ld a, [de]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3f8c9
|
jr z, .PrintFormatString
|
||||||
ld a, [wSavedAtLeastOnce]
|
ld a, [wSavedAtLeastOnce]
|
||||||
and a
|
and a
|
||||||
jr z, .asm_3f8c9
|
jr z, .PrintFormatString
|
||||||
push hl
|
push hl
|
||||||
push hl
|
push hl
|
||||||
ld h, d
|
ld h, d
|
||||||
ld l, e
|
ld l, e
|
||||||
ld de, wd002
|
ld de, wd002
|
||||||
ld bc, $000a
|
ld bc, 10
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld a, $50
|
ld a, "@"
|
||||||
ld [de], a
|
ld [de], a
|
||||||
inc de
|
inc de
|
||||||
ld bc, $0006
|
ld bc, 6
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld de, wd002
|
ld de, wd002
|
||||||
pop hl
|
pop hl
|
||||||
call PlaceString
|
call PlaceString
|
||||||
pop hl
|
pop hl
|
||||||
ld de, $001a
|
ld de, 26
|
||||||
add hl, de
|
add hl, de
|
||||||
push hl
|
push hl
|
||||||
ld de, wd00d
|
ld de, wd00d
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
pop hl
|
pop hl
|
||||||
ld de, $0005
|
ld de, 5
|
||||||
add hl, de
|
add hl, de
|
||||||
push hl
|
push hl
|
||||||
ld de, wd00f
|
ld de, wd00f
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
pop hl
|
pop hl
|
||||||
ld de, $0005
|
ld de, 5
|
||||||
add hl, de
|
add hl, de
|
||||||
ld de, wd011
|
ld de, wd011
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
jr .asm_3f8cf
|
jr .next
|
||||||
|
|
||||||
.asm_3f8c9
|
.PrintFormatString
|
||||||
ld de, .Format
|
ld de, .Format
|
||||||
call PlaceString
|
call PlaceString
|
||||||
|
.next
|
||||||
.asm_3f8cf
|
|
||||||
pop hl
|
pop hl
|
||||||
ld bc, $0012
|
ld bc, 18
|
||||||
add hl, bc
|
add hl, bc
|
||||||
ld d, h
|
ld d, h
|
||||||
ld e, l
|
ld e, l
|
||||||
pop hl
|
pop hl
|
||||||
ld bc, $0028
|
ld bc, 2 * SCREEN_WIDTH
|
||||||
add hl, bc
|
add hl, bc
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz, .asm_3f870
|
jr nz, .loop
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_3f8e0
|
.PrintBattleRecord
|
||||||
hlcoord 1, 0
|
hlcoord 1, 0
|
||||||
ld de, .Record
|
ld de, .Record
|
||||||
call PlaceString
|
call PlaceString
|
||||||
@ -9010,30 +9009,30 @@ Function3f85f: ; 3f85f
|
|||||||
|
|
||||||
hlcoord 6, 4
|
hlcoord 6, 4
|
||||||
ld de, sLinkBattleWins
|
ld de, sLinkBattleWins
|
||||||
call .asm_3f92b
|
call .PrintZerosIfNoSaveFileExists
|
||||||
jr c, .asm_3f92a
|
jr c, .quit
|
||||||
|
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
|
|
||||||
hlcoord 11, 4
|
hlcoord 11, 4
|
||||||
ld de, sLinkBattleLosses
|
ld de, sLinkBattleLosses
|
||||||
call .asm_3f92b
|
call .PrintZerosIfNoSaveFileExists
|
||||||
|
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
|
|
||||||
hlcoord 16, 4
|
hlcoord 16, 4
|
||||||
ld de, sLinkBattleDraws
|
ld de, sLinkBattleDraws
|
||||||
call .asm_3f92b
|
call .PrintZerosIfNoSaveFileExists
|
||||||
|
|
||||||
lb bc, 2, 4
|
lb bc, 2, 4
|
||||||
call PrintNum
|
call PrintNum
|
||||||
|
|
||||||
.asm_3f92a
|
.quit
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.asm_3f92b
|
.PrintZerosIfNoSaveFileExists
|
||||||
ld a, [wSavedAtLeastOnce]
|
ld a, [wSavedAtLeastOnce]
|
||||||
and a
|
and a
|
||||||
ret nz
|
ret nz
|
||||||
@ -9048,7 +9047,8 @@ Function3f85f: ; 3f85f
|
|||||||
; 3f947
|
; 3f947
|
||||||
|
|
||||||
.Format ; 3f947
|
.Format ; 3f947
|
||||||
db " --- <LNBRK> - - -@"
|
db " --- <LNBRK>"
|
||||||
|
db " - - -@"
|
||||||
.Record ; 3f964
|
.Record ; 3f964
|
||||||
db "<PLAYER>'s RECORD@"
|
db "<PLAYER>'s RECORD@"
|
||||||
.Result ; 3f96e
|
.Result ; 3f96e
|
||||||
@ -9166,17 +9166,17 @@ GetRoamMonSpecies: ; 3fa31
|
|||||||
; 3fa42
|
; 3fa42
|
||||||
|
|
||||||
|
|
||||||
Function3fa42: ; 3fa42
|
AddLastMobileBattleToLinkRecord: ; 3fa42
|
||||||
ld hl, OTPlayerID
|
ld hl, OTPlayerID
|
||||||
ld de, StringBuffer1
|
ld de, StringBuffer1
|
||||||
ld bc, 2
|
ld bc, 2
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld hl, OTPlayerName
|
ld hl, OTPlayerName
|
||||||
ld bc, 10
|
ld bc, NAME_LENGTH - 1
|
||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld hl, s1_b254
|
ld hl, sLinkBattleResults
|
||||||
call Function3faa0
|
call .StoreResult
|
||||||
ld hl, s1_b266
|
ld hl, sLinkBattleRecord
|
||||||
ld d, 5
|
ld d, 5
|
||||||
.loop
|
.loop
|
||||||
push hl
|
push hl
|
||||||
@ -9218,24 +9218,22 @@ Function3fa42: ; 3fa42
|
|||||||
pop hl
|
pop hl
|
||||||
|
|
||||||
.done
|
.done
|
||||||
call Function3faa0
|
call .StoreResult
|
||||||
call Function3fac8
|
call .FindOpponentAndAppendRecord
|
||||||
ret
|
ret
|
||||||
; 3faa0
|
; 3faa0
|
||||||
|
.StoreResult: ; 3faa0
|
||||||
Function3faa0: ; 3faa0
|
|
||||||
ld a, [wBattleResult]
|
ld a, [wBattleResult]
|
||||||
and $f
|
and $f
|
||||||
cp $1
|
cp $1
|
||||||
ld bc, 13
|
ld bc, sLinkBattleWins + 1 - sLinkBattleResults
|
||||||
jr c, .okay
|
jr c, .okay
|
||||||
ld bc, 15
|
ld bc, sLinkBattleLosses + 1 - sLinkBattleResults
|
||||||
jr z, .okay
|
jr z, .okay
|
||||||
ld bc, 17
|
ld bc, sLinkBattleDraws + 1 - sLinkBattleResults
|
||||||
|
|
||||||
.okay
|
.okay
|
||||||
add hl, bc
|
add hl, bc
|
||||||
call Function3fabe
|
call .CheckOverflow
|
||||||
ret nc
|
ret nc
|
||||||
inc [hl]
|
inc [hl]
|
||||||
ret nz
|
ret nz
|
||||||
@ -9244,26 +9242,26 @@ Function3faa0: ; 3faa0
|
|||||||
ret
|
ret
|
||||||
; 3fabe
|
; 3fabe
|
||||||
|
|
||||||
Function3fabe: ; 3fabe
|
.CheckOverflow: ; 3fabe
|
||||||
dec hl
|
dec hl
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
inc hl
|
inc hl
|
||||||
cp $27
|
cp 9999 / $100
|
||||||
ret c
|
ret c
|
||||||
ld a, [hl]
|
ld a, [hl]
|
||||||
cp $f
|
cp 9999 % $100
|
||||||
ret
|
ret
|
||||||
; 3fac8
|
; 3fac8
|
||||||
|
|
||||||
Function3fac8: ; 3fac8
|
.FindOpponentAndAppendRecord: ; 3fac8
|
||||||
ld b, $5
|
ld b, 5
|
||||||
ld hl, s1_b277
|
ld hl, sLinkBattleRecord + 17
|
||||||
ld de, wd002
|
ld de, wd002
|
||||||
.loop
|
.loop3
|
||||||
push bc
|
push bc
|
||||||
push de
|
push de
|
||||||
push hl
|
push hl
|
||||||
call Function3fb54
|
call .LoadPointer
|
||||||
pop hl
|
pop hl
|
||||||
ld a, e
|
ld a, e
|
||||||
pop de
|
pop de
|
||||||
@ -9279,10 +9277,10 @@ Function3fac8: ; 3fac8
|
|||||||
add hl, bc
|
add hl, bc
|
||||||
pop bc
|
pop bc
|
||||||
dec b
|
dec b
|
||||||
jr nz, .loop
|
jr nz, .loop3
|
||||||
ld b, $0
|
ld b, $0
|
||||||
ld c, $1
|
ld c, $1
|
||||||
.loop2
|
.loop4
|
||||||
ld a, b
|
ld a, b
|
||||||
add b
|
add b
|
||||||
add b
|
add b
|
||||||
@ -9302,30 +9300,30 @@ Function3fac8: ; 3fac8
|
|||||||
ld e, l
|
ld e, l
|
||||||
pop hl
|
pop hl
|
||||||
push bc
|
push bc
|
||||||
ld c, $3
|
ld c, 3
|
||||||
call StringCmp
|
call StringCmp
|
||||||
pop bc
|
pop bc
|
||||||
jr z, .equal
|
jr z, .equal
|
||||||
jr nc, .done
|
jr nc, .done2
|
||||||
|
|
||||||
.equal
|
.equal
|
||||||
inc c
|
inc c
|
||||||
ld a, c
|
ld a, c
|
||||||
cp $5
|
cp $5
|
||||||
jr nz, .loop2
|
jr nz, .loop4
|
||||||
inc b
|
inc b
|
||||||
ld c, b
|
ld c, b
|
||||||
inc c
|
inc c
|
||||||
ld a, b
|
ld a, b
|
||||||
cp $4
|
cp $4
|
||||||
jr nz, .loop2
|
jr nz, .loop4
|
||||||
ret
|
ret
|
||||||
|
|
||||||
.done
|
.done2
|
||||||
push bc
|
push bc
|
||||||
ld a, b
|
ld a, b
|
||||||
ld bc, 18
|
ld bc, 18
|
||||||
ld hl, s1_b266
|
ld hl, sLinkBattleRecord
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
push hl
|
push hl
|
||||||
ld de, wd002
|
ld de, wd002
|
||||||
@ -9336,7 +9334,7 @@ Function3fac8: ; 3fac8
|
|||||||
push hl
|
push hl
|
||||||
ld a, c
|
ld a, c
|
||||||
ld bc, 18
|
ld bc, 18
|
||||||
ld hl, s1_b266
|
ld hl, sLinkBattleRecord
|
||||||
call AddNTimes
|
call AddNTimes
|
||||||
pop de
|
pop de
|
||||||
push hl
|
push hl
|
||||||
@ -9349,7 +9347,7 @@ Function3fac8: ; 3fac8
|
|||||||
ret
|
ret
|
||||||
; 3fb54
|
; 3fb54
|
||||||
|
|
||||||
Function3fb54: ; 3fb54
|
.LoadPointer: ; 3fb54
|
||||||
ld e, $0
|
ld e, $0
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
ld c, a
|
ld c, a
|
||||||
@ -9361,10 +9359,10 @@ Function3fb54: ; 3fb54
|
|||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
adc b
|
adc b
|
||||||
ld b, a
|
ld b, a
|
||||||
jr nc, .okay
|
jr nc, .okay2
|
||||||
inc e
|
inc e
|
||||||
|
|
||||||
.okay
|
.okay2
|
||||||
ld a, [hld]
|
ld a, [hld]
|
||||||
add c
|
add c
|
||||||
ld c, a
|
ld c, a
|
||||||
@ -9497,7 +9495,7 @@ CopyBackpic: ; 3fc30
|
|||||||
call Get2bpp
|
call Get2bpp
|
||||||
pop af
|
pop af
|
||||||
ld [rSVBK], a
|
ld [rSVBK], a
|
||||||
call Function3fc5b
|
call .LoadTrainerBackpicAsOAM
|
||||||
ld a, $31
|
ld a, $31
|
||||||
ld [hGraphicStartTile], a
|
ld [hGraphicStartTile], a
|
||||||
hlcoord 2, 6
|
hlcoord 2, 6
|
||||||
@ -9506,15 +9504,15 @@ CopyBackpic: ; 3fc30
|
|||||||
ret
|
ret
|
||||||
; 3fc5b
|
; 3fc5b
|
||||||
|
|
||||||
Function3fc5b: ; 3fc5b
|
.LoadTrainerBackpicAsOAM: ; 3fc5b
|
||||||
ld hl, Sprites
|
ld hl, Sprites
|
||||||
xor a
|
xor a
|
||||||
ld [hMapObjectIndexBuffer], a
|
ld [hMapObjectIndexBuffer], a
|
||||||
ld b, $6
|
ld b, $6
|
||||||
ld e, $a8
|
ld e, 21 * 8
|
||||||
.outer_loop
|
.outer_loop
|
||||||
ld c, $3
|
ld c, $3
|
||||||
ld d, $40
|
ld d, 8 * 8
|
||||||
.inner_loop
|
.inner_loop
|
||||||
ld [hl], d
|
ld [hl], d
|
||||||
inc hl
|
inc hl
|
||||||
|
@ -2005,7 +2005,7 @@ Function100c98: ; 100c98
|
|||||||
dn 2, 0
|
dn 2, 0
|
||||||
db D_UP | D_DOWN | A_BUTTON | B_BUTTON
|
db D_UP | D_DOWN | A_BUTTON | B_BUTTON
|
||||||
|
|
||||||
Function100cb5: ; 100cb5
|
Mobile_PartyMenuSelect: ; 100cb5
|
||||||
call Function100dd8
|
call Function100dd8
|
||||||
ret c
|
ret c
|
||||||
ld hl, w2DMenuFlags1
|
ld hl, w2DMenuFlags1
|
||||||
|
19
sram.asm
19
sram.asm
@ -122,16 +122,25 @@ s1_ad0f:: ds 1 ; loaded with 0x7f, used to check save corruption
|
|||||||
; b160
|
; b160
|
||||||
|
|
||||||
ds $f4
|
ds $f4
|
||||||
s1_b254:: ds $c
|
sLinkBattleResults:: ds $c
|
||||||
|
|
||||||
sLinkBattleStats:: ; b260
|
sLinkBattleStats:: ; b260
|
||||||
sLinkBattleWins:: ds 2
|
sLinkBattleWins:: ds 2
|
||||||
sLinkBattleLosses:: ds 2 ; b262
|
sLinkBattleLosses:: ds 2 ; b262
|
||||||
sLinkBattleDraws:: ds 2 ; b264
|
sLinkBattleDraws:: ds 2 ; b264
|
||||||
s1_b266::
|
link_battle_record: MACRO
|
||||||
ds 17
|
\1Name:: ds NAME_LENGTH +- 1
|
||||||
s1_b277::
|
\1ID:: ds 2
|
||||||
ds 73
|
\1Wins:: ds 2
|
||||||
|
\1Losses:: ds 2
|
||||||
|
\1Draws:: ds 2
|
||||||
|
endm
|
||||||
|
sLinkBattleRecord::
|
||||||
|
sLinkBattleRecord1:: link_battle_record sLinkBattleRecord1
|
||||||
|
sLinkBattleRecord2:: link_battle_record sLinkBattleRecord2
|
||||||
|
sLinkBattleRecord3:: link_battle_record sLinkBattleRecord3
|
||||||
|
sLinkBattleRecord4:: link_battle_record sLinkBattleRecord4
|
||||||
|
sLinkBattleRecord5:: link_battle_record sLinkBattleRecord5
|
||||||
sLinkBattleStatsEnd::
|
sLinkBattleStatsEnd::
|
||||||
|
|
||||||
sHallOfFame:: ; b2c0
|
sHallOfFame:: ; b2c0
|
||||||
|
4
wram.asm
4
wram.asm
@ -2173,8 +2173,8 @@ wd271:: ds 5
|
|||||||
|
|
||||||
|
|
||||||
; SECTION "Enemy Party", WRAMX, BANK [1]
|
; SECTION "Enemy Party", WRAMX, BANK [1]
|
||||||
OTPlayerName:: ds NAME_LENGTH
|
OTPlayerName:: ds NAME_LENGTH ; d26b
|
||||||
OTPlayerID:: ds 2
|
OTPlayerID:: ds 2 ; d276
|
||||||
ds 8
|
ds 8
|
||||||
OTPartyCount:: ds 1 ; d280
|
OTPartyCount:: ds 1 ; d280
|
||||||
OTPartySpecies:: ds PARTY_LENGTH ; d281
|
OTPartySpecies:: ds PARTY_LENGTH ; d281
|
||||||
|
Loading…
Reference in New Issue
Block a user