Improve lba_source handling
This commit is contained in:
parent
aaab604f61
commit
a624de92a1
|
@ -4,15 +4,14 @@
|
||||||
<License>%PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT</License>
|
<License>%PSX_LICENSE_PATH%/%PSX_LICENSE%.DAT</License>
|
||||||
</Description>
|
</Description>
|
||||||
<Track lead-out="0:2:0">
|
<Track lead-out="0:2:0">
|
||||||
<!--TODO: JabyEngine should warn at runtime that I did not apply lba_source!-->
|
|
||||||
<File name = "SYSTEM.CNF">System.cnf.subst</File>
|
<File name = "SYSTEM.CNF">System.cnf.subst</File>
|
||||||
<Main name = "%PSX_BOOT_FILE%" lba_source = "../application/src/asset_mgr.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/PoolBox.psexe</Main>
|
<Main name = "%PSX_BOOT_FILE%" lba_source = "../application/src/asset_mgr.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/PoolBox.psexe</Main>
|
||||||
<Overlay name = "BIO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.bios_info</Overlay>
|
<Overlay name = "BIO.BIN" lba_source = "" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.bios_info</Overlay>
|
||||||
<Overlay name = "CTO.BIN" lba_source = "../application/src/Overlay/ControllerTest/controller_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests</Overlay>
|
<Overlay name = "CTO.BIN" lba_source = "../application/src/Overlay/ControllerTest/controller_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.controller_tests</Overlay>
|
||||||
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
|
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
|
||||||
<Overlay name = "GTE.BIN" lba_source = "../application/src/Overlay/GTETest/gte_test_assets.cpp">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
|
<Overlay name = "GTE.BIN" lba_source = "../application/src/Overlay/GTETest/gte_test_assets.cpp" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
|
||||||
<Overlay name = "FCO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.font_cycler</Overlay>
|
<Overlay name = "FCO.BIN" lba_source = "" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.font_cycler</Overlay>
|
||||||
<Overlay name = "SCO.BIN">../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>
|
<Overlay name = "SCO.BIN" lba_source = "" >../application/bin/%PSX_TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>
|
||||||
|
|
||||||
<Directory name = "ASSETS" hidden = "true">
|
<Directory name = "ASSETS" hidden = "true">
|
||||||
<Directory name = "MAIN">
|
<Directory name = "MAIN">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "psxcdgen_ex"
|
name = "psxcdgen_ex"
|
||||||
version = "0.6.0"
|
version = "1.0.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
use attribute_names::LBA_SOURCE;
|
||||||
use cdtypes::types::time::Time;
|
use cdtypes::types::time::Time;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use tool_helper::{format_if_error, path_with_env_from, print_warning, string_with_env_from};
|
use tool_helper::{format_if_error, path_with_env_from, print_warning, string_with_env_from};
|
||||||
|
@ -86,16 +87,26 @@ fn parse_track(track: roxmltree::Node, config: &mut Configuration) -> Result<(),
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
|
tool_helper::print_warning(format!("The main file should always contain the \"{}\" attribute, even when just empty", LBA_SOURCE));
|
||||||
parse_regular_file(file, false)
|
parse_regular_file(file, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_overlay_file(file: roxmltree::Node, is_hidden: bool) -> Result<File, Error> {
|
fn parse_overlay_file(file: roxmltree::Node, is_hidden: bool) -> Result<File, Error> {
|
||||||
// v They will be compressed automatically
|
// v They will be compressed automatically
|
||||||
let common = read_common_properties(&file, is_hidden, Some(LZ4State::AlreadyCompressed))?;
|
let common = read_common_properties(&file, is_hidden, Some(LZ4State::AlreadyCompressed))?;
|
||||||
let path = path_from_node(&file, &common.name)?;
|
let path = path_from_node(&file, &common.name)?;
|
||||||
|
let lba_source = {
|
||||||
|
if let Some(lba_source) = file.attribute(attribute_names::LBA_SOURCE) {
|
||||||
|
lba_source
|
||||||
|
}
|
||||||
|
|
||||||
Ok(File{common, path, kind: FileKind::Overlay(PathBuf::from(file.attribute(attribute_names::LBA_SOURCE).unwrap_or_default()))})
|
else {
|
||||||
|
tool_helper::print_warning(format!("Overlays should always contain the \"{}\" attribute, even when just empty", LBA_SOURCE));
|
||||||
|
""
|
||||||
|
}
|
||||||
|
};
|
||||||
|
Ok(File{common, path, kind: FileKind::Overlay(PathBuf::from(lba_source))})
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_xa_audio(file: roxmltree::Node, is_hidden: bool) -> Result<File, Error> {
|
fn parse_xa_audio(file: roxmltree::Node, is_hidden: bool) -> Result<File, Error> {
|
||||||
|
|
Loading…
Reference in New Issue