Advertiser Content

Petuuuhhh

Age 25
Male
Georgia
Seen 1 Hour Ago
Posted 1 Day Ago
624 posts
2.2 Years
First insert this into free space:
Spoiler:
[/code].thumb
.align

ADD R1, #0xE8
push {r0-r2}
Ldr r0, FlagNumber
Bl FlagCheck
mov r2, r0
pop {r0-r1}
Cmp r2, #0x0
pop {r2}
Beq OriginalCode
bl GetEggMoves
LDR R1, [R7]
b Return

FlagCheck:
ldr r2, FlagCheck2
bx r2

OriginalCode:
bl GetRelearnerMoves
LDR R1, [R7]
b Return

GetRelearnerMoves:
ldr r2, GetRelearnerMoves2
bx r2

GetEggMoves:
ldr r2, GetEggMoves2
bx r2

Return:
ldr r2, Return2
bx r2

.align 2
FlagNumber: .word 0x00000200
FlagCheck2: .word 0x0806e6d1
GetRelearnerMoves2: .word 0x08043c85
GetEggMoves2: .word 0x08045C29
Return2: .word 0x080E50F1
[/code]

Then, insert 00 4A 10 47 XX +1 XX XX XX where XX XX XX XX is the free location you inserted it in in little endian, i.e. backwards but keeping things in 2 byte chunks, at 0xe50e8
For example: 0x12345678 in little endian is 78 56 34 12

Second, insert this into free space:
Spoiler:
.thumb
.align

ADD    R1, #0xE8
push {r0-r2}
Ldr r0, FlagNumber
Bl FlagCheck
mov r2, r0
pop {r0-r1}
Cmp r2, #0x0
pop {r2}
Beq OriginalCode
bl GetEggMoves
LSL    R0, R0, #0x18
b Return

FlagCheck:
ldr r2, FlagCheck2
bx r2

OriginalCode:
bl GetRelearnerMoves
LSL    R0, R0, #0x18
b Return

GetRelearnerMoves:
ldr r2, GetRelearnerMoves2
bx r2

GetEggMoves:
ldr r2, GetEggMoves2
bx r2

Return:
ldr r2, Return2
bx r2

.align 2
FlagNumber:      .word 0x00000200
FlagCheck2:         .word 0x0806e6d1
GetRelearnerMoves2: .word 0x08043c85
GetEggMoves2: .word 0x08045C29
Return2: .word 0x080E5105


Then, insert 00 4A 10 47 YY +1 YY YY YY where YY YY YY YY is the free location you inserted it in in little endian at 0xe50fc

Use HackMew's THUMB Editor and Assembler to do this.

In order to insert the ASM routines, open the .asm files in the THUMB Editor and Assembler, then go to "compile" -> "output to .bin"
Then open them in your hex editor and copy/paste them at the offsets you want
Also, every offset in an unexpanded FireRed you edit with a hex editor is at 0x08XXXXXX, where XXXXXX is the last 6 digits. Knowing this, you will always put 08 as the last 2 digits of little endian
One last thing, your free locations have to be at an address that is a multiple of 4

In order to enable the egg move tutor, set flag 200 using setflag 0x200 in XSE.

Petuuuhhh

Age 25
Male
Georgia
Seen 1 Hour Ago
Posted 1 Day Ago
624 posts
2.2 Years
Oh, it's different in pokeemerald. Uh I know how to do that, too. If you look at my GitHub, I have a commit with it in there. I'll pull it up for you and edit this post.

Alright, look through these. If you have any questions, let me know!
https://github.com/petuuuhhh/em-guantlet/commit/8c72b19238ee436708accbddebe19310911e0c9b
https://github.com/petuuuhhh/em-guantlet/commit/58c0f3fbcd7722ae56af267c2167d269d4f4e86e
https://github.com/petuuuhhh/em-guantlet/commit/36ec8afb0fa67735ddf8343abf4d9111498ac394
Advertiser Content