Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. ; NAME: Player index
  2. ; GAMES: MP3_USA
  3. ; EXECUTION: Direct
  4.  
  5. Addiu Sp sp -100
  6. Sw s0 0x60(sp)
  7. Sw s1 0x5c(sp)
  8. Sw s2 0x58(sp)
  9. Sw s3 0x54(sp)
  10. Sw Ra 0x50(sp)
  11. sw t1 0x4c(sp)
  12. sw t2 0x48(sp)
  13. sw t3 0x44(sp)
  14. sw t4 0x40(sp)
  15. sw v0 0x3c(sp)
  16. sw a0 0x38(sp)
  17. sw a1 0x34(sp)
  18.  
  19. Jal GetCurrentPlayerIndex
  20. Nop
  21. beq v0,r0, Player1
  22. nop
  23. Li a0, 0x1
  24. Beq a0 v0 Player2
  25. Nop
  26. bne v0,r0,Team2
  27.  
  28.  
  29. Player1:
  30. Lui S0 hi(p1_coins)
  31. Addiu S0 S0 lo(p1_coins)
  32. lh t0 0x0 (S0)
  33. Lui S1 hi(p2_coins)
  34. Addiu s1 s1 lo(p2_coins)
  35. lh T1 0x0 (s1)
  36. Add a1 t0 t1
  37. li a0 0x1
  38. Jal 0x800F21C0
  39. Nop
  40. Li a1 0x1
  41. Li a0 0x0
  42. Jal 0x800F21C0
  43. Nop
  44. Lui S0 hi(p1_stars)
  45. Addiu S0 S0 lo(p1_stars)
  46. Lb T0 0x0 (S0)
  47. Lui S1 hi(p2_stars)
  48. Addiu s1 s1 lo(p2_stars)
  49. Lb T1 0x0 (s1)
  50. Add t1 t0 t1
  51. li t0 0x0
  52. sb t0 0x0 (s0)
  53. sb t1 0x0 (s1)
  54. J end
  55. Nop
  56.  
  57. Player2:
  58. Lui S0 hi(p2_coins)
  59. Addiu S0 S0 lo(p2_coins)
  60. lh T0 0x0 (S0)
  61. Lui S1 hi(p1_coins)
  62. Addiu s1 s1 lo(p1_coins)
  63. lh T1 0x0 (s1)
  64. Lui s2 0x800C
  65. Addiu s2 s2 0xd05a
  66. Lb t2 0x0 (s2)
  67. Lb t3 0x0 (s2)
  68. Add a1 t0 t1
  69. Beq t2 t3 lastturn1
  70. nop
  71. li a0 0x0
  72. Jal 0x800F21C0
  73. Nop
  74. Li a1 0x1
  75. Li a0 0x1
  76. Jal 0x800F21C0
  77. Nop
  78. J loadstars2
  79. Nop
  80. loadstars2:
  81. Lui S0 hi(p2_stars)
  82. Addiu S0 S0 lo(p2_stars)
  83. Lb T0 0x0 (S0)
  84. Lui S1 hi(p1_stars)
  85. Addiu s1 s1 lo(p1_stars)
  86. Lb T1 0x0 (s1)
  87. Add t1 t0 t1
  88. Beq t2 t3 storelast1
  89. li t0 0x0
  90. sb t0 0x0 (s0)
  91. sb t1 0x0 (s1)
  92. J end
  93. Nop
  94.  
  95. lastturn1:
  96. Li a0 0x0
  97. Jal 0x800F21C0
  98. Nop
  99. Li a0 0x1
  100. Jal 0x800F21C0
  101. Nop
  102. J loadstars2
  103. Nop
  104. storelast1:
  105. Sb t1 0x0 (s0)
  106. Sb t1 0x0 (s1)
  107. J end
  108. Nop
  109. Team2:
  110. Beq a0, v0, Player4
  111. Nop
  112. J Player3
  113. Nop
  114. Player3:
  115. Lui S0 hi(p3_coins)
  116. Addiu S0 S0 lo(p3_coins)
  117. lh T0 0x0 (S0)
  118. Lui S1 hi(p4_coins)
  119. Addiu s1 s1 lo(p4_coins)
  120. lh T1 0x0 (s1)
  121. Add a1 t0 t1
  122. li a0 0x3
  123. Jal 0x800F21C0
  124. Nop
  125. Li a1 0x1
  126. Li a0 0x2
  127. Jal 0x800F21C0
  128. Nop
  129. Lui S0 hi(p3_stars)
  130. Addiu S0 S0 lo(p3_stars)
  131. Lb T0 0x0 (S0)
  132. Lui S1 hi(p4_stars)
  133. Addiu s1 s1 lo(p4_stars)
  134. Lb T1 0x0 (s1)
  135. Add t1 t0 t1
  136. li t0 0x0
  137. sb t0 0x0 (s0)
  138. sb t1 0x0 (s1)
  139. J end
  140. Nop
  141. Player4:
  142. Lui S0 hi(p4_coins)
  143. Addiu S0 S0 lo(p4_coins)
  144. lh T0 0x0 (S0)
  145. Lui S1 hi(p3_coins)
  146. Addiu s1 s1 lo(p3_coins)
  147. lh T1 0x0 (s1)
  148. Lui s2 0x800C
  149. Addiu s2 s2 0xd05a
  150. Lb t2 0x0 (s2)
  151. Lb t3 0x0 (s2)
  152. Add a1 t0 t1
  153. Beq t2 t3 lastturn2
  154. nop
  155. li a0 0x2
  156. Jal 0x800F21C0
  157. Nop
  158. Li a1 0x1
  159. Li a0 0x3
  160. Jal 0x800F21C0
  161. Nop
  162. J loadstars4
  163. Nop
  164.  
  165. loadstars4:
  166. Lui S0 hi(p4_stars)
  167. Addiu S0 S0 lo(p4_stars)
  168. Lb T0 0x0 (S0)
  169. Lui S1 hi(p3_stars)
  170. Addiu s1 s1 lo(p3_stars)
  171. Lb T1 0x0 (s1)
  172. Add t1 t0 t1
  173. Beq t2 t3 storelast2
  174. li t0 0x0
  175. sb t0 0x0 (s0)
  176. sb t1 0x0 (s1)
  177. J end
  178. Nop
  179.  
  180. lastturn2:
  181. Li a0 0x3
  182. Jal 0x800F21C0
  183. Nop
  184. Li a0 0x2
  185. Jal 0x800F21C0
  186. Nop
  187. J loadstars4
  188. Nop
  189. storelast2:
  190. Sb t1 0x0 (s0)
  191. Sb t1 0x0 (s1)
  192. J end
  193. Nop
  194.  
  195. end:
  196. Lw s0 0x60(sp)
  197. Lw s1 0x5c(sp)
  198. Lw s2 0x58(sp)
  199. Lw s3 0x54(sp)
  200. Lw RA 0x50(sp)
  201. lw t1 0x4c(sp)
  202. lw t2 0x48(sp)
  203. lw t3 0x44(sp)
  204. lw t4 0x40(sp)
  205. lw v0 0x3c(sp)
  206. lw a0 0x38(sp)
  207. lw a1 0x34(sp)
  208. JR RA
  209. Addi Sp sp 100
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement