diff --git a/examples/PoolBox/Makefile b/examples/PoolBox/Makefile index 73f122ce..1dbc762b 100644 --- a/examples/PoolBox/Makefile +++ b/examples/PoolBox/Makefile @@ -3,6 +3,33 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C iso +ifndef REGION +$(error REGION has to be set!) +endif + +# Add regions on your own +# Extend them with what you need +ifeq ($(REGION),SCEE) + export TV_FORMAT=PAL + export LICENSE=LICENSEE +endif +ifeq ($(REGION),SCEA) + export TV_FORMAT=NTSC + export LICENSE=LICENSEA +endif +ifeq ($(REGION),SCEI) + export TV_FORMAT=NTSC + export LICENSE=LICENSEJ +endif + +ifndef TV_FORMAT +$(error TV_FORMAT has not be set! REGION not specified?) +endif + +ifndef LICENSE +$(error LICENSE has not be set! REGION not specified?) +endif + all clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS) all_%: always diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index fba4bb64..f9f4dc97 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -11,11 +11,11 @@ { "label": "build", "type": "shell", - "windows": { // v re-export for WSL v re-export for WSL - "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} TV_FORMAT=${input:tv format} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", + "windows": { // v re-export for WSL v re-export for WSL + "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", }, "linux": { - "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} TV_FORMAT=${input:tv format}", + "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region}", }, "group": { "kind": "build", @@ -62,11 +62,11 @@ "description": "the build target" }, { - "id": "tv format", + "id": "region", "type": "pickString", - "options": ["PAL", "NTSC"], - "default": "PAL", - "description": "TV format to use" + "options": ["SCEE", "SCEA", "SCEI"], + "default": "SCEE", + "description": "Region profile to use" }, { "id": "output memory map", diff --git a/examples/PoolBox/iso/Config.xml b/examples/PoolBox/iso/Config.xml index c4fe8644..4d6462c1 100644 --- a/examples/PoolBox/iso/Config.xml +++ b/examples/PoolBox/iso/Config.xml @@ -2,7 +2,7 @@ Jaby - %PSX_LICENSE_PATH%/LICENSEE.DAT + %PSX_LICENSE_PATH%/%LICENSE%.DAT System.cnf diff --git a/mkfile/ISOMakefile.mk b/mkfile/ISOMakefile.mk index 95ec4b8a..47a5fd0e 100644 --- a/mkfile/ISOMakefile.mk +++ b/mkfile/ISOMakefile.mk @@ -1,12 +1,8 @@ -ifndef TV_FORMAT -$(error TV_FORMAT is not set!) -endif - -CD_OUTPUT ?= $(TV_FORMAT)/$(ARTIFACT).bin +CD_OUTPUT ?= $(REGION)/$(ARTIFACT).bin $(CD_OUTPUT): always - @mkdir -p $(TV_FORMAT) - psxcdgen_ex --list $(TV_FORMAT)/$(ARTIFACT).lba -o $(TV_FORMAT)/$(ARTIFACT) psx bin-cue Config.xml + @mkdir -p $(REGION) + psxcdgen_ex --list $(REGION)/$(ARTIFACT).lba -o $(REGION)/$(ARTIFACT) psx bin-cue Config.xml all: $(CD_OUTPUT) diff --git a/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace b/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace index f647d657..e91d7dcf 100644 --- a/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace +++ b/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace @@ -11,11 +11,11 @@ { "label": "build", "type": "shell", - "windows": { // v re-export for WSL v re-export for WSL - "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} TV_FORMAT=${input:tv format} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", + "windows": { // v re-export for WSL v re-export for WSL + "command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})", }, "linux": { - "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} TV_FORMAT=${input:tv format}", + "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region}", }, "group": { "kind": "build", @@ -62,11 +62,11 @@ "description": "the build target" }, { - "id": "tv format", + "id": "region", "type": "pickString", - "options": ["PAL", "NTSC"], - "default": "PAL", - "description": "TV format to use" + "options": ["SCEE", "SCEA", "SCEI"], + "default": "SCEE", + "description": "Region profile to use" }, { "id": "output memory map", diff --git a/template/JabyEngine-PSX_Game/Makefile b/template/JabyEngine-PSX_Game/Makefile index 7a55ca16..5d9a2735 100644 --- a/template/JabyEngine-PSX_Game/Makefile +++ b/template/JabyEngine-PSX_Game/Makefile @@ -3,6 +3,33 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C iso +ifndef REGION +$(error REGION has to be set!) +endif + +# Add regions on your own +# Extend them with what you need +ifeq ($(REGION),SCEE) + export TV_FORMAT=PAL + export LICENSE=LICENSEE +endif +ifeq ($(REGION),SCEA) + export TV_FORMAT=NTSC + export LICENSE=LICENSEA +endif +ifeq ($(REGION),SCEI) + export TV_FORMAT=NTSC + export LICENSE=LICENSEJ +endif + +ifndef TV_FORMAT +$(error TV_FORMAT has not be set! REGION not specified?) +endif + +ifndef LICENSE +$(error LICENSE has not be set! REGION not specified?) +endif + all clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS) all_%: always diff --git a/template/JabyEngine-PSX_Game/application/Makefile b/template/JabyEngine-PSX_Game/application/Makefile index 34b513c7..0f45f52a 100644 --- a/template/JabyEngine-PSX_Game/application/Makefile +++ b/template/JabyEngine-PSX_Game/application/Makefile @@ -1,6 +1,6 @@ #OVERLAY_CONFIG = Overlays.json -include $(JABY_ENGINE_DIR)/lib/Wildcard.mk +include $(JABY_ENGINE_DIR)/mkfile/Wildcard.mk SRCS = $(call rwildcard, src, c cpp) INCLUDES += -I$(JABY_ENGINE_DIR)/include diff --git a/template/JabyEngine-PSX_Game/iso/Config.xml b/template/JabyEngine-PSX_Game/iso/Config.xml index 55288cf6..9bf05906 100644 --- a/template/JabyEngine-PSX_Game/iso/Config.xml +++ b/template/JabyEngine-PSX_Game/iso/Config.xml @@ -1,7 +1,7 @@ - + System.cnf