diff --git a/.gitignore b/.gitignore index bb017857..f42f86e6 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,7 @@ /iso # Custom configs should not be part of JabyEngine -#**/config +**/config .lfsconfig diff --git a/config/Readme.md b/config/Readme.md index e69de29b..dab2d5d9 100644 --- a/config/Readme.md +++ b/config/Readme.md @@ -0,0 +1,40 @@ +# How to create custom configurations +1. Create folder with name of custom configuration +1. Add `jabyengine_custom_config.hpp` to folder + 1. Follow [guidelines](#jabyengine_custom_confighpp) +1. Build JabyEngine and select your configuration +1. Build your application and select your configuration + +## jabyengine_custom_config.hpp +### Default configuration file +```c++ +// Fix IntelliSense +#include "../dummy_default_config.hpp" + +// Overwrite various configurations +struct CustomConfiguration : public DefaultConfiguration { +}; + +// Define macros here +``` +### `CustomConfiguration` options +When overriding an option make sure to mark the function as `override` +```c++ +struct DefaultConfiguration { + struct BIOSFont { + // VRAM position and CLUT position to load the BIOS font too + static constexpr GPU::PositionU16 texture_load_pos(); + static constexpr GPU::PositionU16 CLUT_load_pos(); + }; + + struct Periphery { + // Turns on the second controller port and enables multi tap support + static constexpr bool include_portB(); + static constexpr bool use_multi_tap(); + }; +}; +``` +### `CustomConfiguration` macros +```c++ +#define __USE_DEBUG_COLOR__ // Turns on colored rectangles during boot +``` \ No newline at end of file diff --git a/examples/PoolBox/PoolBox.code-workspace b/examples/PoolBox/PoolBox.code-workspace index 6c83356f..ac0e7d4b 100644 --- a/examples/PoolBox/PoolBox.code-workspace +++ b/examples/PoolBox/PoolBox.code-workspace @@ -70,10 +70,13 @@ }, { "id": "custom config", - "type": "pickString", - "options": ["", "MyConfig"], - "default": "", - "description": "Simple custom config test" + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "echo ^|^ && dir /b /a:d", + "cwd": "${env:JABY_ENGINE_PATH}/config", + "fieldSeparator": "|" + } }, { "id": "output memory map", @@ -84,6 +87,9 @@ } ] }, + "extensions": { + "recommendations": ["augustocdias.tasks-shell-input"] + }, "settings": { "C_Cpp.default.includePath": [ "${env:JABY_ENGINE_PATH}/include", diff --git a/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace b/template/JabyEngine-PSX_Game/#{ProjectName}.code-workspace index e91d7dcf..beff1495 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} 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} CUSTOM_CONFIG=${input:custom config} 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}", + "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config}", }, "group": { "kind": "build", @@ -67,6 +67,16 @@ "options": ["SCEE", "SCEA", "SCEI"], "default": "SCEE", "description": "Region profile to use" + }, + { + "id": "custom config", + "type": "command", + "command": "shellCommand.execute", + "args": { + "command": "echo ^|^ && dir /b /a:d", + "cwd": "${env:JABY_ENGINE_PATH}/config", + "fieldSeparator": "|" + } }, { "id": "output memory map", @@ -77,6 +87,9 @@ } ] }, + "extensions": { + "recommendations": ["augustocdias.tasks-shell-input"] + }, "settings": { "C_Cpp.default.includePath": [ "${env:JABY_ENGINE_PATH}/include",