Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- isDSi - 207ACB8
- mov r0, #0
- bx lr
- 20309BC 40 88 LDRH R0, [R0,#2] ldrb r0, [r0, #2] - 0x7880
- 2030A9E 70 88 LDRH R0, [R6,#2] ldrb r0, [r6, #2] - 0x78B0
- 2030BAC 40 88 LDRH R0, [R0,#2]
- 2030CC0 70 88 LDRH R0, [R6,#2]
- 2030A50
- 2030B52
- 2030C6A
- 2030D80
- void __fastcall setNatureResetStats(void *pPkm, u8 nature)
- void __fastcall setTrainerPkmStats(u16 trainer_idx, void *pPkm, u16 form, u8 gender_abil)
- 24b available in setTrainerPkmStats
- mov r0, r2 @pTrPkm
- mov r1, r4 @pPkm
- bl isDSi+4
- mov r0, r2 205A99C
- push {r4-r7, lr}
- mov r7, r0
- mov r6, r4
- mov r5, r2
- ldrb r4, [r7, #3]
- cmp r4, #0
- beq rnd
- cmp r4, #25
- bgt rnd
- set:
- mov r0, r6
- sub r1, r4, #1
- bl setNatureResetStats(0x201D60C)
- 0205A9B4 FE2BF7C2
- rnd:
- mov r0, #25
- bl randMain64(0x2005748) 0205A9BA FEC6F7AA
- mov r1, r0
- mov r0, r6
- bl setNatureResetStats(0x201D60C)
- 0205A9C2 FE24F7C2
- ret:
- mov r2, r5
- ldrb r3, [r2, #1]
- ldrh r2, [r2, #6]
- mov r1, r6
- pop {r4-r7, pc}
- setup:
- RAM_ARM9:02030A4C EB F7 20 FD BL createPKM
- RAM_ARM9:02030A50 0D 9A LDR R2, [SP,#0x98+current_tr_poke_ptr] this load a pointer to the trpoke poke's file to r2
- RAM_ARM9:02030A52 0D 9B LDR R3, [SP,#0x98+current_tr_poke_ptr] same into r3
- RAM_ARM9:02030A54 D2 88 LDRH R2, [R2,#6] ; form byte 7 is the form to use in the trpoke file
- RAM_ARM9:02030A56 5B 78 LDRB R3, [R3,#1] ; gender_abil byte 2 is the gender/abil byte
- RAM_ARM9:02030A58 04 98 LDR R0, [SP,#0x98+trainer_idx] ; trainer_idx this is unused but would be a massive pain to do anything with
- RAM_ARM9:02030A5A 21 1C MOVS R1, R4 ; pPkm
- RAM_ARM9:02030A5C 00 F0 E6 F9 BL setTrainerPkmStats
- my function will be setTrPkmNature(void* pTrPkm, *empty*, void* pTrPkm)
- this will look like:
- RAM_ARM9:02030A4C EB F7 20 FD BL createPKM
- RAM_ARM9:02030A50 0D 9A LDR R2, [SP,#0x98+current_tr_poke_ptr]
- RAM_ARM9:02030A52 0D 9B mov r0, r2
- RAM_ARM9:02030A54 C0 46 nop
- RAM_ARM9:02030A56 D2 88 bl setTrPkmNature
- RAM_ARM9:02030A5A 21 1C MOVS R1, R4 ; pPkm
- RAM_ARM9:02030A5C 00 F0 E6 F9 BL setTrainerPkmStats
- move:
- RAM_ARM9:02030B4E 1A 98 LDR R0, [SP,#0x98+p_trpoke_data]
- RAM_ARM9:02030B50 43 18 ADDS R0, R0, R1
- RAM_ARM9:02030B52 DA 88 mov r2, r0
- RAM_ARM9:02030B54 5B 78 bl setTrPkmNature
- RAM_ARM9:02030B58 21 1C MOVS R1, R4 ; pPkm
- RAM_ARM9:02030B5A 00 F0 67 F9 BL setTrainerPkmStats
- item:
- RAM_ARM9:02030C6A 0C 9A LDR R2, [SP,#0x98+var_68]
- RAM_ARM9:02030C6C 0C 9B mov r0, r2
- RAM_ARM9:02030C6E D2 88 nop
- RAM_ARM9:02030C70 5B 78 bl setTrPkmNature
- RAM_ARM9:02030C74 21 1C MOVS R1, R4 ; pPkm
- RAM_ARM9:02030C76 00 F0 D9 F8 BL setTrainerPkmStats
- move/item:
- RAM_ARM9:02030D80 FA 88 LDRH R2, [R7,#6] ; form
- RAM_ARM9:02030D82 7B 78 LDRB R3, [R7,#1] ; gender_abil
- RAM_ARM9:02030D84 04 98 LDR R0, [SP,#0x98+trainer_idx] ; trainer_idx
- RAM_ARM9:02030D86 21 1C MOVS R1, R4 ; pPkm
- RAM_ARM9:02030D88 00 F0 50 F8 BL setTrainerPkmStats
- black2:
- hook: 205A970
- setNatureResetStats: 201D5E0
- mainRand64: 2005748
- RAM:02030A20 EB F7 20 FD BL createPKM
- RAM:02030A24 0D 9A LDR R2, [SP,#0x98+var_64]
- RAM:02030A26 0D 9B LDR R3, [SP,#0x98+var_64]
- RAM:02030A28 D2 88 LDRH R2, [R2,#6]
- RAM:02030A2A 5B 78 LDRB R3, [R3,#1]
- RAM:02030A2C 04 98 LDR R0, [SP,#0x98+var_88]
- RAM:02030A2E 21 1C MOVS R1, R4
- RAM:02030A30 00 F0 E6 F9 BL setTrainerPkmStats
- RAM:02030B22 1A 98 LDR R0, [SP,#0x98+var_30]
- RAM:02030B24 43 18 ADDS R3, R0, R1
- RAM:02030B26 DA 88 LDRH R2, [R3,#6]
- RAM:02030B28 5B 78 LDRB R3, [R3,#1]
- RAM:02030B2A 04 98 LDR R0, [SP,#0x98+var_88]
- RAM:02030B2C 21 1C MOVS R1, R4
- RAM:02030B2E 00 F0 67 F9 BL setTrainerPkmStats
- RAM:02030C3A EC F7 6F F8 BL setPkmStat
- RAM:02030C3E 0C 9A LDR R2, [SP,#0x98+var_68]
- RAM:02030C40 0C 9B LDR R3, [SP,#0x98+var_68]
- RAM:02030C42 D2 88 LDRH R2, [R2,#6]
- RAM:02030C44 5B 78 LDRB R3, [R3,#1]
- RAM:02030C46 04 98 LDR R0, [SP,#0x98+var_88]
- RAM:02030C48 21 1C MOVS R1, R4
- RAM:02030C4A 00 F0 D9 F8 BL setTrainerPkmStats
- RAM:02030D52 F4 DB BLT loc_2030D3E
- RAM:02030D54 FA 88 LDRH R2, [R7,#6]
- RAM:02030D56 7B 78 LDRB R3, [R7,#1]
- RAM:02030D58 04 98 LDR R0, [SP,#0x98+var_88]
- RAM:02030D5A 21 1C MOVS R1, R4
- RAM:02030D5C 00 F0 50 F8 BL setTrainerPkmStats
Add Comment
Please, Sign In to add comment