diff options
Diffstat (limited to 'engine')
26 files changed, 82 insertions, 71 deletions
diff --git a/engine/battle/animations.asm b/engine/battle/animations.asm index 40b2047b..711ebda4 100644 --- a/engine/battle/animations.asm +++ b/engine/battle/animations.asm @@ -928,7 +928,7 @@ BallMoveDistances2: DoGrowlSpecialEffects: ld hl, wShadowOAM ld de, wShadowOAMSprite04 - ld bc, $10 + ld bc, OBJ_SIZE * 4 call CopyData ; copy the musical note graphic ld a, [wSubAnimCounter] dec a @@ -1308,7 +1308,7 @@ AdjustOAMBlockXPos: ld h, d AdjustOAMBlockXPos2: - ld de, 4 + ld de, OBJ_SIZE .loop ld a, [wCoordAdjustmentAmount] ld b, a @@ -1318,7 +1318,7 @@ AdjustOAMBlockXPos2: jr c, .skipPuttingEntryOffScreen ; put off-screen if X >= 168 dec hl - ld a, 160 + ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ld [hli], a .skipPuttingEntryOffScreen ld [hl], a @@ -1332,7 +1332,7 @@ AdjustOAMBlockYPos: ld h, d AdjustOAMBlockYPos2: - ld de, 4 + ld de, OBJ_SIZE .loop ld a, [wCoordAdjustmentAmount] ld b, a @@ -1670,7 +1670,7 @@ _AnimationShootBallsUpward: dec a ld [wNumShootingBalls], a .next - ld de, 4 + ld de, OBJ_SIZE add hl, de ; next OAM entry dec b jr nz, .innerLoop @@ -1723,10 +1723,10 @@ AnimationMinimizeMon: ld hl, wTempPic push hl xor a - ld bc, 7 * 7 * $10 + ld bc, (7 * 7) tiles call FillMemory pop hl - ld de, 7 * 3 * $10 + 4 * $10 + 4 + ld de, (7 * 3 + 4) tiles + TILE_SIZE / 4 add hl, de ld de, MinimizedMonSprite ld c, MinimizedMonSpriteEnd - MinimizedMonSprite @@ -1971,7 +1971,7 @@ AnimationSubstitute: jp AnimationShowMonPic CopyMonsterSpriteData: - ld bc, 1 tiles + ld bc, TILE_SIZE ld a, BANK(MonsterSprite) jp FarCopyData2 @@ -2379,7 +2379,7 @@ FallingObjects_UpdateOAMEntry: inc a cp 112 jr c, .next - ld a, 160 ; if Y >= 112, put it off-screen + ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ; if Y >= 112, put it off-screen .next ld [hli], a ; Y ld a, [wFallingObjectMovementByte] diff --git a/engine/battle/battle_transitions.asm b/engine/battle/battle_transitions.asm index fe731c5d..3670cddc 100644 --- a/engine/battle/battle_transitions.asm +++ b/engine/battle/battle_transitions.asm @@ -14,7 +14,7 @@ BattleTransition: ldh a, [hSpriteIndex] ; enemy trainer sprite index (0 if wild battle) ld c, a ld b, 0 - ld de, $10 + ld de, SPRITESTATEDATA1_LENGTH .loop1 ld a, [hl] cp $ff @@ -35,13 +35,13 @@ BattleTransition: jr z, .skip2 ; skip clearing the block if the enemy trainer is using it push hl push bc - ld bc, $10 + ld bc, OBJ_SIZE * 4 xor a call FillMemory pop bc pop hl .skip2 - ld de, $10 + ld de, OBJ_SIZE * 4 add hl, de dec c jr nz, .loop2 diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 87abf2e8..0916176c 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -106,8 +106,8 @@ SlidePlayerAndEnemySilhouettesOnScreen: SlidePlayerHeadLeft: push bc ld hl, wShadowOAMSprite00XCoord - ld c, $15 ; number of OAM entries - ld de, $4 ; size of OAM entry + ld c, 7 * 3 ; number of OAM entries + ld de, OBJ_SIZE .loop dec [hl] ; decrement X dec [hl] ; decrement X @@ -6655,11 +6655,11 @@ LoadHudTilePatterns: .lcdEnabled ld de, BattleHudTiles1 ld hl, vChars2 tile $6d - lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / $8 + lb bc, BANK(BattleHudTiles1), (BattleHudTiles1End - BattleHudTiles1) / TILE_1BPP_SIZE call CopyVideoDataDouble ld de, BattleHudTiles2 ld hl, vChars2 tile $73 - lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / $8 + lb bc, BANK(BattleHudTiles2), (BattleHudTiles3End - BattleHudTiles2) / TILE_1BPP_SIZE jp CopyVideoDataDouble PrintEmptyString: @@ -7040,14 +7040,14 @@ LoadMonBackPic: ld b, 7 ld c, 8 call ClearScreenArea - ld hl, wMonHBackSprite - wMonHeader + 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 + ld c, (2 * SPRITEBUFFERSIZE) / TILE_SIZE ; count of 16-byte chunks to be copied ldh a, [hLoadedROMBank] ld b, a jp CopyVideoData diff --git a/engine/battle/draw_hud_pokeball_gfx.asm b/engine/battle/draw_hud_pokeball_gfx.asm index 34bff58d..983e7cdf 100644 --- a/engine/battle/draw_hud_pokeball_gfx.asm +++ b/engine/battle/draw_hud_pokeball_gfx.asm @@ -13,7 +13,7 @@ DrawEnemyPokeballs: LoadPartyPokeballGfx: ld de, PokeballTileGraphics ld hl, vSprites tile $31 - lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / $10 + lb bc, BANK(PokeballTileGraphics), (PokeballTileGraphicsEnd - PokeballTileGraphics) / TILE_SIZE jp CopyVideoData SetupOwnPartyPokeballs: diff --git a/engine/battle/effects.asm b/engine/battle/effects.asm index 413c34d9..e107853c 100644 --- a/engine/battle/effects.asm +++ b/engine/battle/effects.asm @@ -686,7 +686,7 @@ UpdateLoweredStatDone: .ApplyBadgeBoostsAndStatusPenalties ldh a, [hWhoseTurn] and a - call nz, ApplyBadgeStatBoosts ; whenever the player uses a stat-down move, badge boosts get reapplied again to every stat, + call nz, ApplyBadgeStatBoosts ; whenever the opponent uses a stat-down move, badge boosts get reapplied again to every stat, ; even to those not affected by the stat-down move (will be boosted further) ld hl, MonsStatsFellText call PrintText diff --git a/engine/events/diploma.asm b/engine/events/diploma.asm index b4ccbb07..3d181210 100644 --- a/engine/events/diploma.asm +++ b/engine/events/diploma.asm @@ -11,7 +11,7 @@ DisplayDiploma:: call DisableLCD ld hl, CircleTile ld de, vChars2 tile CIRCLE_TILE_ID - ld bc, $10 + ld bc, TILE_SIZE ld a, BANK(CircleTile) call FarCopyData2 hlcoord 0, 0 diff --git a/engine/gfx/load_pokedex_tiles.asm b/engine/gfx/load_pokedex_tiles.asm index a3f69171..b0857137 100644 --- a/engine/gfx/load_pokedex_tiles.asm +++ b/engine/gfx/load_pokedex_tiles.asm @@ -3,7 +3,7 @@ LoadPokedexTilePatterns: call LoadHpBarAndStatusTilePatterns ld de, PokedexTileGraphics ld hl, vChars2 tile $60 - lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / $10 + lb bc, BANK(PokedexTileGraphics), (PokedexTileGraphicsEnd - PokedexTileGraphics) / TILE_SIZE call CopyVideoData ld de, PokeballTileGraphics ld hl, vChars2 tile $72 diff --git a/engine/gfx/mon_icons.asm b/engine/gfx/mon_icons.asm index 49e789a5..63da2345 100644 --- a/engine/gfx/mon_icons.asm +++ b/engine/gfx/mon_icons.asm @@ -44,7 +44,7 @@ GetAnimationSpeed: push bc ld hl, wMonPartySpritesSavedOAM ld de, wShadowOAM - ld bc, $60 + ld bc, OBJ_SIZE * 4 * PARTY_LENGTH call CopyData pop bc xor a @@ -52,7 +52,7 @@ GetAnimationSpeed: .animateSprite push bc ld hl, wShadowOAMSprite00TileID - ld bc, $10 + ld bc, OBJ_SIZE * 4 ld a, [wCurrentMenuItem] call AddNTimes ld c, ICONOFFSET @@ -68,8 +68,8 @@ GetAnimationSpeed: ld c, $1 ; amount to increase the y coord by ; otherwise, load a second sprite frame .editTileIDS - ld b, $4 - ld de, $4 + ld b, 4 + ld de, OBJ_SIZE .loop ld a, [hl] add c @@ -254,7 +254,7 @@ WriteMonPartySpriteOAM: .makeCopy ld hl, wShadowOAM ld de, wMonPartySpritesSavedOAM - ld bc, $60 + ld bc, OBJ_SIZE * 4 * PARTY_LENGTH jp CopyData GetPartyMonSpriteID: diff --git a/engine/gfx/palettes.asm b/engine/gfx/palettes.asm index 0497f74a..f4ae5c39 100644 --- a/engine/gfx/palettes.asm +++ b/engine/gfx/palettes.asm @@ -611,7 +611,7 @@ CopySGBBorderTiles: ld b, 128 .tileLoop ; Copy bit planes 1 and 2 of the tile data. - ld c, 16 + ld c, TILE_SIZE .copyLoop ld a, [hli] ld [de], a diff --git a/engine/gfx/sprite_oam.asm b/engine/gfx/sprite_oam.asm index 737443a6..649ab01e 100644 --- a/engine/gfx/sprite_oam.asm +++ b/engine/gfx/sprite_oam.asm @@ -148,16 +148,16 @@ PrepareOAMData:: ldh a, [hOAMBufferOffset] ld l, a ld h, HIGH(wShadowOAM) - ld de, $4 - ld b, $a0 + ld de, OBJ_SIZE + ld b, SCREEN_HEIGHT_PX + OAM_Y_OFS ld a, [wMovementFlags] bit BIT_LEDGE_OR_FISHING, a - ld a, $a0 + ld a, LOW(wShadowOAMEnd) jr z, .clear ; Don't clear the last 4 entries because they are used for the shadow in the ; jumping down ledge animation and the rod in the fishing animation. - ld a, $90 + ld a, LOW(wShadowOAMSprite36) .clear cp l diff --git a/engine/items/town_map.asm b/engine/items/town_map.asm index 6758adea..573ba581 100644 --- a/engine/items/town_map.asm +++ b/engine/items/town_map.asm @@ -24,7 +24,7 @@ DisplayTownMap: call CopyData ld hl, vSprites tile BIRD_BASE_TILE ld de, TownMapCursor - lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / $8 + lb bc, BANK(TownMapCursor), (TownMapCursorEnd - TownMapCursor) / TILE_1BPP_SIZE call CopyVideoDataDouble xor a ld [wWhichTownMapLocation], a @@ -149,7 +149,7 @@ LoadTownMap_Fly:: call CopyVideoData ld de, TownMapUpArrow ld hl, vChars1 tile $6d - lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / $8 + lb bc, BANK(TownMapUpArrow), (TownMapUpArrowEnd - TownMapUpArrow) / TILE_1BPP_SIZE call CopyVideoDataDouble call BuildFlyLocationsList ld hl, wUpdateSpritesEnabled @@ -609,11 +609,11 @@ TownMapSpriteBlinkingAnimation:: xor a jr .done .hideSprites - ld hl, wShadowOAM + ld hl, wShadowOAMSprite00YCoord ld b, OAM_COUNT - 4 - ld de, $4 + ld de, OBJ_SIZE .hideSpritesLoop - ld [hl], $a0 + ld [hl], SCREEN_HEIGHT_PX + OAM_Y_OFS add hl, de dec b jr nz, .hideSpritesLoop diff --git a/engine/link/cable_club.asm b/engine/link/cable_club.asm index c94b2693..ea39b938 100644 --- a/engine/link/cable_club.asm +++ b/engine/link/cable_club.asm @@ -977,5 +977,5 @@ CableClub_DrawHorizontalLine: LoadTrainerInfoTextBoxTiles: ld de, TrainerInfoTextBoxTileGraphics ld hl, vChars2 tile $76 - lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / $10 + lb bc, BANK(TrainerInfoTextBoxTileGraphics), (TrainerInfoTextBoxTileGraphicsEnd - TrainerInfoTextBoxTileGraphics) / TILE_SIZE jp CopyVideoData diff --git a/engine/menus/display_text_id_init.asm b/engine/menus/display_text_id_init.asm index f8bd6512..7ffdf7c3 100644 --- a/engine/menus/display_text_id_init.asm +++ b/engine/menus/display_text_id_init.asm @@ -43,8 +43,8 @@ DisplayTextIDInit:: ; this is done because when you talk to an NPC, they turn to look your way ; the original direction they were facing must be restored after the dialogue is over ld hl, wSprite01StateData1FacingDirection - ld c, $0f - ld de, $10 + ld c, NUM_SPRITESTATEDATA_STRUCTS - 1 + ld de, SPRITESTATEDATA1_LENGTH .spriteFacingDirectionCopyLoop ld a, [hl] ; x#SPRITESTATEDATA1_FACINGDIRECTION inc h @@ -56,7 +56,8 @@ DisplayTextIDInit:: ; loop to force all the sprites in the middle of animation to stand still ; (so that they don't like they're frozen mid-step during the dialogue) ld hl, wSpritePlayerStateData1ImageIndex - ld de, $10 + ld de, SPRITESTATEDATA1_LENGTH + ASSERT NUM_SPRITESTATEDATA_STRUCTS == SPRITESTATEDATA1_LENGTH ld c, e .spriteStandStillLoop ld a, [hl] diff --git a/engine/menus/naming_screen.asm b/engine/menus/naming_screen.asm index fda482e3..9c0cd0a8 100644 --- a/engine/menus/naming_screen.asm +++ b/engine/menus/naming_screen.asm @@ -327,7 +327,7 @@ LoadEDTile: ld de, ED_Tile ld hl, vFont tile $70 ; BUG: BANK("Home") should be BANK(ED_Tile), although it coincidentally works as-is - lb bc, BANK("Home"), (ED_TileEnd - ED_Tile) / $8 + lb bc, BANK("Home"), (ED_TileEnd - ED_Tile) / TILE_1BPP_SIZE jp CopyVideoDataDouble ED_Tile: diff --git a/engine/menus/save.asm b/engine/menus/save.asm index 9dfdd949..3fab0d01 100644 --- a/engine/menus/save.asm +++ b/engine/menus/save.asm @@ -225,15 +225,15 @@ SaveMainData: ld de, sSpriteData ld bc, wSpriteDataEnd - wSpriteDataStart call CopyData - ld hl, wBoxDataStart ; this part is redundant, SaveCurrentBoxData is always called next + ld hl, wBoxDataStart ld de, sCurBoxData ld bc, wBoxDataEnd - wBoxDataStart call CopyData + ldh a, [hTileAnimations] ld [sTileAnimations], a - ld hl, sGameData ld bc, sGameDataEnd - sGameData call CalcCheckSum diff --git a/engine/menus/start_sub_menus.asm b/engine/menus/start_sub_menus.asm index 8ba05b3f..c27e58a9 100644 --- a/engine/menus/start_sub_menus.asm +++ b/engine/menus/start_sub_menus.asm @@ -511,7 +511,7 @@ DrawTrainerInfo: ld de, 13 tiles add hl, de ; hl = colon tile pattern ld de, vChars1 tile $56 - ld bc, 1 tiles + ld bc, TILE_SIZE ld a, BANK(TextBoxGraphics) push bc call FarCopyData2 @@ -677,13 +677,13 @@ SwitchPartyMon_ClearGfx: dec c jr nz, .clearMonBGLoop pop af - ld hl, wShadowOAM - ld bc, $10 + ld hl, wShadowOAMSprite00YCoord + ld bc, OBJ_SIZE * 4 call AddNTimes - ld de, $4 + ld de, OBJ_SIZE ld c, e .clearMonOAMLoop - ld [hl], $a0 + ld [hl], SCREEN_HEIGHT_PX + OAM_Y_OFS add hl, de dec c jr nz, .clearMonOAMLoop diff --git a/engine/movie/credits.asm b/engine/movie/credits.asm index 1a68a7b5..b1ca7c91 100644 --- a/engine/movie/credits.asm +++ b/engine/movie/credits.asm @@ -11,7 +11,7 @@ HallOfFamePC: ld bc, ($20 tiles) / 2 call ZeroMemory ld hl, vChars2 tile $7e - ld bc, 1 tiles + ld bc, TILE_SIZE ld a, $ff ; solid black call FillMemory hlcoord 0, 0 @@ -246,7 +246,7 @@ Credits: pop de ld de, TheEndGfx ld hl, vChars2 tile $60 - lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / $10 + lb bc, BANK(TheEndGfx), (TheEndGfxEnd - TheEndGfx) / TILE_SIZE call CopyVideoData hlcoord 4, 8 ld de, TheEndTextString diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm index 00316018..2fa442f9 100644 --- a/engine/movie/intro.asm +++ b/engine/movie/intro.asm @@ -439,12 +439,12 @@ IntroNidorinoAnimation7: GameFreakIntro: INCBIN "gfx/splash/gamefreak_presents.2bpp" INCBIN "gfx/splash/gamefreak_logo.2bpp" - ds 16, $00 ; blank tile + ds TILE_SIZE, $00 ; blank tile GameFreakIntroEnd: FightIntroBackMon: INCBIN "gfx/intro/gengar.2bpp" - ds 16, $00 ; blank tile + ds TILE_SIZE, $00 ; blank tile FightIntroBackMonEnd: IF DEF(_RED) diff --git a/engine/movie/oak_speech/oak_speech.asm b/engine/movie/oak_speech/oak_speech.asm index 02826b98..a5f13def 100644 --- a/engine/movie/oak_speech/oak_speech.asm +++ b/engine/movie/oak_speech/oak_speech.asm @@ -117,6 +117,9 @@ OakSpeech: ld a, SFX_SHRINK call PlaySound pop af +; bug: switching ROM Bank should not happen outside of Home Bank +; This code does nothing, as PlaySound does all necessary Bank switch +; It looks like a leftover from an early development stage ldh [hLoadedROMBank], a ld [rROMB], a ld c, 4 @@ -145,6 +148,7 @@ OakSpeech: ld [wNewSoundID], a call PlaySound pop af +; bug: switching ROM Bank should not happen outside of Home Bank ldh [hLoadedROMBank], a ld [rROMB], a ld c, 20 @@ -160,21 +164,26 @@ OakSpeech: call DelayFrames call GBFadeOutToWhite jp ClearScreen + OakSpeechText1: text_far _OakSpeechText1 text_end + OakSpeechText2: text_far _OakSpeechText2A ; BUG: The cry played does not match the sprite displayed. sound_cry_nidorina text_far _OakSpeechText2B text_end + IntroducePlayerText: text_far _IntroducePlayerText text_end + IntroduceRivalText: text_far _IntroduceRivalText text_end + OakSpeechText3: text_far _OakSpeechText3 text_end @@ -226,7 +235,7 @@ IntroDisplayPicCenteredOrUpperRight: call UncompressSpriteFromDE ld hl, sSpriteBuffer1 ld de, sSpriteBuffer0 - ld bc, $310 + ld bc, 2 * SPRITEBUFFERSIZE call CopyData ld de, vFrontPic call InterlaceMergeSpriteBuffers diff --git a/engine/movie/splash.asm b/engine/movie/splash.asm index da3fec0d..7f06c68b 100644 --- a/engine/movie/splash.asm +++ b/engine/movie/splash.asm @@ -13,7 +13,7 @@ LoadShootingStarGraphics: call CopyVideoData ld de, FallingStar ld hl, vChars1 tile $22 - lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / $10 + lb bc, BANK(FallingStar), (FallingStarEnd - FallingStar) / TILE_SIZE call CopyVideoData ld hl, GameFreakLogoOAMData ld de, wShadowOAMSprite24 @@ -60,11 +60,11 @@ AnimateShootingStar: jr nz, .bigStarLoop ; Clear big star OAM. - ld hl, wShadowOAM + ld hl, wShadowOAMSprite00YCoord ld c, 4 - ld de, 4 + ld de, OBJ_SIZE .clearOAMLoop - ld [hl], 160 + ld [hl], SCREEN_HEIGHT_PX + OAM_Y_OFS add hl, de dec c jr nz, .clearOAMLoop diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 698dd5e0..c9ea4b47 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -104,7 +104,7 @@ DisplayTitleScreen: ; place tiles for title screen copyright hlcoord 2, 17 ld de, .tileScreenCopyrightTiles - ld b, $10 + ld b, .tileScreenCopyrightTilesEnd - .tileScreenCopyrightTiles .tileScreenCopyrightTilesLoop ld a, [de] ld [hli], a @@ -116,6 +116,7 @@ DisplayTitleScreen: .tileScreenCopyrightTiles db $41,$42,$43,$42,$44,$42,$45,$46,$47,$48,$49,$4A,$4B,$4C,$4D,$4E ; ©'95.'96.'98 GAME FREAK inc. +.tileScreenCopyrightTilesEnd .next call SaveScreenTilesToBuffer2 @@ -380,7 +381,7 @@ LoadCopyrightAndTextBoxTiles: LoadCopyrightTiles: ld de, NintendoCopyrightLogoGraphics ld hl, vChars2 tile $60 - lb bc, BANK(NintendoCopyrightLogoGraphics), (GameFreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / $10 + lb bc, BANK(NintendoCopyrightLogoGraphics), (GameFreakLogoGraphicsEnd - NintendoCopyrightLogoGraphics) / TILE_SIZE call CopyVideoData hlcoord 2, 7 ld de, CopyrightTextString diff --git a/engine/movie/trade.asm b/engine/movie/trade.asm index bf77f21e..292f47cd 100644 --- a/engine/movie/trade.asm +++ b/engine/movie/trade.asm @@ -316,7 +316,7 @@ Trade_AnimateBallEnteringLinkCable: ld [wLinkCableAnimBulgeToggle], a add $7e ld hl, wShadowOAMSprite00TileID - ld de, 4 + ld de, OBJ_SIZE ld c, e .cycleLinkCableBulgeTile ld [hl], a @@ -602,7 +602,7 @@ Trade_AnimCircledMon: xor $3c ; make link cable flash ldh [rBGP], a ld hl, wShadowOAMSprite00TileID - ld de, $4 + ld de, OBJ_SIZE ld c, $14 .loop ld a, [hl] diff --git a/engine/overworld/cut.asm b/engine/overworld/cut.asm index 93902b51..368941d5 100644 --- a/engine/overworld/cut.asm +++ b/engine/overworld/cut.asm @@ -100,13 +100,13 @@ InitCutAnimOAM: call LoadCutGrassAnimationTilePattern call WriteCutOrBoulderDustAnimationOAMBlock ld hl, wShadowOAMSprite36Attributes - ld de, 4 - ld a, $30 + ld de, OBJ_SIZE + ld a, OAM_XFLIP | OAM_PAL1 ld c, e .loop ld [hl], a add hl, de - xor $60 + xor OAM_YFLIP | OAM_XFLIP dec c jr nz, .loop ret diff --git a/engine/overworld/dust_smoke.asm b/engine/overworld/dust_smoke.asm index 96dd364a..85b89cdc 100644 --- a/engine/overworld/dust_smoke.asm +++ b/engine/overworld/dust_smoke.asm @@ -70,7 +70,7 @@ LoadSmokeTileFourTimes:: push hl call LoadSmokeTile pop hl - ld bc, 1 tiles + ld bc, TILE_SIZE add hl, bc pop bc dec c @@ -79,7 +79,7 @@ LoadSmokeTileFourTimes:: LoadSmokeTile: ld de, SSAnneSmokePuffTile - lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / $10 + lb bc, BANK(SSAnneSmokePuffTile), (SSAnneSmokePuffTileEnd - SSAnneSmokePuffTile) / TILE_SIZE jp CopyVideoData SSAnneSmokePuffTile: diff --git a/engine/overworld/ledges.asm b/engine/overworld/ledges.asm index db8b9e97..69403042 100644 --- a/engine/overworld/ledges.asm +++ b/engine/overworld/ledges.asm @@ -59,7 +59,7 @@ INCLUDE "data/tilesets/ledge_tiles.asm" LoadHoppingShadowOAM: ld hl, vChars1 tile $7f ld de, LedgeHoppingShadow - lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / $8 + lb bc, BANK(LedgeHoppingShadow), (LedgeHoppingShadowEnd - LedgeHoppingShadow) / TILE_1BPP_SIZE call CopyVideoDataDouble ld a, $9 lb bc, $54, $48 ; b, c = y, x coordinates of shadow diff --git a/engine/overworld/player_animations.asm b/engine/overworld/player_animations.asm index c163b27e..4ed1f49f 100644 --- a/engine/overworld/player_animations.asm +++ b/engine/overworld/player_animations.asm @@ -209,13 +209,13 @@ LeaveMapThroughHoleAnim: ld [wShadowOAMSprite02TileID], a ld a, [wShadowOAMSprite01TileID] ld [wShadowOAMSprite03TileID], a - ld a, $a0 + ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ld [wShadowOAMSprite00YCoord], a ld [wShadowOAMSprite01YCoord], a ld c, 2 call DelayFrames ; hide upper half of player's sprite - ld a, $a0 + ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ld [wShadowOAMSprite02YCoord], a ld [wShadowOAMSprite03YCoord], a call GBFadeOutToWhite @@ -423,7 +423,7 @@ FishingAnim: ld a, [wSpritePlayerStateData1ImageIndex] ; (image index is locked to standing images) cp SPRITE_FACING_UP jr nz, .skipHidingFishingRod - ld a, $a0 + ld a, SCREEN_HEIGHT_PX + OAM_Y_OFS ld [wShadowOAMSprite39YCoord], a .skipHidingFishingRod |
