From 51949c1abda863451b93771fe91e262741124a63 Mon Sep 17 00:00:00 2001 From: Vi Date: Thu, 15 May 2025 22:24:01 -0500 Subject: [PATCH 1/3] implement and link ac_kamakura_npc0 --- configure.py | 2 +- include/ac_kamakura_npc0.h | 8 +- src/actor/npc/ac_kamakura_npc0.c | 93 +++++++++++++++++++++++ src/actor/npc/ac_kamakura_npc0_talk.c_inc | 15 ++++ 4 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 src/actor/npc/ac_kamakura_npc0.c create mode 100644 src/actor/npc/ac_kamakura_npc0_talk.c_inc diff --git a/configure.py b/configure.py index a10438e7..dcf6bb4d 100644 --- a/configure.py +++ b/configure.py @@ -1106,7 +1106,7 @@ config.libs = [ Object(NonMatching, "actor/npc/ac_harvest_npc0.c"), Object(NonMatching, "actor/npc/ac_harvest_npc1.c"), Object(Matching, "actor/npc/ac_hatumode_npc0.c"), - Object(NonMatching, "actor/npc/ac_kamakura_npc0.c"), + Object(Matching, "actor/npc/ac_kamakura_npc0.c"), Object(Matching, "actor/npc/ac_normal_npc.c"), Object(Matching, "actor/npc/ac_npc.c"), Object(Matching, "actor/npc/ac_npc2.c"), diff --git a/include/ac_kamakura_npc0.h b/include/ac_kamakura_npc0.h index 40d1604f..a6612756 100644 --- a/include/ac_kamakura_npc0.h +++ b/include/ac_kamakura_npc0.h @@ -3,11 +3,17 @@ #include "types.h" #include "m_actor.h" - +#include "ac_npc.h" #ifdef __cplusplus extern "C" { #endif +typedef struct npc_kamakura_npc0_s NPC_KAMUKURA_NPC0_ACTOR; + +/* sizeof(npc_kamakura_npc0_s) == 0x994*/ +struct npc_kamakura_npc0_s { + /* 0x000 */ NPC_ACTOR npc_class; +}; extern ACTOR_PROFILE Kamakura_Npc0_Profile; #ifdef __cplusplus diff --git a/src/actor/npc/ac_kamakura_npc0.c b/src/actor/npc/ac_kamakura_npc0.c new file mode 100644 index 00000000..383f0307 --- /dev/null +++ b/src/actor/npc/ac_kamakura_npc0.c @@ -0,0 +1,93 @@ +#include "ac_kamakura_npc0.h" + +#include "ac_npc.h" +#include "ac_npc_h.h" +#include "ac_quest_manager.h" +#include "ac_quest_manager_clip.h" +#include "dolphin/os/OSRtc.h" +#include "libc64/qrand.h" +#include "libultra/libultra.h" +#include "m_actor_type.h" +#include "m_bgm.h" +#include "m_card.h" +#include "m_choice.h" +#include "m_common_data.h" +#include "m_config.h" +#include "m_demo.h" +#include "m_lib.h" +#include "m_msg.h" +#include "m_npc.h" +#include "m_play.h" +#include "m_play_h.h" +#include "m_player.h" +#include "m_player_lib.h" +#include "m_room_type.h" +#include "m_soncho.h" +#include "m_vibctl.h" +#include "types.h" + +static void aKM0_actor_ct(ACTOR* actorx, GAME* game); +static void aKM0_actor_save(ACTOR* actorx, GAME* game); +static void aKM0_actor_dt(ACTOR* actorx, GAME* game); +static void aKM0_actor_init(ACTOR* actorx, GAME* game); +static void aKM0_actor_move(ACTOR* actorx, GAME* game); +static void aKM0_actor_draw(ACTOR* actorx, GAME* game); + +static void aKM0_talk_request(ACTOR* actorx, GAME* game); +static int aKM0_talk_init(ACTOR* actorx, GAME* game); +static int aKM0_talk_end_chk(ACTOR* actorx, GAME* game); +// clang-format off +ACTOR_PROFILE Kamakura_Npc0_Profile = { + mAc_PROFILE_KAMAKURA_NPC0, + ACTOR_PART_NPC, + ACTOR_STATE_NONE, + 0, + ACTOR_OBJ_BANK_KEEP, + sizeof(NPC_KAMUKURA_NPC0_ACTOR), + aKM0_actor_ct, + aKM0_actor_dt, + aKM0_actor_init, + mActor_NONE_PROC1, + aKM0_actor_save, +}; +// clang-format on + +static void aKM0_actor_ct(ACTOR* actorx, GAME* game) { + // clang-format off + static aNPC_ct_data_c ct_data = { + &aKM0_actor_move, + &aKM0_actor_draw, + aNPC_CT_SCHED_TYPE_WANDER, + &aKM0_talk_request, + &aKM0_talk_init, + &aKM0_talk_end_chk, + 0, + }; + // clang-format on + if (NPC_CLIP->birth_check_proc(actorx, game) == TRUE) { + NPC_CLIP->ct_proc(actorx, game, &ct_data); + NPC_CLIP->set_start_pos_proc(actorx); + } +} + +static void aKM0_actor_save(ACTOR* actorx, GAME* game) { + NPC_CLIP->save_proc(actorx, game); +} + +static void aKM0_actor_dt(ACTOR* actorx, GAME* game) { + NPC_CLIP->dt_proc(actorx, game); +} + +static void aKM0_actor_init(ACTOR* actorx, GAME* game) { + NPC_CLIP->init_proc(actorx, game); +} + +static void aKM0_actor_move(ACTOR* actorx, GAME* game) { + NPC_CLIP->move_proc(actorx, game); +} + +static void aKM0_actor_draw(ACTOR* actorx, GAME* game) { + NPC_CLIP->draw_proc(actorx, game); +} + +#include "../src/actor/npc/ac_kamakura_npc0_talk.c_inc" diff --git a/src/actor/npc/ac_kamakura_npc0_talk.c_inc b/src/actor/npc/ac_kamakura_npc0_talk.c_inc new file mode 100644 index 00000000..a838aab9 --- /dev/null +++ b/src/actor/npc/ac_kamakura_npc0_talk.c_inc @@ -0,0 +1,15 @@ +static void aKM0_talk_request(ACTOR* actorx, GAME* game) { + CLIP(quest_manager_clip)->talk_request_proc(actorx); +} + +static int aKM0_talk_init(ACTOR* actorx, GAME* game) { + return CLIP(quest_manager_clip)->talk_start_proc(actorx); +} + +static int aKM0_talk_end_chk(ACTOR* actorx, GAME* game) { + BOOL res = FALSE; + if (CLIP(quest_manager_clip)->talk_check_proc(actorx) == TRUE) { + res = TRUE; + } + return res; +} From ee32e1481d0287c1898982bb1571a9a87e47f1d9 Mon Sep 17 00:00:00 2001 From: Vi Date: Thu, 15 May 2025 22:53:42 -0500 Subject: [PATCH 2/3] Merge branch 'master' of https://github.com/SamuraiOndo/ac-decomp --- src/actor/npc/ac_kamakura_npc0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/actor/npc/ac_kamakura_npc0.c b/src/actor/npc/ac_kamakura_npc0.c index 383f0307..b6707251 100644 --- a/src/actor/npc/ac_kamakura_npc0.c +++ b/src/actor/npc/ac_kamakura_npc0.c @@ -16,6 +16,7 @@ #include "m_demo.h" #include "m_lib.h" #include "m_msg.h" +#include "m_name_table.h" #include "m_npc.h" #include "m_play.h" #include "m_play_h.h" @@ -41,7 +42,7 @@ ACTOR_PROFILE Kamakura_Npc0_Profile = { mAc_PROFILE_KAMAKURA_NPC0, ACTOR_PART_NPC, ACTOR_STATE_NONE, - 0, + EMPTY_NO, ACTOR_OBJ_BANK_KEEP, sizeof(NPC_KAMUKURA_NPC0_ACTOR), aKM0_actor_ct, From 9196c6248e542d6a93509c3ea6cd9c4863cdd0a6 Mon Sep 17 00:00:00 2001 From: Cuyler36 Date: Mon, 19 May 2025 03:15:20 -0400 Subject: [PATCH 3/3] Update build.yml Inject PAT into env --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c15bde65..2a7448b2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,6 +44,7 @@ jobs: env: PROGRESS_SLUG: animalcrossing PROGRESS_API_KEY: ${{ secrets.PROGRESS_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} # for accessing github endpoints run: | python tools/upload_progress.py -b https://progress.decomp.club/ \ -p $PROGRESS_SLUG -v ${{ matrix.version }} \