Support different regions

This commit is contained in:
jaby 2024-02-09 09:43:39 -05:00
parent 0457cdaaa7
commit 348f0fd444
8 changed files with 74 additions and 24 deletions

View File

@ -3,6 +3,33 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets
make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application
make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C iso 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 clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS)
all_%: always all_%: always

View File

@ -11,11 +11,11 @@
{ {
"label": "build", "label": "build",
"type": "shell", "type": "shell",
"windows": { // v re-export for WSL v re-export for WSL "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})", "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": { "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": { "group": {
"kind": "build", "kind": "build",
@ -62,11 +62,11 @@
"description": "the build target" "description": "the build target"
}, },
{ {
"id": "tv format", "id": "region",
"type": "pickString", "type": "pickString",
"options": ["PAL", "NTSC"], "options": ["SCEE", "SCEA", "SCEI"],
"default": "PAL", "default": "SCEE",
"description": "TV format to use" "description": "Region profile to use"
}, },
{ {
"id": "output memory map", "id": "output memory map",

View File

@ -2,7 +2,7 @@
<Description> <Description>
<Publisher>Jaby</Publisher> <Publisher>Jaby</Publisher>
<!--TODO: How to switch this between PAL and NTSC?--> <!--TODO: How to switch this between PAL and NTSC?-->
<License>%PSX_LICENSE_PATH%/LICENSEE.DAT</License> <License>%PSX_LICENSE_PATH%/%LICENSE%.DAT</License>
</Description> </Description>
<Track> <Track>
<File name = "SYSTEM.CNF">System.cnf</File> <File name = "SYSTEM.CNF">System.cnf</File>

View File

@ -1,12 +1,8 @@
ifndef TV_FORMAT CD_OUTPUT ?= $(REGION)/$(ARTIFACT).bin
$(error TV_FORMAT is not set!)
endif
CD_OUTPUT ?= $(TV_FORMAT)/$(ARTIFACT).bin
$(CD_OUTPUT): always $(CD_OUTPUT): always
@mkdir -p $(TV_FORMAT) @mkdir -p $(REGION)
psxcdgen_ex --list $(TV_FORMAT)/$(ARTIFACT).lba -o $(TV_FORMAT)/$(ARTIFACT) psx bin-cue Config.xml psxcdgen_ex --list $(REGION)/$(ARTIFACT).lba -o $(REGION)/$(ARTIFACT) psx bin-cue Config.xml
all: $(CD_OUTPUT) all: $(CD_OUTPUT)

View File

@ -11,11 +11,11 @@
{ {
"label": "build", "label": "build",
"type": "shell", "type": "shell",
"windows": { // v re-export for WSL v re-export for WSL "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})", "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": { "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": { "group": {
"kind": "build", "kind": "build",
@ -62,11 +62,11 @@
"description": "the build target" "description": "the build target"
}, },
{ {
"id": "tv format", "id": "region",
"type": "pickString", "type": "pickString",
"options": ["PAL", "NTSC"], "options": ["SCEE", "SCEA", "SCEI"],
"default": "PAL", "default": "SCEE",
"description": "TV format to use" "description": "Region profile to use"
}, },
{ {
"id": "output memory map", "id": "output memory map",

View File

@ -3,6 +3,33 @@ make_assets = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C assets
make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application make_application = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C application
make_cd = $(MAKE) $(1) ARTIFACT=$(ARTIFACT) -C iso 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 clean rebuild: |assets_$(MAKECMDGOALS) application_$(MAKECMDGOALS) cd_$(MAKECMDGOALS)
all_%: always all_%: always

View File

@ -1,6 +1,6 @@
#OVERLAY_CONFIG = Overlays.json #OVERLAY_CONFIG = Overlays.json
include $(JABY_ENGINE_DIR)/lib/Wildcard.mk include $(JABY_ENGINE_DIR)/mkfile/Wildcard.mk
SRCS = $(call rwildcard, src, c cpp) SRCS = $(call rwildcard, src, c cpp)
INCLUDES += -I$(JABY_ENGINE_DIR)/include INCLUDES += -I$(JABY_ENGINE_DIR)/include

View File

@ -1,7 +1,7 @@
<ISO_Project> <ISO_Project>
<Description> <Description>
<!--<Publisher>Jaby</Publisher>--> <!--<Publisher>Jaby</Publisher>-->
<!--<License>%PSX_LICENSE_PATH%/LICENSEE.DAT</License>--> <!--<License>%PSX_LICENSE_PATH%/%LICENSE%.DAT</License>-->
</Description> </Description>
<Track> <Track>
<File name="SYSTEM.CNF">System.cnf</File> <File name="SYSTEM.CNF">System.cnf</File>