From 8a8d549c0f5a6d9cffab97ebc46ae377d51ecea2 Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Tue, 9 Jun 2020 22:25:27 +0200 Subject: [PATCH] Implemented Floppy Turbo mode - fixes #526 --- src/osdep/gui/PanelFloppy.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/osdep/gui/PanelFloppy.cpp b/src/osdep/gui/PanelFloppy.cpp index 698f78e6..9a428d6c 100644 --- a/src/osdep/gui/PanelFloppy.cpp +++ b/src/osdep/gui/PanelFloppy.cpp @@ -29,8 +29,8 @@ static gcn::Button* cmdCreateDDDisk; static gcn::Button* cmdCreateHDDisk; static const char* diskfile_filter[] = {".adf", ".adz", ".fdi", ".ipf", ".zip", ".dms", ".gz", ".xz", "\0"}; -static const char* drive_speed_list[] = {"100% (compatible)", "200%", "400%", "800%"}; -static const int drive_speed_values[] = {100, 200, 400, 800}; +static const char* drive_speed_list[] = {"Turbo", "100% (compatible)", "200%", "400%", "800%"}; +static const int drive_speed_values[] = {0, 100, 200, 400, 800}; static void AdjustDropDownControls(); static bool bLoadConfigForDisk = false; @@ -283,7 +283,7 @@ class DriveSpeedSliderActionListener : public gcn::ActionListener public: void action(const gcn::ActionEvent& actionEvent) override { - changed_prefs.floppy_speed = drive_speed_values[int(sldDriveSpeed->getValue())]; + changed_prefs.floppy_speed = drive_speed_values[static_cast(sldDriveSpeed->getValue())]; RefreshPanelFloppy(); } }; @@ -437,14 +437,14 @@ void InitPanelFloppy(const struct _ConfigCategory& category) } lblDriveSpeed = new gcn::Label("Floppy Drive Emulation Speed:"); - sldDriveSpeed = new gcn::Slider(0, 3); + sldDriveSpeed = new gcn::Slider(0, 4); sldDriveSpeed->setSize(110, SLIDER_HEIGHT); sldDriveSpeed->setBaseColor(gui_baseCol); sldDriveSpeed->setMarkerLength(20); sldDriveSpeed->setStepLength(1); sldDriveSpeed->setId("DriveSpeed"); sldDriveSpeed->addActionListener(driveSpeedSliderActionListener); - lblDriveSpeedInfo = new gcn::Label(drive_speed_list[0]); + lblDriveSpeedInfo = new gcn::Label(drive_speed_list[1]); cmdSaveForDisk = new gcn::Button("Save config for disk"); cmdSaveForDisk->setSize(cmdSaveForDisk->getWidth(), BUTTON_HEIGHT); @@ -591,7 +591,7 @@ void RefreshPanelFloppy() chkLoadConfig->setSelected(bLoadConfigForDisk); - for (i = 0; i < 4; ++i) + for (i = 0; i <= 4; ++i) { if (changed_prefs.floppy_speed == drive_speed_values[i]) {