279 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			279 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| Strength:
 | |
|   db 10, "STRENGTH  "
 | |
|   db 10, "          "
 | |
|   db 10, "          "
 | |
|   db 10, "courage   "
 | |
|   db 10, "mercy     "
 | |
|   db 10, "grace     "
 | |
|   
 | |
|   db 10, "STRENGTH  "
 | |
|   db 10, "(reversed)"
 | |
|   db 10, "          "
 | |
|   db 10, "doubt     "
 | |
|   db 10, "cowardice "
 | |
|   db 10, "forceful  "
 | |
|   
 | |
|   dw .BackgroundCopyEnd - .BackgroundCopy
 | |
|   dw .BackgroundCopy
 | |
|   dw .KeyArtTilesEnd - .KeyArtTiles
 | |
|   dw .KeyArtTiles
 | |
|   dw .SpriteTilesEnd - .SpriteTiles
 | |
|   dw .SpriteTiles
 | |
|   dw .fInit
 | |
|   dw .fUpdate
 | |
|   dw .fDraw
 | |
|   dw .fPrintPrep
 | |
|   
 | |
| .fInit: 
 | |
|   ld hl, CVS
 | |
|   ld a, 0
 | |
|   ld [hl+], a ; CVS timer 
 | |
|   ld [hl+], a ; 
 | |
|   ld [hl+], a ; CVS + 2 frame index for clouds goin back and forth
 | |
|   ld [hl+], a ; CVS + 3 frame index for clouds goin back and forth
 | |
|   ld [hl+], a ; CVS + 4 frame index for clouds goin back and forth
 | |
|   ld [hl+], a ; CVS + 5 frame index for clouds goin back and forth
 | |
|   
 | |
|   ld a, %00_00_00_00
 | |
|   ld [rOBP0], a
 | |
|   call AdjustOBP0
 | |
|   
 | |
|   jp .drawClouds
 | |
|   ret
 | |
| .fUpdate:
 | |
|   ld hl, CVS
 | |
|   call IncrementTimer
 | |
|   
 | |
|   ld a, [CVS+1] ; checking the high byte of the timer
 | |
|   cp a, $28 ; $10 = 1 second, $02 = 1/8 of a second
 | |
|   ret c
 | |
|   
 | |
|   ; if the timer is greater or equal to $0600, reset it 
 | |
|   ld a, 0 
 | |
|   ld [CVS], a 
 | |
|   ld [CVS+1], a 
 | |
| .drawClouds
 | |
|   ld hl, .cloud1Anim
 | |
|   ld a, [CVS+2]
 | |
|   inc a
 | |
|   call ArrayClampLooping
 | |
|   ld [CVS+2], a
 | |
|   ld b, 0 
 | |
|   ld c, a 
 | |
|   inc hl 
 | |
|   add hl, bc
 | |
|   add hl, bc
 | |
|   ld b, [hl]
 | |
|   inc hl 
 | |
|   ld c, [hl]
 | |
|   ld hl, .cloud1
 | |
|   ld de, MY_OAM
 | |
|   ld a, $13
 | |
|   call BuildMetaSprite
 | |
|   
 | |
|   ld hl, .cloud2Anim
 | |
|   ld a, [CVS+3]
 | |
|   inc a
 | |
|   call ArrayClampLooping
 | |
|   ld [CVS+3], a
 | |
|   ld b, 0 
 | |
|   ld c, a 
 | |
|   inc hl 
 | |
|   add hl, bc
 | |
|   add hl, bc
 | |
|   ld b, [hl]
 | |
|   inc hl 
 | |
|   ld a, [hl]
 | |
|   add a, 5
 | |
|   ld c, a
 | |
|   ld hl, .cloud2
 | |
|   ld de, MY_OAM+3*4
 | |
|   ld a, $13
 | |
|   call BuildMetaSprite
 | |
|   
 | |
|   ld hl, .cloud3Anim
 | |
|   ld a, [CVS+4]
 | |
|   inc a
 | |
|   call ArrayClampLooping
 | |
|   ld [CVS+4], a
 | |
|   ld b, 0 
 | |
|   ld c, a 
 | |
|   inc hl 
 | |
|   add hl, bc
 | |
|   add hl, bc
 | |
|   ld b, [hl]
 | |
|   inc hl 
 | |
|   ld c, [hl]
 | |
|   ld hl, .cloud3
 | |
|   ld de, MY_OAM+6*4
 | |
|   ld a, $13
 | |
|   call BuildMetaSprite
 | |
|   
 | |
|   
 | |
|   ld hl, .cloud4Anim
 | |
|   ld a, [CVS+5]
 | |
|   inc a
 | |
|   call ArrayClampLooping
 | |
|   ld [CVS+5], a
 | |
|   ld b, 0 
 | |
|   ld c, a 
 | |
|   inc hl 
 | |
|   add hl, bc
 | |
|   add hl, bc
 | |
|   ld b, [hl]
 | |
|   inc hl 
 | |
|   ld c, [hl]
 | |
|   ld hl, .cloud4
 | |
|   ld de, MY_OAM+9*4
 | |
|   ld a, $13
 | |
|   call BuildMetaSprite
 | |
|   
 | |
|   
 | |
|   ret
 | |
| .fDraw: ret
 | |
| .fPrintPrep: ret
 | |
| 
 | |
| .cloud1
 | |
|   db $09, $05, $06
 | |
| .cloud1Anim
 | |
|   db 8, 24, 16, 24, 17, 24, 18, 24, 19, 24, 19, 24, 18, 24, 17, 24, 16, 
 | |
| 
 | |
| .cloud2
 | |
| 	db $01, $03, $02
 | |
| .cloud2Anim
 | |
|   db 6, 28, 48, 28, 49, 28, 50, 28, 50, 28, 49, 28, 48, 
 | |
| .cloud3
 | |
| 	db $04, $07, $00
 | |
| .cloud3Anim
 | |
|   db 8, 48, 64, 48, 64, 48, 65, 48, 65, 48, 66, 48, 66, 48, 65, 48, 65, 
 | |
| .cloud4
 | |
| 	db $08, $00, $00
 | |
| .cloud4Anim
 | |
|   db 6, 69, 59, 69, 59, 69, 59, 69, 60, 69, 60, 69, 60, 
 | |
| .SpriteTiles:
 | |
|   db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$7f,$7f
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$f0,$f0,$f8,$f8,$fe,$fe,$ff,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$03,$03,$3f,$3f,$ff,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ff,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$03,$03,$3f,$3f,$ff,$ff,$ff,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$e0,$e0,$f8,$f8,$ff,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$70,$70,$f8,$f8
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3c,$3c
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$30,$30,$ff,$ff
 | |
| .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 $80,$80,$00,$00,$00,$00,$00,$00,$00,$01,$03,$03,$00,$04,$00,$04
 | |
| 	db $01,$05,$08,$07,$1c,$01,$3d,$01,$75,$0d,$ec,$1c,$d0,$30,$f0,$31
 | |
| 	db $80,$83,$00,$80,$80,$fc,$90,$fe,$30,$fe,$20,$ff,$00,$ff,$00,$ff
 | |
| 	db $00,$04,$00,$08,$00,$10,$00,$30,$00,$20,$00,$60,$00,$40,$00,$40
 | |
| 	db $00,$60,$c8,$30,$ec,$10,$f4,$08,$f6,$08,$3b,$c4,$0d,$f2,$00,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$c0,$00,$70,$80
 | |
| 	db $06,$01,$0e,$01,$1c,$03,$f8,$07,$e7,$18,$8f,$70,$1f,$e0,$5f,$e0
 | |
| 	db $00,$ff,$00,$ff,$00,$fe,$00,$f0,$c0,$30,$00,$e0,$00,$80,$00,$80
 | |
| 	db $00,$e0,$00,$c0,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$3f,$00
 | |
| 	db $01,$00,$03,$00,$06,$00,$08,$04,$10,$08,$30,$00,$60,$10,$c0,$20
 | |
| 	db $5f,$a0,$0a,$f5,$00,$ff,$e0,$ff,$3f,$ff,$00,$ff,$00,$ff,$00,$ff
 | |
| 	db $ff,$00,$af,$50,$0a,$f5,$00,$ff,$9f,$ff,$f0,$ff,$00,$ff,$00,$ff
 | |
| 	db $d1,$2f,$43,$bf,$0c,$ff,$70,$ff,$80,$ff,$00,$ff,$00,$ff,$00,$ff
 | |
| 	db $c3,$fc,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
 | |
| 	db $7f,$80,$7f,$80,$00,$ff,$00,$ff,$00,$f0,$00,$e0,$00,$c0,$00,$e0
 | |
| 	db $ff,$00,$f8,$07,$00,$fe,$00,$00,$00,$00,$00,$00,$00,$00,$00,$01
 | |
| 	db $00,$c1,$00,$03,$00,$07,$00,$0f,$00,$1f,$00,$3f,$00,$7f,$00,$ff
 | |
| 	db $00,$00,$20,$00,$60,$10,$c0,$30,$90,$60,$30,$c0,$f0,$00,$f0,$00
 | |
| 	db $00,$c1,$00,$b8,$00,$60,$00,$40,$00,$c0,$00,$fe,$00,$03,$00,$01
 | |
| 	db $11,$ae,$1c,$e3,$1e,$61,$1c,$23,$00,$1e,$00,$00,$00,$00,$80,$00
 | |
| 	db $00,$c0,$00,$80,$00,$80,$00,$00,$03,$00,$07,$00,$0c,$03,$01,$0e
 | |
| 	db $00,$03,$01,$06,$03,$0c,$87,$18,$8f,$10,$8f,$30,$cf,$30,$de,$21
 | |
| 	db $40,$80,$00,$c0,$a0,$40,$90,$60,$cf,$30,$c0,$3f,$c3,$2c,$87,$68
 | |
| 	db $f8,$00,$f8,$00,$f8,$00,$f8,$00,$7c,$80,$7c,$80,$3e,$c0,$1f,$e0
 | |
| 	db $ce,$31,$ea,$15,$09,$f6,$04,$0b,$01,$0e,$00,$00,$00,$00,$00,$00
 | |
| 	db $80,$5f,$00,$f0,$38,$c0,$20,$c0,$e0,$00,$00,$00,$00,$00,$00,$00
 | |
| 	db $0f,$f0,$87,$78,$c3,$3c,$f1,$0e,$38,$07,$3c,$03,$0f,$00,$02,$01
 | |
| 	db $07,$f8,$b4,$4b,$a5,$5a,$3c,$c3,$00,$ff,$b8,$47,$80,$78,$80,$70
 | |
| 	db $00,$f3,$00,$03,$01,$02,$00,$03,$01,$02,$00,$03,$01,$02,$00,$07
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$80,$7f,$31,$fe,$78,$7f,$28,$79
 | |
| 	db $00,$e6,$00,$c6,$80,$4e,$00,$ce,$80,$5f,$00,$ff,$96,$69,$74,$8b
 | |
| 	db $16,$e9,$30,$ce,$04,$fa,$84,$7b,$b4,$4b,$a4,$5b,$bd,$42,$01,$fe
 | |
| 	db $07,$08,$01,$1e,$05,$7a,$87,$f8,$f0,$8f,$12,$ed,$b3,$4c,$80,$7f
 | |
| 	db $80,$ff,$80,$ff,$40,$fe,$43,$fb,$1f,$1f,$ff,$f1,$f9,$07,$e3,$1a
 | |
| 	db $f7,$08,$07,$f8,$ff,$ff,$00,$00,$00,$00,$00,$00,$00,$0e,$00,$7f
 | |
| 	db $fa,$07,$e3,$1e,$fe,$0d,$f0,$ff,$0c,$33,$05,$1a,$04,$1b,$00,$3f
 | |
| 	db $03,$02,$03,$02,$03,$02,$03,$03,$00,$00,$00,$00,$00,$00,$00,$00
 | |
| 	db $f3,$ff,$fc,$1f,$ff,$07,$7f,$80,$ff,$00,$ff,$06,$ff,$03,$ff,$00
 | |
| 	db $fe,$ff,$fb,$ff,$ff,$ff,$ff,$fe,$7f,$7e,$7f,$7e,$7f,$7e,$7e,$7f
 | |
| 	db $7e,$7e,$7c,$7c,$7c,$7c,$7c,$7c,$ed,$ee,$f0,$ff,$f0,$fc,$80,$86
 | |
| 	db $fc,$ff,$ff,$ff,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$1f,$ff
 | |
| 	db $ff,$00,$7d,$82,$bf,$d2,$fb,$cf,$ff,$67,$ff,$3f,$f1,$08,$00,$f0
 | |
| 	db $7d,$3f,$3e,$1f,$1f,$0f,$0f,$07,$07,$e1,$c1,$30,$f0,$08,$40,$bc
 | |
| 	db $df,$d4,$9f,$94,$9f,$94,$9f,$94,$1f,$14,$1f,$1c,$07,$06,$03,$03
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$07
 | |
| 	db $ff,$0f,$ff,$0f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$1f,$ff,$3f,$fe,$3f
 | |
| 	db $3f,$f0,$3f,$f8,$1f,$fc,$8f,$fe,$cf,$fe,$8f,$fe,$cf,$ff,$c3,$ff
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$03
 | |
| 	db $f9,$3f,$f3,$3f,$f4,$7f,$fd,$7e,$fd,$7a,$fc,$ff,$fe,$fd,$fe,$fd
 | |
| 	db $f3,$ff,$03,$ff,$ff,$ff,$ff,$fe,$ff,$0c,$fb,$0c,$ff,$88,$ff,$78
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01
 | |
| 	db $ff,$07,$fe,$0f,$f8,$0f,$e7,$1f,$fe,$3e,$e0,$70,$c0,$c0,$80,$80
 | |
| 	db $df,$70,$ff,$78,$ff,$78,$ff,$fc,$ff,$fc,$ff,$fe,$fb,$ff,$f9,$7f
 | |
| 	db $ff,$01,$ff,$03,$ff,$03,$fe,$06,$fe,$06,$fc,$0c,$fc,$0c,$f8,$08
 | |
| 	db $ff,$80,$ff,$80,$ff,$c0,$7f,$40,$ff,$c0,$7f,$c0,$7f,$c0,$7f,$c0
 | |
| 	db $f8,$10,$f0,$20,$e0,$20,$e0,$20,$e0,$40,$c0,$40,$c0,$80,$81,$00
 | |
| 	db $7f,$c0,$7f,$c0,$ff,$c0,$ff,$80,$ff,$80,$ff,$80,$ff,$80,$ff,$80
 | |
| 	db $ff,$e0,$3f,$30,$1f,$18,$0f,$0c,$0f,$0e,$07,$07,$01,$03,$80,$00
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$80,$ff,$c0
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$fc,$93,$ff,$41,$ff
 | |
| 	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$3f,$c0,$ff,$e0
 | |
| 	db $01,$00,$03,$0c,$04,$0b,$0d,$0f,$07,$07,$80,$00,$f0,$00,$ff,$00
 | |
| 	db $a3,$63,$67,$e5,$5f,$f9,$bf,$fb,$ff,$fb,$0f,$11,$07,$08,$f7,$08
 | |
| 	db $01,$1e,$01,$1e,$01,$3e,$00,$3f,$80,$7f,$38,$c7,$f8,$07,$fc,$03
 | |
| 	db $00,$07,$00,$03,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00
 | |
| 	db $80,$ff,$80,$ff,$80,$ff,$80,$bf,$80,$9f,$80,$9f,$80,$8f,$80,$87
 | |
| 	db $60,$7f,$10,$7f,$7c,$8f,$fe,$07,$fe,$03,$fd,$03,$ff,$31,$ff,$75
 | |
| 	db $b1,$4e,$a2,$5f,$b1,$49,$00,$f0,$00,$e0,$00,$00,$00,$00,$00,$00
 | |
| 	db $f0,$00,$f8,$00,$ec,$f0,$18,$1d,$07,$06,$03,$02,$03,$02,$03,$02
 | |
| 	db $57,$a8,$00,$ff,$07,$ff,$ff,$f8,$fc,$f0,$1c,$f0,$1c,$f0,$1c,$f0
 | |
| 	db $1c,$f0,$1c,$f1,$1c,$f1,$1c,$f1,$1c,$f1,$1e,$f0,$1e,$f0,$1e,$f0
 | |
| 	db $60,$ff,$30,$ff,$1e,$ff,$03,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
 | |
| 	db $1e,$f0,$17,$f8,$0f,$f8,$0b,$fc,$07,$fc,$05,$fe,$03,$fe,$03,$fe
 | |
| 	db $03,$fe,$03,$ff,$04,$ff,$1c,$fc,$f0,$f0,$00,$00,$00,$00,$00,$00
 | |
| 	db $00,$00,$00,$00,$50,$00,$fa,$00,$ff,$00,$bf,$40,$17,$e8,$c2,$fd
 | |
| 	db $00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$01,$00,$03,$00,$af,$00,$ff,$00,$fc,$03
 | |
| 	db $07,$00,$03,$00,$01,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 | |
| 	db $00,$ff,$00,$ff,$0f,$ff,$06,$ff,$06,$ff,$03,$ff,$03,$ff,$01,$ff
 | |
| 	db $00,$ff,$00,$ff,$ff,$ff,$06,$ff,$06,$ff,$0c,$ff,$0c,$ff,$98,$ff
 | |
| 	db $01,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$01,$ff,$00,$ff,$00,$ff
 | |
| 	db $98,$ff,$f0,$ff,$f0,$ff,$60,$ff,$60,$ff,$ff,$ff,$00,$ff,$00,$ff
 | |
| 	db $00,$ff,$00,$ff,$ff,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff
 | |
| 	db $66,$ff,$66,$ff,$66,$ff,$66,$ff,$66,$ff,$ff,$ff,$00,$ff,$00,$ff
 | |
| 	db $00,$ff,$00,$ff,$f0,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff
 | |
| 	db $60,$ff,$60,$ff,$60,$ff,$60,$ff,$60,$ff,$f0,$ff,$00,$ff,$00,$ff
 | |
| 	db $00,$00,$00,$00,$00,$00,$a8,$00,$fa,$00,$ff,$00,$ff,$00,$ff,$00
 | |
| 	db $00,$00,$00,$00,$00,$00,$00,$00,$a8,$00,$fa,$00,$ff,$00,$ff,$00
 | |
| .KeyArtTilesEnd:
 | |
| 
 | |
| .BackgroundCopy: ; tiles start at 26
 | |
| 	db $47, $47, $47, $47, $47, $47, $47, $47
 | |
| 	db $47, $47, $48, $57, $58, $47, $47, $47
 | |
| 	db $47, $47, $49, $43, $4a, $47, $47, $47
 | |
| 	db $47, $4b, $4c, $40, $4d, $47, $47, $47
 | |
| 	db $4e, $4f, $41, $44, $50, $47, $47, $47
 | |
| 	db $51, $1b, $42, $38, $45, $52, $47, $47
 | |
| 	db $53, $1c, $1d, $37, $39, $54, $47, $47
 | |
| 	db $59, $5a, $3c, $3b, $3a, $55, $56, $47
 | |
| 	db $61, $3d, $3e, $36, $5f, $60, $5e, $67
 | |
| 	db $62, $2d, $2e, $2f, $2c, $3f, $46, $5d
 | |
| 	db $64, $30, $31, $5b, $32, $1e, $1a, $5c
 | |
| 	db $65, $33, $34, $69, $35, $1f, $20, $1a
 | |
| 	db $66, $72, $73, $68, $21, $22, $23, $24
 | |
| 	db $63, $25, $26, $27, $28, $29, $2a, $2b
 | |
| 	db $67, $67, $6a, $6b, $6e, $70, $67, $67
 | |
| 	db $67, $67, $6c, $6d, $6f, $71, $67, $67
 | |
| .BackgroundCopyEnd:
 |