From 5145a851a2d645791e6d3d89ca00706cf7656319 Mon Sep 17 00:00:00 2001 From: red031000 Date: Mon, 31 Aug 2020 14:42:00 +0100 Subject: arm9 MI_init --- arm9/asm/MI_init.s | 17 ----------------- arm9/lib/include/MI_init.h | 6 ++++++ arm9/lib/src/MI_init.c | 11 +++++++++++ arm9/lib/src/OS_init.c | 2 +- arm9/lib/src/OS_reset.c | 2 +- 5 files changed, 19 insertions(+), 19 deletions(-) delete mode 100644 arm9/asm/MI_init.s create mode 100644 arm9/lib/include/MI_init.h create mode 100644 arm9/lib/src/MI_init.c (limited to 'arm9') diff --git a/arm9/asm/MI_init.s b/arm9/asm/MI_init.s deleted file mode 100644 index 282dde3b..00000000 --- a/arm9/asm/MI_init.s +++ /dev/null @@ -1,17 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - arm_func_start MI_Init -MI_Init: ; 0x020CE648 - stmdb sp!, {lr} - sub sp, sp, #0x4 - mov r0, #0x3 - bl MI_SetWramBank - mov r0, #0x0 - bl MI_StopDma - add sp, sp, #0x4 - ldmfd sp!, {lr} - bx lr - diff --git a/arm9/lib/include/MI_init.h b/arm9/lib/include/MI_init.h new file mode 100644 index 00000000..a338ab6b --- /dev/null +++ b/arm9/lib/include/MI_init.h @@ -0,0 +1,6 @@ +#ifndef POKEDIAMOND_MI_INIT_H +#define POKEDIAMOND_MI_INIT_H + +void MI_Init(void); + +#endif //POKEDIAMOND_MI_INIT_H diff --git a/arm9/lib/src/MI_init.c b/arm9/lib/src/MI_init.c new file mode 100644 index 00000000..266a5f2f --- /dev/null +++ b/arm9/lib/src/MI_init.c @@ -0,0 +1,11 @@ +#include "nitro/types.h" +#include "function_target.h" +#include "MI_dma.h" + +extern void MI_SetWramBank(u32 param0); + +ARM_FUNC void MI_Init(void) +{ + MI_SetWramBank(3); + MI_StopDma(0); +} diff --git a/arm9/lib/src/OS_init.c b/arm9/lib/src/OS_init.c index 5bd435e7..00355853 100644 --- a/arm9/lib/src/OS_init.c +++ b/arm9/lib/src/OS_init.c @@ -1,8 +1,8 @@ #include "function_target.h" #include "OS_init.h" +#include "MI_init.h" extern void PXI_Init(void); -extern void MI_Init(void); extern void CTRDG_Init(void); extern void CARD_Init(void); extern void PM_Init(void); diff --git a/arm9/lib/src/OS_reset.c b/arm9/lib/src/OS_reset.c index a458a8fa..03781947 100644 --- a/arm9/lib/src/OS_reset.c +++ b/arm9/lib/src/OS_reset.c @@ -7,6 +7,7 @@ #include "OS_spinLock.h" #include "OS_cache.h" #include "sections.h" +#include "MI_dma.h" static u16 OSi_IsInitReset = 0; vu16 OSi_IsResetOccurred = 0; @@ -16,7 +17,6 @@ extern u32 PXI_IsCallbackReady(u32 param1, u32 param2); extern void PXI_SetFifoRecvCallback(u32 param1, void* callback); extern u32 PXI_SendWordByFifo(u32 param1, u32 data, u32 param2); extern void CARD_LockRom(u16 lockId); -extern void MI_StopDma(u32 dma); static void OSi_CommonCallback(PXIFifoTag tag, u32 data, BOOL err); static void OSi_SendToPxi(u16 data); -- cgit v1.2.3 From e30abae941b5f61a9d943ffdc6dae7f0ea087118 Mon Sep 17 00:00:00 2001 From: red031000 Date: Mon, 31 Aug 2020 14:55:44 +0100 Subject: arm9 MI_wram --- arm9/asm/MI_wram.s | 12 ------------ arm9/lib/include/MI_wram.h | 14 ++++++++++++++ arm9/lib/src/MI_init.c | 5 ++--- arm9/lib/src/MI_wram.c | 8 ++++++++ 4 files changed, 24 insertions(+), 15 deletions(-) delete mode 100644 arm9/asm/MI_wram.s create mode 100644 arm9/lib/include/MI_wram.h create mode 100644 arm9/lib/src/MI_wram.c (limited to 'arm9') diff --git a/arm9/asm/MI_wram.s b/arm9/asm/MI_wram.s deleted file mode 100644 index 3f245464..00000000 --- a/arm9/asm/MI_wram.s +++ /dev/null @@ -1,12 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - arm_func_start MI_SetWramBank -MI_SetWramBank: - ldr r1, _020CD870 ; =0x04000247 - strb r0, [r1, #0x0] - bx lr - .balign 4 -_020CD870: .word 0x04000247 diff --git a/arm9/lib/include/MI_wram.h b/arm9/lib/include/MI_wram.h new file mode 100644 index 00000000..fa445a8a --- /dev/null +++ b/arm9/lib/include/MI_wram.h @@ -0,0 +1,14 @@ +#ifndef POKEDIAMOND_MI_WRAM_H +#define POKEDIAMOND_MI_WRAM_H + +typedef enum +{ + MI_WRAM_ARM9_ALL = 0, + MI_WRAM_1616_1 = 1, + MI_WRAM_1616_2 = 2, + MI_WRAM_ARM7_ALL = 3 +} MIWram; + +void MI_SetWramBank(MIWram cnt); + +#endif //POKEDIAMOND_MI_WRAM_H diff --git a/arm9/lib/src/MI_init.c b/arm9/lib/src/MI_init.c index 266a5f2f..4556e95a 100644 --- a/arm9/lib/src/MI_init.c +++ b/arm9/lib/src/MI_init.c @@ -1,11 +1,10 @@ #include "nitro/types.h" #include "function_target.h" #include "MI_dma.h" - -extern void MI_SetWramBank(u32 param0); +#include "MI_wram.h" ARM_FUNC void MI_Init(void) { - MI_SetWramBank(3); + MI_SetWramBank(MI_WRAM_ARM7_ALL); MI_StopDma(0); } diff --git a/arm9/lib/src/MI_wram.c b/arm9/lib/src/MI_wram.c new file mode 100644 index 00000000..a65bbb6f --- /dev/null +++ b/arm9/lib/src/MI_wram.c @@ -0,0 +1,8 @@ +#include "function_target.h" +#include "consts.h" +#include "MI_wram.h" + +ARM_FUNC void MI_SetWramBank(MIWram cnt) +{ + reg_GX_VRAMCNT_WRAM = (u8)cnt; +} -- cgit v1.2.3 From 79a290495b0b1fe4df5f8f55d9b3f008410ae83d Mon Sep 17 00:00:00 2001 From: red031000 Date: Mon, 31 Aug 2020 15:21:01 +0100 Subject: arm9 MI_uncompress --- arm9/asm/MI_uncompress.s | 50 ---------------------------------- arm9/lib/include/MI_uncompress.h | 7 +++-- arm9/lib/src/MI_uncompress.c | 59 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 53 deletions(-) delete mode 100644 arm9/asm/MI_uncompress.s create mode 100644 arm9/lib/src/MI_uncompress.c (limited to 'arm9') diff --git a/arm9/asm/MI_uncompress.s b/arm9/asm/MI_uncompress.s deleted file mode 100644 index 5f736e14..00000000 --- a/arm9/asm/MI_uncompress.s +++ /dev/null @@ -1,50 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - arm_func_start MI_UncompressLZ8 -MI_UncompressLZ8: ; 0x020CE528 - stmdb sp!, {r4-r6,lr} - ldr r5, [r0], #0x4 - mov r2, r5, lsr #0x8 -_020CE534: - cmp r2, #0x0 - ble _020CE5B4 - ldrb lr, [r0], #0x1 - mov r4, #0x8 -_020CE544: - subs r4, r4, #0x1 - blt _020CE534 - tst lr, #0x80 - bne _020CE568 - ldrb r6, [r0], #0x1 - .word 0xE1416096 - add r1, r1, #0x1 - sub r2, r2, #0x1 - b _020CE5A4 -_020CE568: - ldrb r5, [r0, #0x0] - mov r6, #0x3 - add r3, r6, r5, asr #0x4 - ldrb r6, [r0], #0x1 - and r5, r6, #0xf - mov r12, r5, lsl #0x8 - ldrb r6, [r0], #0x1 - orr r5, r6, r12 - add r12, r5, #0x1 - sub r2, r2, r3 -_020CE590: - ldrb r5, [r1, -r12] - .word 0xE1415095 - add r1, r1, #0x1 - subs r3, r3, #0x1 - bgt _020CE590 -_020CE5A4: - cmp r2, #0x0 - movgt lr, lr, lsl #0x1 - bgt _020CE544 - b _020CE534 -_020CE5B4: - ldmia sp!, {r4-r6,lr} - bx lr diff --git a/arm9/lib/include/MI_uncompress.h b/arm9/lib/include/MI_uncompress.h index 55f28e27..defafa8c 100644 --- a/arm9/lib/include/MI_uncompress.h +++ b/arm9/lib/include/MI_uncompress.h @@ -1,6 +1,7 @@ -#ifndef NITRO_MI_UNCOMPRESS_H_ -#define NITRO_MI_UNCOMPRESS_H_ +#ifndef POKEDIAMOND_MI_UNCOMPRESS_H +#define POKEDIAMOND_MI_UNCOMPRESS_H void MIi_UncompressBackward(void * bottom); +void MI_UncompressLZ8(register const void *srcp, register void *destp); -#endif //NITRO_MI_UNCOMPRESS_H_ +#endif //POKEDIAMOND_MI_UNCOMPRESS_H diff --git a/arm9/lib/src/MI_uncompress.c b/arm9/lib/src/MI_uncompress.c new file mode 100644 index 00000000..c6ad7e4e --- /dev/null +++ b/arm9/lib/src/MI_uncompress.c @@ -0,0 +1,59 @@ +#include "function_target.h" +#include "MI_uncompress.h" + +ARM_FUNC asm void MI_UncompressLZ8(register const void *srcp, register void *destp) +{ + stmfd sp!, {r4-r6, lr} + + ldr r5, [r0], #4 + mov r2, r5, lsr #8 + +_020CE534: + cmp r2, #0 + ble _020CE5B4 + + ldrb lr, [r0], #1 + mov r4, #8 + +_020CE544: + subs r4, r4, #1 + blt _020CE534 + + tst lr, #0x80 + bne _020CE568 + + ldrb r6, [r0], #1 + swpb r6, r6, [r1] + add r1, r1, #1 + sub r2, r2, #1 + b _020CE5A4 + +_020CE568: + ldrb r5, [r0, #0] + mov r6, #3 + add r3, r6, r5, asr #4 + ldrb r6, [r0], #1 + and r5, r6, #0xf + mov r12, r5, lsl #8 + ldrb r6, [r0], #1 + orr r5, r6, r12 + add r12, r5, #1 + sub r2, r2, r3 + +_020CE590: + ldrb r5, [r1, -r12] + swpb r5, r5, [r1] + add r1, r1, #1 + subs r3, r3, #1 + bgt _020CE590 + +_020CE5A4: + cmp r2, #0 + movgt lr, lr, lsl #1 + bgt _020CE544 + b _020CE534 + +_020CE5B4: + ldmfd sp!, {r4-r6, lr} + bx lr +} -- cgit v1.2.3 From 683f3b18d536f2f000d217f241967f2520ba7593 Mon Sep 17 00:00:00 2001 From: red031000 Date: Mon, 31 Aug 2020 18:11:34 +0100 Subject: error_handling --- arm9/asm/error_handling.s | 17 ----------------- arm9/src/error_handling.c | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 17 deletions(-) delete mode 100644 arm9/asm/error_handling.s create mode 100644 arm9/src/error_handling.c (limited to 'arm9') diff --git a/arm9/asm/error_handling.s b/arm9/asm/error_handling.s deleted file mode 100644 index d6330897..00000000 --- a/arm9/asm/error_handling.s +++ /dev/null @@ -1,17 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start ErrorHandling -ErrorHandling: ; 0x02020C2C - push {r3, lr} - bl FUN_02031810 - cmp r0, #0x0 - beq _02020C42 - bl OS_GetProcMode - cmp r0, #0x12 - beq _02020C42 - bl PrintErrorMessageAndReset -_02020C42: - pop {r3, pc} diff --git a/arm9/src/error_handling.c b/arm9/src/error_handling.c new file mode 100644 index 00000000..7ccadd95 --- /dev/null +++ b/arm9/src/error_handling.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "error_handling.h" + +extern u32 FUN_02031810(void); +extern void PrintErrorMessageAndReset(void); + +THUMB_FUNC void ErrorHandling(void) +{ + if (FUN_02031810()) + { + if (OS_GetProcMode() != OS_PROCMODE_IRQ) + { + PrintErrorMessageAndReset(); + } + } +} \ No newline at end of file -- cgit v1.2.3 From c75a270a82fdf7f92d118c61237fea034cbc17f3 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 31 Aug 2020 13:16:24 -0400 Subject: Bump inja; trdata and trpoke to json --- arm9/asm/unk_02038C78.s | 2 +- arm9/asm/unk_0204AB0C.s | 2 +- arm9/asm/unk_0206ABC4.s | 24 ++++++++++++------------ arm9/global.inc | 6 +++--- arm9/modules/11/asm/module_11_thumb2.s | 4 ++-- arm9/modules/67/asm/module_67.s | 2 +- 6 files changed, 20 insertions(+), 20 deletions(-) (limited to 'arm9') diff --git a/arm9/asm/unk_02038C78.s b/arm9/asm/unk_02038C78.s index 73daf808..d16d93f2 100644 --- a/arm9/asm/unk_02038C78.s +++ b/arm9/asm/unk_02038C78.s @@ -2143,7 +2143,7 @@ _02039628: .word 0x00001388 FUN_0203962C: ; 0x0203962C push {r3, lr} mov r1, #0x9 - bl FUN_0206AC74 + bl TrainerData_GetAttr cmp r0, #0x0 beq _0203963C mov r0, #0x1 diff --git a/arm9/asm/unk_0204AB0C.s b/arm9/asm/unk_0204AB0C.s index 5da6e8d4..45702b12 100644 --- a/arm9/asm/unk_0204AB0C.s +++ b/arm9/asm/unk_0204AB0C.s @@ -304,7 +304,7 @@ _0204AD0A: FUN_0204AD0C: ; 0x0204AD0C push {r3-r5, lr} mov r1, #0x1 - bl FUN_0206AC74 + bl TrainerData_GetAttr lsl r0, r0, #0x18 lsr r5, r0, #0x18 ldr r0, _0204AD38 ; =0x0000044D diff --git a/arm9/asm/unk_0206ABC4.s b/arm9/asm/unk_0206ABC4.s index 9d8b12d8..7ea69ce1 100644 --- a/arm9/asm/unk_0206ABC4.s +++ b/arm9/asm/unk_0206ABC4.s @@ -43,7 +43,7 @@ _0206ABF4: cmp r0, #0x0 beq _0206AC48 add r1, sp, #0x14 - bl FUN_0206ADE0 + bl TrainerData_ReadTrData ldr r3, [sp, #0x8] add r6, sp, #0x14 add r3, #0x28 @@ -77,7 +77,7 @@ _0206AC3E: ldr r0, [sp, #0x0] ldr r2, [sp, #0x4] add r1, r7, #0x0 - bl FUN_0206AE0C + bl LoadTrainerParty _0206AC48: ldr r0, [sp, #0x8] add r7, r7, #0x1 @@ -100,13 +100,13 @@ _0206AC48: nop _0206AC70: .word 0x0000022F - thumb_func_start FUN_0206AC74 -FUN_0206AC74: ; 0x0206AC74 + thumb_func_start TrainerData_GetAttr +TrainerData_GetAttr: ; 0x0206AC74 push {r4-r5, lr} sub sp, #0x34 add r5, r1, #0x0 add r1, sp, #0x0 - bl FUN_0206ADE0 + bl TrainerData_ReadTrData cmp r5, #0x9 bhi _0206ACCC add r0, r5, r5 @@ -293,8 +293,8 @@ _0206ADD6: nop _0206ADDC: .word 0x0000022E - thumb_func_start FUN_0206ADE0 -FUN_0206ADE0: ; 0x0206ADE0 + thumb_func_start TrainerData_ReadTrData +TrainerData_ReadTrData: ; 0x0206ADE0 ldr r3, _0206ADEC ; =ReadWholeNarcMemberByIdPair add r2, r0, #0x0 add r0, r1, #0x0 @@ -303,8 +303,8 @@ FUN_0206ADE0: ; 0x0206ADE0 nop _0206ADEC: .word ReadWholeNarcMemberByIdPair - thumb_func_start FUN_0206ADF0 -FUN_0206ADF0: ; 0x0206ADF0 + thumb_func_start TrainerData_ReadTrPoke +TrainerData_ReadTrPoke: ; 0x0206ADF0 ldr r3, _0206ADFC ; =ReadWholeNarcMemberByIdPair add r2, r0, #0x0 add r0, r1, #0x0 @@ -321,8 +321,8 @@ FUN_0206AE00: ; 0x0206AE00 nop _0206AE08: .word UNK_020F8010 - thumb_func_start FUN_0206AE0C -FUN_0206AE0C: ; 0x0206AE0C + thumb_func_start LoadTrainerParty +LoadTrainerParty: ; 0x0206AE0C push {r3-r7, lr} sub sp, #0x50 add r7, r1, #0x0 @@ -345,7 +345,7 @@ FUN_0206AE0C: ; 0x0206AE0C add r0, r4, r6 ldr r0, [r0, #0x18] ldr r1, [sp, #0x4c] - bl FUN_0206ADF0 + bl TrainerData_ReadTrPoke mov r0, #0x34 add r5, r7, #0x0 mul r5, r0 diff --git a/arm9/global.inc b/arm9/global.inc index 1dc35362..c039fd35 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -4838,11 +4838,11 @@ .extern WazaGetMaxPp .extern GetAttrFromWazaTbl .extern FUN_0206ABC4 -.extern FUN_0206AC74 +.extern TrainerData_GetAttr .extern FUN_0206ACD4 .extern FUN_0206AD4C -.extern FUN_0206ADE0 -.extern FUN_0206ADF0 +.extern TrainerData_ReadTrData +.extern TrainerData_ReadTrPoke .extern FUN_0206AE00 .extern PCStorage_init .extern PCStorage_sizeof diff --git a/arm9/modules/11/asm/module_11_thumb2.s b/arm9/modules/11/asm/module_11_thumb2.s index c342adc4..a962fbf2 100644 --- a/arm9/modules/11/asm/module_11_thumb2.s +++ b/arm9/modules/11/asm/module_11_thumb2.s @@ -11742,11 +11742,11 @@ MOD11_02234CFC: ; 0x02234CFC str r0, [sp, #4] ldrh r0, [r6, r0] add r1, sp, #8 - bl FUN_0206ADE0 + bl TrainerData_ReadTrData ldr r0, [sp, #4] add r1, r4, #0 ldrh r0, [r6, r0] - bl FUN_0206ADF0 + bl TrainerData_ReadTrPoke add r0, sp, #8 ldrb r1, [r0] cmp r1, #3 diff --git a/arm9/modules/67/asm/module_67.s b/arm9/modules/67/asm/module_67.s index 997d785e..d71a7476 100644 --- a/arm9/modules/67/asm/module_67.s +++ b/arm9/modules/67/asm/module_67.s @@ -1701,7 +1701,7 @@ _021D822A: mov r1, #1 lsl r0, r0, #0x10 lsr r0, r0, #0x11 - bl FUN_0206AC74 + bl TrainerData_GetAttr cmp r0, #0x3f bne _021D828A ldr r0, [r4, #0x50] -- cgit v1.2.3 From e20f0ad32ec45564d4ad8c0c3ed07d9c21744588 Mon Sep 17 00:00:00 2001 From: red031000 Date: Mon, 31 Aug 2020 19:06:54 +0100 Subject: newline --- arm9/src/error_handling.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arm9') diff --git a/arm9/src/error_handling.c b/arm9/src/error_handling.c index 7ccadd95..9052773f 100644 --- a/arm9/src/error_handling.c +++ b/arm9/src/error_handling.c @@ -13,4 +13,4 @@ THUMB_FUNC void ErrorHandling(void) PrintErrorMessageAndReset(); } } -} \ No newline at end of file +} -- cgit v1.2.3 From 392f50eea4375637f23a4abc8643f525ba98f469 Mon Sep 17 00:00:00 2001 From: PikalaxALT Date: Mon, 31 Aug 2020 16:47:15 -0400 Subject: constants/trainer_classes.h --- arm9/asm/unk_0206ABC4.s | 14 +++++++------- arm9/src/pokemon.c | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 16 deletions(-) (limited to 'arm9') diff --git a/arm9/asm/unk_0206ABC4.s b/arm9/asm/unk_0206ABC4.s index 7ea69ce1..b4b3d88e 100644 --- a/arm9/asm/unk_0206ABC4.s +++ b/arm9/asm/unk_0206ABC4.s @@ -5,13 +5,13 @@ .global UNK_020F8010 UNK_020F8010: ; 0x020F8010 - .byte 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00 - .byte 0x00, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x02 - .byte 0x00, 0x01, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x02 - .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00 - .byte 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x00 - .byte 0x01, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00 - .byte 0x01, 0x00, 0x00, 0x00 + .byte 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 0 + .byte 0, 1, 1, 0, 0, 1, 1, 2, 0, 1, 1, 0, 0, 0, 1, 2 + .byte 0, 1, 0, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 2 + .byte 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0 + .byte 0, 0, 1, 0, 0, 1, 2, 0, 1, 0, 1, 0, 1, 1, 1, 0 + .byte 1, 0, 2, 0, 1, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 0 + .byte 1, 0, 0, 0 .text diff --git a/arm9/src/pokemon.c b/arm9/src/pokemon.c index fb1ad894..48b1a225 100644 --- a/arm9/src/pokemon.c +++ b/arm9/src/pokemon.c @@ -17,6 +17,7 @@ #include "constants/items.h" #include "constants/moves.h" #include "constants/sinnoh_dex.h" +#include "constants/trainer_classes.h" #pragma thumb on @@ -3701,21 +3702,21 @@ int FUN_0206AA30(int x) { switch (x) { - case 63: + case TRAINER_CLASS_PKMN_TRAINER_BARRY: return 2; - case 90: - case 91: - case 92: - case 93: - case 94: - return x - 87; + case TRAINER_CLASS_PKMN_TRAINER_AROMA_LADY: + case TRAINER_CLASS_PKMN_TRAINER_RICH_BOY: + case TRAINER_CLASS_PKMN_TRAINER_PICNICKER: + case TRAINER_CLASS_PKMN_TRAINER_CAMPER: + case TRAINER_CLASS_PKMN_TRAINER_POKEKID: + return x - TRAINER_CLASS_COMMANDER_JUPITER; default: if (FUN_0206AE00(x) == 1) return 1; else return 0; - case 0: - case 1: + case TRAINER_CLASS_PKMN_TRAINER_M: + case TRAINER_CLASS_PKMN_TRAINER_F: return x; } } -- cgit v1.2.3