I want to change the Dead Motion patch so it checks for a specific item instead of specific chapter. I edited the editor to it asks for an item and I modified my .S files to look like this
@Call 08053D58 {J}
@Call 08053068 {U}.thumb
.macro blh to, reg=r3
ldr \reg, =\to
mov lr, \reg
.short 0xf800
.endmbl GetMotion
cmp r0, #0x1
beq Flush_And_EfxDeadPika
cmp r0, #0x2
beq Nothing
cmp r0, #0x3
beq Flush_Only
b Normal_EfxDeadPika@何もしない
Nothing:
mov r0, r5
bl SetNothing
b Exit@画面フラッシュ
Flush_Only:
mov r1, r5
ldr r0, Proc_CustomDeadMotion_Flush_Only
bl RunCustomProcs
b Exit@画面フラッシュした後で点滅して消去
Flush_And_EfxDeadPika:
mov r1, r5
ldr r0, Proc_CustomDeadMotion_Flush_And_Pika
bl RunCustomProcs
b Exit@点滅して消去
Normal_EfxDeadPika:
ldr r0, [r5, #0x5c]
ldr@blhr1, [r5, #0x60@StartEfxDeadPika
@blh 0x08053e10 @StartEfxDeadPika {J}
@StartEfxDeadPikalh 0x@b8053120 @StartEfxDeadPika {U}
@b@ldrExit@復帰
Exit:
@ldr r3, =0x08053D60|1 @{J}
ldr r3, =0x08053070|1 @{U}
bx r3RunCustomProcs:
push {r4,r5,lr}
ldr r4, [r1, #0@blh5c]
ldr r5, [r@NewBlocking6C, #0x60]
@blh 0x08002c30 @NewBlocking6C @NewBlocking6C {J}
blh 0x08002CE0 @NewBlocking6C {U}
str r4, [r0, #0x5c]
str r5, [r0, #0x60]
mov r1, #0x0
strh r1, [r0, #0x2c]
strh r1, [r0, #0x2e]
pop {r4,r5}
pop {r1}
bx r1SetNothing:
push {r4,r5,lr}
mov r1, #0x0
strh r1, [r0, #0x2e]mov r1, #0x1e-1
strh r1,[r0@ldr#0x2c]pop {r4,r5@BattleUnit
pop {r1}
bx r1GetMotion:
push {lr,r4}@BattleUnit@ldr r4,=0x0203a568 @BattleUnit gBattleTarget {J}
ldr r4,=0x0203A56C @BattleUnit gBattleTar@ldret {U}
ldrb r0, [r@BattleUnit, #0xb]
cmp r0, #0x80
bge GetMotion_Fi@BattleUnitd @敵のみ@ldr r4,=0x0203a4e8 @BattleUnit gBattleActor {J}
ldr r4,=0x0203A4EC @BattleUnit gBattleActor {U}
ldrb r0, [r4, #0xb]
cmp r0, #0x80
bge GetMotion_Find @敵のみ
b GetMotion_NotFoundGetMotion_Find:
ldr r3, DeadMotionTable
sub r3, #0x4
GetMotion_Loop:
add r3, #0x4
ldr r0, [r3]
cmp r0, #0x0
beq GetMotion_NotFoundGetMotion_CheckUnit:
ldrb r0, [r3,#0x0]
cmp r0, #0x0
beq GetMotion_CheckClassldr r1, [r4,#0x0]
ldrb r1, [r1,#0x4]
cmp r0, r1
bne GetMotion_LoopGetMotion_CheckClass:
ldrb r0, [r3,#0x1]
cmp r0, #0x0
beq GetMotion_CheckMapldr r1, [r4,#0x4]
ldrb r1, [r1,#0x4]
cmp r0, r1
bne GetMotion_LoopGetMotion_CheckItem:
ldrb r0, [r3,#0x2]
cmp r0, #0x0
beq GetMotion_Foundmov r2, #0x1e
GetMotion_ItemLoop:
cmp r2, #0x26
bgt GetMotion_Loopldrb r1, [r4,r2]
cmp r0, r1
beq GetMotion_Foundadd r2, #0x2
b GetMotion_ItemLoopGetMotion_Found:
ldrb r0, [r3,#0x3]
b GetMotion_ExitGetMotion_NotFound:
mov r0, #0x0GetMotion_Exit:
pop {r4}
pop {r1}
bx r1.ltorg
EALiterals:
.set DeadMotionTable, EALiterals + 0
.set Proc_CustomDeadMotion_Flush_And_Pika, EALiterals + 4
.set Proc_CustomDeadMotion_Flush_Only, EALiterals + 8
but the game is still expecting a map where it asks for an item. I think maybe because the .dmp files still need to be updated? But I’m not sure I have the assembler to do that.