.gba .open "ZM_U.gba","TestIceBomb.gba",0x8000000 .definelabel FreeSpace,0x8760d50 .definelabel GetSpriteWeakness,0x8050370 .definelabel FreezeSprite,0x80506fc .definelabel SetParticleEffect,0x80540EC .definelabel ProjectileHitSolidSprite,0x80504cc .definelabel ProjectileDealDamage,0x8050424 .definelabel BXR0,0x808abf8 .org 0x80521d8     mov r2,#0x28 ; Change bomb exploding particle effect .org 0x8050b4c ; Make the return of the vanilla function earlier     pop r4     pop r0     bx r0     .org 0x8050b40     ldr r0,=FreeSpace+1 ; Hijack     bl BXR0 ; BXR0 calls the function in r0     .pool .org FreeSpace     push r4, r5, r14 ; Push r4 and r5 because we use them and r14 for the return     add r0,r4,#0x0 ; Put the sprite data pointer from vanilla code to r0     ldr r1,=GetSpriteWeakness     bl @@CallR1 ; Call Get Sprite Weakness     add r5,r0,#0x0 ; Save the weakness in r5 for later use     mov r1,#0x40 ; Can be frozen flag     and r1,r0 ; & operation with the weakness     cmp r1,#0x0 ; Check if can be frozen     beq @@WeaknessCheck ; Branch if equal -> Can't be frozen     add r0,r4,#0x0 ; Get sprite data pointer back (again)     mov r1,#0xF0 ; Freeze timer     ldr r2,=FreezeSprite     bl @@CallR2 ; Call Freeze Sprite     ldrh r0,[r4,#0x2] ; Get Y Position of the sprite     ldrh r1,[r4,#0x4] ; Get X Position of the sprite     mov r2,#0x28 ; Freezing sprite particle effect     ldr r3,=SetParticleEffect     bl @@CallR3 ; Call Set Particle Effect @@WeaknessCheck:     add r0,r5,#0x0 ; Get the weakness back     mov r1,#0x2 ; Vulnerable to beam/bombs flag     and r1,r0 ; & operation with the weakness     add r0,r4,#0x0 ; Get sprite data pointer back (again(again))     cmp r1,#0x0 ; Check if vulnerable     beq @@HitSolid     mov r1,#0x8 ; Damage     ldr r2,=ProjectileDealDamage     bl @@CallR2 ; Call Projectile Deal Damage     b @@Return ; Branch to return @@HitSolid:     ldr r1,=ProjectileHitSolidSprite     bl @@CallR1 ; Call Projectile Hit Solid Sprite @@Return:     pop r4, r5 ; Pop r4 and r5 because we pushed them earlier     pop r0 ; Pop the r14 value into r0     bx r0 ; Return @@CallR3:     mov r15,r3 @@CallR2:     mov r15,r2 @@CallR1:     mov r15,r1     .pool .close