From ddc14856e441e997c3f3017dd8583704173360da Mon Sep 17 00:00:00 2001 From: Jaby Date: Thu, 24 Aug 2023 00:24:20 +0200 Subject: [PATCH] Improve identification of Overlays --- src/Tools/psxreadmap/src/lib.rs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/src/Tools/psxreadmap/src/lib.rs b/src/Tools/psxreadmap/src/lib.rs index f0e70241..a52e66b5 100644 --- a/src/Tools/psxreadmap/src/lib.rs +++ b/src/Tools/psxreadmap/src/lib.rs @@ -413,12 +413,24 @@ impl ConsoleUI { let section_list = List::new(data.section_info.iter().map( |section| { - let mut new_item = ListItem::new(section.name.clone()); - - if let Some(color) = section.color_share { - new_item = new_item.style(Style::default().fg(color)); - } - new_item + ListItem::new(Line::from(vec![{ + if let Some(color) = section.color_share { + Span::styled("*", Style::default().fg(color)) + } + else { + Span::raw("") + } + }, + Span::raw( + if section.is_global { + String::from("") + } + + else { + section.name.clone() + } + ) + ])) }).collect::>()).style(Style::default().fg(Color::White)) .block(Self::create_default_border("Section")) .highlight_style(Style::default().add_modifier(Modifier::REVERSED|Modifier::BOLD)); @@ -547,6 +559,7 @@ impl ConsoleUIData { size: program_size, max_size: Self::RAM_SIZE, color_share: None, + is_global: true }); for section in memory_map.sections { @@ -557,6 +570,7 @@ impl ConsoleUIData { size: section.size, max_size: program_size, color_share: None, + is_global: false }); } @@ -594,7 +608,8 @@ struct SectionInfo { pub start_adr: u64, pub size: usize, pub max_size: usize, - pub color_share: Option + pub color_share: Option, + pub is_global: bool, } impl SectionInfo {