Skip to content

Commit 7319361

Browse files
committed
Show Gen 6 seed hash for new saves
1 parent 6b5a59f commit 7319361

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

reader_core/src/gen6/draw.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use super::{
2+
game_lib::get_seed_hash,
23
reader::{Daycare, Gen6Reader},
34
rng::Gen6Rng,
45
};
@@ -73,10 +74,13 @@ pub fn draw_dex_nav(reader: &Gen6Reader, rng: &Gen6Rng) {
7374

7475
pub fn draw_seed_rng(reader: &Gen6Reader, rng: &Gen6Rng) {
7576
let datetime = pnp::os_time();
77+
let hash = get_seed_hash();
78+
let seed_hash = (hash as u32) ^ (hash >> 32) as u32;
7679

7780
draw_mt(rng);
7881
pnp::println!("");
7982
pnp::println!("");
83+
pnp::println!("Seed hash: {:08X}", seed_hash);
8084
pnp::println!("Save var: {:08X}", reader.seed_save_variable());
8185
pnp::println!("Date: {}", datetime.format("%b %d %Y"));
8286
pnp::println!("Time: {}", datetime.format("%H:%M:%S"));

reader_core/src/gen6/game_lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
use crate::title::title_id;
2+
use crate::title::SupportedTitle;
3+
use crate::utils::game_fn;
4+
5+
game_fn!(xy_get_seed_hash() -> u64 = 0x10cad8);
6+
game_fn!(oras_get_seed_hash() -> u64 = 0x10ca94);
7+
8+
pub fn get_seed_hash() -> u64 {
9+
match title_id() {
10+
SupportedTitle::X | SupportedTitle::Y => xy_get_seed_hash(),
11+
SupportedTitle::Or | SupportedTitle::As => oras_get_seed_hash(),
12+
_ => 0,
13+
}
14+
}

reader_core/src/gen6/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
mod draw;
2+
mod game_lib;
23
mod oras_frame;
34
mod reader;
45
mod rng;

0 commit comments

Comments
 (0)