Advertisement
aaaaaa123456789

Katamari Damacy timer and miscellaneous patches

Dec 7th, 2018
219
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. gametitle=Katamari Damacy (SLUS-21008)
  2. // save as FA7E3081.pnach
  3.  
  4. // ax6's New Adjustable Timer
  5. patch=0,EE,001021F0,word,3C080055 // lui $t0, 0x0055
  6. patch=0,EE,001021F4,word,3C04001C // lui $a0, 0x001c
  7. patch=0,EE,001021F8,word,8503EA94 // lh $v1, -0x156c($t0)
  8. patch=0,EE,001021FC,word,2484EF80 // addiu $a0, $a0, -0x1080
  9. patch=0,EE,00102200,word,3C060056 // lui $a2, 0x0056
  10. patch=0,EE,00102204,word,00031880 // sll $v1, $v1, 2
  11. patch=0,EE,00102208,word,90C51192 // lbu $a1, 0x1192($a2)
  12. patch=0,EE,0010220C,word,00641821 // addu $v1, $v1, $a0
  13. patch=0,EE,00102210,word,10A00003 // beqz $a1, .go
  14. patch=0,EE,00102214,word,8C630000 // lw $v1, ($v1)
  15. // .return_zero:
  16. patch=0,EE,00102218,word,03E00008 // jr $ra
  17. patch=0,EE,0010221C,word,24020000 // addiu $v0, $zero, 0
  18. // .go:
  19. patch=0,EE,00102220,word,8D02EAB4 // lw $v0, -0x154c($t0)
  20. patch=0,EE,00102224,word,90630048 // lbu $v1, 72($v1)
  21. patch=0,EE,00102228,word,24420001 // addiu $v0, $v0, 1
  22. patch=0,EE,0010222C,word,AD02EAB4 // sw $v0, -0x154c($t0)
  23. patch=0,EE,00102230,word,2C620009 // sltiu $v0, $v1, 9
  24. patch=0,EE,00102234,word,10400012 // beqz $v0, .decrement
  25. patch=0,EE,00102238,word,00031880 // sll $v1, $v1, 2
  26. patch=0,EE,0010223C,word,3C02004A // lui $v0, 0x004a
  27. patch=0,EE,00102240,word,00621821 // addu $v1, $v1, $v0
  28. patch=0,EE,00102244,word,8C640640 // lw $a0, 0x0640($v1)
  29. patch=0,EE,00102248,word,3C030010 // lui $v1, 0x0010
  30. patch=0,EE,0010224C,word,24632288 // addiu $v1, $v1, 0x2288
  31. patch=0,EE,00102250,word,00831823 // subu $v1, $a0, $v1
  32. patch=0,EE,00102254,word,2402FFDC // addiu $v0, $zero, -0x24
  33. patch=0,EE,00102258,word,10620006 // beq $v1, $v0, .perform_check
  34. patch=0,EE,0010225C,word,2462FFFF // addiu $v0, $v1, -1
  35. patch=0,EE,00102260,word,2C42FFF7 // sltiu $v0, $v0, -9
  36. patch=0,EE,00102264,word,10400005 // beqz $v0, .test
  37. patch=0,EE,00102268,word,00000000 // nop
  38. patch=0,EE,0010226C,word,00800008 // jr $a0
  39. patch=0,EE,00102270,word,00000000 // nop
  40. // .perform_check:
  41. patch=0,EE,00102274,word,90C3119D // lbu $v1, 0x119d($a2)
  42. patch=0,EE,00102278,word,38630002 // xori $v1, $v1, 2
  43. // .test:
  44. patch=0,EE,0010227C,word,10600012 // beqz $v1, .done
  45. // .decrement:
  46. patch=0,EE,00102280,word,90C31188 // lbu $v1, 0x1188($a2)
  47. patch=0,EE,00102284,word,1460FFE4 // bnez $v1, .return_zero
  48. patch=0,EE,00102288,word,8D02EAA8 // lw $v0, -0x1558($t0)
  49. patch=0,EE,0010228C,word,3C060200 // lui $a2, 0x0200
  50. patch=0,EE,00102290,word,1040000D // beqz $v0, .done
  51. patch=0,EE,00102294,word,94C3FFF0 // lhu $v1, -16($a2)
  52. patch=0,EE,00102298,word,94C5FFF2 // lhu $a1, -14($a2)
  53. patch=0,EE,0010229C,word,24631000 // addiu $v1, $v1, 0x1000
  54. patch=0,EE,001022A0,word,3063FFFF // andi $v1, $v1, 0xffff
  55. patch=0,EE,001022A4,word,00A32821 // addu $a1, $a1, $v1
  56. patch=0,EE,001022A8,word,30A30FFF // andi $v1, $a1, 0x0fff
  57. patch=0,EE,001022AC,word,00052B02 // srl $a1, $a1, 12
  58. patch=0,EE,001022B0,word,A4C3FFF2 // sh $v1, -14($a2)
  59. patch=0,EE,001022B4,word,0045182B // sltu $v1, $v0, $a1
  60. patch=0,EE,001022B8,word,50600002 // beqzl $v1, .set_timer
  61. patch=0,EE,001022BC,word,00451023 // subu $v0, $v0, $a1
  62. patch=0,EE,001022C0,word,24020000 // addiu $v0, $zero, 0
  63. // .set_timer:
  64. patch=0,EE,001022C4,word,AD02EAA8 // sw $v0, -0x1558($t0)
  65. // .done:
  66. patch=0,EE,001022C8,word,03E00008 // jr $ra
  67. patch=0,EE,001022CC,word,0005102B // sltu $v0, $zero, $a1
  68. // last line returns 1 if the timer ticked, 0 if not (original: (24020001) addiu $v0, $zero, 1 - would return 1 unconditionally)
  69.  
  70. // Timer Speed Hook - (0C3F8006) jal 0x00FE0018 - replaces (0C04087C) jal 0x001021F0 (original timer call)
  71. patch=0,EE,00101938,word,0C3F8006
  72. patch=0,EE,00101960,word,0C3F8006
  73.  
  74. // ax6's Lookup-Based Timer Speed Control
  75. patch=1,EE,00FE0018,word,3C080055 // lui $t0, 0x0055
  76. patch=1,EE,00FE001C,word,9504EA94 // lhu $a0, -0x156c($t0)
  77. patch=1,EE,00FE0020,word,10800014 // beqz $a0, .set
  78. patch=1,EE,00FE0024,word,00001021 // addu $v0, $zero, $zero
  79. patch=1,EE,00FE0028,word,2C810015 // sltiu $at, $a0, 21
  80. patch=1,EE,00FE002C,word,10200011 // beqz $at, .set
  81. patch=1,EE,00FE0030,word,3402F000 // ori $v0, $zero, 0xf000
  82. patch=1,EE,00FE0034,word,2C81000B // sltiu $at, $a0, 11
  83. patch=1,EE,00FE0038,word,54200011 // bnezl $at, .not_constellation
  84. patch=1,EE,00FE003C,word,001F1821 // addu $v1, $zero, $ra
  85. patch=1,EE,00FE0040,word,3C0900E7 // lui $t1, 0x00e7
  86. patch=1,EE,00FE0044,word,9526C7E0 // lhu $a2, -0x3820($t1)
  87. patch=1,EE,00FE0048,word,10C0000A // beqz $a2, .set
  88. patch=1,EE,00FE004C,word,00001021 // addu $v0, $zero, $zero
  89. patch=1,EE,00FE0050,word,3C09004D // lui $t1, 0x004d
  90. patch=1,EE,00FE0054,word,95256788 // lhu $a1, 0x6788($t1)
  91. patch=1,EE,00FE0058,word,00A6082B // sltu $at, $a1, $a2
  92. patch=1,EE,00FE005C,word,10200005 // beqz $at, .set
  93. patch=1,EE,00FE0060,word,00052B40 // sll $a1, $a1, 13
  94. patch=1,EE,00FE0064,word,00A6001B // divu $a1, $a2
  95. patch=1,EE,00FE0068,word,00002812 // mflo $a1
  96. patch=1,EE,00FE006C,word,24A2E001 // addiu $v0, $a1, -0x1fff
  97. patch=1,EE,00FE0070,word,00021042 // srl $v0, $v0, 1
  98. // .set:
  99. patch=1,EE,00FE0074,word,3C040200 // lui $a0, 0x0200
  100. patch=1,EE,00FE0078,word,0804087C // j 0x001021F0
  101. patch=1,EE,00FE007C,word,A482FFF0 // sh $v0, -16($a0)
  102. // .not_constellation:
  103. patch=1,EE,00FE0080,word,0C3F802C // jal .continue
  104. patch=1,EE,00FE0084,word,00042080 // sll $a0, $a0, 2
  105. // ; size targets per level
  106. patch=1,EE,00FE0088,word,41200000 // .float 10 ; 10 cm
  107. patch=1,EE,00FE008C,word,41A00000 // .float 20 ; 20 cm
  108. patch=1,EE,00FE0090,word,42C80000 // .float 100 ; 1 m
  109. patch=1,EE,00FE0094,word,42480000 // .float 50 ; 50 cm
  110. patch=1,EE,00FE0098,word,43160000 // .float 150 ; 1.5 m
  111. patch=1,EE,00FE009C,word,43960000 // .float 300 ; 3 m
  112. patch=1,EE,00FE00A0,word,44160000 // .float 600 ; 6 m
  113. patch=1,EE,00FE00A4,word,44960000 // .float 1200 ; 12 m
  114. patch=1,EE,00FE00A8,word,453B8000 // .float 3000 ; 30 m
  115. patch=1,EE,00FE00AC,word,46EA6000 // .float 30000 ; 300 m
  116. // .continue:
  117. patch=1,EE,00FE00B0,word,009F2021 // addu $a0, $a0, $ra
  118. patch=1,EE,00FE00B4,word,0003F821 // addu $ra, $zero, $v1
  119. patch=1,EE,00FE00B8,word,8C86FFFC // lw $a2, -4($a0)
  120. patch=1,EE,00FE00BC,word,3C040099 // lui $a0, 0x0099
  121. patch=1,EE,00FE00C0,word,8C858D60 // lw $a1, -0x72a0($a0)
  122. patch=1,EE,00FE00C4,word,00A6082A // slt $at, $a1, $a2
  123. patch=1,EE,00FE00C8,word,3402F000 // ori $v0, $zero, 0xf000
  124. patch=1,EE,00FE00CC,word,083F801D // j .set
  125. patch=1,EE,00FE00D0,word,0001100A // movz $v0, $zero, $at
  126.  
  127. // ax6's Elastic Post-Goal Timer Speed Control - comment top 3 lines to disable
  128. // begins right after slt $at, $a1, $a2 from the function above (overwriting the last three instructions)
  129. patch=1,EE,00FE00C8,word,1420FFEA // bnez $at, .set
  130. patch=1,EE,00FE00CC,word,3402F000 // ori $v0, $zero, 0xf000
  131. patch=1,EE,00FE00D0,word,8D04EAA8 // lw $a0, -0x1558($t0)
  132. patch=1,EE,00FE00D4,word,2C810718 // sltiu $at, $a0, 1816 ; 1 minute + 16 frames
  133. patch=1,EE,00FE00D8,word,1420FFE6 // bnez $at, .set
  134. patch=1,EE,00FE00DC,word,00001021 // addu $v0, $zero, $zero
  135. patch=1,EE,00FE00E0,word,44850800 // mtc1 $a1, $f1
  136. patch=1,EE,00FE00E4,word,44861000 // mtc1 $a2, $f2
  137. patch=1,EE,00FE00E8,word,46020841 // sub.s $f1, $f1, $f2
  138. patch=1,EE,00FE00EC,word,46020843 // div.s $f1, $f1, $f2
  139. patch=1,EE,00FE00F0,word,3C064600 // lui $a2, 0x4600 ; 0x46000000 = 8192.0
  140. patch=1,EE,00FE00F4,word,44861000 // mtc1 $a2, $f2
  141. patch=1,EE,00FE00F8,word,46020842 // mul.s $f1, $f1, $f2
  142. patch=1,EE,00FE00FC,word,3C0447F0 // lui $a0, 0x47f0 ; 0x47f00000 = 122880.0
  143. patch=1,EE,00FE0100,word,44841800 // mtc1 $a0, $f3
  144. patch=1,EE,00FE0104,word,46030834 // c.lt.s $f1, $f3
  145. patch=1,EE,00FE0108,word,3402EFFF // ori $v0, $zero, 0xefff
  146. patch=1,EE,00FE010C,word,4500FFD9 // bc1f .set
  147. patch=1,EE,00FE0110,word,460008A4 // cvt.w.s $f2, $f1
  148. patch=1,EE,00FE0114,word,44041000 // mfc1 $a0, $f2
  149. patch=1,EE,00FE0118,word,24840001 // addiu $a0, $a0, 1
  150. patch=1,EE,00FE011C,word,00042042 // srl $a0, $a0, 1
  151. patch=1,EE,00FE0120,word,0044082B // sltu $at, $v0, $a0
  152. patch=1,EE,00FE0124,word,083F801D // j .set
  153. patch=1,EE,00FE0128,word,0081100A // movz $v0, $a0, $at
  154.  
  155. // Unskippable cutscenes
  156. // Original function: if byte[20F8A368] != 0, word[20F8A348] >= 0, and word[20F8A350] = 2, set the last of these to 3.
  157. // byte[20F8A368] is a boolean that indicates whether a cutscene is active at all
  158. // word[20F8A350] is an enum: 0 = starting cutscene, 1 = loading video, 2 = playing cutscene, 3 = ending video, 4 = cleanup
  159. // This line nops out the sw $v0, 8($a0) line that writes the 3.
  160. patch=0,EE,00177530,word,00000000
  161.  
  162. // L1+L2+R1+R2+Triangle+Circle+Square+Cross = Time's Up
  163. patch=1,EE,D101BE82,extended,000000FF // Check that all buttons are pressed
  164. patch=1,EE,2054EAA8,extended,00000000 // Set remaining time to 0
Advertisement
RAW Paste Data Copied
Advertisement