mirror of
https://github.com/pret/pokeplatinum.git
synced 2026-09-30 21:40:45 -05:00
Document berry_data.c
This commit is contained in:
80
include/berry_data.h
Normal file
80
include/berry_data.h
Normal file
@@ -0,0 +1,80 @@
|
||||
#ifndef POKEPLATINUM_BERRY_DATA_H
|
||||
#define POKEPLATINUM_BERRY_DATA_H
|
||||
|
||||
#include "struct_decls/struct_02006C24_decl.h"
|
||||
#include "struct_decls/struct_02023790_decl.h"
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
|
||||
/*
|
||||
* Constructs a new NARC which contains an open FSFile to the berry data archive.
|
||||
*
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the newly-allocated NARC
|
||||
*/
|
||||
NARC * BerryData_NARC_ctor(u32 heapID);
|
||||
|
||||
BerryData * sub_020973A8(NARC * param0, u32 param1, u32 param2);
|
||||
|
||||
/*
|
||||
* Closes the wrapped FSFile and returns the NARC allocation to the heap from whence it came.
|
||||
*
|
||||
* @param narc: Pointer to the NARC
|
||||
*/
|
||||
void BerryData_NARC_dtor(NARC * narc);
|
||||
|
||||
/*
|
||||
* Creates a new buffer large enough to hold the data of the specified
|
||||
* NARC member in 'nuts_data.narc', then reads the data.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the data that was read.
|
||||
*/
|
||||
BerryData * BerryData_LoadDataByNarcMemberIndex(u32 index, u32 heapID);
|
||||
|
||||
/*
|
||||
* Creates a new buffer large enough to hold the data of the
|
||||
* specified berry, then reads the data from nuts_data.narc
|
||||
*
|
||||
* @param itemID: Item ID of the berry for which to read the data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the data that was read.
|
||||
*/
|
||||
BerryData * BerryData_LoadDataByItemID(u32 itemID, u32 heapID);
|
||||
|
||||
/*
|
||||
* Retrieves the value of the specified attribute from a BerryData buffer
|
||||
*
|
||||
* @param berryData: Pointer to the buffer holding the berry data
|
||||
* @param attributeID: ID of the attribute to retrieve the value for
|
||||
*
|
||||
* @returns: The value of the specified attribute
|
||||
*/
|
||||
u32 BerryData_GetAttribute(BerryData * berryData, u32 attributeID);
|
||||
|
||||
/*
|
||||
* Creates a new string buffer large enough to hold the
|
||||
* name of the specified berry, then reads the string.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the string that was read.
|
||||
*/
|
||||
Strbuf* BerryData_AllocAndGetName(u16 index, u32 heapID);
|
||||
|
||||
/*
|
||||
* Creates a new string buffer large enough to hold the
|
||||
* description of the specified berry, then reads the string.
|
||||
*
|
||||
* @param index: Index of the NARC member within 'nuts_data.narc' which contains the berry's data
|
||||
* @param heapID: ID of the heap to alloc from
|
||||
*
|
||||
* @returns: Pointer to the allocated buffer which contains the string that was read.
|
||||
*/
|
||||
Strbuf* BerryData_AllocAndGetDescription(u16 index, u16 heapID);
|
||||
|
||||
#endif // POKEPLATINUM_BERRY_DATA_H
|
||||
@@ -1,6 +0,0 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_020973A8_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_020973A8_DECL_H
|
||||
|
||||
typedef struct UnkStruct_020973A8_t UnkStruct_020973A8;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_020973A8_DECL_H
|
||||
6
include/struct_decls/struct_berry_data_decl.h
Normal file
6
include/struct_decls/struct_berry_data_decl.h
Normal file
@@ -0,0 +1,6 @@
|
||||
#ifndef POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
#define POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
|
||||
typedef struct BerryData BerryData;
|
||||
|
||||
#endif // POKEPLATINUM_STRUCT_BERRY_DATA_DECL_H
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef POKEPLATINUM_UNK_0209739C_H
|
||||
#define POKEPLATINUM_UNK_0209739C_H
|
||||
|
||||
#include "struct_decls/struct_02006C24_decl.h"
|
||||
#include "struct_decls/struct_02023790_decl.h"
|
||||
#include "struct_decls/struct_020973A8_decl.h"
|
||||
|
||||
NARC * sub_0209739C(u32 param0);
|
||||
UnkStruct_020973A8 * sub_020973A8(NARC * param0, u32 param1, u32 param2);
|
||||
void sub_020973B0(NARC * param0);
|
||||
UnkStruct_020973A8 * sub_020973B8(u32 param0, u32 param1);
|
||||
UnkStruct_020973A8 * sub_020973C8(u32 param0, u32 param1);
|
||||
u32 sub_020973D4(UnkStruct_020973A8 * param0, u32 param1);
|
||||
Strbuf* sub_0209742C(u16 param0, u32 param1);
|
||||
Strbuf* sub_02097454(u16 param0, u16 param1);
|
||||
|
||||
#endif // POKEPLATINUM_UNK_0209739C_H
|
||||
@@ -334,7 +334,7 @@ Static main
|
||||
Object main.nef.p/src_unk_020961E8.c.o
|
||||
Object main.nef.p/src_unk_02096420.c.o
|
||||
Object main.nef.p/src_unk_020972FC.c.o
|
||||
Object main.nef.p/src_unk_0209739C.c.o
|
||||
Object main.nef.p/src_berry_data.c.o
|
||||
Object main.nef.p/src_unk_0209747C.c.o
|
||||
Object main.nef.p/src_unk_02097624.c.o
|
||||
Object main.nef.p/src_unk_02097B18.c.o
|
||||
|
||||
103
src/berry_data.c
Normal file
103
src/berry_data.c
Normal file
@@ -0,0 +1,103 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02006C24_decl.h"
|
||||
#include "struct_decls/struct_0200B144_decl.h"
|
||||
#include "struct_decls/struct_02023790_decl.h"
|
||||
|
||||
#include "narc.h"
|
||||
#include "unk_0200AC5C.h"
|
||||
#include "berry_data.h"
|
||||
|
||||
typedef struct BerryData {
|
||||
u16 size;
|
||||
u8 firmness;
|
||||
u8 yieldCategory;
|
||||
u8 stageDuration;
|
||||
u8 moistureDrainRate;
|
||||
u8 spiciness;
|
||||
u8 dryness;
|
||||
u8 sweetness;
|
||||
u8 bitterness;
|
||||
u8 sourness;
|
||||
u8 smoothness;
|
||||
} BerryData;
|
||||
|
||||
NARC * BerryData_NARC_ctor (u32 heapID)
|
||||
{
|
||||
return NARC_ctor(68, heapID);
|
||||
}
|
||||
|
||||
BerryData * sub_020973A8 (NARC * param0, u32 param1, u32 param2)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMember(param0, 0 + param1, param2);
|
||||
}
|
||||
|
||||
void BerryData_NARC_dtor (NARC * narc)
|
||||
{
|
||||
NARC_dtor(narc);
|
||||
}
|
||||
|
||||
BerryData * BerryData_LoadDataByNarcMemberIndex (u32 index, u32 heapID)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMemberByIndexPair(68, 0 + index, heapID);
|
||||
}
|
||||
|
||||
BerryData * BerryData_LoadDataByItemID (u32 itemID, u32 heapID)
|
||||
{
|
||||
return BerryData_LoadDataByNarcMemberIndex(itemID - 149, heapID);
|
||||
}
|
||||
|
||||
u32 BerryData_GetAttribute (BerryData * berryData, u32 attributeID)
|
||||
{
|
||||
switch (attributeID) {
|
||||
case 0:
|
||||
return berryData->size;
|
||||
case 1:
|
||||
return berryData->firmness;
|
||||
case 2:
|
||||
return berryData->yieldCategory;
|
||||
case 3:
|
||||
return berryData->stageDuration;
|
||||
case 4:
|
||||
return berryData->moistureDrainRate;
|
||||
case 5:
|
||||
return berryData->spiciness;
|
||||
case 6:
|
||||
return berryData->dryness;
|
||||
case 7:
|
||||
return berryData->sweetness;
|
||||
case 8:
|
||||
return berryData->bitterness;
|
||||
case 9:
|
||||
return berryData->sourness;
|
||||
case 10:
|
||||
return berryData->smoothness;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Strbuf* BerryData_AllocAndGetName (u16 index, u32 heapID)
|
||||
{
|
||||
UnkStruct_0200B144 * v0;
|
||||
Strbuf* v1;
|
||||
|
||||
v0 = sub_0200B144(1, 26, 424, heapID);
|
||||
v1 = sub_0200B1EC(v0, index);
|
||||
|
||||
sub_0200B190(v0);
|
||||
return v1;
|
||||
}
|
||||
|
||||
Strbuf* BerryData_AllocAndGetDescription (u16 index, u16 heapID)
|
||||
{
|
||||
UnkStruct_0200B144 * v0;
|
||||
Strbuf* v1;
|
||||
|
||||
v0 = sub_0200B144(1, 26, 423, heapID);
|
||||
v1 = sub_0200B1EC(v0, index);
|
||||
|
||||
sub_0200B190(v0);
|
||||
return v1;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ pokeplatinum_c = files(
|
||||
'unk_020961E8.c',
|
||||
'unk_02096420.c',
|
||||
'unk_020972FC.c',
|
||||
'unk_0209739C.c',
|
||||
'berry_data.c',
|
||||
'unk_0209747C.c',
|
||||
'unk_02097624.c',
|
||||
'unk_02097B18.c',
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
#include "data_021BF67C.h"
|
||||
|
||||
#include "struct_decls/struct_020973A8_decl.h"
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
|
||||
#include "struct_defs/struct_0202A93C.h"
|
||||
#include "overlay083/struct_ov83_0223DB4C_sub1.h"
|
||||
@@ -23,7 +23,7 @@
|
||||
#include "unk_0201D15C.h"
|
||||
#include "unk_0201E3BC.h"
|
||||
#include "poffin.h"
|
||||
#include "unk_0209739C.h"
|
||||
#include "berry_data.h"
|
||||
#include "overlay083/ov83_0223F7F4.h"
|
||||
|
||||
s32 ov83_0223F7F4 (int param0, int param1, int param2, int param3, int param4, int param5)
|
||||
@@ -669,7 +669,7 @@ static int ov83_0223FFA8 (u32 param0, u32 param1)
|
||||
|
||||
void ov83_0223FFD4 (UnkStruct_ov83_0223FDB0 * param0, Poffin * param1, const UnkStruct_ov83_0223FE50 * param2, u32 param3, u32 param4)
|
||||
{
|
||||
UnkStruct_020973A8 * v0;
|
||||
BerryData * v0;
|
||||
int v1, v2;
|
||||
const UnkStruct_ov83_0223DB4C_sub1 * v3 = param2->unk_34.unk_00;
|
||||
s32 v4[5] = {0, 0, 0, 0, 0};
|
||||
@@ -691,7 +691,7 @@ void ov83_0223FFD4 (UnkStruct_ov83_0223FDB0 * param0, Poffin * param1, const Unk
|
||||
|
||||
for (v1 = 0; v1 < param3; v1++) {
|
||||
v17 = param2->unk_130[v1];
|
||||
v0 = sub_020973C8(v3[v17].unk_00, param4);
|
||||
v0 = BerryData_LoadDataByItemID(v3[v17].unk_00, param4);
|
||||
|
||||
v8 = 0;
|
||||
|
||||
@@ -708,10 +708,10 @@ void ov83_0223FFD4 (UnkStruct_ov83_0223FDB0 * param0, Poffin * param1, const Unk
|
||||
}
|
||||
|
||||
for (v2 = 0; v2 < 5; v2++) {
|
||||
v4[v2] += sub_020973D4(v0, 5 + v2);
|
||||
v4[v2] += BerryData_GetAttribute(v0, 5 + v2);
|
||||
}
|
||||
|
||||
v5 += sub_020973D4(v0, 10);
|
||||
v5 += BerryData_GetAttribute(v0, 10);
|
||||
|
||||
Heap_FreeToHeap(v0);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "struct_decls/struct_02018340_decl.h"
|
||||
#include "struct_decls/struct_020203AC_decl.h"
|
||||
#include "struct_decls/struct_02023790_decl.h"
|
||||
#include "struct_decls/struct_020973A8_decl.h"
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
|
||||
#include "struct_defs/struct_0205AA50.h"
|
||||
#include "struct_defs/struct_020972FC.h"
|
||||
@@ -41,7 +41,7 @@
|
||||
#include "unk_020393C8.h"
|
||||
#include "unk_0208C098.h"
|
||||
#include "unk_020972FC.h"
|
||||
#include "unk_0209739C.h"
|
||||
#include "berry_data.h"
|
||||
#include "overlay085/ov85_02241440.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -63,7 +63,7 @@ typedef struct {
|
||||
UnkStruct_ov85_022420A8 unk_194[4];
|
||||
u32 unk_1F4;
|
||||
UnkStruct_020972FC * unk_1F8;
|
||||
UnkStruct_020973A8 * unk_1FC;
|
||||
BerryData * unk_1FC;
|
||||
u8 unk_200;
|
||||
u8 unk_201;
|
||||
} UnkStruct_ov85_022417E4;
|
||||
@@ -234,7 +234,7 @@ int ov85_02241440 (UnkStruct_020067E8 * param0, int * param1)
|
||||
memset(v0, 0, sizeof(UnkStruct_ov85_022417E4));
|
||||
v0->unk_1F8 = sub_02006840(param0);
|
||||
v0->unk_00 = sub_02018340(36);
|
||||
v0->unk_1FC = sub_020973B8(v0->unk_1F8->unk_08, 36);
|
||||
v0->unk_1FC = BerryData_LoadDataByNarcMemberIndex(v0->unk_1F8->unk_08, 36);
|
||||
|
||||
sub_0208C120(0, 36);
|
||||
|
||||
@@ -561,7 +561,7 @@ static void ov85_0224198C (UnkStruct_ov85_022417E4 * param0)
|
||||
Strbuf_Free(v1);
|
||||
Strbuf_Free(v2);
|
||||
|
||||
v1 = sub_0209742C(param0->unk_1F8->unk_08, 36);
|
||||
v1 = BerryData_AllocAndGetName(param0->unk_1F8->unk_08, 36);
|
||||
|
||||
sub_0201D78C(v0, 0, v1, 40, 0, 0xff, ((u32)(((15 & 0xff) << 16) | ((2 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL);
|
||||
Strbuf_Free(v1);
|
||||
@@ -577,7 +577,7 @@ static void ov85_02241A58 (UnkStruct_ov85_022417E4 * param0)
|
||||
|
||||
sub_0201ADA4(v0, 0);
|
||||
|
||||
v1 = sub_02097454(param0->unk_1F8->unk_08, 36);
|
||||
v1 = BerryData_AllocAndGetDescription(param0->unk_1F8->unk_08, 36);
|
||||
|
||||
sub_0201D78C(v0, 0, v1, 0, 0, 0xff, ((u32)(((1 & 0xff) << 16) | ((2 & 0xff) << 8) | ((0 & 0xff) << 0))), NULL);
|
||||
Strbuf_Free(v1);
|
||||
@@ -608,7 +608,7 @@ static void ov85_02241AF4 (UnkStruct_ov85_022417E4 * param0)
|
||||
|
||||
sub_0201ADA4(v0, 0);
|
||||
|
||||
v2 = sub_020973D4(param0->unk_1FC, 1);
|
||||
v2 = BerryData_GetAttribute(param0->unk_1FC, 1);
|
||||
|
||||
if (v2 != 0) {
|
||||
v2--;
|
||||
@@ -646,7 +646,7 @@ static void ov85_02241B9C (UnkStruct_ov85_022417E4 * param0)
|
||||
|
||||
sub_0201ADA4(v0, 0);
|
||||
|
||||
v3 = sub_020973D4(param0->unk_1FC, 0);
|
||||
v3 = BerryData_GetAttribute(param0->unk_1FC, 0);
|
||||
v3 = (((v3 * 1000) / 254 + 5) / 10);
|
||||
v1 = sub_0200B1EC(param0->unk_C4, 9);
|
||||
v2 = Strbuf_Init(32, 36);
|
||||
@@ -865,7 +865,7 @@ static void ov85_02241F0C (UnkStruct_ov85_022417E4 * param0)
|
||||
NARC * v0;
|
||||
|
||||
Heap_FreeToHeap(param0->unk_1FC);
|
||||
param0->unk_1FC = sub_020973B8(param0->unk_1F8->unk_08, 36);
|
||||
param0->unk_1FC = BerryData_LoadDataByNarcMemberIndex(param0->unk_1F8->unk_08, 36);
|
||||
ov85_02241CD0(param0);
|
||||
|
||||
v0 = NARC_ctor(53, 36);
|
||||
@@ -1035,25 +1035,25 @@ static void ov85_02242578 (UnkStruct_ov85_022417E4 * param0)
|
||||
{
|
||||
u32 v0;
|
||||
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][0], ¶m0->unk_194[0].unk_00, sub_020973D4(param0->unk_1FC, 5));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][1], ¶m0->unk_194[0].unk_06, sub_020973D4(param0->unk_1FC, 6));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][2], ¶m0->unk_194[0].unk_12, sub_020973D4(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][0], ¶m0->unk_194[0].unk_00, BerryData_GetAttribute(param0->unk_1FC, 5));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][1], ¶m0->unk_194[0].unk_06, BerryData_GetAttribute(param0->unk_1FC, 6));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][2], ¶m0->unk_194[0].unk_12, BerryData_GetAttribute(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[0][3], ¶m0->unk_194[0].unk_0C, 0);
|
||||
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][0], ¶m0->unk_194[1].unk_00, sub_020973D4(param0->unk_1FC, 9));
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][1], ¶m0->unk_194[1].unk_06, sub_020973D4(param0->unk_1FC, 5));
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][0], ¶m0->unk_194[1].unk_00, BerryData_GetAttribute(param0->unk_1FC, 9));
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][1], ¶m0->unk_194[1].unk_06, BerryData_GetAttribute(param0->unk_1FC, 5));
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][2], ¶m0->unk_194[1].unk_12, 0);
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][3], ¶m0->unk_194[1].unk_0C, sub_020973D4(param0->unk_1FC, 8));
|
||||
ov85_022423A0(&Unk_ov85_02242938[1][3], ¶m0->unk_194[1].unk_0C, BerryData_GetAttribute(param0->unk_1FC, 8));
|
||||
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][0], ¶m0->unk_194[2].unk_00, sub_020973D4(param0->unk_1FC, 9));
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][0], ¶m0->unk_194[2].unk_00, BerryData_GetAttribute(param0->unk_1FC, 9));
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][1], ¶m0->unk_194[2].unk_06, 0);
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][2], ¶m0->unk_194[2].unk_12, sub_020973D4(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][3], ¶m0->unk_194[2].unk_0C, sub_020973D4(param0->unk_1FC, 8));
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][2], ¶m0->unk_194[2].unk_12, BerryData_GetAttribute(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[2][3], ¶m0->unk_194[2].unk_0C, BerryData_GetAttribute(param0->unk_1FC, 8));
|
||||
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][0], ¶m0->unk_194[3].unk_00, 0);
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][1], ¶m0->unk_194[3].unk_06, sub_020973D4(param0->unk_1FC, 6));
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][2], ¶m0->unk_194[3].unk_12, sub_020973D4(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][3], ¶m0->unk_194[3].unk_0C, sub_020973D4(param0->unk_1FC, 8));
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][1], ¶m0->unk_194[3].unk_06, BerryData_GetAttribute(param0->unk_1FC, 6));
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][2], ¶m0->unk_194[3].unk_12, BerryData_GetAttribute(param0->unk_1FC, 7));
|
||||
ov85_022423A0(&Unk_ov85_02242938[3][3], ¶m0->unk_194[3].unk_0C, BerryData_GetAttribute(param0->unk_1FC, 8));
|
||||
|
||||
for (v0 = 0; v0 < 4; v0++) {
|
||||
ov85_022423FC(¶m0->unk_D4[v0].unk_00, ¶m0->unk_194[v0].unk_00, ¶m0->unk_134[v0].unk_00);
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02006C24_decl.h"
|
||||
#include "struct_decls/struct_020973A8_decl.h"
|
||||
#include "struct_decls/struct_berry_data_decl.h"
|
||||
|
||||
#include "struct_defs/struct_02027854.h"
|
||||
#include "struct_defs/struct_02027BF4.h"
|
||||
|
||||
#include "heap.h"
|
||||
#include "unk_02027B70.h"
|
||||
#include "unk_0209739C.h"
|
||||
#include "berry_data.h"
|
||||
|
||||
static void sub_02027C50(UnkStruct_02027854 * param0);
|
||||
static int sub_02027C7C(const UnkStruct_02027BF4 * param0, int param1, int param2);
|
||||
@@ -48,23 +48,23 @@ UnkStruct_02027BF4 * sub_02027BF4 (int param0)
|
||||
{
|
||||
int v0;
|
||||
UnkStruct_02027BF4 * v1;
|
||||
UnkStruct_020973A8 * v2;
|
||||
BerryData * v2;
|
||||
NARC * v3;
|
||||
|
||||
v3 = sub_0209739C(param0);
|
||||
v3 = BerryData_NARC_ctor(param0);
|
||||
v1 = Heap_AllocFromHeap(param0, sizeof(UnkStruct_02027BF4) * 64);
|
||||
|
||||
for (v0 = 0; v0 < 64; v0++) {
|
||||
v2 = sub_020973A8(v3, v0, param0);
|
||||
|
||||
v1[v0].unk_00 = sub_020973D4(v2, 3);
|
||||
v1[v0].unk_01 = sub_020973D4(v2, 4);
|
||||
v1[v0].unk_02 = sub_020973D4(v2, 2);
|
||||
v1[v0].unk_00 = BerryData_GetAttribute(v2, 3);
|
||||
v1[v0].unk_01 = BerryData_GetAttribute(v2, 4);
|
||||
v1[v0].unk_02 = BerryData_GetAttribute(v2, 2);
|
||||
|
||||
Heap_FreeToHeap(v2);
|
||||
}
|
||||
|
||||
sub_020973B0(v3);
|
||||
BerryData_NARC_dtor(v3);
|
||||
return v1;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
#include "party.h"
|
||||
#include "item.h"
|
||||
#include "unk_020923C0.h"
|
||||
#include "unk_0209739C.h"
|
||||
#include "berry_data.h"
|
||||
|
||||
#include <nitro/code16.h>
|
||||
|
||||
@@ -390,7 +390,7 @@ BOOL sub_02047BB8 (UnkStruct_0203E724 * param0)
|
||||
u8 v1 = (*((param0)->unk_08++));
|
||||
u16 v2 = inline_02049538(param0);
|
||||
u16 v3 = inline_02049538(param0);
|
||||
Strbuf* v4 = sub_0209742C(v2 - 149, 32);
|
||||
Strbuf* v4 = BerryData_AllocAndGetName(v2 - 149, 32);
|
||||
|
||||
sub_0200B48C(*v0, v1, v4, 0, (v3 < 2 ? 1 : 0), GAME_LANGUAGE);
|
||||
Strbuf_Free(v4);
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
#include <nitro.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "struct_decls/struct_02006C24_decl.h"
|
||||
#include "struct_decls/struct_0200B144_decl.h"
|
||||
#include "struct_decls/struct_02023790_decl.h"
|
||||
|
||||
#include "narc.h"
|
||||
#include "unk_0200AC5C.h"
|
||||
#include "unk_0209739C.h"
|
||||
|
||||
typedef struct UnkStruct_020973A8_t {
|
||||
u16 unk_00;
|
||||
u8 unk_02;
|
||||
u8 unk_03;
|
||||
u8 unk_04;
|
||||
u8 unk_05;
|
||||
u8 unk_06;
|
||||
u8 unk_07;
|
||||
u8 unk_08;
|
||||
u8 unk_09;
|
||||
u8 unk_0A;
|
||||
u8 unk_0B;
|
||||
} UnkStruct_020973A8;
|
||||
|
||||
NARC * sub_0209739C (u32 param0)
|
||||
{
|
||||
return NARC_ctor(68, param0);
|
||||
}
|
||||
|
||||
UnkStruct_020973A8 * sub_020973A8 (NARC * param0, u32 param1, u32 param2)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMember(param0, 0 + param1, param2);
|
||||
}
|
||||
|
||||
void sub_020973B0 (NARC * param0)
|
||||
{
|
||||
NARC_dtor(param0);
|
||||
}
|
||||
|
||||
UnkStruct_020973A8 * sub_020973B8 (u32 param0, u32 param1)
|
||||
{
|
||||
return NARC_AllocAndReadWholeMemberByIndexPair(68, 0 + param0, param1);
|
||||
}
|
||||
|
||||
UnkStruct_020973A8 * sub_020973C8 (u32 param0, u32 param1)
|
||||
{
|
||||
return sub_020973B8(param0 - 149, param1);
|
||||
}
|
||||
|
||||
u32 sub_020973D4 (UnkStruct_020973A8 * param0, u32 param1)
|
||||
{
|
||||
switch (param1) {
|
||||
case 0:
|
||||
return param0->unk_00;
|
||||
case 1:
|
||||
return param0->unk_02;
|
||||
case 2:
|
||||
return param0->unk_03;
|
||||
case 3:
|
||||
return param0->unk_04;
|
||||
case 4:
|
||||
return param0->unk_05;
|
||||
case 5:
|
||||
return param0->unk_06;
|
||||
case 6:
|
||||
return param0->unk_07;
|
||||
case 7:
|
||||
return param0->unk_08;
|
||||
case 8:
|
||||
return param0->unk_09;
|
||||
case 9:
|
||||
return param0->unk_0A;
|
||||
case 10:
|
||||
return param0->unk_0B;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Strbuf* sub_0209742C (u16 param0, u32 param1)
|
||||
{
|
||||
UnkStruct_0200B144 * v0;
|
||||
Strbuf* v1;
|
||||
|
||||
v0 = sub_0200B144(1, 26, 424, param1);
|
||||
v1 = sub_0200B1EC(v0, param0);
|
||||
|
||||
sub_0200B190(v0);
|
||||
return v1;
|
||||
}
|
||||
|
||||
Strbuf* sub_02097454 (u16 param0, u16 param1)
|
||||
{
|
||||
UnkStruct_0200B144 * v0;
|
||||
Strbuf* v1;
|
||||
|
||||
v0 = sub_0200B144(1, 26, 423, param1);
|
||||
v1 = sub_0200B1EC(v0, param0);
|
||||
|
||||
sub_0200B190(v0);
|
||||
return v1;
|
||||
}
|
||||
Reference in New Issue
Block a user