Skip to content

Commit c970d42

Browse files
committed
Further Cleanup
1 parent 4718c2c commit c970d42

File tree

3 files changed

+73
-73
lines changed

3 files changed

+73
-73
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
#[skyline::hook(offset=0x6a7100)] // unadjusted for 13.0.2?
3-
pub fn stub_kill_screen() {}
2+
// #[skyline::hook(offset=0x6a7100)] // unadjusted for 13.0.2?
3+
// pub fn stub_kill_screen() {}
44

55
pub fn install() {
66
unsafe {
77
// linear hitstun patch
88
skyline::patching::Patch::in_text(0x62BA74).data(0xD2800000u32);
99
}
10-
skyline::install_hooks!(
11-
//stub_kill_screen,
12-
);
10+
// skyline::install_hooks!(
11+
// stub_kill_screen,
12+
// );
1313
}

fighters/common/src/function_hooks/stage_hazards.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ unsafe fn lylat_no_rot(ctx: &mut skyline::hooks::InlineCtx) {
9898
// 0x2 - corneria
9999
// 0x3 - space battle (small ships)
100100
// 0x4 - default haz off space
101-
#[skyline::hook(offset = 0x297D68C, inline)]
102-
unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
103-
// if get_current_stage_alt() == 0 {
104-
// *ctx.registers[8].x.as_mut() = 0x2;
105-
// } else {
106-
*ctx.registers[8].x.as_mut() = 0x4;
107-
// }
108-
}
101+
// #[skyline::hook(offset = 0x297D68C, inline)]
102+
// unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
103+
// // if get_current_stage_alt() == 0 {
104+
// // *ctx.registers[8].x.as_mut() = 0x2;
105+
// // } else {
106+
// *ctx.registers[8].x.as_mut() = 0x4;
107+
// // }
108+
// }
109109

110110
pub fn install() {
111111
// NOTE: The 0xc80 is from the 13.0.1 -> 13.0.2 port

fighters/common/src/misc.rs

+60-60
Original file line numberDiff line numberDiff line change
@@ -19,67 +19,67 @@ unsafe fn steve_parry_stuff_fix(ctx: &mut skyline::hooks::InlineCtx) {
1919
}
2020
}
2121

22-
#[skyline::hook(offset = 0x641814, inline)]
23-
unsafe fn shield_damage_analog(ctx: &skyline::hooks::InlineCtx) {
24-
let boma =
25-
*(*ctx.registers[0].x.as_ref() as *const u64).add(1) as *mut BattleObjectModuleAccessor;
26-
let current_shield = WorkModule::get_float(boma, 6);
27-
let attack_power = *(*ctx.registers[19].x.as_ref() as *const f32).add(0xf730 / 4);
28-
let analog = InputModule::get_analog_for_guard((*boma).object());
29-
let damage_mul = WorkModule::get_param_float(
30-
boma,
31-
smash::hash40("common"),
32-
smash::hash40("shield_damage_mul"),
33-
);
34-
let damage_mul = if analog > 0.0 && analog < 1.0 {
35-
damage_mul + 0.2 * (1.0 - analog)
36-
} else {
37-
damage_mul
38-
};
39-
WorkModule::set_float(boma, current_shield - attack_power * damage_mul, 6);
40-
}
41-
42-
#[skyline::hook(offset = 0x6285f0, inline)]
43-
unsafe fn shield_pushback_analog(ctx: &skyline::hooks::InlineCtx) {
44-
let fighter = *ctx.registers[19].x.as_ref();
45-
let boma = *(fighter as *const u64).add(4);
46-
let attack_module: u64 = *(boma as *const u64).add(0xa0 / 8);
47-
let transactor_count: u64 = *(attack_module as *const u64).add(0x20 / 8);
48-
let transactors: u64 = *(attack_module as *const u64).add(0x28 / 8);
49-
50-
let mul = WorkModule::get_param_float(
51-
boma as _,
52-
smash::hash40("common"),
53-
smash::hash40("shield_rebound_speed_mul"),
54-
);
55-
56-
for x in 0..transactor_count {
57-
let transactor = transactors + 720 * x;
58-
let p_list = *(transactor as *const u64).add(608 / 8);
59-
if p_list == 0 {
60-
continue;
61-
}
62-
63-
let mut current = *(p_list as *const u64);
64-
while current != p_list && current != 0 {
65-
if *(current as *const u8).add(47) == 2 {
66-
let battle_object_id = *(current as *const u32).add(36 / 4);
67-
let object = utils::util::get_battle_object_from_id(battle_object_id);
68-
let analog = InputModule::get_analog_for_guard(object);
69-
let mul = if analog > 0.0 && analog < 1.0 {
70-
mul * analog * 0.1
71-
} else {
72-
mul
73-
};
74-
std::arch::asm!("fmov s0, w8", in("w8") mul);
75-
return;
76-
}
22+
// #[skyline::hook(offset = 0x641814, inline)]
23+
// unsafe fn shield_damage_analog(ctx: &skyline::hooks::InlineCtx) {
24+
// let boma =
25+
// *(*ctx.registers[0].x.as_ref() as *const u64).add(1) as *mut BattleObjectModuleAccessor;
26+
// let current_shield = WorkModule::get_float(boma, 6);
27+
// let attack_power = *(*ctx.registers[19].x.as_ref() as *const f32).add(0xf730 / 4);
28+
// let analog = InputModule::get_analog_for_guard((*boma).object());
29+
// let damage_mul = WorkModule::get_param_float(
30+
// boma,
31+
// smash::hash40("common"),
32+
// smash::hash40("shield_damage_mul"),
33+
// );
34+
// let damage_mul = if analog > 0.0 && analog < 1.0 {
35+
// damage_mul + 0.2 * (1.0 - analog)
36+
// } else {
37+
// damage_mul
38+
// };
39+
// WorkModule::set_float(boma, current_shield - attack_power * damage_mul, 6);
40+
// }
7741

78-
current = *(current as *const u64);
79-
}
80-
}
81-
std::arch::asm!("fmov s0, w8", in("w8") mul);
82-
}
42+
// #[skyline::hook(offset = 0x6285f0, inline)]
43+
// unsafe fn shield_pushback_analog(ctx: &skyline::hooks::InlineCtx) {
44+
// let fighter = *ctx.registers[19].x.as_ref();
45+
// let boma = *(fighter as *const u64).add(4);
46+
// let attack_module: u64 = *(boma as *const u64).add(0xa0 / 8);
47+
// let transactor_count: u64 = *(attack_module as *const u64).add(0x20 / 8);
48+
// let transactors: u64 = *(attack_module as *const u64).add(0x28 / 8);
49+
50+
// let mul = WorkModule::get_param_float(
51+
// boma as _,
52+
// smash::hash40("common"),
53+
// smash::hash40("shield_rebound_speed_mul"),
54+
// );
55+
56+
// for x in 0..transactor_count {
57+
// let transactor = transactors + 720 * x;
58+
// let p_list = *(transactor as *const u64).add(608 / 8);
59+
// if p_list == 0 {
60+
// continue;
61+
// }
62+
63+
// let mut current = *(p_list as *const u64);
64+
// while current != p_list && current != 0 {
65+
// if *(current as *const u8).add(47) == 2 {
66+
// let battle_object_id = *(current as *const u32).add(36 / 4);
67+
// let object = utils::util::get_battle_object_from_id(battle_object_id);
68+
// let analog = InputModule::get_analog_for_guard(object);
69+
// let mul = if analog > 0.0 && analog < 1.0 {
70+
// mul * analog * 0.1
71+
// } else {
72+
// mul
73+
// };
74+
// std::arch::asm!("fmov s0, w8", in("w8") mul);
75+
// return;
76+
// }
77+
78+
// current = *(current as *const u64);
79+
// }
80+
// }
81+
// std::arch::asm!("fmov s0, w8", in("w8") mul);
82+
// }
8383

8484
pub fn install() {
8585
smashline::Agent::new("fighter")

0 commit comments

Comments
 (0)