A85: Here's a fade to white routine for you


[Prev][Next][Index][Thread]

A85: Here's a fade to white routine for you




Well, so much for #fncall DELAY.  I made my own that I think is the same
size or maybe even a byte or two smaller but doesn't use the a register
so I didn't have to use the push and pop.  To change the length of the
fade, change the value of DE.  ($2300 is about 1 second total)  Also, I
suppose you could just take out the ld de, $xxxx and let the user do it
before they call the routine but I don't think it will change much if
someone uses it.  Also, if you want to change the duration the screen is
white, change the cp 5 line to a smaller value to allow more time in the
white.  One question, is the ld a, (CONTRAST) really necessary?  I took
them out at one time and it didn't seem to affect anything.  If you have
questions, optimizations, suggestions, e-mail me at the address below. 
Since I have this working, I might start a fade to black and fade-ins
from white and black.  Another question, if you set text to write inverse
(white on black) and call CLEARLCD, does this change the screen to all
black?

FadeToWhite:
   ld    a, (CONTRAST)
   push  af
FTWLoop:
   dec   a
   ld    (CONTRAST), a
   out   (2), a
   ld    hl, $0000
   ld    de, $1180
DelayLoop:
   dec   de
   call  CP_HL_DE
   jr    nz, DelayLoop
   cp    $05
   jr    nz, FTWLoop
   call  CLEARLCD
   pop   af
   ld    (CONTRAST), a
   out   (2), a
   ret


egillespie@juno.com

"In a prototypical world, nothing ever goes wrong." -Scott Meyers

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]