254 lines
8.1 KiB
PHP
254 lines
8.1 KiB
PHP
TheStar:
|
|
db 10, "THE STAR "
|
|
db 10, " "
|
|
db 9, "hope "
|
|
db 9, "healing "
|
|
db 9, "purpose "
|
|
dw .BackgroundCopyEnd - .BackgroundCopy
|
|
dw .BackgroundCopy
|
|
dw .KeyArtTilesEnd - .KeyArtTiles
|
|
dw .KeyArtTiles
|
|
dw .SpriteTilesEnd - .SpriteTiles
|
|
dw .SpriteTiles
|
|
dw .fInit
|
|
dw .fUpdate
|
|
dw .fDraw
|
|
|
|
.fInit:
|
|
ld hl, CVS
|
|
ld a, 0
|
|
ld [hl+], a ; CVS timer for star flicker
|
|
ld [hl+], a
|
|
ld [hl+], a ; CVS+2 frame of star flicker
|
|
ld [hl+], a ; CVS+3 timer for lil stars
|
|
ld [hl+], a
|
|
ld [hl+], a ; CVS+5 frame of lill stars
|
|
|
|
; star flare is first 20 OAM sprites
|
|
ld hl, MY_OAM+20*4
|
|
ld b, 21
|
|
.paletteLoop
|
|
inc hl ; now poining at x
|
|
inc hl ; now pointing at tile id
|
|
inc hl ; now pointing at attributes
|
|
set OAMB_PAL1, [hl]
|
|
inc hl ; now pointing at y for next sprite
|
|
dec b
|
|
jp nz, .paletteLoop
|
|
|
|
ld a, %00_01_10_00
|
|
ld [rOBP0], a
|
|
ld a, %10_01_00_00
|
|
ld [rOBP1], a
|
|
|
|
ld hl, .starflare
|
|
ld de, MY_OAM
|
|
ld b, (2+1)*8
|
|
ld c, (1+1+2)*8
|
|
ld a, $54
|
|
call BuildMetaSprite
|
|
|
|
ld hl, MY_OAM + 20*4
|
|
ld [hl], (2+1)*8 + 3
|
|
inc hl
|
|
ld [hl], (1+1)*8 + 7
|
|
inc hl
|
|
ld [hl], 1
|
|
|
|
ld hl, MY_OAM + 20*4 + 1*4
|
|
ld [hl], (2+1)*8 + 7
|
|
inc hl
|
|
ld [hl], (1+1+6)*8 + 6
|
|
inc hl
|
|
ld [hl], 1
|
|
|
|
ld hl, MY_OAM + 20*4 + 2*4
|
|
ld [hl], (2+1+5)*8 + 2
|
|
inc hl
|
|
ld [hl], (1+1+2)*8 + 5
|
|
inc hl
|
|
ld [hl], 2
|
|
|
|
ld hl, MY_OAM + 20*4 + 3*4
|
|
ld [hl], (2+1+6)*8 + 2
|
|
inc hl
|
|
ld [hl], (1+1+5)*8 + 4
|
|
inc hl
|
|
ld [hl], 2
|
|
|
|
ret
|
|
.fUpdate:
|
|
ld hl, CVS
|
|
call IncrementTimer
|
|
|
|
ld a, [CVS+1] ; checking the high byte of the timer
|
|
cp a, $04 ; $10 = 1 second, $02 = 1/8 of a second
|
|
jp c, :+
|
|
|
|
ld a, 0
|
|
ld [CVS], a
|
|
ld [CVS+1], a
|
|
|
|
ld b, 4
|
|
ld a, [CVS+2]
|
|
inc a
|
|
call ArrayClampLoopingB
|
|
ld [CVS+2], a
|
|
:
|
|
|
|
ld hl, CVS+3
|
|
call IncrementTimer
|
|
|
|
ld a, [CVS+3+1] ; checking the high byte of the timer
|
|
cp a, $02 ; $10 = 1 second, $02 = 1/8 of a second
|
|
jp c, :+
|
|
|
|
ld a, 0
|
|
ld [CVS+3], a
|
|
ld [CVS+3+1], a
|
|
|
|
ld b, 12
|
|
ld a, [CVS+5]
|
|
inc a
|
|
call ArrayClampLoopingB
|
|
ld [CVS+5], a
|
|
:
|
|
call .flicker
|
|
ret
|
|
|
|
.flicker:
|
|
|
|
ret
|
|
.fDraw:
|
|
ld a, [CVS+2]
|
|
cp a, 0
|
|
jp z, .frame0
|
|
cp a, 1
|
|
jp z, .frame1
|
|
cp a, 2
|
|
jp z, .frame2
|
|
cp a, 3
|
|
jp z, .frame3
|
|
|
|
.frame0
|
|
ld a, %00_00_00_00
|
|
ld [rOBP0], a
|
|
ret
|
|
.frame1
|
|
ld a, %00_00_01_00
|
|
ld [rOBP0], a
|
|
ret
|
|
.frame2
|
|
ld a, %00_01_10_00
|
|
ld [rOBP0], a
|
|
ret
|
|
.frame3
|
|
ld a, %00_00_01_00
|
|
ld [rOBP0], a
|
|
ret
|
|
|
|
.starflare
|
|
db $09, $0a, $0b, $0c
|
|
db $07, $08, $0d, $04
|
|
db $05, $06, $0e, $0f
|
|
db $00, $13, $10, $00
|
|
db $00, $12, $11, $00
|
|
|
|
.SpriteTiles:
|
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$20,$00,$50,$20,$88,$00,$50,$00,$20,$00,$00,$00,$00,$00,$00
|
|
db $00,$00,$00,$20,$20,$50,$00,$20,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$00,$00,$00,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$00,$00,$00,$00,$00,$f0,$00,$0c,$f0,$f0,$00,$00,$00,$00,$00
|
|
db $00,$00,$00,$00,$01,$00,$01,$00,$03,$00,$03,$00,$07,$00,$00,$00
|
|
db $80,$7e,$80,$7f,$80,$7f,$3a,$c1,$62,$81,$c2,$01,$82,$01,$02,$01
|
|
db $00,$00,$00,$00,$01,$00,$0f,$00,$38,$07,$0f,$00,$01,$00,$00,$00
|
|
db $80,$7f,$00,$fe,$00,$f8,$00,$f0,$00,$f0,$00,$f0,$80,$70,$00,$78
|
|
db $00,$00,$00,$00,$00,$00,$06,$00,$03,$00,$03,$00,$01,$00,$01,$00
|
|
db $01,$00,$01,$00,$01,$00,$03,$00,$c2,$01,$62,$81,$32,$c1,$98,$67
|
|
db $80,$00,$80,$00,$80,$00,$80,$00,$c3,$00,$4f,$80,$59,$86,$23,$dc
|
|
db $00,$00,$00,$00,$00,$00,$c0,$00,$80,$00,$80,$00,$00,$00,$00,$00
|
|
db $02,$fc,$00,$7e,$01,$1e,$01,$0e,$00,$0f,$01,$0e,$03,$0c,$00,$1c
|
|
db $04,$78,$06,$f8,$02,$fc,$03,$fc,$59,$86,$4d,$82,$47,$80,$41,$80
|
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$00,$80,$00,$c0,$00
|
|
db $40,$80,$40,$80,$40,$80,$40,$80,$40,$80,$c0,$00,$80,$00,$80,$00
|
|
db $80,$00,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $01,$00,$01,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $02,$01,$02,$01,$02,$01,$02,$01,$03,$00,$01,$00,$01,$00,$01,$00
|
|
.SpriteTilesEnd:
|
|
; original export script by gabriel reis, modified by shoofle
|
|
|
|
|
|
.KeyArtTiles:
|
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$ff,$22,$ff,$ff,$ff,$ff,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
|
|
db $7f,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$77,$ff,$ff,$ff,$fd,$ff,$ff,$ff
|
|
db $77,$ff,$ff,$ff,$dd,$ff,$ff,$ff,$77,$ff,$ff,$ff,$dd,$ff,$ff,$ff
|
|
db $55,$ff,$ff,$ff,$5d,$ff,$ff,$ff,$55,$ff,$ff,$ff,$d5,$ff,$ff,$ff
|
|
db $55,$ff,$bf,$ff,$55,$ff,$ff,$ff,$55,$ff,$fb,$ff,$55,$ff,$ff,$ff
|
|
db $55,$ff,$bb,$ff,$55,$ff,$ee,$ff,$55,$ff,$bb,$ff,$55,$ff,$ee,$ff
|
|
db $55,$ff,$ab,$ff,$55,$ff,$ee,$ff,$55,$ff,$aa,$ff,$55,$ff,$ea,$ff
|
|
db $55,$ff,$aa,$ff,$55,$ff,$aa,$ff,$55,$ff,$aa,$ff,$55,$ff,$aa,$ff
|
|
db $11,$ff,$aa,$ff,$55,$ff,$aa,$ff,$11,$ff,$aa,$ff,$54,$ff,$aa,$ff
|
|
db $11,$ff,$aa,$ff,$44,$ff,$aa,$ff,$10,$ff,$aa,$ff,$44,$ff,$aa,$ff
|
|
db $00,$ff,$aa,$ff,$04,$ff,$aa,$ff,$00,$ff,$aa,$ff,$00,$ff,$aa,$ff
|
|
db $00,$ff,$2a,$ff,$00,$ff,$aa,$ff,$00,$ff,$22,$ff,$00,$ff,$aa,$ff
|
|
db $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$3c,$3c,$30,$30,$20,$20,$00,$00
|
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$80,$80
|
|
db $01,$01,$01,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$03,$03
|
|
db $77,$ff,$ff,$ff,$dc,$fe,$fe,$fe,$74,$fc,$fc,$fc,$d8,$f8,$ff,$ff
|
|
db $00,$00,$00,$00,$00,$00,$04,$04,$14,$1c,$3c,$3c,$5c,$7c,$fc,$fc
|
|
db $ff,$ff,$ff,$ff,$ff,$ff,$f9,$f9,$fc,$fc,$fc,$fc,$fe,$fe,$fe,$fe
|
|
db $fe,$fe,$fe,$fe,$fe,$fe,$fc,$fc,$3c,$3c,$1c,$1c,$0c,$0c,$00,$00
|
|
db $03,$03,$01,$01,$01,$01,$00,$00,$20,$20,$30,$30,$18,$38,$3e,$3e
|
|
db $77,$ff,$ff,$ff,$dd,$ff,$ff,$ff,$77,$ff,$7f,$7f,$5d,$7f,$3f,$3f
|
|
db $7f,$ff,$ff,$ff,$fe,$fe,$f0,$f0,$40,$c0,$f0,$f0,$fe,$fe,$ff,$ff
|
|
db $7f,$ff,$ff,$ff,$ff,$ff,$0f,$0f,$03,$03,$0f,$0f,$fd,$ff,$ff,$ff
|
|
db $54,$fc,$fc,$fc,$5c,$fc,$fc,$fc,$54,$fc,$fe,$fe,$d4,$fe,$fe,$fe
|
|
db $15,$3f,$3f,$3f,$1d,$3f,$3f,$3f,$15,$3f,$3f,$3f,$55,$7f,$7f,$7f
|
|
db $55,$7f,$3f,$7f,$55,$ff,$ff,$ff,$55,$ff,$fb,$ff,$55,$ff,$ff,$ff
|
|
db $00,$ff,$23,$ff,$3f,$ff,$ff,$ff,$f8,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $3f,$ff,$ff,$ff,$fc,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $fe,$ff,$ff,$ff,$ff,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $00,$ff,$ff,$ff,$ff,$ff,$3f,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01,$00,$03
|
|
db $00,$00,$00,$00,$00,$00,$c0,$c0,$00,$80,$00,$c0,$00,$e0,$00,$f0
|
|
db $00,$03,$00,$03,$00,$03,$00,$03,$00,$03,$00,$03,$00,$03,$00,$03
|
|
db $00,$f0,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$00,$f0,$00,$e0
|
|
db $00,$03,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$c0,$00,$80,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
|
|
db $00,$ff,$ff,$ff,$ff,$ff,$c0,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $00,$ff,$ff,$ff,$ff,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
|
|
db $00,$ff,$00,$e0,$00,$f9,$00,$f9,$00,$fd,$00,$fc,$00,$fe,$00,$fe
|
|
db $00,$ff,$00,$00,$00,$f2,$00,$f6,$00,$f6,$00,$f6,$00,$66,$00,$66
|
|
db $00,$ff,$00,$03,$00,$4f,$00,$4f,$00,$4f,$00,$4f,$00,$4f,$00,$4f
|
|
db $00,$ff,$00,$fe,$00,$fe,$00,$fc,$00,$f9,$00,$f9,$00,$e0,$00,$ff
|
|
db $00,$7e,$00,$3f,$00,$bf,$00,$9f,$00,$cf,$00,$cf,$00,$00,$00,$ff
|
|
db $00,$ff,$00,$00,$00,$cc,$00,$ce,$00,$de,$00,$9e,$00,$be,$00,$3e
|
|
db $00,$66,$00,$6e,$00,$0e,$00,$0e,$00,$9e,$00,$9e,$00,$00,$00,$ff
|
|
db $00,$4f,$00,$4f,$00,$4f,$00,$4f,$00,$4f,$00,$4f,$00,$03,$00,$ff
|
|
db $54,$fe,$be,$fe,$54,$fe,$ff,$ff,$55,$ff,$fb,$ff,$55,$ff,$ff,$ff
|
|
db $ff,$ff,$ff,$ff,$ff,$ff,$3f,$3f,$7f,$7f,$7f,$7f,$ff,$ff,$ff,$ff
|
|
.KeyArtTilesEnd:
|
|
|
|
.BackgroundCopy: ; tiles start at 26
|
|
db $1c, $1c, $2e, $2f, $29, $4c, $1c, $1c
|
|
db $1d, $1d, $32, $2a, $2b, $33, $1d, $1d
|
|
db $1e, $1e, $2c, $2d, $30, $31, $1e, $1e
|
|
db $1f, $1f, $1f, $34, $35, $1f, $1f, $1f
|
|
db $20, $20, $20, $4b, $36, $20, $20, $20
|
|
db $21, $21, $21, $21, $21, $21, $21, $21
|
|
db $22, $22, $22, $22, $22, $22, $22, $22
|
|
db $23, $23, $23, $23, $23, $23, $23, $23
|
|
db $24, $24, $24, $24, $24, $24, $24, $24
|
|
db $25, $25, $25, $25, $25, $25, $25, $25
|
|
db $26, $26, $26, $26, $26, $26, $26, $26
|
|
db $27, $27, $27, $27, $27, $27, $27, $27
|
|
db $37, $41, $42, $38, $39, $42, $3a, $1b
|
|
db $28, $28, $28, $28, $28, $28, $28, $28
|
|
db $28, $28, $43, $48, $44, $45, $28, $28
|
|
db $28, $28, $46, $47, $49, $4a, $28, $28
|
|
.BackgroundCopyEnd:
|