diff options
author | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-16 19:00:50 -0500 |
---|---|---|
committer | Remy Oukaour <remy.oukaour@gmail.com> | 2017-12-16 19:00:50 -0500 |
commit | 25a3960646548c40af70f9f59bed544f4ce8d472 (patch) | |
tree | 8b0bade10dbb09b2d4221a00f9bbbae7ed78dd7c /engine/check_battle_scene.asm | |
parent | 05d49f7d752b03cbccb2fdcca2781a8a5de85425 (diff) |
Move some more main.asm routines into individual files
Diffstat (limited to 'engine/check_battle_scene.asm')
-rw-r--r-- | engine/check_battle_scene.asm | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/engine/check_battle_scene.asm b/engine/check_battle_scene.asm new file mode 100644 index 000000000..b63f00907 --- /dev/null +++ b/engine/check_battle_scene.asm @@ -0,0 +1,47 @@ +CheckBattleScene: ; 4ea44 +; Return carry if battle scene is turned off. + + ld a, 0 + ld hl, wLinkMode + call GetFarWRAMByte + cp LINK_MOBILE + jr z, .mobile + + ld a, [Options] + bit BATTLE_SCENE, a + jr nz, .off + + and a + ret + +.mobile + ld a, [wcd2f] + and a + jr nz, .from_wram + + ld a, $4 + call GetSRAMBank + ld a, [$a60c] + ld c, a + call CloseSRAM + + ld a, c + bit 0, c + jr z, .off + + and a + ret + +.from_wram + ld a, $5 + ld hl, w5_dc00 + call GetFarWRAMByte + bit 0, a + jr z, .off + + and a + ret + +.off + scf + ret |