由于老外的源码有些问题 所以应jirachiwish的要求重新写了一个
若使用扩充进化方式为8个的表格请自行修改.set中的内容,并修改源码3中#40为#64
以及修改源码1和源码2中add r1, r6, r7为lsl r1, r6, #1
昼携带道具进化:- .thumb
- #For Firered, include it in the evolution method table
- .set Time, 0x3005542
- .set EvoExit, 0x8043111
- .set Evolve, 0x804310D
- .set Decrypter, 0x803FBE9
- ldr r0, =Time
- ldrb r0, [r0]
- cmp r0, #0x15
- bge exit
- cmp r0, #6
- blt exit
- DecryptItem:
- add r1, r6, r7
- lsl r1, r1, #0x3
- add r1, r2, r1
- add r1, r1, r3
- push {r1-r4}
- ldrh r4, [r1, #0x2]
- mov r0, r8
- mov r1, #0xc
- ldr r3, =Decrypter
- bl bx_r3
- cmp r0, r4
- bne exit2
- pop {r1-r4}
- ldr r0, =Evolve
- bx r0
- exit2:
- pop {r1-r4}
- exit:
- ldr r0, =EvoExit
- bx r0
- bx_r3:
- bx r3
- .ltorg
复制代码 夜携带道具进化:- .thumb
- #For Firered, include it in the evolution method table
- .set Time, 0x3005542
- .set EvoExit, 0x8043111
- .set Evolve, 0x804310D
- .set Decrypter, 0x803FBE9
- ldr r0, =Time
- ldrb r0, [r0]
- cmp r0, #0x15
- bge DecryptItem
- cmp r0, #6
- bge exit
- DecryptItem:
- add r1, r6, r7
- lsl r1, r1, #0x3
- add r1, r2, r1
- add r1, r1, r3
- push {r1-r4}
- ldrh r4, [r1, #0x2]
- mov r0, r8
- mov r1, #0xc
- ldr r3, =Decrypter
- bl bx_r3
- cmp r0, r4
- bne exit2
- pop {r1-r4}
- ldr r0, =Evolve
- bx r0
- exit2:
- pop {r1-r4}
- exit:
- ldr r0, =EvoExit
- bx r0
- bx_r3:
- bx r3
- .ltorg
复制代码 删除道具修复:- #Firered: put 00 48 00 47 XX+1 XX XX 08 at 0x80CED68
- .set IndexOfDayHeldItem, 0x10
- .set IndexOfNightHeldItem, 0x11
- .set Encrypt, 0x804037D
- .set Decrypt, 0x803FBE9
- .set BackAddr, 0x80CED71
- .set EvoTable, 0x8259754
- .thumb
- mov r0, r9
- mov r1, #0xb
- ldr r3, =Decrypt
- bl bx_r3
- ldr r1, =EvoTable
- mov r2, #40
- mul r0, r2
- add r0, r1, r0
- ldrh r0, [r0]
- cmp r0, #IndexOfDayHeldItem
- beq ItemReduction
- cmp r0, #IndexOfNightHeldItem
- bne back
- ItemReduction:
- mov r0, r9
- mov r1, #0xc
- mov r2, #0
- str r2, [sp]
- mov r2, sp
- ldr r3, =Encrypt
- bl bx_r3
- back:
- mov r0, r9
- mov r1, #0xB
- mov r2, r4
- add r2, #0xC
- ldr r3, =Encrypt
- bl bx_r3
- mov r0, r9
- ldr r3, =BackAddr
- bx_r3:
- bx r3
- .ltorg
复制代码 |