home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / Ti / Magazine / Tests / DOORSOSD.ZIP / graytst.asm < prev    next >
Encoding:
Assembly Source File  |  1999-12-22  |  1.3 KB  |  52 lines

  1.     include "doorsos.h"
  2.     include "graphlib.h"
  3.     include "userlib.h"
  4.     xdef    _ti89
  5.     xdef    _ti92plus
  6.     xdef    _comment
  7.     xdef    _main
  8. _main:
  9.  
  10.     jsr    graphlib::clr_scr    ;clears the main screen (1st bitplane)
  11.     jsr    graphlib::gray4    ;switches to 4 grayshades mode
  12.     move.w    #1,graphlib::choosescreen    ;set all graphlib functions to grayscale mode
  13.  
  14.     move.l    graphlib::plane1,a1    ;adress of the 2nd bitplane
  15.     jsr    graphlib::clr_scr    ;clears the second bitplane
  16.  
  17.  
  18.     move.l    graphlib::plane0,a0    ;adress of the 1st bitplane
  19.     lea    1500(a0),a0        ;50th line
  20.     move.w    #374,d0
  21. \loop1    move.l    #$FFFFFFFF,(a0)+    ;put black over the next 50 lines
  22.     dbra    d0,\loop1
  23.  
  24.  
  25.     move.l    graphlib::plane1,a0    ;adress of the 2nd bitplane
  26.     lea    750(a0),a0        ;25th line
  27.     move.w    #374,d0
  28. \loop2    move.w    #$FFFF,(a0)+        ;put black over the next 25 lines
  29.     dbra    d0,\loop2
  30.  
  31.     move.l    graphlib::plane1,a0    ;adress of the 2nd bitplane
  32.     lea    2250(a0),a0        ;75th line
  33.     move.w    #374,d0
  34. \loop3    move.w    #$FFFF,(a0)+        ;put black over the next 25 lines
  35.     dbra    d0,\loop3
  36. ;so we get:
  37. ;25 lines : white
  38. ;25 lines : low gray
  39. ;25 lines : dark gray
  40. ;25 lines : black
  41.  
  42.     clr.w    graphlib::choosescreen    ;set all graphlib functions to Black and White mode
  43. \wait    tst.w    KEY_PRESSED_FLAG
  44.     beq    \wait
  45.     clr.w    KEY_PRESSED_FLAG
  46.     jsr    graphlib::gray2        ;restores Black and White mode
  47.     rts
  48.  
  49.  
  50. _comment   dc.b    "Gray4 test",0
  51.         end
  52.