Skip to content

Commit cf5bcb9

Browse files
committed
Updates for 02-2026 STD
1 parent 5f9fce9 commit cf5bcb9

7 files changed

Lines changed: 28 additions & 31 deletions

File tree

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ walkdir = "2.3.3"
2222
thiserror = "1.0.43"
2323
camino = "1"
2424
# Switch utilities
25-
skyline = { git = "https://github.com/ultimate-research/skyline-rs" }
25+
skyline = "0.6"
2626
skyline-config = { git = "https://github.com/skyline-rs/skyline-config" }
2727
# For the updater
2828
zip = { version = "0.6", default-features = false, features = ["deflate"], optional = true }
@@ -42,7 +42,7 @@ orbits = { git = "https://github.com/blu-dev/orbits" }
4242
smash-arc = { git = "https://github.com/jam1garner/smash-arc", features = ["smash-runtime", "rust-zstd", "serialize"] }
4343
hash40 = "1.3"
4444
arcropolis-api = { git = "https://github.com/Raytwo/arcropolis_api" }
45-
arc-config = { git = "https://github.com/blu-dev/arc-config", features = ["runtime"] }
45+
arc-config = { git = "https://github.com/Raytwo/arc-config", features = ["runtime"] }
4646
# For arc:/ and mods:/
4747
nn-fuse = { git = "https://github.com/Raytwo/nn-fuse" }
4848
prcx = { git = "https://github.com/zrksyd/prcx", branch = "xml-style-zrksyd" }

crates/config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ serde_json = "1.0"
1111
toml = "0.5.11"
1212
log = "0.4.19"
1313
smash-arc = { git = "https://github.com/jam1garner/smash-arc", default-features = false}
14-
skyline = { git = "https://github.com/Raytwo/skyline-rs", branch="preview" }
14+
skyline = "0.6"
1515
skyline-config = { git = "https://github.com/skyline-rs/skyline-config" }
1616
thiserror = "1.0.43"
1717
semver = { version = "1", features = ["serde"] }

crates/menus/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ skyline-web = { git = "https://github.com/skyline-rs/skyline-web" }
1313
skyline-config = { git = "https://github.com/skyline-rs/skyline-config" }
1414
log = "0.4.19"
1515
smash-arc = { git = "https://github.com/jam1garner/smash-arc" }
16-
skyline = { git = "https://github.com/Raytwo/skyline-rs", branch="preview" }
16+
skyline = "0.6"
1717
config = { path = "../config" }
1818
semver = { version = "1", features = ["serde"] }
1919
camino = "1"

src/api/lua.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::lua::lua::{lua_state, luaL_Reg_container, luaL_Reg_from_api};
22
use std::ffi::CString;
33

44
#[no_mangle]
5-
pub extern "C" fn arcorp_add_lua_menu_manager(name: *mut i8, reg_vec_ptr: *mut luaL_Reg_from_api, reg_vec_size: usize, reg_vec_cap: usize) -> bool {
5+
pub extern "C" fn arcorp_add_lua_menu_manager(name: *mut u8, reg_vec_ptr: *mut luaL_Reg_from_api, reg_vec_size: usize, reg_vec_cap: usize) -> bool {
66
debug!("arcorp_add_lua_menu_manager -> Function called");
77
unsafe {
88
match CString::from_raw(name).to_str() {
@@ -28,7 +28,7 @@ pub extern "C" fn arcorp_add_lua_menu_manager(name: *mut i8, reg_vec_ptr: *mut l
2828
}
2929

3030
#[no_mangle]
31-
pub extern "C" fn arcorp_add_lua_ingame_manager(name: *mut i8, reg_vec_ptr: *mut luaL_Reg_from_api, reg_vec_size: usize, reg_vec_cap: usize) -> bool {
31+
pub extern "C" fn arcorp_add_lua_ingame_manager(name: *mut u8, reg_vec_ptr: *mut luaL_Reg_from_api, reg_vec_size: usize, reg_vec_cap: usize) -> bool {
3232
debug!("arcorp_add_lua_ingame_manager -> Function called");
3333
unsafe {
3434
match CString::from_raw(name).to_str() {
@@ -95,7 +95,7 @@ pub extern "C" fn arcrop_lua_state_push_nil(lua_state: &mut lua_state) {
9595
}
9696

9797
#[no_mangle]
98-
pub extern "C" fn arcrop_lua_state_push_string(lua_state: &mut lua_state, str: *mut i8) {
98+
pub extern "C" fn arcrop_lua_state_push_string(lua_state: &mut lua_state, str: *mut u8) {
9999
debug!("arcrop_lua_state_push_string -> Function called");
100100
unsafe { lua_state.push_string(CString::from_raw(str).to_str().expect("Failed to get string from str pointer!")); }
101101
}

src/fixes.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use skyline::{from_offset, hook, hooks::InlineCtx, install_hooks, patching::{Pat
55
fn install_inkling_patches() {
66
#[skyline::hook(offset = offsets::clear_ink_patch(), inline)]
77
unsafe fn clear_ink_patch(ctx: &mut InlineCtx) {
8-
let res = (*ctx.registers[24].w.as_ref() as u32) % 8;
9-
*ctx.registers[24].w.as_mut() = res;
8+
let res = ctx.registers[24].w() % 8;
9+
ctx.registers[24].set_w(res);
1010
}
1111

1212
// Inkling Patches here nop some branches so it can work with more than c08+
@@ -39,7 +39,7 @@ fn install_added_color_patches() {
3939

4040
#[hook(offset = offsets::set_global_color_for_classic_mode(), inline)]
4141
pub unsafe fn set_global_color_for_classic_mode(ctx: &mut InlineCtx) {
42-
*(ctx.registers[9].w.as_mut()) = *(ctx.registers[9].w.as_ref()) % 8;
42+
ctx.registers[9].set_w(ctx.registers[9].w() % 8);
4343
}
4444

4545
skyline::install_hook!(set_global_color_for_classic_mode);
@@ -126,8 +126,8 @@ fn install_lazy_loading_patches() {
126126
#[hook(offset = offsets::load_chara_1_for_all_costumes(), inline)]
127127
pub unsafe fn original_load_chara_1_ui_for_all_colors(ctx: &mut InlineCtx) {
128128
// Save the first and fourth parameter for reference when we load the file ourselves
129-
PARAM_1 = *ctx.registers[0].x.as_ref();
130-
PARAM_4 = *ctx.registers[3].x.as_ref();
129+
PARAM_1 = ctx.registers[0].x();
130+
PARAM_4 = ctx.registers[3].x();
131131
}
132132

133133
#[hook(offset = offsets::load_stock_icon_for_portrait_menu(), inline)]
@@ -137,8 +137,8 @@ fn install_lazy_loading_patches() {
137137
CharaSelectMenu, which means we should be pretty safe loading the CSPs
138138
*/
139139
if PARAM_1 != 0 && PARAM_4 != 0 {
140-
let ui_chara_hash = *ctx.registers[1].x.as_ref();
141-
let color = *ctx.registers[2].w.as_ref();
140+
let ui_chara_hash = ctx.registers[1].x();
141+
let color = ctx.registers[2].w();
142142
let path = get_ui_chara_path_from_hash_color_and_type(ui_chara_hash, color, 1);
143143
load_ui_file(PARAM_1 as *const u64, &path, 0, PARAM_4);
144144
}

src/lib.rs

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ static mut NEWS_DATA: LazyLock<RwLock<HashMap<String, String>>> = LazyLock::new(
5050
#[macro_export]
5151
macro_rules! reg_x {
5252
($ctx:ident, $no:expr) => {
53-
unsafe { *$ctx.registers[$no].x.as_ref() }
53+
$ctx.registers[$no].x()
5454
};
5555
}
5656

5757
#[macro_export]
5858
macro_rules! reg_w {
5959
($ctx:ident, $no:expr) => {
60-
unsafe { *$ctx.registers[$no].w.as_ref() }
60+
$ctx.registers[$no].w()
6161
};
6262
}
6363

@@ -342,13 +342,13 @@ unsafe fn msbt_text(ctx: &mut InlineCtx) {
342342
text.push('\0');
343343

344344
let text_vec: Vec<u16> = text.encode_utf16().collect();
345-
*ctx.registers[0].x.as_mut() = text_vec.as_ptr() as u64;
345+
ctx.registers[0].set_x(text_vec.as_ptr() as u64);
346346
}
347347
}
348348

349349
#[skyline::hook(offset = offsets::packet_send(), inline)]
350350
unsafe fn online_slot_spoof(ctx: &InlineCtx) {
351-
let data = *ctx.registers[3].x.as_ref() as *mut u8;
351+
let data = ctx.registers[3].x() as *mut u8;
352352

353353
if data.is_null() {
354354
return;
@@ -371,9 +371,9 @@ pub fn is_online() -> bool {
371371
unsafe fn change_fighter_color_r(ctx: &mut skyline::hooks::InlineCtx) {
372372
if is_online() {
373373
unsafe {
374-
if *ctx.registers[8].w.as_ref() >= 8 {
375-
*ctx.registers[8].w.as_mut() = 0; // Actual color
376-
*ctx.registers[3].w.as_mut() = 0; // UI
374+
if ctx.registers[8].w() >= 8 {
375+
ctx.registers[8].set_w(0); // Actual color
376+
ctx.registers[3].set_w(0); // UI
377377
}
378378
}
379379
}
@@ -383,33 +383,30 @@ unsafe fn change_fighter_color_r(ctx: &mut skyline::hooks::InlineCtx) {
383383
unsafe fn change_fighter_color_l(ctx: &mut skyline::hooks::InlineCtx) {
384384
if is_online() {
385385
unsafe {
386-
if *ctx.registers[8].w.as_ref() >= 8 {
386+
if ctx.registers[8].w() >= 8 {
387387
// Assuming that if they can change a character's color then that means a character has at least a set of 8 colors
388-
*ctx.registers[8].w.as_mut() = 7; // Actual color
389-
*ctx.registers[3].w.as_mut() = 7; // UI
388+
ctx.registers[8].set_w(7); // Actual color
389+
ctx.registers[3].set_w(7); // UI
390390
}
391391
}
392392
}
393393
}
394394

395395
#[skyline::hook(offset = offsets::skip_opening(), inline)]
396396
unsafe fn skip_opening_cutscene(ctx: &mut InlineCtx) {
397-
let data = ctx.registers[8].x.as_mut();
398-
*data = 0;
397+
ctx.registers[8].set_x(0);
399398
}
400399

401400
// Change the next callback for the TitleSceneInfo::callbacks::Enter from "DisplayOpeningCutscene" to "HowToPlay"
402401
#[skyline::hook(offset = offsets::title_scene_play_opening(), inline)]
403402
unsafe fn title_scene_play_opening(ctx: &mut InlineCtx) {
404-
let data = ctx.registers[9].x.as_mut();
405-
*data = 1;
403+
ctx.registers[9].set_x(1);
406404
}
407405

408406
// Pretend the state for another state handler (OpeningCutsceneLayout?) is set to 5
409407
#[skyline::hook(offset = offsets::title_scene_how_to_play(), inline)]
410408
unsafe fn title_scene_show_how_to_play_fake_state_index(ctx: &mut InlineCtx) {
411-
let data = ctx.registers[8].x.as_mut();
412-
*data = 5;
409+
ctx.registers[8].set_x(5);
413410
}
414411

415412
#[skyline::main(name = "arcropolis")]

src/lua/lua.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ pub struct luaL_Reg_container {
7272
#[repr(C)]
7373
#[derive(Debug)]
7474
pub struct luaL_Reg_from_api {
75-
pub name: *mut i8,
75+
pub name: *mut u8,
7676
pub func: LuaCfunction,
7777
}
7878

0 commit comments

Comments
 (0)