Seventh, fix the TM read
In 125A78, emter 00 49 08 47 FF FF FF 08, FF FF FF 08 = the offset of empty place+1 offset form
.text
.align 2
.thumb
.thumb_func
.global TM_index
main:
mov r1, #0xBB
lsl r1, r1, #0x1
cmp r0, r1
bhi newtm
mov r1, #0x90
lsl r1, r1, #0x1
add r1, r1, #0x1
sub r0, r0 ,r1
lsl r0, r0, #0x1
b exit
newtm:
add r1, r1, #0x1
sub r0, r0, r1
lsl r0, r0, #0x1
add r0, r0, #0x74
exit:
ldr r1, tm_table
add r0, r0, r1
ldrh r0, [r0]
bx lr
.align
tm_table:.word 0x08EEEEEE
note:
table is the fifth step offset of create TM table
#0xBB is new item number, one before beginning number divide by 2 (If divide by 2 cannot get the whole number, please use that value, then use bge to analysis),if you not understand how to do please copy, but the TM will be start on 0x177
The formula of moves read in orgin version (The number of item*0x10000+0xFEDF0000)/0x8000
Eighth, fix the number of TM
The same of last code, in 131D5A please enter 01 48 00 47 00 00 FF FF FF 08, FF FF FF 08 = The offset of empty place+1 Offset form
write these ASM in that offset of empty place
code:
.text
.align 2
.thumb
.thumb_func
.global tm_name
main:
mov r0, #0xBB
lsl r0, r0, #0x1
cmp r6, r0
bhi new_tm
mov r0, #0xA9
lsl r0, r0, #0x1
cmp r6, r0
bls old_tm
ldr r1, temp
ldr r0, return1
bx r0
new_tm:
ldr r1, text_no
mov r0, r5
bl refresh
ldr r4, ram
ldr r0, value
ldr r1, return3
bx r1
old_tm:
ldr r1, return2
bx r1
refresh:
ldr r2, routine
bx r2
.align
text_no:.word 0x08416226
routine:.word 0x08008DA5
temp:.word 0x08463178
return1:.word 0x08131D65
return2:.word 0x08131DA5
ram:.word 0x02021CD0
value:.word 0xFFFFFEBC
return3:.word 0x08131DB1
note:
this code is according to Jambo51's 649 record to get,
#0xBB is new item number, one before beginning number divide by 2 (If divide by 2 cannot get the whole number, please use that value, then use bge to analysis),if you not understand how to do please copy, but the TM will be start on 0x177
7. Change the TM analysis
In 43C40 please enter 00 48 00 47 FF FF FF 08, FF FF FF 08 = The offset of empty place+1 Offset form
Write this ASM in that offset of empty place
Code:
.text
.align 2
.thumb
.thumb_func
.global tm_compact_hack
main:
mov r3, r1
cmp r4, #0x56
bge newtm
check:
cmp r4, #0x1f
bls first_32
cmp r4, #0x3f
bls first_64
cmp r4, #0x5f
bls first_96
after_96:
mov r0, r4
sub r0, #0x60
mov r2, #0x1
lsl r2, r0
ldr r0, table
lsl r1, r1, #0x4
add r0, #0xC
get_offset:
add r1, r1, r0
ldr r0, [r1]
and r0, r2
b exit
newtm:
sub r4, #0x1C
b check
first_64:
mov r0, r4
sub r0, #0x20
mov r2, #0x1
lsl r2, r0
ldr r0, table
lsl r1, r1, #0x4
add r0, #0x4
b get_offset
first_96:
mov r0, r4
sub r0, #0x40
mov r2, #0x1
lsl r2, r0
ldr r0, table
lsl r1, r1, #0x4
add r0, #0x8
b get_offset
first_32:
mov r1, #0x1
lsl r1, r5
ldr r2, table
lsl r0, r3, #0x4
add r0, r0, r2
ldr r0, [r0]
and r0, r1
exit:
pop {r4-r5}
pop {r1}
bx r1
.align
table:.word 0x08DDDDDD
note:
#0x56 is from 0x177-0x121, #0x1C is the difference in amount from one item to new TM after the last HM ,if you not understand, please copy it,but the beginning of TM will start from 0x177
table is new Pokemon learn TM table