;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; -=- Contrast IIIc -=- ; ; ; ; (c) December 1997 ; ; ; ; by Nicolas HANNEBICQUE - < nhannebi@ireste.fr > ; ; Adapted to CrASH by Eric Piel - < Eric.Piel@etu.utc.fr > ; ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; last update by Nicolas : 19th of April 1997 (Battery Saver II) ; you can of course use this routine in your own programs, since it is ; only 106 bytes big, as long as you give me credit... ; it is not commented but it's also too simple (if you don't understand, ; do not hesitate to e-mail me !!) ; ; On December 98 : 70 bytes!! by Eric #INCLUDE "CRASH82.INC" .db "Contrast",0 key: call GET_KEY or a jr z,key ;No Key =>a is 0 ld l,0Dh ;after get_key, hl=8000h; and CURSOR_COL=$800D ld (hl),0Fh ;last colomn of the screen ld l,08h ;ld hl,CONTRAST ;CONTRAST = $8008 dec a ;YES, IT IS jr z,down rra ;cp G_ENTER ;cp l; because if it was ENTER, now a=00001000b and if it was UP, a=00000011b ret nc ;cp G_UP-1 ;jr nz,key up: ld a,(hl) ;ld a,(CONTRAST) cp $28 jr nc,update_contrast inc a jr change down: ld a,(hl) ;ld a,(CONTRAST) or a ;dec a jr z,update_contrast ;jp m,key dec a change: ld (hl),a update_contrast: ;ld a,(CONTRAST) ; courtesy of add a,$D7 ; Randy ;call DISP_DELAY ; Gluvna out (P_LCD_CON),a ; ... ;ld a,(CONTRAST) sub $A5 ;add a,50 ROM_CALL(TR_CHARPUT) jr key .end