sprite32.s 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. .globl Sprite32
  2. .text
  3. .even
  4. Sprite32:
  5. movem.l %d3-%d7,-(%a7) | 4
  6. | Compute offset from beginning of plane.
  7. mulu.w #30,%d1 | 4
  8. adda.l %d1,%a1 | 2
  9. move.w %d0,%d1 | 2
  10. lsr.w #4,%d1 | 2
  11. add.w %d1,%d1 | 2
  12. adda.w %d1,%a1 | 2
  13. | d0, d5: shift counts.
  14. and.w #15,%d0 | 4
  15. moveq #16,%d5 | 2
  16. sub.w %d0,%d5 | 2
  17. | d4: drawing mode.
  18. subq.w #1,%d3 | 2
  19. | d3, d6: masks used by AND and RPLC.
  20. moveq #-1,%d4 | 2
  21. lsr.w %d0,%d4 | 2
  22. move.w %d4,%d6 | 2
  23. not.l %d4 | 2
  24. swap %d4 | 2
  25. | Jump to loop entry.
  26. bra.s .L__s32_loopentry | 2
  27. | AND.
  28. .L__s32_Am:
  29. or.l %d4,%d1 | 2
  30. or.w %d6,%d7 | 2
  31. and.l %d1,(%a1)+ | 2
  32. and.w %d7,(%a1) | 2
  33. | Next line.
  34. .L__s32_loop:
  35. lea 26(%a1),%a1 | 4
  36. .L__s32_loopentry:
  37. | Have we finished ?
  38. subq.w #1,%d2 | 2
  39. blt.s .L__s32_rts | 2
  40. move.l (%a0)+,%d1 | 2
  41. move.w %d1,%d7 | 2
  42. lsr.l %d0,%d1 | 2
  43. lsl.w %d5,%d7 | 2
  44. cmp.w #1,%d3 | 4
  45. beq.s .L__s32_Am | 2
  46. tst.w %d3 | 2
  47. blt.s .L__s32_Xm | 2
  48. beq.s .L__s32_Om | 2
  49. | RPLC.
  50. and.l %d4,(%a1) | 2
  51. and.w %d6,4(%a1) | 2
  52. | OR.
  53. .L__s32_Om:
  54. or.l %d1,(%a1)+ | 2
  55. or.w %d7,(%a1) | 2
  56. bra.s .L__s32_loop | 2
  57. | XOR
  58. .L__s32_Xm:
  59. eor.l %d1,(%a1)+ | 2
  60. eor.w %d7,(%a1) | 2
  61. bra.s .L__s32_loop | 2
  62. | Return
  63. .L__s32_rts:
  64. movem.l (%a7)+,%d3-%d7 | 4
  65. rts | 2