mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-27 22:03:37 +00:00
android: Port advanced emulation settings to Zep Zone
- Add memory layout configuration (4GB-16GB DRAM options) - Implement ASTC texture handling controls - Add shader backend selection (GLSL/GLASM/SPIR-V) - Include VRAM usage mode settings - Create organized UI with headers and detailed descriptions - Based On Uzuy Commit 8f49bef05c 14/09/2024 Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.citron.citron_emu.features.settings.model
|
||||
@@ -26,7 +27,14 @@ enum class IntSetting(override val key: String) : AbstractIntSetting {
|
||||
OVERLAY_OPACITY("control_opacity"),
|
||||
LOCK_DRAWER("lock_drawer"),
|
||||
VERTICAL_ALIGNMENT("vertical_alignment"),
|
||||
FSR_SHARPENING_SLIDER("fsr_sharpening_slider");
|
||||
FSR_SHARPENING_SLIDER("fsr_sharpening_slider"),
|
||||
|
||||
// Zep Zone settings
|
||||
MEMORY_LAYOUT_MODE("memory_layout_mode"),
|
||||
ASTC_DECODE_MODE("accelerate_astc"),
|
||||
ASTC_RECOMPRESSION("astc_recompression"),
|
||||
SHADER_BACKEND("shader_backend"),
|
||||
VRAM_USAGE_MODE("vram_usage_mode");
|
||||
|
||||
override fun getInt(needsGlobal: Boolean): Int = NativeConfig.getInt(key, needsGlobal)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.citron.citron_emu.features.settings.model
|
||||
@@ -22,7 +23,8 @@ object Settings {
|
||||
SECTION_INPUT_PLAYER_SEVEN,
|
||||
SECTION_INPUT_PLAYER_EIGHT,
|
||||
SECTION_THEME(R.string.preferences_theme),
|
||||
SECTION_DEBUG(R.string.preferences_debug);
|
||||
SECTION_DEBUG(R.string.preferences_debug),
|
||||
SECTION_ZEP_ZONE(R.string.preferences_zep_zone);
|
||||
}
|
||||
|
||||
fun getPlayerString(player: Int): String =
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.citron.citron_emu.features.settings.model.view
|
||||
@@ -386,6 +387,53 @@ abstract class SettingsItem(
|
||||
override fun reset() = setBoolean(defaultValue)
|
||||
}
|
||||
put(SwitchSetting(fastmem, R.string.fastmem))
|
||||
|
||||
// Zep Zone Settings
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.MEMORY_LAYOUT_MODE,
|
||||
titleId = R.string.memory_layout_mode,
|
||||
descriptionId = R.string.memory_layout_mode_description,
|
||||
choicesId = R.array.memoryLayoutNames,
|
||||
valuesId = R.array.memoryLayoutValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.ASTC_DECODE_MODE,
|
||||
titleId = R.string.astc_decode_mode,
|
||||
descriptionId = R.string.astc_decode_mode_description,
|
||||
choicesId = R.array.astcDecodeModeNames,
|
||||
valuesId = R.array.astcDecodeModeValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.ASTC_RECOMPRESSION,
|
||||
titleId = R.string.astc_recompression,
|
||||
descriptionId = R.string.astc_recompression_description,
|
||||
choicesId = R.array.astcRecompressionNames,
|
||||
valuesId = R.array.astcRecompressionValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.SHADER_BACKEND,
|
||||
titleId = R.string.shader_backend,
|
||||
descriptionId = R.string.shader_backend_description,
|
||||
choicesId = R.array.shaderBackendNames,
|
||||
valuesId = R.array.shaderBackendValues
|
||||
)
|
||||
)
|
||||
put(
|
||||
SingleChoiceSetting(
|
||||
IntSetting.VRAM_USAGE_MODE,
|
||||
titleId = R.string.vram_usage_mode,
|
||||
descriptionId = R.string.vram_usage_mode_description,
|
||||
choicesId = R.array.vramUsageModeNames,
|
||||
valuesId = R.array.vramUsageModeValues
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
|
||||
// SPDX-FileCopyrightText: 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
package org.citron.citron_emu.features.settings.ui
|
||||
@@ -98,6 +99,7 @@ class SettingsFragmentPresenter(
|
||||
MenuTag.SECTION_INPUT_PLAYER_EIGHT -> addInputPlayer(sl, 7)
|
||||
MenuTag.SECTION_THEME -> addThemeSettings(sl)
|
||||
MenuTag.SECTION_DEBUG -> addDebugSettings(sl)
|
||||
MenuTag.SECTION_ZEP_ZONE -> addZepZoneSettings(sl)
|
||||
}
|
||||
settingsList = sl
|
||||
adapter.submitList(settingsList) {
|
||||
@@ -141,6 +143,14 @@ class SettingsFragmentPresenter(
|
||||
menuKey = MenuTag.SECTION_DEBUG
|
||||
)
|
||||
)
|
||||
add(
|
||||
SubmenuSetting(
|
||||
titleId = R.string.preferences_zep_zone,
|
||||
descriptionId = R.string.preferences_zep_zone_description,
|
||||
iconId = R.drawable.ic_settings,
|
||||
menuKey = MenuTag.SECTION_ZEP_ZONE
|
||||
)
|
||||
)
|
||||
add(
|
||||
RunnableSetting(
|
||||
titleId = R.string.reset_to_default,
|
||||
@@ -972,4 +982,19 @@ class SettingsFragmentPresenter(
|
||||
add(SettingsItem.FASTMEM_COMBINED)
|
||||
}
|
||||
}
|
||||
|
||||
private fun addZepZoneSettings(sl: ArrayList<SettingsItem>) {
|
||||
sl.apply {
|
||||
add(HeaderSetting(R.string.memory_layout_header))
|
||||
add(IntSetting.MEMORY_LAYOUT_MODE.key)
|
||||
|
||||
add(HeaderSetting(R.string.astc_settings_header))
|
||||
add(IntSetting.ASTC_DECODE_MODE.key)
|
||||
add(IntSetting.ASTC_RECOMPRESSION.key)
|
||||
|
||||
add(HeaderSetting(R.string.advanced_graphics_header))
|
||||
add(IntSetting.SHADER_BACKEND.key)
|
||||
add(IntSetting.VRAM_USAGE_MODE.key)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,4 +303,71 @@
|
||||
<item>2</item>
|
||||
</integer-array>
|
||||
|
||||
<!-- Zep Zone setting arrays -->
|
||||
<string-array name="memoryLayoutNames">
|
||||
<item>4GB DRAM (Default)</item>
|
||||
<item>6GB DRAM (Unsafe)</item>
|
||||
<item>8GB DRAM (Unsafe)</item>
|
||||
<item>10GB DRAM (Unsafe)</item>
|
||||
<item>12GB DRAM (Unsafe)</item>
|
||||
<item>14GB DRAM (Unsafe)</item>
|
||||
<item>16GB DRAM (Unsafe)</item>
|
||||
</string-array>
|
||||
|
||||
<integer-array name="memoryLayoutValues">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
<item>3</item>
|
||||
<item>4</item>
|
||||
<item>5</item>
|
||||
<item>6</item>
|
||||
</integer-array>
|
||||
|
||||
<string-array name="astcDecodeModeNames">
|
||||
<item>CPU</item>
|
||||
<item>GPU</item>
|
||||
<item>CPU Asynchronous</item>
|
||||
</string-array>
|
||||
|
||||
<integer-array name="astcDecodeModeValues">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</integer-array>
|
||||
|
||||
<string-array name="astcRecompressionNames">
|
||||
<item>Uncompressed</item>
|
||||
<item>BC1</item>
|
||||
<item>BC3</item>
|
||||
</string-array>
|
||||
|
||||
<integer-array name="astcRecompressionValues">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</integer-array>
|
||||
|
||||
<string-array name="shaderBackendNames">
|
||||
<item>GLSL</item>
|
||||
<item>GLASM</item>
|
||||
<item>SPIR-V</item>
|
||||
</string-array>
|
||||
|
||||
<integer-array name="shaderBackendValues">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
<item>2</item>
|
||||
</integer-array>
|
||||
|
||||
<string-array name="vramUsageModeNames">
|
||||
<item>Conservative</item>
|
||||
<item>Aggressive</item>
|
||||
</string-array>
|
||||
|
||||
<integer-array name="vramUsageModeValues">
|
||||
<item>0</item>
|
||||
<item>1</item>
|
||||
</integer-array>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -410,6 +410,13 @@
|
||||
<string name="preferences_theme">Theme and color</string>
|
||||
<string name="preferences_debug">Debug</string>
|
||||
<string name="preferences_debug_description">CPU/GPU debugging, graphics API, fastmem</string>
|
||||
<string name="preferences_zep_zone">Zep Zone</string>
|
||||
<string name="preferences_zep_zone_description">Advanced emulation settings</string>
|
||||
|
||||
<!-- Zep Zone Headers -->
|
||||
<string name="memory_layout_header">Memory Layout</string>
|
||||
<string name="astc_settings_header">ASTC Settings</string>
|
||||
<string name="advanced_graphics_header">Advanced Graphics</string>
|
||||
|
||||
<!-- Game properties -->
|
||||
<string name="info">Info</string>
|
||||
@@ -1167,4 +1174,16 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
</string>
|
||||
|
||||
<!-- Zep Zone settings strings -->
|
||||
<string name="memory_layout_mode">Memory Layout</string>
|
||||
<string name="memory_layout_mode_description">Increases the amount of emulated RAM from the stock 4GB of the retail Switch to the developer kit\'s 8/6GB. It doesn\'t improve stability or performance and is intended to let big texture mods fit in emulated RAM. Enabling it will increase memory use. It is not recommended to enable unless a specific game with a texture mod needs it.</string>
|
||||
<string name="astc_decode_mode">ASTC Decoding Method</string>
|
||||
<string name="astc_decode_mode_description">Controls how ASTC textures are decoded. GPU decoding is faster but may cause issues on some devices.</string>
|
||||
<string name="astc_recompression">ASTC Recompression Method</string>
|
||||
<string name="astc_recompression_description">Controls how ASTC textures are recompressed when GPU doesn\'t support them natively.</string>
|
||||
<string name="shader_backend">Shader Backend</string>
|
||||
<string name="shader_backend_description">Controls which shader backend to use for rendering.</string>
|
||||
<string name="vram_usage_mode">VRAM Usage Mode</string>
|
||||
<string name="vram_usage_mode_description">Controls how aggressively VRAM is used. Conservative mode limits VRAM usage for better stability.</string>
|
||||
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user