Thread: Development: Ability Resource Thread
View Single Post
  #137    
Old July 19th, 2015 (8:30 AM). Edited July 19th, 2015 by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
     
    Join Date: Dec 2008
    Location: Hong Kong
    Age: 23
    Gender: Male
    Posts: 843
    Quote:
    Originally Posted by KDS View Post
    The reason is that, Mold Breaker sets the target's ability to xFF and absorb table routine reads the last entry to branch to xFFFFFF. To fix this, in the Loop: label ,swap the order of these pair statements 'cmp r0, r1 beq Success' and 'cmp r1, xFF beq End'.
    All fixed!

    I've actually made Simple now! I'll also update this post to include Contrary in the future!

    Simple

    Spoiler:
    Fire Red
    Spoiler:
    Routine I: Negative Stat Boost
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_funcs
    .global simplenegativestatboost
    
    BufferAbility:
    	mov r2, #0x1
    	lsr r6, r0, #0x18
    	ldr r0, .Bank
    	ldrb r0, [r0]
    	mov r1, #0x58
    	mul r0, r1
    	ldr r1, .BattleData
    	add r0, r0, r1
    	ldrb r0, [r0]
    SimpleCheck:
    	cmp r0, #0x57
    	bne DetermineNegativeStage
    Simple:
    	lsl r0, r6, #0x19
    	lsr r6, r0, #0x18
    DetermineNegativeStage:
    	cmp r6, #0xFE
    	beq Harshly
    	cmp r6, #0xFF
    	beq Fell
    Severely:
    	strb r4, [r3, #0x1]
    	mov r0, #0x85
    	strb r0, [r3, #0x2]
    	mov r0, #0x1
    	strb r0, [r3, #0x3]
    	mov r2, #0x4
    	b Fell
    Harshly:
    	strb r4, [r3, #0x1]
    	mov r0, #0xD3
    	strb r0, [r3, #0x2]
    	strb r4, [r3, #0x3]
    	mov r2, #0x4
    Fell:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    .Bank: .word 0x02023BC4
    .BattleData: .word 0x02023C04
    .Return: .word 0x08027F12
    
    #Insert 00 4A 10 47 xx xx xx 08 at 27EFC

    Routine II: Positive Stat Boost
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global simplepositivestatboost
    
    BufferAbility:
    	mov r2, #0x1
    	ldr r0, .Bank
    	ldrb r0, [r0]
    	mov r1, #0x58
    	mul r0, r1
    	ldr r1, .BattleData
    	add r0, r0, r1
    	ldrb r0, [r0]
    SimpleCheck:
    	cmp r0, #0x57
    	bne DeterminePositiveStage
    Simple:
    	lsl r0, r6, #0x19
    	lsr r6, r0, #0x18
    DeterminePositiveStage:
    	cmp r6, #0x2
    	beq Sharply
    	cmp r6, #0x1
    	beq Rose
    Drastically:
    	strb r4, [r3, #0x1]
    	mov r0, #0x86
    	strb r0, [r3, #0x2]
    	mov r0, #0x1
    	strb r0, [r3, #0x3]
    	mov r2, #0x4
    	b Rose
    Sharply:
    	strb r4, [r3, #0x1]
    	mov r0, #0xD1
    	strb r0, [r3, #0x2]
    	strb r4, [r3, #0x3]
    	mov r2, #0x4
    Rose:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    .Bank: .word 0x02023BC4
    .BattleData: .word 0x02023C04
    .Return: .word 0x08027F87
    
    #Insert 01 4A 10 47 00 00 xx xx xx 08 at 27F76

    Routine III: Display Stat Stage Message
    Spoiler:
    Code:
    .text
    .text
    .align 2
    .thumb
    .thumb_func
    .global displaystatstagemessage
    
    BufferMessage:
    	ldr r0, .Index
    	cmp r0, r1
    	beq BufferSeverely
    	add r0, #0x1
    	cmp r0, r1
    	bne Normal
    BufferDrastically:
    	ldr r1, .DrasticallyString
    	b Return
    BufferSeverely:
    	ldr r1, .SeverelyString
    	b Return
    Normal:
    	ldr r0, .MessageTable
    	sub r1, #0xC
    	lsl r1, r1, #0x2
    	add r1, r1, r0
    	ldr r1, [r1]
    Return:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    
    .Index: .word 0x00000185
    .DrasticallyString: .word 0x08DDDDDD
    .SeverelyString: .word 0x08EEEEEE
    .MessageTable: .word 0x083FDF3C
    .Return: .word 0x080D8491
    
    #Insert 01 48 00 47 00 00 xx xx xx 08 at 080D8486
    DDDDDD refers to the following string
    Code:
    D8 E6 D5 E7 E8 DD D7 D5 E0 E0 ED 00 FF
    EEEEEE refers to the following string.
    Code:
    E7 D9 EA D9 E6 D9 E0 ED 00 FF

    Emerald
    Spoiler:
    Routine I: Negative Stat Boost
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global simplenegativestatboost
    
    BufferAbility:
    	mov r2, #0x1
    	lsr r6, r0, #0x18
    	ldr r0, .Bank
    	ldrb r0, [r0]
    	mov r1, #0x58
    	mul r0, r1
    	ldr r1, .BattleData
    	add r0, r0, r1
    	ldrb r0, [r0]
    SimpleCheck:
    	cmp r0, #0x57
    	bne DetermineNegativeStage
    Simple:
    	lsl r0, r6, #0x19
    	lsr r6, r0, #0x18
    DetermineNegativeStage:
    	cmp r6, #0xFE
    	beq Harshly
    	cmp r6, #0xFF
    	beq Fell
    Severely:
    	strb r4, [r3, #0x1]
    	mov r0, #0x85
    	strb r0, [r3, #0x2]
    	mov r0, #0x1
    	strb r0, [r3, #0x3]
    	mov r2, #0x4
    	b Fell
    Harshly:
    	strb r4, [r3, #0x1]
    	mov r0, #0xD3
    	strb r0, [r3, #0x2]
    	strb r4, [r3, #0x3]
    	mov r2, #0x4
    Fell:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    .Bank: .word 0x02024064
    .BattleData: .word 0x020240A4
    .Return: .word 0x08050D33
    
    #Insert 00 4A 10 47 xx xx xx 08 at 50D1C

    Routine II: Positive Stat Boost
    Spoiler:
    Code:
    .text
    .align 2
    .thumb
    .thumb_func
    .global simplepositivestatboost
    
    BufferAbility:
    	mov r2, #0x1
    	ldr r0, .Bank
    	ldrb r0, [r0]
    	mov r1, #0x58
    	mul r0, r1
    	ldr r1, .BattleData
    	add r0, r0, r1
    	ldrb r0, [r0]
    SimpleCheck:
    	cmp r0, #0x57
    	bne DeterminePositiveStage
    Simple:
    	lsl r0, r6, #0x19
    	lsr r6, r0, #0x18
    DeterminePositiveStage:
    	cmp r6, #0x2
    	beq Sharply
    	cmp r6, #0x1
    	beq Rose
    Drastically:
    	strb r4, [r3, #0x1]
    	mov r0, #0x86
    	strb r0, [r3, #0x2]
    	mov r0, #0x1
    	strb r0, [r3, #0x3]
    	mov r2, #0x4
    	b Rose
    Sharply:
    	strb r4, [r3, #0x1]
    	mov r0, #0xD1
    	strb r0, [r3, #0x2]
    	strb r4, [r3, #0x3]
    	mov r2, #0x4
    Rose:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    .Bank: .word 0x02024064
    .BattleData: .word 0x020240A4
    .Return: .word 0x08050DA7
    
    #Insert 01 4A 10 47 00 00 xx xx xx 08 at 50D96

    Routine III: Display Stat Stage Message
    Spoiler:
    Code:
    .text
    .text
    .align 2
    .thumb
    .thumb_func
    .global displaystatstagemessage
    
    BufferMessage:
    	ldr r0, .Index
    	cmp r0, r1
    	beq BufferSeverely
    	add r0, #0x1
    	cmp r0, r1
    	bne Normal
    BufferDrastically:
    	ldr r1, .DrasticallyString
    	b Return
    BufferSeverely:
    	ldr r1, .SeverelyString
    	b Return
    Normal:
    	ldr r0, .MessageTable
    	sub r1, #0xC
    	lsl r1, r1, #0x2
    	add r1, r1, r0
    	ldr r1, [r1]
    Return:
    	ldr r0, .Return
    	bx r0
    
    .align 2
    
    .Index: .word 0x00000185
    .DrasticallyString: .word 0x08DDDDDD
    .SeverelyString: .word 0x08EEEEEE
    .MessageTable: .word 0x085CC270
    .Return: .word 0x0814F6C1
    
    #Insert 01 48 00 47 00 00 xx xx xx 08 at 0814F6B6
    DDDDDD refers to the following string
    Code:
    D8 E6 D5 E7 E8 DD D7 D5 E0 E0 ED 00 FF
    EEEEEE refers to the following string.
    Code:
    E7 D9 EA D9 E6 D9 E0 ED 00 FF

    __________________
    Reply With Quote