mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
Merge pull request #59 from Cuyler36/m_random_field
Implement & link m_random_field.c
This commit is contained in:
@@ -71,6 +71,10 @@ m_police_box.c:
|
||||
.text: [0x803DE8A0, 0x803DEE38]
|
||||
.rodata: [0x806431C8, 0x806431D8]
|
||||
.data: [0x8065BE98, 0x8065BEF0]
|
||||
m_random_field.c:
|
||||
.text: [0x803E4B20, 0x803E50E4]
|
||||
.rodata: [0x80643218, 0x80643240]
|
||||
.data: [0x8065C098, 0x8065C588]
|
||||
m_room_type/mRmTp_FtrItemNo2FtrIdx.c:
|
||||
.text: [0x803E7878, 0x803E78BC]
|
||||
#m_time.c: # unlinked until function callers that reorder local static variables are implemented.
|
||||
|
||||
@@ -58,6 +58,7 @@ extern f32 mCoBG_GetBgY_AngleS_FromWpos(s_xyz* angle_to_ground, xyz_t wpos, f32
|
||||
extern int mCoBG_CheckWaterAttribute_OutOfSea(u32 attribute);
|
||||
extern int mCoBG_CheckHole_OrgAttr(u32 attribute);
|
||||
extern f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t wpos, f32 foot_dist);
|
||||
extern int mCoBG_Attribute2CheckPlant(u32 attribute, const xyz_t* wpos);
|
||||
|
||||
extern f32 mCoBG_GetWaterHeight_File(xyz_t wpos, char* file, int line);
|
||||
#define mCoBG_GetWaterHeight(wpos) mCoBG_GetWaterHeight_File(wpos, __FILE__, __LINE__)
|
||||
|
||||
@@ -21,6 +21,8 @@ extern "C" {
|
||||
#define mFI_ROW_TO_CHARSTR(row) ((row) + 'A')
|
||||
#define mFI_COL_TO_CHARSTR(col) ((col) + '0')
|
||||
|
||||
#define mFI_NUM_SOUND_SOURCES 6
|
||||
|
||||
enum field_type {
|
||||
mFI_FIELDTYPE_FG,
|
||||
mFI_FIELDTYPE_1,
|
||||
@@ -100,6 +102,15 @@ typedef struct block_table_s {
|
||||
mActor_name_t* items;
|
||||
} mFI_block_tbl_c;
|
||||
|
||||
enum {
|
||||
mFI_SOUND_SOURCE_POND = 3, // TODO: might not be correct name
|
||||
};
|
||||
|
||||
typedef struct sound_source_info_s {
|
||||
s16 kind;
|
||||
xyz_t wpos;
|
||||
} mFI_sound_source_info_c;
|
||||
|
||||
extern int mFI_CheckFieldData();
|
||||
extern mActor_name_t mFI_GetFieldId();
|
||||
extern int mFI_GetClimate();
|
||||
@@ -120,6 +131,12 @@ extern mCoBG_Collision_u* mFI_GetBkNum2ColTop(int block_x, int block_z);
|
||||
extern u32 mFI_BkNum2BlockKind(int block_x, int block_z);
|
||||
extern int mFI_BlockKind2BkNum(int* block_x, int* block_z, u32 block_kind);
|
||||
extern int mFI_GetBlockUtNum2FG(mActor_name_t* fg_item, int block_x, int block_z, int ut_x, int ut_z);
|
||||
extern void mFI_UtNum2CenterWpos(xyz_t* wpos, int ut_x, int ut_z);
|
||||
extern u8 mFI_GetBlockXMax();
|
||||
extern u8 mFI_GetBlockZMax();
|
||||
extern u8 mFI_BkNum2BlockType();
|
||||
extern mFI_sound_source_info_c* mFI_GetSoundSourcePBlockNum(int block_x,int block_z);
|
||||
extern int mFI_Wpos2UtNum(int* ut_x, int* ut_z, xyz_t wpos);
|
||||
|
||||
extern void mFI_PrintNowBGNum(gfxprint_t* gfxprint);
|
||||
extern void mFI_PrintFgAttr(gfxprint_t* gfxprint);
|
||||
|
||||
@@ -37,6 +37,13 @@ typedef struct fg_items_s {
|
||||
/* 0x000 */ mActor_name_t items[UT_Z_NUM][UT_X_NUM];
|
||||
} mFM_fg_c;
|
||||
|
||||
/* sizeof (mFM_combo_info_c) == 6 */
|
||||
typedef struct block_combo_s {
|
||||
/* 0x00 */ mActor_name_t bg_id;
|
||||
/* 0x02 */ mActor_name_t fg_id;
|
||||
/* 0x05 */ u8 type;
|
||||
} mFM_combo_info_c;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
#ifndef M_RANDOM_FIELD_H
|
||||
#define M_RANDOM_FIELD_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_random_field_h.h"
|
||||
#include "m_field_make.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define mRF_BLOCK_TYPE_MAX 108 // TODO: this is likely a giant enum lol
|
||||
#define mRF_DIRECT_ERROR 100
|
||||
|
||||
enum {
|
||||
mRF_GATE_NONE,
|
||||
mRF_GATE1_TYPE0,
|
||||
mRF_GATE1_TYPE1,
|
||||
mRF_GATE2_TYPE0,
|
||||
mRF_GATE2_TYPE1,
|
||||
mRF_GATE3_TYPE0,
|
||||
|
||||
mRF_GATE_TYPE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mRF_DIRECT_NORTH,
|
||||
mRF_DIRECT_WEST,
|
||||
mRF_DIRECT_SOUTH,
|
||||
mRF_DIRECT_EAST,
|
||||
|
||||
mRF_DIRECT_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mRF_RIVER0,
|
||||
mRF_RIVER1,
|
||||
mRF_RIVER2,
|
||||
mRF_RIVER3,
|
||||
mRF_RIVER4,
|
||||
mRF_RIVER5,
|
||||
mRF_RIVER6,
|
||||
|
||||
mRF_RIVER_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mRF_FIELD_STEP1, /* first level */
|
||||
mRF_FIELD_STEP2, /* second level*/
|
||||
mRF_FIELD_STEP3, /* third level */
|
||||
mRF_FIELD_STEP4, /* fourth level */
|
||||
|
||||
mRF_FIELD_STEP_NUM
|
||||
};
|
||||
|
||||
typedef struct gate_s {
|
||||
int ut0;
|
||||
int ut1;
|
||||
} mRF_gate_c;
|
||||
|
||||
extern u32 mRF_Type2BlockInfo(u8 type);
|
||||
extern int mRF_SearchPond(int* ut_x, int* ut_z, int block_x, int block_z);
|
||||
extern mRF_gate_c* mRF_BlockTypeDirect2GateData(int* gate_count, u8 block_type, int direct);
|
||||
extern void mRF_CheckBeastRoad();
|
||||
extern int mRF_RiverIdx2NextDirect(int river_idx);
|
||||
extern int mRF_BlockType2RiverNextDirect(u8 type);
|
||||
extern void mRF_IslandBgData_To_VillageData();
|
||||
extern int mRF_CheckFieldStep3();
|
||||
|
||||
extern mFM_combo_info_c data_combi_table[];
|
||||
extern int data_combi_table_number;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef M_RANDOM_FIELD_H
|
||||
#define M_RANDOM_FIELD_H
|
||||
#ifndef M_RANDOM_FIELD_H_H
|
||||
#define M_RANDOM_FIELD_H_H
|
||||
|
||||
#include "types.h"
|
||||
|
||||
@@ -31,13 +31,13 @@ extern "C" {
|
||||
#define mRF_BLOCKKIND_OCEAN (1 << 20)
|
||||
#define mRF_BLOCKKIND_ISLAND (1 << 21)
|
||||
#define mRF_BLOCKKIND_OFFING (1 << 22)
|
||||
#define mRF_BLOCKKIND_23 (1 << 23)
|
||||
#define mRF_BLOCKKIND_24 (1 << 24)
|
||||
#define mRF_BLOCKKIND_25 (1 << 25)
|
||||
#define mRF_BLOCKKIND_26 (1 << 26)
|
||||
#define mRF_BLOCKKIND_27 (1 << 27)
|
||||
#define mRF_BLOCKKIND_28 (1 << 28)
|
||||
#define mRF_BLOCKKIND_29 (1 << 29)
|
||||
#define mRF_BLOCKKIND_RIVER0 (1 << 23)
|
||||
#define mRF_BLOCKKIND_RIVER1 (1 << 24)
|
||||
#define mRF_BLOCKKIND_RIVER2 (1 << 25)
|
||||
#define mRF_BLOCKKIND_RIVER3 (1 << 26)
|
||||
#define mRF_BLOCKKIND_RIVER4 (1 << 27)
|
||||
#define mRF_BLOCKKIND_RIVER5 (1 << 28)
|
||||
#define mRF_BLOCKKIND_RIVER6 (1 << 29)
|
||||
#define mRF_BLOCKKIND_DOCK (1 << 30)
|
||||
#define mRF_BLOCKKIND_ISLAND_LEFT (1 << 31)
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef M_RANDOM_FIELD_OVL_H
|
||||
#define M_RANDOM_FIELD_OVL_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_random_field_h.h"
|
||||
#include "m_field_make.h"
|
||||
#include "game_h.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void mRF_MakeRandomField_ovl(mFM_combination_c* combi_table, mFM_combo_info_c* combo_info, int combo_count, GAME* game);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user