diff options
Diffstat (limited to 'engine/gamefreak.asm')
-rwxr-xr-x | engine/gamefreak.asm | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index e2db39de..5472a56e 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -1,15 +1,15 @@ -LoadShootingStarGraphics: ; 70000 (1c:4000) +LoadShootingStarGraphics: ld a, $f9 ld [rOBP0], a ld a, $a4 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a call UpdateGBCPal_OBP0 call UpdateGBCPal_OBP1 - ld de, AnimationTileset2 + $30 ; $4757 ; star tile (top left quadrant) + ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) ld hl, vChars1 + $200 lb bc, BANK(AnimationTileset2), $01 call CopyVideoData - ld de, AnimationTileset2 + $130 ; $481e ; star tile (bottom left quadrant) + ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) ld hl, vChars1 + $210 lb bc, BANK(AnimationTileset2), $01 call CopyVideoData @@ -26,9 +26,9 @@ LoadShootingStarGraphics: ; 70000 (1c:4000) ld bc, GameFreakShootingStarOAMDataEnd - GameFreakShootingStarOAMData jp CopyData -AnimateShootingStar: ; 7004a (1c:404a) +AnimateShootingStar: call LoadShootingStarGraphics - ld a, $c2 ; (SFX_1f_67 - SFX_Headers_1f) / 3 + ld a, SFX_SHOOTING_STAR call PlaySound ; Move the big star down and left across the screen. @@ -39,7 +39,7 @@ AnimateShootingStar: ; 7004a (1c:404a) push bc .bigStarInnerLoop ld a, [hl] ; Y - add 4 ; y + add 4 ld [hli], a ld a, [hl] ; X add -4 @@ -60,11 +60,11 @@ AnimateShootingStar: ; 7004a (1c:404a) .next cp b jr nz, .bigStarLoop + +; Clear big star OAM. ld hl, wOAMBuffer ld c, 4 ld de, 4 - -; Clear big star OAM. .clearOAMLoop ld [hl], 160 add hl, de @@ -74,7 +74,7 @@ AnimateShootingStar: ; 7004a (1c:404a) ; Make Gamefreak logo flash. ld b, 3 .flashLogoLoop - ld hl, rOBP0 ; $ff48 + ld hl, rOBP0 rrc [hl] rrc [hl] call UpdateGBCPal_OBP0 @@ -83,13 +83,14 @@ AnimateShootingStar: ; 7004a (1c:404a) ret c dec b jr nz, .flashLogoLoop + ; Copy 24 instances of the small stars OAM data. ; Note that their coordinates put them off-screen. ld de, wOAMBuffer ld a, 24 .initSmallStarsOAMLoop push af - ld hl, SmallStarsOAM ; $40ee + ld hl, SmallStarsOAM ld bc, SmallStarsOAMEnd - SmallStarsOAM call CopyData pop af @@ -98,8 +99,8 @@ AnimateShootingStar: ; 7004a (1c:404a) ; Animate the small stars falling from the Gamefreak logo. xor a - ld [wMoveDownSmallStarsOAMCount], a ; wWhichTrade - ld hl, SmallStarsWaveCoordsPointerTable ; 1c:4105 + ld [wMoveDownSmallStarsOAMCount], a + ld hl, SmallStarsWaveCoordsPointerTable ld c, 6 .smallStarsLoop ld a, [hli] @@ -156,11 +157,11 @@ AnimateShootingStar: ; 7004a (1c:404a) and a ret -SmallStarsOAM: ; 70101 (1c:4101) +SmallStarsOAM: db $00,$00,$A2,$90 SmallStarsOAMEnd: -SmallStarsWaveCoordsPointerTable: ; 70105 (1c:4105) +SmallStarsWaveCoordsPointerTable: dw SmallStarsWave1Coords dw SmallStarsWave2Coords dw SmallStarsWave3Coords @@ -171,7 +172,7 @@ SmallStarsWaveCoordsPointerTable: ; 70105 (1c:4105) ; The stars that fall from the Gamefreak logo come in 4 waves of 4 OAM entries. ; These arrays contain the Y and X coordinates of each OAM entry. -SmallStarsWave1Coords: ; 70111 (1c:4111) +SmallStarsWave1Coords: db $68,$30 db $05,$68 db $40,$05 @@ -179,7 +180,7 @@ SmallStarsWave1Coords: ; 70111 (1c:4111) db $04,$68 db $78,$07 -SmallStarsWave2Coords: ; 7011d (1c:411d) +SmallStarsWave2Coords: db $68,$38 db $05,$68 db $48,$06 @@ -187,7 +188,7 @@ SmallStarsWave2Coords: ; 7011d (1c:411d) db $04,$68 db $70,$07 -SmallStarsWave3Coords: ; 70129 (1c:4129) +SmallStarsWave3Coords: db $68,$34 db $05,$68 db $4c,$06 @@ -195,7 +196,7 @@ SmallStarsWave3Coords: ; 70129 (1c:4129) db $06,$68 db $64,$07 -SmallStarsWave4Coords: ; 70135 (1c:4135) +SmallStarsWave4Coords: db $68,$3c db $05,$68 db $5c,$04 @@ -203,10 +204,10 @@ SmallStarsWave4Coords: ; 70135 (1c:4135) db $07,$68 db $74,$07 -SmallStarsEmptyWave: ; 70141 (1c:4141) +SmallStarsEmptyWave: db $FF -MoveDownSmallStars: ; 70142 (1c:4142) +MoveDownSmallStars: ld b, 8 .loop ld hl, wOAMBuffer + $5c @@ -214,15 +215,15 @@ MoveDownSmallStars: ; 70142 (1c:4142) ld de, -4 ld c, a .innerLoop - inc [hl] + inc [hl] ; Y add hl, de dec c jr nz, .innerLoop ; Toggle the palette so that the lower star in the small stars tile blinks in ; and out. - ld a, [rOBP1] ; $ff49 + ld a, [rOBP1] xor %10100000 - ld [rOBP1], a ; $ff49 + ld [rOBP1], a call UpdateGBCPal_OBP1 ld c, 3 call CheckForUserInterruption @@ -231,7 +232,7 @@ MoveDownSmallStars: ; 70142 (1c:4142) jr nz, .loop ret -GameFreakLogoOAMData: ; 70166 (1c:4166) +GameFreakLogoOAMData: db $48,$50,$8D,$00 db $48,$58,$8E,$00 db $50,$50,$8F,$00 @@ -250,13 +251,13 @@ GameFreakLogoOAMData: ; 70166 (1c:4166) db $60,$78,$86,$00 GameFreakLogoOAMDataEnd: -GameFreakShootingStarOAMData: ; 701a6 (1c:41a6) +GameFreakShootingStarOAMData: db $00,$A0,$A0,$14 db $00,$A8,$A0,$34 db $08,$A0,$A1,$14 db $08,$A8,$A1,$34 GameFreakShootingStarOAMDataEnd: -FallingStar: ; 701b6 (1c:41b6) +FallingStar: INCBIN "gfx/falling_star.2bpp" FallingStarEnd: |