Use psxcdgen_ex under WSL and improve wslpath and makefiles

This commit is contained in:
2023-08-25 05:15:23 +02:00
parent 5c944dcb0a
commit d919f4fbd5
14 changed files with 113 additions and 70 deletions

View File

@@ -1,4 +1,4 @@
set bin_projects=psxcdgen psxcdgen_ex psxcdread psxreadmap wslpath
set bin_linux_projects=cpp_out jaby_engine_fconv mkoverlay
set bin_linux_projects=cpp_out psxcdgen_ex jaby_engine_fconv mkoverlay wslpath
set clean_projects=cdtypes
set clean_projects_linux=tool_helper

View File

@@ -1,7 +1,7 @@
use clap::{Parser, ValueEnum};
use psxcdgen_ex::{encoder::{EncodingFunctions, psx::{calculate_psx_lbas, calculate_psx_length_for, encode_psx_image}}, file_writer::{ImageType, write_image}, config_reader};
use std::{path::PathBuf};
use tool_helper::{Error, exit_with_error};
use std::path::PathBuf;
use tool_helper::{Error, exit_with_error, read_file_to_string};
#[derive(Parser)]
#[clap(about = "Creates an ISO image from a description file", long_about = None)]
@@ -37,7 +37,7 @@ impl SystemType {
fn run_main(cmd_line: CommandLine) -> Result<(), Error> {
let encoding_functions = cmd_line.system_type.get_encoding_functions();
let (desc, lba_embedded_files) = psxcdgen_ex::process(config_reader::parse_xml(std::fs::read_to_string(cmd_line.input_file)?)?, encoding_functions.lba_calculator)?;
let (desc, lba_embedded_files) = psxcdgen_ex::process(config_reader::parse_xml(read_file_to_string(&cmd_line.input_file)?)?, encoding_functions.lba_calculator)?;
let file_map = desc.create_file_map();
psxcdgen_ex::process_files(file_map, lba_embedded_files, encoding_functions.length_calculator)?;

View File

@@ -6,6 +6,7 @@ fn convert_slashes(path: String) -> String {
path.replace('\\', "/")
}
#[cfg(target_os = "windows")]
fn replace_drive_letter(mut path: String) -> String {
let has_drive_letter = {
let drive_letter = path.get(0..2);
@@ -35,5 +36,10 @@ fn replace_drive_letter(mut path: String) -> String {
path.insert_str(0, "/mnt/");
}
path
}
#[cfg(not(target_os = "windows"))]
fn replace_drive_letter(path: String) -> String {
path
}