[settings] changed debug knobs category to allow per-game usage (#3564)
as the name says, plus changed android type for shortsetting, and added communication good pratices to handbook (.md) file. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3564 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: xbzk <xbzk@eden-emu.dev> Co-committed-by: xbzk <xbzk@eden-emu.dev>
This commit is contained in:
parent
4f29128e50
commit
5ee81a4932
|
|
@ -12,12 +12,13 @@ The setting ranges from 0 to 65535 (0x0000 to 0xFFFF), where each bit represents
|
|||
* [Accessing Debug Knobs (dev side)](#accessing-debug-knobs-dev-side)
|
||||
* [Setting Debug Knobs (user side)](#setting-debug-knobs-user-side)
|
||||
* [Bit Manipulation Examples](#bit-manipulation-examples)
|
||||
3. [Examples](#examples)
|
||||
3. [Terminology and user communication](#terminology-and-user-communication)
|
||||
4. [Examples](#examples)
|
||||
|
||||
* [Example 1: Conditional Debug Logging](#example-1-conditional-debug-logging)
|
||||
* [Example 2: Performance Tuning](#example-2-performance-tuning)
|
||||
* [Example 3: Feature Gating](#example-3-feature-gating)
|
||||
4. [Best Practices](#best-practices)
|
||||
5. [Best Practices](#best-practices)
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -77,6 +78,44 @@ To enable specific features, calculate the decimal value by setting the appropri
|
|||
* **Enable bits 0 and 1**: Value = 3 (2^0 + 2^1)
|
||||
* **Enable bit 15**: Value = 32768 (2^15)
|
||||
|
||||
## Terminology and user communication
|
||||
|
||||
There are two main confusions when talking about knobs:
|
||||
|
||||
### Whether it's zero-based or one-based
|
||||
|
||||
Sometimes when an user reports: knobs 1 and 2 gets better performance, dev may get confuse whether he means the knobs 1 and 2 literally, or the 1st and 2nd knobs (knobs 0 and 1).
|
||||
|
||||
Debug knobs are **zero-based**, which means:
|
||||
* The first knob is the knob(0) (or knob0 henceforth), and the last one is the 15 (knob15, likewise)
|
||||
* You can talk: "knob0 is enabled/disabled", "In this video i was using only knobs 0 and 2", etc.
|
||||
|
||||
### Whether one is talking about the knob itself or about the entire parameter value (which represents all knobs)
|
||||
|
||||
Sometimes when an user reports: knob 3 results, it's unclear whether he's referring to knob setting with value 3 (which means both knob 0 and 1 are enabled), or to knob(3) specifically.
|
||||
Whenever you're instructing tests or reporting results, be precise about whether one you're talking to avoid confusion:
|
||||
|
||||
### Setting based terminology
|
||||
|
||||
ALWAYS use the word in PLURAL (knobs), without mentioning which one, to refer to the setting, aka multiple knobs at once:
|
||||
Examples:
|
||||
- **knobs=0**: no knobs enabled
|
||||
- **knobs=1**: knob0 enabled, others disabled
|
||||
- **knobs=2**: knob1 enabled, others disabled
|
||||
- **knobs=3**: knobs 0 and 1 enabled, others disabled
|
||||
|
||||
...
|
||||
|
||||
### Knob based terminology
|
||||
|
||||
Use the word in SINGULAR (knob), or in plural but referring which ones, when meaning multiple knobs at once:
|
||||
Examples:
|
||||
- **knob0**: knob 0 enabled, others disabled
|
||||
- **knob1**: knob 1 enabled, others disabled
|
||||
- **knobs 0 and 1**: knobs 0 and 1 enabled, others disabled
|
||||
|
||||
...
|
||||
|
||||
## Examples
|
||||
|
||||
### Example 1: Conditional Debug Logging
|
||||
|
|
|
|||
|
|
@ -68,7 +68,6 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
|||
MY_PAGE_APPLET("my_page_applet_mode"),
|
||||
INPUT_OVERLAY_AUTO_HIDE("input_overlay_auto_hide"),
|
||||
OVERLAY_GRID_SIZE("overlay_grid_size"),
|
||||
DEBUG_KNOBS("debug_knobs"),
|
||||
GPU_LOG_RING_BUFFER_SIZE("gpu_log_ring_buffer_size")
|
||||
;
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ enum class ShortSetting(override val key: String) : AbstractShortSetting {
|
|||
RENDERER_SPEED_LIMIT("speed_limit"),
|
||||
RENDERER_TURBO_SPEED_LIMIT("turbo_speed_limit"),
|
||||
RENDERER_SLOW_SPEED_LIMIT("slow_speed_limit"),
|
||||
DEBUG_KNOBS("debug_knobs")
|
||||
;
|
||||
|
||||
override fun getShort(needsGlobal: Boolean): Short = NativeConfig.getShort(key, needsGlobal)
|
||||
|
|
@ -28,4 +29,4 @@ enum class ShortSetting(override val key: String) : AbstractShortSetting {
|
|||
override fun getValueAsString(needsGlobal: Boolean): String = getShort(needsGlobal).toString()
|
||||
|
||||
override fun reset() = NativeConfig.setShort(key, defaultValue)
|
||||
}
|
||||
}
|
||||
|
|
@ -896,7 +896,7 @@ abstract class SettingsItem(
|
|||
)
|
||||
put(
|
||||
SpinBoxSetting(
|
||||
IntSetting.DEBUG_KNOBS,
|
||||
ShortSetting.DEBUG_KNOBS,
|
||||
titleId = R.string.debug_knobs,
|
||||
descriptionId = R.string.debug_knobs_description,
|
||||
valueHint = R.string.debug_knobs_hint,
|
||||
|
|
|
|||
|
|
@ -1229,7 +1229,7 @@ class SettingsFragmentPresenter(
|
|||
|
||||
add(HeaderSetting(R.string.general))
|
||||
|
||||
add(IntSetting.DEBUG_KNOBS.key)
|
||||
add(ShortSetting.DEBUG_KNOBS.key)
|
||||
|
||||
add(HeaderSetting(R.string.gpu_logging_header))
|
||||
add(BooleanSetting.GPU_LOGGING_ENABLED.key)
|
||||
|
|
|
|||
|
|
@ -791,7 +791,7 @@ struct Values {
|
|||
0,
|
||||
65535,
|
||||
"debug_knobs",
|
||||
Category::Debugging,
|
||||
Category::Core,
|
||||
Specialization::Countable,
|
||||
true,
|
||||
true};
|
||||
|
|
|
|||
Loading…
Reference in New Issue