diff options
author | yenatch <yenatch@gmail.com> | 2013-05-21 18:32:55 -0400 |
---|---|---|
committer | yenatch <yenatch@gmail.com> | 2013-05-21 18:32:55 -0400 |
commit | 6dde0b274d1edac5db5087bcd9a9931716fe1d83 (patch) | |
tree | e1d3a6aede9af497b444cb7a0c39057fce7b69aa /main.asm | |
parent | 399925fff577cf11a77193d997d2bf19ee72aa04 (diff) |
ilex forest tree tile animations
Diffstat (limited to 'main.asm')
-rw-r--r-- | main.asm | 172 |
1 files changed, 171 insertions, 1 deletions
@@ -16700,7 +16700,177 @@ WaterTileFrames: ; fc41c INCBIN "baserom.gbc", $fc41c, $fc45c - $fc41c ; fc45c -INCBIN "baserom.gbc", $fc45c, $fc56d - $fc45c + +ForestTreeLeftAnimation: ; fc45c + ld hl, [sp+0] + ld b, h + ld c, l + +; Only during the Celebi event. + ld a, [$dbf3] + bit 2, a + jr nz, .asm_fc46c + ld hl, ForestTreeLeftFrames + jr .asm_fc47d + +.asm_fc46c + ld a, [TileAnimationTimer] + call GetForestTreeFrame + add a + add a + add a + add ForestTreeLeftFrames % $100 + ld l, a + ld a, 0 + adc ForestTreeLeftFrames / $100 + ld h, a + +.asm_fc47d + ld sp, hl + ld hl, $90c0 + jp WriteTile +; fc484 + + +ForestTreeLeftFrames: ; fc484 + INCBIN "gfx/tilesets/forest-tree/1.2bpp" + INCBIN "gfx/tilesets/forest-tree/2.2bpp" +; fc4a4 + +ForestTreeRightFrames: ; fc4a4 + INCBIN "gfx/tilesets/forest-tree/3.2bpp" + INCBIN "gfx/tilesets/forest-tree/4.2bpp" +; fc4c4 + + +ForestTreeRightAnimation: ; fc4c4 + ld hl, [sp+0] + ld b, h + ld c, l + +; Only during the Celebi event. + ld a, [$dbf3] + bit 2, a + jr nz, .asm_fc4d4 + ld hl, ForestTreeRightFrames + jr .asm_fc4eb + +.asm_fc4d4 + ld a, [TileAnimationTimer] + call GetForestTreeFrame + add a + add a + add a + add ForestTreeLeftFrames % $100 + ld l, a + ld a, 0 + adc ForestTreeLeftFrames / $100 + ld h, a + push bc + ld bc, ForestTreeRightFrames - ForestTreeLeftFrames + add hl, bc + pop bc + +.asm_fc4eb + ld sp, hl + ld hl, $90f0 + jp WriteTile +; fc4f2 + + +ForestTreeLeftAnimation2: ; fc4f2 + ld hl, [sp+0] + ld b, h + ld c, l + +; Only during the Celebi event. + ld a, [$dbf3] + bit 2, a + jr nz, .asm_fc502 + ld hl, ForestTreeLeftFrames + jr .asm_fc515 + +.asm_fc502 + ld a, [TileAnimationTimer] + call GetForestTreeFrame + xor 2 + add a + add a + add a + add ForestTreeLeftFrames % $100 + ld l, a + ld a, 0 + adc ForestTreeLeftFrames / $100 + ld h, a + +.asm_fc515 + ld sp, hl + ld hl, $90c0 + jp WriteTile +; fc51c + + +ForestTreeRightAnimation2: ; fc51c + ld hl, [sp+0] + ld b, h + ld c, l + +; Only during the Celebi event. + ld a, [$dbf3] + bit 2, a + jr nz, .asm_fc52c + ld hl, ForestTreeRightFrames + jr .asm_fc545 + +.asm_fc52c + ld a, [TileAnimationTimer] + call GetForestTreeFrame + xor 2 + add a + add a + add a + add ForestTreeLeftFrames % $100 + ld l, a + ld a, 0 + adc ForestTreeLeftFrames / $100 + ld h, a + push bc + ld bc, ForestTreeRightFrames - ForestTreeLeftFrames + add hl, bc + pop bc + +.asm_fc545 + ld sp, hl + ld hl, $90f0 + jp WriteTile +; fc54c + + +GetForestTreeFrame: ; fc54c +; Return 0 if a is even, or 2 if odd. + and a + jr z, .even + cp 1 + jr z, .odd + cp 2 + jr z, .even + cp 3 + jr z, .odd + cp 4 + jr z, .even + cp 5 + jr z, .odd + cp 6 + jr z, .even +.odd + ld a, 2 + scf + ret +.even + xor a + ret +; fc56d + AnimateFlowerTile: ; fc56d ; No parameters. |