File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ pub fn draw_rng(reader: &Gen2Reader) {
3535 pnp:: println!( "DIV {:04X}" , measured_div( ) ) ;
3636 pnp:: println!( "State {:04X}" , reader. rng_state( ) ) ;
3737 pnp:: println!( "Advances {}" , rng_advance( ) ) ;
38+ pnp:: println!( "" ) ;
39+ pnp:: println!( "TID {}" , reader. trainer_id( ) ) ;
3840}
3941
4042pub fn draw_pkx ( pkx : & Pk2 ) {
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ struct Gen2Addresses {
1010 time_ptr : u32 ,
1111 time_day_ptr : u32 ,
1212 play_time_ptr : u32 ,
13+ trainer_id_ptr : u32 ,
1314}
1415
1516const CRYSTAL_ADDRESSES : Gen2Addresses = Gen2Addresses {
@@ -20,6 +21,7 @@ const CRYSTAL_ADDRESSES: Gen2Addresses = Gen2Addresses {
2021 time_ptr : 0xff94 ,
2122 time_day_ptr : 0xd4cb ,
2223 play_time_ptr : 0xd4c5 ,
24+ trainer_id_ptr : 0xd47b ,
2325} ;
2426
2527pub struct Gen2Reader {
@@ -92,4 +94,8 @@ impl Gen2Reader {
9294 pub fn dst ( & self ) -> bool {
9395 ( gb_mem:: read_u8 ( self . addrs . dst_ptr ) & 0x80 ) != 0
9496 }
97+
98+ pub fn trainer_id ( & self ) -> u16 {
99+ gb_mem:: read_u16 ( self . addrs . trainer_id_ptr )
100+ }
95101}
You can’t perform that action at this time.
0 commit comments