Re: A86: contrast


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

Re: A86: contrast




In a message dated Wed, 29 Sep 1999  9:04:12 PM Eastern Daylight Time, "Andrew T" <ironman_294@hotmail.com> writes:

> 
> hmmmm I made a little contrast program but i am haveing some problems could 
> some one tell me two things, first im getting trash in my out put second you 
> cant hold down a key you have to keep on pushing it.
> BUT...i am happy to say that it does make the contrast go up or down
> 
> .org _asm_exec_ram
> 
> ProgStart:
> ld bc,$0000
> ld (_penCol),bc
> ld hl,msg
> call _vputs
> ld bc,$0100
> ld (_penCol),bc
> ld a,($c008)
> ld l,a
> ld h,0
> call _vputs

This is not the way to display a number.  I would recommend using _dispAHL like this:

 ld a,($c008)
 ld l,a
 xor a
 ld h,a
 call _dispAHL

Remember: _puts is only for zero-terminated strings pointed to by hl.

> key_wait
> xor a

 ld ($c001),a    ;clear last recorded getkey scancode

> call GET_KEY
> cp K_PLUS
> jr z,inc_contrast
> cp K_MINUS
> jr z,dec_contrast
> cp K_EXIT
> ret z
> jr ProgStart
> 
> inc_contrast:
> ld a,($c008)
> cp $1f
> jp p,ProgStart
> inc a
> out (2),a
> ld ($c008),a
> jr ProgStart
> 
> dec_contrast:
> ld a,($c008)
> cp 0
> jp z,ProgStart
> dec a
> out (2),a
> ld ($c008),a
> jr ProgStart
> 
> msg:
> .db "The contrast is:",0
> 
> .end
> 
> ______________________________________________________
> Get Your Private, Free Email at http://www.hotmail.com