MrDollSteak

Formerly known as 11bayerf1

Age 24
Male
Hong Kong
Seen 2 Weeks Ago
Posted May 15th, 2019
846 posts
10.7 Years
How would I be able to implement an eviolite, or one thay doesn't require the pokemon to be able to evolve? Would it just be combining metal powder with the deepseascale and then bypassing the check so the game thinks its a clampearl/ditto thats holding the item?
Making the eviolite is quite easy actually.

All you'd need to do is branch to free space from the original check, load the relevant values over the branch location, then check for the original item ie. deepseascale or metal powder and then return to the original routine if it is correct. Then you'd check for the eviolite byte, and if it's not, then branch to the next item check.

Under the actual eviolite code, to check if a pokemon has an evolution you'd want to do the following.
Load the evo table (0x8259754) into one register. Load the user's pokemon's index number into another register, then mov #0x28 into a third register.
Multiply the index number by #0x28, then add that to the register containing 259754, then load the contents of that register into the same register, and compare that to 0x0. If it is NOT 0x0 (has some form of evolution) it will give a successful boost.

EDIT: I've made the code now!
The index I've used 0x47 is just for my rombase, feel free to change that to whatever you want.

Eviolite
Spoiler:
Eviolite I (Sp. Def boost)

.text
.align 2
.thumb
.thumb_func
.global eviolite

main:
	ldr r2, [sp, #0x1C]
	cmp r2, #0x24
	beq seascale
	cmp r2, #0x46
	beq vest
	cmp r2, #0x47
	bne return
eviolite:
	ldr r3, [sp, #0x4]
	ldrh r1, [r3] 
	mov r2, #0x28 
	mul r2, r1
	ldr r0, .evotable
	add r0, r1, r0 
	ldr r0, [r0]
	cmp r0, #0x0
	beq return
vest:
	ldr r1, .return3
	bx r1
seascale:
	ldr r3, [sp, #0x4]
	ldrh r1, [r3]
	ldr r0, .return2
	bx r0
return:
	ldr r2, .return
	bx r2

.align
.evotable:        .word 0x08259754
.return:        .word 0x0803EFF7
.return2:        .word 0x0803EFE9
.return3:        .word 0x0803EFEF
*Insert 80 46 01 4A 10 47 00 00 XX+1 XX XX 08* at 3EFDC
(This replaces Assault Vest I's code, so if you intend to use both, feel free to delete the other one)

Eviolite II (Defense boost)

.text
.align 2
.thumb
.thumb_func
.global eviolite

main:
	ldr r0, [sp, #0x1C]
	cmp r0, #0x40
	beq metalpowder
	cmp r0, #0x47
	bne return
eviolite:
	ldr r1, [sp, #0x4] 
	ldrh r0, [r1] 
	mov r2, #0x28 
	mul r2, r0 
	ldr r0, .evotable
	add r0, r2, r0 
	ldr r0, [r0] 
	cmp r0, #0x0
	beq return
success:
	ldr r3, .return
	bx r3
metalpowder:
	ldr r1, [sp, #0x4]
	ldrh r0, [r1]
	ldr r3, .return2
	bx r3
return:
	ldr r3, .return3
	bx r3

.align
.evotable:        .word 0x08259754
.return:        .word 0x0803F019
.return2:        .word 0x0803F015
.return3:        .word 0x0803F021
*Insert 01 48 00 47 00 00 XX+1 XX XX 08* at 3F00A