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_02.s 4.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. perspective:
  2. move.w vncoords,d7
  3. beq prs_end
  4. subq.w #1,d7
  5. lea vcoordsx,a0
  6. lea vcoordsy,a1
  7. lea vcoordsz,a2
  8. lea scoordsx,a4
  9. lea scoordsy,a5
  10. link a6,#-32
  11. prs_crd:
  12. moveq #3,d6
  13. lea persmatx,a3
  14. prs_elmnt:
  15. move.w (a0),d0
  16. move.w (a1),d1
  17. move.w (a2),d2
  18. muls.w (a3)+,d0
  19. muls.w (a3)+,d1
  20. muls.w (a3)+,d2
  21. add.l d1,d0
  22. add.l d2,d0
  23. moveq #1,d1
  24. muls.w (a3)+,d1
  25. add.l d1,d0
  26. move.l d0,-(a6)
  27. dbf d6,prs_elmnt
  28. move.l (a6)+,d3
  29. bne prs_ok
  30. addq.w #1,d3
  31. prs_ok:
  32. addq.l #4,a6
  33. move.l (a6)+,d4
  34. divs.w d3,d4
  35. addi.w #160,d4
  36. move.w d4,(a4)+
  37. move.l (a6)+,d4
  38. divs.w d3,d4
  39. subi.w #199,d4
  40. neg.w d4
  41. move.w d4,(a5)+
  42. addq.l #2,a0
  43. addq.l #2,a1
  44. addq.l #2,a2
  45. dbf d7,prs_crd
  46. unlk a6
  47. prs_end:
  48. rts
  49. polydraw:
  50. move.w npoly,d7
  51. beq polydraw5
  52. subq.w #1,d7
  53. lea scoordsx,a0
  54. lea scoordsy,a1
  55. lea sedglst,a2
  56. lea snedges,a3
  57. lea col_lst,a4
  58. polydraw2:
  59. move.w (a4)+,d0
  60. cmpi.w #$f,d0
  61. ble polydraw3
  62. move.w (a3)+,d0
  63. addq.w #1,d0
  64. add.w d0,d0
  65. adda.w d0,a2
  66. bra polydraw4
  67. polydraw3:
  68. move.w d0,colour
  69. move.w (a3)+,d0
  70. beq polydraw3
  71. move.w d0,no_in
  72. lea crds_in,a5
  73. polydraw1:
  74. move.w (a2)+,d1
  75. lsl.w #1,d1
  76. move.w 0(a0,d1.w),(a5)+
  77. move.w 0(a1,d1.w),(a5)+
  78. dbf d0,polydraw1
  79. movem.l d7/a0-a4,-(sp)
  80. bsr clip
  81. bsr poly_fil
  82. movem.l (sp)+,d7/a0-a4
  83. polydraw4:
  84. dbra d7,polydraw2
  85. polydraw5:
  86. rts
  87. polypoints:
  88. movem.l d0-d3/d7/a0-a5,-(sp)
  89. move.w npts,d7
  90. beq polyptend
  91. subq.w #1,d7
  92. lea scoordsx,a0
  93. lea scoordsy,a1
  94. lea crds_in,a5
  95. lea col_lst,a4
  96. clr.w d1
  97. polypt1:
  98. move.w (a0)+,d2
  99. move.w (a1)+,d3
  100. move.w (a4)+,d0
  101. ; beq.s polypt4
  102. cmpi.w #$f,d0
  103. bgt polypt4
  104. ; move.w d0,colour
  105. move.w d2,(a5)+
  106. move.w d3,(a5)+
  107. addq.w #1,d1
  108. polypt4:
  109. dbra d7,polypt1
  110. move.w d1,no_in
  111. bsr poly_point
  112. polyptend:
  113. movem.l (sp)+,d0-d3/d7/a0-a5
  114. rts
  115. polywire:
  116. move.w npoly,d7
  117. beq polywire5
  118. subq.w #1,d7
  119. lea scoordsx,a0
  120. lea scoordsy,a1
  121. lea sedglst,a2
  122. lea snedges,a3
  123. lea col_lst,a4
  124. polywire2:
  125. move.w (a4)+,d0
  126. ; beq.s hide_polyline
  127. cmpi.w #$f,d0
  128. ble polywire3
  129. hide_polyline:
  130. move.w (a3)+,d0
  131. addq.w #1,d0
  132. add.w d0,d0
  133. adda.w d0,a2
  134. bra polywire4
  135. polywire3:
  136. move.w d0,colour
  137. move.w (a3)+,d0
  138. beq polywire3
  139. move.w d0,no_in
  140. lea crds_in,a5
  141. polywire1:
  142. move.w (a2)+,d1
  143. lsl.w #1,d1
  144. move.w 0(a0,d1.w),(a5)+
  145. move.w 0(a1,d1.w),(a5)+
  146. dbf d0,polywire1
  147. movem.l d7/a0-a4,-(sp)
  148. bsr no_clip ; actually no clipping
  149. bsr poly_line
  150. movem.l (sp)+,d7/a0-a4
  151. polywire4:
  152. dbra d7,polywire2
  153. polywire5:
  154. rts
  155. .INCLUDE 'CORE_01.IS'