Config clean-ups, auto-pause, 4:3 integer scale, and more parameters.

This commit is contained in:
OBattler
2023-10-13 23:30:31 +02:00
parent 903b91af86
commit 7ec58da46f
31 changed files with 340 additions and 368 deletions

View File

@@ -84,11 +84,6 @@ static int cw;
static int ch; static int ch;
static ini_t config; 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 #ifdef ENABLE_CONFIG_LOG
int config_do_log = 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); update_icons = ini_section_get_int(cat, "update_icons", 1);
window_remember = ini_section_get_int(cat, "window_remember", 0); 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; window_w = window_h = window_x = window_y = 0;
}
if (vid_resize & 2) { if (vid_resize & 2) {
p = ini_section_get_string(cat, "window_fixed_res", NULL); p = ini_section_get_string(cat, "window_fixed_res", NULL);
@@ -213,12 +203,12 @@ load_general(void)
if (p == NULL) if (p == NULL)
p = "0, 0, 0, 0"; p = "0, 0, 0, 0";
sscanf(p, "%i, %i, %i, %i", &cw, &ch, &cx, &cy); sscanf(p, "%i, %i, %i, %i", &cw, &ch, &cx, &cy);
} else { } else
cw = ch = cx = cy = 0; cw = ch = cx = cy = 0;
ini_section_delete_var(cat, "window_remember");
}
ini_section_delete_var(cat, "window_coordinates"); ini_section_delete_var(cat, "window_coordinates");
do_auto_pause = ini_section_get_int(cat, "do_auto_pause", 0);
} }
/* Load monitor section. */ /* Load monitor section. */
@@ -229,25 +219,21 @@ load_monitor(int monitor_index)
char name[512]; char name[512];
char temp[512]; char temp[512];
const char * p = NULL; const char * p = NULL;
monitor_settings_t *ms = &monitor_settings[monitor_index];
sprintf(name, "Monitor #%i", monitor_index + 1); sprintf(name, "Monitor #%i", monitor_index + 1);
sprintf(temp, "%i, %i, %i, %i", cx, cy, cw, ch); sprintf(temp, "%i, %i, %i, %i", cx, cy, cw, ch);
cat = ini_find_section(config, name); cat = ini_find_section(config, name);
p = ini_section_get_string(cat, "window_coordinates", NULL); p = ini_section_get_string(cat, "window_coordinates", temp);
if (p == NULL)
p = temp;
if (window_remember) { if (window_remember) {
sscanf(p, "%i, %i, %i, %i", sscanf(p, "%i, %i, %i, %i", &ms->mon_window_x, &ms->mon_window_y,
&monitor_settings[monitor_index].mon_window_x, &monitor_settings[monitor_index].mon_window_y, &ms->mon_window_w, &ms->mon_window_h);
&monitor_settings[monitor_index].mon_window_w, &monitor_settings[monitor_index].mon_window_h); ms->mon_window_maximized = !!ini_section_get_int(cat, "window_maximized", 0);
monitor_settings[monitor_index].mon_window_maximized = !!ini_section_get_int(cat, "window_maximized", 0); } else
} else { ms->mon_window_maximized = 0;
monitor_settings[monitor_index].mon_window_maximized = 0;
}
} }
/* Load "Machine" section. */ /* Load "Machine" section. */
@@ -465,22 +451,27 @@ load_machine(void)
c = 0; c = 0;
i = 256; i = 256;
while (cpu_f->cpus[cpu].cpu_type) { while (cpu_f->cpus[cpu].cpu_type) {
if (cpu_is_eligible(cpu_f, cpu, machine)) { /* skip ineligible CPUs */ if (cpu_is_eligible(cpu_f, cpu, machine)) {
if ((cpu_f->cpus[cpu].rspeed == speed) && (cpu_f->cpus[cpu].multi == multi)) /* exact speed/multiplier match */ /* Skip ineligible CPUs. */
if ((cpu_f->cpus[cpu].rspeed == speed) && (cpu_f->cpus[cpu].multi == multi))
/* Exact speed/multiplier match. */
break; 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; i = cpu;
c = cpu; /* store fastest eligible CPU */ c = cpu; /* store fastest eligible CPU */
} }
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); cpu = MIN(i, c);
} else { /* default */ } else {
/* Find first eligible family. */ /* Default, find first eligible family. */
c = 0; c = 0;
while (!cpu_family_is_eligible(&cpu_families[c], machine)) { 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"); fatal("No eligible CPU families for the selected machine\n");
return; return;
} }
@@ -490,7 +481,8 @@ load_machine(void)
/* Find first eligible CPU in that family. */ /* Find first eligible CPU in that family. */
cpu = 0; cpu = 0;
while (!cpu_is_eligible(cpu_f, cpu, machine)) { 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; cpu = 0;
break; break;
} }
@@ -527,10 +519,6 @@ load_machine(void)
time_sync = !!ini_section_get_int(cat, "enable_sync", 1); time_sync = !!ini_section_get_int(cat, "enable_sync", 1);
pit_mode = ini_section_get_int(cat, "pit_mode", -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. */ /* Load "Video" section. */
@@ -556,7 +544,8 @@ load_video(void)
} }
free_p = 1; 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"); gfxcard[0] = video_get_video_from_internal_name("virge385_pci");
else else
gfxcard[0] = video_get_video_from_internal_name(p); gfxcard[0] = video_get_video_from_internal_name(p);
@@ -564,9 +553,11 @@ load_video(void)
free(p); 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"); 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"); ini_section_delete_var(cat, "xga");
voodoo_enabled = !!ini_section_get_int(cat, "voodoo", 0); 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); p = ini_section_get_string(cat, "joystick_type", NULL);
if (p != 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"); joystick_type = joystick_get_from_internal_name("2axis_2button");
else if (!strcmp(p, "standard_4button")) else if (!strcmp(p, "standard_4button"))
joystick_type = joystick_get_from_internal_name("2axis_4button"); joystick_type = joystick_get_from_internal_name("2axis_4button");
@@ -616,7 +608,8 @@ load_input_devices(void)
if (!joystick_type) { if (!joystick_type) {
/* Try to read an integer for backwards compatibility with old configs */ /* 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"); joystick_type = joystick_get_from_internal_name("2axis_2button");
else { else {
c = ini_section_get_int(cat, "joystick_type", 8); 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); sprintf(temp, "joystick_%i_pov_%i", c, d);
p = ini_section_get_string(cat, temp, "0, 0"); p = ini_section_get_string(cat, temp, "0, 0");
joystick_state[c].pov_mapping[d][0] = joystick_state[c].pov_mapping[d][1] = 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]);
} }
} }
} }
@@ -780,45 +774,41 @@ load_network(void)
char temp[512]; char temp[512];
uint16_t c = 0; uint16_t c = 0;
uint16_t min = 0; uint16_t min = 0;
netcard_conf_t *nc = &net_cards_conf[c];
/* Handle legacy configuration which supported only one NIC */ /* Handle legacy configuration which supported only one NIC */
p = ini_section_get_string(cat, "net_card", NULL); p = ini_section_get_string(cat, "net_card", NULL);
if (p != 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); p = ini_section_get_string(cat, "net_type", NULL);
if (p != NULL) { if (p != NULL) {
if (!strcmp(p, "pcap") || !strcmp(p, "1")) 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")) 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")) else if (!strcmp(p, "vde") || !strcmp(p, "2"))
net_cards_conf[c].net_type = NET_TYPE_VDE; nc->net_type = NET_TYPE_VDE;
else else
net_cards_conf[c].net_type = NET_TYPE_NONE; nc->net_type = NET_TYPE_NONE;
} else { } else
net_cards_conf[c].net_type = NET_TYPE_NONE; nc->net_type = NET_TYPE_NONE;
}
p = ini_section_get_string(cat, "net_host_device", NULL); p = ini_section_get_string(cat, "net_host_device", NULL);
if (p != 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_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); 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); ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2096, (wchar_t *) IDS_2130);
} strcpy(nc->host_dev_name, "none");
strcpy(net_cards_conf[c].host_dev_name, "none"); } else
} else { strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); } else
} strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
} else { } else
strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); strcpy(nc->host_dev_name, "none");
}
} else {
strcpy(net_cards_conf[c].host_dev_name, "none");
}
min++; min++;
} }
@@ -828,54 +818,50 @@ load_network(void)
ini_section_delete_var(cat, "net_host_device"); ini_section_delete_var(cat, "net_host_device");
for (c = min; c < NET_CARD_MAX; c++) { for (c = min; c < NET_CARD_MAX; c++) {
nc = &net_cards_conf[c];
sprintf(temp, "net_%02i_card", c + 1); sprintf(temp, "net_%02i_card", c + 1);
p = ini_section_get_string(cat, temp, NULL); p = ini_section_get_string(cat, temp, NULL);
if (p != 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);
} else { else
net_cards_conf[c].device_num = 0; nc->device_num = 0;
}
sprintf(temp, "net_%02i_net_type", c + 1); sprintf(temp, "net_%02i_net_type", c + 1);
p = ini_section_get_string(cat, temp, NULL); p = ini_section_get_string(cat, temp, NULL);
if (p != NULL) { if (p != NULL) {
if (!strcmp(p, "pcap") || !strcmp(p, "1")) { 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")) { 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")) { else if (!strcmp(p, "vde") || !strcmp(p, "2"))
net_cards_conf[c].net_type = NET_TYPE_VDE; nc->net_type = NET_TYPE_VDE;
} else { else
net_cards_conf[c].net_type = NET_TYPE_NONE; nc->net_type = NET_TYPE_NONE;
} } else
} else { nc->net_type = NET_TYPE_NONE;
net_cards_conf[c].net_type = NET_TYPE_NONE;
}
sprintf(temp, "net_%02i_host_device", c + 1); sprintf(temp, "net_%02i_host_device", c + 1);
p = ini_section_get_string(cat, temp, NULL); p = ini_section_get_string(cat, temp, NULL);
if (p != 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_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); 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); ui_msgbox_header(MBX_ERROR, (wchar_t *) IDS_2096, (wchar_t *) IDS_2130);
} strcpy(nc->host_dev_name, "none");
strcpy(net_cards_conf[c].host_dev_name, "none"); } else
} else { strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); } else
} strncpy(nc->host_dev_name, p, sizeof(nc->host_dev_name) - 1);
} else { } else
strncpy(net_cards_conf[c].host_dev_name, p, sizeof(net_cards_conf[c].host_dev_name) - 1); strcpy(nc->host_dev_name, "none");
}
} else {
strcpy(net_cards_conf[c].host_dev_name, "none");
}
sprintf(temp, "net_%02i_link", c + 1); sprintf(temp, "net_%02i_link", c + 1);
net_cards_conf[c].link_state = ini_section_get_int(cat, temp, 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)); (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 min = 0;
int free_p = 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++) { for (c = min; c < SCSI_BUS_MAX; c++) {
sprintf(temp, "scsicard_%d", c + 1); 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. */ /* Load "Floppy and CD-ROM Drives" section. */
static void static void
load_floppy_and_cdrom_drives(void) load_floppy_and_cdrom_drives(void)
@@ -1308,9 +1227,6 @@ load_floppy_and_cdrom_drives(void)
int c; int c;
int d = 0; int d = 0;
/* TODO: Backwards compatibility, get rid of this when enough time has passed. */
backwards_compat = (cat == NULL);
memset(temp, 0x00, sizeof(temp)); memset(temp, 0x00, sizeof(temp));
for (c = 0; c < FDD_NUM; c++) { for (c = 0; c < FDD_NUM; c++) {
sprintf(temp, "fdd_%02i_type", c + 1); sprintf(temp, "fdd_%02i_type", c + 1);
@@ -1543,85 +1459,6 @@ load_other_removable_devices(void)
unsigned int board = 0; unsigned int board = 0;
unsigned int dev = 0; unsigned int dev = 0;
int c; 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)); memset(temp, 0x00, sizeof(temp));
for (c = 0; c < ZIP_NUM; c++) { 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"); ini_section_t cat = ini_find_section(config, "Other peripherals");
char *p; char *p;
char temp[512]; 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); bugger_enabled = !!ini_section_get_int(cat, "bugger_enabled", 0);
postcard_enabled = !!ini_section_get_int(cat, "postcard_enabled", 0); postcard_enabled = !!ini_section_get_int(cat, "postcard_enabled", 0);
@@ -1961,6 +1745,7 @@ config_load(void)
scale = 1; scale = 1;
machine = machine_get_machine_from_internal_name("ibmpc"); machine = machine_get_machine_from_internal_name("ibmpc");
dpi_scale = 1; dpi_scale = 1;
do_auto_pause = 0;
fpu_type = fpu_get_type(cpu_f, cpu, "none"); fpu_type = fpu_get_type(cpu_f, cpu, "none");
gfxcard[0] = video_get_video_from_internal_name("cga"); gfxcard[0] = video_get_video_from_internal_name("cga");
@@ -2011,7 +1796,7 @@ config_load(void)
} else { } else {
load_general(); /* General */ load_general(); /* General */
for (i = 0; i < MONITORS_NUM; i++) for (i = 0; i < MONITORS_NUM; i++)
load_monitor(i); load_monitor(i); /* Monitors */
load_machine(); /* Machine */ load_machine(); /* Machine */
load_video(); /* Video */ load_video(); /* Video */
load_input_devices(); /* Input devices */ load_input_devices(); /* Input devices */
@@ -2021,8 +1806,6 @@ config_load(void)
load_storage_controllers(); /* Storage controllers */ load_storage_controllers(); /* Storage controllers */
load_hard_disks(); /* Hard disks */ load_hard_disks(); /* Hard disks */
load_floppy_and_cdrom_drives(); /* Floppy and CD-ROM drives */ 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_removable_devices(); /* Other removable devices */
load_other_peripherals(); /* Other peripherals */ load_other_peripherals(); /* Other peripherals */
@@ -2115,13 +1898,10 @@ save_general(void)
else else
ini_section_set_int(cat, "update_icons", update_icons); ini_section_set_int(cat, "update_icons", update_icons);
if (window_remember || (vid_resize & 2)) {
if (window_remember) if (window_remember)
ini_section_set_int(cat, "window_remember", window_remember); ini_section_set_int(cat, "window_remember", window_remember);
else else
ini_section_delete_var(cat, "window_remember"); ini_section_delete_var(cat, "window_remember");
} else
ini_section_delete_var(cat, "window_remember");
if (vid_resize & 2) { if (vid_resize & 2) {
sprintf(temp, "%ix%i", fixed_size_x, fixed_size_y); sprintf(temp, "%ix%i", fixed_size_x, fixed_size_y);
@@ -2204,6 +1984,11 @@ save_general(void)
else else
ini_section_delete_var(cat, "video_gl_shader"); 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); ini_delete_section_if_empty(config, cat);
} }
@@ -2214,21 +1999,20 @@ save_monitor(int monitor_index)
ini_section_t cat; ini_section_t cat;
char name[sizeof("Monitor #") + 12] = { [0] = 0 }; char name[sizeof("Monitor #") + 12] = { [0] = 0 };
char temp[512]; char temp[512];
monitor_settings_t *ms = &monitor_settings[monitor_index];
snprintf(name, sizeof(name), "Monitor #%i", monitor_index + 1); snprintf(name, sizeof(name), "Monitor #%i", monitor_index + 1);
cat = ini_find_or_create_section(config, name); cat = ini_find_or_create_section(config, name);
if (window_remember) { if (window_remember) {
sprintf(temp, "%i, %i, %i, %i", sprintf(temp, "%i, %i, %i, %i", ms->mon_window_x, ms->mon_window_y,
monitor_settings[monitor_index].mon_window_x, monitor_settings[monitor_index].mon_window_y, ms->mon_window_w, ms->mon_window_h);
monitor_settings[monitor_index].mon_window_w, monitor_settings[monitor_index].mon_window_h);
ini_section_set_string(cat, "window_coordinates", temp); ini_section_set_string(cat, "window_coordinates", temp);
if (monitor_settings[monitor_index].mon_window_maximized != 0) { if (ms->mon_window_maximized != 0)
ini_section_set_int(cat, "window_maximized", monitor_settings[monitor_index].mon_window_maximized); ini_section_set_int(cat, "window_maximized", ms->mon_window_maximized);
} else { else
ini_section_delete_var(cat, "window_maximized"); ini_section_delete_var(cat, "window_maximized");
}
} else { } else {
ini_section_delete_var(cat, "window_coordinates"); ini_section_delete_var(cat, "window_coordinates");
ini_section_delete_var(cat, "window_maximized"); ini_section_delete_var(cat, "window_maximized");
@@ -2284,13 +2068,16 @@ save_machine(void)
/* Match the family name, speed and multiplier. */ /* Match the family name, speed and multiplier. */
if (!strcmp(cpu_f->internal_name, legacy_table_entry->family)) { 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; legacy_cpu = i;
break; 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; closest_legacy_cpu = i;
} }
}
i++; i++;
} }
@@ -2322,7 +2109,8 @@ save_machine(void)
else else
ini_section_set_string(cat, "fpu_type", fpu_get_internal_name(cpu_f, cpu, fpu_type)); 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_delete_var(cat, "mem_size");
ini_section_set_int(cat, "mem_size", mem_size); ini_section_set_int(cat, "mem_size", mem_size);
@@ -2531,21 +2319,23 @@ save_network(void)
{ {
char temp[512]; char temp[512];
ini_section_t cat = ini_find_or_create_section(config, "Network"); 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_type");
ini_section_delete_var(cat, "net_host_device"); ini_section_delete_var(cat, "net_host_device");
ini_section_delete_var(cat, "net_card"); ini_section_delete_var(cat, "net_card");
for (uint8_t c = 0; c < NET_CARD_MAX; c++) { for (uint8_t c = 0; c < NET_CARD_MAX; c++) {
nc = &net_cards_conf[c];
sprintf(temp, "net_%02i_card", c + 1); 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); ini_section_delete_var(cat, temp);
} else { else
ini_section_set_string(cat, temp, network_card_get_internal_name(net_cards_conf[c].device_num)); ini_section_set_string(cat, temp, network_card_get_internal_name(nc->device_num));
}
sprintf(temp, "net_%02i_net_type", c + 1); sprintf(temp, "net_%02i_net_type", c + 1);
switch(net_cards_conf[c].net_type) { switch(nc->net_type) {
case NET_TYPE_NONE: case NET_TYPE_NONE:
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
break; break;
@@ -2564,21 +2354,21 @@ save_network(void)
} }
sprintf(temp, "net_%02i_host_device", c + 1); sprintf(temp, "net_%02i_host_device", c + 1);
if (net_cards_conf[c].host_dev_name[0] != '\0') { if (nc->host_dev_name[0] != '\0') {
if (!strcmp(net_cards_conf[c].host_dev_name, "none")) if (!strcmp(nc->host_dev_name, "none"))
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
else 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 } else
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
sprintf(temp, "net_%02i_link", c + 1); sprintf(temp, "net_%02i_link", c + 1);
if (net_cards_conf[c].link_state == (NET_LINK_10_HD | NET_LINK_10_FD | if (nc->link_state == (NET_LINK_10_HD | NET_LINK_10_FD |
NET_LINK_100_HD | NET_LINK_100_FD | NET_LINK_100_HD | NET_LINK_100_FD |
NET_LINK_1000_HD | NET_LINK_1000_FD)) NET_LINK_1000_HD | NET_LINK_1000_FD))
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
else 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); ini_delete_section_if_empty(config, cat);
@@ -2798,9 +2588,9 @@ save_hard_disks(void)
ini_section_delete_var(cat, temp); ini_section_delete_var(cat, temp);
sprintf(temp, "hdd_%02i_ide_channel", c + 1); 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); ini_section_delete_var(cat, temp);
} else { else {
sprintf(tmp2, "%01u:%01u", hdd[c].ide_channel >> 1, hdd[c].ide_channel & 1); sprintf(tmp2, "%01u:%01u", hdd[c].ide_channel >> 1, hdd[c].ide_channel & 1);
ini_section_set_string(cat, temp, tmp2); ini_section_set_string(cat, temp, tmp2);
} }
@@ -2917,26 +2707,23 @@ save_floppy_and_cdrom_drives(void)
for (c = 0; c < CDROM_NUM; c++) { for (c = 0; c < CDROM_NUM; c++) {
sprintf(temp, "cdrom_%02i_host_drive", c + 1); 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); ini_section_delete_var(cat, temp);
} else { else
ini_section_set_int(cat, temp, cdrom[c].host_drive); ini_section_set_int(cat, temp, cdrom[c].host_drive);
}
sprintf(temp, "cdrom_%02i_speed", c + 1); 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); ini_section_delete_var(cat, temp);
} else { else
ini_section_set_int(cat, temp, cdrom[c].speed); ini_section_set_int(cat, temp, cdrom[c].speed);
}
sprintf(temp, "cdrom_%02i_type", c + 1); 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); ini_section_delete_var(cat, temp);
} else { else
ini_section_set_string(cat, temp, ini_section_set_string(cat, temp,
cdrom_get_internal_name(cdrom_get_type(c))); cdrom_get_internal_name(cdrom_get_type(c)));
}
sprintf(temp, "cdrom_%02i_parameters", c + 1); sprintf(temp, "cdrom_%02i_parameters", c + 1);
if (cdrom[c].bus_type == 0) if (cdrom[c].bus_type == 0)
@@ -3104,7 +2891,7 @@ config_save(void)
{ {
save_general(); /* General */ save_general(); /* General */
for (uint8_t i = 0; i < MONITORS_NUM; i++) for (uint8_t i = 0; i < MONITORS_NUM; i++)
save_monitor(i); save_monitor(i); /* Monitors */
save_machine(); /* Machine */ save_machine(); /* Machine */
save_video(); /* Video */ save_video(); /* Video */
save_input_devices(); /* Input devices */ save_input_devices(); /* Input devices */

View File

@@ -2056,6 +2056,7 @@ farret(int far)
} }
wait(2, 0); wait(2, 0);
if (far)
load_cs(new_cs); load_cs(new_cs);
set_ip(new_ip); set_ip(new_ip);
} }

View File

@@ -146,6 +146,8 @@ extern int enable_discord; /* (C) enable Discord integration */
extern int fixed_size_x; extern int fixed_size_x;
extern int fixed_size_y; 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 */ extern double mouse_sensitivity; /* (C) Mouse sensitivity scale */
#ifdef _Atomic #ifdef _Atomic
extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */ extern _Atomic double mouse_x_error; /* Mouse error accumulator - Y */

View File

@@ -42,7 +42,8 @@ enum {
FULLSCR_SCALE_FULL = 0, FULLSCR_SCALE_FULL = 0,
FULLSCR_SCALE_43, FULLSCR_SCALE_43,
FULLSCR_SCALE_KEEPRATIO, FULLSCR_SCALE_KEEPRATIO,
FULLSCR_SCALE_INT FULLSCR_SCALE_INT,
FULLSCR_SCALE_INT43
}; };
#ifdef __cplusplus #ifdef __cplusplus

View File

@@ -122,7 +122,10 @@ msgid "&Square pixels (Keep ratio)"
msgstr "&Píxels quadrats (Mant. aspecte)" msgstr "&Píxels quadrats (Mant. aspecte)"
msgid "&Integer scale" 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" msgid "E&GA/(S)VGA settings"
msgstr "&Ajustaments EGA/(S)VGA" msgstr "&Ajustaments EGA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lent"
msgid "Fast" msgid "Fast"
msgstr "Ràpid" msgstr "Ràpid"
msgid "&Auto-pause on focus loss"
msgstr "&Pausa automàtica en la pèrdua del focus"

View File

@@ -124,6 +124,9 @@ msgstr "&Zachovat poměr stran"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Celočíselné škálování" 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" msgid "E&GA/(S)VGA settings"
msgstr "Nastavení pro E&GA a (S)VGA" msgstr "Nastavení pro E&GA a (S)VGA"
@@ -1218,3 +1221,6 @@ msgstr "Pomalý"
msgid "Fast" msgid "Fast"
msgstr "Rychlý" msgstr "Rychlý"
msgid "&Auto-pause on focus loss"
msgstr "&Automatická pauza při ztrátě zaměření okna"

View File

@@ -124,6 +124,9 @@ msgstr "&Quadratische Pixel (Seitenverhältnis beibehalten)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Integer-Skalierung" msgstr "&Integer-Skalierung"
msgid "4:&3 Integer scale"
msgstr "4:&3 Integer-Skalierung"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA-Einstellungen" msgstr "E&GA/(S)VGA-Einstellungen"
@@ -1219,3 +1222,5 @@ msgstr "Langsam"
msgid "Fast" msgid "Fast"
msgstr "Schnell" msgstr "Schnell"
msgid "&Auto-pause on focus loss"
msgstr "&Auto-Pause bei Fokusverlust"

View File

@@ -124,6 +124,9 @@ msgstr "&Square pixels (Keep ratio)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Integer scale" msgstr "&Integer scale"
msgid "4:&3 Integer scale"
msgstr "4:&3 Integer scale"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA settings" msgstr "E&GA/(S)VGA settings"
@@ -1219,3 +1222,5 @@ msgstr "Slow"
msgid "Fast" msgid "Fast"
msgstr "Fast" msgstr "Fast"
msgid "&Auto-pause on focus loss"
msgstr "&Auto-pause on focus loss"

View File

@@ -124,6 +124,9 @@ msgstr "&Square pixels (Keep ratio)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Integer scale" msgstr "&Integer scale"
msgid "4:&3 Integer scale"
msgstr "4:&3 Integer scale"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA settings" msgstr "E&GA/(S)VGA settings"
@@ -1219,3 +1222,5 @@ msgstr "Slow"
msgid "Fast" msgid "Fast"
msgstr "Fast" msgstr "Fast"
msgid "&Auto-pause on focus loss"
msgstr "&Auto-pause on focus loss"

View File

@@ -124,6 +124,9 @@ msgstr "&Píxeles cuadrados (Mant. aspecto)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Escalado valor entero" msgstr "&Escalado valor entero"
msgid "4:&3 Integer scale"
msgstr "Escalado valor entero 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "&Configuraciones EGA/(S)VGA" msgstr "&Configuraciones EGA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lenta"
msgid "Fast" msgid "Fast"
msgstr "Rápida" msgstr "Rápida"
msgid "&Auto-pause on focus loss"
msgstr "&Pausa automática al perder el foco"

View File

@@ -124,6 +124,9 @@ msgstr "&Tasasivuiset kuvapisteet (säilytä kuvasuhde)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Kokonaislukuskaalaus" msgstr "&Kokonaislukuskaalaus"
msgid "4:&3 Integer scale"
msgstr "4:&3 Kokonaislukuskaalaus"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "&EGA/(S)VGA-asetukset" msgstr "&EGA/(S)VGA-asetukset"
@@ -1219,3 +1222,5 @@ msgstr "Hidas"
msgid "Fast" msgid "Fast"
msgstr "Nopea" msgstr "Nopea"
msgid "&Auto-pause on focus loss"
msgstr "&Automaattinen tauko tarkennuksen hävitessä"

View File

@@ -124,6 +124,9 @@ msgstr "pixels &Carrés(Keep ratio)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "Echelle &Entière" msgstr "Echelle &Entière"
msgid "4:&3 Integer scale"
msgstr "Echelle Entière 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Réglages E&GA/(S)VGA" msgstr "Réglages E&GA/(S)VGA"
@@ -1219,3 +1222,6 @@ msgstr "Lent"
msgid "Fast" msgid "Fast"
msgstr "Rapide" msgstr "Rapide"
msgid "&Auto-pause on focus loss"
msgstr "&Pause automatique à perte de mise au point"

View File

@@ -124,6 +124,9 @@ msgstr "&Kvadratni pikseli (zadrži omjer)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Cijelobrojno skaliranje" msgstr "&Cijelobrojno skaliranje"
msgid "4:&3 Integer scale"
msgstr "4:&3 Cijelobrojno skaliranje"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA postavke" msgstr "E&GA/(S)VGA postavke"
@@ -1219,3 +1222,5 @@ msgstr "Spori"
msgid "Fast" msgid "Fast"
msgstr "Brzi" msgstr "Brzi"
msgid "&Auto-pause on focus loss"
msgstr "&Automatska pauza pri gubitku fokusa"

View File

@@ -124,6 +124,9 @@ msgstr "&Négyzetes képpontok (aránytartás)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Egész tényezős nagyítás" 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" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA beállítások" msgstr "E&GA/(S)VGA beállítások"
@@ -1219,3 +1222,5 @@ msgstr "Lassú"
msgid "Fast" msgid "Fast"
msgstr "Gyors" msgstr "Gyors"
msgid "&Auto-pause on focus loss"
msgstr "&Automatikus szünet fókuszvesztéskor"

View File

@@ -124,6 +124,9 @@ msgstr "&Pixel quadrati (mantiene l'aspetto)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Scala intera" msgstr "&Scala intera"
msgid "4:&3 Integer scale"
msgstr "Scala intera 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Impostazioni E&GA/(S)VGA" msgstr "Impostazioni E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lenta"
msgid "Fast" msgid "Fast"
msgstr "Veloce" msgstr "Veloce"
msgid "&Auto-pause on focus loss"
msgstr "&Pausa automatica alla perdita della messa a fuoco"

View File

@@ -124,6 +124,9 @@ msgstr "正方形ピクセル(アスペクト比を維持)(&S)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "整数倍(&I)" msgstr "整数倍(&I)"
msgid "4:&3 Integer scale"
msgstr "4:3 整数倍(&3)"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGAの設定" msgstr "E&GA/(S)VGAの設定"
@@ -1219,3 +1222,5 @@ msgstr "遅い"
msgid "Fast" msgid "Fast"
msgstr "速い" msgstr "速い"
msgid "&Auto-pause on focus loss"
msgstr "フォーカスが外れると自動ポーズ(&A)"

View File

@@ -124,6 +124,9 @@ msgstr "정사각형 픽셀 (비율 유지)(&S)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "정수배 확대(&I)" msgstr "정수배 확대(&I)"
msgid "4:&3 Integer scale"
msgstr "4:3 정수배 확대(&3)"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "E&GA/(S)VGA 설정" msgstr "E&GA/(S)VGA 설정"
@@ -1219,3 +1222,5 @@ msgstr "느린"
msgid "Fast" msgid "Fast"
msgstr "빠른" msgstr "빠른"
msgid "&Auto-pause on focus loss"
msgstr "집중력 저하 시 자동 일시 중지(&A)"

View File

@@ -124,6 +124,9 @@ msgstr "&Kwadratowe piksele (Zachowaj proporcje)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Skalowanie całkowite" msgstr "&Skalowanie całkowite"
msgid "4:&3 Integer scale"
msgstr "Skalowanie całkowite 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Ustawienia E&GA/(S)VGA" msgstr "Ustawienia E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Powolny"
msgid "Fast" msgid "Fast"
msgstr "Szybki" msgstr "Szybki"
msgid "&Auto-pause on focus loss"
msgstr "&Automatyczna pauza po utracie fokusu"

View File

@@ -124,6 +124,9 @@ msgstr "Pixel&s quadrados (manter proporção)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Redimensionamento com valores inteiros" msgstr "&Redimensionamento com valores inteiros"
msgid "4:&3 Integer scale"
msgstr "Redimensionamento com valores inteiros 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Configurações E&GA/(S)VGA" msgstr "Configurações E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lento"
msgid "Fast" msgid "Fast"
msgstr "Rápido" msgstr "Rápido"
msgid "&Auto-pause on focus loss"
msgstr "Pausa &automática ao perder o foco"

View File

@@ -124,6 +124,9 @@ msgstr "Pixels &quadrados (Manter rácio)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "Escala &inteira" msgstr "Escala &inteira"
msgid "4:&3 Integer scale"
msgstr "Escala inteira 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Definições E&GA/(S)VGA" msgstr "Definições E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Lento"
msgid "Fast" msgid "Fast"
msgstr "Rápido" msgstr "Rápido"
msgid "&Auto-pause on focus loss"
msgstr "Pausa &automática na perda de focagem"

View File

@@ -124,6 +124,9 @@ msgstr "&Квадратные пиксели (сохранить соотнош
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Целочисленное масштабирование" msgstr "&Целочисленное масштабирование"
msgid "4:&3 Integer scale"
msgstr "4:&3 Целочисленное масштабирование"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Настройки E&GA/(S)VGA" msgstr "Настройки E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Медленный"
msgid "Fast" msgid "Fast"
msgstr "Быстрый" msgstr "Быстрый"
msgid "&Auto-pause on focus loss"
msgstr "&Автопауза при потере фокуса"

View File

@@ -124,6 +124,9 @@ msgstr "&Zachovať pomer strán"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Celočíselné škálovanie" msgstr "&Celočíselné škálovanie"
msgid "4:&3 Integer scale"
msgstr "4:&3 Celočíselné škálovanie"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Nastavenia pre E&GA a (S)VGA" msgstr "Nastavenia pre E&GA a (S)VGA"
@@ -1218,3 +1221,6 @@ msgstr "Pomalý"
msgid "Fast" msgid "Fast"
msgstr "Rýchly" msgstr "Rýchly"
msgid "&Auto-pause on focus loss"
msgstr "&Automatická pauza pri strate fokusu okna"

View File

@@ -124,6 +124,9 @@ msgstr "&Kvadratni piksli (ohrani razmerje)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Celoštevilsko raztezanje" msgstr "&Celoštevilsko raztezanje"
msgid "4:&3 Integer scale"
msgstr "Celoštevilsko raztezanje 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Nastavitve E&GA/(S)VGA" msgstr "Nastavitve E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Počasni"
msgid "Fast" msgid "Fast"
msgstr "Hitri" msgstr "Hitri"
msgid "&Auto-pause on focus loss"
msgstr "&Samodejni premor ob izgubi fokusa"

View File

@@ -124,6 +124,9 @@ msgstr "&Kare piksel (ölçeği koru)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "Tam &sayı ölçeklemesi" msgstr "Tam &sayı ölçeklemesi"
msgid "4:&3 Integer scale"
msgstr "4:&3 Tam sayı ölçeklemesi"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "EGA/&(S)VGA ayarları" msgstr "EGA/&(S)VGA ayarları"
@@ -1219,3 +1222,5 @@ msgstr "Yavaş"
msgid "Fast" msgid "Fast"
msgstr "Hızlı" msgstr "Hızlı"
msgid "&Auto-pause on focus loss"
msgstr "&Odak kaybında otomatik duraklatma"

View File

@@ -124,6 +124,9 @@ msgstr "&Квадратні пікселі (зберегти відношенн
msgid "&Integer scale" msgid "&Integer scale"
msgstr "&Цілісночисленне масштабування" msgstr "&Цілісночисленне масштабування"
msgid "4:&3 Integer scale"
msgstr "Цілісночисленне масштабування 4:&3"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "Налаштування E&GA/(S)VGA" msgstr "Налаштування E&GA/(S)VGA"
@@ -1219,3 +1222,5 @@ msgstr "Повільний"
msgid "Fast" msgid "Fast"
msgstr "Швидкий" msgstr "Швидкий"
msgid "&Auto-pause on focus loss"
msgstr "&Автопауза при втраті фокусу"

View File

@@ -124,6 +124,9 @@ msgstr "保持比例(&S)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "整数比例(&I)" msgstr "整数比例(&I)"
msgid "4:&3 Integer scale"
msgstr "4:3 整数比例(&3)"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "EGA/(S)VGA 设置(&G)" msgstr "EGA/(S)VGA 设置(&G)"
@@ -1219,3 +1222,6 @@ msgstr "慢"
msgid "Fast" msgid "Fast"
msgstr "快" msgstr "快"
msgid "&Auto-pause on focus loss"
msgstr "&失焦自动暂停"

View File

@@ -124,6 +124,9 @@ msgstr "保持比例(&S)"
msgid "&Integer scale" msgid "&Integer scale"
msgstr "整數比例(&I)" msgstr "整數比例(&I)"
msgid "4:&3 Integer scale"
msgstr "4:3 整數比例(&3)"
msgid "E&GA/(S)VGA settings" msgid "E&GA/(S)VGA settings"
msgstr "EGA/(S)VGA 設定(&G)" msgstr "EGA/(S)VGA 設定(&G)"
@@ -1219,3 +1222,5 @@ msgstr "慢"
msgid "Fast" msgid "Fast"
msgstr "快" msgstr "快"
msgid "&Auto-pause on focus loss"
msgstr "&失去焦點時自動暫停"

View File

@@ -211,7 +211,11 @@ MainWindow::MainWindow(QWidget *parent)
connect(this, &MainWindow::hardResetCompleted, this, [this]() { connect(this, &MainWindow::hardResetCompleted, this, [this]() {
ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA)); ui->actionMCA_devices->setVisible(machine_has_bus(machine, MACHINE_BUS_MCA));
QApplication::setOverrideCursor(Qt::ArrowCursor); QApplication::setOverrideCursor(Qt::ArrowCursor);
#ifdef USE_WACOM
ui->menuTablet_tool->menuAction()->setVisible(mouse_mode >= 1); 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); 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) { connect(qApp, &QGuiApplication::applicationStateChanged, [this](Qt::ApplicationState state) {
if (mouse_capture && state != Qt::ApplicationState::ApplicationActive) if (state == Qt::ApplicationState::ApplicationActive) {
if (auto_paused) {
plat_pause(0);
auto_paused = 0;
}
} else {
if (mouse_capture)
emit setMouseCapture(false); emit setMouseCapture(false);
if (do_auto_pause && !dopause) {
auto_paused = 1;
plat_pause(1);
}
}
}); });
connect(this, &MainWindow::resizeContents, this, [this](int w, int h) { connect(this, &MainWindow::resizeContents, this, [this](int w, int h) {
@@ -530,6 +546,9 @@ MainWindow::MainWindow(QWidget *parent)
case FULLSCR_SCALE_INT: case FULLSCR_SCALE_INT:
ui->actionFullScreen_int->setChecked(true); ui->actionFullScreen_int->setChecked(true);
break; break;
case FULLSCR_SCALE_INT43:
ui->actionFullScreen_int43->setChecked(true);
break;
} }
actGroup = new QActionGroup(this); actGroup = new QActionGroup(this);
actGroup->addAction(ui->actionFullScreen_stretch); actGroup->addAction(ui->actionFullScreen_stretch);
@@ -583,6 +602,9 @@ MainWindow::MainWindow(QWidget *parent)
if (vid_cga_contrast > 0) { if (vid_cga_contrast > 0) {
ui->actionChange_contrast_for_monochrome_display->setChecked(true); ui->actionChange_contrast_for_monochrome_display->setChecked(true);
} }
if (do_auto_pause > 0) {
ui->actionAuto_pause->setChecked(true);
}
#ifdef Q_OS_MACOS #ifdef Q_OS_MACOS
ui->actionCtrl_Alt_Del->setShortcutVisibleInContextMenu(true); ui->actionCtrl_Alt_Del->setShortcutVisibleInContextMenu(true);
@@ -1559,6 +1581,13 @@ MainWindow::on_actionFullScreen_int_triggered()
update_fullscreen_scale_checkboxes(ui, ui->actionFullScreen_int); 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 static void
update_greyscale_checkboxes(Ui::MainWindow *ui, QAction *selected, int value) 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); 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 void
MainWindow::on_actionRemember_size_and_position_triggered() MainWindow::on_actionRemember_size_and_position_triggered()
{ {

View File

@@ -69,6 +69,7 @@ private slots:
void on_actionFullscreen_triggered(); void on_actionFullscreen_triggered();
void on_actionSettings_triggered(); void on_actionSettings_triggered();
void on_actionExit_triggered(); void on_actionExit_triggered();
void on_actionAuto_pause_triggered();
void on_actionPause_triggered(); void on_actionPause_triggered();
void on_actionCtrl_Alt_Del_triggered(); void on_actionCtrl_Alt_Del_triggered();
void on_actionCtrl_Alt_Esc_triggered(); void on_actionCtrl_Alt_Esc_triggered();
@@ -90,6 +91,7 @@ private slots:
void on_actionLinear_triggered(); void on_actionLinear_triggered();
void on_actionNearest_triggered(); void on_actionNearest_triggered();
void on_actionFullScreen_int_triggered(); void on_actionFullScreen_int_triggered();
void on_actionFullScreen_int43_triggered();
void on_actionFullScreen_keepRatio_triggered(); void on_actionFullScreen_keepRatio_triggered();
void on_actionFullScreen_43_triggered(); void on_actionFullScreen_43_triggered();
void on_actionFullScreen_stretch_triggered(); void on_actionFullScreen_stretch_triggered();

View File

@@ -68,17 +68,19 @@
<addaction name="actionPen"/> <addaction name="actionPen"/>
<addaction name="actionCursor_Puck"/> <addaction name="actionCursor_Puck"/>
</widget> </widget>
<addaction name="actionAuto_pause"/>
<addaction name="separator"/>
<addaction name="actionKeyboard_requires_capture"/> <addaction name="actionKeyboard_requires_capture"/>
<addaction name="actionRight_CTRL_is_left_ALT"/> <addaction name="actionRight_CTRL_is_left_ALT"/>
<addaction name="menuTablet_tool"/> <addaction name="menuTablet_tool"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionPause"/>
<addaction name="separator"/>
<addaction name="actionHard_Reset"/> <addaction name="actionHard_Reset"/>
<addaction name="actionCtrl_Alt_Del"/> <addaction name="actionCtrl_Alt_Del"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionCtrl_Alt_Esc"/> <addaction name="actionCtrl_Alt_Esc"/>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionPause"/>
<addaction name="separator"/>
<addaction name="actionExit"/> <addaction name="actionExit"/>
</widget> </widget>
<widget class="QMenu" name="menuTools"> <widget class="QMenu" name="menuTools">
@@ -148,6 +150,7 @@
<addaction name="actionFullScreen_43"/> <addaction name="actionFullScreen_43"/>
<addaction name="actionFullScreen_keepRatio"/> <addaction name="actionFullScreen_keepRatio"/>
<addaction name="actionFullScreen_int"/> <addaction name="actionFullScreen_int"/>
<addaction name="actionFullScreen_int43"/>
</widget> </widget>
<widget class="QMenu" name="menuEGA_S_VGA_settings"> <widget class="QMenu" name="menuEGA_S_VGA_settings">
<property name="title"> <property name="title">
@@ -263,6 +266,14 @@
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionSettings"/> <addaction name="actionSettings"/>
</widget> </widget>
<action name="actionAuto_pause">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Auto-pause on focus loss</string>
</property>
</action>
<action name="actionKeyboard_requires_capture"> <action name="actionKeyboard_requires_capture">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>
@@ -586,6 +597,14 @@
<string>&amp;Integer scale</string> <string>&amp;Integer scale</string>
</property> </property>
</action> </action>
<action name="actionFullScreen_int43">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>4:&amp;3 Integer scale</string>
</property>
</action>
<action name="actionInverted_VGA_monitor"> <action name="actionInverted_VGA_monitor">
<property name="checkable"> <property name="checkable">
<bool>true</bool> <bool>true</bool>

View File

@@ -76,7 +76,12 @@ RendererCommon::onResize(int width, int height)
switch (video_fullscreen_scale) { switch (video_fullscreen_scale) {
case FULLSCR_SCALE_INT: case FULLSCR_SCALE_INT:
case FULLSCR_SCALE_INT43:
if (video_fullscreen_scale == FULLSCR_SCALE_INT43)
gsr = 4.0 / 3.0;
else
gsr = gw / gh; gsr = gw / gh;
if (gsr <= hsr) { if (gsr <= hsr) {
dw = hh * gsr; dw = hh * gsr;
dh = hh; dh = hh;