kearnseyboy6
Aussie's Toughest Mudder
- 300
- Posts
- 16
- Years
- Seen Jun 22, 2019
Hello, I am a newbie and I'm kinda confused with this kind of method to write routines as it always push registers and use much stack space.
For example, if I want to use the "specific map evolution", I will write the following function:
I think it does nothing different with the original routine in the thread so I'm really confused about it. (I haven't tested it yet)Spoiler:
Code:.thumb add r0, r6, r7 lsl r0, r0, #0x3 add r0, r2, r0 add r1, r0, r3 ldrh r0, [r1, #0x2] push {r1} ldr r1, mapbank ldrh r1, [r1] cmp r1, r0 bne exit pop {r1} ldr r0, evolve bx r0 exit: pop {r1} ldr r0, evolve add r0, r0, #0x4 bx r0 .align 2 evolve: .word 0x0804310D mapbank: .word 0x02031DBC
Does evolution hack use special ways to write routines?
Anyway, I've updated the night friendship evolution and day friendship evolution routine so that they will work in fr.
Spoiler:
night friendship evolution:
Code:.thumb push {r0} ldr r0, time ldrb r0, [r0] cmp r0, #0x15 bge evolution cmp r0, #0x6 blt evolution pop {r0} ldr r0, noevo bx r0 evolution: pop {r0} ldr r1, evolve bx r1 .align 2 time: .word 0x3005542 evolve: .word 0x8043001 noevo: .word 0x8043111
day friendship evolution:
Code:.thumb push {r0} ldr r0, time ldrb r0, [r0] cmp r0, #0x15 bge abort cmp r0, #0x6 blt abort pop {r0} ldr r1, evolve bx r1 abort: pop {r0} ldr r0, noevo bx r0 .align 2 time: .word 0x3005542 evolve: .word 0x8043001 noevo: .word 0x8043111
They're also not tested.
Then I've written the slowpoke evolution method in anime, which is linked with Shellder and the Shellder in the party will be deleted. (which is mainly based on JPAN's deletion function)However, I haven't tested it and I'm really not sure what will happen if the player abort the evolution by pressing "b".(As I haven't tested it, I absolutely haven't debugged the evolution process) Anyway, here's my routine (may have error as it is much more complicated than the others)
Spoiler:Code:.thumb protection: push {r1-r7} mov r4, #0x0 mov r6, #0x0 loop: mov r5, #0x96 lsl r5, #0x2 cmp r4, r5 bhs abort ldr r0, pkmnaddr add r0, r0, r4 mov r1, #0xb add r6, #0x1 push {r6} push {r0} bl decrypt pop {r1} pop {r6} add r4, #0x64 cmp r0, #0x5a bne loop deletefunc: mov r2, r8 cmp r1, r2 blt adjust delete: add r3, r1, #0x0 add r3, #0x64 sub r0 ,r6, #0x1 main_loop: mov r2, #0x0 mov r4, #0x0 cmp r0, #0x5 beq delete_loop add r0, #0x1 copy_loop: ldr r4, [r3, #0x0] str r4, [r1, #0x0] add r3, #0x4 add r1, #0x4 add r2, #0x4 cmp r2, #0x64 beq main_loop b copy_loop delete_loop: str r4, [r1, #0x0] add r1, #0x4 add r2, #0x4 cmp r2, #0x64 bne delete_loop end: pop {r1-r7} ldr r0, evolve bx r0 decrypt: ldr r2, decrypter bx r2 abort: pop {r1-r7} ldr r0, quit bx r0 adjust: sub r2, #0x64 mov r8, r2 b delete .align 2 pkmnaddr: .word 0x02024284 decrypter: .word 0x0803fbe9 quit: .word 0x08043111 evolve: .word 0x08043017
Edit:I've tested the last one and I found that it worked ok except when the player press B to abort the evolution because the routine is also executed in this case so the shellder will be deleted although the evolution is aborted. Maybe I must look into the evolution routine to get it fixed. But I don't think the item related routine which requires to delete the pokemon's item is safe, if in the same case.
![]()
(I don't use an English ROM, sorry for that.)
It has a glitch, so temporarily removed.
That's good work ^^
For the map evolution it load the argument (map ID) an just compares it to the current map. Very simple routine :)