Skip to content

Commit

Permalink
bring back gs
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuoya committed Jul 29, 2022
1 parent 494e0a2 commit 9ab858c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,12 @@ public class SettingsItem {
public static final int SETTING_SKIP_CPU_WRITE = 2;
public static final int SETTING_SKIP_TEXTURE_COPY = 3;
public static final int SETTING_USE_LINEAR_FILTER = 4;
public static final int SETTING_SCALE_FACTOR = 5;
public static final int SETTING_SCREEN_LAYOUT = 6;
public static final int SETTING_ACCURATE_MUL = 7;
public static final int SETTING_CUSTOM_LAYOUT = 8;
public static final int SETTING_FRAME_LIMIT = 9;
public static final int SETTING_USE_HW_GS = 5;
public static final int SETTING_SCALE_FACTOR = 6;
public static final int SETTING_SCREEN_LAYOUT = 7;
public static final int SETTING_ACCURATE_MUL = 8;
public static final int SETTING_CUSTOM_LAYOUT = 9;
public static final int SETTING_FRAME_LIMIT = 10;

// pref
public static final int SETTING_JOYSTICK_RELATIVE = 100;
Expand Down Expand Up @@ -673,6 +674,9 @@ public void loadSettingsMenu() {
mSettings.add(new SettingsItem(SettingsItem.SETTING_USE_LINEAR_FILTER,
R.string.setting_use_linear_filter,
SettingsItem.TYPE_CHECKBOX, mRunningSettings[i++]));
mSettings.add(new SettingsItem(SettingsItem.SETTING_USE_HW_GS,
R.string.setting_use_hw_gs,
SettingsItem.TYPE_CHECKBOX, mRunningSettings[i++]));
mSettings.add(new SettingsItem(SettingsItem.SETTING_SCALE_FACTOR,
R.string.running_resolution, SettingsItem.TYPE_RADIO_GROUP,
mRunningSettings[i++]));
Expand Down
1 change: 1 addition & 0 deletions src/android/app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<string name="setting_skip_cpu_write">Omitir acceso a la CPU</string>
<string name="setting_skip_texture_copy">Saltar copia de textura</string>
<string name="setting_use_linear_filter">Usar filtro lineal</string>
<string name="setting_use_hw_gs">Habilitar sombreador de geometría</string>
<string name="use_haptic_feedback">Retroalimentación háptica (vibración)</string>
<string name="joystick_relative_center">Centro relativo de uso del joystick</string>
<string name="show_right_joystick">Mostrar joystick C</string>
Expand Down
1 change: 1 addition & 0 deletions src/android/app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<string name="setting_skip_cpu_write">跳过CPU访问</string>
<string name="setting_skip_texture_copy">跳过纹理复制</string>
<string name="setting_use_linear_filter">使用线性过滤</string>
<string name="setting_use_hw_gs">启用几何着色器</string>
<string name="use_haptic_feedback">按键反馈(震动)</string>
<string name="joystick_relative_center">摇杆使用相对位置</string>
<string name="show_right_joystick">显示右摇杆</string>
Expand Down
1 change: 1 addition & 0 deletions src/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<string name="setting_skip_cpu_write">Skip CPU Access</string>
<string name="setting_skip_texture_copy">Skip Texture Copy</string>
<string name="setting_use_linear_filter">Use Linear Filter</string>
<string name="setting_use_hw_gs">Enable Geometry Shader</string>
<string name="use_haptic_feedback">Haptic Feedback (Vibration)</string>
<string name="joystick_relative_center">Joystick use relative center</string>
<string name="show_right_joystick">Show Right Joystick</string>
Expand Down
1 change: 1 addition & 0 deletions src/android/jni/config/main_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ const ConfigInfo<std::string> CAMERA_DEVICE{{"Camera", "camera_type"}, "blank"};

// debug
const ConfigInfo<bool> ALLOW_SHADOW{{"Debug", "allow_shadow"}, false};
const ConfigInfo<bool> USE_HW_GS{{"Debug", "use_hw_gs"}, false};
const ConfigInfo<u8> SHADER_TYPE{{"Debug", "shader_type"}, 1};
const ConfigInfo<bool> USE_PRESENT_THREAD{{"Debug", "use_present_thread"}, true};
const ConfigInfo<bool> CPU_USAGE_LIMIT{{"Debug", "cpu_usage_limit"}, false};
Expand Down
1 change: 1 addition & 0 deletions src/android/jni/config/main_settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ extern const ConfigInfo<std::string> CAMERA_DEVICE;

// debug
extern const ConfigInfo<bool> ALLOW_SHADOW;
extern const ConfigInfo<bool> USE_HW_GS;
extern const ConfigInfo<u8> SHADER_TYPE;
extern const ConfigInfo<bool> USE_PRESENT_THREAD;
extern const ConfigInfo<bool> CPU_USAGE_LIMIT;
Expand Down
5 changes: 4 additions & 1 deletion src/android/jni/main_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -437,8 +437,10 @@ JNIEXPORT void JNICALL Java_org_citra_emu_NativeLibrary_Run(JNIEnv* env, jclass
Settings::values.is_new_3ds = Config::Get(Config::IS_NEW_3DS);
Settings::values.use_virtual_sd = Config::Get(Config::USE_VIRTUAL_SD);
Settings::values.region_value = Config::Get(Config::SYSTEM_REGION);
Settings::values.shared_font_type = Config::Get(Config::SHARED_FONT_TYPE);
// renderer
Settings::values.use_direct_display = true;
Settings::values.use_hw_gs = Config::Get(Config::USE_HW_GS);
Settings::values.use_gles = Config::Get(Config::USE_GLES);
Settings::values.show_fps = Config::Get(Config::SHOW_FPS);
Settings::values.use_hw_renderer = Config::Get(Config::USE_HW_RENDERER);
Expand Down Expand Up @@ -547,14 +549,15 @@ JNIEXPORT void JNICALL Java_org_citra_emu_NativeLibrary_StopEmulation(JNIEnv* en
JNIEXPORT jintArray JNICALL Java_org_citra_emu_NativeLibrary_getRunningSettings(JNIEnv* env,
jclass obj) {
int i = 0;
int settings[10];
int settings[11];

// get settings
settings[i++] = Settings::values.core_ticks_hack > 0;
settings[i++] = Settings::values.skip_slow_draw;
settings[i++] = Settings::values.skip_cpu_write;
settings[i++] = Settings::values.skip_texture_copy;
settings[i++] = Settings::values.use_linear_filter;
settings[i++] = Settings::values.use_hw_gs;
settings[i++] = std::min(std::max(Settings::values.resolution_factor - 1, 0), 3);
settings[i++] = static_cast<int>(Settings::values.layout_option);
settings[i++] = static_cast<int>(Settings::values.shaders_accurate_mul);
Expand Down
2 changes: 1 addition & 1 deletion src/core/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ struct Values {
std::string pp_shader_name;

bool custom_textures;
bool preload_textures;

// Audio
bool enable_dsp_lle;
Expand Down Expand Up @@ -218,6 +217,7 @@ struct Values {
bool use_present_thread;
bool use_direct_display;
bool use_fence_sync;
bool use_hw_gs;
SharedFontType shared_font_type;
AccurateMul shaders_accurate_mul;
std::string remote_shader_host;
Expand Down

0 comments on commit 9ab858c

Please sign in to comment.