menu: fade in screen on cold boot

This commit is contained in:
Maximilian Rehkopf 2012-07-03 16:14:39 +02:00
parent 14a2136be7
commit 5eae77f626
3 changed files with 40 additions and 2 deletions

View File

@ -184,6 +184,11 @@ direntry_xscroll
direntry_xscroll_wait
.word 0
infloop .byt 0,0 ; to be filled w/ 80 FE
tgt_bright
.byt 0
cur_bright
.byt 0
;------------------------
saved_sp
.word 0

View File

@ -29,8 +29,12 @@ GAME_MAIN:
sta $420d ; fast cpu
jsr setup_gfx
jsr colortest
jsr setup_hdma
jsr tests
jsr setup_hdma
lda #$0f
sta cur_bright
sta tgt_bright
sta $2100
jmp @set_bank ; Set bios bank, just to be sure
set_bank:
@ -277,6 +281,14 @@ tests:
sta $2100 ;screen on, full brightness
lda #9
sta bar_yl
stz cur_bright
stz tgt_bright
rts
screen_on:
stz $2100 ;screen on, 0% brightness
lda #$0f
sta tgt_bright
rts
snes_init:
@ -387,7 +399,7 @@ snes_init:
fadeloop:
sep #$30 : .as : .xs
ldx #$0f
ldx cur_bright
and #$00
pha
plb

View File

@ -87,6 +87,27 @@ math_cont
lda #$3e ; ch. 1-5
sta @$420c ; trigger HDMA
lda #$01
lda cur_bright
cmp tgt_bright
beq +
bpl bright_down
bright_up
inc
sta cur_bright
lda $2100
and #$f0
ora cur_bright
sta $2100
bra +
bright_down
dec
sta cur_bright
lda $2100
and #$f0
ora cur_bright
sta $2100
+ lda #$01
sta isr_done
rtl