Use psxcdgen_ex under WSL and improve wslpath and makefiles
This commit is contained in:
parent
5f21d7ebe7
commit
2c37c2b412
|
@ -1,5 +1,23 @@
|
|||
ARTIFACT = PoolBox
|
||||
make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets
|
||||
make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application
|
||||
make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -f $(JABY_ENGINE_DIR)/lib/ISOTarget.mk -C iso
|
||||
|
||||
all clean rebuild: always
|
||||
$(MAKE) $(MAKECMDGOALS) -C assets
|
||||
$(MAKE) $(MAKECMDGOALS) -C application
|
||||
$(call make_assets,$(MAKECMDGOALS))
|
||||
$(call make_application,$(MAKECMDGOALS))
|
||||
$(call make_cd,$(MAKECMDGOALS))
|
||||
|
||||
all_%: always
|
||||
$(call make_assets,$*)
|
||||
$(call make_application,$*)
|
||||
$(call make_cd,$*)
|
||||
|
||||
assets_%: always
|
||||
$(call make_assets,$*)
|
||||
application_%: always
|
||||
$(call make_application,$*)
|
||||
cd_%: always
|
||||
$(call make_cd,$*)
|
||||
|
||||
always: ;
|
|
@ -11,7 +11,7 @@
|
|||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "wsl make ${input:target} BUILD_PROFILE=${input:build profile} JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
|
||||
"command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
|
@ -22,25 +22,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "cdgen",
|
||||
"type": "shell",
|
||||
"command": "${env:JABY_ENGINE_PATH}/bin/psxcdgen_ex.exe --list iso/PoolBox.lba -o iso/PoolBox psx bin-cue iso/Config.xml",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "build & generate cd",
|
||||
"type": "shell",
|
||||
"dependsOn": ["build", "cdgen"],
|
||||
"dependsOrder": "sequence",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
|
@ -50,6 +31,13 @@
|
|||
"default": "release",
|
||||
"description": "The build profile for PoolBox"
|
||||
},
|
||||
{
|
||||
"id": "project",
|
||||
"type": "pickString",
|
||||
"options": ["all", "assets", "application", "cd"],
|
||||
"default": "all",
|
||||
"description": "Project to build"
|
||||
},
|
||||
{
|
||||
"id": "target",
|
||||
"type": "pickString",
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
ARTIFACT = PoolBox
|
||||
BUILD_DIR = bin
|
||||
|
||||
OVERLAY_CONFIG = Overlays.json
|
||||
|
@ -11,8 +10,3 @@ CCFLAGS += -save-temps=obj
|
|||
|
||||
include $(JABY_ENGINE_DIR)/lib/Makefile
|
||||
include $(JABY_ENGINE_DIR)/lib/PSEXETarget.mk
|
||||
|
||||
clean:
|
||||
rm -fr $(OUTPUT_DIR)
|
||||
rm -fr ../iso/*.bin
|
||||
rm -fr ../iso/*.cue
|
|
@ -4,14 +4,14 @@
|
|||
<License>%PSX_LICENSE_PATH%/LICENSEE.DAT</License>
|
||||
</Description>
|
||||
<Track>
|
||||
<File name = "SYSTEM.CNF">iso/System.cnf</File>
|
||||
<Main name = "XXXX_AAA.AA" lba_source = "application/src/main_assets.cpp">application/bin/PSX-release/PoolBox.psexe</Main>
|
||||
<File name = "SYSTEM.CNF">System.cnf</File>
|
||||
<Main name = "XXXX_AAA.AA" lba_source = "../application/src/main_assets.cpp">../application/bin/PSX-release/PoolBox.psexe</Main>
|
||||
<Directory name="ASSETS" hidden = "true">
|
||||
<Directory name = "MAIN">
|
||||
<File name = "FONT.BIN" lz4 = "already">assets/bin/YoshiFont.bin</File>
|
||||
<File name = "FONT.BIN" lz4 = "already">../assets/bin/YoshiFont.bin</File>
|
||||
</Directory>
|
||||
<File name = "FONT.BIN" lz4 = "already">assets/bin/TexturePage.bin</File>
|
||||
<File name = "ICON.BIN" lz4 = "already">assets/bin/IconTexture.bin</File>
|
||||
<File name = "FONT.BIN" lz4 = "already">../assets/bin/TexturePage.bin</File>
|
||||
<File name = "ICON.BIN" lz4 = "already">../assets/bin/IconTexture.bin</File>
|
||||
</Directory>
|
||||
</Track>
|
||||
</ISO_Project>
|
|
@ -0,0 +1,14 @@
|
|||
include $(JABY_ENGINE_DIR)/lib/RebuildTarget.mk
|
||||
CD_OUTPUT ?= $(ARTIFACT).bin
|
||||
|
||||
$(CD_OUTPUT): always
|
||||
psxcdgen_ex --list $(ARTIFACT).lba -o $(ARTIFACT) psx bin-cue Config.xml
|
||||
|
||||
all: $(CD_OUTPUT)
|
||||
|
||||
clean:
|
||||
rm -fr *.bin
|
||||
rm -fr *.cue
|
||||
rm -fr *.lba
|
||||
|
||||
always: ;
|
|
@ -7,6 +7,8 @@ include $(AUTO_OVERLAY_DIR)/Overlays.mk
|
|||
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)
|
||||
JABY_ENGINE_LIB_NAME = JabyEngine_$(TV_FORMAT)
|
||||
|
||||
OVERLAY_TARGET = $(foreach ovl, $(OVERLAYSECTION), $(OUTPUT_DIR)/Overlay$(ovl))
|
||||
|
||||
#Linking rule
|
||||
$(TARGET).elf: $(OBJS) $(JABY_ENGINE_LIB_DIR)/lib$(JABY_ENGINE_LIB_NAME).a $(AUTO_OVERLAY_DIR)/Overlays.ld
|
||||
$(LD) -o $(TARGET).elf $(LDFLAGS_all) $(LDFLAGS) $(OBJS) -L$(JABY_ENGINE_LIB_DIR) -l$(JABY_ENGINE_LIB_NAME) $(LIBS)
|
||||
|
@ -16,7 +18,7 @@ $(TARGET).psexe: $(TARGET).elf
|
|||
$(PREFIX)-objcopy $(addprefix -R , $(OVERLAYSECTION)) -O binary $< $@
|
||||
|
||||
#Create overlays
|
||||
$(foreach ovl, $(OVERLAYSECTION), $(OUTPUT_DIR)/Overlay$(ovl)): $(TARGET).elf
|
||||
$(OVERLAY_TARGET): $(TARGET).elf
|
||||
$(PREFIX)-objcopy -j $(suffix $@) -O binary $< $@
|
||||
|
||||
#Create overlay makefile
|
||||
|
@ -25,4 +27,7 @@ $(AUTO_OVERLAY_DIR)/Overlays.mk: $(OVERLAY_CONFIG)
|
|||
mkoverlay --mk-file $(AUTO_OVERLAY_DIR)/Overlays.mk --ld-script $(AUTO_OVERLAY_DIR)/Overlays.ld $<
|
||||
|
||||
#Rules section for default compilation and linking
|
||||
all: $(TARGET).psexe $(foreach ovl, $(OVERLAYSECTION), $(OUTPUT_DIR)/Overlay$(ovl))
|
||||
all: $(TARGET).psexe $(OVERLAY_TARGET)
|
||||
|
||||
clean:
|
||||
rm -fr $(OUTPUT_DIR)
|
|
@ -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
|
|
@ -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)?;
|
||||
|
|
|
@ -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);
|
||||
|
@ -37,3 +38,8 @@ fn replace_drive_letter(mut path: String) -> String {
|
|||
|
||||
path
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "windows"))]
|
||||
fn replace_drive_letter(path: String) -> String {
|
||||
path
|
||||
}
|
|
@ -11,37 +11,17 @@
|
|||
{
|
||||
"label": "build",
|
||||
"type": "shell",
|
||||
"command": "wsl make ${input:target} BUILD_PROFILE=${input:build profile} JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
|
||||
"command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
},
|
||||
"options": {
|
||||
"cwd": "application",
|
||||
"env": {
|
||||
"PATH": "${env:JABY_ENGINE_PATH}/bin;${env:PATH}"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "cdgen",
|
||||
"type": "shell",
|
||||
"command": "${env:JABY_ENGINE_PATH}/bin/psxcdgen_ex.exe --list iso/#{ProjectName}.lba -o iso/#{ProjectName} psx bin-cue iso/Config.xml",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "build & generate cd",
|
||||
"type": "shell",
|
||||
"dependsOn": ["build", "cdgen"],
|
||||
"dependsOrder": "sequence",
|
||||
"group": {
|
||||
"kind": "build",
|
||||
"isDefault": true
|
||||
}
|
||||
}
|
||||
],
|
||||
"inputs": [
|
||||
{
|
||||
|
@ -51,6 +31,13 @@
|
|||
"default": "release",
|
||||
"description": "The build profile for #{ProjectName}"
|
||||
},
|
||||
{
|
||||
"id": "project",
|
||||
"type": "pickString",
|
||||
"options": ["all", "assets", "application", "cd"],
|
||||
"default": "all",
|
||||
"description": "Project to build"
|
||||
},
|
||||
{
|
||||
"id": "target",
|
||||
"type": "pickString",
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
ARTIFACT = #{ProjectName}
|
||||
make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets
|
||||
make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application
|
||||
make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -f $(JABY_ENGINE_DIR)/lib/ISOTarget.mk -C iso
|
||||
|
||||
all clean rebuild: always
|
||||
$(call make_assets,$(MAKECMDGOALS))
|
||||
$(call make_application,$(MAKECMDGOALS))
|
||||
$(call make_cd,$(MAKECMDGOALS))
|
||||
|
||||
all_%: always
|
||||
$(call make_assets,$*)
|
||||
$(call make_application,$*)
|
||||
$(call make_cd,$*)
|
||||
|
||||
assets_%: always
|
||||
$(call make_assets,$*)
|
||||
application_%: always
|
||||
$(call make_application,$*)
|
||||
cd_%: always
|
||||
$(call make_cd,$*)
|
||||
|
||||
always: ;
|
|
@ -1,4 +1,3 @@
|
|||
ARTIFACT = #{ProjectName}
|
||||
BUILD_DIR = bin
|
||||
|
||||
#OVERLAY_CONFIG = Overlays.json
|
||||
|
@ -10,8 +9,3 @@ INCLUDES += -I$(JABY_ENGINE_DIR)/include
|
|||
|
||||
include $(JABY_ENGINE_DIR)/lib/Makefile
|
||||
include $(JABY_ENGINE_DIR)/lib/PSEXETarget.mk
|
||||
|
||||
clean:
|
||||
rm -fr $(OUTPUT_DIR)
|
||||
rm -fr ../iso/*.bin
|
||||
rm -fr ../iso/*.cue
|
|
@ -0,0 +1,14 @@
|
|||
include $(JABY_ENGINE_DIR)/lib/ExportPath.mk
|
||||
include $(JABY_ENGINE_DIR)/lib/RebuildTarget.mk
|
||||
|
||||
OUTPUT_DIR = bin
|
||||
|
||||
# Create build targets like
|
||||
# $(OUTPUT_DIR)/TexturePage.bin: TexturePage.png
|
||||
# @mkdir -p $(OUTPUT_DIR)
|
||||
# jaby_engine_fconv --lz4 $< -o $@ simple-tim clut4
|
||||
|
||||
all: #$(OUTPUT_DIR)/TexturePage.bin
|
||||
|
||||
clean:
|
||||
rm -fr $(OUTPUT_DIR)
|
|
@ -4,7 +4,7 @@
|
|||
<!--<License>%PSX_LICENSE_PATH%/LICENSEE.DAT</License>-->
|
||||
</Description>
|
||||
<Track>
|
||||
<File name="SYSTEM.CNF">iso/System.cnf</File>
|
||||
<Main name="XXXX_AAA.AA">application/bin/PSX-release/#{ProjectName}.psexe</Main>
|
||||
<File name="SYSTEM.CNF">System.cnf</File>
|
||||
<Main name="XXXX_AAA.AA">../application/bin/PSX-release/#{ProjectName}.psexe</Main>
|
||||
</Track>
|
||||
</ISO_Project>
|
Loading…
Reference in New Issue