diff --git a/config/rel_slices.yml b/config/rel_slices.yml index f0c8cfc3..3dc9cad4 100644 --- a/config/rel_slices.yml +++ b/config/rel_slices.yml @@ -312,6 +312,18 @@ ac_t_bag1.c: ac_t_bag2.c: .text: [0x804A79F8, 0x804A7B4C] .data: [0x8068EA48, 0x8068EA88] +ac_t_biscus1.c: + .text: [0x804A7B4C, 0x804A7CA0] + .data: [0x8068EA88, 0x8068EAC8] +ac_t_biscus2.c: + .text: [0x804A7CA0, 0x804A7DF4] + .data: [0x8068EAC8, 0x8068EB08] +ac_t_biscus3.c: + .text: [0x804A7DF4, 0x804A7F48] + .data: [0x8068EB08, 0x8068EB48] +ac_t_biscus4.c: + .text: [0x804A7F48, 0x804A809C] + .data: [0x8068EB48, 0x8068EB88] ac_t_pistol.c: .text: [0x804A95F4, 0x804A9858] .rodata: [0x80645EF8, 0x80645F00] diff --git a/include/ac_t_biscus1.h b/include/ac_t_biscus1.h index 8d04e218..7a9e9dfe 100644 --- a/include/ac_t_biscus1.h +++ b/include/ac_t_biscus1.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_Biscus1_Profile; +typedef void (*BISCUS1_PROC)(ACTOR*); + +typedef struct t_biscus1_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + BISCUS1_PROC proc; + int current_id; +}BISCUS1_ACTOR; + #ifdef __cplusplus } #endif diff --git a/include/ac_t_biscus2.h b/include/ac_t_biscus2.h index c6a3b931..a5624cd0 100644 --- a/include/ac_t_biscus2.h +++ b/include/ac_t_biscus2.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_Biscus2_Profile; +typedef void (*BISCUS2_PROC)(ACTOR*); + +typedef struct t_biscus2_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + BISCUS2_PROC proc; + int current_id; +}BISCUS2_ACTOR; + #ifdef __cplusplus } #endif diff --git a/include/ac_t_biscus3.h b/include/ac_t_biscus3.h index 5480fc82..16201c8b 100644 --- a/include/ac_t_biscus3.h +++ b/include/ac_t_biscus3.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_Biscus3_Profile; +typedef void (*BISCUS3_PROC)(ACTOR*); + +typedef struct t_biscus3_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + BISCUS3_PROC proc; + int current_id; +}BISCUS3_ACTOR; + #ifdef __cplusplus } #endif diff --git a/include/ac_t_biscus4.h b/include/ac_t_biscus4.h index e681ef30..8a8c720d 100644 --- a/include/ac_t_biscus4.h +++ b/include/ac_t_biscus4.h @@ -3,6 +3,7 @@ #include "types.h" #include "m_actor.h" +#include "ac_tools.h" #ifdef __cplusplus extern "C" { @@ -10,6 +11,17 @@ extern "C" { extern ACTOR_PROFILE T_Biscus4_Profile; + +typedef void (*BISCUS4_PROC)(ACTOR*); + +typedef struct t_biscus4_s{ + TOOLS_ACTOR tools_class; + u8 pad2[0x8]; + BISCUS4_PROC proc; + int current_id; +}BISCUS4_ACTOR; + + #ifdef __cplusplus } #endif diff --git a/rel/ac_t_biscus1.c b/rel/ac_t_biscus1.c new file mode 100644 index 00000000..454733e6 --- /dev/null +++ b/rel/ac_t_biscus1.c @@ -0,0 +1,90 @@ +#include "ac_t_biscus1.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTB1_actor_ct(ACTOR* actor, GAME*); +static void aTB1_actor_move(ACTOR* actor, GAME*); +static void aTB1_actor_draw(ACTOR* actor, GAME*); +static void aTB1_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Biscus1_Profile = { + mAc_PROFILE_T_BISCUS1, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(BISCUS1_ACTOR), + &aTB1_actor_ct, + NONE_ACTOR_PROC, + &aTB1_actor_move, + &aTB1_actor_draw, + NULL +}; + +extern Gfx crw_biscus1_body_model[]; + +static void aTB1_actor_ct(ACTOR* actor, GAME*){ + + aTB1_setupAction(actor,4); +} + +static void aTB1_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTB1_setupAction(ACTOR*actor, int action){ + BISCUS1_ACTOR* biscus = (BISCUS1_ACTOR*)actor; + static BISCUS1_PROC process[] = { + (BISCUS1_PROC)none_proc1,(BISCUS1_PROC)none_proc1,(BISCUS1_PROC)none_proc1,aTB1_destruct,(BISCUS1_PROC)none_proc1,NULL + }; + + biscus->proc = process[action]; + biscus->current_id = action; + biscus->tools_class.process_id = action; + +} + +static void aTB1_actor_move(ACTOR* actor, GAME*){ + BISCUS1_ACTOR* biscus = (BISCUS1_ACTOR*)actor; + + if(biscus->tools_class.process_id != biscus->current_id){ + aTB1_setupAction(actor, biscus->tools_class.process_id); + } + + biscus->proc(actor); +} + +static void aTB1_actor_draw(ACTOR* actor, GAME* game){ + BISCUS1_ACTOR* biscus = (BISCUS1_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(biscus->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); + + biscus->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_biscus1_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_biscus2.c b/rel/ac_t_biscus2.c new file mode 100644 index 00000000..9f0e0572 --- /dev/null +++ b/rel/ac_t_biscus2.c @@ -0,0 +1,90 @@ +#include "ac_t_biscus2.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTB2_actor_ct(ACTOR* actor, GAME*); +static void aTB2_actor_move(ACTOR* actor, GAME*); +static void aTB2_actor_draw(ACTOR* actor, GAME*); +static void aTB2_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Biscus2_Profile = { + mAc_PROFILE_T_BISCUS2, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(BISCUS2_ACTOR), + &aTB2_actor_ct, + NONE_ACTOR_PROC, + &aTB2_actor_move, + &aTB2_actor_draw, + NULL +}; + +extern Gfx crw_biscus2_body_model[]; + +static void aTB2_actor_ct(ACTOR* actor, GAME*){ + + aTB2_setupAction(actor,4); +} + +static void aTB2_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTB2_setupAction(ACTOR*actor, int action){ + BISCUS2_ACTOR* biscus = (BISCUS2_ACTOR*)actor; + static BISCUS2_PROC process[] = { + (BISCUS2_PROC)none_proc1,(BISCUS2_PROC)none_proc1,(BISCUS2_PROC)none_proc1,aTB2_destruct,(BISCUS2_PROC)none_proc1,NULL + }; + + biscus->proc = process[action]; + biscus->current_id = action; + biscus->tools_class.process_id = action; + +} + +static void aTB2_actor_move(ACTOR* actor, GAME*){ + BISCUS2_ACTOR* biscus = (BISCUS2_ACTOR*)actor; + + if(biscus->tools_class.process_id != biscus->current_id){ + aTB2_setupAction(actor, biscus->tools_class.process_id); + } + + biscus->proc(actor); +} + +static void aTB2_actor_draw(ACTOR* actor, GAME* game){ + BISCUS2_ACTOR* biscus = (BISCUS2_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(biscus->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); + + biscus->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_biscus2_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_biscus3.c b/rel/ac_t_biscus3.c new file mode 100644 index 00000000..ed28c0ae --- /dev/null +++ b/rel/ac_t_biscus3.c @@ -0,0 +1,90 @@ +#include "ac_t_biscus3.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTB3_actor_ct(ACTOR* actor, GAME*); +static void aTB3_actor_move(ACTOR* actor, GAME*); +static void aTB3_actor_draw(ACTOR* actor, GAME*); +static void aTB3_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Biscus3_Profile = { + mAc_PROFILE_T_BISCUS3, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(BISCUS3_ACTOR), + &aTB3_actor_ct, + NONE_ACTOR_PROC, + &aTB3_actor_move, + &aTB3_actor_draw, + NULL +}; + +extern Gfx crw_biscus3_body_model[]; + +static void aTB3_actor_ct(ACTOR* actor, GAME*){ + + aTB3_setupAction(actor,4); +} + +static void aTB3_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTB3_setupAction(ACTOR*actor, int action){ + BISCUS3_ACTOR* biscus = (BISCUS3_ACTOR*)actor; + static BISCUS3_PROC process[] = { + (BISCUS3_PROC)none_proc1,(BISCUS3_PROC)none_proc1,(BISCUS3_PROC)none_proc1,aTB3_destruct,(BISCUS3_PROC)none_proc1,NULL + }; + + biscus->proc = process[action]; + biscus->current_id = action; + biscus->tools_class.process_id = action; + +} + +static void aTB3_actor_move(ACTOR* actor, GAME*){ + BISCUS3_ACTOR* biscus = (BISCUS3_ACTOR*)actor; + + if(biscus->tools_class.process_id != biscus->current_id){ + aTB3_setupAction(actor, biscus->tools_class.process_id); + } + + biscus->proc(actor); +} + +static void aTB3_actor_draw(ACTOR* actor, GAME* game){ + BISCUS3_ACTOR* biscus = (BISCUS3_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(biscus->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); + + biscus->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_biscus3_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file diff --git a/rel/ac_t_biscus4.c b/rel/ac_t_biscus4.c new file mode 100644 index 00000000..26829a6c --- /dev/null +++ b/rel/ac_t_biscus4.c @@ -0,0 +1,90 @@ +#include "ac_t_biscus4.h" + +#include "m_name_table.h" +#include "sys_matrix.h" +#include "m_lib.h" +#include "m_rcp.h" + + +static void aTB4_actor_ct(ACTOR* actor, GAME*); +static void aTB4_actor_move(ACTOR* actor, GAME*); +static void aTB4_actor_draw(ACTOR* actor, GAME*); +static void aTB4_setupAction(ACTOR*, int); + +ACTOR_PROFILE T_Biscus4_Profile = { + mAc_PROFILE_T_BISCUS4, + ACTOR_PART_BG, + ACTOR_STATE_NO_DRAW_WHILE_CULLED | ACTOR_STATE_NO_MOVE_WHILE_CULLED, + EMPTY_NO, + ACTOR_OBJ_BANK_16, + sizeof(BISCUS4_ACTOR), + &aTB4_actor_ct, + NONE_ACTOR_PROC, + &aTB4_actor_move, + &aTB4_actor_draw, + NULL +}; + +extern Gfx crw_biscus4_body_model[]; + +static void aTB4_actor_ct(ACTOR* actor, GAME*){ + + aTB4_setupAction(actor,4); +} + +static void aTB4_destruct(ACTOR* actor){ + + Actor_delete(actor); +} + + +static void aTB4_setupAction(ACTOR*actor, int action){ + BISCUS4_ACTOR* biscus = (BISCUS4_ACTOR*)actor; + static BISCUS4_PROC process[] = { + (BISCUS4_PROC)none_proc1,(BISCUS4_PROC)none_proc1,(BISCUS4_PROC)none_proc1,aTB4_destruct,(BISCUS4_PROC)none_proc1,NULL + }; + + biscus->proc = process[action]; + biscus->current_id = action; + biscus->tools_class.process_id = action; + +} + +static void aTB4_actor_move(ACTOR* actor, GAME*){ + BISCUS4_ACTOR* biscus = (BISCUS4_ACTOR*)actor; + + if(biscus->tools_class.process_id != biscus->current_id){ + aTB4_setupAction(actor, biscus->tools_class.process_id); + } + + biscus->proc(actor); +} + +static void aTB4_actor_draw(ACTOR* actor, GAME* game){ + BISCUS4_ACTOR* biscus = (BISCUS4_ACTOR*)actor; + + GRAPH* graph; + Gfx* gfxp; + + if(biscus->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); + + biscus->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_biscus4_body_model); + SET_POLY_OPA_DISP(gfxp); + + CLOSE_DISP(graph); + } + + +} \ No newline at end of file