summaryrefslogtreecommitdiff
path: root/include/m_random_field.h
diff options
context:
space:
mode:
authorkuchenmitsahne <25233413+kuchenmitsahne@users.noreply.github.com>2025-06-04 19:38:23 -0400
committerGitHub <noreply@github.com>2025-06-04 16:38:23 -0700
commita4d5910cdb9bed05fa5aea4476a3cf4ef178be06 (patch)
tree017ad9a1547e3206190c216d8a7ddd2e95ff327c /include/m_random_field.h
parent8c6ae625aef6d07741cd8925f422f43ae24b198c (diff)
m_random_field OK (#241)
* 25 functions OK * 10 functions OK * Add block type and block kind enums/defines * Formatting/style pass * Move `FieldMakeBlockType` to `m_field_make` * Remove unused/duplicate defines * Split data out for `m_quest` and `m_random_field`; rename data symbols * Generate `m_random_field.c` and rename function symbols. * mRF_BlockTypeDirect2GateType, mRF_BlockTypeDirect2GateData OK * mRF_Type2BlockInfo, mRF_Info2BlockType, mRF_GateType2GateCount, mRF_SearchPond, mRF_Attr2BeastRoadAttr, mRF_CheckBeastRoad OK * mFI_GetUnitCol OK; mRF_PrintDebug and mRF_BlockInf2CheckBeastRoad OK (pending data import). * Fix `m_random_field` code split; all newly included functions OK * Fix mRF_Malloc return type; formatting pass * Name m_random_field_ovl * Rename data symbols (m_random_field_ovl). * Rename symbols (all functions named) * Import data * Declare overlay segment; rename symbols * mRF_MakeRandomField OK (all functions matching). * Extract asset `data_combi_table` * Clean up mRF_MakeRandomField; document m_field_make.h * Rename mCoBG_unkStruct->unk6 as unitAttribute * Misc cleanup and formatting. * Rename additional data symbols (m_random_field_ovl). * Formatting pass * Improve documentation of BackgroundAttribute enum. * Formatting pass; add omitted attribute.
Diffstat (limited to 'include/m_random_field.h')
-rw-r--r--include/m_random_field.h44
1 files changed, 29 insertions, 15 deletions
diff --git a/include/m_random_field.h b/include/m_random_field.h
index 256edbb..3a9bdc6 100644
--- a/include/m_random_field.h
+++ b/include/m_random_field.h
@@ -2,6 +2,9 @@
#define M_RANDOM_FIELD_H
#include "ultra64.h"
+#include "m_collision_bg.h"
+#include "game.h"
+#include "m_field_make.h"
#define RANDOM_FIELD_DIRECT_ERROR 100
@@ -14,6 +17,17 @@ typedef enum RandomFieldDirection {
/* 4 */ RANDOM_FIELD_DIRECT_NUM
} RandomFieldDirection;
+typedef enum RandomFieldGateType {
+ /* 0 */ mRF_GATE_NONE,
+ /* 1 */ mRF_GATE1_TYPE0,
+ /* 2 */ mRF_GATE1_TYPE1,
+ /* 3 */ mRF_GATE2_TYPE0,
+ /* 4 */ mRF_GATE2_TYPE1,
+ /* 5 */ mRF_GATE3_TYPE0,
+
+ /* 6 */ mRF_GATE_TYPE_NUM
+} RandomFieldGateType;
+
typedef struct RandomFieldGate {
/* 0x00 */ s32 ut0;
/* 0x04 */ s32 ut1;
@@ -53,20 +67,20 @@ typedef struct RandomFieldGate {
#define mRF_BLOCKKIND_CLIFF6 (1 << 30) // Bottom part of cliff that juts out, valley on left
#define mRF_BLOCKKIND_31 (1 << 31) // Not used in `mRF_block_info`
-// void func_800BCBA0_jp();
-// void func_800BCBDC_jp();
-// void func_800BCC20_jp();
-// void func_800BCC30_jp();
-// void func_800BCC40_jp();
-// void func_800BCCFC_jp();
-s32 mRF_Type2BlockInfo(u8 type);
-// void func_800BCDFC_jp();
-// void func_800BCE80_jp();
-// void func_800BCEA4_jp();
-// void func_800BCF64_jp();
-// void func_800BCFA4_jp();
-RandomFieldGate* mRF_BlockTypeDirect2GateData(s32*, u8, s32);
-// void func_800BD02C_jp();
-// void func_800BD1E4_jp();
+// void* mRF_Malloc(Game* game, size_t size);
+// void mRF_Free(Game* game, void* ptr);
+s32* mRF_StepNo(void);
+s32* mRF_TryCnt(void);
+// void mRF_PrintDebug(gfxprint* gfxprint);
+void mRF_MakeRandomField(FieldMakeCombination* combi_table, FieldMakeComboInfo* combi_info, s32 combi_count, Game* game);
+u32 mRF_Type2BlockInfo(u8 blockType);
+// u8 mRF_Info2BlockType(u32 blockInfo);
+// s32 mRF_GateType2GateCount(s32 gateType);
+s32 mRF_SearchPond(s32* utX, s32* utZ, s32 blockX, s32 blockZ);
+// s32 mRF_Attr2BeastRoadAttr(s32 attribute);
+// s32 mRF_BlockTypeDirect2GateType(u8 blockType, s32 direct);
+RandomFieldGate* mRF_BlockTypeDirect2GateData(s32* gateCount, u8 blockType, s32 direct);
+// s32 mRF_BlockInf2CheckBeastRoad(u8 blockType, mCoBG_unkStructUnion* collisionData);
+void mRF_CheckBeastRoad();
#endif