mirror of
https://github.com/FEX-Emu/FEX.git
synced 2026-10-14 08:00:50 +02:00
FEXCore/Config: Adds support for enum mask configuration array
Allows us to consume an array of strings and convert it to an mask of enum values. This is a quality of life change that allows us to specify a mask of options. The first configuration option added to support this is to control the vixl disassembler. Now by default the vixl disassembler doesn't disassemble any blocks and needs to be enabled individually. eg: ``` FEXLoader --disassemble=blocks <args> FEXLoader --disassemble=dispatcher <args> FEXLoader --disassemble=blocks,dispatcher <args> ``` Has the additional convenience option of just passing in numbers as well. ``` FEXLoader --disassemble=2 <args> FEXLoader --disassemble=1 <args> FEXLoader --disassemble=3 <args> ``` Also of course all of this works through environment variables. ``` FEX_DISASSEMBLE=blocks FEXInterpreter <args> FEX_DISASSEMBLE=dispatcher FEXInterpreter <args> FEX_DISASSEMBLE=blocks,dispatcher FEXInterpreter <args> ``` While only used fairly sparingly now, this is likely to have some additional configurations using this in the future. Since we already have some configs that are basically using enums, but just by doing string comparisons. This was asked for by a developer, so I figured I would throw it together quick.
This commit is contained in:
1 parent
f7b7997c77
commit
79f7dcbaa5
8 files changed
+143
-9
No files matched your search
@@ -1,5 +1,6 @@
|
||||
#include "Common/StringConv.h"
|
||||
#include "Common/StringUtils.h"
|
||||
#include "FEXCore/Utils/EnumUtils.h"
|
||||
|
||||
#include <FEXCore/Config/Config.h>
|
||||
#include <FEXCore/Utils/Allocator.h>
|
||||
@@ -37,6 +38,7 @@ namespace DefaultValues {
|
||||
#define OPT_BASE(type, group, enum, json, default) const P(type) P(enum) = P(default);
|
||||
#define OPT_STR(group, enum, json, default) const std::string_view P(enum) = P(default);
|
||||
#define OPT_STRARRAY(group, enum, json, default) OPT_STR(group, enum, json, default)
|
||||
#define OPT_STRENUM(group, enum, json, default) const uint64_t P(enum) = FEXCore::ToUnderlying(P(default));
|
||||
#include <FEXCore/Config/ConfigValues.inl>
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user