Conway's Game of Life - 3D 68000er Assembler-Code für 8x8x8 Game of Life.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

core_03.s 5.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. .INCLUDE 'CORE_02.IS'
  2. sincos:
  3. lea sintable,a5
  4. cmpi.w #360,d1
  5. bmi less360
  6. subi.w #360,d1
  7. less360:
  8. cmpi.w #270,d1
  9. bmi less270
  10. bsr over270
  11. rts
  12. less270:
  13. cmpi.w #180,d1
  14. bmi less180
  15. bsr over180
  16. rts
  17. less180:
  18. cmpi.w #90,d1
  19. bmi less90
  20. bsr over90
  21. rts
  22. less90:
  23. add.w d1,d1
  24. move.w 0(a5,d1.w),d2
  25. subi.w #180,d1
  26. neg.w d1
  27. move.w 0(a5,d1.w),d3
  28. rts
  29. over270:
  30. subi.w #360,d1
  31. neg.w d1
  32. add.w d1,d1
  33. move.w 0(a5,d1.w),d2
  34. neg.w d2
  35. subi.w #180,d1
  36. neg.w d1
  37. move.w 0(a5,d1.w),d3
  38. rts
  39. over180:
  40. subi.w #180,d1
  41. add.w d1,d1
  42. move.w 0(a5,d1.w),d2
  43. neg.w d2
  44. subi.w #180,d1
  45. neg.w d1
  46. move.w 0(a5,d1.w),d3
  47. neg.w d3
  48. rts
  49. over90:
  50. subi.w #180,d1
  51. neg.w d1
  52. add.w d1,d1
  53. move.w 0(a5,d1.w),d2
  54. subi.w #180,d1
  55. neg.w d1
  56. move.w 0(a5,d1.w),d3
  57. neg.w d3
  58. rts
  59. otranw:
  60. move.w otheta,d1
  61. bsr sincos
  62. move.w d2,stheta
  63. move.w d3,ctheta
  64. move.w ophi,d1
  65. bsr sincos
  66. move.w d2,sphi
  67. move.w d3,cphi
  68. move.w ogamma,d1
  69. bsr sincos
  70. move.w d2,sgamma
  71. move.w d3,cgamma
  72. lea stheta,a0
  73. lea ctheta,a1
  74. lea sphi,a2
  75. lea cphi,a3
  76. lea sgamma,a4
  77. lea cgamma,a5
  78. lea o_wmatx,a6
  79. ; OM11
  80. move.w (a3),d0
  81. muls.w (a5),d0
  82. lsl.l #2,d0
  83. swap.w d0
  84. move.w d0,(a6)+
  85. ; OM12
  86. move.w (a3),d0
  87. muls.w (a4),d0
  88. neg.l d0
  89. lsl.l #2,d0
  90. swap.w d0
  91. move.w d0,(a6)+
  92. ; OM13
  93. move.w (a2),(a6)+
  94. ; OM21
  95. move.w (a1),d0
  96. muls.w (a4),d0
  97. move.w (a0),d1
  98. muls.w (a2),d1
  99. lsl.l #2,d1
  100. swap.w d1
  101. muls.w (a5),d1
  102. add.l d1,d0
  103. lsl.l #2,d0
  104. swap.w d0
  105. move.w d0,(a6)+
  106. ; OM22
  107. move.w (a1),d0
  108. muls.w (a5),d0
  109. move.w (a0),d1
  110. muls.w (a2),d1
  111. lsl.l #2,d1
  112. swap.w d1
  113. muls.w (a4),d1
  114. sub.l d1,d0
  115. lsl.l #2,d0
  116. swap.w d0
  117. move.w d0,(a6)+
  118. ; OM23
  119. move.w (a0),d0
  120. muls.w (a3),d0
  121. neg.l d0
  122. lsl.l #2,d0
  123. swap.w d0
  124. move.w d0,(a6)+
  125. ; OM31
  126. move.w (a0),d0
  127. muls.w (a4),d0
  128. move.w (a1),d1
  129. muls.w (a2),d1
  130. lsl.l #2,d1
  131. swap.w d1
  132. muls.w (a5),d1
  133. sub.l d1,d0
  134. lsl.l #2,d0
  135. swap.w d0
  136. move.w d0,(a6)+
  137. ; OM32
  138. move.w (a0),d0
  139. muls.w (a5),d0
  140. move.w (a1),d1
  141. muls.w (a2),d1
  142. lsl.l #2,d1
  143. swap.w d1
  144. muls.w (a4),d1
  145. add.l d1,d0
  146. lsl.l #2,d0
  147. swap.w d0
  148. move.w d0,(a6)+
  149. ; OM33
  150. move.w (a1),d0
  151. muls.w (a3),d0
  152. lsl.l #2,d0
  153. swap.w d0
  154. move.w d0,(a6)+
  155. move.w oncoords,d7
  156. ext.l d7
  157. beq otranw3
  158. subq.w #1,d7
  159. lea ocoordsx,a0
  160. lea ocoordsy,a1
  161. lea ocoordsz,a2
  162. lea wcoordsx,a3
  163. lea wcoordsy,a4
  164. lea wcoordsz,a5
  165. exg.l a3,d3
  166. link a6,#-6
  167. otranw1:
  168. moveq.l #2,d6
  169. lea o_wmatx,a3
  170. otranw2:
  171. move.w (a0),d0
  172. move.w (a1),d1
  173. move.w (a2),d2
  174. muls.w (a3)+,d0
  175. muls.w (a3)+,d1
  176. muls.w (a3)+,d2
  177. add.l d1,d0
  178. add.l d2,d0
  179. lsl.l #2,d0
  180. swap.w d0
  181. move.w d0,-(a6)
  182. dbf d6,otranw2
  183. move.w (a6)+,d0
  184. add.w Ooz,d0
  185. move.w d0,(a5)+
  186. move.w (a6)+,d0
  187. add.w Ooy,d0
  188. move.w d0,(a4)+
  189. exg.l a3,d3
  190. move.w (a6)+,d0
  191. add.w Oox,d0
  192. move.w d0,(a3)+
  193. exg.l a3,d3
  194. addq.l #2,a0
  195. addq.l #2,a1
  196. addq.l #2,a2
  197. dbf d7,otranw1
  198. unlk a6
  199. otranw3:
  200. rts