mirror of
https://gitlab.com/xCrystal/pokecrystal-board.git
synced 2024-11-16 11:27:33 -08:00
Use hSerialConnectionStatus constants elsewhere
This commit is contained in:
parent
0c6338836d
commit
b199f6cfbf
@ -27,7 +27,7 @@ DoBattle: ; 3c000
|
|||||||
jr z, .not_linked
|
jr z, .not_linked
|
||||||
|
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $2
|
cp USING_INTERNAL_CLOCK
|
||||||
jr z, .player_2
|
jr z, .player_2
|
||||||
|
|
||||||
.not_linked
|
.not_linked
|
||||||
@ -98,7 +98,7 @@ DoBattle: ; 3c000
|
|||||||
and a
|
and a
|
||||||
jr z, .not_linked_2
|
jr z, .not_linked_2
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $2
|
cp USING_INTERNAL_CLOCK
|
||||||
jr nz, .not_linked_2
|
jr nz, .not_linked_2
|
||||||
xor a
|
xor a
|
||||||
ld [wEnemySwitchMonIndex], a
|
ld [wEnemySwitchMonIndex], a
|
||||||
@ -252,7 +252,7 @@ Stubbed_Function3c1bf:
|
|||||||
|
|
||||||
HandleBetweenTurnEffects: ; 3c1d6
|
HandleBetweenTurnEffects: ; 3c1d6
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .CheckEnemyFirst
|
jr z, .CheckEnemyFirst
|
||||||
call CheckFaint_PlayerThenEnemy
|
call CheckFaint_PlayerThenEnemy
|
||||||
ret c
|
ret c
|
||||||
@ -351,7 +351,7 @@ CheckFaint_EnemyThenPlayer: ; 3c25c
|
|||||||
|
|
||||||
HandleBerserkGene: ; 3c27c
|
HandleBerserkGene: ; 3c27c
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .reverse
|
jr z, .reverse
|
||||||
|
|
||||||
call .player
|
call .player
|
||||||
@ -459,7 +459,7 @@ DetermineMoveOrder: ; 3c314
|
|||||||
cp $2
|
cp $2
|
||||||
jr nz, .switch
|
jr nz, .switch
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $2
|
cp USING_INTERNAL_CLOCK
|
||||||
jr z, .player_2
|
jr z, .player_2
|
||||||
|
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
@ -516,7 +516,7 @@ DetermineMoveOrder: ; 3c314
|
|||||||
|
|
||||||
.both_have_quick_claw
|
.both_have_quick_claw
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $2
|
cp USING_INTERNAL_CLOCK
|
||||||
jr z, .player_2b
|
jr z, .player_2b
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
cp c
|
cp c
|
||||||
@ -546,7 +546,7 @@ DetermineMoveOrder: ; 3c314
|
|||||||
|
|
||||||
.speed_tie
|
.speed_tie
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $2
|
cp USING_INTERNAL_CLOCK
|
||||||
jr z, .player_2c
|
jr z, .player_2c
|
||||||
call BattleRandom
|
call BattleRandom
|
||||||
cp 1 + (50 percent)
|
cp 1 + (50 percent)
|
||||||
@ -710,7 +710,7 @@ ParsePlayerAction: ; 3c434
|
|||||||
|
|
||||||
HandleEncore: ; 3c4df
|
HandleEncore: ; 3c4df
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player_1
|
jr z, .player_1
|
||||||
call .do_player
|
call .do_player
|
||||||
jr .do_enemy
|
jr .do_enemy
|
||||||
@ -1162,7 +1162,7 @@ ResidualDamage: ; 3c716
|
|||||||
|
|
||||||
HandlePerishSong: ; 3c801
|
HandlePerishSong: ; 3c801
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .EnemyFirst
|
jr z, .EnemyFirst
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call .do_it
|
call .do_it
|
||||||
@ -1231,7 +1231,7 @@ HandlePerishSong: ; 3c801
|
|||||||
|
|
||||||
HandleWrap: ; 3c874
|
HandleWrap: ; 3c874
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .EnemyFirst
|
jr z, .EnemyFirst
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call .do_it
|
call .do_it
|
||||||
@ -1303,7 +1303,7 @@ SwitchTurnCore: ; 3c8e4
|
|||||||
|
|
||||||
HandleLeftovers: ; 3c8eb
|
HandleLeftovers: ; 3c8eb
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .DoEnemyFirst
|
jr z, .DoEnemyFirst
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call .do_it
|
call .do_it
|
||||||
@ -1353,7 +1353,7 @@ HandleLeftovers: ; 3c8eb
|
|||||||
|
|
||||||
HandleMysteryberry: ; 3c93c
|
HandleMysteryberry: ; 3c93c
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .DoEnemyFirst
|
jr z, .DoEnemyFirst
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call .do_it
|
call .do_it
|
||||||
@ -1492,7 +1492,7 @@ HandleMysteryberry: ; 3c93c
|
|||||||
|
|
||||||
HandleFutureSight: ; 3ca26
|
HandleFutureSight: ; 3ca26
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .enemy_first
|
jr z, .enemy_first
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call .do_it
|
call .do_it
|
||||||
@ -1551,7 +1551,7 @@ HandleFutureSight: ; 3ca26
|
|||||||
|
|
||||||
HanleDefrost: ; 3ca8f
|
HanleDefrost: ; 3ca8f
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .enemy_first
|
jr z, .enemy_first
|
||||||
call .do_player_turn
|
call .do_player_turn
|
||||||
jr .do_enemy_turn
|
jr .do_enemy_turn
|
||||||
@ -1611,7 +1611,7 @@ HanleDefrost: ; 3ca8f
|
|||||||
|
|
||||||
HandleSafeguard: ; 3cafb
|
HandleSafeguard: ; 3cafb
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player1
|
jr z, .player1
|
||||||
call .CheckPlayer
|
call .CheckPlayer
|
||||||
jr .CheckEnemy
|
jr .CheckEnemy
|
||||||
@ -1648,7 +1648,7 @@ HandleSafeguard: ; 3cafb
|
|||||||
|
|
||||||
HandleScreens: ; 3cb36
|
HandleScreens: ; 3cb36
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp 1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .Both
|
jr z, .Both
|
||||||
call .CheckPlayer
|
call .CheckPlayer
|
||||||
jr .CheckEnemy
|
jr .CheckEnemy
|
||||||
@ -1732,7 +1732,7 @@ HandleWeather: ; 3cb9e
|
|||||||
ret nz
|
ret nz
|
||||||
|
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp 1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .enemy_first
|
jr z, .enemy_first
|
||||||
|
|
||||||
.player_first
|
.player_first
|
||||||
@ -2116,7 +2116,7 @@ HandleEnemyMonFaint: ; 3cd55
|
|||||||
|
|
||||||
DoubleSwitch: ; 3cdca
|
DoubleSwitch: ; 3cdca
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player_1
|
jr z, .player_1
|
||||||
call ClearSprites
|
call ClearSprites
|
||||||
hlcoord 1, 0
|
hlcoord 1, 0
|
||||||
@ -4351,7 +4351,7 @@ RecallPlayerMon: ; 3dce6
|
|||||||
|
|
||||||
HandleHealingItems: ; 3dcf9
|
HandleHealingItems: ; 3dcf9
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player_1
|
jr z, .player_1
|
||||||
call SetPlayerTurn
|
call SetPlayerTurn
|
||||||
call HandleHPHealingItem
|
call HandleHPHealingItem
|
||||||
@ -4596,7 +4596,7 @@ UseConfusionHealingItem: ; 3de51
|
|||||||
HandleStatBoostingHeldItems: ; 3de97
|
HandleStatBoostingHeldItems: ; 3de97
|
||||||
; The effects handled here are not used in-game.
|
; The effects handled here are not used in-game.
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player_1
|
jr z, .player_1
|
||||||
call .DoPlayer
|
call .DoPlayer
|
||||||
jp .DoEnemy
|
jp .DoEnemy
|
||||||
@ -5375,7 +5375,7 @@ PlayerSwitch: ; 3e3ad
|
|||||||
|
|
||||||
.dont_run
|
.dont_run
|
||||||
ld a, [hSerialConnectionStatus]
|
ld a, [hSerialConnectionStatus]
|
||||||
cp $1
|
cp USING_EXTERNAL_CLOCK
|
||||||
jr z, .player_1
|
jr z, .player_1
|
||||||
call BattleMonEntrance
|
call BattleMonEntrance
|
||||||
call EnemyMonEntrance
|
call EnemyMonEntrance
|
||||||
|
@ -2143,7 +2143,7 @@ Special_EnterTimeCapsule: ; 29c7b
|
|||||||
Special_WaitForOtherPlayerToExit: ; 29c92
|
Special_WaitForOtherPlayerToExit: ; 29c92
|
||||||
ld c, 3
|
ld c, 3
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, -1
|
ld a, CONNECTION_NOT_ESTABLISHED
|
||||||
ld [hSerialConnectionStatus], a
|
ld [hSerialConnectionStatus], a
|
||||||
xor a
|
xor a
|
||||||
ld [rSB], a
|
ld [rSB], a
|
||||||
@ -2169,7 +2169,7 @@ Special_WaitForOtherPlayerToExit: ; 29c92
|
|||||||
ld [rSC], a
|
ld [rSC], a
|
||||||
ld c, 3
|
ld c, 3
|
||||||
call DelayFrames
|
call DelayFrames
|
||||||
ld a, -1
|
ld a, CONNECTION_NOT_ESTABLISHED
|
||||||
ld [hSerialConnectionStatus], a
|
ld [hSerialConnectionStatus], a
|
||||||
ld a, [rIF]
|
ld a, [rIF]
|
||||||
push af
|
push af
|
||||||
|
@ -136,7 +136,7 @@ Init:: ; 17d
|
|||||||
; BG on
|
; BG on
|
||||||
ld [rLCDC], a
|
ld [rLCDC], a
|
||||||
|
|
||||||
ld a, -1
|
ld a, CONNECTION_NOT_ESTABLISHED
|
||||||
ld [hSerialConnectionStatus], a
|
ld [hSerialConnectionStatus], a
|
||||||
|
|
||||||
farcall InitCGBPals
|
farcall InitCGBPals
|
||||||
|
@ -4052,9 +4052,9 @@ _StartMobileBattle: ; 1019ab
|
|||||||
call CopyBytes
|
call CopyBytes
|
||||||
ld a, [wcd2f]
|
ld a, [wcd2f]
|
||||||
and a
|
and a
|
||||||
ld a, 2
|
ld a, USING_INTERNAL_CLOCK
|
||||||
jr z, .got_link_player_number
|
jr z, .got_link_player_number
|
||||||
ld a, 1
|
ld a, USING_EXTERNAL_CLOCK
|
||||||
.got_link_player_number
|
.got_link_player_number
|
||||||
ld [hSerialConnectionStatus], a
|
ld [hSerialConnectionStatus], a
|
||||||
ret
|
ret
|
||||||
@ -4075,7 +4075,7 @@ StartMobileBattle: ; 101a21
|
|||||||
farcall ShowLinkBattleParticipantsAfterEnd
|
farcall ShowLinkBattleParticipantsAfterEnd
|
||||||
xor a
|
xor a
|
||||||
ld [wDisableTextAcceleration], a
|
ld [wDisableTextAcceleration], a
|
||||||
ld a, $ff
|
ld a, CONNECTION_NOT_ESTABLISHED
|
||||||
ld [hSerialConnectionStatus], a
|
ld [hSerialConnectionStatus], a
|
||||||
pop af
|
pop af
|
||||||
ld [Options], a
|
ld [Options], a
|
||||||
|
Loading…
Reference in New Issue
Block a user