Replace License Logo with TMD but results are bad?
This commit is contained in:
parent
f133b26283
commit
54f2b43b4f
|
@ -9,7 +9,8 @@
|
|||
</Defaults>-->
|
||||
<Description>
|
||||
<Publisher>Jaby</Publisher>
|
||||
<License>%PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT</License>
|
||||
<!--<License>%PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT</License>-->
|
||||
<AltLicense>%JABY_ENGINE_DIR%/bin/extern/32BIT.TMD</AltLicense>
|
||||
</Description>
|
||||
<Filesystem lead-out="0:2:0">
|
||||
<File name = "SYSTEM.CNF">System.cnf.subst</File>
|
||||
|
|
|
@ -64,11 +64,11 @@ fn parse_root(root: roxmltree::Node, config: &mut Configuration) -> Result<(), E
|
|||
|
||||
fn parse_description(description: roxmltree::Node, config: &mut Configuration) -> Result<(), Error> {
|
||||
fn parse_license_path(license: roxmltree::Node) -> LicenseFile {
|
||||
LicenseFile::from_option(path_from_node(&license, tag_names::LICENSE).ok())
|
||||
LicenseFile::from_authentic_option(path_from_node(&license, tag_names::LICENSE).ok())
|
||||
}
|
||||
|
||||
fn parse_altlicense_path(license: roxmltree::Node) -> LicenseFile {
|
||||
LicenseFile::from_option(path_from_node(&license, tag_names::ALTLICENSE).ok())
|
||||
LicenseFile::from_tmd_option(path_from_node(&license, tag_names::ALTLICENSE).ok())
|
||||
}
|
||||
|
||||
for node in description.descendants() {
|
||||
|
|
|
@ -237,13 +237,21 @@ fn process_system_area(system_area: &SystemArea, sec_writer: &mut dyn SectorWrit
|
|||
|
||||
fn write_tmd_file(sec_writer: &mut dyn SectorWriter, tmd_file: BufferedInputFile) -> Result<(), Error> {
|
||||
fn write_license_string(sec_writer: &mut dyn SectorWriter, text: &str) -> Result<(), Error> {
|
||||
let text_len = text.len();
|
||||
|
||||
if text_len <= Mode2Form1::DATA_SIZE {
|
||||
let mut license_string_buffer = [0u8; Mode2Form1::DATA_SIZE];
|
||||
|
||||
license_string_buffer[..Mode2Form1::DATA_SIZE].copy_from_slice(text[0..text.len()].as_bytes());
|
||||
license_string_buffer[..text_len].copy_from_slice(text[0..text_len].as_bytes());
|
||||
write_license_string_raw(sec_writer, &license_string_buffer)?;
|
||||
Ok(())
|
||||
}
|
||||
|
||||
else {
|
||||
Err(Error::from_text(format!("License string \"{}\" is longer then supported length {}", text, Mode2Form1::DATA_SIZE)))
|
||||
}
|
||||
}
|
||||
|
||||
fn write_license_logo(sec_writer: &mut dyn SectorWriter, mut tmd_file: BufferedInputFile) -> Result<(), Error> {
|
||||
let bytes = {
|
||||
let mut bytes = vec![];
|
||||
|
|
|
@ -112,7 +112,7 @@ pub enum LicenseFile {
|
|||
}
|
||||
|
||||
impl LicenseFile {
|
||||
pub fn from_option(option: Option<PathBuf>) -> LicenseFile {
|
||||
pub fn from_authentic_option(option: Option<PathBuf>) -> LicenseFile {
|
||||
if let Some(path) = option {
|
||||
LicenseFile::Authentic(path)
|
||||
}
|
||||
|
@ -121,6 +121,16 @@ impl LicenseFile {
|
|||
LicenseFile::None
|
||||
}
|
||||
}
|
||||
|
||||
pub fn from_tmd_option(option: Option<PathBuf>) -> LicenseFile {
|
||||
if let Some(path) = option {
|
||||
LicenseFile::TMD(path)
|
||||
}
|
||||
|
||||
else {
|
||||
LicenseFile::None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct SystemArea {
|
||||
|
|
Loading…
Reference in New Issue