First configuratable JabyEngine prototype

This commit is contained in:
Björn Gaier 2024-02-09 11:30:55 -05:00
parent 8a927010ba
commit efe28a9718
7 changed files with 84 additions and 17 deletions

View File

@ -0,0 +1,18 @@
#pragma once
#include <PSX/GPU/gpu_types.hpp>
namespace JabyEngine {
#define TEST_STR "Planschbecken sind konfigurierbar"
struct Configuration {
struct BIOSFont {
static constexpr auto TextureLoadPos = GPU::PositionU16::create(320, 256);
static constexpr auto CLUTLoadPos = GPU::PositionU16::create(320, 511);
};
struct Periphery {
static constexpr bool IncludePortB = false;
static constexpr bool UseMultiTap = false;
};
};
}

View File

@ -0,0 +1,2 @@
#pragma once

View File

@ -11,8 +11,8 @@
{
"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} REGION=${input:region} 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} ${input:test} 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} REGION=${input:region}",
@ -67,6 +67,13 @@
"options": ["SCEE", "SCEA", "SCEI"],
"default": "SCEE",
"description": "Region profile to use"
},
{
"id": "test",
"type": "pickString",
"options": ["", "CUSTOM_CONFIG=MyConfig"],
"default": "",
"description": "Simple custom config test"
},
{
"id": "output memory map",

View File

@ -1,18 +1,23 @@
#pragma once
#include "GPU/gpu_types.hpp"
namespace JabyEngine {
#define TEST_STR "Planschbecken sind default"
struct Configuration {
struct BIOSFont {
static constexpr auto TextureLoadPos = GPU::PositionU16::create(320, 256);
static constexpr auto CLUTLoadPos = GPU::PositionU16::create(320, 511);
};
#if __has_include(<jabyengine_custom_config.hpp>)
#include <jabyengine_custom_config.hpp>
#else
#include "GPU/gpu_types.hpp"
struct Periphery {
static constexpr bool IncludePortB = false;
static constexpr bool UseMultiTap = false;
namespace JabyEngine {
#define TEST_STR "Planschbecken sind default"
struct Configuration {
struct BIOSFont {
static constexpr auto TextureLoadPos = GPU::PositionU16::create(320, 256);
static constexpr auto CLUTLoadPos = GPU::PositionU16::create(320, 511);
};
struct Periphery {
static constexpr bool IncludePortB = false;
static constexpr bool UseMultiTap = false;
};
};
};
}
}
#endif // has jabyengine_custom_config

View File

@ -4,7 +4,14 @@ AUTO_OVERLAY_DIR = $(OUTPUT_DIR)/auto_overlay
include $(AUTO_OVERLAY_DIR)/Overlays.mk
#We use the JabyEngine so we will include ourselves
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)
ifdef CUSTOM_CONFIG
CCFLAGS += -I$(JABY_ENGINE_DIR)/config/$(CUSTOM_CONFIG) -imacros $(JABY_ENGINE_DIR)/config/$(CUSTOM_CONFIG)/jabyengine_custom_defines.hpp
# TODO: v can this be empty maybe??
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)/$(CUSTOM_CONFIG)
else
JABY_ENGINE_LIB_DIR = $(JABY_ENGINE_DIR)/lib/PSX-$(BUILD_PROFILE)
endif
JABY_ENGINE_SUPPORT_LIB_DIR = $(JABY_ENGINE_DIR)/Support/lib/PSX-$(BUILD_PROFILE)
JABY_ENGINE_SUPPORT_LIBS = $(addprefix -l,$(SUPPORT_LIBS))
JABY_ENGINE_SUPPORT_DEPS = $(addsuffix .a,$(addprefix $(JABY_ENGINE_SUPPORT_LIB_DIR)/lib,$(SUPPORT_LIBS)))

View File

@ -27,6 +27,17 @@
},
"group": "build"
},
{
"label": "make custom config",
"type": "shell",
"windows": {
"command": "wsl make ${input:target} BUILD_PROFILE=${input:build cfg} TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:custom config}",
},
"linux": {
"command": "make ${input:target} BUILD_PROFILE=${input:build cfg} TV_FORMAT=${input:tv format} CUSTOM_CONFIG=${input:custom config}",
},
"group": "build"
},
{
"label": "combi make",
"type": "shell",
@ -54,6 +65,13 @@
"default": "PAL",
"description": "TV format to use"
},
{
"id": "custom config",
"type": "pickString",
"options": ["MyConfig"],
"default": "MyConfig",
"description": "The custom configuration to use for this build"
},
{
"id": "target",
"type": "pickString",

View File

@ -6,9 +6,19 @@ ARTIFACT = libJabyEngine_$(TV_FORMAT)
SPLASH_IMAGE = src/BootLoader/splash_image_pal_boot.hpp
SPLASH_IMAGE_NTSC = src/BootLoader/splash_image_ntsc_boot.hpp
#TODO: v Check if we need this include still
CCFLAGS += -Iinclude -I../../include -D__friends=public
CCFLAGS += -save-temps=obj
ifdef CUSTOM_CONFIG
#TODO: Custom config build var
CCFLAGS += -I../../config/$(CUSTOM_CONFIG) -imacros ../../config/$(CUSTOM_CONFIG)/jabyengine_custom_defines.hpp
#TODO: v Or here? v Do we want this here?
CONFIG_NAME = $(PLATFORM)-$(BUILD_PROFILE)/$(CUSTOM_CONFIG)
else
CONFIG_NAME = $(PLATFORM)-$(BUILD_PROFILE)
endif
include ../../mkfile/Wildcard.mk
SRCS = $(call rwildcard, src, c cpp s)