From dba7f59d83c0850c86dd3009d63b2bdeeb0fed68 Mon Sep 17 00:00:00 2001 From: Rangi Date: Sun, 15 Jul 2018 11:58:01 -0400 Subject: [PATCH] More OAM coordinate consistency --- engine/events/celebi.asm | 2 +- engine/events/field_moves.asm | 40 +++++++++++++++++++---------------- engine/events/fishing_gfx.asm | 2 +- engine/games/unown_puzzle.asm | 4 ++-- engine/movie/title.asm | 4 ++-- mobile/mobile_22_2.asm | 2 +- mobile/mobile_46.asm | 2 +- mobile/mobile_5c.asm | 2 +- mobile/mobile_5f.asm | 8 +++---- 9 files changed, 35 insertions(+), 31 deletions(-) diff --git a/engine/events/celebi.asm b/engine/events/celebi.asm index 76bdbaa76..a34f3935a 100644 --- a/engine/events/celebi.asm +++ b/engine/events/celebi.asm @@ -31,7 +31,7 @@ CelebiShrineEvent: call GetCelebiSpriteTile inc d push de - ld a, $90 + ld a, 36 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a farcall DoNextFrameForAllSprites call CelebiEvent_CountDown diff --git a/engine/events/field_moves.asm b/engine/events/field_moves.asm index f5ad049f2..6adb80ba6 100644 --- a/engine/events/field_moves.asm +++ b/engine/events/field_moves.asm @@ -1,3 +1,7 @@ +FIELDMOVE_GRASS EQU $80 +FIELDMOVE_TREE EQU $84 +FIELDMOVE_FLY EQU $84 + PlayWhirlpoolSound: call WaitSFX ld de, SFX_SURF @@ -20,11 +24,11 @@ BlindingFlash: ShakeHeadbuttTree: farcall ClearSpriteAnims ld de, CutGrassGFX - ld hl, vTiles1 tile $00 + ld hl, vTiles0 tile FIELDMOVE_GRASS lb bc, BANK(CutGrassGFX), 4 call Request2bpp ld de, HeadbuttTreeGFX - ld hl, vTiles1 tile $04 + ld hl, vTiles0 tile FIELDMOVE_TREE lb bc, BANK(HeadbuttTreeGFX), 8 call Request2bpp call Cut_Headbutt_GetPixelFacing @@ -32,8 +36,8 @@ ShakeHeadbuttTree: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $84 - ld a, 36 * 4 + ld [hl], FIELDMOVE_TREE + ld a, 36 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a farcall DoNextFrameForAllSprites call HideHeadbuttTree @@ -48,7 +52,7 @@ ShakeHeadbuttTree: and a jr z, .done dec [hl] - ld a, 36 * 4 + ld a, 36 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a farcall DoNextFrameForAllSprites call DelayFrame @@ -111,7 +115,7 @@ OWCutAnimation: ; 0: Split tree in half ; 1: Mow the lawn ld a, e - and $1 + and 1 ld [wJumptableIndex], a call .LoadCutGFX call WaitSFX @@ -121,7 +125,7 @@ OWCutAnimation: ld a, [wJumptableIndex] bit 7, a jr nz, .finish - ld a, 36 * 4 + ld a, 36 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a callfar DoNextFrameForAllSprites call OWCutJumptable @@ -134,11 +138,11 @@ OWCutAnimation: .LoadCutGFX: callfar ClearSpriteAnims ; pointless to farcall ld de, CutGrassGFX - ld hl, vTiles1 tile $00 + ld hl, vTiles0 tile FIELDMOVE_GRASS lb bc, BANK(CutGrassGFX), 4 call Request2bpp ld de, CutTreeGFX - ld hl, vTiles1 tile $04 + ld hl, vTiles0 tile FIELDMOVE_TREE lb bc, BANK(CutTreeGFX), 4 call Request2bpp ret @@ -173,7 +177,7 @@ Cut_SpawnAnimateTree: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $84 + ld [hl], FIELDMOVE_TREE ld a, 32 ld [wFrameCounter], a ; Cut_StartWaiting @@ -226,7 +230,7 @@ Cut_SpawnLeaf: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $80 + ld [hl], FIELDMOVE_GRASS ld hl, SPRITEANIMSTRUCT_0E add hl, bc ld [hl], $4 @@ -313,7 +317,7 @@ FlyFromAnim: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $84 + ld [hl], FIELDMOVE_FLY ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID add hl, bc ld [hl], SPRITE_ANIM_SEQ_FLY_FROM @@ -323,7 +327,7 @@ FlyFromAnim: ld a, [wJumptableIndex] bit 7, a jr nz, .exit - ld a, 0 * 4 + ld a, 0 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a callfar DoNextFrameForAllSprites call FlyFunction_FrameTimer @@ -347,7 +351,7 @@ FlyToAnim: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $84 + ld [hl], FIELDMOVE_FLY ld hl, SPRITEANIMSTRUCT_ANIM_SEQ_ID add hl, bc ld [hl], SPRITE_ANIM_SEQ_FLY_TO @@ -360,7 +364,7 @@ FlyToAnim: ld a, [wJumptableIndex] bit 7, a jr nz, .exit - ld a, 0 * 4 + ld a, 0 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a callfar DoNextFrameForAllSprites call FlyFunction_FrameTimer @@ -394,7 +398,7 @@ endr FlyFunction_InitGFX: callfar ClearSpriteAnims ld de, CutGrassGFX - ld hl, vTiles1 tile $00 + ld hl, vTiles0 tile FIELDMOVE_GRASS lb bc, BANK(CutGrassGFX), 4 call Request2bpp ld a, [wCurPartyMon] @@ -404,7 +408,7 @@ FlyFunction_InitGFX: add hl, de ld a, [hl] ld [wd265], a - ld e, $84 + ld e, FIELDMOVE_FLY farcall FlyFunction_GetMonIcon xor a ld [wJumptableIndex], a @@ -446,5 +450,5 @@ FlyFunction_FrameTimer: call _InitSpriteAnimStruct ld hl, SPRITEANIMSTRUCT_TILE_ID add hl, bc - ld [hl], $80 + ld [hl], FIELDMOVE_GRASS ret diff --git a/engine/events/fishing_gfx.asm b/engine/events/fishing_gfx.asm index 25d1ee77a..159f0022d 100644 --- a/engine/events/fishing_gfx.asm +++ b/engine/events/fishing_gfx.asm @@ -17,7 +17,7 @@ LoadFishingGFX: call .LoadGFX ld hl, vTiles0 tile $0a call .LoadGFX - ld hl, vTiles1 tile $7c + ld hl, vTiles0 tile $fc call .LoadGFX pop af diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm index fb88d93b6..40c6527d9 100644 --- a/engine/games/unown_puzzle.asm +++ b/engine/games/unown_puzzle.asm @@ -19,11 +19,11 @@ _UnownPuzzle: xor a call ByteFill ld hl, UnownPuzzleCursorGFX - ld de, vTiles1 tile $60 + ld de, vTiles0 tile $e0 ld bc, 4 tiles call CopyBytes ld hl, UnownPuzzleStartCancelLZ - ld de, vTiles1 tile $6d + ld de, vTiles0 tile $ed call Decompress call LoadUnownPuzzlePiecesGFX hlcoord 0, 0 diff --git a/engine/movie/title.asm b/engine/movie/title.asm index 3717b4e73..eb639489f 100644 --- a/engine/movie/title.asm +++ b/engine/movie/title.asm @@ -246,8 +246,8 @@ SuicuneFrameIterator: ret .Frames: - db $80 ; vTiles4 tile $00 - db $88 ; vTiles4 tile $08 + db $80 ; vTiles3 tile $80 + db $88 ; vTiles3 tile $88 db $00 ; vTiles5 tile $00 db $08 ; vTiles5 tile $08 diff --git a/mobile/mobile_22_2.asm b/mobile/mobile_22_2.asm index 260e62073..be1c897d8 100644 --- a/mobile/mobile_22_2.asm +++ b/mobile/mobile_22_2.asm @@ -586,7 +586,7 @@ Function8b690: ld a, BANK(GFX_17afa5) call FarCopyBytes ld hl, GFX_17afa5 + $514 + $160 - ld de, vTiles1 tile $6e + ld de, vTiles0 tile $ee ld bc, $10 ld a, BANK(GFX_17afa5) call FarCopyBytes diff --git a/mobile/mobile_46.asm b/mobile/mobile_46.asm index 43ddf5201..95e1f5ac5 100644 --- a/mobile/mobile_46.asm +++ b/mobile/mobile_46.asm @@ -5543,7 +5543,7 @@ Function11ac51: call Function11b314 call Function11acb7 call Function11ad6e - ld a, 30 * 4 + ld a, 30 * SPRITEOAMSTRUCT_LENGTH ld [wCurrSpriteOAMAddr], a farcall DoNextFrameForAllSprites farcall ReloadMapPart diff --git a/mobile/mobile_5c.asm b/mobile/mobile_5c.asm index 2874ce65a..0b4d05014 100644 --- a/mobile/mobile_5c.asm +++ b/mobile/mobile_5c.asm @@ -279,7 +279,7 @@ Function170d02: ld a, $1 ld [rVBK], a ld de, GFX_171848 - ld hl, vTiles1 tile $41 + ld hl, vTiles0 tile $c1 lb bc, BANK(GFX_171848), 24 call Get2bpp xor a diff --git a/mobile/mobile_5f.asm b/mobile/mobile_5f.asm index ed2b5188c..505d6cdbd 100644 --- a/mobile/mobile_5f.asm +++ b/mobile/mobile_5f.asm @@ -605,7 +605,7 @@ Function17d370: call ClearScreen farcall ReloadMapPart call DisableLCD - ld hl, vTiles1 tile $6e + ld hl, vTiles0 tile $ee ld de, $c608 ld bc, 1 tiles call CopyBytes @@ -620,7 +620,7 @@ Function17d370: ld bc, 1 tiles call ByteFill ld hl, $c608 - ld de, vTiles1 tile $6e + ld de, vTiles0 tile $ee ld bc, 1 tiles call CopyBytes xor a @@ -652,7 +652,7 @@ Function17d3f6: Function17d405: call DisableLCD - ld hl, vTiles1 tile $6e + ld hl, vTiles0 tile $ee ld de, $c608 ld bc, 1 tiles call CopyBytes @@ -667,7 +667,7 @@ Function17d405: ld bc, 1 tiles call ByteFill ld hl, $c608 - ld de, vTiles1 tile $6e + ld de, vTiles0 tile $ee ld bc, 1 tiles call CopyBytes xor a