clipsprite8.s 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. .globl ClipSprite8
  2. .text
  3. .even
  4. ClipSprite8:
  5. movem.l %d3-%d5,-(%a7)
  6. tst.w %d1
  7. bge.s .L__cs8_1
  8. add.w %d1,%d2
  9. suba.w %d1,%a0
  10. moveq #0,%d1
  11. .L__cs8_1:
  12. move.w %d1,%d5
  13. add.w %d2,%d1
  14. sub.w #128,%d1
  15. ble.s .L__cs8_2
  16. sub.w %d1,%d2
  17. .L__cs8_2:
  18. mulu.w #30,%d5
  19. adda.w %d5,%a1
  20. move.w %d0,%d1
  21. not.w %d0
  22. and.w #15,%d0
  23. moveq #-1,%d4
  24. add.w #9,%d0
  25. asr.w #4,%d1
  26. add.w %d1,%d1
  27. bge.s .L__cs8_3
  28. cmp.w #-2,%d1
  29. blt.s .L__cs8_rts
  30. clr.w %d4
  31. swap %d4
  32. .L__cs8_3:
  33. cmp.w #28,%d1
  34. blt.s .L__cs8_5
  35. beq.s .L__cs8_4
  36. .L__cs8_rts:
  37. movem.l (%a7)+,%d3-%d5
  38. rts
  39. .L__cs8_4:
  40. clr.w %d4
  41. .L__cs8_5:
  42. adda.w %d1,%a1
  43. subq.w #1,%d3
  44. moveq #0,%d5
  45. not.b %d5
  46. lsl.l %d0,%d5
  47. and.l %d4,%d5
  48. not.l %d5 |ANDing flag used in RPLC mode
  49. bra.s .L__cs8_loopentry | 2
  50. .L__cs8_AND:
  51. not.b %d1
  52. lsl.l %d0,%d1
  53. and.l %d4,%d1
  54. not.l %d1
  55. and.l %d1,(%a1)
  56. .L__cs8_loop:
  57. lea 30(%a1),%a1 | 4
  58. .L__cs8_loopentry:
  59. subq.w #1,%d2
  60. blt.s .L__cs8_rts
  61. moveq #0,%d1
  62. move.b (%a0)+,%d1
  63. cmp.w #1,%d3
  64. beq.s .L__cs8_AND
  65. lsl.l %d0,%d1
  66. and.l %d4,%d1
  67. tst.w %d3
  68. blt.s .L__cs8_XOR
  69. beq.s .L__cs8_OR
  70. |RPLC
  71. and.l %d5,(%a1)
  72. .L__cs8_OR:
  73. or.l %d1,(%a1)
  74. bra.s .L__cs8_loop
  75. .L__cs8_XOR:
  76. eor.l %d1,(%a1)
  77. bra.s .L__cs8_loop