Partial documentation of trainer_tower

This commit is contained in:
PikalaxALT 2019-10-22 15:34:03 -04:00
parent 6742a901af
commit 2a584a0671
8 changed files with 533 additions and 515 deletions

View File

@ -917,10 +917,10 @@ gUnknown_83E0468:: @ 83E0468
.4byte gOtherText_Exit, NULL
gUnknown_83E0480:: @ 83E0480
.4byte gUnknown_8417F82, NULL
.4byte gUnknown_8417F89, NULL
.4byte gUnknown_8417F90, NULL
.4byte gUnknown_8417F99, NULL
.4byte gOtherText_Single, NULL
.4byte gOtherText_Double, NULL
.4byte gOtherText_Knockout, NULL
.4byte gOtherText_Mixed, NULL
.4byte gOtherText_Exit, NULL
gUnknown_83E04A8:: @ 83E04A8

View File

@ -460,13 +460,26 @@ gUnknown_83FE88F:: @ 83FE88F
.incbin "baserom.gba", 0x3FE88F, 0xF3
gUnknown_83FE982:: @ 83FE982
.incbin "baserom.gba", 0x3FE982, 0x16
.string "TIME BOARD$"
.string "CLEAR TIME$"
gUnknown_83FE998:: @ 83FE998
.incbin "baserom.gba", 0x3FE998, 0x2C
.string "{STR_VAR_1}MIN. {STR_VAR_2}.{STR_VAR_3}SEC.$"
.string "1F$"
.string "2F$"
.string "3F$"
.string "4F$"
.string "5F$"
.string "6F$"
.string "7F$"
.string "8F$"
.align 2
gUnknown_83FE9C4:: @ 83FE9C4
.incbin "baserom.gba", 0x3FE9C4, 0x10
.4byte gOtherText_Single
.4byte gOtherText_Double
.4byte gOtherText_Knockout
.4byte gOtherText_Mixed
gUnknown_83FE9D4:: @ 83FE9D4
.incbin "baserom.gba", 0x3FE9D4, 0x10

View File

@ -1793,16 +1793,16 @@ gUnknown_8417F69:: @ 0x8417F69
gUnknown_8417F77:: @ 0x8417F77
.string "JOIN GROUP$"
gUnknown_8417F82:: @ 0x8417F82
gOtherText_Single:: @ 0x8417F82
.string "SINGLE$"
gUnknown_8417F89:: @ 0x8417F89
gOtherText_Double:: @ 0x8417F89
.string "DOUBLE$"
gUnknown_8417F90:: @ 0x8417F90
gOtherText_Knockout:: @ 0x8417F90
.string "KNOCKOUT$"
gUnknown_8417F99:: @ 0x8417F99
gOtherText_Mixed:: @ 0x8417F99
.string "MIXED$"
gUnknown_8417F9F:: @ 0x8417F9F

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

View File

@ -3,25 +3,25 @@
#include "global.h"
struct TrainerTowerTrainer_004
{
/* 0x000 */ u8 unk_000[11];
/* 0x00B */ u8 unk_00B;
/* 0x00C */ u8 unk_00C;
/* 0x00E */ u16 unk_00E[6];
/* 0x01A */ u16 unk_01A[6];
/* 0x026 */ u16 unk_026[6];
/* 0x032 */ u16 unk_032[6];
/* 0x040 */ struct BattleTowerPokemon unk_040[PARTY_SIZE];
}; // size: 328
struct TrainerTowerTrainer
{
/* 0x000 */ u8 name[11];
/* 0x00B */ u8 facilityClass;
/* 0x00C */ u8 gender;
/* 0x00E */ u16 speechBefore[6];
/* 0x01A */ u16 speechWin[6];
/* 0x026 */ u16 speechLose[6];
/* 0x032 */ u16 speechAfter[6];
/* 0x040 */ struct BattleTowerPokemon mons[PARTY_SIZE];
}; // size: 328
struct TrainerTowerFloor
{
/* 0x000 */ u8 unk_000;
/* 0x000 */ u8 unk_001;
/* 0x002 */ u8 unk_002;
/* 0x003 */ u8 unk_003;
/* 0x004 */ struct TrainerTowerTrainer_004 unk_004[3];
/* 0x001 */ u8 floorIdx;
/* 0x002 */ u8 challengeType;
/* 0x003 */ u8 prize;
/* 0x004 */ struct TrainerTowerTrainer trainers[3];
/* 0x3DC */ u32 checksum;
};
@ -32,16 +32,16 @@ struct Unk_203F458_Header
u32 unk4;
};
struct TrainerTowerData
struct EReaderTrainerHillSet
{
u8 count;
u8 id;
u16 dummy;
u32 checksum;
struct TrainerTowerTrainer trainers[8];
struct TrainerTowerFloor floors[8];
};
bool32 ValidateTrainerTowerData(struct TrainerTowerData * a0);
bool32 CEReaderTool_SaveTrainerTower(struct TrainerTowerData * a0);
bool32 ValidateTrainerTowerData(struct EReaderTrainerHillSet * a0);
bool32 CEReaderTool_SaveTrainerTower(struct EReaderTrainerHillSet * a0);
#endif //GUARD_CEREADER_TOOL_H

View File

@ -9,18 +9,18 @@ u8 sub_815D654(void)
return (gSaveBlock1Ptr->unkArray[0].unk9 + 1) % 256;
}
static bool32 ValidateTrainerTowerTrainer(struct TrainerTowerTrainer * trainer)
static bool32 ValidateTrainerTowerTrainer(struct TrainerTowerFloor * floor)
{
if (trainer->unk_001 < 1 || trainer->unk_001 > 8)
if (floor->floorIdx < 1 || floor->floorIdx > 8)
return FALSE;
if (trainer->unk_002 > 2)
if (floor->challengeType > 2)
return FALSE;
if (CalcByteArraySum((const u8 *)trainer, offsetof(typeof(*trainer), checksum)) != trainer->checksum)
if (CalcByteArraySum((const u8 *)floor, offsetof(typeof(*floor), checksum)) != floor->checksum)
return FALSE;
return TRUE;
}
bool32 ValidateTrainerTowerData(struct TrainerTowerData * ttdata)
bool32 ValidateTrainerTowerData(struct EReaderTrainerHillSet * ttdata)
{
u32 count = ttdata->count;
s32 i;
@ -28,18 +28,18 @@ bool32 ValidateTrainerTowerData(struct TrainerTowerData * ttdata)
return FALSE;
for (i = 0; i < count; i++)
{
if (!ValidateTrainerTowerTrainer(&ttdata->trainers[i]))
if (!ValidateTrainerTowerTrainer(&ttdata->floors[i]))
return FALSE;
}
if (CalcByteArraySum((const u8 *)ttdata->trainers, count * sizeof(ttdata->trainers[0])) != ttdata->checksum)
if (CalcByteArraySum((const u8 *)ttdata->floors, count * sizeof(ttdata->floors[0])) != ttdata->checksum)
return FALSE;
return TRUE;
}
#define SEC30_SIZE (offsetof(struct TrainerTowerData, trainers[4]))
#define SEC31_SIZE (sizeof(struct TrainerTowerData) - SEC30_SIZE)
#define SEC30_SIZE (offsetof(struct EReaderTrainerHillSet, floors[4]))
#define SEC31_SIZE (sizeof(struct EReaderTrainerHillSet) - SEC30_SIZE)
static bool32 CEReaderTool_SaveTrainerTower_r(struct TrainerTowerData * ttdata, u8 * buffer)
static bool32 CEReaderTool_SaveTrainerTower_r(struct EReaderTrainerHillSet * ttdata, u8 * buffer)
{
AGB_ASSERT_EX(ttdata->dummy == 0, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/cereader_tool.c", 198);
AGB_ASSERT_EX(ttdata->id == 0, "C:/WORK/POKeFRLG/src/pm_lgfr_ose/source/cereader_tool.c", 199)
@ -56,7 +56,7 @@ static bool32 CEReaderTool_SaveTrainerTower_r(struct TrainerTowerData * ttdata,
return TRUE;
}
bool32 CEReaderTool_SaveTrainerTower(struct TrainerTowerData * ttdata)
bool32 CEReaderTool_SaveTrainerTower(struct EReaderTrainerHillSet * ttdata)
{
u8 * buffer = AllocZeroed(0x1000);
bool32 result = CEReaderTool_SaveTrainerTower_r(ttdata, buffer);
@ -64,7 +64,7 @@ bool32 CEReaderTool_SaveTrainerTower(struct TrainerTowerData * ttdata)
return result;
}
static bool32 CEReaderTool_LoadTrainerTower_r(struct TrainerTowerData * ttdata, void * buffer)
static bool32 CEReaderTool_LoadTrainerTower_r(struct EReaderTrainerHillSet * ttdata, void * buffer)
{
if (TryCopySpecialSaveSection(30, buffer) != 1)
return FALSE;
@ -79,7 +79,7 @@ static bool32 CEReaderTool_LoadTrainerTower_r(struct TrainerTowerData * ttdata,
return TRUE;
}
bool32 CEReaderTool_LoadTrainerTower(struct TrainerTowerData * ttdata)
bool32 CEReaderTool_LoadTrainerTower(struct EReaderTrainerHillSet * ttdata)
{
void * buffer = AllocZeroed(0x1000);
bool32 success = CEReaderTool_LoadTrainerTower_r(ttdata, buffer);

View File

@ -423,7 +423,7 @@ void sub_8143910(u8 taskId)
}
break;
case 15:
data->t0E = ValidateTrainerTowerData((struct TrainerTowerData *)gDecompressionBuffer);
data->t0E = ValidateTrainerTowerData((struct EReaderTrainerHillSet *)gDecompressionBuffer);
sub_800AA80(data->t0E);
data->state = 16;
break;
@ -437,7 +437,7 @@ void sub_8143910(u8 taskId)
}
break;
case 17:
if (CEReaderTool_SaveTrainerTower((struct TrainerTowerData *)gDecompressionBuffer))
if (CEReaderTool_SaveTrainerTower((struct EReaderTrainerHillSet *)gDecompressionBuffer))
{
AddTextPrinterToWindow1(gUnknown_841DE99);
ResetDelayTimer(&data->t00);

File diff suppressed because it is too large Load Diff