2018-06-24 07:09:41 -07:00
|
|
|
CheckBattleScene:
|
2017-12-16 16:00:50 -08:00
|
|
|
; Return carry if battle scene is turned off.
|
|
|
|
|
2018-01-04 11:53:50 -08:00
|
|
|
ld a, BANK(wLinkMode)
|
2017-12-16 16:00:50 -08:00
|
|
|
ld hl, wLinkMode
|
|
|
|
call GetFarWRAMByte
|
|
|
|
cp LINK_MOBILE
|
|
|
|
jr z, .mobile
|
|
|
|
|
2018-01-23 14:39:09 -08:00
|
|
|
ld a, [wOptions]
|
2017-12-16 16:00:50 -08:00
|
|
|
bit BATTLE_SCENE, a
|
|
|
|
jr nz, .off
|
|
|
|
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.mobile
|
|
|
|
ld a, [wcd2f]
|
|
|
|
and a
|
|
|
|
jr nz, .from_wram
|
|
|
|
|
2020-06-13 15:48:26 -07:00
|
|
|
ld a, BANK(s4_a60c) ; MBC30 bank used by JP Crystal; inaccessible by MBC3
|
2020-06-17 14:03:38 -07:00
|
|
|
call OpenSRAM
|
2020-06-13 15:48:26 -07:00
|
|
|
ld a, [s4_a60c]
|
2017-12-16 16:00:50 -08:00
|
|
|
ld c, a
|
|
|
|
call CloseSRAM
|
|
|
|
|
|
|
|
ld a, c
|
|
|
|
bit 0, c
|
|
|
|
jr z, .off
|
|
|
|
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.from_wram
|
2018-01-04 11:53:50 -08:00
|
|
|
ld a, BANK(w5_dc00)
|
2017-12-16 16:00:50 -08:00
|
|
|
ld hl, w5_dc00
|
|
|
|
call GetFarWRAMByte
|
|
|
|
bit 0, a
|
|
|
|
jr z, .off
|
|
|
|
|
|
|
|
and a
|
|
|
|
ret
|
|
|
|
|
|
|
|
.off
|
|
|
|
scf
|
|
|
|
ret
|