Merge remote-tracking branch 'upstream/master' into feature/mtrr

This commit is contained in:
Jasmine Iwanek
2023-02-04 04:17:18 -05:00
26 changed files with 472 additions and 298 deletions

View File

@@ -90,74 +90,78 @@
#define IDT_NET_TYPE 1725 /* Network type: */
#define IDT_PCAP 1726 /* PCap device: */
#define IDT_NET 1727 /* Network adapter: */
#define IDT_NET1 1728 /* Network adapter 1: */
#define IDT_NET2 1729 /* Network adapter 2: */
#define IDT_NET3 1730 /* Network adapter 3: */
#define IDT_NET4 1731 /* Network adapter 4: */
/* DLG_CFG_PORTS */
#define IDT_COM1 1728 /* COM1 Device: */
#define IDT_COM2 1729 /* COM1 Device: */
#define IDT_COM3 1730 /* COM1 Device: */
#define IDT_COM4 1731 /* COM1 Device: */
#define IDT_COM1 1732 /* COM1 Device: */
#define IDT_COM2 1733 /* COM1 Device: */
#define IDT_COM3 1734 /* COM1 Device: */
#define IDT_COM4 1735 /* COM1 Device: */
#define IDT_LPT1 1732 /* LPT1 Device: */
#define IDT_LPT2 1733 /* LPT2 Device: */
#define IDT_LPT3 1734 /* LPT3 Device: */
#define IDT_LPT4 1735 /* LPT4 Device: */
#define IDT_LPT1 1736 /* LPT1 Device: */
#define IDT_LPT2 1737 /* LPT2 Device: */
#define IDT_LPT3 1738 /* LPT3 Device: */
#define IDT_LPT4 1739 /* LPT4 Device: */
/* DLG_CFG_STORAGE */
#define IDT_HDC 1736 /* HD Controller: */
#define IDT_FDC 1737 /* Ext FD Controller: */
#define IDT_SCSI_1 1738 /* SCSI Board #1: */
#define IDT_SCSI_2 1739 /* SCSI Board #2: */
#define IDT_SCSI_3 1740 /* SCSI Board #3: */
#define IDT_SCSI_4 1742 /* SCSI Board #4: */
#define IDT_HDC 1740 /* HD Controller: */
#define IDT_FDC 1741 /* Ext FD Controller: */
#define IDT_SCSI_1 1742 /* SCSI Board #1: */
#define IDT_SCSI_2 1743 /* SCSI Board #2: */
#define IDT_SCSI_3 1744 /* SCSI Board #3: */
#define IDT_SCSI_4 1745 /* SCSI Board #4: */
/* DLG_CFG_HARD_DISKS */
#define IDT_HDD 1743 /* Hard disks: */
#define IDT_BUS 1744 /* Bus: */
#define IDT_CHANNEL 1745 /* Channel: */
#define IDT_ID 1746 /* ID: */
#define IDT_LUN 1747 /* LUN: */
#define IDT_SPEED 1748 /* Speed: */
#define IDT_HDD 1746 /* Hard disks: */
#define IDT_BUS 1747 /* Bus: */
#define IDT_CHANNEL 1748 /* Channel: */
#define IDT_ID 1749 /* ID: */
#define IDT_LUN 1750 /* LUN: */
#define IDT_SPEED 1751 /* Speed: */
/* DLG_CFG_HARD_DISKS_ADD */
#define IDT_SECTORS 1749 /* Sectors: */
#define IDT_HEADS 1750 /* Heads: */
#define IDT_CYLS 1751 /* Cylinders: */
#define IDT_SIZE_MB 1752 /* Size (MB): */
#define IDT_TYPE 1753 /* Type: */
#define IDT_FILE_NAME 1754 /* File name: */
#define IDT_IMG_FORMAT 1755 /* Image Format: */
#define IDT_BLOCK_SIZE 1756 /* Block Size: */
#define IDT_PROGRESS 1757 /* Progress: */
#define IDT_SECTORS 1752 /* Sectors: */
#define IDT_HEADS 1753 /* Heads: */
#define IDT_CYLS 1754 /* Cylinders: */
#define IDT_SIZE_MB 1755 /* Size (MB): */
#define IDT_TYPE 1756 /* Type: */
#define IDT_FILE_NAME 1757 /* File name: */
#define IDT_IMG_FORMAT 1758 /* Image Format: */
#define IDT_BLOCK_SIZE 1759 /* Block Size: */
#define IDT_PROGRESS 1760 /* Progress: */
/* DLG_CFG_FLOPPY_AND_CDROM_DRIVES */
#define IDT_FLOPPY_DRIVES 1758 /* Floppy drives: */
#define IDT_FDD_TYPE 1759 /* Type: */
#define IDT_CD_DRIVES 1760 /* CD-ROM drives: */
#define IDT_CD_BUS 1761 /* Bus: */
#define IDT_CD_ID 1762 /* ID: */
#define IDT_CD_LUN 1763 /* LUN: */
#define IDT_CD_CHANNEL 1764 /* Channel: */
#define IDT_CD_SPEED 1765 /* Speed: */
#define IDT_FLOPPY_DRIVES 1761 /* Floppy drives: */
#define IDT_FDD_TYPE 1762 /* Type: */
#define IDT_CD_DRIVES 1763 /* CD-ROM drives: */
#define IDT_CD_BUS 1764 /* Bus: */
#define IDT_CD_ID 1765 /* ID: */
#define IDT_CD_LUN 1766 /* LUN: */
#define IDT_CD_CHANNEL 1767 /* Channel: */
#define IDT_CD_SPEED 1768 /* Speed: */
/* DLG_CFG_OTHER_REMOVABLE_DEVICES */
#define IDT_MO_DRIVES 1766 /* MO drives: */
#define IDT_MO_BUS 1767 /* Bus: */
#define IDT_MO_ID 1768 /* ID: */
#define IDT_MO_CHANNEL 1769 /* Channel */
#define IDT_MO_TYPE 1770 /* Type: */
#define IDT_MO_DRIVES 1769 /* MO drives: */
#define IDT_MO_BUS 1770 /* Bus: */
#define IDT_MO_ID 1771 /* ID: */
#define IDT_MO_CHANNEL 1772 /* Channel */
#define IDT_MO_TYPE 1773 /* Type: */
#define IDT_ZIP_DRIVES 1771 /* ZIP drives: */
#define IDT_ZIP_BUS 1772 /* Bus: */
#define IDT_ZIP_ID 1773 /* ID: */
#define IDT_ZIP_LUN 1774 /* LUN: */
#define IDT_ZIP_CHANNEL 1775 /* Channel: */
#define IDT_ZIP_DRIVES 1774 /* ZIP drives: */
#define IDT_ZIP_BUS 1775 /* Bus: */
#define IDT_ZIP_ID 1776 /* ID: */
#define IDT_ZIP_LUN 1777 /* LUN: */
#define IDT_ZIP_CHANNEL 1778 /* Channel: */
/* DLG_CFG_PERIPHERALS */
#define IDT_ISARTC 1776 /* ISA RTC: */
#define IDT_ISAMEM_1 1777 /* ISAMEM Board #1: */
#define IDT_ISAMEM_2 1778 /* ISAMEM Board #2: */
#define IDT_ISAMEM_3 1779 /* ISAMEM Board #3: */
#define IDT_ISAMEM_4 1780 /* ISAMEM Board #4: */
#define IDT_ISARTC 1779 /* ISA RTC: */
#define IDT_ISAMEM_1 1780 /* ISAMEM Board #1: */
#define IDT_ISAMEM_2 1781 /* ISAMEM Board #2: */
#define IDT_ISAMEM_3 1782 /* ISAMEM Board #3: */
#define IDT_ISAMEM_4 1783 /* ISAMEM Board #4: */
/*
* To try to keep these organized, we now group the
@@ -218,109 +222,118 @@
#define IDC_RADIO_FM_DRV_NUKED 1054
#define IDC_RADIO_FM_DRV_YMFM 1055
#define IDC_COMBO_NET_TYPE 1060 /* network config */
#define IDC_COMBO_PCAP 1061
#define IDC_COMBO_NET 1062
#define IDC_COMBO_NET1_TYPE 1060 /* network config */
#define IDC_COMBO_NET2_TYPE 1061
#define IDC_COMBO_NET3_TYPE 1062
#define IDC_COMBO_NET4_TYPE 1063
#define IDC_COMBO_PCAP1 1064
#define IDC_COMBO_PCAP2 1065
#define IDC_COMBO_PCAP3 1066
#define IDC_COMBO_PCAP4 1067
#define IDC_COMBO_NET1 1068
#define IDC_COMBO_NET2 1069
#define IDC_COMBO_NET3 1070
#define IDC_COMBO_NET4 1071
#define IDC_COMBO_LPT1 1070 /* ports config */
#define IDC_COMBO_LPT2 1071
#define IDC_COMBO_LPT3 1072
#define IDC_COMBO_LPT4 1073
#define IDC_CHECK_SERIAL1 1074
#define IDC_CHECK_SERIAL2 1075
#define IDC_CHECK_SERIAL3 1076
#define IDC_CHECK_SERIAL4 1077
#define IDC_CHECK_PARALLEL1 1078
#define IDC_CHECK_PARALLEL2 1079
#define IDC_CHECK_PARALLEL3 1080
#define IDC_CHECK_PARALLEL4 1081
#define IDC_COMBO_LPT1 1080 /* ports config */
#define IDC_COMBO_LPT2 1081
#define IDC_COMBO_LPT3 1082
#define IDC_COMBO_LPT4 1083
#define IDC_CHECK_SERIAL1 1084
#define IDC_CHECK_SERIAL2 1085
#define IDC_CHECK_SERIAL3 1086
#define IDC_CHECK_SERIAL4 1087
#define IDC_CHECK_PARALLEL1 1088
#define IDC_CHECK_PARALLEL2 1089
#define IDC_CHECK_PARALLEL3 1090
#define IDC_CHECK_PARALLEL4 1091
#define IDC_OTHER_PERIPH 1082 /* storage controllers config */
#define IDC_COMBO_HDC 1083
#define IDC_CONFIGURE_HDC 1084
#define IDC_CHECK_IDE_TER 1085
#define IDC_BUTTON_IDE_TER 1086
#define IDC_CHECK_IDE_QUA 1087
#define IDC_BUTTON_IDE_QUA 1088
#define IDC_GROUP_SCSI 1089
#define IDC_COMBO_SCSI_1 1090
#define IDC_COMBO_SCSI_2 1091
#define IDC_COMBO_SCSI_3 1092
#define IDC_COMBO_SCSI_4 1093
#define IDC_CONFIGURE_SCSI_1 1094
#define IDC_CONFIGURE_SCSI_2 1095
#define IDC_CONFIGURE_SCSI_3 1096
#define IDC_CONFIGURE_SCSI_4 1097
#define IDC_CHECK_CASSETTE 1098
#define IDC_OTHER_PERIPH 1110 /* storage controllers config */
#define IDC_COMBO_HDC 1111
#define IDC_CONFIGURE_HDC 1112
#define IDC_CHECK_IDE_TER 1113
#define IDC_BUTTON_IDE_TER 1114
#define IDC_CHECK_IDE_QUA 1115
#define IDC_BUTTON_IDE_QUA 1116
#define IDC_GROUP_SCSI 1117
#define IDC_COMBO_SCSI_1 1118
#define IDC_COMBO_SCSI_2 1119
#define IDC_COMBO_SCSI_3 1120
#define IDC_COMBO_SCSI_4 1121
#define IDC_CONFIGURE_SCSI_1 1122
#define IDC_CONFIGURE_SCSI_2 1123
#define IDC_CONFIGURE_SCSI_3 1124
#define IDC_CONFIGURE_SCSI_4 1125
#define IDC_CHECK_CASSETTE 1126
#define IDC_HARD_DISKS 1100 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1101
#define IDC_BUTTON_HDD_ADD_NEW 1102
#define IDC_BUTTON_HDD_ADD 1103
#define IDC_BUTTON_HDD_REMOVE 1104
#define IDC_COMBO_HD_BUS 1105
#define IDC_COMBO_HD_CHANNEL 1106
#define IDC_COMBO_HD_ID 1107
#define IDC_COMBO_HD_LUN 1108
#define IDC_COMBO_HD_CHANNEL_IDE 1109
#define IDC_HARD_DISKS 1130 /* hard disks config */
#define IDC_LIST_HARD_DISKS 1131
#define IDC_BUTTON_HDD_ADD_NEW 1132
#define IDC_BUTTON_HDD_ADD 1133
#define IDC_BUTTON_HDD_REMOVE 1134
#define IDC_COMBO_HD_BUS 1135
#define IDC_COMBO_HD_CHANNEL 1136
#define IDC_COMBO_HD_ID 1137
#define IDC_COMBO_HD_LUN 1138
#define IDC_COMBO_HD_CHANNEL_IDE 1139
#define IDC_EDIT_HD_FILE_NAME 1110 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1111
#define IDC_EDIT_HD_HPC 1112
#define IDC_EDIT_HD_CYL 1113
#define IDC_EDIT_HD_SIZE 1114
#define IDC_COMBO_HD_TYPE 1115
#define IDC_PBAR_IMG_CREATE 1116
#define IDC_COMBO_HD_IMG_FORMAT 1117
#define IDC_COMBO_HD_BLOCK_SIZE 1118
#define IDC_EDIT_HD_FILE_NAME 1140 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1141
#define IDC_EDIT_HD_HPC 1142
#define IDC_EDIT_HD_CYL 1143
#define IDC_EDIT_HD_SIZE 1144
#define IDC_COMBO_HD_TYPE 1145
#define IDC_PBAR_IMG_CREATE 1146
#define IDC_COMBO_HD_IMG_FORMAT 1147
#define IDC_COMBO_HD_BLOCK_SIZE 1148
#define IDC_REMOV_DEVICES 1120 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1121
#define IDC_COMBO_FD_TYPE 1122
#define IDC_CHECKTURBO 1123
#define IDC_CHECKBPB 1124
#define IDC_LIST_CDROM_DRIVES 1125
#define IDC_COMBO_CD_BUS 1126
#define IDC_COMBO_CD_ID 1127
#define IDC_COMBO_CD_LUN 1128
#define IDC_COMBO_CD_CHANNEL_IDE 1129
#define IDC_CHECKEARLY 1130
#define IDC_REMOV_DEVICES 1150 /* floppy and cd-rom drives config */
#define IDC_LIST_FLOPPY_DRIVES 1151
#define IDC_COMBO_FD_TYPE 1152
#define IDC_CHECKTURBO 1153
#define IDC_CHECKBPB 1154
#define IDC_LIST_CDROM_DRIVES 1155
#define IDC_COMBO_CD_BUS 1156
#define IDC_COMBO_CD_ID 1157
#define IDC_COMBO_CD_LUN 1158
#define IDC_COMBO_CD_CHANNEL_IDE 1159
#define IDC_CHECKEARLY 1160
#define IDC_LIST_ZIP_DRIVES 1140 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1141
#define IDC_COMBO_ZIP_ID 1142
#define IDC_COMBO_ZIP_LUN 1143
#define IDC_COMBO_ZIP_CHANNEL_IDE 1144
#define IDC_CHECK250 1145
#define IDC_COMBO_CD_SPEED 1146
#define IDC_LIST_MO_DRIVES 1147
#define IDC_COMBO_MO_BUS 1148
#define IDC_COMBO_MO_ID 1149
#define IDC_COMBO_MO_LUN 1150
#define IDC_COMBO_MO_CHANNEL_IDE 1151
#define IDC_COMBO_MO_TYPE 1152
#define IDC_LIST_ZIP_DRIVES 1170 /* other removable devices config */
#define IDC_COMBO_ZIP_BUS 1171
#define IDC_COMBO_ZIP_ID 1172
#define IDC_COMBO_ZIP_LUN 1173
#define IDC_COMBO_ZIP_CHANNEL_IDE 1174
#define IDC_CHECK250 1175
#define IDC_COMBO_CD_SPEED 1176
#define IDC_LIST_MO_DRIVES 1177
#define IDC_COMBO_MO_BUS 1178
#define IDC_COMBO_MO_ID 1179
#define IDC_COMBO_MO_LUN 1170
#define IDC_COMBO_MO_CHANNEL_IDE 1181
#define IDC_COMBO_MO_TYPE 1182
#define IDC_CHECK_BUGGER 1160 /* other periph config */
#define IDC_CHECK_POSTCARD 1161
#define IDC_COMBO_ISARTC 1162
#define IDC_CONFIGURE_ISARTC 1163
#define IDC_COMBO_FDC 1164
#define IDC_CONFIGURE_FDC 1165
#define IDC_GROUP_ISAMEM 1166
#define IDC_COMBO_ISAMEM_1 1167
#define IDC_COMBO_ISAMEM_2 1168
#define IDC_COMBO_ISAMEM_3 1169
#define IDC_COMBO_ISAMEM_4 1170
#define IDC_CONFIGURE_ISAMEM_1 1171
#define IDC_CONFIGURE_ISAMEM_2 1172
#define IDC_CONFIGURE_ISAMEM_3 1173
#define IDC_CONFIGURE_ISAMEM_4 1174
#define IDC_CHECK_BUGGER 1190 /* other periph config */
#define IDC_CHECK_POSTCARD 1191
#define IDC_COMBO_ISARTC 1192
#define IDC_CONFIGURE_ISARTC 1193
#define IDC_COMBO_FDC 1194
#define IDC_CONFIGURE_FDC 1195
#define IDC_GROUP_ISAMEM 1196
#define IDC_COMBO_ISAMEM_1 1197
#define IDC_COMBO_ISAMEM_2 1198
#define IDC_COMBO_ISAMEM_3 1199
#define IDC_COMBO_ISAMEM_4 1200
#define IDC_CONFIGURE_ISAMEM_1 1201
#define IDC_CONFIGURE_ISAMEM_2 1202
#define IDC_CONFIGURE_ISAMEM_3 1203
#define IDC_CONFIGURE_ISAMEM_4 1204
#define IDC_SLIDER_GAIN 1180 /* sound gain dialog */
#define IDC_SLIDER_GAIN 1210 /* sound gain dialog */
#define IDC_EDIT_FILE_NAME 1200 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1201
#define IDC_COMBO_RPM_MODE 1202
#define IDC_EDIT_FILE_NAME 1220 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1221
#define IDC_COMBO_RPM_MODE 1222
#define IDC_COMBO_LANG 1009 /* change language dialog */
#define IDC_COMBO_ICON 1010
@@ -337,17 +350,24 @@
#define IDC_CONFIGURE_SND3 1304
#define IDC_CONFIGURE_SND4 1305
#define IDC_CONFIGURE_VOODOO 1306
#define IDC_CONFIGURE_MOD 1307
#define IDC_CONFIGURE_NET_TYPE 1308
#define IDC_CONFIGURE_BUSLOGIC 1309
#define IDC_CONFIGURE_PCAP 1310
#define IDC_CONFIGURE_NET 1311
#define IDC_CONFIGURE_MIDI_OUT 1312
#define IDC_CONFIGURE_MIDI_IN 1313
#define IDC_JOY1 1314
#define IDC_JOY2 1315
#define IDC_JOY3 1316
#define IDC_JOY4 1317
#define IDC_CONFIGURE_NET1_TYPE 1310
#define IDC_CONFIGURE_NET2_TYPE 1311
#define IDC_CONFIGURE_NET3_TYPE 1312
#define IDC_CONFIGURE_NET4_TYPE 1313
#define IDC_CONFIGURE_PCAP1 1314
#define IDC_CONFIGURE_PCAP2 1315
#define IDC_CONFIGURE_PCAP3 1316
#define IDC_CONFIGURE_PCAP4 1317
#define IDC_CONFIGURE_NET1 1318
#define IDC_CONFIGURE_NET2 1319
#define IDC_CONFIGURE_NET3 1320
#define IDC_CONFIGURE_NET4 1321
#define IDC_CONFIGURE_MIDI_OUT 1322
#define IDC_CONFIGURE_MIDI_IN 1323
#define IDC_JOY1 1330
#define IDC_JOY2 1331
#define IDC_JOY3 1332
#define IDC_JOY4 1333
#define IDC_HDTYPE 1380
#define IDC_RENDER 1381
#define IDC_STATUS 1382

View File

@@ -76,22 +76,37 @@ parse_valuators(const double *input_values,
static bool exitthread = false;
static int
xinput2_get_xtest_pointer()
{
/* The XTEST pointer events injected by VNC servers to move the cursor always report
absolute coordinates, despite XTEST declaring relative axes (related: SDL issue 1836).
This looks for the XTEST pointer so that we can assume it's absolute as a workaround. */
int devs;
XIDeviceInfo *info = XIQueryDevice(disp, XIAllDevices, &devs), *dev;
for (int i = 0; i < devs; i++) {
dev = &info[i];
if ((dev->use == XISlavePointer) && !strcmp(dev->name, "Virtual core XTEST pointer"))
return dev->deviceid;
}
return -1;
}
void
xinput2_proc()
{
Window win;
win = DefaultRootWindow(disp);
int xtest_pointer = xinput2_get_xtest_pointer();
ximask.deviceid = XIAllMasterDevices;
ximask.mask_len = XIMaskLen(XI_LASTEVENT);
ximask.mask = (unsigned char *) calloc(ximask.mask_len, sizeof(unsigned char));
XISetMask(ximask.mask, XI_RawKeyPress);
XISetMask(ximask.mask, XI_RawKeyRelease);
XISetMask(ximask.mask, XI_RawButtonPress);
XISetMask(ximask.mask, XI_RawButtonRelease);
XISetMask(ximask.mask, XI_RawMotion);
XISetMask(ximask.mask, XI_Motion);
XISetMask(ximask.mask, XI_DeviceChanged);
XISelectEvents(disp, win, &ximask, 1);
@@ -134,7 +149,7 @@ common_motion:
const XIValuatorClassInfo *v = (const XIValuatorClassInfo *) xidevinfo->classes[i];
if (v->type == XIValuatorClass) {
/* Is this an absolute or relative axis? */
if (v->mode == XIModeRelative) {
if ((v->mode == XIModeRelative) && (rawev->sourceid != xtest_pointer)) {
/* Set relative coordinates. */
if (axis == 0)
xi2_mouse_x = xi2_mouse_x + coords[axis];
@@ -145,19 +160,30 @@ common_motion:
int disp_screen = XDefaultScreen(disp);
double abs_div;
if (axis == 0) {
abs_div = (v->max - v->min) / (double) XDisplayWidth(disp, disp_screen);
if (abs_div <= 0)
abs_div = 1;
abs_div = (coords[axis] - v->min) / abs_div;
if (v->mode == XIModeRelative) {
/* XTEST axes have dummy min/max values because they're nominally relative,
but in practice, the injected absolute coordinates are already in pixels. */
abs_div = coords[axis];
} else {
abs_div = (v->max - v->min) / (double) XDisplayWidth(disp, disp_screen);
if (abs_div <= 0)
abs_div = 1;
abs_div = (coords[axis] - v->min) / abs_div;
}
if (xi2_mouse_abs_x != 0)
xi2_mouse_x = xi2_mouse_x + (abs_div - xi2_mouse_abs_x);
xi2_mouse_abs_x = abs_div;
} else {
abs_div = (v->max - v->min) / (double) XDisplayHeight(disp, disp_screen);
if (abs_div <= 0)
abs_div = 1;
abs_div = (coords[axis] - v->min) / abs_div;
if (v->mode == XIModeRelative) {
/* Same as above. */
abs_div = coords[axis];
} else {
abs_div = (v->max - v->min) / (double) XDisplayHeight(disp, disp_screen);
if (abs_div <= 0)
abs_div = 1;
abs_div = (coords[axis] - v->min) / abs_div;
}
if (xi2_mouse_abs_y != 0)
xi2_mouse_y = xi2_mouse_y + (abs_div - xi2_mouse_abs_y);
@@ -181,6 +207,14 @@ common_motion:
XFlush(disp);
}
break;
}
case XI_DeviceChanged:
{
/* Re-scan for XTEST pointer, just in case. */
xtest_pointer = xinput2_get_xtest_pointer();
break;
}
}

View File

@@ -66,7 +66,7 @@ static void
ali5123_fdc_handler(ali5123_t *dev)
{
uint16_t ld_port = 0;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << 0));
uint8_t global_enable = !(dev->regs[0x22] & (1 << 0));
uint8_t local_enable = !!dev->ld_regs[0][0x30];
fdc_remove(dev->fdc);
@@ -81,7 +81,7 @@ static void
ali5123_lpt_handler(ali5123_t *dev)
{
uint16_t ld_port = 0;
uint8_t global_enable = !!(dev->regs[0x22] & (1 << 3));
uint8_t global_enable = !(dev->regs[0x22] & (1 << 3));
uint8_t local_enable = !!dev->ld_regs[3][0x30];
uint8_t lpt_irq = dev->ld_regs[3][0x70];
@@ -100,9 +100,10 @@ ali5123_lpt_handler(ali5123_t *dev)
static void
ali5123_serial_handler(ali5123_t *dev, int uart)
{
uint8_t uart_nos[2][3]= { { 4, 5, 0xb }, { 4, 0xb, 5 } };
uint16_t ld_port = 0;
uint8_t uart_no = (uart == 2) ? 0x0b : (4 + uart);
uint8_t global_enable = !!(dev->regs[0x22] & (1 << uart_no));
uint8_t uart_no = uart_nos[!!(dev->regs[0x2d] & 0x20)][uart];
uint8_t global_enable = !(dev->regs[0x22] & (1 << (4 + uart)));
uint8_t local_enable = !!dev->ld_regs[uart_no][0x30];
uint8_t mask = (uart == 1) ? 0x04 : 0x05;
@@ -207,8 +208,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
{
ali5123_t *dev = (ali5123_t *) priv;
uint8_t index = (port & 1) ? 0 : 1;
uint8_t valxor = 0x00, keep = 0x00;
uint8_t cur_ld;
uint8_t valxor = 0x00, cur_ld = dev->regs[7];
if (index) {
if (((val == 0x51) && (!dev->tries) && (!dev->locked)) || ((val == 0x23) && (dev->tries) && (!dev->locked))) {
@@ -236,27 +236,23 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
if (dev->locked) {
if (dev->cur_reg < 48) {
valxor = val ^ dev->regs[dev->cur_reg];
if ((val == 0x1f) || (val == 0x20) || (val == 0x21))
if ((val >= 0x1f) && (val <= 0x21))
return;
dev->regs[dev->cur_reg] = val;
} else {
valxor = val ^ dev->ld_regs[dev->regs[7]][dev->cur_reg];
if (((dev->cur_reg & 0xf0) == 0x70) && (dev->regs[7] < 4))
valxor = val ^ dev->ld_regs[cur_ld][dev->cur_reg];
if (((dev->cur_reg & 0xf0) == 0x70) && (cur_ld < 4))
return;
/* Block writes to some logical devices. */
if (dev->regs[7] > 0x0c)
if (cur_ld > 0x0c)
return;
else
switch (dev->regs[7]) {
case 0x01:
case 0x02:
case 0x06:
case 0x08:
case 0x09:
case 0x0a:
return;
}
dev->ld_regs[dev->regs[7]][dev->cur_reg] = val | keep;
else switch (cur_ld) {
case 0x01: case 0x02:
case 0x06:
case 0x08 ... 0x0a:
return;
}
dev->ld_regs[cur_ld][dev->cur_reg] = val;
}
} else
return;
@@ -281,16 +277,18 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
if (valxor & 0x40)
ali5123_serial_handler(dev, 2);
break;
case 0x2d:
if (valxor & 0x20) {
ali5123_serial_handler(dev, 1);
ali5123_serial_handler(dev, 2);
}
break;
}
return;
}
cur_ld = dev->regs[7];
if ((dev->regs[7] == 5) && (dev->regs[0x2d] & 0x20))
cur_ld = 0x0b;
else if ((dev->regs[7] == 0x0b) && (dev->regs[0x2d] & 0x20))
cur_ld = 5;
switch (cur_ld) {
case 0:
/* FDD */
@@ -299,7 +297,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
case 0x60:
case 0x61:
if ((dev->cur_reg == 0x30) && (val & 0x01))
dev->regs[0x22] |= 0x01;
dev->regs[0x22] &= ~0x01;
if (valxor)
ali5123_fdc_handler(dev);
break;
@@ -339,7 +337,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
case 0x61:
case 0x70:
if ((dev->cur_reg == 0x30) && (val & 0x01))
dev->regs[0x22] |= 0x08;
dev->regs[0x22] &= ~0x08;
if (valxor)
ali5123_lpt_handler(dev);
break;
@@ -354,7 +352,7 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
case 0x70:
case 0xf0:
if ((dev->cur_reg == 0x30) && (val & 0x01))
dev->regs[0x22] |= 0x10;
dev->regs[0x22] &= ~0x10;
if (valxor)
ali5123_serial_handler(dev, 0);
break;
@@ -369,9 +367,9 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
case 0x70:
case 0xf0:
if ((dev->cur_reg == 0x30) && (val & 0x01))
dev->regs[0x22] |= 0x20;
dev->regs[0x22] &= ~((dev->regs[0x2d] & 0x20) ? 0x40 : 0x20);
if (valxor)
ali5123_serial_handler(dev, 1);
ali5123_serial_handler(dev, (dev->regs[0x2d] & 0x20) ? 2 : 1);
break;
}
break;
@@ -384,9 +382,9 @@ ali5123_write(uint16_t port, uint8_t val, void *priv)
case 0x70:
case 0xf0:
if ((dev->cur_reg == 0x30) && (val & 0x01))
dev->regs[0x22] |= 0x40;
dev->regs[0x22] &= ~((dev->regs[0x2d] & 0x20) ? 0x20 : 0x40);
if (valxor)
ali5123_serial_handler(dev, 2);
ali5123_serial_handler(dev, (dev->regs[0x2d] & 0x20) ? 1 : 2);
break;
}
break;
@@ -411,11 +409,6 @@ ali5123_read(uint16_t port, void *priv)
ret = dev->regs[dev->cur_reg];
} else {
cur_ld = dev->regs[7];
if ((dev->regs[7] == 5) && (dev->regs[0x2d] & 0x20))
cur_ld = 0x0b;
else if ((dev->regs[7] == 0x0b) && (dev->regs[0x2d] & 0x20))
cur_ld = 5;
ret = dev->ld_regs[cur_ld][dev->cur_reg];
}
}

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (přesnější)"
#define STR_FM_DRV_YMFM "YMFM (rychlejší)"
#define STR_NET_TYPE "Druh sítě:"
#define STR_NET_TYPE "Druh sítě:"
#define STR_PCAP "PCap zařízení:"
#define STR_NET "Síťový adaptér:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Zařízení na COM1:"
#define STR_COM2 "Zařízení na COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (genauer)"
#define STR_FM_DRV_YMFM "YMFM (schneller)"
#define STR_NET_TYPE "Netzwerktyp:"
#define STR_NET_TYPE "Netzwerktyp:"
#define STR_PCAP "PCap-Gerät:"
#define STR_NET "Netzwerkadapter:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1-Gerät:"
#define STR_COM2 "COM2-Gerät:"

View File

@@ -397,22 +397,22 @@ FONT FONT_SIZE, FONT_NAME
BEGIN
LTEXT STR_NET_TYPE, IDT_NET_TYPE,
CFG_HMARGIN, CFG_VMARGIN, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
COMBOBOX IDC_COMBO_NET_TYPE,
COMBOBOX IDC_COMBO_NET1_TYPE,
CFG_COMBO_BOX_LEFT, 7, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT STR_PCAP, IDT_PCAP,
CFG_HMARGIN, 28, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
COMBOBOX IDC_COMBO_PCAP,
COMBOBOX IDC_COMBO_PCAP1,
CFG_COMBO_BOX_LEFT, 26, CFG_COMBO_NOBTN_WIDTH, CFG_COMBO_HEIGHT,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
LTEXT STR_NET, IDT_NET,
CFG_HMARGIN, 47, CFG_PANE_LTEXT_PRI_WIDTH, CFG_PANE_LTEXT_HEIGHT
COMBOBOX IDC_COMBO_NET,
COMBOBOX IDC_COMBO_NET1,
CFG_COMBO_BOX_LEFT, 45, CFG_COMBO_BTN_WIDTH, CFG_COMBO_HEIGHT,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_NET,
PUSHBUTTON STR_CONFIGURE, IDC_CONFIGURE_NET1,
CFG_COMBO_BTN_LEFT, 44, CFG_BTN_WIDTH, CFG_BTN_HEIGHT
END

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (more accurate)"
#define STR_FM_DRV_YMFM "YMFM (faster)"
#define STR_NET_TYPE "Network type:"
#define STR_NET_TYPE "Network type:"
#define STR_PCAP "PCap device:"
#define STR_NET "Network adapter:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 Device:"
#define STR_COM2 "COM2 Device:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (more accurate)"
#define STR_FM_DRV_YMFM "YMFM (faster)"
#define STR_NET_TYPE "Network type:"
#define STR_NET_TYPE "Network type:"
#define STR_PCAP "PCap device:"
#define STR_NET "Network adapter:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 Device:"
#define STR_COM2 "COM2 Device:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (más preciso)"
#define STR_FM_DRV_YMFM "YMFM (más rápido)"
#define STR_NET_TYPE "Tipo de red:"
#define STR_NET_TYPE "Tipo de red:"
#define STR_PCAP "Dispositivo PCap:"
#define STR_NET "Adaptador de red:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Dispositivo COM1:"
#define STR_COM2 "Dispositivo COM2:"

View File

@@ -301,6 +301,10 @@ END
#define STR_NET_TYPE "Verkon tyyppi:"
#define STR_PCAP "PCap-laite:"
#define STR_NET "Verkkokortti:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1-laite:"
#define STR_COM2 "COM2-laite:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (plus précis)"
#define STR_FM_DRV_YMFM "YMFM (plus rapide)"
#define STR_NET_TYPE "Type de réseau:"
#define STR_NET_TYPE "Type de réseau:"
#define STR_PCAP "Dispositif PCap:"
#define STR_NET "Adaptateur de réseau:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Dispositif COM1:"
#define STR_COM2 "Dispositif COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (precizniji)"
#define STR_FM_DRV_YMFM "YMFM (brži)"
#define STR_NET_TYPE "Tip mreže:"
#define STR_NET_TYPE "Tip mreže:"
#define STR_PCAP "Uređaj PCap:"
#define STR_NET "Mrežna kartica:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Uređaj COM1:"
#define STR_COM2 "Uređaj COM2:"

View File

@@ -303,9 +303,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (pontosabb)"
#define STR_FM_DRV_YMFM "YMFM (gyorsabb)"
#define STR_NET_TYPE "Hálózati típusa:"
#define STR_NET_TYPE "Hálózati típusa:"
#define STR_PCAP "PCap eszköz:"
#define STR_NET "Hálózati kártya:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 eszköz:"
#define STR_COM2 "COM2 eszköz:"

View File

@@ -299,9 +299,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (più accurato)"
#define STR_FM_DRV_YMFM "YMFM (più veloce)"
#define STR_NET_TYPE "Tipo di rete:"
#define STR_NET_TYPE "Tipo di rete:"
#define STR_PCAP "Dispositivo PCap:"
#define STR_NET "Scheda di rete:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Dispositivo COM1:"
#define STR_COM2 "Dispositivo COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (高精度化)"
#define STR_FM_DRV_YMFM "YMFM (より速く)"
#define STR_NET_TYPE "ネットワークタイプ:"
#define STR_NET_TYPE "ネットワークタイプ:"
#define STR_PCAP "PCapデバイス:"
#define STR_NET "ネットワークアダプター:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1デバイス:"
#define STR_COM2 "COM2デバイス:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (더 정확한)"
#define STR_FM_DRV_YMFM "YMFM (더 빠르게)"
#define STR_NET_TYPE "네트워크 종류:"
#define STR_NET_TYPE "네트워크 종류:"
#define STR_PCAP "PCap 장치:"
#define STR_NET "네트워크 어댑터:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 장치:"
#define STR_COM2 "COM2 장치:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (dokładniejszy)"
#define STR_FM_DRV_YMFM "YMFM (szybszy)"
#define STR_NET_TYPE "Rodzaj sieci:"
#define STR_NET_TYPE "Rodzaj sieci:"
#define STR_PCAP "Urządzenie PCap:"
#define STR_NET "Karta sieciowa:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Urządzenie COM1:"
#define STR_COM2 "Urządzenie COM2:"

View File

@@ -109,7 +109,7 @@ BEGIN
MENUITEM "&Preferências...", IDM_PREFERENCES
#ifdef DISCORD
MENUITEM "Ativar integração com o &Discord", IDM_DISCORD
#endif DISCORD
#endif
MENUITEM SEPARATOR
MENUITEM "&Ganho de som...", IDM_SND_GAIN
#ifdef MTR_ENABLED
@@ -304,6 +304,10 @@ END
#define STR_NET_TYPE "Tipo de rede:"
#define STR_PCAP "Dispositivo PCap:"
#define STR_NET "Adaptador de rede:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Dispositivo COM1:"
#define STR_COM2 "Dispositivo COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (mais exacto)"
#define STR_FM_DRV_YMFM "YMFM (mais rápido)"
#define STR_NET_TYPE "Tipo de rede:"
#define STR_NET_TYPE "Tipo de rede:"
#define STR_PCAP "Dispositivo PCap:"
#define STR_NET "Placa de rede:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Dispositivo COM1:"
#define STR_COM2 "Dispositivo COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (более точный)"
#define STR_FM_DRV_YMFM "YMFM (быстрей)"
#define STR_NET_TYPE "Тип сети:"
#define STR_NET_TYPE "Тип сети:"
#define STR_PCAP "Устройство PCap:"
#define STR_NET "Сетевая карта:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Устройство COM1:"
#define STR_COM2 "Устройство COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (točnejši)"
#define STR_FM_DRV_YMFM "YMFM (hitrejši)"
#define STR_NET_TYPE "Vrsta omrežja:"
#define STR_NET_TYPE "Vrsta omrežja:"
#define STR_PCAP "Naprava PCap:"
#define STR_NET "Omrežna kartica:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Naprava COM1:"
#define STR_COM2 "Naprava COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (daha doğru)"
#define STR_FM_DRV_YMFM "YMFM (daha hızlı)"
#define STR_NET_TYPE "Ağ tipi:"
#define STR_NET_TYPE "Ağ tipi:"
#define STR_PCAP "PCap cihazı:"
#define STR_NET "Ağ cihazı:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 Cihazı:"
#define STR_COM2 "COM2 Cihazı:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (більш точний)"
#define STR_FM_DRV_YMFM "YMFM (швидший)"
#define STR_NET_TYPE "Тип мережі:"
#define STR_NET_TYPE "Тип мережі:"
#define STR_PCAP "Пристрій PCap:"
#define STR_NET "Мережева карта:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "Пристрій COM1:"
#define STR_COM2 "Пристрій COM2:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (更准确)"
#define STR_FM_DRV_YMFM "YMFM (更快)"
#define STR_NET_TYPE "网络类型:"
#define STR_NET_TYPE "网络类型:"
#define STR_PCAP "PCap 设备:"
#define STR_NET "网络适配器:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 设备:"
#define STR_COM2 "COM2 设备:"

View File

@@ -298,9 +298,13 @@ END
#define STR_FM_DRV_NUKED "Nuked (更準確)"
#define STR_FM_DRV_YMFM "YMFM (更快)"
#define STR_NET_TYPE "網路類型:"
#define STR_NET_TYPE "網路類型:"
#define STR_PCAP "PCap 裝置:"
#define STR_NET "網路配接器:"
#define STR_NET1 "Network card 1:"
#define STR_NET2 "Network card 2:"
#define STR_NET3 "Network card 3:"
#define STR_NET4 "Network card 4:"
#define STR_COM1 "COM1 裝置:"
#define STR_COM2 "COM2 裝置:"

View File

@@ -104,8 +104,9 @@ static int temp_midi_output_device, temp_midi_input_device, temp_mpu401;
static int temp_float, temp_fm_driver;
/* Network category */
static int temp_net_type, temp_net_card;
static char temp_pcap_dev[128];
static int temp_net_type[NET_CARD_MAX];
static int temp_net_card[NET_CARD_MAX];
static char temp_pcap_dev[NET_CARD_MAX][128];
/* Ports category */
static int temp_lpt_devices[PARALLEL_MAX];
@@ -345,13 +346,15 @@ win_settings_init(void)
temp_fm_driver = fm_driver;
/* Network category */
temp_net_type = net_cards_conf[0].net_type;
memset(temp_pcap_dev, 0, sizeof(temp_pcap_dev));
#ifdef ENABLE_SETTINGS_LOG
assert(sizeof(temp_pcap_dev) == sizeof(net_cards_conf[0].host_dev_name));
#endif
memcpy(temp_pcap_dev, net_cards_conf[0].host_dev_name, sizeof(net_cards_conf[0].host_dev_name));
temp_net_card = net_cards_conf[0].device_num;
for (i = 0; i < NET_CARD_MAX; i++) {
temp_net_type[i] = net_cards_conf[i].net_type;
memset(temp_pcap_dev[i], 0, sizeof(temp_pcap_dev[i]));
# ifdef ENABLE_SETTINGS_LOG
assert(sizeof(temp_pcap_dev[i]) == sizeof(net_cards_conf[i].host_dev_name));
# endif
memcpy(temp_pcap_dev[i], net_cards_conf[i].host_dev_name, sizeof(net_cards_conf[i].host_dev_name));
temp_net_card[i] = net_cards_conf[i].device_num;
}
/* Ports category */
for (i = 0; i < PARALLEL_MAX; i++) {
@@ -470,9 +473,11 @@ win_settings_changed(void)
i = i || (fm_driver != temp_fm_driver);
/* Network category */
i = i || (net_cards_conf[i].net_type != temp_net_type);
i = i || strcmp(temp_pcap_dev, net_cards_conf[0].host_dev_name);
i = i || (net_cards_conf[0].device_num != temp_net_card);
for (j = 0; j < NET_CARD_MAX; j++) {
i = i || (net_cards_conf[j].net_type != temp_net_type[j]);
i = i || strcmp(temp_pcap_dev[j], net_cards_conf[j].host_dev_name);
i = i || (net_cards_conf[j].device_num != temp_net_card[j]);
}
/* Ports category */
for (j = 0; j < PARALLEL_MAX; j++) {
@@ -561,10 +566,12 @@ win_settings_save(void)
fm_driver = temp_fm_driver;
/* Network category */
net_cards_conf[i].net_type = temp_net_type;
memset(net_cards_conf[0].host_dev_name, '\0', sizeof(net_cards_conf[0].host_dev_name));
strcpy(net_cards_conf[0].host_dev_name, temp_pcap_dev);
net_cards_conf[0].device_num = temp_net_card;
for (i = 0; i < NET_CARD_MAX; i++) {
net_cards_conf[i].net_type = temp_net_type[i];
memset(net_cards_conf[i].host_dev_name, '\0', sizeof(net_cards_conf[i].host_dev_name));
strcpy(net_cards_conf[i].host_dev_name, temp_pcap_dev[i]);
net_cards_conf[i].device_num = temp_net_card[i];
}
/* Ports category */
for (i = 0; i < PARALLEL_MAX; i++) {
@@ -2003,10 +2010,16 @@ network_recalc_combos(HWND hdlg)
{
ignore_change = 1;
settings_enable_window(hdlg, IDC_COMBO_PCAP, temp_net_type == NET_TYPE_PCAP);
settings_enable_window(hdlg, IDC_COMBO_NET,
(temp_net_type == NET_TYPE_SLIRP) || ((temp_net_type == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev) > 0)));
settings_enable_window(hdlg, IDC_CONFIGURE_NET, network_card_has_config(temp_net_card) && ((temp_net_type == NET_TYPE_SLIRP) || ((temp_net_type == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev) > 0))));
#if 0
for (uint8_t i = 0; i < NET_CARD_MAX; i++) {
#endif
settings_enable_window(hdlg, IDC_COMBO_PCAP1, temp_net_type[0] == NET_TYPE_PCAP);
settings_enable_window(hdlg, IDC_COMBO_NET1,
(temp_net_type[0] == NET_TYPE_SLIRP) || ((temp_net_type[0] == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev[0]) > 0)));
settings_enable_window(hdlg, IDC_CONFIGURE_NET1, network_card_has_config(temp_net_card[0]) && ((temp_net_type[0] == NET_TYPE_SLIRP) || ((temp_net_type[0] == NET_TYPE_PCAP) && (network_dev_to_id(temp_pcap_dev[0]) > 0))));
#if 0
}
#endif
ignore_change = 0;
}
@@ -2025,90 +2038,120 @@ win_settings_network_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
case WM_INITDIALOG:
lptsTemp = (LPTSTR) malloc(512 * sizeof(WCHAR));
settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"None");
settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"SLiRP");
settings_add_string(hdlg, IDC_COMBO_NET_TYPE, (LPARAM) L"PCap");
settings_set_cur_sel(hdlg, IDC_COMBO_NET_TYPE, temp_net_type);
settings_enable_window(hdlg, IDC_COMBO_PCAP, temp_net_type == NET_TYPE_PCAP);
#if 0
for (uint8_t i = 0; i < NET_CARD_MAX; i++) {
#endif
settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"None");
settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"SLiRP");
settings_add_string(hdlg, IDC_COMBO_NET1_TYPE, (LPARAM) L"PCap");
settings_set_cur_sel(hdlg, IDC_COMBO_NET1_TYPE, temp_net_type[0]);
settings_enable_window(hdlg, IDC_COMBO_PCAP1, temp_net_type[0] == NET_TYPE_PCAP);
for (c = 0; c < network_ndev; c++) {
mbstowcs(lptsTemp, network_devs[c].description, strlen(network_devs[c].description) + 1);
settings_add_string(hdlg, IDC_COMBO_PCAP, (LPARAM) lptsTemp);
}
settings_set_cur_sel(hdlg, IDC_COMBO_PCAP, network_dev_to_id(temp_pcap_dev));
for (c = 0; c < network_ndev; c++) {
mbstowcs(lptsTemp, network_devs[c].description, strlen(network_devs[c].description) + 1);
settings_add_string(hdlg, IDC_COMBO_PCAP1, (LPARAM) lptsTemp);
}
settings_set_cur_sel(hdlg, IDC_COMBO_PCAP1, network_dev_to_id(temp_pcap_dev[0]));
/* NIC config */
c = d = 0;
settings_reset_content(hdlg, IDC_COMBO_NET);
while (1) {
generate_device_name(network_card_getdevice(c), network_card_get_internal_name(c), 1);
/* NIC config */
c = d = 0;
settings_reset_content(hdlg, IDC_COMBO_NET1);
while (1) {
generate_device_name(network_card_getdevice(c), network_card_get_internal_name(c), 1);
if (device_name[0] == L'\0')
break;
if (device_name[0] == L'\0')
break;
if (network_card_available(c) && device_is_valid(network_card_getdevice(c), temp_machine)) {
if (c == 0)
settings_add_string(hdlg, IDC_COMBO_NET, win_get_string(IDS_2104));
else
settings_add_string(hdlg, IDC_COMBO_NET, (LPARAM) device_name);
settings_list_to_device[0][d] = c;
if ((c == 0) || (c == temp_net_card))
settings_set_cur_sel(hdlg, IDC_COMBO_NET, d);
d++;
if (network_card_available(c) && device_is_valid(network_card_getdevice(c), temp_machine)) {
if (c == 0)
settings_add_string(hdlg, IDC_COMBO_NET1, win_get_string(IDS_2104));
else
settings_add_string(hdlg, IDC_COMBO_NET1, (LPARAM) device_name);
settings_list_to_device[0][d] = c;
if ((c == 0) || (c == temp_net_card[0]))
settings_set_cur_sel(hdlg, IDC_COMBO_NET1, d);
d++;
}
c++;
}
c++;
settings_enable_window(hdlg, IDC_COMBO_NET1, d);
network_recalc_combos(hdlg);
free(lptsTemp);
#if 0
}
settings_enable_window(hdlg, IDC_COMBO_NET, d);
network_recalc_combos(hdlg);
free(lptsTemp);
#endif
return TRUE;
case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_COMBO_NET_TYPE:
case IDC_COMBO_NET1_TYPE:
#if 0
case IDC_COMBO_NET2_TYPE:
case IDC_COMBO_NET3_TYPE:
case IDC_COMBO_NET4_TYPE:
#endif
if (ignore_change)
return FALSE;
temp_net_type = settings_get_cur_sel(hdlg, IDC_COMBO_NET_TYPE);
temp_net_type[0] = settings_get_cur_sel(hdlg, IDC_COMBO_NET1_TYPE);
network_recalc_combos(hdlg);
break;
case IDC_COMBO_PCAP:
case IDC_COMBO_PCAP1:
#if 0
case IDC_COMBO_PCAP2:
case IDC_COMBO_PCAP3:
case IDC_COMBO_PCAP4:
#endif
if (ignore_change)
return FALSE;
memset(temp_pcap_dev, '\0', sizeof(temp_pcap_dev));
strcpy(temp_pcap_dev, network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP)].device);
memset(temp_pcap_dev[0], '\0', sizeof(temp_pcap_dev[0]));
strcpy(temp_pcap_dev[0], network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP1)].device);
network_recalc_combos(hdlg);
break;
case IDC_COMBO_NET:
case IDC_COMBO_NET1:
#if 0
case IDC_COMBO_NET2:
case IDC_COMBO_NET3:
case IDC_COMBO_NET4:
#endif
if (ignore_change)
return FALSE;
temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)];
temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)];
network_recalc_combos(hdlg);
break;
case IDC_CONFIGURE_NET:
case IDC_CONFIGURE_NET1:
#if 0
case IDC_CONFIGURE_NET2:
case IDC_CONFIGURE_NET3:
case IDC_CONFIGURE_NET4:
#endif
if (ignore_change)
return FALSE;
temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) network_card_getdevice(temp_net_card));
temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)];
temp_deviceconfig |= deviceconfig_open(hdlg, (void *) network_card_getdevice(temp_net_card[0]));
break;
}
return FALSE;
case WM_SAVESETTINGS:
temp_net_type = settings_get_cur_sel(hdlg, IDC_COMBO_NET_TYPE);
memset(temp_pcap_dev, '\0', sizeof(temp_pcap_dev));
strcpy(temp_pcap_dev, network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP)].device);
temp_net_card = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET)];
#if 0
for (uint8_t i = 0; i < NET_CARD_MAX; i++) {
#endif
temp_net_type[0] = settings_get_cur_sel(hdlg, IDC_COMBO_NET1_TYPE);
memset(temp_pcap_dev[0], '\0', sizeof(temp_pcap_dev[0]));
strcpy(temp_pcap_dev[0], network_devs[settings_get_cur_sel(hdlg, IDC_COMBO_PCAP1)].device);
temp_net_card[0] = settings_list_to_device[0][settings_get_cur_sel(hdlg, IDC_COMBO_NET1)];
#if 0
}
#endif
default:
return FALSE;
}