Advertisement
Eeems

Untitled

Jun 13th, 2011
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. LCDUp:  ;shifts the LCD up by the amount in a
  2.     push bc ;
  3.     push de ;Preserve registers
  4.     push hl ;
  5.     ld b,a
  6. LCDUpLoop
  7.         push bc
  8.         ld hl,LCDBuffer+12
  9.         ld de,LCDBuffer
  10.         ld bc,756
  11.         ldir
  12.         pop bc
  13.         djnz LCDUpLoop
  14.     pop hl  ;
  15.     pop de  ;Restore registers
  16.     pop bc  ;
  17.     ret
  18. LCDDown:        ;shifts the screen down the amount of lines in a
  19.     push bc ;
  20.     push de ;Preserve registers
  21.     push hl ;
  22.     ld b,a
  23. LCDDownLoop
  24.         push bc
  25.         ld hl,LCDBuffer+767-12
  26.         ld de,LCDBuffer+767
  27.         ld bc,756
  28.         lddr
  29.         pop bc
  30.         djnz LCDDownLoop
  31.     pop hl  ;
  32.     pop de  ;Restore registers
  33.     pop bc  ;
  34.     ret
  35. LCDRight:       ;shifts the screen right the amount of lines in a
  36.     push bc ;
  37.     push de ;Preserve registers
  38.     push hl ;
  39.     ld b,a
  40. LCDRightLoop:
  41.         push bc
  42.         ld hl,LCDBuffer
  43.         ld c,64
  44. LCDRightMainLoop:
  45.         ld b,12
  46.         or a
  47. LCDRightSmallLoop:
  48.             rr (hl)
  49.             inc hl
  50.             djnz LCDRightSmallLoop
  51.         dec c
  52.         jr nz,LCDRightMainLoop
  53.         pop bc
  54.         djnz LCDRightLoop
  55.     pop hl  ;
  56.     pop de  ;Restore registers
  57.     pop bc  ;
  58.     ret
  59. LCDLeft:        ;shifts the screen left the amount of lines in a
  60.     push bc ;
  61.     push de ;Preserve registers
  62.     push hl ;
  63.     ld b,a
  64. LCDLeftLoop:
  65.         push bc
  66.         ld hl,LCDBuffer+767
  67.         ld c,64
  68. LCDLeftMainLoop:
  69.         ld b,12
  70.         or a
  71. LCDLeftSmallLoop:
  72.             rl (hl)
  73.             dec hl
  74.             djnz LCDLeftSmallLoop
  75.         dec c
  76.         jr nz,LCDLeftMainLoop
  77.         pop bc
  78.         djnz LCDLeftLoop
  79.     pop hl  ;
  80.     pop de  ;Restore registers
  81.     pop bc  ;
  82.     ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement