diff --git a/config/rel_slices.yml b/config/rel_slices.yml index b6be1573..eb60a951 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -351,6 +351,18 @@ ac_t_hanabi.c: .text: [0x804A8834, 0x804A8A9C] .rodata: [0x80645EC8, 0x80645ED0] .data: [0x8068EC50, 0x8068ECB0] +ac_t_hasu1.c: + .text: [0x804A8A9C, 0x804A8BF0] + .data: [0x8068ECB0, 0x8068ECF0] +ac_t_hat1.c: + .text: [0x804A8BF0, 0x804A8D44] + .data: [0x8068ECF0, 0x8068ED30] +ac_t_hat2.c: + .text: [0x804A8D44, 0x804A8E98] + .data: [0x8068ED30, 0x8068ED70] +ac_t_hat3.c: + .text: [0x804A8E98, 0x804A8FEC] + .data: [0x8068ED70, 0x8068EDB0] ac_t_pistol.c: .text: [0x804A95F4, 0x804A9858] .rodata: [0x80645EF8, 0x80645F00] diff --git a/include/ac_t_hasu1.h b/include/ac_t_hasu1.h index a73b214e..d78b2b47 100644 --- a/include/ac_t_hasu1.h +++ b/include/ac_t_hasu1.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -10,6 +11,15 @@ extern "C" { extern ACTOR_PROFILE T_Hasu1_Profile; +typedef void (*HASU1_PROC)(ACTOR*); + +typedef struct t_hasu1_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + HASU1_PROC proc; + int current_id; +}HASU1_ACTOR; + #ifdef __cplusplus } #endif diff --git a/include/ac_t_hat1.h b/include/ac_t_hat1.h index 0c17167f..61fe66c7 100644 --- a/include/ac_t_hat1.h +++ b/include/ac_t_hat1.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -10,6 +11,15 @@ extern "C" { extern ACTOR_PROFILE T_Hat1_Profile; +typedef void (*HAT1_PROC)(ACTOR*); + +typedef struct t_hat1_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + HAT1_PROC proc; + int current_id; +}HAT1_ACTOR; + #ifdef __cplusplus } #endif diff --git a/include/ac_t_hat2.h b/include/ac_t_hat2.h index 1716f762..7657c966 100644 --- a/include/ac_t_hat2.h +++ b/include/ac_t_hat2.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -10,6 +11,16 @@ extern "C" { extern ACTOR_PROFILE T_Hat2_Profile; +typedef void (*HAT2_PROC)(ACTOR*); + +typedef struct t_hat2_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + HAT2_PROC proc; + int current_id; +}HAT2_ACTOR; + + #ifdef __cplusplus } #endif diff --git a/include/ac_t_hat3.h b/include/ac_t_hat3.h index 9b7bf6d4..01942bb6 100644 --- a/include/ac_t_hat3.h +++ b/include/ac_t_hat3.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -10,6 +11,15 @@ extern "C" { extern ACTOR_PROFILE T_Hat3_Profile; +typedef void (*HAT3_PROC)(ACTOR*); + +typedef struct t_hat3_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + HAT3_PROC proc; + int current_id; +}HAT3_ACTOR; + #ifdef __cplusplus } #endif diff --git a/rel/ac_t_cobra1.c b/rel/ac_t_cobra1.c index ab10b68c..57d7dd45 100644 --- a/rel/ac_t_cobra1.c +++ b/rel/ac_t_cobra1.c @@ -39,42 +39,42 @@ static void aTCB1_destruct(ACTOR* actor){ static void aTCB1_setupAction(ACTOR*actor, int action){ - COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor; + COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor; static COBRA1_PROC process[] = { (COBRA1_PROC)none_proc1,(COBRA1_PROC)none_proc1,(COBRA1_PROC)none_proc1,aTCB1_destruct,(COBRA1_PROC)none_proc1,NULL }; - biscus->proc = process[action]; - biscus->current_id = action; - biscus->tools_class.process_id = action; + cobra->proc = process[action]; + cobra->current_id = action; + cobra->tools_class.process_id = action; } static void aTCB1_actor_move(ACTOR* actor, GAME*){ - COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor; + COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor; - if(biscus->tools_class.process_id != biscus->current_id){ - aTCB1_setupAction(actor, biscus->tools_class.process_id); + if(cobra->tools_class.process_id != cobra->current_id){ + aTCB1_setupAction(actor, cobra->tools_class.process_id); } - biscus->proc(actor); + cobra->proc(actor); } static void aTCB1_actor_draw(ACTOR* actor, GAME* game){ - COBRA1_ACTOR* biscus = (COBRA1_ACTOR*)actor; + COBRA1_ACTOR* cobra = (COBRA1_ACTOR*)actor; GRAPH* graph; Gfx* gfxp; - if(biscus->tools_class.enable == 1){ + if(cobra->tools_class.enable == 1){ graph = game->graph; OPEN_DISP(graph); - Matrix_put(&biscus->tools_class.matrix_work); - Matrix_Position_Zero(&biscus->tools_class.actor_class.world.position); + Matrix_put(&cobra->tools_class.matrix_work); + Matrix_Position_Zero(&cobra->tools_class.actor_class.world.position); - biscus->tools_class.enable = 0; + cobra->tools_class.enable = 0; _texture_z_light_fog_prim_npc(graph); diff --git a/rel/ac_t_hasu1.c b/rel/ac_t_hasu1.c new file mode 100644 index 00000000..25997833 --- /dev/null +++ b/rel/ac_t_hasu1.c @@ -0,0 +1,90 @@ +#include "ac_t_hasu1.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTHS1_actor_ct(ACTOR* actor, GAME*); +static void aTHS1_actor_move(ACTOR* actor, GAME*); +static void aTHS1_actor_draw(ACTOR* actor, GAME*); +static void aTHS1_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Hasu1_Profile = { + mAc_PROFILE_T_HASU1, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(HASU1_ACTOR), + &aTHS1_actor_ct, + NONE_ACTOR_PROC, + &aTHS1_actor_move, + &aTHS1_actor_draw, + NULL +}; + +extern Gfx crw_hasu1_body_model[]; + +static void aTHS1_actor_ct(ACTOR* actor, GAME*){ + + aTHS1_setupAction(actor,4); +} + +static void aTHS1_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTHS1_setupAction(ACTOR*actor, int action){ + HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor; + static HASU1_PROC process[] = { + (HASU1_PROC)none_proc1,(HASU1_PROC)none_proc1,(HASU1_PROC)none_proc1,aTHS1_destruct,(HASU1_PROC)none_proc1,NULL + }; + + hasu->proc = process[action]; + hasu->current_id = action; + hasu->tools_class.process_id = action; + +} + +static void aTHS1_actor_move(ACTOR* actor, GAME*){ + HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor; + + if(hasu->tools_class.process_id != hasu->current_id){ + aTHS1_setupAction(actor, hasu->tools_class.process_id); + } + + hasu->proc(actor); +} + +static void aTHS1_actor_draw(ACTOR* actor, GAME* game){ + HASU1_ACTOR* hasu = (HASU1_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(hasu->tools_class.enable == 1){ + graph = game->graph; + + OPEN_DISP(graph); + + Matrix_put(&hasu->tools_class.matrix_work); + Matrix_Position_Zero(&hasu->tools_class.actor_class.world.position); + + hasu->tools_class.enable = 0; + + _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); + gSPDisplayList(gfxp++, crw_hasu1_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_hat1.c b/rel/ac_t_hat1.c new file mode 100644 index 00000000..23fe380a --- /dev/null +++ b/rel/ac_t_hat1.c @@ -0,0 +1,90 @@ +#include "ac_t_hat1.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTHT1_actor_ct(ACTOR* actor, GAME*); +static void aTHT1_actor_move(ACTOR* actor, GAME*); +static void aTHT1_actor_draw(ACTOR* actor, GAME*); +static void aTHT1_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Hat1_Profile = { + mAc_PROFILE_T_HAT1, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(HAT1_ACTOR), + &aTHT1_actor_ct, + NONE_ACTOR_PROC, + &aTHT1_actor_move, + &aTHT1_actor_draw, + NULL +}; + +extern Gfx crw_hat1_body_model[]; + +static void aTHT1_actor_ct(ACTOR* actor, GAME*){ + + aTHT1_setupAction(actor,4); +} + +static void aTHT1_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTHT1_setupAction(ACTOR*actor, int action){ + HAT1_ACTOR* hat = (HAT1_ACTOR*)actor; + static HAT1_PROC process[] = { + (HAT1_PROC)none_proc1,(HAT1_PROC)none_proc1,(HAT1_PROC)none_proc1,aTHT1_destruct,(HAT1_PROC)none_proc1,NULL + }; + + hat->proc = process[action]; + hat->current_id = action; + hat->tools_class.process_id = action; + +} + +static void aTHT1_actor_move(ACTOR* actor, GAME*){ + HAT1_ACTOR* hat = (HAT1_ACTOR*)actor; + + if(hat->tools_class.process_id != hat->current_id){ + aTHT1_setupAction(actor, hat->tools_class.process_id); + } + + hat->proc(actor); +} + +static void aTHT1_actor_draw(ACTOR* actor, GAME* game){ + HAT1_ACTOR* hat = (HAT1_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(hat->tools_class.enable == 1){ + graph = game->graph; + + OPEN_DISP(graph); + + Matrix_put(&hat->tools_class.matrix_work); + Matrix_Position_Zero(&hat->tools_class.actor_class.world.position); + + hat->tools_class.enable = 0; + + _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); + gSPDisplayList(gfxp++, crw_hat1_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_hat2.c b/rel/ac_t_hat2.c new file mode 100644 index 00000000..901eb47f --- /dev/null +++ b/rel/ac_t_hat2.c @@ -0,0 +1,90 @@ +#include "ac_t_hat2.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTHT2_actor_ct(ACTOR* actor, GAME*); +static void aTHT2_actor_move(ACTOR* actor, GAME*); +static void aTHT2_actor_draw(ACTOR* actor, GAME*); +static void aTHT2_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Hat2_Profile = { + mAc_PROFILE_T_HAT2, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(HAT2_ACTOR), + &aTHT2_actor_ct, + NONE_ACTOR_PROC, + &aTHT2_actor_move, + &aTHT2_actor_draw, + NULL +}; + +extern Gfx crw_hat2_body_model[]; + +static void aTHT2_actor_ct(ACTOR* actor, GAME*){ + + aTHT2_setupAction(actor,4); +} + +static void aTHT2_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTHT2_setupAction(ACTOR*actor, int action){ + HAT2_ACTOR* hat = (HAT2_ACTOR*)actor; + static HAT2_PROC process[] = { + (HAT2_PROC)none_proc1,(HAT2_PROC)none_proc1,(HAT2_PROC)none_proc1,aTHT2_destruct,(HAT2_PROC)none_proc1,NULL + }; + + hat->proc = process[action]; + hat->current_id = action; + hat->tools_class.process_id = action; + +} + +static void aTHT2_actor_move(ACTOR* actor, GAME*){ + HAT2_ACTOR* hat = (HAT2_ACTOR*)actor; + + if(hat->tools_class.process_id != hat->current_id){ + aTHT2_setupAction(actor, hat->tools_class.process_id); + } + + hat->proc(actor); +} + +static void aTHT2_actor_draw(ACTOR* actor, GAME* game){ + HAT2_ACTOR* hat = (HAT2_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(hat->tools_class.enable == 1){ + graph = game->graph; + + OPEN_DISP(graph); + + Matrix_put(&hat->tools_class.matrix_work); + Matrix_Position_Zero(&hat->tools_class.actor_class.world.position); + + hat->tools_class.enable = 0; + + _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); + gSPDisplayList(gfxp++, crw_hat2_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_hat3.c b/rel/ac_t_hat3.c new file mode 100644 index 00000000..6eb20444 --- /dev/null +++ b/rel/ac_t_hat3.c @@ -0,0 +1,90 @@ +#include "ac_t_hat3.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTHT3_actor_ct(ACTOR* actor, GAME*); +static void aTHT3_actor_move(ACTOR* actor, GAME*); +static void aTHT3_actor_draw(ACTOR* actor, GAME*); +static void aTHT3_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Hat3_Profile = { + mAc_PROFILE_T_HAT3, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(HAT3_ACTOR), + &aTHT3_actor_ct, + NONE_ACTOR_PROC, + &aTHT3_actor_move, + &aTHT3_actor_draw, + NULL +}; + +extern Gfx crw_hat3_body_model[]; + +static void aTHT3_actor_ct(ACTOR* actor, GAME*){ + + aTHT3_setupAction(actor,4); +} + +static void aTHT3_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTHT3_setupAction(ACTOR*actor, int action){ + HAT3_ACTOR* hat = (HAT3_ACTOR*)actor; + static HAT3_PROC process[] = { + (HAT3_PROC)none_proc1,(HAT3_PROC)none_proc1,(HAT3_PROC)none_proc1,aTHT3_destruct,(HAT3_PROC)none_proc1,NULL + }; + + hat->proc = process[action]; + hat->current_id = action; + hat->tools_class.process_id = action; + +} + +static void aTHT3_actor_move(ACTOR* actor, GAME*){ + HAT3_ACTOR* hat = (HAT3_ACTOR*)actor; + + if(hat->tools_class.process_id != hat->current_id){ + aTHT3_setupAction(actor, hat->tools_class.process_id); + } + + hat->proc(actor); +} + +static void aTHT3_actor_draw(ACTOR* actor, GAME* game){ + HAT3_ACTOR* hat = (HAT3_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(hat->tools_class.enable == 1){ + graph = game->graph; + + OPEN_DISP(graph); + + Matrix_put(&hat->tools_class.matrix_work); + Matrix_Position_Zero(&hat->tools_class.actor_class.world.position); + + hat->tools_class.enable = 0; + + _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); + gSPDisplayList(gfxp++, crw_hat3_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file