sprite8.s 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. .globl Sprite8
  2. .text
  3. .even
  4. Sprite8:
  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. add.w #9,%d0 | 4
  16. move.w %d4,-(%a7) | 2
  17. move.l %d3,-(%a7) | 2
  18. | d4: drawing mode.
  19. move.w 4+6(%a7),%d4 | 4
  20. subq.w #1,%d4 | 2
  21. | d3: mask used by AND and RPLC.
  22. moveq #-1,%d3 | 2
  23. clr.b %d3 | 2
  24. rol.l %d0,%d3 | 2
  25. | Jump to loop entry.
  26. bra.s .L__s8_loopentry | 2
  27. | AND.
  28. .L__s8_Am:
  29. or.l %d3,%d1 | 2
  30. and.l %d1,(%a1) | 2
  31. | Next line.
  32. .L__s8_loop:
  33. lea 30(%a1),%a1 | 4
  34. .L__s8_loopentry:
  35. | Have we finished ?
  36. subq.w #1,%d2 | 2
  37. blt.s .L__s8_rts | 2
  38. moveq #0,%d1 | 2
  39. move.b (%a0)+,%d1 | 2
  40. lsl.l %d0,%d1 | 2
  41. cmp.w #1,%d4 | 4
  42. beq.s .L__s8_Am | 2
  43. tst.w %d4 | 2
  44. blt.s .L__s8_Xm | 2
  45. beq.s .L__s8_Om | 2
  46. | RPLC.
  47. and.l %d3,(%a1) | 2
  48. | OR.
  49. .L__s8_Om:
  50. or.l %d1,(%a1) | 2
  51. bra.s .L__s8_loop | 2
  52. | XOR
  53. .L__s8_Xm:
  54. eor.l %d1,(%a1) | 2
  55. bra.s .L__s8_loop | 2
  56. | Return
  57. .L__s8_rts:
  58. move.l (%a7)+,%d3 | 2
  59. move.w (%a7)+,%d4 | 2
  60. rts | 2