#endif
void init_config()
{
+ int i;
// initial settings
memset(&config, 0, sizeof(config_t));
#if defined(USE_DEVICE_TYPE) && defined(DEVICE_TYPE_DEFAULT)
config.device_type = DEVICE_TYPE_DEFAULT;
#endif
-#if defined(USE_FD1) && defined(IGNORE_CRC_DEFAULT)
- config.ignore_crc = IGNORE_CRC_DEFAULT;
+#if defined(USE_FD1)
+# if defined(IGNORE_CRC_DEFAULT)
+ for(i = 0; i < 8; i++) config.ignore_crc[i] = IGNORE_CRC_DEFAULT;
+# else
+ for(i = 0; i < 8; i++) config.ignore_crc = false;
+# endif
#endif
#if defined(USE_SOUND_DEVICE_TYPE) && defined(SOUND_DEVICE_TYPE_DEFAULT)
config.sound_device_type = SOUND_DEVICE_TYPE_DEFAULT;
void load_config()
{
- int drv, i;
+ int drv, i;
// initial settings
init_config();
config.drive_type = GetPrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
#endif
#ifdef USE_FD1
- config.ignore_crc = GetPrivateProfileBool(_T("Control"), _T("IgnoreCRC"), config.ignore_crc, config_path);
+ {
+ _TCHAR _tag[128];
+ for(drv = 0; drv < 8; drv++) {
+ memset(_tag, 0x00, sizeof(_tag));
+ _stprintf_s(_tag, 64, _T("IgnoreCRC_%d"), drv + 1);
+ config.ignore_crc[drv] = GetPrivateProfileBool(_T("Control"), _tag, config.ignore_crc[drv], config_path);
+ }
+ }
#endif
#ifdef USE_TAPE
config.tape_sound = GetPrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
void save_config()
{
- int drv, i;
-
+ int drv, i;
// get config path
#if defined(_USE_AGAR) || defined(_USE_QT)
char app_path2[_MAX_PATH], *ptr;
WritePrivateProfileInt(_T("Control"), _T("DriveType"), config.drive_type, config_path);
#endif
#ifdef USE_FD1
- WritePrivateProfileBool(_T("Control"), _T("IgnoreCRC"), config.ignore_crc, config_path);
+ {
+ _TCHAR _tag[128];
+ for(drv = 0; drv < 8; drv++) {
+ memset(_tag, 0x00, sizeof(_tag));
+ _stprintf_s(_tag, 64, _T("IgnoreCRC_%d"), drv + 1);
+ WritePrivateProfileBool(_T("Control"), _tag, config.ignore_crc[drv], config_path);
+ }
+ }
+
#endif
#ifdef USE_TAPE
WritePrivateProfileBool(_T("Control"), _T("TapeSound"), config.tape_sound, config_path);
void save_config_state(void *f)
{
FILEIO *state_fio = (FILEIO *)f;
+ int drv;
state_fio->FputUint32(STATE_VERSION);
state_fio->FputInt32(config.drive_type);
#endif
#ifdef USE_FD1
- state_fio->FputBool(config.ignore_crc);
+ for(drv = 0; drv < 8; drv++) state_fio->FputBool(config.ignore_crc[drv]);
#endif
#ifdef USE_MONITOR_TYPE
state_fio->FputInt32(config.monitor_type);
bool load_config_state(void *f)
{
FILEIO *state_fio = (FILEIO *)f;
+ int drv;
if(state_fio->FgetUint32() != STATE_VERSION) {
return false;
config.drive_type = state_fio->FgetInt32();
#endif
#ifdef USE_FD1
- config.ignore_crc = state_fio->FgetBool();
+ for(drv = 0; drv < 8; drv++) config.ignore_crc[drv] = state_fio->FgetBool();
#endif
#ifdef USE_MONITOR_TYPE
config.monitor_type = state_fio->FgetInt32();
int drive_type;
#endif
#ifdef USE_FD1
- BOOL ignore_crc;
+ bool ignore_crc[8];
#endif
#ifdef USE_TAPE
bool tape_sound;
-void META_MainWindow::do_set_ignore_crc_error(bool flag)
-{
- if(emu) {
- config.ignore_crc = flag;
- emu->LockVM();
- emu->update_config();
- emu->UnlockVM();
- }
-}
void META_MainWindow::retranslateUi(void)
#endif
actionCycleSteal->setText(QString::fromUtf8("Cycle Steal"));
- actionIgnoreCRC->setText(QString::fromUtf8("Ignore CRC errors"));
menuSoundDevice->setTitle(QApplication::translate("MainWindow", "Sound Boards", 0));
#if defined(_FM77AV_VARIANTS)
actionSoundDevice[0]->setVisible(false);
this, SLOT(do_set_extram(bool)));
#endif
- actionIgnoreCRC = new Action_Control_7(this);
- menuMachine->addAction(actionIgnoreCRC);
- actionIgnoreCRC->setCheckable(true);
- actionIgnoreCRC->setVisible(true);
- if(config.ignore_crc == false) {
- actionIgnoreCRC->setChecked(false);
- } else {
- actionIgnoreCRC->setChecked(true);
- }
- connect(actionIgnoreCRC, SIGNAL(toggled(bool)),
- this, SLOT(do_set_ignore_crc_error(bool)));
-
}
# if defined(_FM77AV_VARIANTS) || defined(_FM77_VARIANTS)
class Action_Control_7 *actionExtRam;
# endif
- class Action_Control_7 *actionIgnoreCRC;
void setupUI_Emu(void);
void retranslateUi(void);
public:
~META_MainWindow();
public slots:
void do_set_sound_device(int);
- void do_set_ignore_crc_error(bool);
void do_set_extram(bool flag);
};
void on_recent_disk(void);
void write_protect_fd(void);
void no_write_protect_fd(void);
+ void do_set_ignore_crc_error(bool flag);
void set_screen_aspect(void);
void set_screen_size(void);
class Action_Control *action_D88_ListImage_FD[8][64];
class Action_Control *actionInsert_FD[8];
class Action_Control *actionEject_FD[8];
+ class Action_Control *actionIgnoreCRC[8];
class Action_Control *actionProtection_ON_FD[8];
class Action_Control *actionProtection_OFF_FD[8];
write_protect = false;
emit sig_write_protect_fd(drive, write_protect);
}
+
+void Object_Menu_Control::do_set_ignore_crc_error(bool flag)
+{
+ if(emu) {
+ config.ignore_crc[drive] = flag;
+ emu->LockVM();
+ emu->update_config();
+ emu->UnlockVM();
+ }
+}
+
// Common Routine
#ifdef USE_FD1
void Ui_MainWindow::open_disk_dialog(int drv)
menuFD[drv]->addAction(actionInsert_FD[drv]);
menuFD[drv]->addAction(actionEject_FD[drv]);
menuFD[drv]->addSeparator();
+ menuFD[drv]->addAction(actionIgnoreCRC[drv]);
+ menuFD[drv]->addSeparator();
menuFD_Recent[drv] = new QMenu(menuFD[drv]);
menuFD_Recent[drv]->setObjectName(QString::fromUtf8("Recent_FD", -1) + QString::number(drv));
menuFD[drv]->addAction(menuFD_Recent[drv]->menuAction());
actionEject_FD[drv]->binds->setDrive(drv);
actionEject_FD[drv]->binds->setNumber(0);
+ actionEject_FD[drv] = new Action_Control(this);
+ actionEject_FD[drv]->setObjectName(QString::fromUtf8("actionEject_FD") + drive_name);
+ actionEject_FD[drv]->binds->setDrive(drv);
+ actionEject_FD[drv]->binds->setNumber(0);
+
+ actionIgnoreCRC[drv] = new Action_Control(this);
+ actionIgnoreCRC[drv]->setCheckable(true);
+ actionIgnoreCRC[drv]->setVisible(true);
+ actionIgnoreCRC[drv]->binds->setDrive(drv);
+ actionIgnoreCRC[drv]->binds->setNumber(drv);
+ if(config.ignore_crc[drv] == false) {
+ actionIgnoreCRC[drv]->setChecked(false);
+ } else {
+ actionIgnoreCRC[drv]->setChecked(true);
+ }
+ connect(actionIgnoreCRC[drv], SIGNAL(toggled(bool)),
+ actionIgnoreCRC[drv]->binds, SLOT(do_set_ignore_crc_error(bool)));
+
actionGroup_Opened_FD[drv] = new QActionGroup(this);
actionRecent_Opened_FD[drv] = new Action_Control(this);
actionRecent_Opened_FD[drv]->setObjectName(QString::fromUtf8("actionRecent_Opened_FD") + drive_name);
menuFD[drv]->setTitle(QApplication::translate("MainWindow", drive_name.toUtf8().constData() , 0));
actionInsert_FD[drv]->setText(QApplication::translate("MainWindow", "Insert", 0));
actionEject_FD[drv]->setText(QApplication::translate("MainWindow", "Eject", 0));
+ actionIgnoreCRC[drv]->setText(QApplication::translate("MainWindow", "Ignore CRC Errors", 0));
menuFD_Recent[drv]->setTitle(QApplication::translate("MainWindow", "Recent Opened", 0));
menuFD_D88[drv]->setTitle(QApplication::translate("MainWindow", "Select D88 Image", 0));
density = t[6];
deleted = (t[7] != 0);
- if(config.ignore_crc != false) {
+ if(config.ignore_crc[drive_num] != false) {
crc_error = false;
} else {
crc_error = (((t[8] & 0xf0) != 0x00) && ((t[8] & 0xf0) != 0x10));
fdc[drvreg].next_trans_position = disk[drvreg]->data_position[i];
fdc[drvreg].next_sync_position = disk[drvreg]->sync_position[i];
fdc[drvreg].index = 0;
- return (disk[drvreg]->deleted ? FDC_ST_RECTYPE : 0) | ((disk[drvreg]->crc_error && !config.ignore_crc) ? FDC_ST_CRCERR : 0);
+ return (disk[drvreg]->deleted ? FDC_ST_RECTYPE : 0) | ((disk[drvreg]->crc_error && !config.ignore_crc[drvreg]) ? FDC_ST_CRCERR : 0);
}
// sector not found
fdc[drvreg].next_sync_position = disk[drvreg]->sync_position[first_sector];
fdc[drvreg].index = 0;
secreg = disk[drvreg]->id[0];
- return (disk[drvreg]->crc_error && !config.ignore_crc) ? FDC_ST_CRCERR : 0;
+ return (disk[drvreg]->crc_error && !config.ignore_crc[drvreg]) ? FDC_ST_CRCERR : 0;
}
// sector not found
AF = 0x0801; // record not found
return true;
}
- if(disk[drv]->crc_error && !config.ignore_crc) {
+ if(disk[drv]->crc_error && !config.ignore_crc[drv]) {
AF = 0x0401; // data crc error
return true;
}
AF = 0x0801; // record not found
return true;
}
- if(disk[drv]->crc_error && !config.ignore_crc) {
+ if(disk[drv]->crc_error && !config.ignore_crc[drv]) {
AF = 0x0401; // data crc error
return true;
}
AF = 0x0c01; // other error
return true;
}
- if(disk[drv]->crc_error && !config.ignore_crc) {
+ if(disk[drv]->crc_error && !config.ignore_crc[drv]) {
AF = 0x0401; // data crc error
return true;
}