diff options
59 files changed, 540 insertions, 387 deletions
diff --git a/arm9/asm/scrcmd_24.s b/arm9/asm/scrcmd_24.s deleted file mode 100644 index b9569382..00000000 --- a/arm9/asm/scrcmd_24.s +++ /dev/null @@ -1,316 +0,0 @@ - .include "asm/macros.inc" - .include "global.inc" - - .text - - thumb_func_start FUN_02045D88 -FUN_02045D88: ; 0x02045D88 - push {r4-r6, lr} - add r5, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - mov r1, #0x13 - bl FUN_02039438 - add r1, r5, #0x0 - add r1, #0x80 - lsl r2, r4, #0x18 - add r6, r0, #0x0 - ldr r1, [r1, #0x0] - mov r0, #0x20 - lsr r2, r2, #0x18 - bl FUN_02037CF0 - str r0, [r6, #0x0] - ldr r1, _02045DCC ; =FUN_0203BC04 - add r0, r5, #0x0 - bl SetupNativeScript - mov r0, #0x1 - pop {r4-r6, pc} - nop -_02045DCC: .word FUN_0203BC04 - - thumb_func_start FUN_02045DD0 -FUN_02045DD0: ; 0x02045DD0 - push {r3-r5, lr} - add r4, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r4, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl GetVarPointer - add r4, #0x80 - add r5, r0, #0x0 - ldr r0, [r4, #0x0] - mov r1, #0x13 - bl FUN_02039438 - add r4, r0, #0x0 - ldr r0, [r4, #0x0] - cmp r0, #0x0 - bne _02045DFC - bl ErrorHandling -_02045DFC: - ldr r0, [r4, #0x0] - bl FUN_02037D5C - strh r0, [r5, #0x0] - ldrh r0, [r5, #0x0] - cmp r0, #0x4 - bne _02045E0E - mov r0, #0xff - strh r0, [r5, #0x0] -_02045E0E: - ldr r0, [r4, #0x0] - bl FreeToHeap - mov r0, #0x0 - str r0, [r4, #0x0] - pop {r3-r5, pc} - .balign 4 - - thumb_func_start FUN_02045E1C -FUN_02045E1C: ; 0x02045E1C - mov r0, #0x0 - bx lr - - thumb_func_start FUN_02045E20 -FUN_02045E20: ; 0x02045E20 - push {r4-r6, lr} - add r5, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl GetVarPointer - add r4, r0, #0x0 - add r0, r5, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r5, #0x80 - add r6, r0, #0x0 - ldr r0, [r5, #0x0] - ldr r0, [r0, #0xc] - bl SavArray_PlayerParty_get - add r1, r6, #0x0 - bl GetPartyMonByIndex - mov r1, #0x20 - bl FUN_02088DF8 - add r5, r0, #0x0 - bl FUN_02088EF8 - strh r0, [r4, #0x0] - add r0, r5, #0x0 - bl FreeToHeap - mov r0, #0x0 - pop {r4-r6, pc} - .balign 4 - - thumb_func_start FUN_02045E74 -FUN_02045E74: ; 0x02045E74 - push {r3-r7, lr} - sub sp, #0x8 - add r5, r0, #0x0 - add r0, #0x80 - add r7, r1, #0x0 - ldr r0, [r0, #0x0] - mov r1, #0x13 - str r2, [sp, #0x0] - add r6, r3, #0x0 - bl FUN_02039438 - str r0, [sp, #0x4] - mov r0, #0x20 - bl FUN_02088DD8 - add r4, r0, #0x0 - ldr r0, [sp, #0x4] - str r4, [r0, #0x0] - ldr r0, [sp, #0x0] - str r0, [r4, #0x0] - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl ScriptEnvironment_GetSav2Ptr - bl Sav2_PlayerData_GetProfileAddr - str r0, [r4, #0x4] - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - ldr r0, [r0, #0xc] - bl Sav2_PlayerData_GetOptionsAddr - str r0, [r4, #0x8] - str r6, [r4, #0xc] - add r0, r5, #0x0 - strb r7, [r4, #0x15] - add r0, #0x80 - ldr r0, [r0, #0x0] - add r1, r4, #0x0 - bl FUN_02038864 - ldr r1, _02045EDC ; =FUN_0203BC04 - add r0, r5, #0x0 - bl SetupNativeScript - add r0, r6, #0x0 - bl FreeToHeap - add sp, #0x8 - pop {r3-r7, pc} - .balign 4 -_02045EDC: .word FUN_0203BC04 - - thumb_func_start FUN_02045EE0 -FUN_02045EE0: ; 0x02045EE0 - mov r0, #0x1 - bx lr - - thumb_func_start FUN_02045EE4 -FUN_02045EE4: ; 0x02045EE4 - push {r3-r5, lr} - add r5, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - ldr r0, [r0, #0xc] - bl SavArray_PlayerParty_get - add r1, r4, #0x0 - bl GetPartyMonByIndex - add r4, r0, #0x0 - mov r1, #0x20 - bl FUN_02088DF8 - add r3, r0, #0x0 - add r0, r5, #0x0 - mov r1, #0x1 - add r2, r4, #0x0 - bl FUN_02045E74 - mov r0, #0x1 - pop {r3-r5, pc} - - thumb_func_start FUN_02045F24 -FUN_02045F24: ; 0x02045F24 - push {r4-r6, lr} - add r5, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r6, r0, #0x0 - add r0, r5, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - ldr r0, [r0, #0xc] - bl SavArray_PlayerParty_get - add r1, r6, #0x0 - bl GetPartyMonByIndex - add r6, r0, #0x0 - mov r0, #0x20 - mov r1, #0x4 - bl AllocFromHeap - add r3, r0, #0x0 - ldr r0, _02045F80 ; =0x0000FFFF - strh r4, [r3, #0x0] - strh r0, [r3, #0x2] - add r0, r5, #0x0 - mov r1, #0x0 - add r2, r6, #0x0 - bl FUN_02045E74 - mov r0, #0x1 - pop {r4-r6, pc} - .balign 4 -_02045F80: .word 0x0000FFFF - - thumb_func_start FUN_02045F84 -FUN_02045F84: ; 0x02045F84 - mov r0, #0x0 - bx lr - - thumb_func_start FUN_02045F88 -FUN_02045F88: ; 0x02045F88 - push {r3-r5, lr} - add r4, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r4, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl GetVarPointer - add r4, #0x80 - add r5, r0, #0x0 - ldr r0, [r4, #0x0] - mov r1, #0x13 - bl FUN_02039438 - ldr r4, [r0, #0x0] - cmp r4, #0x0 - bne _02045FB2 - bl ErrorHandling -_02045FB2: - ldrb r0, [r4, #0x16] - cmp r0, #0x0 - bne _02045FBC - mov r0, #0x0 - b _02045FBE -_02045FBC: - mov r0, #0xff -_02045FBE: - strh r0, [r5, #0x0] - add r0, r4, #0x0 - bl FUN_02088DF0 - mov r0, #0x0 - pop {r3-r5, pc} - .balign 4 - - thumb_func_start FUN_02045FCC -FUN_02045FCC: ; 0x02045FCC - push {r3-r5, lr} - add r4, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r4, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl GetVarPointer - add r4, #0x80 - add r5, r0, #0x0 - ldr r0, [r4, #0x0] - mov r1, #0x13 - bl FUN_02039438 - ldr r4, [r0, #0x0] - cmp r4, #0x0 - bne _02045FF6 - bl ErrorHandling -_02045FF6: - ldrb r0, [r4, #0x16] - cmp r0, #0x0 - bne _02046000 - mov r0, #0x0 - b _02046002 -_02046000: - mov r0, #0xff -_02046002: - strh r0, [r5, #0x0] - add r0, r4, #0x0 - bl FUN_02088DF0 - mov r0, #0x0 - pop {r3-r5, pc} - .balign 4 diff --git a/arm9/asm/scrcmd_asm.s b/arm9/asm/scrcmd_asm.s index e481c6f1..71187dd6 100644 --- a/arm9/asm/scrcmd_asm.s +++ b/arm9/asm/scrcmd_asm.s @@ -14,50 +14,6 @@ UNK_021C5A0C: ; 0x021C5A0C .text - thumb_func_start FUN_0203AFC4 -FUN_0203AFC4: ; 0x0203AFC4 - push {r4-r6, lr} - add r5, r0, #0x0 - bl ScriptReadHalfword - add r1, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - bl VarGet - add r6, r0, #0x0 - add r0, r5, #0x0 - bl ScriptReadWord - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - add r1, r6, #0x0 - bl FUN_0203B120 - add r6, r0, #0x0 - bne _0203AFF6 - bl ErrorHandling -_0203AFF6: - ldr r1, [r5, #0x8] - add r0, r6, #0x0 - add r1, r1, r4 - bl FUN_0205AEA4 - add r4, r0, #0x0 - add r0, r5, #0x0 - add r0, #0x80 - ldr r0, [r0, #0x0] - mov r1, #0x4 - bl FUN_02039438 - ldrb r1, [r0, #0x0] - add r5, #0x80 - mov r2, #0x0 - add r1, r1, #0x1 - strb r1, [r0, #0x0] - ldr r0, [r5, #0x0] - add r1, r4, #0x0 - bl FUN_0203B174 - mov r0, #0x0 - pop {r4-r6, pc} - thumb_func_start FUN_0203B024 FUN_0203B024: ; 0x0203B024 push {r3-r7, lr} diff --git a/arm9/asm/unk_02038C78.s b/arm9/asm/unk_02038C78.s index 38588cd5..b60088a5 100644 --- a/arm9/asm/unk_02038C78.s +++ b/arm9/asm/unk_02038C78.s @@ -243,7 +243,7 @@ gScriptCmdTable: ; 0x020F355C .word ScrCmd_Unk005B .word ScrCmd_Unk005C .word ScrCmd_Unk005D - .word FUN_0203AFC4 + .word ScrCmd_Unk005E .word FUN_0203B148 .word FUN_0203B1F0 .word FUN_0203B3B0 @@ -603,8 +603,8 @@ gScriptCmdTable: ; 0x020F355C .word FUN_0203E078 .word FUN_0203E0CC .word FUN_0203E120 - .word FUN_02045D88 - .word FUN_02045DD0 + .word ScrCmd_Unk01C6 + .word ScrCmd_Unk01C7 .word FUN_02044D8C .word FUN_02044E34 .word FUN_02044E78 @@ -691,14 +691,14 @@ gScriptCmdTable: ; 0x020F355C .word FUN_0203E848 .word FUN_0203E858 .word ScrCmd_Unk021D - .word FUN_02045E1C - .word FUN_02045E20 - .word FUN_02045EE0 - .word FUN_02045EE4 - .word FUN_02045F84 - .word FUN_02045F88 - .word FUN_02045F24 - .word FUN_02045FCC + .word ScrCmd_Unk021E + .word ScrCmd_Unk021F + .word ScrCmd_Unk0220 + .word ScrCmd_Unk0221 + .word ScrCmd_Unk0222 + .word ScrCmd_Unk0223 + .word ScrCmd_Unk0224 + .word ScrCmd_Unk0225 .word FUN_0203E870 .word FUN_0203E894 .word FUN_0203E8C4 diff --git a/arm9/global.inc b/arm9/global.inc index e826f9ce..59d2d3da 100644 --- a/arm9/global.inc +++ b/arm9/global.inc @@ -2783,7 +2783,7 @@ .extern ScrCmd_Unk0048 .extern ScrCmd_Unk02CF .extern ScrCmd_Unk02D0 -.extern FUN_0203AFC4 +.extern ScrCmd_Unk005E .extern FUN_0203B024 .extern FUN_0203B148 .extern FUN_0203B1F0 @@ -3402,16 +3402,16 @@ .extern ScrCmd_Unk0090 .extern ScrCmd_Unk0091 .extern ScrCmd_Unk0092 -.extern FUN_02045D88 -.extern FUN_02045DD0 -.extern FUN_02045E1C -.extern FUN_02045E20 -.extern FUN_02045EE0 -.extern FUN_02045EE4 -.extern FUN_02045F24 -.extern FUN_02045F84 -.extern FUN_02045F88 -.extern FUN_02045FCC +.extern ScrCmd_Unk01C6 +.extern ScrCmd_Unk01C7 +.extern ScrCmd_Unk021E +.extern ScrCmd_Unk021F +.extern ScrCmd_Unk0220 +.extern ScrCmd_Unk0221 +.extern ScrCmd_Unk0224 +.extern ScrCmd_Unk0222 +.extern ScrCmd_Unk0223 +.extern ScrCmd_Unk0225 .extern ScrCmd_Unk023F .extern ScrCmd_Unk0240 .extern ScrCmd_Unk0241 diff --git a/arm9/src/scrcmd.c b/arm9/src/scrcmd.c index 3bb26ac0..00ccd34d 100644 --- a/arm9/src/scrcmd.c +++ b/arm9/src/scrcmd.c @@ -55,6 +55,10 @@ extern void MOD05_021E26CC(u32 param0, u8 param1); extern void MOD05_021E2B80(u32 param0, u8 param1); extern void MOD05_021E2B9C(u32 param0, u8 param1); +extern u32 FUN_0203B120(struct UnkSavStruct80 *arg, u16 param1); +extern u32 FUN_0205AEA4(u32 param0, const u8 *ptr); +extern void FUN_0203B174(struct UnkSavStruct80 *arg, u32 param1, u32 param2); + extern u8 *UNK_020F34E0; static BOOL RunPauseTimer(struct ScriptContext *ctx); @@ -1298,3 +1302,19 @@ THUMB_FUNC BOOL ScrCmd_Unk02D0(struct ScriptContext *ctx) MOD05_021E2B9C(*unk, ScriptReadByte(ctx)); return TRUE; } + +THUMB_FUNC BOOL ScrCmd_Unk005E(struct ScriptContext *ctx) +{ + u16 unk = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + u32 unk2 = ScriptReadWord(ctx); + + u32 unk3 = FUN_0203B120(ctx->unk80, unk); + GF_ASSERT(unk3); + + u32 unk4 = FUN_0205AEA4(unk3, ctx->scriptPtr + unk2); + u8 *unk5 = FUN_02039438(ctx->unk80, 4); + (*unk5)++; + + FUN_0203B174(ctx->unk80, unk4, 0); + return FALSE; +} diff --git a/arm9/src/scrcmd_24.c b/arm9/src/scrcmd_24.c new file mode 100644 index 00000000..d3f955d0 --- /dev/null +++ b/arm9/src/scrcmd_24.c @@ -0,0 +1,276 @@ +#include "scrcmd.h" +#include "heap.h" +#include "party.h" +#include "unk_020377F0.h" +#include "unk_02088DD8.h" + +extern void* FUN_02039438(struct UnkSavStruct80*, int idx); + +extern struct UnkStruct_02037CF0* FUN_02037CF0(u32 heap_id, struct UnkSavStruct80*, u8); +extern u8 FUN_02037D5C(struct UnkStruct_02037CF0*); +extern void FUN_02038864(struct UnkSavStruct80*, struct UnkStruct_02088DD8*); +extern BOOL FUN_0203BC04(struct ScriptContext* ctx); +extern struct UnkStruct_02088DD8* FUN_02088DD8(u32 heap_id); +extern void FUN_02088DF0(struct UnkStruct_02037CF0*); +extern void* FUN_02088DF8(struct Pokemon* pokemon, u32 heap_id); +extern BOOL FUN_02088EF8(void*); + +THUMB_FUNC BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx) +{ + u16 unk = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + struct UnkStruct_02037CF0** unk_ret_ptr = FUN_02039438(ctx->unk80, 19); + *unk_ret_ptr = FUN_02037CF0(32, ctx->unk80, (u8)unk); + + SetupNativeScript(ctx, FUN_0203BC04); + return TRUE; +} + +#ifdef NONMATCHING +THUMB_FUNC BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx) +{ + u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx)); + struct UnkStruct_02037CF0** unk_ptr = FUN_02039438(ctx->unk80, 19); + GF_ASSERT(*unk_ptr != NULL); + + *ret_ptr = FUN_02037D5C(*unk_ptr); + if (*ret_ptr == 4) + { + *ret_ptr = 0xFF; + } + + FreeToHeap(*unk_ptr); + *unk_ptr = NULL; + return FALSE; +} +#else +THUMB_FUNC asm BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx) +{ + push {r3-r5, lr} + add r4, r0, #0x0 + bl ScriptReadHalfword + add r1, r0, #0x0 + add r0, r4, #0x0 + add r0, #0x80 + ldr r0, [r0, #0x0] + bl GetVarPointer + add r4, #0x80 + add r5, r0, #0x0 + ldr r0, [r4, #0x0] + mov r1, #0x13 + bl FUN_02039438 + add r4, r0, #0x0 + ldr r0, [r4, #0x0] + cmp r0, #0x0 + bne _02045DFC + bl ErrorHandling +_02045DFC: + ldr r0, [r4, #0x0] + bl FUN_02037D5C + strh r0, [r5, #0x0] + ldrh r0, [r5, #0x0] + cmp r0, #0x4 + bne _02045E0E + mov r0, #0xff + strh r0, [r5, #0x0] +_02045E0E: + ldr r0, [r4, #0x0] + bl FreeToHeap + mov r0, #0x0 + str r0, [r4, #0x0] + pop {r3-r5, pc} +} +#endif + +THUMB_FUNC BOOL ScrCmd_Unk021E(struct ScriptContext* ctx) +{ +#pragma unused(ctx) + return FALSE; +} + +THUMB_FUNC BOOL ScrCmd_Unk021F(struct ScriptContext* ctx) +{ + u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx)); + u16 mon_idx = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + struct PlayerParty* party = SavArray_PlayerParty_get(ctx->unk80->saveBlock2); + struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx); + void* unk_ptr = FUN_02088DF8(pokemon, 32); + + *ret_ptr = (u16)FUN_02088EF8(unk_ptr); + FreeToHeap(unk_ptr); + + return FALSE; +} + +THUMB_FUNC void FUN_02045E74(struct ScriptContext* ctx, u8 a1, struct Pokemon* pokemon, void* a3) +{ + struct UnkStruct_02088DD8** unk = FUN_02039438(ctx->unk80, 19); + struct UnkStruct_02088DD8* unk2 = FUN_02088DD8(32); + *unk = unk2; + + unk2->pokemon = pokemon; + + struct SaveBlock2* sav2 = ScriptEnvironment_GetSav2Ptr(ctx->unk80); + unk2->player = Sav2_PlayerData_GetProfileAddr(sav2); + + unk2->options = Sav2_PlayerData_GetOptionsAddr(ctx->unk80->saveBlock2); + unk2->unkC = a3; + unk2->unk15 = a1; + FUN_02038864(ctx->unk80, unk2); + + SetupNativeScript(ctx, FUN_0203BC04); + FreeToHeap(a3); +} + +THUMB_FUNC BOOL ScrCmd_Unk0220(struct ScriptContext* ctx) +{ +#pragma unused(ctx) + return TRUE; +} + +THUMB_FUNC BOOL ScrCmd_Unk0221(struct ScriptContext* ctx) +{ + u16 mon_idx = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + struct PlayerParty* party = SavArray_PlayerParty_get(ctx->unk80->saveBlock2); + struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx); + void* unk_ptr = FUN_02088DF8(pokemon, 32); + + FUN_02045E74(ctx, 1, pokemon, unk_ptr); + return TRUE; +} + +THUMB_FUNC BOOL ScrCmd_Unk0224(struct ScriptContext* ctx) +{ + u16 mon_idx = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + u16 unk2 = VarGet(ctx->unk80, ScriptReadHalfword(ctx)); + struct PlayerParty* party = SavArray_PlayerParty_get(ctx->unk80->saveBlock2); + struct Pokemon* pokemon = GetPartyMonByIndex(party, mon_idx); + + u16* unk_array = AllocFromHeap(32, 2 * sizeof(u16)); + unk_array[0] = unk2; + unk_array[1] = 0xFFFF; + + FUN_02045E74(ctx, 0, pokemon, unk_array); + return TRUE; +} + +THUMB_FUNC BOOL ScrCmd_Unk0222(struct ScriptContext* ctx) +{ +#pragma unused(ctx) + return FALSE; +} + +#ifdef NONMATCHING +THUMB_FUNC BOOL ScrCmd_Unk0223(struct ScriptContext* ctx) +{ + u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx)); + struct UnkStruct_02037CF0** unk = FUN_02039438(ctx->unk80, 19); + struct UnkStruct_02037CF0* unk_sub = *unk; + + GF_ASSERT(unk_sub != NULL); + + if (unk_sub->unk16 == 0) + { + *ret_ptr = 0; + } + else + { + *ret_ptr = 0xFF; + } + + FUN_02088DF0(unk_sub); + return FALSE; +} +#else +THUMB_FUNC asm BOOL ScrCmd_Unk0223(struct ScriptContext* ctx) +{ + push {r3-r5, lr} + add r4, r0, #0x0 + bl ScriptReadHalfword + add r1, r0, #0x0 + add r0, r4, #0x0 + add r0, #0x80 + ldr r0, [r0, #0x0] + bl GetVarPointer + add r4, #0x80 + add r5, r0, #0x0 + ldr r0, [r4, #0x0] + mov r1, #0x13 + bl FUN_02039438 + ldr r4, [r0, #0x0] + cmp r4, #0x0 + bne _02045FB2 + bl ErrorHandling +_02045FB2: + ldrb r0, [r4, #0x16] + cmp r0, #0x0 + bne _02045FBC + mov r0, #0x0 + b _02045FBE +_02045FBC: + mov r0, #0xff +_02045FBE: + strh r0, [r5, #0x0] + add r0, r4, #0x0 + bl FUN_02088DF0 + mov r0, #0x0 + pop {r3-r5, pc} +} +#endif + +#ifdef NONMATCHING +THUMB_FUNC BOOL ScrCmd_Unk0225(struct ScriptContext* ctx) +{ + u16* ret_ptr = GetVarPointer(ctx->unk80, ScriptReadHalfword(ctx)); + struct UnkStruct_02037CF0** unk = FUN_02039438(ctx->unk80, 19); + struct UnkStruct_02037CF0* unk_sub = *unk; + + GF_ASSERT(unk_sub != NULL); + + if (unk_sub->unk16 == 0) + { + *ret_ptr = 0; + } + else + { + *ret_ptr = 0xFF; + } + + FUN_02088DF0(unk_sub); + return FALSE; +} +#else +THUMB_FUNC asm BOOL ScrCmd_Unk0225(struct ScriptContext* ctx) +{ + push {r3-r5, lr} + add r4, r0, #0x0 + bl ScriptReadHalfword + add r1, r0, #0x0 + add r0, r4, #0x0 + add r0, #0x80 + ldr r0, [r0, #0x0] + bl GetVarPointer + add r4, #0x80 + add r5, r0, #0x0 + ldr r0, [r4, #0x0] + mov r1, #0x13 + bl FUN_02039438 + ldr r4, [r0, #0x0] + cmp r4, #0x0 + bne _02045FB2 + bl ErrorHandling +_02045FB2: + ldrb r0, [r4, #0x16] + cmp r0, #0x0 + bne _02045FBC + mov r0, #0x0 + b _02045FBE +_02045FBC: + mov r0, #0xff +_02045FBE: + strh r0, [r5, #0x0] + add r0, r4, #0x0 + bl FUN_02088DF0 + mov r0, #0x0 + pop {r3-r5, pc} +} +#endif diff --git a/files/poketool/icongra/poke_icon/.gitignore b/files/poketool/icongra/poke_icon/.gitignore index 8f4afa7f..fccab7c8 100644 --- a/files/poketool/icongra/poke_icon/.gitignore +++ b/files/poketool/icongra/poke_icon/.gitignore @@ -1,6 +1,5 @@ narc_0000.NCLR -narc_0002.NCER -narc_0004.NCER +*.NCER narc_0007.NCGR narc_0008.NCGR narc_0009.NCGR @@ -11,4 +10,24 @@ narc_0013.NCGR narc_0014.NCGR narc_0015.NCGR narc_0016.NCGR +narc_0017.NCGR +narc_0018.NCGR +narc_0019.NCGR +narc_0020.NCGR +narc_0021.NCGR +narc_0022.NCGR +narc_0023.NCGR +narc_0024.NCGR +narc_0025.NCGR +narc_0026.NCGR +narc_0027.NCGR +narc_0028.NCGR +narc_0029.NCGR +narc_0030.NCGR +narc_0031.NCGR +narc_0032.NCGR +narc_0033.NCGR +narc_0034.NCGR +narc_0035.NCGR +narc_0036.NCGR narc_0402.NCGR diff --git a/files/poketool/icongra/poke_icon/narc_0002.json b/files/poketool/icongra/poke_icon/narc_0002.json index defb5b41..1750fa55 100644 --- a/files/poketool/icongra/poke_icon/narc_0002.json +++ b/files/poketool/icongra/poke_icon/narc_0002.json @@ -4,6 +4,7 @@ "imageHeight": 32, "imageWidth": 32, "cellCount": 2, + "mappingType": 0, "cells": [ { "readOnly": 2054, diff --git a/files/poketool/icongra/poke_icon/narc_0004.json b/files/poketool/icongra/poke_icon/narc_0004.json index 3d8b8b80..b8cae63a 100644 --- a/files/poketool/icongra/poke_icon/narc_0004.json +++ b/files/poketool/icongra/poke_icon/narc_0004.json @@ -4,6 +4,7 @@ "imageHeight": 32, "imageWidth": 32, "cellCount": 2, + "mappingType": 0, "cells": [ { "readOnly": 2054, diff --git a/files/poketool/icongra/poke_icon/narc_0006.NCER b/files/poketool/icongra/poke_icon/narc_0006.NCER Binary files differdeleted file mode 100644 index 19e6e054..00000000 --- a/files/poketool/icongra/poke_icon/narc_0006.NCER +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0006.json b/files/poketool/icongra/poke_icon/narc_0006.json new file mode 100644 index 00000000..ce7f1d83 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0006.json @@ -0,0 +1,68 @@ +{ + "labelEnabled": true, + "extended": true, + "imageHeight": 32, + "imageWidth": 32, + "cellCount": 2, + "mappingType": 1, + "cells": [ + { + "readOnly": 2054, + "maxX": 15, + "maxY": 15, + "minX": 65520, + "minY": 65520, + "OAM": { + "Attr0": { + "YCoordinate": 240, + "Rotation": false, + "SizeDisable": false, + "Mode": 0, + "Mosaic": false, + "Colours": 16, + "Shape": 0 + }, + "Attr1": { + "XCoordinate": 496, + "RotationScaling": 0, + "Size": 2 + }, + "Attr2": { + "CharName": 0, + "Priority": 0, + "Palette": 0 + } + } + }, + { + "readOnly": 2054, + "maxX": 15, + "maxY": 15, + "minX": 65520, + "minY": 65520, + "OAM": { + "Attr0": { + "YCoordinate": 240, + "Rotation": false, + "SizeDisable": false, + "Mode": 0, + "Mosaic": false, + "Colours": 16, + "Shape": 0 + }, + "Attr1": { + "XCoordinate": 496, + "RotationScaling": 0, + "Size": 2 + }, + "Attr2": { + "CharName": 8, + "Priority": 0, + "Palette": 0 + } + } + } + ], + "labels": ["CellAnime0", "CellAnime1", "CellAnime2", "CellAnime3", "CellAnime4", "CellAnime5"], + "labelCount": 6 +} diff --git a/files/poketool/icongra/poke_icon/narc_0017.NCGR b/files/poketool/icongra/poke_icon/narc_0017.NCGR Binary files differdeleted file mode 100644 index 8676315a..00000000 --- a/files/poketool/icongra/poke_icon/narc_0017.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0017.png b/files/poketool/icongra/poke_icon/narc_0017.png Binary files differnew file mode 100644 index 00000000..2b8dbd37 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0017.png diff --git a/files/poketool/icongra/poke_icon/narc_0018.NCGR b/files/poketool/icongra/poke_icon/narc_0018.NCGR Binary files differdeleted file mode 100644 index 6401655c..00000000 --- a/files/poketool/icongra/poke_icon/narc_0018.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0018.png b/files/poketool/icongra/poke_icon/narc_0018.png Binary files differnew file mode 100644 index 00000000..fe17c1e7 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0018.png diff --git a/files/poketool/icongra/poke_icon/narc_0019.NCGR b/files/poketool/icongra/poke_icon/narc_0019.NCGR Binary files differdeleted file mode 100644 index 46d342ae..00000000 --- a/files/poketool/icongra/poke_icon/narc_0019.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0019.png b/files/poketool/icongra/poke_icon/narc_0019.png Binary files differnew file mode 100644 index 00000000..11ad963d --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0019.png diff --git a/files/poketool/icongra/poke_icon/narc_0020.NCGR b/files/poketool/icongra/poke_icon/narc_0020.NCGR Binary files differdeleted file mode 100644 index db6cb323..00000000 --- a/files/poketool/icongra/poke_icon/narc_0020.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0020.png b/files/poketool/icongra/poke_icon/narc_0020.png Binary files differnew file mode 100644 index 00000000..6efbd041 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0020.png diff --git a/files/poketool/icongra/poke_icon/narc_0021.NCGR b/files/poketool/icongra/poke_icon/narc_0021.NCGR Binary files differdeleted file mode 100644 index f0e4eb2b..00000000 --- a/files/poketool/icongra/poke_icon/narc_0021.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0021.png b/files/poketool/icongra/poke_icon/narc_0021.png Binary files differnew file mode 100644 index 00000000..1c857d44 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0021.png diff --git a/files/poketool/icongra/poke_icon/narc_0022.NCGR b/files/poketool/icongra/poke_icon/narc_0022.NCGR Binary files differdeleted file mode 100644 index 3d83aea4..00000000 --- a/files/poketool/icongra/poke_icon/narc_0022.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0022.png b/files/poketool/icongra/poke_icon/narc_0022.png Binary files differnew file mode 100644 index 00000000..d5e6471a --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0022.png diff --git a/files/poketool/icongra/poke_icon/narc_0023.NCGR b/files/poketool/icongra/poke_icon/narc_0023.NCGR Binary files differdeleted file mode 100644 index b84b867e..00000000 --- a/files/poketool/icongra/poke_icon/narc_0023.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0023.png b/files/poketool/icongra/poke_icon/narc_0023.png Binary files differnew file mode 100644 index 00000000..c3c8f5d8 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0023.png diff --git a/files/poketool/icongra/poke_icon/narc_0024.NCGR b/files/poketool/icongra/poke_icon/narc_0024.NCGR Binary files differdeleted file mode 100644 index a0bb2fad..00000000 --- a/files/poketool/icongra/poke_icon/narc_0024.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0024.png b/files/poketool/icongra/poke_icon/narc_0024.png Binary files differnew file mode 100644 index 00000000..c0348df5 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0024.png diff --git a/files/poketool/icongra/poke_icon/narc_0025.NCGR b/files/poketool/icongra/poke_icon/narc_0025.NCGR Binary files differdeleted file mode 100644 index e3945760..00000000 --- a/files/poketool/icongra/poke_icon/narc_0025.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0025.png b/files/poketool/icongra/poke_icon/narc_0025.png Binary files differnew file mode 100644 index 00000000..fc77716e --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0025.png diff --git a/files/poketool/icongra/poke_icon/narc_0026.NCGR b/files/poketool/icongra/poke_icon/narc_0026.NCGR Binary files differdeleted file mode 100644 index f40adfe7..00000000 --- a/files/poketool/icongra/poke_icon/narc_0026.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0026.png b/files/poketool/icongra/poke_icon/narc_0026.png Binary files differnew file mode 100644 index 00000000..ae7b2225 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0026.png diff --git a/files/poketool/icongra/poke_icon/narc_0027.NCGR b/files/poketool/icongra/poke_icon/narc_0027.NCGR Binary files differdeleted file mode 100644 index 690c7ab2..00000000 --- a/files/poketool/icongra/poke_icon/narc_0027.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0027.png b/files/poketool/icongra/poke_icon/narc_0027.png Binary files differnew file mode 100644 index 00000000..b9959d1c --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0027.png diff --git a/files/poketool/icongra/poke_icon/narc_0028.NCGR b/files/poketool/icongra/poke_icon/narc_0028.NCGR Binary files differdeleted file mode 100644 index 4adf4b97..00000000 --- a/files/poketool/icongra/poke_icon/narc_0028.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0028.png b/files/poketool/icongra/poke_icon/narc_0028.png Binary files differnew file mode 100644 index 00000000..b7f3a1eb --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0028.png diff --git a/files/poketool/icongra/poke_icon/narc_0029.NCGR b/files/poketool/icongra/poke_icon/narc_0029.NCGR Binary files differdeleted file mode 100644 index 7db15dcf..00000000 --- a/files/poketool/icongra/poke_icon/narc_0029.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0029.png b/files/poketool/icongra/poke_icon/narc_0029.png Binary files differnew file mode 100644 index 00000000..a52ea031 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0029.png diff --git a/files/poketool/icongra/poke_icon/narc_0030.NCGR b/files/poketool/icongra/poke_icon/narc_0030.NCGR Binary files differdeleted file mode 100644 index 9eba4fa4..00000000 --- a/files/poketool/icongra/poke_icon/narc_0030.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0030.png b/files/poketool/icongra/poke_icon/narc_0030.png Binary files differnew file mode 100644 index 00000000..3c81efd6 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0030.png diff --git a/files/poketool/icongra/poke_icon/narc_0031.NCGR b/files/poketool/icongra/poke_icon/narc_0031.NCGR Binary files differdeleted file mode 100644 index ed436770..00000000 --- a/files/poketool/icongra/poke_icon/narc_0031.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0031.png b/files/poketool/icongra/poke_icon/narc_0031.png Binary files differnew file mode 100644 index 00000000..8967d44a --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0031.png diff --git a/files/poketool/icongra/poke_icon/narc_0032.NCGR b/files/poketool/icongra/poke_icon/narc_0032.NCGR Binary files differdeleted file mode 100644 index 3424a464..00000000 --- a/files/poketool/icongra/poke_icon/narc_0032.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0032.png b/files/poketool/icongra/poke_icon/narc_0032.png Binary files differnew file mode 100644 index 00000000..feb77f7d --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0032.png diff --git a/files/poketool/icongra/poke_icon/narc_0033.NCGR b/files/poketool/icongra/poke_icon/narc_0033.NCGR Binary files differdeleted file mode 100644 index ca90981b..00000000 --- a/files/poketool/icongra/poke_icon/narc_0033.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0033.png b/files/poketool/icongra/poke_icon/narc_0033.png Binary files differnew file mode 100644 index 00000000..67543933 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0033.png diff --git a/files/poketool/icongra/poke_icon/narc_0034.NCGR b/files/poketool/icongra/poke_icon/narc_0034.NCGR Binary files differdeleted file mode 100644 index 9fa16d27..00000000 --- a/files/poketool/icongra/poke_icon/narc_0034.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0034.png b/files/poketool/icongra/poke_icon/narc_0034.png Binary files differnew file mode 100644 index 00000000..5919f109 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0034.png diff --git a/files/poketool/icongra/poke_icon/narc_0035.NCGR b/files/poketool/icongra/poke_icon/narc_0035.NCGR Binary files differdeleted file mode 100644 index 0fbd78f8..00000000 --- a/files/poketool/icongra/poke_icon/narc_0035.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0035.png b/files/poketool/icongra/poke_icon/narc_0035.png Binary files differnew file mode 100644 index 00000000..08198e6b --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0035.png diff --git a/files/poketool/icongra/poke_icon/narc_0036.NCGR b/files/poketool/icongra/poke_icon/narc_0036.NCGR Binary files differdeleted file mode 100644 index 109becc0..00000000 --- a/files/poketool/icongra/poke_icon/narc_0036.NCGR +++ /dev/null diff --git a/files/poketool/icongra/poke_icon/narc_0036.png b/files/poketool/icongra/poke_icon/narc_0036.png Binary files differnew file mode 100644 index 00000000..a2483ae6 --- /dev/null +++ b/files/poketool/icongra/poke_icon/narc_0036.png diff --git a/filesystem.mk b/filesystem.mk index 4264c367..f06a5429 100644 --- a/filesystem.mk +++ b/filesystem.mk @@ -2589,6 +2589,7 @@ files/poketool/icongra/poke_icon.narc: \ files/poketool/icongra/poke_icon/narc_0000.NCLR \ files/poketool/icongra/poke_icon/narc_0002.NCER \ files/poketool/icongra/poke_icon/narc_0004.NCER \ + files/poketool/icongra/poke_icon/narc_0006.NCER \ files/poketool/icongra/poke_icon/narc_0007.NCGR \ files/poketool/icongra/poke_icon/narc_0008.NCGR \ files/poketool/icongra/poke_icon/narc_0009.NCGR \ @@ -2599,6 +2600,26 @@ files/poketool/icongra/poke_icon.narc: \ files/poketool/icongra/poke_icon/narc_0014.NCGR \ files/poketool/icongra/poke_icon/narc_0015.NCGR \ files/poketool/icongra/poke_icon/narc_0016.NCGR \ + files/poketool/icongra/poke_icon/narc_0017.NCGR \ + files/poketool/icongra/poke_icon/narc_0018.NCGR \ + files/poketool/icongra/poke_icon/narc_0019.NCGR \ + files/poketool/icongra/poke_icon/narc_0020.NCGR \ + files/poketool/icongra/poke_icon/narc_0021.NCGR \ + files/poketool/icongra/poke_icon/narc_0022.NCGR \ + files/poketool/icongra/poke_icon/narc_0023.NCGR \ + files/poketool/icongra/poke_icon/narc_0024.NCGR \ + files/poketool/icongra/poke_icon/narc_0025.NCGR \ + files/poketool/icongra/poke_icon/narc_0026.NCGR \ + files/poketool/icongra/poke_icon/narc_0027.NCGR \ + files/poketool/icongra/poke_icon/narc_0028.NCGR \ + files/poketool/icongra/poke_icon/narc_0029.NCGR \ + files/poketool/icongra/poke_icon/narc_0030.NCGR \ + files/poketool/icongra/poke_icon/narc_0031.NCGR \ + files/poketool/icongra/poke_icon/narc_0032.NCGR \ + files/poketool/icongra/poke_icon/narc_0033.NCGR \ + files/poketool/icongra/poke_icon/narc_0034.NCGR \ + files/poketool/icongra/poke_icon/narc_0035.NCGR \ + files/poketool/icongra/poke_icon/narc_0036.NCGR \ files/poketool/icongra/poke_icon/narc_0402.NCGR files/msgdata/msg.narc: \ diff --git a/graphics_rules.mk b/graphics_rules.mk index 8abbbbaa..d20020cd 100644 --- a/graphics_rules.mk +++ b/graphics_rules.mk @@ -86,6 +86,26 @@ CLOBBER_SIZE_VERSION101_NCGR_FILES := files/graphic/bag_gra/narc_0002.NCGR \ files/poketool/icongra/poke_icon/narc_0014.NCGR \ files/poketool/icongra/poke_icon/narc_0015.NCGR \ files/poketool/icongra/poke_icon/narc_0016.NCGR \ + files/poketool/icongra/poke_icon/narc_0017.NCGR \ + files/poketool/icongra/poke_icon/narc_0018.NCGR \ + files/poketool/icongra/poke_icon/narc_0019.NCGR \ + files/poketool/icongra/poke_icon/narc_0020.NCGR \ + files/poketool/icongra/poke_icon/narc_0021.NCGR \ + files/poketool/icongra/poke_icon/narc_0022.NCGR \ + files/poketool/icongra/poke_icon/narc_0023.NCGR \ + files/poketool/icongra/poke_icon/narc_0024.NCGR \ + files/poketool/icongra/poke_icon/narc_0025.NCGR \ + files/poketool/icongra/poke_icon/narc_0026.NCGR \ + files/poketool/icongra/poke_icon/narc_0027.NCGR \ + files/poketool/icongra/poke_icon/narc_0028.NCGR \ + files/poketool/icongra/poke_icon/narc_0029.NCGR \ + files/poketool/icongra/poke_icon/narc_0030.NCGR \ + files/poketool/icongra/poke_icon/narc_0031.NCGR \ + files/poketool/icongra/poke_icon/narc_0032.NCGR \ + files/poketool/icongra/poke_icon/narc_0033.NCGR \ + files/poketool/icongra/poke_icon/narc_0034.NCGR \ + files/poketool/icongra/poke_icon/narc_0035.NCGR \ + files/poketool/icongra/poke_icon/narc_0036.NCGR \ files/poketool/icongra/poke_icon/narc_0402.NCGR 4BPP_NCLR_FILES := files/application/wifi_earth/wifi_earth/narc_0006.NCLR \ @@ -498,6 +518,26 @@ NCGR_CLEAN_LIST := files/application/wifi_earth/wifi_earth/narc_0005.NCGR \ files/poketool/icongra/poke_icon/narc_0014.NCGR \ files/poketool/icongra/poke_icon/narc_0015.NCGR \ files/poketool/icongra/poke_icon/narc_0016.NCGR \ + files/poketool/icongra/poke_icon/narc_0017.NCGR \ + files/poketool/icongra/poke_icon/narc_0018.NCGR \ + files/poketool/icongra/poke_icon/narc_0019.NCGR \ + files/poketool/icongra/poke_icon/narc_0020.NCGR \ + files/poketool/icongra/poke_icon/narc_0021.NCGR \ + files/poketool/icongra/poke_icon/narc_0022.NCGR \ + files/poketool/icongra/poke_icon/narc_0023.NCGR \ + files/poketool/icongra/poke_icon/narc_0024.NCGR \ + files/poketool/icongra/poke_icon/narc_0025.NCGR \ + files/poketool/icongra/poke_icon/narc_0026.NCGR \ + files/poketool/icongra/poke_icon/narc_0027.NCGR \ + files/poketool/icongra/poke_icon/narc_0028.NCGR \ + files/poketool/icongra/poke_icon/narc_0029.NCGR \ + files/poketool/icongra/poke_icon/narc_0030.NCGR \ + files/poketool/icongra/poke_icon/narc_0031.NCGR \ + files/poketool/icongra/poke_icon/narc_0032.NCGR \ + files/poketool/icongra/poke_icon/narc_0033.NCGR \ + files/poketool/icongra/poke_icon/narc_0034.NCGR \ + files/poketool/icongra/poke_icon/narc_0035.NCGR \ + files/poketool/icongra/poke_icon/narc_0036.NCGR \ files/poketool/icongra/poke_icon/narc_0402.NCGR \ files/poketool/pokegra/pokegra/narc_0006.NCGR \ files/poketool/pokegra/pokegra/narc_0007.NCGR \ @@ -881,7 +921,8 @@ NCLR_CLEAN_LIST := files/application/wifi_earth/wifi_earth/narc_0006.NCLR \ files/poketool/trgra/trfgra/narc_0194.NCLR \ NCER_CLEAN_LIST := files/poketool/icongra/poke_icon/narc_0002.NCER \ - files/poketool/icongra/poke_icon/narc_0004.NCER + files/poketool/icongra/poke_icon/narc_0004.NCER \ + files/poketool/icongra/poke_icon/narc_0006.NCER NSCR_CLEAN_LIST := files/demo/title/titledemo/narc_0000.NSCR \ files/demo/title/titledemo/narc_0008.NSCR \ diff --git a/include/scrcmd.h b/include/scrcmd.h index c246279d..226bbb8c 100644 --- a/include/scrcmd.h +++ b/include/scrcmd.h @@ -105,6 +105,7 @@ BOOL ScrCmd_Unk0047(struct ScriptContext *ctx); BOOL ScrCmd_Unk0048(struct ScriptContext *ctx); BOOL ScrCmd_Unk02CF(struct ScriptContext *ctx); BOOL ScrCmd_Unk02D0(struct ScriptContext *ctx); +BOOL ScrCmd_Unk005E(struct ScriptContext *ctx); //scrcmd_4.c BOOL ScrCmd_GetPlayerName(struct ScriptContext* ctx); @@ -301,6 +302,19 @@ BOOL ScrCmd_Unk0090(struct ScriptContext* ctx); BOOL ScrCmd_Unk0091(struct ScriptContext* ctx); BOOL ScrCmd_Unk0092(struct ScriptContext* ctx); +//scrcmd_24.c +BOOL ScrCmd_Unk01C6(struct ScriptContext* ctx); +BOOL ScrCmd_Unk01C7(struct ScriptContext* ctx); +BOOL ScrCmd_Unk021E(struct ScriptContext* ctx); +BOOL ScrCmd_Unk021F(struct ScriptContext* ctx); +void FUN_02045E74(struct ScriptContext* ctx, u8 a1, struct Pokemon* pokemon, void* a3); +BOOL ScrCmd_Unk0220(struct ScriptContext* ctx); +BOOL ScrCmd_Unk0221(struct ScriptContext* ctx); +BOOL ScrCmd_Unk0224(struct ScriptContext* ctx); +BOOL ScrCmd_Unk0222(struct ScriptContext* ctx); +BOOL ScrCmd_Unk0223(struct ScriptContext* ctx); +BOOL ScrCmd_Unk0225(struct ScriptContext* ctx); + //scrcmd_25.c BOOL ScrCmd_Unk023F(struct ScriptContext* ctx); BOOL ScrCmd_Unk0240(struct ScriptContext* ctx); diff --git a/include/unk_020377F0.h b/include/unk_020377F0.h new file mode 100644 index 00000000..91276889 --- /dev/null +++ b/include/unk_020377F0.h @@ -0,0 +1,30 @@ +#ifndef POKEDIAMOND_UNK_020377F0_H +#define POKEDIAMOND_UNK_020377F0_H + +struct Options; +struct PlayerParty; + +// This struct gets created from a bunch of places, not just 0x02037CF0. This was +// just the first place I (tgsm) found it being created. +struct UnkStruct_02037CF0 +{ + struct PlayerParty* party; + struct Options* options; + u16* name_buf; + u32 trainer_id; + u8 gender; + u8 unk11; + u8 unk12; + u8 party_count; + u8 unk14; + u8 unk15; + u8 unk16; + u8 padding; + u16 unk18; + u8 padding2[0x2]; + BOOL has_national_dex; + u8 padding3[0xC]; + BOOL unk2C; +}; + +#endif diff --git a/include/unk_02088DD8.h b/include/unk_02088DD8.h new file mode 100644 index 00000000..318a98fb --- /dev/null +++ b/include/unk_02088DD8.h @@ -0,0 +1,19 @@ +#ifndef POKEDIAMOND_UNK_02088DD8_H +#define POKEDIAMOND_UNK_02088DD8_H + +struct Options; +struct PlayerData; +struct Pokemon; + +struct UnkStruct_02088DD8 +{ + struct Pokemon* pokemon; + struct PlayerData* player; + struct Options* options; + void* unkC; + u8 padding[0x5]; + u8 unk15; + u8 padding2[0x2]; +}; + +#endif diff --git a/tools/nitrogfx/gfx.c b/tools/nitrogfx/gfx.c index 305fbeb2..f5ff30e7 100644 --- a/tools/nitrogfx/gfx.c +++ b/tools/nitrogfx/gfx.c @@ -774,8 +774,9 @@ void WriteNtrCell(char *path, struct JsonToCellOptions *options) KBECHeader[4] = (size + 0x20) & 0xFF; //size KBECHeader[5] = (size + 0x20) >> 8; //unlikely to be more than 16 bits, but there are 32 allocated, change if necessary - fwrite(KBECHeader, 1, 0x20, fp); + KBECHeader[16] = (options->mappingType & 0xFF); //not possible to be more than 8 bits, though 32 are allocated + fwrite(KBECHeader, 1, 0x20, fp); unsigned char *KBECContents = malloc(size); diff --git a/tools/nitrogfx/json.c b/tools/nitrogfx/json.c index aad325be..b825c363 100644 --- a/tools/nitrogfx/json.c +++ b/tools/nitrogfx/json.c @@ -51,16 +51,17 @@ struct JsonToCellOptions *ParseNCERJson(char *path) cJSON *imageHeight = cJSON_GetObjectItemCaseSensitive(json, "imageHeight"); cJSON *imageWidth = cJSON_GetObjectItemCaseSensitive(json, "imageWidth"); cJSON *cellCount = cJSON_GetObjectItemCaseSensitive(json, "cellCount"); + cJSON *mappingType = cJSON_GetObjectItemCaseSensitive(json, "mappingType"); options->labelEnabled = GetBool(labelBool); options->extended = GetBool(extended); options->imageHeight = GetInt(imageHeight); options->imageWidth = GetInt(imageWidth); options->cellCount = GetInt(cellCount); + options->mappingType = GetInt(mappingType); options->cells = malloc(sizeof(struct Cell *) * options->cellCount); - if (options->labelEnabled) { cJSON *labelCount = cJSON_GetObjectItemCaseSensitive(json, "labelCount"); diff --git a/tools/nitrogfx/options.h b/tools/nitrogfx/options.h index 780c83e6..66e9895d 100644 --- a/tools/nitrogfx/options.h +++ b/tools/nitrogfx/options.h @@ -74,6 +74,7 @@ struct Cell { struct JsonToCellOptions { bool labelEnabled; bool extended; + int mappingType; int imageHeight; int imageWidth; int cellCount; |