Advertisement
Runer112

84+CSE Common window setup code

Sep 19th, 2013
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. ;Sets the LCD window bounds to the given rectangular area. Behavior is
  2. ; undefined if width=0, height=0, or any bound is offscreen.
  3. ; I: b=y, c=height, e=width, l=x/2
  4. ; O: a=y+height-1, b=0, c=height, de=width, hl=y+height-1
  5. ;FO: c=0, others=(dec l[=y+height])
  6. Draw_Common_X1:
  7. ld h,0
  8. add hl,hl
  9.  
  10. ;Sets the LCD window bounds to the given rectangular area. Behavior is
  11. ; undefined if width=0, height=0, or any bound is offscreen.
  12. ; I: b=y, c=height, e=width, hl=x
  13. ; O: a=y+height-1, b=0, c=height, de=width, hl=y+height-1
  14. ;FO: c=0, others=(dec l[=y+height])
  15. Draw_Common:
  16. ld d,0
  17.  
  18. ;Sets the LCD window bounds to the given rectangular area. Behavior is
  19. ; undefined if width=0, height=0, or any bound is offscreen.
  20. ; I: b=y, c=height, de=width, hl=x
  21. ; O: a=y+height-1, b=0, c=height, de=width, hl=y+height-1
  22. ;FO: c=0, others=(dec l[=y+height])
  23. Draw_Common_W2:
  24. ld a,$52
  25. call LCD_Out_A_HL
  26. ld a,$21
  27. call LCD_Out_A_HL
  28. add hl,de
  29. dec hl
  30. ld a,$53
  31. call LCD_Out_A_HL
  32. ld l,b
  33. ld a,$50
  34. call LCD_Out_A_L
  35. ld a,$20
  36. call LCD_Out_A_HL
  37. add hl,bc
  38. dec l
  39. ld a,$51
  40. ; jp LCD_Out_A_L
  41.  
  42.  
  43.  
  44. ;Outputs L to LCD register A
  45. ; I: a=LCD register, l=output
  46. ; O: a=output, hl=output
  47. ;FO: all=unaffected
  48. LCD_Out_A_L:
  49. ld h,0
  50.  
  51. ;Outputs HL to LCD register A
  52. ; I: a=LCD register, hl=output
  53. ; O: a=output, hl=output
  54. ;FO: all=unaffected
  55. LCD_Out_A_HL:
  56. out ($10),a
  57. out ($10),a
  58. ld a,h
  59. out ($11),a
  60. ld a,l
  61. out ($11),a
  62. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement