Advertisement
AnthonyCagliano

Untitled

Jan 13th, 2017
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. ld a, cRed
  2. ld hl, vram
  3. ld bc, 36*320
  4. call _MemSet
  5. ld hl, 2 \ push hl \ push hl
  6. ld hl, 2 \ push hl
  7. ld hl, 70
  8. ld ix, dieValues-1 \ ld b, 5
  9. dierender_foreach:
  10. ; we enter this loop with the sprite x and y scale, and y position pushed
  11. ; the x position is in hl, and the pointer to the die value array -1 is in ix
  12. push hl
  13. call sprite_getPointer
  14. push hl
  15. call gfx_SSprite
  16. pop hl
  17. pop hl
  18. ld a, b
  19. ld bc, 34 \ add hl, bc
  20. ld b, a
  21. djnz dierender_foreach
  22. pop hl
  23. pop hl
  24. pop hl
  25. ret
  26.  
  27. sprite_getPointer:
  28. ; in = ix pointing to byte before die value
  29. ; out = ix advanced 1, hl points to sprite
  30. inc ix \ ld a, (ix) \ inc a
  31. ld hl, DieSpritesStart-258
  32. push bc \ ld bc, 258
  33. ld b, a
  34. jumptospriteloop:
  35. add hl, bc
  36. djnz jumptospriteloop
  37. pop bc
  38. ret
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement