home *** CD-ROM | disk | FTP | other *** search
/ ticalc.org / ticalc_org_rev_b.iso / archives / 82 / asm / source / crash / scrtest.asm < prev    next >
Encoding:
Assembly Source File  |  2001-07-01  |  1.7 KB  |  62 lines

  1. ;────────────────────────────────────────────────────────────────────────────
  2. ;                    Scrolling Routines by CrASH_Man                02/14/98
  3. ;────────────────────────────────────────────────────────────────────────────
  4. ;
  5. ;   This is some example source for CrASH v1.3 to test the scrolling
  6. ; routines inside SCROLL.ASM.
  7. ;
  8. ;   Hit keys and the screen will scroll up, down, left, then right.
  9. ;
  10. ;                                                               by CrASH_Man
  11.  
  12. .INCLUDE CrASH82.INC
  13. .DB "Scroll Test", 0
  14.  
  15.   CALL MakeScreen
  16.   LD  B, 64                     ; Scroll vertically 64 times
  17. ULoop:
  18.   CALL Scroll_U                 ; Scroll up
  19.   CALL CR_GRBCopy
  20.   DJNZ ULoop
  21.   CALL MakeScreen
  22.   LD  B, 64
  23. DLoop:
  24.   CALL Scroll_D                 ; Scroll down
  25.   CALL CR_GRBCopy
  26.   DJNZ DLoop
  27.   CALL MakeScreen
  28.   LD  B, 96
  29. LLoop:
  30.   CALL Scroll_L                 ; Scroll left
  31.   CALL CR_GRBCopy
  32.   DJNZ LLoop
  33.   CALL MakeScreen
  34.   LD  B, 96
  35. RLoop:
  36.   CALL Scroll_R                 ; Scroll right
  37.   CALL CR_GRBCopy
  38.   DJNZ RLoop
  39.  
  40.   RET
  41.  
  42. MakeScreen:                     ; Fill the screen with random pixels
  43.   LD  HL, GRAPH_MEM             ; Fill GRAPH_MEM
  44.   LD  B, 0                      ; 256 times -- Each time we do 3 bytes
  45. FillLoop:
  46.   CALL RAND \ RLA               ; 8-bit number
  47.   LD  (HL), A                   ; Save it
  48.   INC HL                        ; Point to next byte in GRAPH_MEM
  49.   CALL RAND \ RLA
  50.   LD  (HL), A
  51.   INC HL
  52.   CALL RAND \ RLA
  53.   LD  (HL), A
  54.   INC HL
  55.   DJNZ FillLoop
  56.  
  57.   CALL CR_GRBCopy               ; Display
  58.   CALL CR_KHAND                 ; Wait for a key
  59.   RET
  60.  
  61. .INCLUDE SCROLL.ASM             ; These are the scrolling routines.
  62.