mirror of
https://github.com/ACreTeam/ac-decomp
synced 2026-05-23 06:34:18 -04:00
100% text, add -requireprotos
This commit is contained in:
@@ -375,6 +375,7 @@ BASE_REL_CFLAGS = CFLAGS + [
|
||||
"-sdata 0",
|
||||
f"-sdata2 {REL_SDATA2_SIZE}",
|
||||
"-enum int",
|
||||
"-requireprotos",
|
||||
#"-pool off",
|
||||
"-sym on"
|
||||
] + REL_DEFINES
|
||||
|
||||
+375
-1
@@ -3,11 +3,386 @@
|
||||
|
||||
#include "types.h"
|
||||
#include "m_actor.h"
|
||||
#include "m_field_info.h"
|
||||
#include "bg_item_h.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define bIT_PIT_NUM 13
|
||||
#define bIT_DROP_NUM 19
|
||||
#define bIT_FRUIT_DROP_NUM 6
|
||||
#define bIT_HOLE_NUM 1
|
||||
#define bIT_SHIN_NUM 1
|
||||
#define bIT_TEN_COIN_NUM 5
|
||||
#define bIT_FADE_NUM 3
|
||||
|
||||
enum {
|
||||
bIT_TYPE_CAT_BG_ITEM,
|
||||
bIT_TYPE_CAT_BG_ITEM2,
|
||||
bIT_TYPE_CAT_FTR,
|
||||
bIT_TYPE_CAT_ITEM1,
|
||||
bIT_TYPE_CAT_CRACK,
|
||||
bIT_TYPE_CAT_DUMMY,
|
||||
|
||||
bIT_TYPE_CAT_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
bIT_DRAW_TYPE_STUMP1,
|
||||
bIT_DRAW_TYPE_STUMP2,
|
||||
bIT_DRAW_TYPE_STUMP3,
|
||||
bIT_DRAW_TYPE_STUMP4,
|
||||
bIT_DRAW_TYPE_FENCE,
|
||||
bIT_DRAW_TYPE_NOTICE,
|
||||
bIT_DRAW_TYPE_GRASS,
|
||||
bIT_DRAW_TYPE_MAPBOARD,
|
||||
bIT_DRAW_TYPE_MELODY,
|
||||
bIT_DRAW_TYPE_FENCES,
|
||||
bIT_DRAW_TYPE_HONYCOMB,
|
||||
bIT_DRAW_TYPE_HOLE00_G,
|
||||
bIT_DRAW_TYPE_HOLE00_S,
|
||||
bIT_DRAW_TYPE_CRACK00_G,
|
||||
bIT_DRAW_TYPE_CRACK00_S,
|
||||
bIT_DRAW_TYPE_HOLE00_SHIN_G,
|
||||
bIT_DRAW_TYPE_STONE_A,
|
||||
bIT_DRAW_TYPE_STONE_B,
|
||||
bIT_DRAW_TYPE_STONE_C,
|
||||
bIT_DRAW_TYPE_STONE_D,
|
||||
bIT_DRAW_TYPE_STONE_E,
|
||||
bIT_DRAW_TYPE_TANE,
|
||||
bIT_DRAW_TYPE_TREE0,
|
||||
bIT_DRAW_TYPE_TREE1,
|
||||
bIT_DRAW_TYPE_TREE2,
|
||||
bIT_DRAW_TYPE_TREE3,
|
||||
bIT_DRAW_TYPE_TREE4,
|
||||
bIT_DRAW_TYPE_TREE4_AP,
|
||||
bIT_DRAW_TYPE_TREE4_OR,
|
||||
bIT_DRAW_TYPE_TREE4_PH,
|
||||
bIT_DRAW_TYPE_TREE4_PR,
|
||||
bIT_DRAW_TYPE_TREE4_NT,
|
||||
bIT_DRAW_TYPE_TREE4_BG,
|
||||
bIT_DRAW_TYPE_FLOWER_LEAF,
|
||||
bIT_DRAW_TYPE_FLOWER00,
|
||||
bIT_DRAW_TYPE_FLOWER01,
|
||||
bIT_DRAW_TYPE_FLOWER02,
|
||||
bIT_DRAW_TYPE_TREE0_DEAD,
|
||||
bIT_DRAW_TYPE_PALM000,
|
||||
bIT_DRAW_TYPE_PALM001,
|
||||
bIT_DRAW_TYPE_PALM002,
|
||||
bIT_DRAW_TYPE_PALM003,
|
||||
bIT_DRAW_TYPE_PALM004,
|
||||
bIT_DRAW_TYPE_PALM004_CC,
|
||||
bIT_DRAW_TYPE_PALM_STUMP001,
|
||||
bIT_DRAW_TYPE_PALM_STUMP002,
|
||||
bIT_DRAW_TYPE_PALM_STUMP003,
|
||||
bIT_DRAW_TYPE_PALM_STUMP004,
|
||||
bIT_DRAW_TYPE_PALM000_DEAD,
|
||||
bIT_DRAW_TYPE_CEDAR000,
|
||||
bIT_DRAW_TYPE_CEDAR001,
|
||||
bIT_DRAW_TYPE_CEDAR002,
|
||||
bIT_DRAW_TYPE_CEDAR003,
|
||||
bIT_DRAW_TYPE_CEDAR004,
|
||||
bIT_DRAW_TYPE_CEDAR_STUMP001,
|
||||
bIT_DRAW_TYPE_CEDAR_STUMP002,
|
||||
bIT_DRAW_TYPE_CEDAR_STUMP003,
|
||||
bIT_DRAW_TYPE_CEDAR_STUMP004,
|
||||
bIT_DRAW_TYPE_CEDAR000_DEAD,
|
||||
bIT_DRAW_TYPE_GOLD_TREE000,
|
||||
bIT_DRAW_TYPE_GOLD_TREE001,
|
||||
bIT_DRAW_TYPE_GOLD_TREE002,
|
||||
bIT_DRAW_TYPE_GOLD_TREE003,
|
||||
bIT_DRAW_TYPE_GOLD_TREE004,
|
||||
bIT_DRAW_TYPE_GOLD_TREE_STUMP001,
|
||||
bIT_DRAW_TYPE_GOLD_TREE_STUMP002,
|
||||
bIT_DRAW_TYPE_GOLD_TREE_STUMP003,
|
||||
bIT_DRAW_TYPE_GOLD_TREE_STUMP004,
|
||||
bIT_DRAW_TYPE_GOLD_TREE000_DEAD,
|
||||
bIT_DRAW_TYPE_APPLE,
|
||||
bIT_DRAW_TYPE_ORANGE,
|
||||
bIT_DRAW_TYPE_PEACH,
|
||||
bIT_DRAW_TYPE_PEAR,
|
||||
bIT_DRAW_TYPE_NUTS,
|
||||
bIT_DRAW_TYPE_MATUTAKE,
|
||||
bIT_DRAW_TYPE_KABU,
|
||||
bIT_DRAW_TYPE_FISH,
|
||||
bIT_DRAW_TYPE_BAG,
|
||||
bIT_DRAW_TYPE_LEAF,
|
||||
bIT_DRAW_TYPE_ROLL,
|
||||
bIT_DRAW_TYPE_BOX,
|
||||
bIT_DRAW_TYPE_PACK,
|
||||
bIT_DRAW_TYPE_PRESENT,
|
||||
bIT_DRAW_TYPE_SEED,
|
||||
bIT_DRAW_TYPE_HANIWA,
|
||||
bIT_DRAW_TYPE_OTHER,
|
||||
bIT_DRAW_TYPE_86,
|
||||
bIT_DRAW_TYPE_TOOL,
|
||||
bIT_DRAW_TYPE_FOSSIL,
|
||||
bIT_DRAW_TYPE_TRASH,
|
||||
bIT_DRAW_TYPE_90,
|
||||
bIT_DRAW_TYPE_OTOSI,
|
||||
bIT_DRAW_TYPE_SHELL_A,
|
||||
bIT_DRAW_TYPE_SHELL_B,
|
||||
bIT_DRAW_TYPE_SHELL_C,
|
||||
bIT_DRAW_TYPE_CANDY,
|
||||
bIT_DRAW_TYPE_COCONUT,
|
||||
bIT_DRAW_TYPE_97,
|
||||
bIT_DRAW_TYPE_CLOTH,
|
||||
bIT_DRAW_TYPE_CARPET,
|
||||
bIT_DRAW_TYPE_WALL,
|
||||
bIT_DRAW_TYPE_AXE,
|
||||
bIT_DRAW_TYPE_NET,
|
||||
bIT_DRAW_TYPE_ROD,
|
||||
bIT_DRAW_TYPE_SCOOP,
|
||||
bIT_DRAW_TYPE_GOLD_AXE,
|
||||
bIT_DRAW_TYPE_GOLD_NET,
|
||||
bIT_DRAW_TYPE_GOLD_ROD,
|
||||
bIT_DRAW_TYPE_GOLD_SCOOP,
|
||||
bIT_DRAW_TYPE_UMBRELLA,
|
||||
bIT_DRAW_TYPE_PINWHEEL,
|
||||
bIT_DRAW_TYPE_FAN,
|
||||
bIT_DRAW_TYPE_PAPER,
|
||||
bIT_DRAW_TYPE_SEEDBAG,
|
||||
bIT_DRAW_TYPE_LUCKBAG,
|
||||
bIT_DRAW_TYPE_GYMCARD,
|
||||
bIT_DRAW_TYPE_MUSIC,
|
||||
bIT_DRAW_TYPE_LOTTERY,
|
||||
bIT_DRAW_TYPE_BONE,
|
||||
bIT_DRAW_TYPE_DIARY,
|
||||
bIT_DRAW_TYPE_FORK,
|
||||
bIT_DRAW_TYPE_FISH2,
|
||||
bIT_DRAW_TYPE_NONE,
|
||||
|
||||
bIT_DRAW_TYPE_MAX
|
||||
};
|
||||
|
||||
enum {
|
||||
bIT_PAL_FLOWER_A,
|
||||
bIT_PAL_FLOWER_B,
|
||||
bIT_PAL_FLOWER_C,
|
||||
bIT_PAL_GRASS,
|
||||
bIT_PAL_HOLE_G,
|
||||
bIT_PAL_HOLE_S,
|
||||
bIT_PAL_TREE,
|
||||
bIT_PAL_PALM_TREE,
|
||||
bIT_PAL_GOLD_TREE,
|
||||
|
||||
bIT_PAL_NUM
|
||||
};
|
||||
|
||||
/* sizeof(bg_item_tbl_c) == 0x100 */
|
||||
typedef struct bg_item_tbl_s {
|
||||
u8 info[UT_TOTAL_NUM];
|
||||
} bg_item_tbl_c;
|
||||
|
||||
/* sizeof(bg_item_block_info_tbl_c) == 0x404 */
|
||||
typedef struct block_info_tbl_s {
|
||||
/* 0x000 */ int _000;
|
||||
/* 0x004 */ bg_item_tbl_c info_tbl[mFM_VISIBLE_BLOCK_NUM];
|
||||
} bg_item_block_info_tbl_c;
|
||||
|
||||
/* sizeof(bg_item_type_data_c) == 0xC */
|
||||
typedef struct type_data_s {
|
||||
/* 0x00 */ s8 _00;
|
||||
/* 0x02 */ s16 type;
|
||||
/* 0x04 */ f32* pos_x_tbl_p;
|
||||
/* 0x08 */ f32* pos_z_tbl_p;
|
||||
} bg_item_type_data_c;
|
||||
|
||||
typedef struct draw_pos_s {
|
||||
MtxF mtxf;
|
||||
int _04;
|
||||
s16 next_add_cnt; // this isn't right
|
||||
u8 cull_flag;
|
||||
s8 sub_idx;
|
||||
} bg_item_draw_pos_c;
|
||||
|
||||
typedef struct draw_list_s {
|
||||
void* draw_proc;
|
||||
u8 gfx_idx;
|
||||
u8 mat_idx;
|
||||
} bg_item_draw_list_c;
|
||||
|
||||
typedef struct draw_part_s {
|
||||
Gfx** display_list_table_p;
|
||||
int draw_list_count;
|
||||
bg_item_draw_list_c** draw_list_table_p;
|
||||
int shadow_vtx_count;
|
||||
Vtx* shadow_vtx_p;
|
||||
f32 shadow_len;
|
||||
u8* shadow_vtx_fix_table_p;
|
||||
bg_item_draw_list_c* shadow_draw_list;
|
||||
} bg_item_draw_part_c;
|
||||
|
||||
typedef struct draw_part_table_s {
|
||||
bg_item_draw_part_c* draw_part_p;
|
||||
u16 flags;
|
||||
} bg_item_draw_part_table_c;
|
||||
|
||||
typedef struct draw_data_s {
|
||||
bg_item_draw_pos_c draw_pos[UT_TOTAL_NUM + 1];
|
||||
u16* idx_p;
|
||||
u16 val;
|
||||
} bg_item_draw_data_c;
|
||||
|
||||
typedef struct draw_table_s {
|
||||
bg_item_draw_data_c draw_data;
|
||||
s16 draw_flag;
|
||||
u8 bx;
|
||||
u8 bz;
|
||||
} bg_item_draw_table_c;
|
||||
|
||||
typedef struct common_info_s {
|
||||
bg_item_draw_part_table_c* draw_part_table_p;
|
||||
bg_item_type_data_c** type_data_table_p;
|
||||
f32* pos_table_p;
|
||||
u16* pal_p[bIT_PAL_NUM];
|
||||
u16 _30;
|
||||
} bg_item_common_info_c;
|
||||
|
||||
typedef void (*bIT_ACTOR_DROP_MOVE_PROC)(bg_item_drop_c*);
|
||||
typedef void (*bIT_ACTOR_DROP_DRAW_PROC)(GAME*, bg_item_common_info_c*, bg_item_drop_c*);
|
||||
typedef void (*bIT_ACTOR_DROP_DESTRUCT_PROC)(bg_item_drop_c*);
|
||||
|
||||
struct drop_s {
|
||||
bIT_ACTOR_DROP_MOVE_PROC move_proc;
|
||||
bIT_ACTOR_DROP_DRAW_PROC draw_proc;
|
||||
bIT_ACTOR_DROP_DESTRUCT_PROC dt_proc;
|
||||
s16 mode;
|
||||
mActor_name_t fg_item;
|
||||
mActor_name_t display_fg_item;
|
||||
xyz_t position;
|
||||
xyz_t target_position;
|
||||
xyz_t scale;
|
||||
xyz_t offset;
|
||||
s_xyz angle;
|
||||
s16 _4A;
|
||||
f32 _4C;
|
||||
s16 drop_speed;
|
||||
f32 _54;
|
||||
s16 _58;
|
||||
s16 _5A;
|
||||
s16 _5C;
|
||||
f32 velocity_xz;
|
||||
f32 velocity_y;
|
||||
f32 acceleration_y;
|
||||
u16 flags;
|
||||
s16 _6E;
|
||||
s16 _70;
|
||||
u8 _72;
|
||||
mActor_name_t target_pos_fg_item;
|
||||
u16 _76;
|
||||
u16 _78;
|
||||
f32 _7C;
|
||||
s16 wait_counter;
|
||||
f32 total_distance_y;
|
||||
u16 _88;
|
||||
s16 _8A;
|
||||
ACTOR* actorx_p;
|
||||
s16 _90;
|
||||
s16 layer;
|
||||
xyz_t last_position;
|
||||
f32 last_velocity_xz;
|
||||
f32 last_velocity_y;
|
||||
};
|
||||
|
||||
typedef struct drop_table_s {
|
||||
bg_item_drop_c* drop_p;
|
||||
s16 count;
|
||||
} bg_item_drop_table_c;
|
||||
|
||||
typedef struct pit_s {
|
||||
xyz_t position;
|
||||
f32 scale;
|
||||
s16 mode;
|
||||
mActor_name_t hole_fg_item;
|
||||
s16 hole_timer;
|
||||
s16 wait_counter;
|
||||
s16 wait_type;
|
||||
mActor_name_t fg_item_in_pit;
|
||||
} bg_item_pit_c;
|
||||
|
||||
struct hole_s {
|
||||
xyz_t position;
|
||||
f32 scale;
|
||||
s_xyz angle;
|
||||
s16 mode;
|
||||
mActor_name_t hole_fg_item;
|
||||
mActor_name_t fg_item;
|
||||
u16 counter;
|
||||
u16 max_counter;
|
||||
u16 wait_counter;
|
||||
s16 wait_type;
|
||||
};
|
||||
|
||||
typedef struct shin_s {
|
||||
xyz_t position;
|
||||
mActor_name_t fg_item;
|
||||
u16 mode;
|
||||
} bg_item_shin_c;
|
||||
|
||||
typedef struct ten_coin_s {
|
||||
u8 _00[0x30];
|
||||
xyz_t position;
|
||||
f32 scale;
|
||||
s16 angle;
|
||||
mActor_name_t fg_item;
|
||||
u16 _44;
|
||||
s16 _46;
|
||||
s16 _48;
|
||||
s16 _4A;
|
||||
s16 _4C;
|
||||
s16 _4E;
|
||||
s16 _50;
|
||||
s16 left_frames;
|
||||
s16 total_frames;
|
||||
s16 hit_count;
|
||||
} bg_item_ten_coin_c;
|
||||
|
||||
typedef struct fade_s {
|
||||
xyz_t position;
|
||||
mActor_name_t fg_item;
|
||||
u8 alpha;
|
||||
u8 mode;
|
||||
u8 _10;
|
||||
} bg_item_fade_c;
|
||||
|
||||
typedef int (*bIT_TALK_DISPLAY_LIMIT_CHECK_PROC)(int);
|
||||
|
||||
struct bg_common_s {
|
||||
bg_item_draw_table_c draw_table[mFM_VISIBLE_BLOCK_NUM];
|
||||
bg_item_block_info_tbl_c block_info_table;
|
||||
mFI_item_table_c item_table;
|
||||
bg_item_common_info_c common_info;
|
||||
bg_item_drop_table_c drop_info;
|
||||
bg_item_drop_table_c fruit_drop_info;
|
||||
bg_item_pit_c pit[bIT_PIT_NUM];
|
||||
bg_item_drop_c drop[bIT_DROP_NUM];
|
||||
bg_item_drop_c fruit_drop[bIT_FRUIT_DROP_NUM];
|
||||
bg_item_hole_c hole[bIT_HOLE_NUM];
|
||||
bg_item_shin_c shin[bIT_SHIN_NUM];
|
||||
bg_item_ten_coin_c ten_coin[bIT_TEN_COIN_NUM];
|
||||
bg_item_fade_c fade[bIT_FADE_NUM];
|
||||
bIT_TALK_DISPLAY_LIMIT_CHECK_PROC talk_display_limit_check_proc;
|
||||
ACTOR* bg_item_actorx_p;
|
||||
u16 flags;
|
||||
int _139E0[mFM_VISIBLE_BLOCK_NUM];
|
||||
int _139F4[mFM_VISIBLE_BLOCK_NUM];
|
||||
};
|
||||
|
||||
typedef struct blk_idx_info_s {
|
||||
u16 idx[bIT_DRAW_TYPE_MAX];
|
||||
} bg_item_idx_info_c;
|
||||
|
||||
typedef struct bg_item_actor_s BG_ITEM_ACTOR;
|
||||
|
||||
struct bg_item_actor_s {
|
||||
ACTOR actor_class;
|
||||
bg_item_common_c common;
|
||||
bg_item_idx_info_c item_idx_info[mFM_VISIBLE_BLOCK_NUM];
|
||||
};
|
||||
|
||||
extern ACTOR_PROFILE BgItem_Profile;
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -15,4 +390,3 @@ extern ACTOR_PROFILE BgItem_Profile;
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
+48
-15
@@ -10,27 +10,60 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct background_item_shadow_s {
|
||||
u32 vtx_num;
|
||||
u8* vtx_fix_flags;
|
||||
f32 size;
|
||||
Vtx* vtx;
|
||||
Gfx* gfx;
|
||||
u32 vtx_num;
|
||||
u8* vtx_fix_flags;
|
||||
f32 size;
|
||||
Vtx* vtx;
|
||||
Gfx* gfx;
|
||||
} bIT_ShadowData_c;
|
||||
|
||||
typedef int (*bIT_DRAW_BF_PROC)(Gfx**, rgba_t*);
|
||||
typedef int (*bIT_DRAW_AF_PROC)(Gfx**, rgba_t*);
|
||||
|
||||
typedef struct bg_common_s bg_item_common_c;
|
||||
typedef struct drop_s bg_item_drop_c;
|
||||
typedef struct hole_s bg_item_hole_c;
|
||||
|
||||
typedef void (*bIT_SHADOW_DRAW_PROC)(GAME*, bIT_ShadowData_c*, int);
|
||||
|
||||
typedef int (*bIT_FRUIT_SET_PROC)(mActor_name_t item, int ut_x, int ut_z, s16 p0, s16 p1);
|
||||
typedef void (*bIT_SINGLE_DRAW_PROC)(GAME* game, mActor_name_t fg_no, xyz_t* pos, f32 scale_f, bIT_DRAW_BF_PROC draw_bf,
|
||||
bIT_DRAW_AF_PROC draw_af, rgba_t* col);
|
||||
typedef int (*bIT_TREE_CUTCOUNT_CHECK_PROC)(GAME* game, int ut_x, int ut_z);
|
||||
typedef void (*bIT_DIG_HOLE_EFFECT_ENTRY_PROC)(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames);
|
||||
typedef void (*bIT_BURY_HOLE_EFFECT_ENTRY_PROC)(mActor_name_t fg_item, xyz_t* pos, u16 frames);
|
||||
typedef int (*bIT_PIT_FALL_PROC)(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
typedef int (*bIT_PIT_FALL_STOP_PROC)(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
typedef int (*bIT_PIT_EXIT_PROC)(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
typedef int (*bIT_RAND_POS_GET_PROC)(xyz_t* pos, const xyz_t* check_pos);
|
||||
typedef int (*bIT_TEN_COIN_ENTRY_EX_PROC)(xyz_t* pos, s16 angle);
|
||||
typedef int (*bIT_FRUIT_SET_PROC)(mActor_name_t fg_item, int ut_x, int ut_z, s16 count, int type);
|
||||
typedef void (*bIT_FLY_ENTRY_PROC)(mActor_name_t fg_item, xyz_t* pos, s16 angle_y);
|
||||
typedef void (*bIT_ITEM_TREE_FRUIT_DROP_PROC)(mActor_name_t item, int ut_x, int ut_z, xyz_t* pos);
|
||||
|
||||
typedef int (*bIT_PLAYER_DROP_ENTRY_PROC)(GAME* game, mActor_name_t fg_item, int ut_x, int ut_z, s16 layer);
|
||||
typedef int (*bIT_DROP_ENTRY_V1_PROC)(mActor_name_t fg_item, xyz_t* pos, xyz_t* target_pos);
|
||||
typedef int (*bIT_FADE_ENTRY_PROC)(mActor_name_t fg_name, xyz_t* pos);
|
||||
|
||||
typedef struct background_item_clip_s {
|
||||
void* _00;
|
||||
bIT_SHADOW_DRAW_PROC draw_shadow_proc;
|
||||
void* _08[(0x30 - 0x08) / sizeof(void*)];
|
||||
bIT_FRUIT_SET_PROC fruit_set_proc;
|
||||
void* _34;
|
||||
bIT_ITEM_TREE_FRUIT_DROP_PROC item_tree_fruit_drop_proc;
|
||||
void* _3C[(0x54 - 0x3C) / sizeof(void*)];
|
||||
bg_item_common_c* bg_item_common_p;
|
||||
bIT_SHADOW_DRAW_PROC draw_shadow_proc;
|
||||
bIT_SINGLE_DRAW_PROC single_draw_proc;
|
||||
bIT_TREE_CUTCOUNT_CHECK_PROC tree_cutcount_check_proc;
|
||||
bIT_DIG_HOLE_EFFECT_ENTRY_PROC dig_hole_effect_entry_proc;
|
||||
bIT_BURY_HOLE_EFFECT_ENTRY_PROC bury_hole_effect_entry_proc;
|
||||
bIT_PIT_FALL_PROC pit_fall_proc;
|
||||
bIT_PIT_FALL_STOP_PROC pit_fall_stop_proc;
|
||||
bIT_PIT_EXIT_PROC pit_exit_proc;
|
||||
void* _24;
|
||||
bIT_RAND_POS_GET_PROC rand_pos_get_proc;
|
||||
bIT_TEN_COIN_ENTRY_EX_PROC ten_coin_entry_ex_proc;
|
||||
bIT_FRUIT_SET_PROC fruit_set_proc;
|
||||
bIT_FLY_ENTRY_PROC fly_entry_proc;
|
||||
bIT_ITEM_TREE_FRUIT_DROP_PROC item_tree_fruit_drop_proc;
|
||||
bIT_PLAYER_DROP_ENTRY_PROC player_drop_entry_proc;
|
||||
bIT_DROP_ENTRY_V1_PROC drop_entry_v1_proc;
|
||||
void* _44;
|
||||
void* _48;
|
||||
ACTOR* bg_item_actorx;
|
||||
bIT_FADE_ENTRY_PROC fade_entry_proc;
|
||||
} bIT_Clip_c;
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -16,7 +16,7 @@ typedef struct Arena {
|
||||
/* 0x20 */ u8 unk_20;
|
||||
/* 0x21 */ u8 isInit;
|
||||
/* 0x22 */ u8 flag;
|
||||
/* 0x24 */ u8 pad[0x2C-0x24];
|
||||
/* 0x24 */ u8 pad[0x2C - 0x24];
|
||||
} Arena; // size = 0x2C
|
||||
|
||||
typedef struct ArenaNode {
|
||||
@@ -30,8 +30,8 @@ typedef struct ArenaNode {
|
||||
/* 0x18 */ OSId threadId;
|
||||
/* 0x1C */ Arena* arena;
|
||||
/* 0x20 */ OSTime time;
|
||||
/* 0x28 */ u8 unk_28[0x30-0x28]; // probably padding
|
||||
} ArenaNode; // size = 0x30
|
||||
/* 0x28 */ u8 unk_28[0x30 - 0x28]; // probably padding
|
||||
} ArenaNode; // size = 0x30
|
||||
|
||||
void setDebugInfo(ArenaNode*, const char*, s32, Arena*);
|
||||
void arena_lock_init(Arena*);
|
||||
@@ -61,8 +61,8 @@ u32 __osGetFreeSize(Arena*);
|
||||
u32 __osGetMemBlockSize(Arena*, void*);
|
||||
void __osDisplayArena(Arena*);
|
||||
int __osCheckArena(Arena*);
|
||||
extern int __osMallocIsInitalized(Arena*);
|
||||
|
||||
extern int __osMalloc_FreeBlockTest_Enable;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
typedef void (*mActor_proc)(ACTOR*, GAME*);
|
||||
#define NONE_ACTOR_PROC ((mActor_proc)&none_proc1)
|
||||
#define NONE_ACTOR_PROC ((mActor_proc) & none_proc1)
|
||||
|
||||
#define mAc_MAX_ACTORS 200
|
||||
|
||||
@@ -42,7 +42,7 @@ typedef enum bank_id {
|
||||
ACTOR_OBJ_BANK_1,
|
||||
ACTOR_OBJ_BANK_2,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
ACTOR_OBJ_BANK_4,
|
||||
ACTOR_OBJ_BANK_BGITEM,
|
||||
ACTOR_OBJ_BANK_ROOM_SUNSHINE,
|
||||
ACTOR_OBJ_BANK_6,
|
||||
ACTOR_OBJ_BANK_AIRPLANE,
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ extern void mBGMPsComp_make_ps_quietField(u16 stop_type);
|
||||
extern void mBGMPsComp_make_ps_fc_quietField(u16 stop_type);
|
||||
extern void mBGMPsComp_make_ps_fieldSuddenEv(u8 bgm_num, u16 stop_type, u8 priority);
|
||||
extern void mBGMPsComp_delete_ps_fanfare(u8 bgm_num, u16 stop_type);
|
||||
extern void mBGMPsComp_delete_ps_wipe();
|
||||
extern void mBGMPsComp_delete_ps_quiet();
|
||||
extern void mBGMPsComp_delete_ps_demo(u8 bgm_num, u16 stop_type);
|
||||
extern void mBGMPsComp_delete_ps_happening(u8 bgm_num, u16 stop_type);
|
||||
extern void mBGMPsComp_delete_ps_room(u8 bgm_num, u16 stop_type);
|
||||
|
||||
@@ -53,6 +53,7 @@ extern void mCD_toNextLand();
|
||||
|
||||
extern int mCD_EraseBrokenLand_bg(void*);
|
||||
extern int mCD_card_format_bg(u8);
|
||||
extern void mCD_ReCheckLoadLand(GAME_PLAY* play);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -271,6 +271,12 @@ extern int mCoBG_RegistMoveBg(mCoBG_bg_regist_c* bg_regist, xyz_t* wpos, xyz_t*
|
||||
mCoBG_bg_size_c* bg_size, f32* scale_percent, mCoBG_bg_contact_c* bg_contact, xyz_t* ofs,
|
||||
int type, u32 attribute, f32 check_dist);
|
||||
extern void mCoBG_CrossOffMoveBg(int move_bg_idx);
|
||||
extern int mCoBG_CheckPlace(xyz_t wpos);
|
||||
extern int mCoBG_CheckSandHole_ClData(mCoBG_Collision_u* col);
|
||||
extern int mCoBG_GetHoleNumber_ClData(mCoBG_Collision_u* col);
|
||||
extern void mCoBG_GetBgNorm_FromWpos(xyz_t* norm, xyz_t wpos);
|
||||
extern int mCoBG_GetWaterFlow(xyz_t* water_flow, u32 attr);
|
||||
extern void mCoBG_SetAttribute(xyz_t pos, u32 attr);
|
||||
|
||||
extern void mCoBG_InitMoveBgData();
|
||||
extern void mCoBG_InitBlockBgCheckMode();
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef M_DESIGN_OVL_H
|
||||
#define M_DESIGN_OVL_H
|
||||
|
||||
#include "types.h"
|
||||
#include "m_mask_cat.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern void mDE_maskcat_init(MaskCat_c* mask_cat);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+361
-352
@@ -15,7 +15,7 @@ extern "C" {
|
||||
#define mEv_TODAY_EVENT_NUM 16
|
||||
|
||||
#define mEv_SCHEDULE_LAST_WEEKDAY_OF_MONTH 6 /* day of last weekday of the month */
|
||||
#define mEv_SCHEDULE_EVERY_WEEK 7 /* scheduled for the desired day this week (e.g. this saturday) */
|
||||
#define mEv_SCHEDULE_EVERY_WEEK 7 /* scheduled for the desired day this week (e.g. this saturday) */
|
||||
|
||||
/* Month flags */
|
||||
#define mEv_SCHEDULE_HARVEST_MOON_DATE 0x40 /* Use this year's lunisolar harvest moon date */
|
||||
@@ -26,12 +26,14 @@ extern "C" {
|
||||
#define mEv_SCHEDULE_LUNAR(m) (mEv_SCHEDULE_HARVEST_MOON_DATE | ((m) & 0xF))
|
||||
|
||||
/* Day flags */
|
||||
#define mEv_SCHEDULE_WEEKLY 0x80 /* Event happens on a given weekday and week of the month */
|
||||
#define mEv_SCHEDULE_WEEKLY 0x80 /* Event happens on a given weekday and week of the month */
|
||||
#define mEv_SCHEDULE_TOWN_DAY 0x40 /* Use save data 'town day' day */
|
||||
#define mEv_SCHEDULE_DAY_AFTER 0x40 /* When used in conjunction with the 'weekly' flag, it schedules on the day after the Nth weekday */
|
||||
#define mEv_SCHEDULE_DAY_AFTER \
|
||||
0x40 /* When used in conjunction with the 'weekly' flag, it schedules on the day after the Nth weekday */
|
||||
#define mEv_SCHEDULE_LAST_DAY_OF_MONTH 0x20
|
||||
|
||||
#define mEv_SCHEDULE_MAKE_WEEKLY_DATA(week, weekday) (mEv_SCHEDULE_WEEKLY | ((((week) & 0b111) << 3) | ((weekday) & 0b111)))
|
||||
#define mEv_SCHEDULE_MAKE_WEEKLY_DATA(week, weekday) \
|
||||
(mEv_SCHEDULE_WEEKLY | ((((week) & 0b111) << 3) | ((weekday) & 0b111)))
|
||||
#define mEv_SCHEDULE_1ST_WEEKDAY(weekday) mEv_SCHEDULE_MAKE_WEEKLY_DATA(1, weekday)
|
||||
#define mEv_SCHEDULE_2ND_WEEKDAY(weekday) mEv_SCHEDULE_MAKE_WEEKLY_DATA(2, weekday)
|
||||
#define mEv_SCHEDULE_3RD_WEEKDAY(weekday) mEv_SCHEDULE_MAKE_WEEKLY_DATA(3, weekday)
|
||||
@@ -41,7 +43,7 @@ extern "C" {
|
||||
#define mEv_SCHEDULE_EVERY_WEEKDAY(weekday) mEv_SCHEDULE_MAKE_WEEKLY_DATA(mEv_SCHEDULE_EVERY_WEEK, weekday)
|
||||
|
||||
/* Hour flags */
|
||||
#define mEv_SCHEDULE_TODAY 0x80 /* event will be active on the day loaded */
|
||||
#define mEv_SCHEDULE_TODAY 0x80 /* event will be active on the day loaded */
|
||||
#define mEv_SCHEDULE_MULTIDAY 0x40 /* event scheduled over more than a single day */
|
||||
#define mEv_SCHEDULE_USE_SAVE_SLOT_VALUE 0x20
|
||||
|
||||
@@ -51,39 +53,39 @@ extern "C" {
|
||||
#define mEv_TO_MONTH(month_day) ((lbRTC_month_t)((month_day) >> 8))
|
||||
|
||||
typedef union event_monthday_s {
|
||||
struct {
|
||||
u8 month;
|
||||
u8 day;
|
||||
};
|
||||
u16 raw;
|
||||
struct {
|
||||
u8 month;
|
||||
u8 day;
|
||||
};
|
||||
u16 raw;
|
||||
} mEv_MonthDay_u;
|
||||
|
||||
typedef struct event_today_s {
|
||||
int type;
|
||||
u32 active_hours; /* bitfield (24 bits) */
|
||||
mEv_MonthDay_u begin_date;
|
||||
mEv_MonthDay_u end_date;
|
||||
s16 status;
|
||||
u16 pad;
|
||||
int type;
|
||||
u32 active_hours; /* bitfield (24 bits) */
|
||||
mEv_MonthDay_u begin_date;
|
||||
mEv_MonthDay_u end_date;
|
||||
s16 status;
|
||||
u16 pad;
|
||||
} mEv_event_today_c;
|
||||
|
||||
typedef struct event_date_s {
|
||||
u8 month;
|
||||
u8 day;
|
||||
u8 _2;
|
||||
u8 hour;
|
||||
u8 month;
|
||||
u8 day;
|
||||
u8 _2;
|
||||
u8 hour;
|
||||
} mEv_schedule_date_c;
|
||||
|
||||
typedef union {
|
||||
mEv_schedule_date_c d;
|
||||
u16 md, _h;
|
||||
u32 raw;
|
||||
mEv_schedule_date_c d;
|
||||
u16 md, _h;
|
||||
u32 raw;
|
||||
} mEv_schedule_date_u;
|
||||
|
||||
typedef struct event_schedule_s {
|
||||
mEv_schedule_date_u date[2]; /* 0 = begin, 1 = end */
|
||||
s16 _8;
|
||||
s16 type; /* event type */
|
||||
mEv_schedule_date_u date[2]; /* 0 = begin, 1 = end */
|
||||
s16 _8;
|
||||
s16 type; /* event type */
|
||||
} mEv_schedule_c;
|
||||
|
||||
#define mEv_EVENT_HOUR_START_EVENT (1 << 28)
|
||||
@@ -93,7 +95,7 @@ typedef struct event_schedule_s {
|
||||
/**
|
||||
* Event type definition
|
||||
* xxxyyyyy yyyyyyyy yyyyyyyy yyyyyyyy
|
||||
*
|
||||
*
|
||||
* x: event type (e.g. special event, 'first job' (chores) event, holidays, ...) (0-7)
|
||||
* y: sub-type (specific event)
|
||||
**/
|
||||
@@ -111,460 +113,460 @@ typedef struct event_schedule_s {
|
||||
#define mEv_SET(type, subtype) (mEv_SET_TYPE(type) | mEv_SET_TYPE(subtype))
|
||||
|
||||
enum event_type {
|
||||
mEv_SPNPC_EVENT, /* special NPC events */
|
||||
mEv_SAVED_EVENT, /* events saved to data */
|
||||
mEv_TYPE2_EVENT, /* unused? */
|
||||
mEv_TYPE3_EVENT, /* unused? */
|
||||
mEv_TYPE4_EVENT, /* unused? */
|
||||
mEv_DAILY_EVENT, /* checked daily always? aSL_ReportShopOpen2Event has event 3 */
|
||||
mEv_SPECL_EVENT, /* ??? secondary special npc event data? */
|
||||
mEv_SPNPC_EVENT, /* special NPC events */
|
||||
mEv_SAVED_EVENT, /* events saved to data */
|
||||
mEv_TYPE2_EVENT, /* unused? */
|
||||
mEv_TYPE3_EVENT, /* unused? */
|
||||
mEv_TYPE4_EVENT, /* unused? */
|
||||
mEv_DAILY_EVENT, /* checked daily always? aSL_ReportShopOpen2Event has event 3 */
|
||||
mEv_SPECL_EVENT, /* ??? secondary special npc event data? */
|
||||
|
||||
mEv_EVENT_TYPE_NUM
|
||||
mEv_EVENT_TYPE_NUM
|
||||
};
|
||||
|
||||
enum events {
|
||||
mEv_SPNPC_SHOP = (int)mEv_SET(mEv_SPNPC_EVENT, 0),
|
||||
mEv_SPNPC_DESIGNER,
|
||||
mEv_SPNPC_BROKER,
|
||||
mEv_SPNPC_ARTIST,
|
||||
mEv_SPNPC_ARABIAN,
|
||||
mEv_SPNPC_GYPSY,
|
||||
mEv_SPNPC_END,
|
||||
mEv_SPNPC_SHOP = (int)mEv_SET(mEv_SPNPC_EVENT, 0),
|
||||
mEv_SPNPC_DESIGNER,
|
||||
mEv_SPNPC_BROKER,
|
||||
mEv_SPNPC_ARTIST,
|
||||
mEv_SPNPC_ARABIAN,
|
||||
mEv_SPNPC_GYPSY,
|
||||
mEv_SPNPC_END,
|
||||
|
||||
mEv_SAVED_RENEWSHOP = (int)mEv_SET(mEv_SAVED_EVENT, 0), /* renew shop */
|
||||
mEv_SAVED_UNK1, /* unused */
|
||||
|
||||
/* intro through chores */
|
||||
mEv_SAVED_FIRSTJOB_PLR0,
|
||||
mEv_SAVED_FIRSTJOB_PLR1,
|
||||
mEv_SAVED_FIRSTJOB_PLR2,
|
||||
mEv_SAVED_FIRSTJOB_PLR3,
|
||||
mEv_SAVED_RENEWSHOP = (int)mEv_SET(mEv_SAVED_EVENT, 0), /* renew shop */
|
||||
mEv_SAVED_UNK1, /* unused */
|
||||
|
||||
/* selecting house */
|
||||
mEv_SAVED_FIRSTINTRO_PLR0,
|
||||
mEv_SAVED_FIRSTINTRO_PLR1,
|
||||
mEv_SAVED_FIRSTINTRO_PLR2,
|
||||
mEv_SAVED_FIRSTINTRO_PLR3,
|
||||
/* intro through chores */
|
||||
mEv_SAVED_FIRSTJOB_PLR0,
|
||||
mEv_SAVED_FIRSTJOB_PLR1,
|
||||
mEv_SAVED_FIRSTJOB_PLR2,
|
||||
mEv_SAVED_FIRSTJOB_PLR3,
|
||||
|
||||
/* wait for next day to talk about HRA */
|
||||
mEv_SAVED_HRAWAIT_PLR0,
|
||||
mEv_SAVED_HRAWAIT_PLR1,
|
||||
mEv_SAVED_HRAWAIT_PLR2,
|
||||
mEv_SAVED_HRAWAIT_PLR3,
|
||||
/* selecting house */
|
||||
mEv_SAVED_FIRSTINTRO_PLR0,
|
||||
mEv_SAVED_FIRSTINTRO_PLR1,
|
||||
mEv_SAVED_FIRSTINTRO_PLR2,
|
||||
mEv_SAVED_FIRSTINTRO_PLR3,
|
||||
|
||||
/* Nook will talk about HRA when entering the shop */
|
||||
mEv_SAVED_HRATALK_PLR0,
|
||||
mEv_SAVED_HRATALK_PLR1,
|
||||
mEv_SAVED_HRATALK_PLR2,
|
||||
mEv_SAVED_HRATALK_PLR3,
|
||||
/* wait for next day to talk about HRA */
|
||||
mEv_SAVED_HRAWAIT_PLR0,
|
||||
mEv_SAVED_HRAWAIT_PLR1,
|
||||
mEv_SAVED_HRAWAIT_PLR2,
|
||||
mEv_SAVED_HRAWAIT_PLR3,
|
||||
|
||||
/* Do a 'favor' for a villager during chores */
|
||||
mEv_SAVED_FJOPENQUEST_PLR0,
|
||||
mEv_SAVED_FJOPENQUEST_PLR1,
|
||||
mEv_SAVED_FJOPENQUEST_PLR2,
|
||||
mEv_SAVED_FJOPENQUEST_PLR3,
|
||||
/* Nook will talk about HRA when entering the shop */
|
||||
mEv_SAVED_HRATALK_PLR0,
|
||||
mEv_SAVED_HRATALK_PLR1,
|
||||
mEv_SAVED_HRATALK_PLR2,
|
||||
mEv_SAVED_HRATALK_PLR3,
|
||||
|
||||
/* Player going to another town, set at train station */
|
||||
mEv_SAVED_GATEWAY_PLR0,
|
||||
mEv_SAVED_GATEWAY_PLR1,
|
||||
mEv_SAVED_GATEWAY_PLR2,
|
||||
mEv_SAVED_GATEWAY_PLR3,
|
||||
mEv_SAVED_GATEWAY_FRGN, /* Foreigner */
|
||||
/* Do a 'favor' for a villager during chores */
|
||||
mEv_SAVED_FJOPENQUEST_PLR0,
|
||||
mEv_SAVED_FJOPENQUEST_PLR1,
|
||||
mEv_SAVED_FJOPENQUEST_PLR2,
|
||||
mEv_SAVED_FJOPENQUEST_PLR3,
|
||||
|
||||
mEv_DAILY_0 = (int)mEv_SET(mEv_DAILY_EVENT, 0), /* unused */
|
||||
mEv_DAILY_1, /* unused */
|
||||
mEv_DAILY_2, /* unused */
|
||||
mEv_DAILY_OPEN_SHOP, /* shop opened */
|
||||
/* Player going to another town, set at train station */
|
||||
mEv_SAVED_GATEWAY_PLR0,
|
||||
mEv_SAVED_GATEWAY_PLR1,
|
||||
mEv_SAVED_GATEWAY_PLR2,
|
||||
mEv_SAVED_GATEWAY_PLR3,
|
||||
mEv_SAVED_GATEWAY_FRGN, /* Foreigner */
|
||||
|
||||
mEv_SPECL_DESIGNER_COMPLETE = (int)mEv_SET(mEv_SPECL_EVENT, 0)
|
||||
mEv_DAILY_0 = (int)mEv_SET(mEv_DAILY_EVENT, 0), /* unused */
|
||||
mEv_DAILY_1, /* unused */
|
||||
mEv_DAILY_2, /* unused */
|
||||
mEv_DAILY_OPEN_SHOP, /* shop opened */
|
||||
|
||||
mEv_SPECL_DESIGNER_COMPLETE = (int)mEv_SET(mEv_SPECL_EVENT, 0)
|
||||
};
|
||||
|
||||
enum week_type {
|
||||
mEv_WEEKTYPE_NONE,
|
||||
mEv_WEEKTYPE_1ST,
|
||||
mEv_WEEKTYPE_2ND,
|
||||
mEv_WEEKTYPE_3RD,
|
||||
mEv_WEEKTYPE_4TH,
|
||||
mEv_WEEKTYPE_5TH,
|
||||
mEv_WEEKTYPE_LAST,
|
||||
mEv_WEEKTYPE_SPECIAL
|
||||
mEv_WEEKTYPE_NONE,
|
||||
mEv_WEEKTYPE_1ST,
|
||||
mEv_WEEKTYPE_2ND,
|
||||
mEv_WEEKTYPE_3RD,
|
||||
mEv_WEEKTYPE_4TH,
|
||||
mEv_WEEKTYPE_5TH,
|
||||
mEv_WEEKTYPE_LAST,
|
||||
mEv_WEEKTYPE_SPECIAL
|
||||
};
|
||||
|
||||
enum event_table {
|
||||
mEv_EVENT_RUMOR_NEW_YEARS_DAY,
|
||||
mEv_EVENT_NEW_YEARS_DAY,
|
||||
mEv_EVENT_RUMOR_KAMAKURA,
|
||||
mEv_EVENT_KAMAKURA,
|
||||
mEv_EVENT_SONCHO_VACATION_JANUARY,
|
||||
mEv_EVENT_SONCHO_VACATION_FEBRUARY,
|
||||
mEv_EVENT_RUMOR_GROUNDHOG_DAY,
|
||||
mEv_EVENT_GROUNDHOG_DAY,
|
||||
mEv_EVENT_RUMOR_VALENTINES_DAY,
|
||||
mEv_EVENT_VALENTINES_DAY,
|
||||
mEv_EVENT_RUMOR_SPRING_SPORTS_FAIR,
|
||||
mEv_EVENT_SPRING_EQUINOX,
|
||||
mEv_EVENT_SPORTS_FAIR_BALL_TOSS,
|
||||
mEv_EVENT_SPORTS_FAIR_AEROBICS,
|
||||
mEv_EVENT_SPORTS_FAIR_TUG_OF_WAR,
|
||||
mEv_EVENT_SPORTS_FAIR_FOOT_RACE,
|
||||
mEv_EVENT_SPORTS_FAIR,
|
||||
mEv_EVENT_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_NATURE_DAY,
|
||||
mEv_EVENT_SPRING_CLEANING,
|
||||
mEv_EVENT_MOTHERS_DAY,
|
||||
mEv_EVENT_SUMMER_CAMPER,
|
||||
mEv_EVENT_GRADUATION_DAY,
|
||||
mEv_EVENT_FATHERS_DAY,
|
||||
mEv_EVENT_RUMOR_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_TALK_FISHING_TOURNEY_1, // for dialog?
|
||||
mEv_EVENT_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_TOWN_DAY,
|
||||
mEv_EVENT_RUMOR_FIREWORKS_SHOW,
|
||||
mEv_EVENT_FIREWORKS_SHOW,
|
||||
mEv_EVENT_RUMOR_MORNING_AEROBICS,
|
||||
mEv_EVENT_TALK_MORNING_AEROBICS,
|
||||
mEv_EVENT_MORNING_AEROBICS,
|
||||
mEv_EVENT_RUMOR_METEOR_SHOWER,
|
||||
mEv_EVENT_METEOR_SHOWER,
|
||||
mEv_EVENT_FOUNDERS_DAY,
|
||||
mEv_EVENT_LABOR_DAY,
|
||||
mEv_EVENT_RUMOR_FALL_SPORTS_FAIR,
|
||||
mEv_EVENT_AUTUMN_EQUINOX,
|
||||
mEv_EVENT_RUMOR_HARVEST_MOON_DAY,
|
||||
mEv_EVENT_HARVEST_MOON_FESTIVAL,
|
||||
mEv_EVENT_EXPLORERS_DAY,
|
||||
mEv_EVENT_RUMOR_MUSHROOM_SEASON,
|
||||
mEv_EVENT_TALK_MUSHROOM_SEASON,
|
||||
mEv_EVENT_MUSHROOM_SEASON,
|
||||
mEv_EVENT_RUMOR_HALLOWEEN,
|
||||
mEv_EVENT_HALLOWEEN,
|
||||
mEv_EVENT_MAYORS_DAY,
|
||||
mEv_EVENT_OFFICERS_DAY,
|
||||
mEv_EVENT_RUMOR_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_TALK_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_RUMOR_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_SALE_DAY,
|
||||
mEv_EVENT_SNOW_DAY,
|
||||
mEv_EVENT_TOY_DAY_SONCHO,
|
||||
mEv_EVENT_RUMOR_TOY_DAY,
|
||||
mEv_EVENT_TOY_DAY_JINGLE,
|
||||
mEv_EVENT_SNOWMAN_SEASON,
|
||||
mEv_EVENT_RUMOR_NEW_YEARS_EVE_COUNTDOWN,
|
||||
mEv_EVENT_NEW_YEARS_EVE_COUNTDOWN,
|
||||
mEv_EVENT_CHERRY_BLOSSOM_PETALS,
|
||||
mEv_EVENT_TALK_TOY_DAY,
|
||||
|
||||
mEv_EVENT_PLAYER_BIRTHDAY,
|
||||
|
||||
mEv_EVENT_DOZAEMON,
|
||||
mEv_EVENT_KABU_PEDDLER,
|
||||
mEv_EVENT_LOTTERY,
|
||||
mEv_EVENT_KK_SLIDER,
|
||||
|
||||
mEv_EVENT_HANDBILL_BROKER,
|
||||
mEv_EVENT_HANDBILL_SHOP_SALE,
|
||||
|
||||
mEv_EVENT_ARTIST,
|
||||
mEv_EVENT_BROKER_SALE,
|
||||
mEv_EVENT_DESIGNER,
|
||||
mEv_EVENT_GYPSY,
|
||||
mEv_EVENT_SHOP_SALE,
|
||||
mEv_EVENT_CARPET_PEDDLER,
|
||||
mEv_EVENT_RUMOR_NEW_YEARS_DAY,
|
||||
mEv_EVENT_NEW_YEARS_DAY,
|
||||
mEv_EVENT_RUMOR_KAMAKURA,
|
||||
mEv_EVENT_KAMAKURA,
|
||||
mEv_EVENT_SONCHO_VACATION_JANUARY,
|
||||
mEv_EVENT_SONCHO_VACATION_FEBRUARY,
|
||||
mEv_EVENT_RUMOR_GROUNDHOG_DAY,
|
||||
mEv_EVENT_GROUNDHOG_DAY,
|
||||
mEv_EVENT_RUMOR_VALENTINES_DAY,
|
||||
mEv_EVENT_VALENTINES_DAY,
|
||||
mEv_EVENT_RUMOR_SPRING_SPORTS_FAIR,
|
||||
mEv_EVENT_SPRING_EQUINOX,
|
||||
mEv_EVENT_SPORTS_FAIR_BALL_TOSS,
|
||||
mEv_EVENT_SPORTS_FAIR_AEROBICS,
|
||||
mEv_EVENT_SPORTS_FAIR_TUG_OF_WAR,
|
||||
mEv_EVENT_SPORTS_FAIR_FOOT_RACE,
|
||||
mEv_EVENT_SPORTS_FAIR,
|
||||
mEv_EVENT_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_APRILFOOLS_DAY,
|
||||
mEv_EVENT_RUMOR_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_NATURE_DAY,
|
||||
mEv_EVENT_SPRING_CLEANING,
|
||||
mEv_EVENT_MOTHERS_DAY,
|
||||
mEv_EVENT_SUMMER_CAMPER,
|
||||
mEv_EVENT_GRADUATION_DAY,
|
||||
mEv_EVENT_FATHERS_DAY,
|
||||
mEv_EVENT_RUMOR_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_TALK_FISHING_TOURNEY_1, // for dialog?
|
||||
mEv_EVENT_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_TOWN_DAY,
|
||||
mEv_EVENT_RUMOR_FIREWORKS_SHOW,
|
||||
mEv_EVENT_FIREWORKS_SHOW,
|
||||
mEv_EVENT_RUMOR_MORNING_AEROBICS,
|
||||
mEv_EVENT_TALK_MORNING_AEROBICS,
|
||||
mEv_EVENT_MORNING_AEROBICS,
|
||||
mEv_EVENT_RUMOR_METEOR_SHOWER,
|
||||
mEv_EVENT_METEOR_SHOWER,
|
||||
mEv_EVENT_FOUNDERS_DAY,
|
||||
mEv_EVENT_LABOR_DAY,
|
||||
mEv_EVENT_RUMOR_FALL_SPORTS_FAIR,
|
||||
mEv_EVENT_AUTUMN_EQUINOX,
|
||||
mEv_EVENT_RUMOR_HARVEST_MOON_DAY,
|
||||
mEv_EVENT_HARVEST_MOON_FESTIVAL,
|
||||
mEv_EVENT_EXPLORERS_DAY,
|
||||
mEv_EVENT_RUMOR_MUSHROOM_SEASON,
|
||||
mEv_EVENT_TALK_MUSHROOM_SEASON,
|
||||
mEv_EVENT_MUSHROOM_SEASON,
|
||||
mEv_EVENT_RUMOR_HALLOWEEN,
|
||||
mEv_EVENT_HALLOWEEN,
|
||||
mEv_EVENT_MAYORS_DAY,
|
||||
mEv_EVENT_OFFICERS_DAY,
|
||||
mEv_EVENT_RUMOR_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_TALK_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_RUMOR_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_SALE_DAY,
|
||||
mEv_EVENT_SNOW_DAY,
|
||||
mEv_EVENT_TOY_DAY_SONCHO,
|
||||
mEv_EVENT_RUMOR_TOY_DAY,
|
||||
mEv_EVENT_TOY_DAY_JINGLE,
|
||||
mEv_EVENT_SNOWMAN_SEASON,
|
||||
mEv_EVENT_RUMOR_NEW_YEARS_EVE_COUNTDOWN,
|
||||
mEv_EVENT_NEW_YEARS_EVE_COUNTDOWN,
|
||||
mEv_EVENT_CHERRY_BLOSSOM_PETALS,
|
||||
mEv_EVENT_TALK_TOY_DAY,
|
||||
|
||||
mEv_EVENT_SONCHO_NEW_YEARS_DAY,
|
||||
mEv_EVENT_SONCHO_GROUNDHOG_DAY,
|
||||
mEv_EVENT_SONCHO_SPRING_SPORTS_FAIR,
|
||||
mEv_EVENT_SONCHO_APRILFOOLS_DAY,
|
||||
mEv_EVENT_SONCHO_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_NATURE_DAY,
|
||||
mEv_EVENT_SONCHO_SPRING_CLEANING,
|
||||
mEv_EVENT_SONCHO_MOTHERS_DAY,
|
||||
mEv_EVENT_SONCHO_GRADUATION_DAY,
|
||||
mEv_EVENT_SONCHO_FATHERS_DAY,
|
||||
mEv_EVENT_SONCHO_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_SONCHO_TOWN_DAY,
|
||||
mEv_EVENT_SONCHO_FIREWORKS_SHOW,
|
||||
mEv_EVENT_SONCHO_METEOR_SHOWER,
|
||||
mEv_EVENT_SONCHO_FOUNDERS_DAY,
|
||||
mEv_EVENT_SONCHO_LABOR_DAY,
|
||||
mEv_EVENT_SONCHO_FALL_SPORTS_FAIR,
|
||||
mEv_EVENT_SONCHO_HARVEST_MOON_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_EXPLORERS_DAY,
|
||||
mEv_EVENT_SONCHO_HALLOWEEN,
|
||||
mEv_EVENT_SONCHO_MAYORS_DAY,
|
||||
mEv_EVENT_SONCHO_OFFICERS_DAY,
|
||||
mEv_EVENT_SONCHO_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_SONCHO_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_SALE_DAY,
|
||||
mEv_EVENT_SONCHO_SNOW_DAY,
|
||||
mEv_EVENT_SONCHO_TOY_DAY,
|
||||
mEv_EVENT_PLAYER_BIRTHDAY,
|
||||
|
||||
mEv_EVENT_TALK_NEW_YEARS_COUNTDOWN,
|
||||
mEv_EVENT_HARVEST_FESTIVAL_FRANKLIN,
|
||||
mEv_EVENT_DOZAEMON,
|
||||
mEv_EVENT_KABU_PEDDLER,
|
||||
mEv_EVENT_LOTTERY,
|
||||
mEv_EVENT_KK_SLIDER,
|
||||
|
||||
mEv_EVENT_WEATHER_CLEAR,
|
||||
mEv_EVENT_WEATHER_SNOW,
|
||||
mEv_EVENT_WEATHER_SPORTS_FAIR,
|
||||
mEv_EVENT_HANDBILL_BROKER,
|
||||
mEv_EVENT_HANDBILL_SHOP_SALE,
|
||||
|
||||
mEv_EVENT_BRIDGE_MAKE,
|
||||
mEv_EVENT_SONCHO_BRIDGE_MAKE,
|
||||
mEv_EVENT_ARTIST,
|
||||
mEv_EVENT_BROKER_SALE,
|
||||
mEv_EVENT_DESIGNER,
|
||||
mEv_EVENT_GYPSY,
|
||||
mEv_EVENT_SHOP_SALE,
|
||||
mEv_EVENT_CARPET_PEDDLER,
|
||||
|
||||
mEv_EVENT_GHOST,
|
||||
mEv_EVENT_MASK_NPC, // "Go Home Npc" & "Blanca" events
|
||||
mEv_EVENT_SONCHO_NEW_YEARS_DAY,
|
||||
mEv_EVENT_SONCHO_GROUNDHOG_DAY,
|
||||
mEv_EVENT_SONCHO_SPRING_SPORTS_FAIR,
|
||||
mEv_EVENT_SONCHO_APRILFOOLS_DAY,
|
||||
mEv_EVENT_SONCHO_CHERRY_BLOSSOM_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_NATURE_DAY,
|
||||
mEv_EVENT_SONCHO_SPRING_CLEANING,
|
||||
mEv_EVENT_SONCHO_MOTHERS_DAY,
|
||||
mEv_EVENT_SONCHO_GRADUATION_DAY,
|
||||
mEv_EVENT_SONCHO_FATHERS_DAY,
|
||||
mEv_EVENT_SONCHO_FISHING_TOURNEY_1,
|
||||
mEv_EVENT_SONCHO_TOWN_DAY,
|
||||
mEv_EVENT_SONCHO_FIREWORKS_SHOW,
|
||||
mEv_EVENT_SONCHO_METEOR_SHOWER,
|
||||
mEv_EVENT_SONCHO_FOUNDERS_DAY,
|
||||
mEv_EVENT_SONCHO_LABOR_DAY,
|
||||
mEv_EVENT_SONCHO_FALL_SPORTS_FAIR,
|
||||
mEv_EVENT_SONCHO_HARVEST_MOON_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_EXPLORERS_DAY,
|
||||
mEv_EVENT_SONCHO_HALLOWEEN,
|
||||
mEv_EVENT_SONCHO_MAYORS_DAY,
|
||||
mEv_EVENT_SONCHO_OFFICERS_DAY,
|
||||
mEv_EVENT_SONCHO_FISHING_TOURNEY_2,
|
||||
mEv_EVENT_SONCHO_HARVEST_FESTIVAL,
|
||||
mEv_EVENT_SONCHO_SALE_DAY,
|
||||
mEv_EVENT_SONCHO_SNOW_DAY,
|
||||
mEv_EVENT_SONCHO_TOY_DAY,
|
||||
|
||||
mEv_EVENT_74, // unused?
|
||||
mEv_EVENT_TALK_NEW_YEARS_COUNTDOWN,
|
||||
mEv_EVENT_HARVEST_FESTIVAL_FRANKLIN,
|
||||
|
||||
mEv_EVENT_KOINOBORI,
|
||||
mEv_EVENT_WEATHER_CLEAR,
|
||||
mEv_EVENT_WEATHER_SNOW,
|
||||
mEv_EVENT_WEATHER_SPORTS_FAIR,
|
||||
|
||||
mEv_EVENT_76, // unused?
|
||||
mEv_EVENT_BRIDGE_MAKE,
|
||||
mEv_EVENT_SONCHO_BRIDGE_MAKE,
|
||||
|
||||
mEv_EVENT_NUM
|
||||
mEv_EVENT_GHOST,
|
||||
mEv_EVENT_MASK_NPC, // "Go Home Npc" & "Blanca" events
|
||||
|
||||
mEv_EVENT_74, // unused?
|
||||
|
||||
mEv_EVENT_KOINOBORI,
|
||||
|
||||
mEv_EVENT_76, // unused?
|
||||
|
||||
mEv_EVENT_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mEv_SAVE_DATE_TODAY,
|
||||
mEv_SAVE_DATE_LAST_PLAY_DATE,
|
||||
mEv_SAVE_DATE_BIRTHDAY,
|
||||
mEv_SAVE_DATE_SPECIAL0, /* Initialized to rtc month-day in init_special_event */
|
||||
mEv_SAVE_DATE_SPECIAL1, /* Initialized to beginning month-day of special event in init_special_event */
|
||||
mEv_SAVE_DATE_SPECIAL2, /* Initialized to ending month-day of special event in init_special_event */
|
||||
mEv_SAVE_DATE_WEEKLY,
|
||||
mEv_SAVE_DATE_SPECIAL3, /* Initialized to opening hours for shop sale in init_special_event */
|
||||
mEv_SAVE_DATE_TODAY,
|
||||
mEv_SAVE_DATE_LAST_PLAY_DATE,
|
||||
mEv_SAVE_DATE_BIRTHDAY,
|
||||
mEv_SAVE_DATE_SPECIAL0, /* Initialized to rtc month-day in init_special_event */
|
||||
mEv_SAVE_DATE_SPECIAL1, /* Initialized to beginning month-day of special event in init_special_event */
|
||||
mEv_SAVE_DATE_SPECIAL2, /* Initialized to ending month-day of special event in init_special_event */
|
||||
mEv_SAVE_DATE_WEEKLY,
|
||||
mEv_SAVE_DATE_SPECIAL3, /* Initialized to opening hours for shop sale in init_special_event */
|
||||
|
||||
mEv_SAVE_DATE_NUM
|
||||
mEv_SAVE_DATE_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mEv_SPECIAL_STATE_UNSCHEDULED,
|
||||
mEv_SPECIAL_STATE_SCHEDULED_LATER,
|
||||
mEv_SPECIAL_STATE_SCHEDULED_TODAY,
|
||||
mEv_SPECIAL_STATE_ACTIVE,
|
||||
|
||||
mEv_SPECIAL_STATE_NUM
|
||||
mEv_SPECIAL_STATE_UNSCHEDULED,
|
||||
mEv_SPECIAL_STATE_SCHEDULED_LATER,
|
||||
mEv_SPECIAL_STATE_SCHEDULED_TODAY,
|
||||
mEv_SPECIAL_STATE_ACTIVE,
|
||||
|
||||
mEv_SPECIAL_STATE_NUM
|
||||
};
|
||||
|
||||
#define mEv_STATUS_ACTIVE (1 << 0) /* event is active */
|
||||
#define mEv_STATUS_STOP (1 << 1) /* event is stopped */
|
||||
#define mEv_STATUS_SHOW (1 << 2) /* event is shown */
|
||||
#define mEv_STATUS_PLAYSOUND (1 << 3) /* event should play sound */
|
||||
#define mEv_STATUS_RUN (1 << 4) /* event should run */
|
||||
#define mEv_STATUS_ERROR (1 << 5) /* event is in error state */
|
||||
#define mEv_STATUS_TALK (1 << 6) /* event requires talking to player */
|
||||
#define mEv_STATUS_EXIST (1 << 7) /* event is scheduled */
|
||||
#define mEv_STATUS_ACTIVE (1 << 0) /* event is active */
|
||||
#define mEv_STATUS_STOP (1 << 1) /* event is stopped */
|
||||
#define mEv_STATUS_SHOW (1 << 2) /* event is shown */
|
||||
#define mEv_STATUS_PLAYSOUND (1 << 3) /* event should play sound */
|
||||
#define mEv_STATUS_RUN (1 << 4) /* event should run */
|
||||
#define mEv_STATUS_ERROR (1 << 5) /* event is in error state */
|
||||
#define mEv_STATUS_TALK (1 << 6) /* event requires talking to player */
|
||||
#define mEv_STATUS_EXIST (1 << 7) /* event is scheduled */
|
||||
|
||||
#define mEv_GHOST_HITODAMA_NUM 5
|
||||
typedef struct ghost_spirit_block_data_s {
|
||||
u8 block_x[mEv_GHOST_HITODAMA_NUM];
|
||||
u8 block_z[mEv_GHOST_HITODAMA_NUM];
|
||||
u8 block_x[mEv_GHOST_HITODAMA_NUM];
|
||||
u8 block_z[mEv_GHOST_HITODAMA_NUM];
|
||||
} mEv_gst_hitodama_block_c;
|
||||
|
||||
#define mEv_GHOST_FLAG_ACTIVE 0x4000 // TODO: do these live in the ghost actor itself?
|
||||
#define mEv_GHOST_FLAG_RETURNED_SPIRITS 0x8000
|
||||
typedef struct ghost_common_s {
|
||||
mEv_gst_hitodama_block_c hitodama_block_data;
|
||||
u16 flags;
|
||||
u8 _0C[0x2C - 0x0C];
|
||||
mEv_gst_hitodama_block_c hitodama_block_data;
|
||||
u16 flags;
|
||||
u8 _0C[0x2C - 0x0C];
|
||||
} mEv_gst_common_c;
|
||||
|
||||
typedef struct ghost_event_s {
|
||||
u16 okoruhito_str_no;
|
||||
u16 flags;
|
||||
lbRTC_ymd_c renew_time;
|
||||
u16 okoruhito_str_no;
|
||||
u16 flags;
|
||||
lbRTC_ymd_c renew_time;
|
||||
} mEv_gst_c;
|
||||
|
||||
#define mEv_DESGINER_NUM 3
|
||||
|
||||
typedef struct designer_common_s {
|
||||
int button_presses;
|
||||
int _04;
|
||||
int button_presses;
|
||||
int _04;
|
||||
} mEv_dsg_common_c;
|
||||
|
||||
typedef struct kabu_peddler_event_s {
|
||||
PersonalID_c spoken_pids[TOTAL_PLAYER_NUM];
|
||||
PersonalID_c spoken_pids[TOTAL_PLAYER_NUM];
|
||||
} mEv_kabu_peddler_c;
|
||||
|
||||
typedef struct dozaemon_event_s {
|
||||
u16 flags;
|
||||
u16 flags;
|
||||
} mEv_dozaemon_c;
|
||||
|
||||
typedef union {
|
||||
mEv_kabu_peddler_c kabu_peddler;
|
||||
mEv_dozaemon_c dozaemon;
|
||||
mEv_kabu_peddler_c kabu_peddler;
|
||||
mEv_dozaemon_c dozaemon;
|
||||
} mEv_weekly_u;
|
||||
|
||||
typedef struct bargin_event_s {
|
||||
lbRTC_time_c start_time;
|
||||
lbRTC_time_c end_time;
|
||||
mActor_name_t items[5];
|
||||
int kind;
|
||||
lbRTC_time_c start_time;
|
||||
lbRTC_time_c end_time;
|
||||
mActor_name_t items[5];
|
||||
int kind;
|
||||
} mEv_bargin_c;
|
||||
|
||||
typedef struct designer_event_s {
|
||||
PersonalID_c pids[mEv_DESGINER_NUM];
|
||||
int used;
|
||||
mActor_name_t gifted_cloths[mEv_DESGINER_NUM];
|
||||
PersonalID_c pids[mEv_DESGINER_NUM];
|
||||
int used;
|
||||
mActor_name_t gifted_cloths[mEv_DESGINER_NUM];
|
||||
} mEv_designer_c;
|
||||
|
||||
typedef struct broker_event_s {
|
||||
PersonalID_c pid[2];
|
||||
lbRTC_time_c end_time;
|
||||
int used;
|
||||
mActor_name_t sold_items[2];
|
||||
mActor_name_t items[3];
|
||||
PersonalID_c pid[2];
|
||||
lbRTC_time_c end_time;
|
||||
int used;
|
||||
mActor_name_t sold_items[2];
|
||||
mActor_name_t items[3];
|
||||
} mEv_broker_c;
|
||||
|
||||
typedef struct artist_event_s {
|
||||
PersonalID_c pids[2];
|
||||
int used;
|
||||
mActor_name_t walls[2];
|
||||
PersonalID_c pids[2];
|
||||
int used;
|
||||
mActor_name_t walls[2];
|
||||
} mEv_artist_c;
|
||||
|
||||
typedef struct arabian_event_s {
|
||||
int used;
|
||||
mActor_name_t carpet;
|
||||
int used;
|
||||
mActor_name_t carpet;
|
||||
} mEv_arabian_c;
|
||||
|
||||
typedef struct gypsy_event_s {
|
||||
int _00;
|
||||
int block_z;
|
||||
int block_x;
|
||||
int ut_z;
|
||||
int ut_x;
|
||||
int _00;
|
||||
int block_z;
|
||||
int block_x;
|
||||
int ut_z;
|
||||
int ut_x;
|
||||
} mEv_gypsy_c;
|
||||
|
||||
typedef union {
|
||||
mEv_bargin_c bargin;
|
||||
mEv_designer_c designer;
|
||||
mEv_broker_c broker;
|
||||
mEv_artist_c artist;
|
||||
mEv_arabian_c arabian;
|
||||
mEv_gypsy_c gypsy;
|
||||
mEv_bargin_c bargin;
|
||||
mEv_designer_c designer;
|
||||
mEv_broker_c broker;
|
||||
mEv_artist_c artist;
|
||||
mEv_arabian_c arabian;
|
||||
mEv_gypsy_c gypsy;
|
||||
} mEv_special_u;
|
||||
|
||||
typedef struct special_event_s {
|
||||
lbRTC_time_c scheduled;
|
||||
u32 type;
|
||||
mEv_special_u event;
|
||||
lbRTC_time_c scheduled;
|
||||
u32 type;
|
||||
mEv_special_u event;
|
||||
} mEv_special_c;
|
||||
|
||||
typedef struct save_event_data_s {
|
||||
mEv_special_c special;
|
||||
mEv_weekly_u weekly;
|
||||
u32 flags;
|
||||
mEv_special_c special;
|
||||
mEv_weekly_u weekly;
|
||||
u32 flags;
|
||||
} mEv_event_save_c;
|
||||
|
||||
typedef struct broker_event_common_s {
|
||||
PersonalID_c entered_pid;
|
||||
int hide_npc;
|
||||
PersonalID_c entered_pid;
|
||||
int hide_npc;
|
||||
} mEv_broker_common_c;
|
||||
|
||||
typedef struct santa_event_common_s {
|
||||
u8 present;
|
||||
u8 talk_counter;
|
||||
s8 bx;
|
||||
s8 bz;
|
||||
mActor_name_t last_talk_cloth;
|
||||
u8 present;
|
||||
u8 talk_counter;
|
||||
s8 bx;
|
||||
s8 bz;
|
||||
mActor_name_t last_talk_cloth;
|
||||
} mEv_santa_event_common_c;
|
||||
|
||||
#define mEv_SANTA_CLOTH_NUM_MAX 10 /* How many different shirts can the player trick Jingle with */
|
||||
|
||||
typedef struct santa_event_s {
|
||||
PersonalID_c pid;
|
||||
u8 present_count;
|
||||
mActor_name_t cloth[mEv_SANTA_CLOTH_NUM_MAX];
|
||||
PersonalID_c pid;
|
||||
u8 present_count;
|
||||
mActor_name_t cloth[mEv_SANTA_CLOTH_NUM_MAX];
|
||||
} mEv_santa_event_c;
|
||||
|
||||
typedef union {
|
||||
mEv_broker_common_c broker;
|
||||
mEv_santa_event_common_c santa;
|
||||
mEv_broker_common_c broker;
|
||||
mEv_santa_event_common_c santa;
|
||||
} mEv_event_common_u;
|
||||
|
||||
typedef struct event_s {
|
||||
u8 day;
|
||||
u8 hour;
|
||||
u8 _02;
|
||||
u8 state;
|
||||
u8 month;
|
||||
u8 year;
|
||||
s16 changed_num;
|
||||
int block_z;
|
||||
int block_x;
|
||||
int unused[5];
|
||||
u8 day;
|
||||
u8 hour;
|
||||
u8 _02;
|
||||
u8 state;
|
||||
u8 month;
|
||||
u8 year;
|
||||
s16 changed_num;
|
||||
int block_z;
|
||||
int block_x;
|
||||
int unused[5];
|
||||
} Event_c;
|
||||
|
||||
typedef struct event_info_s {
|
||||
u8 type;
|
||||
u8 id;
|
||||
u16 year;
|
||||
mEv_MonthDay_u start_date;
|
||||
mEv_MonthDay_u end_date;
|
||||
u8 type;
|
||||
u8 id;
|
||||
u16 year;
|
||||
mEv_MonthDay_u start_date;
|
||||
mEv_MonthDay_u end_date;
|
||||
} mEv_info_c;
|
||||
|
||||
typedef struct event_place_data_s {
|
||||
BlockOrUnit_c block;
|
||||
BlockOrUnit_c unit;
|
||||
mActor_name_t actor_name;
|
||||
s16 flag;
|
||||
BlockOrUnit_c block;
|
||||
BlockOrUnit_c unit;
|
||||
mActor_name_t actor_name;
|
||||
s16 flag;
|
||||
} mEv_place_data_c;
|
||||
|
||||
typedef struct event_place_s {
|
||||
mEv_info_c info;
|
||||
mEv_place_data_c data;
|
||||
mEv_info_c info;
|
||||
mEv_place_data_c data;
|
||||
} mEv_place_c;
|
||||
|
||||
typedef struct event_area_s {
|
||||
mEv_info_c info;
|
||||
int data[11];
|
||||
mEv_info_c info;
|
||||
int data[11];
|
||||
} mEv_area_c;
|
||||
|
||||
#define mEv_AREA_NUM 5
|
||||
#define mEv_PLACE_NUM 10
|
||||
|
||||
typedef struct event_common_s {
|
||||
s16 _00;
|
||||
s16 area_use_bitfield;
|
||||
mEv_area_c area[mEv_AREA_NUM];
|
||||
s16 too_short;
|
||||
s16 place_use_bitfield;
|
||||
mEv_place_c place[mEv_PLACE_NUM];
|
||||
s16 fieldday_event_id;
|
||||
s16 fieldday_event_over_status;
|
||||
u32 unused[2];
|
||||
s16 _00;
|
||||
s16 area_use_bitfield;
|
||||
mEv_area_c area[mEv_AREA_NUM];
|
||||
s16 too_short;
|
||||
s16 place_use_bitfield;
|
||||
mEv_place_c place[mEv_PLACE_NUM];
|
||||
s16 fieldday_event_id;
|
||||
s16 fieldday_event_over_status;
|
||||
u32 unused[2];
|
||||
} mEv_common_data_c;
|
||||
|
||||
typedef struct event_save_event_info_s {
|
||||
u8 type;
|
||||
u8 flags;
|
||||
u8 type;
|
||||
u8 flags;
|
||||
} mEv_event_save_info_c;
|
||||
|
||||
typedef struct event_common_save_data {
|
||||
mEv_event_save_info_c special_event;
|
||||
mEv_event_save_info_c weekly_event;
|
||||
u16 dates[mEv_SAVE_DATE_NUM];
|
||||
int area_use_bitfield;
|
||||
mEv_area_c area[mEv_AREA_NUM];
|
||||
int last_date;
|
||||
int delete_event_id;
|
||||
u32 valentines_day_date;
|
||||
u32 white_day_date; /* unused in AC */
|
||||
u16 ghost_day;
|
||||
u16 bridge_day; // last date suspension bridge event was active
|
||||
union {
|
||||
struct {
|
||||
u8 used_all_locations:1; // set to true when tortimer has cycled through all possible bridge locations?
|
||||
u8 locations_used:7; // index of river acre w/ possible bridge location currently at
|
||||
};
|
||||
mEv_event_save_info_c special_event;
|
||||
mEv_event_save_info_c weekly_event;
|
||||
u16 dates[mEv_SAVE_DATE_NUM];
|
||||
int area_use_bitfield;
|
||||
mEv_area_c area[mEv_AREA_NUM];
|
||||
int last_date;
|
||||
int delete_event_id;
|
||||
u32 valentines_day_date;
|
||||
u32 white_day_date; /* unused in AC */
|
||||
u16 ghost_day;
|
||||
u16 bridge_day; // last date suspension bridge event was active
|
||||
union {
|
||||
struct {
|
||||
u8 used_all_locations : 1; // set to true when tortimer has cycled through all possible bridge locations?
|
||||
u8 locations_used : 7; // index of river acre w/ possible bridge location currently at
|
||||
};
|
||||
|
||||
u8 raw;
|
||||
} bridge_flags;
|
||||
u8 ghost_event_type; // 0x72 will spawn wisp, 0x77 won't?
|
||||
u8 soncho_event_type; // checked not equal to 0xFF for summer & fall fishing tournies
|
||||
u8 dozaemon_completed; // used to signal when you've received an item from gulliver
|
||||
u8 raw;
|
||||
} bridge_flags;
|
||||
u8 ghost_event_type; // 0x72 will spawn wisp, 0x77 won't?
|
||||
u8 soncho_event_type; // checked not equal to 0xFF for summer & fall fishing tournies
|
||||
u8 dozaemon_completed; // used to signal when you've received an item from gulliver
|
||||
} mEv_save_common_data_c;
|
||||
|
||||
extern void mEv_clear_status(int event, s16 status);
|
||||
@@ -606,13 +608,20 @@ extern void mEv_SetTitleDemo(int titledemo_no);
|
||||
|
||||
extern int mGH_check_birth2();
|
||||
extern int mMC_check_birth();
|
||||
extern void mGH_animal_return_init();
|
||||
extern void mMC_mask_cat_init();
|
||||
extern void mEv_init_force(Event_c* event);
|
||||
extern void mEv_SetGateway();
|
||||
extern void mEv_UnSetGateway();
|
||||
extern void mGH_check_delete();
|
||||
extern void mMC_check_delete();
|
||||
extern void mEv_special_event_soldout(int type);
|
||||
|
||||
extern void mEv_debug_print4f(gfxprint_t* gfxprint);
|
||||
extern void mEv_sp_debug_print4f(gfxprint_t* gfxprint);
|
||||
|
||||
#define mEv_IsEventActive(event) mEv_check_status(event, mEv_STATUS_ACTIVE)
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,8 +10,10 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
extern int mEvMN_GetJointEventRandomNpc(mActor_name_t* selected_npc_id);
|
||||
extern int mEvNM_CheckJointEvent();
|
||||
extern int mEvNM_CheckJointEvent(u32 id);
|
||||
extern void mEvMN_GetEventNpcName(mActor_name_t* npc_name, int event, int idx, int param_4);
|
||||
extern int mEvMN_GetEventTypeMap(void);
|
||||
extern int mEvMN_GetMapIdx(int event_type);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+22
-21
@@ -15,35 +15,36 @@ extern "C" {
|
||||
#define mFRm_NO_ERROR_NO 7
|
||||
|
||||
enum save_error_type {
|
||||
mFRm_ERROR_BAD_RTC, /* RTC returned abnormal value */
|
||||
mFRm_ERROR_MEMCARD_TRAVELDATA_CONFLICT, /* travel data is on the same memory card as requesting to save town data */
|
||||
mFRm_ERROR_DATA_CORRUPTED, /* save data is corrupt */
|
||||
mFRm_ERROR_MEMCARD_NO_FILES, /* memory card is out of "files" */
|
||||
mFRm_ERROR_MEMCARD_DAMAGED, /* memory card is damaged */
|
||||
mFRm_ERROR_MEMCARD_FORMAT, /* memory card requires formatting (corrupt or different region?) */
|
||||
mFRm_ERROR_MEMCARD_INVALID, /* memory card type "cannot be used with Animal Crossing" */
|
||||
mFRm_ERROR_MEMCARD_NO_SPACE, /* memory card has free files, but not enough free space for save */
|
||||
mFRm_ERROR_NOT_MEMCARD, /* device in card slot is not a memory card */
|
||||
mFRm_ERROR_NO_MEMCARD, /* nothing inserted in either Slot A or Slot B */
|
||||
|
||||
mFRm_ERROR_NUM
|
||||
mFRm_ERROR_BAD_RTC, /* RTC returned abnormal value */
|
||||
mFRm_ERROR_MEMCARD_TRAVELDATA_CONFLICT, /* travel data is on the same memory card as requesting to save town data */
|
||||
mFRm_ERROR_DATA_CORRUPTED, /* save data is corrupt */
|
||||
mFRm_ERROR_MEMCARD_NO_FILES, /* memory card is out of "files" */
|
||||
mFRm_ERROR_MEMCARD_DAMAGED, /* memory card is damaged */
|
||||
mFRm_ERROR_MEMCARD_FORMAT, /* memory card requires formatting (corrupt or different region?) */
|
||||
mFRm_ERROR_MEMCARD_INVALID, /* memory card type "cannot be used with Animal Crossing" */
|
||||
mFRm_ERROR_MEMCARD_NO_SPACE, /* memory card has free files, but not enough free space for save */
|
||||
mFRm_ERROR_NOT_MEMCARD, /* device in card slot is not a memory card */
|
||||
mFRm_ERROR_NO_MEMCARD, /* nothing inserted in either Slot A or Slot B */
|
||||
|
||||
mFRm_ERROR_NUM
|
||||
};
|
||||
|
||||
typedef struct mFRm_chk_s {
|
||||
/* 0x00 */ int version;
|
||||
/* 0x04 */ u32 code;
|
||||
/* 0x08 */ u16 land_id;
|
||||
/* 0x0A */ lbRTC_time_c time;
|
||||
/* 0x12 */ u16 checksum;
|
||||
/* 0x00 */ int version;
|
||||
/* 0x04 */ u32 code;
|
||||
/* 0x08 */ u16 land_id;
|
||||
/* 0x0A */ lbRTC_time_c time;
|
||||
/* 0x12 */ u16 checksum;
|
||||
} mFRm_chk_t;
|
||||
|
||||
typedef struct flashrom_error_info {
|
||||
int err_no;
|
||||
int proc_idx;
|
||||
int err_no;
|
||||
int proc_idx;
|
||||
} mFRm_err_info_c;
|
||||
|
||||
typedef int (save_check_proc)(void);
|
||||
typedef int(save_check_proc)(void);
|
||||
|
||||
extern MATCH_FORCESTRIP void mFRm_PrintErrInfo(gfxprint_t* gfxprint);
|
||||
extern void mFRm_set_msg_idx(int idx);
|
||||
extern int mFRm_get_msg_idx();
|
||||
extern u16 mFRm_ReturnCheckSum(u16* data, int size);
|
||||
@@ -57,7 +58,7 @@ extern void mFRm_PrintSavedDebug(gfxprint_t* gfxprint);
|
||||
extern void mFRm_clear_err_info();
|
||||
extern void mFRm_save_data_check();
|
||||
extern void mFRm_display_errInfo(gfxprint_t* gfxprint);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+54
-51
@@ -19,79 +19,82 @@ extern "C" {
|
||||
#define mHandbill_MAIL_NUM 982
|
||||
|
||||
enum {
|
||||
mHandbill_FREE_STR0,
|
||||
mHandbill_FREE_STR1,
|
||||
mHandbill_FREE_STR2,
|
||||
mHandbill_FREE_STR3,
|
||||
mHandbill_FREE_STR4,
|
||||
mHandbill_FREE_STR5,
|
||||
mHandbill_FREE_STR6,
|
||||
mHandbill_FREE_STR7,
|
||||
mHandbill_FREE_STR8,
|
||||
mHandbill_FREE_STR9,
|
||||
mHandbill_FREE_STR10,
|
||||
mHandbill_FREE_STR11,
|
||||
mHandbill_FREE_STR12,
|
||||
mHandbill_FREE_STR13,
|
||||
mHandbill_FREE_STR14,
|
||||
mHandbill_FREE_STR15,
|
||||
mHandbill_FREE_STR16,
|
||||
mHandbill_FREE_STR17,
|
||||
mHandbill_FREE_STR18,
|
||||
mHandbill_FREE_STR19,
|
||||
mHandbill_FREE_STR0,
|
||||
mHandbill_FREE_STR1,
|
||||
mHandbill_FREE_STR2,
|
||||
mHandbill_FREE_STR3,
|
||||
mHandbill_FREE_STR4,
|
||||
mHandbill_FREE_STR5,
|
||||
mHandbill_FREE_STR6,
|
||||
mHandbill_FREE_STR7,
|
||||
mHandbill_FREE_STR8,
|
||||
mHandbill_FREE_STR9,
|
||||
mHandbill_FREE_STR10,
|
||||
mHandbill_FREE_STR11,
|
||||
mHandbill_FREE_STR12,
|
||||
mHandbill_FREE_STR13,
|
||||
mHandbill_FREE_STR14,
|
||||
mHandbill_FREE_STR15,
|
||||
mHandbill_FREE_STR16,
|
||||
mHandbill_FREE_STR17,
|
||||
mHandbill_FREE_STR18,
|
||||
mHandbill_FREE_STR19,
|
||||
|
||||
mHandbill_FREE_STR_NUM
|
||||
mHandbill_FREE_STR_NUM
|
||||
};
|
||||
|
||||
enum {
|
||||
mHandbill_FILL_NONE,
|
||||
mHandbill_FILL_RETURN,
|
||||
mHandbill_FILL_SPACE,
|
||||
mHandbill_FILL_NONE,
|
||||
mHandbill_FILL_RETURN,
|
||||
mHandbill_FILL_SPACE,
|
||||
|
||||
mHandbill_FILL_NUM
|
||||
mHandbill_FILL_NUM
|
||||
};
|
||||
|
||||
typedef struct handbill_data_s mHandbill_Data_c;
|
||||
|
||||
struct handbill_data_s {
|
||||
u8 free_str[mHandbill_FREE_STR_NUM][mHandbill_FREE_STR_LEN];
|
||||
int free_str_art[mHandbill_FREE_STR_NUM];
|
||||
int force_art;
|
||||
int capital_flag;
|
||||
u8 free_str[mHandbill_FREE_STR_NUM][mHandbill_FREE_STR_LEN];
|
||||
int free_str_art[mHandbill_FREE_STR_NUM];
|
||||
int force_art;
|
||||
int capital_flag;
|
||||
};
|
||||
|
||||
extern void mHandbill_Load_HandbillFromRom(u8* header, int* header_back_pos, u8* footer, u8* body, int handbill_no);
|
||||
extern void mHandbill_Load_HandbillFromRom2(u8* header, int header_size, int* header_back_pos, u8* footer, int footer_size, u8* body, int handbill_no);
|
||||
extern void mHandbill_Set_free_str(int free_str_no, u8* str, int str_len);
|
||||
extern void mHandbill_Set_free_str_art(int free_str_no, u8* str, int str_len, int article_no);
|
||||
extern void mHandbill_aram_init();
|
||||
extern void mHandbill_Set_free_str(int str_num, u8* str, int str_len);
|
||||
extern void mHandbill_Set_free_str_art(int str_num, u8* str, int str_len, int article);
|
||||
extern int mHandbill_MoveDataCut(u8* data, int buf_size, int dst_idx, int src_idx, int data_len, int fill_type);
|
||||
extern void mHandbill_Load_HandbillFromRom(u8* header, int* header_back_start, u8* footer, u8* body, int mail_no);
|
||||
extern void mHandbill_Load_HandbillFromRom2(u8* header, int header_size, int* header_back_start, u8* footer,
|
||||
int footer_size, u8* body, int mail_no);
|
||||
|
||||
enum {
|
||||
mHandbillz_TYPE_SUPER,
|
||||
mHandbillz_TYPE_MAILA,
|
||||
mHandbillz_TYPE_MAILB,
|
||||
mHandbillz_TYPE_MAILC,
|
||||
mHandbillz_TYPE_PS,
|
||||
mHandbillz_TYPE_SUPER,
|
||||
mHandbillz_TYPE_MAILA,
|
||||
mHandbillz_TYPE_MAILB,
|
||||
mHandbillz_TYPE_MAILC,
|
||||
mHandbillz_TYPE_PS,
|
||||
|
||||
mHandbillz_TYPE_NUM
|
||||
mHandbillz_TYPE_NUM
|
||||
};
|
||||
|
||||
typedef struct mHandbillz_info_s {
|
||||
u8* super_buf_p;
|
||||
size_t super_buf_size;
|
||||
u8* super_buf_p;
|
||||
size_t super_buf_size;
|
||||
|
||||
u8* mail_buf_p;
|
||||
size_t mail_buf_size;
|
||||
u8* mail_buf_p;
|
||||
size_t mail_buf_size;
|
||||
|
||||
u8* ps_buf_p;
|
||||
size_t ps_buf_size;
|
||||
u8* ps_buf_p;
|
||||
size_t ps_buf_size;
|
||||
|
||||
int super_no;
|
||||
int maila_no;
|
||||
int mailb_no;
|
||||
int mailc_no;
|
||||
int ps_no;
|
||||
int super_no;
|
||||
int maila_no;
|
||||
int mailb_no;
|
||||
int mailc_no;
|
||||
int ps_no;
|
||||
|
||||
int header_back_start;
|
||||
int header_back_start;
|
||||
} mHandbillz_Info_c;
|
||||
|
||||
extern int mHandbillz_load(mHandbillz_Info_c* info);
|
||||
|
||||
@@ -14,14 +14,17 @@ typedef void (*mHP_SET_HANIWAPORTRAIT_PROC)(Submenu*, mSM_MenuInfo_c*, GRAPH*, G
|
||||
typedef void (*mHP_HANIWAPORTRAIT_SHAPE_MOVE_PROC)(Submenu*);
|
||||
|
||||
struct haniwaPortrait_ovl_s {
|
||||
cKF_SkeletonInfo_R_c keyframe;
|
||||
s_xyz keyframe_work[8];
|
||||
s_xyz keyframe_morph[8];
|
||||
u8 _0D0[72];
|
||||
mHP_SET_HANIWAPORTRAIT_PROC set_haniwaPortrait_proc;
|
||||
mHP_HANIWAPORTRAIT_SHAPE_MOVE_PROC haniwaPortrait_shape_move_proc;
|
||||
cKF_SkeletonInfo_R_c keyframe;
|
||||
s_xyz keyframe_work[8];
|
||||
s_xyz keyframe_morph[8];
|
||||
u8 _0D0[72];
|
||||
mHP_SET_HANIWAPORTRAIT_PROC set_haniwaPortrait_proc;
|
||||
mHP_HANIWAPORTRAIT_SHAPE_MOVE_PROC haniwaPortrait_shape_move_proc;
|
||||
};
|
||||
|
||||
extern void mHP_haniwaPortrait_ovl_construct(Submenu* submenu);
|
||||
extern void mHP_haniwaPortrait_ovl_destruct(Submenu* submenu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -40,6 +40,7 @@ extern "C" {
|
||||
|
||||
/* short angle -> radians */
|
||||
#define SHORT2RAD_ANGLE(s) ((((f32)(s)) / (65536.0f / (2.0f * F_PI))))
|
||||
#define SHORT2RAD_ANGLE2(s) ((f32)(s) * ((2.0f * F_PI) / 65536.0f))
|
||||
#define SHORTANGLE2RAD(sangle) ((F_PI / 32768.0f) * ((f32)(sangle)))
|
||||
|
||||
/* degrees -> short angle */
|
||||
|
||||
@@ -555,6 +555,7 @@ extern int mNT_check_unknown(mActor_name_t item_no);
|
||||
|
||||
#define FTR0_START 0x1000
|
||||
#define FTR_CLASSIC_WARDROBE 0x1004
|
||||
#define FTR_FAN 0x1088
|
||||
#define FTR_PAPA_BEAR 0x10E8
|
||||
#define FTR_PAPA_BEAR_EAST 0x10E9
|
||||
#define FTR_PAPA_BEAR_NORTH 0x10EA
|
||||
|
||||
@@ -60,6 +60,9 @@ extern int mPlib_check_player_actor_main_index_RecieveMove(GAME* game);
|
||||
extern int mPlib_check_label_player_demo_wait(GAME* game, void* label);
|
||||
extern int mPlib_check_player_outdoor_start(GAME* game);
|
||||
extern void mPlib_Set_change_color_request();
|
||||
extern int mPlib_check_player_open_umbrella(GAME_PLAY* play);
|
||||
extern int mPlib_Check_UKI_COMEBACK_STATUS();
|
||||
extern int mPlib_check_player_actor_main_index_OutDoorMove(GAME_PLAY* play);
|
||||
|
||||
extern mPlayer_change_data_from_submenu_c* mPlib_Get_change_data_from_submenu_p();
|
||||
|
||||
@@ -67,6 +70,7 @@ extern void mPlib_Object_Exchange_keep_new_PlayerMdl(GAME_PLAY* play);
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerTex(GAME_PLAY* play, int bank_id, int base_idx);
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerFaceTex(GAME_PLAY* play);
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerFacePallet(GAME_PLAY* play, int bank_id, int base_idx);
|
||||
extern void mPlib_Object_Exchange_keep_new_PlayerPallet(GAME_PLAY* play, int bank_id, int base_idx);
|
||||
extern void mPlib_request_main_give_type1(GAME* game, mActor_name_t item, int mode, int present, int on_surface);
|
||||
|
||||
#define GET_PLAYER_ACTOR(play) get_player_actor_withoutCheck(play)
|
||||
|
||||
+9
-5
@@ -30,15 +30,19 @@ extern Gfx* gfx_softsprite_prim_xlu(Gfx* gfx);
|
||||
extern Gfx* gfx_tex_scroll2(Gfx** gfxpp, int x, int y, int width, int height);
|
||||
extern Gfx* tex_scroll2(GRAPH* graph, u32 x, u32 y, int width, int height);
|
||||
extern Gfx* tex_scroll2_dolphin(GRAPH* graph, int x, int y, int width, int height);
|
||||
extern Gfx* two_tex_scroll(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2, int width2, int height2);
|
||||
extern Gfx* two_tex_scroll_dolphin(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2, int width2, int height2);
|
||||
extern void DisplayList_initialize(GRAPH* graph, u32 clear_r, u32 clear_g, u32 clear_b, GAME* game);
|
||||
extern Gfx* two_tex_scroll(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2,
|
||||
int width2, int height2);
|
||||
extern Gfx* two_tex_scroll_dolphin(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2,
|
||||
int y2, int width2, int height2);
|
||||
extern void DisplayList_initialize(GRAPH* graph, u8 clear_r, u8 clear_g, u8 clear_b, GAME* game);
|
||||
extern void fade_rgba8888_draw(Gfx** gfxp, u32 color);
|
||||
extern void fade_black_draw(Gfx** gfx, u32 color);
|
||||
extern Gfx* gfx_gDPFillRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
|
||||
extern Gfx* gfx_gDPFillRectangleF(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry);
|
||||
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx, int dtdy);
|
||||
extern Gfx* gfx_gSPScisTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx, int dtdy);
|
||||
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx,
|
||||
int dtdy);
|
||||
extern Gfx* gfx_gSPScisTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx,
|
||||
int dtdy);
|
||||
|
||||
extern Gfx RSP_RDP_clear_data[];
|
||||
extern int fbdemo_mode;
|
||||
|
||||
+18
-14
@@ -10,26 +10,30 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
mRP_CURSOR_100000,
|
||||
mRP_CURSOR_10000,
|
||||
mRP_CURSOR_1000,
|
||||
mRP_CURSOR_100,
|
||||
mRP_CURSOR_10,
|
||||
mRP_CURSOR_1,
|
||||
mRP_CURSOR_OK,
|
||||
mRP_CURSOR_100000,
|
||||
mRP_CURSOR_10000,
|
||||
mRP_CURSOR_1000,
|
||||
mRP_CURSOR_100,
|
||||
mRP_CURSOR_10,
|
||||
mRP_CURSOR_1,
|
||||
mRP_CURSOR_OK,
|
||||
|
||||
mRP_CURSOR_NUM
|
||||
mRP_CURSOR_NUM
|
||||
};
|
||||
|
||||
struct repay_ovl_s {
|
||||
u32 money;
|
||||
u32 loan;
|
||||
u32 repay_amount;
|
||||
u32 max_money;
|
||||
u32 max_repay;
|
||||
int cursor_idx;
|
||||
u32 money;
|
||||
u32 loan;
|
||||
u32 repay_amount;
|
||||
u32 max_money;
|
||||
u32 max_repay;
|
||||
int cursor_idx;
|
||||
};
|
||||
|
||||
extern void mRP_repay_ovl_set_proc(Submenu* submenu);
|
||||
extern void mRP_repay_ovl_construct(Submenu* submenu);
|
||||
extern void mRP_repay_ovl_destruct(Submenu* submenu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+20
-16
@@ -13,32 +13,36 @@ extern "C" {
|
||||
#define mTI_MAX_YEAR 30
|
||||
|
||||
enum {
|
||||
mTI_IDX_HOUR,
|
||||
mTI_IDX_MIN,
|
||||
mTI_IDX_MONTH,
|
||||
mTI_IDX_DAY,
|
||||
mTI_IDX_YEAR,
|
||||
mTI_IDX_OK,
|
||||
mTI_IDX_HOUR,
|
||||
mTI_IDX_MIN,
|
||||
mTI_IDX_MONTH,
|
||||
mTI_IDX_DAY,
|
||||
mTI_IDX_YEAR,
|
||||
mTI_IDX_OK,
|
||||
|
||||
mTI_IDX_NUM = mTI_IDX_OK
|
||||
mTI_IDX_NUM = mTI_IDX_OK
|
||||
};
|
||||
|
||||
enum {
|
||||
mTI_OVL_OPEN_NORMAL,
|
||||
mTI_OVL_OPEN_INITIAL,
|
||||
mTI_OVL_OPEN_NORMAL,
|
||||
mTI_OVL_OPEN_INITIAL,
|
||||
|
||||
mTI_OVL_OPEN_NUM
|
||||
mTI_OVL_OPEN_NUM
|
||||
};
|
||||
|
||||
struct timeIn_ovl_s {
|
||||
u16 values[mTI_IDX_NUM];
|
||||
int sel_idx;
|
||||
u16 saved_min;
|
||||
u16 input_disabled_flag;
|
||||
lbRTC_time_c original_time;
|
||||
int init_flag;
|
||||
u16 values[mTI_IDX_NUM];
|
||||
int sel_idx;
|
||||
u16 saved_min;
|
||||
u16 input_disabled_flag;
|
||||
lbRTC_time_c original_time;
|
||||
int init_flag;
|
||||
};
|
||||
|
||||
extern void mTI_timeIn_ovl_set_proc(Submenu* submenu);
|
||||
extern void mTI_timeIn_ovl_construct(Submenu* submenu);
|
||||
extern void mTI_timeIn_ovl_destruct(Submenu* submenu);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
+50
-44
@@ -12,77 +12,83 @@ extern "C" {
|
||||
#define mVibctl_FLAG_FORCE_STOP1 (1 << 1) // 2
|
||||
#define mVibctl_FLAG_FORCE_STOP2 (1 << 2) // 4
|
||||
#define mVibctl_FLAG_FORCE_STOP3 (1 << 3) // 8
|
||||
#define mVibctl_FLAG_FORCE_STOP_ALL (mVibctl_FLAG_FORCE_STOP0 | mVibctl_FLAG_FORCE_STOP1 | mVibctl_FLAG_FORCE_STOP2 | mVibctl_FLAG_FORCE_STOP3) // 15
|
||||
#define mVibctl_FLAG_FORCE_STOP_ALL \
|
||||
(mVibctl_FLAG_FORCE_STOP0 | mVibctl_FLAG_FORCE_STOP1 | mVibctl_FLAG_FORCE_STOP2 | mVibctl_FLAG_FORCE_STOP3) // 15
|
||||
|
||||
enum {
|
||||
mVibctl_ELEM_ENTRY_ATTACK, // fade-in program
|
||||
mVibctl_ELEM_ENTRY_SUSTAIN, // sustain program
|
||||
mVibctl_ELEM_ENTRY_RELEASE, // fade-out program
|
||||
mVibctl_ELEM_ENTRY_END, // program has finished
|
||||
mVibctl_ELEM_ENTRY_ATTACK, // fade-in program
|
||||
mVibctl_ELEM_ENTRY_SUSTAIN, // sustain program
|
||||
mVibctl_ELEM_ENTRY_RELEASE, // fade-out program
|
||||
mVibctl_ELEM_ENTRY_END, // program has finished
|
||||
|
||||
mVibctl_ELEM_ENTRY_NUM = mVibctl_ELEM_ENTRY_END
|
||||
mVibctl_ELEM_ENTRY_NUM = mVibctl_ELEM_ENTRY_END
|
||||
};
|
||||
|
||||
enum {
|
||||
mVibctl_VIB_PROG_NON, // rumble config attack, shake tree attack
|
||||
mVibctl_VIB_PROG_FFF, // fish touch bobber, fishing rod cast, rumble config sustain, Mouth of Truth furniture interaction attack & sustain, shovel hits soft object, net swing, axe cut attack & release, trip attack, pick weed sustain & release
|
||||
mVibctl_VIB_PROG_F, // unused?
|
||||
mVibctl_VIB_PROG_MF, // unused?
|
||||
mVibctl_VIB_PROG_MP, // unused?
|
||||
mVibctl_VIB_PROG_P, // rumble config release, shake tree release
|
||||
mVibctl_VIB_PROG_FUNBARI, // unused?
|
||||
mVibctl_VIB_PROG_ANAHORI, // digging with shovel
|
||||
mVibctl_VIB_PROG_ANAUME, // filling hole with shovel
|
||||
mVibctl_VIB_PROG_IMPACT, // fish bite bobber, shovel hits hard object
|
||||
mVibctl_VIB_PROG_KI_GA_TAORERU, // axe cut sustain
|
||||
mVibctl_VIB_PROG_KI_WO_YUSURU, // shake tree sustain
|
||||
mVibctl_VIB_PROG_KORONODA, // trip sustain
|
||||
mVibctl_VIB_PROG_SURPRISE, // Mouth of Truth furniture interaction release
|
||||
mVibctl_VIB_PROG_DUMMY_B, // unused?
|
||||
mVibctl_VIB_PROG_SAMPLE, // unused?
|
||||
mVibctl_VIB_PROG_NON, // rumble config attack, shake tree attack
|
||||
mVibctl_VIB_PROG_FFF, // fish touch bobber, fishing rod cast, rumble config sustain, Mouth of Truth furniture
|
||||
// interaction attack & sustain, shovel hits soft object, net swing, axe cut attack & release,
|
||||
// trip attack, pick weed sustain & release
|
||||
mVibctl_VIB_PROG_F, // unused?
|
||||
mVibctl_VIB_PROG_MF, // unused?
|
||||
mVibctl_VIB_PROG_MP, // unused?
|
||||
mVibctl_VIB_PROG_P, // rumble config release, shake tree release
|
||||
mVibctl_VIB_PROG_FUNBARI, // unused?
|
||||
mVibctl_VIB_PROG_ANAHORI, // digging with shovel
|
||||
mVibctl_VIB_PROG_ANAUME, // filling hole with shovel
|
||||
mVibctl_VIB_PROG_IMPACT, // fish bite bobber, shovel hits hard object
|
||||
mVibctl_VIB_PROG_KI_GA_TAORERU, // axe cut sustain
|
||||
mVibctl_VIB_PROG_KI_WO_YUSURU, // shake tree sustain
|
||||
mVibctl_VIB_PROG_KORONODA, // trip sustain
|
||||
mVibctl_VIB_PROG_SURPRISE, // Mouth of Truth furniture interaction release
|
||||
mVibctl_VIB_PROG_DUMMY_B, // unused?
|
||||
mVibctl_VIB_PROG_SAMPLE, // unused?
|
||||
|
||||
mVibctl_VIB_PROG_NUM
|
||||
mVibctl_VIB_PROG_NUM
|
||||
};
|
||||
|
||||
#define mVibctl_ELEM_NUM 4
|
||||
|
||||
typedef struct vibration_element_entry_s {
|
||||
int type;
|
||||
int frames;
|
||||
f32 step;
|
||||
int type;
|
||||
int frames;
|
||||
f32 step;
|
||||
} mVibInfo_elem_entry_c;
|
||||
|
||||
typedef struct vibration_element_s {
|
||||
mVibInfo_elem_entry_c entries[mVibctl_ELEM_ENTRY_NUM];
|
||||
f32 step0;
|
||||
f32 step1;
|
||||
int now_entry;
|
||||
int state_idx;
|
||||
f32 frame_intensity;
|
||||
int entry_frame;
|
||||
f32 now_intensity;
|
||||
int command; // for padmgr, PAD_MOTOR_*
|
||||
mVibInfo_elem_entry_c entries[mVibctl_ELEM_ENTRY_NUM];
|
||||
f32 step0;
|
||||
f32 step1;
|
||||
int now_entry;
|
||||
int state_idx;
|
||||
f32 frame_intensity;
|
||||
int entry_frame;
|
||||
f32 now_intensity;
|
||||
int command; // for padmgr, PAD_MOTOR_*
|
||||
} mVibElem_c;
|
||||
|
||||
typedef struct vibration_info_s {
|
||||
mVibElem_c* target_elem;
|
||||
mVibElem_c elements[mVibctl_ELEM_NUM];
|
||||
int num_elements;
|
||||
int force_stop;
|
||||
int last_force_stop;
|
||||
mVibElem_c* target_elem;
|
||||
mVibElem_c elements[mVibctl_ELEM_NUM];
|
||||
int num_elements;
|
||||
int force_stop;
|
||||
int last_force_stop;
|
||||
} mVibInfo_c;
|
||||
|
||||
typedef struct vibration_work_data_S {
|
||||
const u8* data;
|
||||
int count;
|
||||
const u8* data;
|
||||
int count;
|
||||
} mVibWorkData_c;
|
||||
|
||||
extern void mVibctl_ct();
|
||||
extern void mVibctl_init0();
|
||||
extern void mVibctl_init();
|
||||
extern void mVibctl_cleanup();
|
||||
extern void mVibctl_reset();
|
||||
extern void mVibctl_entry(int total_frames, int attack_type, int sustain_type, int release_type, int attack_frames, int sustain_frames, int release_frames, f32 step);
|
||||
extern void mVibctl_simple_entry(int total_frames, int type, int attack_frames, int sustain_frames, int release_frames, f32 step);
|
||||
extern void mVibctl_entry(int total_frames, int attack_type, int sustain_type, int release_type, int attack_frames,
|
||||
int sustain_frames, int release_frames, f32 step);
|
||||
extern void mVibctl_simple_entry(int total_frames, int type, int attack_frames, int sustain_frames, int release_frames,
|
||||
f32 step);
|
||||
extern void mVibctl_set_force_stop(int force_stop);
|
||||
extern void mVibctl_clr_force_stop(int force_stop);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ extern OSThread graphThread;
|
||||
extern u8 SegmentBaseAddress[0x40];
|
||||
|
||||
void foresta_main();
|
||||
extern void mainproc(void* val);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+63
-61
@@ -14,52 +14,52 @@ extern "C" {
|
||||
#define PADMSGBUFCNT 8
|
||||
|
||||
enum pads {
|
||||
PAD0,
|
||||
PAD1,
|
||||
PAD2,
|
||||
PAD3,
|
||||
PAD0,
|
||||
PAD1,
|
||||
PAD2,
|
||||
PAD3,
|
||||
|
||||
PAD_NUM
|
||||
PAD_NUM
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
u8 last_command; // PAD_MOTOR_*
|
||||
u8 now_command; // PAD_MOTOR_*
|
||||
u8 frames;
|
||||
u8 _pad;
|
||||
u8 last_command; // PAD_MOTOR_*
|
||||
u8 now_command; // PAD_MOTOR_*
|
||||
u8 frames;
|
||||
u8 _pad;
|
||||
} Motor_t;
|
||||
|
||||
typedef struct {
|
||||
Motor_t motors[MAXCONTROLLERS];
|
||||
s16 cooldown_frames;
|
||||
u8 rumble_frames;
|
||||
u8 _pad0;
|
||||
u8 reset;
|
||||
Motor_t motors[MAXCONTROLLERS];
|
||||
s16 cooldown_frames;
|
||||
u8 rumble_frames;
|
||||
u8 _pad0;
|
||||
u8 reset;
|
||||
} Rumble_t;
|
||||
|
||||
typedef struct {
|
||||
/* 0x0000 */ u8 pad_pattern;
|
||||
/* 0x0004 */ void (*callback)(void*);
|
||||
/* 0x0008 */ void* callback_param;
|
||||
/* 0x000C */ void (*callback2)(void*);
|
||||
/* 0x0010 */ void* callback2_param;
|
||||
/* 0x0000 */ u8 pad_pattern;
|
||||
/* 0x0004 */ void (*callback)(void*);
|
||||
/* 0x0008 */ void* callback_param;
|
||||
/* 0x000C */ void (*callback2)(void*);
|
||||
/* 0x0010 */ void* callback2_param;
|
||||
|
||||
/* 0x0014 */ OSContStatus pad_status[MAXCONTROLLERS];
|
||||
/* 0x0024 */ OSMessage _msg24;
|
||||
/* 0x0028 */ OSMessage _msg28;
|
||||
/* 0x002C */ OSMessage _msgBuf2C[PADMSGBUFCNT];
|
||||
/* 0x004C */ OSMessageQueue _msgQueue4C;
|
||||
/* 0x006C */ OSMessageQueue _msgQueue6C;
|
||||
/* 0x008C */ OSMessageQueue _msgQueue8C;
|
||||
/* 0x00AC */ irqmgr_client_t irqclient;
|
||||
/* 0x00B4 */ u32 _unk0; /* maybe additional value in irqmgr_client_t? */
|
||||
/* 0x00B8 */ OSThread thread;
|
||||
/* 0x03C8 */ u8 _tmp[0x60]; //pad_t pads[MAXCONTROLLERS]; // TODO: figure out what's going on here.
|
||||
/* 0x0428 */ OSContPad n64_pads[MAXCONTROLLERS]; /* Converted from PADStatus via JUTGamePad */
|
||||
/* 0x0440 */ u8 num_controllers;
|
||||
/* 0x0441 */ u8 device_type[4];
|
||||
/* 0x0445 */ u8 pak_type[4];
|
||||
/* 0x044A */ Rumble_t rumble;
|
||||
/* 0x0014 */ OSContStatus pad_status[MAXCONTROLLERS];
|
||||
/* 0x0024 */ OSMessage _msg24;
|
||||
/* 0x0028 */ OSMessage _msg28;
|
||||
/* 0x002C */ OSMessage _msgBuf2C[PADMSGBUFCNT];
|
||||
/* 0x004C */ OSMessageQueue _msgQueue4C;
|
||||
/* 0x006C */ OSMessageQueue _msgQueue6C;
|
||||
/* 0x008C */ OSMessageQueue _msgQueue8C;
|
||||
/* 0x00AC */ irqmgr_client_t irqclient;
|
||||
/* 0x00B4 */ u32 _unk0; /* maybe additional value in irqmgr_client_t? */
|
||||
/* 0x00B8 */ OSThread thread;
|
||||
/* 0x03C8 */ u8 _tmp[0x60]; // pad_t pads[MAXCONTROLLERS]; // TODO: figure out what's going on here.
|
||||
/* 0x0428 */ OSContPad n64_pads[MAXCONTROLLERS]; /* Converted from PADStatus via JUTGamePad */
|
||||
/* 0x0440 */ u8 num_controllers;
|
||||
/* 0x0441 */ u8 device_type[4];
|
||||
/* 0x0445 */ u8 pak_type[4];
|
||||
/* 0x044A */ Rumble_t rumble;
|
||||
} padmgr;
|
||||
|
||||
extern padmgr padmgr_class;
|
||||
@@ -70,38 +70,40 @@ extern void padmgr_force_stop_OFF();
|
||||
extern void padmgr_RumbleSet(int pad, int intensity);
|
||||
extern void padmgr_Create(OSMessageQueue* queue, OSId id, OSPri priority, void* stack, size_t stackSize);
|
||||
extern void padmgr_Init(OSMessageQueue* queue);
|
||||
extern void padmgr_RequestPadData(pad_t* pad, int count);
|
||||
extern void padmgr_ClearPadData(pad_t* pad);
|
||||
|
||||
#define padmgr_setClient(callback_proc, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
mgr->callback = callback_proc; \
|
||||
mgr->callback_param = param; \
|
||||
} while (0)
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
mgr->callback = callback_proc; \
|
||||
mgr->callback_param = param; \
|
||||
} while (0)
|
||||
|
||||
#define padmgr_removeClient(callback_proc, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
if (mgr->callback == (callback_proc) && mgr->callback_param == (param)) { \
|
||||
mgr->callback = NULL; \
|
||||
mgr->callback_param = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
#define padmgr_removeClient(callback_proc, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
if (mgr->callback == (callback_proc) && mgr->callback_param == (param)) { \
|
||||
mgr->callback = NULL; \
|
||||
mgr->callback_param = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define padmgr_setClient2(callback, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
mgr->callback2 = callback; \
|
||||
mgr->callback2_param = param; \
|
||||
} while (0)
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
mgr->callback2 = callback; \
|
||||
mgr->callback2_param = param; \
|
||||
} while (0)
|
||||
|
||||
#define padmgr_removeClient2(callback, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
if (mgr->callback2 == (callback) && mgr->callback2_param == (param)) { \
|
||||
mgr->callback2 = NULL; \
|
||||
mgr->callback2_param = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
#define padmgr_removeClient2(callback, param) \
|
||||
do { \
|
||||
padmgr* mgr = &padmgr_class; \
|
||||
if (mgr->callback2 == (callback) && mgr->callback2_param == (param)) { \
|
||||
mgr->callback2 = NULL; \
|
||||
mgr->callback2_param = NULL; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+17
-16
@@ -10,35 +10,36 @@ extern "C" {
|
||||
#endif
|
||||
|
||||
enum save_mode {
|
||||
SAVE_MODE_BEGIN,
|
||||
SAVE_MODE_BEGIN,
|
||||
|
||||
SAVE_MODE_FLASHROM = SAVE_MODE_BEGIN,
|
||||
SAVE_MODE_CPAK,
|
||||
SAVE_MODE_FLASHROM = SAVE_MODE_BEGIN,
|
||||
SAVE_MODE_CPAK,
|
||||
|
||||
SAVE_MODE_NUM
|
||||
SAVE_MODE_NUM
|
||||
};
|
||||
|
||||
enum save_error {
|
||||
SAVE_ERROR_NONE,
|
||||
SAVE_ERROR_FLASHROM,
|
||||
SAVE_ERROR_CPAK,
|
||||
SAVE_ERROR_EXIT,
|
||||
SAVE_ERROR_NONE,
|
||||
SAVE_ERROR_FLASHROM,
|
||||
SAVE_ERROR_CPAK,
|
||||
SAVE_ERROR_EXIT,
|
||||
|
||||
SAVE_ERROR_NUM
|
||||
SAVE_ERROR_NUM
|
||||
};
|
||||
|
||||
/* sizeof(struct game_save_menu_s) == 0x0228 */
|
||||
typedef struct game_save_menu_s {
|
||||
/* 0x0000 */ GAME game;
|
||||
/* 0x00E0 */ View view;
|
||||
/* 0x0200 */ u32 frame;
|
||||
/* 0x0204 */ int mode;
|
||||
/* 0x0208 */ int error;
|
||||
/* 0x020C */ int cursor_col[SAVE_MODE_NUM][3];
|
||||
/* 0x0000 */ GAME game;
|
||||
/* 0x00E0 */ View view;
|
||||
/* 0x0200 */ u32 frame;
|
||||
/* 0x0204 */ int mode;
|
||||
/* 0x0208 */ int error;
|
||||
/* 0x020C */ int cursor_col[SAVE_MODE_NUM][3];
|
||||
} GAME_SAVE_MENU;
|
||||
|
||||
extern void save_menu_init(GAME* game);
|
||||
extern void save_menu_draw_main(GAME_SAVE_MENU* save_menu);
|
||||
extern void save_menu_cleanup(GAME* game);
|
||||
extern void save_menu_init(GAME* game);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
+240
-252
@@ -11,252 +11,255 @@
|
||||
#include "m_name_table.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_actor_shadow.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void Airplane_Actor_ct(ACTOR* actor, GAME* game);
|
||||
static void Airplane_Actor_dt(ACTOR* actor, GAME* game);
|
||||
static void Airplane_Actor_move(ACTOR* actor, GAME* game);
|
||||
static void Airplane_Actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
/* TODO: ct, dt, & draw go in this TU, while all others go in a separate TU. Probably something like ac_airplane_move.c_inc */
|
||||
/* TODO: ct, dt, & draw go in this TU, while all others go in a separate TU. Probably something like
|
||||
* ac_airplane_move.c_inc */
|
||||
|
||||
ACTOR_PROFILE Airplane_Profile = {
|
||||
mAc_PROFILE_AIRPLANE,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
|
||||
ETC_AIRPLANE,
|
||||
ACTOR_OBJ_BANK_AIRPLANE,
|
||||
sizeof(AIRPLANE_ACTOR),
|
||||
&Airplane_Actor_ct,
|
||||
&Airplane_Actor_dt,
|
||||
&Airplane_Actor_move,
|
||||
&Airplane_Actor_draw,
|
||||
NULL
|
||||
mAc_PROFILE_AIRPLANE,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED,
|
||||
ETC_AIRPLANE,
|
||||
ACTOR_OBJ_BANK_AIRPLANE,
|
||||
sizeof(AIRPLANE_ACTOR),
|
||||
&Airplane_Actor_ct,
|
||||
&Airplane_Actor_dt,
|
||||
&Airplane_Actor_move,
|
||||
&Airplane_Actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void Airplane_Actor_ct(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
|
||||
Shape_Info_init(actor, 0.0f, &mAc_ActorShadowEllipse, 6.5f, 6.5f);
|
||||
airplane->status = 5;
|
||||
|
||||
airplane->speed = 6.2f;
|
||||
airplane->y_speed = 0.0f;
|
||||
airplane->actor_class.speed = airplane->speed;
|
||||
|
||||
airplane->rotY = RAD2DEG(SHORTANGLE2RAD((f32)actor->world.angle.y));
|
||||
airplane->rotY_goal = airplane->rotY;
|
||||
airplane->rotY_min = airplane->rotY;
|
||||
airplane->rotZ = 0.0f;
|
||||
airplane->rotX = 0.0f;
|
||||
Shape_Info_init(actor, 0.0f, &mAc_ActorShadowEllipse, 6.5f, 6.5f);
|
||||
airplane->status = 5;
|
||||
|
||||
airplane->ground_timer = 0;
|
||||
airplane->wind_frame = 0;
|
||||
airplane->wind_change_frame = 0;
|
||||
airplane->wind = NULL;
|
||||
airplane->speed = 6.2f;
|
||||
airplane->y_speed = 0.0f;
|
||||
airplane->actor_class.speed = airplane->speed;
|
||||
|
||||
actor->world.position.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, actor->world.position, -5.5f);
|
||||
airplane->rotY = RAD2DEG(SHORTANGLE2RAD((f32)actor->world.angle.y));
|
||||
airplane->rotY_goal = airplane->rotY;
|
||||
airplane->rotY_min = airplane->rotY;
|
||||
airplane->rotZ = 0.0f;
|
||||
airplane->rotX = 0.0f;
|
||||
|
||||
airplane->ground_timer = 0;
|
||||
airplane->wind_frame = 0;
|
||||
airplane->wind_change_frame = 0;
|
||||
airplane->wind = NULL;
|
||||
|
||||
actor->world.position.y = mCoBG_GetBgY_AngleS_FromWpos(NULL, actor->world.position, -5.5f);
|
||||
}
|
||||
|
||||
static void Airplane_Actor_dt(ACTOR* actor, GAME* game) { }
|
||||
static void Airplane_Actor_dt(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
extern Gfx glider_model[];
|
||||
|
||||
static void Airplane_Actor_draw(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
|
||||
if (airplane->status != aAp_STATUS_PLAYER_CATCH && airplane->status != aAp_STATUS_START_FLY_MOVE) {
|
||||
GRAPH* g = game->graph;
|
||||
if (airplane->status != aAp_STATUS_PLAYER_CATCH && airplane->status != aAp_STATUS_START_FLY_MOVE) {
|
||||
GRAPH* g = game->graph;
|
||||
|
||||
_texture_z_light_fog_prim(g);
|
||||
Matrix_RotateX(RAD2SHORTANGLE(DEG2RAD(airplane->rotX)), 1);
|
||||
Matrix_RotateZ(RAD2SHORTANGLE(DEG2RAD(airplane->rotZ)), 1);
|
||||
Matrix_scale(50.0f, 50.0f, 50.0f, 1);
|
||||
_texture_z_light_fog_prim(g);
|
||||
Matrix_RotateX(RAD2SHORTANGLE(DEG2RAD(airplane->rotX)), 1);
|
||||
Matrix_RotateZ(RAD2SHORTANGLE(DEG2RAD(airplane->rotZ)), 1);
|
||||
Matrix_scale(50.0f, 50.0f, 50.0f, 1);
|
||||
|
||||
OPEN_DISP(g);
|
||||
gSPMatrix(NOW_POLY_OPA_DISP++, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, glider_model);
|
||||
CLOSE_DISP(g);
|
||||
}
|
||||
OPEN_DISP(g);
|
||||
gSPMatrix(NOW_POLY_OPA_DISP++, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, glider_model);
|
||||
CLOSE_DISP(g);
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_RubberMove(f32* now, f32 target, f32 step) {
|
||||
*now += step * (target - *now);
|
||||
*now += step * (target - *now);
|
||||
}
|
||||
|
||||
static void aAp_FallByWall(ACTOR* actor) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
if (actor->bg_collision_check.result.hit_wall == 0) {
|
||||
return;
|
||||
}
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
if (actor->bg_collision_check.result.hit_wall == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
airplane->status = aAp_STATUS_FALL_FLY_MOVE;
|
||||
airplane->status = aAp_STATUS_FALL_FLY_MOVE;
|
||||
}
|
||||
|
||||
static void aAp_GroundFriction(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
/* slow down speed since we're on the ground */
|
||||
aAp_RubberMove(&airplane->speed, 0.0f, 0.6f);
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
/* slow down speed since we're on the ground */
|
||||
aAp_RubberMove(&airplane->speed, 0.0f, 0.6f);
|
||||
|
||||
if (airplane->speed < 1.0f) {
|
||||
airplane->speed = 0.0f;
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
if (airplane->speed < 1.0f) {
|
||||
airplane->speed = 0.0f;
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
|
||||
if (airplane->ground_timer >= 5) {
|
||||
airplane->ground_timer = 0;
|
||||
if (airplane->ground_timer >= 5) {
|
||||
airplane->ground_timer = 0;
|
||||
|
||||
(*Common_Get(clip.effect_clip)->effect_make_proc)(eEC_EFFECT_DUST, actor->world.position, 1, actor->world.angle.y, game, actor->npc_id, 0, 8);
|
||||
}
|
||||
(*Common_Get(clip.effect_clip)->effect_make_proc)(eEC_EFFECT_DUST, actor->world.position, 1,
|
||||
actor->world.angle.y, game, actor->npc_id, 0, 8);
|
||||
}
|
||||
|
||||
airplane->ground_timer++;
|
||||
airplane->ground_timer++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_FreeFlyMove(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
|
||||
aAp_RubberMove(&airplane->speed, 3.0f, 0.01f);
|
||||
aAp_RubberMove(&airplane->rotX, 19.0f, 0.045f);
|
||||
aAp_RubberMove(&airplane->rotZ, 0.0f, 0.05f);
|
||||
aAp_GroundFriction(actor, game);
|
||||
aAp_FallByWall(actor);
|
||||
aAp_RubberMove(&airplane->speed, 3.0f, 0.01f);
|
||||
aAp_RubberMove(&airplane->rotX, 19.0f, 0.045f);
|
||||
aAp_RubberMove(&airplane->rotZ, 0.0f, 0.05f);
|
||||
aAp_GroundFriction(actor, game);
|
||||
aAp_FallByWall(actor);
|
||||
}
|
||||
|
||||
static void aAp_SomerFlyMove(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
switch (airplane->tilt_status) {
|
||||
case aAp_TILT_DOWN:
|
||||
{
|
||||
aAp_RubberMove(&airplane->rotX, -89.0f, 0.2f);
|
||||
aAp_RubberMove(&airplane->speed, 9.0f, 0.1f);
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
switch (airplane->tilt_status) {
|
||||
case aAp_TILT_DOWN: {
|
||||
aAp_RubberMove(&airplane->rotX, -89.0f, 0.2f);
|
||||
aAp_RubberMove(&airplane->speed, 9.0f, 0.1f);
|
||||
|
||||
if (airplane->rotX < -87.0f) {
|
||||
airplane->tilt_status = aAp_TILT_UP;
|
||||
airplane->rotX = 60.0f;
|
||||
}
|
||||
if (airplane->rotX < -87.0f) {
|
||||
airplane->tilt_status = aAp_TILT_UP;
|
||||
airplane->rotX = 60.0f;
|
||||
}
|
||||
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
case aAp_TILT_UP: {
|
||||
aAp_RubberMove(&airplane->rotX, 0.0f, 0.04f);
|
||||
aAp_RubberMove(&airplane->speed, 10.0f, 0.1f);
|
||||
|
||||
if (ABS(airplane->rotX) < 3.0f) {
|
||||
airplane->status = aAp_STATUS_FREE_FLY_MOVE;
|
||||
airplane->tilt_status = aAp_TILT_DOWN;
|
||||
}
|
||||
|
||||
aAp_GroundFriction(actor, game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
case aAp_TILT_UP:
|
||||
{
|
||||
aAp_RubberMove(&airplane->rotX, 0.0f, 0.04f);
|
||||
aAp_RubberMove(&airplane->speed, 10.0f, 0.1f);
|
||||
|
||||
if (ABS(airplane->rotX) < 3.0f) {
|
||||
airplane->status = aAp_STATUS_FREE_FLY_MOVE;
|
||||
airplane->tilt_status = aAp_TILT_DOWN;
|
||||
}
|
||||
|
||||
aAp_GroundFriction(actor, game);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
aAp_FallByWall(actor);
|
||||
aAp_FallByWall(actor);
|
||||
}
|
||||
|
||||
static int aAp_SelectFly(AIRPLANE_ACTOR* actor, int stick_y) {
|
||||
int mode = (int)(fqrand() * 7.0f) & 1;
|
||||
if (stick_y > 67) {
|
||||
if (mode != 0) {
|
||||
actor->status = aAp_STATUS_FALL_FLY_MOVE2;
|
||||
int mode = (int)(fqrand() * 7.0f) & 1;
|
||||
if (stick_y > 67) {
|
||||
if (mode != 0) {
|
||||
actor->status = aAp_STATUS_FALL_FLY_MOVE2;
|
||||
} else {
|
||||
actor->status = aAp_STATUS_SOMER_FLY_MOVE;
|
||||
actor->tilt_status = aAp_TILT_DOWN;
|
||||
}
|
||||
} else {
|
||||
actor->status = aAp_STATUS_FREE_FLY_MOVE;
|
||||
}
|
||||
else {
|
||||
actor->status = aAp_STATUS_SOMER_FLY_MOVE;
|
||||
actor->tilt_status = aAp_TILT_DOWN;
|
||||
}
|
||||
}
|
||||
else {
|
||||
actor->status = aAp_STATUS_FREE_FLY_MOVE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void aAp_StartFlyMove(ACTOR* actor, GAME* game) {
|
||||
static s16 goal_angle_random[8] = { 2366, 2002, -1092, -2366, 0, 4368, -4186, 4186 };
|
||||
static s16 goal_angle_random2[8] = { 12740, 8190, -9100, -8190, -10920, 10920, 9100, 0 };
|
||||
static s16 goal_angle_random[8] = { 2366, 2002, -1092, -2366, 0, 4368, -4186, 4186 };
|
||||
static s16 goal_angle_random2[8] = { 12740, 8190, -9100, -8190, -10920, 10920, 9100, 0 };
|
||||
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
int now_stick_y = getJoystick_Y();
|
||||
PLAYER_ACTOR* player = get_player_actor_withoutCheck((GAME_PLAY*)game);
|
||||
int goal = fqrand() * 8.0f;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int last_stick_y = airplane->joystick_y;
|
||||
s16* goal_angle_random_tbl;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
int now_stick_y = getJoystick_Y();
|
||||
PLAYER_ACTOR* player = get_player_actor_withoutCheck((GAME_PLAY*)game);
|
||||
int goal = fqrand() * 8.0f;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int last_stick_y = airplane->joystick_y;
|
||||
s16* goal_angle_random_tbl;
|
||||
|
||||
if (now_stick_y - last_stick_y > 30) {
|
||||
f32 stick_y = ABS((f32)last_stick_y);
|
||||
int adjusted_y = ABS(last_stick_y);
|
||||
if (now_stick_y - last_stick_y > 30) {
|
||||
f32 stick_y = ABS((f32)last_stick_y);
|
||||
int adjusted_y = ABS(last_stick_y);
|
||||
|
||||
airplane->speed = ABS((f32)last_stick_y) * 0.0875f + 3.0f;
|
||||
aAp_SelectFly(airplane, adjusted_y);
|
||||
airplane->speed = ABS((f32)last_stick_y) * 0.0875f + 3.0f;
|
||||
aAp_SelectFly(airplane, adjusted_y);
|
||||
|
||||
goal_angle_random_tbl = adjusted_y > 50 ? goal_angle_random2 : goal_angle_random;
|
||||
goal_angle_random_tbl = adjusted_y > 50 ? goal_angle_random2 : goal_angle_random;
|
||||
|
||||
actor->world.position.y = player->actor_class.world.position.y + 25.0f;
|
||||
actor->world.position.x = player->actor_class.world.position.x;
|
||||
actor->world.position.z = player->actor_class.world.position.z;
|
||||
actor->world.position.y = player->actor_class.world.position.y + 25.0f;
|
||||
actor->world.position.x = player->actor_class.world.position.x;
|
||||
actor->world.position.z = player->actor_class.world.position.z;
|
||||
|
||||
airplane->rotY = RAD2DEG(SHORTANGLE2RAD(player->actor_class.shape_info.rotation.y));
|
||||
airplane->rotY_goal = airplane->rotY + (RAD2DEG(SHORTANGLE2RAD(goal_angle_random_tbl[goal])));
|
||||
airplane->rotX = airplane->speed * RAD2DEG(-0.14959965f) + 30.0f;
|
||||
airplane->rotZ = 0.0f;
|
||||
airplane->y_speed = 0.0f;
|
||||
airplane->rotY = RAD2DEG(SHORTANGLE2RAD(player->actor_class.shape_info.rotation.y));
|
||||
airplane->rotY_goal = airplane->rotY + (RAD2DEG(SHORTANGLE2RAD(goal_angle_random_tbl[goal])));
|
||||
airplane->rotX = airplane->speed * RAD2DEG(-0.14959965f) + 30.0f;
|
||||
airplane->rotZ = 0.0f;
|
||||
airplane->y_speed = 0.0f;
|
||||
|
||||
mPlib_request_main_wait_type3((GAME*)play);
|
||||
}
|
||||
mPlib_request_main_wait_type3((GAME*)play);
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_PlayerCatch(ACTOR* actor, GAME* game) { }
|
||||
static void aAp_PlayerCatch(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
static void aAp_StopFlyMove(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
airplane->speed = 0.0f;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
airplane->speed = 0.0f;
|
||||
|
||||
if (actor->player_distance_xz <= 30.0f && chkTrigger(BUTTON_A)) {
|
||||
airplane->status = aAp_STATUS_PLAYER_CATCH; // player is now "holding" the airplane
|
||||
}
|
||||
if (actor->player_distance_xz <= 30.0f && chkTrigger(BUTTON_A)) {
|
||||
airplane->status = aAp_STATUS_PLAYER_CATCH; // player is now "holding" the airplane
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_FallFlyMove(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
aAp_RubberMove(&airplane->rotX, 60.0f, 0.04f);
|
||||
aAp_RubberMove(&airplane->speed, 5.0f, 0.02f);
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
aAp_RubberMove(&airplane->rotX, 60.0f, 0.04f);
|
||||
aAp_RubberMove(&airplane->speed, 5.0f, 0.02f);
|
||||
|
||||
actor->world.position.y -= 0.15f;
|
||||
actor->world.position.y -= 0.15f;
|
||||
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
Common_Get(clip.effect_clip)->effect_make_proc(eEC_EFFECT_DUST, actor->world.position, 1, actor->world.angle.y, game, actor->npc_id, 0, 8);
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
}
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
Common_Get(clip.effect_clip)
|
||||
->effect_make_proc(eEC_EFFECT_DUST, actor->world.position, 1, actor->world.angle.y, game, actor->npc_id, 0,
|
||||
8);
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_FallFlyMove2(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
aAp_RubberMove(&airplane->rotX, 70.0f, 0.15f);
|
||||
aAp_RubberMove(&airplane->speed, 10.0f, 0.02f);
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
aAp_RubberMove(&airplane->rotX, 70.0f, 0.15f);
|
||||
aAp_RubberMove(&airplane->speed, 10.0f, 0.02f);
|
||||
|
||||
actor->world.position.y -= 0.15f;
|
||||
actor->world.position.y -= 0.15f;
|
||||
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
Common_Get(clip.effect_clip)->effect_make_proc(eEC_EFFECT_DUST, actor->world.position, 1, actor->world.angle.y, game, actor->npc_id, 0, 8);
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
}
|
||||
if (actor->bg_collision_check.result.on_ground) {
|
||||
Common_Get(clip.effect_clip)
|
||||
->effect_make_proc(eEC_EFFECT_DUST, actor->world.position, 1, actor->world.angle.y, game, actor->npc_id, 0,
|
||||
8);
|
||||
airplane->status = aAp_STATUS_STOP_FLY_MOVE;
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_LeanAirplane(AIRPLANE_ACTOR* airplane) {
|
||||
if (airplane->status == aAp_STATUS_FREE_FLY_MOVE) {
|
||||
aAp_RubberMove(&airplane->rotZ, 0.0f, 0.05f);
|
||||
}
|
||||
else if (airplane->rotY_min - airplane->rotY > 0.0f) {
|
||||
aAp_RubberMove(&airplane->rotZ, 50.0f, 0.05f);
|
||||
}
|
||||
else {
|
||||
aAp_RubberMove(&airplane->rotZ, -50.0f, 0.05f);
|
||||
}
|
||||
if (airplane->status == aAp_STATUS_FREE_FLY_MOVE) {
|
||||
aAp_RubberMove(&airplane->rotZ, 0.0f, 0.05f);
|
||||
} else if (airplane->rotY_min - airplane->rotY > 0.0f) {
|
||||
aAp_RubberMove(&airplane->rotZ, 50.0f, 0.05f);
|
||||
} else {
|
||||
aAp_RubberMove(&airplane->rotZ, -50.0f, 0.05f);
|
||||
}
|
||||
}
|
||||
|
||||
static xyz_t wind1 = { 2.0f, 1.0f, 4.0f };
|
||||
@@ -266,122 +269,107 @@ static xyz_t wind4 = { -1.0f, 3.0f, -4.0f };
|
||||
|
||||
static xyz_t* wind_table[4] = { &wind1, &wind2, &wind3, &wind4 };
|
||||
|
||||
static int wind_change_frame_table[10] = {
|
||||
300, 20, 500, 1000, 100,
|
||||
700, 20, 200, 80, 70
|
||||
};
|
||||
static int wind_change_frame_table[10] = { 300, 20, 500, 1000, 100, 700, 20, 200, 80, 70 };
|
||||
|
||||
static void aAp_WindSystem(ACTOR* actor, GAME* game) {
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
xyz_t dir = { 0.0f, 1.0f, 0.0f };
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
xyz_t dir = { 0.0f, 1.0f, 0.0f };
|
||||
|
||||
airplane->wind_frame++;
|
||||
if (airplane->wind_frame > airplane->wind_change_frame) {
|
||||
int table_rng = fqrand() * 4.0f;
|
||||
int change_frame_rng = fqrand() * 10.0f;
|
||||
airplane->wind_frame++;
|
||||
if (airplane->wind_frame > airplane->wind_change_frame) {
|
||||
int table_rng = fqrand() * 4.0f;
|
||||
int change_frame_rng = fqrand() * 10.0f;
|
||||
|
||||
airplane->wind_frame = 0;
|
||||
airplane->wind_change_frame = wind_change_frame_table[change_frame_rng];
|
||||
airplane->wind = wind_table[table_rng];
|
||||
}
|
||||
airplane->wind_frame = 0;
|
||||
airplane->wind_change_frame = wind_change_frame_table[change_frame_rng];
|
||||
airplane->wind = wind_table[table_rng];
|
||||
}
|
||||
|
||||
if (airplane->status != aAp_STATUS_STOP_FLY_MOVE &&
|
||||
airplane->status != aAp_STATUS_START_FLY_MOVE &&
|
||||
airplane->status != aAp_STATUS_PLAYER_CATCH &&
|
||||
airplane->wind != NULL
|
||||
) {
|
||||
sMath_RotateX(&dir, DEG2RAD(airplane->rotX));
|
||||
sMath_RotateZ(&dir, DEG2RAD(airplane->rotZ));
|
||||
sMath_RotateY(&dir, DEG2RAD(airplane->rotY));
|
||||
}
|
||||
if (airplane->status != aAp_STATUS_STOP_FLY_MOVE && airplane->status != aAp_STATUS_START_FLY_MOVE &&
|
||||
airplane->status != aAp_STATUS_PLAYER_CATCH && airplane->wind != NULL) {
|
||||
sMath_RotateX(&dir, DEG2RAD(airplane->rotX));
|
||||
sMath_RotateZ(&dir, DEG2RAD(airplane->rotZ));
|
||||
sMath_RotateY(&dir, DEG2RAD(airplane->rotY));
|
||||
}
|
||||
}
|
||||
|
||||
static void aAp_CommonHandle(ACTOR* actor, AIRPLANE_ACTOR* airplane, GAME* game) {
|
||||
aAp_LeanAirplane(airplane);
|
||||
|
||||
actor->speed = airplane->speed * cosf_table(DEG2RAD(airplane->rotX));
|
||||
airplane->y_speed = airplane->speed * sinf_table(DEG2RAD(airplane->rotX));
|
||||
aAp_LeanAirplane(airplane);
|
||||
|
||||
actor->world.position.y -= airplane->y_speed;
|
||||
actor->world.angle.y = RAD2SHORTANGLE(DEG2RAD(airplane->rotY));
|
||||
actor->shape_info.rotation.y = RAD2SHORTANGLE(DEG2RAD(airplane->rotY));
|
||||
actor->speed = airplane->speed * cosf_table(DEG2RAD(airplane->rotX));
|
||||
airplane->y_speed = airplane->speed * sinf_table(DEG2RAD(airplane->rotX));
|
||||
|
||||
Actor_position_moveF(actor);
|
||||
actor->world.position.y -= airplane->y_speed;
|
||||
actor->world.angle.y = RAD2SHORTANGLE(DEG2RAD(airplane->rotY));
|
||||
actor->shape_info.rotation.y = RAD2SHORTANGLE(DEG2RAD(airplane->rotY));
|
||||
|
||||
airplane->joystick_x = getJoystick_X();
|
||||
airplane->joystick_y = getJoystick_Y();
|
||||
Actor_position_moveF(actor);
|
||||
|
||||
switch (airplane->status) {
|
||||
case aAp_STATUS_START_FLY_MOVE:
|
||||
case aAp_STATUS_PLAYER_CATCH:
|
||||
{
|
||||
actor->shape_info.draw_shadow = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
case aAp_STATUS_FREE_FLY_MOVE:
|
||||
case aAp_STATUS_FALL_FLY_MOVE:
|
||||
case aAp_STATUS_FALL_FLY_MOVE2:
|
||||
case aAp_STATUS_SOMER_FLY_MOVE:
|
||||
{
|
||||
aAp_RubberMove(&airplane->rotY, airplane->rotY_goal, 0.07f);
|
||||
actor->shape_info.draw_shadow = TRUE;
|
||||
break;
|
||||
airplane->joystick_x = getJoystick_X();
|
||||
airplane->joystick_y = getJoystick_Y();
|
||||
|
||||
switch (airplane->status) {
|
||||
case aAp_STATUS_START_FLY_MOVE:
|
||||
case aAp_STATUS_PLAYER_CATCH: {
|
||||
actor->shape_info.draw_shadow = FALSE;
|
||||
break;
|
||||
}
|
||||
|
||||
case aAp_STATUS_FREE_FLY_MOVE:
|
||||
case aAp_STATUS_FALL_FLY_MOVE:
|
||||
case aAp_STATUS_FALL_FLY_MOVE2:
|
||||
case aAp_STATUS_SOMER_FLY_MOVE: {
|
||||
aAp_RubberMove(&airplane->rotY, airplane->rotY_goal, 0.07f);
|
||||
actor->shape_info.draw_shadow = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
default: {
|
||||
actor->shape_info.draw_shadow = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
actor->shape_info.draw_shadow = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
aAp_WindSystem(actor, game);
|
||||
aAp_WindSystem(actor, game);
|
||||
}
|
||||
|
||||
static void aAp_ZbuttonChangeStatus(AIRPLANE_ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if (chkButton(BUTTON_Z)) {
|
||||
if (actor->status == aAp_STATUS_PLAYER_CATCH) {
|
||||
mPlib_request_main_refuse_type1(play);
|
||||
actor->status = aAp_STATUS_START_FLY_MOVE;
|
||||
if (chkButton(BUTTON_Z)) {
|
||||
if (actor->status == aAp_STATUS_PLAYER_CATCH) {
|
||||
mPlib_request_main_refuse_type1(play);
|
||||
actor->status = aAp_STATUS_START_FLY_MOVE;
|
||||
}
|
||||
} else if (actor->status == aAp_STATUS_START_FLY_MOVE) {
|
||||
mPlib_request_main_wait_type3((GAME*)play);
|
||||
actor->status = aAp_STATUS_PLAYER_CATCH;
|
||||
}
|
||||
}
|
||||
else if (actor->status == aAp_STATUS_START_FLY_MOVE) {
|
||||
mPlib_request_main_wait_type3((GAME*)play);
|
||||
actor->status = aAp_STATUS_PLAYER_CATCH;
|
||||
}
|
||||
}
|
||||
|
||||
static f32 aAp_GetBgCheckOffsetY(s16 status) {
|
||||
if (status == aAp_STATUS_FALL_FLY_MOVE || status == aAp_STATUS_STOP_FLY_MOVE) {
|
||||
return -5.5f;
|
||||
}
|
||||
if (status == aAp_STATUS_FALL_FLY_MOVE || status == aAp_STATUS_STOP_FLY_MOVE) {
|
||||
return -5.5f;
|
||||
}
|
||||
|
||||
return 0.0f;
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
typedef void (*AIRPLANE_ACTOR_MOVE_PROC)(ACTOR*, GAME*);
|
||||
static void Airplane_Actor_move(ACTOR* actor, GAME* game) {
|
||||
static AIRPLANE_ACTOR_MOVE_PROC AirplaneMove[aAp_STATUS_NUM] = {
|
||||
&aAp_FreeFlyMove,
|
||||
&aAp_FallFlyMove,
|
||||
&aAp_FallFlyMove2,
|
||||
&aAp_SomerFlyMove,
|
||||
&aAp_StartFlyMove,
|
||||
&aAp_StopFlyMove,
|
||||
&aAp_PlayerCatch
|
||||
};
|
||||
static AIRPLANE_ACTOR_MOVE_PROC AirplaneMove[aAp_STATUS_NUM] = { &aAp_FreeFlyMove, &aAp_FallFlyMove,
|
||||
&aAp_FallFlyMove2, &aAp_SomerFlyMove,
|
||||
&aAp_StartFlyMove, &aAp_StopFlyMove,
|
||||
&aAp_PlayerCatch };
|
||||
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
f32 offset_y;
|
||||
AIRPLANE_ACTOR* airplane = (AIRPLANE_ACTOR*)actor;
|
||||
f32 offset_y;
|
||||
|
||||
airplane->rotY_min = airplane->rotY;
|
||||
(*AirplaneMove[airplane->status])(actor, game);
|
||||
aAp_ZbuttonChangeStatus(airplane, game);
|
||||
aAp_CommonHandle(actor, airplane, game);
|
||||
airplane->rotY_min = airplane->rotY;
|
||||
(*AirplaneMove[airplane->status])(actor, game);
|
||||
aAp_ZbuttonChangeStatus(airplane, game);
|
||||
aAp_CommonHandle(actor, airplane, game);
|
||||
|
||||
offset_y = aAp_GetBgCheckOffsetY(airplane->status);
|
||||
mCoBG_BgCheckControll(NULL, actor, 15.0f, offset_y, FALSE, FALSE, 0);
|
||||
offset_y = aAp_GetBgCheckOffsetY(airplane->status);
|
||||
mCoBG_BgCheckControll(NULL, actor, 15.0f, offset_y, FALSE, FALSE, 0);
|
||||
}
|
||||
|
||||
+83
-86
@@ -10,112 +10,109 @@
|
||||
#include "m_titledemo.h"
|
||||
#include "m_event.h"
|
||||
#include "m_scene_table.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_cpak.h"
|
||||
|
||||
extern void flash_rom_and_player_info_clear() {
|
||||
Save* save = Common_GetPointer(save);
|
||||
Private_c* priv_p;
|
||||
int i;
|
||||
Save* save = Common_GetPointer(save);
|
||||
Private_c* priv_p;
|
||||
int i;
|
||||
|
||||
bzero(save, sizeof(Save));
|
||||
mFRm_ClearSaveCheckData(Save_GetPointer(save_check));
|
||||
bzero(save, sizeof(Save));
|
||||
mFRm_ClearSaveCheckData(Save_GetPointer(save_check));
|
||||
|
||||
priv_p = Save_GetPointer(private[0]);
|
||||
for (i = 0; i < PLAYER_NUM; i++) {
|
||||
mPr_ClearPrivateInfo(priv_p);
|
||||
priv_p++;
|
||||
}
|
||||
priv_p = Save_GetPointer(private[0]);
|
||||
for (i = 0; i < PLAYER_NUM; i++) {
|
||||
mPr_ClearPrivateInfo(priv_p);
|
||||
priv_p++;
|
||||
}
|
||||
|
||||
Save_Set(land_info.exists, TRUE);
|
||||
Save_Set(land_info.exists, TRUE);
|
||||
}
|
||||
|
||||
extern int decide_next_scene_no() {
|
||||
int is_first_game;
|
||||
int bad_save;
|
||||
int next_scene_no;
|
||||
|
||||
is_first_game = mFRm_CheckSaveData() == FALSE;
|
||||
int is_first_game;
|
||||
int bad_save;
|
||||
int next_scene_no;
|
||||
|
||||
// this is weird, can't get it as a ternary or a switch
|
||||
switch ((int)Common_Get(save_error_type)) {
|
||||
case mFRm_ERROR_MEMCARD_TRAVELDATA_CONFLICT:
|
||||
case mFRm_ERROR_DATA_CORRUPTED:
|
||||
case mFRm_ERROR_MEMCARD_NO_FILES:
|
||||
case mFRm_ERROR_MEMCARD_DAMAGED:
|
||||
case mFRm_ERROR_MEMCARD_FORMAT:
|
||||
case mFRm_ERROR_MEMCARD_INVALID:
|
||||
case mFRm_ERROR_MEMCARD_NO_SPACE:
|
||||
case mFRm_ERROR_NOT_MEMCARD:
|
||||
case mFRm_ERROR_NO_MEMCARD:
|
||||
{
|
||||
bad_save = TRUE;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
bad_save = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
is_first_game = mFRm_CheckSaveData() == FALSE;
|
||||
|
||||
if (lbRTC_IsAbnormal()) {
|
||||
const lbRTC_time_c* src;
|
||||
|
||||
Common_Set(time.rtc_crashed, TRUE);
|
||||
Common_Set(time.add_sec, 1);
|
||||
|
||||
if (is_first_game == TRUE || bad_save == TRUE) {
|
||||
src = &mTM_rtcTime_default_code;
|
||||
}
|
||||
else {
|
||||
src = Save_GetPointer(save_check.time);
|
||||
// this is weird, can't get it as a ternary or a switch
|
||||
switch ((int)Common_Get(save_error_type)) {
|
||||
case mFRm_ERROR_MEMCARD_TRAVELDATA_CONFLICT:
|
||||
case mFRm_ERROR_DATA_CORRUPTED:
|
||||
case mFRm_ERROR_MEMCARD_NO_FILES:
|
||||
case mFRm_ERROR_MEMCARD_DAMAGED:
|
||||
case mFRm_ERROR_MEMCARD_FORMAT:
|
||||
case mFRm_ERROR_MEMCARD_INVALID:
|
||||
case mFRm_ERROR_MEMCARD_NO_SPACE:
|
||||
case mFRm_ERROR_NOT_MEMCARD:
|
||||
case mFRm_ERROR_NO_MEMCARD: {
|
||||
bad_save = TRUE;
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
bad_save = FALSE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
lbRTC_TimeCopy(Common_GetPointer(newly_set_time), src);
|
||||
}
|
||||
if (lbRTC_IsAbnormal()) {
|
||||
const lbRTC_time_c* src;
|
||||
|
||||
if (bad_save == TRUE || Common_Get(time.rtc_crashed) == TRUE) {
|
||||
if (bad_save == TRUE) {
|
||||
flash_rom_and_player_info_clear();
|
||||
Common_Set(time.rtc_crashed, TRUE);
|
||||
Common_Set(time.add_sec, 1);
|
||||
|
||||
if (is_first_game == TRUE || bad_save == TRUE) {
|
||||
src = &mTM_rtcTime_default_code;
|
||||
} else {
|
||||
src = Save_GetPointer(save_check.time);
|
||||
}
|
||||
|
||||
lbRTC_TimeCopy(Common_GetPointer(newly_set_time), src);
|
||||
}
|
||||
|
||||
Common_Set(house_owner_name, RSV_NO);
|
||||
Common_Set(last_field_id, -1);
|
||||
next_scene_no = SCENE_PLAYERSELECT_3;
|
||||
}
|
||||
else if (is_first_game == TRUE) {
|
||||
flash_rom_and_player_info_clear();
|
||||
Common_Set(house_owner_name, RSV_NO);
|
||||
Common_Set(last_field_id, -1);
|
||||
next_scene_no = SCENE_PLAYERSELECT;
|
||||
}
|
||||
else {
|
||||
next_scene_no = SCENE_PLAYERSELECT_2;
|
||||
}
|
||||
if (bad_save == TRUE || Common_Get(time.rtc_crashed) == TRUE) {
|
||||
if (bad_save == TRUE) {
|
||||
flash_rom_and_player_info_clear();
|
||||
}
|
||||
|
||||
return next_scene_no;
|
||||
Common_Set(house_owner_name, RSV_NO);
|
||||
Common_Set(last_field_id, -1);
|
||||
next_scene_no = SCENE_PLAYERSELECT_3;
|
||||
} else if (is_first_game == TRUE) {
|
||||
flash_rom_and_player_info_clear();
|
||||
Common_Set(house_owner_name, RSV_NO);
|
||||
Common_Set(last_field_id, -1);
|
||||
next_scene_no = SCENE_PLAYERSELECT;
|
||||
} else {
|
||||
next_scene_no = SCENE_PLAYERSELECT_2;
|
||||
}
|
||||
|
||||
return next_scene_no;
|
||||
}
|
||||
|
||||
extern void title_action_data_init_start_select(GAME_PLAY* play) {
|
||||
mCD_LoadLand();
|
||||
mCPk_InitPak(0);
|
||||
mCD_LoadLand();
|
||||
mCPk_InitPak(0);
|
||||
|
||||
Common_Set(now_private, Save_GetPointer(private[0]));
|
||||
Common_Set(player_no, 0);
|
||||
|
||||
mTD_rtc_reserve();
|
||||
mTM_clear_renew_is();
|
||||
mNpc_ClearAnimalInfo(mNpc_GetInAnimalP());
|
||||
play->next_scene_no = decide_next_scene_no();
|
||||
Common_Set(now_private, Save_GetPointer(private[0]));
|
||||
Common_Set(player_no, 0);
|
||||
|
||||
{
|
||||
int rtc_enabled = Common_Get(time.rtc_enabled);
|
||||
Common_Set(time.rtc_enabled, TRUE);
|
||||
mTM_rtcTime_limit_check();
|
||||
Common_Set(time.rtc_enabled, rtc_enabled);
|
||||
}
|
||||
mTD_rtc_reserve();
|
||||
mTM_clear_renew_is();
|
||||
mNpc_ClearAnimalInfo(mNpc_GetInAnimalP());
|
||||
play->next_scene_no = decide_next_scene_no();
|
||||
|
||||
mEv_ClearEventInfo();
|
||||
Common_Set(scene_from_title_demo, -1);
|
||||
Common_Set(door_data.next_scene_id, 0);
|
||||
Common_Set(submenu_disabled, TRUE);
|
||||
{
|
||||
int rtc_enabled = Common_Get(time.rtc_enabled);
|
||||
Common_Set(time.rtc_enabled, TRUE);
|
||||
mTM_rtcTime_limit_check();
|
||||
Common_Set(time.rtc_enabled, rtc_enabled);
|
||||
}
|
||||
|
||||
mEv_ClearEventInfo();
|
||||
Common_Set(scene_from_title_demo, -1);
|
||||
Common_Set(door_data.next_scene_id, 0);
|
||||
Common_Set(submenu_disabled, TRUE);
|
||||
}
|
||||
|
||||
+87
-94
@@ -3,22 +3,23 @@
|
||||
#include "m_event.h"
|
||||
#include "m_name_table.h"
|
||||
#include "m_common_data.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
static void aAPC_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aAPC_actor_dt(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Aprilfool_Control_Profile = {
|
||||
mAc_PROFILE_APRILFOOL_CONTROL,
|
||||
ACTOR_PART_CONTROL,
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(APRILFOOL_CONTROL_ACTOR),
|
||||
&aAPC_actor_ct,
|
||||
&aAPC_actor_dt,
|
||||
mActor_NONE_PROC1,
|
||||
mActor_NONE_PROC1,
|
||||
NULL
|
||||
mAc_PROFILE_APRILFOOL_CONTROL,
|
||||
ACTOR_PART_CONTROL,
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(APRILFOOL_CONTROL_ACTOR),
|
||||
&aAPC_actor_ct,
|
||||
&aAPC_actor_dt,
|
||||
mActor_NONE_PROC1,
|
||||
mActor_NONE_PROC1,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static int aAPC_talk_chk_proc(mActor_name_t actor_name);
|
||||
@@ -26,122 +27,114 @@ static void aAPC_talk_set_proc(mActor_name_t actor_name);
|
||||
static int aAPC_get_msg_num_proc(mActor_name_t actor_name, int update_talked);
|
||||
|
||||
static void aAPC_actor_ct(ACTOR* actor, GAME* game) {
|
||||
APRILFOOL_CONTROL_ACTOR* aprilfool_control = (APRILFOOL_CONTROL_ACTOR*)actor;
|
||||
aAPC_event_save_data_c* save_data;
|
||||
APRILFOOL_CONTROL_ACTOR* aprilfool_control = (APRILFOOL_CONTROL_ACTOR*)actor;
|
||||
aAPC_event_save_data_c* save_data;
|
||||
|
||||
if (Common_Get(clip).aprilfool_control_clip == NULL) {
|
||||
Common_Get(clip).aprilfool_control_clip = &aprilfool_control->clip;
|
||||
}
|
||||
if (Common_Get(clip).aprilfool_control_clip == NULL) {
|
||||
Common_Get(clip).aprilfool_control_clip = &aprilfool_control->clip;
|
||||
}
|
||||
|
||||
save_data = (aAPC_event_save_data_c*)mEv_get_save_area(mEv_EVENT_APRILFOOLS_DAY, 0);
|
||||
if (save_data == NULL) {
|
||||
save_data = (aAPC_event_save_data_c*)mEv_reserve_save_area(mEv_EVENT_APRILFOOLS_DAY, 0);
|
||||
bzero(save_data, sizeof(aAPC_event_save_data_c));
|
||||
}
|
||||
|
||||
Common_Get(clip).aprilfool_control_clip->talk_chk_proc = &aAPC_talk_chk_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->talk_set_proc = &aAPC_talk_set_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->get_msg_num_proc = &aAPC_get_msg_num_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->event_save_data_p = save_data;
|
||||
save_data = (aAPC_event_save_data_c*)mEv_get_save_area(mEv_EVENT_APRILFOOLS_DAY, 0);
|
||||
if (save_data == NULL) {
|
||||
save_data = (aAPC_event_save_data_c*)mEv_reserve_save_area(mEv_EVENT_APRILFOOLS_DAY, 0);
|
||||
bzero(save_data, sizeof(aAPC_event_save_data_c));
|
||||
}
|
||||
|
||||
Common_Get(clip).aprilfool_control_clip->talk_chk_proc = &aAPC_talk_chk_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->talk_set_proc = &aAPC_talk_set_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->get_msg_num_proc = &aAPC_get_msg_num_proc;
|
||||
Common_Get(clip).aprilfool_control_clip->event_save_data_p = save_data;
|
||||
}
|
||||
|
||||
static void aAPC_actor_dt(ACTOR* actor, GAME* game) {
|
||||
Common_Get(clip).aprilfool_control_clip = NULL;
|
||||
mEv_actor_dying_message(mEv_EVENT_APRILFOOLS_DAY, actor);
|
||||
Common_Get(clip).aprilfool_control_clip = NULL;
|
||||
mEv_actor_dying_message(mEv_EVENT_APRILFOOLS_DAY, actor);
|
||||
}
|
||||
|
||||
typedef struct aprilfool_npc_data_s {
|
||||
mActor_name_t actor_name;
|
||||
u16 data_idx;
|
||||
mActor_name_t actor_name;
|
||||
u16 data_idx;
|
||||
} aAPC_npc_data_c;
|
||||
|
||||
static int aAPC_get_data_idx(mActor_name_t actor_name) {
|
||||
static aAPC_npc_data_c npc_data_table[11] = {
|
||||
{ SP_NPC_STATION_MASTER, 0x0000 }, /* Porter */
|
||||
{ SP_NPC_SHOP_MASTER, 0x0001 }, /* Tom Nook */
|
||||
{ SP_NPC_CURATOR, 0x0002 }, /* Blathers */
|
||||
{ SP_NPC_NEEDLEWORK0, 0x0003 }, /* Mable */
|
||||
{ SP_NPC_NEEDLEWORK1, 0x0004 }, /* Sable */
|
||||
{ SP_NPC_POLICE, 0x0005 }, /* Copper */
|
||||
{ SP_NPC_POLICE2, 0x0006 }, /* Booker */
|
||||
{ SP_NPC_POST_GIRL, 0x0007 }, /* Pelly */
|
||||
{ SP_NPC_POST_GIRL2, 0x0008 }, /* Phyllis */
|
||||
{ SP_NPC_POST_MAN, 0x0009 }, /* Pete */
|
||||
{ SP_NPC_SENDO, 0x000A } /* Kapp'n */
|
||||
};
|
||||
static aAPC_npc_data_c npc_data_table[11] = {
|
||||
{ SP_NPC_STATION_MASTER, 0x0000 }, /* Porter */
|
||||
{ SP_NPC_SHOP_MASTER, 0x0001 }, /* Tom Nook */
|
||||
{ SP_NPC_CURATOR, 0x0002 }, /* Blathers */
|
||||
{ SP_NPC_NEEDLEWORK0, 0x0003 }, /* Mable */
|
||||
{ SP_NPC_NEEDLEWORK1, 0x0004 }, /* Sable */
|
||||
{ SP_NPC_POLICE, 0x0005 }, /* Copper */
|
||||
{ SP_NPC_POLICE2, 0x0006 }, /* Booker */
|
||||
{ SP_NPC_POST_GIRL, 0x0007 }, /* Pelly */
|
||||
{ SP_NPC_POST_GIRL2, 0x0008 }, /* Phyllis */
|
||||
{ SP_NPC_POST_MAN, 0x0009 }, /* Pete */
|
||||
{ SP_NPC_SENDO, 0x000A } /* Kapp'n */
|
||||
};
|
||||
|
||||
aAPC_npc_data_c* npc_data_p = npc_data_table;
|
||||
int i;
|
||||
int res = -1;
|
||||
aAPC_npc_data_c* npc_data_p = npc_data_table;
|
||||
int i;
|
||||
int res = -1;
|
||||
|
||||
for (i = 0; i < 11; i++) {
|
||||
if (npc_data_p->actor_name == actor_name) {
|
||||
res = npc_data_p->data_idx;
|
||||
break;
|
||||
for (i = 0; i < 11; i++) {
|
||||
if (npc_data_p->actor_name == actor_name) {
|
||||
res = npc_data_p->data_idx;
|
||||
break;
|
||||
}
|
||||
|
||||
npc_data_p++;
|
||||
}
|
||||
|
||||
npc_data_p++;
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int aAPC_talk_chk_proc(mActor_name_t actor_name) {
|
||||
int res = TRUE;
|
||||
int res = TRUE;
|
||||
|
||||
if (mLd_PlayerManKindCheck() == FALSE) {
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
if (mLd_PlayerManKindCheck() == FALSE) {
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
|
||||
if (data_idx != -1) {
|
||||
u16 bitfield = Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
if (data_idx != -1) {
|
||||
u16 bitfield =
|
||||
Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
|
||||
if (aAPC_GET_NPC_BIT(bitfield, data_idx) == 0) {
|
||||
res = FALSE;
|
||||
}
|
||||
if (aAPC_GET_NPC_BIT(bitfield, data_idx) == 0) {
|
||||
res = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
static void aAPC_talk_set_proc(mActor_name_t actor_name) {
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
|
||||
if (data_idx != -1) {
|
||||
u16* bitfield = &Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
data_idx = 1 << data_idx;
|
||||
|
||||
bitfield[0] |= data_idx;
|
||||
}
|
||||
if (data_idx != -1) {
|
||||
u16* bitfield =
|
||||
&Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
data_idx = 1 << data_idx;
|
||||
|
||||
bitfield[0] |= data_idx;
|
||||
}
|
||||
}
|
||||
|
||||
static int aAPC_get_msg_num_proc(mActor_name_t actor_name, int update_talked) {
|
||||
static int msg_num_table[11] = {
|
||||
0x3BB5,
|
||||
0x3BAC,
|
||||
0x3BB0,
|
||||
0x3BB1,
|
||||
0x3BB2,
|
||||
0x3BB3,
|
||||
0x3BB4,
|
||||
0x3BAE,
|
||||
0x3BAF,
|
||||
0x3BAD,
|
||||
0x3BB6
|
||||
};
|
||||
static int msg_num_table[11] = { 0x3BB5, 0x3BAC, 0x3BB0, 0x3BB1, 0x3BB2, 0x3BB3,
|
||||
0x3BB4, 0x3BAE, 0x3BAF, 0x3BAD, 0x3BB6 };
|
||||
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
int msg_num = -1;
|
||||
int data_idx = aAPC_get_data_idx(actor_name);
|
||||
int msg_num = -1;
|
||||
|
||||
if (data_idx != -1) {
|
||||
if (update_talked == TRUE) {
|
||||
u16* bitfield = &Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
if (data_idx != -1) {
|
||||
if (update_talked == TRUE) {
|
||||
u16* bitfield =
|
||||
&Common_Get(clip).aprilfool_control_clip->event_save_data_p->talk_bitfield[Common_Get(player_no)];
|
||||
|
||||
bitfield[0] = aAPC_SET_NPC_BIT(bitfield[0], data_idx);
|
||||
bitfield[0] = aAPC_SET_NPC_BIT(bitfield[0], data_idx);
|
||||
}
|
||||
|
||||
msg_num = msg_num_table[data_idx];
|
||||
}
|
||||
|
||||
msg_num = msg_num_table[data_idx];
|
||||
}
|
||||
|
||||
return msg_num;
|
||||
return msg_num;
|
||||
}
|
||||
|
||||
+35
-34
@@ -11,6 +11,7 @@
|
||||
#include "m_random_field.h"
|
||||
#include "m_roll_lib.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_collision_bg.h"
|
||||
|
||||
extern Gfx act_ball_b_model[];
|
||||
extern Gfx act_ball_d_model[];
|
||||
@@ -44,15 +45,15 @@ ACTOR_PROFILE Ball_Profile = {
|
||||
BALL_ACTOR* Global_Actor_p;
|
||||
|
||||
ClObjPipeData_c aBALL_CoInfoData = {
|
||||
{0x39, 0x20, ClObj_TYPE_PIPE}, // collision data
|
||||
{1}, // element data
|
||||
{ 0x39, 0x20, ClObj_TYPE_PIPE }, // collision data
|
||||
{ 1 }, // element data
|
||||
// Pipe specs
|
||||
{
|
||||
13, // radius
|
||||
30, // height
|
||||
-10, // offset
|
||||
13, // radius
|
||||
30, // height
|
||||
-10, // offset
|
||||
|
||||
{0, 0, 0}, // center
|
||||
{ 0, 0, 0 }, // center
|
||||
},
|
||||
};
|
||||
|
||||
@@ -60,15 +61,15 @@ StatusData_c aBALL_StatusData = {
|
||||
0, 13, 30, -10, 100,
|
||||
};
|
||||
|
||||
void aBALL_process_ground_init(ACTOR*, GAME*);
|
||||
void aBALL_process_air_water(ACTOR*, GAME*);
|
||||
void aBALL_process_ground_water(ACTOR*, GAME*);
|
||||
void aBALL_process_ground(ACTOR*, GAME*);
|
||||
void aBALL_process_air(ACTOR*, GAME*);
|
||||
void aBALL_process_air_water_init(ACTOR* actor, GAME*);
|
||||
void aBALL_process_ground_water_init(ACTOR* actor, GAME*);
|
||||
static void aBALL_process_ground_init(ACTOR*, GAME*);
|
||||
static void aBALL_process_air_water(ACTOR*, GAME*);
|
||||
static void aBALL_process_ground_water(ACTOR*, GAME*);
|
||||
static void aBALL_process_ground(ACTOR*, GAME*);
|
||||
static void aBALL_process_air(ACTOR*, GAME*);
|
||||
static void aBALL_process_air_water_init(ACTOR* actor, GAME*);
|
||||
static void aBALL_process_ground_water_init(ACTOR* actor, GAME*);
|
||||
|
||||
int aBALL_Random_pos_set(xyz_t* pos) {
|
||||
static int aBALL_Random_pos_set(xyz_t* pos) {
|
||||
int x_max;
|
||||
int z_max;
|
||||
int random_x;
|
||||
@@ -111,7 +112,7 @@ int aBALL_Random_pos_set(xyz_t* pos) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void aBALL_actor_ct(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_actor_ct(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
@@ -157,7 +158,7 @@ void aBALL_actor_ct(ACTOR* actor, GAME* game) {
|
||||
ball->unk20C = 0;
|
||||
}
|
||||
|
||||
void aBALL_actor_dt(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_actor_dt(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
if ((ball->unk208 & 1) || (ball->unk208 & 2) || (mRlib_Set_Position_Check(actor) == 0)) {
|
||||
@@ -169,7 +170,7 @@ void aBALL_actor_dt(ACTOR* actor, GAME* game) {
|
||||
ClObjPipe_dt(game, &ball->ball_pipe);
|
||||
}
|
||||
|
||||
void aBALL_position_move(BALL_ACTOR* actor) {
|
||||
static void aBALL_position_move(BALL_ACTOR* actor) {
|
||||
xyz_t pos;
|
||||
s_xyz angle;
|
||||
|
||||
@@ -195,7 +196,7 @@ void aBALL_position_move(BALL_ACTOR* actor) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_BGcheck(BALL_ACTOR* actor) {
|
||||
static void aBALL_BGcheck(BALL_ACTOR* actor) {
|
||||
f32 speed_y;
|
||||
s16 hit_angle;
|
||||
s16 rot;
|
||||
@@ -266,7 +267,7 @@ void aBALL_BGcheck(BALL_ACTOR* actor) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_OBJcheck(BALL_ACTOR* actor, GAME*) {
|
||||
static void aBALL_OBJcheck(BALL_ACTOR* actor, GAME*) {
|
||||
int wade;
|
||||
ACTOR* collided;
|
||||
xyz_t pos_speed;
|
||||
@@ -373,14 +374,14 @@ void aBALL_OBJcheck(BALL_ACTOR* actor, GAME*) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_House_Tree_Rev_Check(BALL_ACTOR* actor) {
|
||||
static void aBALL_House_Tree_Rev_Check(BALL_ACTOR* actor) {
|
||||
if (mRlib_HeightGapCheck_And_ReversePos(&actor->actor_class) != 1) {
|
||||
actor->unk208 |= 1;
|
||||
Actor_delete(&actor->actor_class);
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_process_air_init(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_air_init(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
f32 angle;
|
||||
@@ -395,7 +396,7 @@ void aBALL_process_air_init(ACTOR* actor, GAME* game) {
|
||||
ball->process_proc = aBALL_process_air;
|
||||
}
|
||||
|
||||
void aBALL_process_air(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_air(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
ball->ball_acceleration = 0.0f;
|
||||
@@ -414,7 +415,7 @@ void aBALL_process_air(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_process_ground_init(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_ground_init(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
actor->shape_info.draw_shadow = 1;
|
||||
@@ -426,7 +427,7 @@ void aBALL_process_ground_init(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_process_ground(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_ground(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
f32 temp;
|
||||
xyz_t norm;
|
||||
@@ -518,7 +519,7 @@ void aBALL_process_ground(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_set_spd_relations_in_water(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_set_spd_relations_in_water(ACTOR* actor, GAME* game) {
|
||||
static s16 angl_add_table[] = {
|
||||
0x100,
|
||||
0x400,
|
||||
@@ -559,14 +560,14 @@ void aBALL_set_spd_relations_in_water(ACTOR* actor, GAME* game) {
|
||||
ball->ball_acceleration = 0.1f;
|
||||
}
|
||||
|
||||
void aBALL_process_air_water_init(ACTOR* actor, GAME*) {
|
||||
static void aBALL_process_air_water_init(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
actor->shape_info.draw_shadow = 0;
|
||||
ball->process_proc = aBALL_process_air_water;
|
||||
}
|
||||
|
||||
void aBALL_process_air_water(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_air_water(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
f32 ball_speed;
|
||||
@@ -595,7 +596,7 @@ void aBALL_process_air_water(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_process_ground_water_init(ACTOR* actor, GAME*) {
|
||||
static void aBALL_process_ground_water_init(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
actor->shape_info.draw_shadow = 0;
|
||||
@@ -603,7 +604,7 @@ void aBALL_process_ground_water_init(ACTOR* actor, GAME*) {
|
||||
ball->process_proc = aBALL_process_ground_water;
|
||||
}
|
||||
|
||||
void aBALL_process_ground_water(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_process_ground_water(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
|
||||
u32 currentUT;
|
||||
@@ -643,7 +644,7 @@ void aBALL_process_ground_water(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_calc_axis(ACTOR* actor) {
|
||||
static void aBALL_calc_axis(ACTOR* actor) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
s16 angle;
|
||||
f32 speed_fact;
|
||||
@@ -658,7 +659,7 @@ void aBALL_calc_axis(ACTOR* actor) {
|
||||
mRlib_Roll_Matrix_to_s_xyz(actor, &ball->angle, angle);
|
||||
}
|
||||
|
||||
int aBALL_player_angle_distance_check(ACTOR* actor, PLAYER_ACTOR* player) {
|
||||
static int aBALL_player_angle_distance_check(ACTOR* actor, PLAYER_ACTOR* player) {
|
||||
f32 distance;
|
||||
s16 angle;
|
||||
int abs_angle;
|
||||
@@ -678,7 +679,7 @@ int aBALL_player_angle_distance_check(ACTOR* actor, PLAYER_ACTOR* player) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aBALL_status_check(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_status_check(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
PLAYER_ACTOR* player;
|
||||
@@ -731,7 +732,7 @@ void aBALL_status_check(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aBALL_actor_move(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_actor_move(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
@@ -757,7 +758,7 @@ void aBALL_actor_move(ACTOR* actor, GAME* game) {
|
||||
aBALL_status_check(actor, game);
|
||||
}
|
||||
|
||||
void aBALL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
static void aBALL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
BALL_ACTOR* ball = (BALL_ACTOR*)actor;
|
||||
GRAPH* graph;
|
||||
Gfx* gfx;
|
||||
|
||||
+5
-2
@@ -3,6 +3,8 @@
|
||||
#include "m_name_table.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aBRS_actor_ct(ACTOR*, GAME*);
|
||||
static void aBRS_actor_dt(ACTOR*, GAME*);
|
||||
@@ -43,6 +45,7 @@ extern Gfx obj_w_yamishop_window_model[];
|
||||
static void aBRS_set_bgOffset(STRUCTURE_ACTOR*, int);
|
||||
static void aBRS_setup_action(STRUCTURE_ACTOR* actor, int type);
|
||||
static void change_FGUnit(ACTOR*, int);
|
||||
static int aBRS_ctrl_light(STRUCTURE_ACTOR* shop);
|
||||
|
||||
static void aBRS_actor_ct(ACTOR* actor, GAME* game) {
|
||||
static cKF_Skeleton_R_c* skl[] = {
|
||||
@@ -90,7 +93,7 @@ static void aBRS_actor_ct(ACTOR* actor, GAME* game) {
|
||||
aBRS_setup_action(&shop->structure_class, action);
|
||||
cKF_SkeletonInfo_R_play(&shop->structure_class.keyframe);
|
||||
|
||||
shop->structure_class.arg0_f = aBRS_ctrl_light(actor) != 0 ? 1.0f : 0.0f;
|
||||
shop->structure_class.arg0_f = aBRS_ctrl_light((STRUCTURE_ACTOR*)actor) != 0 ? 1.0f : 0.0f;
|
||||
}
|
||||
|
||||
Door_data_c aBRS_br_shop_door_data = {
|
||||
@@ -104,7 +107,7 @@ static void aBRS_actor_dt(ACTOR* actor, GAME* game) {
|
||||
cKF_SkeletonInfo_R_dt(&shop->structure_class.keyframe);
|
||||
|
||||
if (Save_Get(event_save_data.special.event.broker.used) >= 3) {
|
||||
mEv_special_event_soldout(75);
|
||||
mEv_special_event_soldout(mEv_EVENT_BROKER_SALE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include "audio.h"
|
||||
#include "sys_math3d.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
extern Gfx obj_fallS_model[];
|
||||
extern Gfx obj_fallS_rainbowT_model[];
|
||||
|
||||
+1
-2
@@ -6,12 +6,12 @@
|
||||
#include "audio.h"
|
||||
#include "sys_math3d.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
extern Gfx obj_fallSESW_model[];
|
||||
extern Gfx obj_fallSE_rainbowT_model[];
|
||||
extern EVW_ANIME_DATA obj_fallSE_evw_anime;
|
||||
|
||||
|
||||
static void aFLEW_actor_move(ACTOR* actor, GAME* game);
|
||||
static void aFLEW_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
@@ -32,4 +32,3 @@ ACTOR_PROFILE FallSESW_Profile = {
|
||||
#include "../src/ac_fallSESW_move.c_inc"
|
||||
|
||||
#include "../src/ac_fallSESW_draw.c_inc"
|
||||
|
||||
|
||||
+26
-28
@@ -8,17 +8,20 @@
|
||||
#include "m_player_lib.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_debug.h"
|
||||
#include "m_needlework.h"
|
||||
#include "m_needlework_ovl.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
enum {
|
||||
aFLAG_ACTION_WAIT,
|
||||
aFLAG_ACTION_TALK,
|
||||
aFLAG_ACTION_TALK_END,
|
||||
aFLAG_ACTION_OPEN_WAIT,
|
||||
aFLAG_ACTION_END_WAIT,
|
||||
aFLAG_ACTION_UP,
|
||||
aFLAG_ACTION_DOWN,
|
||||
aFLAG_ACTION_WAIT,
|
||||
aFLAG_ACTION_TALK,
|
||||
aFLAG_ACTION_TALK_END,
|
||||
aFLAG_ACTION_OPEN_WAIT,
|
||||
aFLAG_ACTION_END_WAIT,
|
||||
aFLAG_ACTION_UP,
|
||||
aFLAG_ACTION_DOWN,
|
||||
|
||||
aFLAG_ACTION_NUM
|
||||
aFLAG_ACTION_NUM
|
||||
};
|
||||
|
||||
static void aFLAG_actor_ct(ACTOR* actor, GAME* game);
|
||||
@@ -37,20 +40,15 @@ ACTOR_PROFILE Flag_Profile = {
|
||||
&aFLAG_actor_dt,
|
||||
&aFLAG_actor_init,
|
||||
&aFLAG_actor_draw,
|
||||
NULL
|
||||
NULL,
|
||||
};
|
||||
|
||||
static u8 aFLAG_shadow_vtx_fix_flg_table[8] = { FALSE, TRUE, TRUE, FALSE, TRUE, FALSE, FALSE, TRUE };
|
||||
|
||||
extern Vtx obj_frag_shadow_v[];
|
||||
extern Gfx obj_frag_shadowT_model[];
|
||||
static bIT_ShadowData_c aFLAG_shadow_data = {
|
||||
8,
|
||||
aFLAG_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_frag_shadow_v,
|
||||
obj_frag_shadowT_model
|
||||
};
|
||||
static bIT_ShadowData_c aFLAG_shadow_data = { 8, aFLAG_shadow_vtx_fix_flg_table, 60.0f, obj_frag_shadow_v,
|
||||
obj_frag_shadowT_model };
|
||||
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_obj_s_frag;
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_obj_w_frag;
|
||||
@@ -248,12 +246,17 @@ static void aFLAG_up(STRUCTURE_ACTOR* flag, GAME_PLAY* game_play) {
|
||||
flag->arg1_f = starting_x + (normalized_x_length * flag->arg1 * flag->arg1);
|
||||
} else if (flag->arg1 <= second_point_frame) {
|
||||
normalized_x_length = (middle_x - starting_x) / (second_point_frame * (first_point_frame - second_point_frame));
|
||||
flag->arg1_f = middle_x + (normalized_x_length * (flag->arg1 - second_point_frame) * (flag->arg1 - second_point_frame));
|
||||
flag->arg1_f =
|
||||
middle_x + (normalized_x_length * (flag->arg1 - second_point_frame) * (flag->arg1 - second_point_frame));
|
||||
} else if (flag->arg1 <= third_point_frame) {
|
||||
normalized_x_length = (ending_x - middle_x) / ((third_point_frame - second_point_frame) * (ending_frame - second_point_frame));
|
||||
flag->arg1_f = middle_x + (normalized_x_length * (flag->arg1 - second_point_frame) * (flag->arg1 - second_point_frame));
|
||||
normalized_x_length =
|
||||
(ending_x - middle_x) / ((third_point_frame - second_point_frame) * (ending_frame - second_point_frame));
|
||||
flag->arg1_f =
|
||||
middle_x + (normalized_x_length * (flag->arg1 - second_point_frame) * (flag->arg1 - second_point_frame));
|
||||
} else {
|
||||
normalized_x_length = (ending_x - middle_x) / ((ending_frame - second_point_frame) * ((third_point_frame - second_point_frame) - (ending_frame - second_point_frame)));
|
||||
normalized_x_length =
|
||||
(ending_x - middle_x) / ((ending_frame - second_point_frame) *
|
||||
((third_point_frame - second_point_frame) - (ending_frame - second_point_frame)));
|
||||
flag->arg1_f = ending_x + (normalized_x_length * (flag->arg1 - ending_frame) * (flag->arg1 - ending_frame));
|
||||
}
|
||||
|
||||
@@ -307,7 +310,8 @@ static void aFLAG_down(STRUCTURE_ACTOR* flag, GAME_PLAY* game_play) {
|
||||
flag->arg1_f = ending_x + (flag->arg1 * (normalized_x_length * flag->arg1));
|
||||
} else {
|
||||
normalized_x_length = -(x_length / (ending_frame * (midpoint_frame - ending_frame)));
|
||||
flag->arg1_f = starting_x + (normalized_x_length * (flag->arg1 - ending_frame) * (flag->arg1 - ending_frame));
|
||||
flag->arg1_f =
|
||||
starting_x + (normalized_x_length * (flag->arg1 - ending_frame) * (flag->arg1 - ending_frame));
|
||||
}
|
||||
|
||||
flag->arg1 += 1;
|
||||
@@ -320,13 +324,7 @@ static void aFLAG_down(STRUCTURE_ACTOR* flag, GAME_PLAY* game_play) {
|
||||
|
||||
static void aFLAG_setup_action(STRUCTURE_ACTOR* flag, int action) {
|
||||
static aSTR_MOVE_PROC process[aFLAG_ACTION_NUM] = {
|
||||
&aFLAG_wait,
|
||||
&aFLAG_talk,
|
||||
&aFLAG_talk_end,
|
||||
&aFLAG_menu_open_wait,
|
||||
&aFLAG_menu_end_wait,
|
||||
&aFLAG_up,
|
||||
&aFLAG_down
|
||||
&aFLAG_wait, &aFLAG_talk, &aFLAG_talk_end, &aFLAG_menu_open_wait, &aFLAG_menu_end_wait, &aFLAG_up, &aFLAG_down
|
||||
};
|
||||
|
||||
flag->action_proc = process[action];
|
||||
|
||||
+13
-17
@@ -6,11 +6,11 @@
|
||||
#include "m_collision_bg.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aKAG_actor_ct(ACTOR*,GAME*);
|
||||
static void aKAG_actor_init(ACTOR*,GAME*);
|
||||
static void aKAG_actor_draw(ACTOR*,GAME*);
|
||||
|
||||
static void aKAG_actor_ct(ACTOR*, GAME*);
|
||||
static void aKAG_actor_init(ACTOR*, GAME*);
|
||||
static void aKAG_actor_draw(ACTOR*, GAME*);
|
||||
|
||||
ACTOR_PROFILE Kago_Profile = {
|
||||
mAc_PROFILE_KAGO,
|
||||
@@ -23,34 +23,30 @@ ACTOR_PROFILE Kago_Profile = {
|
||||
NONE_ACTOR_PROC,
|
||||
&aKAG_actor_init,
|
||||
&aKAG_actor_draw,
|
||||
NULL
|
||||
NULL,
|
||||
};
|
||||
|
||||
extern Vtx obj_e_kago_shadow_v[];
|
||||
extern Gfx obj_e_kago_shadow_model[];
|
||||
|
||||
u8 aKAG_shadow_vtx_fix_flg_table[] = {1,0,0,1,1,0,0,1,0,1,0,0,1};
|
||||
u8 aKAG_shadow_vtx_fix_flg_table[] = { 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 0, 0, 1 };
|
||||
bIT_ShadowData_c aKAG_shadow_data = {
|
||||
13,
|
||||
aKAG_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_e_kago_shadow_v,
|
||||
obj_e_kago_shadow_model,
|
||||
13, aKAG_shadow_vtx_fix_flg_table, 60.0f, obj_e_kago_shadow_v, obj_e_kago_shadow_model,
|
||||
};
|
||||
|
||||
void aKAG_set_bgOffset(KAGO_ACTOR*, int);
|
||||
void aKAG_setup_action(KAGO_ACTOR*, int);
|
||||
static void aKAG_set_bgOffset(KAGO_ACTOR*, int);
|
||||
static void aKAG_setup_action(KAGO_ACTOR*, int);
|
||||
|
||||
void aKAG_actor_ct(ACTOR* actor, GAME*){
|
||||
static void aKAG_actor_ct(ACTOR* actor, GAME* game) {
|
||||
KAGO_ACTOR* kago = (KAGO_ACTOR*)actor;
|
||||
|
||||
kago->structure_class.action = actor->npc_id - SPORTSFAIR_BASKET_RED;
|
||||
kago->structure_class.structure_type = kago->structure_class.action + aSTR_TYPE_SPORTSFAIR_A;
|
||||
kago->structure_class.structure_pal = kago->structure_class.action + aSTR_PAL_KAGO_R;
|
||||
aKAG_setup_action(kago,0);
|
||||
aKAG_set_bgOffset(kago,1);
|
||||
aKAG_setup_action(kago, 0);
|
||||
aKAG_set_bgOffset(kago, 1);
|
||||
}
|
||||
|
||||
#include "../src/ac_kago_move.c_inc"
|
||||
|
||||
#include "../src/ac_kago_draw.c_inc"
|
||||
#include "../src/ac_kago_draw.c_inc"
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
void aKAG_set_bgOffset(KAGO_ACTOR* actor, int id) {
|
||||
static void aKAG_set_bgOffset(KAGO_ACTOR* actor, int id) {
|
||||
id = id == 0 ? 10 : 10;
|
||||
|
||||
mCoBG_SetPlussOffset(actor->structure_class.actor_class.home.position, id, 100);
|
||||
}
|
||||
|
||||
void aKAG_wait(STRUCTURE_ACTOR* actorx, GAME_PLAY* play) {
|
||||
static void aKAG_wait(STRUCTURE_ACTOR* actorx, GAME_PLAY* play) {
|
||||
}
|
||||
|
||||
void aKAG_setup_action(KAGO_ACTOR* kago, int id) {
|
||||
static void aKAG_setup_action(KAGO_ACTOR* kago, int id) {
|
||||
static aSTR_MOVE_PROC process[] = {
|
||||
aKAG_wait,
|
||||
};
|
||||
@@ -16,7 +16,7 @@ void aKAG_setup_action(KAGO_ACTOR* kago, int id) {
|
||||
kago->structure_class.arg0 = id;
|
||||
}
|
||||
|
||||
void aKAG_actor_move(ACTOR* actor, GAME* game) {
|
||||
static void aKAG_actor_move(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
KAGO_ACTOR* kago = (KAGO_ACTOR*)actor;
|
||||
|
||||
@@ -40,9 +40,9 @@ void aKAG_actor_move(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
void aKAG_actor_init(ACTOR* actor, GAME* game) {
|
||||
static void aKAG_actor_init(ACTOR* actor, GAME* game) {
|
||||
|
||||
mFI_SetFG_common(0xF111, actor->home.position, 0);
|
||||
aKAG_actor_move(actor, game);
|
||||
actor->mv_proc = aKAG_actor_move;
|
||||
}
|
||||
}
|
||||
|
||||
+5
-4
@@ -5,6 +5,7 @@
|
||||
#include "m_field_info.h"
|
||||
#include "m_demo.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_msg.h"
|
||||
|
||||
extern void aNP_actor_init(ACTOR* actor, GAME* game);
|
||||
|
||||
@@ -34,7 +35,7 @@ static void aNP_set_talk_info(ACTOR* actor) {
|
||||
mDemo_Set_camera(TRUE);
|
||||
mPlib_Set_able_hand_all_item_in_demo(TRUE);
|
||||
color.r = 205;
|
||||
color.g = 120;
|
||||
color.g = 120;
|
||||
color.b = 0;
|
||||
color.a = 255;
|
||||
mDemo_Set_talk_window_color(&color);
|
||||
@@ -45,9 +46,9 @@ static void aNP_actor_move(ACTOR* actor, GAME_PLAY* play) {
|
||||
s16 player_angle;
|
||||
int angle;
|
||||
|
||||
if ((mDemo_Check(7, actor) == 0) && (mDemo_Check(8,actor) == 0)) {
|
||||
if ((mDemo_Check(7, actor) == 0) && (mDemo_Check(8, actor) == 0)) {
|
||||
player = GET_PLAYER_ACTOR(play);
|
||||
if ((player != NULL) && (player->actor_class.world.position.z >= actor->world.position.z)) {
|
||||
if ((player != NULL) && (player->actor_class.world.position.z >= actor->world.position.z)) {
|
||||
player_angle = actor->player_angle_y;
|
||||
angle = (player_angle >= 0) ? player_angle : -player_angle;
|
||||
if (angle < 0x2000) {
|
||||
@@ -59,7 +60,7 @@ static void aNP_actor_move(ACTOR* actor, GAME_PLAY* play) {
|
||||
|
||||
extern void aNP_actor_init(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
|
||||
mFI_SetFG_common(DUMMY_NAMEPLATE, actor->home.position, 0);
|
||||
aNP_actor_move(actor, play);
|
||||
actor->mv_proc = (mActor_proc)(aNP_actor_move);
|
||||
|
||||
+4
-1
@@ -7,6 +7,9 @@
|
||||
#include "m_bgm.h"
|
||||
#include "m_soncho.h"
|
||||
#include "m_card.h"
|
||||
#include "boot.h"
|
||||
#include "m_string.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
extern void aNRTC_actor_ct(ACTOR*, GAME*);
|
||||
extern void aNRTC_actor_dt(ACTOR*, GAME*);
|
||||
@@ -111,4 +114,4 @@ void aNRTC_actor_draw(ACTOR* actor, GAME* game) {
|
||||
|
||||
#include "../src/ac_npc_rtc_think.c.inc"
|
||||
|
||||
#include "../src/ac_npc_rtc_talk.c.inc"
|
||||
#include "../src/ac_npc_rtc_talk.c.inc"
|
||||
|
||||
+160
-167
@@ -1,33 +1,30 @@
|
||||
|
||||
void aNRTC_set_slot_name(int slot_id, int str_no) {
|
||||
static void aNRTC_set_slot_name(int slot_id, int str_no) {
|
||||
u8 name[mIN_ITEM_NAME_LEN];
|
||||
|
||||
mString_Load_StringFromRom(name, sizeof(name), 0x6CD + slot_id);
|
||||
mMsg_Set_free_str(mMsg_Get_base_window_p(),str_no, name, sizeof(name));
|
||||
mMsg_Set_free_str(mMsg_Get_base_window_p(), str_no, name, sizeof(name));
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_rtc_err(NPCRTC_ACTOR* rtc, GAME_PLAY*) {
|
||||
static void aNRTC_rtc_err(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
aNRTC_change_talk_proc(rtc, 3);
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 1;
|
||||
aNRTC_change_talk_proc(rtc, 10);
|
||||
break;
|
||||
switch (num) {
|
||||
case 0:
|
||||
aNRTC_change_talk_proc(rtc, 3);
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 1;
|
||||
aNRTC_change_talk_proc(rtc, 10);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_timer_open_msg_wait(NPCRTC_ACTOR* rtc, GAME_PLAY*) {
|
||||
static void aNRTC_timer_open_msg_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int order = mDemo_Get_OrderValue(4, 9);
|
||||
|
||||
|
||||
if (order == 1) {
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
mDemo_Set_OrderValue(4, 9, 0);
|
||||
@@ -37,30 +34,28 @@ void aNRTC_timer_open_msg_wait(NPCRTC_ACTOR* rtc, GAME_PLAY*) {
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_timer_open_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play){
|
||||
Submenu* submenu = &play->submenu;
|
||||
static void aNRTC_timer_open_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
Submenu* submenu = &play->submenu;
|
||||
if (mMsg_Check_main_wait(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 5);
|
||||
mSM_open_submenu(submenu, 3, 1, 0);
|
||||
mMsg_request_main_appear_wait_type1(mMsg_Get_base_window_p());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_timer_close_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
if (play->submenu.open_flag == FALSE) {
|
||||
static void aNRTC_timer_close_wait(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
if (play->submenu.open_flag == FALSE) {
|
||||
if (mMsg_Check_not_series_main_wait(mMsg_Get_base_window_p()) == 1) {
|
||||
mMsg_Set_ForceNext(mMsg_Get_base_window_p());
|
||||
mMsg_Set_ForceNext(mMsg_Get_base_window_p());
|
||||
rtc->unk9A8 = 2;
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNRTC_delete_bf(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int order = mDemo_Get_OrderValue(4, 9);
|
||||
|
||||
void aNRTC_delete_bf(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int order = mDemo_Get_OrderValue(4, 9);
|
||||
|
||||
if ((mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) && (order != 0)) {
|
||||
|
||||
mMsg_Set_LockContinue(mMsg_Get_base_window_p());
|
||||
@@ -68,8 +63,7 @@ void aNRTC_delete_bf(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play){
|
||||
static void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
mMsg_Window_c* window;
|
||||
int card;
|
||||
int card_ret;
|
||||
@@ -77,7 +71,7 @@ void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play){
|
||||
window = mMsg_Get_base_window_p();
|
||||
card_ret = mCD_EraseBrokenLand_bg(&card);
|
||||
|
||||
switch(card_ret){
|
||||
switch (card_ret) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
mMsg_Set_continue_msg_num(window, 0x9DE);
|
||||
@@ -97,135 +91,138 @@ void aNRTC_delete(NPCRTC_ACTOR* rtc, GAME_PLAY* play){
|
||||
rtc->unk9A8 = 1;
|
||||
mMsg_Set_continue_msg_num(window, 0x9DF);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(card_ret != 0x19){
|
||||
if (card_ret != 0x19) {
|
||||
mMsg_Unset_LockContinue(window);
|
||||
aNRTC_change_talk_proc(rtc,10);
|
||||
aNRTC_change_talk_proc(rtc, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_format_chk(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
static void aNRTC_format_chk(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 2;
|
||||
break;
|
||||
case 2:
|
||||
rtc->unk9A8 = 1;
|
||||
break;
|
||||
case 3:
|
||||
rtc->unk9A8 = 3;
|
||||
aNRTC_change_talk_proc(rtc, 9);
|
||||
break;
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 2;
|
||||
break;
|
||||
case 2:
|
||||
rtc->unk9A8 = 1;
|
||||
break;
|
||||
case 3:
|
||||
rtc->unk9A8 = 3;
|
||||
aNRTC_change_talk_proc(rtc, 9);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_format(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
static void aNRTC_format(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int order;
|
||||
mMsg_Window_c* window;
|
||||
int card_ret;
|
||||
|
||||
window = mMsg_Get_base_window_p();
|
||||
order = mDemo_Get_OrderValue(4, 9);
|
||||
switch (order) {
|
||||
case 1:
|
||||
mDemo_Set_OrderValue(4, 9, 2);
|
||||
mMsg_Set_LockContinue(window);
|
||||
break;
|
||||
case 2:
|
||||
card_ret = mCD_card_format_bg(Common_Get(memcard_slot));
|
||||
switch (card_ret) {
|
||||
case 1:
|
||||
mMsg_Set_continue_msg_num(window, 0x9E9);
|
||||
mMsg_Unset_LockContinue(window);
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
rtc->unk9A8 = 3;
|
||||
mDemo_Set_OrderValue(4, 9, 0);
|
||||
break;
|
||||
case -1:
|
||||
mMsg_Unset_LockContinue(window);
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
rtc->unk9A8 = 1;
|
||||
mMsg_Set_continue_msg_num(window, 0x9E7);
|
||||
mDemo_Set_OrderValue(4, 9, 0);
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_break_data(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
switch (order) {
|
||||
case 1:
|
||||
aNRTC_change_talk_proc(rtc, 6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_break_data_2(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 2;
|
||||
mDemo_Set_OrderValue(4, 9, 2);
|
||||
mMsg_Set_LockContinue(window);
|
||||
break;
|
||||
case 2:
|
||||
rtc->unk9A8 = 1;
|
||||
card_ret = mCD_card_format_bg(Common_Get(memcard_slot));
|
||||
switch (card_ret) {
|
||||
case 1:
|
||||
mMsg_Set_continue_msg_num(window, 0x9E9);
|
||||
mMsg_Unset_LockContinue(window);
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
rtc->unk9A8 = 3;
|
||||
mDemo_Set_OrderValue(4, 9, 0);
|
||||
break;
|
||||
case -1:
|
||||
mMsg_Unset_LockContinue(window);
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
rtc->unk9A8 = 1;
|
||||
mMsg_Set_continue_msg_num(window, 0x9E7);
|
||||
mDemo_Set_OrderValue(4, 9, 0);
|
||||
case 0:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
rtc->unk9A8 = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNRTC_break_data(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
case 1:
|
||||
aNRTC_change_talk_proc(rtc, 6);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_change_talk_proc(NPCRTC_ACTOR* rtc, int idx) {
|
||||
static void aNRTC_break_data_2(NPCRTC_ACTOR* rtc, GAME_PLAY* play) {
|
||||
int num;
|
||||
|
||||
if (mMsg_Check_MainNormalContinue(mMsg_Get_base_window_p()) == 1) {
|
||||
aNRTC_change_talk_proc(rtc, 0xA);
|
||||
num = mChoice_Get_ChoseNum(mChoice_Get_base_window_p());
|
||||
switch (num) {
|
||||
case 0:
|
||||
rtc->unk9A8 = 3;
|
||||
break;
|
||||
case 1:
|
||||
rtc->unk9A8 = 2;
|
||||
break;
|
||||
case 2:
|
||||
rtc->unk9A8 = 1;
|
||||
break;
|
||||
case 3:
|
||||
rtc->unk9A8 = 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNRTC_change_talk_proc(NPCRTC_ACTOR* rtc, int idx) {
|
||||
static aNPCRTC_SUB_PROC process[] = {
|
||||
aNRTC_break_data, aNRTC_break_data_2, aNRTC_rtc_err, aNRTC_timer_open_msg_wait,
|
||||
aNRTC_timer_open_wait, aNRTC_timer_close_wait, aNRTC_delete_bf, aNRTC_delete,
|
||||
aNRTC_format_chk, aNRTC_format, (aNPCRTC_SUB_PROC)none_proc1,
|
||||
aNRTC_break_data,
|
||||
aNRTC_break_data_2,
|
||||
aNRTC_rtc_err,
|
||||
aNRTC_timer_open_msg_wait,
|
||||
aNRTC_timer_open_wait,
|
||||
aNRTC_timer_close_wait,
|
||||
aNRTC_delete_bf,
|
||||
aNRTC_delete,
|
||||
aNRTC_format_chk,
|
||||
aNRTC_format,
|
||||
(aNPCRTC_SUB_PROC)none_proc1,
|
||||
};
|
||||
rtc->unk994 = idx;
|
||||
rtc->unk99C = process[idx];
|
||||
rtc->unk99C = process[idx];
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_set_talk_info_talk_request(){
|
||||
static void aNRTC_set_talk_info_talk_request() {
|
||||
int msg;
|
||||
|
||||
switch(Common_Get(save_error_type)){
|
||||
|
||||
switch (Common_Get(save_error_type)) {
|
||||
case 0:
|
||||
msg = 0x9CC;
|
||||
break;
|
||||
break;
|
||||
case 2:
|
||||
msg = 0x9D1;
|
||||
break;
|
||||
@@ -257,81 +254,77 @@ void aNRTC_set_talk_info_talk_request(){
|
||||
msg = 0x9D4;
|
||||
break;
|
||||
}
|
||||
mDemo_Set_msg_num(msg);
|
||||
mDemo_Set_msg_num(msg);
|
||||
mDemo_Set_camera(1);
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_talk_request(ACTOR* actor,GAME*) {
|
||||
static void aNRTC_talk_request(ACTOR* actor, GAME* game) {
|
||||
mDemo_Request(8, actor, aNRTC_set_talk_info_talk_request);
|
||||
}
|
||||
|
||||
|
||||
int aNRTC_talk_init(ACTOR* actor, GAME* game) {
|
||||
static int aNRTC_talk_init(ACTOR* actor, GAME* game) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
|
||||
|
||||
mDemo_Set_ListenAble();
|
||||
aNRTC_set_slot_name(Common_Get(memcard_slot), mMsg_FREE_STR4);
|
||||
switch (Common_Get(save_error_type)) {
|
||||
case 0:
|
||||
aNRTC_change_talk_proc(rtc, 2);
|
||||
break;
|
||||
case 2:
|
||||
aNRTC_change_talk_proc(rtc, 0);
|
||||
break;
|
||||
case 5:
|
||||
aNRTC_change_talk_proc(rtc, 8);
|
||||
break;
|
||||
default:
|
||||
aNRTC_change_talk_proc(rtc, 1);
|
||||
break;
|
||||
switch (Common_Get(save_error_type)) {
|
||||
case 0:
|
||||
aNRTC_change_talk_proc(rtc, 2);
|
||||
break;
|
||||
case 2:
|
||||
aNRTC_change_talk_proc(rtc, 0);
|
||||
break;
|
||||
case 5:
|
||||
aNRTC_change_talk_proc(rtc, 8);
|
||||
break;
|
||||
default:
|
||||
aNRTC_change_talk_proc(rtc, 1);
|
||||
break;
|
||||
}
|
||||
rtc->npc_class.talk_info.talk_request_proc = mActor_NONE_PROC1;
|
||||
mMsg_Set_idling_req(mMsg_Get_base_window_p());
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
int aNRTC_talk_end_chk(ACTOR* actor,GAME* game){
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int res = 0;
|
||||
mMsg_Window_c* window;
|
||||
static int aNRTC_talk_end_chk(ACTOR* actor, GAME* game) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int res = 0;
|
||||
mMsg_Window_c* window;
|
||||
|
||||
window = mMsg_Get_base_window_p();
|
||||
rtc->unk99C(rtc,play);
|
||||
|
||||
if(mMsg_Check_idling_now(window) == 1){
|
||||
rtc->unk99C(rtc, play);
|
||||
|
||||
if (mMsg_Check_idling_now(window) == 1) {
|
||||
mMsg_request_main_disappear_wait_type1(window);
|
||||
aNRTC_think_init_proc(&rtc->npc_class,play);
|
||||
rtc->unk9A0 = 0;
|
||||
aNRTC_think_init_proc(&rtc->npc_class, play);
|
||||
rtc->unk9A0 = 0;
|
||||
res = 1;
|
||||
rtc->unk9B4 = 0x32;
|
||||
rtc->unk9B0 = 0x4B;
|
||||
bzero(&play->fade_color_value, sizeof(rgba8888_t));
|
||||
}
|
||||
else{
|
||||
int unk9AC;
|
||||
rtc->unk9B4 = 0x32;
|
||||
rtc->unk9B0 = 0x4B;
|
||||
bzero(&play->fade_color_value, sizeof(rgba8888_t));
|
||||
} else {
|
||||
int unk9AC;
|
||||
unk9AC = rtc->unk9AC;
|
||||
if ((mMsg_Check_MainNormal(mMsg_Get_base_window_p()) == 1) || (((mChoice_check_main_normal(mChoice_Get_base_window_p()) == 1) != 0))) {
|
||||
if ((mMsg_Check_MainNormal(mMsg_Get_base_window_p()) == 1) ||
|
||||
(((mChoice_check_main_normal(mChoice_Get_base_window_p()) == 1) != 0))) {
|
||||
unk9AC++;
|
||||
if (unk9AC > 0x258) {
|
||||
unk9AC = 0x258;
|
||||
}
|
||||
} else {
|
||||
unk9AC = 0;
|
||||
}
|
||||
}
|
||||
if (mDemo_Get_OrderValue(4, 0) == 0) {
|
||||
if (unk9AC >= 0x258) {
|
||||
if ( rtc->npc_class.draw.animation_id != 0x76) {
|
||||
if (unk9AC >= 0x258) {
|
||||
if (rtc->npc_class.draw.animation_id != 0x76) {
|
||||
mDemo_Set_OrderValue(4, 0, 0xFF);
|
||||
}
|
||||
} else if (rtc->npc_class.draw.animation_id == 0x76) {
|
||||
mDemo_Set_OrderValue(4, 0, 0xFD);
|
||||
}
|
||||
}
|
||||
rtc->unk9AC = unk9AC;
|
||||
rtc->unk9AC = unk9AC;
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
+48
-64
@@ -1,116 +1,101 @@
|
||||
|
||||
void aNRTC_talk_request(ACTOR* actor,GAME*);
|
||||
static void aNRTC_talk_request(ACTOR* actor, GAME*);
|
||||
|
||||
void aNRTC_think_start(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_think_start(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
if(rtc->unk9B8 > 0){
|
||||
if (rtc->unk9B8 > 0) {
|
||||
rtc->unk9B8--;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
rtc->unk9A0 = 1;
|
||||
rtc->npc_class.talk_info.talk_request_proc = aNRTC_talk_request;
|
||||
rtc->npc_class.condition_info.demo_flg = 0x100;
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_think_title(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_think_title(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
|
||||
|
||||
play->fb_wipe_type = 3;
|
||||
play->fb_fade_type = 4;
|
||||
mPlib_request_main_invade_type1(play);
|
||||
Actor_info_save_actor(play);
|
||||
rtc->unk9A8 = 5;
|
||||
rtc->unk9A8 = 5;
|
||||
}
|
||||
Door_data_c door_data = {
|
||||
SCENE_PLAYERSELECT,
|
||||
4,
|
||||
FALSE,
|
||||
0,
|
||||
{100,0,120},
|
||||
EMPTY_NO,
|
||||
3,
|
||||
{0,0,0}
|
||||
};
|
||||
|
||||
void aNRTC_think_door(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
|
||||
Door_data_c door_data = { SCENE_PLAYERSELECT, 4, FALSE, 0, { 100, 0, 120 }, EMPTY_NO, 3, { 0, 0, 0 } };
|
||||
|
||||
static void aNRTC_think_door(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
|
||||
if (sAdo_BgmFadeoutCheck() != 0) {
|
||||
goto_other_scene(play, &door_data, 1);
|
||||
Common_Set(transition.wipe_type,3);
|
||||
Common_Set(transition.wipe_type, 3);
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_think_check(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_think_check(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
if (sAdo_BgmFadeoutCheck() != 0) {
|
||||
goto_other_scene(play, &door_data, 1);
|
||||
mCD_ReCheckLoadLand(play);
|
||||
Common_Set(transition.wipe_type,3);
|
||||
Common_Set(transition.wipe_type, 3);
|
||||
rtc->unk9A8 = 5;
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_think_ipmenu(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
static void aNRTC_think_ipmenu(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
if (sAdo_BgmFadeoutCheck() != 0) {
|
||||
HotResetIplMenu();
|
||||
rtc->unk9A8 = 5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
aNPC_SUB_PROC aNRTC_proc_table[] = {
|
||||
aNRTC_think_start,
|
||||
aNRTC_think_title,
|
||||
aNRTC_think_door,
|
||||
aNRTC_think_check,
|
||||
aNRTC_think_ipmenu,
|
||||
(aNPC_SUB_PROC)mActor_NONE_PROC1,
|
||||
aNRTC_think_start, aNRTC_think_title, aNRTC_think_door,
|
||||
aNRTC_think_check, aNRTC_think_ipmenu, (aNPC_SUB_PROC)mActor_NONE_PROC1,
|
||||
};
|
||||
|
||||
void aNRTC_think_main_proc(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_think_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
if(rtc->unk9B0 > 0){
|
||||
if (rtc->unk9B0 > 0) {
|
||||
rtc->unk9B0--;
|
||||
if(rtc->unk9B0 == 0){
|
||||
play->fade_color_value.c.a = -1;
|
||||
}
|
||||
else if(rtc->unk9B0 < 25){
|
||||
play->fade_color_value.c.a = 255.0f * (1.0f - (0.04f * rtc->unk9B0));
|
||||
if (rtc->unk9B0 == 0) {
|
||||
play->fade_color_value.c.a = -1;
|
||||
} else if (rtc->unk9B0 < 25) {
|
||||
play->fade_color_value.c.a = 255.0f * (1.0f - (0.04f * rtc->unk9B0));
|
||||
}
|
||||
} else if (rtc->unk9A0 == 0) {
|
||||
aNRTC_proc_table[rtc->unk9A8](actor, play);
|
||||
}
|
||||
else if(rtc->unk9A0 == 0){
|
||||
aNRTC_proc_table[rtc->unk9A8](actor,play);
|
||||
}
|
||||
if(rtc->unk9B4 == 0){
|
||||
if(rtc->unk9A8 == 1){
|
||||
if (rtc->unk9B4 == 0) {
|
||||
if (rtc->unk9A8 == 1) {
|
||||
mBGMPsComp_make_ps_wipe(0x21C2);
|
||||
} else {
|
||||
mBGMPsComp_make_ps_wipe(0x621C);
|
||||
}
|
||||
}
|
||||
rtc->unk9B4 = -2;
|
||||
}
|
||||
else if(rtc->unk9B4 > 0){
|
||||
} else if (rtc->unk9B4 > 0) {
|
||||
rtc->unk9B4--;
|
||||
}
|
||||
}
|
||||
|
||||
void aNRTC_think_init_proc(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_think_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
rtc->npc_class.request.act_priority = 4;
|
||||
rtc->npc_class.request.act_idx = 8;
|
||||
rtc->npc_class.request.act_type = 0;
|
||||
}
|
||||
|
||||
void aNRTC_think_proc(NPC_ACTOR* actor, GAME_PLAY* play,int idx){
|
||||
static aNPC_SUB_PROC think_proc[] = { aNRTC_think_init_proc, aNRTC_think_main_proc,};
|
||||
static void aNRTC_think_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
|
||||
static aNPC_SUB_PROC think_proc[] = {
|
||||
aNRTC_think_init_proc,
|
||||
aNRTC_think_main_proc,
|
||||
};
|
||||
|
||||
think_proc[idx](actor,play);
|
||||
think_proc[idx](actor, play);
|
||||
}
|
||||
|
||||
|
||||
void aNRTC_schedule_init_proc(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
static void aNRTC_schedule_init_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
rtc->npc_class.draw._5BE = 1;
|
||||
rtc->npc_class.talk_info.default_animation = 0x76;
|
||||
@@ -118,20 +103,19 @@ void aNRTC_schedule_init_proc(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
rtc->unk9B0 = 0;
|
||||
rtc->unk9B8 = 0x5A;
|
||||
rtc->npc_class.think.think_proc = aNRTC_think_proc;
|
||||
rtc->unk9A8 = 0;
|
||||
Common_Get(clip.npc_clip)->think_proc(actor,play,6,0);
|
||||
rtc->unk9A8 = 0;
|
||||
Common_Get(clip.npc_clip)->think_proc(actor, play, 6, 0);
|
||||
}
|
||||
|
||||
void aNRTC_schedule_main_proc(NPC_ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
static void aNRTC_schedule_main_proc(NPC_ACTOR* actor, GAME_PLAY* play) {
|
||||
NPCRTC_ACTOR* rtc = (NPCRTC_ACTOR*)actor;
|
||||
if(Common_Get(clip.npc_clip)->think_proc(actor,play,-1,1) == 0){
|
||||
Common_Get(clip.npc_clip)->think_proc(actor,play,-1,2);
|
||||
if (Common_Get(clip.npc_clip)->think_proc(actor, play, -1, 1) == 0) {
|
||||
Common_Get(clip.npc_clip)->think_proc(actor, play, -1, 2);
|
||||
}
|
||||
}
|
||||
|
||||
static void aNRTC_schedule_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx) {
|
||||
static aNPC_SUB_PROC sche_proc[] = { aNRTC_schedule_init_proc, aNRTC_schedule_main_proc };
|
||||
|
||||
void aNRTC_schedule_proc(NPC_ACTOR* actor, GAME_PLAY* play, int idx){
|
||||
static aNPC_SUB_PROC sche_proc[] = {aNRTC_schedule_init_proc,aNRTC_schedule_main_proc};
|
||||
|
||||
sche_proc[idx](actor,play);
|
||||
}
|
||||
sche_proc[idx](actor, play);
|
||||
}
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
#include "m_snowman.h"
|
||||
#include "m_quest.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aPSM_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aPSM_actor_dt(ACTOR* actor, GAME* game);
|
||||
@@ -75,8 +75,8 @@ static void aPSM_actor_ct(ACTOR* actor, GAME* game) {
|
||||
mCoBG_SetPlussOffset(actor->home.position, 3, 100);
|
||||
}
|
||||
|
||||
static void aPSM_actor_dt(ACTOR* actor, GAME* game) {
|
||||
mCoBG_SetPlussOffset(actor->home.position, 0, 100);
|
||||
static void aPSM_actor_dt(ACTOR* actor, GAME* game) {
|
||||
mCoBG_SetPlussOffset(actor->home.position, 0, 100);
|
||||
}
|
||||
|
||||
static void aPSM_set_talk_info(ACTOR* actor) {
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
#include "m_common_data.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_item_name.h"
|
||||
#include "m_msg.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aRSV_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aRSV_actor_init(ACTOR* actor, GAME* game);
|
||||
|
||||
+29
-37
@@ -4,6 +4,7 @@
|
||||
#include "m_name_table.h"
|
||||
#include "m_field_info.h"
|
||||
#include "m_event.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
static void aRP_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aRP_actor_dt(ACTOR* actor, GAME* game);
|
||||
@@ -24,93 +25,85 @@ ACTOR_PROFILE Rope_Profile = {
|
||||
};
|
||||
|
||||
extern Vtx tol_rope_1_v[0x3C];
|
||||
extern Gfx tol_rope_1T_model[];
|
||||
extern Gfx tol_rope_1T_model[];
|
||||
extern Gfx tol_rope_1_shadowT_model[];
|
||||
|
||||
void aRP_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void aRP_actor_ct(ACTOR* actor, GAME* game) {
|
||||
|
||||
xyz_t world;
|
||||
xyz_t world;
|
||||
xyz_t pos = actor->world.position;
|
||||
|
||||
int i;
|
||||
mFI_Wpos2UtCenterWpos(&world, pos);
|
||||
|
||||
world.x -= 40.0f;
|
||||
for(i = 0; i < 3; i++){
|
||||
world.x -= 40.0f;
|
||||
for (i = 0; i < 3; i++) {
|
||||
mCoBG_SetPlussOffset(world, 2, 100);
|
||||
world.x += 40.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void aRP_actor_dt(ACTOR* actor, GAME* game){
|
||||
static void aRP_actor_dt(ACTOR* actor, GAME* game) {
|
||||
|
||||
xyz_t world;
|
||||
xyz_t world;
|
||||
xyz_t pos = actor->world.position;
|
||||
|
||||
int i;
|
||||
mFI_Wpos2UtCenterWpos(&world, pos);
|
||||
|
||||
world.x -= 40.0f;
|
||||
for(i = 0; i < 3; i++){
|
||||
world.x -= 40.0f;
|
||||
for (i = 0; i < 3; i++) {
|
||||
mCoBG_SetPlussOffset(world, 0, 100);
|
||||
world.x += 40.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void aRP_make_vtx(Vtx* vtx){
|
||||
static void aRP_make_vtx(Vtx* vtx) {
|
||||
static u8 flg[] = {
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
|
||||
TRUE, TRUE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE,
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE,
|
||||
TRUE, TRUE, TRUE, TRUE
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE, FALSE, TRUE,
|
||||
TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
|
||||
};
|
||||
|
||||
|
||||
Vtx* make;
|
||||
int fact;
|
||||
u8* flag;
|
||||
int i;
|
||||
|
||||
|
||||
flag = flg;
|
||||
fact = (*(f32*)mEv_get_save_area(0xE, 9) * 100.0f);
|
||||
make = tol_rope_1_v;
|
||||
|
||||
for(i = 0; i < ARRAY_SIZE(tol_rope_1_v, Vtx); i++, vtx++, flag++){
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(tol_rope_1_v, Vtx); i++, vtx++, flag++) {
|
||||
vtx[0] = make[0];
|
||||
|
||||
if (flag[0] == 1) {
|
||||
vtx->v.ob[0] = make->v.ob[0] + fact;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
vtx->v.ob[0] = make->v.ob[0];
|
||||
}
|
||||
|
||||
|
||||
make++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void aRP_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void aRP_actor_draw(ACTOR* actor, GAME* game) {
|
||||
Vtx* work;
|
||||
Vtx* vtx;
|
||||
Gfx* gfxp;
|
||||
Gfx* gfxp2;
|
||||
GRAPH* graph = game->graph;
|
||||
|
||||
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
vtx = GRAPH_ALLOC_TYPE(graph, Vtx, ARRAY_SIZE(tol_rope_1_v, Vtx));
|
||||
|
||||
work = vtx;
|
||||
|
||||
if(vtx != NULL){
|
||||
if (vtx != NULL) {
|
||||
aRP_make_vtx(vtx);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
work = tol_rope_1_v;
|
||||
}
|
||||
|
||||
@@ -118,16 +111,15 @@ void aRP_actor_draw(ACTOR* actor, GAME* game){
|
||||
|
||||
gfxp = NOW_POLY_OPA_DISP;
|
||||
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(gfxp++, 8, work);
|
||||
gSPSegment(gfxp++, 8, work);
|
||||
gSPDisplayList(gfxp++, tol_rope_1T_model);
|
||||
SET_POLY_OPA_DISP(gfxp);
|
||||
|
||||
|
||||
_texture_z_light_fog_prim_shadow(graph);
|
||||
gfxp2 = NOW_SHADOW_DISP;
|
||||
_texture_z_light_fog_prim_shadow(graph);
|
||||
gfxp2 = NOW_SHADOW_DISP;
|
||||
gSPMatrix(gfxp2++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfxp2++, tol_rope_1_shadowT_model);
|
||||
gSPDisplayList(gfxp2++, tol_rope_1_shadowT_model);
|
||||
SET_SHADOW_DISP(gfxp2);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
+16
-19
@@ -6,33 +6,30 @@
|
||||
#include "m_rcp.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_event.h"
|
||||
|
||||
static void aSCR_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aSCR_actor_dt(ACTOR* actor, GAME* game);
|
||||
static void aSCR_actor_init(ACTOR* actor, GAME* game);
|
||||
static void aSCR_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE S_Car_Profile = {
|
||||
mAc_PROFILE_S_CAR,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
DESIGNER_CAR,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(STRUCTURE_ACTOR),
|
||||
&aSCR_actor_ct,
|
||||
&aSCR_actor_dt,
|
||||
&aSCR_actor_init,
|
||||
&aSCR_actor_draw,
|
||||
NULL
|
||||
ACTOR_PROFILE S_Car_Profile = {
|
||||
mAc_PROFILE_S_CAR,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
DESIGNER_CAR,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(STRUCTURE_ACTOR),
|
||||
&aSCR_actor_ct,
|
||||
&aSCR_actor_dt,
|
||||
&aSCR_actor_init,
|
||||
&aSCR_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
u8 aSCR_shadow_vtx_fix_flg_table0[24] = {
|
||||
FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, TRUE, TRUE,
|
||||
TRUE, TRUE, TRUE, TRUE,
|
||||
TRUE, TRUE, TRUE, TRUE,
|
||||
FALSE, FALSE, FALSE, FALSE,
|
||||
FALSE, FALSE, FALSE, FALSE
|
||||
u8 aSCR_shadow_vtx_fix_flg_table0[24] = {
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, TRUE, TRUE, TRUE, TRUE,
|
||||
TRUE, TRUE, TRUE, TRUE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, FALSE,
|
||||
};
|
||||
|
||||
extern Vtx obj_car_shadow_v[];
|
||||
|
||||
+39
-46
@@ -9,90 +9,85 @@ static void aTHB_actor_dt(ACTOR* actor, GAME* game);
|
||||
static void aTHB_actor_move(ACTOR* actor, GAME* game);
|
||||
static void aTHB_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE T_Hanabi_Profile = {
|
||||
mAc_PROFILE_T_HANABI,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_HANABI,
|
||||
sizeof(HANABI_ACTOR),
|
||||
&aTHB_actor_ct,
|
||||
&aTHB_actor_dt,
|
||||
&aTHB_actor_move,
|
||||
&aTHB_actor_draw,
|
||||
NULL
|
||||
};
|
||||
ACTOR_PROFILE T_Hanabi_Profile = { mAc_PROFILE_T_HANABI,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_HANABI,
|
||||
sizeof(HANABI_ACTOR),
|
||||
&aTHB_actor_ct,
|
||||
&aTHB_actor_dt,
|
||||
&aTHB_actor_move,
|
||||
&aTHB_actor_draw,
|
||||
NULL };
|
||||
|
||||
static void aTHB_setupAction(ACTOR* actor, int idx);
|
||||
|
||||
extern Gfx main_utiwa1_model[];
|
||||
|
||||
static void aTHB_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void aTHB_actor_ct(ACTOR* actor, GAME* game) {
|
||||
aTHB_setupAction(actor, 1);
|
||||
}
|
||||
|
||||
static void aTHB_actor_dt(ACTOR* actor, GAME* game){
|
||||
|
||||
static void aTHB_actor_dt(ACTOR* actor, GAME* game) {
|
||||
}
|
||||
|
||||
static void aTHB_calc_scale(ACTOR* actor, int idx){
|
||||
static void aTHB_calc_scale(ACTOR* actor, int idx) {
|
||||
|
||||
static f32 aim[] = {1.0f, 0.0f};
|
||||
static f32 aim[] = { 1.0f, 0.0f };
|
||||
f32 hanabi_scale = actor->scale.x;
|
||||
|
||||
chase_f(&hanabi_scale, aim[idx],0.05f);
|
||||
|
||||
chase_f(&hanabi_scale, aim[idx], 0.05f);
|
||||
|
||||
actor->scale.x = hanabi_scale;
|
||||
actor->scale.y = hanabi_scale;
|
||||
actor->scale.z = hanabi_scale;
|
||||
|
||||
}
|
||||
|
||||
void aTHB_takeout(ACTOR* actor){
|
||||
static void aTHB_takeout(ACTOR* actor) {
|
||||
|
||||
aTHB_calc_scale(actor, 0);
|
||||
}
|
||||
|
||||
void aTHB_putaway(ACTOR* actor){
|
||||
static void aTHB_putaway(ACTOR* actor) {
|
||||
|
||||
aTHB_calc_scale(actor, 1);
|
||||
}
|
||||
|
||||
void aTHB_destruct(ACTOR* actor){
|
||||
static void aTHB_destruct(ACTOR* actor) {
|
||||
|
||||
Actor_delete(actor);
|
||||
}
|
||||
|
||||
static void aTHB_setupAction(ACTOR* actor, int idx){
|
||||
static void aTHB_setupAction(ACTOR* actor, int idx) {
|
||||
HANABI_ACTOR* hanabi = (HANABI_ACTOR*)actor;
|
||||
|
||||
static HANABI_PROC process[] = {(HANABI_PROC)none_proc1, aTHB_takeout,aTHB_putaway,aTHB_destruct,
|
||||
(HANABI_PROC)none_proc1,NULL};
|
||||
static f32 start_scale[] = {0.0f, 0.0f, 1.0f,1.0f,1.0f,0.0f,0.0f};
|
||||
static HANABI_PROC process[] = { (HANABI_PROC)none_proc1, aTHB_takeout, aTHB_putaway, aTHB_destruct,
|
||||
(HANABI_PROC)none_proc1, NULL };
|
||||
static f32 start_scale[] = { 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f, 0.0f };
|
||||
f32 scale;
|
||||
|
||||
hanabi->proc = process[idx];
|
||||
hanabi->current_id = idx;
|
||||
hanabi->current_id = idx;
|
||||
hanabi->tools_class.work0 = idx;
|
||||
|
||||
scale = start_scale[idx];
|
||||
hanabi->tools_class.actor_class.scale.x = scale;
|
||||
hanabi->tools_class.actor_class.scale.y = scale;
|
||||
hanabi->tools_class.actor_class.scale.z = scale;
|
||||
|
||||
}
|
||||
|
||||
static void aTHB_actor_move(ACTOR* actor, GAME* game){
|
||||
static void aTHB_actor_move(ACTOR* actor, GAME* game) {
|
||||
HANABI_ACTOR* hanabi = (HANABI_ACTOR*)actor;
|
||||
|
||||
|
||||
int t = hanabi->tools_class.work0;
|
||||
if(t!= hanabi->current_id){
|
||||
if (t != hanabi->current_id) {
|
||||
aTHB_setupAction(actor, t);
|
||||
}
|
||||
hanabi->proc(actor);
|
||||
}
|
||||
|
||||
static void aTHB_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void aTHB_actor_draw(ACTOR* actor, GAME* game) {
|
||||
HANABI_ACTOR* hanabi = (HANABI_ACTOR*)actor;
|
||||
|
||||
GRAPH* graph = game->graph;
|
||||
@@ -100,27 +95,25 @@ static void aTHB_actor_draw(ACTOR* actor, GAME* game){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
if(hanabi->tools_class.init_matrix == 1){
|
||||
if (hanabi->tools_class.init_matrix == 1) {
|
||||
Matrix_put(&hanabi->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&hanabi->tools_class.actor_class.world.position);
|
||||
hanabi->tools_class.init_matrix = 0;
|
||||
}
|
||||
else{
|
||||
Matrix_translate(hanabi->tools_class.actor_class.world.position.x, hanabi->tools_class.actor_class.world.position.y,
|
||||
hanabi->tools_class.actor_class.world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
} else {
|
||||
Matrix_translate(hanabi->tools_class.actor_class.world.position.x,
|
||||
hanabi->tools_class.actor_class.world.position.y,
|
||||
hanabi->tools_class.actor_class.world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
}
|
||||
|
||||
Matrix_scale(hanabi->tools_class.actor_class.scale.x, hanabi->tools_class.actor_class.scale.y, hanabi->tools_class.actor_class.scale.z, TRUE);
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
Matrix_scale(hanabi->tools_class.actor_class.scale.x, hanabi->tools_class.actor_class.scale.y,
|
||||
hanabi->tools_class.actor_class.scale.z, TRUE);
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
gfxp = NOW_POLY_OPA_DISP;
|
||||
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph),G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPMatrix(gfxp++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfxp++, main_utiwa1_model);
|
||||
SET_POLY_OPA_DISP(gfxp);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
+66
-71
@@ -2,104 +2,99 @@
|
||||
|
||||
#include "m_name_table.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aTNS_setupAction(ACTOR* actorx, u8 action);
|
||||
|
||||
ACTOR_PROFILE T_NpcSao_Profile = {
|
||||
mAc_PROFILE_T_NPCSAO,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_NPC_SAO,
|
||||
sizeof(NPC_SAO_TOOL_ACTOR),
|
||||
&aTNS_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTNS_actor_move,
|
||||
&aTNS_actor_draw,
|
||||
NULL
|
||||
mAc_PROFILE_T_NPCSAO,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_NPC_SAO,
|
||||
sizeof(NPC_SAO_TOOL_ACTOR),
|
||||
&aTNS_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTNS_actor_move,
|
||||
&aTNS_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
extern void aTNS_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
aTNS_setupAction(actorx, 1);
|
||||
aTNS_setupAction(actorx, 1);
|
||||
}
|
||||
|
||||
static void aTNS_destruct(NPC_SAO_TOOL_ACTOR* npc_sao) {
|
||||
Actor_delete((ACTOR*)npc_sao);
|
||||
Actor_delete((ACTOR*)npc_sao);
|
||||
}
|
||||
|
||||
static void aTNS_setupAction(ACTOR* actorx, u8 action) {
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
|
||||
static aTNS_ACTION_PROC process[] = {
|
||||
(aTNS_ACTION_PROC)&none_proc1,
|
||||
(aTNS_ACTION_PROC)&none_proc1,
|
||||
(aTNS_ACTION_PROC)&none_proc1,
|
||||
&aTNS_destruct,
|
||||
(aTNS_ACTION_PROC)&none_proc1,
|
||||
NULL
|
||||
};
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
|
||||
npc_sao->action_proc = process[action];
|
||||
npc_sao->action = action;
|
||||
npc_sao->tool_class.work0 = action;
|
||||
static aTNS_ACTION_PROC process[] = { (aTNS_ACTION_PROC)&none_proc1, (aTNS_ACTION_PROC)&none_proc1,
|
||||
(aTNS_ACTION_PROC)&none_proc1, &aTNS_destruct,
|
||||
(aTNS_ACTION_PROC)&none_proc1, NULL };
|
||||
|
||||
npc_sao->action_proc = process[action];
|
||||
npc_sao->action = action;
|
||||
npc_sao->tool_class.work0 = action;
|
||||
}
|
||||
|
||||
extern void aTNS_actor_move(ACTOR* actorx, GAME* game) {
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
s16 rotation_y;
|
||||
ACTOR* parent_actor;
|
||||
s16 parent_rotation_y;
|
||||
int temp;
|
||||
f32 pos_offset;
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
s16 rotation_y;
|
||||
ACTOR* parent_actor;
|
||||
s16 parent_rotation_y;
|
||||
int temp;
|
||||
f32 pos_offset;
|
||||
|
||||
if (npc_sao->tool_class.work0 != npc_sao->action) {
|
||||
aTNS_setupAction(actorx, npc_sao->tool_class.work0);
|
||||
}
|
||||
if (npc_sao->tool_class.work0 != npc_sao->action) {
|
||||
aTNS_setupAction(actorx, npc_sao->tool_class.work0);
|
||||
}
|
||||
|
||||
(npc_sao->action_proc)(npc_sao);
|
||||
|
||||
parent_actor = actorx->parent_actor;
|
||||
temp = npc_sao->rotation_y;
|
||||
parent_rotation_y = parent_actor->shape_info.rotation.y;
|
||||
rotation_y = temp + ((int)(fqrand() * 6.0f + 2.0f) * 256);
|
||||
|
||||
npc_sao->pos_x = parent_actor->world.position.x + sin_s(parent_rotation_y) * 100.0f;
|
||||
npc_sao->pos_y = parent_actor->world.position.y + -20.0f + sin_s(rotation_y) * 1.5f;
|
||||
npc_sao->pos_z = parent_actor->world.position.z + cos_s(parent_rotation_y) * 100.0f;
|
||||
|
||||
npc_sao->rotation_y = rotation_y;
|
||||
(npc_sao->action_proc)(npc_sao);
|
||||
|
||||
parent_actor = actorx->parent_actor;
|
||||
temp = npc_sao->rotation_y;
|
||||
parent_rotation_y = parent_actor->shape_info.rotation.y;
|
||||
rotation_y = temp + ((int)(fqrand() * 6.0f + 2.0f) * 256);
|
||||
|
||||
npc_sao->pos_x = parent_actor->world.position.x + sin_s(parent_rotation_y) * 100.0f;
|
||||
npc_sao->pos_y = parent_actor->world.position.y + -20.0f + sin_s(rotation_y) * 1.5f;
|
||||
npc_sao->pos_z = parent_actor->world.position.z + cos_s(parent_rotation_y) * 100.0f;
|
||||
|
||||
npc_sao->rotation_y = rotation_y;
|
||||
}
|
||||
|
||||
extern Gfx tol_npcsao_1_sao_model[];
|
||||
extern Gfx tol_npcsao_1_uki_model[];
|
||||
|
||||
extern void aTNS_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
GRAPH* g = game->graph;
|
||||
Gfx* gfx;
|
||||
NPC_SAO_TOOL_ACTOR* npc_sao = (NPC_SAO_TOOL_ACTOR*)actorx;
|
||||
GRAPH* g = game->graph;
|
||||
Gfx* gfx;
|
||||
|
||||
if (npc_sao->tool_class.init_matrix == TRUE) {
|
||||
Matrix_put(&npc_sao->tool_class.matrix_work);
|
||||
Matrix_Position_Zero(&actorx->world.position);
|
||||
npc_sao->tool_class.init_matrix = FALSE;
|
||||
}
|
||||
else {
|
||||
Matrix_translate(actorx->world.position.x, actorx->world.position.y, actorx->world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
}
|
||||
|
||||
_texture_z_light_fog_prim_npc(g);
|
||||
if (npc_sao->tool_class.init_matrix == TRUE) {
|
||||
Matrix_put(&npc_sao->tool_class.matrix_work);
|
||||
Matrix_Position_Zero(&actorx->world.position);
|
||||
npc_sao->tool_class.init_matrix = FALSE;
|
||||
} else {
|
||||
Matrix_translate(actorx->world.position.x, actorx->world.position.y, actorx->world.position.z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, TRUE);
|
||||
}
|
||||
|
||||
OPEN_DISP(g);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
_texture_z_light_fog_prim_npc(g);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_npcsao_1_sao_model);
|
||||
Matrix_translate(npc_sao->pos_x, npc_sao->pos_y, npc_sao->pos_z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_npcsao_1_uki_model);
|
||||
OPEN_DISP(g);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(g);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_npcsao_1_sao_model);
|
||||
Matrix_translate(npc_sao->pos_x, npc_sao->pos_y, npc_sao->pos_z, FALSE);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(g), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_npcsao_1_uki_model);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(g);
|
||||
}
|
||||
|
||||
+58
-71
@@ -2,119 +2,106 @@
|
||||
|
||||
#include "m_name_table.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
ACTOR_PROFILE T_Tumbler_Profile = {
|
||||
mAc_PROFILE_T_TUMBLER,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_TUMBLER,
|
||||
sizeof(TOOL_TUMBLER_ACTOR),
|
||||
&aTTB_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTTB_actor_move,
|
||||
&aTTB_actor_draw,
|
||||
NULL
|
||||
mAc_PROFILE_T_TUMBLER,
|
||||
ACTOR_PART_BG,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_TUMBLER,
|
||||
sizeof(TOOL_TUMBLER_ACTOR),
|
||||
&aTTB_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aTTB_actor_move,
|
||||
&aTTB_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static void aTTB_setupAction(TOOL_TUMBLER_ACTOR* tumbler_actor, int action);
|
||||
|
||||
extern void aTTB_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
|
||||
aTTB_setupAction(tumbler, 1);
|
||||
aTTB_setupAction(tumbler, 1);
|
||||
}
|
||||
|
||||
static void aTTB_calc_scale(TOOL_TUMBLER_ACTOR* tumbler_actor, int goal_idx) {
|
||||
static f32 aim[] = { 1.0f, 0.0f };
|
||||
static f32 aim[] = { 1.0f, 0.0f };
|
||||
|
||||
f32 scale = tumbler_actor->tools_class.actor_class.scale.x;
|
||||
f32 scale = tumbler_actor->tools_class.actor_class.scale.x;
|
||||
|
||||
chase_f(&scale, aim[goal_idx], 0.05f);
|
||||
tumbler_actor->tools_class.actor_class.scale.x = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.y = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.z = scale;
|
||||
chase_f(&scale, aim[goal_idx], 0.05f);
|
||||
tumbler_actor->tools_class.actor_class.scale.x = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.y = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.z = scale;
|
||||
}
|
||||
|
||||
static void aTTB_takeout(TOOL_TUMBLER_ACTOR* tumbler_actor) {
|
||||
aTTB_calc_scale(tumbler_actor, 0);
|
||||
aTTB_calc_scale(tumbler_actor, 0);
|
||||
}
|
||||
|
||||
static void aTTB_putaway(TOOL_TUMBLER_ACTOR* tumbler_actor) {
|
||||
aTTB_calc_scale(tumbler_actor, 1);
|
||||
aTTB_calc_scale(tumbler_actor, 1);
|
||||
}
|
||||
|
||||
static void aTTB_destruct(TOOL_TUMBLER_ACTOR* tumbler_actor) {
|
||||
Actor_delete((ACTOR*)tumbler_actor);
|
||||
Actor_delete((ACTOR*)tumbler_actor);
|
||||
}
|
||||
|
||||
static void aTTB_setupAction(TOOL_TUMBLER_ACTOR* tumbler_actor, int action) {
|
||||
static aTTB_ACTION_PROC process[] = {
|
||||
(aTTB_ACTION_PROC)&none_proc1,
|
||||
&aTTB_takeout,
|
||||
&aTTB_putaway,
|
||||
&aTTB_destruct,
|
||||
(aTTB_ACTION_PROC)&none_proc1,
|
||||
NULL
|
||||
};
|
||||
static aTTB_ACTION_PROC process[] = { (aTTB_ACTION_PROC)&none_proc1, &aTTB_takeout, &aTTB_putaway, &aTTB_destruct,
|
||||
(aTTB_ACTION_PROC)&none_proc1, NULL };
|
||||
|
||||
static f32 start_scale[] = {
|
||||
0.0f,
|
||||
0.0f,
|
||||
1.0f,
|
||||
1.0f,
|
||||
1.0f,
|
||||
0.0f
|
||||
};
|
||||
static f32 start_scale[] = { 0.0f, 0.0f, 1.0f, 1.0f, 1.0f, 0.0f };
|
||||
|
||||
f32 scale;
|
||||
f32 scale;
|
||||
|
||||
tumbler_actor->action_proc = process[action];
|
||||
tumbler_actor->action = action;
|
||||
tumbler_actor->action_proc = process[action];
|
||||
tumbler_actor->action = action;
|
||||
|
||||
scale = start_scale[action];
|
||||
tumbler_actor->tools_class.actor_class.scale.x = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.y = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.z = scale;
|
||||
scale = start_scale[action];
|
||||
tumbler_actor->tools_class.actor_class.scale.x = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.y = scale;
|
||||
tumbler_actor->tools_class.actor_class.scale.z = scale;
|
||||
}
|
||||
|
||||
extern void aTTB_actor_move(ACTOR* actorx, GAME* game) {
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
|
||||
if (tumbler->tools_class.work0 != tumbler->action) {
|
||||
aTTB_setupAction(tumbler, tumbler->tools_class.work0);
|
||||
}
|
||||
if (tumbler->tools_class.work0 != tumbler->action) {
|
||||
aTTB_setupAction(tumbler, tumbler->tools_class.work0);
|
||||
}
|
||||
|
||||
(*tumbler->action_proc)(tumbler);
|
||||
(*tumbler->action_proc)(tumbler);
|
||||
}
|
||||
|
||||
extern Gfx tol_kamicup_1T_model[];
|
||||
|
||||
extern void aTTB_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
GRAPH* graph = game->graph;
|
||||
TOOL_TUMBLER_ACTOR* tumbler = (TOOL_TUMBLER_ACTOR*)actorx;
|
||||
GRAPH* graph = game->graph;
|
||||
|
||||
Gfx* gfx;
|
||||
Gfx* gfx;
|
||||
|
||||
if (tumbler->tools_class.init_matrix == TRUE) {
|
||||
Matrix_put(&tumbler->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&actorx->world.position);
|
||||
tumbler->tools_class.init_matrix = FALSE;
|
||||
}
|
||||
else {
|
||||
Matrix_translate(actorx->world.position.x, actorx->world.position.y, actorx->world.position.z, 0);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
|
||||
}
|
||||
|
||||
Matrix_scale(actorx->scale.x, actorx->scale.y, actorx->scale.z, 1);
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
if (tumbler->tools_class.init_matrix == TRUE) {
|
||||
Matrix_put(&tumbler->tools_class.matrix_work);
|
||||
Matrix_Position_Zero(&actorx->world.position);
|
||||
tumbler->tools_class.init_matrix = FALSE;
|
||||
} else {
|
||||
Matrix_translate(actorx->world.position.x, actorx->world.position.y, actorx->world.position.z, 0);
|
||||
Matrix_scale(0.01f, 0.01f, 0.01f, 1);
|
||||
}
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
Matrix_scale(actorx->scale.x, actorx->scale.y, actorx->scale.z, 1);
|
||||
_texture_z_light_fog_prim_npc(graph);
|
||||
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_kamicup_1T_model);
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(gfx++, tol_kamicup_1T_model);
|
||||
|
||||
SET_POLY_OPA_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
+17
-41
@@ -5,6 +5,8 @@
|
||||
#include "m_field_info.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_bgm.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aTnt_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aTnt_actor_dt(ACTOR* actor, GAME* game);
|
||||
@@ -12,42 +14,24 @@ static void aTnt_actor_init(ACTOR* actor, GAME* game);
|
||||
static void aTnt_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Tent_Profile = {
|
||||
mAc_PROFILE_TENT,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
TENT,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(TENT_ACTOR),
|
||||
aTnt_actor_ct,
|
||||
aTnt_actor_dt,
|
||||
aTnt_actor_init,
|
||||
aTnt_actor_draw,
|
||||
NULL,
|
||||
mAc_PROFILE_TENT, ACTOR_PART_ITEM, ACTOR_STATE_TA_SET, TENT, ACTOR_OBJ_BANK_KEEP, sizeof(TENT_ACTOR), aTnt_actor_ct,
|
||||
aTnt_actor_dt, aTnt_actor_init, aTnt_actor_draw, NULL,
|
||||
};
|
||||
|
||||
extern Vtx obj_s_tent_shadow_v[];
|
||||
extern Gfx obj_s_tent_shadow_modelT[];
|
||||
|
||||
u8 aTNT_shadow_vtx_fix_flg_table[] = { FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE
|
||||
,FALSE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE,FALSE,TRUE,TRUE,FALSE };
|
||||
|
||||
u8 aTNT_shadow_vtx_fix_flg_table[] = {
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE, FALSE, TRUE, TRUE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE,
|
||||
TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE, FALSE, TRUE, TRUE, FALSE,
|
||||
};
|
||||
|
||||
bIT_ShadowData_c aTnt_shadow_data = {
|
||||
28,
|
||||
aTNT_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_s_tent_shadow_v,
|
||||
obj_s_tent_shadow_modelT,
|
||||
28, aTNT_shadow_vtx_fix_flg_table, 60.0f, obj_s_tent_shadow_v, obj_s_tent_shadow_modelT,
|
||||
};
|
||||
|
||||
Door_data_c aTnt_tent_enter_data = {
|
||||
SCENE_TENT,
|
||||
4,
|
||||
FALSE,
|
||||
0,
|
||||
{120,0,220},
|
||||
EMPTY_NO,
|
||||
1,
|
||||
{0,0,0},
|
||||
SCENE_TENT, 4, FALSE, 0, { 120, 0, 220 }, EMPTY_NO, 1, { 0, 0, 0 },
|
||||
};
|
||||
|
||||
static void aTnt_ChangeFg(ACTOR* actor, int type);
|
||||
@@ -55,7 +39,6 @@ static void aTnt_SetupAction(ACTOR* actor, int type);
|
||||
static void aTnt_SetBgOffset(ACTOR* actor, int offset);
|
||||
static int aTnt_ControlLight(ACTOR* actor);
|
||||
|
||||
|
||||
static void aTnt_actor_ct(ACTOR* actor, GAME* game) {
|
||||
TENT_ACTOR* tent = (TENT_ACTOR*)actor;
|
||||
f32 t;
|
||||
@@ -73,8 +56,8 @@ static void aTnt_actor_ct(ACTOR* actor, GAME* game) {
|
||||
tent->structure_class.arg0_f = t;
|
||||
}
|
||||
|
||||
static void aTnt_actor_dt(ACTOR* actor, GAME* game) {
|
||||
aTnt_ChangeFg(actor, 0);
|
||||
static void aTnt_actor_dt(ACTOR* actor, GAME* game) {
|
||||
aTnt_ChangeFg(actor, 0);
|
||||
}
|
||||
|
||||
static void aTnt_ChangeFg(ACTOR* actor, int type) {
|
||||
@@ -114,17 +97,11 @@ static void aTnt_ChangeFg(ACTOR* actor, int type) {
|
||||
|
||||
static void aTnt_SetBgOffset(ACTOR* actor, int type) {
|
||||
static mCoBG_OffsetTable_c height_table_ct[] = {
|
||||
{100, 3, 1, 1, 7, 7, 0},
|
||||
{100, 10, 10, 10, 10, 10, 0},
|
||||
{100, 3, 7, 7, 1, 1, 0},
|
||||
{100, 3, 1, 1, 7, 7, 0},
|
||||
{100, 10, 10, 10, 10, 10, 0},
|
||||
{100, 3, 7, 7, 1, 1, 0},
|
||||
{100, 3, 3, 3, 3, 3, 0},
|
||||
{100, 10, 10, 10, 10, 10, 0},
|
||||
{100, 3, 3, 3, 3, 3, 0},
|
||||
{ 100, 3, 1, 1, 7, 7, 0 }, { 100, 10, 10, 10, 10, 10, 0 }, { 100, 3, 7, 7, 1, 1, 0 },
|
||||
{ 100, 3, 1, 1, 7, 7, 0 }, { 100, 10, 10, 10, 10, 10, 0 }, { 100, 3, 7, 7, 1, 1, 0 },
|
||||
{ 100, 3, 3, 3, 3, 3, 0 }, { 100, 10, 10, 10, 10, 10, 0 }, { 100, 3, 3, 3, 3, 3, 0 },
|
||||
};
|
||||
static mCoBG_OffsetTable_c* height_table[] = {height_table_ct, height_table_ct};
|
||||
static mCoBG_OffsetTable_c* height_table[] = { height_table_ct, height_table_ct };
|
||||
mCoBG_OffsetTable_c* tbl = height_table[type];
|
||||
int j;
|
||||
int i;
|
||||
@@ -290,4 +267,3 @@ static void aTnt_actor_draw(ACTOR* actor, GAME* game) {
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+23
-30
@@ -7,7 +7,7 @@
|
||||
#include "m_player_lib.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_bgm.h"
|
||||
|
||||
#include "m_soncho.h"
|
||||
|
||||
static void aTOU_actor_ct(ACTOR*, GAME*);
|
||||
static void aTOU_actor_dt(ACTOR*, GAME*);
|
||||
@@ -31,48 +31,42 @@ ACTOR_PROFILE Toudai_Profile = {
|
||||
extern Vtx obj_s_toudai_shadow_v[];
|
||||
extern Gfx obj_s_toudai_shadow_1_model[];
|
||||
|
||||
u8 aTOU_shadow_vtx_fix_flg_table[] = {1,0,1,0,
|
||||
0,1,1,0,
|
||||
1,0,0,0,};
|
||||
bIT_ShadowData_c aTOU_shadow_data = {
|
||||
10,
|
||||
aTOU_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_s_toudai_shadow_v,
|
||||
obj_s_toudai_shadow_1_model,
|
||||
u8 aTOU_shadow_vtx_fix_flg_table[] = {
|
||||
1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0,
|
||||
};
|
||||
|
||||
bIT_ShadowData_c aTOU_shadow_data = {
|
||||
10, aTOU_shadow_vtx_fix_flg_table, 60.0f, obj_s_toudai_shadow_v, obj_s_toudai_shadow_1_model,
|
||||
};
|
||||
|
||||
static void aTOU_set_bgOffset(TOUDAI_ACTOR*, int);
|
||||
static void aTOU_setup_action(ACTOR*, int);
|
||||
|
||||
static void aTOU_fgunit_on(ACTOR* actor){
|
||||
static void aTOU_fgunit_on(ACTOR* actor) {
|
||||
TOUDAI_ACTOR* light = (TOUDAI_ACTOR*)actor;
|
||||
|
||||
xyz_t pos;
|
||||
int i;
|
||||
mActor_name_t* nameptr;
|
||||
|
||||
xyz_t_move(&pos, &light->actor_class.home.position);
|
||||
|
||||
xyz_t_move(&pos, &light->actor_class.home.position);
|
||||
|
||||
pos.x -= 40.0f;
|
||||
pos.z -= 80.0f;
|
||||
for(i = 0; i < 2; i++){
|
||||
for (i = 0; i < 2; i++) {
|
||||
nameptr = mFI_GetUnitFG(pos);
|
||||
if(nameptr != NULL){
|
||||
if(mSN_ClearSnowman(nameptr) == 0){
|
||||
if (nameptr != NULL) {
|
||||
if (mSN_ClearSnowman(nameptr) == 0) {
|
||||
if (((*nameptr >= 0x2A) && (*nameptr <= 0x42)) || (*nameptr == 0x5C)) {
|
||||
mPB_keep_item(bg_item_fg_sub_dig2take_conv(*nameptr));
|
||||
mFI_SetFG_common(RSV_NO, pos, 1);
|
||||
mFI_Wpos2DepositOFF(pos);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
mFI_Wpos2DepositOFF(pos);
|
||||
mPB_keep_item(*nameptr);
|
||||
mFI_SetFG_common(RSV_NO, pos, 1);
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
mFI_SetFG_common(RSV_NO, pos, 1);
|
||||
}
|
||||
}
|
||||
@@ -80,17 +74,17 @@ static void aTOU_fgunit_on(ACTOR* actor){
|
||||
}
|
||||
}
|
||||
|
||||
static void aTOU_fgunit_off(ACTOR* actor){
|
||||
static void aTOU_fgunit_off(ACTOR* actor) {
|
||||
TOUDAI_ACTOR* light = (TOUDAI_ACTOR*)actor;
|
||||
|
||||
int i;
|
||||
xyz_t pos;
|
||||
|
||||
xyz_t_move(&pos, &light->actor_class.home.position);
|
||||
|
||||
xyz_t_move(&pos, &light->actor_class.home.position);
|
||||
|
||||
pos.x -= 40.0f;
|
||||
pos.z -= 80.0f;
|
||||
for (i = 0; i < 2; i++){
|
||||
for (i = 0; i < 2; i++) {
|
||||
mFI_SetFG_common(EMPTY_NO, pos, 1);
|
||||
pos.x += 40.0f;
|
||||
}
|
||||
@@ -98,9 +92,9 @@ static void aTOU_fgunit_off(ACTOR* actor){
|
||||
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_obj_s_toudai;
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_obj_w_toudai;
|
||||
|
||||
static void aTOU_actor_ct(ACTOR* actor, GAME* game){
|
||||
static cKF_Skeleton_R_c* skl[] = {&cKF_bs_r_obj_s_toudai, &cKF_bs_r_obj_w_toudai};
|
||||
|
||||
static void aTOU_actor_ct(ACTOR* actor, GAME* game) {
|
||||
static cKF_Skeleton_R_c* skl[] = { &cKF_bs_r_obj_s_toudai, &cKF_bs_r_obj_w_toudai };
|
||||
TOUDAI_ACTOR* light = (TOUDAI_ACTOR*)actor;
|
||||
|
||||
light->season = Common_Get(time.season);
|
||||
@@ -113,14 +107,13 @@ static void aTOU_actor_ct(ACTOR* actor, GAME* game){
|
||||
actor->world.position.z -= 20.0f;
|
||||
}
|
||||
|
||||
static void aTOU_actor_dt(ACTOR* actor, GAME* game){
|
||||
static void aTOU_actor_dt(ACTOR* actor, GAME* game) {
|
||||
TOUDAI_ACTOR* light = (TOUDAI_ACTOR*)actor;
|
||||
|
||||
|
||||
aTOU_fgunit_off(&light->actor_class);
|
||||
cKF_SkeletonInfo_R_dt(&light->keyframe);
|
||||
light->actor_class.world.position.x += 20.0f;
|
||||
light->actor_class.world.position.z += 20.0f;
|
||||
|
||||
}
|
||||
|
||||
#include "../src/ac_toudai_move.c_inc"
|
||||
|
||||
+9
-8
@@ -6,6 +6,7 @@
|
||||
#include "m_event.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_play.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
static void aTR0_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aTR0_actor_dt(ACTOR* actor, GAME* game);
|
||||
@@ -23,7 +24,7 @@ ACTOR_PROFILE Train0_Profile = {
|
||||
&aTR0_actor_dt,
|
||||
&aTR0_actor_move,
|
||||
&aTR0_actor_draw,
|
||||
NULL
|
||||
NULL,
|
||||
};
|
||||
|
||||
extern cKF_Skeleton_R_c cKF_bs_r_obj_train1_1;
|
||||
@@ -31,19 +32,19 @@ extern cKF_Animation_R_c cKF_ba_r_obj_train1_1;
|
||||
|
||||
extern Gfx obj_train1_2_model[];
|
||||
|
||||
static void aTR0_actor_ct(ACTOR* actor, GAME* GAME){
|
||||
static void aTR0_actor_ct(ACTOR* actor, GAME* GAME) {
|
||||
TRAIN0_ACTOR* train0 = (TRAIN0_ACTOR*)actor;
|
||||
|
||||
cKF_SkeletonInfo_R_ct(&train0->keyframe, &cKF_bs_r_obj_train1_1,NULL, train0->work, train0->target);
|
||||
cKF_SkeletonInfo_R_init(&train0->keyframe, train0->keyframe.skeleton, &cKF_ba_r_obj_train1_1,
|
||||
1.0f, 25.0f, 1.0f, 0.5f, 0.0f, 1, NULL);
|
||||
cKF_SkeletonInfo_R_ct(&train0->keyframe, &cKF_bs_r_obj_train1_1, NULL, train0->work, train0->target);
|
||||
cKF_SkeletonInfo_R_init(&train0->keyframe, train0->keyframe.skeleton, &cKF_ba_r_obj_train1_1, 1.0f, 25.0f, 1.0f,
|
||||
0.5f, 0.0f, 1, NULL);
|
||||
cKF_SkeletonInfo_R_play(&train0->keyframe);
|
||||
train0->actor_class.cull_width = 600.0f;
|
||||
train0->actor_class.world.angle.y = 16384;
|
||||
train0->tr_action = 5;
|
||||
}
|
||||
|
||||
static void aTR0_actor_dt(ACTOR* actor, GAME* game){
|
||||
static void aTR0_actor_dt(ACTOR* actor, GAME* game) {
|
||||
|
||||
TRAIN0_ACTOR* train0 = (TRAIN0_ACTOR*)actor;
|
||||
|
||||
@@ -53,9 +54,9 @@ static void aTR0_actor_dt(ACTOR* actor, GAME* game){
|
||||
|
||||
mFI_SetFG_common(0, tr_home_pos, 0);
|
||||
|
||||
if(train0->tr_actor_p != NULL){
|
||||
if (train0->tr_actor_p != NULL) {
|
||||
Actor_delete(train0->tr_actor_p);
|
||||
train0->tr_actor_p = NULL;
|
||||
train0->tr_actor_p = NULL;
|
||||
}
|
||||
cKF_SkeletonInfo_R_dt(&train0->keyframe);
|
||||
Common_Set(train_exists_flag, 0);
|
||||
|
||||
+47
-53
@@ -1,4 +1,4 @@
|
||||
static void aTR1_OngenTrgStart(ACTOR* actor, u16 id){
|
||||
static void aTR1_OngenTrgStart(ACTOR* actor, u16 id) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
|
||||
sAdo_OngenTrgStart(id, &train1->actor_class.world.position);
|
||||
@@ -12,138 +12,132 @@ static f32 calc_speed1(ACTOR* actor0, ACTOR* actor1) {
|
||||
return 0.8f + train0->tr_speed;
|
||||
}
|
||||
|
||||
if (actor1->speed < train0->tr_speed){
|
||||
return train0->tr_speed + (0.5f * - (actor1->speed - train0->tr_speed));
|
||||
if (actor1->speed < train0->tr_speed) {
|
||||
return train0->tr_speed + (0.5f * -(actor1->speed - train0->tr_speed));
|
||||
}
|
||||
|
||||
return train0->tr_speed;
|
||||
}
|
||||
|
||||
static f32 calc_speed2(ACTOR* actor){
|
||||
static f32 calc_speed2(ACTOR* actor) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
int should_stop = F32_IS_ZERO(train1->tr0_pos);
|
||||
|
||||
|
||||
return should_stop == FALSE ? train1->tr0_pos : -0.23f;
|
||||
}
|
||||
|
||||
static void aTR1_position_move(ACTOR* actor){
|
||||
static void aTR1_position_move(ACTOR* actor) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
TRAIN0_ACTOR* train0 = (TRAIN0_ACTOR*)actor->parent_actor;
|
||||
|
||||
f32 diff;
|
||||
f32 tr_back_calc;
|
||||
f32 base_x_pos;
|
||||
|
||||
|
||||
tr_back_calc = train1->actor_class.world.position.x;
|
||||
base_x_pos = -125.0f + train0->tr1_pos;
|
||||
tr_back_calc += 0.5f * train1->actor_class.speed;
|
||||
|
||||
|
||||
diff = tr_back_calc - base_x_pos;
|
||||
if((diff) <= 0.0f){
|
||||
if ((diff) <= 0.0f) {
|
||||
train1->actor_class.speed = calc_speed1(actor->parent_actor, actor);
|
||||
train1->actor_class.world.position.x = base_x_pos;
|
||||
}
|
||||
else if((diff) > 2.0f){
|
||||
} else if ((diff) > 2.0f) {
|
||||
train1->actor_class.speed = calc_speed2(actor->parent_actor);
|
||||
train1->actor_class.world.position.x = 2.0f + base_x_pos;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
chase_f(&train1->actor_class.speed, 0.0f, 0.0025f);
|
||||
train1->actor_class.world.position.x = tr_back_calc;
|
||||
}
|
||||
}
|
||||
|
||||
static void aTR1_chg_station_attr(int station){
|
||||
static void aTR1_chg_station_attr(int station) {
|
||||
static xyz_t doorway_pos = { 2180.0f, 0.0f, 820.0f };
|
||||
xyz_t soil_pos;
|
||||
xyz_t unk20_pos;
|
||||
|
||||
if(mEv_CheckFirstIntro() == 0){
|
||||
if(station == 5){
|
||||
soil_pos = doorway_pos;
|
||||
mCoBG_SetAttribute(&soil_pos, 7);
|
||||
}
|
||||
else if(station == 6){
|
||||
unk20_pos = doorway_pos;
|
||||
mCoBG_SetAttribute(&unk20_pos, 0x20);
|
||||
if (mEv_CheckFirstIntro() == 0) {
|
||||
if (station == 5) {
|
||||
mCoBG_SetAttribute(doorway_pos, mCoBG_ATTRIBUTE_STONE);
|
||||
} else if (station == 6) {
|
||||
mCoBG_SetAttribute(doorway_pos, 0x20);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aTR1_passenger_ctrl(ACTOR* actor){
|
||||
static void aTR1_passenger_ctrl(ACTOR* actor) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
|
||||
GAME_PLAY* play = (GAME_PLAY*)gamePT;
|
||||
xyz_t pos;
|
||||
s_xyz rot;
|
||||
|
||||
if(train1->player_pass_exists == 1){
|
||||
if (train1->player_pass_exists == 1) {
|
||||
pos.x = train1->actor_class.world.position.x + 60.0f;
|
||||
pos.y = train1->actor_class.world.position.y + 20.0f;
|
||||
pos.z = train1->actor_class.world.position.z + 20.0f;
|
||||
rot.x = ZeroSVec.x;
|
||||
rot.y = ZeroSVec.y;
|
||||
rot.z = ZeroSVec.z;
|
||||
get_player_actor_withoutCheck((GAME_PLAY*)gamePT)->Set_force_position_angle_proc(gamePT, &pos, &rot, mPlayer_FORCE_POSITION_ANGLE_POSX | mPlayer_FORCE_POSITION_ANGLE_POSY | mPlayer_FORCE_POSITION_ANGLE_POSZ | mPlayer_FORCE_POSITION_ANGLE_ROTY);
|
||||
}
|
||||
else if(train1->player_pass_leaving == 1){
|
||||
get_player_actor_withoutCheck((GAME_PLAY*)gamePT)
|
||||
->Set_force_position_angle_proc(gamePT, &pos, &rot,
|
||||
mPlayer_FORCE_POSITION_ANGLE_POSX | mPlayer_FORCE_POSITION_ANGLE_POSY |
|
||||
mPlayer_FORCE_POSITION_ANGLE_POSZ | mPlayer_FORCE_POSITION_ANGLE_ROTY);
|
||||
} else if (train1->player_pass_leaving == 1) {
|
||||
pos.x = train1->actor_class.world.position.x + 2.0f;
|
||||
pos.y = train1->actor_class.world.position.y + 16.0f;
|
||||
pos.z = train1->actor_class.world.position.z + 20.0f;
|
||||
get_player_actor_withoutCheck((GAME_PLAY*)gamePT)->Set_force_position_angle_proc(gamePT, &pos, NULL, mPlayer_FORCE_POSITION_ANGLE_POSX | mPlayer_FORCE_POSITION_ANGLE_POSY | mPlayer_FORCE_POSITION_ANGLE_POSZ);
|
||||
|
||||
get_player_actor_withoutCheck((GAME_PLAY*)gamePT)
|
||||
->Set_force_position_angle_proc(gamePT, &pos, NULL,
|
||||
mPlayer_FORCE_POSITION_ANGLE_POSX | mPlayer_FORCE_POSITION_ANGLE_POSY |
|
||||
mPlayer_FORCE_POSITION_ANGLE_POSZ);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void aTR1_setupAction(ACTOR* actor, int action){
|
||||
static void aTR1_setupAction(ACTOR* actor, int action) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
|
||||
static cKF_Animation_R_c* anime_table[] = {&cKF_ba_r_obj_train1_3_open, &cKF_ba_r_obj_train1_3_close};
|
||||
static f32 anime_end[] = {24.0f, 32.0f};
|
||||
static int animeSeqNoTable[] = {0,0,0,0,0,1,1,0,0};
|
||||
static f32 anime_spd[] = {0.0f,0.0f,0.0f,0.0f, 0.5f, 0.0f,0.5f,0.0f,0.0f};
|
||||
|
||||
|
||||
static cKF_Animation_R_c* anime_table[] = { &cKF_ba_r_obj_train1_3_open, &cKF_ba_r_obj_train1_3_close };
|
||||
static f32 anime_end[] = { 24.0f, 32.0f };
|
||||
static int animeSeqNoTable[] = { 0, 0, 0, 0, 0, 1, 1, 0, 0 };
|
||||
static f32 anime_spd[] = { 0.0f, 0.0f, 0.0f, 0.0f, 0.5f, 0.0f, 0.5f, 0.0f, 0.0f };
|
||||
|
||||
cKF_Animation_R_c* anime_pt;
|
||||
f32 speed;
|
||||
f32 end;
|
||||
f32 tr_speed;
|
||||
int seq_no = animeSeqNoTable[action];
|
||||
|
||||
|
||||
anime_pt = anime_table[seq_no];
|
||||
speed = anime_spd[action];
|
||||
end = anime_end[seq_no];
|
||||
|
||||
tr_speed = 1.0f;
|
||||
train1->tr_action = action;
|
||||
|
||||
if((train1->tr_action == 6) || (train1->tr_action == 4)){
|
||||
if((mEv_CheckTitleDemo() == 0) && (tr_speed != train1->tr_speed)){
|
||||
|
||||
if ((train1->tr_action == 6) || (train1->tr_action == 4)) {
|
||||
if ((mEv_CheckTitleDemo() == 0) && (tr_speed != train1->tr_speed)) {
|
||||
aTR1_OngenTrgStart(actor, 43);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
tr_speed = end;
|
||||
}
|
||||
}
|
||||
cKF_SkeletonInfo_R_init(&train1->keyframe, train1->keyframe.skeleton, anime_pt,
|
||||
1.0f, end, tr_speed, speed, 0.0f, 0, NULL );
|
||||
cKF_SkeletonInfo_R_init(&train1->keyframe, train1->keyframe.skeleton, anime_pt, 1.0f, end, tr_speed, speed, 0.0f, 0,
|
||||
NULL);
|
||||
aTR1_chg_station_attr(action);
|
||||
}
|
||||
|
||||
static void aTR1_actor_move(ACTOR* actor, GAME* game){
|
||||
static void aTR1_actor_move(ACTOR* actor, GAME* game) {
|
||||
TRAIN1_ACTOR* train1 = (TRAIN1_ACTOR*)actor;
|
||||
TRAIN0_ACTOR* train0 = (TRAIN0_ACTOR*)actor->parent_actor;
|
||||
cKF_SkeletonInfo_R_c* keyframe = &train1->keyframe;
|
||||
|
||||
|
||||
train1->anim_state = cKF_SkeletonInfo_R_play(keyframe);
|
||||
if(mEv_CheckTitleDemo() <= 0){
|
||||
aTR1_position_move((ACTOR*)train1);
|
||||
if (mEv_CheckTitleDemo() <= 0) {
|
||||
aTR1_position_move((ACTOR*)train1);
|
||||
}
|
||||
aTR1_passenger_ctrl((ACTOR*)train1);
|
||||
|
||||
if(train0->tr_action != train1->tr_action){
|
||||
aTR1_setupAction((ACTOR*)train1, train0->tr_action);
|
||||
if (train0->tr_action != train1->tr_action) {
|
||||
aTR1_setupAction((ACTOR*)train1, train0->tr_action);
|
||||
}
|
||||
|
||||
train1->tr_speed = 0.0f;
|
||||
|
||||
+19
-17
@@ -12,6 +12,7 @@
|
||||
#include "m_malloc.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_event.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
static void Weather_Actor_ct(ACTOR* actor, GAME* game);
|
||||
static void Weather_Actor_dt(ACTOR* actor, GAME* game);
|
||||
@@ -19,6 +20,7 @@ static void Weather_Actor_move(ACTOR* actor, GAME* game);
|
||||
static void Weather_Actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id);
|
||||
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather);
|
||||
|
||||
static aWeather_Profile_c* profile_tbl[] = {
|
||||
&iam_weather_fine, &iam_weather_rain, &iam_weather_snow, &iam_weather_sakura, &iam_weather_leaf,
|
||||
@@ -105,7 +107,7 @@ extern void aWeather_RequestChangeWeatherFromIsland() {
|
||||
mEnv_SAVE_GET_WEATHER_INTENSITY(Save_Get(weather)));
|
||||
}
|
||||
|
||||
int aWeather_GetWeatherPrvNum(ACTOR* actor) {
|
||||
static int aWeather_GetWeatherPrvNum(ACTOR* actor) {
|
||||
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
|
||||
aWeather_Priv* priv = weather->priv;
|
||||
int i;
|
||||
@@ -120,7 +122,7 @@ int aWeather_GetWeatherPrvNum(ACTOR* actor) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
void aWeather_AbolishPrivate(ACTOR* actor, int num) {
|
||||
static void aWeather_AbolishPrivate(ACTOR* actor, int num) {
|
||||
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
|
||||
aWeather_Priv* priv = weather->priv;
|
||||
|
||||
@@ -132,7 +134,7 @@ void aWeather_AbolishPrivate(ACTOR* actor, int num) {
|
||||
}
|
||||
}
|
||||
|
||||
aWeather_Priv* aWeather_GetWeatherPrv(u8 status, s16 timer, xyz_t* pos, xyz_t* speed, ACTOR* actor, int id) {
|
||||
static aWeather_Priv* aWeather_GetWeatherPrv(u8 status, s16 timer, xyz_t* pos, xyz_t* speed, ACTOR* actor, int id) {
|
||||
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
|
||||
aWeather_Priv* priv = weather->priv;
|
||||
|
||||
@@ -155,7 +157,7 @@ aWeather_Priv* aWeather_GetWeatherPrv(u8 status, s16 timer, xyz_t* pos, xyz_t* s
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int aWeather_StopSysLevSE() {
|
||||
static int aWeather_StopSysLevSE() {
|
||||
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
|
||||
|
||||
u8 current = weather->current_sound_effect;
|
||||
@@ -171,7 +173,7 @@ int aWeather_StopSysLevSE() {
|
||||
}
|
||||
}
|
||||
|
||||
int aWeather_StartSysLevSE() {
|
||||
static int aWeather_StartSysLevSE() {
|
||||
WEATHER_ACTOR* weather = Common_Get(clip.weather_clip)->actor;
|
||||
|
||||
u8 current = weather->current_sound_effect;
|
||||
@@ -200,7 +202,7 @@ int aWeather_StartSysLevSE() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s16 level) {
|
||||
static void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s16 level) {
|
||||
|
||||
weather->next_status = status;
|
||||
weather->next_level = level;
|
||||
@@ -218,7 +220,7 @@ void aWeather_ChangeWeatherInstance(WEATHER_ACTOR* weather, s16 status, s16 leve
|
||||
}
|
||||
}
|
||||
|
||||
int aWeather_IsLand_Event_Check() {
|
||||
static int aWeather_IsLand_Event_Check() {
|
||||
|
||||
if (((mFI_CheckBeforeScenePerpetual() != 0) || (mFI_GetClimate() == 1)) &&
|
||||
(Common_Get(island_weather) != (s16)mEnv_SAVE_GET_WEATHER_TYPE(Save_Get(weather)))) {
|
||||
@@ -227,7 +229,7 @@ int aWeather_IsLand_Event_Check() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
|
||||
static int aWeather_Basement_Event_Check(WEATHER_ACTOR* weather) {
|
||||
|
||||
if ((weather->basement_event == 1) || (weather->basement_event == 2)) {
|
||||
return 1;
|
||||
@@ -303,7 +305,7 @@ static void aWeather_EndEnvSE(ACTOR* actor) {
|
||||
aWeather_SysLevCall_MoveEnd(weather);
|
||||
}
|
||||
|
||||
void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
|
||||
static void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
|
||||
|
||||
if (!mFI_GET_TYPE(mFI_GetFieldId())) {
|
||||
weather->current_profile = profile_tbl[id];
|
||||
@@ -312,7 +314,7 @@ void aWeather_SetNowProfile(WEATHER_ACTOR* weather, s16 id) {
|
||||
}
|
||||
}
|
||||
|
||||
void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
|
||||
static void aWeather_SecureWeatherPrivateWork(WEATHER_ACTOR* weather) {
|
||||
int i;
|
||||
|
||||
weather->priv = zelda_malloc(sizeof(aWeather_Priv) * 100);
|
||||
@@ -344,7 +346,7 @@ static void aWeather_SetClip(WEATHER_ACTOR* weather, int flag) {
|
||||
}
|
||||
}
|
||||
|
||||
void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
|
||||
static void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
|
||||
s_xyz pos = Common_Get(wind); // multiply by 1 means inline ?
|
||||
f32 speed = Common_Get(wind_speed) * 0.01f;
|
||||
f32 factor = 1.0f;
|
||||
@@ -354,7 +356,7 @@ void aWeather_RenewWindInfo(WEATHER_ACTOR* weather) {
|
||||
weather->wind_info.z = pos.z * speed * factor;
|
||||
}
|
||||
|
||||
void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves) {
|
||||
static void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves) {
|
||||
|
||||
int i;
|
||||
|
||||
@@ -363,7 +365,7 @@ void aWeather_SnowInAdvance(WEATHER_ACTOR* weather, GAME_PLAY* play, int moves)
|
||||
}
|
||||
}
|
||||
|
||||
void Weather_Actor_ct(ACTOR* actor, GAME* game) {
|
||||
static void Weather_Actor_ct(ACTOR* actor, GAME* game) {
|
||||
static s16 DemoWeatherTbl[5][2] = {
|
||||
3, 1, 1, 2, 0, 0, 0, 0, 2, 1,
|
||||
};
|
||||
@@ -481,7 +483,7 @@ static void Weather_Actor_draw(ACTOR* actor, GAME* game) {
|
||||
aWeather_DrawWeatherPrv(actor, game);
|
||||
}
|
||||
|
||||
void aWeather_MakeWeatherPrv(ACTOR* actor, GAME* game) {
|
||||
static void aWeather_MakeWeatherPrv(ACTOR* actor, GAME* game) {
|
||||
WEATHER_ACTOR* weather = (WEATHER_ACTOR*)actor;
|
||||
|
||||
if (weather->current_level != 0) {
|
||||
@@ -515,7 +517,7 @@ static void aWeather_MoveWeatherPrv(WEATHER_ACTOR* weather, GAME* game) {
|
||||
}
|
||||
}
|
||||
|
||||
int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
|
||||
static int aWeather_CountWeatherPrivate(WEATHER_ACTOR* weather) {
|
||||
int i;
|
||||
int count;
|
||||
aWeather_Priv* priv = weather->priv;
|
||||
@@ -554,13 +556,13 @@ static void aWeather_ChangeWeather(WEATHER_ACTOR* weather, GAME_PLAY* play) {
|
||||
}
|
||||
}
|
||||
|
||||
void aWeather_CheckWeatherTimer() {
|
||||
static void aWeather_CheckWeatherTimer() {
|
||||
s_xyz dir;
|
||||
|
||||
mEnv_DecideWindDirect(&dir, 0x3000, 0x3000);
|
||||
}
|
||||
|
||||
void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play) {
|
||||
static void aWeather_RenewWeatherLevel(WEATHER_ACTOR* weather, GAME_PLAY* play) {
|
||||
s16 level;
|
||||
|
||||
if (weather->current_level != weather->current_aim_level) {
|
||||
|
||||
+23
-34
@@ -6,58 +6,47 @@
|
||||
#include "m_rcp.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_handbill.h"
|
||||
|
||||
static void aYAT_actor_ct(ACTOR* actor, GAME* game);
|
||||
static void aYAT_actor_init(ACTOR* actor, GAME* game);
|
||||
static void aYAT_actor_draw(ACTOR* actor, GAME* game);
|
||||
|
||||
ACTOR_PROFILE Yatai_Profile = {
|
||||
mAc_PROFILE_YATAI,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
FIREWORKS_STALL0,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(YATAI_ACTOR),
|
||||
&aYAT_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aYAT_actor_init,
|
||||
&aYAT_actor_draw,
|
||||
NULL
|
||||
mAc_PROFILE_YATAI,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_TA_SET,
|
||||
FIREWORKS_STALL0,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(YATAI_ACTOR),
|
||||
&aYAT_actor_ct,
|
||||
NONE_ACTOR_PROC,
|
||||
&aYAT_actor_init,
|
||||
&aYAT_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static u8 aYAT_shadow_vtx_fix_flg_table[] = {
|
||||
TRUE, FALSE, TRUE, FALSE,
|
||||
FALSE, FALSE, TRUE, FALSE
|
||||
};
|
||||
static u8 aYAT_shadow_vtx_fix_flg_table[] = { TRUE, FALSE, TRUE, FALSE, FALSE, FALSE, TRUE, FALSE };
|
||||
|
||||
extern Vtx obj_e_yatai_shadow_l_v[];
|
||||
extern Gfx obj_e_yatai_shadow_l_modelT[];
|
||||
static bIT_ShadowData_c aYAT_shadow_data_l = {
|
||||
7, aYAT_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_e_yatai_shadow_l_v,
|
||||
obj_e_yatai_shadow_l_modelT
|
||||
};
|
||||
static bIT_ShadowData_c aYAT_shadow_data_l = { 7, aYAT_shadow_vtx_fix_flg_table, 60.0f, obj_e_yatai_shadow_l_v,
|
||||
obj_e_yatai_shadow_l_modelT };
|
||||
|
||||
extern Vtx obj_e_yatai_shadow_r_v[];
|
||||
extern Gfx obj_e_yatai_shadow_r_modelT[];
|
||||
static bIT_ShadowData_c aYAT_shadow_data_r = {
|
||||
10, aYAT_shadow_vtx_fix_flg_table,
|
||||
60.0f,
|
||||
obj_e_yatai_shadow_r_v,
|
||||
obj_e_yatai_shadow_r_modelT
|
||||
};
|
||||
static bIT_ShadowData_c aYAT_shadow_data_r = { 10, aYAT_shadow_vtx_fix_flg_table, 60.0f, obj_e_yatai_shadow_r_v,
|
||||
obj_e_yatai_shadow_r_modelT };
|
||||
|
||||
static void aYAT_set_bgOffset(STRUCTURE_ACTOR* yatai, int idx);
|
||||
|
||||
static void aYAT_actor_ct(ACTOR* actor, GAME* game)
|
||||
{
|
||||
STRUCTURE_ACTOR* yatai = (STRUCTURE_ACTOR*)actor;
|
||||
static void aYAT_actor_ct(ACTOR* actor, GAME* game) {
|
||||
STRUCTURE_ACTOR* yatai = (STRUCTURE_ACTOR*)actor;
|
||||
|
||||
yatai->arg0 = actor->npc_id - FIREWORKS_STALL0;
|
||||
aYAT_set_bgOffset(yatai, yatai->arg0 + 2);
|
||||
yatai->arg0 = actor->npc_id - FIREWORKS_STALL0;
|
||||
aYAT_set_bgOffset(yatai, yatai->arg0 + 2);
|
||||
}
|
||||
|
||||
#include "../src/ac_yatai_move.c_inc"
|
||||
#include "../src/ac_yatai_move.c_inc"
|
||||
|
||||
#include "../src/ac_yatai_draw.c_inc"
|
||||
#include "../src/ac_yatai_draw.c_inc"
|
||||
|
||||
+2
-1
@@ -8,6 +8,8 @@
|
||||
#include "m_common_data.h"
|
||||
#include "m_camera2.h"
|
||||
#include "sys_math.h"
|
||||
#include "jaudio_NES/kappa.h"
|
||||
#include "jaudio_NES/staff.h"
|
||||
|
||||
int S_ongenpos_refuse_fg;
|
||||
|
||||
@@ -297,7 +299,6 @@ extern void sAdos_KishaStatusLevel(f32 speed, u32 ongenNum1, u16 angle1, f32 dis
|
||||
}
|
||||
|
||||
extern void sAdos_GetRadioCounter(void* p) {
|
||||
|
||||
Na_GetRadioCounter(p);
|
||||
}
|
||||
|
||||
|
||||
+132
@@ -0,0 +1,132 @@
|
||||
#include "bg_item.h"
|
||||
|
||||
#include "m_common_data.h"
|
||||
#include "m_name_table.h"
|
||||
#include "m_malloc.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_skin_matrix.h"
|
||||
#include "gfxalloc.h"
|
||||
#include "m_rcp.h"
|
||||
#include "m_event_map_npc.h"
|
||||
|
||||
#define bIT_CLIP (Common_Get(clip).bg_item_clip)
|
||||
|
||||
static void bIT_actor_ct(ACTOR* actorx, GAME* game);
|
||||
static void bIT_actor_dt(ACTOR* actorx, GAME* game);
|
||||
static void bIT_actor_move(ACTOR* actorx, GAME* game);
|
||||
static void bIT_actor_draw(ACTOR* actorx, GAME* game);
|
||||
|
||||
ACTOR_PROFILE BgItem_Profile = {
|
||||
mAc_PROFILE_BGITEM,
|
||||
ACTOR_PART_ITEM,
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_BGITEM,
|
||||
sizeof(BG_ITEM_ACTOR),
|
||||
&bIT_actor_ct,
|
||||
&bIT_actor_dt,
|
||||
&bIT_actor_move,
|
||||
&bIT_actor_draw,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static f32 pos_table[] = {
|
||||
20.0f, 60.0f, 100.0f, 140.0f, 180.0f, 220.0f, 260.0f, 300.0f,
|
||||
340.0f, 380.0f, 420.0f, 460.0f, 500.0f, 540.0f, 580.0f, 620.0f,
|
||||
};
|
||||
|
||||
static f32 pos_table2[] = {
|
||||
0.0f, 40.0f, 80.0f, 120.0f, 160.0f, 200.0f, 240.0f, 280.0f,
|
||||
320.0f, 360.0f, 400.0f, 440.0f, 480.0f, 520.0f, 560.0f, 600.0f,
|
||||
};
|
||||
|
||||
#include "bg_item_data.c_inc"
|
||||
|
||||
// TODO:
|
||||
static bg_item_draw_part_table_c draw_part_table_a[];
|
||||
|
||||
#include "../src/bg_item_clip.c_inc"
|
||||
#include "../src/bg_item_common.c_inc"
|
||||
|
||||
extern u16 obj_g_hole_pal[];
|
||||
extern u16 obj_s_hole_pal[];
|
||||
|
||||
static void bIT_actor_ct(ACTOR* actorx, GAME* game) {
|
||||
BG_ITEM_ACTOR* bg_item = (BG_ITEM_ACTOR*)actorx;
|
||||
bg_item_common_c* common;
|
||||
bg_item_common_info_c* common_info;
|
||||
int i;
|
||||
int max;
|
||||
int event_type;
|
||||
PLAYER_ACTOR* player;
|
||||
mFI_block_tbl_c* block_table;
|
||||
bg_item_tbl_c* info_table;
|
||||
|
||||
common = &bg_item->common;
|
||||
common_info = &common->common_info;
|
||||
bIT_clip_ct(actorx);
|
||||
mFI_InitItemTable(&common->item_table);
|
||||
player = GET_PLAYER_ACTOR((GAME_PLAY*)game);
|
||||
event_type = mEvMN_GetEventTypeMap();
|
||||
|
||||
if (player != NULL) {
|
||||
mFI_GetItemTable(&bg_item->common.item_table, player->actor_class.world.position, __FILE__, 257);
|
||||
mFI_BornItemON();
|
||||
}
|
||||
|
||||
max = common->item_table.count;
|
||||
block_table = common->item_table.block_info_tbl;
|
||||
info_table = common->block_info_table.info_tbl;
|
||||
for (i = 0; i < max; i++, block_table++, info_table++) {
|
||||
bIT_common_clear_treeatr(block_table->block_x, block_table->block_z, info_table);
|
||||
|
||||
if (event_type == -1 || mEvMN_GetMapIdx(event_type) == -1) {
|
||||
mFI_ClearHoleBlock(block_table->block_x, block_table->block_z);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < mFM_VISIBLE_BLOCK_NUM; i++) {
|
||||
common->_139F4[i] = i;
|
||||
}
|
||||
|
||||
common_info->_30 = 4;
|
||||
common_info->draw_part_table_p = draw_part_table_a;
|
||||
|
||||
common_info->pal_p[bIT_PAL_FLOWER_A] = g_fdinfo->field_palette.flower0_pal;
|
||||
common_info->pal_p[bIT_PAL_FLOWER_B] = g_fdinfo->field_palette.flower1_pal;
|
||||
common_info->pal_p[bIT_PAL_FLOWER_C] = g_fdinfo->field_palette.flower2_pal;
|
||||
common_info->pal_p[bIT_PAL_GRASS] = g_fdinfo->field_palette.grass_pal;
|
||||
common_info->pal_p[bIT_PAL_TREE] = g_fdinfo->field_palette.cedar_tree_pal;
|
||||
common_info->pal_p[bIT_PAL_PALM_TREE] = g_fdinfo->field_palette.palm_tree_pal;
|
||||
common_info->pal_p[bIT_PAL_GOLD_TREE] = g_fdinfo->field_palette.golden_tree_pal;
|
||||
common_info->pal_p[bIT_PAL_HOLE_G] = obj_g_hole_pal;
|
||||
common_info->pal_p[bIT_PAL_HOLE_S] = obj_s_hole_pal;
|
||||
|
||||
common->bg_item_actorx_p = actorx;
|
||||
|
||||
{
|
||||
bg_item_draw_table_c* draw_tbl = common->draw_table;
|
||||
bg_item_idx_info_c* start_idx = bg_item->item_idx_info;
|
||||
|
||||
for (i = 0; i < mFM_VISIBLE_BLOCK_NUM; i++, draw_tbl++, start_idx++) {
|
||||
draw_tbl->draw_data.val = bIT_DRAW_TYPE_MAX - 1;
|
||||
draw_tbl->draw_data.idx_p = start_idx->idx;
|
||||
}
|
||||
}
|
||||
|
||||
common_info->pos_table_p = pos_table;
|
||||
bg_item_common_chg_BGDataR(common);
|
||||
bg_item_common_construct(game, common);
|
||||
}
|
||||
|
||||
static void bIT_actor_dt(ACTOR* actorx, GAME* game) {
|
||||
BG_ITEM_ACTOR* bg_item = (BG_ITEM_ACTOR*)actorx;
|
||||
|
||||
bg_item_common_destruct((GAME_PLAY*)game, actorx, &bg_item->common);
|
||||
bIT_clip_dt();
|
||||
}
|
||||
|
||||
#include "../src/bg_item_move.c_inc"
|
||||
#include "../src/bg_item_draw.c_inc"
|
||||
@@ -0,0 +1,109 @@
|
||||
static void bIT_copy_vtx(Vtx* dst, Vtx* src, u32 count, u8* fix_table, int fix_adjust_pos) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i != count; i++, src++, dst++, fix_table++) {
|
||||
*dst = *src;
|
||||
|
||||
/* Adjust vertex by sun position */
|
||||
if (*fix_table == TRUE) {
|
||||
dst->v.ob[0] = src->v.ob[0] + fix_adjust_pos;
|
||||
} else {
|
||||
dst->v.ob[0] = src->v.ob[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void bIT_draw_shadow(GAME* game, bIT_ShadowData_c* data, int type) {
|
||||
GRAPH* graph = game->graph;
|
||||
Kankyo* kankyo = &((GAME_PLAY*)game)->kankyo;
|
||||
Vtx* vtx = (Vtx*)GRAPH_ALLOC_TYPE(graph, Vtx, data->vtx_num);
|
||||
Gfx* gfx;
|
||||
u8 r;
|
||||
u8 g;
|
||||
u8 b;
|
||||
u8 a;
|
||||
|
||||
if (vtx != NULL) {
|
||||
bIT_copy_vtx(vtx, data->vtx, data->vtx_num, data->vtx_fix_flags, (int)(kankyo->shadow_pos * data->size));
|
||||
} else {
|
||||
vtx = data->vtx;
|
||||
}
|
||||
|
||||
OPEN_DISP(graph);
|
||||
gfx = NOW_SHADOW_DISP;
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gSPMatrix(gfx++, _Matrix_to_Mtx_new(graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(gfx++, G_MWO_SEGMENT_8, vtx);
|
||||
r = kankyo->base_light.shadow_color[0];
|
||||
g = kankyo->base_light.shadow_color[1];
|
||||
b = kankyo->base_light.shadow_color[2];
|
||||
a = kankyo->shadow_alpha;
|
||||
gDPSetPrimColor(gfx++, 0, kankyo->shadow_alpha, r, g, b, a);
|
||||
if (type == 1) {
|
||||
gSPLoadGeometryMode(gfx++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH | 0x00000050);
|
||||
}
|
||||
|
||||
gSPDisplayList(gfx++, data->gfx);
|
||||
|
||||
if (type == 1) {
|
||||
gSPLoadGeometryMode(gfx++, G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_SHADING_SMOOTH | 0x00000040);
|
||||
gSPDisplayList(gfx++, data->gfx);
|
||||
}
|
||||
|
||||
gSPClearGeometryMode(gfx++, 0x00000050);
|
||||
|
||||
SET_SHADOW_DISP(gfx);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
static void bIT_draw_shadow(GAME* game, bIT_ShadowData_c* data, int type);
|
||||
static void bit_cmn_single_draw(GAME* game, mActor_name_t fg_no, xyz_t* pos, f32 scale_f, bIT_DRAW_BF_PROC draw_bf,
|
||||
bIT_DRAW_AF_PROC draw_af, rgba_t* col);
|
||||
static int bIT_actor_player_drop_entry(GAME* game, mActor_name_t fg_item, int ut_x, int ut_z, s16 layer);
|
||||
static int BIT_actor_tree_cutcount_check(GAME* game, int ut_x, int ut_z);
|
||||
static void bIT_actor_dig_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames, u16 wait_frames);
|
||||
static void bIT_actor_bury_hole_effect_entry(mActor_name_t fg_item, xyz_t* pos, u16 frames);
|
||||
static void bIT_actor_fly_entry(mActor_name_t fg_item, xyz_t* pos, s16 angle_y);
|
||||
static int bIT_drop_entry_v1(mActor_name_t fg_item, xyz_t* pos, xyz_t* target_pos);
|
||||
static void bg_item_tree_fruit_drop(mActor_name_t fg_item, int ut_x, int ut_z, xyz_t* drop_pos);
|
||||
static int bIT_actor_pit_fall(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
static int bIT_actor_pit_fall_stop(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
static int bIT_actor_pit_exit(mActor_name_t pit_fg_item, int ut_x, int ut_z, mActor_name_t fg_item_in_pit);
|
||||
static int bIT_actor_rand_pos_get(xyz_t* pos, const xyz_t* check_pos);
|
||||
static int bg_item_ten_coin_entry_ex(xyz_t* pos, s16 angle);
|
||||
static int bIT_fruit_set(mActor_name_t fg_item, int ut_x, int ut_z, s16 count, int type);
|
||||
static int bIT_actor_fade_entry(mActor_name_t fg_name, xyz_t* pos);
|
||||
|
||||
static void bIT_clip_ct(ACTOR* actorx) {
|
||||
BG_ITEM_ACTOR* bg_item = (BG_ITEM_ACTOR*)actorx;
|
||||
|
||||
if (bIT_CLIP == NULL) {
|
||||
bIT_CLIP = (bIT_Clip_c*)zelda_malloc(sizeof(bIT_Clip_c));
|
||||
bIT_CLIP->draw_shadow_proc = &bIT_draw_shadow;
|
||||
bIT_CLIP->single_draw_proc = &bit_cmn_single_draw;
|
||||
bIT_CLIP->player_drop_entry_proc = &bIT_actor_player_drop_entry;
|
||||
bIT_CLIP->tree_cutcount_check_proc = &BIT_actor_tree_cutcount_check;
|
||||
bIT_CLIP->dig_hole_effect_entry_proc = &bIT_actor_dig_hole_effect_entry;
|
||||
bIT_CLIP->bury_hole_effect_entry_proc = &bIT_actor_bury_hole_effect_entry;
|
||||
bIT_CLIP->fly_entry_proc = &bIT_actor_fly_entry;
|
||||
bIT_CLIP->drop_entry_v1_proc = &bIT_drop_entry_v1;
|
||||
bIT_CLIP->item_tree_fruit_drop_proc = &bg_item_tree_fruit_drop;
|
||||
bIT_CLIP->pit_fall_proc = &bIT_actor_pit_fall;
|
||||
bIT_CLIP->pit_fall_stop_proc = &bIT_actor_pit_fall_stop;
|
||||
bIT_CLIP->pit_exit_proc = &bIT_actor_pit_exit;
|
||||
bIT_CLIP->rand_pos_get_proc = &bIT_actor_rand_pos_get;
|
||||
bIT_CLIP->ten_coin_entry_ex_proc = &bg_item_ten_coin_entry_ex;
|
||||
bIT_CLIP->fruit_set_proc = &bIT_fruit_set;
|
||||
bIT_CLIP->fade_entry_proc = &bIT_actor_fade_entry;
|
||||
bIT_CLIP->bg_item_common_p = &bg_item->common;
|
||||
bIT_CLIP->bg_item_actorx = actorx;
|
||||
}
|
||||
}
|
||||
|
||||
static void bIT_clip_dt(void) {
|
||||
if (bIT_CLIP != NULL) {
|
||||
zelda_free(bIT_CLIP);
|
||||
bIT_CLIP = NULL;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,260 @@
|
||||
static bg_item_type_data_c typeData_table_bgItem[] = {
|
||||
{ 0, bIT_DRAW_TYPE_NONE, NULL, NULL }, // 0x0000
|
||||
{ 0, bIT_DRAW_TYPE_STUMP1, pos_table, pos_table }, // 0x0001
|
||||
{ 0, bIT_DRAW_TYPE_STUMP2, pos_table, pos_table }, // 0x0002
|
||||
{ 0, bIT_DRAW_TYPE_STUMP3, pos_table, pos_table }, // 0x0003
|
||||
{ 0, bIT_DRAW_TYPE_STUMP4, pos_table, pos_table }, // 0x0004
|
||||
{ 0, bIT_DRAW_TYPE_FENCE, pos_table2, pos_table2 }, // 0x0005
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x0006
|
||||
{ 0, bIT_DRAW_TYPE_NOTICE, pos_table2, pos_table2 }, // 0x0007
|
||||
{ 0, bIT_DRAW_TYPE_GRASS, pos_table, pos_table }, // 0x0008
|
||||
{ 1, bIT_DRAW_TYPE_GRASS, pos_table, pos_table }, // 0x0009
|
||||
{ 2, bIT_DRAW_TYPE_GRASS, pos_table, pos_table }, // 0x000A
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x000B
|
||||
{ 0, bIT_DRAW_TYPE_MAPBOARD, pos_table2, pos_table2 }, // 0x000C
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x000D
|
||||
{ 0, bIT_DRAW_TYPE_MELODY, pos_table2, pos_table2 }, // 0x000E
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x000F
|
||||
{ 0, bIT_DRAW_TYPE_FENCES, pos_table, pos_table }, // 0x0010
|
||||
{ 0, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0011
|
||||
{ 1, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0012
|
||||
{ 2, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0013
|
||||
{ 3, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0014
|
||||
{ 4, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0015
|
||||
{ 5, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0016
|
||||
{ 6, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0017
|
||||
{ 7, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0018
|
||||
{ 8, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0019
|
||||
{ 9, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001A
|
||||
{ 10, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001B
|
||||
{ 11, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001C
|
||||
{ 12, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001D
|
||||
{ 13, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001E
|
||||
{ 14, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x001F
|
||||
{ 15, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0020
|
||||
{ 16, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0021
|
||||
{ 17, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0022
|
||||
{ 18, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0023
|
||||
{ 19, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0024
|
||||
{ 20, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0025
|
||||
{ 21, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0026
|
||||
{ 22, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0027
|
||||
{ 23, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0028
|
||||
{ 24, bIT_DRAW_TYPE_HOLE00_G, pos_table, pos_table }, // 0x0029
|
||||
{ 0, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002A
|
||||
{ 1, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002B
|
||||
{ 2, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002C
|
||||
{ 3, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002D
|
||||
{ 4, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002E
|
||||
{ 5, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x002F
|
||||
{ 6, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0030
|
||||
{ 7, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0031
|
||||
{ 8, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0032
|
||||
{ 9, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0033
|
||||
{ 10, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0034
|
||||
{ 11, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0035
|
||||
{ 12, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0036
|
||||
{ 13, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0037
|
||||
{ 14, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0038
|
||||
{ 15, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0039
|
||||
{ 16, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003A
|
||||
{ 17, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003B
|
||||
{ 18, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003C
|
||||
{ 19, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003D
|
||||
{ 20, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003E
|
||||
{ 21, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x003F
|
||||
{ 22, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0040
|
||||
{ 23, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0041
|
||||
{ 24, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0042
|
||||
{ 0, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0043
|
||||
{ 1, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0044
|
||||
{ 2, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0045
|
||||
{ 3, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0046
|
||||
{ 4, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0047
|
||||
{ 5, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0048
|
||||
{ 6, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0049
|
||||
{ 7, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004A
|
||||
{ 8, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004B
|
||||
{ 9, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004C
|
||||
{ 10, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004D
|
||||
{ 11, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004E
|
||||
{ 12, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x004F
|
||||
{ 13, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0050
|
||||
{ 14, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0051
|
||||
{ 15, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0052
|
||||
{ 16, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0053
|
||||
{ 17, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0054
|
||||
{ 18, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0055
|
||||
{ 19, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0056
|
||||
{ 20, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0057
|
||||
{ 21, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0058
|
||||
{ 22, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x0059
|
||||
{ 23, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x005A
|
||||
{ 24, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table }, // 0x005B
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x005C
|
||||
{ 0, bIT_DRAW_TYPE_HOLE00_SHIN_G, pos_table, pos_table }, // 0x005D
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x005E
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x005F
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0060
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0061
|
||||
{ 0, bIT_DRAW_TYPE_HONYCOMB, pos_table, pos_table }, // 0x0062
|
||||
{ 0, bIT_DRAW_TYPE_STONE_A, pos_table, pos_table }, // 0x0063
|
||||
{ 1, bIT_DRAW_TYPE_STONE_B, pos_table, pos_table }, // 0x0064
|
||||
{ 2, bIT_DRAW_TYPE_STONE_C, pos_table, pos_table }, // 0x0065
|
||||
{ 3, bIT_DRAW_TYPE_STONE_D, pos_table, pos_table }, // 0x0066
|
||||
{ 4, bIT_DRAW_TYPE_STONE_E, pos_table, pos_table }, // 0x0067
|
||||
{ 0, bIT_DRAW_TYPE_TANE, pos_table, pos_table }, // 0x0068
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0069
|
||||
{ 0, bIT_DRAW_TYPE_STONE_A, pos_table, pos_table }, // 0x006A
|
||||
{ 1, bIT_DRAW_TYPE_STONE_B, pos_table, pos_table }, // 0x006B
|
||||
{ 2, bIT_DRAW_TYPE_STONE_C, pos_table, pos_table }, // 0x006C
|
||||
{ 3, bIT_DRAW_TYPE_STONE_D, pos_table, pos_table }, // 0x006D
|
||||
{ 4, bIT_DRAW_TYPE_STONE_E, pos_table, pos_table }, // 0x006E
|
||||
{ 0, bIT_DRAW_TYPE_NONE, pos_table, pos_table }, // 0x006F
|
||||
{ 0, bIT_DRAW_TYPE_PALM_STUMP001, pos_table, pos_table }, // 0x0070
|
||||
{ 0, bIT_DRAW_TYPE_PALM_STUMP002, pos_table, pos_table }, // 0x0071
|
||||
{ 0, bIT_DRAW_TYPE_PALM_STUMP003, pos_table, pos_table }, // 0x0072
|
||||
{ 0, bIT_DRAW_TYPE_PALM_STUMP004, pos_table, pos_table }, // 0x0073
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR_STUMP001, pos_table, pos_table }, // 0x0074
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR_STUMP002, pos_table, pos_table }, // 0x0075
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR_STUMP003, pos_table, pos_table }, // 0x0076
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR_STUMP004, pos_table, pos_table }, // 0x0077
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR004, pos_table, pos_table }, // 0x0078
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR004, pos_table, pos_table }, // 0x0079
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR004, pos_table, pos_table }, // 0x007A
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE_STUMP001, pos_table, pos_table }, // 0x007B
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE_STUMP002, pos_table, pos_table }, // 0x007C
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE_STUMP003, pos_table, pos_table }, // 0x007D
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE_STUMP004, pos_table, pos_table }, // 0x007E
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE004, pos_table, pos_table }, // 0x007F
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE004, pos_table, pos_table }, // 0x0080
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE004, pos_table, pos_table }, // 0x0081
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR004, pos_table, pos_table }, // 0x0082
|
||||
};
|
||||
|
||||
static bg_item_type_data_c typeData_table_bgItem2[] = {
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0800
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0801
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0802
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0803
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0804
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0805
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0806
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0807
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0808
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0809
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x080A
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x080B
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_AP, pos_table, pos_table }, // 0x080C
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x080D
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x080E
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x080F
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0810
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0811
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0812
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0813
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_OR, pos_table, pos_table }, // 0x0814
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0815
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0816
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0817
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0818
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0819
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x081A
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x081B
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_PH, pos_table, pos_table }, // 0x081C
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x081D
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x081E
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x081F
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0820
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0821
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0822
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0823
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_PR, pos_table, pos_table }, // 0x0824
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0825
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0826
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0827
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0828
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x0829
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x082A
|
||||
{ 0, bIT_DRAW_TYPE_TREE4, pos_table, pos_table }, // 0x082B
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_NT, pos_table, pos_table }, // 0x082C
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x082D
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x082E
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x082F
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0830
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_BG, pos_table, pos_table }, // 0x0831
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0832
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0833
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0834
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0835
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_BG, pos_table, pos_table }, // 0x0836
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x0837
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0838
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0839
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x083A
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_BG, pos_table, pos_table }, // 0x083B
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x083C
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x083D
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x083E
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x083F
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x0840
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x0841
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x0842
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x0843
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER_LEAF, pos_table, pos_table }, // 0x0844
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER00, pos_table, pos_table }, // 0x0845
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER01, pos_table, pos_table }, // 0x0846
|
||||
{ 0, bIT_DRAW_TYPE_FLOWER02, pos_table, pos_table }, // 0x0847
|
||||
{ 1, bIT_DRAW_TYPE_FLOWER00, pos_table, pos_table }, // 0x0848
|
||||
{ 1, bIT_DRAW_TYPE_FLOWER01, pos_table, pos_table }, // 0x0849
|
||||
{ 1, bIT_DRAW_TYPE_FLOWER02, pos_table, pos_table }, // 0x084A
|
||||
{ 2, bIT_DRAW_TYPE_FLOWER00, pos_table, pos_table }, // 0x084B
|
||||
{ 2, bIT_DRAW_TYPE_FLOWER01, pos_table, pos_table }, // 0x084C
|
||||
{ 2, bIT_DRAW_TYPE_FLOWER02, pos_table, pos_table }, // 0x084D
|
||||
{ 0, bIT_DRAW_TYPE_TREE0_DEAD, pos_table, pos_table }, // 0x084E
|
||||
{ 0, bIT_DRAW_TYPE_TREE0, pos_table, pos_table }, // 0x084F
|
||||
{ 0, bIT_DRAW_TYPE_TREE1, pos_table, pos_table }, // 0x0850
|
||||
{ 0, bIT_DRAW_TYPE_TREE2, pos_table, pos_table }, // 0x0851
|
||||
{ 0, bIT_DRAW_TYPE_TREE3, pos_table, pos_table }, // 0x0852
|
||||
{ 0, bIT_DRAW_TYPE_TREE4_BG, pos_table, pos_table }, // 0x0853
|
||||
{ 0, bIT_DRAW_TYPE_PALM000, pos_table, pos_table }, // 0x0854
|
||||
{ 0, bIT_DRAW_TYPE_PALM001, pos_table, pos_table }, // 0x0855
|
||||
{ 0, bIT_DRAW_TYPE_PALM002, pos_table, pos_table }, // 0x0856
|
||||
{ 0, bIT_DRAW_TYPE_PALM003, pos_table, pos_table }, // 0x0857
|
||||
{ 0, bIT_DRAW_TYPE_PALM004, pos_table, pos_table }, // 0x0858
|
||||
{ 0, bIT_DRAW_TYPE_PALM004, pos_table, pos_table }, // 0x0859
|
||||
{ 0, bIT_DRAW_TYPE_PALM004, pos_table, pos_table }, // 0x085A
|
||||
{ 0, bIT_DRAW_TYPE_PALM004_CC, pos_table, pos_table }, // 0x085B
|
||||
{ 0, bIT_DRAW_TYPE_PALM000_DEAD, pos_table, pos_table }, // 0x085C
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR000, pos_table, pos_table }, // 0x085D
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR001, pos_table, pos_table }, // 0x085E
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR002, pos_table, pos_table }, // 0x085F
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR003, pos_table, pos_table }, // 0x0860
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR004, pos_table, pos_table }, // 0x0861
|
||||
{ 0, bIT_DRAW_TYPE_CEDAR000_DEAD, pos_table, pos_table }, // 0x0862
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE000, pos_table, pos_table }, // 0x0863
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE001, pos_table, pos_table }, // 0x0864
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE002, pos_table, pos_table }, // 0x0865
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE003, pos_table, pos_table }, // 0x0866
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE004, pos_table, pos_table }, // 0x0867
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE004, pos_table, pos_table }, // 0x0868
|
||||
{ 0, bIT_DRAW_TYPE_GOLD_TREE000_DEAD, pos_table, pos_table }, // 0x0869
|
||||
};
|
||||
|
||||
static bg_item_type_data_c typeData_table_dummy[] = {
|
||||
{ 0, bIT_DRAW_TYPE_FISH2, pos_table, pos_table },
|
||||
};
|
||||
|
||||
// BG draw data here
|
||||
|
||||
static bg_item_type_data_c typeData_table_item1[] = {
|
||||
{ 0, bIT_DRAW_TYPE_APPLE, pos_table, pos_table }, // 2XXX
|
||||
};
|
||||
|
||||
static bg_item_type_data_c typeData_table_ftr[] = {
|
||||
{ 0, bIT_DRAW_TYPE_LEAF, pos_table, pos_table }, // 1XXX, 3XXX
|
||||
};
|
||||
|
||||
static bg_item_type_data_c typeData_table_crack[] = {
|
||||
{ 0, bIT_DRAW_TYPE_CRACK00_G, pos_table, pos_table },
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
static void bIT_actor_draw(ACTOR* actorx, GAME* game) {
|
||||
BG_ITEM_ACTOR* bg_item = (BG_ITEM_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
bg_item_common_draw(play, &bg_item->common, draw_part_table_a);
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
static bg_item_type_data_c type_data_table_p_a[bIT_TYPE_CAT_NUM] = {
|
||||
// TODO
|
||||
};
|
||||
|
||||
static int bg_item_talking_display_limit_check(int idx) {
|
||||
int res = FALSE;
|
||||
|
||||
if ((idx >= bIT_DRAW_TYPE_TREE2 && idx <= bIT_DRAW_TYPE_TREE4_BG) ||
|
||||
(idx >= bIT_DRAW_TYPE_PALM002 && idx <= bIT_DRAW_TYPE_PALM004_CC) ||
|
||||
(idx >= bIT_DRAW_TYPE_CEDAR002 && idx <= bIT_DRAW_TYPE_CEDAR004) ||
|
||||
(idx >= bIT_DRAW_TYPE_GOLD_TREE002 && idx <= bIT_DRAW_TYPE_GOLD_TREE004) || idx == bIT_DRAW_TYPE_NOTICE ||
|
||||
idx == bIT_DRAW_TYPE_MAPBOARD || idx == bIT_DRAW_TYPE_MELODY) {
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static void bIT_actor_move(ACTOR* actorx, GAME* game) {
|
||||
BG_ITEM_ACTOR* bg_item = (BG_ITEM_ACTOR*)actorx;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
bg_item_common_c* common = &bg_item->common;
|
||||
bg_item_common_info_c* common_info = &common->common_info;
|
||||
|
||||
common_info->type_data_table_p = type_data_table_p_a;
|
||||
common_info->pos_table_p = pos_table;
|
||||
common->flags = 0;
|
||||
|
||||
if (Camera2_CheckCullingMode() != FALSE) {
|
||||
common->flags |= 1;
|
||||
}
|
||||
|
||||
common->talk_display_limit_check_proc = &bg_item_talking_display_limit_check;
|
||||
bg_item_common_move(play, actorx, &bg_item->common);
|
||||
}
|
||||
+64
-73
@@ -17,7 +17,7 @@ extern Vtx light_floorL01_vtx[];
|
||||
extern Vtx light_floorR01_vtx[];
|
||||
extern Gfx light_shine01_mode[];
|
||||
extern Vtx light_shineL01_vtx[];
|
||||
extern Vtx light_shineR01_vtx[];
|
||||
extern Vtx light_shineR01_vtx[];
|
||||
|
||||
ACTOR_PROFILE Room_Sunshine_Profile = {
|
||||
mAc_PROFILE_ROOM_SUNSHINE,
|
||||
@@ -33,111 +33,105 @@ ACTOR_PROFILE Room_Sunshine_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void Ef_Room_Sunshine_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_actor_ct(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
xyz_t pos;
|
||||
xyz_t pos2;
|
||||
xyz_t pos2;
|
||||
xyz_t pos3;
|
||||
|
||||
|
||||
sunshine->unk_174 = 0;
|
||||
|
||||
if(sunshine->actor_class.actor_specific == 0){
|
||||
if (sunshine->actor_class.actor_specific == 0) {
|
||||
sunshine->actor_class.mv_proc = Ef_Room_SunshineL_actor_move;
|
||||
sunshine->actor_class.dw_proc = Ef_Room_SunshineL_actor_draw;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
sunshine->actor_class.world.position.x -= 1.0f;
|
||||
}
|
||||
|
||||
sunshine->actor_class.world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
sunshine->actor_class.world.position.y =
|
||||
mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
|
||||
sunshine->actor_class.scale.x = 1.0f;
|
||||
sunshine->actor_class.scale.y = 1.0f;
|
||||
sunshine->actor_class.scale.z = 1.0f;
|
||||
|
||||
switch(sunshine->actor_class.actor_specific){
|
||||
switch (sunshine->actor_class.actor_specific) {
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
sunshine->actor_class.mv_proc = Ef_Room_SunshineL_actor_move;
|
||||
sunshine->actor_class.dw_proc = Ef_Room_SunshineL_actor_draw;
|
||||
sunshine->actor_class.world.position.x += 5.0f;
|
||||
sunshine->actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
sunshine->actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
sunshine->actor_class.world.position.x -= 6.0f;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
sunshine->actor_class.world.position.x -= 5.0f;
|
||||
sunshine->actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
sunshine->actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(sunshine->actor_class.world.position, 0.0f);
|
||||
sunshine->actor_class.world.position.x += 6.0f;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static f32 calc_scale_Ef_Room_Sunshine(int flag, int sec) {
|
||||
|
||||
f32 calc_scale_Ef_Room_Sunshine(int flag, int sec){
|
||||
|
||||
if(flag == 0){
|
||||
if (flag == 0) {
|
||||
return 1.5f * sin_s((sec << 14) / 28800.0f);
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return 1.5f * sin_s((sec << 14) / 14400.0f);
|
||||
}
|
||||
}
|
||||
|
||||
int calc_alpha_Ef_Room_Sunshine(){
|
||||
static int calc_alpha_Ef_Room_Sunshine() {
|
||||
f32 ret;
|
||||
int sec;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
ret = (120.0f + GETREG(TAKREG,30)) * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
}
|
||||
else if(Common_Get(time.now_sec) < 72000){
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ?
|
||||
(Common_Get(time.now_sec) - 43200U) : -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
ret = (120.0f + GETREG(TAKREG, 30)) * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
} else if (Common_Get(time.now_sec) < 72000) {
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
|
||||
: -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
ret = 255.0f * ((28800 - sec) / 28800.0f);
|
||||
}
|
||||
else{
|
||||
ret = (120.0f + GETREG(TAKREG,30)) * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
} else {
|
||||
ret = (120.0f + GETREG(TAKREG, 30)) * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
}
|
||||
|
||||
if((Common_Get(weather) == 1) || (Common_Get(weather) == 2)){
|
||||
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
|
||||
ret *= 0.6f;
|
||||
}
|
||||
|
||||
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
void Ef_Room_SunshineL_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_SunshineL_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(1, Common_Get(time.now_sec));
|
||||
}
|
||||
else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)){
|
||||
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
|
||||
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(0, Common_Get(time.now_sec) - 43200);
|
||||
}
|
||||
else{
|
||||
sunshine->actor_class.scale.x = 0.0f;
|
||||
} else {
|
||||
sunshine->actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Ef_Room_SunshineR_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_SunshineR_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)){
|
||||
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
|
||||
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(0, 43200 - Common_Get(time.now_sec));
|
||||
}
|
||||
else if (Common_Get(time.now_sec) >= 72000){
|
||||
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(1, 86400 -Common_Get(time.now_sec));
|
||||
}
|
||||
else{
|
||||
sunshine->actor_class.scale.x = 0.0f;
|
||||
} else if (Common_Get(time.now_sec) >= 72000) {
|
||||
sunshine->actor_class.scale.x = calc_scale_Ef_Room_Sunshine(1, 86400 - Common_Get(time.now_sec));
|
||||
} else {
|
||||
sunshine->actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void setup_mode_Ef_Room_Sunshine(ACTOR* actor, GAME_PLAY* play){
|
||||
static void setup_mode_Ef_Room_Sunshine(ACTOR* actor, GAME_PLAY* play) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
u8* color;
|
||||
f32 alpha;
|
||||
@@ -146,41 +140,39 @@ void setup_mode_Ef_Room_Sunshine(ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, 0.1f +sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, 0.1f + sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
|
||||
|
||||
gDPPipeSync(NEXT_POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
|
||||
color =play->kankyo.base_light.sun_color_window;
|
||||
}
|
||||
else{
|
||||
color =play->kankyo.base_light.moon_color_window;
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
|
||||
color = play->kankyo.base_light.sun_color_window;
|
||||
} else {
|
||||
color = play->kankyo.base_light.moon_color_window;
|
||||
}
|
||||
|
||||
alpha = (u8)calc_alpha_Ef_Room_Sunshine() * mKK_windowlight_alpha_get();
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0,0, color[0], color[1], color[2], (int)(alpha));
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, 0, color[0], color[1], color[2], (int)(alpha));
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
void Ef_Room_SunshineL_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_SunshineL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
GRAPH* graph;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floor01_mode);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floorL01_vtx);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shine01_mode);
|
||||
@@ -189,14 +181,13 @@ void Ef_Room_SunshineL_actor_draw(ACTOR* actor, GAME* game){
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
|
||||
void Ef_Room_SunshineR_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_SunshineR_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
GRAPH* graph;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine(actor, play);
|
||||
@@ -207,6 +198,6 @@ void Ef_Room_SunshineR_actor_draw(ACTOR* actor, GAME* game){
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_floorR01_vtx);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shine01_mode);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, light_shineR01_vtx);
|
||||
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
+131
-144
@@ -5,6 +5,7 @@
|
||||
#include "m_debug.h"
|
||||
#include "m_collision_bg.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "m_rcp.h"
|
||||
|
||||
void Ef_Room_Sunshine_Minsect_actor_ct(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_Minsect_actor_dt(ACTOR* actor, GAME* play);
|
||||
@@ -34,114 +35,110 @@ ACTOR_PROFILE Room_Sunshine_Minsect_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void Ef_Room_Sunshine_Minsect_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_Minsect_actor_ct(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
|
||||
xyz_t pos;
|
||||
|
||||
|
||||
minsect->ef_sunshine_class.unk_174 = 0;
|
||||
draw_status = 0;
|
||||
if(minsect->ef_sunshine_class.actor_class.actor_specific == 0){
|
||||
if (minsect->ef_sunshine_class.actor_class.actor_specific == 0) {
|
||||
minsect->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MinsectL_actor_move;
|
||||
minsect->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MinsectL_actor_draw;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
minsect->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
|
||||
}
|
||||
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(minsect->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y =
|
||||
mCoBG_GetBgY_OnlyCenter_FromWpos(minsect->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = 0.01f;
|
||||
minsect->ef_sunshine_class.actor_class.scale.y = 0.01f;
|
||||
minsect->ef_sunshine_class.actor_class.scale.z = 0.01f;
|
||||
minsect->ef_sunshine_class.actor_class.cull_radius = 10000.0f;
|
||||
minsect->ef_sunshine_class.actor_class.cull_radius = 10000.0f;
|
||||
|
||||
switch(minsect->ef_sunshine_class.actor_class.actor_specific){
|
||||
switch (minsect->ef_sunshine_class.actor_class.actor_specific) {
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
minsect->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_MinsectL_actor_move;
|
||||
minsect->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_MinsectL_actor_draw;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.x += 5.0f;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
minsect->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.x += 6.0f;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
f32 calc_scale_Ef_Room_Sunshine_Minsect(int flag, int sec){
|
||||
|
||||
if(flag == 0){
|
||||
static f32 calc_scale_Ef_Room_Sunshine_Minsect(int flag, int sec) {
|
||||
|
||||
if (flag == 0) {
|
||||
return 0.01f * (1.5f * sin_s((sec << 14) / 28800.0f));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return 0.01f * (1.5f * sin_s((sec << 14) / 14400.0f));
|
||||
}
|
||||
}
|
||||
|
||||
int calc_alpha_Ef_Room_SunshineMinsect(){
|
||||
static int calc_alpha_Ef_Room_SunshineMinsect() {
|
||||
f32 ret;
|
||||
int sec;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
}
|
||||
else if(Common_Get(time.now_sec) < 72000){
|
||||
//any other number matches codegen, but 43200 breaks
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ?
|
||||
(Common_Get(time.now_sec) - 43200U) : -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
} else if (Common_Get(time.now_sec) < 72000) {
|
||||
// any other number matches codegen, but 43200 breaks
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
|
||||
: -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
ret = 255.0f * ((28800 - sec) / 28800.0f);
|
||||
}
|
||||
else{
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
} else {
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
}
|
||||
|
||||
if((Common_Get(weather) == 1) || (Common_Get(weather) == 2)){
|
||||
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
|
||||
ret *= 0.6f;
|
||||
}
|
||||
|
||||
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_MinsectL_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_MinsectL_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Minsect(1, Common_Get(time.now_sec));
|
||||
}
|
||||
else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)){
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Minsect(0, Common_Get(time.now_sec) - 43200);
|
||||
}
|
||||
else{
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x =
|
||||
calc_scale_Ef_Room_Sunshine_Minsect(1, Common_Get(time.now_sec));
|
||||
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x =
|
||||
calc_scale_Ef_Room_Sunshine_Minsect(0, Common_Get(time.now_sec) - 43200);
|
||||
} else {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG,64);
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG, 64);
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_MinsectR_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_MinsectR_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEMINSECT_ACTOR* minsect = (ROOMSUNSHINEMINSECT_ACTOR*)actor;
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)){
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Minsect(0, 43200 - Common_Get(time.now_sec));
|
||||
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Minsect(0, 43200 - Common_Get(time.now_sec));
|
||||
} else if (Common_Get(time.now_sec) >= 72000) {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Minsect(1, 86400 - Common_Get(time.now_sec));
|
||||
} else {
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
else if (Common_Get(time.now_sec) >= 72000){
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Minsect(1, 86400 -Common_Get(time.now_sec));
|
||||
}
|
||||
else{
|
||||
minsect->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG,64);
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y = minsect->ef_sunshine_class.actor_class.home.position.y;
|
||||
minsect->ef_sunshine_class.actor_class.world.position.y += 0.01f * GETREG(TAKREG, 64);
|
||||
}
|
||||
|
||||
|
||||
void setup_mode_Ef_Room_Sunshine_Minsect(ACTOR* actor, GAME_PLAY* play){
|
||||
static void setup_mode_Ef_Room_Sunshine_Minsect(ACTOR* actor, GAME_PLAY* play) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
u8* color;
|
||||
int calc;
|
||||
@@ -150,29 +147,27 @@ void setup_mode_Ef_Room_Sunshine_Minsect(ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
|
||||
|
||||
gDPPipeSync(NEXT_POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
|
||||
color =play->kankyo.base_light.sun_color_window;
|
||||
}
|
||||
else{
|
||||
color =play->kankyo.base_light.moon_color_window;
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
|
||||
color = play->kankyo.base_light.sun_color_window;
|
||||
} else {
|
||||
color = play->kankyo.base_light.moon_color_window;
|
||||
}
|
||||
|
||||
calc = ((u8)calc_alpha_Ef_Room_SunshineMinsect() * mKK_windowlight_alpha_get());
|
||||
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 75);
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
void setup_mode_Ef_Room_Sunshine_Minsect_decal(ACTOR* actor, GAME_PLAY* play){
|
||||
static void setup_mode_Ef_Room_Sunshine_Minsect_decal(ACTOR* actor, GAME_PLAY* play) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
u8* color;
|
||||
int calc;
|
||||
@@ -181,52 +176,49 @@ void setup_mode_Ef_Room_Sunshine_Minsect_decal(ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
|
||||
|
||||
gDPPipeSync(NEXT_POLY_OPA_DISP);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
|
||||
color =play->kankyo.base_light.sun_color_window;
|
||||
}
|
||||
else{
|
||||
color =play->kankyo.base_light.moon_color_window;
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
|
||||
color = play->kankyo.base_light.sun_color_window;
|
||||
} else {
|
||||
color = play->kankyo.base_light.moon_color_window;
|
||||
}
|
||||
|
||||
calc = ((u8)calc_alpha_Ef_Room_SunshineMinsect() * mKK_windowlight_alpha_get());
|
||||
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_OPA_DISP, 0, calc, color[0], color[1], color[2], 75);
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
static void BG_draw_Minsect(ACTOR* actor, GAME_PLAY* play) {
|
||||
GRAPH* graph;
|
||||
|
||||
void BG_draw_Minsect(ACTOR* actor, GAME_PLAY* play){
|
||||
GRAPH* graph;
|
||||
|
||||
if(!(draw_status & 4)){
|
||||
if (!(draw_status & 4)) {
|
||||
draw_status |= 4;
|
||||
}
|
||||
|
||||
if((draw_status & 1) && (draw_status & 2)){
|
||||
draw_status = 0;
|
||||
if ((draw_status & 1) && (draw_status & 2)) {
|
||||
draw_status = 0;
|
||||
}
|
||||
|
||||
graph = play->game.graph;
|
||||
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 0);
|
||||
Global_kankyo_set_room_prim(play);
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, rom_museum4_ue_model);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
void BG_draw_Minsect_niwa(ACTOR* actor, GAME_PLAY* play){
|
||||
GRAPH* graph;
|
||||
static void BG_draw_Minsect_niwa(ACTOR* actor, GAME_PLAY* play) {
|
||||
GRAPH* graph;
|
||||
|
||||
graph = play->game.graph;
|
||||
Matrix_scale(0.0625f, 0.0625f, 0.0625f, 0);
|
||||
@@ -235,10 +227,10 @@ void BG_draw_Minsect_niwa(ACTOR* actor, GAME_PLAY* play){
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, rom_museum4_model);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_MinsectL_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_MinsectL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
|
||||
_texture_z_light_fog_prim(game->graph);
|
||||
@@ -247,75 +239,70 @@ void Ef_Room_Sunshine_MinsectL_actor_draw(ACTOR* actor, GAME* game){
|
||||
|
||||
draw_status |= 1;
|
||||
|
||||
if(mKK_windowlight_alpha_get() < 9.99999974738e-05f){
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)){
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
if (mKK_windowlight_alpha_get() < 9.99999974738e-05f) {
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
}
|
||||
} else if (0.0f == actor->scale.x) {
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
}
|
||||
} else {
|
||||
s16 reg;
|
||||
graph = game->graph;
|
||||
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect(actor, (GAME_PLAY*)game);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor, (GAME_PLAY*)game);
|
||||
|
||||
if (REGADDR(TAKREG, 0) == 0) {
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
|
||||
}
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
else if(0.0f == actor->scale.x){
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)){
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
}
|
||||
}
|
||||
else{
|
||||
s16 reg;
|
||||
graph = game->graph;
|
||||
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect(actor,(GAME_PLAY*)game);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor,(GAME_PLAY*)game);
|
||||
|
||||
if(REGADDR(TAKREG, 0) == 0){
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
|
||||
}
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_MinsectR_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_MinsectR_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
|
||||
|
||||
_texture_z_light_fog_prim(game->graph);
|
||||
_texture_z_light_fog_prim_shadow(game->graph);
|
||||
_texture_z_light_fog_prim_xlu(game->graph);
|
||||
|
||||
draw_status |= 2;
|
||||
|
||||
if(mKK_windowlight_alpha_get() < 9.99999974738e-05f){
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)){
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
if (mKK_windowlight_alpha_get() < 9.99999974738e-05f) {
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
}
|
||||
}
|
||||
else if(0.0f == actor->scale.x){
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)){
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
} else if (0.0f == actor->scale.x) {
|
||||
if ((draw_status & 1) && (draw_status & 2) && !(draw_status & 4)) {
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
}
|
||||
}
|
||||
else{
|
||||
graph = game->graph;
|
||||
} else {
|
||||
graph = game->graph;
|
||||
|
||||
BG_draw_Minsect_niwa(actor,(GAME_PLAY*)game);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect(actor,(GAME_PLAY*)game);
|
||||
OPEN_DISP(graph);
|
||||
BG_draw_Minsect_niwa(actor, (GAME_PLAY*)game);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect(actor, (GAME_PLAY*)game);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor,(GAME_PLAY*)game);
|
||||
|
||||
if(REGADDR(TAKREG, 0) == 0){
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
|
||||
}
|
||||
BG_draw_Minsect(actor,(GAME_PLAY*)game);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_museum4_shine_1T_model);
|
||||
setup_mode_Ef_Room_Sunshine_Minsect_decal(actor, (GAME_PLAY*)game);
|
||||
|
||||
if (REGADDR(TAKREG, 0) == 0) {
|
||||
gSPDisplayList(NEXT_POLY_OPA_DISP, obj_museum4_shine_2T_model);
|
||||
}
|
||||
BG_draw_Minsect(actor, (GAME_PLAY*)game);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@
|
||||
#include "m_collision_bg.h"
|
||||
#include "sys_matrix.h"
|
||||
|
||||
void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_Police_actor_dt(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_Police_actor_dt(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* play);
|
||||
|
||||
extern Gfx obj_koban_shine_modelT[];
|
||||
|
||||
@@ -29,119 +29,119 @@ ACTOR_PROFILE Room_Sunshine_Police_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_Police_actor_ct(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
|
||||
xyz_t pos;
|
||||
xyz_t pos2;
|
||||
xyz_t pos2;
|
||||
xyz_t pos3;
|
||||
|
||||
|
||||
police->ef_sunshine_class.unk_174 = 0;
|
||||
|
||||
if(police->ef_sunshine_class.actor_class.actor_specific == 0){
|
||||
if (police->ef_sunshine_class.actor_class.actor_specific == 0) {
|
||||
police->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PoliceL_actor_move;
|
||||
police->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PoliceL_actor_draw;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
police->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
|
||||
}
|
||||
|
||||
police->ef_sunshine_class.actor_class.world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
police->ef_sunshine_class.actor_class.world.position.y =
|
||||
mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
|
||||
police->ef_sunshine_class.actor_class.scale.x = 0.01f;
|
||||
police->ef_sunshine_class.actor_class.scale.y = 0.01f;
|
||||
police->ef_sunshine_class.actor_class.scale.z = 0.01f;
|
||||
|
||||
switch(police->ef_sunshine_class.actor_class.actor_specific){
|
||||
switch (police->ef_sunshine_class.actor_class.actor_specific) {
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
police->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PoliceL_actor_move;
|
||||
police->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PoliceL_actor_draw;
|
||||
police->ef_sunshine_class.actor_class.world.position.x += 5.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) - 40.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) -
|
||||
40.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
police->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) - 40.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(police->ef_sunshine_class.actor_class.world.position, 0.0f) -
|
||||
40.0f;
|
||||
police->ef_sunshine_class.actor_class.world.position.x += 6.0f;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
f32 calc_scale_Ef_Room_Sunshine_Police(int flag, int sec){
|
||||
|
||||
if(flag == 0){
|
||||
static f32 calc_scale_Ef_Room_Sunshine_Police(int flag, int sec) {
|
||||
|
||||
if (flag == 0) {
|
||||
return 0.01f * (1.5f * sin_s((sec << 14) / 28800.0f));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return 0.01f * (1.5f * sin_s((sec << 14) / 14400.0f));
|
||||
}
|
||||
}
|
||||
|
||||
int calc_alpha_Ef_Room_SunshinePolice(){
|
||||
static int calc_alpha_Ef_Room_SunshinePolice() {
|
||||
f32 ret;
|
||||
int sec;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
}
|
||||
else if(Common_Get(time.now_sec) < 72000){
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ?
|
||||
(Common_Get(time.now_sec) - 43200U) : -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
} else if (Common_Get(time.now_sec) < 72000) {
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
|
||||
: -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
ret = 255.0f * ((28800 - sec) / 28800.0f);
|
||||
}
|
||||
else{
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
} else {
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
}
|
||||
|
||||
if((Common_Get(weather) == 1) || (Common_Get(weather) == 2)){
|
||||
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
|
||||
ret *= 0.6f;
|
||||
}
|
||||
|
||||
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PoliceL_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
police->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Police(1, Common_Get(time.now_sec));
|
||||
}
|
||||
else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)){
|
||||
police->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Police(0, Common_Get(time.now_sec) - 43200);
|
||||
}
|
||||
else{
|
||||
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
|
||||
police->ef_sunshine_class.actor_class.scale.x =
|
||||
calc_scale_Ef_Room_Sunshine_Police(0, Common_Get(time.now_sec) - 43200);
|
||||
} else {
|
||||
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PoliceR_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOLICE_ACTOR* police = (ROOMSUNSHINEPOLICE_ACTOR*)actor;
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)){
|
||||
police->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Police(0, 43200 - Common_Get(time.now_sec));
|
||||
}
|
||||
else if (Common_Get(time.now_sec) >= 72000){
|
||||
police->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Police(1, 86400 -Common_Get(time.now_sec));
|
||||
}
|
||||
else{
|
||||
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
|
||||
police->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Police(0, 43200 - Common_Get(time.now_sec));
|
||||
} else if (Common_Get(time.now_sec) >= 72000) {
|
||||
police->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Police(1, 86400 - Common_Get(time.now_sec));
|
||||
} else {
|
||||
police->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
int cull_check_from_camera(ACTOR* actor, GAME_PLAY* play, int flag){
|
||||
static int cull_check_from_camera(ACTOR* actor, GAME_PLAY* play, int flag) {
|
||||
|
||||
if(((play->camera.lookat.eye.x >= actor->world.position.x) && (flag == 1)) ||
|
||||
(play->camera.lookat.eye.x <= actor->world.position.x) && (flag == 0)){
|
||||
return 1;
|
||||
if (((play->camera.lookat.eye.x >= actor->world.position.x) && (flag == 1)) ||
|
||||
(play->camera.lookat.eye.x <= actor->world.position.x) && (flag == 0)) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void setup_mode_Ef_Room_Sunshine_Police(ACTOR* actor, GAME_PLAY* play){
|
||||
static void setup_mode_Ef_Room_Sunshine_Police(ACTOR* actor, GAME_PLAY* play) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
u8* color;
|
||||
int calc;
|
||||
@@ -150,67 +150,62 @@ void setup_mode_Ef_Room_Sunshine_Police(ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
|
||||
|
||||
gDPPipeSync(NEXT_POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
|
||||
color =play->kankyo.base_light.sun_color_window;
|
||||
}
|
||||
else{
|
||||
color =play->kankyo.base_light.moon_color_window;
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
|
||||
color = play->kankyo.base_light.sun_color_window;
|
||||
} else {
|
||||
color = play->kankyo.base_light.moon_color_window;
|
||||
}
|
||||
|
||||
calc = ((u8)calc_alpha_Ef_Room_SunshinePolice() * mKK_windowlight_alpha_get());
|
||||
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 255);
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PoliceL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(cull_check_from_camera(actor,play,0) == 0){
|
||||
|
||||
if (cull_check_from_camera(actor, play, 0) == 0) {
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Police(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_koban_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_koban_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PoliceR_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if(cull_check_from_camera(actor,play,1) == 0){
|
||||
|
||||
if (cull_check_from_camera(actor, play, 1) == 0) {
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Police(actor, play);
|
||||
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_koban_shine_modelT);
|
||||
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,15 +5,14 @@
|
||||
#include "m_debug.h"
|
||||
#include "m_collision_bg.h"
|
||||
#include "sys_matrix.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
|
||||
void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_Posthouse_actor_dt(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* play);
|
||||
void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* play);
|
||||
|
||||
static void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_Posthouse_actor_dt(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* play);
|
||||
static void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* play);
|
||||
|
||||
extern Gfx obj_yubinkyoku_shine_modelT[];
|
||||
|
||||
@@ -31,111 +30,110 @@ ACTOR_PROFILE Room_Sunshine_Posthouse_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_Posthouse_actor_ct(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
|
||||
xyz_t pos;
|
||||
xyz_t pos2;
|
||||
xyz_t pos2;
|
||||
xyz_t pos3;
|
||||
|
||||
|
||||
posthouse->ef_sunshine_class.unk_174 = 0;
|
||||
|
||||
if(posthouse->ef_sunshine_class.actor_class.actor_specific == 0){
|
||||
if (posthouse->ef_sunshine_class.actor_class.actor_specific == 0) {
|
||||
posthouse->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PosthouseL_actor_move;
|
||||
posthouse->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PosthouseL_actor_draw;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.x -= 1.0f;
|
||||
}
|
||||
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y = mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y =
|
||||
mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = 0.05f;
|
||||
posthouse->ef_sunshine_class.actor_class.scale.y = 0.05f;
|
||||
posthouse->ef_sunshine_class.actor_class.scale.z = 0.05f;
|
||||
|
||||
switch(posthouse->ef_sunshine_class.actor_class.actor_specific){
|
||||
switch (posthouse->ef_sunshine_class.actor_class.actor_specific) {
|
||||
|
||||
case 2:
|
||||
|
||||
|
||||
posthouse->ef_sunshine_class.actor_class.mv_proc = Ef_Room_Sunshine_PosthouseL_actor_move;
|
||||
posthouse->ef_sunshine_class.actor_class.dw_proc = Ef_Room_Sunshine_PosthouseL_actor_draw;
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.x += 5.0f;
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.x -= 6.0f;
|
||||
break;
|
||||
break;
|
||||
|
||||
case 3:
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.x -= 5.0f;
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y = 1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.y =
|
||||
1.0f + mCoBG_GetBgY_OnlyCenter_FromWpos(posthouse->ef_sunshine_class.actor_class.world.position, 0.0f);
|
||||
posthouse->ef_sunshine_class.actor_class.world.position.x += 6.0f;
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
f32 calc_scale_Ef_Room_Sunshine_Posthouse(int flag, int sec){
|
||||
|
||||
if(flag == 0){
|
||||
static f32 calc_scale_Ef_Room_Sunshine_Posthouse(int flag, int sec) {
|
||||
|
||||
if (flag == 0) {
|
||||
return 0.05f * (1.5f * sin_s((sec << 14) / 28800.0f));
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
return 0.05f * (1.5f * sin_s((sec << 14) / 14400.0f));
|
||||
}
|
||||
}
|
||||
|
||||
int calc_alpha_Ef_Room_SunshinePosthouse(){
|
||||
static int calc_alpha_Ef_Room_SunshinePosthouse() {
|
||||
f32 ret;
|
||||
int sec;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
}
|
||||
else if(Common_Get(time.now_sec) < 72000){
|
||||
//any other number matches codegen, but 43200 breaks
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ?
|
||||
(Common_Get(time.now_sec) - 43200U) : -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
ret = 120.0f * ((14400 - Common_Get(time.now_sec)) / 14400.0f);
|
||||
} else if (Common_Get(time.now_sec) < 72000) {
|
||||
// any other number matches codegen, but 43200 breaks
|
||||
sec = (Common_Get(time.now_sec) - 43200) >= 0 ? (Common_Get(time.now_sec) - 43200U)
|
||||
: -(Common_Get(time.now_sec) - 43200U);
|
||||
|
||||
ret = 255.0f * ((28800 - sec) / 28800.0f);
|
||||
}
|
||||
else{
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
} else {
|
||||
ret = 120.0f * ((14400 - (86400 - Common_Get(time.now_sec))) / 14400.0f);
|
||||
}
|
||||
|
||||
if((Common_Get(weather) == 1) || (Common_Get(weather) == 2)){
|
||||
if ((Common_Get(weather) == 1) || (Common_Get(weather) == 2)) {
|
||||
ret *= 0.6f;
|
||||
}
|
||||
|
||||
|
||||
return (u8)ret;
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PosthouseL_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
|
||||
|
||||
if(Common_Get(time.now_sec) < 14400){
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Posthouse(1, Common_Get(time.now_sec));
|
||||
}
|
||||
else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)){
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = calc_scale_Ef_Room_Sunshine_Posthouse(0, Common_Get(time.now_sec) - 43200);
|
||||
}
|
||||
else{
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
|
||||
if (Common_Get(time.now_sec) < 14400) {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x =
|
||||
calc_scale_Ef_Room_Sunshine_Posthouse(1, Common_Get(time.now_sec));
|
||||
} else if ((Common_Get(time.now_sec) >= 43200) && (Common_Get(time.now_sec) < 72000)) {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x =
|
||||
calc_scale_Ef_Room_Sunshine_Posthouse(0, Common_Get(time.now_sec) - 43200);
|
||||
} else {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PosthouseR_actor_move(ACTOR* actor, GAME* game) {
|
||||
ROOMSUNSHINEPOSTHOUSE_ACTOR* posthouse = (ROOMSUNSHINEPOSTHOUSE_ACTOR*)actor;
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)){
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Posthouse(0, 43200 - Common_Get(time.now_sec));
|
||||
}
|
||||
else if (Common_Get(time.now_sec) >= 72000){
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = -calc_scale_Ef_Room_Sunshine_Posthouse(1, 86400 -Common_Get(time.now_sec));
|
||||
}
|
||||
else{
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 43200)) {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Posthouse(0, 43200 - Common_Get(time.now_sec));
|
||||
} else if (Common_Get(time.now_sec) >= 72000) {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x =
|
||||
-calc_scale_Ef_Room_Sunshine_Posthouse(1, 86400 - Common_Get(time.now_sec));
|
||||
} else {
|
||||
posthouse->ef_sunshine_class.actor_class.scale.x = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void setup_mode_Ef_Room_Sunshine_Posthouse(ACTOR* actor, GAME_PLAY* play){
|
||||
static void setup_mode_Ef_Room_Sunshine_Posthouse(ACTOR* actor, GAME_PLAY* play) {
|
||||
ROOMSUNSHINE_ACTOR* sunshine = (ROOMSUNSHINE_ACTOR*)actor;
|
||||
u8* color;
|
||||
int calc;
|
||||
@@ -144,61 +142,57 @@ void setup_mode_Ef_Room_Sunshine_Posthouse(ACTOR* actor, GAME_PLAY* play){
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z,1);
|
||||
Matrix_translate(sunshine->actor_class.world.position.x, sunshine->actor_class.world.position.y,
|
||||
sunshine->actor_class.world.position.z, 0);
|
||||
Matrix_scale(sunshine->actor_class.scale.x, sunshine->actor_class.scale.y, sunshine->actor_class.scale.z, 1);
|
||||
|
||||
gDPPipeSync(NEXT_POLY_XLU_DISP);
|
||||
|
||||
gSPMatrix(NEXT_POLY_XLU_DISP, _Matrix_to_Mtx_new(play->game.graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
|
||||
if((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)){
|
||||
color =play->kankyo.base_light.sun_color_window;
|
||||
}
|
||||
else{
|
||||
color =play->kankyo.base_light.moon_color_window;
|
||||
if ((Common_Get(time.now_sec) >= 14400) && (Common_Get(time.now_sec) < 72000)) {
|
||||
color = play->kankyo.base_light.sun_color_window;
|
||||
} else {
|
||||
color = play->kankyo.base_light.moon_color_window;
|
||||
}
|
||||
|
||||
calc = ((u8)calc_alpha_Ef_Room_SunshinePosthouse() * mKK_windowlight_alpha_get());
|
||||
|
||||
|
||||
gDPSetPrimColor(NEXT_POLY_XLU_DISP, 0, calc, color[0], color[1], color[2], 255);
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PosthouseL_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* game){
|
||||
static void Ef_Room_Sunshine_PosthouseR_actor_draw(ACTOR* actor, GAME* game) {
|
||||
GRAPH* graph;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
if((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)){
|
||||
return;
|
||||
if ((mKK_windowlight_alpha_get() < 9.99999974738e-05f) || (actor->scale.x == 0.0f)) {
|
||||
return;
|
||||
}
|
||||
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
graph = play->game.graph;
|
||||
setup_mode_Ef_Room_Sunshine_Posthouse(actor, play);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NEXT_POLY_XLU_DISP, obj_yubinkyoku_shine_modelT);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
+36
-63
@@ -11,25 +11,26 @@ extern u8 int_nog_fan_fan2_TA_tex_txt[];
|
||||
extern u8 int_nog_fan_fan3_TA_tex_txt[];
|
||||
|
||||
static u8* aNogFan_nog_fan01_anim[] = {
|
||||
int_nog_fan_fan1_TA_tex_txt,int_nog_fan_fan2_TA_tex_txt,int_nog_fan_fan3_TA_tex_txt,
|
||||
int_nog_fan_fan1_TA_tex_txt,
|
||||
int_nog_fan_fan2_TA_tex_txt,
|
||||
int_nog_fan_fan3_TA_tex_txt,
|
||||
};
|
||||
|
||||
void aNogFan_ControlSwitchSE(FTR_ACTOR* ftr_actor){
|
||||
if (ftr_actor->switch_bit != FALSE){
|
||||
sAdo_OngenTrgStart(0x16,&ftr_actor->position);
|
||||
}
|
||||
else{
|
||||
sAdo_OngenTrgStart(0x17,&ftr_actor->position);
|
||||
static void aNogFan_ControlSwitchSE(FTR_ACTOR* ftr_actor) {
|
||||
if (ftr_actor->switch_bit != FALSE) {
|
||||
sAdo_OngenTrgStart(0x16, &ftr_actor->position);
|
||||
} else {
|
||||
sAdo_OngenTrgStart(0x17, &ftr_actor->position);
|
||||
}
|
||||
}
|
||||
|
||||
void aNogFan_ChangeSwitch(FTR_ACTOR* ftr_actor){
|
||||
if (ftr_actor->switch_changed_flag != FALSE){
|
||||
static void aNogFan_ChangeSwitch(FTR_ACTOR* ftr_actor) {
|
||||
if (ftr_actor->switch_changed_flag != FALSE) {
|
||||
aNogFan_ControlSwitchSE(ftr_actor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void aNogFan_ct(FTR_ACTOR* ftr_actor, u8* data){
|
||||
static void aNogFan_ct(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
|
||||
keyf = &ftr_actor->keyframe;
|
||||
@@ -40,41 +41,37 @@ static void aNogFan_ct(FTR_ACTOR* ftr_actor, u8* data){
|
||||
|
||||
ftr_actor->dynamic_work_s[0] = 0;
|
||||
|
||||
if(ftr_actor->switch_bit != FALSE){
|
||||
if (ftr_actor->switch_bit != FALSE) {
|
||||
ftr_actor->dynamic_work_f[0] = 0.5f;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
ftr_actor->dynamic_work_f[0] = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void aNogFan_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data){
|
||||
static void aNogFan_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
static int fan_kurukuru_data[] = {
|
||||
1,1,1,2,2,2,2,2,3,0xFFFFFFFF,
|
||||
1, 1, 1, 2, 2, 2, 2, 2, 3, 0xFFFFFFFF,
|
||||
};
|
||||
int num;
|
||||
int idx;
|
||||
|
||||
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
|
||||
keyf = &ftr_actor->keyframe;
|
||||
|
||||
aNogFan_ChangeSwitch(ftr_actor);
|
||||
if(ftr_actor->switch_bit != FALSE){
|
||||
if (ftr_actor->switch_bit != FALSE) {
|
||||
f32 step = sqrtf(0.94999998807907);
|
||||
|
||||
add_calc(&ftr_actor->dynamic_work_f[0],0.5f, 1.0f - step, 0.25f,0.0005f);
|
||||
add_calc(&ftr_actor->dynamic_work_f[0], 0.5f, 1.0f - step, 0.25f, 0.0005f);
|
||||
|
||||
if(aFTR_CAN_PLAY_SE(ftr_actor)){
|
||||
sAdo_OngenPos((u32) ftr_actor, 1, &ftr_actor->position);
|
||||
if (aFTR_CAN_PLAY_SE(ftr_actor)) {
|
||||
sAdo_OngenPos((u32)ftr_actor, 1, &ftr_actor->position);
|
||||
}
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
f32 step = sqrtf(0.94999998807907);
|
||||
|
||||
add_calc(&ftr_actor->dynamic_work_f[0],0.0f, 1.0f - step, 0.25f,0.0005f);
|
||||
|
||||
add_calc(&ftr_actor->dynamic_work_f[0], 0.0f, 1.0f - step, 0.25f, 0.0005f);
|
||||
}
|
||||
|
||||
keyf->frame_control.speed = ftr_actor->dynamic_work_f[0];
|
||||
@@ -83,75 +80,51 @@ static void aNogFan_mv(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u
|
||||
idx = 9.0f - (2.0f * (ftr_actor->dynamic_work_f[0] * 9.0f));
|
||||
ftr_actor->dynamic_work_s[0]++;
|
||||
|
||||
|
||||
num = fan_kurukuru_data[idx];
|
||||
|
||||
if((num != -1) && (ftr_actor->dynamic_work_s[0] >= num )){
|
||||
if ((num != -1) && (ftr_actor->dynamic_work_s[0] >= num)) {
|
||||
ftr_actor->dynamic_work_s[0] = 0;
|
||||
ftr_actor->tex_animation.frame++;
|
||||
|
||||
if(ftr_actor->tex_animation.frame >= 6 || ftr_actor->tex_animation.frame < 0){
|
||||
if (ftr_actor->tex_animation.frame >= 6 || ftr_actor->tex_animation.frame < 0) {
|
||||
ftr_actor->tex_animation.frame = 0;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void aNogFan_dw(FTR_ACTOR* ftr_actor, ACTOR* my_room_actor, GAME* game, u8* data) {
|
||||
int idx;
|
||||
cKF_SkeletonInfo_R_c* keyf;
|
||||
Mtx* mtx;
|
||||
|
||||
|
||||
keyf = &ftr_actor->keyframe;
|
||||
|
||||
mtx = ftr_actor->skeleton_mtx[game->frame_counter & 1];
|
||||
|
||||
if(ftr_actor->ctr_type == aFTR_CTR_TYPE_GAME_PLAY){
|
||||
if (ftr_actor->ctr_type == aFTR_CTR_TYPE_GAME_PLAY) {
|
||||
idx = ftr_actor->tex_animation.frame >> 1;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
int fctr = ABS((int)game->frame_counter % 6);
|
||||
idx = fctr >> 1;
|
||||
idx = fctr >> 1;
|
||||
}
|
||||
|
||||
OPEN_DISP(game->graph);
|
||||
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP,_Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8,aNogFan_nog_fan01_anim[idx]);
|
||||
gSPMatrix(NEXT_POLY_OPA_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(NEXT_POLY_OPA_DISP, G_MWO_SEGMENT_8, aNogFan_nog_fan01_anim[idx]);
|
||||
cKF_Si3_draw_R_SV(game, keyf, mtx, NULL, NULL, NULL);
|
||||
|
||||
|
||||
CLOSE_DISP(game->graph);
|
||||
}
|
||||
|
||||
static void aNogFan_dt(FTR_ACTOR* ftr_actor, u8* data){
|
||||
|
||||
static void aNogFan_dt(FTR_ACTOR* ftr_actor, u8* data) {
|
||||
}
|
||||
|
||||
static aFTR_vtable_c aNogFan_func = {
|
||||
&aNogFan_ct,
|
||||
&aNogFan_mv,
|
||||
&aNogFan_dw,
|
||||
&aNogFan_dt,
|
||||
NULL,
|
||||
&aNogFan_ct, &aNogFan_mv, &aNogFan_dw, &aNogFan_dt, NULL,
|
||||
};
|
||||
|
||||
aFTR_PROFILE iam_nog_fan01 = {
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
40.0f,
|
||||
0.01f,
|
||||
aFTR_SHAPE_TYPEA,
|
||||
mCoBG_FTR_TYPEA,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
&aNogFan_func,
|
||||
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 40.0f, 0.01f, aFTR_SHAPE_TYPEA, mCoBG_FTR_TYPEA,
|
||||
0, 0, 0, 0, &aNogFan_func,
|
||||
};
|
||||
|
||||
+152
-150
@@ -9,6 +9,13 @@
|
||||
#include "gamealloc.h"
|
||||
#include "THA_GA.h"
|
||||
#include "jsyswrap.h"
|
||||
#include "m_debug_mode.h"
|
||||
#include "padmgr.h"
|
||||
#include "m_bgm.h"
|
||||
#include "libu64/debug.h"
|
||||
#include "libc64/malloc.h"
|
||||
#include "GBA/gba.h"
|
||||
#include "m_vibctl.h"
|
||||
|
||||
GAME* gamePT = NULL;
|
||||
|
||||
@@ -24,227 +31,222 @@ f32 game_GameFrame__1F;
|
||||
GAME* game_class_p;
|
||||
|
||||
static void game_move_first(GAME* this) {
|
||||
if (zurumode_flag) {
|
||||
Debug_mode_input(&this->pads[1]);
|
||||
}
|
||||
if (zurumode_flag) {
|
||||
Debug_mode_input(&this->pads[1]);
|
||||
}
|
||||
|
||||
JC_JUTProcBar_setVisible(JC_JUTProcBar_getManager(), GETREG(SREG, 0) != 0);
|
||||
JC_JUTProcBar_setVisibleHeapBar(JC_JUTProcBar_getManager(), GETREG(SREG, 0) != 0);
|
||||
JC_JUTProcBar_setVisible(JC_JUTProcBar_getManager(), GETREG(SREG, 0) != 0);
|
||||
JC_JUTProcBar_setVisibleHeapBar(JC_JUTProcBar_getManager(), GETREG(SREG, 0) != 0);
|
||||
}
|
||||
|
||||
extern void game_debug_draw_last(GAME* this, GRAPH* graph) {
|
||||
int i;
|
||||
Gfx* gfx;
|
||||
Gfx* close;
|
||||
int i;
|
||||
Gfx* gfx;
|
||||
Gfx* close;
|
||||
|
||||
if (zurumode_flag) {
|
||||
OPEN_DISP(graph);
|
||||
if (zurumode_flag) {
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
close = gfxopen(gfx);
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, close);
|
||||
gfx = NOW_POLY_OPA_DISP;
|
||||
close = gfxopen(gfx);
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, close);
|
||||
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
pad_t* pad = &this->pads[i];
|
||||
if (pad->now.errno == 0) {
|
||||
last_now_button[i] = pad->now.button;
|
||||
last_on_trigger[i] = pad->on.button;
|
||||
last_button[i] = last_now_button[i] | last_on_trigger[i];
|
||||
}
|
||||
else {
|
||||
last_now_button[i] = 0;
|
||||
last_on_trigger[i] = 0;
|
||||
last_button[i] = i == 0 ? 0xffff : 0;
|
||||
}
|
||||
for (i = 0; i < MAXCONTROLLERS; i++) {
|
||||
pad_t* pad = &this->pads[i];
|
||||
if (pad->now.errno == 0) {
|
||||
last_now_button[i] = pad->now.button;
|
||||
last_on_trigger[i] = pad->on.button;
|
||||
last_button[i] = last_now_button[i] | last_on_trigger[i];
|
||||
} else {
|
||||
last_now_button[i] = 0;
|
||||
last_on_trigger[i] = 0;
|
||||
last_button[i] = i == 0 ? 0xffff : 0;
|
||||
}
|
||||
|
||||
SETREG(HREG, 40 + i, last_button[i]);
|
||||
SETREG(HREG, 40 + i, last_button[i]);
|
||||
}
|
||||
|
||||
gSPEndDisplayList(close++);
|
||||
gfxclose(gfx, close);
|
||||
SET_POLY_OPA_DISP(close);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
gSPEndDisplayList(close++);
|
||||
gfxclose(gfx, close);
|
||||
SET_POLY_OPA_DISP(close);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
if (zurumode_flag) {
|
||||
Debug_mode_output(graph);
|
||||
}
|
||||
if (zurumode_flag) {
|
||||
Debug_mode_output(graph);
|
||||
}
|
||||
}
|
||||
|
||||
static void game_draw_first(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPSegment(NOW_BG_OPA_DISP++, G_MWO_NUMLIGHT, 0x80000000);
|
||||
gSPSegment(NOW_BG_OPA_DISP++, G_MWO_NUMLIGHT, 0x80000000);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void game_draw_last(GRAPH* graph) {
|
||||
Gfx* close;
|
||||
Gfx* poly_gfx;
|
||||
Gfx* close;
|
||||
Gfx* poly_gfx;
|
||||
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
poly_gfx = NOW_POLY_OPA_DISP;
|
||||
close = gfxopen(poly_gfx);
|
||||
poly_gfx = NOW_POLY_OPA_DISP;
|
||||
close = gfxopen(poly_gfx);
|
||||
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, close);
|
||||
gSPEndDisplayList(close++);
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, close);
|
||||
gSPEndDisplayList(close++);
|
||||
|
||||
gfxclose(poly_gfx, close);
|
||||
SET_POLY_OPA_DISP(close);
|
||||
gfxclose(poly_gfx, close);
|
||||
SET_POLY_OPA_DISP(close);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void game_get_controller(GAME* this) {
|
||||
if (this->pad_initialized == TRUE) {
|
||||
padmgr_RequestPadData(this->pads, 1);
|
||||
}
|
||||
else {
|
||||
padmgr_ClearPadData(this->pads);
|
||||
}
|
||||
if (this->pad_initialized == TRUE) {
|
||||
padmgr_RequestPadData(this->pads, 1);
|
||||
} else {
|
||||
padmgr_ClearPadData(this->pads);
|
||||
}
|
||||
}
|
||||
|
||||
extern void SetGameFrame(int frame) {
|
||||
if (game_GameFrame != frame) {
|
||||
game_GameFrame = frame;
|
||||
game_GameFrameF = (int)(u8)frame;
|
||||
game_GameFrame_2F = game_GameFrameF * 0.5f;
|
||||
game_GameFrame__1F = 1.0f / game_GameFrameF;
|
||||
if (game_GameFrame != frame) {
|
||||
game_GameFrame = frame;
|
||||
game_GameFrameF = (int)(u8)frame;
|
||||
game_GameFrame_2F = game_GameFrameF * 0.5f;
|
||||
game_GameFrame__1F = 1.0f / game_GameFrameF;
|
||||
|
||||
SETREG(SREG, 30, (u16)frame);
|
||||
SETREG(SREG, 30, (u16)frame);
|
||||
|
||||
if (GETREG(SREG, 29) > 0) {
|
||||
frame = GETREG(SREG, 29);
|
||||
if (GETREG(SREG, 29) > 0) {
|
||||
frame = GETREG(SREG, 29);
|
||||
}
|
||||
|
||||
JC_JFWDisplay_setFrameRate(JC_JFWDisplay_getManager(), frame);
|
||||
}
|
||||
|
||||
JC_JFWDisplay_setFrameRate(JC_JFWDisplay_getManager(), frame);
|
||||
}
|
||||
}
|
||||
|
||||
extern void game_main(GAME* this) {
|
||||
GRAPH* graph = this->graph;
|
||||
GRAPH* graph = this->graph;
|
||||
|
||||
if (GETREG(SREG, 30) != game_GameFrame || GETREG(SREG, 29)) {
|
||||
SetGameFrame(GETREG(SREG, 30));
|
||||
}
|
||||
if (GETREG(SREG, 30) != game_GameFrame || GETREG(SREG, 29)) {
|
||||
SetGameFrame(GETREG(SREG, 30));
|
||||
}
|
||||
|
||||
game_draw_first(graph);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_TIME);
|
||||
mTM_time();
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_TIME_FINISHED);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_EXEC);
|
||||
this->exec(this);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_EXEC_FINISHED);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_BGM);
|
||||
mBGM_main(this);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_BGM_FINISHED);
|
||||
game_move_first(this);
|
||||
this->frame_counter++;
|
||||
game_draw_first(graph);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_TIME);
|
||||
mTM_time();
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_TIME_FINISHED);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_EXEC);
|
||||
this->exec(this);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_EXEC_FINISHED);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_BGM);
|
||||
mBGM_main(this);
|
||||
GRAPH_SET_DOING_POINT(graph, GAME_BGM_FINISHED);
|
||||
game_move_first(this);
|
||||
this->frame_counter++;
|
||||
}
|
||||
|
||||
static void game_init_hyral(GAME* this, size_t size) {
|
||||
u8* hyral = (u8*)gamealloc_malloc(&this->gamealloc, size);
|
||||
if (hyral != NULL) {
|
||||
THA_ct(&this->tha, (char*)hyral, size);
|
||||
}
|
||||
else {
|
||||
THA_ct(&this->tha, NULL, 0);
|
||||
_dbg_hungup(__FILE__, 559);
|
||||
}
|
||||
u8* hyral = (u8*)gamealloc_malloc(&this->gamealloc, size);
|
||||
if (hyral != NULL) {
|
||||
THA_ct(&this->tha, (char*)hyral, size);
|
||||
} else {
|
||||
THA_ct(&this->tha, NULL, 0);
|
||||
_dbg_hungup(__FILE__, 559);
|
||||
}
|
||||
}
|
||||
|
||||
extern void game_resize_hyral(GAME* this, int size) {
|
||||
size_t max_size, free_size, alloc_size;
|
||||
u8* old_hyral;
|
||||
u8* hyral;
|
||||
size_t max_size, free_size, alloc_size;
|
||||
u8* old_hyral;
|
||||
u8* hyral;
|
||||
|
||||
old_hyral = (u8*)this->tha.buf_p;
|
||||
THA_dt(&this->tha);
|
||||
gamealloc_free(&this->gamealloc, old_hyral);
|
||||
GetFreeArena(&max_size, &free_size, &alloc_size);
|
||||
max_size -= 0x50;
|
||||
old_hyral = (u8*)this->tha.buf_p;
|
||||
THA_dt(&this->tha);
|
||||
gamealloc_free(&this->gamealloc, old_hyral);
|
||||
GetFreeArena(&max_size, &free_size, &alloc_size);
|
||||
max_size -= 0x50;
|
||||
|
||||
if (size <= 0) {
|
||||
size = max_size + size;
|
||||
if (size < 0) {
|
||||
size = 0;
|
||||
if (size <= 0) {
|
||||
size = max_size + size;
|
||||
if (size < 0) {
|
||||
size = 0;
|
||||
}
|
||||
} else {
|
||||
if (size > max_size) {
|
||||
size = max_size;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (size > max_size) {
|
||||
size = max_size;
|
||||
}
|
||||
}
|
||||
|
||||
hyral = (u8*)gamealloc_malloc(&this->gamealloc, (u32)size);
|
||||
if (hyral != NULL) {
|
||||
THA_ct(&this->tha, (char*)hyral, (u32)size);
|
||||
}
|
||||
else {
|
||||
THA_ct(&this->tha, NULL, 0);
|
||||
_dbg_hungup(__FILE__, 633);
|
||||
}
|
||||
hyral = (u8*)gamealloc_malloc(&this->gamealloc, (u32)size);
|
||||
if (hyral != NULL) {
|
||||
THA_ct(&this->tha, (char*)hyral, (u32)size);
|
||||
} else {
|
||||
THA_ct(&this->tha, NULL, 0);
|
||||
_dbg_hungup(__FILE__, 633);
|
||||
}
|
||||
}
|
||||
|
||||
extern void game_ct(GAME* this, void (*init)(GAME*), GRAPH* graph) {
|
||||
gamePT = this;
|
||||
graph->need_viupdate = TRUE;
|
||||
mCon_ct();
|
||||
this->graph = graph;
|
||||
this->frame_counter = 0;
|
||||
this->exec = NULL;
|
||||
this->cleanup = NULL;
|
||||
this->doing = TRUE;
|
||||
this->pad_initialized = TRUE;
|
||||
GAME_NEXT_GAME_NULL(this);
|
||||
gamealloc_init(&this->gamealloc);
|
||||
game_init_hyral(this, GAME_HYRAL_SIZE);
|
||||
SetGameFrame(GAME_FRAME);
|
||||
__gfxprint_default_flags |= GFXPRINT_FLAG_HIGHRES;
|
||||
init(this);
|
||||
mBGM_init();
|
||||
GBAInit();
|
||||
mVibctl_init();
|
||||
gamePT = this;
|
||||
graph->need_viupdate = TRUE;
|
||||
mCon_ct();
|
||||
this->graph = graph;
|
||||
this->frame_counter = 0;
|
||||
this->exec = NULL;
|
||||
this->cleanup = NULL;
|
||||
this->doing = TRUE;
|
||||
this->pad_initialized = TRUE;
|
||||
GAME_NEXT_GAME_NULL(this);
|
||||
gamealloc_init(&this->gamealloc);
|
||||
game_init_hyral(this, GAME_HYRAL_SIZE);
|
||||
SetGameFrame(GAME_FRAME);
|
||||
__gfxprint_default_flags |= GFXPRINT_FLAG_HIGHRES;
|
||||
init(this);
|
||||
mBGM_init();
|
||||
GBAInit();
|
||||
mVibctl_init();
|
||||
}
|
||||
|
||||
extern void game_dt(GAME* this) {
|
||||
mCon_dt();
|
||||
mBGM_cleanup();
|
||||
if (this->cleanup != NULL) {
|
||||
this->cleanup(this);
|
||||
}
|
||||
|
||||
mVibctl_cleanup();
|
||||
THA_dt(&this->tha);
|
||||
gamealloc_cleanup(&this->gamealloc);
|
||||
gamePT = NULL;
|
||||
mCon_dt();
|
||||
mBGM_cleanup();
|
||||
if (this->cleanup != NULL) {
|
||||
this->cleanup(this);
|
||||
}
|
||||
|
||||
mVibctl_cleanup();
|
||||
THA_dt(&this->tha);
|
||||
gamealloc_cleanup(&this->gamealloc);
|
||||
gamePT = NULL;
|
||||
}
|
||||
|
||||
extern void (*game_get_next_game_init(GAME* this))(GAME*) {
|
||||
return this->next_game_init;
|
||||
return this->next_game_init;
|
||||
}
|
||||
|
||||
/* @fabricated */
|
||||
MATCH_FORCESTRIP extern size_t game_get_next_game_class_size(GAME* this) {
|
||||
return this->next_game_class_size;
|
||||
return this->next_game_class_size;
|
||||
}
|
||||
|
||||
extern int game_is_doing(GAME* this) {
|
||||
return this->doing;
|
||||
return this->doing;
|
||||
}
|
||||
|
||||
extern int game_getFreeBytes(GAME* this) {
|
||||
return THA_getFreeBytes16(&this->tha);
|
||||
return THA_getFreeBytes16(&this->tha);
|
||||
}
|
||||
|
||||
extern void game_goto_next_game_play(GAME* this) {
|
||||
GAME_GOTO_NEXT(this, play, PLAY);
|
||||
GAME_GOTO_NEXT(this, play, PLAY);
|
||||
}
|
||||
|
||||
/* @fabricated */
|
||||
MATCH_FORCESTRIP extern void game_goto_next_game_famicom_emu(GAME* this) {
|
||||
GAME_GOTO_NEXT(this, famicom_emu, FAMICOM_EMU);
|
||||
GAME_GOTO_NEXT(this, famicom_emu, FAMICOM_EMU);
|
||||
}
|
||||
|
||||
+676
-732
File diff suppressed because it is too large
Load Diff
+68
-81
@@ -6,12 +6,11 @@
|
||||
#include "sys_matrix.h"
|
||||
#include "m_lib.h"
|
||||
#include "m_lights.h"
|
||||
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
extern Gfx ef_shadow_out_modelT[];
|
||||
extern Gfx ef_shadow_in_modelT[];
|
||||
|
||||
|
||||
int mActorShadow_OperateScrollLimit(int value, int step, int limit) {
|
||||
if (step != 0) {
|
||||
if (step > 0) {
|
||||
@@ -29,11 +28,10 @@ int mActorShadow_OperateScrollLimit(int value, int step, int limit) {
|
||||
return value;
|
||||
}
|
||||
|
||||
Gfx* mActorShadow_TileScroll2(u32* x1, u32* y1, int step1, int step2, int limit1, int limit2, int width1,
|
||||
int height1, u32* x2, u32* y2, int step3, int step4, int limit3, int limit4,
|
||||
int width2, int height2, GAME* game){
|
||||
Gfx* mActorShadow_TileScroll2(u32* x1, u32* y1, int step1, int step2, int limit1, int limit2, int width1, int height1,
|
||||
u32* x2, u32* y2, int step3, int step4, int limit3, int limit4, int width2, int height2,
|
||||
GAME* game) {
|
||||
|
||||
|
||||
*x1 = mActorShadow_OperateScrollLimit(*x1, step1, limit1);
|
||||
*y1 = mActorShadow_OperateScrollLimit(*y1, step2, limit2);
|
||||
*x2 = mActorShadow_OperateScrollLimit(*x2, step3, limit3);
|
||||
@@ -42,7 +40,6 @@ int width2, int height2, GAME* game){
|
||||
return two_tex_scroll(game->graph, 0, *x1, *y1, width1, height1, 1, *x2, *y2, width2, height2);
|
||||
}
|
||||
|
||||
|
||||
void mActorShadow_AdjustRate(f32* rate) {
|
||||
if (*rate < 0.0f) {
|
||||
*rate = 0.0f;
|
||||
@@ -51,43 +48,42 @@ void mActorShadow_AdjustRate(f32* rate) {
|
||||
}
|
||||
}
|
||||
|
||||
void mActorShadow_GetTimeAngleY_TimeAlpha(Shadow_Info* shadow, GAME_PLAY* play){
|
||||
void mActorShadow_GetTimeAngleY_TimeAlpha(Shadow_Info* shadow, GAME_PLAY* play) {
|
||||
f32 timef;
|
||||
int timesec = Common_Get(time.now_sec);
|
||||
shadow->unk1C = play->kankyo.shadow_alpha;
|
||||
|
||||
// Between 4 a.m and 8 p.m
|
||||
if((timesec >= 14400) && ( timesec < 72000)){
|
||||
if ((timesec >= 14400) && (timesec < 72000)) {
|
||||
timef = (timesec - 14400) / 57600.0f;
|
||||
} //Between 12 a.m and 4 a.m
|
||||
else if (timesec < 14400){
|
||||
} // Between 12 a.m and 4 a.m
|
||||
else if (timesec < 14400) {
|
||||
timef = 0.5f + timesec / 28800.0f;
|
||||
} // Between 8 p.m and 12 a.m
|
||||
else{
|
||||
timef = (timesec - 72000)/ 28800.0f;
|
||||
else {
|
||||
timef = (timesec - 72000) / 28800.0f;
|
||||
}
|
||||
|
||||
shadow->unk26 = 0x8000 - ((s16)(16384.0f * timef) + 0x6000);
|
||||
shadow->unk26 = 0x8000 - ((s16)(16384.0f * timef) + 0x6000);
|
||||
}
|
||||
|
||||
|
||||
void mActorShadow_GetGroundAverageAngle(Shadow_Info* shadow){
|
||||
void mActorShadow_GetGroundAverageAngle(Shadow_Info* shadow) {
|
||||
static xyz_t angle_range_table[4] = {
|
||||
{ 10.0f, 0.0f, 10.0f },
|
||||
{ 10.0f, 0.0f, -10.0f },
|
||||
{ -10.0f, 0.0f, 10.0f },
|
||||
{ -10.0f, 0.0f, -10.0f },
|
||||
};
|
||||
|
||||
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int z = 0;
|
||||
int i;
|
||||
|
||||
|
||||
for (i = 0; i < 4; i++) {
|
||||
xyz_t pos = shadow->position;
|
||||
s_xyz sangle = {0, 0, 0};
|
||||
|
||||
s_xyz sangle = { 0, 0, 0 };
|
||||
|
||||
pos.x += angle_range_table[i].x;
|
||||
pos.y += angle_range_table[i].y;
|
||||
pos.z += angle_range_table[i].z;
|
||||
@@ -98,7 +94,7 @@ void mActorShadow_GetGroundAverageAngle(Shadow_Info* shadow){
|
||||
y += sangle.y;
|
||||
z += sangle.z;
|
||||
}
|
||||
|
||||
|
||||
shadow->unk20 = x >> 2;
|
||||
shadow->unk22 = y >> 2;
|
||||
shadow->unk24 = z >> 2;
|
||||
@@ -107,16 +103,16 @@ void mActorShadow_GetGroundAverageAngle(Shadow_Info* shadow){
|
||||
void mActorShadow_GetDistanceRate(Shadow_Info* shadow, f32 rate) {
|
||||
f32 xcalc;
|
||||
f32 disty = shadow->position.y - shadow->groundY;
|
||||
|
||||
|
||||
disty = disty >= 0.0f ? disty : -disty;
|
||||
xcalc = rate + 100.0f;
|
||||
|
||||
if (disty > xcalc){
|
||||
if (disty > xcalc) {
|
||||
shadow->unk14 = 0.600000023842f;
|
||||
shadow->unk18 = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
xcalc = (xcalc - disty) / xcalc;
|
||||
shadow->unk14 = xcalc * 0.399999976158f + 0.6f;
|
||||
shadow->unk18 = xcalc;
|
||||
@@ -124,8 +120,8 @@ void mActorShadow_GetDistanceRate(Shadow_Info* shadow, f32 rate) {
|
||||
f32 mActorShadow_GetAbsBigger(f32 a, f32 b) {
|
||||
a = a >= 0.0f ? a : -a;
|
||||
b = b >= 0.0f ? b : -b;
|
||||
|
||||
if(a > b){
|
||||
|
||||
if (a > b) {
|
||||
return a;
|
||||
}
|
||||
return b;
|
||||
@@ -137,7 +133,7 @@ void mActorShadow_RadiusScaleRate(ACTOR* actor, Shadow_Info* shadow) {
|
||||
}
|
||||
|
||||
void mActorShadow_GetShadowTopPos_GetSlideS(Shadow_Info* shadow) {
|
||||
|
||||
|
||||
xyz_t wpos;
|
||||
xyz_t base;
|
||||
f32 bg_y;
|
||||
@@ -147,7 +143,7 @@ void mActorShadow_GetShadowTopPos_GetSlideS(Shadow_Info* shadow) {
|
||||
base.x = 0.0f;
|
||||
base.y = 0.0f;
|
||||
base.z = -40.0f;
|
||||
sMath_RotateY(&base, shadow->unk26 * (9.58738019108e-05f));
|
||||
sMath_RotateY(&base, shadow->unk26 * (9.58738019108e-05f));
|
||||
wpos.x = shadow->position.x + base.x;
|
||||
wpos.y = shadow->position.y + base.y;
|
||||
wpos.z = shadow->position.z + base.z;
|
||||
@@ -161,29 +157,27 @@ void mActorShadow_GetShadowTopPos_GetSlideS(Shadow_Info* shadow) {
|
||||
shadow->unk34 = 0;
|
||||
}
|
||||
|
||||
Gfx* mActorShadow_SetTexScroll(ACTOR* actor, Shadow_Info* shadow, GAME* game){
|
||||
|
||||
Gfx* mActorShadow_SetTexScroll(ACTOR* actor, Shadow_Info* shadow, GAME* game) {
|
||||
|
||||
u32 y1 = 0;
|
||||
u32 x1 = 0;
|
||||
u32 y2 = 0;
|
||||
int step;
|
||||
|
||||
if(actor->shape_info.unk_20 < shadow->unk34){
|
||||
|
||||
if (actor->shape_info.unk_20 < shadow->unk34) {
|
||||
step = 0xD;
|
||||
}
|
||||
else if(actor->shape_info.unk_20 > shadow->unk34){
|
||||
} else if (actor->shape_info.unk_20 > shadow->unk34) {
|
||||
step = -0xD;
|
||||
}
|
||||
else{
|
||||
} else {
|
||||
step = 0;
|
||||
}
|
||||
|
||||
mActorShadow_TileScroll2(&x1, &y1, 0, 0, 0, 0, 0x20, 0x10, (u32*)&actor->shape_info.unk_20, &y2, step, 0, shadow->unk34, 0, 0x20, 0x10, game);
|
||||
mActorShadow_TileScroll2(&x1, &y1, 0, 0, 0, 0, 0x20, 0x10, (u32*)&actor->shape_info.unk_20, &y2, step, 0,
|
||||
shadow->unk34, 0, 0x20, 0x10, game);
|
||||
}
|
||||
|
||||
|
||||
void mActorShadow_GetLastAlphaScale(f32* scale, u8* alpha, ACTOR* actor, Shadow_Info* shadow) {
|
||||
|
||||
|
||||
f32 alph = shadow->unk1C * shadow->unk18 * actor->shape_info.shadow_alpha_change_rate * 0.75f;
|
||||
|
||||
*scale = shadow->unk10 * shadow->unk14 * actor->shape_info.shadow_size_change_rate;
|
||||
@@ -194,7 +188,6 @@ void mActorShadow_GetLastAlphaScale(f32* scale, u8* alpha, ACTOR* actor, Shadow_
|
||||
*alpha = alph;
|
||||
}
|
||||
|
||||
|
||||
void mActorShadow_DrawActorShadow(ACTOR* actor, Shadow_Info* shadow, GAME_PLAY* play, int id, xyz_t ofs, f32 rad) {
|
||||
f32 x, y, z;
|
||||
f32 y_adjust;
|
||||
@@ -206,17 +199,17 @@ void mActorShadow_DrawActorShadow(ACTOR* actor, Shadow_Info* shadow, GAME_PLAY*
|
||||
GRAPH* graph;
|
||||
GAME* game = (GAME*)play;
|
||||
|
||||
|
||||
scene = Save_Get(scene_no);
|
||||
|
||||
mActorShadow_GetLastAlphaScale(&scale, &alpha, actor, shadow);
|
||||
|
||||
mActorShadow_GetLastAlphaScale(&scale, &alpha, actor, shadow);
|
||||
graph = game->graph;
|
||||
_texture_z_light_fog_prim_shadow(graph);
|
||||
|
||||
OPEN_DISP(graph);
|
||||
|
||||
y_adjust = (scene == 19 || scene == 27 || scene == 28 || scene == 34) ? 0.5f :
|
||||
((scene == 15 || scene == 16 || scene == 49) ? 0.6f : 2.0f);
|
||||
|
||||
y_adjust = (scene == 19 || scene == 27 || scene == 28 || scene == 34)
|
||||
? 0.5f
|
||||
: ((scene == 15 || scene == 16 || scene == 49) ? 0.6f : 2.0f);
|
||||
|
||||
switch (actor->shape_info.force_shadow_position) {
|
||||
case 1:
|
||||
@@ -243,7 +236,7 @@ void mActorShadow_DrawActorShadow(ACTOR* actor, Shadow_Info* shadow, GAME_PLAY*
|
||||
Matrix_RotateX(shadow->unk20, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if ((shadow->kind == 0) && (id == 0)) {
|
||||
Matrix_RotateY(shadow->unk26, 1);
|
||||
}
|
||||
@@ -263,13 +256,13 @@ void mActorShadow_DrawActorShadow(ACTOR* actor, Shadow_Info* shadow, GAME_PLAY*
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
gSPMatrix(NEXT_SHADOW_DISP, _Matrix_to_Mtx_new(game->graph), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
mEnv_GetShadowPrimColor_Light(&r, &g, &b, game);
|
||||
gDPSetPrimColor(NEXT_SHADOW_DISP, 0, 0xFF, r, g, b, (u8)alpha);
|
||||
|
||||
if ((shadow->kind == 0) && (id == 0)) {
|
||||
texscroll = mActorShadow_SetTexScroll(actor, shadow, game);
|
||||
texscroll = mActorShadow_SetTexScroll(actor, shadow, game);
|
||||
if (texscroll != NULL) {
|
||||
gSPSegment(NEXT_SHADOW_DISP, 0x08, texscroll);
|
||||
gSPDisplayList(NEXT_SHADOW_DISP, ef_shadow_out_modelT);
|
||||
@@ -277,17 +270,15 @@ void mActorShadow_DrawActorShadow(ACTOR* actor, Shadow_Info* shadow, GAME_PLAY*
|
||||
} else {
|
||||
gSPDisplayList(NEXT_SHADOW_DISP, ef_shadow_in_modelT);
|
||||
}
|
||||
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
}
|
||||
|
||||
void mActorShadow_GetShadowPosition(ACTOR* actor, xyz_t* position){
|
||||
void mActorShadow_GetShadowPosition(ACTOR* actor, xyz_t* position) {
|
||||
|
||||
if(actor->shape_info.shadow_position != NULL){
|
||||
if (actor->shape_info.shadow_position != NULL) {
|
||||
*position = *actor->shape_info.shadow_position;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
*position = actor->world.position;
|
||||
}
|
||||
}
|
||||
@@ -300,12 +291,12 @@ int mActorShadow_GetShadowKind(void) {
|
||||
}
|
||||
}
|
||||
|
||||
f32 mAc_GetShadowGroundY_NoneForce(const Shadow_Info* shadow){
|
||||
f32 res = mCoBG_GetShadowBgY_AngleS_FromWpos(0.0f, NULL, shadow->position);
|
||||
return res;
|
||||
f32 mAc_GetShadowGroundY_NoneForce(const Shadow_Info* shadow) {
|
||||
f32 res = mCoBG_GetShadowBgY_AngleS_FromWpos(0.0f, NULL, shadow->position);
|
||||
return res;
|
||||
}
|
||||
|
||||
f32 mAc_GetShadowGroundY_Force(const Shadow_Info* shadow){
|
||||
f32 mAc_GetShadowGroundY_Force(const Shadow_Info* shadow) {
|
||||
return mCoBG_GetBgY_OnlyCenter_FromWpos2(shadow->position, 0.0f);
|
||||
}
|
||||
|
||||
@@ -319,11 +310,10 @@ void mAc_DecideShadowRadius_IamFish(Shadow_Info* shadow, ACTOR* actor, f32* radi
|
||||
*radius = (actor->shape_info.shadow_size_z / 19.0f) * 0.018f;
|
||||
}
|
||||
|
||||
void mAc_ActorShadowDraw_ShadowDrawFlagOff(ACTOR* actor, GAME_PLAY* play, int arg2, xyz_t arg3, f32 arg6){
|
||||
|
||||
void mAc_ActorShadowDraw_ShadowDrawFlagOff(ACTOR* actor, GAME_PLAY* play, int arg2, xyz_t arg3, f32 arg6) {
|
||||
}
|
||||
|
||||
void mAc_ActorShadowDraw_ShadowDrawFlagOn(ACTOR* actor, GAME_PLAY* play, int proc, xyz_t pos, f32 rate){
|
||||
void mAc_ActorShadowDraw_ShadowDrawFlagOn(ACTOR* actor, GAME_PLAY* play, int proc, xyz_t pos, f32 rate) {
|
||||
static void (*set_raius_proc[])(Shadow_Info*, ACTOR*, f32*) = {
|
||||
mAc_DecideShadowRadius_IamNotFish,
|
||||
mAc_DecideShadowRadius_IamFish,
|
||||
@@ -345,7 +335,7 @@ void mAc_ActorShadowDraw_ShadowDrawFlagOn(ACTOR* actor, GAME_PLAY* play, int pro
|
||||
|
||||
ground_y_proc = actor->shape_info.force_shadow_position & 1;
|
||||
shadow.groundY = get_ground_y_proc[ground_y_proc](&shadow);
|
||||
|
||||
|
||||
mActorShadow_GetTimeAngleY_TimeAlpha(&shadow, play);
|
||||
mActorShadow_GetGroundAverageAngle(&shadow);
|
||||
mActorShadow_GetDistanceRate(&shadow, rate);
|
||||
@@ -358,10 +348,10 @@ void mAc_ActorShadowDraw_ShadowDrawFlagOn(ACTOR* actor, GAME_PLAY* play, int pro
|
||||
void mAc_ActorShadowDraw(ACTOR* actor, GAME_PLAY* play, int arg2, xyz_t arg3, f32 arg6) {
|
||||
|
||||
static void (*shadwo_draw_proc[])(ACTOR* actor, GAME_PLAY* play, int arg2, xyz_t arg3, f32 arg6) = {
|
||||
mAc_ActorShadowDraw_ShadowDrawFlagOff,
|
||||
mAc_ActorShadowDraw_ShadowDrawFlagOn,
|
||||
};
|
||||
|
||||
mAc_ActorShadowDraw_ShadowDrawFlagOff,
|
||||
mAc_ActorShadowDraw_ShadowDrawFlagOn,
|
||||
};
|
||||
|
||||
if (actor->id == 0x4A) {
|
||||
mActorShadow_UnSetForceShadowPos(actor);
|
||||
actor->shape_info.shadow_position = &actor->world.position;
|
||||
@@ -373,7 +363,6 @@ void mAc_ActorShadowDraw(ACTOR* actor, GAME_PLAY* play, int arg2, xyz_t arg3, f3
|
||||
|
||||
xyz_t mActorShadow_offset0 = { 0.0f, 0.0f, 0.0f };
|
||||
|
||||
|
||||
void mActorShadow_SetForceShadowPos(ACTOR* actor, xyz_t* pos) {
|
||||
actor->shape_info.force_shadow_position = 1;
|
||||
actor->shape_info.shadow_position = pos;
|
||||
@@ -384,28 +373,26 @@ void mActorShadow_UnSetForceShadowPos(ACTOR* actor) {
|
||||
actor->shape_info.shadow_position = &actor->world.position;
|
||||
}
|
||||
|
||||
|
||||
void mAc_NormalActorShadow(ACTOR* actor, GAME_PLAY* play, f32 rad){
|
||||
void mAc_NormalActorShadow(ACTOR* actor, GAME_PLAY* play, f32 rad) {
|
||||
mAc_ActorShadowDraw(actor, play, 0, mActorShadow_offset0, rad);
|
||||
}
|
||||
|
||||
void mAc_UnagiActorShadow(ACTOR* actor, GAME_PLAY* play, xyz_t pos){
|
||||
void mAc_UnagiActorShadow(ACTOR* actor, GAME_PLAY* play, xyz_t pos) {
|
||||
mAc_ActorShadowDraw(actor, play, 1, pos, 1.0f);
|
||||
}
|
||||
|
||||
void mAc_ActorShadowCircle(ACTOR* actor, LightsN* lights, GAME_PLAY* play){
|
||||
void mAc_ActorShadowCircle(ACTOR* actor, LightsN* lights, GAME_PLAY* play) {
|
||||
mAc_ActorShadowDraw(actor, play, 0, mActorShadow_offset0, 1.0f);
|
||||
}
|
||||
|
||||
void mAc_ActorShadowEllipse(ACTOR* actor, LightsN* lights, GAME_PLAY* play){
|
||||
|
||||
void mAc_ActorShadowEllipse(ACTOR* actor, LightsN* lights, GAME_PLAY* play) {
|
||||
|
||||
static xyz_t tunekiti_offset = { 0.0f, 1.0f, 0.0f };
|
||||
|
||||
if(actor->id == 0x79){
|
||||
mAc_ActorShadowDraw(actor, play, 0, tunekiti_offset, 1.0f);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
if (actor->id == 0x79) {
|
||||
mAc_ActorShadowDraw(actor, play, 0, tunekiti_offset, 1.0f);
|
||||
|
||||
} else {
|
||||
mAc_ActorShadowDraw(actor, play, 0, mActorShadow_offset0, 1.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1815
-2118
File diff suppressed because it is too large
Load Diff
+137
-148
@@ -4,205 +4,194 @@
|
||||
#include "libc64/sleep.h"
|
||||
#include "libultra/gu.h"
|
||||
#include "m_play.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
Gfx fbdemo_gfx_init[] = {
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON),
|
||||
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG |
|
||||
G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR |
|
||||
G_LOD | G_SHADING_SMOOTH),
|
||||
gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN |
|
||||
G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH),
|
||||
gsDPSetCombineMode(G_CC_DECALRGB, G_CC_DECALRGB),
|
||||
gsDPSetOtherMode(
|
||||
G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP |
|
||||
G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE |
|
||||
G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_OPA_SURF | G_RM_AA_OPA_SURF2),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
extern void fbdemo_init_gfx(fbdemo_c* this) {
|
||||
int col;
|
||||
int col2;
|
||||
int colTex;
|
||||
int rowTex;
|
||||
int col;
|
||||
int col2;
|
||||
int colTex;
|
||||
int rowTex;
|
||||
|
||||
int row;
|
||||
int frame;
|
||||
int row;
|
||||
int frame;
|
||||
|
||||
Vtx* vtx;
|
||||
Gfx* gfx;
|
||||
Vtx* vtx;
|
||||
Gfx* gfx;
|
||||
|
||||
guMtxIdent(&this->modelView1);
|
||||
guMtxIdent(&this->modelView2);
|
||||
guOrtho(&this->projection, 0.0f, 320, 240, 0.0f, -1000.0f, 1000.0f, 1.0f);
|
||||
guMtxIdent(&this->modelView1);
|
||||
guMtxIdent(&this->modelView2);
|
||||
guOrtho(&this->projection, 0.0f, 320, 240, 0.0f, -1000.0f, 1000.0f, 1.0f);
|
||||
|
||||
for (frame = 0; frame < 2; frame++) {
|
||||
this->frame = frame;
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
for (rowTex = 0, row = 0; row < (this->rows + 1); rowTex += 0x20, row++) {
|
||||
for (colTex = 0, col = 0; col < (this->cols + 1); colTex += 0x20, col++) {
|
||||
Vtx_tn* vtxn = &vtx->n;
|
||||
vtx++;
|
||||
vtxn->ob[0] = col * 0x20;
|
||||
vtxn->ob[1] = row * 0x20;
|
||||
vtxn->ob[2] = -5;
|
||||
vtxn->flag = 0;
|
||||
vtxn->tc[0] = colTex << 6;
|
||||
vtxn->tc[1] = rowTex << 6;
|
||||
vtxn->n[0] = 0;
|
||||
vtxn->n[1] = 0;
|
||||
vtxn->n[2] = 120;
|
||||
vtxn->a = 255;
|
||||
}
|
||||
for (frame = 0; frame < 2; frame++) {
|
||||
this->frame = frame;
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
for (rowTex = 0, row = 0; row < (this->rows + 1); rowTex += 0x20, row++) {
|
||||
for (colTex = 0, col = 0; col < (this->cols + 1); colTex += 0x20, col++) {
|
||||
Vtx_tn* vtxn = &vtx->n;
|
||||
vtx++;
|
||||
vtxn->ob[0] = col * 0x20;
|
||||
vtxn->ob[1] = row * 0x20;
|
||||
vtxn->ob[2] = -5;
|
||||
vtxn->flag = 0;
|
||||
vtxn->tc[0] = colTex << 6;
|
||||
vtxn->tc[1] = rowTex << 6;
|
||||
vtxn->n[0] = 0;
|
||||
vtxn->n[1] = 0;
|
||||
vtxn->n[2] = 120;
|
||||
vtxn->a = 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gfx = this->gfx;
|
||||
for (rowTex = 0, row = 0; row < this->rows; rowTex += 0x20, row++) {
|
||||
gSPVertex(gfx++,
|
||||
SEGMENT_ADDR(0xA, (u32)row * (this->cols + 1) * sizeof(Vtx)),
|
||||
2 * (this->cols + 1), 0);
|
||||
gfx = this->gfx;
|
||||
for (rowTex = 0, row = 0; row < this->rows; rowTex += 0x20, row++) {
|
||||
gSPVertex(gfx++, SEGMENT_ADDR(0xA, (u32)row * (this->cols + 1) * sizeof(Vtx)), 2 * (this->cols + 1), 0);
|
||||
|
||||
colTex = 0;
|
||||
col = 0;
|
||||
col2 = 0;
|
||||
while (col < this->cols) {
|
||||
gDPPipeSync(gfx++);
|
||||
colTex = 0;
|
||||
col = 0;
|
||||
col2 = 0;
|
||||
while (col < this->cols) {
|
||||
gDPPipeSync(gfx++);
|
||||
|
||||
gDPLoadTextureTile(gfx++, SEGMENT_ADDR(0xB, 0), G_IM_FMT_RGBA,
|
||||
G_IM_SIZ_16b, 320, 240, colTex, rowTex, colTex + 0x20,
|
||||
rowTex + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK,
|
||||
G_TX_NOLOD, G_TX_NOLOD);
|
||||
gDPLoadTextureTile(gfx++, SEGMENT_ADDR(0xB, 0), G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, 240, colTex, rowTex,
|
||||
colTex + 0x20, rowTex + 0x20, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP,
|
||||
G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD);
|
||||
|
||||
gSP1Quadrangle(gfx++, col2, col2 + 1, +(this->cols) + 2 + col2,
|
||||
this->cols + 1 + col2, 0);
|
||||
gSP1Quadrangle(gfx++, col2, col2 + 1, +(this->cols) + 2 + col2, this->cols + 1 + col2, 0);
|
||||
|
||||
colTex += 0x20;
|
||||
col2++;
|
||||
col++;
|
||||
colTex += 0x20;
|
||||
col2++;
|
||||
col++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
gDPPipeSync(gfx++);
|
||||
gSPEndDisplayList(gfx++);
|
||||
gDPPipeSync(gfx++);
|
||||
gSPEndDisplayList(gfx++);
|
||||
}
|
||||
|
||||
extern void fbdemo_init_data(fbdemo_c* this) {
|
||||
int col;
|
||||
int row;
|
||||
int col;
|
||||
int row;
|
||||
|
||||
for (row = 0; row < this->rows + 1; row++) {
|
||||
for (col = 0; col < this->cols + 1; col++) {
|
||||
(this->vtxData + col + row * (this->cols + 1))->x = col * 0x20;
|
||||
(this->vtxData + col + row * (this->cols + 1))->y = row * 0x20;
|
||||
for (row = 0; row < this->rows + 1; row++) {
|
||||
for (col = 0; col < this->cols + 1; col++) {
|
||||
(this->vtxData + col + row * (this->cols + 1))->x = col * 0x20;
|
||||
(this->vtxData + col + row * (this->cols + 1))->y = row * 0x20;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern void fbdemo_cleanup(fbdemo_c* this) {
|
||||
msleep(100);
|
||||
msleep(100);
|
||||
|
||||
if (this->vtxData != NULL) {
|
||||
free(this->vtxData);
|
||||
this->vtxData = NULL;
|
||||
}
|
||||
if (this->vtxFrame1 != NULL) {
|
||||
free(this->vtxFrame1);
|
||||
this->vtxFrame1 = NULL;
|
||||
}
|
||||
if (this->vtxFrame2 != NULL) {
|
||||
free(this->vtxFrame2);
|
||||
this->vtxFrame2 = NULL;
|
||||
}
|
||||
if (this->gfx != NULL) {
|
||||
free(this->gfx);
|
||||
this->gfx = NULL;
|
||||
}
|
||||
if (this->vtxData != NULL) {
|
||||
free(this->vtxData);
|
||||
this->vtxData = NULL;
|
||||
}
|
||||
if (this->vtxFrame1 != NULL) {
|
||||
free(this->vtxFrame1);
|
||||
this->vtxFrame1 = NULL;
|
||||
}
|
||||
if (this->vtxFrame2 != NULL) {
|
||||
free(this->vtxFrame2);
|
||||
this->vtxFrame2 = NULL;
|
||||
}
|
||||
if (this->gfx != NULL) {
|
||||
free(this->gfx);
|
||||
this->gfx = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
extern fbdemo_c* fbdemo_init(fbdemo_c* this, int cols, int rows) {
|
||||
s32 gridsize;
|
||||
s32 gridsize;
|
||||
|
||||
bzero(this, sizeof(fbdemo));
|
||||
bzero(this, sizeof(fbdemo));
|
||||
|
||||
this->cols = cols;
|
||||
this->rows = rows;
|
||||
this->cols = cols;
|
||||
this->rows = rows;
|
||||
|
||||
this->frame = 0;
|
||||
this->vtxData = malloc((cols + 1) * sizeof(xy_t) * (rows + 1));
|
||||
this->frame = 0;
|
||||
this->vtxData = malloc((cols + 1) * sizeof(xy_t) * (rows + 1));
|
||||
|
||||
this->vtxFrame1 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
|
||||
this->vtxFrame2 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
|
||||
this->vtxFrame1 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
|
||||
this->vtxFrame2 = malloc((cols + 1) * sizeof(Vtx) * (rows + 1));
|
||||
|
||||
this->gfx = malloc(((this->cols * 9 + 1) * this->rows + 2) * sizeof(Gfx));
|
||||
this->gfx = malloc(((this->cols * 9 + 1) * this->rows + 2) * sizeof(Gfx));
|
||||
|
||||
if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) ||
|
||||
(this->vtxFrame2 == NULL) || (this->gfx == NULL)) {
|
||||
if (this->vtxData != NULL) {
|
||||
free(this->vtxData);
|
||||
this->vtxData = NULL;
|
||||
if ((this->vtxData == NULL) || (this->vtxFrame1 == NULL) || (this->vtxFrame2 == NULL) || (this->gfx == NULL)) {
|
||||
if (this->vtxData != NULL) {
|
||||
free(this->vtxData);
|
||||
this->vtxData = NULL;
|
||||
}
|
||||
|
||||
if (this->vtxFrame1 != NULL) {
|
||||
free(this->vtxFrame1);
|
||||
this->vtxFrame1 = NULL;
|
||||
}
|
||||
|
||||
if (this->vtxFrame2 != NULL) {
|
||||
free(this->vtxFrame2);
|
||||
this->vtxFrame2 = NULL;
|
||||
}
|
||||
|
||||
if (this->gfx != NULL) {
|
||||
free(this->gfx);
|
||||
this->gfx = NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (this->vtxFrame1 != NULL) {
|
||||
free(this->vtxFrame1);
|
||||
this->vtxFrame1 = NULL;
|
||||
}
|
||||
fbdemo_init_gfx(this);
|
||||
fbdemo_init_data(this);
|
||||
this->frame = 0;
|
||||
|
||||
if (this->vtxFrame2 != NULL) {
|
||||
free(this->vtxFrame2);
|
||||
this->vtxFrame2 = NULL;
|
||||
}
|
||||
|
||||
if (this->gfx != NULL) {
|
||||
free(this->gfx);
|
||||
this->gfx = NULL;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
fbdemo_init_gfx(this);
|
||||
fbdemo_init_data(this);
|
||||
this->frame = 0;
|
||||
|
||||
return this;
|
||||
return this;
|
||||
}
|
||||
|
||||
extern void fbdemo_update(fbdemo_c* this) {
|
||||
int col;
|
||||
int row;
|
||||
Vtx* vtx;
|
||||
int col;
|
||||
int row;
|
||||
Vtx* vtx;
|
||||
|
||||
for (row = 0; row < this->rows + 1; row++) {
|
||||
for (col = 0; col < this->cols + 1; col++) {
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
(vtx + col + row * (this->cols + 1))->n.ob[0] =
|
||||
(this->vtxData + col + row * (this->cols + 1))->x;
|
||||
for (row = 0; row < this->rows + 1; row++) {
|
||||
for (col = 0; col < this->cols + 1; col++) {
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
(vtx + col + row * (this->cols + 1))->n.ob[0] = (this->vtxData + col + row * (this->cols + 1))->x;
|
||||
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
(vtx + col + row * (this->cols + 1))->n.ob[1] =
|
||||
(this->vtxData + col + row * (this->cols + 1))->y;
|
||||
vtx = (this->frame == 0) ? this->vtxFrame1 : this->vtxFrame2;
|
||||
(vtx + col + row * (this->cols + 1))->n.ob[1] = (this->vtxData + col + row * (this->cols + 1))->y;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void fbdemo_draw(fbdemo_c* this, Gfx** gfxP) {
|
||||
Gfx* gfx = *gfxP;
|
||||
Gfx* gfx = *gfxP;
|
||||
|
||||
gSPDisplayList(gfx++, fbdemo_gfx_init);
|
||||
fbdemo_update(this);
|
||||
gSPMatrix(gfx++, &this->projection,
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPMatrix(gfx++, &this->modelView1,
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(gfx++, 0xA, this->frame == 0 ? this->vtxFrame1 : this->vtxFrame2);
|
||||
gSPSegment(gfx++, 0xB, this->zBuffer);
|
||||
gSPDisplayList(gfx++, fbdemo_gfx_init);
|
||||
gSPDisplayList(gfx++, this->gfx);
|
||||
gDPPipeSync(gfx++);
|
||||
this->frame ^= 1;
|
||||
*gfxP = gfx;
|
||||
gSPDisplayList(gfx++, fbdemo_gfx_init);
|
||||
fbdemo_update(this);
|
||||
gSPMatrix(gfx++, &this->projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
|
||||
gSPMatrix(gfx++, &this->modelView1, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPSegment(gfx++, 0xA, this->frame == 0 ? this->vtxFrame1 : this->vtxFrame2);
|
||||
gSPSegment(gfx++, 0xB, this->zBuffer);
|
||||
gSPDisplayList(gfx++, fbdemo_gfx_init);
|
||||
gSPDisplayList(gfx++, this->gfx);
|
||||
gDPPipeSync(gfx++);
|
||||
this->frame ^= 1;
|
||||
*gfxP = gfx;
|
||||
}
|
||||
|
||||
extern void fbdemo_move(fbdemo_c* this) {}
|
||||
extern void fbdemo_move(fbdemo_c* this) {
|
||||
}
|
||||
|
||||
+186
-199
@@ -37,313 +37,312 @@
|
||||
#include "m_time.h"
|
||||
#include "m_land.h"
|
||||
#include "m_name_table.h"
|
||||
#include "libultra/libultra.h"
|
||||
#include "zurumode.h"
|
||||
|
||||
static int l_mfrm_msg_idx = 0;
|
||||
static int l_mfrm_now_color = 0;
|
||||
static mFRm_err_info_c l_mfrm_err_info[mFRm_ERROR_INFO_NUM];
|
||||
static int l_mfrm_err_debug[] = {0, 0, 0, 0, 0, 0};
|
||||
|
||||
static int l_mfrm_err_debug[] = { 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
/**
|
||||
* @brief Set the current message index value.
|
||||
*
|
||||
*
|
||||
* This function sets the global message index value to the provided input.
|
||||
*
|
||||
*
|
||||
* @param idx The message index value to be set.
|
||||
*/
|
||||
extern void mFRm_set_msg_idx(int idx) {
|
||||
l_mfrm_msg_idx = idx;
|
||||
l_mfrm_msg_idx = idx;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the current message index value.
|
||||
*
|
||||
*
|
||||
* This function returns the global message index value.
|
||||
*
|
||||
*
|
||||
* @return int The current message index value.
|
||||
*/
|
||||
extern int mFRm_get_msg_idx() {
|
||||
return l_mfrm_msg_idx;
|
||||
return l_mfrm_msg_idx;
|
||||
}
|
||||
|
||||
/* @fabricated - necessary for including some strings in .data & taken from DnM */
|
||||
extern MATCH_FORCESTRIP void mFRm_PrintErrInfo(gfxprint_t* gfxprint) {
|
||||
gfxprint_color(gfxprint, 250, 100, 250, 255);
|
||||
gfxprint_locate8x8(gfxprint, 22, 3);
|
||||
gfxprint_color(gfxprint, 250, 100, 250, 255);
|
||||
gfxprint_locate8x8(gfxprint, 22, 3);
|
||||
|
||||
if (l_mfrm_err_debug[0] != 0) {
|
||||
gfxprint_printf(gfxprint, "N");
|
||||
}
|
||||
if (l_mfrm_err_debug[0] != 0) {
|
||||
gfxprint_printf(gfxprint, "N");
|
||||
}
|
||||
|
||||
if (l_mfrm_err_debug[1] != 0) {
|
||||
gfxprint_printf(gfxprint, "A");
|
||||
}
|
||||
if (l_mfrm_err_debug[1] != 0) {
|
||||
gfxprint_printf(gfxprint, "A");
|
||||
}
|
||||
|
||||
if (l_mfrm_err_debug[2] != 0) {
|
||||
gfxprint_printf(gfxprint, "W");
|
||||
}
|
||||
if (l_mfrm_err_debug[2] != 0) {
|
||||
gfxprint_printf(gfxprint, "W");
|
||||
}
|
||||
|
||||
if (l_mfrm_err_debug[3] != 0) {
|
||||
gfxprint_printf(gfxprint, "R");
|
||||
}
|
||||
if (l_mfrm_err_debug[3] != 0) {
|
||||
gfxprint_printf(gfxprint, "R");
|
||||
}
|
||||
|
||||
if (l_mfrm_err_debug[4] != 0) {
|
||||
gfxprint_printf(gfxprint, "C");
|
||||
}
|
||||
if (l_mfrm_err_debug[4] != 0) {
|
||||
gfxprint_printf(gfxprint, "C");
|
||||
}
|
||||
|
||||
if (l_mfrm_err_debug[5] != 0) {
|
||||
gfxprint_printf(gfxprint, "O");
|
||||
}
|
||||
if (l_mfrm_err_debug[5] != 0) {
|
||||
gfxprint_printf(gfxprint, "O");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the checksum of the given data.
|
||||
*
|
||||
*
|
||||
* This function calculates the checksum of the provided data by adding
|
||||
* all the 16-bit data elements together.
|
||||
*
|
||||
*
|
||||
* @param data A pointer to the data buffer.
|
||||
* @param size The size of the data buffer in bytes.
|
||||
* @return u16 The calculated checksum.
|
||||
*/
|
||||
extern u16 mFRm_ReturnCheckSum(u16* data, int size) {
|
||||
u16 checksum = 0;
|
||||
u16 checksum = 0;
|
||||
|
||||
// Check if the size is even
|
||||
if ((size & 1) == 0) {
|
||||
// Calculate the checksum by adding all 16-bit data elements
|
||||
while (size != 0) {
|
||||
checksum += *data;
|
||||
data++;
|
||||
size -= sizeof(u16);
|
||||
// Check if the size is even
|
||||
if ((size & 1) == 0) {
|
||||
// Calculate the checksum by adding all 16-bit data elements
|
||||
while (size != 0) {
|
||||
checksum += *data;
|
||||
data++;
|
||||
size -= sizeof(u16);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return checksum;
|
||||
return checksum;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Calculate the flat checksum of the given data.
|
||||
*
|
||||
*
|
||||
* This function calculates the flat checksum of the provided data by
|
||||
* subtracting the current checksum from the calculated checksum and
|
||||
* then performing a bitwise complement and incrementing by 1.
|
||||
*
|
||||
*
|
||||
* @param data A pointer to the data buffer.
|
||||
* @param size The size of the data buffer in bytes.
|
||||
* @param now_checksum The current checksum of the data buffer.
|
||||
* @return u16 The calculated flat checksum.
|
||||
*/
|
||||
extern u16 mFRm_GetFlatCheckSum(u16* data, int size, u16 now_checksum) {
|
||||
// Calculate the checksum
|
||||
u16 checksum = mFRm_ReturnCheckSum(data, size) - now_checksum;
|
||||
// Calculate the checksum
|
||||
u16 checksum = mFRm_ReturnCheckSum(data, size) - now_checksum;
|
||||
|
||||
// Perform bitwise complement and increment by 1
|
||||
return (u16)(((~checksum & 0xFFFF) + 1) & 0xFFFF);
|
||||
// Perform bitwise complement and increment by 1
|
||||
return (u16)(((~checksum & 0xFFFF) + 1) & 0xFFFF);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the save data ID is valid.
|
||||
*
|
||||
*
|
||||
* This function checks if the provided save_check structure contains a valid
|
||||
* save data ID.
|
||||
*
|
||||
*
|
||||
* @param save_check A pointer to the mFRm_chk_t structure containing the save data ID.
|
||||
* @return int Returns TRUE if the save data ID is valid, otherwise FALSE.
|
||||
*/
|
||||
extern int mFRm_CheckSaveData_ID(mFRm_chk_t* save_check) {
|
||||
int ret = FALSE;
|
||||
|
||||
// Check if the save data ID is valid
|
||||
if ((save_check->code == mFRm_SAVE_ID)) {
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
int ret = FALSE;
|
||||
|
||||
// Check if the save data ID is valid
|
||||
if ((save_check->code == mFRm_SAVE_ID)) {
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the save data is valid.
|
||||
*
|
||||
*
|
||||
* This function checks if the provided save_check structure contains valid save data,
|
||||
* comparing the land ID with the provided land_id parameter.
|
||||
*
|
||||
*
|
||||
* @param save_check A pointer to the mFRm_chk_t structure containing the save data.
|
||||
* @param land_id The land ID to check against the save data.
|
||||
* @return int Returns TRUE if the save data is valid, otherwise FALSE.
|
||||
*/
|
||||
extern int mFRm_CheckSaveData_common(mFRm_chk_t* save_check, u16 land_id) {
|
||||
int ret = FALSE;
|
||||
int ret = FALSE;
|
||||
|
||||
// Check if the save data ID is valid and land IDs match
|
||||
if (mFRm_CheckSaveData_ID(save_check) != 0 &&
|
||||
mLd_CHECK_LAND_ID(save_check->land_id) &&
|
||||
save_check->land_id == land_id) {
|
||||
ret = TRUE;
|
||||
}
|
||||
// Check if the save data ID is valid and land IDs match
|
||||
if (mFRm_CheckSaveData_ID(save_check) != 0 && mLd_CHECK_LAND_ID(save_check->land_id) &&
|
||||
save_check->land_id == land_id) {
|
||||
ret = TRUE;
|
||||
}
|
||||
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Check if the current save data is valid.
|
||||
*
|
||||
*
|
||||
* This function checks if the current save data is valid using mFRm_CheckSaveData_common.
|
||||
*
|
||||
*
|
||||
* @return int Returns TRUE if the save data is valid, otherwise FALSE.
|
||||
*/
|
||||
extern int mFRm_CheckSaveData() {
|
||||
return mFRm_CheckSaveData_common(Save_GetPointer(save_check), Save_Get(land_info.id));
|
||||
return mFRm_CheckSaveData_common(Save_GetPointer(save_check), Save_Get(land_info.id));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear the save check data.
|
||||
*
|
||||
*
|
||||
* This function clears the provided save_check structure by setting its fields to their
|
||||
* default values.
|
||||
*
|
||||
*
|
||||
* @param save_check A pointer to the mFRm_chk_t structure to be cleared.
|
||||
*/
|
||||
extern void mFRm_ClearSaveCheckData(mFRm_chk_t* save_check) {
|
||||
// Set the save check data fields to their default values
|
||||
save_check->code = -1;
|
||||
save_check->land_id = 0xFFFF;
|
||||
bcopy((lbRTC_time_c*)&mTM_rtcTime_clear_code, &save_check->time, sizeof(lbRTC_time_c));
|
||||
save_check->checksum = 0;
|
||||
// Set the save check data fields to their default values
|
||||
save_check->code = -1;
|
||||
save_check->land_id = 0xFFFF;
|
||||
bcopy((lbRTC_time_c*)&mTM_rtcTime_clear_code, &save_check->time, sizeof(lbRTC_time_c));
|
||||
save_check->checksum = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the save check data.
|
||||
*
|
||||
*
|
||||
* This function sets the save check data fields based on the current save data
|
||||
* and real-time clock values.
|
||||
*
|
||||
*
|
||||
* @param save_check A pointer to the mFRm_chk_t structure to be set.
|
||||
*/
|
||||
extern void mFRm_SetSaveCheckData(mFRm_chk_t* save_check) {
|
||||
u16 land_id = Save_Get(land_info.id);
|
||||
u16 land_id = Save_Get(land_info.id);
|
||||
|
||||
// Set the save check data fields
|
||||
save_check->code = mFRm_SAVE_ID;
|
||||
save_check->land_id = land_id;
|
||||
lbRTC_TimeCopy(&save_check->time, &common_data.time.rtc_time);
|
||||
// Set the save check data fields
|
||||
save_check->code = mFRm_SAVE_ID;
|
||||
save_check->land_id = land_id;
|
||||
lbRTC_TimeCopy(&save_check->time, &common_data.time.rtc_time);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Print the saved debug information.
|
||||
*
|
||||
*
|
||||
* This function prints an 'X' to the screen if the saved debug information is available.
|
||||
*
|
||||
*
|
||||
* @param gfxprint A pointer to the gfxprint_t structure for screen printing.
|
||||
*/
|
||||
extern void mFRm_PrintSavedDebug(gfxprint_t* gfxprint) {
|
||||
// Check if the saved debug information is available
|
||||
if (Save_Get(saved_rom_debug) == TRUE) {
|
||||
// Set the print color and location
|
||||
gfxprint_color(gfxprint, 50, 250, 100, 255);
|
||||
gfxprint_locate8x8(gfxprint, 29, 3);
|
||||
// Print an 'X' to the screen
|
||||
gfxprint_printf(gfxprint, "X");
|
||||
}
|
||||
// Check if the saved debug information is available
|
||||
if (Save_Get(saved_rom_debug) == TRUE) {
|
||||
// Set the print color and location
|
||||
gfxprint_color(gfxprint, 50, 250, 100, 255);
|
||||
gfxprint_locate8x8(gfxprint, 29, 3);
|
||||
// Print an 'X' to the screen
|
||||
gfxprint_printf(gfxprint, "X");
|
||||
}
|
||||
}
|
||||
|
||||
/* Color table for displaying error information */
|
||||
static u32 l_mfrm_color_table[7][3] = {
|
||||
{ 0, 0, 0}, /* Black */
|
||||
{255, 0, 0}, /* Red */
|
||||
{255, 255, 255}, /* White */
|
||||
{ 0, 190, 0}, /* Green */
|
||||
{100, 100, 100}, /* Gray */
|
||||
{ 0, 0, 255}, /* Blue */
|
||||
{255, 0, 255} /* Magenta */
|
||||
{ 0, 0, 0 }, /* Black */
|
||||
{ 255, 0, 0 }, /* Red */
|
||||
{ 255, 255, 255 }, /* White */
|
||||
{ 0, 190, 0 }, /* Green */
|
||||
{ 100, 100, 100 }, /* Gray */
|
||||
{ 0, 0, 255 }, /* Blue */
|
||||
{ 255, 0, 255 } /* Magenta */
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Clear the error information.
|
||||
*
|
||||
*
|
||||
* This function clears the error information by setting all error numbers
|
||||
* to mFRm_NO_ERROR_NO.
|
||||
*/
|
||||
extern void mFRm_clear_err_info() {
|
||||
int i;
|
||||
// Zero out the error information array
|
||||
bzero(l_mfrm_err_info, sizeof(mFRm_err_info_c) * mFRm_ERROR_INFO_NUM);
|
||||
int i;
|
||||
// Zero out the error information array
|
||||
bzero(l_mfrm_err_info, sizeof(mFRm_err_info_c) * mFRm_ERROR_INFO_NUM);
|
||||
|
||||
// Set all error numbers to mFRm_NO_ERROR_NO
|
||||
for (i = 0; i < mFRm_ERROR_INFO_NUM; i++) {
|
||||
l_mfrm_err_info[i].err_no = mFRm_NO_ERROR_NO;
|
||||
}
|
||||
// Set all error numbers to mFRm_NO_ERROR_NO
|
||||
for (i = 0; i < mFRm_ERROR_INFO_NUM; i++) {
|
||||
l_mfrm_err_info[i].err_no = mFRm_NO_ERROR_NO;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get a free error information slot.
|
||||
*
|
||||
*
|
||||
* This function returns a pointer to the first available error information slot.
|
||||
*
|
||||
*
|
||||
* @param err_info A pointer to the error information array.
|
||||
* @param count The number of error information slots.
|
||||
* @return mFRm_err_info_c* A pointer to the first available error information slot or NULL if none are available.
|
||||
*/
|
||||
static mFRm_err_info_c* mFRm_get_free_errInfo(mFRm_err_info_c* err_info, int count) {
|
||||
mFRm_err_info_c* ret = NULL;
|
||||
mFRm_err_info_c* ret = NULL;
|
||||
|
||||
// Iterate through the error information slots
|
||||
while (count != 0) {
|
||||
// Check if the current slot is available
|
||||
if (err_info->err_no == mFRm_NO_ERROR_NO) {
|
||||
ret = err_info;
|
||||
break;
|
||||
// Iterate through the error information slots
|
||||
while (count != 0) {
|
||||
// Check if the current slot is available
|
||||
if (err_info->err_no == mFRm_NO_ERROR_NO) {
|
||||
ret = err_info;
|
||||
break;
|
||||
}
|
||||
err_info++;
|
||||
count--;
|
||||
}
|
||||
err_info++;
|
||||
count--;
|
||||
}
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the error information for a specific process.
|
||||
*
|
||||
*
|
||||
* This function sets the error information for the specified process index and error number.
|
||||
*
|
||||
*
|
||||
* @param err_info A pointer to the error information array.
|
||||
* @param proc_idx The process index for which the error occurred.
|
||||
* @param err_no The error number to be set.
|
||||
*/
|
||||
static void mFRm_set_errInfo(mFRm_err_info_c* err_info, int proc_idx, int err_no) {
|
||||
// Get a free error information slot
|
||||
mFRm_err_info_c* free = mFRm_get_free_errInfo(err_info, mFRm_ERROR_INFO_NUM);
|
||||
// Get a free error information slot
|
||||
mFRm_err_info_c* free = mFRm_get_free_errInfo(err_info, mFRm_ERROR_INFO_NUM);
|
||||
|
||||
// Set the error information if a free slot is available
|
||||
if (free != NULL) {
|
||||
free->err_no = err_no;
|
||||
free->proc_idx = proc_idx;
|
||||
}
|
||||
// Set the error information if a free slot is available
|
||||
if (free != NULL) {
|
||||
free->err_no = err_no;
|
||||
free->proc_idx = proc_idx;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the number of error information slots with errors.
|
||||
*
|
||||
*
|
||||
* This function returns the number of error information slots with error numbers
|
||||
* different from mFRm_NO_ERROR_NO.
|
||||
*
|
||||
*
|
||||
* @param err_info A pointer to the error information array.
|
||||
* @param count The number of error information slots.
|
||||
* @return int The number of error information slots with errors.
|
||||
*/
|
||||
static int mFRm_get_errInfoNum(mFRm_err_info_c* err_info, int count) {
|
||||
int ret = 0;
|
||||
int ret = 0;
|
||||
|
||||
// Loop through the error information slots
|
||||
while (count != 0) {
|
||||
// Increment the count if the error number is not mFRm_NO_ERROR_NO
|
||||
if (err_info->err_no != mFRm_NO_ERROR_NO) {
|
||||
ret++;
|
||||
// Loop through the error information slots
|
||||
while (count != 0) {
|
||||
// Increment the count if the error number is not mFRm_NO_ERROR_NO
|
||||
if (err_info->err_no != mFRm_NO_ERROR_NO) {
|
||||
ret++;
|
||||
}
|
||||
err_info++;
|
||||
count--;
|
||||
}
|
||||
err_info++;
|
||||
count--;
|
||||
}
|
||||
return ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#define mFRm_ERRORLINE(line) mFRm_set_errInfo(l_mfrm_err_info, (line), l_mfrm_now_color)
|
||||
@@ -359,82 +358,70 @@ static int mFRm_get_errInfoNum(mFRm_err_info_c* err_info, int count) {
|
||||
|
||||
/**
|
||||
* @brief Perform save data checks.
|
||||
*
|
||||
*
|
||||
* This function performs save data checks for different procedures and
|
||||
* increments the color index upon each check.
|
||||
*/
|
||||
extern void mFRm_save_data_check() {
|
||||
// Define save data check procedures
|
||||
static save_check_proc* proc[] = {
|
||||
&sChk_check_save_data, &sChk_check_save_gen, &sChk_CheckSaveData_MYK,
|
||||
&sChk_CheckSaveData_NSW, &sChk_check_save_take, &sChk_CheckSaveData_YSD,
|
||||
&sChk_CheckSaveData_komatu
|
||||
};
|
||||
// Define save data check procedures
|
||||
static save_check_proc* proc[] = { &sChk_check_save_data, &sChk_check_save_gen, &sChk_CheckSaveData_MYK,
|
||||
&sChk_CheckSaveData_NSW, &sChk_check_save_take, &sChk_CheckSaveData_YSD,
|
||||
&sChk_CheckSaveData_komatu };
|
||||
|
||||
int i = 0;
|
||||
mFRm_err_info_c* err_info = l_mfrm_err_info;
|
||||
l_mfrm_now_color = 0;
|
||||
int i = 0;
|
||||
mFRm_err_info_c* err_info = l_mfrm_err_info;
|
||||
l_mfrm_now_color = 0;
|
||||
|
||||
// If zurumode_flag is greater or equal to 2 and scene_no is 7, perform save data checks
|
||||
if ((zurumode_flag >= 2) && (Save_Get(scene_no) == 7)) {
|
||||
// If there are no errors, perform the save data checks
|
||||
if (mFRm_get_errInfoNum(err_info, mFRm_ERROR_INFO_NUM) == 0) {
|
||||
while (i < 7) {
|
||||
(*proc[i])();
|
||||
l_mfrm_now_color++;
|
||||
i++;
|
||||
}
|
||||
// If zurumode_flag is greater or equal to 2 and scene_no is 7, perform save data checks
|
||||
if ((zurumode_flag >= 2) && (Save_Get(scene_no) == 7)) {
|
||||
// If there are no errors, perform the save data checks
|
||||
if (mFRm_get_errInfoNum(err_info, mFRm_ERROR_INFO_NUM) == 0) {
|
||||
while (i < 7) {
|
||||
(*proc[i])();
|
||||
l_mfrm_now_color++;
|
||||
i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Display error information on the screen.
|
||||
*
|
||||
*
|
||||
* This function displays the error information on the screen if there are
|
||||
* any errors and if the zurumode_flag is greater than or equal to 2.
|
||||
*
|
||||
*
|
||||
* @param gfxprint A pointer to the gfxprint_t structure for screen printing.
|
||||
*/
|
||||
extern void mFRm_display_errInfo(gfxprint_t* gfxprint) {
|
||||
mFRm_err_info_c* err_info = l_mfrm_err_info;
|
||||
int i;
|
||||
mFRm_err_info_c* err_info = l_mfrm_err_info;
|
||||
int i;
|
||||
|
||||
// If zurumode_flag is greater or equal to 2 and scene_no is 7, display
|
||||
// error information
|
||||
if ((zurumode_flag >= 2) && (Save_Get(scene_no) == 7)) {
|
||||
gfxprint_locate8x8(gfxprint, 37, 17);
|
||||
gfxprint_color(gfxprint, 255, 255, 255, 255);
|
||||
gfxprint_printf(gfxprint, "-");
|
||||
// If zurumode_flag is greater or equal to 2 and scene_no is 7, display
|
||||
// error information
|
||||
if ((zurumode_flag >= 2) && (Save_Get(scene_no) == 7)) {
|
||||
gfxprint_locate8x8(gfxprint, 37, 17);
|
||||
gfxprint_color(gfxprint, 255, 255, 255, 255);
|
||||
gfxprint_printf(gfxprint, "-");
|
||||
|
||||
// If there are errors, display them on the screen
|
||||
if (mFRm_get_errInfoNum(err_info, mFRm_ERROR_INFO_NUM) > 0) {
|
||||
for (i = 0; i < 10; i++) {
|
||||
gfxprint_locate8x8(gfxprint, 30, i + 18);
|
||||
// If there are errors, display them on the screen
|
||||
if (mFRm_get_errInfoNum(err_info, mFRm_ERROR_INFO_NUM) > 0) {
|
||||
for (i = 0; i < 10; i++) {
|
||||
gfxprint_locate8x8(gfxprint, 30, i + 18);
|
||||
|
||||
// Break the loop if no error is found
|
||||
if (err_info->err_no == mFRm_NO_ERROR_NO) {
|
||||
break;
|
||||
// Break the loop if no error is found
|
||||
if (err_info->err_no == mFRm_NO_ERROR_NO) {
|
||||
break;
|
||||
}
|
||||
|
||||
// Set the color for displaying the error information
|
||||
gfxprint_color(gfxprint, l_mfrm_color_table[err_info->err_no][0],
|
||||
l_mfrm_color_table[err_info->err_no][1], l_mfrm_color_table[err_info->err_no][2], 255);
|
||||
|
||||
// Display the error information
|
||||
gfxprint_printf(gfxprint, "x%dx %d", err_info->err_no, err_info->proc_idx);
|
||||
err_info++;
|
||||
}
|
||||
}
|
||||
|
||||
// Set the color for displaying the error information
|
||||
gfxprint_color(
|
||||
gfxprint,
|
||||
l_mfrm_color_table[err_info->err_no][0],
|
||||
l_mfrm_color_table[err_info->err_no][1],
|
||||
l_mfrm_color_table[err_info->err_no][2],
|
||||
255
|
||||
);
|
||||
|
||||
// Display the error information
|
||||
gfxprint_printf(
|
||||
gfxprint,
|
||||
"x%dx %d",
|
||||
err_info->err_no,
|
||||
err_info->proc_idx
|
||||
);
|
||||
err_info++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+152
-161
@@ -12,8 +12,9 @@
|
||||
#include "MSL_C/w_math.h"
|
||||
#include "m_rcp.h"
|
||||
#include "libc/math.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
#define mFont_CC_FONT 0, 0, 0, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0
|
||||
#define mFont_CC_FONT 0, 0, 0, PRIMITIVE, PRIMITIVE, 0, TEXEL0, 0
|
||||
#define mFont_CC_NOFONT 0, 0, 0, PRIMITIVE, 0, PRIMITIVE, TEXEL0, PRIMITIVE
|
||||
|
||||
#include "../src/m_font_offset.c_inc"
|
||||
@@ -24,200 +25,190 @@
|
||||
/* @unused static u8* mFont_Get_end_load_texture() */
|
||||
|
||||
extern void mFont_ct() {
|
||||
// code removed probably
|
||||
// code removed probably
|
||||
}
|
||||
|
||||
static int mMsg_CutLeftSpace(u8* str, int str_len) {
|
||||
// This should've been renamed or moved to m_message.h
|
||||
|
||||
u8* dst;
|
||||
u8* src;
|
||||
int i, j;
|
||||
// This should've been renamed or moved to m_message.h
|
||||
|
||||
for (i = 0; i < str_len; i++) {
|
||||
if (str[i] != CHAR_SPACE) {
|
||||
break;
|
||||
u8* dst;
|
||||
u8* src;
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < str_len; i++) {
|
||||
if (str[i] != CHAR_SPACE) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (i == str_len) {
|
||||
return 0;
|
||||
}
|
||||
else if (i == 0) {
|
||||
return str_len;
|
||||
}
|
||||
if (i == str_len) {
|
||||
return 0;
|
||||
} else if (i == 0) {
|
||||
return str_len;
|
||||
}
|
||||
|
||||
dst = str;
|
||||
src = str + i;
|
||||
for (j = i; j < str_len; j++) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
dst = str;
|
||||
src = str + i;
|
||||
for (j = i; j < str_len; j++) {
|
||||
*dst++ = *src++;
|
||||
}
|
||||
|
||||
for (j = 0; j < i; j++) {
|
||||
*dst++ = CHAR_SPACE;
|
||||
}
|
||||
for (j = 0; j < i; j++) {
|
||||
*dst++ = CHAR_SPACE;
|
||||
}
|
||||
|
||||
return str_len - i;
|
||||
return str_len - i;
|
||||
}
|
||||
|
||||
static u8 mFont_suji_data[] = "0123456789";
|
||||
|
||||
static int mFont_suji_check(u8 c) {
|
||||
u8* suji = mFont_suji_data;
|
||||
int i;
|
||||
u8* suji = mFont_suji_data;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (c == suji[i]) {
|
||||
return TRUE;
|
||||
for (i = 0; i < 10; i++) {
|
||||
if (c == suji[i]) {
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
extern int mFont_UnintToString(
|
||||
u8* str,
|
||||
int figure,
|
||||
u32 num,
|
||||
int figure_start,
|
||||
int left_cut,
|
||||
int fill_zero,
|
||||
int separator
|
||||
) {
|
||||
int i;
|
||||
int j;
|
||||
u32 cur_num;
|
||||
int next;
|
||||
|
||||
int temp2;
|
||||
int last_figure;
|
||||
extern int mFont_UnintToString(u8* str, int figure, u32 num, int figure_start, int left_cut, int fill_zero,
|
||||
int separator) {
|
||||
int i;
|
||||
int j;
|
||||
u32 cur_num;
|
||||
int next;
|
||||
|
||||
int l = figure - figure_start;
|
||||
u8 fill_char = fill_zero ? CHAR_ZERO : CHAR_SPACE;
|
||||
u8 left_fill_char = fill_zero && !left_cut ? CHAR_ZERO : CHAR_SPACE;
|
||||
int temp2;
|
||||
int last_figure;
|
||||
|
||||
cur_num = num;
|
||||
for (last_figure = figure - 1; last_figure >= l; last_figure--) {
|
||||
next = cur_num / 10;
|
||||
temp2 = cur_num - next * 10;
|
||||
if (cur_num == 0) {
|
||||
if (num == 0 && last_figure == figure - 1) {
|
||||
str[last_figure] = CHAR_ZERO;
|
||||
}
|
||||
else {
|
||||
str[last_figure] = fill_char;
|
||||
}
|
||||
}
|
||||
else {
|
||||
str[last_figure] = mFont_suji_data[temp2];
|
||||
}
|
||||
cur_num = next;
|
||||
}
|
||||
int l = figure - figure_start;
|
||||
u8 fill_char = fill_zero ? CHAR_ZERO : CHAR_SPACE;
|
||||
u8 left_fill_char = fill_zero && !left_cut ? CHAR_ZERO : CHAR_SPACE;
|
||||
|
||||
for (i = last_figure; i >= 0; i--) {
|
||||
str[i] = left_fill_char;
|
||||
}
|
||||
|
||||
if (separator) {
|
||||
int count = 0;
|
||||
for (i = figure - 1; i >= 0; i--) {
|
||||
if (mFont_suji_check(str[i])) {
|
||||
count++;
|
||||
if (count > 3) {
|
||||
for (j = 0; j < i; j++) {
|
||||
str[j] = str[j + 1];
|
||||
}
|
||||
|
||||
str[i] = CHAR_COMMA;
|
||||
count = 0;
|
||||
cur_num = num;
|
||||
for (last_figure = figure - 1; last_figure >= l; last_figure--) {
|
||||
next = cur_num / 10;
|
||||
temp2 = cur_num - next * 10;
|
||||
if (cur_num == 0) {
|
||||
if (num == 0 && last_figure == figure - 1) {
|
||||
str[last_figure] = CHAR_ZERO;
|
||||
} else {
|
||||
str[last_figure] = fill_char;
|
||||
}
|
||||
} else {
|
||||
str[last_figure] = mFont_suji_data[temp2];
|
||||
}
|
||||
}
|
||||
cur_num = next;
|
||||
}
|
||||
}
|
||||
|
||||
if (left_cut) {
|
||||
return mMsg_CutLeftSpace(str, figure);
|
||||
}
|
||||
for (i = last_figure; i >= 0; i--) {
|
||||
str[i] = left_fill_char;
|
||||
}
|
||||
|
||||
return figure;
|
||||
if (separator) {
|
||||
int count = 0;
|
||||
for (i = figure - 1; i >= 0; i--) {
|
||||
if (mFont_suji_check(str[i])) {
|
||||
count++;
|
||||
if (count > 3) {
|
||||
for (j = 0; j < i; j++) {
|
||||
str[j] = str[j + 1];
|
||||
}
|
||||
|
||||
str[i] = CHAR_COMMA;
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (left_cut) {
|
||||
return mMsg_CutLeftSpace(str, figure);
|
||||
}
|
||||
|
||||
return figure;
|
||||
}
|
||||
|
||||
extern int mFont_char_save_data_check(u8 c) {
|
||||
return c == CHAR_CONTROL_CODE || c == CHAR_MESSAGE_TAG;
|
||||
return c == CHAR_CONTROL_CODE || c == CHAR_MESSAGE_TAG;
|
||||
}
|
||||
|
||||
extern u8 mFont_small_to_capital(u8 small) {
|
||||
static const u8 tbl[56][2] = {
|
||||
{ CHAR_a, CHAR_A },
|
||||
{ CHAR_b, CHAR_B },
|
||||
{ CHAR_c, CHAR_C },
|
||||
{ CHAR_d, CHAR_D },
|
||||
{ CHAR_e, CHAR_E },
|
||||
{ CHAR_f, CHAR_F },
|
||||
{ CHAR_g, CHAR_G },
|
||||
{ CHAR_h, CHAR_H },
|
||||
{ CHAR_i, CHAR_I },
|
||||
{ CHAR_j, CHAR_J },
|
||||
{ CHAR_k, CHAR_K },
|
||||
{ CHAR_l, CHAR_L },
|
||||
{ CHAR_m, CHAR_M },
|
||||
{ CHAR_n, CHAR_N },
|
||||
{ CHAR_o, CHAR_O },
|
||||
{ CHAR_p, CHAR_P },
|
||||
{ CHAR_q, CHAR_Q },
|
||||
{ CHAR_r, CHAR_R },
|
||||
{ CHAR_s, CHAR_S },
|
||||
{ CHAR_t, CHAR_T },
|
||||
{ CHAR_u, CHAR_U },
|
||||
{ CHAR_v, CHAR_V },
|
||||
{ CHAR_w, CHAR_W },
|
||||
{ CHAR_x, CHAR_X },
|
||||
{ CHAR_y, CHAR_Y },
|
||||
{ CHAR_z, CHAR_Z },
|
||||
{ CHAR_DIARESIS_a, CHAR_DIAERESIS_A },
|
||||
{ CHAR_GRAVE_a, CHAR_GRAVE_A },
|
||||
{ CHAR_ACUTE_a, CHAR_ACUTE_A },
|
||||
{ CHAR_CIRCUMFLEX_a, CHAR_CIRCUMFLEX_A },
|
||||
{ CHAR_TILDE_a, CHAR_TILDE_A },
|
||||
{ CHAR_ANGSTROM_a, CHAR_ANGSTROM_A },
|
||||
{ CHAR_LOWER_CEDILLA, CHAR_CEDILLA },
|
||||
{ CHAR_GRAVE_e, CHAR_GRAVE_E },
|
||||
{ CHAR_ACUTE_e, CHAR_ACUTE_E },
|
||||
{ CHAR_CIRCUMFLEX_e, CHAR_CIRCUMFLEX_E },
|
||||
{ CHAR_DIARESIS_e, CHAR_DIARESIS_E },
|
||||
{ CHAR_GRAVE_i, CHAR_GRAVE_I },
|
||||
{ CHAR_ACUTE_i, CHAR_ACUTE_I },
|
||||
{ CHAR_CIRCUMFLEX_i, CHAR_CIRCUMFLEX_I },
|
||||
{ CHAR_DIARESIS_i, CHAR_DIARESIS_I },
|
||||
{ CHAR_LOWER_ETH, CHAR_ETH },
|
||||
{ CHAR_TILDE_n, CHAR_TILDE_N },
|
||||
{ CHAR_GRAVE_o, CHAR_GRAVE_O },
|
||||
{ CHAR_ACUTE_o, CHAR_ACUTE_O },
|
||||
{ CHAR_CIRCUMFLEX_o, CHAR_CIRCUMFLEX_O },
|
||||
{ CHAR_TILDE_o, CHAR_TILDE_O },
|
||||
{ CHAR_DIARESIS_o, CHAR_DIARESIS_O },
|
||||
{ CHAR_oe, CHAR_OE },
|
||||
{ CHAR_GRAVE_u, CHAR_GRAVE_U },
|
||||
{ CHAR_ACUTE_u, CHAR_ACUTE_U },
|
||||
{ CHAR_CIRCUMFLEX_u, CHAR_CIRCUMFLEX_U },
|
||||
{ CHAR_DIARESIS_u, CHAR_DIARESIS_U },
|
||||
{ CHAR_ACUTE_y, CHAR_ACUTE_Y },
|
||||
{ CHAR_LOWER_THORN, CHAR_THORN },
|
||||
{ CHAR_LOWER_ASH, CHAR_ASH }
|
||||
};
|
||||
static const u8 tbl[56][2] = {
|
||||
{ CHAR_a, CHAR_A },
|
||||
{ CHAR_b, CHAR_B },
|
||||
{ CHAR_c, CHAR_C },
|
||||
{ CHAR_d, CHAR_D },
|
||||
{ CHAR_e, CHAR_E },
|
||||
{ CHAR_f, CHAR_F },
|
||||
{ CHAR_g, CHAR_G },
|
||||
{ CHAR_h, CHAR_H },
|
||||
{ CHAR_i, CHAR_I },
|
||||
{ CHAR_j, CHAR_J },
|
||||
{ CHAR_k, CHAR_K },
|
||||
{ CHAR_l, CHAR_L },
|
||||
{ CHAR_m, CHAR_M },
|
||||
{ CHAR_n, CHAR_N },
|
||||
{ CHAR_o, CHAR_O },
|
||||
{ CHAR_p, CHAR_P },
|
||||
{ CHAR_q, CHAR_Q },
|
||||
{ CHAR_r, CHAR_R },
|
||||
{ CHAR_s, CHAR_S },
|
||||
{ CHAR_t, CHAR_T },
|
||||
{ CHAR_u, CHAR_U },
|
||||
{ CHAR_v, CHAR_V },
|
||||
{ CHAR_w, CHAR_W },
|
||||
{ CHAR_x, CHAR_X },
|
||||
{ CHAR_y, CHAR_Y },
|
||||
{ CHAR_z, CHAR_Z },
|
||||
{ CHAR_DIARESIS_a, CHAR_DIAERESIS_A },
|
||||
{ CHAR_GRAVE_a, CHAR_GRAVE_A },
|
||||
{ CHAR_ACUTE_a, CHAR_ACUTE_A },
|
||||
{ CHAR_CIRCUMFLEX_a, CHAR_CIRCUMFLEX_A },
|
||||
{ CHAR_TILDE_a, CHAR_TILDE_A },
|
||||
{ CHAR_ANGSTROM_a, CHAR_ANGSTROM_A },
|
||||
{ CHAR_LOWER_CEDILLA, CHAR_CEDILLA },
|
||||
{ CHAR_GRAVE_e, CHAR_GRAVE_E },
|
||||
{ CHAR_ACUTE_e, CHAR_ACUTE_E },
|
||||
{ CHAR_CIRCUMFLEX_e, CHAR_CIRCUMFLEX_E },
|
||||
{ CHAR_DIARESIS_e, CHAR_DIARESIS_E },
|
||||
{ CHAR_GRAVE_i, CHAR_GRAVE_I },
|
||||
{ CHAR_ACUTE_i, CHAR_ACUTE_I },
|
||||
{ CHAR_CIRCUMFLEX_i, CHAR_CIRCUMFLEX_I },
|
||||
{ CHAR_DIARESIS_i, CHAR_DIARESIS_I },
|
||||
{ CHAR_LOWER_ETH, CHAR_ETH },
|
||||
{ CHAR_TILDE_n, CHAR_TILDE_N },
|
||||
{ CHAR_GRAVE_o, CHAR_GRAVE_O },
|
||||
{ CHAR_ACUTE_o, CHAR_ACUTE_O },
|
||||
{ CHAR_CIRCUMFLEX_o, CHAR_CIRCUMFLEX_O },
|
||||
{ CHAR_TILDE_o, CHAR_TILDE_O },
|
||||
{ CHAR_DIARESIS_o, CHAR_DIARESIS_O },
|
||||
{ CHAR_oe, CHAR_OE },
|
||||
{ CHAR_GRAVE_u, CHAR_GRAVE_U },
|
||||
{ CHAR_ACUTE_u, CHAR_ACUTE_U },
|
||||
{ CHAR_CIRCUMFLEX_u, CHAR_CIRCUMFLEX_U },
|
||||
{ CHAR_DIARESIS_u, CHAR_DIARESIS_U },
|
||||
{ CHAR_ACUTE_y, CHAR_ACUTE_Y },
|
||||
{ CHAR_LOWER_THORN, CHAR_THORN },
|
||||
{ CHAR_LOWER_ASH, CHAR_ASH },
|
||||
};
|
||||
|
||||
u8 res = small;
|
||||
u8* t = (u8*)tbl;
|
||||
int i;
|
||||
u8 res = small;
|
||||
u8* t = (u8*)tbl;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 56; i++) {
|
||||
if (t[0] == small) {
|
||||
res = t[1];
|
||||
break;
|
||||
for (i = 0; i < 56; i++) {
|
||||
if (t[0] == small) {
|
||||
res = t[1];
|
||||
break;
|
||||
}
|
||||
|
||||
t += 2;
|
||||
}
|
||||
|
||||
t += 2;
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
+6
-5
@@ -6,14 +6,15 @@
|
||||
#include "m_debug.h"
|
||||
#include "m_npc_schedule.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "libultra/libultra.h"
|
||||
|
||||
#define mEnv_TIME_TO_SECS(hour, min, sec) ((hour) * mTM_SECONDS_IN_HOUR + (min) * mTM_SECONDS_IN_MINUTE + (sec))
|
||||
|
||||
static int klight_chg_time[mEnv_TERM_NUM + 1] = { mEnv_TIME_TO_SECS(0, 0, 0), mEnv_TIME_TO_SECS(4, 0, 0),
|
||||
mEnv_TIME_TO_SECS(6, 0, 0), mEnv_TIME_TO_SECS(8, 0, 0),
|
||||
mEnv_TIME_TO_SECS(12, 0, 0), mEnv_TIME_TO_SECS(16, 0, 0),
|
||||
mEnv_TIME_TO_SECS(18, 0, 0), mEnv_TIME_TO_SECS(20, 0, 0),
|
||||
mEnv_TIME_TO_SECS(24, 0, 0) };
|
||||
static int klight_chg_time[mEnv_TERM_NUM + 1] = {
|
||||
mEnv_TIME_TO_SECS(0, 0, 0), mEnv_TIME_TO_SECS(4, 0, 0), mEnv_TIME_TO_SECS(6, 0, 0),
|
||||
mEnv_TIME_TO_SECS(8, 0, 0), mEnv_TIME_TO_SECS(12, 0, 0), mEnv_TIME_TO_SECS(16, 0, 0),
|
||||
mEnv_TIME_TO_SECS(18, 0, 0), mEnv_TIME_TO_SECS(20, 0, 0), mEnv_TIME_TO_SECS(24, 0, 0),
|
||||
};
|
||||
|
||||
static BaseLight l_mEnv_kcolor_fine_data[mEnv_TERM_NUM] = {
|
||||
/* 00:00 -> 03:59 */
|
||||
|
||||
+931
-1036
File diff suppressed because it is too large
Load Diff
+56
-67
@@ -24,27 +24,28 @@ typedef void (*mMsg_MAIN_PROC)(mMsg_Window_c*, GAME*);
|
||||
#ifndef __INTELLISENSE__
|
||||
/* Force assetrip to detect these assets. They're used in a .c_inc file. */
|
||||
FORCESTRIP static u8 __unused_msg0[] = {
|
||||
#include "assets/msg/con_kaiwa2_w1_tex.inc"
|
||||
#include "assets/msg/con_kaiwa2_w1_tex.inc"
|
||||
};
|
||||
FORCESTRIP static u8 __unused_msg1[] = {
|
||||
#include "assets/msg/con_kaiwa2_w2_tex.inc"
|
||||
#include "assets/msg/con_kaiwa2_w2_tex.inc"
|
||||
};
|
||||
FORCESTRIP static u8 __unused_msg2[] = {
|
||||
#include "assets/msg/con_kaiwa2_w3_tex.inc"
|
||||
#include "assets/msg/con_kaiwa2_w3_tex.inc"
|
||||
};
|
||||
FORCESTRIP static Vtx __unused_msg3[] = {
|
||||
#include "assets/msg/con_kaiwa2_v.inc"
|
||||
#include "assets/msg/con_kaiwa2_v.inc"
|
||||
};
|
||||
FORCESTRIP static u8 __unused_msg4[] = {
|
||||
#include "assets/msg/con_namefuti_TXT.inc"
|
||||
#include "assets/msg/con_namefuti_TXT.inc"
|
||||
};
|
||||
FORCESTRIP static Vtx __unused_msg5[] = {
|
||||
#include "assets/msg/con_kaiwaname_v.inc"
|
||||
#include "assets/msg/con_kaiwaname_v.inc"
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static void mMsg_MainSetup_Window(mMsg_Window_c* msg_p, GAME* game);
|
||||
static int mMsg_end_to_disappear(mMsg_Window_c* msg_p);
|
||||
|
||||
#include "../src/m_msg_ctrl.c_inc"
|
||||
|
||||
@@ -67,100 +68,88 @@ static void mMsg_sound_MessageStatus(u8 status);
|
||||
#include "../src/m_msg_draw_font.c_inc"
|
||||
|
||||
static void mMsg_MainSetup_Window(mMsg_Window_c* msg_p, GAME* game) {
|
||||
static mMsg_MAIN_PROC proc[mMsg_INDEX_NUM] = {
|
||||
&mMsg_MainSetup_Hide,
|
||||
&mMsg_MainSetup_Appear,
|
||||
&mMsg_MainSetup_Normal,
|
||||
&mMsg_MainSetup_Cursol,
|
||||
&mMsg_MainSetup_Disappear,
|
||||
&mMsg_MainSetup_Appear_Wait,
|
||||
&mMsg_MainSetup_Wait,
|
||||
&mMsg_MainSetup_Disappear_wait
|
||||
};
|
||||
static mMsg_MAIN_PROC proc[mMsg_INDEX_NUM] = {
|
||||
&mMsg_MainSetup_Hide, &mMsg_MainSetup_Appear, &mMsg_MainSetup_Normal, &mMsg_MainSetup_Cursol,
|
||||
&mMsg_MainSetup_Disappear, &mMsg_MainSetup_Appear_Wait, &mMsg_MainSetup_Wait, &mMsg_MainSetup_Disappear_wait,
|
||||
};
|
||||
|
||||
int idx = msg_p->requested_main_index;
|
||||
int idx = msg_p->requested_main_index;
|
||||
|
||||
if (idx >= 0) {
|
||||
if (idx >= mMsg_INDEX_NUM || proc[idx] == NULL) {
|
||||
return;
|
||||
if (idx >= 0) {
|
||||
if (idx >= mMsg_INDEX_NUM || proc[idx] == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
(*proc[idx])(msg_p, game);
|
||||
}
|
||||
|
||||
(*proc[idx])(msg_p, game);
|
||||
}
|
||||
}
|
||||
|
||||
static void mMsg_Main_Window(mMsg_Window_c* msg_p, GAME* game) {
|
||||
static mMsg_MAIN_PROC proc[mMsg_INDEX_NUM] = {
|
||||
&mMsg_Main_Hide,
|
||||
&mMsg_Main_Appear,
|
||||
&mMsg_Main_Normal,
|
||||
&mMsg_Main_Cursol,
|
||||
&mMsg_Main_Disappear,
|
||||
&mMsg_Main_Appear_wait,
|
||||
&mMsg_Main_Wait,
|
||||
&mMsg_Main_Disappear_wait
|
||||
};
|
||||
static mMsg_MAIN_PROC proc[mMsg_INDEX_NUM] = {
|
||||
&mMsg_Main_Hide, &mMsg_Main_Appear, &mMsg_Main_Normal, &mMsg_Main_Cursol,
|
||||
&mMsg_Main_Disappear, &mMsg_Main_Appear_wait, &mMsg_Main_Wait, &mMsg_Main_Disappear_wait,
|
||||
};
|
||||
|
||||
int idx = msg_p->main_index;
|
||||
int idx = msg_p->main_index;
|
||||
|
||||
if (idx >= 0) {
|
||||
if (idx >= mMsg_INDEX_NUM || proc[idx] == NULL) {
|
||||
return;
|
||||
if (idx >= 0) {
|
||||
if (idx >= mMsg_INDEX_NUM || proc[idx] == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
(*proc[idx])(msg_p, game);
|
||||
}
|
||||
|
||||
(*proc[idx])(msg_p, game);
|
||||
}
|
||||
}
|
||||
|
||||
static void mMsg_Draw_Window(mMsg_Window_c* msg_p, GAME* game) {
|
||||
if (msg_p->draw_flag && msg_p->data_loaded) {
|
||||
mFont_SetMatrix(game->graph, mFont_MODE_FONT);
|
||||
mMsg_SetMatrix(msg_p, game, mFont_MODE_FONT);
|
||||
mMsg_DrawWindowBody(msg_p, game, mFont_MODE_FONT);
|
||||
mMsg_UnSetMatrix();
|
||||
mFont_UnSetMatrix(game->graph, mFont_MODE_FONT);
|
||||
if (msg_p->draw_flag && msg_p->data_loaded) {
|
||||
mFont_SetMatrix(game->graph, mFont_MODE_FONT);
|
||||
mMsg_SetMatrix(msg_p, game, mFont_MODE_FONT);
|
||||
mMsg_DrawWindowBody(msg_p, game, mFont_MODE_FONT);
|
||||
mMsg_UnSetMatrix();
|
||||
mFont_UnSetMatrix(game->graph, mFont_MODE_FONT);
|
||||
|
||||
if (msg_p->msg_data->data_loaded) {
|
||||
mMsg_draw_font(msg_p, game);
|
||||
if (msg_p->msg_data->data_loaded) {
|
||||
mMsg_draw_font(msg_p, game);
|
||||
}
|
||||
|
||||
mChoice_Draw(&msg_p->choice_window, game, mFont_MODE_FONT);
|
||||
}
|
||||
|
||||
mChoice_Draw(&msg_p->choice_window, game, mFont_MODE_FONT);
|
||||
}
|
||||
}
|
||||
|
||||
extern void mMsg_aram_init() {
|
||||
mChoice_aram_init();
|
||||
mString_aram_init();
|
||||
mHandbill_aram_init();
|
||||
mChoice_aram_init();
|
||||
mString_aram_init();
|
||||
mHandbill_aram_init();
|
||||
}
|
||||
|
||||
extern void mMsg_aram_init2() {
|
||||
Msg_table_rom_start = JW_GetAramAddress(RESOURCE_MESSAGE_TABLE);
|
||||
Msg_rom_start = JW_GetAramAddress(RESOURCE_MESSAGE);
|
||||
Msg_table_rom_start = JW_GetAramAddress(RESOURCE_MESSAGE_TABLE);
|
||||
Msg_rom_start = JW_GetAramAddress(RESOURCE_MESSAGE);
|
||||
}
|
||||
|
||||
extern void mMsg_ct(GAME* game) {
|
||||
mMsg_init(game);
|
||||
mChoice_ct(&mMsg_window.choice_window, game);
|
||||
mMsg_init(game);
|
||||
mChoice_ct(&mMsg_window.choice_window, game);
|
||||
}
|
||||
|
||||
extern void mMsg_dt(GAME* game) {
|
||||
mChoice_dt(&mMsg_window.choice_window, game);
|
||||
mChoice_dt(&mMsg_window.choice_window, game);
|
||||
}
|
||||
|
||||
extern void mMsg_debug_draw(gfxprint_t* gfxprint) {
|
||||
if (mMsg_window.msg_data != NULL) {
|
||||
gfxprint_color(gfxprint, 245, 255, 250, 255);
|
||||
gfxprint_locate8x8(gfxprint, 3, 6);
|
||||
gfxprint_printf(gfxprint, "%5d", mMsg_window.msg_data->msg_no);
|
||||
}
|
||||
if (mMsg_window.msg_data != NULL) {
|
||||
gfxprint_color(gfxprint, 245, 255, 250, 255);
|
||||
gfxprint_locate8x8(gfxprint, 3, 6);
|
||||
gfxprint_printf(gfxprint, "%5d", mMsg_window.msg_data->msg_no);
|
||||
}
|
||||
}
|
||||
|
||||
extern void mMsg_Main(GAME* game) {
|
||||
mMsg_Main_Window(&mMsg_window, game);
|
||||
mChoice_Main(&mMsg_window.choice_window, game);
|
||||
mMsg_Main_Window(&mMsg_window, game);
|
||||
mChoice_Main(&mMsg_window.choice_window, game);
|
||||
}
|
||||
|
||||
extern void mMsg_Draw(GAME* game) {
|
||||
mMsg_Draw_Window(&mMsg_window, game);
|
||||
mMsg_Draw_Window(&mMsg_window, game);
|
||||
}
|
||||
|
||||
+322
-977
File diff suppressed because it is too large
Load Diff
+5287
-5544
File diff suppressed because it is too large
Load Diff
@@ -35,6 +35,8 @@
|
||||
#include "m_trademark.h"
|
||||
#include "zurumode.h"
|
||||
#include "m_scene_table.h"
|
||||
#include "m_player_lib.h"
|
||||
#include "m_skin_matrix.h"
|
||||
|
||||
u16 S_back_title_timer;
|
||||
u16 S_se_endcheck_timeout;
|
||||
|
||||
+11
-11
@@ -17,8 +17,8 @@ void Player_actor_draw_call(ACTOR* actor, GAME* game);
|
||||
ACTOR_PROFILE Player_Profile = {
|
||||
mAc_PROFILE_PLAYER,
|
||||
ACTOR_PART_PLAYER,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_26 | ACTOR_STATE_25 |
|
||||
ACTOR_STATE_NO_MOVE_WHILE_CULLED | ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_2 | ACTOR_STATE_0,
|
||||
ACTOR_STATE_CAN_MOVE_IN_DEMO_SCENES | ACTOR_STATE_26 | ACTOR_STATE_25 | ACTOR_STATE_NO_MOVE_WHILE_CULLED |
|
||||
ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_2 | ACTOR_STATE_0,
|
||||
EMPTY_NO,
|
||||
ACTOR_OBJ_BANK_KEEP,
|
||||
sizeof(PLAYER_ACTOR),
|
||||
@@ -29,16 +29,16 @@ ACTOR_PROFILE Player_Profile = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
void initfunc(GAME_PLAY* play){
|
||||
static void initfunc(GAME_PLAY* play) {
|
||||
Submenu* submenu = &play->submenu;
|
||||
|
||||
Player_actor_ct_func = mSM_ovlptr_dllcnv(&Player_actor_ct, submenu , 1);
|
||||
Player_actor_ct_func = mSM_ovlptr_dllcnv(&Player_actor_ct, submenu, 1);
|
||||
Player_actor_dt_func = mSM_ovlptr_dllcnv(&Player_actor_dt, submenu, 1);
|
||||
Player_actor_move_func = mSM_ovlptr_dllcnv(&Player_actor_move, submenu,1);
|
||||
Player_actor_draw_func = mSM_ovlptr_dllcnv(&Player_actor_draw, submenu,1);
|
||||
Player_actor_move_func = mSM_ovlptr_dllcnv(&Player_actor_move, submenu, 1);
|
||||
Player_actor_draw_func = mSM_ovlptr_dllcnv(&Player_actor_draw, submenu, 1);
|
||||
}
|
||||
|
||||
static void Player_actor_ct_call(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_ct_call(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
load_player(&play->submenu);
|
||||
@@ -46,21 +46,21 @@ static void Player_actor_ct_call(ACTOR* actor, GAME* game){
|
||||
Player_actor_ct_func(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_dt_call(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_dt_call(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
load_player(&play->submenu);
|
||||
Player_actor_dt_func(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_move_call(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_move_call(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
|
||||
load_player(&play->submenu);
|
||||
Player_actor_move_func(actor, game);
|
||||
}
|
||||
|
||||
static void Player_actor_draw_call(ACTOR* actor, GAME* game){
|
||||
static void Player_actor_draw_call(ACTOR* actor, GAME* game) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
|
||||
load_player(&play->submenu);
|
||||
|
||||
+340
-316
@@ -2,455 +2,479 @@
|
||||
|
||||
#include "gfxalloc.h"
|
||||
#include "libu64/u64types.h"
|
||||
#include "jsyswrap.h"
|
||||
#include "m_font.h"
|
||||
|
||||
#define G_CC_POLY_Z_LIGHT_PRIM PRIMITIVE, 0, SHADE, 0, 0, 0, 0, PRIMITIVE
|
||||
#define G_CC_MODULATEIDECALA_PRIM2 PRIMITIVE, 0, COMBINED, 0, 0, 0, 0, COMBINED
|
||||
#define G_CC_PRIMLERP 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIM_LOD_FRAC, 0
|
||||
|
||||
static Gfx z_gsCPModeSet_Data[15][6] = {
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_POLY_Z_LIGHT_PRIM, G_CC_POLY_Z_LIGHT_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_ZB_CLD_SURF | G_RM_ZB_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_AA_TEX_EDGE | G_RM_AA_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_XLU_SURF | G_RM_ZB_XLU_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_PASS2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_PASS | G_RM_ZB_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA | CVG_X_ALPHA | ALPHA_CVG_SEL | G_RM_FOG_SHADE_A | GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_PRIMLERP, G_CC_PASS2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_ZB_OVL_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
}
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_POLY_Z_LIGHT_PRIM, G_CC_POLY_Z_LIGHT_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_XLU_SURF | G_RM_AA_ZB_XLU_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_ZB_CLD_SURF | G_RM_ZB_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_OPA_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_AA_ZB_OPA_SURF | G_RM_AA_ZB_OPA_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA_PRIM, G_CC_MODULATEIDECALA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_AA_TEX_EDGE | G_RM_AA_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEI_PRIM, G_CC_MODULATEI_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_ZB_XLU_SURF | G_RM_ZB_XLU_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_1CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_SHADE | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIA_PRIM, G_CC_PASS2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_PASS | G_RM_ZB_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | AA_EN | Z_CMP | Z_UPD | IM_RD | CVG_DST_FULL | ZMODE_OPA |
|
||||
CVG_X_ALPHA | ALPHA_CVG_SEL | G_RM_FOG_SHADE_A |
|
||||
GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_A_MEM)),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_AA_ZB_TEX_EDGE2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA_PRIM2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_RGBA16 |
|
||||
G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_CLD_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
},
|
||||
{
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_ON),
|
||||
gsDPSetCombineMode(G_CC_PRIMLERP, G_CC_PASS2),
|
||||
gsDPSetOtherMode(G_AD_NOTPATTERN | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_2CYCLE | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_FOG_SHADE_A | G_RM_ZB_OVL_SURF2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_FOG | G_SHADING_SMOOTH),
|
||||
gsSPEndDisplayList(),
|
||||
}
|
||||
};
|
||||
|
||||
Gfx RSP_RDP_clear_data[12] = {
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 640, 480),
|
||||
gsDPSetBlendColor(0x00, 0x00, 0x00, 0x08),
|
||||
gsSPClipRatio(FRUSTRATIO_2),
|
||||
gsSPEndDisplayList(),
|
||||
gsDPPipeSync(),
|
||||
gsSPTexture(65535, 65535, 0, 0, G_OFF),
|
||||
gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_PERSP | G_CYC_FILL | G_PM_NPRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsSPLoadGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BACK | G_LIGHTING | G_SHADING_SMOOTH),
|
||||
gsDPSetScissor(G_SC_NON_INTERLACE, 0, 0, 640, 480),
|
||||
gsDPSetBlendColor(0x00, 0x00, 0x00, 0x08),
|
||||
gsSPClipRatio(FRUSTRATIO_2),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
int fbdemo_mode;
|
||||
|
||||
extern void gfx_set_fog_position(Gfx** gfxp, int near, int far) {
|
||||
Gfx* gfx;
|
||||
Gfx* gfx;
|
||||
|
||||
if (near == far) {
|
||||
if (near == far) {
|
||||
gfx = (*gfxp)++;
|
||||
gSPFogPosition(gfx++, 0, 10000000);
|
||||
return;
|
||||
}
|
||||
gfx = (*gfxp)++;
|
||||
gSPFogPosition(gfx++, 0, 10000000);
|
||||
return;
|
||||
}
|
||||
gfx = (*gfxp)++;
|
||||
gSPFogPosition(gfx++, near, far);
|
||||
gSPFogPosition(gfx++, near, far);
|
||||
}
|
||||
|
||||
extern Gfx* gfx_set_fog_nosync(Gfx* gfx, int r, int g, int b, int a, int near,
|
||||
int far) {
|
||||
gDPSetFogColor(gfx++, r, g, b, a);
|
||||
gfx_set_fog_position(&gfx, near, far);
|
||||
extern Gfx* gfx_set_fog_nosync(Gfx* gfx, int r, int g, int b, int a, int near, int far) {
|
||||
gDPSetFogColor(gfx++, r, g, b, a);
|
||||
gfx_set_fog_position(&gfx, near, far);
|
||||
|
||||
return gfx;
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern void texture_z_light_prim_xlu_disp(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim_bg(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_BG_OPA_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_BG_OPA_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim_shadow(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_SHADOW_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_SHADOW_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim_xlu(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim_light(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_LIGHT_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_LIGHT_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void _texture_z_light_fog_prim_npc(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[10]);
|
||||
gDPPipeSync(NOW_POLY_OPA_DISP++);
|
||||
gDPSetPrimColor(NOW_POLY_OPA_DISP++, 0, 128, 255, 255, 255, 255);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[10]);
|
||||
gDPPipeSync(NOW_POLY_OPA_DISP++);
|
||||
gDPSetPrimColor(NOW_POLY_OPA_DISP++, 0, 128, 255, 255, 255, 255);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern Gfx* texture_z_light_fog_prim_bb_pal_opa(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[12]);
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[12]);
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
|
||||
return gfx;
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* texture_z_light_fog_prim_bb_pal_xlu(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[13]);
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[13]);
|
||||
gDPSetPrimColor(gfx++, 0, 128, 255, 255, 255, 255);
|
||||
|
||||
return gfx;
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* texture_z_fog_lod_alpha_shadow(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[14]);
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[14]);
|
||||
|
||||
return gfx;
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* gfx_rect_moji(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[4]);
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[4]);
|
||||
|
||||
return gfx;
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern void rect_moji(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[4]);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, z_gsCPModeSet_Data[4]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void polygon_z_light_prim(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[0]);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[0]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern void softsprite_prim(GRAPH* graph) {
|
||||
OPEN_DISP(graph);
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[6]);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, z_gsCPModeSet_Data[6]);
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
}
|
||||
|
||||
extern Gfx* gfx_softsprite_prim_xlu(Gfx* gfx) {
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[8]);
|
||||
gDPSetColorDither(gfx++, G_CD_DISABLE);
|
||||
gSPDisplayList(gfx++, z_gsCPModeSet_Data[8]);
|
||||
gDPSetColorDither(gfx++, G_CD_DISABLE);
|
||||
|
||||
return gfx++;
|
||||
return gfx++;
|
||||
}
|
||||
|
||||
extern Gfx* gfx_tex_scroll2(Gfx** gfxpp, int x, int y, int width, int height) {
|
||||
Gfx* dl = gfxalloc(gfxpp, 3 * sizeof(Gfx));
|
||||
Gfx* dl = gfxalloc(gfxpp, 3 * sizeof(Gfx));
|
||||
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, G_TX_RENDERTILE, x, y, x + ((width - 1) << 2),
|
||||
y + ((height - 1) << 2));
|
||||
gSPEndDisplayList(dl + 2);
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, G_TX_RENDERTILE, x, y, x + ((width - 1) << 2), y + ((height - 1) << 2));
|
||||
gSPEndDisplayList(dl + 2);
|
||||
}
|
||||
|
||||
extern Gfx* tex_scroll2(GRAPH* graph, u32 x, u32 y, int width, int height) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 3);
|
||||
if (dl != NULL) {
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, G_TX_RENDERTILE, x & 0x7FF, y & 0x7FF,
|
||||
((x & 0x7FF) + ((width - 1) << 2)),
|
||||
((y & 0x7FF) + ((height - 1) << 2)));
|
||||
gSPEndDisplayList(dl + 2);
|
||||
}
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 3);
|
||||
if (dl != NULL) {
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, G_TX_RENDERTILE, x & 0x7FF, y & 0x7FF, ((x & 0x7FF) + ((width - 1) << 2)),
|
||||
((y & 0x7FF) + ((height - 1) << 2)));
|
||||
gSPEndDisplayList(dl + 2);
|
||||
}
|
||||
|
||||
return dl;
|
||||
return dl;
|
||||
}
|
||||
|
||||
extern Gfx* tex_scroll2_dolphin(GRAPH* graph, int x, int y, int width, int height) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 2);
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 2);
|
||||
|
||||
if (dl != NULL) {
|
||||
gDPSetTileSize_Dolphin(dl, 0, x << 1, y << 1, width, height);
|
||||
gSPEndDisplayList(dl + 1);
|
||||
}
|
||||
if (dl != NULL) {
|
||||
gDPSetTileSize_Dolphin(dl, 0, x << 1, y << 1, width, height);
|
||||
gSPEndDisplayList(dl + 1);
|
||||
}
|
||||
|
||||
return dl;
|
||||
return dl;
|
||||
}
|
||||
|
||||
extern Gfx* two_tex_scroll(GRAPH* graph, int tile1, int x1, int y1, int width1,
|
||||
int height1, int tile2, int x2, int y2, int width2,
|
||||
int height2) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 5);
|
||||
extern Gfx* two_tex_scroll(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2, int y2,
|
||||
int width2, int height2) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 5);
|
||||
|
||||
if (dl != NULL) {
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, tile1, x1 & 0x7FF, y1 & 0x7FF,
|
||||
(x1 & 0x7FF) + ((width1 - 1) << 2),
|
||||
(y1 & 0x7FF) + ((height1 - 1) << 2));
|
||||
gDPTileSync(dl + 2);
|
||||
gDPSetTileSize(dl + 3, tile2, x2 & 0x7FF, y2 & 0x7FF,
|
||||
(x2 & 0x7FF) + ((width2 - 1) << 2),
|
||||
(y2 & 0x7FF) + ((height2 - 1) << 2));
|
||||
gSPEndDisplayList(dl + 4);
|
||||
}
|
||||
if (dl != NULL) {
|
||||
gDPTileSync(dl);
|
||||
gDPSetTileSize(dl + 1, tile1, x1 & 0x7FF, y1 & 0x7FF, (x1 & 0x7FF) + ((width1 - 1) << 2),
|
||||
(y1 & 0x7FF) + ((height1 - 1) << 2));
|
||||
gDPTileSync(dl + 2);
|
||||
gDPSetTileSize(dl + 3, tile2, x2 & 0x7FF, y2 & 0x7FF, (x2 & 0x7FF) + ((width2 - 1) << 2),
|
||||
(y2 & 0x7FF) + ((height2 - 1) << 2));
|
||||
gSPEndDisplayList(dl + 4);
|
||||
}
|
||||
|
||||
return dl;
|
||||
return dl;
|
||||
}
|
||||
|
||||
extern Gfx* two_tex_scroll_dolphin(GRAPH* graph, int tile1, int x1, int y1, int width1,
|
||||
int height1, int tile2, int x2, int y2, int width2,
|
||||
int height2) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 3);
|
||||
extern Gfx* two_tex_scroll_dolphin(GRAPH* graph, int tile1, int x1, int y1, int width1, int height1, int tile2, int x2,
|
||||
int y2, int width2, int height2) {
|
||||
Gfx* dl = GRAPH_ALLOC_TYPE(graph, Gfx, 3);
|
||||
|
||||
if (dl != NULL) {
|
||||
gDPSetTileSize_Dolphin(dl, tile1, x1 << 1, y1 << 1, width1, height1);
|
||||
gDPSetTileSize_Dolphin(dl + 1, tile2, x2 << 1, y2 << 1, width2, height2);
|
||||
gSPEndDisplayList(dl + 2);
|
||||
}
|
||||
if (dl != NULL) {
|
||||
gDPSetTileSize_Dolphin(dl, tile1, x1 << 1, y1 << 1, width1, height1);
|
||||
gDPSetTileSize_Dolphin(dl + 1, tile2, x2 << 1, y2 << 1, width2, height2);
|
||||
gSPEndDisplayList(dl + 2);
|
||||
}
|
||||
|
||||
return dl;
|
||||
return dl;
|
||||
}
|
||||
|
||||
extern void DisplayList_initialize(GRAPH* graph, u32 clear_r, u32 clear_g,
|
||||
u32 clear_b, GAME* game) {
|
||||
OPEN_DISP(graph);
|
||||
extern void DisplayList_initialize(GRAPH* graph, u8 clear_r, u8 clear_g, u8 clear_b, GAME* game) {
|
||||
OPEN_DISP(graph);
|
||||
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_FONT_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_BG_OPA_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_BG_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_SHADOW_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_LIGHT_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_POLY_OPA_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_POLY_XLU_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_OVERLAY_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_FONT_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_BG_OPA_DISP++, RSP_RDP_clear_data);
|
||||
gSPDisplayList(NOW_BG_XLU_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_SHADOW_DISP++, z_gsCPModeSet_Data[2]);
|
||||
gSPDisplayList(NOW_LIGHT_DISP++, z_gsCPModeSet_Data[2]);
|
||||
|
||||
gDPSetScissor(NOW_POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_POLY_XLU_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_OVERLAY_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_FONT_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_SHADOW_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_LIGHT_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_BG_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_BG_XLU_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_POLY_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_POLY_XLU_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_OVERLAY_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_FONT_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_SHADOW_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_LIGHT_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_BG_OPA_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
gDPSetScissor(NOW_BG_XLU_DISP++, G_SC_NON_INTERLACE, 0, 0, 640, 480);
|
||||
|
||||
if (((game == NULL) || (fbdemo_mode < 2)) &&
|
||||
(JW_setClearColor(clear_r, clear_g, clear_b))) {
|
||||
gDPSetCycleType(NOW_POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(NOW_POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(NOW_POLY_OPA_DISP++,
|
||||
(GPACK_RGBA5551(clear_r, clear_g, clear_b, 1) << 16) |
|
||||
GPACK_RGBA5551(clear_r, clear_g, clear_b, 1));
|
||||
gDPFillRectangle(NOW_POLY_OPA_DISP++, 0, 0, 639, 479);
|
||||
gDPPipeSync(NOW_POLY_OPA_DISP++);
|
||||
}
|
||||
if (((game == NULL) || (fbdemo_mode < 2)) && (JW_setClearColor(clear_r, clear_g, clear_b))) {
|
||||
gDPSetCycleType(NOW_POLY_OPA_DISP++, G_CYC_FILL);
|
||||
gDPSetRenderMode(NOW_POLY_OPA_DISP++, G_RM_NOOP, G_RM_NOOP2);
|
||||
gDPSetFillColor(NOW_POLY_OPA_DISP++, (GPACK_RGBA5551(clear_r, clear_g, clear_b, 1) << 16) |
|
||||
GPACK_RGBA5551(clear_r, clear_g, clear_b, 1));
|
||||
gDPFillRectangle(NOW_POLY_OPA_DISP++, 0, 0, 639, 479);
|
||||
gDPPipeSync(NOW_POLY_OPA_DISP++);
|
||||
}
|
||||
|
||||
CLOSE_DISP(graph);
|
||||
CLOSE_DISP(graph);
|
||||
|
||||
mFont_Main_start(graph);
|
||||
mFont_Main_start(graph);
|
||||
}
|
||||
|
||||
extern void fade_rgba8888_draw(Gfx** gfxp, u32 color) {
|
||||
static Gfx fade_gfx[6] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT |
|
||||
G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
|
||||
gsDPFillRectangle(0, 0, 640, 480),
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
static Gfx fade_gfx[6] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_CLD_SURF | G_RM_CLD_SURF2),
|
||||
gsDPSetCombineMode(G_CC_PRIMITIVE, G_CC_PRIMITIVE),
|
||||
gsDPFillRectangle(0, 0, 640, 480),
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
static Gfx fill_gfx[5] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT |
|
||||
G_TF_BILERP | G_TT_NONE | G_TL_TILE | G_TD_CLAMP |
|
||||
G_TP_NONE | G_CYC_FILL | G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsDPFillRectangle(0, 0, 639, 479),
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
static Gfx fill_gfx[5] = {
|
||||
gsDPPipeSync(),
|
||||
gsDPSetOtherMode(G_AD_DISABLE | G_CD_MAGICSQ | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_NONE | G_TL_TILE |
|
||||
G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_1PRIMITIVE,
|
||||
G_AC_NONE | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2),
|
||||
gsDPFillRectangle(0, 0, 639, 479),
|
||||
gsDPPipeSync(),
|
||||
gsSPEndDisplayList(),
|
||||
};
|
||||
|
||||
Gfx* gfx;
|
||||
Gfx* gfx;
|
||||
|
||||
if ((color & 0xFF) == 255) {
|
||||
u32 r = ((color >> 16) & 0xF800);
|
||||
u32 g = ((color >> 13) & 0x7FFC0);
|
||||
u32 b = (color >> 10) & 0x7FFFFF;
|
||||
u32 c = ((r | g | b | 1));
|
||||
u32 f = c | ((c & 0xFFFF) << 16);
|
||||
if ((color & 0xFF) == 255) {
|
||||
u32 r = ((color >> 16) & 0xF800);
|
||||
u32 g = ((color >> 13) & 0x7FFC0);
|
||||
u32 b = (color >> 10) & 0x7FFFFF;
|
||||
u32 c = ((r | g | b | 1));
|
||||
u32 f = c | ((c & 0xFFFF) << 16);
|
||||
|
||||
gfx = *gfxp;
|
||||
gDPSetFillColor(gfx, f);
|
||||
gSPDisplayList(gfx + 1, fill_gfx);
|
||||
*gfxp = gfx + 2;
|
||||
} else if ((color & 0xFF) != 0) {
|
||||
gfx = *gfxp;
|
||||
gDPSetColor(gfx, G_SETPRIMCOLOR, color);
|
||||
gSPDisplayList(gfx + 1, fade_gfx);
|
||||
*gfxp = gfx + 2;
|
||||
}
|
||||
gfx = *gfxp;
|
||||
gDPSetFillColor(gfx, f);
|
||||
gSPDisplayList(gfx + 1, fill_gfx);
|
||||
*gfxp = gfx + 2;
|
||||
} else if ((color & 0xFF) != 0) {
|
||||
gfx = *gfxp;
|
||||
gDPSetColor(gfx, G_SETPRIMCOLOR, color);
|
||||
gSPDisplayList(gfx + 1, fade_gfx);
|
||||
*gfxp = gfx + 2;
|
||||
}
|
||||
}
|
||||
|
||||
extern void fade_black_draw(Gfx** gfx, u32 color) { fade_rgba8888_draw(gfx, color); }
|
||||
extern void fade_black_draw(Gfx** gfx, u32 color) {
|
||||
fade_rgba8888_draw(gfx, color);
|
||||
}
|
||||
|
||||
extern Gfx* gfx_gDPFillRectangle1(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry) {
|
||||
gDPFillRectangle(gfx++, ulx << 1, uly << 1, lrx << 1, lry << 1);
|
||||
return gfx;
|
||||
gDPFillRectangle(gfx++, ulx << 1, uly << 1, lrx << 1, lry << 1);
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* gfx_gDPFillRectangleF(Gfx* gfx, u32 ulx, u32 uly, u32 lrx, u32 lry) {
|
||||
gDPFillRectangle(gfx++, ulx << 1, uly << 1, (lrx << 1) - 1, (lry << 1) - 1);
|
||||
return gfx;
|
||||
gDPFillRectangle(gfx++, ulx << 1, uly << 1, (lrx << 1) - 1, (lry << 1) - 1);
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh,
|
||||
int tile, int s, int t, int dsdx, int dtdy) {
|
||||
gSPTextureRectangle(gfx++, xl << 1, yl << 1, xh << 1, yh << 1, tile, s, t,
|
||||
dsdx >> 1, dtdy >> 1);
|
||||
return gfx;
|
||||
extern Gfx* gfx_gSPTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx,
|
||||
int dtdy) {
|
||||
gSPTextureRectangle(gfx++, xl << 1, yl << 1, xh << 1, yh << 1, tile, s, t, dsdx >> 1, dtdy >> 1);
|
||||
return gfx;
|
||||
}
|
||||
|
||||
extern Gfx* gfx_gSPScisTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh,
|
||||
int tile, int s, int t, int dsdx, int dtdy) {
|
||||
gSPScisTextureRectangle(gfx++, (s16)(xl << 1), (s16)(yl << 1), xh << 1,
|
||||
yh << 1, tile, s, t, dsdx >> 1, dtdy >> 1);
|
||||
return gfx;
|
||||
extern Gfx* gfx_gSPScisTextureRectangle1(Gfx* gfx, int xl, int yl, int xh, int yh, int tile, int s, int t, int dsdx,
|
||||
int dtdy) {
|
||||
gSPScisTextureRectangle(gfx++, (s16)(xl << 1), (s16)(yl << 1), xh << 1, yh << 1, tile, s, t, dsdx >> 1, dtdy >> 1);
|
||||
return gfx;
|
||||
}
|
||||
|
||||
+372
-386
@@ -23,503 +23,489 @@
|
||||
#include "m_notice.h"
|
||||
#include "m_event.h"
|
||||
#include "m_common_data.h"
|
||||
#include "m_design_ovl.h"
|
||||
|
||||
static void famicom_emu_initial_common_data() {
|
||||
// stubbed
|
||||
// stubbed
|
||||
}
|
||||
|
||||
static void decide_fruit(mActor_name_t* fruit_p) {
|
||||
*fruit_p = RANDOM(mAGrw_FRUIT_NUM) | ITM_FOOD_START;
|
||||
*fruit_p = RANDOM(mAGrw_FRUIT_NUM) | ITM_FOOD_START;
|
||||
}
|
||||
|
||||
static void decide_fish_location(u8* location) {
|
||||
*location = RANDOM(3);
|
||||
*location = RANDOM(3);
|
||||
}
|
||||
|
||||
static void title_game_haniwa_data_init() {
|
||||
static int haniwa_msg[4] = { mString_HANIWA_MSG0, mString_HANIWA_MSG1, mString_HANIWA_MSG2, mString_HANIWA_MSG3 };
|
||||
u8 haniwa_buf[HANIWA_MESSAGE_LEN];
|
||||
static int haniwa_msg[4] = { mString_HANIWA_MSG0, mString_HANIWA_MSG1, mString_HANIWA_MSG2, mString_HANIWA_MSG3 };
|
||||
u8 haniwa_buf[HANIWA_MESSAGE_LEN];
|
||||
|
||||
int line_len;
|
||||
int haniwa_msg_len;
|
||||
int i;
|
||||
u8* dst;
|
||||
int line_len;
|
||||
int haniwa_msg_len;
|
||||
int i;
|
||||
u8* dst;
|
||||
|
||||
/* Load message line-by-line */
|
||||
dst = haniwa_buf;
|
||||
haniwa_msg_len = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
/* Load message line-by-line */
|
||||
dst = haniwa_buf;
|
||||
haniwa_msg_len = 0;
|
||||
for (i = 0; i < 4; i++) {
|
||||
|
||||
mString_Load_StringFromRom(dst, HANIWA_MESSAGE_LEN - haniwa_msg_len, haniwa_msg[i]);
|
||||
line_len = mMl_strlen(dst, HANIWA_MESSAGE_LEN - haniwa_msg_len, CHAR_SPACE);
|
||||
mString_Load_StringFromRom(dst, HANIWA_MESSAGE_LEN - haniwa_msg_len, haniwa_msg[i]);
|
||||
line_len = mMl_strlen(dst, HANIWA_MESSAGE_LEN - haniwa_msg_len, CHAR_SPACE);
|
||||
|
||||
if (i < 3) {
|
||||
dst[line_len] = CHAR_NEW_LINE;
|
||||
haniwa_msg_len += line_len + 1;
|
||||
dst += line_len + 1;
|
||||
if (i < 3) {
|
||||
dst[line_len] = CHAR_NEW_LINE;
|
||||
haniwa_msg_len += line_len + 1;
|
||||
dst += line_len + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < mHS_HOUSE_NUM; i++) {
|
||||
Haniwa_c* haniwa = &Save_Get(homes + i)->haniwa;
|
||||
mHm_hs_c* house = Save_Get(homes + i);
|
||||
int j;
|
||||
for (i = 0; i < mHS_HOUSE_NUM; i++) {
|
||||
Haniwa_c* haniwa = &Save_Get(homes + i)->haniwa;
|
||||
mHm_hs_c* house = Save_Get(homes + i);
|
||||
int j;
|
||||
|
||||
/* Copy default message */
|
||||
mem_copy(house->haniwa.message, haniwa_buf, HANIWA_MESSAGE_LEN);
|
||||
|
||||
/* Clear held items */
|
||||
for (j = 0; j < HANIWA_ITEM_HOLD_NUM; j++) {
|
||||
haniwa->items[j].item = EMPTY_NO;
|
||||
/* Copy default message */
|
||||
mem_copy(house->haniwa.message, haniwa_buf, HANIWA_MESSAGE_LEN);
|
||||
|
||||
/* Clear held items */
|
||||
for (j = 0; j < HANIWA_ITEM_HOLD_NUM; j++) {
|
||||
haniwa->items[j].item = EMPTY_NO;
|
||||
}
|
||||
|
||||
haniwa->bells = 0;
|
||||
}
|
||||
|
||||
haniwa->bells = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static void mSDI_ClearMoneyPlayerHomeStationBlock() {
|
||||
static int block_num[2][2] = {
|
||||
{ 2, 1 }, /* Player home */
|
||||
{ 2, 0 } /* Station */
|
||||
};
|
||||
static int block_num[2][2] = {
|
||||
{ 2, 1 }, /* Player home */
|
||||
{ 2, 0 } /* Station */
|
||||
};
|
||||
|
||||
int block_z;
|
||||
int block_x;
|
||||
mActor_name_t* items;
|
||||
u16* deposit;
|
||||
int ut_x;
|
||||
int ut_z;
|
||||
mActor_name_t item;
|
||||
int i;
|
||||
int block_z;
|
||||
int block_x;
|
||||
mActor_name_t* items;
|
||||
u16* deposit;
|
||||
int ut_x;
|
||||
int ut_z;
|
||||
mActor_name_t item;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 2; i++) {
|
||||
block_z = block_num[i][1];
|
||||
block_x = block_num[i][0];
|
||||
for (i = 0; i < 2; i++) {
|
||||
block_z = block_num[i][1];
|
||||
block_x = block_num[i][0];
|
||||
|
||||
items = Save_Get(fg[block_z][block_x]).items[0];
|
||||
deposit = Save_Get(deposit[block_z * FG_BLOCK_X_NUM + block_x]);
|
||||
items = Save_Get(fg[block_z][block_x]).items[0];
|
||||
deposit = Save_Get(deposit[block_z * FG_BLOCK_X_NUM + block_x]);
|
||||
|
||||
if (items != NULL) {
|
||||
for (ut_z = 0; ut_z < UT_Z_NUM; ut_z++) {
|
||||
for (ut_x = 0; ut_x < UT_X_NUM; ut_x++) {
|
||||
item = *items;
|
||||
if (items != NULL) {
|
||||
for (ut_z = 0; ut_z < UT_Z_NUM; ut_z++) {
|
||||
for (ut_x = 0; ut_x < UT_X_NUM; ut_x++) {
|
||||
item = *items;
|
||||
|
||||
if (item >= ITM_MONEY_START && item <= ITM_MONEY_END) {
|
||||
mPB_keep_item(item);
|
||||
*items = EMPTY_NO;
|
||||
if (item >= ITM_MONEY_START && item <= ITM_MONEY_END) {
|
||||
mPB_keep_item(item);
|
||||
*items = EMPTY_NO;
|
||||
|
||||
if (deposit != NULL) {
|
||||
mFI_BlockDepositOFF(deposit, ut_x, ut_z);
|
||||
if (deposit != NULL) {
|
||||
mFI_BlockDepositOFF(deposit, ut_x, ut_z);
|
||||
}
|
||||
}
|
||||
|
||||
items++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
items++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void mSDI_PullTreeUT(mActor_name_t* item_p) {
|
||||
mActor_name_t item = *item_p;
|
||||
mActor_name_t item = *item_p;
|
||||
|
||||
if (
|
||||
(item >= TREE_SAPLING && item <= TREE_30000BELLS) ||
|
||||
(item >= TREE_100BELLS_SAPLING && item <= TREE_PALM_FRUIT) ||
|
||||
(item >= CEDAR_TREE_SAPLING && item <= CEDAR_TREE) ||
|
||||
(item >= GOLD_TREE_SAPLING && item <= GOLD_TREE)
|
||||
) {
|
||||
*item_p = EMPTY_NO;
|
||||
}
|
||||
if ((item >= TREE_SAPLING && item <= TREE_30000BELLS) ||
|
||||
(item >= TREE_100BELLS_SAPLING && item <= TREE_PALM_FRUIT) ||
|
||||
(item >= CEDAR_TREE_SAPLING && item <= CEDAR_TREE) || (item >= GOLD_TREE_SAPLING && item <= GOLD_TREE)) {
|
||||
*item_p = EMPTY_NO;
|
||||
}
|
||||
}
|
||||
|
||||
static void mSDI_PullTreeBlock(mActor_name_t* items_p, int ut) {
|
||||
int i;
|
||||
for (i = ut; i < UT_TOTAL_NUM; i += UT_X_NUM) {
|
||||
mSDI_PullTreeUT(&items_p[i]);
|
||||
}
|
||||
int i;
|
||||
for (i = ut; i < UT_TOTAL_NUM; i += UT_X_NUM) {
|
||||
mSDI_PullTreeUT(&items_p[i]);
|
||||
}
|
||||
}
|
||||
|
||||
static void mSDI_PullTree() {
|
||||
mFM_fg_c* fg_block;
|
||||
int block_z;
|
||||
mFM_fg_c* fg_block;
|
||||
int block_z;
|
||||
|
||||
for (block_z = 0; block_z < FG_BLOCK_Z_NUM; block_z++) {
|
||||
/* Clear trees against the cliffs on the left and right town cliff borders */
|
||||
fg_block = Save_GetPointer(fg[block_z][0]);
|
||||
mSDI_PullTreeBlock(fg_block->items[0], 0);
|
||||
mSDI_PullTreeBlock((fg_block + FG_BLOCK_X_NUM - 1)->items[0], UT_X_NUM - 1);
|
||||
}
|
||||
for (block_z = 0; block_z < FG_BLOCK_Z_NUM; block_z++) {
|
||||
/* Clear trees against the cliffs on the left and right town cliff borders */
|
||||
fg_block = Save_GetPointer(fg[block_z][0]);
|
||||
mSDI_PullTreeBlock(fg_block->items[0], 0);
|
||||
mSDI_PullTreeBlock((fg_block + FG_BLOCK_X_NUM - 1)->items[0], UT_X_NUM - 1);
|
||||
}
|
||||
}
|
||||
|
||||
static void mSDI_PullTreeUnderPlayerBlock() {
|
||||
/**
|
||||
* Cleared tree diagram
|
||||
*
|
||||
* -------xx-------
|
||||
* -------xx-------
|
||||
* ----------------
|
||||
* ...
|
||||
**/
|
||||
/**
|
||||
* Cleared tree diagram
|
||||
*
|
||||
* -------xx-------
|
||||
* -------xx-------
|
||||
* ----------------
|
||||
* ...
|
||||
**/
|
||||
|
||||
mActor_name_t* items = &Save_Get(fg[2][2].items[0][0]);
|
||||
if (items != NULL) {
|
||||
mSDI_PullTreeUT(&items[7]);
|
||||
mSDI_PullTreeUT(&items[8]);
|
||||
mSDI_PullTreeUT(&items[16 + 7]);
|
||||
mSDI_PullTreeUT(&items[16 + 8]);
|
||||
}
|
||||
mActor_name_t* items = &Save_Get(fg[2][2].items[0][0]);
|
||||
if (items != NULL) {
|
||||
mSDI_PullTreeUT(&items[7]);
|
||||
mSDI_PullTreeUT(&items[8]);
|
||||
mSDI_PullTreeUT(&items[16 + 7]);
|
||||
mSDI_PullTreeUT(&items[16 + 8]);
|
||||
}
|
||||
}
|
||||
|
||||
static int mSDI_StartInitNew(GAME* game, int player_no, int malloc_flag) {
|
||||
int town_day;
|
||||
Private_c* priv;
|
||||
int i;
|
||||
Private_c* priv_p;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
GAME* g = NULL;
|
||||
int town_day;
|
||||
Private_c* priv;
|
||||
int i;
|
||||
Private_c* priv_p;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
GAME* g = NULL;
|
||||
|
||||
Common_Set(scene_from_title_demo, SCENE_START_DEMO);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
osSyncPrintf("player no -- %d\n", player_no);
|
||||
Common_Set(player_no, player_no);
|
||||
Common_Set(scene_from_title_demo, SCENE_START_DEMO);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
osSyncPrintf("player no -- %d\n", player_no);
|
||||
Common_Set(player_no, player_no);
|
||||
|
||||
priv = Save_GetPointer(private[player_no]);
|
||||
Common_Set(now_private, priv);
|
||||
priv->gender = mPr_SEX_MALE;
|
||||
decide_fruit(Save_GetPointer(fruit));
|
||||
mFM_DecideBgTexIdx(Save_GetPointer(bg_tex_idx));
|
||||
mFAs_ClearGoodField();
|
||||
priv = Save_GetPointer(private[player_no]);
|
||||
Common_Set(now_private, priv);
|
||||
priv->gender = mPr_SEX_MALE;
|
||||
decide_fruit(Save_GetPointer(fruit));
|
||||
mFM_DecideBgTexIdx(Save_GetPointer(bg_tex_idx));
|
||||
mFAs_ClearGoodField();
|
||||
|
||||
if (malloc_flag == FALSE) {
|
||||
g = game;
|
||||
}
|
||||
if (malloc_flag == FALSE) {
|
||||
g = game;
|
||||
}
|
||||
|
||||
bzero(Save_Get(deposit), sizeof(Save_Get(deposit)));
|
||||
Save_Set(dust_flag, FALSE);
|
||||
bzero(Save_GetPointer(island), sizeof(Island_c));
|
||||
mFM_InitFgCombiSaveData(g);
|
||||
bzero(Save_Get(deposit), sizeof(Save_Get(deposit)));
|
||||
Save_Set(dust_flag, FALSE);
|
||||
bzero(Save_GetPointer(island), sizeof(Island_c));
|
||||
mFM_InitFgCombiSaveData(g);
|
||||
|
||||
/* Remove trees */
|
||||
mSDI_PullTree();
|
||||
mSDI_PullTreeUnderPlayerBlock();
|
||||
/* Remove trees */
|
||||
mSDI_PullTree();
|
||||
mSDI_PullTreeUnderPlayerBlock();
|
||||
|
||||
mFM_SetBlockKindLoadCombi(g);
|
||||
|
||||
/* Tree -> Fruit Tree */
|
||||
mAGrw_ChangeTree2FruitTree();
|
||||
|
||||
/* Tree -> Cedar Tree */
|
||||
mAGrw_ChangeTree2Cedar();
|
||||
mFM_SetBlockKindLoadCombi(g);
|
||||
|
||||
priv_p = Save_Get(private);
|
||||
/* Tree -> Fruit Tree */
|
||||
mAGrw_ChangeTree2FruitTree();
|
||||
|
||||
mMld_SetDefaultMelody();
|
||||
mLd_LandDataInit();
|
||||
mEv_ClearEventSaveInfo(Save_GetPointer(event_save_data));
|
||||
mEv_init(&play->event);
|
||||
mNpc_InitNpcAllInfo(malloc_flag);
|
||||
/* Tree -> Cedar Tree */
|
||||
mAGrw_ChangeTree2Cedar();
|
||||
|
||||
for (i = 0; i < PLAYER_NUM; i++) {
|
||||
mPr_ClearPrivateInfo(priv_p);
|
||||
priv_p = Save_Get(private);
|
||||
|
||||
Save_Get(homes[i]).outlook_pal = i;
|
||||
Save_Get(homes[i]).next_outlook_pal = i;
|
||||
bzero(&Save_Get(homes[i]).size_info, sizeof(mHm_rmsz_c));
|
||||
|
||||
mPr_ClearMotherMailInfo(&Save_Get(mother_mail[i]));
|
||||
priv_p++;
|
||||
}
|
||||
mMld_SetDefaultMelody();
|
||||
mLd_LandDataInit();
|
||||
mEv_ClearEventSaveInfo(Save_GetPointer(event_save_data));
|
||||
mEv_init(&play->event);
|
||||
mNpc_InitNpcAllInfo(malloc_flag);
|
||||
|
||||
mPr_InitPrivateInfo(priv_p - PLAYER_NUM + player_no);
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
title_game_haniwa_data_init();
|
||||
mPB_police_box_init(g);
|
||||
mSN_snowman_init(); //
|
||||
mHS_house_init();
|
||||
mGH_animal_return_init(); //
|
||||
mMC_mask_cat_init(); //
|
||||
mDE_maskcat_init(Save_GetPointer(mask_cat)); //
|
||||
|
||||
lbRTC_TimeCopy(Save_GetPointer(last_grow_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(treasure_buried_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(treasure_checked_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(saved_auto_nwrite_time), &mTM_rtcTime_clear_code);
|
||||
for (i = 0; i < PLAYER_NUM; i++) {
|
||||
mPr_ClearPrivateInfo(priv_p);
|
||||
|
||||
Save_Set(station_type, RANDOM(15));
|
||||
Save_Set(island.last_song_to_island, -1);
|
||||
Save_Set(island.last_song_from_island, -1);
|
||||
Save_Get(homes[i]).outlook_pal = i;
|
||||
Save_Get(homes[i]).next_outlook_pal = i;
|
||||
bzero(&Save_Get(homes[i]).size_info, sizeof(mHm_rmsz_c));
|
||||
|
||||
mPr_SetPossessionItem(Common_Get(now_private), 0, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
|
||||
|
||||
town_day = RANDOM(30) + 1; /* Initial spread is [1, 30] */
|
||||
if (town_day >= 4) {
|
||||
town_day++; /* Add an extra day so that 4th of July is never chosen, so [1, 3] U [5, 31] */
|
||||
}
|
||||
mPr_ClearMotherMailInfo(&Save_Get(mother_mail[i]));
|
||||
priv_p++;
|
||||
}
|
||||
|
||||
Save_Set(town_day, town_day);
|
||||
|
||||
mCkRh_InitGokiSaveData_AllRoom();
|
||||
|
||||
mNW_InitMyOriginal();
|
||||
mNW_InitNeedleworkData();
|
||||
mPr_InitPrivateInfo(priv_p - PLAYER_NUM + player_no);
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
title_game_haniwa_data_init();
|
||||
mPB_police_box_init(g);
|
||||
mSN_snowman_init(); //
|
||||
mHS_house_init();
|
||||
mGH_animal_return_init(); //
|
||||
mMC_mask_cat_init(); //
|
||||
mDE_maskcat_init(Save_GetPointer(mask_cat)); //
|
||||
|
||||
mEv_2nd_init(&play->event);
|
||||
lbRTC_TimeCopy(Save_GetPointer(last_grow_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(treasure_buried_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(treasure_checked_time), &mTM_rtcTime_clear_code);
|
||||
lbRTC_TimeCopy(Save_GetPointer(saved_auto_nwrite_time), &mTM_rtcTime_clear_code);
|
||||
|
||||
mISL_init(Save_GetPointer(island));
|
||||
Save_Set(station_type, RANDOM(15));
|
||||
Save_Set(island.last_song_to_island, -1);
|
||||
Save_Set(island.last_song_from_island, -1);
|
||||
|
||||
famicom_emu_initial_common_data();
|
||||
mPr_SetPossessionItem(Common_Get(now_private), 0, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
|
||||
|
||||
mRmTp_SetDefaultLightSwitchData(1); // TODO: lightswitch enum
|
||||
town_day = RANDOM(30) + 1; /* Initial spread is [1, 30] */
|
||||
if (town_day >= 4) {
|
||||
town_day++; /* Add an extra day so that 4th of July is never chosen, so [1, 3] U [5, 31] */
|
||||
}
|
||||
|
||||
mFI_PullTanukiPathTrees();
|
||||
Save_Set(town_day, town_day);
|
||||
|
||||
Common_Set(_2dbe1, 0);
|
||||
mCkRh_InitGokiSaveData_AllRoom();
|
||||
|
||||
return TRUE;
|
||||
mNW_InitMyOriginal();
|
||||
mNW_InitNeedleworkData();
|
||||
|
||||
mEv_2nd_init(&play->event);
|
||||
|
||||
mISL_init(Save_GetPointer(island));
|
||||
|
||||
famicom_emu_initial_common_data();
|
||||
|
||||
mRmTp_SetDefaultLightSwitchData(1); // TODO: lightswitch enum
|
||||
|
||||
mFI_PullTanukiPathTrees();
|
||||
|
||||
Common_Set(_2dbe1, 0);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static int mSDI_StartInitFrom(GAME* game, int player_no, int malloc_flag) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int res = FALSE;
|
||||
GAME* g = game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
int res = FALSE;
|
||||
GAME* g = game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
|
||||
if (malloc_flag) {
|
||||
g = NULL;
|
||||
}
|
||||
|
||||
Common_Set(scene_from_title_demo, SCENE_FG);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
Private_c* priv = Save_Get(private + player_no);
|
||||
|
||||
if (mPr_CheckPrivate(priv) == TRUE) {
|
||||
|
||||
if (priv->exists == TRUE) {
|
||||
Common_Set(now_private, priv);
|
||||
Common_Set(player_no, player_no);
|
||||
mFM_SetBlockKindLoadCombi(g); //
|
||||
mEv_init_force(&play->event); //
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g); //
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mMkRm_MarkRoom(g);
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
}
|
||||
else {
|
||||
/* Player loaded their player data while "out travelling" */
|
||||
Common_Set(player_decoy_flag, TRUE); // set "gyroid face" flag
|
||||
priv->exists = TRUE;
|
||||
Common_Set(now_private, priv);
|
||||
Common_Set(player_no, player_no);
|
||||
mFM_SetBlockKindLoadCombi(g); //
|
||||
mEv_init_force(&play->event); //
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g); //
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
|
||||
/* Punish player by deleting their pockets and some pending items */
|
||||
bzero(&priv->inventory.pockets, sizeof(priv->inventory.pockets));
|
||||
priv->inventory.lotto_ticket_expiry_month = 0;
|
||||
priv->inventory.lotto_ticket_mail_storage = 0;
|
||||
priv->inventory.item_conditions = 0;
|
||||
priv->inventory.wallet = 0;
|
||||
mQst_ClearDelivery(priv->deliveries, mPr_DELIVERY_QUEST_NUM); //
|
||||
mQst_ClearErrand(priv->errands, mPr_ERRAND_QUEST_NUM); //
|
||||
|
||||
mMkRm_MarkRoom(g);
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
}
|
||||
if (malloc_flag) {
|
||||
g = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
Common_Set(scene_from_title_demo, SCENE_FG);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
Private_c* priv = Save_Get(private + player_no);
|
||||
|
||||
if (mPr_CheckPrivate(priv) == TRUE) {
|
||||
|
||||
if (priv->exists == TRUE) {
|
||||
Common_Set(now_private, priv);
|
||||
Common_Set(player_no, player_no);
|
||||
mFM_SetBlockKindLoadCombi(g); //
|
||||
mEv_init_force(&play->event); //
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g); //
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mMkRm_MarkRoom(g);
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
} else {
|
||||
/* Player loaded their player data while "out travelling" */
|
||||
Common_Set(player_decoy_flag, TRUE); // set "gyroid face" flag
|
||||
priv->exists = TRUE;
|
||||
Common_Set(now_private, priv);
|
||||
Common_Set(player_no, player_no);
|
||||
mFM_SetBlockKindLoadCombi(g); //
|
||||
mEv_init_force(&play->event); //
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g); //
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
|
||||
/* Punish player by deleting their pockets and some pending items */
|
||||
bzero(&priv->inventory.pockets, sizeof(priv->inventory.pockets));
|
||||
priv->inventory.lotto_ticket_expiry_month = 0;
|
||||
priv->inventory.lotto_ticket_mail_storage = 0;
|
||||
priv->inventory.item_conditions = 0;
|
||||
priv->inventory.wallet = 0;
|
||||
mQst_ClearDelivery(priv->deliveries, mPr_DELIVERY_QUEST_NUM); //
|
||||
mQst_ClearErrand(priv->errands, mPr_ERRAND_QUEST_NUM); //
|
||||
|
||||
mMkRm_MarkRoom(g);
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int mSDI_StartInitNewPlayer(GAME* game, int player_no, int malloc_flag) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
int res = FALSE;
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
int res = FALSE;
|
||||
|
||||
Common_Set(scene_from_title_demo, SCENE_START_DEMO2);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
Common_Set(scene_from_title_demo, SCENE_START_DEMO2);
|
||||
lbRTC_GetTime(Common_GetPointer(time.rtc_time));
|
||||
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
Private_c* priv = Save_Get(private + player_no);
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
Private_c* priv = Save_Get(private + player_no);
|
||||
|
||||
if (mPr_CheckPrivate(priv) != TRUE) {
|
||||
mPr_InitPrivateInfo(priv);
|
||||
Common_Set(now_private, priv);
|
||||
mPr_SetPossessionItem(priv, 0, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
|
||||
Common_Set(player_no, player_no);
|
||||
Common_Get(now_private)->gender = mPr_SEX_MALE;
|
||||
mNW_InitOneMyOriginal(Common_Get(player_no));
|
||||
mCkRh_InitGokiSaveData_InitNewPlayer();
|
||||
if (mPr_CheckPrivate(priv) != TRUE) {
|
||||
mPr_InitPrivateInfo(priv);
|
||||
Common_Set(now_private, priv);
|
||||
mPr_SetPossessionItem(priv, 0, ITM_MONEY_1000, mPr_ITEM_COND_QUEST);
|
||||
Common_Set(player_no, player_no);
|
||||
Common_Get(now_private)->gender = mPr_SEX_MALE;
|
||||
mNW_InitOneMyOriginal(Common_Get(player_no));
|
||||
mCkRh_InitGokiSaveData_InitNewPlayer();
|
||||
|
||||
if (malloc_flag == FALSE) {
|
||||
mFM_SetBlockKindLoadCombi(game);
|
||||
mEv_init_force(&play->event);
|
||||
mSP_ExchangeLineUp_InGame(game);
|
||||
}
|
||||
else {
|
||||
mFM_SetBlockKindLoadCombi(NULL);
|
||||
mEv_init_force(&play->event);
|
||||
mSP_ExchangeLineUp_InGame(NULL);
|
||||
}
|
||||
if (malloc_flag == FALSE) {
|
||||
mFM_SetBlockKindLoadCombi(game);
|
||||
mEv_init_force(&play->event);
|
||||
mSP_ExchangeLineUp_InGame(game);
|
||||
} else {
|
||||
mFM_SetBlockKindLoadCombi(NULL);
|
||||
mEv_init_force(&play->event);
|
||||
mSP_ExchangeLineUp_InGame(NULL);
|
||||
}
|
||||
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mSDI_ClearMoneyPlayerHomeStationBlock();
|
||||
mRmTp_SetDefaultLightSwitchData(1); // TODO: enum
|
||||
mFI_PullTanukiPathTrees();
|
||||
res = TRUE;
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mSDI_ClearMoneyPlayerHomeStationBlock();
|
||||
mRmTp_SetDefaultLightSwitchData(1); // TODO: enum
|
||||
mFI_PullTanukiPathTrees();
|
||||
res = TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
static int mSDI_StartInitPak(GAME* game, int player_no, int malloc_flag) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
GAME* g = game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
int res = FALSE;
|
||||
|
||||
if (malloc_flag == TRUE) {
|
||||
g = NULL;
|
||||
}
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
GAME* g = game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
int res = FALSE;
|
||||
|
||||
if (player_no < mPr_PLAYER_NUM) {
|
||||
Common_Set(scene_from_title_demo, SCENE_FG);
|
||||
}
|
||||
if (malloc_flag == TRUE) {
|
||||
g = NULL;
|
||||
}
|
||||
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
mFM_SetBlockKindLoadCombi(g);
|
||||
mEv_init_force(&play->event);
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g);
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mNpc_SetReturnAnimal(mNpc_GetInAnimalP()); //
|
||||
mNpc_SendRegisteredGoodbyMail(); //
|
||||
mMkRm_MarkRoom(g);
|
||||
mEv_SetGateway(); //
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
}
|
||||
if (player_no < mPr_PLAYER_NUM) {
|
||||
Common_Set(scene_from_title_demo, SCENE_FG);
|
||||
}
|
||||
|
||||
return res;
|
||||
if (mFRm_CheckSaveData() == TRUE) {
|
||||
mFM_SetBlockKindLoadCombi(g);
|
||||
mEv_init_force(&play->event);
|
||||
mHsRm_GetHuusuiRoom(g, player_no);
|
||||
mCkRh_DecideNowGokiFamilyCount(player_no);
|
||||
mSP_ExchangeLineUp_InGame(g);
|
||||
mNpc_SetRemoveAnimalNo(Save_GetPointer(remove_animal_idx), animals, -1);
|
||||
mNpc_SetReturnAnimal(mNpc_GetInAnimalP()); //
|
||||
mNpc_SendRegisteredGoodbyMail(); //
|
||||
mMkRm_MarkRoom(g);
|
||||
mEv_SetGateway(); //
|
||||
mRmTp_SetDefaultLightSwitchData(2); // TODO: enum
|
||||
res = TRUE;
|
||||
}
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
static int mSDI_StartInitErr(GAME* game, int player_no, int malloc_flag) {
|
||||
return TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
extern void mSDI_StartInitAfter(GAME* game, int renew_mode, int malloc_flag) {
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
GAME_PLAY* play = (GAME_PLAY*)game;
|
||||
Animal_c* animals = Save_Get(animals);
|
||||
|
||||
Common_Set(house_owner_name, -1);
|
||||
mEA_InitLetterCardE();
|
||||
Common_Set(last_field_id, -1);
|
||||
mHm_SetNowHome();
|
||||
mNpc_RenewalAnimalMemory(); //
|
||||
mNpc_ForceRemove(); //
|
||||
mTM_renewal_renew_time();
|
||||
mEv_ClearEventInfo();
|
||||
mEnv_DecideWeather_NormalGameStart(); //
|
||||
mMl_start_send_mail();
|
||||
mPO_first_work(play);
|
||||
mTM_set_season();
|
||||
mAGrw_ClearAllShine_Stone(); //
|
||||
mAGrw_RestoreStoneShine(Common_Get(player_no));
|
||||
mFAs_SetFieldRank();
|
||||
mEv_2nd_init(&play->event);
|
||||
mNpc_Grow(); //
|
||||
Kabu_manager();
|
||||
mNpc_InitNpcData();
|
||||
mNpc_InitNpcList(Common_Get(npclist), ANIMAL_NUM_MAX); //
|
||||
mNpc_SetNpcList(Common_Get(npclist), animals, ANIMAL_NUM_MAX, malloc_flag);
|
||||
mNpc_InitNpcList(Common_Get(island_npclist), 1);
|
||||
mNpc_ClearTalkInfo(); //
|
||||
Common_Set(house_owner_name, -1);
|
||||
mEA_InitLetterCardE();
|
||||
Common_Set(last_field_id, -1);
|
||||
mHm_SetNowHome();
|
||||
mNpc_RenewalAnimalMemory(); //
|
||||
mNpc_ForceRemove(); //
|
||||
mTM_renewal_renew_time();
|
||||
mEv_ClearEventInfo();
|
||||
mEnv_DecideWeather_NormalGameStart(); //
|
||||
mMl_start_send_mail();
|
||||
mPO_first_work(play);
|
||||
mTM_set_season();
|
||||
mAGrw_ClearAllShine_Stone(); //
|
||||
mAGrw_RestoreStoneShine(Common_Get(player_no));
|
||||
mFAs_SetFieldRank();
|
||||
mEv_2nd_init(&play->event);
|
||||
mNpc_Grow(); //
|
||||
Kabu_manager();
|
||||
mNpc_InitNpcData();
|
||||
mNpc_InitNpcList(Common_Get(npclist), ANIMAL_NUM_MAX); //
|
||||
mNpc_SetNpcList(Common_Get(npclist), animals, ANIMAL_NUM_MAX, malloc_flag);
|
||||
mNpc_InitNpcList(Common_Get(island_npclist), 1);
|
||||
mNpc_ClearTalkInfo(); //
|
||||
|
||||
if (renew_mode == 1) {
|
||||
mFM_RenewalReserve(); //
|
||||
}
|
||||
if (renew_mode == 1) {
|
||||
mFM_RenewalReserve(); //
|
||||
}
|
||||
|
||||
mNpc_ChangePresentCloth(); //
|
||||
mQst_ClearNotSaveQuest(Common_GetPointer(quest)); //
|
||||
mGH_check_delete(); //
|
||||
mMC_check_delete(); //
|
||||
mFM_SetIslandNpcRoomData(game, malloc_flag); //
|
||||
mCD_calendar_wellcome_on(); //
|
||||
mPr_SetItemCollectBit(FTR_TAPEDECK);
|
||||
mPr_SetItemCollectBit(FTR_COLLEGERULE);
|
||||
mPr_SetItemCollectBit(FTR_ORANGEBOX);
|
||||
mNPS_set_all_schedule_area(); //
|
||||
mNpcW_InitNpcWalk(Common_GetPointer(npc_walk)); //
|
||||
mHm_CheckRehouseOrder();
|
||||
decide_fish_location(Common_GetPointer(fish_location));
|
||||
mTRC_init(game);
|
||||
Common_Set(goki_shocked_flag, FALSE);
|
||||
mNtc_auto_nwrite_time_ct(); //
|
||||
mPr_SendMailFromMother();
|
||||
mNpc_Remail(); //
|
||||
mPr_SendForeingerAnimalMail(Common_Get(now_private));
|
||||
mPr_StartSetCompleteTalkInfo();
|
||||
mMsm_SendInformationMail(); //
|
||||
mMsm_SendCompMail(); //
|
||||
mFI_SetFirstSetShell(); //
|
||||
mMsr_FirstClearMushroom();
|
||||
mSN_decide_msg(); //
|
||||
mPr_RenewalMapInfo(Common_Get(now_private)->maps, mPr_FOREIGN_MAP_COUNT, Save_GetPointer(land_info));
|
||||
mSP_SetTanukiShopStatus(); //
|
||||
mEnv_DecideTodayWindPowerRange(); //
|
||||
mFI_SetClimate(mFI_CLIMATE_0);
|
||||
mISL_RestoreIsland(); //
|
||||
mNpc_SendHPMail(); //
|
||||
mNpc_ChangePresentCloth(); //
|
||||
mQst_ClearNotSaveQuest(Common_GetPointer(quest)); //
|
||||
mGH_check_delete(); //
|
||||
mMC_check_delete(); //
|
||||
mFM_SetIslandNpcRoomData(game, malloc_flag); //
|
||||
mCD_calendar_wellcome_on(); //
|
||||
mPr_SetItemCollectBit(FTR_TAPEDECK);
|
||||
mPr_SetItemCollectBit(FTR_COLLEGERULE);
|
||||
mPr_SetItemCollectBit(FTR_ORANGEBOX);
|
||||
mNPS_set_all_schedule_area(); //
|
||||
mNpcW_InitNpcWalk(Common_GetPointer(npc_walk)); //
|
||||
mHm_CheckRehouseOrder();
|
||||
decide_fish_location(Common_GetPointer(fish_location));
|
||||
mTRC_init(game);
|
||||
Common_Set(goki_shocked_flag, FALSE);
|
||||
mNtc_auto_nwrite_time_ct(); //
|
||||
mPr_SendMailFromMother();
|
||||
mNpc_Remail(); //
|
||||
mPr_SendForeingerAnimalMail(Common_Get(now_private));
|
||||
mPr_StartSetCompleteTalkInfo();
|
||||
mMsm_SendInformationMail(); //
|
||||
mMsm_SendCompMail(); //
|
||||
mFI_SetFirstSetShell(); //
|
||||
mMsr_FirstClearMushroom();
|
||||
mSN_decide_msg(); //
|
||||
mPr_RenewalMapInfo(Common_Get(now_private)->maps, mPr_FOREIGN_MAP_COUNT, Save_GetPointer(land_info));
|
||||
mSP_SetTanukiShopStatus(); //
|
||||
mEnv_DecideTodayWindPowerRange(); //
|
||||
mFI_SetClimate(mFI_CLIMATE_0);
|
||||
mISL_RestoreIsland(); //
|
||||
mNpc_SendHPMail(); //
|
||||
}
|
||||
|
||||
typedef int (*mSDI_INIT_PROC)(GAME*, int, int);
|
||||
|
||||
extern int mSDI_StartInitBefore(GAME* game, int player_no, int init_mode, int malloc_flag) {
|
||||
static mSDI_INIT_PROC init_proc[mSDI_INIT_MODE_NUM] = {
|
||||
&mSDI_StartInitNew,
|
||||
&mSDI_StartInitNewPlayer,
|
||||
&mSDI_StartInitFrom,
|
||||
&mSDI_StartInitPak,
|
||||
&mSDI_StartInitErr
|
||||
};
|
||||
|
||||
mEv_UnSetGateway(); //
|
||||
return (*init_proc[init_mode])(game, player_no, malloc_flag);
|
||||
static mSDI_INIT_PROC init_proc[mSDI_INIT_MODE_NUM] = { &mSDI_StartInitNew, &mSDI_StartInitNewPlayer,
|
||||
&mSDI_StartInitFrom, &mSDI_StartInitPak,
|
||||
&mSDI_StartInitErr };
|
||||
|
||||
mEv_UnSetGateway(); //
|
||||
return (*init_proc[init_mode])(game, player_no, malloc_flag);
|
||||
}
|
||||
|
||||
extern int mSDI_StartDataInit(GAME* game, int player_no, int init_mode) {
|
||||
static int renew_reserve_mode_table[mSDI_INIT_MODE_NUM] = {
|
||||
TRUE,
|
||||
FALSE,
|
||||
FALSE,
|
||||
FALSE,
|
||||
FALSE
|
||||
};
|
||||
static int renew_reserve_mode_table[mSDI_INIT_MODE_NUM] = { TRUE, FALSE, FALSE, FALSE, FALSE };
|
||||
|
||||
int res;
|
||||
int res;
|
||||
|
||||
if (init_mode < mSDI_INIT_MODE_NEW || init_mode >= mSDI_INIT_MODE_NUM) {
|
||||
init_mode = mSDI_INIT_MODE_NEW;
|
||||
}
|
||||
if (init_mode < mSDI_INIT_MODE_NEW || init_mode >= mSDI_INIT_MODE_NUM) {
|
||||
init_mode = mSDI_INIT_MODE_NEW;
|
||||
}
|
||||
|
||||
res = mSDI_StartInitBefore(game, player_no, init_mode, mSDI_MALLOC_FLAG_ZELDA);
|
||||
if (res == TRUE) {
|
||||
mSDI_StartInitAfter(game, renew_reserve_mode_table[init_mode], mSDI_MALLOC_FLAG_ZELDA);
|
||||
}
|
||||
res = mSDI_StartInitBefore(game, player_no, init_mode, mSDI_MALLOC_FLAG_ZELDA);
|
||||
if (res == TRUE) {
|
||||
mSDI_StartInitAfter(game, renew_reserve_mode_table[init_mode], mSDI_MALLOC_FLAG_ZELDA);
|
||||
}
|
||||
|
||||
return res;
|
||||
return res;
|
||||
}
|
||||
|
||||
+11
-15
@@ -16,28 +16,28 @@
|
||||
#include "m_debug.h"
|
||||
#include "dolphin/os.h"
|
||||
#include "libforest/osreport.h"
|
||||
#include "m_land.h"
|
||||
|
||||
//TODO: actually add all the stacks and headers
|
||||
// TODO: actually add all the stacks and headers
|
||||
|
||||
OSThread graphThread;
|
||||
static OSMessage serialMsgBuf;
|
||||
static OSMessageQueue l_serialMsgQ;
|
||||
u8 SegmentBaseAddress[0x40];
|
||||
|
||||
|
||||
int ScreenWidth = SCREEN_WIDTH;
|
||||
int ScreenHeight = SCREEN_HEIGHT;
|
||||
|
||||
extern void mainproc (void* val){
|
||||
extern void mainproc(void* val) {
|
||||
|
||||
irqmgr_client_t irqClient;
|
||||
OSMessageQueue irqMgrMsgQueue;
|
||||
OSMessage irqMsgBuf[10];
|
||||
OSMessage msg;
|
||||
|
||||
|
||||
ScreenWidth = SCREEN_WIDTH;
|
||||
ScreenHeight = SCREEN_HEIGHT;
|
||||
|
||||
|
||||
JW_BeginFrame();
|
||||
JW_EndFrame();
|
||||
mCD_init_card();
|
||||
@@ -48,14 +48,13 @@ extern void mainproc (void* val){
|
||||
irqmgr_AddClient(&irqClient, &irqMgrMsgQueue);
|
||||
memset(padmgrStack, 0xEB, PADMGR_STACK_SIZE);
|
||||
|
||||
|
||||
padmgr_Create(&l_serialMsgQ, 7, 15, padmgrStack + PADMGR_STACK_SIZE, PADMGR_STACK_SIZE);
|
||||
|
||||
|
||||
osCreateThread2(&graphThread, 4, graph_proc, val, graphStack + GRAPH_STACK_SIZE, GRAPH_STACK_SIZE, 8);
|
||||
|
||||
|
||||
JW_BeginFrame();
|
||||
JW_EndFrame();
|
||||
|
||||
|
||||
osStartThread(&graphThread);
|
||||
osSetThreadPri(NULL, 5);
|
||||
|
||||
@@ -63,7 +62,7 @@ extern void mainproc (void* val){
|
||||
mMsg_aram_init2();
|
||||
mLd_StartFlagOn();
|
||||
famicom_mount_archive();
|
||||
|
||||
|
||||
JC_JKRAramHeap_dump(JC_JKRAram_getAramHeap());
|
||||
osSetThreadPri(NULL, 13);
|
||||
|
||||
@@ -77,20 +76,17 @@ extern void mainproc (void* val){
|
||||
} while (msg != NULL);
|
||||
}
|
||||
|
||||
|
||||
u32 entry(void) {
|
||||
padmgr_Init(NULL);
|
||||
new_Debug_mode();
|
||||
|
||||
|
||||
SETREG(SREG, 0, 0);
|
||||
mainproc(NULL);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void foresta_main(void){
|
||||
void foresta_main(void) {
|
||||
OSReport("どうぶつの森 main2 開始\n");
|
||||
HotStartEntry = &entry;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user