Skip to content

Commit

Permalink
misc updates
Browse files Browse the repository at this point in the history
  • Loading branch information
blu-dev committed Nov 12, 2023
1 parent c38e7bc commit d065af1
Show file tree
Hide file tree
Showing 4 changed files with 371 additions and 181 deletions.
139 changes: 93 additions & 46 deletions src/app/modules/motion_animcmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,42 +4,71 @@ use crate::*;
#[derive(TypeAssert)]
#[size = 0x18]
pub struct MotionScriptState {
#[offset = 0x00] motion_kind: phx::Hash40,
#[offset = 0x08] start_frame: f32,
#[offset = 0x0C] motion_rate: f32,
#[offset = 0x10] alternate_fighter_kind: i32,
#[offset = 0x14] disable_excute: bool,
#[offset = 0x15] disable_acmd: bool,
#[offset = 0x16] use_alternate_fighter_kind: bool,

#[offset = 0x00]
motion_kind: phx::Hash40,
#[offset = 0x08]
start_frame: f32,
#[offset = 0x0C]
motion_rate: f32,
#[offset = 0x10]
alternate_fighter_kind: i32,
#[offset = 0x14]
disable_excute: bool,
#[offset = 0x15]
disable_acmd: bool,
#[offset = 0x16]
use_alternate_fighter_kind: bool,
}
#[repr(C)]
#[derive(TypeAssert)]
#[size = 0x118]
pub struct MotionAnimcmdState {
#[offset = 0x000] owner: *mut app::BattleObjectModuleAccessor,
#[offset = 0x008] agent_kind: i32,
#[offset = 0x00C] _xC: i32,
#[offset = 0x010] entry_id: app::FighterEntryID,
#[offset = 0x018] main_script: MotionScriptState,
#[offset = 0x030] partial_script: MotionScriptState,
#[offset = 0x048] main_update_rate: f32,
#[offset = 0x04C] partial_update_rate: f32,
#[offset = 0x050] sleep_game: bool,
#[offset = 0x051] sleep_expression: bool,
#[offset = 0x052] sleep_sound: bool,
#[offset = 0x053] sleep_effect: bool,
#[offset = 0x058] self_main_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x078] self_partial_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x098] self_agent_kinds: [i32; 4],
#[offset = 0x0A8] shared_agent_kinds: [i32; 4],
#[offset = 0x0B8] shared_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x0D8] _padding: u64,
#[offset = 0x0E0] function_object: [u64; 6],
#[offset = 0x110] skip_delay_update: bool,
#[offset = 0x111] is_sleep: bool,
#[offset = 0x112] change_main_immediate: bool,
#[offset = 0x113] change_partial_immediate: bool,
#[offset = 0x000]
pub owner: *mut app::BattleObjectModuleAccessor,
#[offset = 0x008]
pub agent_kind: i32,
#[offset = 0x00C]
pub _xC: i32,
#[offset = 0x010]
pub entry_id: app::FighterEntryID,
#[offset = 0x018]
pub main_script: MotionScriptState,
#[offset = 0x030]
pub partial_script: MotionScriptState,
#[offset = 0x048]
pub main_update_rate: f32,
#[offset = 0x04C]
pub partial_update_rate: f32,
#[offset = 0x050]
pub sleep_game: bool,
#[offset = 0x051]
pub sleep_expression: bool,
#[offset = 0x052]
pub sleep_sound: bool,
#[offset = 0x053]
pub sleep_effect: bool,
#[offset = 0x058]
pub self_main_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x078]
pub self_partial_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x098]
pub self_agent_kinds: [i32; 4],
#[offset = 0x0A8]
pub shared_agent_kinds: [i32; 4],
#[offset = 0x0B8]
pub shared_agents: [*mut lib::AnimcmdAgent; 4],
#[offset = 0x0D8]
pub _padding: u64,
#[offset = 0x0E0]
pub function_object: [u64; 6],
#[offset = 0x110]
pub skip_delay_update: bool,
#[offset = 0x111]
pub is_sleep: bool,
#[offset = 0x112]
pub change_main_immediate: bool,
#[offset = 0x113]
pub change_partial_immediate: bool,
}

#[repr(C)]
Expand All @@ -54,11 +83,11 @@ pub(crate) struct MotionAnimcmdModuleVTable {
deleter: extern "C" fn(this: &mut MotionAnimcmdModule),

/// Checks if this module is implemented
///
///
/// ### Returns
/// * `true` - The module is **not** implemented
/// * `false` - The module **is** implemented
///
///
/// ### Notes
/// If the module is not implemented, there should be no attempt to
/// either of the following:
Expand All @@ -68,10 +97,12 @@ pub(crate) struct MotionAnimcmdModuleVTable {
pub is_virtual: extern "C" fn(this: &MotionAnimcmdModule),

#[offset = 0x18]
handle_int_msc_command: extern "C" fn(this: &mut MotionAnimcmdModule, command: &lib::MscCommand) -> lib::TValue,
handle_int_msc_command:
extern "C" fn(this: &mut MotionAnimcmdModule, command: &lib::MscCommand) -> lib::TValue,

#[offset = 0x20]
handle_float_msc_command: extern "C" fn(this: &mut MotionAnimcmdModule, command: &lib::MscCommand) -> lib::TValue,
handle_float_msc_command:
extern "C" fn(this: &mut MotionAnimcmdModule, command: &lib::MscCommand) -> lib::TValue,

#[offset = 0x28]
initialize: extern "C" fn(this: &mut MotionAnimcmdModule, module_init_args: *const u64),
Expand All @@ -81,7 +112,7 @@ pub(crate) struct MotionAnimcmdModuleVTable {

#[offset = 0x38]
start_module: extern "C" fn(this: &mut MotionAnimcmdModule),

#[offset = 0x40]
end_module: extern "C" fn(this: &mut MotionAnimcmdModule),

Expand All @@ -95,7 +126,8 @@ pub(crate) struct MotionAnimcmdModuleVTable {
pub exec_motion_lines: extern "C" fn(this: &mut MotionAnimcmdModule, update_rate: f32) -> i32,

#[offset = 0x60]
pub exec_partial_motion_lines: extern "C" fn(this: &mut MotionAnimcmdModule, update_rate: f32) -> i32,
pub exec_partial_motion_lines:
extern "C" fn(this: &mut MotionAnimcmdModule, update_rate: f32) -> i32,

#[offset = 0x68]
pub change_script_motion_lines: extern "C" fn(
Expand All @@ -105,7 +137,7 @@ pub(crate) struct MotionAnimcmdModuleVTable {
disable_excute: bool,
disable_acmd: bool,
rate: f32,
alternate_agent: bool
alternate_agent: bool,
),

#[offset = 0x70]
Expand All @@ -116,17 +148,31 @@ pub(crate) struct MotionAnimcmdModuleVTable {
disable_excute: bool,
disable_acmd: bool,
rate: f32,
alternate_agent: bool
alternate_agent: bool,
),

#[offset = 0x78]
pub call_script_single: extern "C" fn(this: &mut MotionAnimcmdModule, acmd_category: i32, script_name: phx::Hash40, agent_kind: i32),
pub call_script_single: extern "C" fn(
this: &mut MotionAnimcmdModule,
acmd_category: i32,
script_name: phx::Hash40,
agent_kind: i32,
),

#[offset = 0x80]
pub change_script_motion_line_single: extern "C" fn(this: &mut MotionAnimcmdModule, acmd_category: i32, motion_kind: phx::Hash40, agent_kind: i32),
pub change_script_motion_line_single: extern "C" fn(
this: &mut MotionAnimcmdModule,
acmd_category: i32,
motion_kind: phx::Hash40,
agent_kind: i32,
),

#[offset = 0x88]
pub exec_motion_lines_initialize: extern "C" fn(this: &mut MotionAnimcmdModule, start_frame: f32, disable_excute: bool) -> i32,
pub exec_motion_lines_initialize: extern "C" fn(
this: &mut MotionAnimcmdModule,
start_frame: f32,
disable_excute: bool,
) -> i32,

#[offset = 0x90]
pub flush_current_motion: extern "C" fn(this: &mut MotionAnimcmdModule),
Expand All @@ -153,17 +199,18 @@ pub(crate) struct MotionAnimcmdModuleVTable {
pub enable_skip_delay_update: extern "C" fn(this: &mut MotionAnimcmdModule),

#[offset = 0xD0]
pub set_change_partial_immediate: extern "C" fn(this: &mut MotionAnimcmdModule, change_immediate: bool),
pub set_change_partial_immediate:
extern "C" fn(this: &mut MotionAnimcmdModule, change_immediate: bool),

#[offset = 0xD8]
set_function_object: extern "C" fn(this: &mut MotionAnimcmdModule, object: *const u64),

#[offset = 0xE0]
unk_2: extern "C" fn(this: &mut MotionAnimcmdModule)
unk_2: extern "C" fn(this: &mut MotionAnimcmdModule),
}

#[repr(C)]
pub struct MotionAnimcmdModule {
vtable: &'static MotionAnimcmdModuleVTable,
state: *mut MotionAnimcmdState
}
state: *mut MotionAnimcmdState,
}
Loading

0 comments on commit d065af1

Please sign in to comment.