Implement & link ac_mikanbox, ac_npc_totakeke refactor

This commit is contained in:
Cuyler36
2025-01-07 19:09:21 -05:00
parent c84af287c2
commit 6bd0c5fc4b
18 changed files with 817 additions and 227 deletions
+7 -2
View File
@@ -3,16 +3,21 @@
#include "types.h"
#include "m_actor.h"
#include "ac_mikanbox_clip.h"
#include "ac_structure.h"
#ifdef __cplusplus
extern "C" {
#endif
extern ACTOR_PROFILE Mikanbox_Profile;
typedef struct mikanbox_actor_s {
STRUCTURE_ACTOR s_actor;
} MIKANBOX_ACTOR;
extern ACTOR_PROFILE Mikanbox_Profile;
#ifdef __cplusplus
}
#endif
#endif
+48
View File
@@ -0,0 +1,48 @@
#ifndef AC_MIKANBOX_CLIP_H
#define AC_MIKANBOX_CLIP_H
#include "types.h"
#include "m_actor.h"
#include "ac_npc_totakeke.h"
#ifdef __cplusplus
extern "C" {
#endif
#define aMKBC_NUM_GOOD_MD (ITM_MINIDISK52 - ITM_MINIDISK_START)
typedef void (*aMKBC_SET_STRING_PROC)(int base);
typedef void (*aMKBC_ROLL_DRAW_PROC)(GAME_PLAY* play, int timer, int page_idx);
typedef void (*aMKBC_THINK_INIT_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int init_idx);
typedef void (*aMKBC_SOUND_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play, int idx);
typedef int (*aMKBC_SECTION_CHK_PROC)(int section);
typedef u8 (*aMKBC_BGM_NO_PROC)(NPC_TOTAKEKE_ACTOR* totakeke);
typedef void (*aMKBC_ROLL_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play);
typedef void (*aMKBC_HEAD_UP_PROC)(ACTOR* actorx);
typedef void (*aMKBC_SET_ITEMSTR_PROC)(int str_no, u8 md_no);
typedef void (*aMKBC_SET_ITEMSTR3_PROC)(void);
typedef u8 (*aMKBC_SEARCH_MERODY_PROC)(void);
typedef void (*aMKBC_CHECK_MERODY_PROC)(u32 md_no);
typedef struct mikanbox_clip_s aMKBC_Clip_c;
struct mikanbox_clip_s {
/* 0x000 */ aMKBC_SET_STRING_PROC set_string_proc;
/* 0x004 */ aMKBC_ROLL_DRAW_PROC roll_draw_proc;
/* 0x008 */ aMKBC_THINK_INIT_PROC think_init_proc;
/* 0x00C */ aMKBC_SOUND_PROC sound_proc;
/* 0x010 */ aMKBC_SECTION_CHK_PROC section_chk_proc;
/* 0x014 */ aMKBC_BGM_NO_PROC bgm_no_proc;
/* 0x018 */ aMKBC_ROLL_PROC roll_proc;
/* 0x01C */ aMKBC_HEAD_UP_PROC head_up_proc;
/* 0x020 */ aMKBC_SET_ITEMSTR_PROC set_itemstr_proc;
/* 0x024 */ aMKBC_SET_ITEMSTR3_PROC set_itemstr3_proc;
/* 0x028 */ aMKBC_SEARCH_MERODY_PROC search_merody_proc;
/* 0x02C */ aMKBC_CHECK_MERODY_PROC check_merody_proc;
};
#ifdef __cplusplus
}
#endif
#endif
+27 -45
View File
@@ -4,6 +4,7 @@
#include "types.h"
#include "m_actor.h"
#include "ac_npc.h"
#include "m_item_name.h"
#ifdef __cplusplus
extern "C" {
@@ -11,25 +12,19 @@ extern "C" {
extern ACTOR_PROFILE Npc_Totakeke_Profile;
// @BUG - this should've been updated to mIN_ITEM_NAME_LEN
#ifndef BUGFIXES
#define aNTT_REQUEST_STR_LEN 10
#else
#define aNTT_REQUEST_STR_LEN mIN_ITEM_NAME_LEN
#endif
typedef struct npc_totakeke_s NPC_TOTAKEKE_ACTOR;
typedef struct npc_totakeke_clip_s aNTT_Clip_c;
typedef struct npc_totakeke_think_data_s aNTT_think_data_c;
typedef struct npc_totakeke_event_save_s aNTT_event_save_c;
typedef struct npc_totakeke_event_common_s aNTT_event_common_c;
typedef void (*aNTTrequest_str_PROC)(GAME*, s16, u8);
typedef void (*aNTT_08_PROC)(NPC_TOTAKEKE_ACTOR*, GAME_PLAY*, u8);
typedef void (*aNTT_0C_PROC)(NPC_TOTAKEKE_ACTOR*, GAME_PLAY*, int);
typedef int (*aNTT_10_PROC)(int);
typedef u8 (*aNTT_14_PROC)(NPC_TOTAKEKE_ACTOR*);
typedef void (*aNTT_1C_PROC)(NPC_TOTAKEKE_ACTOR*);
typedef void (*aNTT_20_PROC)(int, u8);
typedef void (*aNTT_24_PROC)();
typedef u8 (*aNTT_PICK_SONG_PROC)();
typedef void (*aNTT_2C_PROC)(int);
typedef void (*aNTT_PROC)(NPC_TOTAKEKE_ACTOR* totakeke, GAME_PLAY* play);
struct npc_totakeke_s {
@@ -37,7 +32,7 @@ struct npc_totakeke_s {
/* 0x994 */ aNTT_PROC proc;
/* 0x998 */ s16 roll2_count;
/* 0x99a */ s16 roll4_count;
/* 0x99c */ u16 _99c;
/* 0x99c */ s16 show_timer;
/* 0x99e */ u8 song;
/* 0x99f */ u8 _99f;
/* 0x9a0 */ u8 _9a0;
@@ -49,50 +44,37 @@ struct npc_totakeke_s {
/* 0x9a6 */ u8 post_roll_think;
/* 0x9a7 */ u8 melody_inst;
/* 0x9a8 */ u8 think_proc_id;
/* 0x9a9 */ u8 _9a9;
/* 0x9ac */ u8 _9aa;
/* 0x9ac */ u8 _9ab;
};
struct npc_totakeke_clip_s {
/* 0x000 */ int _00;
/* 0x004 */ aNTTrequest_str_PROC _04;
/* 0x008 */ aNTT_08_PROC _08;
/* 0x00c */ aNTT_0C_PROC _0C;
/* 0x010 */ aNTT_10_PROC _10;
/* 0x014 */ aNTT_14_PROC _14;
/* 0x018 */ aNTT_PROC _18;
/* 0x01c */ aNTT_1C_PROC _1c;
/* 0x020 */ aNTT_20_PROC _20;
/* 0x024 */ aNTT_24_PROC _24;
/* 0x028 */ aNTT_PICK_SONG_PROC pick_song;
/* 0x02c */ aNTT_2C_PROC _2c;
/* 0x9a9 */ u8 majin_flag;
/* 0x9aa */ u8 _9aa;
/* 0x9ab */ u8 _9ab;
};
struct npc_totakeke_think_data_s {
/* 0x00 */ u8 think_proc_id;
/* 0x01 */ u8 _01;
/* 0x01 */ u8 think_init_idx;
/* 0x02 */ u8 next_talk;
/* 0x03 */ u8 talk;
/* 0x04 */ u8 pre_roll_think;
};
#define aNTT_FLAG_0 1
#define aNTT_FLAG_AIRCHECK_RECEIVED 1 << 4
#define aNTT_FLAG_HELLO (1 << 0)
#define aNTT_FLAG_1 (1 << 1)
#define aNTT_FLAG_2 (1 << 2)
#define aNTT_FLAG_3 (1 << 3)
#define aNTT_FLAG_AIRCHECK_RECEIVED (1 << 4)
#define aNTT_FLAG_5 (1 << 5)
#define aNTT_FLAG_6 (1 << 6)
#define aNTT_FLAG_7 (1 << 7)
#define aNTT_FLAG_SP_DELETE_MAJIN (1 << 13)
#define aNTT_FLAG_SP_ROLL_DRAW (1 << 14)
#define aNTT_FLAG_SP_ROLL_END (1 << 15)
struct npc_totakeke_event_save_s {
/* 0x00 */ u8 _00;
/* 0x01 */ u8 _01;
/* 0x00 */ s16 _00;
/* 0x01 */ u16 bitfield;
/* 0x04 */ u8 request_str[aNTT_REQUEST_STR_LEN];
/* 0x0e */ u8 _0e;
/* 0x0f */ u8 _0f;
/* 0x10 */ u8 _10;
/* 0x11 */ u8 _11;
/* 0x12 */ u8 _12;
/* 0x13 */ u8 _13;
/* 0x14 */ u8 _14;
/* 0x15 */ u8 _15;
/* 0x04 */ u8 request_str[mIN_ITEM_NAME_LEN];
/* 0x14 */ u8 roll_flag;
/* 0x15 */ u8 copyright_alpha;
};
struct npc_totakeke_event_common_s {
+2
View File
@@ -370,6 +370,8 @@ typedef enum bgm_e {
BGM_KAPPA_SONG15,
// TODO: others
BGM_MD0 = 128,
BGM_TOTAKEKE_LIVE0 = 192,
} BGM_e;
#ifdef __cplusplus
+2 -2
View File
@@ -34,7 +34,7 @@
#include "ac_turi_clip.h"
#include "ac_hatumode_control.h"
#include "ac_station_clip.h"
#include "ac_npc_totakeke.h"
#include "ac_mikanbox_clip.h"
#ifdef __cplusplus
extern "C" {
@@ -91,7 +91,7 @@ typedef struct clip_s {
/* 0x0CC */ void* _0CC;
/* 0x0D0 */ void* _0D0;
/* 0x0D4 */ CLIP_NONE_PROC ball_redma_proc; /* removed in DnM+ */
/* 0x0D8 */ aNTT_Clip_c* totakeke_clip;
/* 0x0D8 */ aMKBC_Clip_c* mikanbox_clip;
/* 0x0DC */ aAL_Clip_c* animal_logo_clip;
/* 0x0E0 */ aSTC_clip_c* station_clip;
/* 0x0E4 */ aTRC_clip_c* turi_clip;
+2
View File
@@ -7,6 +7,8 @@
extern "C" {
#endif
#define MSG_CARPETPEDDLER_START 0x048A
#define MSG_TOTAKEKE_START 0x1B93
#define MSG_SANTA_WISH_FTR 0x2B54
#define MSG_SANTA_WISH_WALL 0x2B55
#define MSG_SANTA_WISH_CARPET 0x2B56
+1
View File
@@ -3294,6 +3294,7 @@ extern int mNT_check_unknown(mActor_name_t item_no);
#define DUMMY_KOINOBORI 0xF114
#define DUMMY_WINDMILL 0xF116
#define DUMMY_LOTUS 0xF11B
#define DUMMY_MIKANBOX 0xF11C
#define DUMMY_DOUZOU 0xF11D
#define DUMMY_NAMEPLATE 0xF11F
#define DUMMY_MUSEUM 0xF120
+2 -2
View File
@@ -18,8 +18,8 @@ extern "C" {
#define mString_HANIWA_MSG1 0x76B
#define mString_HANIWA_MSG2 0x76C
#define mString_HANIWA_MSG3 0x76D
#define mString_CARPETPEDDLER_START 0x48a
#define mString_TOTAKEKE_START 0x1b93
#define mString_MIKANBOX_START 0x77B
#define mString_MIKANBOX_END 0x7FE
#ifdef __cplusplus
}
+3 -1
View File
@@ -57,12 +57,14 @@ enum {
};
#define mTM_SECONDS_IN_MINUTE 60
#define mTM_SECONDS_IN_HOUR 60*60
#define mTM_SECONDS_IN_HOUR (60*60)
#define mTM_SECONDS_IN_HALFDAY (12*60*60)
#define mTM_SECONDS_IN_DAY (24*60*60)
#define mTM_MINUTES_IN_HOUR 60
#define mTM_TIME2SEC(h, m, s) ((h) * mTM_SECONDS_IN_HOUR + (m) * mTM_SECONDS_IN_MINUTE + (s))
typedef struct time_calendar_term_s {
lbRTC_month_t month;
lbRTC_day_t day;