A85: Fade to white


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

A85: Fade to white




I don't know if I'm going to add this to my game, but I wrote a fade to
white routine since I've never seen this effect in a game.  I can't get
it to work and I have no idea why.  You're supposed to press a key to
start the fade out process, then when it is done fading, you are supposed
to press a key again.  The second pause works, but the first doesn't. 
Here's the code:

#include "usgard.h"

   .org  0
   .db   "Fading effects "
   .db   "by Erik Gillespie", 0

start:
   call  CLEARLCD
   sub   a
   ld    (CURSOR_ROW), a
   ld    (CURSOR_COL), a
   ld    hl, &T_FadeOut
   call  D_ZT_STR
   call  GetCh
   call  FadeToWhite
   sub   a
   ld    (CURSOR_ROW), a
   ld    (CURSOR_COL), a
   ld    hl, &T_DoneFading
   call  D_ZT_STR

GetCh:
   call  GET_KEY
   or    a
   jr    z, GetCh
   ret

FadeToWhite:
   ld    a, (CONTRAST)
   push  af
   ld    bc, 200            ; Wait 4/25 of a second before fading any
more
FTWLoop:
   dec   a
   ld    (CONTRAST), a
   #fncall  DELAY
   cp    0
   jr    nz, FTWLoop
   pop   af
   call  CLEARLCD
   ld    (CONTRAST), a
   ret

T_FadeOut:
   .db   "Fading to white", 0
T_DoneFading:
   .db   "Done fading", 0

.end



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]


Follow-Ups: