aboutsummaryrefslogtreecommitdiffstats
path: root/engine/movie
diff options
context:
space:
mode:
authorNarishma-gb <194818981+Narishma-gb@users.noreply.github.com>2025-11-18 21:17:31 +0100
committerGitHub <noreply@github.com>2025-11-18 15:17:31 -0500
commitf3326786259f4e53c06b7565369add7605bea8ba (patch)
tree1e09025ed19a6403fa74c408aa195662178cc0ca /engine/movie
parentAdd `_vc` patch targets to `.PHONY` (diff)
downloadpokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.tar.gz
pokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.tar.xz
pokeyellow-f3326786259f4e53c06b7565369add7605bea8ba.zip
Use more hardware and graphics constants (#532)
- Use `OBJ_SIZE` and `TILE_SIZE` from hardware.inc. - `SPRITESTATEDATA1_LENGTH`, `NUM_SPRITESTATEDATA_STRUCTS` and `TILE_1BPP_SIZE` are used in some places. - Highlight an oversight in `OakSpeech` where several direct MBC bank switches are requested. - Remove redundant comments in home/overworld.asm. - Add unreferenced `FillBgMap` function to avoid a byte of dead code. - Some constants added in wram.asm. - Correctly separate the commented code in `SaveMainData`.
Diffstat (limited to 'engine/movie')
-rw-r--r--engine/movie/credits.asm4
-rw-r--r--engine/movie/intro.asm4
-rw-r--r--engine/movie/oak_speech/oak_speech.asm11
-rw-r--r--engine/movie/splash.asm8
-rw-r--r--engine/movie/title.asm5
-rw-r--r--engine/movie/trade.asm4
6 files changed, 23 insertions, 13 deletions
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]