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 /iso
# Custom configs should not be part of JabyEngine # Custom configs should not be part of JabyEngine
#**/config **/config
.lfsconfig .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", "id": "custom config",
"type": "pickString", "type": "command",
"options": ["", "MyConfig"], "command": "shellCommand.execute",
"default": "", "args": {
"description": "Simple custom config test" "command": "echo ^|^<Default^> && dir /b /a:d",
"cwd": "${env:JABY_ENGINE_PATH}/config",
"fieldSeparator": "|"
}
}, },
{ {
"id": "output memory map", "id": "output memory map",
@ -83,6 +86,9 @@
"description": "Output a memory map" "description": "Output a memory map"
} }
] ]
},
"extensions": {
"recommendations": ["augustocdias.tasks-shell-input"]
}, },
"settings": { "settings": {
"C_Cpp.default.includePath": [ "C_Cpp.default.includePath": [

View File

@ -12,10 +12,10 @@
"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} REGION=${input:region} 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} CUSTOM_CONFIG=${input:custom config} 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} REGION=${input:region}", "command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} REGION=${input:region} CUSTOM_CONFIG=${input:custom config}",
}, },
"group": { "group": {
"kind": "build", "kind": "build",
@ -67,6 +67,16 @@
"options": ["SCEE", "SCEA", "SCEI"], "options": ["SCEE", "SCEA", "SCEI"],
"default": "SCEE", "default": "SCEE",
"description": "Region profile to use" "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", "id": "output memory map",
@ -76,6 +86,9 @@
"description": "Output a memory map" "description": "Output a memory map"
} }
] ]
},
"extensions": {
"recommendations": ["augustocdias.tasks-shell-input"]
}, },
"settings": { "settings": {
"C_Cpp.default.includePath": [ "C_Cpp.default.includePath": [