gbufToLCD_old.z80 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. ;===============================================================
  2. GraphToLCD:
  3. ;===============================================================
  4. ld hl,(BufPtr)
  5. ld ix,(GrayBufPtr)
  6. ;===============================================================
  7. BufferToLCD:
  8. ;===============================================================
  9. ;Input:
  10. ; HL points to the buffer to copy to the LCD
  11. ;Outputs:
  12. ;
  13. ;===============================================================
  14. di
  15. LCDDelay()
  16. ld a,$80
  17. out (16),a
  18. exx
  19. ld hl,(GrayMask)
  20. add hl,hl
  21. jr nc,$+4
  22. set 4,l
  23. ld (GrayMask),hl
  24. ld bc,(textmode)
  25. ld a,3
  26. and c
  27. ld c,a
  28. exx
  29. ld de,12
  30. LCDDelay()
  31. ld a,$20
  32. col:
  33. push af
  34. pop af
  35. out (10h),a
  36. push af
  37. ld b,64
  38. row:
  39. ;(checker AND gray) OR black
  40. ;
  41. exx
  42. add hl,hl
  43. jr nc,$+4
  44. set 4,l
  45. ld a,h
  46. exx
  47. ld c,a
  48. ld a,(ix)
  49. xor (hl)
  50. and c
  51. xor (hl)
  52. add hl,de
  53. add ix,de
  54. bit InvertLCDFlag,(iy+UserFlags)
  55. jr z,$+3
  56. cpl
  57. ex af,af'
  58. LCDDelay()
  59. ex af,af'
  60. out ($11),a
  61. exx
  62. ld b,c
  63. inc b
  64. dec b
  65. jr z,RotateDone
  66. RotateMask:
  67. add hl,hl
  68. jr nc,$+4
  69. set 4,l
  70. ld a,h
  71. djnz RotateMask
  72. RotateDone:
  73. exx
  74. djnz row
  75. pop af
  76. inc a
  77. dec h
  78. dec h
  79. dec h
  80. inc hl
  81. dec ixh
  82. dec ixh
  83. dec ixh
  84. inc ix
  85. cp $2c
  86. jp nz,col
  87. ret