270 lines
		
	
	
		
			8.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			270 lines
		
	
	
		
			8.0 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
Death:
 | 
						|
  db 10, "DEATH     "
 | 
						|
  db 10, "          "
 | 
						|
  db 10, "          "
 | 
						|
  db 10, "change    "
 | 
						|
  db 10, "endings   "
 | 
						|
  db 10, "upheaval  "
 | 
						|
  
 | 
						|
  db 10, "DEATH     "
 | 
						|
  db 10, "(reversed)"
 | 
						|
  db 10, "          "
 | 
						|
  db 10, "fear      "
 | 
						|
  db 10, "dependent "
 | 
						|
  db 10, "repeating "
 | 
						|
  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 stars 
 | 
						|
  ld [hl+], a 
 | 
						|
  ld [hl+], a ; cvs+2 for starrs 2
 | 
						|
  ld [hl+], a 
 | 
						|
  ld [hl+], a ; cvs+4 for starrs 3
 | 
						|
  ld [hl+], a 
 | 
						|
  
 | 
						|
  ld a, %11000100
 | 
						|
  ld [rOBP0], a
 | 
						|
  call AdjustOBP0
 | 
						|
  
 | 
						|
  ld hl, MY_OAM
 | 
						|
  ld [hl], 24+8
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+8
 | 
						|
  inc hl
 | 
						|
  ld [hl], 1
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*1
 | 
						|
  ld [hl], 24+16
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+32
 | 
						|
  inc hl
 | 
						|
  ld [hl], 2
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*2
 | 
						|
  ld [hl], 24+2
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+57
 | 
						|
  inc hl
 | 
						|
  ld [hl], 2
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*3
 | 
						|
  ld [hl], 24+0
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+40
 | 
						|
  inc hl
 | 
						|
  ld [hl], 3
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*4
 | 
						|
  ld [hl], 24-2
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+20
 | 
						|
  inc hl
 | 
						|
  ld [hl], 3
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*5
 | 
						|
  ld [hl], 24+24
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+60
 | 
						|
  inc hl
 | 
						|
  ld [hl], 3
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+4*6
 | 
						|
  ld [hl], 24+20
 | 
						|
  inc hl 
 | 
						|
  ld [hl], 16+5
 | 
						|
  inc hl
 | 
						|
  ld [hl], 3
 | 
						|
  ret
 | 
						|
.fUpdate: 
 | 
						|
  ld hl, CVS
 | 
						|
  call IncrementTimer
 | 
						|
  
 | 
						|
  ld a, [CVS+1] ; checking the high byte of the timer
 | 
						|
  cp a, $05 ; $10 = 1 second, $02 = 1/8 of a second
 | 
						|
  jp c, :+ ; if the timer is less than $0600, skip 
 | 
						|
  
 | 
						|
  ; if the timer is greater or equal to $0600, reset it 
 | 
						|
  ld a, 0 
 | 
						|
  ld [CVS], a 
 | 
						|
  ld [CVS+1], a 
 | 
						|
  
 | 
						|
  call .blink
 | 
						|
:
 | 
						|
 | 
						|
  ld hl, CVS+2
 | 
						|
  call IncrementTimer
 | 
						|
  
 | 
						|
  ld a, [CVS+2+1] ; checking the high byte of the timer
 | 
						|
  cp a, $03 ; $10 = 1 second, $02 = 1/8 of a second
 | 
						|
  jp c, :+ ; if the timer is less than $0600, skip 
 | 
						|
  
 | 
						|
  ; if the timer is greater or equal to $0600, reset it 
 | 
						|
  ld a, 0 
 | 
						|
  ld [CVS+2], a 
 | 
						|
  ld [CVS+2+1], a 
 | 
						|
  
 | 
						|
  call .blink2
 | 
						|
:
 | 
						|
 | 
						|
  ld hl, CVS+4
 | 
						|
  call IncrementTimer
 | 
						|
  
 | 
						|
  ld a, [CVS+4+1] ; checking the high byte of the timer
 | 
						|
  cp a, $04 ; $10 = 1 second, $02 = 1/8 of a second
 | 
						|
  jp c, :+ ; if the timer is less than $0600, skip 
 | 
						|
  
 | 
						|
  ; if the timer is greater or equal to $0600, reset it 
 | 
						|
  ld a, 0 
 | 
						|
  ld [CVS+4], a 
 | 
						|
  ld [CVS+4+1], a 
 | 
						|
  
 | 
						|
  call .blink3
 | 
						|
:
 | 
						|
  ret
 | 
						|
.fDraw: ret
 | 
						|
.fPrintPrep: ret
 | 
						|
 | 
						|
.blink:
 | 
						|
  ld a, 2
 | 
						|
 | 
						|
  ld hl, MY_OAM+2
 | 
						|
  cp a, [hl]
 | 
						|
  jp z, :+
 | 
						|
  jp nz, :++
 | 
						|
: dec [hl]
 | 
						|
  jp :++
 | 
						|
: inc [hl]
 | 
						|
:
 | 
						|
  ret
 | 
						|
 
 | 
						|
.blink2:
 | 
						|
  ld a, 2
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+(4*1)+2
 | 
						|
  cp a, [hl]
 | 
						|
  jp z, :+
 | 
						|
  jp nz, :++
 | 
						|
: inc [hl]
 | 
						|
  jp :++
 | 
						|
: dec [hl]
 | 
						|
:
 | 
						|
  ret
 | 
						|
  
 | 
						|
.blink3:
 | 
						|
  ld a, 2
 | 
						|
  
 | 
						|
  ld hl, MY_OAM+(4*2)+2
 | 
						|
  cp a, [hl]
 | 
						|
  jp z, :+
 | 
						|
  jp nz, :++
 | 
						|
: inc [hl]
 | 
						|
  jp :++
 | 
						|
: dec [hl]
 | 
						|
:
 | 
						|
  ret
 | 
						|
.SpriteTiles:
 | 
						|
  db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
 | 
						|
	db $20,$00,$50,$00,$88,$20,$50,$00,$20,$00,$00,$00,$00,$00,$00,$00
 | 
						|
	db $00,$00,$20,$00,$50,$00,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00
 | 
						|
	db $00,$00,$00,$00,$00,$20,$00,$00,$00,$00,$00,$00,$00,$00,$00,$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 $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $ff,$ff,$ff,$ff,$fc,$fc,$fb,$f8,$f6,$f0,$ec,$e0,$d9,$c0,$93,$80
 | 
						|
	db $e7,$ef,$00,$08,$40,$0c,$13,$04,$73,$04,$f1,$06,$f9,$02,$f8,$03
 | 
						|
	db $bf,$80,$7f,$00,$0f,$00,$e7,$00,$f3,$00,$f9,$00,$fc,$00,$fe,$00
 | 
						|
	db $fb,$03,$fd,$01,$fd,$01,$fd,$01,$fd,$01,$fd,$01,$01,$01,$7f,$7f
 | 
						|
	db $b7,$80,$27,$00,$6f,$00,$4f,$00,$5f,$00,$5f,$00,$5f,$00,$5f,$00
 | 
						|
	db $7f,$7f,$3f,$3f,$bf,$3f,$9f,$1f,$df,$1f,$df,$1f,$df,$1f,$df,$1f
 | 
						|
	db $df,$1f,$df,$1f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f
 | 
						|
	db $ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f,$ef,$0f
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$c7,$ff,$c7,$df,$c7,$df
 | 
						|
	db $ff,$00,$ff,$00,$7f,$80,$7f,$80,$7f,$80,$3f,$c0,$3f,$40,$1f,$60
 | 
						|
	db $9f,$20,$9f,$20,$8f,$30,$cf,$10,$c7,$18,$c7,$18,$e7,$08,$63,$0c
 | 
						|
	db $f3,$04,$f3,$04,$31,$06,$f9,$02,$f8,$03,$f8,$03,$fc,$01,$fc,$01
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0,$f0,$ef,$e0
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$1f,$1f,$ef,$0f
 | 
						|
	db $df,$c0,$df,$c0,$df,$c0,$bf,$80,$bc,$80,$bf,$80,$be,$80,$bf,$80
 | 
						|
	db $f7,$07,$f7,$07,$f7,$07,$fb,$03,$7b,$03,$fb,$03,$fb,$03,$fb,$03
 | 
						|
	db $00,$00,$ff,$ff,$ff,$ff,$fe,$fe,$f8,$f8,$f3,$f0,$f7,$f0,$e7,$e0
 | 
						|
	db $7e,$01,$83,$80,$f8,$f8,$0e,$0e,$07,$07,$e3,$03,$f3,$03,$f1,$01
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f0,$ff,$0f,$f0,$f0,$00
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$01,$ff,$fe,$01,$03,$00
 | 
						|
	db $ff,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$f8,$f8,$f3,$f0
 | 
						|
	db $00,$00,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $1f,$ff,$c3,$3f,$7c,$03,$07,$00,$00,$00,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $c0,$00,$07,$07,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$0f,$0f,$e7,$07
 | 
						|
	db $ef,$e0,$ef,$e0,$ef,$e0,$ef,$e0,$ef,$e0,$ef,$e0,$ef,$e0,$e0,$e0
 | 
						|
	db $f7,$07,$f3,$03,$fb,$03,$fb,$03,$fb,$03,$fb,$03,$fb,$03,$03,$03
 | 
						|
	db $fc,$01,$fc,$01,$fc,$01,$fe,$00,$fe,$00,$fe,$00,$c3,$00,$ff,$00
 | 
						|
	db $df,$c0,$d8,$c0,$df,$c0,$d8,$c0,$df,$c0,$df,$c0,$d8,$c0,$df,$c0
 | 
						|
	db $5f,$00,$5f,$00,$5e,$00,$2f,$00,$af,$80,$af,$80,$af,$80,$af,$80
 | 
						|
	db $ff,$00,$ff,$00,$00,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$f0,$00
 | 
						|
	db $ff,$00,$ff,$00,$f8,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$fc,$fc,$fb,$f8,$f7,$f0,$ef,$e0,$ef,$e0
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$07,$07,$f3,$03,$f9,$01,$fc,$00,$fc,$00
 | 
						|
	db $fc,$00,$0c,$00,$fc,$00,$1c,$00,$fc,$00,$fc,$00,$7c,$00,$fc,$00
 | 
						|
	db $bf,$80,$b1,$80,$bf,$80,$bf,$80,$b0,$80,$bf,$80,$bf,$80,$bf,$80
 | 
						|
	db $f9,$01,$f9,$01,$f9,$01,$f9,$01,$79,$01,$f9,$01,$f9,$01,$f9,$01
 | 
						|
	db $af,$80,$af,$80,$af,$80,$af,$80,$af,$80,$af,$80,$af,$80,$af,$80
 | 
						|
	db $f7,$f0,$c7,$c0,$cf,$c0,$cf,$c0,$cf,$c0,$cf,$c0,$cf,$c0,$e0,$e0
 | 
						|
	db $f9,$01,$f9,$01,$f9,$01,$f9,$01,$f9,$01,$f9,$01,$f9,$01,$03,$03
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$3f,$ff,$c0,$3f
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$ff,$7f,$80
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$ff
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$00,$ff,$ff,$00
 | 
						|
	db $ff,$ff,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $ff,$ff,$00,$00,$db,$92,$db,$92,$db,$92,$db,$92,$db,$92,$db,$92
 | 
						|
	db $ff,$ff,$3f,$3f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f
 | 
						|
	db $7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$7f,$3f,$3f,$ff,$ff
 | 
						|
	db $ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$fe,$fe,$ff,$ff
 | 
						|
	db $db,$92,$db,$92,$db,$92,$db,$92,$db,$92,$db,$92,$00,$00,$ff,$ff
 | 
						|
	db $ff,$ff,$00,$00,$7d,$39,$39,$39,$bb,$93,$93,$93,$d7,$c7,$e7,$c7
 | 
						|
	db $cf,$c7,$d7,$c7,$93,$93,$bb,$93,$39,$39,$7d,$39,$00,$00,$ff,$ff
 | 
						|
	db $f0,$ff,$f0,$fb,$f8,$f9,$fe,$fe,$ff,$ff,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $ff,$ff,$00,$ff,$00,$55,$00,$15,$80,$80,$fc,$fc,$ff,$ff,$ff,$ff
 | 
						|
	db $f0,$ff,$00,$fd,$00,$55,$00,$54,$00,$00,$01,$01,$ff,$ff,$ff,$ff
 | 
						|
	db $af,$80,$af,$80,$af,$80,$97,$80,$d7,$c0,$d7,$c0,$c0,$c0,$ff,$ff
 | 
						|
	db $ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$ff,$00,$00,$00,$ff,$ff
 | 
						|
	db $fe,$00,$fe,$00,$fe,$00,$ff,$00,$ff,$00,$ff,$00,$00,$00,$fc,$ff
 | 
						|
	db $6f,$8f,$6f,$8f,$37,$c7,$37,$47,$37,$47,$17,$67,$07,$37,$0f,$ff
 | 
						|
	db $0f,$df,$07,$57,$07,$47,$07,$07,$7f,$7f,$ff,$ff,$ff,$ff,$ff,$ff
 | 
						|
	db $7f,$00,$7f,$00,$7f,$00,$7f,$00,$39,$46,$3b,$44,$00,$64,$db,$ff
 | 
						|
	db $f3,$03,$f3,$03,$13,$a3,$13,$e3,$b3,$43,$33,$c3,$07,$47,$3f,$ff
 | 
						|
.KeyArtTilesEnd:
 | 
						|
 | 
						|
.BackgroundCopy: ; tiles start at 26
 | 
						|
		db $1b, $1b, $1b, $1b, $1b, $1b, $1b, $1b
 | 
						|
	db $1b, $1b, $1b, $1b, $1b, $1b, $1b, $1b
 | 
						|
	db $1b, $1b, $1b, $1b, $1b, $1b, $1b, $1b
 | 
						|
	db $45, $44, $2e, $2f, $46, $46, $43, $1b
 | 
						|
	db $30, $33, $31, $31, $31, $2c, $2d, $32
 | 
						|
	db $41, $35, $1b, $1b, $1b, $34, $42, $1b
 | 
						|
	db $1b, $1b, $28, $29, $1b, $1b, $1b, $1b
 | 
						|
	db $1b, $24, $2a, $2b, $1b, $1b, $3b, $3c
 | 
						|
	db $1c, $1d, $1e, $1f, $1b, $1b, $37, $3d
 | 
						|
	db $20, $36, $25, $21, $1b, $1b, $3e, $3f
 | 
						|
	db $38, $39, $26, $22, $1b, $1b, $57, $58
 | 
						|
	db $40, $3a, $27, $23, $1b, $1b, $1b, $1b
 | 
						|
	db $52, $53, $54, $55, $1b, $1b, $1b, $1b
 | 
						|
	db $4f, $50, $51, $56, $1b, $1b, $1b, $1b
 | 
						|
	db $1b, $1b, $47, $4d, $48, $49, $1b, $1b
 | 
						|
	db $1b, $1b, $4b, $4e, $4c, $4a, $1b, $1b
 | 
						|
 | 
						|
.BackgroundCopyEnd:
 |