diff options
Diffstat (limited to 'engine/battle/core.asm')
-rw-r--r-- | engine/battle/core.asm | 548 |
1 files changed, 224 insertions, 324 deletions
diff --git a/engine/battle/core.asm b/engine/battle/core.asm index d9bcdddb..45dfdc6f 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -67,6 +67,9 @@ SlidePlayerAndEnemySilhouettesOnScreen: ldh [rBGP], a ldh [rOBP0], a ldh [rOBP1], a + call UpdateGBCPal_BGP + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 .slideSilhouettesLoop ; slide silhouettes of the player's pic and the enemy's pic onto the screen ld h, b ld l, $40 @@ -156,10 +159,16 @@ StartBattle: call DelayFrames call SaveScreenTilesToBuffer1 .checkAnyPartyAlive + ld a, [wBattleType] + cp BATTLE_TYPE_RUN + jp z, .specialBattle + cp BATTLE_TYPE_PIKACHU + jp z, .specialBattle call AnyPartyAlive ld a, d and a jp z, HandlePlayerBlackOut ; jump if no mon is alive +.specialBattle call LoadScreenTilesFromBuffer1 ld a, [wBattleType] and a ; is it a normal battle? @@ -893,6 +902,11 @@ ReplaceFaintedEnemyMon: ld hl, wEnemyHPBarColor ld e, $30 call GetBattleHealthBarColor + ldpal a, SHADE_BLACK, SHADE_DARK, SHADE_LIGHT, SHADE_WHITE + ldh [rOBP0], a + ldh [rOBP1], a + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 callfar DrawEnemyPokeballs ld a, [wLinkState] cp LINK_STATE_BATTLING @@ -958,9 +972,7 @@ TrainerDefeatedText: PlayBattleVictoryMusic: push af - ld a, SFX_STOP_ALL_MUSIC - ld [wNewSoundID], a - call PlaySoundWaitForCurrent + call StopAllMusic ld c, BANK(Music_DefeatedTrainer) pop af call PlayMusic @@ -1014,6 +1026,7 @@ RemoveFaintedPlayerMon: ld a, $ff ld [wLowHealthAlarm], a ;disable low health alarm call WaitForSoundToFinish + xor a .skipWaitForSound ; a is 0, so this zeroes the enemy's accumulated damage. ld hl, wEnemyBideAccumulatedDamage @@ -1038,10 +1051,36 @@ RemoveFaintedPlayerMon: and a ; was this called by HandleEnemyMonFainted? ret z ; if so, return + ld a, [wPlayerMonNumber] + ld [wWhichPokemon], a + callfar IsThisPartymonStarterPikachu_Party + jr nc, .notPlayerPikachu + ld e, $3 + callfar PlayPikachuSoundClip + jr .printText +.notPlayerPikachu ld a, [wBattleMonSpecies] call PlayCry +.printText ld hl, PlayerMonFaintedText - jp PrintText + call PrintText + ld a, [wPlayerMonNumber] + ld [wWhichPokemon], a + ld a, [wBattleMonLevel] + ld b, a + ld a, [wEnemyMonLevel] + sub b ; enemylevel - playerlevel + ; are we stronger than the opposing pokemon? + jr c, .regularFaint ; if so, deduct happiness regularly + + cp 30 ; is the enemy 30 levels greater than us? + jr nc, .carelessTrainer ; if so, punish the player for being careless, as they shouldn't be fighting a very high leveled trainer with such a level difference +.regularFaint + callabd_ModifyPikachuHappiness PIKAHAPPY_FAINTED + ret +.carelessTrainer + callabd_ModifyPikachuHappiness PIKAHAPPY_CARELESSTRAINER + ret PlayerMonFaintedText: text_far _PlayerMonFaintedText @@ -1098,7 +1137,7 @@ ChooseNextMon: ld a, [wLinkState] cp LINK_STATE_BATTLING jr nz, .notLinkBattle - inc a ; 1 + ld a, 1 ld [wActionResultOrTookBattleTurn], a call LinkBattleExchangeData .notLinkBattle @@ -1498,6 +1537,8 @@ TryRunningFromBattle: ld a, [wBattleType] cp BATTLE_TYPE_SAFARI jp z, .canEscape ; jump if it's a safari battle + cp BATTLE_TYPE_RUN + jp z, .canEscape ; hurry, get away? ld a, [wLinkState] cp LINK_STATE_BATTLING jp z, .canEscape @@ -1753,19 +1794,46 @@ SendOutMon: call RunPaletteCommand ld hl, wEnemyBattleStatus1 res USING_TRAPPING_MOVE, [hl] + callfar IsThisPartymonStarterPikachu + jr c, .starterPikachu ld a, $1 ldh [hWhoseTurn], a ld a, POOF_ANIM call PlayMoveAnimation hlcoord 4, 11 predef AnimateSendingOutMon + jr .playRegularCry +.starterPikachu + xor a + ldh [hWhoseTurn], a + ld a, $1 + ldh [hAutoBGTransferEnabled], a + callfar StarterPikachuBattleEntranceAnimation + callfar IsPlayerPikachuAsleepInParty + ld e, $24 + jr c, .asm_3cd81 + ld e, $a +.asm_3cd81 + callfar PlayPikachuSoundClip + jr .done +.playRegularCry ld a, [wcf91] call PlayCry +.done call PrintEmptyString jp SaveScreenTilesToBuffer1 ; show 2 stages of the player mon getting smaller before disappearing AnimateRetreatingPlayerMon: + ld a, [wWhichPokemon] + push af + ld a, [wPlayerMonNumber] + ld [wWhichPokemon], a + callfar IsThisPartymonStarterPikachu + pop bc + ld a, b + ld [wWhichPokemon], a + jr c, .starterPikachu hlcoord 1, 5 lb bc, 7, 7 call ClearScreenArea @@ -1789,10 +1857,17 @@ AnimateRetreatingPlayerMon: call .clearScreenArea ld a, $4c ldcoord_a 5, 11 + jr .clearScreenArea +.starterPikachu + xor a + ldh [hWhoseTurn], a + callfar AnimationSlideMonOff + ret .clearScreenArea hlcoord 1, 5 lb bc, 7, 7 - jp ClearScreenArea + call ClearScreenArea + ret ; reads player's current mon's HP into wBattleMonHP ReadPlayerMonCurHPAndStatus: @@ -2013,40 +2088,52 @@ DisplayBattleMenu:: .menuselected ld [wTextBoxID], a call DisplayTextBoxID - ; handle menu input if it's not the old man tutorial + ; handle menu input if it's not the old man tutorial or prof. oak pikachu battle ld a, [wBattleType] - dec a - jp nz, .handleBattleMenuInput -; the following happens for the old man tutorial + cp BATTLE_TYPE_OLD_MAN + jr z, .doSimulatedMenuInput + cp BATTLE_TYPE_PIKACHU + jr z, .doSimulatedMenuInput + jp .handleBattleMenuInput +; the following happens for the old man tutorial and prof. oak pikachu battle +.doSimulatedMenuInput ; Temporarily save the player name in wLinkEnemyTrainerName. ; Since wLinkEnemyTrainerName == wGrassRate, this affects wild encounters. ; The wGrassRate byte and following wGrassMons buffer are supposed ; to get overwritten when entering a map with wild Pokémon, ; but an oversight prevents this in Cinnabar and Route 21, ; so the infamous MissingNo. glitch can show up. + ; However, this has been fixed in Yellow. ld hl, wPlayerName ld de, wLinkEnemyTrainerName ld bc, NAME_LENGTH call CopyData ld hl, .oldManName + ld a, [wBattleType] + dec a + jr z, .useOldManName + ld hl, .profOakName +.useOldManName ld de, wPlayerName ld bc, NAME_LENGTH call CopyData ; the following simulates the keystrokes by drawing menus on screen hlcoord 9, 14 ld [hl], "▶" - ld c, 80 + ld c, 20 call DelayFrames ld [hl], " " hlcoord 9, 16 ld [hl], "▶" - ld c, 50 + ld c, 20 call DelayFrames ld [hl], "▷" ld a, $2 ; select the "ITEM" menu jp .upperLeftMenuItemWasNotSelected .oldManName db "OLD MAN@" +.profOakName + db "PROF.OAK@" .handleBattleMenuInput ld a, [wBattleAndStartSavedMenuItem] ld [wCurrentMenuItem], a @@ -2129,6 +2216,9 @@ DisplayBattleMenu:: .AButtonPressed call PlaceUnfilledArrowMenuCursor ld a, [wBattleType] + cp BATTLE_TYPE_RUN + jr z, .handleUnusedBattle + ld a, [wBattleType] cp BATTLE_TYPE_SAFARI ld a, [wCurrentMenuItem] ld [wBattleAndStartSavedMenuItem], a @@ -2160,7 +2250,18 @@ DisplayBattleMenu:: .throwSafariBallWasSelected ld a, SAFARI_BALL ld [wcf91], a - jr UseBagItem + jp UseBagItem +.handleUnusedBattle + ld a, [wCurrentMenuItem] + cp $3 + jp z, BattleMenu_RunWasSelected + ld hl, .RunAwayText + call PrintText + jp DisplayBattleMenu + +.RunAwayText + text_far _RunAwayText + text_end .upperLeftMenuItemWasNotSelected ; a menu item other than the upper left item was selected cp $2 @@ -2197,18 +2298,22 @@ BagWasSelected: call DrawHUDsAndHPBars .next ld a, [wBattleType] - dec a ; is it the old man tutorial? - jr nz, DisplayPlayerBag ; no, it is a normal battle - ld hl, OldManItemList + cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial? + jr z, .simulatedInputBattle + cp BATTLE_TYPE_PIKACHU ; is it the prof oak battle with pikachu? + jr z, .simulatedInputBattle + jr DisplayPlayerBag +.simulatedInputBattle + ld hl, SimulatedInputBattleItemList ld a, l ld [wListPointer], a ld a, h ld [wListPointer + 1], a jr DisplayBagMenu -OldManItemList: +SimulatedInputBattleItemList: db 1 ; # items - db POKE_BALL, 50 + db POKE_BALL, 1 db -1 ; end DisplayPlayerBag: @@ -2368,6 +2473,8 @@ PartyMenuOrRockOrRun: predef StatusScreen predef StatusScreen2 ; now we need to reload the enemy mon pic + ld a, 1 + ldh [hWhoseTurn], a ld a, [wEnemyBattleStatus2] bit HAS_SUBSTITUTE_UP, a ; does the enemy mon have a substitute? ld hl, AnimationSubstitute @@ -2487,8 +2594,7 @@ MoveSelectionMenu: ld hl, wBattleMonMoves call .loadmoves hlcoord 4, 12 - ld b, 4 - ld c, 14 + lb bc, 4, 14 di ; out of pure coincidence, it is possible for vblank to occur between the di and ei ; so it is necessary to put the di ei block to not cause tearing call TextBoxBorder @@ -2506,8 +2612,7 @@ MoveSelectionMenu: ld hl, wEnemyMonMoves call .loadmoves hlcoord 0, 7 - ld b, 4 - ld c, 14 + lb bc, 4, 14 call TextBoxBorder hlcoord 2, 8 call .writemoves @@ -2521,8 +2626,7 @@ MoveSelectionMenu: call AddNTimes call .loadmoves hlcoord 4, 7 - ld b, 4 - ld c, 14 + lb bc, 4, 14 call TextBoxBorder hlcoord 6, 8 call .writemoves @@ -2536,8 +2640,6 @@ MoveSelectionMenu: ld a, [wMoveMenuType] cp $1 jr z, .selectedmoveknown - ld a, $1 - jr nc, .selectedmoveknown ld a, [wPlayerMoveListIndex] inc a .selectedmoveknown @@ -2609,6 +2711,14 @@ SelectMenuItem: jp nz, SelectMenuItem_CursorDown bit BIT_SELECT, a jp nz, SwapMovesInMenu +IF DEF(_DEBUG) + bit BIT_START, a + jp nz, Func_3d4f5 + bit BIT_D_RIGHT, a + jp nz, Func_3d529 + bit BIT_D_LEFT, a + jp nz, Func_3d523 +ENDC bit BIT_B_BUTTON, a push af xor a @@ -2703,6 +2813,55 @@ SelectMenuItem_CursorDown: ld [wCurrentMenuItem], a jp SelectMenuItem +Func_3d4f5: + bit 3, a + ld a, $0 + jr nz, .asm_3d4fd + ld a, $1 +.asm_3d4fd + ldh [hWhoseTurn], a + call LoadScreenTilesFromBuffer1 + call Func_3d536 + ld a, [wTestBattlePlayerSelectedMove] + and a + jp z, MoveSelectionMenu + ld [wAnimationID], a + xor a + ld [wAnimationType], a + predef MoveAnimation + callfar Func_78e98 + jp MoveSelectionMenu + +Func_3d523: + ld a, [wTestBattlePlayerSelectedMove] + dec a + jr asm_3d52d +Func_3d529: + ld a, [wTestBattlePlayerSelectedMove] + inc a +asm_3d52d: + ld [wTestBattlePlayerSelectedMove], a + call Func_3d536 + jp MoveSelectionMenu + +Func_3d536: + hlcoord 10, 16 + lb bc, 2, 10 + call ClearScreenArea + hlcoord 10, 17 + ld de, wTestBattlePlayerSelectedMove + lb bc, LEADING_ZEROES | 1, 3 + call PrintNumber + ld a, [wTestBattlePlayerSelectedMove] + and a + ret z + cp STRUGGLE + ret nc + ld [wd11e], a + call GetMoveName + hlcoord 13, 17 + jp PlaceString + AnyMoveToSelect: ; return z and Struggle as the selected move if all moves have 0 PP and/or are disabled ld a, STRUGGLE @@ -2736,7 +2895,10 @@ AnyMoveToSelect: or c jr .handleDisabledMovePPLoop .allMovesChecked - and a ; any PP left? +; bugfix: only check PP value and not PP up bits +; in case all other moves have no PP left and a move has a PP up used on it +; and a non-PP up move is disabled + and $3f ; any PP left? ret nz ; return if a move has PP left .noMovesLeft ld hl, NoMovesLeftText @@ -2751,6 +2913,14 @@ NoMovesLeftText: text_end SwapMovesInMenu: +IF DEF(_DEBUG) + ld a, [wFlags_D733] + bit BIT_TEST_BATTLE, a + jp nz, Func_3d4f5 +ENDC + ld a, [wPlayerBattleStatus3] + bit TRANSFORMED, a + jp nz, MoveSelectionMenu ld a, [wMenuItemToSwap] and a jr z, .noMenuItemSelected @@ -2830,8 +3000,7 @@ PrintMenuItem: xor a ldh [hAutoBGTransferEnabled], a hlcoord 0, 8 - ld b, 3 - ld c, 9 + lb bc, 3, 9 call TextBoxBorder ld a, [wPlayerDisabledMove] and a @@ -2898,7 +3067,7 @@ PrintMenuItem: jp Delay3 DisabledText: - db "disabled!@" + db "Disabled!@" TypeText: db "TYPE@" @@ -4991,7 +5160,7 @@ AttackSubstitute: ldh a, [hWhoseTurn] xor $01 ldh [hWhoseTurn], a - callfar HideSubstituteShowMonAnim ; animate the substitute breaking + callfar Func_79929 ; animate the substitute breaking ; flip the turn back to the way it was ldh a, [hWhoseTurn] xor $01 @@ -5322,6 +5491,17 @@ AIGetTypeEffectiveness: inc hl jr .loop .done + ; 40% chance for Lorelei's Dewgong to ignore type effectiveness? + ld a, [wTrainerClass] + cp LORELEI + jr nz, .ok + ld a, [wEnemyMonSpecies] + cp DEWGONG + jr nz, .ok + call BattleRandom + cp $66 ; 40 percent + ret c +.ok ld a, [hl] ld [wTypeEffectiveness], a ; store damage multiplier ret @@ -6302,10 +6482,13 @@ SwapPlayerAndEnemyLevels: ; (for use when scrolling the player sprite and enemy's silhouettes on screen) LoadPlayerBackPic: ld a, [wBattleType] - dec a ; is it the old man tutorial? - ld de, RedPicBack - jr nz, .next ld de, OldManPicBack + cp BATTLE_TYPE_OLD_MAN ; is it the old man tutorial? + jr z, .next + ld de, ProfOakPicBack + cp BATTLE_TYPE_PIKACHU ; is it the pikachu battle at the beginning of the game? + jr z, .next + ld de, RedPicBack .next ld a, BANK(RedPicBack) call UncompressSpriteFromDE @@ -6330,6 +6513,8 @@ LoadPlayerBackPic: ld [hli], a ; OAM tile number inc a ; increment tile number ldh [hOAMTile], a + ld a, $2 + ld [hl], a inc hl dec c jr nz, .innerLoop @@ -6343,18 +6528,15 @@ LoadPlayerBackPic: jr nz, .loop ld de, vBackPic call InterlaceMergeSpriteBuffers - ld a, $a - ld [MBC1SRamEnable], a - xor a - ld [MBC1SRamBank], a + ld a, $0 + call SwitchSRAMBankAndLatchClockData ld hl, vSprites ld de, sSpriteBuffer1 ldh a, [hLoadedROMBank] ld b, a ld c, 7 * 7 call CopyVideoData - xor a - ld [MBC1SRamEnable], a + call PrepareRTCDataAndDisableSRAM ld a, $31 ldh [hStartTileID], a hlcoord 1, 5 @@ -6726,288 +6908,6 @@ HandleExplodingAnimation: PlayMoveAnimation: ld [wAnimationID], a call Delay3 - predef_jump MoveAnimation - -InitBattle:: - ld a, [wCurOpponent] - and a - jr z, DetermineWildOpponent - -InitOpponent: - ld a, [wCurOpponent] - ld [wcf91], a - ld [wEnemyMonSpecies2], a - jr InitBattleCommon - -DetermineWildOpponent: - ld a, [wd732] - bit 1, a - jr z, .asm_3ef2f - ldh a, [hJoyHeld] - bit 1, a ; B button pressed? - ret nz -.asm_3ef2f - ld a, [wNumberOfNoRandomBattleStepsLeft] - and a - ret nz - callfar TryDoWildEncounter - ret nz -InitBattleCommon: - ld a, [wMapPalOffset] - push af - ld hl, wLetterPrintingDelayFlags - ld a, [hl] - push af - res 1, [hl] - callfar InitBattleVariables - ld a, [wEnemyMonSpecies2] - sub OPP_ID_OFFSET - jp c, InitWildBattle - ld [wTrainerClass], a - call GetTrainerInformation - callfar ReadTrainer - call DoBattleTransitionAndInitBattleVariables - call _LoadTrainerPic - xor a - ld [wEnemyMonSpecies2], a - ldh [hStartTileID], a - dec a - ld [wAICount], a - hlcoord 12, 0 - predef CopyUncompressedPicToTilemap - ld a, $ff - ld [wEnemyMonPartyPos], a - ld a, $2 - ld [wIsInBattle], a - jp _InitBattleCommon - -InitWildBattle: - ld a, $1 - ld [wIsInBattle], a - call LoadEnemyMonData - call DoBattleTransitionAndInitBattleVariables - ld a, [wCurOpponent] - cp RESTLESS_SOUL - jr z, .isGhost - call IsGhostBattle - jr nz, .isNoGhost -.isGhost - ld hl, wMonHSpriteDim - ld a, $66 - ld [hli], a ; write sprite dimensions - ld bc, GhostPic - ld a, c - ld [hli], a ; write front sprite pointer - ld [hl], b - ld hl, wEnemyMonNick ; set name to "GHOST" - ld a, "G" - ld [hli], a - ld a, "H" - ld [hli], a - ld a, "O" - ld [hli], a - ld a, "S" - ld [hli], a - ld a, "T" - ld [hli], a - ld [hl], "@" - ld a, [wcf91] - push af - ld a, MON_GHOST - ld [wcf91], a - ld de, vFrontPic - call LoadMonFrontSprite ; load ghost sprite - pop af - ld [wcf91], a - jr .spriteLoaded -.isNoGhost - ld de, vFrontPic - call LoadMonFrontSprite ; load mon sprite -.spriteLoaded - xor a - ld [wTrainerClass], a - ldh [hStartTileID], a - hlcoord 12, 0 - predef CopyUncompressedPicToTilemap - -; common code that executes after init battle code specific to trainer or wild battles -_InitBattleCommon: - ld b, SET_PAL_BATTLE_BLACK - call RunPaletteCommand - call SlidePlayerAndEnemySilhouettesOnScreen - xor a - ldh [hAutoBGTransferEnabled], a - ld hl, .emptyString - call PrintText - call SaveScreenTilesToBuffer1 - call ClearScreen - ld a, $98 - ldh [hAutoBGTransferDest + 1], a - ld a, $1 - ldh [hAutoBGTransferEnabled], a - call Delay3 - ld a, $9c - ldh [hAutoBGTransferDest + 1], a - call LoadScreenTilesFromBuffer1 - hlcoord 9, 7 - lb bc, 5, 10 - call ClearScreenArea - hlcoord 1, 0 - lb bc, 4, 10 - call ClearScreenArea - call ClearSprites - ld a, [wIsInBattle] - dec a ; is it a wild battle? - call z, DrawEnemyHUDAndHPBar ; draw enemy HUD and HP bar if it's a wild battle - call StartBattle - callfar EndOfBattle - pop af - ld [wLetterPrintingDelayFlags], a - pop af - ld [wMapPalOffset], a - ld a, [wSavedTileAnimations] - ldh [hTileAnimations], a - scf - ret -.emptyString - db "@" - -_LoadTrainerPic: -; wd033-wd034 contain pointer to pic - ld a, [wTrainerPicPointer] - ld e, a - ld a, [wTrainerPicPointer + 1] - ld d, a ; de contains pointer to trainer pic - ld a, [wLinkState] - and a - ld a, BANK(TrainerPics) ; this is where all the trainer pics are (not counting Red's) - jr z, .loadSprite - ld a, BANK(RedPicFront) -.loadSprite - call UncompressSpriteFromDE - ld de, vFrontPic - ld a, $77 - ld c, a - jp LoadUncompressedSpriteData - -; unreferenced -ResetCryModifiers: - xor a - ld [wFrequencyModifier], a - ld [wTempoModifier], a - jp PlaySound - -; animates the mon "growing" out of the pokeball -AnimateSendingOutMon: - ld a, [wPredefRegisters] - ld h, a - ld a, [wPredefRegisters + 1] - ld l, a - ldh a, [hStartTileID] - ldh [hBaseTileID], a - ld b, $4c - ld a, [wIsInBattle] - and a - jr z, .notInBattle - add b - ld [hl], a - call Delay3 - ld bc, -(SCREEN_WIDTH * 2 + 1) - add hl, bc - ld a, 1 - ld [wDownscaledMonSize], a - lb bc, 3, 3 - predef CopyDownscaledMonTiles - ld c, 4 - call DelayFrames - ld bc, -(SCREEN_WIDTH * 2 + 1) - add hl, bc - xor a - ld [wDownscaledMonSize], a - lb bc, 5, 5 - predef CopyDownscaledMonTiles - ld c, 5 - call DelayFrames - ld bc, -(SCREEN_WIDTH * 2 + 1) - jr .next -.notInBattle - ld bc, -(SCREEN_WIDTH * 6 + 3) -.next - add hl, bc - ldh a, [hBaseTileID] - add $31 - jr CopyUncompressedPicToHL - -CopyUncompressedPicToTilemap: - ld a, [wPredefRegisters] - ld h, a - ld a, [wPredefRegisters + 1] - ld l, a - ldh a, [hStartTileID] -CopyUncompressedPicToHL:: - lb bc, 7, 7 - ld de, SCREEN_WIDTH - push af - ld a, [wSpriteFlipped] - and a - jr nz, .flipped - pop af -.loop - push bc - push hl -.innerLoop - ld [hl], a - add hl, de - inc a - dec c - jr nz, .innerLoop - pop hl - inc hl - pop bc - dec b - jr nz, .loop - ret - -.flipped - push bc - ld b, 0 - dec c - add hl, bc - pop bc - pop af -.flippedLoop - push bc - push hl -.flippedInnerLoop - ld [hl], a - add hl, de - inc a - dec c - jr nz, .flippedInnerLoop - pop hl - dec hl - pop bc - dec b - jr nz, .flippedLoop + predef MoveAnimation + callfar Func_78e98 ret - -LoadMonBackPic: -; Assumes the monster's attributes have -; been loaded with GetMonHeader. - ld a, [wBattleMonSpecies2] - ld [wcf91], a - hlcoord 1, 5 - ld b, 7 - ld c, 8 - call ClearScreenArea - ld hl, wMonHBackSprite - wMonHeader - call UncompressMonSprite - predef ScaleSpriteByTwo - ld de, vBackPic - call InterlaceMergeSpriteBuffers ; combine the two buffers to a single 2bpp sprite - ld hl, vSprites - ld de, vBackPic - ld c, (2*SPRITEBUFFERSIZE)/16 ; count of 16-byte chunks to be copied - ldh a, [hLoadedROMBank] - ld b, a - jp CopyVideoData |