Skip to content

Commit

Permalink
Add support for Elden Ring 2.05.0 (#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
veeenu authored Oct 5, 2024
1 parent be3b5dd commit 2d4fa45
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 14 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ members = [
]

[workspace.package]
version = "1.8.4"
version = "1.8.5"
authors = ["Andrea Venuta <[email protected]>"]

[profile.release]
Expand Down
45 changes: 45 additions & 0 deletions lib/libeldenring/src/codegen/base_addresses.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ pub enum Version {
V2_02_3,
V2_03_0,
V2_04_0,
V2_05_0,
}

impl TryFrom<(u32, u32, u32)> for Version {
Expand Down Expand Up @@ -141,6 +142,7 @@ impl TryFrom<(u32, u32, u32)> for Version {
(2, 2, 3) => Ok(Version::V2_02_3),
(2, 3, 0) => Ok(Version::V2_03_0),
(2, 4, 0) => Ok(Version::V2_04_0),
(2, 5, 0) => Ok(Version::V2_05_0),
(maj, min, patch) => {
log::error!("Unrecognized version {maj}.{min:02}.{patch}");
Err(())
Expand Down Expand Up @@ -174,6 +176,7 @@ impl From<Version> for (u32, u32, u32) {
Version::V2_02_3 => (2, 2, 3),
Version::V2_03_0 => (2, 3, 0),
Version::V2_04_0 => (2, 4, 0),
Version::V2_05_0 => (2, 5, 0),
}
}
}
Expand Down Expand Up @@ -203,6 +206,7 @@ impl From<Version> for BaseAddresses {
Version::V2_02_3 => BASE_ADDRESSES_2_02_3,
Version::V2_03_0 => BASE_ADDRESSES_2_03_0,
Version::V2_04_0 => BASE_ADDRESSES_2_04_0,
Version::V2_05_0 => BASE_ADDRESSES_2_05_0,
}
}
}
Expand Down Expand Up @@ -1108,3 +1112,44 @@ pub const BASE_ADDRESSES_2_04_0: BaseAddresses = BaseAddresses {
event_patch2: 0xe535e0,
font_patch: 0x268d360,
};

pub const BASE_ADDRESSES_2_05_0: BaseAddresses = BaseAddresses {
bullet_man: 0x3d62748,
chr_dbg_flags: 0x3d6619f,
csfd4_virtual_memory_flag: 0x3d68448,
cs_flipper: 0x4589ad8,
cs_lua_event_manager: 0x3d67e48,
cs_menu_man: 0x8ba7b624,
cs_menu_man_imp: 0x3d6b7b0,
cs_net_man: 0x3d5ae60,
cs_regulation_manager: 0x3d86c58,
cs_session_manager: 0x3d7a4d0,
damage_ctrl: 0x3d66378,
field_area: 0x3d691d8,
game_data_man: 0x3d5df38,
game_man: 0x3d69918,
global_pos: 0x3d65f88,
group_mask: 0x3b33cff,
hit_ins: 0x3d6a0e0,
hit_ins_hitbox_offset: 0x3d6a0ec,
map_item_man: 0x3d67a50,
menu_man_ins: 0x3d6b7b0,
msg_repository: 0x3d7d4f8,
solo_param_repository: 0x3d81ee8,
world_chr_man: 0x3d65f88,
world_chr_man_dbg: 0x3d66198,
world_chr_man_imp: 0x3d65f88,
func_item_spawn: 0x55ac90,
func_item_inject: 0x5606a0,
func_remove_intro_screens: 0xb0c26d,
func_dbg_action_force: 0x123846b,
lua_warp: 0x599cfe,
current_target: 0x7171fe,
func_check_graces: 0x3d6cfc0,
base_fps: 0x3d76060,
base_anim: 0x3b12e30,
dbg_event_man_off: 0x3d67ff8,
event_patch1: 0xe53600,
event_patch2: 0xe535e0,
font_patch: 0x268d360,
};
22 changes: 11 additions & 11 deletions lib/libeldenring/src/pointers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ impl Pointers {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 => 0x6c8,
V1_04_0 | V1_04_1 | V1_05_0 | V1_06_0 | V1_07_0 => 0x6c0,
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 | V2_02_0 | V2_02_3
| V2_03_0 | V2_04_0 => 0x6d0,
| V2_03_0 | V2_04_0 | V2_05_0 => 0x6d0,
}
};

Expand All @@ -251,7 +251,7 @@ impl Pointers {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 => 0x6b8,
V1_04_0 | V1_04_1 | V1_05_0 | V1_06_0 | V1_07_0 => 0x6b0,
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 | V2_02_0 | V2_02_3
| V2_03_0 | V2_04_0 => 0x6c0,
| V2_03_0 | V2_04_0 | V2_05_0 => 0x6c0,
}
};

Expand All @@ -260,13 +260,13 @@ impl Pointers {
| V1_04_1 => group_mask,
V1_05_0 => group_mask - 8,
V1_06_0 | V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1
| V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => group_mask,
| V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => group_mask,
};

let show_geom = match version {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_06_0 | V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0
| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => {
| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => {
vec![
bitflag!(0b1; group_mask + 2),
bitflag!(0b1; group_mask + 3),
Expand Down Expand Up @@ -306,7 +306,7 @@ impl Pointers {
let show_chr = match version {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_06_0 | V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0
| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => {
| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => {
bitflag!(0b1; group_mask + 0xe)
},
V1_05_0 => bitflag!(0b1; group_mask + 4),
Expand All @@ -316,14 +316,14 @@ impl Pointers {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_05_0 | V1_06_0 => 0xB658,
V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 | V2_02_0
| V2_02_3 | V2_03_0 | V2_04_0 => 0x10EF8,
| V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => 0x10EF8,
};

let player_ins = match version {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_05_0 | V1_06_0 => 0x18468,
V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 | V2_02_0
| V2_02_3 | V2_03_0 | V2_04_0 => 0x1E508,
| V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => 0x1E508,
};

let torrent_enemy_ins = match version {
Expand All @@ -332,7 +332,7 @@ impl Pointers {
V1_06_0 => 0x18378,
V1_07_0 => 0x1E1A0,
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 => 0x1e1b8,
V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => 0x1cc90,
V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => 0x1cc90,
};

// TODO 1.08.x
Expand Down Expand Up @@ -376,7 +376,7 @@ impl Pointers {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_05_0 | V1_06_0 | V1_07_0 | V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1
| V2_00_0 | V2_00_1 => None,
V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => {
V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => {
Some(pointer_chain!(game_data_man, 0x8, 0xfc))
},
},
Expand All @@ -398,7 +398,7 @@ impl Pointers {
match version {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 => 0x6FD,
V1_04_0 | V1_04_1 | V1_05_0 | V1_06_0 | V1_07_0 => 0x6F5,
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 => 0x735
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0| V2_00_1 | V2_02_0 | V2_02_3 | V2_03_0 | V2_04_0 | V2_05_0 => 0x735
}
),
global_position: Position {
Expand Down Expand Up @@ -498,7 +498,7 @@ impl Pointers {
V1_02_0 | V1_02_1 | V1_02_2 | V1_02_3 | V1_03_0 | V1_03_1 | V1_03_2 | V1_04_0
| V1_04_1 | V1_05_0 | V1_06_0 | V1_07_0 => (0xB1, 0xB2),
V1_08_0 | V1_08_1 | V1_09_0 | V1_09_1 | V2_00_0 | V2_00_1 | V2_02_0 | V2_02_3
| V2_03_0 | V2_04_0 => (0xC1, 0xC2),
| V2_03_0 | V2_04_0 | V2_05_0 => (0xC1, 0xC2),
},
current_target: pointer_chain!(current_target),
show_all_map_layers: bitflag!(0b1; func_check_graces),
Expand Down

0 comments on commit 2d4fa45

Please sign in to comment.