Skip to content

Commit

Permalink
Fix Nit's
Browse files Browse the repository at this point in the history
  • Loading branch information
Spidy123222 committed Jul 10, 2024
1 parent 68f741b commit 83af776
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion config_spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,6 @@ perf:
override_clockspeed:
type: bool
default: false
cpu_clockspeed:
cpu_clockspeed_scale:
type: number
default: 1
3 changes: 1 addition & 2 deletions hw/i386/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -536,11 +536,10 @@ static long get_file_size(FILE *f)
uint64_t cpu_get_tsc(CPUX86State *env)
{
#ifdef XBOX
float clock_multiplier = g_config.perf.cpu_clockspeed;
int cpu_clock_hz = 733333333;

if (g_config.perf.override_clockspeed) {
cpu_clock_hz *= clock_multiplier;
cpu_clock_hz *= g_config.perf.cpu_clockspeed_scale;
}
return muldiv64(qemu_clock_get_ns(QEMU_CLOCK_VIRTUAL), cpu_clock_hz, NANOSECONDS_PER_SECOND);
#else
Expand Down
8 changes: 4 additions & 4 deletions ui/xui/main-menu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,11 @@ void MainMenuGeneralView::Draw()
"Enables to override default CPU clock speed");

char buf[32];
snprintf(buf, sizeof(buf), "Clock Speed %d%% (%.2f MHz)", (int)(g_config.perf.cpu_clockspeed * 100), (733333333 * g_config.perf.cpu_clockspeed)/1000000);
Slider("Virtual CPU clock", &g_config.perf.cpu_clockspeed, buf, 0.01f, 2.f, 0.01f);
snprintf(buf, sizeof(buf), "Clock Speed %d%% (%.2f MHz)", (int)(g_config.perf.cpu_clockspeed_scale * 100), (733333333 * g_config.perf.cpu_clockspeed_scale) / 1000000);
Slider("Virtual CPU clock", &g_config.perf.cpu_clockspeed_scale, buf, 0.01f, 2.f, 0.01f);

if (fabs(g_config.perf.cpu_clockspeed - 1.f) <= 0.0099f) {
g_config.perf.cpu_clockspeed = 1;
if (fabs(g_config.perf.cpu_clockspeed_scale - 1.f) <= 0.0099f) {
g_config.perf.cpu_clockspeed_scale = 1;
}

SectionTitle("Miscellaneous");
Expand Down
3 changes: 2 additions & 1 deletion ui/xui/widgets.cc
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,8 @@ bool Toggle(const char *str_id, bool *v, const char *description)
return status;
}

void Slider(const char *str_id, float *v, const char *description, float min, float max, float increment) {
void Slider(const char *str_id, float *v, const char *description, float min, float max, float increment)
{
float x = (*v - min) / (max - min);
ImGui::PushStyleColor(ImGuiCol_Button, IM_COL32_BLACK_TRANS);

Expand Down

0 comments on commit 83af776

Please sign in to comment.