sprite16.s 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. .globl Sprite16
  2. .text
  3. .even
  4. Sprite16:
  5. | Compute offset from beginning of plane.
  6. mulu.w #30,%d1 | 4
  7. adda.l %d1,%a1 | 2
  8. move.w %d0,%d1 | 2
  9. lsr.w #4,%d1 | 2
  10. add.w %d1,%d1 | 2
  11. adda.w %d1,%a1 | 2
  12. | d0: shift count.
  13. not.w %d0 | 2
  14. and.w #15,%d0 | 4
  15. addq.w #1,%d0 | 2
  16. move.l %d4,-(%a7) | 2
  17. | d3: drawing mode.
  18. subq.w #1,%d3 | 2
  19. | d4: mask used by AND and RPLC.
  20. moveq #-1,%d4 | 2
  21. clr.w %d4 | 2
  22. rol.l %d0,%d4 | 2
  23. | Jump to loop entry.
  24. bra.s .L__s16_loopentry | 2
  25. | AND.
  26. .L__s16_Am:
  27. or.l %d4,%d1 | 2
  28. and.l %d1,(%a1) | 2
  29. | Next line.
  30. .L__s16_loop:
  31. lea 30(%a1),%a1 | 4
  32. .L__s16_loopentry:
  33. | Have we finished ?
  34. subq.w #1,%d2 | 2
  35. blt.s .L__s16_rts | 2
  36. moveq #0,%d1 | 2
  37. move.w (%a0)+,%d1 | 2
  38. lsl.l %d0,%d1 | 2
  39. cmp.w #1,%d3 | 4
  40. beq.s .L__s16_Am | 2
  41. tst.w %d3 | 2
  42. blt.s .L__s16_Xm | 2
  43. beq.s .L__s16_Om | 2
  44. | RPLC.
  45. and.l %d4,(%a1) | 2
  46. | OR.
  47. .L__s16_Om:
  48. or.l %d1,(%a1) | 2
  49. bra.s .L__s16_loop | 2
  50. | XOR
  51. .L__s16_Xm:
  52. eor.l %d1,(%a1) | 2
  53. bra.s .L__s16_loop | 2
  54. | Return
  55. .L__s16_rts:
  56. addq.w #1,%d3 | 2
  57. move.l (%a7)+,%d4 | 2
  58. rts | 2