From 2de9ecc8440aa77814e08dbd0332270375b17590 Mon Sep 17 00:00:00 2001 From: InusualZ Date: Wed, 1 Jun 2022 20:51:03 -0400 Subject: [PATCH] dol: add and use new `DolSectionType::Text` --- dol/src/lib.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/dol/src/lib.rs b/dol/src/lib.rs index 890d322..94059b2 100644 --- a/dol/src/lib.rs +++ b/dol/src/lib.rs @@ -146,6 +146,7 @@ impl Dol { #[derive(Debug, Clone, Copy, Eq, PartialEq)] pub enum DolSectionType { + Text, Data, Bss, } @@ -168,9 +169,15 @@ impl From<&DolHeaderData> for DolHeader { fn from(header: &DolHeaderData) -> Self { let mut sections = Vec::with_capacity(DolHeaderData::SECTION_COUNT); for i in 0..DolHeaderData::SECTION_COUNT { + let kind = if i < 7 { + DolSectionType::Text + } else { + DolSectionType::Data + }; + if header.section_sizes[i] > 0 { sections.push(DolSection { - kind: DolSectionType::Data, + kind, index: i, offset: header.section_offsets[i], target: header.section_targets[i],