Mgamerz

MMBN3 White Enhanced Bosses ASM v0.002 FLAMEMAN

Dec 27th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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 0x080013E0
  16. RecoveryChipRoutine EQU 0x80ADB04
  17. SpawnObject EQU 0x08003084
  18. ;FieldConfiguration EQU 0x
  19. SetPanelTeam EQU 0x0800B7C4
  20. PlaySound EQU 0x080005B8
  21. CalculateAIConstantsAddress EQU 0x080AEDBC
  22. GetPanelType EQU 0x0800B4F2
  23.  
  24. ;Flashman Chips
  25. flashmanchipcount EQU 1h
  26. flashmanChipHookAddress EQU 0x080B6726
  27.  
  28. gutsmanChipHookAddress EQU 0x080B8592
  29. gutsmanZPunchHookAddress EQU 0x080B84C6
  30. gutsmanChipCount EQU 4h
  31. gutsmanZPunchChipCount EQU 3h
  32. gutsmanMovesBeforeZPunch EQU 6h
  33.  
  34. teamfamily EQU 3Fh
  35. areafamily EQU 0h
  36. stagefamily EQU 4h
  37. trumpyfamily EQU 26h
  38. sensorfamily EQU 3Eh
  39. grabbackfamily EQU 15h
  40. mpchipfamily EQU 18h
  41. div EQU swi 6
  42.  
  43.  
  44. .org 0x08235154 ;Free Space
  45. .area 0xDAC
  46. .align 2
  47.  
  48. rngRoutine:
  49.     ldr r0, =rngaddress
  50.     bx r0
  51.     pop r15
  52.  
  53. ;setPanelToTeam:
  54. ;   ldr r0 =fieldConfiguration
  55.  
  56. ;callTimestopChipWithoutTimestop:
  57.     ;requires routine and parameters.
  58.  
  59.  
  60.     ;healSelf:
  61.     ;r0 = how much to heal
  62.     ;r5 = who to heal
  63.     ;bl RecoveryChipRoutine
  64.  
  65. ;===========================FLASH MAN==========================
  66. armRaiseMove:
  67.     ;Hijack at 080D7A66
  68.     push r1-r3,r5,r6
  69.     push r14
  70.     ;b performBulbSpawn
  71.     push r0
  72.     ldrh r0, [r5,24h] ;GetHP
  73.     ldr r4, =12Ch
  74.     cmp r0,r4
  75.     pop r0
  76.     bgt notInRecoveryThreshold
  77.  
  78.     inRecoveryThreshold:
  79.         ldr r0, =0x7D ;how much HP to heal at level 0 (125)
  80.         ldr r4, [r5,4h] ;get level
  81.         add r4, r4, 1h ; prevents *0
  82.         mul r0, r4 ;multiply how much HP to heal
  83.         bl RecoveryChipRoutine
  84.         mov r1, 0h ;0 = Navi Pixelated Summon
  85.         strb r1, [r5, 0xC]
  86.         mov r1, 1h  ;Give Flashman another chip to use as he may run out.
  87.         strb r1, [r5,0x1A] ;0xA offset is how many chips an AI have to use, but r5 is incremented by 4 here for some reason.
  88.         pop r1
  89.         pop r1-r3,r5,r6; including get rid of return address, we will set our own to resume control
  90.  
  91.         ldr r0, =080D7A84h|1b
  92.         bx r0 ;ignore post spawn
  93.  
  94.     notInRecoveryThreshold:
  95.        
  96.         push r1-r3
  97.         bl rngRoutine ;GET RNG result AND PUT INTO r0
  98.         mov r1, 02h ;remainder 0 = steal, anything else = bulbs
  99.         swi 6; Divide, remainder is in r1
  100.         mov r0, 0h
  101.         cmp r0, r1
  102.         pop r1
  103.         pop r2
  104.         pop r3
  105.         bne performBulbSpawn
  106.         stealPanels:
  107.             ;position is on the stack it seems...?
  108.             ;Make the areagrab noise since it won't automatically
  109.             mov r0, 0x78
  110.             bl PlaySound
  111.             mov r0, 9h
  112.             b armRaiseFinish
  113.             pop r1-r3,r5,r6
  114.             ldr r0, =080D7A84h|1b
  115.             bx r0 ;ignore post spawn
  116.  
  117.         performBulbSpawn:
  118.             mov r0, 11h
  119.  
  120.         armRaiseFinish:
  121.             bl SpawnObject
  122.             pop r15 ;finish
  123.  
  124. snakeTrace:
  125.     push r14
  126.     bl GetPlayer ;load X,Y into r0 r1
  127.     ;r0 - Player Current X
  128.     ;r1 - Player Current Y
  129.     push r1
  130.     push r3 ;temporary variable
  131.     ldr r1, [sp,0xC] ;next X pos of bulb
  132.     add r1, r1, 1h
  133.     cmp r0, r1 ;compare next X+1 (same) vs Megaman's X
  134.     ldrb r2,[r5,13h] ; highjacks at 080D7688 ;Current Y position
  135.     bne snakeTraceNotLinedUp ;exit if numbers aren't the same
  136.     snakeTraceLinedUp:
  137.         pop r3
  138.         pop r0 ;Player Y
  139.         cmp r2, r0 ;compare Y coordinates. also used by the routine we return to
  140.         bne snakeTraceDifferentYs
  141.         b snakeTraceLinedUpExit ;same Ys.
  142.  
  143.         snakeTraceDifferentYs:
  144.             str r1, [sp,0x4] ;store same X if our current Y is not the same as the player Y (hit and leave field)
  145.  
  146.         snakeTraceLinedUpExit:
  147.             pop r15
  148.  
  149.     snakeTraceNotLinedUp:
  150.         pop r3
  151.         mov r1, 1h
  152.         cmp r1, 1h ;force same y
  153.         pop r1
  154.         ;mov r2, 1h
  155.         ;cmp r2, 2h ;Same Y
  156.         pop r15
  157.    
  158.  
  159. loadFlashmanRandomChip:
  160.     push r14
  161.     bl rngRoutine ;GET RNG result AND PUT INTO r0
  162.     mov r1, flashmanchipcount ;number of chips in selection list
  163.     swi 6; Divide
  164.     ldr r0,=@@flashmanChipLookupTable ;Load address of chip lookup table (defined below)
  165.     mov r2,0x03 ; Load r2 with 3
  166.     mul r1,r2 ;Multiply the remainder result by the size of the structs (3 bytes) - this will provide an offset into the chip lookup table
  167.     add r0,r0,r1 ;calculate the address using the offset, store in r0
  168.     ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  169.     ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  170.     ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  171.     ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  172.     pop r15
  173.  
  174. .pool
  175. @@flashmanChipLookupTable:
  176. ;.byte teamfamily, 1h, 0h
  177. .byte areafamily, 0h, 10h
  178. ;.byte stagefamily, 4h, 0h
  179. ;.byte trumpyfamily, 2h, 0h
  180.  
  181. ;Flashman zap throwdown
  182. .align 4
  183. flashmanThrowdownAction:
  184.     push r1,r2,r5,r6
  185.     push r14
  186.     bl rngRoutine ;GET RNG result AND PUT INTO r0
  187.     mov r1, 0x3 ;number of available actions
  188.     swi 6; Divide
  189.     ldr r0,=flashmanThrowdownLookupTable ;Load address of actions
  190.     add r0,r0,r1 ;calculate the address using the offset, store in r0
  191.     ldrb r1, [r0, 1h] ;sound check
  192.     ldrb r0, [r0] ;action
  193.     tst r1, r1
  194.     bne playThrowdownSFX
  195.     b finishFlashmanThrowdown
  196.     playThrowdownSFX:
  197.         push r0
  198.         mov r0, r1
  199.         bl PlaySound
  200.         pop r0
  201.  
  202.     finishFlashmanThrowdown:
  203.         pop r15
  204.  
  205. .pool
  206. flashmanThrowdownLookupTable:
  207. .byte 0x35, 0x00 ;Mine
  208. .byte 0x3A, 0x9D ;YoYo
  209. .byte 0x10, 0x00 ;ZapAttack
  210.  
  211. ;-----------------------------GUTS MAN----------------------
  212.  
  213. ;This block is unused right now due to spam issues
  214. ;loadGutsmanRandomChip:
  215. ;push r14
  216. ;bl rngRoutine
  217. ;mov r1, gutsmanchipcount
  218. ;swi 6; Divide
  219. ;ldr r0,=@@gutsmanChipLookupTable ;Load address of chip lookup table (defined below)
  220. ;mov r2,0x03 ; Load r2 with 3
  221. ;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
  222. ;add r0,r0,r1 ;calculate the address using the offset, store in r0
  223. ;ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  224. ;ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  225. ;ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family)
  226. ;ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  227. ;pop r15
  228.  
  229.  
  230. ;.pool
  231. ;@@gutsmanChipLookupTable:
  232. ;.byte teamfamily, 0h, 0h
  233. ;.byte areafamily, 1h, 10h
  234. ;.byte stagefamily, 4h, 0h
  235. ;.byte trumpyfamily, 1h, 0h
  236. ;.align 4
  237. loadZPunchRandomChip:
  238.     .align 2
  239.     push r14
  240.     bl rngRoutine
  241.     mov r1, gutsmanZPunchChipCount
  242.     swi 6; Divide
  243.     ldr r0,=@@gutsmanZPunchLookupTable ;Load address of chip lookup table (defined below)
  244.     mov r2,0x03 ; Load r2 with 3
  245.     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
  246.     add r0,r0,r1 ;calculate the address using the offset, store in r0
  247.     ldrb r3, [r0,0x02] ;load byte from *r0 (offset 2 forward) into r3 (dmg)
  248.     ldrb r1, [r0,0x01] ;load byte from *r0 (offset 1 forward) into r1 (sublevel)
  249.     ldrb r0, [r0,0x00] ;load byte from *r0 (direct addr) into r0 (family;)
  250.     ldrb r2,[r5,16h] ; ...this is actually the object's alliance enemy/allied
  251.     pop r15
  252.  
  253. .pool
  254. @@gutsmanZPunchLookupTable:
  255. ;.byte teamfamily, 0h, 0h
  256. ;.byte areafamily, 1h, 10h
  257. ;.byte stagefamily, 4h, 0h
  258. .byte trumpyfamily, 2h, 0h
  259. .byte sensorfamily, 2h, 100h
  260. .byte mpchipfamily, 2h, 0h
  261.  
  262. ;=================GRAB REVENGE===========
  263. .align 2
  264. grabRevengeResetBoard:
  265.     push r14
  266.     //Read what team called this chip 00 = Player 04 = Enemy. This conveniently also means the return value can be used as an offset to the list of timer pointers
  267.     ldrb r0, [r5,6h]
  268.     //lsr r2, r2, 2h //Divide by 4 - 1 is enemy 0 is us
  269.     //mul r1, r2, 4h ;0x4 = no offset, 1x4 = 2nd offset (enemy team offset in the pool)
  270.     ldr r1, =GrabRevengeMemoryTimerPointer
  271.     //ldr r1, [r1] //Load pointer to first item in pool
  272.     add r0, r1, r0 //get offset in the pool below
  273.     ldr r0, [r0] //load the value into 40 from there
  274.     mov r1, 5h ;timer value to set, will be incremented by 15 frames every time to create a nice
  275.     push r2,r3
  276.     mov r2, 0h
  277.     mov r3, 2h ;0-2 columns
  278.    
  279.     returnColumnsInCascade:
  280.         strh r1, [r0] ;Set the current timer of panels to 5 frames. After those 5 frames the panels will return
  281.         add r0, r0, 4h ;Go to next position for next row.
  282.         push r0
  283.         mov r0, 20h
  284.         add r1, r1, r0
  285.         pop r0
  286.         //add r1, r1, 7h;Add 14 frames for cascade
  287.         //add r1, r1, 7h;Add 14 frames for cascade
  288.         add r2, r2, 1h ;Update counter
  289.         cmp r2,r3
  290.         ble returnColumnsInCascade
  291.  
  292.  
  293.     pop r2,r3
  294.     mov r0, 5h ;original code
  295.     mov r1, 4h ;original code
  296.     pop r15
  297.  
  298. .pool
  299. GrabRevengeMemoryTimerPointer:
  300. .dw 0200F7A4h ;Panels that the enemy stole from you will reset
  301. .dw 0200F7B0h ;Panels that the player stole from the other team will reset
  302.  
  303. //=========================FLAME MAN======================================
  304. flamemanNextCandleStateRandom: //return next state on r0.
  305.     push r14
  306.     push r2
  307.     push r3
  308.     strb r0, [r5,6h]
  309.     bl rngRoutine
  310.     mov r1, 4h //Number of candle states
  311.     div //r1 = remainder
  312.     mov r0, r1
  313.     pop r3
  314.     pop r2
  315.     pop r15
  316.  
  317. flamemanYellowGuyChangeToHorizontalOnSameRowAsPlayer:
  318.     push r14
  319.     push r0-r2
  320.     bl GetPlayer ;r0 = X, r1 = Y
  321.     mov r3, r1 //Put player Y in r3
  322.     pop r0-r2
  323.     ldr r1,[r5,44h]
  324.     tst r1,r1
  325.     pop r15
  326.  
  327. flamemanYellowGuyChangeToVerticalOnSameColumnAsPlayer:
  328.     push r14
  329.     push r0-r2
  330.     bl GetPlayer ;r0 = X, r1 = Y
  331.     mov r3, r0 //Put player X in r3
  332.     pop r0-r2
  333.     ldr r1,[r5,40h]
  334.     tst r1,r1
  335.     pop r15
  336.  
  337. flamemanLevelUpCandleExtinguished:
  338.     push r14
  339.     push r1,r2
  340.     ldrb r0, [r5,0Ch] //Read state that is being extinguished
  341.     //Check if it is 0x4 (Level Up)
  342.     cmp r0, 8h //8 as its left shifted by 1.
  343.     bne @@flamemanCandleExtinguishedFinish
  344.  
  345.     //We are extinguishing a level up flame
  346.     ldr r0,[r5,4Ch] //Get Pointer To Parent
  347.     ldrb r2, [r0,4h] //Get current level
  348.     sub r2, 1h
  349.     strb r2,[r0,4h] //Store level -1
  350.     bl flamemanUpdateAIConstantsAddress
  351.  
  352.     @@flamemanCandleExtinguishedFinish:
  353.         pop r1,r2
  354.         mov r0, 0h //Original Code
  355.         strb r0,[r5,0Ch] //Original Code
  356.         pop r15
  357.  
  358. flamemanLevelUpCandleActivating:
  359.     push r1,r2,r14
  360.     ldrh r0, [r5,20h] //Read activation timer
  361.     cmp r0, 0h
  362.     bne @@flamemanEndCandleActivation
  363.     add r0, 1h
  364.     strh r0, [r5,20h] //Set candle timer to 1 (it doesn't count down while active) to indicate this effect has already been applied
  365.     ldrh r0, [r5,24h] //Get HP
  366.     lsl r0, r0, 0x2 //Quadruple HP
  367.     strh r0, [r5,24h]
  368.     //strh r0, [r5,26h]
  369.     ldr r0,[r5,4Ch] //Get Pointer To Parent
  370.     ldrb r2, [r0,4h] //Get current level
  371.     add r2, 1h
  372.     strb r2,[r0,4h] //Store level +1
  373.     bl flamemanUpdateAIConstantsAddress //R0 = FlamemanPointer, R2 = Level
  374.     @@flamemanEndCandleActivation:
  375.     pop r1,r2,r15
  376.  
  377. .align 4
  378. flamemanCustomCandleActivationArray:
  379.     .word 0x080E2CC9 //Green Empty Function
  380.     .word 0x080E2CCD //Red Empty Function
  381.     .word 0x080E2CD1 //Yellow Empty Function
  382.     //NEW ONE HERE //NEW Level Up Startup Function
  383.     .word flamemanLevelUpCandleActivating|1b
  384.  
  385. flamemanUpdateAIConstantsAddress:
  386.     push r14
  387.     push r5 //This operation requires r5 to point to flameman memory
  388.     mov r5, r0 //Update R5 with the one referenced by the candle parent
  389.     ldr r0, =flamemanNewAIData ;Flameman AI Base
  390.     mov r1, 0Ah ;Flameman's data is 0xA bytes wide per level
  391.     bl CalculateAIConstantsAddress
  392.     pop r5
  393.     pop r15
  394.  
  395.     .pool
  396.     //Flameman New AI Data
  397.     flamemanNewAIData:
  398.     //      0    1    2    3    4    5    6    7    8    9
  399.     .byte 0x3C,0x3C,0x3C,0x1E,0x2D,0x08,0xA4,0x0A,0x10,0x78 //Normal
  400.     .byte 0x64,0x50,0x50,0x19,0x28,0x0C,0x90,0x09,0x18,0x64 //Alpha
  401.     .byte 0x96,0x96,0x96,0x14,0x23,0x15,0x70,0x08,0x20,0x50 //Beta
  402.     .byte 0xC8,0xC8,0xC8,0x0F,0x1E,0x20,0x58,0x06,0x20,0x3C //Omega
  403.     .byte 0xE1,0xE1,0xE1,0x0A,0x0F,0x25,0x44,0x03,0x28,0x28 //Omega + 1
  404.     .byte 0xFA,0xFA,0xFA,0x05,0x0A,0x28,0x40,0x01,0x30,0x16 //Omega + 2
  405.  
  406.     //Candle info
  407.     //[02038A74]=CURRENT SELF POINTER
  408.     //[02038AC0]=PARENT POINTER
  409.     //r5+4C = Parent Pointer
  410.  
  411. flamemanAdditionalAttacksWithLevelUpCandleCheck:
  412.     push r0-r2,r14
  413.     mov r0, #0x0 //init bitmask
  414.  
  415.     //Check Candle 1
  416.     ldr r1, [r5,#0x60]
  417.     tst r1,r1 //Candle 1 is not null check
  418.     beq @@CheckCandle2
  419.     ldrb r2, [r1,#0xC]
  420.     orr r0, r2 //add effect to bitmask
  421.  
  422.     //Check Candle 2
  423.     @@CheckCandle2:
  424.     ldr r1, [r5,#0x64]
  425.     tst r1,r1 //Candle 2 is not null check
  426.     beq @@candleEffectCheck
  427.     ldrb r2, [r1,#0xC]
  428.     orr r0, r2
  429.  
  430.     @@candleEffectCheck:
  431.     //8 = Leveled Up
  432.     mov r1, 8h
  433.     and r0, r1
  434.     tst r0, r0
  435.     beq @@flamemanLaunchStandardFlameAttack
  436.  
  437.     //Different Flame Attack
  438.     @@flamemanLaunchDifferentFlameAttack:
  439.         bl rngRoutine ;GET RNG result AND PUT INTO r0
  440.         mov r1, 0x4
  441.         swi 6
  442.         tst r1,r1
  443.         bne @@flamemanLaunchModifiedFlameAttack
  444.         @@flamemanSpawnFireRatn:
  445.             //Check if square we are going to spawn in is occupied by something. If it is, we shouldn't spawn a ratton
  446.             pop r0-r2
  447.             push r0-r2 //we might still need these...
  448.             mov r0, r1
  449.             mov r1, r2 //move positions to correct registers
  450.             bl GetPanelType
  451.             mov r1, 0xE
  452.             lsl r1, r1, 0x18 //Occupied mask
  453.             //mov r1, 0x10 //broken panel mask
  454.             //orr r0, r1 //also check if panel is broken
  455.             tst r0, r1
  456.             bne @@flamemanLaunchModifiedFlameAttack //it is occupied
  457.  
  458.             //Spawn Ratton
  459.             pop r0-r2 //Discard
  460.             mov r0, 0xC8 //HP of Object
  461.             mov r3, 1h //Enemy Team
  462.             mov r4, 0h //Memory Space that will be assigned to this object on spawn (by spawnobject)
  463.             mov r6, 0xE6 //230 Damage
  464.             bl 0x080DA218 ;SpawnRatton
  465.             pop r15
  466.  
  467.         @@flamemanLaunchModifiedFlameAttack:
  468.             //Recover a small amount of HP
  469.             push r4
  470.             ldr r0, =0xA ;how much HP to heal at level 0 (125)
  471.             ldrb r4, [r5,4h] ;get level
  472.             add r4, r4, 1h ; prevents *0
  473.             mul r0, r4 ;multiply how much HP to heal
  474.             bl RecoveryChipRoutine
  475.             pop r4
  476.             mov r0, 30h
  477.             lsl r1, r1, 18h
  478.             orr r4, r1
  479.         @@flamemanLaunchStandardFlameAttack:
  480.             pop r0-r2
  481.             bl 0x080E317E ;FlamemanSpawnInitialFlameTower
  482.             pop r15
  483.  
  484. .align 4
  485. .pool
  486. @@FlamemanCustomFlameAttackPattern:
  487. .word 0x06280C00 //Straight Flame
  488. .word 0x02241401 //WideFlame
  489. .word 0x32241401 //WideFlame, goes 3 rows deep (at least)
  490. .word 0x02241400
  491.  
  492. .endarea
  493. ;==================HOOKS================
  494. .org 0x080E2F84 //ldr r1,[r5,44h]
  495. flamemanYellowGuyYHook:
  496.     bl flamemanYellowGuyChangeToHorizontalOnSameRowAsPlayer
  497.  
  498. .org 0x080E2F2A //ldr r1,[r5,40h]
  499. flamemanYellowGuyXHook:
  500.     bl flamemanYellowGuyChangeToVerticalOnSameColumnAsPlayer
  501.  
  502. .org 0x080E2D46 //strb r0,[r5,6h]
  503. flamemanRandomCandleStateHook:
  504.     push r14
  505.     nop
  506.     bl flamemanNextCandleStateRandom
  507.     pop r15
  508.  
  509. .org 0x080E2C10 //mov r0, 0h
  510. flamemanCandleExtinguishLevelUpHook:
  511.     bl flamemanLevelUpCandleExtinguished
  512.  
  513. .org 0x080C57C0 //bl FlameManSpawnInitialTower
  514.     bl flamemanAdditionalAttacksWithLevelUpCandleCheck
  515.  
  516. .org 0x080F9E9E
  517. grabRevengeResetBoardHook:
  518.     bl grabRevengeResetBoard
  519.  
  520. .org flashmanChipHookAddress
  521. flashmanChipHook:
  522.     bl loadFlashmanRandomChip
  523.     nop
  524.  
  525. .org 0x080D7A66 ;Flashman Bulb Spawn (Arm Raise Move to heal)
  526. flashmanArmRaiseMoveHook:
  527.     bl armRaiseMove
  528.     nop
  529.     nop
  530.  
  531. .org 0x080D7664 ;In the Follow Trace Y calculation area (will only affect follow and not zigzag tracer)
  532. snakeTraceHook:
  533.     bl snakeTrace
  534.     nop
  535.     nop
  536.  
  537. .org 0x080D7850 ;Flashman zap throwdown
  538. flashmanThrowdownHook:
  539.     bl flashmanThrowdownAction
  540.  
  541. ;.org gutsmanChipHookAddress
  542. ;gutsmanAreaGrabChipHook:
  543. ;bl loadGutsmanRandomChip
  544. ;nop
  545.  
  546. .org gutsmanZPunchHookAddress
  547.     bl loadZPunchRandomChip ;Hook z-punch chip and use my routine instead
  548.     ;nop
  549.  
  550. ;=================PATCHES===============
  551.  
  552. ;--------------HP SPEED PATCH---------------------
  553. ;Makes HP display change faster than default (which is 2)
  554. .org 0x08010E22
  555.     mov r0, 4h
  556.  
  557. ;------------FLAME MAN PATCHES----------
  558. .org 0x080C53EC
  559.     mov r1, 5h ;Candle 1 at X=5 rather than X=6
  560.  
  561. .org 0x080C5406
  562.     mov r1, 5h ;Candle 2 at X=5 rather than X=6
  563.  
  564. .org 0x080E2F98
  565.     cmp r0, r3 ;YellowGuyY will now go left on same row rather than 3
  566.  
  567. .org 0x080E2F40
  568.     cmp r0, r3 ;YellowGuyX will now go down on same row rather than 3
  569.  
  570. .org 0x080E2CB8
  571.     .word flamemanCustomCandleActivationArray ;Rewrite the activation array pointer to my own so the level up function can activate (and avoid crash)
  572.  
  573. .org 0x080C5440
  574.     .word flamemanNewAIData ;Repoint AI data to my own so we have omega +2 levels
  575.  
  576. .org 0x080C5916
  577.     .byte 7h ;Allow flameman to attack from back row
  578.  
  579. .org 0x080C5424
  580.     //Patch out Flameman's Off-Limits 6,2 position.
  581.     nop
  582.     nop
  583.     nop
  584.     nop
  585.  
  586. .org 0x080C566A
  587.     //Patch out FlameMan's additional off-limits 6,2 check
  588.     nop
  589.     nop
  590.  
  591. .org 0x080E30B8
  592.     //Patch out flames despawning on holes
  593.     nop
  594.     nop
  595.  
  596. .org 0x080C559A
  597.     cmp r0, #0x6 //Flameman 6 moves in upper half HP instead of 8
  598.  
  599. .org 0x080C55B8
  600.     cmp r0, #0x3 //Flameman 3 moves in lower half of HP instead of 5
  601.  
  602. ;--------------Flashman Patches---------
  603.  
  604. ;--------------GUTSMAN PATCHES----------
  605. ;.org 0x080B7DF0 ;gutsmans sets move counter here to 0xFF so Z-Punch attack no longer comes up
  606. ;mov r0, #0x0 ;reset to 0 instead so he can use it again. this is the amount of moves he has done.
  607.  
  608. ;.org 0x080b7de8 ;gutsmans checks if his move count is same as this in order to activate Z-Punch
  609. ;cmp r0, gutsmanMovesBeforeZPunch
  610.  
  611. ;.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.
  612. ;add r1, r1, 1 ;add 1 HP so its one over the max. Can use zpunch anytime now
  613.  
  614. .org 0x080b8590 ;gutsmans areagrab response chip
  615. mov r0, grabbackfamily
  616. mov r1, 0x1 ;grabrevenge sublevel
  617. ldrb r2,[r5,#0x16]
  618. mov r3,#0x32 ;50 damage per hit
  619.  
  620. ;-.org 0x080ae6a4 ;gutsman beta AI - delay after shockwave
  621. ;-.byte 0x64 ;contact damage
  622.  
  623. .org 0x08019b68 ;flashman beta HP
  624. .byte 0xe8
  625. .byte 0x03 ;1000 HP 0x03e8
  626.  
  627. .close
  628. ; eof
Advertisement
Add Comment
Please, Sign In to add comment