Mgamerz

Untitled

Dec 18th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. ;Mgamerz Enhanced Enemies Mod v0.001
  2. ;12/17/2016
  3. ;Apply to MMBN3 ENGLISH WHITE version only! Apply with ARMIPS:
  4. ;armips filename.asm
  5.  
  6. input equ whitevanilla.gba ; Put the name of your ROM here
  7.  
  8. fspace equ 0x800000; Put the ROM free space offset here
  9.  
  10. .gba
  11. .open input,output.gba,8000000h
  12.  
  13. rngaddress EQU 0x080016a2|1b
  14. timestopchipcall EQU 08008E54h
  15. GetPlayer EQU 080013E0h
  16.  
  17. ;Flashman Chips
  18. flashmanchipcount EQU 4h
  19. flashmanChipHookAddress EQU 0x080B6726
  20.  
  21. gutsmanChipHookAddress EQU 0x080B8592
  22. gutsmanZPunchHookAddress EQU 0x080B84C6
  23. gutsmanChipCount EQU 4h
  24. gutsmanZPunchChipCount EQU 3h
  25. gutsmanMovesBeforeZPunch EQU 6h
  26.  
  27. teamfamily EQU 3Fh
  28. areafamily EQU 0h
  29. stagefamily EQU 4h
  30. trumpyfamily EQU 26h
  31. sensorfamily EQU 3Eh
  32. grabbackfamily EQU 15h
  33. mpchipfamily EQU 18h
  34.  
  35. .org 08235156h ;Free Space
  36. .align 2
  37.  
  38. rngRoutine:
  39. ldr r0, =rngaddress
  40. bx r0
  41. pop r15
  42.  
  43. ;===========================FLASH MAN==========================
  44. snakeTrace:
  45. push r14
  46. ;r0 - Player Current X
  47. ;r1 - Player Current Y
  48.  
  49. push r1
  50. ldr r1, [sp,0x8] ;next X pos of bulb
  51. cmp r0, r1
  52. bne snakeTraceFinish ;exit if numbers aren't the same
  53. add r1, 1h
  54. ;mov r1, r2
  55. str r1, [sp,0x8]
  56.  
  57. snakeTraceFinish:
  58. pop r1
  59. ;restore hijacked code
  60. bl 0x080013E0
  61. ldrb r2,[r5,13h] ; highjacks at 080D7688
  62. cmp r2, r1 ;compare Y coordinates
  63. pop r15
  64.  
  65. loadFlashmanRandomChip:
  66. push r14
  67. bl rngRoutine ;GET RNG result AND PUT INTO r0
  68. mov r1, flashmanchipcount ;number of chips in selection list
  69. swi 6; Divide
  70. ldr r0,=@@flashmanChipLookupTable ;Load address of chip lookup table (defined below)
  71. mov r2,0x03 ; Load r2 with 3
  72. mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide an offset into the chip lookup table
  73. add r0,r0,r1 ;calculate the address using the offset, store in r0
  74. ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  75. ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  76. ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  77. ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  78. pop r15
  79.  
  80. ;Call Chip
  81. ;ldr r6, =timestopchipcall
  82. ;push r14
  83. ;bx r6
  84. ;ldrb r2,[r5,#0x16]
  85. ;pop r15
  86.  
  87. .pool
  88. @@flashmanChipLookupTable:
  89. .byte teamfamily, 0h, 0h
  90. .byte areafamily, 1h, 10h
  91. .byte stagefamily, 4h, 0h
  92. .byte trumpyfamily, 1h, 0h
  93.  
  94. ;-----------------------------GUTS MAN----------------------
  95.  
  96. ;This block is unused right now due to spam issues
  97. ;loadGutsmanRandomChip:
  98. ;push r14
  99. ;bl rngRoutine
  100. ;mov r1, gutsmanchipcount
  101. ;swi 6; Divide
  102. ;ldr r0,=@@gutsmanChipLookupTable ;Load address of chip lookup table (defined below)
  103. ;mov r2,0x03 ; Load r2 with 3
  104. ;mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide ;an offset into the chip lookup table
  105. ;add r0,r0,r1 ;calculate the address using the offset, store in r0
  106. ;ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  107. ;ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  108. ;ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  109. ;ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  110. ;pop r15
  111.  
  112.  
  113. ;.pool
  114. ;@@gutsmanChipLookupTable:
  115. ;.byte teamfamily, 0h, 0h
  116. ;.byte areafamily, 1h, 10h
  117. ;.byte stagefamily, 4h, 0h
  118. ;.byte trumpyfamily, 1h, 0h
  119.  
  120. loadZPunchRandomChip:
  121. push r14
  122. bl rngRoutine
  123. mov r1, gutsmanZPunchChipCount
  124. swi 6; Divide
  125. ldr r0,=@@gutsmanZPunchLookupTable ;Load address of chip lookup table (defined below)
  126. mov r2,0x03 ; Load r2 with 3
  127. mul r1,r2 ;Multiple the remainder result by the size of the structs (3 bytes) - this will provide an offset into the chip lookup table
  128. add r0,r0,r1 ;calculate the address using the offset, store in r0
  129. ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  130. ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  131. ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  132. ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  133. pop r15
  134.  
  135. .pool
  136. @@gutsmanZPunchLookupTable:
  137. ;.byte teamfamily, 0h, 0h
  138. ;.byte areafamily, 1h, 10h
  139. ;.byte stagefamily, 4h, 0h
  140. .byte trumpyfamily, 2h, 0h
  141. .byte sensorfamily, 2h, 100h
  142. .byte mpchipfamily, 2h, 0h
  143.  
  144.  
  145. ;==================HOOKS================
  146. .org flashmanChipHookAddress
  147.  
  148. flashmanChipHook:
  149. ;push r14
  150. bl loadFlashmanRandomChip
  151. nop
  152.  
  153.  
  154. .org 0x080D7664 ;In the Follow Trace Y calculation area (will only affect follow and not zigzag tracer)
  155. snakeTraceHook:
  156. bl snakeTrace
  157. nop
  158. nop
  159.  
  160.  
  161. ;.org gutsmanChipHookAddress
  162. ;gutsmanAreaGrabChipHook:
  163. ;bl loadGutsmanRandomChip
  164. ;nop
  165.  
  166. .org gutsmanZPunchHookAddress
  167. bl loadZPunchRandomChip ;Hook z-punch chip and use my routine instead
  168. ;nop
  169.  
  170. ;=================PATCHES===============
  171.  
  172. ;--------------HP SPEED PATCH---------------------
  173. ;Makes HP display change faster than default (which is 2)
  174. .org 0x08010E22
  175. mov r0, 4h
  176.  
  177. ;--------------GUTSMAN PATCHES----------
  178. .org 0x080B7DF0 ;gutsman set move counter here to 0xFF so this attack no longer comes up
  179. mov r0, #0x0 ;reset to 0 instead of past
  180.  
  181. .org 0x080b7de8 ;gutsmans checks if his move count is same as this in order to activate Z-Punch
  182. cmp r0, gutsmanMovesBeforeZPunch
  183.  
  184. .org 0x080b7dcc ;gutsman checks this value and if his hp is less he can use zpunch. by default it is division by 2 by shifting to the right by 1.
  185. add r1, r1, 1 ;add 1 HP so its one over the max. Can use zpunch anytime now
  186.  
  187. .org 0x080b8590 ;gutsmans areagrab response chip
  188. mov r0, grabbackfamily
  189. mov r1, 0x1 ;grabrevenge sublevel
  190. ldrb r2,[r5,#0x16]
  191. mov r3,#0x32 ;50 damage per hit
  192.  
  193. ;.org 0x080ae6a4 ;gutsman beta AI - delay after shockwave
  194. ;.byte 0x64 ;contact damage
  195.  
  196.  
  197. .close
  198. ; eof
Advertisement
Add Comment
Please, Sign In to add comment