Removed redundant CD-ROM Disabled option.

This commit is contained in:
SarahW 2018-02-10 12:48:07 +00:00
commit cdf42681af
7 changed files with 1347 additions and 1450 deletions

View file

@ -545,7 +545,6 @@ int keybsenddelay;
extern int cdrom_drive;
extern int old_cdrom_drive;
extern int idecallback[2];
extern int cdrom_enabled;
#define CD_STATUS_EMPTY 0
#define CD_STATUS_DATA_ONLY 1

View file

@ -271,7 +271,7 @@ void resetide(void)
{
ide_drives[d].drive = d;
if ((cdrom_channel == d) && cdrom_enabled)
if (cdrom_channel == d)
{
ide_drives[d].type = IDE_CDROM;
scsi_bus_atapi_init(&ide_drives[d].atapi.bus, &scsi_cd, d);

View file

@ -63,7 +63,6 @@ int window_w, window_h, window_x, window_y, window_remember;
int start_in_fullscreen = 0;
int cdrom_enabled;
int CPUID;
int vid_resize, vid_api;
@ -726,7 +725,6 @@ void loadconfig(char *fn)
mem_size = (((models[model].flags & MODEL_AT) && models[model].ram_granularity < 128) ? models[model].min_ram*1024 : models[model].min_ram);
cdrom_drive = config_get_int(CFG_MACHINE, NULL, "cdrom_drive", 0);
cdrom_enabled = config_get_int(CFG_MACHINE, NULL, "cdrom_enabled", 0);
cdrom_channel = config_get_int(CFG_MACHINE, NULL, "cdrom_channel", 2);
zip_channel = config_get_int(CFG_MACHINE, NULL, "zip_channel", -1);
@ -871,7 +869,6 @@ void saveconfig(char *fn)
config_set_int(CFG_MACHINE, NULL, "mem_size", mem_size);
config_set_int(CFG_MACHINE, NULL, "cdrom_drive", cdrom_drive);
config_set_int(CFG_MACHINE, NULL, "cdrom_enabled", cdrom_enabled);
config_set_int(CFG_MACHINE, NULL, "cdrom_channel", cdrom_channel);
config_set_string(CFG_MACHINE, NULL, "cdrom_path", image_path);

View file

@ -128,10 +128,6 @@
<label>_Load image...</label>
</object>
<object class="separator"/>
<object class="wxMenuItem" name="IDM_CDROM_DISABLED">
<label>_Disabled</label>
<radio>1</radio>
</object>
<object class="wxMenuItem" name="IDM_CDROM_EMPTY">
<label>_Empty</label>
<radio>1</radio>

File diff suppressed because it is too large Load diff

View file

@ -61,7 +61,7 @@ drive_info_t* get_machine_info(char* s, int* num_drive_info) {
for (i = 0; i < num_hdds; ++i)
{
drive = 'C'+i;
if (cdrom_enabled && !hdd_controller_current_is_mfm() && i == cdrom_channel)
if (!hdd_controller_current_is_mfm() && i == cdrom_channel)
{
if (cdrom_drive < 0)
continue;

View file

@ -353,17 +353,12 @@ void sdl_saveconfig()
void update_cdrom_menu(void* hmenu)
{
if (!cdrom_enabled)
wx_checkmenuitem(menu, WX_ID("IDM_CDROM_DISABLED"), WX_MB_CHECKED);
if (cdrom_drive == CDROM_IMAGE)
wx_checkmenuitem(menu, WX_ID("IDM_CDROM_IMAGE"), WX_MB_CHECKED);
else if (cdrom_drive > 0)
wx_checkmenuitem(menu, IDM_CDROM_REAL+cdrom_drive, WX_MB_CHECKED);
else
{
if (cdrom_drive == CDROM_IMAGE)
wx_checkmenuitem(menu, WX_ID("IDM_CDROM_IMAGE"), WX_MB_CHECKED);
else if (cdrom_drive > 0)
wx_checkmenuitem(menu, IDM_CDROM_REAL+cdrom_drive, WX_MB_CHECKED);
else
wx_checkmenuitem(menu, WX_ID("IDM_CDROM_EMPTY"), WX_MB_CHECKED);
}
wx_checkmenuitem(menu, WX_ID("IDM_CDROM_EMPTY"), WX_MB_CHECKED);
}
void wx_initmenu()
@ -1058,49 +1053,9 @@ int wx_handle_command(void* hwnd, int wParam, int checked)
wx_checkmenuitem(menu, wParam, WX_MB_CHECKED);
saveconfig(NULL);
}
else if (ID_IS("IDM_CDROM_DISABLED"))
{
if (cdrom_enabled)
{
if (!confirm())
{
update_cdrom_menu(hmenu);
return 0;
}
}
if (!cdrom_enabled)
{
/* Switching from disabled to disabled. Do nothing. */
update_cdrom_menu(hmenu);
return 0;
}
atapi->exit();
atapi_close();
ioctl_set_drive(0);
old_cdrom_drive = cdrom_drive;
cdrom_drive = 0;
if (cdrom_enabled)
{
pause = 1;
SDL_Delay(100);
cdrom_enabled = 0;
saveconfig(NULL);
resetpchard();
pause = 0;
}
update_cdrom_menu(hmenu);
}
else if (ID_IS("IDM_CDROM_EMPTY"))
{
if (!cdrom_enabled)
{
if (!confirm())
{
update_cdrom_menu(hmenu);
return 0;
}
}
if ((cdrom_drive == 0) && cdrom_enabled)
if (cdrom_drive == 0)
{
update_cdrom_menu(hmenu);
/* Switch from empty to empty. Do nothing. */
@ -1112,15 +1067,6 @@ int wx_handle_command(void* hwnd, int wParam, int checked)
old_cdrom_drive = cdrom_drive;
cdrom_drive = 0;
saveconfig(NULL);
if (!cdrom_enabled)
{
pause = 1;
SDL_Delay(100);
cdrom_enabled = 1;
saveconfig(NULL);
resetpchard();
pause = 0;
}
update_cdrom_menu(hmenu);
}
else if (ID_IS("IDM_CDROM_IMAGE") || ID_IS("IDM_CDROM_IMAGE_LOAD"))
@ -1129,19 +1075,10 @@ int wx_handle_command(void* hwnd, int wParam, int checked)
"CD-ROM image (*.iso;*.cue)|*.iso;*.cue|All files (*.*)|*.*",
image_path))
{
if (!cdrom_enabled)
{
if (!confirm())
{
update_cdrom_menu(hmenu);
return 0;
}
}
old_cdrom_drive = cdrom_drive;
strcpy(temp_image_path, openfilestring);
if ((strcmp(image_path, temp_image_path) == 0)
&& (cdrom_drive == CDROM_IMAGE)
&& cdrom_enabled)
&& (cdrom_drive == CDROM_IMAGE))
{
/* Switching from ISO to the same ISO. Do nothing. */
update_cdrom_menu(hmenu);
@ -1152,31 +1089,14 @@ int wx_handle_command(void* hwnd, int wParam, int checked)
image_open(temp_image_path);
cdrom_drive = CDROM_IMAGE;
saveconfig(NULL);
if (!cdrom_enabled)
{
pause = 1;
SDL_Delay(100);
cdrom_enabled = 1;
saveconfig(NULL);
resetpchard();
pause = 0;
}
update_cdrom_menu(hmenu);
} else
update_cdrom_menu(hmenu);
}
else if (wParam >= IDM_CDROM_REAL && wParam < IDM_CDROM_REAL+100)
{
if (!cdrom_enabled)
{
if (!confirm())
{
update_cdrom_menu(hmenu);
return 0;
}
}
new_cdrom_drive = wParam-IDM_CDROM_REAL;
if ((cdrom_drive == new_cdrom_drive) && cdrom_enabled)
if (cdrom_drive == new_cdrom_drive)
{
/* Switching to the same drive. Do nothing. */
update_cdrom_menu(hmenu);
@ -1188,15 +1108,6 @@ int wx_handle_command(void* hwnd, int wParam, int checked)
ioctl_set_drive(new_cdrom_drive);
cdrom_drive = new_cdrom_drive;
saveconfig(NULL);
if (!cdrom_enabled)
{
pause = 1;
SDL_Delay(100);
cdrom_enabled = 1;
saveconfig(NULL);
resetpchard();
pause = 0;
}
update_cdrom_menu(hmenu);
}
return 0;