diff --git a/src/config.c b/src/config.c
index 957489a18..0bad73574 100644
--- a/src/config.c
+++ b/src/config.c
@@ -84,11 +84,6 @@ static int cw;
static int ch;
static ini_t config;
-/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
-static int backwards_compat = 0;
-static int backwards_compat2 = 0;
-
-#define ENABLE_CONFIG_LOG 1
#ifdef ENABLE_CONFIG_LOG
int config_do_log = ENABLE_CONFIG_LOG;
@@ -145,14 +140,9 @@ load_general(void)
update_icons = ini_section_get_int(cat, "update_icons", 1);
window_remember = ini_section_get_int(cat, "window_remember", 0);
- if (window_remember || (vid_resize & 2)) {
- if (!window_remember)
- ini_section_delete_var(cat, "window_remember");
- } else {
- ini_section_delete_var(cat, "window_remember");
+ if (!window_remember && !(vid_resize & 2))
window_w = window_h = window_x = window_y = 0;
- }
if (vid_resize & 2) {
p = ini_section_get_string(cat, "window_fixed_res", NULL);
@@ -213,41 +203,37 @@ load_general(void)
if (p == NULL)
p = "0, 0, 0, 0";
sscanf(p, "%i, %i, %i, %i", &cw, &ch, &cx, &cy);
- } else {
+ } else
cw = ch = cx = cy = 0;
- ini_section_delete_var(cat, "window_remember");
- }
ini_section_delete_var(cat, "window_coordinates");
+
+ do_auto_pause = ini_section_get_int(cat, "do_auto_pause", 0);
}
/* Load monitor section. */
static void
load_monitor(int monitor_index)
{
- ini_section_t cat;
- char name[512];
- char temp[512];
- const char *p = NULL;
+ ini_section_t cat;
+ char name[512];
+ char temp[512];
+ const char * p = NULL;
+ monitor_settings_t *ms = &monitor_settings[monitor_index];
sprintf(name, "Monitor #%i", monitor_index + 1);
sprintf(temp, "%i, %i, %i, %i", cx, cy, cw, ch);
cat = ini_find_section(config, name);
- p = ini_section_get_string(cat, "window_coordinates", NULL);
-
- if (p == NULL)
- p = temp;
+ p = ini_section_get_string(cat, "window_coordinates", temp);
if (window_remember) {
- sscanf(p, "%i, %i, %i, %i",
- &monitor_settings[monitor_index].mon_window_x, &monitor_settings[monitor_index].mon_window_y,
- &monitor_settings[monitor_index].mon_window_w, &monitor_settings[monitor_index].mon_window_h);
- monitor_settings[monitor_index].mon_window_maximized = !!ini_section_get_int(cat, "window_maximized", 0);
- } else {
- monitor_settings[monitor_index].mon_window_maximized = 0;
- }
+ sscanf(p, "%i, %i, %i, %i", &ms->mon_window_x, &ms->mon_window_y,
+ &ms->mon_window_w, &ms->mon_window_h);
+ ms->mon_window_maximized = !!ini_section_get_int(cat, "window_maximized", 0);
+ } else
+ ms->mon_window_maximized = 0;
}
/* Load "Machine" section. */
@@ -465,22 +451,27 @@ load_machine(void)
c = 0;
i = 256;
while (cpu_f->cpus[cpu].cpu_type) {
- if (cpu_is_eligible(cpu_f, cpu, machine)) { /* skip ineligible CPUs */
- if ((cpu_f->cpus[cpu].rspeed == speed) && (cpu_f->cpus[cpu].multi == multi)) /* exact speed/multiplier match */
+ if (cpu_is_eligible(cpu_f, cpu, machine)) {
+ /* Skip ineligible CPUs. */
+ if ((cpu_f->cpus[cpu].rspeed == speed) && (cpu_f->cpus[cpu].multi == multi))
+ /* Exact speed/multiplier match. */
break;
- else if ((cpu_f->cpus[cpu].rspeed >= speed) && (i == 256)) /* closest speed match */
+ else if ((cpu_f->cpus[cpu].rspeed >= speed) && (i == 256))
+ /* Closest speed match. */
i = cpu;
c = cpu; /* store fastest eligible CPU */
}
cpu++;
}
- if (!cpu_f->cpus[cpu].cpu_type) /* if no exact match was found, use closest matching faster CPU, or fastest eligible CPU */
+ if (!cpu_f->cpus[cpu].cpu_type)
+ /* if no exact match was found, use closest matching faster CPU or fastest eligible CPU. */
cpu = MIN(i, c);
- } else { /* default */
- /* Find first eligible family. */
+ } else {
+ /* Default, find first eligible family. */
c = 0;
while (!cpu_family_is_eligible(&cpu_families[c], machine)) {
- if (cpu_families[c++].package == 0) { /* end of list */
+ if (cpu_families[c++].package == 0) {
+ /* End of list. */
fatal("No eligible CPU families for the selected machine\n");
return;
}
@@ -490,7 +481,8 @@ load_machine(void)
/* Find first eligible CPU in that family. */
cpu = 0;
while (!cpu_is_eligible(cpu_f, cpu, machine)) {
- if (cpu_f->cpus[cpu++].cpu_type == 0) { /* end of list */
+ if (cpu_f->cpus[cpu++].cpu_type == 0) {
+ /* End of list. */
cpu = 0;
break;
}
@@ -527,10 +519,6 @@ load_machine(void)
time_sync = !!ini_section_get_int(cat, "enable_sync", 1);
pit_mode = ini_section_get_int(cat, "pit_mode", -1);
-
- /* Remove this after a while.. */
- ini_section_delete_var(cat, "nvr_path");
- ini_section_delete_var(cat, "enable_sync");
}
/* Load "Video" section. */
@@ -556,7 +544,8 @@ load_video(void)
}
free_p = 1;
}
- if (!strcmp(p, "virge375_vbe20_pci")) /* migrate renamed cards */
+ if (!strcmp(p, "virge375_vbe20_pci"))
+ /* Migrate renamed cards */
gfxcard[0] = video_get_video_from_internal_name("virge385_pci");
else
gfxcard[0] = video_get_video_from_internal_name(p);
@@ -564,9 +553,11 @@ load_video(void)
free(p);
}
- if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_8514A)) || video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_8514)
+ if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_8514A)) ||
+ video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_8514)
ini_section_delete_var(cat, "8514a");
- if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_XGA)) || video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_XGA)
+ if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_XGA)) ||
+ video_card_get_flags(gfxcard[0]) == VIDEO_FLAG_TYPE_XGA)
ini_section_delete_var(cat, "xga");
voodoo_enabled = !!ini_section_get_int(cat, "voodoo", 0);
@@ -601,7 +592,8 @@ load_input_devices(void)
p = ini_section_get_string(cat, "joystick_type", NULL);
if (p != NULL) {
- if (!strcmp(p, "standard_2button")) /* migrate renamed types */
+ if (!strcmp(p, "standard_2button"))
+ /* Migrate renamed types */
joystick_type = joystick_get_from_internal_name("2axis_2button");
else if (!strcmp(p, "standard_4button"))
joystick_type = joystick_get_from_internal_name("2axis_4button");
@@ -616,7 +608,8 @@ load_input_devices(void)
if (!joystick_type) {
/* Try to read an integer for backwards compatibility with old configs */
- if (!strcmp(p, "0")) /* workaround for ini_section_get_int returning 0 on non-integer data */
+ if (!strcmp(p, "0"))
+ /* Workaround for ini_section_get_int returning 0 on non-integer data */
joystick_type = joystick_get_from_internal_name("2axis_2button");
else {
c = ini_section_get_int(cat, "joystick_type", 8);
@@ -668,7 +661,8 @@ load_input_devices(void)
sprintf(temp, "joystick_%i_pov_%i", c, d);
p = ini_section_get_string(cat, temp, "0, 0");
joystick_state[c].pov_mapping[d][0] = joystick_state[c].pov_mapping[d][1] = 0;
- sscanf(p, "%i, %i", &joystick_state[c].pov_mapping[d][0], &joystick_state[c].pov_mapping[d][1]);
+ sscanf(p, "%i, %i", &joystick_state[c].pov_mapping[d][0],
+ &joystick_state[c].pov_mapping[d][1]);
}
}
}
@@ -775,50 +769,46 @@ load_sound(void)
static void
load_network(void)
{
- ini_section_t cat = ini_find_section(config, "Network");
- char *p;
- char temp[512];
- uint16_t c = 0;
- uint16_t min = 0;
+ ini_section_t cat = ini_find_section(config, "Network");
+ char * p;
+ char temp[512];
+ uint16_t c = 0;
+ uint16_t min = 0;
+ netcard_conf_t *nc = &net_cards_conf[c];
/* Handle legacy configuration which supported only one NIC */
p = ini_section_get_string(cat, "net_card", NULL);
if (p != NULL) {
- net_cards_conf[c].device_num = network_card_get_from_internal_name(p);
+ nc->device_num = network_card_get_from_internal_name(p);
p = ini_section_get_string(cat, "net_type", NULL);
if (p != NULL) {
if (!strcmp(p, "pcap") || !strcmp(p, "1"))
- net_cards_conf[c].net_type = NET_TYPE_PCAP;
+ nc->net_type = NET_TYPE_PCAP;
else if (!strcmp(p, "slirp") || !strcmp(p, "2"))
- net_cards_conf[c].net_type = NET_TYPE_SLIRP;
+ nc->net_type = NET_TYPE_SLIRP;
else if (!strcmp(p, "vde") || !strcmp(p, "2"))
- net_cards_conf[c].net_type = NET_TYPE_VDE;
+ nc->net_type = NET_TYPE_VDE;
else
- net_cards_conf[c].net_type = NET_TYPE_NONE;
- } else {
- net_cards_conf[c].net_type = NET_TYPE_NONE;
- }
+ nc->net_type = NET_TYPE_NONE;
+ } else
+ nc->net_type = NET_TYPE_NONE;
p = ini_section_get_string(cat, "net_host_device", NULL);
if (p != NULL) {
- if (net_cards_conf[c].net_type == NET_TYPE_PCAP) {
+ if (nc->net_type == NET_TYPE_PCAP) {
if ((network_dev_to_id(p) == -1) || (network_ndev == 1)) {
- if (network_ndev == 1) {
+ if (network_ndev == 1)
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2095, (wchar_t *) IDS_2130);
- } else if (network_dev_to_id(p) == -1) {
+ else if (network_dev_to_id(p) == -1)
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2096, (wchar_t *) IDS_2130);
- }
- strcpy(net_cards_conf[c].host_dev_name, "none");
- } else {
- strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1);
- }
- } else {
- strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1);
- }
- } else {
- strcpy(net_cards_conf[c].host_dev_name, "none");
- }
+ strcpy(nc->host_dev_name, "none");
+ } else
+ strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
+ } else
+ strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
+ } else
+ strcpy(nc->host_dev_name, "none");
min++;
}
@@ -828,54 +818,50 @@ load_network(void)
ini_section_delete_var(cat, "net_host_device");
for (c = min; c < NET_CARD_MAX; c++) {
+ nc = &net_cards_conf[c];
sprintf(temp, "net_%02i_card", c + 1);
p = ini_section_get_string(cat, temp, NULL);
- if (p != NULL) {
- net_cards_conf[c].device_num = network_card_get_from_internal_name(p);
- } else {
- net_cards_conf[c].device_num = 0;
- }
+ if (p != NULL)
+ nc->device_num = network_card_get_from_internal_name(p);
+ else
+ nc->device_num = 0;
sprintf(temp, "net_%02i_net_type", c + 1);
p = ini_section_get_string(cat, temp, NULL);
if (p != NULL) {
- if (!strcmp(p, "pcap") || !strcmp(p, "1")) {
- net_cards_conf[c].net_type = NET_TYPE_PCAP;
- } else if (!strcmp(p, "slirp") || !strcmp(p, "2")) {
- net_cards_conf[c].net_type = NET_TYPE_SLIRP;
- } else if (!strcmp(p, "vde") || !strcmp(p, "2")) {
- net_cards_conf[c].net_type = NET_TYPE_VDE;
- } else {
- net_cards_conf[c].net_type = NET_TYPE_NONE;
- }
- } else {
- net_cards_conf[c].net_type = NET_TYPE_NONE;
- }
+ if (!strcmp(p, "pcap") || !strcmp(p, "1"))
+ nc->net_type = NET_TYPE_PCAP;
+ else if (!strcmp(p, "slirp") || !strcmp(p, "2"))
+ nc->net_type = NET_TYPE_SLIRP;
+ else if (!strcmp(p, "vde") || !strcmp(p, "2"))
+ nc->net_type = NET_TYPE_VDE;
+ else
+ nc->net_type = NET_TYPE_NONE;
+ } else
+ nc->net_type = NET_TYPE_NONE;
sprintf(temp, "net_%02i_host_device", c + 1);
p = ini_section_get_string(cat, temp, NULL);
if (p != NULL) {
- if (net_cards_conf[c].net_type == NET_TYPE_PCAP) {
+ if (nc->net_type == NET_TYPE_PCAP) {
if ((network_dev_to_id(p) == -1) || (network_ndev == 1)) {
- if (network_ndev == 1) {
+ if (network_ndev == 1)
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2095, (wchar_t *) IDS_2130);
- } else if (network_dev_to_id(p) == -1) {
+ else if (network_dev_to_id(p) == -1)
ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2096, (wchar_t *) IDS_2130);
- }
- strcpy(net_cards_conf[c].host_dev_name, "none");
- } else {
- strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1);
- }
- } else {
- strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1);
- }
- } else {
- strcpy(net_cards_conf[c].host_dev_name, "none");
- }
+ strcpy(nc->host_dev_name, "none");
+ } else
+ strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
+ } else
+ strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
+ } else
+ strcpy(nc->host_dev_name, "none");
sprintf(temp, "net_%02i_link", c + 1);
- net_cards_conf[c].link_state = ini_section_get_int(cat, temp,
- (NET_LINK_10_HD | NET_LINK_10_FD | NET_LINK_100_HD | NET_LINK_100_FD | NET_LINK_1000_HD | NET_LINK_1000_FD));
+ nc->link_state = ini_section_get_int(cat, temp,
+ (NET_LINK_10_HD | NET_LINK_10_FD |
+ NET_LINK_100_HD | NET_LINK_100_FD |
+ NET_LINK_1000_HD | NET_LINK_1000_FD));
}
}
@@ -931,17 +917,6 @@ load_storage_controllers(void)
int min = 0;
int free_p = 0;
- /* TODO: Backwards compatibility, get rid of this when enough time has passed. */
- backwards_compat2 = (cat == NULL);
-
- /* TODO: Backwards compatibility, get rid of this when enough time has passed. */
- p = ini_section_get_string(cat, "scsicard", NULL);
- if (p != NULL) {
- scsi_card_current[0] = scsi_card_get_from_internal_name(p);
- min++;
- }
- ini_section_delete_var(cat, "scsi_card");
-
for (c = min; c < SCSI_BUS_MAX; c++) {
sprintf(temp, "scsicard_%d", c + 1);
@@ -1238,62 +1213,6 @@ load_hard_disks(void)
}
}
-/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
-/* Load "Floppy Drives" section. */
-static void
-load_floppy_drives(void)
-{
- ini_section_t cat = ini_find_section(config, "Floppy drives");
- char temp[512];
- char *p;
-
- if (!backwards_compat)
- return;
-
- for (uint8_t c = 0; c < FDD_NUM; c++) {
- sprintf(temp, "fdd_%02i_type", c + 1);
- p = ini_section_get_string(cat, temp, (c < 2) ? "525_2dd" : "none");
- fdd_set_type(c, fdd_get_from_internal_name(p));
- if (fdd_get_type(c) > 13)
- fdd_set_type(c, 13);
- ini_section_delete_var(cat, temp);
-
- sprintf(temp, "fdd_%02i_fn", c + 1);
- p = ini_section_get_string(cat, temp, "");
- ini_section_delete_var(cat, temp);
-
- if (!strcmp(p, usr_path))
- p[0] = 0x00;
-
- if (p[0] != 0x00) {
- if (path_abs(p)) {
- if (strlen(p) > 511)
- fatal("load_floppy_drives(): strlen(p) > 511 (floppyfns[%i])\n", c);
- else
- strncpy(floppyfns[c], p, 511);
- } else
- path_append_filename(floppyfns[c], usr_path, p);
- path_normalize(floppyfns[c]);
- }
-
-#if defined(ENABLE_CONFIG_LOG) && (ENABLE_CONFIG_LOG == 2)
- if (*p != '\0')
- config_log("Floppy%d: %ls\n", c, floppyfns[c]);
-#endif
- sprintf(temp, "fdd_%02i_writeprot", c + 1);
- ui_writeprot[c] = !!ini_section_get_int(cat, temp, 0);
- ini_section_delete_var(cat, temp);
- sprintf(temp, "fdd_%02i_turbo", c + 1);
- fdd_set_turbo(c, !!ini_section_get_int(cat, temp, 0));
- ini_section_delete_var(cat, temp);
- sprintf(temp, "fdd_%02i_check_bpb", c + 1);
- fdd_set_check_bpb(c, !!ini_section_get_int(cat, temp, 1));
- ini_section_delete_var(cat, temp);
- }
-
- ini_delete_section_if_empty(config, cat);
-}
-
/* Load "Floppy and CD-ROM Drives" section. */
static void
load_floppy_and_cdrom_drives(void)
@@ -1308,9 +1227,6 @@ load_floppy_and_cdrom_drives(void)
int c;
int d = 0;
- /* TODO: Backwards compatibility, get rid of this when enough time has passed. */
- backwards_compat = (cat == NULL);
-
memset(temp, 0x00, sizeof(temp));
for (c = 0; c < FDD_NUM; c++) {
sprintf(temp, "fdd_%02i_type", c + 1);
@@ -1543,85 +1459,6 @@ load_other_removable_devices(void)
unsigned int board = 0;
unsigned int dev = 0;
int c;
- int d = 0;
-
- /* TODO: Backwards compatibility, get rid of this when enough time has passed. */
- if (backwards_compat) {
- memset(temp, 0x00, sizeof(temp));
- for (c = 0; c < CDROM_NUM; c++) {
- sprintf(temp, "cdrom_%02i_host_drive", c + 1);
- cdrom[c].host_drive = ini_section_get_int(cat, temp, 0);
- cdrom[c].prev_host_drive = cdrom[c].host_drive;
- ini_section_delete_var(cat, temp);
-
- sprintf(temp, "cdrom_%02i_parameters", c + 1);
- p = ini_section_get_string(cat, temp, NULL);
- if (p != NULL)
- sscanf(p, "%01u, %s", &d, s);
- else
- sscanf("0, none", "%01u, %s", &d, s);
- cdrom[c].sound_on = d;
- cdrom[c].bus_type = hdd_string_to_bus(s, 1);
- ini_section_delete_var(cat, temp);
-
- sprintf(temp, "cdrom_%02i_speed", c + 1);
- cdrom[c].speed = ini_section_get_int(cat, temp, 8);
- ini_section_delete_var(cat, temp);
-
- /* Default values, needed for proper operation of the Settings dialog. */
- cdrom[c].ide_channel = cdrom[c].scsi_device_id = c + 2;
- ini_section_delete_var(cat, temp);
-
- if (cdrom[c].bus_type == CDROM_BUS_ATAPI) {
- sprintf(temp, "cdrom_%02i_ide_channel", c + 1);
- sprintf(tmp2, "%01u:%01u", (c + 2) >> 1, (c + 2) & 1);
- p = ini_section_get_string(cat, temp, tmp2);
- sscanf(p, "%01u:%01u", &board, &dev);
- board &= 3;
- dev &= 1;
- cdrom[c].ide_channel = (board << 1) + dev;
-
- if (cdrom[c].ide_channel > 7)
- cdrom[c].ide_channel = 7;
-
- ini_section_delete_var(cat, temp);
- } else if (cdrom[c].bus_type == CDROM_BUS_SCSI) {
- sprintf(temp, "cdrom_%02i_scsi_id", c + 1);
- cdrom[c].scsi_device_id = ini_section_get_int(cat, temp, c + 2);
-
- if (cdrom[c].scsi_device_id > 15)
- cdrom[c].scsi_device_id = 15;
-
- ini_section_delete_var(cat, temp);
- }
-
- sprintf(temp, "cdrom_%02i_image_path", c + 1);
- p = ini_section_get_string(cat, temp, "");
- ini_section_delete_var(cat, temp);
-
- if (!strcmp(p, usr_path))
- p[0] = 0x00;
-
- if (p[0] != 0x00) {
- if (path_abs(p)) {
- if (strlen(p) > 511)
- fatal("load_other_removable_devices(): strlen(p) > 511 (cdrom[%i].image_path)\n",
- c);
- else
- strncpy(cdrom[c].image_path, p, 511);
- } else
- path_append_filename(cdrom[c].image_path, usr_path, p);
- path_normalize(cdrom[c].image_path);
- }
-
- if (cdrom[c].host_drive && (cdrom[c].host_drive != 200))
- cdrom[c].host_drive = 0;
-
- if ((cdrom[c].host_drive == 0x200) && (strlen(cdrom[c].image_path) == 0))
- cdrom[c].host_drive = 0;
- }
- }
- backwards_compat = 0;
memset(temp, 0x00, sizeof(temp));
for (c = 0; c < ZIP_NUM; c++) {
@@ -1863,59 +1700,6 @@ load_other_peripherals(void)
ini_section_t cat = ini_find_section(config, "Other peripherals");
char *p;
char temp[512];
- int free_p = 0;
-
- if (backwards_compat2) {
- p = ini_section_get_string(cat, "scsicard", NULL);
- if (p != NULL)
- scsi_card_current[0] = scsi_card_get_from_internal_name(p);
- else
- scsi_card_current[0] = 0;
- ini_section_delete_var(cat, "scsicard");
-
- p = ini_section_get_string(cat, "fdc", NULL);
- if (p != NULL)
- fdc_type = fdc_card_get_from_internal_name(p);
- else
- fdc_type = FDC_INTERNAL;
- ini_section_delete_var(cat, "fdc");
-
- p = ini_section_get_string(cat, "hdc", NULL);
- if (p == NULL) {
- if (machine_has_flags(machine, MACHINE_HDC)) {
- p = (char *) malloc((strlen("internal") + 1) * sizeof(char));
- strcpy(p, "internal");
- } else {
- p = (char *) malloc((strlen("none") + 1) * sizeof(char));
- strcpy(p, "none");
- }
- free_p = 1;
- }
- if (!strcmp(p, "mfm_xt"))
- hdc_current = hdc_get_from_internal_name("st506_xt");
- else if (!strcmp(p, "mfm_xt_dtc5150x"))
- hdc_current = hdc_get_from_internal_name("st506_xt_dtc5150x");
- else if (!strcmp(p, "mfm_at"))
- hdc_current = hdc_get_from_internal_name("st506_at");
- else if (!strcmp(p, "vlb_isa"))
- hdc_current = hdc_get_from_internal_name("ide_vlb");
- else if (!strcmp(p, "vlb_isa_2ch"))
- hdc_current = hdc_get_from_internal_name("ide_vlb_2ch");
- else
- hdc_current = hdc_get_from_internal_name(p);
- ini_section_delete_var(cat, "hdc");
-
- if (free_p) {
- free(p);
- p = NULL;
- }
-
- ide_ter_enabled = !!ini_section_get_int(cat, "ide_ter", 0);
- ini_section_delete_var(cat, "ide_ter");
- ide_qua_enabled = !!ini_section_get_int(cat, "ide_qua", 0);
- ini_section_delete_var(cat, "ide_qua");
- }
- backwards_compat2 = 0;
bugger_enabled = !!ini_section_get_int(cat, "bugger_enabled", 0);
postcard_enabled = !!ini_section_get_int(cat, "postcard_enabled", 0);
@@ -1961,6 +1745,7 @@ config_load(void)
scale = 1;
machine = machine_get_machine_from_internal_name("ibmpc");
dpi_scale = 1;
+ do_auto_pause = 0;
fpu_type = fpu_get_type(cpu_f, cpu, "none");
gfxcard[0] = video_get_video_from_internal_name("cga");
@@ -2009,9 +1794,9 @@ config_load(void)
config_log("Config file not present or invalid!\n");
} else {
- load_general(); /* General */
+ load_general(); /* General */
for (i = 0; i < MONITORS_NUM; i++)
- load_monitor(i);
+ load_monitor(i); /* Monitors */
load_machine(); /* Machine */
load_video(); /* Video */
load_input_devices(); /* Input devices */
@@ -2021,8 +1806,6 @@ config_load(void)
load_storage_controllers(); /* Storage controllers */
load_hard_disks(); /* Hard disks */
load_floppy_and_cdrom_drives(); /* Floppy and CD-ROM drives */
- /* TODO: Backwards compatibility, get rid of this when enough time has passed. */
- load_floppy_drives(); /* Floppy drives */
load_other_removable_devices(); /* Other removable devices */
load_other_peripherals(); /* Other peripherals */
@@ -2115,12 +1898,9 @@ save_general(void)
else
ini_section_set_int(cat, "update_icons", update_icons);
- if (window_remember || (vid_resize & 2)) {
- if (window_remember)
- ini_section_set_int(cat, "window_remember", window_remember);
- else
- ini_section_delete_var(cat, "window_remember");
- } else
+ if (window_remember)
+ ini_section_set_int(cat, "window_remember", window_remember);
+ else
ini_section_delete_var(cat, "window_remember");
if (vid_resize & 2) {
@@ -2204,6 +1984,11 @@ save_general(void)
else
ini_section_delete_var(cat, "video_gl_shader");
+ if (do_auto_pause)
+ ini_section_set_int(cat, "do_auto_pause", do_auto_pause);
+ else
+ ini_section_delete_var(cat, "do_auto_pause");
+
ini_delete_section_if_empty(config, cat);
}
@@ -2211,24 +1996,23 @@ save_general(void)
static void
save_monitor(int monitor_index)
{
- ini_section_t cat;
- char name[sizeof("Monitor #") + 12] = { [0] = 0 };
- char temp[512];
+ ini_section_t cat;
+ char name[sizeof("Monitor #") + 12] = { [0] = 0 };
+ char temp[512];
+ monitor_settings_t *ms = &monitor_settings[monitor_index];
snprintf(name, sizeof(name), "Monitor #%i", monitor_index + 1);
cat = ini_find_or_create_section(config, name);
if (window_remember) {
- sprintf(temp, "%i, %i, %i, %i",
- monitor_settings[monitor_index].mon_window_x, monitor_settings[monitor_index].mon_window_y,
- monitor_settings[monitor_index].mon_window_w, monitor_settings[monitor_index].mon_window_h);
+ sprintf(temp, "%i, %i, %i, %i", ms->mon_window_x, ms->mon_window_y,
+ ms->mon_window_w, ms->mon_window_h);
ini_section_set_string(cat, "window_coordinates", temp);
- if (monitor_settings[monitor_index].mon_window_maximized != 0) {
- ini_section_set_int(cat, "window_maximized", monitor_settings[monitor_index].mon_window_maximized);
- } else {
+ if (ms->mon_window_maximized != 0)
+ ini_section_set_int(cat, "window_maximized", ms->mon_window_maximized);
+ else
ini_section_delete_var(cat, "window_maximized");
- }
} else {
ini_section_delete_var(cat, "window_coordinates");
ini_section_delete_var(cat, "window_maximized");
@@ -2284,12 +2068,15 @@ save_machine(void)
/* Match the family name, speed and multiplier. */
if (!strcmp(cpu_f->internal_name, legacy_table_entry->family)) {
- if ((legacy_table_entry->rspeed == cpu_f->cpus[cpu].rspeed) && (legacy_table_entry->multi == cpu_f->cpus[cpu].multi)) { /* exact speed/multiplier match */
+ if ((legacy_table_entry->rspeed == cpu_f->cpus[cpu].rspeed) &&
+ (legacy_table_entry->multi == cpu_f->cpus[cpu].multi)) {
+ /* Exact speed/multiplier match. */
legacy_cpu = i;
break;
- } else if ((legacy_table_entry->rspeed >= cpu_f->cpus[cpu].rspeed) && (closest_legacy_cpu == -1)) { /* closest speed match */
+ } else if ((legacy_table_entry->rspeed >= cpu_f->cpus[cpu].rspeed) &&
+ (closest_legacy_cpu == -1))
+ /* Closest speed match. */
closest_legacy_cpu = i;
- }
}
i++;
@@ -2322,7 +2109,8 @@ save_machine(void)
else
ini_section_set_string(cat, "fpu_type", fpu_get_internal_name(cpu_f, cpu, fpu_type));
- // Write the mem_size explicitly to the setttings in order to help managers to display it without having the actual machine table
+ /* Write the mem_size explicitly to the setttings in order to help managers
+ to display it without having the actual machine table. */
ini_section_delete_var(cat, "mem_size");
ini_section_set_int(cat, "mem_size", mem_size);
@@ -2529,23 +2317,25 @@ save_sound(void)
static void
save_network(void)
{
- char temp[512];
- ini_section_t cat = ini_find_or_create_section(config, "Network");
+ char temp[512];
+ ini_section_t cat = ini_find_or_create_section(config, "Network");
+ netcard_conf_t *nc;
ini_section_delete_var(cat, "net_type");
ini_section_delete_var(cat, "net_host_device");
ini_section_delete_var(cat, "net_card");
for (uint8_t c = 0; c < NET_CARD_MAX; c++) {
+ nc = &net_cards_conf[c];
+
sprintf(temp, "net_%02i_card", c + 1);
- if (net_cards_conf[c].device_num == 0) {
+ if (nc->device_num == 0)
ini_section_delete_var(cat, temp);
- } else {
- ini_section_set_string(cat, temp, network_card_get_internal_name(net_cards_conf[c].device_num));
- }
+ else
+ ini_section_set_string(cat, temp, network_card_get_internal_name(nc->device_num));
sprintf(temp, "net_%02i_net_type", c + 1);
- switch(net_cards_conf[c].net_type) {
+ switch(nc->net_type) {
case NET_TYPE_NONE:
ini_section_delete_var(cat, temp);
break;
@@ -2564,21 +2354,21 @@ save_network(void)
}
sprintf(temp, "net_%02i_host_device", c + 1);
- if (net_cards_conf[c].host_dev_name[0] != '\0') {
- if (!strcmp(net_cards_conf[c].host_dev_name, "none"))
+ if (nc->host_dev_name[0] != '\0') {
+ if (!strcmp(nc->host_dev_name, "none"))
ini_section_delete_var(cat, temp);
else
- ini_section_set_string(cat, temp, net_cards_conf[c].host_dev_name);
+ ini_section_set_string(cat, temp, nc->host_dev_name);
} else
ini_section_delete_var(cat, temp);
sprintf(temp, "net_%02i_link", c + 1);
- if (net_cards_conf[c].link_state == (NET_LINK_10_HD | NET_LINK_10_FD |
- NET_LINK_100_HD | NET_LINK_100_FD |
- NET_LINK_1000_HD | NET_LINK_1000_FD))
+ if (nc->link_state == (NET_LINK_10_HD | NET_LINK_10_FD |
+ NET_LINK_100_HD | NET_LINK_100_FD |
+ NET_LINK_1000_HD | NET_LINK_1000_FD))
ini_section_delete_var(cat, temp);
else
- ini_section_set_int(cat, temp, net_cards_conf[c].link_state);
+ ini_section_set_int(cat, temp, nc->link_state);
}
ini_delete_section_if_empty(config, cat);
@@ -2798,9 +2588,9 @@ save_hard_disks(void)
ini_section_delete_var(cat, temp);
sprintf(temp, "hdd_%02i_ide_channel", c + 1);
- if (!hdd_is_valid(c) || (hdd[c].bus != HDD_BUS_IDE)) {
+ if (!hdd_is_valid(c) || (hdd[c].bus != HDD_BUS_IDE))
ini_section_delete_var(cat, temp);
- } else {
+ else {
sprintf(tmp2, "%01u:%01u", hdd[c].ide_channel >> 1, hdd[c].ide_channel & 1);
ini_section_set_string(cat, temp, tmp2);
}
@@ -2917,26 +2707,23 @@ save_floppy_and_cdrom_drives(void)
for (c = 0; c < CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c + 1);
- if ((cdrom[c].bus_type == 0) || (cdrom[c].host_drive != 200)) {
+ if ((cdrom[c].bus_type == 0) || (cdrom[c].host_drive != 200))
ini_section_delete_var(cat, temp);
- } else {
+ else
ini_section_set_int(cat, temp, cdrom[c].host_drive);
- }
sprintf(temp, "cdrom_%02i_speed", c + 1);
- if ((cdrom[c].bus_type == 0) || (cdrom[c].speed == 8)) {
+ if ((cdrom[c].bus_type == 0) || (cdrom[c].speed == 8))
ini_section_delete_var(cat, temp);
- } else {
+ else
ini_section_set_int(cat, temp, cdrom[c].speed);
- }
sprintf(temp, "cdrom_%02i_type", c + 1);
- if ((cdrom[c].bus_type == 0) || (cdrom[c].bus_type == CDROM_BUS_MITSUMI)) {
+ if ((cdrom[c].bus_type == 0) || (cdrom[c].bus_type == CDROM_BUS_MITSUMI))
ini_section_delete_var(cat, temp);
- } else {
+ else
ini_section_set_string(cat, temp,
cdrom_get_internal_name(cdrom_get_type(c)));
- }
sprintf(temp, "cdrom_%02i_parameters", c + 1);
if (cdrom[c].bus_type == 0)
@@ -3102,9 +2889,9 @@ save_other_removable_devices(void)
void
config_save(void)
{
- save_general(); /* General */
+ save_general(); /* General */
for (uint8_t i = 0; i < MONITORS_NUM; i++)
- save_monitor(i);
+ save_monitor(i); /* Monitors */
save_machine(); /* Machine */
save_video(); /* Video */
save_input_devices(); /* Input devices */
diff --git a/src/cpu/808x.c b/src/cpu/808x.c
index f8209def6..d20fdb87a 100644
--- a/src/cpu/808x.c
+++ b/src/cpu/808x.c
@@ -2056,7 +2056,8 @@ farret(int far)
}
wait(2, 0);
- load_cs(new_cs);
+ if (far)
+ load_cs(new_cs);
set_ip(new_ip);
}
diff --git a/src/include/86box/86box.h b/src/include/86box/86box.h
index e0ff0e1d9..a8f4ac7f2 100644
--- a/src/include/86box/86box.h
+++ b/src/include/86box/86box.h
@@ -146,6 +146,8 @@ extern int enable_discord; /* (C) enable Discord integration */
extern int fixed_size_x;
extern int fixed_size_y;
+extern int do_auto_pause; /* (C) Auto-pause the emulator on focus loss */
+extern int auto_paused;
extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
#ifdef _Atomic
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */
diff --git a/src/include/86box/video.h b/src/include/86box/video.h
index 1e3d9ea2a..a28faf335 100644
--- a/src/include/86box/video.h
+++ b/src/include/86box/video.h
@@ -42,7 +42,8 @@ enum {
FULLSCR_SCALE_FULL = 0,
FULLSCR_SCALE_43,
FULLSCR_SCALE_KEEPRATIO,
- FULLSCR_SCALE_INT
+ FULLSCR_SCALE_INT,
+ FULLSCR_SCALE_INT43
};
#ifdef __cplusplus
diff --git a/src/qt/languages/ca-ES.po b/src/qt/languages/ca-ES.po
index 1bbfc646d..371781b7a 100644
--- a/src/qt/languages/ca-ES.po
+++ b/src/qt/languages/ca-ES.po
@@ -122,7 +122,10 @@ msgid "&Square pixels (Keep ratio)"
msgstr "&Píxels quadrats (Mant. aspecte)"
msgid "&Integer scale"
-msgstr "&Escalat valor sencer"
+msgstr "&Escala de valor enter"
+
+msgid "4:&3 Integer scale"
+msgstr "Escala de valor enter 4:&3"
msgid "E&GA/(S)VGA settings"
msgstr "&Ajustaments EGA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lent"
msgid "Fast"
msgstr "Ràpid"
+msgid "&Auto-pause on focus loss"
+msgstr "&Pausa automàtica en la pèrdua del focus"
diff --git a/src/qt/languages/cs-CZ.po b/src/qt/languages/cs-CZ.po
index 00a29ecd1..d86f5b635 100644
--- a/src/qt/languages/cs-CZ.po
+++ b/src/qt/languages/cs-CZ.po
@@ -124,6 +124,9 @@ msgstr "&Zachovat poměr stran"
msgid "&Integer scale"
msgstr "&Celočíselné škálování"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Celočíselné škálování"
+
msgid "E&GA/(S)VGA settings"
msgstr "Nastavení pro E&GA a (S)VGA"
@@ -1218,3 +1221,6 @@ msgstr "Pomalý"
msgid "Fast"
msgstr "Rychlý"
+
+msgid "&Auto-pause on focus loss"
+msgstr "&Automatická pauza při ztrátě zaměření okna"
diff --git a/src/qt/languages/de-DE.po b/src/qt/languages/de-DE.po
index ad1176dd1..9c985d871 100644
--- a/src/qt/languages/de-DE.po
+++ b/src/qt/languages/de-DE.po
@@ -124,6 +124,9 @@ msgstr "&Quadratische Pixel (Seitenverhältnis beibehalten)"
msgid "&Integer scale"
msgstr "&Integer-Skalierung"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Integer-Skalierung"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA-Einstellungen"
@@ -1219,3 +1222,5 @@ msgstr "Langsam"
msgid "Fast"
msgstr "Schnell"
+msgid "&Auto-pause on focus loss"
+msgstr "&Auto-Pause bei Fokusverlust"
diff --git a/src/qt/languages/en-GB.po b/src/qt/languages/en-GB.po
index 7d7be2d2d..4a6a58db6 100644
--- a/src/qt/languages/en-GB.po
+++ b/src/qt/languages/en-GB.po
@@ -124,6 +124,9 @@ msgstr "&Square pixels (Keep ratio)"
msgid "&Integer scale"
msgstr "&Integer scale"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Integer scale"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA settings"
@@ -1219,3 +1222,5 @@ msgstr "Slow"
msgid "Fast"
msgstr "Fast"
+msgid "&Auto-pause on focus loss"
+msgstr "&Auto-pause on focus loss"
diff --git a/src/qt/languages/en-US.po b/src/qt/languages/en-US.po
index bacec4cc0..ce7ceb149 100644
--- a/src/qt/languages/en-US.po
+++ b/src/qt/languages/en-US.po
@@ -124,6 +124,9 @@ msgstr "&Square pixels (Keep ratio)"
msgid "&Integer scale"
msgstr "&Integer scale"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Integer scale"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA settings"
@@ -1219,3 +1222,5 @@ msgstr "Slow"
msgid "Fast"
msgstr "Fast"
+msgid "&Auto-pause on focus loss"
+msgstr "&Auto-pause on focus loss"
diff --git a/src/qt/languages/es-ES.po b/src/qt/languages/es-ES.po
index d1abad9fc..d8d648691 100644
--- a/src/qt/languages/es-ES.po
+++ b/src/qt/languages/es-ES.po
@@ -124,6 +124,9 @@ msgstr "&Píxeles cuadrados (Mant. aspecto)"
msgid "&Integer scale"
msgstr "&Escalado valor entero"
+msgid "4:&3 Integer scale"
+msgstr "Escalado valor entero 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "&Configuraciones EGA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lenta"
msgid "Fast"
msgstr "Rápida"
+msgid "&Auto-pause on focus loss"
+msgstr "&Pausa automática al perder el foco"
diff --git a/src/qt/languages/fi-FI.po b/src/qt/languages/fi-FI.po
index 46472e653..217827f74 100644
--- a/src/qt/languages/fi-FI.po
+++ b/src/qt/languages/fi-FI.po
@@ -124,6 +124,9 @@ msgstr "&Tasasivuiset kuvapisteet (säilytä kuvasuhde)"
msgid "&Integer scale"
msgstr "&Kokonaislukuskaalaus"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Kokonaislukuskaalaus"
+
msgid "E&GA/(S)VGA settings"
msgstr "&EGA/(S)VGA-asetukset"
@@ -1219,3 +1222,5 @@ msgstr "Hidas"
msgid "Fast"
msgstr "Nopea"
+msgid "&Auto-pause on focus loss"
+msgstr "&Automaattinen tauko tarkennuksen hävitessä"
diff --git a/src/qt/languages/fr-FR.po b/src/qt/languages/fr-FR.po
index 837617da4..be66e5924 100644
--- a/src/qt/languages/fr-FR.po
+++ b/src/qt/languages/fr-FR.po
@@ -124,6 +124,9 @@ msgstr "pixels &Carrés(Keep ratio)"
msgid "&Integer scale"
msgstr "Echelle &Entière"
+msgid "4:&3 Integer scale"
+msgstr "Echelle Entière 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Réglages E&GA/(S)VGA"
@@ -1219,3 +1222,6 @@ msgstr "Lent"
msgid "Fast"
msgstr "Rapide"
+msgid "&Auto-pause on focus loss"
+msgstr "&Pause automatique à perte de mise au point"
+
diff --git a/src/qt/languages/hr-HR.po b/src/qt/languages/hr-HR.po
index 5f83669e6..b2aa40d28 100644
--- a/src/qt/languages/hr-HR.po
+++ b/src/qt/languages/hr-HR.po
@@ -124,6 +124,9 @@ msgstr "&Kvadratni pikseli (zadrži omjer)"
msgid "&Integer scale"
msgstr "&Cijelobrojno skaliranje"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Cijelobrojno skaliranje"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA postavke"
@@ -1219,3 +1222,5 @@ msgstr "Spori"
msgid "Fast"
msgstr "Brzi"
+msgid "&Auto-pause on focus loss"
+msgstr "&Automatska pauza pri gubitku fokusa"
diff --git a/src/qt/languages/hu-HU.po b/src/qt/languages/hu-HU.po
index eaa229fb2..352a64749 100644
--- a/src/qt/languages/hu-HU.po
+++ b/src/qt/languages/hu-HU.po
@@ -124,6 +124,9 @@ msgstr "&Négyzetes képpontok (aránytartás)"
msgid "&Integer scale"
msgstr "&Egész tényezős nagyítás"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Egész tényezős nagyítás"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA beállítások"
@@ -1219,3 +1222,5 @@ msgstr "Lassú"
msgid "Fast"
msgstr "Gyors"
+msgid "&Auto-pause on focus loss"
+msgstr "&Automatikus szünet fókuszvesztéskor"
diff --git a/src/qt/languages/it-IT.po b/src/qt/languages/it-IT.po
index 4c9ce36e2..df71d148b 100644
--- a/src/qt/languages/it-IT.po
+++ b/src/qt/languages/it-IT.po
@@ -124,6 +124,9 @@ msgstr "&Pixel quadrati (mantiene l'aspetto)"
msgid "&Integer scale"
msgstr "&Scala intera"
+msgid "4:&3 Integer scale"
+msgstr "Scala intera 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Impostazioni E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lenta"
msgid "Fast"
msgstr "Veloce"
+msgid "&Auto-pause on focus loss"
+msgstr "&Pausa automatica alla perdita della messa a fuoco"
diff --git a/src/qt/languages/ja-JP.po b/src/qt/languages/ja-JP.po
index c6518f841..613496fd9 100644
--- a/src/qt/languages/ja-JP.po
+++ b/src/qt/languages/ja-JP.po
@@ -124,6 +124,9 @@ msgstr "正方形ピクセル(アスペクト比を維持)(&S)"
msgid "&Integer scale"
msgstr "整数倍(&I)"
+msgid "4:&3 Integer scale"
+msgstr "4:3 整数倍(&3)"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGAの設定"
@@ -1219,3 +1222,5 @@ msgstr "遅い"
msgid "Fast"
msgstr "速い"
+msgid "&Auto-pause on focus loss"
+msgstr "フォーカスが外れると自動ポーズ(&A)"
diff --git a/src/qt/languages/ko-KR.po b/src/qt/languages/ko-KR.po
index e5f55c276..ac4476ca8 100644
--- a/src/qt/languages/ko-KR.po
+++ b/src/qt/languages/ko-KR.po
@@ -124,6 +124,9 @@ msgstr "정사각형 픽셀 (비율 유지)(&S)"
msgid "&Integer scale"
msgstr "정수배 확대(&I)"
+msgid "4:&3 Integer scale"
+msgstr "4:3 정수배 확대(&3)"
+
msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA 설정"
@@ -1219,3 +1222,5 @@ msgstr "느린"
msgid "Fast"
msgstr "빠른"
+msgid "&Auto-pause on focus loss"
+msgstr "집중력 저하 시 자동 일시 중지(&A)"
diff --git a/src/qt/languages/pl-PL.po b/src/qt/languages/pl-PL.po
index 37945a0f3..b24e338f4 100644
--- a/src/qt/languages/pl-PL.po
+++ b/src/qt/languages/pl-PL.po
@@ -124,6 +124,9 @@ msgstr "&Kwadratowe piksele (Zachowaj proporcje)"
msgid "&Integer scale"
msgstr "&Skalowanie całkowite"
+msgid "4:&3 Integer scale"
+msgstr "Skalowanie całkowite 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Ustawienia E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Powolny"
msgid "Fast"
msgstr "Szybki"
+msgid "&Auto-pause on focus loss"
+msgstr "&Automatyczna pauza po utracie fokusu"
diff --git a/src/qt/languages/pt-BR.po b/src/qt/languages/pt-BR.po
index a78655a74..0db661b4f 100644
--- a/src/qt/languages/pt-BR.po
+++ b/src/qt/languages/pt-BR.po
@@ -124,6 +124,9 @@ msgstr "Pixel&s quadrados (manter proporção)"
msgid "&Integer scale"
msgstr "&Redimensionamento com valores inteiros"
+msgid "4:&3 Integer scale"
+msgstr "Redimensionamento com valores inteiros 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Configurações E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lento"
msgid "Fast"
msgstr "Rápido"
+msgid "&Auto-pause on focus loss"
+msgstr "Pausa &automática ao perder o foco"
diff --git a/src/qt/languages/pt-PT.po b/src/qt/languages/pt-PT.po
index 99f59e8b3..8f080e423 100644
--- a/src/qt/languages/pt-PT.po
+++ b/src/qt/languages/pt-PT.po
@@ -124,6 +124,9 @@ msgstr "Pixels &quadrados (Manter rácio)"
msgid "&Integer scale"
msgstr "Escala &inteira"
+msgid "4:&3 Integer scale"
+msgstr "Escala inteira 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Definições E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lento"
msgid "Fast"
msgstr "Rápido"
+msgid "&Auto-pause on focus loss"
+msgstr "Pausa &automática na perda de focagem"
diff --git a/src/qt/languages/ru-RU.po b/src/qt/languages/ru-RU.po
index d4b5126fa..b0bcc0e1e 100644
--- a/src/qt/languages/ru-RU.po
+++ b/src/qt/languages/ru-RU.po
@@ -124,6 +124,9 @@ msgstr "&Квадратные пиксели (сохранить соотнош
msgid "&Integer scale"
msgstr "&Целочисленное масштабирование"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Целочисленное масштабирование"
+
msgid "E&GA/(S)VGA settings"
msgstr "Настройки E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Медленный"
msgid "Fast"
msgstr "Быстрый"
+msgid "&Auto-pause on focus loss"
+msgstr "&Автопауза при потере фокуса"
diff --git a/src/qt/languages/sk-SK.po b/src/qt/languages/sk-SK.po
index c2821aade..a8f60b861 100644
--- a/src/qt/languages/sk-SK.po
+++ b/src/qt/languages/sk-SK.po
@@ -124,6 +124,9 @@ msgstr "&Zachovať pomer strán"
msgid "&Integer scale"
msgstr "&Celočíselné škálovanie"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Celočíselné škálovanie"
+
msgid "E&GA/(S)VGA settings"
msgstr "Nastavenia pre E&GA a (S)VGA"
@@ -1218,3 +1221,6 @@ msgstr "Pomalý"
msgid "Fast"
msgstr "Rýchly"
+
+msgid "&Auto-pause on focus loss"
+msgstr "&Automatická pauza pri strate fokusu okna"
diff --git a/src/qt/languages/sl-SI.po b/src/qt/languages/sl-SI.po
index 5e468c8e1..98a51d863 100644
--- a/src/qt/languages/sl-SI.po
+++ b/src/qt/languages/sl-SI.po
@@ -124,6 +124,9 @@ msgstr "&Kvadratni piksli (ohrani razmerje)"
msgid "&Integer scale"
msgstr "&Celoštevilsko raztezanje"
+msgid "4:&3 Integer scale"
+msgstr "Celoštevilsko raztezanje 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Nastavitve E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Počasni"
msgid "Fast"
msgstr "Hitri"
+msgid "&Auto-pause on focus loss"
+msgstr "&Samodejni premor ob izgubi fokusa"
diff --git a/src/qt/languages/tr-TR.po b/src/qt/languages/tr-TR.po
index 8263f3c2d..0d6875eb8 100644
--- a/src/qt/languages/tr-TR.po
+++ b/src/qt/languages/tr-TR.po
@@ -124,6 +124,9 @@ msgstr "&Kare piksel (ölçeği koru)"
msgid "&Integer scale"
msgstr "Tam &sayı ölçeklemesi"
+msgid "4:&3 Integer scale"
+msgstr "4:&3 Tam sayı ölçeklemesi"
+
msgid "E&GA/(S)VGA settings"
msgstr "EGA/&(S)VGA ayarları"
@@ -1219,3 +1222,5 @@ msgstr "Yavaş"
msgid "Fast"
msgstr "Hızlı"
+msgid "&Auto-pause on focus loss"
+msgstr "&Odak kaybında otomatik duraklatma"
diff --git a/src/qt/languages/uk-UA.po b/src/qt/languages/uk-UA.po
index 254e0c284..6f8ecac52 100644
--- a/src/qt/languages/uk-UA.po
+++ b/src/qt/languages/uk-UA.po
@@ -124,6 +124,9 @@ msgstr "&Квадратні пікселі (зберегти відношенн
msgid "&Integer scale"
msgstr "&Цілісночисленне масштабування"
+msgid "4:&3 Integer scale"
+msgstr "Цілісночисленне масштабування 4:&3"
+
msgid "E&GA/(S)VGA settings"
msgstr "Налаштування E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Повільний"
msgid "Fast"
msgstr "Швидкий"
+msgid "&Auto-pause on focus loss"
+msgstr "&Автопауза при втраті фокусу"
diff --git a/src/qt/languages/zh-CN.po b/src/qt/languages/zh-CN.po
index b6d9e5c97..0c12fa76a 100644
--- a/src/qt/languages/zh-CN.po
+++ b/src/qt/languages/zh-CN.po
@@ -124,6 +124,9 @@ msgstr "保持比例(&S)"
msgid "&Integer scale"
msgstr "整数比例(&I)"
+msgid "4:&3 Integer scale"
+msgstr "4:3 整数比例(&3)"
+
msgid "E&GA/(S)VGA settings"
msgstr "EGA/(S)VGA 设置(&G)"
@@ -1219,3 +1222,6 @@ msgstr "慢"
msgid "Fast"
msgstr "快"
+msgid "&Auto-pause on focus loss"
+msgstr "&失焦自动暂停"
+
diff --git a/src/qt/languages/zh-TW.po b/src/qt/languages/zh-TW.po
index d10b45628..c840230bd 100644
--- a/src/qt/languages/zh-TW.po
+++ b/src/qt/languages/zh-TW.po
@@ -124,6 +124,9 @@ msgstr "保持比例(&S)"
msgid "&Integer scale"
msgstr "整數比例(&I)"
+msgid "4:&3 Integer scale"
+msgstr "4:3 整數比例(&3)"
+
msgid "E&GA/(S)VGA settings"
msgstr "EGA/(S)VGA 設定(&G)"
@@ -1219,3 +1222,5 @@ msgstr "慢"
msgid "Fast"
msgstr "快"
+msgid "&Auto-pause on focus loss"
+msgstr "&失去焦點時自動暫停"
diff --git a/src/qt/qt_mainwindow.cpp b/src/qt/qt_mainwindow.cpp
index 62a79c30d..427b47598 100644
--- a/src/qt/qt_mainwindow.cpp
+++ b/src/qt/qt_mainwindow.cpp
@@ -211,7 +211,11 @@ MainWindow::MainWindow(QWidget *parent)
connect(this, &MainWindow::hardResetCompleted, this, [this]() {
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
QApplication::setOverrideCursor(Qt::ArrowCursor);
+#ifdef USE_WACOM
ui->menuTablet_tool->menuAction()->setVisible(mouse_mode >= 1);
+#else
+ ui->menuTablet_tool->menuAction()->setVisible(false);
+#endif
});
connect(this, &MainWindow::showMessageForNonQtThread, this, &MainWindow::showMessage_, Qt::BlockingQueuedConnection);
@@ -268,8 +272,20 @@ MainWindow::MainWindow(QWidget *parent)
});
connect(qApp, &QGuiApplication::applicationStateChanged, [this](Qt::ApplicationState state) {
- if (mouse_capture && state != Qt::ApplicationState::ApplicationActive)
- emit setMouseCapture(false);
+ if (state == Qt::ApplicationState::ApplicationActive) {
+ if (auto_paused) {
+ plat_pause(0);
+ auto_paused = 0;
+ }
+ } else {
+ if (mouse_capture)
+ emit setMouseCapture(false);
+
+ if (do_auto_pause && !dopause) {
+ auto_paused = 1;
+ plat_pause(1);
+ }
+ }
});
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
@@ -530,6 +546,9 @@ MainWindow::MainWindow(QWidget *parent)
case FULLSCR_SCALE_INT:
ui->actionFullScreen_int->setChecked(true);
break;
+ case FULLSCR_SCALE_INT43:
+ ui->actionFullScreen_int43->setChecked(true);
+ break;
}
actGroup = new QActionGroup(this);
actGroup->addAction(ui->actionFullScreen_stretch);
@@ -583,6 +602,9 @@ MainWindow::MainWindow(QWidget *parent)
if (vid_cga_contrast > 0) {
ui->actionChange_contrast_for_monochrome_display->setChecked(true);
}
+ if (do_auto_pause > 0) {
+ ui->actionAuto_pause->setChecked(true);
+ }
#ifdef Q_OS_MACOS
ui->actionCtrl_Alt_Del->setShortcutVisibleInContextMenu(true);
@@ -1559,6 +1581,13 @@ MainWindow::on_actionFullScreen_int_triggered()
update_fullscreen_scale_checkboxes(ui, ui->actionFullScreen_int);
}
+void
+MainWindow::on_actionFullScreen_int43_triggered()
+{
+ video_fullscreen_scale = FULLSCR_SCALE_INT43;
+ update_fullscreen_scale_checkboxes(ui, ui->actionFullScreen_int43);
+}
+
static void
update_greyscale_checkboxes(Ui::MainWindow *ui, QAction *selected, int value)
{
@@ -1709,6 +1738,13 @@ MainWindow::on_actionForce_4_3_display_ratio_triggered()
video_toggle_option(ui->actionForce_4_3_display_ratio, &force_43);
}
+void
+MainWindow::on_actionAuto_pause_triggered()
+{
+ do_auto_pause ^= 1;
+ ui->actionAuto_pause->setChecked(do_auto_pause > 0 ? true : false);
+}
+
void
MainWindow::on_actionRemember_size_and_position_triggered()
{
diff --git a/src/qt/qt_mainwindow.hpp b/src/qt/qt_mainwindow.hpp
index 7e4032a31..0de3f8656 100644
--- a/src/qt/qt_mainwindow.hpp
+++ b/src/qt/qt_mainwindow.hpp
@@ -69,6 +69,7 @@ private slots:
void on_actionFullscreen_triggered();
void on_actionSettings_triggered();
void on_actionExit_triggered();
+ void on_actionAuto_pause_triggered();
void on_actionPause_triggered();
void on_actionCtrl_Alt_Del_triggered();
void on_actionCtrl_Alt_Esc_triggered();
@@ -90,6 +91,7 @@ private slots:
void on_actionLinear_triggered();
void on_actionNearest_triggered();
void on_actionFullScreen_int_triggered();
+ void on_actionFullScreen_int43_triggered();
void on_actionFullScreen_keepRatio_triggered();
void on_actionFullScreen_43_triggered();
void on_actionFullScreen_stretch_triggered();
diff --git a/src/qt/qt_mainwindow.ui b/src/qt/qt_mainwindow.ui
index 882122cac..0580b18e1 100644
--- a/src/qt/qt_mainwindow.ui
+++ b/src/qt/qt_mainwindow.ui
@@ -68,17 +68,19 @@
+
+
+
+
-
-
+
+
+ true
+
+
+ &Auto-pause on focus loss
+
+
true
@@ -586,6 +597,14 @@
&Integer scale
+
+
+ true
+
+
+ 4:&3 Integer scale
+
+
true
diff --git a/src/qt/qt_renderercommon.cpp b/src/qt/qt_renderercommon.cpp
index 6685eede5..723211266 100644
--- a/src/qt/qt_renderercommon.cpp
+++ b/src/qt/qt_renderercommon.cpp
@@ -76,7 +76,12 @@ RendererCommon::onResize(int width, int height)
switch (video_fullscreen_scale) {
case FULLSCR_SCALE_INT:
- gsr = gw / gh;
+ case FULLSCR_SCALE_INT43:
+ if (video_fullscreen_scale == FULLSCR_SCALE_INT43)
+ gsr = 4.0 / 3.0;
+ else
+ gsr = gw / gh;
+
if (gsr <= hsr) {
dw = hh * gsr;
dh = hh;