Merge pull request #5422 from Cacodemon345/qt-hide-fdd-menus
Make sure that floppy icons and options do not appear if there's no floppy controller available
This commit is contained in:
@@ -79,6 +79,8 @@ int floppyrate[4];
|
||||
|
||||
int fdc_current[FDC_MAX] = { 0, 0 };
|
||||
|
||||
volatile int fdcinited = 0;
|
||||
|
||||
#ifdef ENABLE_FDC_LOG
|
||||
int fdc_do_log = ENABLE_FDC_LOG;
|
||||
|
||||
@@ -2348,6 +2350,8 @@ fdc_close(void *priv)
|
||||
|
||||
fifo_close(fdc->fifo_p);
|
||||
|
||||
fdcinited = 0;
|
||||
|
||||
free(fdc);
|
||||
}
|
||||
|
||||
@@ -2393,6 +2397,8 @@ fdc_init(const device_t *info)
|
||||
|
||||
fdc_reset(fdc);
|
||||
|
||||
fdcinited = 1;
|
||||
|
||||
return fdc;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,8 @@ extern "C" {
|
||||
#include <86box/ui.h>
|
||||
#include <86box/machine_status.h>
|
||||
#include <86box/config.h>
|
||||
|
||||
extern volatile int fdcinited;
|
||||
};
|
||||
|
||||
#include <QIcon>
|
||||
@@ -303,6 +305,9 @@ MachineStatus::hasSCSI()
|
||||
void
|
||||
MachineStatus::iterateFDD(const std::function<void(int)> &cb)
|
||||
{
|
||||
if (!fdcinited)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < FDD_NUM; ++i) {
|
||||
if (fdd_get_type(i) != 0) {
|
||||
cb(i);
|
||||
|
||||
Reference in New Issue
Block a user