GAME_SUB.SRC 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. ************************************************************************
  2. * *
  3. * 044 COMMON SUBROUTINES *
  4. * by S.OKADA from 91/10/24 Thu 09:47 *
  5. * *
  6. ************************************************************************
  7. XDEF FREE_OBJ_WORK
  8. XDEF FREE_OBJ_WORK_SUB
  9. XDEF FREE_HERO_PWORK
  10. XDEF LWORK_DEAD
  11. XDEF GET_OBJ_BACK_ADRS
  12. XDEF MESS_SET,MESS_SET_INNER,FLAME_WRITE,FLAME_CLR
  13. XDEF FLAME_WRITED,FLAME_CLRD
  14. XDEF LANG_SET,LANG_SET_INNER
  15. XDEF RANDOM_EFFECT,RANDOM_EFFECT_ACT
  16. XDEF LANG_SOUND,DEAD_BAN
  17. XREF ?A5
  18. ;by MESSAGE
  19. XREF MESS_SETP,MESS_SET_INNERP,FLAME_WRITEP,FLAME_CLRP
  20. XREF FLAME_WRITEPD,FLAME_CLRPD
  21. ;by LANG
  22. XREF LANG_SETP,LANG_SET_INNERP
  23. SECT GAMES,,C
  24. INCLUDE SYS.INC
  25. INCLUDE NEO_GEO.INC
  26. INCLUDE LABEL.INC
  27. FREE_HERO_PWORK:
  28. MOVEP.W HERO_OBJ_START(A6),D0
  29. CLR.B D0
  30. JMP FREE_OBJ_WORK_SUB(PC)
  31. FREE_OBJ_WORK:
  32. ; search free PWORK for non player
  33. ; out) NE (D0(.b)<>0)
  34. ; find free work A0
  35. ; EQ (D0(.b)=0)
  36. ; not find free work
  37. ; use) D0,A0
  38. MOVE.W #FREE_OBJ_START,D0
  39. FREE_OBJ_WORK_SUB:
  40. LEA.L 0(A5,D0.W),A0
  41. MOVE.B WORK_No(A0),D0
  42. AFW_1:
  43. TST.W TYPE(A0)
  44. BEQ AFW_2
  45. LEA.L 100H(A0),A0
  46. ADDQ.B #1,D0
  47. CMP.B #70H,D0
  48. BCS.S AFW_1
  49. AFW_2:
  50. SUB.B #6FH,D0
  51. RTS
  52. LWORK_DEAD:
  53. LEA.L LWORK_START+1000H(A5),A6
  54. LWORK_DEAD_1:
  55. CLR.W TYPE(A6)
  56. CMP.B #70H,WORK_No(A6)
  57. LEA.L 100H(A6),A6
  58. BCS.S LWORK_DEAD_1
  59. RTS
  60. GET_OBJ_BACK_ADRS:
  61. ; caluculate obj_back addres by hit left-lower
  62. ; and area size
  63. ; in) A0 master work address
  64. ; out) A1 obj back address
  65. ; D6 y size-1
  66. ; D5 x size-1
  67. ; use) D0,D1,D2
  68. MOVE.W Y_POSITION(A0),D0
  69. MOVE.W D0,D6
  70. ADD.W HIT_LOWER(A0),D0
  71. BPL.S GOBA_1
  72. MOVEQ.L #0,D0
  73. GOBA_1:
  74. LSR.W #4,D0
  75. ADD.W HIT_UPPER(A0),D6
  76. BPL.S GOBA_2
  77. MOVEQ.L #0,D6
  78. GOBA_2:
  79. LSR.W #4,D6
  80. SUB.W D0,D6
  81. MOVE.W HIT_RIGHT(A0),D5
  82. BPL.S GOBA_3
  83. MOVEQ.L #0,D5
  84. GOBA_3:
  85. LSR.W #4,D5
  86. MOVE.W HIT_LEFT(A0),D1
  87. BPL.S GOBA_4
  88. MOVEQ.L #0,D1
  89. GOBA_4:
  90. MOVE.W D1,D2
  91. LSR.W #4,D2
  92. SUB.W D2,D5
  93. AND.W #0FFF0H,D1
  94. ADD.W D1,D1
  95. ADD.W D1,D0
  96. LEA.L BACK1_BUFFER(A5),A1
  97. LEA.L 0(A1,D0.W),A1
  98. RTS
  99. MESS_SET JMP MESS_SETP
  100. MESS_SET_INNER JMP MESS_SET_INNERP
  101. FLAME_WRITE JMP FLAME_WRITEP
  102. FLAME_CLR JMP FLAME_CLRP
  103. FLAME_WRITED JMP FLAME_WRITEPD
  104. FLAME_CLRD JMP FLAME_CLRPD
  105. LANG_SET JMP LANG_SETP
  106. LANG_SET_INNER JMP LANG_SET_INNERP
  107. RANDOM_EFFECT_ACT:
  108. MOVE.L (A0)+,D4
  109. RANDOM_EFFECT:
  110. MOVEQ.L #RND_STOP,D0
  111. AND.B DEBUG_DIP1(A5),D0
  112. EOR.B #RND_STOP,D0
  113. BEQ.S RE_1
  114. JSR.S RAND8
  115. RE_1:
  116. CMP.B #80H,D0
  117. BCS.S RE_3
  118. CMP.B #0E0H,D0
  119. BCC.S RE_2
  120. SWAP D4
  121. RE_2:
  122. MOVE.W D4,D0
  123. JSR.S SET_SOUND
  124. RE_3:
  125. RTS
  126. LANG_SOUND:
  127. MOVE.L (A0)+,D0
  128. TST.B LANGUAGE(A5)
  129. BNE.S LANG_SOUND_1
  130. SWAP D0
  131. LANG_SOUND_1:
  132. JSR.S SET_SOUND
  133. RTS
  134. DEAD_BAN:
  135. MOVE.L A1,-(SP)
  136. MOVEP.W MASTER_No(A6),D0
  137. CLR.B D0
  138. LEA.L -LOG(A5,D0.W),A1
  139. MOVE.L (A0)+,D0
  140. TST.W HERO_LIFE(A1)
  141. BEQ.S DEAD_BAN_1
  142. SWAP D0
  143. DEAD_BAN_1:
  144. JSR.S SET_SOUND
  145. MOVE.L (SP)+,A1
  146. RTS
  147. INCLUDE WORK.INC
  148.