Seen November 12th, 2021
Posted April 30th, 2020
218 posts
8.8 Years
I know there's several routines like this one, but I didn't found them practical.

Check a specific pokémon with a specific slot through the use of Special 0xA2, for Emerald :


	push {r0-r7, lr}
	ldr r6, var8005
	ldr r0, party_amount
	ldrb r4, [r0]
	cmp r4, #0x0
	beq End
	ldrh r3, [r6]
	cmp r3, #0x0
	beq End
	add r0, #3
	mov r1, #0x64
	ldr r7, var8004
	ldrb r6, [r7]
	mul r1, r6
	add r0, r0, r1
	push {r0-r7}
	mov r1, #0xB
	ldr r2, decrypt_poke
	bl Jump
	mov r9, r0
	pop {r0-r7}
	cmp r9, r3
	bne NoSuccess
	mov r6, #1
	b Success
	mov r6, #0
	ldr r7, var8005
	strh r6, [r7]

	pop {r0-r7, pc}
mov pc, r2
.align 2
party_amount:	.word 0x020244E9
var8004:		.word 0x020275D8 + (0x8004*2)
var8005:		.word 0x020275D8 + (0x8005*2)
decrypt_poke:	.word 0x0806A519

/*var 0x8005, species you want to check*/
Basically, when you use special 0xA2, the party screen open and you can select a poke, the slot of the poke is stored in var 0x8004, so the routine check this slot.
If it is the the same species than 0x8005, then 0x8005 is set to 1, otherwise to 0