Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

Draconius GO
Reply
 
Thread Tools
  #1    
Old January 29th, 2015 (8:09 PM). Edited August 7th, 2016 by MrDollSteak.
MrDollSteak's Avatar
MrDollSteak MrDollSteak is offline
Formerly known as 11bayerf1
     
    Join Date: Dec 2008
    Location: Hong Kong
    Age: 22
    Gender: Male
    Posts: 817

    Ability Resource Thread



    This thread is for the development and sharing of new ability routines and battle scripts for Fire Red and Emerald. Requests made by users can definitely be considered just make sure you follow the posting guidelines. Abilities are one of the things that I and other hackers are often asked to share, and make tutorials for, sadly the way in which abilities work, there is no real tutorial that can assist in making an ability outside of general ASM and battle scripting knowledge. For this reason I have decided to create this thread. It also makes it far easier for people to discover bugs or errors in routines, allowing for them to be fixed far more easily.

    Extra Information


    Before you get started, refer to the following threads for information about the procedure of expanding the relevant tables, inserting ASM and understanding how battle scripts work:

    Expanding the Ability Name and Description Tables by RaileysXerilyasRX
    Inserting ASM Routines by FBI Agent
    HackMew's Knowledge by HackMew
    GBA ASM Programming by Shiny Quagsire
    Yet another ASM tutorial by knizz
    BSP Scripting Tutorial by Jambo51

    Thread rules


    Do not demand for your requests to be fulfilled!
    People do not have to fulfil your requests, they do it because they want to! Not only are those posts annoying, they also are completely pointless! If such a post is found, it will probably be deleted.

    Wrap your abilities and routines in [SPOILER]spoiler tags[/SPOILER].
    This is here to keep the thread as easy to browse as possible, as most routines and whatnot tend to take up multiple lines and this can make scrolling through the thread a chore.

    Be reasonable with your requests!
    This thread is for mostly small ability routines or battle scripts: don't be greedy! No-one is going to make an entire hack for you.

    Give credit when requested!
    If and when you use any of the routines posted here, give credit to the original creator if they ask for it. If they don't explicitly ask for credit, assume they do. Theft won't be tolerated and if you're caught the moderators will request you add credits to your hack threads, and if not your thread may be deleted.

    State the base game for which your requests / abilities are for.
    This is mostly to avoid confusion, and to allow for easier organisation of the thread. Please try not to request abilities for Ruby or Sapphire: these games are very difficult to code for and Emerald tends to be far better in nearly every way.

    Read the thread before making a request!
    Again for organisational reasons, it is a waste of space and time to request abilities which have already been created.

    New Abilities


    All the routines here are for abilities from Gen 4 and above. They are treated in the index order of the most recent games ORAS +1. This is because Cacophony no longer exists in those games, and therefore does not take an index slot. For this reason while Tangled Feet is listed as ability number 77 on Bulbapedia, if you have expanded your ability table, it will in fact be ability number 78. Remember also that this is the decimal index number, so the routines themselves will be listed with their indexes in hex.

    Additionally because some abilities are tied to the same routine, or have prerequisites please look at the ability routines themselves, because you may not need to insert it multiple times, or will need to have inserted other routines to get them to work.

    Spoiler:
    4E - Tangled Feet [FR] [EM]
    4F - Motor Drive [EM]
    50 - Rivalry
    51 - Steadfast
    52 - Snow Cloak [FR] [EM]
    53 - Gluttony
    54 - Anger Point
    55 - Unburden [FR] [EM]
    56 - Heatproof [FR] [EM]
    57 - Simple [FR] [EM]
    58 - Dry Skin [EM]
    59 - Download
    5A - Iron Fist
    5B - Poison Heal
    5C - Adaptability
    5D - Skill Link [FR] [EM]
    5E - Hydration
    5F - Solar Power
    60 - Quick Feet [FR] [EM]
    61 - Normalize [FR] [EM]
    62 - Sniper [FR] [EM]
    63 - Magic Guard [EM]
    64 - No Guard [FR] [EM]
    65 - Stall [FR] [EM]
    66 - Technician [FR] [EM]
    67 - Leaf Guard [EM]
    68 - Klutz
    69 - Mold Breaker [FR] [EM]
    6A - Super Luck [FR] [EM]
    6B - Aftermath
    6C - Anticipation
    6D - Forewarn
    6E - Unaware [FR]
    6F - Tinted Lens [FR] [EM]
    70 - Filter [FR] [EM]
    71 - Slow Start
    72 - Scrappy [FR] [EM]
    73 - Storm Drain [EM]
    74 - Ice Body
    75 - Solid Rock [FR] [EM]
    76 - Snow Warning [FR]
    77 - Honey Gather
    78 - Frisk
    79 - Reckless
    7A - Multitype
    7B - Flower Gift
    7C - Bad Dreams
    7D - Pickpocket
    7E - Sheer Force
    7F - Contrary
    80 - Unnerve
    81 - Defiant [FR]
    82 - Defeatist [FR] [EM]
    83 - Cursed Body
    84 - Healer
    85 - Friend Guard
    86 - Weak Armor
    87 - Heavy Metal
    88 - Light Metal
    89 - Multiscale [FR] [EM]
    8A - Toxic Boost [FR] [EM]
    8B - Flare Boost [FR] [EM]
    8C - Harvest
    8D - Telepathy
    8E - Moody
    8F - Overcoat [FR] [EM]
    90 - Poison Touch
    91 - Regenerator [FR] [EM]
    92 - Big Pecks [FR] [EM]
    93 - Sand Rush [FR] [EM]
    94 - Wonder Skin [FR] [EM]
    95 - Analytic
    96 - Illusion
    97 - Imposter
    98 - Infiltrator
    99 - Mummy
    9A - Moxie [FR] [EM]
    9B - Justified
    9C - Rattled
    9D - Magic Bounce [FR]
    9E - Sap Sipper [EM]
    9F - Prankster [FR] [EM]
    A0 - Sand Force
    A1 - Iron Barbs
    A2 - Zen Mode
    A3 - Victory Star [FR] [EM]
    A4 - Turboblaze [FR] [EM]
    A5 - Teravolt [FR] [EM]
    A6 - Aroma Veil [EM]
    A7 - Flower Veil [EM]
    A8 - Cheek Pouch
    A9 - Protean [FR] [EM]
    AA - Fur Coat [FR] [EM]
    AB - Magician
    AC - Bulletproof [FR] [EM]
    AD - Competitive [FR]
    AE - Strong Jaw
    AF - Refrigerate [FR] [EM]
    B0 - Sweet Veil [EM]
    B1 - Stance Change
    B2 - Gale Wings [FR] [EM]
    B3 - Mega Launcher
    B4 - Grass Pelt
    B5 - Symbiosis
    B6 - Tough Claws
    B7 - Pixilate [FR] [EM]
    B8 - Gooey
    B9 - Aerilate [FR] [EM]
    BA - Parental Bond
    BB - Dark Aura
    BC - Fairy Aura
    BD - Aura Break
    BE - Primordial Sea
    BF - Desolate Land
    C0 - Delta Stream


    Updated Effects



    All the routines here are to add effects that did not exist in Gen 3 to abilities that did. They use the same index numbers as the existing abilities.

    Spoiler:
    01 - Stench
    05 - Sturdy [FR] [EM]
    0C - Oblivious [EM]
    0D - Cloud Nine
    17 - Shadow Tag
    18 - Rough Skin [FR] [EM]
    1F - Lightning Rod [EM]
    24 - Trace [FR]
    28 - Magma Armor
    2E - Pressure [FR]
    31 - Flame Body
    33 - Keen Eye
    4D - Air Lock
    __________________
    Reply With Quote

    Relevant Advertising!

      #2    
    Old January 30th, 2015 (1:21 AM). Edited July 5th, 2015 by MrDollSteak.
    MrDollSteak's Avatar
    MrDollSteak MrDollSteak is offline
    Formerly known as 11bayerf1
       
      Join Date: Dec 2008
      Location: Hong Kong
      Age: 22
      Gender: Male
      Posts: 817
      To start off here are a few damage-calc related abilities as well as an update Sturdy effect!

      These abilities require Doesnt's PSS Split, because of a few shifting bytes.

      Sniper, Technician, Defeatist and the Slow Start Attack Drop
      Spoiler:
      Fire Red
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global snipertechnicianandslowstartattackdrop
       
      Main:
      	cmp r4, #0x37
      	bne Sniper
      HustleBoost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      Sniper:
      	cmp r4, #0x62
      	bne Technician
      CheckCrit:
      	ldr r0, .CritLoc
      	ldrb r0, [r0]
      	cmp r0, #0x2
      	bne Return
      	b Boost
      Technician:
      	cmp r4, #066
      	bne Defeatist
      CheckBasePower:
      	ldr r0, .BasePower
      	ldrb r0, [r0]
      	cmp r0, #0x3D
      	bge Return
      Boost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      	mov r2, r8
      	lsr r0, r2, #0x1
      	add r0, r0, r2
      	mov r8, r0
      Defeatist:
      	cmp r4, #066
      	bne SlowStart
      CheckHP:
      	ldrh r2, [r0, #0xC]
      	lsr r2, r2, #0x1
      	ldrh r0, [r0, #0x8]
      	cmp r0, r2
      	bgt Return
      	mov r2, r8
      	lsr r0, r2, #0x1
      	mov r8, r0
      	b AttackDrop
      SlowStart:
      	cmp r4, #0x71
      	bne Return
      CheckCounter:
      	ldr r0, .SlowStartLoc
      	ldr r2, [sp, #0xC]
      	add r0, r0, r2
      	ldrb r0, [r0]
      	cmp r0, #0x0
      	beq Return
      AttackDrop:
      	lsr r7, r7, #0x1
      Return:
      	ldr r0, .Return
      	bx r0
      
      .align 2
      .CritLoc: .word 0x02023D71
      .BasePower: .word 0x02024020
      .SlowStartLoc: .word 0x0203C024
      .Return: .word 0x0803F065
      
      #Insert 00 48 00 47 xx xx xx 08 at 03F05C
      .SlowStartLoc is a free ram location that you can use to have the counter for slow start.

      It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.

      Emerald
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global damagecalchalve
       
      Main:
      	cmp r4, #0x37
      	bne Sniper
      HustleBoost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      Sniper:
      	cmp r4, #0x62
      	bne Technician
      CheckCrit:
      	ldr r0, .CritLoc
      	ldrb r0, [r0]
      	cmp r0, #0x2
      	bne Return
      	b Boost
      Technician:
      	cmp r4, #066
      	bne Defeatist
      CheckBasePower:
      	ldr r0, .BasePower
      	ldrb r0, [r0]
      	cmp r0, #0x3D
      	bge Return
      Boost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      	mov r2, r8
      	lsr r0, r2, #0x1
      	add r0, r0, r2
      	mov r8, r0
      Defeatist:
      	cmp r4, #066
      	bne SlowStart
      CheckHP:
      	ldrh r2, [r0, #0xC]
      	lsr r2, r2, #0x1
      	ldrh r0, [r0, #0x8]
      	cmp r0, r2
      	bgt Return
      	mov r2, r8
      	lsr r0, r2, #0x1
      	mov r8, r0
      	b AttackDrop
      SlowStart:
      	cmp r4, #0x71
      	bne Return
      CheckCounter:
      	ldr r0, .SlowStartLoc
      	ldr r2, [sp, #0x10]
      	add r0, r0, r2
      	ldrb r0, [r0]
      	cmp r0, #0x0
      	beq Return
      AttackDrop:
      	lsr r7, r7, #0x1
      Return:
      	ldr r0, .Return
      	bx r0
      
      .align 2
      .CritLoc: .word 0x02024211
      .BasePower: .word 0x020244E0
      .SlowStartLoc: .word 0x0203E324
      .Return: .word 0x0806989B
      
      #Insert 00 48 00 47 xx xx xx 08 at 069888
      .SlowStartLoc is a free ram location that you can use to have the counter for slow start.

      It has come to my attention that Technician can apply some unwanted boosts to Revenge and a few other moves, so the code will be amended in the future.

      Toxic Boost and Flare Boost
      Spoiler:
      Fire Red
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global statusboostabilities
       
      Main:
        	ldr r1, [sp, #0x24]
      	ldrb r0, [r1]
      	cmp r0, #0x8A
      	beq ToxicBoost
      	cmp r0, #0x8B
      	beq FlareBoost
      	cmp r0, #0x3E
      	bne MarvelScaleCheck
      GutsReturn:
      	ldr r0, .Return
      	bx r0
      ToxicBoost:
      	ldr r0, [r6, #0x4C]
      CheckPoison:
      	cmp r0, #0x8
      	beq AttackBoost
      	cmp r0, #0x80
      	bne MarvelScaleCheck
      AttackBoost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      	b MarvelScaleCheck
      FlareBoost:
      	ldr r0, [r6, #0x4C]
      CheckBurn:
      	cmp r0, #0x10
      	bne MarvelScaleCheck
      SpAtkBoost:
      	mov r2, r8
      	lsr r0, r2, #0x1
      	add r2, r0, r2
      	mov r8, r2
      MarvelScaleCheck:
      	ldr r0, .Return2
      	bx r0
       
      .align 2
      .Return: .word 0x0803F0CD
      .Return2: .word 0x0803F0E1
      
      #insert 00 48 00 47 xx xx xx 08 at 03F0C4

      Emerald
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global statusboostabilities
       
      Main:
      	ldrb r0, [r1]
      	cmp r0, #0x8A
      	beq ToxicBoost
      	cmp r0, #0x8B
      	beq FlareBoost
      	cmp r0, #0x3E
      	bne MarvelScaleCheck
      Guts:
      CheckStatus:
      	ldr r0, [r6, #0x4C]
      	cmp r0, #0x0
      	beq MarvelScaleCheck
      GutsReturn:
      	ldr r0, .Return
      	bx r0
      ToxicBoost:
      	ldr r0, [r6, #0x4C]
      CheckPoison:
      	cmp r0, #0x8
      	beq AttackBoost
      	cmp r0, #0x80
      	bne MarvelScaleCheck
      AttackBoost:
      	lsr r0, r7, #0x1
      	add r7, r0, r7
      	b MarvelScaleCheck
      FlareBoost:
      	ldr r0, [r6, #0x4C]
      CheckBurn:
      	cmp r0, #0x10
      	bne MarvelScaleCheck
      SpAtkBoost:
      	mov r2, r8
      	lsr r0, r2, #0x1
      	add r2, r0, r2
      	mov r8, r2
      MarvelScaleCheck:
      	ldr r0, .Return2
      	bx r0
       
      .align 2
      .Return: .word 0x08069909
      .Return2: .word 0x08069917
      
      #insert 00 48 00 47 xx xx xx 08 at 0698FC

      Multiscale and Fur Coat
      Spoiler:
      Fire Red
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global multiscaleandfurcoat
       
      Main:
      	ldr r2, [sp, #0x28]
      	ldrb r0, [r2]
      	cmp r0, #0x3F
      	bne Multiscale
      	ldr r0, .Return
      	bx r0
      Multiscale:
      	cmp r0, #0x89
      	bne FurCoat
      CheckHP:
      	ldr r1, [sp, #0x4]
      	ldrh r0, [r1, #0x28]
      	ldrh r1, [r1, #0x2C]
      	cmp r1, r0
      	bne Return
      HalveDamage:
      	lsr r7, r7, #0x1
      	mov r0, r8
      	lsr r0, r0, #0x1
      	mov r8, r0
      FurCoat:
      	ldrb r0, [r2]
      	cmp r0, #0xAA
      	bne Return
      DefenseBoost:
      	ldr r1, [sp, #0x14]
      	mov r0, r1
      	add r1, r0, r0
      	str r1, [sp, #0x14]
      Return:
      	ldr r2, .Return2
      	bx r2
      
      .align 2
      .Return: .word 0x0803F0E9
      .Return2: .word 0x0803F103
      
      #insert 00 48 00 47 xx xx xx 08 at 03F0E0

      Emerald
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global multiscaleandfurcoat
       
      Main:
      	ldrb r0, [r2]
      	cmp r0, #0x3F
      	bne Multiscale
      	ldr r3, [sp, #0x4]
      	ldr r0, .Return
      	bx r0
      Multiscale:
      	cmp r0, #0x89
      	bne FurCoat
      CheckHP:
      	ldr r1, [sp, #0x4]
      	ldrh r0, [r1, #0x28]
      	ldrh r1, [r1, #0x2C]
      	cmp r1, r0
      	bne Return
      HalveDamage:
      	lsr r7, r7, #0x1
      	mov r0, r8
      	lsr r0, r0, #0x1
      	mov r8, r0
      FurCoat:
      	ldrb r0, [r2]
      	cmp r0, #0xAA
      	bne Return
      DefenseBoost:
      	ldr r1, [sp, #0x18]
      	mov r0, r1
      	add r1, r0, r0
      	str r1, [sp, #0x18]
      Return:
      	ldr r2, .Return2
      	bx r2
      
      .align 2
      .Return: .word 0x08069921
      .Return2: .word 0x08069939
      
      #insert 00 48 00 47 xx xx xx 08 at 069918

      Sturdy
      Spoiler:
      Fire Red
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global sturdyupdate
       
      Sturdy:
      	ldrb r0, [r3]
      	mov r1, #0x58
      	mul r0, r1
      	add r0, r0, r2
      	add r0, #0x20
      	ldrb r1, [r0]
      	cmp r1, #0x5
      	bne FalseSwipeCheck
      CheckHP:
      	ldrh r1, [r0, #0xC]
      	ldrh r0, [r0, #0x8]
      	cmp r0, r1
      	beq SturdySuccess
      FalseSwipeCheck:
      	ldr r0, .MoveLoc
      	ldrh r1, [r0]
      	lsl r0, r1, #0x1
      	add r0, r0, r1
      	ldr r2, .Return
      	bx r2
      SturdySuccess:
      DisplayEndureMessage:
      	mov r0, #0x56
      	ldr r1, .Index
      	ldrb r2, [r3]
      	lsl r0, r2, #0x4
      	add r0, r0, r1
      	mov r1, #0x2
      	strb r1, [r0]
      Return:
      	ldr r0, .Return2
      	bx r0
      
      .align 2
      
      .MoveLoc: .word 0x02023D4A
      .Return: .word 0x0801F1ED
      .Index: .word 0x02023E8C
      .Return2: .word 0x0801F217
      
      #insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2
      It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.

      Emerald
      Spoiler:
      Code:
      .text
      .align 2
      .thumb
      .thumb_func
      .global sturdyupdate
       
      Sturdy:
      	ldrb r0, [r3]
      	mov r1, #0x58
      	mul r0, r1
      	add r0, r0, r2
      	add r0, #0x20
      	ldrb r1, [r0]
      	cmp r1, #0x5
      	bne FalseSwipeCheck
      CheckHP:
      	ldrh r1, [r0, #0xC]
      	ldrh r0, [r0, #0x8]
      	cmp r0, r1
      	beq SturdySuccess
      FalseSwipeCheck:
      	ldr r0, .MoveLoc
      	ldrh r1, [r0]
      	lsl r0, r1, #0x1
      	add r0, r0, r1
      	ldr r2, .Return
      	bx r2
      SturdySuccess:
      DisplayEndureMessage:
      	mov r0, #0x56
      	ldr r1, .Index
      	ldrb r2, [r3]
      	lsl r0, r2, #0x4
      	add r0, r0, r1
      	mov r1, #0x2
      	strb r1, [r0]
      Return:
      	ldr r0, .Return2
      	bx r0
      
      .align 2
      
      .MoveLoc: .word 0x020241EA
      .Return: .word 0x080479DD
      .Index: .word 0x0202433C
      .Return2: .word 0x08047A07
      
      #insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 0479D2
      It should be noted that this doesn't work fully with Multi-hit moves, in that they do not break Sturdy. I am planning on rewriting the entire Multi-hit system to make Parental Bond.
      __________________
      Reply With Quote
        #3    
      Old January 30th, 2015 (2:52 AM). Edited January 30th, 2015 by You Watanabe.
      You Watanabe's Avatar
      You Watanabe You Watanabe is offline
      Now Leaving...
         
        Join Date: Feb 2014
        Location: Shiganshina District, Wall Maria
        Gender: Female
        Nature: Adamant
        Posts: 430
        It is an excellent thing that someone finally made this kind of thread. Keep it up dude!
        It is kinda bit complicated for me about how abilities are triggered when in need. Well, I'm off to study them.

        EDIT: One good question: if two routines (one is old and one is latest but different abilities) collides when "insert this at whatever offset", will you rewrite the asm? I don't know if you understand this question and I don't also know if this will possible in progress.

        EDIT2: Ported the new Sturdy... there is a bug/error at: In the same turn, if the faster one attacks the enemy then enemy activates sturdy then the enemy uses a status move that affects with snatch, there will be a message appear that is snatch related. I don't know if you can understand this but do a battle in the same turn that you attack first that makes that sturdy effect on the enemy and the enemy uses a status move that affects snatch so you will see what I mean. It snatched itself. A status move used in the next turn after sturdy's turn still works fine (no snatch message). Noted that I have applied expansion of pokemon, types, attacks, abilities, and the pss patch and icons whenever I'm going to post some errors dude.
        __________________

        Userpage


        Pokémon Dark Jade Version (Coming Soon!)


        The Omsoc Empire (Coming Soon!)
        Reply With Quote
          #4    
        Old January 31st, 2015 (12:50 AM). Edited April 28th, 2015 by Chacha Dinosaur.
        Chacha Dinosaur's Avatar
        Chacha Dinosaur Chacha Dinosaur is offline
        Adamant and adaptive dinosaur.
           
          Join Date: Jul 2013
          Age: 23
          Gender: Male
          Posts: 454
          There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
          Here it is posted with Moxie.

          Magic Bounce
          Spoiler:
          Fire Red

          For MrDS's base 1.5a at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines to remove branch to the old routine.

          Spoiler:
          Routine At XXXXXX:
          Spoiler:
          Code:
          .text
          .align 2
          .thumb
          .thumb_func
          .global magicbounce
          .align 2
               
                  mov r9, r2
                  ldr r1, freeRAMLoc
                  ldrb r1, [r1, #0x0]
                  cmp r1, #0x0
                  bne nobouncing
                  cmp r0, #0x0
                  bge magicbouncecheck
                  
                  ldr r2, moveTable
                  ldr r1, =0x0801D8E9
                  bx r1
          
          magicbouncecheck:
                  ldr r2, =0x02023C04
                  ldr r1, =0x02023D6C
                  ldrb r3, [r1, #0x0]
                  mov r1, #0x58
                  mul r1, r3
                  add r1, r1, r2
                  ldrb r1, [r1, #0x0]
                  cmp r1, #0x9D
                  bne nobouncing
          
                  ldr r2, =0x02023DFC
                  lsl r1, r3, #0x02
                  add r1, r1, r2
                  ldr r1, [r1, #0x0]
                  ldr r0, =0x000400C0
                  and r0, r1
                  cmp r0, #0x0
                  bne nobouncing
          
                  ldr r2, moveTable
                  ldr r0, =0x02023D4A
                  ldrh r1, [r0, #0x0]
                  lsl r0, r1, #0x01
                  add r0, r0, r1
                  lsl r0, r0, #0x02
                  add r0, r0, r2
                  ldrb r1, [r0, #0x8]
                  mov r0, #0x4
                  and r0, r1
                  cmp r0, #0x0
                  beq nobouncing 
          
                  ldr r0, =0x02023D6B
                  ldrb r0, [r0, #0x0]
                  ldr r2, =0x00000115
                  add r1, r3, #0x0
                  bl pressure
          
                  bl returnSetter
          
                  ldr r1, =0x02023D74
                  ldr r0, MBScript
                  str r0, [r1, #0x0]
                  ldr r0, =0x0801DAFD
                  bx r0
          
          nobouncing:
                  ldr r1, =0x0801D94D
                  bx r1
          
          pressure:
                  ldr r3, =0x08016EC9
                  bx r3
          
          returnSetter:
                  ldr r1, =0x08017545
                  bx r1
          
          .align 2
          freeRAMLoc: .word 0x0203C030
          moveTable: .word 0x08250C04
          MBScript: .word 0x08VVVVVV
          
          @At 1D8E0, insert: 00 49 08 47 XX+1 XX XX 08


          Routine At YYYYYY:
          Spoiler:
          Code:
          .text
          .align 2
          .thumb
          .thumb_func
          .global bounceflagclear
          .align 2
          
          ldr r3, freeRAMLoc
          ldrb r0, [r3, #0x0]
          cmp r0, #0x0
          beq exit
          sub r0, r0, #0x1
          strb r0, [r3, #0x0]
          
          exit:
          add sp, #0x4
          pop {r3, r4}
          mov r8, r3
          mov r9, r4
          pop {r4-r7}
          pop {r0}
          bx r0
          
          .align 2
          freeRAMLoc: .word 0x0203C030
          
          @At 1DAFC, insert: 00 48 00 47 YY+1 YY YY 08


          Routine At ZZZZZZ:
          Spoiler:
          Code:
          .text
          .align 2
          .thumb
          .thumb_func
          .global setbouncereflectionflag
          
          main:    
              push {lr}
              ldr r0, freeRAMLoc
              ldr r1, =0x02023BCC
              ldrb r1, [r1, #0x0]
              cmp r1, #0x2
              beq oneexit
          
              ldr r2, =0x02023D4A
              ldr r1, moveTable
              mov r3, #0xC
              ldrb r2, [r2, #0x0]
              mul r3, r2
              add r1, r1, r3
              ldrb r1, [r1, #0x6]
              cmp r1, #0x8
              bne oneexit
          
              ldr r2, =0x02023D6D
              ldrb r2, [r2, #0x0]
              mov r1, #0x58
              mul r1, r2
              ldr r3, =0x02023C0C
              add r3, r3, r1
              ldrh r3, [r3, #0x0]
              cmp r3, #0x0
              beq oneexit
          
              mov r1, #0x2
              strb r1, [r0, #0x0]
              pop {r0}
              bx r0
          
          oneexit:
              mov r1, #0x1
              strb r1, [r0, #0x0]
              pop {r0}
              bx r0
          
          .align 2
          freeRAMLoc: .word 0x0203C030
          moveTable: .word 0x08250C04


          Magic Coat Script (At UUUUUU):
          Spoiler:
          At x1D934, insert in reverse hex: UU UU UU 08
          Code:
          02 03 39 20 00 10 BE 00 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


          Magic Bounce Script (At VVVVVV):
          Spoiler:
          Code:
          02 03 39 20 00 FA 20 C0 03 02 SS SS SS 08 10 84 01 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


          String At SSSSSS:
          Code:
          FD 13 B4 E7 00 FD 14 FE EB D5 E7 00 D6 E3 E9 E2 D7 D9 D8 00 D6 D5 D7 DF 00 D6 ED 00 FD 1B AB FF
          Notes to understand this:
          Spoiler:

          + If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
          + Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
          + Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
          + A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
          + If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
          + This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
          + The free RAM location refered in the 3 routines MUST BE SAME.
          + Will port to Emerald soon.




          Moxie
          Spoiler:
          Fire Red
          Spoiler:
          At x213DC, insert in reverse hex: XX XX XX 08

          Battle Script at XXXXXX:
          Spoiler:
          Code:
          56 00
          39 40 00
          1A 00
          1B 00
          10 1D 00
          10 30 01
          1E 01 9A YY YY YY 08
          3C


          Battle Script at YYYYYY:
          Spoiler:
          Code:
          E3 01 ZZ ZZ ZZ 08
          20 01 00 01 0C ZZ ZZ ZZ 08
          39 20 00
          2E DF 3F 02 02 00
          48 01 02 00
          2E DE 3F 02 02 11
          89 41 ZZ ZZ ZZ 08
          FA 20 C0 03 02 SS SS SS 08 
          10 84 01
          12 40 00
          3C


          Battle Script at ZZZZZZ:
          Code:
          3C
          String at SSSSSS:
          Code:
          FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF


          Emerald
          Spoiler:

          At x49C8C insert in reverse hex: XX XX XX 08

          Battle Script at XXXXXX:
          Spoiler:
          Code:
          56 00
          39 40 00
          1A 00
          1B 00
          10 1D 00
          10 30 01
          1E 01 9A YY YY YY 08
          3C


          Battle Script at YYYYYY:
          Spoiler:
          Code:
          E3 01 ZZ ZZ ZZ 08
          20 01 00 01 0C ZZ ZZ ZZ 08
          39 20 00
          2E 8F 44 02 02 00
          48 01 02 00
          2E 8E 44 02 02 11
          89 41 ZZ ZZ ZZ 08
          FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
          10 84 01
          12 40 00
          3C


          Battle Script at ZZZZZZ:
          Code:
          3C
          String At SSSSSS:
          Code:
          FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF



          Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
          Reply With Quote
            #5    
          Old January 31st, 2015 (1:04 AM).
          Lance32497's Avatar
          Lance32497 Lance32497 is offline
          LanceKoijer of Pokemon_Addicts
             
            Join Date: Aug 2014
            Location: Criscanto town-Ginoa Region xD
            Gender: Male
            Nature: Adamant
            Posts: 793
            Finally
            This is what I'm waiting for!
            __________________
            This signature has been disabled.
            Scrollbar appears
            Please review and fix the issues by reading the signature rules.

            You must edit it to meet the limits set by the rules before you may remove the [sig-reason] code from your signature. Removing this tag will re-enable it.

            Do not remove the tag until you fix the issues in your signature. You may be infracted for removing this tag if you do not fix the specified issues. Do not use this tag for decoration purposes.
            Reply With Quote
              #6    
            Old February 1st, 2015 (5:55 PM).
            HidoranBlaze's Avatar
            HidoranBlaze HidoranBlaze is offline
               
              Join Date: Apr 2013
              Age: 21
              Gender: Male
              Posts: 253
              Quote:
              Originally Posted by RaileysXerilyasRX View Post
              It is an excellent thing that someone finally made this kind of thread. Keep it up dude!
              It is kinda bit complicated for me about how abilities are triggered when in need. Well, I'm off to study them.

              EDIT: One good question: if two routines (one is old and one is latest but different abilities) collides when "insert this at whatever offset", will you rewrite the asm? I don't know if you understand this question and I don't also know if this will possible in progress.

              EDIT2: Ported the new Sturdy... there is a bug/error at: In the same turn, if the faster one attacks the enemy then enemy activates sturdy then the enemy uses a status move that affects with snatch, there will be a message appear that is snatch related. I don't know if you can understand this but do a battle in the same turn that you attack first that makes that sturdy effect on the enemy and the enemy uses a status move that affects snatch so you will see what I mean. It snatched itself. A status move used in the next turn after sturdy's turn still works fine (no snatch message). Noted that I have applied expansion of pokemon, types, attacks, abilities, and the pss patch and icons whenever I'm going to post some errors dude.
              That's a bug MrDS and I encountered when we were making sturdy. It's fixed in the FR version, but not EM's for some reason (probably a goof on Dollsteak's part). At DisplayEndureMessage, change mov r1, #0x32 to mov r1, #0x2.
              Reply With Quote
                #7    
              Old February 12th, 2015 (12:58 AM).
              Urobolos Urobolos is offline
                 
                Join Date: Nov 2014
                Posts: 15
                Quote:
                Originally Posted by KDS View Post
                Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.
                Where can I find the files to patch those in.

                Also, would this work with the Mr Dollsteak's Decap Patch?
                Reply With Quote
                  #8    
                Old February 13th, 2015 (3:04 PM).
                Z-nogyroP Z-nogyroP is offline
                   
                  Join Date: May 2014
                  Age: 16
                  Gender: Male
                  Posts: 107
                  Alright, I tried implementing the Sturdy for FireRed with MrDollSteak's patch applied to it, but the game froze when I tried the opposing Tepig used Overheat on my Turtwig. At first I thought it was an issue with Overheat, so I tried changing it to Blast Burn, but same thing happened. Note that both times I used Withdraw on the first turn. I tried again, but I used Tackle, and it froze. I wondered if it was an issue with the Rombase and not being compatible, so I went to a clean FireRed ROM, inserted it there, and it happened again. Am I doing something wrong, or can someone else verify that the Sturdy routine is messed up?
                  Reply With Quote
                    #9    
                  Old February 13th, 2015 (11:15 PM).
                  ShyRayq's Avatar
                  ShyRayq ShyRayq is offline
                  Unprofessional Unprofessional
                     
                    Join Date: Aug 2007
                    Gender: Male
                    Nature: Adamant
                    Posts: 1,532
                    Quote:
                    Originally Posted by Z-nogyroP View Post
                    Alright, I tried implementing the Sturdy for FireRed with MrDollSteak's patch applied to it, but the game froze when I tried the opposing Tepig used Overheat on my Turtwig. At first I thought it was an issue with Overheat, so I tried changing it to Blast Burn, but same thing happened. Note that both times I used Withdraw on the first turn. I tried again, but I used Tackle, and it froze. I wondered if it was an issue with the Rombase and not being compatible, so I went to a clean FireRed ROM, inserted it there, and it happened again. Am I doing something wrong, or can someone else verify that the Sturdy routine is messed up?
                    When you placed the hook in, did you add 1 to the routine's pointer? Because you need to do that. If you did, I'm not sure what the problem is.
                    __________________
                    3DS Friend Code: 5069-3944-3902
                    IGN: Peter; (X, Y, OR, AS, S, M)
                    Friend Safari: (Fighting) Throh, Meditite, Breloom
                    Living Pokedex Complete: LG, E, Pl, B, B2, Y, OR, M
                    Big thanks especially to DestinedJagold, Xerneas_X, Elements1 and ~RNC~

                    PM me if you want to trade, or add my FC.
                    Reply With Quote
                      #10    
                    Old February 14th, 2015 (5:08 AM).
                    Z-nogyroP Z-nogyroP is offline
                       
                      Join Date: May 2014
                      Age: 16
                      Gender: Male
                      Posts: 107
                      ...durr, I pulled a dumb. Works perfectly now! Thank you!

                      Also, do you plan on adding these abilities to your ROMbase if they aren't already there (like the upgraded Sturdy, and KDS's new Magic Bounce)?
                      Reply With Quote
                        #11    
                      Old February 15th, 2015 (2:27 AM).
                      AtecainCorp.'s Avatar
                      AtecainCorp. AtecainCorp. is online now
                      Rejishan awake...
                         
                        Join Date: Jun 2008
                        Location: Takoabe Town (Region Thonsu)
                        Age: 24
                        Gender: Male
                        Nature: Hardy
                        Posts: 1,270
                        Quote:
                        Originally Posted by KDS View Post
                        There was a report mentioning problems with the Magic Bounce Ability in MrDS's Rombase, so I decided it to implement this myself from scratch, and it is working fine in Trainer Battles and Doubles.
                        Here it is posted with Moxie.

                        Magic Bounce
                        Spoiler:
                        Fire Red
                        Spoiler:
                        Routine At XXXXXX:
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global magicbounce
                        .align 2
                             
                                mov r9, r2
                                ldr r1, freeRAMLoc
                                ldrb r1, [r1, #0x0]
                                cmp r1, #0x0
                                bne nobouncing
                                cmp r0, #0x0
                                bge magicbouncecheck
                                
                                ldr r2, moveTable
                                ldr r1, =0x0801D8E9
                                bx r1
                        
                        magicbouncecheck:
                                ldr r2, =0x02023C04
                                ldr r1, =0x02023D6C
                                ldrb r3, [r1, #0x0]
                                mov r1, #0x58
                                mul r1, r3
                                add r1, r1, r2
                                ldrb r1, [r1, #0x0]
                                cmp r1, #0x9D
                                bne nobouncing
                        
                                ldr r2, =0x02023DFC
                                lsl r1, r3, #0x02
                                add r1, r1, r2
                                ldr r1, [r1, #0x0]
                                ldr r0, =0x000400C0
                                and r0, r1
                                cmp r0, #0x0
                                bne nobouncing
                        
                                ldr r2, moveTable
                                ldr r0, =0x02023D4A
                                ldrh r1, [r0, #0x0]
                                lsl r0, r1, #0x01
                                add r0, r0, r1
                                lsl r0, r0, #0x02
                                add r0, r0, r2
                                ldrb r1, [r0, #0x8]
                                mov r0, #0x4
                                and r0, r1
                                cmp r0, #0x0
                                beq nobouncing 
                        
                                ldr r0, =0x02023D6B
                                ldrb r0, [r0, #0x0]
                                ldr r2, =0x00000115
                                add r1, r3, #0x0
                                bl pressure
                        
                                bl returnSetter
                        
                                ldr r1, =0x02023D74
                                ldr r0, MBScript
                                str r0, [r1, #0x0]
                                ldr r0, =0x0801DAFD
                                bx r0
                        
                        nobouncing:
                                ldr r1, =0x0801D94D
                                bx r1
                        
                        pressure:
                                ldr r3, =0x08016EC9
                                bx r3
                        
                        returnSetter:
                                ldr r1, =0x08017545
                                bx r1
                        
                        .align 2
                        freeRAMLoc: .word 0x0203C030
                        moveTable: .word 0x08250C04
                        MBScript: .word 0x08VVVVVV
                        
                        @At 1D8E0, insert: 00 49 08 47 XX+1 XX XX 08


                        Routine At YYYYYY:
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global bounceflagclear
                        .align 2
                        
                        ldr r3, freeRAMLoc
                        ldrb r0, [r3, #0x0]
                        cmp r0, #0x0
                        beq exit
                        sub r0, r0, #0x1
                        strb r0, [r3, #0x0]
                        
                        exit:
                        add sp, #0x4
                        pop {r3, r4}
                        mov r8, r3
                        mov r9, r4
                        pop {r4-r7}
                        pop {r0}
                        bx r0
                        
                        .align 2
                        freeRAMLoc: .word 0x0203C030
                        
                        @At 1DAFC, insert: 00 48 00 47 YY+1 YY YY 08


                        Routine At ZZZZZZ:
                        Spoiler:
                        Code:
                        .text
                        .align 2
                        .thumb
                        .thumb_func
                        .global setbouncereflectionflag
                        
                        main:    
                            push {lr}
                            ldr r0, freeRAMLoc
                            ldr r1, =0x02023BCC
                            ldrb r1, [r1, #0x0]
                            cmp r1, #0x2
                            beq oneexit
                        
                            ldr r2, =0x02023D4A
                            ldr r1, moveTable
                            mov r3, #0xC
                            ldrb r2, [r2, #0x0]
                            mul r3, r2
                            add r1, r1, r3
                            ldrb r1, [r1, #0x6]
                            cmp r1, #0x8
                            bne oneexit
                        
                            ldr r2, =0x02023D6D
                            ldrb r2, [r2, #0x0]
                            mov r1, #0x58
                            mul r1, r2
                            ldr r3, =0x02023C0C
                            add r3, r3, r1
                            ldrh r3, [r3, #0x0]
                            cmp r3, #0x0
                            beq oneexit
                        
                            mov r1, #0x2
                            strb r1, [r0, #0x0]
                            pop {r0}
                            bx r0
                        
                        oneexit:
                            mov r1, #0x1
                            strb r1, [r0, #0x0]
                            pop {r0}
                            bx r0
                        
                        .align 2
                        freeRAMLoc: .word 0x0203C030
                        moveTable: .word 0x08250C04


                        Magic Coat Script (At UUUUUU):
                        Spoiler:
                        At x1D934, insert in reverse hex: UU UU UU 08
                        Code:
                        02 03 39 20 00 10 BE 00 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


                        Magic Bounce Script (At VVVVVV):
                        Spoiler:
                        Code:
                        02 03 39 20 00 FA 20 C0 03 02 SS SS SS 08 10 84 01 12 40 00 F8 ZZ+1 ZZ ZZ 08 35 D0 3D 02 02 00 0C 80 00 76 01 01 3C


                        String At SSSSSS:
                        Code:
                        FD 13 B4 E7 00 FD 14 FE EB D5 E7 00 D6 E3 E9 E2 D7 D9 D8 00 D6 D5 D7 DF 00 D6 ED 00 FD 1B AB FF
                        Notes to understand this:
                        Spoiler:

                        + If for some stupid reason, Magic Coat is used on a Magic Bounce pokemon, then Magic coat activates before Magic bounce.
                        + Magic Bounce does not activate, if the mon with Magic Bounce is in a semi-invulnerable state (fly, dive etc.).
                        + Added a special Flag to ensure that Magic Bounce does not re-reflect a move reflected by Magic Bounce/Magic Coat. Otherwise, a infinite ping-pong loop happens between two Magic Bounce pokemon.
                        + A free RAM location is used for this Flag. Initially, it is set to 0. When the condition for Magic Coat or Magic Bounce is met, it is set to 1 (e.g, always the case in singles, reflected spore in doubles) or 2 (e.g reflected growl in doubles), according to the no. of mons the rebounded Move can affect, and then the Rebound is executed.
                        + If the value of the Flag is non-zero, the Magic Bounce and Magic Coat checks are automatically skipped to avoid the re-reflection situation and the Flag is decremented by 1 and this Step is repeated until the Flag is cleared to 0.
                        + This to try to ensure that during the Rebound itself, the Flag is successfully cleared to 0.
                        + The free RAM location refered in the 3 routines MUST BE SAME.
                        + Will port to Emerald soon.




                        Moxie
                        Spoiler:
                        Fire Red
                        Spoiler:
                        At x213DC, insert in reverse hex: XX XX XX 08

                        Battle Script at XXXXXX:
                        Spoiler:
                        Code:
                        56 00
                        39 40 00
                        1A 00
                        1B 00
                        10 1D 00
                        10 30 01
                        1E 01 9A YY YY YY 08
                        3C


                        Battle Script at YYYYYY:
                        Spoiler:
                        Code:
                        E3 01 ZZ ZZ ZZ 08
                        20 01 00 01 0C ZZ ZZ ZZ 08
                        39 20 00
                        2E DF 3F 02 02 00
                        48 01 02 00
                        2E DE 3F 02 02 11
                        89 41 ZZ ZZ ZZ 08
                        FA 20 C0 03 02 SS SS SS 08 
                        10 84 01
                        12 40 00
                        3C


                        Battle Script at ZZZZZZ:
                        Code:
                        3C
                        String at SSSSSS:
                        Code:
                        FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF


                        Emerald
                        Spoiler:

                        At x49C04, insert in reverse hex: XX XX XX 08

                        Battle Script at XXXXXX:
                        Spoiler:
                        Code:
                        56 00
                        39 40 00
                        1A 00
                        1B 00
                        10 1D 00
                        10 30 01
                        1E 01 9A YY YY YY 08
                        3C


                        Battle Script at YYYYYY:
                        Spoiler:
                        Code:
                        E3 01 ZZ ZZ ZZ 08
                        20 01 00 01 0C ZZ ZZ ZZ 08
                        39 20 00
                        2E 8F 44 02 02 00
                        48 01 02 00
                        2E 8E 44 02 02 11
                        89 41 ZZ ZZ ZZ 08
                        FB 20 E3 03 02 SS SS SS 08 //Assuming that setword command is at FB, and the RAM location for the string pointer is at 0x203E320. If not, then change this line accordingly
                        10 84 01
                        12 40 00
                        3C


                        Battle Script at ZZZZZZ:
                        Code:
                        3C
                        String At SSSSSS:
                        Code:
                        FD 0F B4 E7 00 C7 E3 EC DD D9 FE E6 D5 DD E7 D9 D8 00 DD E8 E7 00 BB E8 E8 D5 D7 DF AB FF



                        Also, these require Jambo's Callasm and Setword commands, and his Battle String Loader Hack.

                        Someone can traslate me MOXIE effect for Pokemon Fire Red? I'm confused.
                        __________________
                        - My new Project comming Soon
                        Reply With Quote
                          #12    
                        Old February 16th, 2015 (9:43 AM).
                        Z-nogyroP Z-nogyroP is offline
                           
                          Join Date: May 2014
                          Age: 16
                          Gender: Male
                          Posts: 107
                          If I may make a suggestion? I think it would be very useful to upload the codes for Mega Launcher and Reckless, because those abilities (boost moves if they are in a certain table) could be very useful in making "new" abilities. Just a thought.
                          Reply With Quote
                            #13    
                          Old February 28th, 2015 (7:46 AM). Edited November 11th, 2015 by Chacha Dinosaur.
                          Chacha Dinosaur's Avatar
                          Chacha Dinosaur Chacha Dinosaur is offline
                          Adamant and adaptive dinosaur.
                             
                            Join Date: Jul 2013
                            Age: 23
                            Gender: Male
                            Posts: 454
                            Re: Urobolos

                            Sorry the for the late reply. The callasm command and battle string loader hack are posted in the Quick R&D thread and these things are already installed in MrDS' Patch.

                            Re: AtecianCorp.

                            Lol, you just the need to make the byte changes mentioned the post in a Hex Editor and install Jambo's battle string and setword command.

                            Anyway, here are some more abilities!

                            1. Mold Breaker, Teravolt and Turboblaze:
                            Spoiler:
                            Fire Red:
                            Spoiler:
                            Step I
                            Spoiler:
                            Mold Breaker Table:-
                            Code:
                            00 00 00 00 01 01 00 01 01 00 01 01 01 00 00 01 
                            00 02 01 01 01 01 00 00 00 01 02 00 00 01 00 00 
                            00 00 00 00 00 00 00 01 01 01 00 01 00 00 00 01 
                            00 00 00 01 01 00 00 00 00 00 00 00 01 00 00 01 
                            00 00 00 00 00 00 00 00 01 01 00 01 00 00 01 01 
                            00 00 01 00 00 00 01 01 01 00 00 00 00 00 00 00 
                            00 00 00 00 00 00 00 02 00 00 00 00 00 00 01 00 
                            01 00 00 00 00 01 00 00 00 00 00 01 00 00 00 01 
                            00 00 00 00 00 00 00 01 01 01 00 00 00 01 00 01 
                            00 00 01 00 01 00 00 00 00 00 00 00 00 01 01 00 
                            00 00 00 00 00 00 00 00 00 00 01 00 01 00 00 00 
                            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
                            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
                            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
                            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
                            00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
                            Insert this table if your ROM has Ability Indices in the same order as that mentioned in the OP (Otherwise you need to modify the table using the Info given below)
                            There are 256 entries in this table which equal to the maximum No. of abilities that can be accommodated in a GBA rom.

                            An entry for each ability takes one byte of space and there are entries for every ability. The entry is set to 00 if Mold Breaker does not negate the Ability, 01 (or a non-zero value) if Mold Breaker is able to negate it and 02 if the Ability is negated by Mold Breaker to simulate the Gen V hazard effect.

                            For e.g, the first entry is for Ability ID 0x0, the Blank Ability, so it does not need to be checked against Mold Breaker and therefore its entry should be set to 00. The second entry is for Stench (ID = 0x1) so set to 00. The 6th entry is set to 01 because MB negates Sturdy (ID = 0x5).

                            There are some abilities that are not supported by this implementation and require specific explicit Mold Breaker checks. Hence, their entry is set to 00 to avoid wastage of time.
                            Spoiler:

                            1. Damp (It checks the whole battle field for presence of Damp rather than a single target, so the 'faintifnotdamp' battlescript command needs to be modified for this. I'm leaving this for now because I'm lazy

                            2. Lightning and Storm Drain (Mold Breaker should allow redirection of move).

                            3. Friend Guard, Aroma Veil, Sweet Veil, Flower Veil (The target's boosts are sometimes by virtue of its Ally's Ability).



                            Modify the table accordingly if there is a need to.

                            Step II
                            Spoiler:
                            1a. Replace x8TTTTTT in the routines with the offset of the Mold breaker table.
                            1b. Insert these routines with byte changes in the respective code comments.

                            Routine I (Checks for user's Mold Breaker prior to move execution and then disables Abilities that are negated by Mold Breaker)
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global moldbreaker
                                 
                            AbilityBufferUser:
                                 	push {r2-r4}
                            	ldr r0, .Bank
                            	ldr r0, [r0]
                            	mov r1, #0x58
                            	ldr r2, .BattleData
                            	mul r0, r1
                            	add r0, r0, r2
                            	ldrb r0, [r0]
                            MoldBreakerCheck:
                            	cmp r0, #0x69
                               	beq MoldBreaker
                                	cmp r0, #0xA4
                                	beq MoldBreaker
                                	cmp r0, #0xA5
                                	bne Return
                            MoldBreaker:
                            AbilityBufferTarget:
                                 	ldr r0, .Bank
                            	add r0, #0x1
                                 	ldrb r4, [r0]
                            	mul r1, r4 
                            	add r1, r1, r2 
                                 	ldrb r3, [r1]
                            LoadTable:
                                 	ldr r0, .MoldBreakerTable
                               	add r2, r0, r3
                                 	ldrb r0, [r2]
                            CheckIfAffected:
                                	cmp r0, #0x0
                                 	beq Return
                            Affected:
                                 	mov r0, #0xFF
                                 	strb r0, [r1]
                                 	ldr r0, .DisabledAbilityLoc
                                 	add r0, r4
                                 	strb r3, [r0]
                            Return:
                                	pop {r2-r4}
                                 	bl Canceler
                                 	lsl r0, r0, #0x18
                                 	lsr r2, r0, #0x18
                                 	cmp r2, #0x0
                                 	beq Continue
                                 	ldr r0, .Return
                                 	bx r0
                            Continue:
                                 	ldr r0, .Return2
                                 	bx r0
                            
                            Canceler:
                                 	ldr r0, .Return3
                                 	bx r0
                            
                            .align 2
                            
                            .Bank: .word 0x02023D6B
                            .BattleData: .word 0x02023C04
                            .MoldBreakerTable: .word 0x08TTTTTT
                            .DisabledAbilityLoc: .word 0x0203C034
                            .Return: .word 0x0801DAFD
                            .Return2: .word 0x0801D7D7
                            .Return3: .word 0x080192D5
                            
                            @At 1D7C8: 00 48 00 47 XX+1 XX XX 08

                            Routine II (Checks for user's Mold Breaker in target iterating moves like Earthquake and then disables abilities that negate damage)
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global moldbreakermultipletargets
                                 
                            AbilityBufferUser:
                                 	push {r1-r4}
                            	ldr r0, .Bank
                            	ldr r0, [r0]
                            	mov r1, #0x58
                            	ldr r2, .BattleData
                            	mul r0, r1
                            	add r0, r0, r2
                            	ldrb r0, [r0]
                            MoldBreakerCheck:
                            	cmp r0, #0x69
                               	beq MoldBreaker
                                	cmp r0, #0xA4
                                	beq MoldBreaker
                                	cmp r0, #0xA5
                                	bne Return
                            MoldBreaker:
                            AbilityBufferTarget:
                                 	ldr r0, .Bank
                            	add r0, #0x1
                                 	ldrb r4, [r0]
                            	mul r1, r4 
                            	add r1, r1, r2 
                                 	ldrb r3, [r1]
                            LoadTable:
                                 	ldr r0, .MoldBreakerTable
                               	add r2, r0, r3
                                 	ldrb r0, [r2]
                            CheckIfAffected:
                                	cmp r0, #0x0
                                 	beq Return
                            Affected:
                                 	mov r0, #0xFF
                                 	strb r0, [r1]
                                 	ldr r0, .DisabledAbilityLoc
                                 	add r0, r4
                                 	strb r3, [r0]
                            Return:
                                	pop {r1-r4}
                                 	ldr r0, [r1]
                            	add r0, #0x1
                            	str r0, [r1]
                            	pop {r0}
                            	bx r0
                            
                            .align 2
                            
                            .Bank: .word 0x02023D6B
                            .BattleData: .word 0x02023C04
                            .MoldBreakerTable: .word 0x08TTTTTT
                            .DisabledAbilityLoc: .word 0x0203C034
                            
                            @At 225E0: 00 48 00 47 XX+1 XX XX 08


                            Routine III and its associated Battle Script (Generation V effect. Makes the foe affected by entry hazards even if it has an ability to negate the hazards effect (except Magic Guard))
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global moldbreakerhazards
                                 
                            AbilityBufferUser:
                                 	push {lr}
                            	ldr r0, .Bank
                            	ldrb r0, [r0]
                            	mov r1, #0x58
                            	ldr r2, .BattleData
                            	mul r0, r1
                            	add r0, r0, r2
                            	ldrb r0, [r0]
                            MoldBreakerCheck:
                            	cmp r0, #0x69
                               	beq MoldBreaker
                                	cmp r0, #0xA4
                                	beq MoldBreaker
                                	cmp r0, #0xA5
                                	bne Return
                            MoldBreaker:
                            AbilityBufferTarget:
                                 	ldr r0, .Bank
                            	add r0, #0x1
                                 	ldrb r4, [r0]
                            	mul r1, r4 
                            	add r1, r1, r2 
                                 	ldrb r3, [r1]
                            LoadTable:
                                 	ldr r0, .MoldBreakerTable
                               	add r2, r0, r3
                                 	ldrb r0, [r2]
                            CheckIfAffected:
                                	cmp r0, #0x0
                                 	beq Return
                            Affected:
                                 	mov r0, #0xFF
                                 	strb r0, [r1]
                                 	ldr r0, .DisabledAbilityLoc
                                 	add r0, r4
                                 	strb r3, [r0]
                            Return:
                            	pop {r0}
                            	bx r0
                            
                            .align 2
                            
                            .Bank: .word 0x02023D6B
                            .BattleData: .word 0x02023C04
                            .MoldBreakerTable: .word 0x08TTTTTT
                            .DisabledAbilityLoc: .word 0x0203C034
                            
                            .align 2
                            moldBreakerTable: .word 0x08TTTTTT
                            Battle Script at YYYYYY:
                            Code:
                            09 0A E2 00 58 00 3A 2B 04 4C 2B 02 02 08 00 00 00 ZZ ZZ ZZ 08 2E 8A 3E 02 02 05 F6
                            Battle Script at ZZZZZZ:
                            Code:
                            4C 00 4D 00 4E 00 00 3A 10 54 01 F8 XX+1 XX XX 28 52 00 28 4E 69 1D 08
                            At x28308 insert YY YY YY 08 in reverse hex


                            Routine IV (Restores disabled abilities at the end of move execution)
                            Spoiler:
                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global restoreabilities
                                 
                            EndTurn:
                                 	ldr r0, .Outcome
                            	mov r1, #0x0
                            	strb r1, [r0]
                            	ldr r0, .Index
                            	strb r1, [r0]
                            RestoreAbilities:
                            	push {r2-r6}
                            	ldr r4, .Battlers
                            	ldrb r4, [r4]
                            	mov r3, #0x0
                            	ldr r5, .DisabledAbilityLoc
                            	ldr r6, .BattleData
                            Loop:
                            	ldrb r2 [r5, #0x0]
                            	cmp r2, #0x0
                            	beq EndLoop
                            	strb r2, [r6]
                            	strb r1, [r5]
                            EndLoop:
                            	add r3, r3, #0x1
                            	cmp r3, r4
                            	bge Exit
                            	add r5, r5, #0x1
                            	add r6, r6, #0x58
                            	b Loop
                            Exit:
                            	pop {r2-r6}
                            	ldr r1, .EndLoc
                            	mov r0, #0xB
                            	strb r0, [r1]
                            	bx lr
                            
                            .align 2
                            
                            .Outcome: .word 0x02023DCC
                            .Index: .word 0x02023BC4
                            .Battlers: .word 0x02023D6C
                            .DisabledAbilityLoc: .word 0x0203C034
                            .BattleData: .word 0x02023C04
                            .EndLoc: .word 0x02023BE3
                            
                            @ Go to your Battle Script command table, search for CD 2C 02 08 and replace it by XX+1 XX XX 08 (We are replacing the 'End' Battle Script Command. Not the case in Emerald






                            2. Unaware & Updated Keen Eye (+ Sacred Sword Effect)
                            Spoiler:
                            This only works with Doesntknowhowtoplay's DPSS patch.
                            LL is the move effect ID for Sacred sword effect (Set the Pointer to the Basic Damaging Battle Script as an entry in the Move Effect Table).

                            Fire Red:
                            Spoiler:
                            Just insert these routines and make bytes changes mentioned their comments.

                            Attack and Special Attack Unaware:
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global unwareattack
                            
                            main:
                            cmp r4, #0x2
                            bne nocrit
                            cmp r2, #0x6
                            ble ignorestat
                            
                            nocrit:
                            mov r0, #0x20
                            ldr r1, [sp, #0x4]
                            ldrb r1, [r1, r0]
                            cmp r1, #0x6E
                            beq ignorestat
                            ldr r1, return1
                            bx r1
                            
                            ignorestat:
                            ldr r1, return2
                            bx r1
                            
                            .align 2
                            return1: .word 0x0803F3D1
                            return2: .word 0x0803F3E1
                            
                            @At 3F3C8: 00 49 08 47 XX XX XX 08

                            Defense and Special Defense Unaware:
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global unwaredefense
                            
                            main:
                            cmp r4, #0x2
                            bne nocrit
                            cmp r2, #0x5
                            bgt ignorestat
                            
                            nocrit:
                            mov r0, #0x20
                            ldrb r1, [r6, r0]
                            cmp r1, #0x6E
                            beq ignorestat
                            
                            ldr r1, currMove
                            ldrh r1, [r1, #0x0]
                            mov r0, #0xC
                            mul r1, r0
                            ldr r0, moveTable
                            add r0, r0, r1
                            ldrb r1, [r0, #0x0]
                            cmp r1, #0xLL
                            beq ignorestat
                            
                            ldr r1, return1
                            bx r1
                            
                            ignorestat:
                            ldr r1, return2
                            bx r1
                            
                            .align 2
                            currMove: .word 0x02023D4C
                            moveTable: .word 0x08250C04
                            return1: .word 0x0803F419
                            return2: .word 0x0803F429
                            
                            @At 3F410: 00 49 08 47 XX XX XX 08

                            Accuracy and Evasiveness Unaware + Updated Keen Eye
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global unawareaccuracy
                            
                            LoadUserData:
                                  mov r2, r3
                                  ldr r0, .UserBank
                                  mov r1, #0x58
                                  ldrb r4, [r0]
                                  mul r4, r1
                                  add r4, r4, r2
                            
                            LoadTargetData:
                                  add r0, #0x1
                                  ldrb r3, [r0]
                                  mul r3, r1
                                  add r3, r3, r2
                            
                            CheckTargetUnaware:
                                  mov r1, #0x20
                                  ldrb r0, [r3, r1]
                                  cmp r0, #0x6E
                                  beq SetZeroAccuracy
                            
                            LoadUserAccuracy:
                                  ldrb r5, [r4, #0x1E]
                                  b CheckUserUnaware
                            
                            SetZeroAccuracy:
                                  mov r5, #0x6
                            
                            CheckUserUnaware:
                                  ldrb r0, [r4, r1]
                                  cmp r0, #0x6E
                                  beq SetZeroEvasion
                            
                            CheckSacredSwordChipAway:
                                  ldr r1, .CurrMove
                                  ldrh r1, [r1]
                                  lsl r0, r1, #0x1
                                  add r1, r1, r0
                                  lsl r1, r1, #0x2
                                  ldr r0, .MoveData
                                  add r1, r1, r0
                                  ldrb r0, [r1]
                                  cmp r0, #0xLL
                                  beq SetZeroEvasion
                            
                            LoadTargetEvasion:
                                  ldrb r2, [r3, #0x1F]
                            
                            CheckForPositiveEvasion:
                                  cmp r2, #0x6
                                  ble CalcNetBuff
                            
                            PositiveEvasion:
                            
                            CheckUserKeenEye:
                                  add r4, #0x20
                                  ldrb r0, [r4]
                                  cmp r0, #0x33
                                  bne CalcNetBuff
                            
                            CheckForesite:      
                                  ldr r0, [r3, #0x50]
                                  mov r1, #0x80
                                  lsl r1, r1, #0x16
                                  and r0, r1
                                  cmp r0, #0x0
                                  beq CalcNetBuff
                                        
                            SetZeroEvasion:       
                                  mov r2, #0x6
                            
                            CalcNetBuff:
                                  
                            GravityCheck:
                                  ldr r1, .GravityCounter
                                  ldrb r0, [r1]
                                  cmp r0, #0x0
                                  beq Exit
                            
                            DecreaseEvasion:            
                                  sub r2, r2, #0x2
                                  cmp r2, #0x0
                                  bge Exit     
                                  mov r2, #0x0 
                            
                            Exit:
                                  add r0, r5, #0x6
                                  sub r0, r0, r2      
                                  ldr r1, .Return
                                  bx r1
                            
                            .align 2
                            .GravityCounter: .word 0x0203C03B
                            .UserBank: .word 0x02023D6B
                            .CurrMove: .word 0x02023D4A
                            .MoveData: .word 0x08250c04
                            .Return: .word 0x0801DFAA+1
                            
                            /*At x1DF60: 00 48 00 47 XX+1 XX XX 08*/





                            3. New Switch-in Ability System
                            Spoiler:
                            Note:-
                            Spoiler:
                            There is an existing one made that has been used for implementing abilities like Download etc.
                            But there is one problem with that switch-in manager. It performs an OR logic with status byte of the banked pokemon with x00000200 (so that the switch-in script does not execute repeatedly at the start of a turn) which causes a nasty side effect. The nasty side effect is that pokemon possessing an ability which uses that switch-in logic becomes totally immune to non-volatile status conditions (e.g burn, poison, sleep etc.).

                            A battling banked mon's status condition is stored in a Word and the functions responible for inflicting these status have a check that the content of status Word should be absolute zero otherwise no status infliction happens. So when the switch-in ability mon is inflicted with a Status Move, the Status Word of the banked mon would always atleast consist of x00000200 (i.e 1 in its 9th bit) and hence fails to be inflicted with the status.

                            The new system in this post hooks with the Intimidate ability and ORs special status flag with x800000 to avoid the repetitive problem instead of ORing with the status byte to avoid the statusimmunity problem. This also uses a similar table system compared that previous switch-in one but uses custom Battle Scripts instead of custom ASM as entries.

                            Also, there is logic added to solve inconsistencies due to Trace, Skill Swap and Role Play on switch-in abilities while simultaneously updating Intimidate to latest Generation (activation due to copying by Trace, RolePlay etc.)

                            Fire Red:
                            Spoiler:
                            Step I
                            Spoiler:

                            1a. One custom table of the size ((No. of Switch-in Abilities)*8 bytes) is going to be used for this system, so select suitable starting offsets for the table according to the requirements.
                            1b. In the routine, replace x8TTTTTT (near the last line) with the table's starting offset,
                            1c. Insert the routine somewhere.
                            Routine
                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global switchinabilities
                            
                            IntimidateCheck:
                            cmp r1, #0x16
                            bne LoadTable
                            ldr r0, [r2, #0x0]
                            and r0, r6
                            cmp r0, #0x0
                            beq NextIter
                            ldr r0, =0x0801BAAD
                            bx r0
                            
                            LoadTable:
                            push {r2-r3}
                            mov r3, #0x0
                            ldr r0, .TableLoc
                            Loop:
                            lsl r2, r3, #0x3
                            add r2, r2, r0
                            ldrb r2, [r2]
                            cmp r1, r2
                            beq Success
                            cmp r2, #0xFF
                            beq PopBeforeNextIter
                            add r3, #0x1
                            b Loop
                            
                            Success:
                            lsl r2, r3, #0x3
                            add r2, r2, r0
                            ldr r0, [r2, #0x4]
                            pop {r2-r3}
                            push {r0}
                            ldr r0, [r2, #0x0]
                            and r0, r6
                            cmp r0, #0x0
                            bne PopR0BeforeNextIter
                            mov r4, r8
                            strb r1, [r4, #0x0]
                            ldr r0, [r2, #0x0]
                            orr r0, r6
                            str r0, [r2, #0x0]
                            ldr r0, =0x02023D6B
                            strb r5, [r0]
                            pop {r0}
                            ldr r1, =0x0801BABB
                            bx r1
                            
                            PopR0BeforeNextIter:
                            pop {r0}
                            b NextIter
                            
                            PopBeforeNextIter:
                            pop {r2-r3}
                            
                            NextIter:
                            ldr r0, =0x0801B4FF
                            bx r0
                            
                            
                            .align
                            .TableLoc: .word 0x8TTTTTT
                            
                            @insert 00 48 00 47 xx+1 xx xx 08 at 1B4F0

                            Step II
                            Spoiler:

                            Now, here are some sample Battle Scripts to understand how to make custom Battle Scripts for switch-in abilities.

                            Pressure Message Battle Script:
                            Spoiler:

                            #dynamic 0x740280

                            #org @main
                            call @pressuremessage
                            // The table should have pointer to this
                            end3

                            #org @pressuremessage
                            pause 0x20


                            setbyte 0x2023D6C 0x0
                            cmde1 0x81D936A

                            setword 0x0203C020 ("Offset to pressure message")
                            printstring 0x184
                            waitmessage 0x40
                            return

                            // Pressure Message Hex: FD 13 FE DD E7 00 D9 EC D9 E6 E8 DD E2 DB 00 E4 E6 D9 E7 E7 E9 E6 D9 AB FF


                            The bolded part will be the crux of every switch-in script using this system, so make sure to start your switch-in battle script using these lines. Also, in case if you want to understand the need for this part:
                            Spoiler:

                            'pause 0x20' - Pauses for half a second
                            'setbyte 0x2023D6C 0x0 - Sets the content of 0x2023D6C to 0x0. This must be set to zero for command e1 to work properly.
                            'cmd e1 0x81D936A' - This sets the user buffer (0x2023FDB not 0x2023D6B in this case) and target buffer (0x2023D6C) and is used in Target Iteration for Intimidate in doubles. The second parameter is an offset to branch after the Iteration finishes, the offset '0x81D936A' just contains a script containing the command '3C' (i.e a return command).


                            Similarly, message scripts can be created for Mold Breaker, Terravolt and Turboblaze.
                            Abilities like Download, Imposter and Frisk would require some extra logic.

                            Now compile them and also note down the table pointer of the script

                            Step III
                            Spoiler:

                            Now fill the table in the format: (Ability ID) 00 00 00 (the pointer to the associated script).. Hence, each ability entry will use 8 (1+1+1+1+4) entries per table for this implementation.
                            Only include those abilities in the tables that have switch-in logic. Also make sure that the table is terminated by a FF.

                            Step IV
                            Spoiler:

                            This adjusts Trace, Skill Swap and Role Play to the latest standards while simultaneously solving the inconsistencies due to the routines.

                            Insert these custom ASM and corresponding battle scripts.

                            Skill Swap Adjust:
                            Spoiler:

                            Code:
                            text
                            .align 2
                            .thumb
                            .thumb_func
                            .global switchinabilitiesskillswap
                            
                            push {lr}
                            ldr r6, =0x2023C04
                            ldr r7, =0x2023DFC
                            mov r5, #0x80
                            lsl r5, r5, #0xC
                            mov r4, #0x58
                            ldr r3, =0x2023D6B
                            ldrb r2, [r3, #0x0]
                            lsl r1, r2, #0x2
                            add r1, r1, r7
                            ldr r0, [r1] 
                            mul r2, r4
                            add r2, r2, r6
                            ldrb r2, [r2, #0x0]
                            cmp r2, #0x16
                            beq orrmarker
                            bic r0, r5
                            b cont
                            
                            orrmarker:
                            orr r0, r5
                            cont: 
                            str r0, [r1]
                            add r3, #0x1
                            ldrb r2, [r3, #0x0]
                            lsl r1, r2, #0x2
                            add r1, r1, r7
                            ldr r0, [r1] 
                            mul r2, r4
                            add r2, r2, r6
                            ldrb r2, [r2, #0x0]
                            cmp r2, #0x16
                            beq orrmarker2
                            bic r0, r5
                            b cont2
                            
                            orrmarker2:
                            orr r0, r5
                            cont2: 
                            str r0, [r1]
                            pop {r0}
                            bx r0
                            Battle Script at YYYYYY:
                            Code:
                            F8 XX+1 XX XX 28 4E 69 1D 08
                            At x1D82C6 insert YY YY YY 08 in reverse hex



                            Role Play Adjust
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global switchinabilitiesroleplay
                            
                            push {lr}
                            ldr r6, =0x2023C04
                            ldr r7, =0x2023DFC
                            mov r5, #0x80
                            lsl r5, r5, #0xC
                            mov r4, #0x58
                            ldr r3, =0x2023D6B
                            ldrb r2, [r3, #0x0]
                            lsl r1, r2, #0x2
                            add r1, r1, r7
                            ldr r0, [r1] 
                            mul r2, r4
                            add r2, r2, r6
                            ldrb r2, [r2, #0x0]
                            cmp r2, #0x16
                            beq orrmarker
                            bic r0, r5
                            b cont
                            
                            orrmarker:
                            orr r0, r5
                            cont: 
                            str r0, [r1]
                            pop {r0}
                            bx r0
                            Battle Script at YYYYYY:
                            Code:
                            F8 XX+1 XX XX 28 4E 69 1D 08
                            At x1D813D insert YY YY YY 08 in reverse hex



                            Trace Adjust
                            Spoiler:

                            Code:
                            .text
                            .align 2
                            .thumb
                            .thumb_func
                            .global switchinabilitiestrace
                            
                            push {lr}
                            ldr r6, =0x2023c04
                            ldr r7, =0x2023DFC
                            mov r5, #0x80
                            lsl r5, r5, #0xC
                            mov r4, #0x58
                            ldr r3, =0x2023FDB
                            ldrb r2, [r3, #0x0]
                            lsl r1, r2, #0x2
                            add r1, r1, r7
                            ldr r0, [r1] 
                            mul r2, r4
                            add r2, r2, r6
                            ldrb r2, [r2, #0x0]
                            cmp r2, #0x16
                            beq orrmarker
                            bic r0, r5
                            b cont
                            
                            orrmarker:
                            orr r0, r5
                            cont: 
                            str r0, [r1]
                            pop {r0}
                            bx r0
                            Battle Script at YYYYYY:
                            Code:
                            39 20 00 10 D0 00 12 40 00 F8 XX+1 XX XX 08 3F
                            At x1BB18 insert YY YY YY 08 in reverse hex




                            Reply With Quote
                              #14    
                            Old February 28th, 2015 (11:03 AM).
                            Urobolos Urobolos is offline
                               
                              Join Date: Nov 2014
                              Posts: 15
                              Quote:
                              Originally Posted by KDS View Post
                              Sorry the for the late reply. The callasm command and battle string loader hack are posted in the Quick R&D thread and these things are already installed in MrDS' Patch.
                              Yeah, would the routines (for both the Magic Coat/Bounce fix and the fixed Ability Switch-In routines) still work if I compile and put them in a rom currently using the MrDS patch? Because I'm pretty sure the MrDS patch still uses the erroneous original routines.
                              Reply With Quote
                                #15    
                              Old February 28th, 2015 (9:31 PM).
                              Chacha Dinosaur's Avatar
                              Chacha Dinosaur Chacha Dinosaur is offline
                              Adamant and adaptive dinosaur.
                                 
                                Join Date: Jul 2013
                                Age: 23
                                Gender: Male
                                Posts: 454
                                Quote:
                                Originally Posted by Urobolos View Post
                                Yeah, would the routines (for both the Magic Coat/Bounce fix and the fixed Ability Switch-In routines) still work if I compile and put them in a rom currently using the MrDS patch? Because I'm pretty sure the MrDS patch still uses the erroneous original routines.
                                You need to remove the old ones before inserting the new ones.
                                Reply With Quote
                                  #16    
                                Old February 28th, 2015 (9:59 PM).
                                Urobolos Urobolos is offline
                                   
                                  Join Date: Nov 2014
                                  Posts: 15
                                  Quote:
                                  Originally Posted by KDS View Post
                                  You need to remove the old ones before inserting the new ones.
                                  Where can I even find the old routines to remove in the first place?
                                  Reply With Quote
                                    #17    
                                  Old March 1st, 2015 (1:00 AM).
                                  DizzyEgg's Avatar
                                  DizzyEgg DizzyEgg is offline
                                     
                                    Join Date: Feb 2014
                                    Location: Poland
                                    Age: 20
                                    Gender: Male
                                    Nature: Quiet
                                    Posts: 716
                                    I have a question. How do you insert those abilities? I mean, I know how to insert ASM routine but what am I supposed to do later? How to write these abilities' effect into one that exists?
                                    __________________
                                    Support Pokeruby!

                                    My works:
                                    Battle Engine Upgrade
                                    Pokemon Expansion
                                    Items/TMs/Tutors Expansion
                                    Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

                                    Emerald Features:
                                    Form Changes (KDS)
                                    Reply With Quote
                                      #18    
                                    Old March 2nd, 2015 (7:06 AM).
                                    Chacha Dinosaur's Avatar
                                    Chacha Dinosaur Chacha Dinosaur is offline
                                    Adamant and adaptive dinosaur.
                                       
                                      Join Date: Jul 2013
                                      Age: 23
                                      Gender: Male
                                      Posts: 454
                                      Quote:
                                      Originally Posted by Urobolos View Post
                                      Where can I even find the old routines to remove in the first place?
                                      For Magic Bounce at x1D8D6 insert, 18 01 80 18 00 78 C0 06 88 46 before applying the new routines.
                                      For the switch-in one, I advise to wait till the next version of the base since MrDS will be making many switch-in abilities using this system.
                                      Reply With Quote
                                        #19    
                                      Old April 12th, 2015 (1:18 AM).
                                      DizzyEgg's Avatar
                                      DizzyEgg DizzyEgg is offline
                                         
                                        Join Date: Feb 2014
                                        Location: Poland
                                        Age: 20
                                        Gender: Male
                                        Nature: Quiet
                                        Posts: 716
                                        The code for Fire Red's Sturdy is impossible to compile. Errors that I get:
                                        Sturdy.asm:22: Error: invalid offset, value too big <0xFFFFFFFC>
                                        Sturdy.asm:31: Error: invalid offset, value too big <0xFFFFFFFC>
                                        Could someone correct it?
                                        __________________
                                        Support Pokeruby!

                                        My works:
                                        Battle Engine Upgrade
                                        Pokemon Expansion
                                        Items/TMs/Tutors Expansion
                                        Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

                                        Emerald Features:
                                        Form Changes (KDS)
                                        Reply With Quote
                                          #20    
                                        Old April 12th, 2015 (10:59 AM).
                                        Touched's Avatar
                                        Touched Touched is online now
                                        Resident ASMAGICIAN
                                           
                                          Join Date: Jul 2014
                                          Gender: Male
                                          Posts: 626
                                          Quote:
                                          Originally Posted by DizzyEgg View Post
                                          The code for Fire Red's Sturdy is impossible to compile. Errors that I get:
                                          Sturdy.asm:22: Error: invalid offset, value too big <0xFFFFFFFC>
                                          Sturdy.asm:31: Error: invalid offset, value too big <0xFFFFFFFC>
                                          Could someone correct it?
                                          There were errors in the case on lines 22 and 31. The fixed version is below

                                          Spoiler:

                                          Code:
                                          .text
                                          .align 2
                                          .thumb
                                          .thumb_func
                                          .global sturdyupdate
                                           
                                          Sturdy:
                                          	ldrb r0, [r3]
                                          	mov r1, #0x58
                                          	mul r0, r1
                                          	add r0, r0, r2
                                          	add r0, #0x20
                                          	ldrb r1, [r0]
                                          	cmp r1, #0x5
                                          	bne FalseSwipeCheck
                                          CheckHP:
                                          	ldrh r1, [r0, #0xC]
                                          	ldrh r0, [r0, #0x8]
                                          	cmp r0, r1
                                          	beq SturdySuccess
                                          FalseSwipeCheck:
                                          	ldr r0, .MoveLoc
                                          	ldrh r1, [r0]
                                          	lsl r0, r1, #0x1
                                          	add r0, r0, r1
                                          	ldr r2, .Return
                                          	bx r2
                                          SturdySuccess:
                                          DisplayEndureMessage:
                                          	mov r0, #0x56
                                          	ldr r1, .Index
                                          	ldrb r2, [r3]
                                          	lsl r0, r2, #0x4
                                          	add r0, r0, r1
                                          	mov r1, #0x2
                                          	strb r1, [r0]
                                          Return:
                                          	ldr r0, .Return2
                                          	bx r0
                                          
                                          .align 2
                                          
                                          .MoveLoc: .word 0x02023D4A
                                          .Return: .word 0x0801F1ED
                                          .Index: .word 0x02023E8C
                                          .Return2: .word 0x0801F217
                                          
                                          #insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2
                                          Reply With Quote
                                            #21    
                                          Old April 12th, 2015 (11:52 AM).
                                          DizzyEgg's Avatar
                                          DizzyEgg DizzyEgg is offline
                                             
                                            Join Date: Feb 2014
                                            Location: Poland
                                            Age: 20
                                            Gender: Male
                                            Nature: Quiet
                                            Posts: 716
                                            Quote:
                                            Originally Posted by Touched View Post
                                            There were errors in the case on lines 22 and 31. The fixed version is below

                                            Spoiler:

                                            Code:
                                            .text
                                            .align 2
                                            .thumb
                                            .thumb_func
                                            .global sturdyupdate
                                             
                                            Sturdy:
                                                ldrb r0, [r3]
                                                mov r1, #0x58
                                                mul r0, r1
                                                add r0, r0, r2
                                                add r0, #0x20
                                                ldrb r1, [r0]
                                                cmp r1, #0x5
                                                bne FalseSwipeCheck
                                            CheckHP:
                                                ldrh r1, [r0, #0xC]
                                                ldrh r0, [r0, #0x8]
                                                cmp r0, r1
                                                beq SturdySuccess
                                            FalseSwipeCheck:
                                                ldr r0, .MoveLoc
                                                ldrh r1, [r0]
                                                lsl r0, r1, #0x1
                                                add r0, r0, r1
                                                ldr r2, .Return
                                                bx r2
                                            SturdySuccess:
                                            DisplayEndureMessage:
                                                mov r0, #0x56
                                                ldr r1, .Index
                                                ldrb r2, [r3]
                                                lsl r0, r2, #0x4
                                                add r0, r0, r1
                                                mov r1, #0x2
                                                strb r1, [r0]
                                            Return:
                                                ldr r0, .Return2
                                                bx r0
                                            
                                            .align 2
                                            
                                            .MoveLoc: .word 0x02023D4A
                                            .Return: .word 0x0801F1ED
                                            .Index: .word 0x02023E8C
                                            .Return2: .word 0x0801F217
                                            
                                            #insert 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2
                                            Even though it compiles now, there is another problem. This code doesn't work for me. After inserting it when I select a move in a battle and use it, the whole game freezes. On a modified rom it actually resets and on a clean rom it just freezes. Now, am I just doing something incorrectly or is this the code that is wrong?
                                            __________________
                                            Support Pokeruby!

                                            My works:
                                            Battle Engine Upgrade
                                            Pokemon Expansion
                                            Items/TMs/Tutors Expansion
                                            Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

                                            Emerald Features:
                                            Form Changes (KDS)
                                            Reply With Quote
                                              #22    
                                            Old April 12th, 2015 (12:49 PM).
                                            Touched's Avatar
                                            Touched Touched is online now
                                            Resident ASMAGICIAN
                                               
                                              Join Date: Jul 2014
                                              Gender: Male
                                              Posts: 626
                                              Quote:
                                              Originally Posted by DizzyEgg View Post
                                              Even though it compiles now, there is another problem. This code doesn't work for me. After inserting it when I select a move in a battle and use it, the whole game freezes. On a modified rom it actually resets and on a clean rom it just freezes. Now, am I just doing something incorrectly or is this the code that is wrong?
                                              After a quick glance I can't see anything obviously wrong with the logic. Did you follow the instruction telling you to put 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2. Remember the offset has to be little-endian and plus 1 (since it's THUMB code). If you did this, I can only assume it's broken.
                                              Reply With Quote
                                                #23    
                                              Old April 12th, 2015 (10:54 PM).
                                              DizzyEgg's Avatar
                                              DizzyEgg DizzyEgg is offline
                                                 
                                                Join Date: Feb 2014
                                                Location: Poland
                                                Age: 20
                                                Gender: Male
                                                Nature: Quiet
                                                Posts: 716
                                                Quote:
                                                Originally Posted by Touched View Post
                                                After a quick glance I can't see anything obviously wrong with the logic. Did you follow the instruction telling you to put 01 48 00 47 00 00 xx xx xx 08 1A 4A at 01F1E2. Remember the offset has to be little-endian and plus 1 (since it's THUMB code). If you did this, I can only assume it's broken.
                                                Yes, it was my fault. Apparently I didn't add 1 to my offset. Thanks for your help!
                                                __________________
                                                Support Pokeruby!

                                                My works:
                                                Battle Engine Upgrade
                                                Pokemon Expansion
                                                Items/TMs/Tutors Expansion
                                                Various Features(Evo Methods, BW Repel, Levels Above 100, Trainers with EV, Nature Colored Stats)

                                                Emerald Features:
                                                Form Changes (KDS)
                                                Reply With Quote
                                                  #24    
                                                Old April 15th, 2015 (8:00 AM).
                                                kleenexfeu kleenexfeu is offline
                                                   
                                                  Join Date: Aug 2013
                                                  Gender: Male
                                                  Posts: 219
                                                  Hi,
                                                  how am I suppose to do if I want to make technician not the number 0x66 ability but rather the 0x4D ability ? Because in the routine, if I replace the "cmp r4, #066" with "cmp r4, #04D" the assembler doesn't want to assemble my routine.
                                                  Any clue ? Tell me if I'm not clear
                                                  __________________
                                                  Links for my work:
                                                  Dynamic Emerald Attack ROMbase
                                                  Arceus and Giratina Forms

                                                  Touched's Emerald IDB + Battle stuff (probably outdated)
                                                  Touched's Emerald IDB 6.8 + Battle stuff (probably outdated)
                                                  Reply With Quote
                                                    #25    
                                                  Old April 15th, 2015 (8:05 AM).
                                                  You Watanabe's Avatar
                                                  You Watanabe You Watanabe is offline
                                                  Now Leaving...
                                                     
                                                    Join Date: Feb 2014
                                                    Location: Shiganshina District, Wall Maria
                                                    Gender: Female
                                                    Nature: Adamant
                                                    Posts: 430
                                                    Quote:
                                                    Originally Posted by kleenexfeu View Post
                                                    Hi,
                                                    how am I suppose to do if I want to make technician not the number 0x66 ability but rather the 0x4D ability ? Because in the routine, if I replace the "cmp r4, #066" with "cmp r4, #04D" the assembler doesn't want to assemble my routine.
                                                    Any clue ? Tell me if I'm not clear
                                                    "cmp r4, #0x66"
                                                    "cmp r4, #0x4D"

                                                    Don't forget to have x those kind of digits because that means a hex digit otherwise your routine doesn't want to assemble at all.
                                                    __________________

                                                    Userpage


                                                    Pokémon Dark Jade Version (Coming Soon!)


                                                    The Omsoc Empire (Coming Soon!)
                                                    Reply With Quote
                                                    Reply

                                                    Quick Reply

                                                    Join the conversation!

                                                    Create an account to post a reply in this thread, participate in other discussions, and more!

                                                    Create a PokéCommunity Account

                                                    Sponsored Links
                                                    Thread Tools

                                                    Posting Rules
                                                    You may not post new threads
                                                    You may not post replies
                                                    You may not post attachments
                                                    You may not edit your posts

                                                    BB code is On
                                                    Smilies are On
                                                    [IMG] code is On
                                                    HTML code is Off

                                                    Forum Jump


                                                    All times are GMT -8. The time now is 9:14 AM.