Re: A86: Re: Key Presses


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

Re: A86: Re: Key Presses




ContrastUp:
    ld hl,_contrast
    ld a,(hl)
    cp $1f
    jr z,Waitkey
    inc (hl)
    jr UpdateContrast

ContrastDown:
    ld hl,_contrast
    ld a,(hl)
    or a
    jr z,Waitkey
    dec (hl)
UpdateContrast:
    ld a,(hl)
    out (2),a
    jr Waitkey

In a message dated 12/4/99 17:38:23 Eastern Standard Time, brent@calc.org 
writes:

> I've used this before:
>  
>  up:
>   ld a,($c008)   ;load contrast into a
>   cp 31            ;see if it's top
>   jr z,getkey     ;if it is go back to the getkey loop
>   inc a             ;if it isn't, increment it
>   jr changecont ;get another key
>  down:
>   ld a,($c008)  ;"
>   cp 1             ;see if it is-
>   jr c,getkey    ;less than one, and go to getkey loop if so
>   dec a           ;else decrement it
>  changecont:
>   out (2),a       ;actually change the contrast
>  
>  the reason we check to see if it is at the top or bottom allowed, is 
because 
> it will just loop and screw your contrast until a reset



----
Jonah Cohen
<ComAsYuAre@aol.com>
http://linux.hypnotic.org/~jonah/