diff options
Diffstat (limited to 'engine/gamefreak.asm')
-rwxr-xr-x | engine/gamefreak.asm | 78 |
1 files changed, 48 insertions, 30 deletions
diff --git a/engine/gamefreak.asm b/engine/gamefreak.asm index 69c059ff..6545e216 100755 --- a/engine/gamefreak.asm +++ b/engine/gamefreak.asm @@ -2,12 +2,14 @@ LoadShootingStarGraphics: ld a, $f9 ld [rOBP0], a ld a, $a4 - ld [rOBP1], a - ld de, AnimationTileset2 + $30 ; star tile (top left quadrant) + ld [rOBP1], a ; $ff49 + call UpdateGBCPal_OBP0 + call UpdateGBCPal_OBP1 + ld de, AnimationTileset2 + $30 ; $4757 ; star tile (top left quadrant) ld hl, vChars1 + $200 lb bc, BANK(AnimationTileset2), $01 call CopyVideoData - ld de, AnimationTileset2 + $130 ; star tile (bottom left quadrant) + ld de, AnimationTileset2 + $130 ; $481e ; star tile (bottom left quadrant) ld hl, vChars1 + $210 lb bc, BANK(AnimationTileset2), $01 call CopyVideoData @@ -37,7 +39,7 @@ AnimateShootingStar: push bc .bigStarInnerLoop ld a, [hl] ; Y - add 4 + add 4 ; y ld [hli], a ld a, [hl] ; X add -4 @@ -58,11 +60,11 @@ AnimateShootingStar: .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 @@ -72,22 +74,22 @@ AnimateShootingStar: ; Make Gamefreak logo flash. ld b, 3 .flashLogoLoop - ld hl, rOBP0 + ld hl, rOBP0 ; $ff48 rrc [hl] rrc [hl] + call UpdateGBCPal_OBP0 ld c, 10 call CheckForUserInterruption 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 + ld hl, SmallStarsOAM ; $40ee ld bc, SmallStarsOAMEnd - SmallStarsOAM call CopyData pop af @@ -96,8 +98,8 @@ AnimateShootingStar: ; Animate the small stars falling from the Gamefreak logo. xor a - ld [wMoveDownSmallStarsOAMCount], a - ld hl, SmallStarsWaveCoordsPointerTable + ld [wMoveDownSmallStarsOAMCount], a ; wWhichTrade + ld hl, SmallStarsWaveCoordsPointerTable ; 1c:4105 ld c, 6 .smallStarsLoop ld a, [hli] @@ -118,6 +120,15 @@ AnimateShootingStar: ld [hli], a ; X inc de inc hl + push bc + ld a, [de] + ld b,a + ld a, [hl] + and $f0 + or b + ld [hl], a + inc de + pop bc inc hl dec c jr nz, .smallStarsInnerLoop @@ -162,27 +173,35 @@ SmallStarsWaveCoordsPointerTable: SmallStarsWave1Coords: db $68,$30 - db $68,$40 + db $05,$68 + db $40,$05 db $68,$58 - db $68,$78 + db $04,$68 + db $78,$07 SmallStarsWave2Coords: db $68,$38 - db $68,$48 + db $05,$68 + db $48,$06 db $68,$60 - db $68,$70 + db $04,$68 + db $70,$07 SmallStarsWave3Coords: db $68,$34 - db $68,$4C + db $05,$68 + db $4c,$06 db $68,$54 - db $68,$64 + db $06,$68 + db $64,$07 SmallStarsWave4Coords: - db $68,$3C - db $68,$5C - db $68,$6C - db $68,$74 + db $68,$3c + db $05,$68 + db $5c,$04 + db $68,$6c + db $07,$68 + db $74,$07 SmallStarsEmptyWave: db $FF @@ -195,17 +214,16 @@ MoveDownSmallStars: ld de, -4 ld c, a .innerLoop - inc [hl] ; Y + inc [hl] 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] + ld a, [rOBP1] ; $ff49 xor %10100000 - ld [rOBP1], a - + ld [rOBP1], a ; $ff49 + call UpdateGBCPal_OBP1 ld c, 3 call CheckForUserInterruption ret c @@ -233,10 +251,10 @@ GameFreakLogoOAMData: GameFreakLogoOAMDataEnd: GameFreakShootingStarOAMData: - db $00,$A0,$A0,$10 - db $00,$A8,$A0,$30 - db $08,$A0,$A1,$10 - db $08,$A8,$A1,$30 + db $00,$A0,$A0,$14 + db $00,$A8,$A0,$34 + db $08,$A0,$A1,$14 + db $08,$A8,$A1,$34 GameFreakShootingStarOAMDataEnd: FallingStar: |