Finish integrating custom configs

This commit is contained in:
jaby 2024-02-20 22:29:09 -05:00
parent 2153c573df
commit bf67b83629
4 changed files with 67 additions and 8 deletions

2
.gitignore vendored
View File

@ -6,7 +6,7 @@
/iso
# Custom configs should not be part of JabyEngine
#**/config
**/config
.lfsconfig

View File

@ -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
```

View File

@ -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 ^|^<Default^> && 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",

View File

@ -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 ^|^<Default^> && 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",