sprite32.s 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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. move.w 4+5*4(%a7),%d4 | 4
  19. subq.w #1,%d4 | 2
  20. | d3, d6: masks used by AND and RPLC.
  21. moveq #-1,%d3 | 2
  22. lsr.w %d0,%d3 | 2
  23. move.w %d3,%d6 | 2
  24. not.l %d3 | 2
  25. swap %d3 | 2
  26. | Jump to loop entry.
  27. bra.s .L__s32_loopentry | 2
  28. | AND.
  29. .L__s32_Am:
  30. or.l %d3,%d1 | 2
  31. or.w %d6,%d7 | 2
  32. and.l %d1,(%a1)+ | 2
  33. and.w %d7,(%a1) | 2
  34. | Next line.
  35. .L__s32_loop:
  36. lea 26(%a1),%a1 | 4
  37. .L__s32_loopentry:
  38. | Have we finished ?
  39. subq.w #1,%d2 | 2
  40. blt.s .L__s32_rts | 2
  41. move.l (%a0)+,%d1 | 2
  42. move.w %d1,%d7 | 2
  43. lsr.l %d0,%d1 | 2
  44. lsl.w %d5,%d7 | 2
  45. cmp.w #1,%d4 | 4
  46. beq.s .L__s32_Am | 2
  47. tst.w %d4 | 2
  48. blt.s .L__s32_Xm | 2
  49. beq.s .L__s32_Om | 2
  50. | RPLC.
  51. and.l %d3,(%a1) | 2
  52. and.w %d6,4(%a1) | 2
  53. | OR.
  54. .L__s32_Om:
  55. or.l %d1,(%a1)+ | 2
  56. or.w %d7,(%a1) | 2
  57. bra.s .L__s32_loop | 2
  58. | XOR
  59. .L__s32_Xm:
  60. eor.l %d1,(%a1)+ | 2
  61. eor.w %d7,(%a1) | 2
  62. bra.s .L__s32_loop | 2
  63. | Return
  64. .L__s32_rts:
  65. movem.l (%a7)+,%d3-%d7 | 4
  66. rts | 2