Use new substitution feature to switch between serial codes

This commit is contained in:
Jaby 2024-03-21 17:23:38 -05:00
parent f865be0c7c
commit 618c671844
7 changed files with 21 additions and 13 deletions

View File

@ -12,17 +12,17 @@ endif
ifeq ($(REGION),SCEE)
export TV_FORMAT=PAL
export LICENSE=LICENSEE
export BOOT=SLES_000.25
export BOOT_FILE=SLES_000.25
endif
ifeq ($(REGION),SCEA)
export TV_FORMAT=NTSC
export LICENSE=LICENSEA
export BOOT=SLUS_001.51
export BOOT_FILE=SLUS_001.51
endif
ifeq ($(REGION),SCEI)
export TV_FORMAT=NTSC
export LICENSE=LICENSEJ
export BOOT=XXXX_AAA.AA
export BOOT_FILE=XXXX_AAA.AA
endif
ifndef TV_FORMAT

View File

@ -4,11 +4,11 @@
<License>%PSX_LICENSE_PATH%/%LICENSE%.DAT</License>
</Description>
<Track>
<File name = "SYSTEM.CNF">System.cnf</File>
<File name = "SYSTEM.CNF">System.cnf.subst</File>
<!--For pkg use: SLES_000.25;1 or SLUS_001.51;1 - no japanse version yet. Otherwise leave as "XXXX_AAA.AA"-->
<Main name = "%BOOT%" lba_source = "../application/src/asset_mgr.cpp">../application/bin/%TV_FORMAT%/PSX-release/PoolBox.psexe</Main>
<Overlay name = "CTO.BIN" lba_source = "../application/src/Overlay/ControllerTest/controller_test_assets.cpp">../application/bin/%TV_FORMAT%/PSX-release/Overlay.controller_tests</Overlay>
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp">../application/bin/%TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
<Main name = "%BOOT_FILE%" lba_source = "../application/src/asset_mgr.cpp">../application/bin/%TV_FORMAT%/PSX-release/PoolBox.psexe</Main>
<Overlay name = "CTO.BIN" lba_source = "../application/src/Overlay/ControllerTest/controller_test_assets.cpp">../application/bin/%TV_FORMAT%/PSX-release/Overlay.controller_tests</Overlay>
<Overlay name = "GTO.BIN" lba_source = "../application/src/Overlay/GPUTest/gpu_test_assets.cpp">../application/bin/%TV_FORMAT%/PSX-release/Overlay.gpu_tests</Overlay>
<Overlay name = "GTE.BIN">../application/bin/%TV_FORMAT%/PSX-release/Overlay.gte_tests</Overlay>
<Overlay name = "FCO.BIN">../application/bin/%TV_FORMAT%/PSX-release/Overlay.font_cycler</Overlay>
<Overlay name = "SCO.BIN">../application/bin/%TV_FORMAT%/PSX-release/Overlay.screen_center</Overlay>

View File

@ -1,4 +0,0 @@
BOOT=cdrom:\SLES_000.25;1
TCB=4
EVENT=10
STACK=801FFFF0

View File

@ -0,0 +1,4 @@
BOOT=cdrom:\%BOOT_FILE%;1
TCB=4
EVENT=10
STACK=801FFFF0

View File

@ -1,6 +1,6 @@
[package]
name = "psxcdgen_ex"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
[profile.release]

View File

@ -1,6 +1,6 @@
[package]
name = "tool_helper"
version = "0.9.1"
version = "0.9.2"
edition = "2021"
[profile.release]

View File

@ -213,6 +213,14 @@ pub fn input_to_vec(input: Input) -> Result<Vec<u8>, Error> {
}
pub fn read_file(file_path: &PathBuf) -> Result<Vec<u8>, Error> {
if let Some(ext) = file_path.extension() {
if ext == "subst" {
// File needs substitution!
let file_content = read_file_to_string(file_path)?;
return Ok(string_with_env_from(&file_content).into_bytes());
}
}
match std::fs::read(file_path) {
Ok(data) => Ok(data),
Err(error) => create_file_read_error(file_path, error),