Advertisement
AnthonyCagliano

Untitled

Jan 10th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.73 KB | None | 0 0
  1. renderDie:
  2. ld hl,dieValues-1 \ ld b,5
  3. ld e,$01
  4. @: inc hl \ ld a,(hl)
  5. ld c,a
  6. add a,a
  7. add a,c
  8. add a,a
  9. add a,a
  10. add a,a
  11. ld hl,Sprites
  12. add a,l
  13. ld l,a
  14. jr nc,$+3
  15. inc h
  16. ld d,$40
  17. push bc
  18. call drawSprite_6_Bit
  19. pop bc
  20. inc e \ inc e \ djnz {-1@}
  21. ret
  22.  
  23. drawSprite_6_Bit:
  24. ld a,d \ add a,$79 ; Y coord into A
  25. ld b,12 ; Loop this 12 times
  26. drawSprite_outerloop:
  27. inc a \ push af
  28. out ($10),a \ call lcdwait
  29. ld a,e \ add a,$20
  30. out ($10),a \ call lcdwait ; use outi instead
  31. ld c,$11
  32. outi \ call lcdwait
  33. outi \ call lcdwait
  34. pop af
  35. djnz drawSprite_outerloop
  36. ret
  37.  
  38. Sprites:
  39. .db %11111111,%11110000
  40. .db %10000000,%00010000
  41. .db %10000000,%00010000
  42. .db %10000000,%00010000
  43. .db %10000000,%00010000
  44. .db %10000000,%00010000
  45. .db %10000000,%00010000
  46. .db %10000000,%00010000
  47. .db %10000000,%00010000
  48. .db %10000000,%00010000
  49. .db %10000000,%00010000
  50. .db %11111111,%11110000
  51. ;sprite_OneDie:
  52. .db %11111111,%11110000
  53. .db %10000000,%00010000
  54. .db %10000000,%00010000
  55. .db %10000000,%00010000
  56. .db %10000000,%00010000
  57. .db %10000110,%00010000
  58. .db %10000110,%00010000
  59. .db %10000000,%00010000
  60. .db %10000000,%00010000
  61. .db %10000000,%00010000
  62. .db %10000000,%00010000
  63. .db %11111111,%11110000
  64. ;sprite_TwoDie:
  65. .db %11111111,%11110000
  66. .db %10000000,%00010000
  67. .db %10000000,%00010000
  68. .db %10000110,%00010000
  69. .db %10000110,%00010000
  70. .db %10000000,%00010000
  71. .db %10000000,%00010000
  72. .db %10000110,%00010000
  73. .db %10000110,%00010000
  74. .db %10000000,%00010000
  75. .db %10000000,%00010000
  76. .db %11111111,%11110000
  77. ; three die
  78. .db %11111111,%11110000
  79. .db %10000000,%00010000
  80. .db %10000000,%11010000
  81. .db %10000000,%11010000
  82. .db %10000000,%00010000
  83. .db %10000110,%00010000
  84. .db %10000110,%00010000
  85. .db %10000000,%00010000
  86. .db %10110000,%00010000
  87. .db %10110000,%00010000
  88. .db %10000000,%00010000
  89. .db %11111111,%11110000
  90. ; four die
  91. .db %11111111,%11110000
  92. .db %10000000,%00010000
  93. .db %10110000,%11010000
  94. .db %10110000,%11010000
  95. .db %10000000,%00010000
  96. .db %10000000,%00010000
  97. .db %10000000,%00010000
  98. .db %10000000,%00010000
  99. .db %10110000,%11010000
  100. .db %10110000,%11010000
  101. .db %10000000,%00010000
  102. .db %11111111,%11110000
  103. ; five die
  104. .db %11111111,%11110000
  105. .db %10000000,%00010000
  106. .db %10011001,%10010000
  107. .db %10011001,%10010000
  108. .db %10000000,%00010000
  109. .db %10000110,%00010000
  110. .db %10000110,%00010000
  111. .db %10000000,%00010000
  112. .db %10011001,%10010000
  113. .db %10011001,%10010000
  114. .db %10000000,%00010000
  115. .db %11111111,%11110000
  116. ; six die
  117. .db %11111111,%11110000
  118. .db %10000000,%00010000
  119. .db %10011001,%10010000
  120. .db %10011001,%10010000
  121. .db %10000000,%00010000
  122. .db %10011001,%10010000
  123. .db %10011001,%10010000
  124. .db %10000000,%00010000
  125. .db %10011001,%10010000
  126. .db %10011001,%10010000
  127. .db %10000000,%00010000
  128. .db %11111111,%11110000
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement