Skip to content

Commit

Permalink
Fix two battle bugs and add extended OAM support
Browse files Browse the repository at this point in the history
  • Loading branch information
ISSOtm committed Nov 1, 2017
1 parent 471ef91 commit c5bd1ae
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions battle/battle_engine.asm
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ StartBattle::
ld a, [wBattlePreservedNPCs]
ld b, a
ld hl, wVirtualOAM + 4 * 4 ; Skip 4 sprites (the player's)
ld hl, wVirtualOAM + 8 * OAM_SPRITE_SIZE ; Skip 8 sprites (the overlays and the player's)
ld c, 8
.clearUnwantedNPCs
rrc b
Expand All @@ -210,19 +210,21 @@ StartBattle::
jr nz, .clearUnwantedNPCs
inc a
ld [wTransferSprites], a
ldh a, [hOAMMode]
and a
call nz, ExtendOAM
ld a, [wBattleTransitionID]
IF !DEF(GlitchMaps)
cp MAX_BATT_TRANS
jp nc, .invalidBattleTransition
ENDC
ld hl, BattleTransitions
add a, a
add a, l
add a, LOW(BattleTransitions)
ld l, a
jr nc, .noCarry4
inc h
.noCarry4
adc HIGH(BattleTransitions)
sub l
ld h, a
ld a, [hli]
ld h, [hl]
ld l, a
Expand Down

0 comments on commit c5bd1ae

Please sign in to comment.