Initial release of the ISA Memory Expansion Card driver. Not done yet, but works.

This commit is contained in:
waltje
2018-08-25 14:52:23 -04:00
parent d4a9d52bd7
commit f6eae8c658
11 changed files with 1261 additions and 106 deletions

View File

@@ -8,7 +8,7 @@
*
* Common resources for the application.
*
* Version: @(#)VARCem-common.rc 1.0.6 2018/06/06
* Version: @(#)VARCem-common.rc 1.0.7 2018/08/18
*
* Author: Fred N. van Kempen, <decwiz@yahoo.com>
*
@@ -423,7 +423,7 @@ BEGIN
BS_AUTOCHECKBOX | WS_TABSTOP,7,107,110,10
END
DLG_CFG_PERIPHERALS DIALOG 97, 0, 267, 97
DLG_CFG_PERIPHERALS DIALOG 97, 0, 267, 180
STYLE DS_CONTROL | WS_CHILD
FONT 9, FONT_NAME
BEGIN
@@ -447,6 +447,24 @@ BEGIN
CONTROL STR_3479,IDC_CHECK_BUGGER,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,7,80,94,10
GROUPBOX "ISA Memory Expansion",IDC_GROUP_ISAMEM,7,99,255,70
LTEXT "#1:",IDT_1763,12,111,21,10
COMBOBOX IDC_COMBO_ISAMEM_1,25,110,180,120,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_1,209,110,46,12
LTEXT "#2:",IDT_1764,12,125,21,10
COMBOBOX IDC_COMBO_ISAMEM_2,25,124,180,120,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_2,209,124,46,12
LTEXT "#3:",IDT_1765,12,139,21,10
COMBOBOX IDC_COMBO_ISAMEM_3,25,138,180,120,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_3,209,138,46,12
LTEXT "#4:",IDT_1766,12,153,21,10
COMBOBOX IDC_COMBO_ISAMEM_4,25,152,180,120,
CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON STR_CONFIGURE,IDC_CONFIGURE_ISAMEM_4,209,152,46,12
END
DLG_CFG_DISK DIALOG 97, 0, 267, 154

View File

@@ -8,7 +8,7 @@
#
# Makefile for Windows systems using the MinGW32 environment.
#
# Version: @(#)Makefile.mingw 1.0.50 2018/07/28
# Version: @(#)Makefile.mingw 1.0.51 2018/08/14
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
@@ -603,6 +603,7 @@ INTELOBJ := intel.o \
intel_piix.o intel_piix4.o
DEVOBJ := bugger.o \
isamem.o \
game.o game_dev.o \
parallel.o parallel_dev.o serial.o \
sio_fdc37c66x.o sio_fdc37c669.o sio_fdc37c93x.o \

View File

@@ -8,7 +8,7 @@
#
# Makefile for Windows using Visual Studio 2015.
#
# Version: @(#)Makefile.VC 1.0.37 2018/07/28
# Version: @(#)Makefile.VC 1.0.38 2018/08/12
#
# Author: Fred N. van Kempen, <decwiz@yahoo.com>
#
@@ -573,6 +573,7 @@ INTELOBJ := intel.obj \
intel_piix.obj intel_piix4.obj
DEVOBJ := bugger.obj \
isamem.obj \
game.obj game_dev.obj \
parallel.obj parallel_dev.obj serial.obj \
sio_fdc37c66x.obj sio_fdc37c669.obj sio_fdc37c93x.obj \

View File

@@ -8,7 +8,7 @@
*
* Windows resource defines.
*
* Version: @(#)resource.h 1.0.16 2018/05/28
* Version: @(#)resource.h 1.0.17 2018/08/18
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -113,6 +113,10 @@
#define IDT_1758 1758 /* ZIP drives: */
#define IDT_1761 1761 /* Speed: */
#define IDT_1762 1762 /* ZIP drives: */
#define IDT_1763 1763 /* Board #1: */
#define IDT_1764 1764 /* Board #2: */
#define IDT_1765 1765 /* Board #3: */
#define IDT_1766 1766 /* Board #4: */
#define IDT_TITLE 1790 /* "VARCem for Plaform" */
#define IDT_VERSION 1791 /* "version.." */
@@ -183,49 +187,60 @@
#define IDC_COMBO_IDE_TER 1125
#define IDC_COMBO_IDE_QUA 1126
#define IDC_CHECK_BUGGER 1127
#define IDC_CONFIGURE_BUGGER 1128
#define IDC_HARD_DISKS 1130 /* hard disk 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_GROUP_ISAMEM 1140
#define IDC_COMBO_ISAMEM_1 1141
#define IDC_COMBO_ISAMEM_2 1142
#define IDC_COMBO_ISAMEM_3 1143
#define IDC_COMBO_ISAMEM_4 1144
#define IDC_CONFIGURE_ISAMEM_1 1145
#define IDC_CONFIGURE_ISAMEM_2 1146
#define IDC_CONFIGURE_ISAMEM_3 1147
#define IDC_CONFIGURE_ISAMEM_4 1148
#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_HARD_DISKS 1150 /* hard disk config */
#define IDC_LIST_HARD_DISKS 1151
#define IDC_BUTTON_HDD_ADD_NEW 1152
#define IDC_BUTTON_HDD_ADD 1153
#define IDC_BUTTON_HDD_REMOVE 1154
#define IDC_COMBO_HD_BUS 1155
#define IDC_COMBO_HD_CHANNEL 1156
#define IDC_COMBO_HD_ID 1157
#define IDC_COMBO_HD_LUN 1158
#define IDC_COMBO_HD_CHANNEL_IDE 1159
#define IDC_REMOV_DEVICES 1150 /* removable dev 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_LIST_ZIP_DRIVES 1160
#define IDC_COMBO_ZIP_BUS 1161
#define IDC_COMBO_ZIP_ID 1162
#define IDC_COMBO_ZIP_LUN 1163
#define IDC_COMBO_ZIP_CHANNEL_IDE 1164
#define IDC_CHECK250 1165
#define IDC_COMBO_CD_SPEED 1166
#define IDC_EDIT_HD_FILE_NAME 1160 /* add hard disk dialog */
#define IDC_EDIT_HD_SPT 1161
#define IDC_EDIT_HD_HPC 1162
#define IDC_EDIT_HD_CYL 1163
#define IDC_EDIT_HD_SIZE 1164
#define IDC_COMBO_HD_TYPE 1165
#define IDC_PBAR_IMG_CREATE 1166
#define IDC_SLIDER_GAIN 1180 /* sound gain dialog */
#define IDC_REMOV_DEVICES 1170 /* removable dev config */
#define IDC_LIST_FLOPPY_DRIVES 1171
#define IDC_COMBO_FD_TYPE 1172
#define IDC_CHECKTURBO 1173
#define IDC_CHECKBPB 1174
#define IDC_LIST_CDROM_DRIVES 1175
#define IDC_COMBO_CD_BUS 1176
#define IDC_COMBO_CD_ID 1177
#define IDC_COMBO_CD_LUN 1178
#define IDC_COMBO_CD_CHANNEL_IDE 1179
#define IDC_LIST_ZIP_DRIVES 1180
#define IDC_COMBO_ZIP_BUS 1181
#define IDC_COMBO_ZIP_ID 1182
#define IDC_COMBO_ZIP_LUN 1183
#define IDC_COMBO_ZIP_CHANNEL_IDE 1184
#define IDC_CHECK250 1185
#define IDC_COMBO_CD_SPEED 1186
#define IDC_EDIT_FILE_NAME 1190 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1191
#define IDC_COMBO_RPM_MODE 1192
#define IDC_SLIDER_GAIN 1190 /* sound gain dialog */
#define IDC_EDIT_FILE_NAME 1195 /* new floppy image dialog */
#define IDC_COMBO_DISK_SIZE 1196
#define IDC_COMBO_RPM_MODE 1197
/* For the DeviceConfig code, re-do later. */

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Settings dialog.
*
* Version: @(#)win_settings.c 1.0.31 2018/05/24
* Version: @(#)win_settings.c 1.0.32 2018/08/18
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -58,6 +58,7 @@
#include "../devices/ports/parallel.h"
#include "../devices/ports/parallel_dev.h"
#include "../devices/ports/serial.h"
#include "../devices/misc/isamem.h"
#include "../devices/input/mouse.h"
#include "../devices/input/game/joystick.h"
#include "../devices/floppy/fdd.h"
@@ -112,7 +113,8 @@ static int temp_hdc_type,
temp_scsi_card,
temp_ide_ter, temp_ide_ter_irq,
temp_ide_qua, temp_ide_qua_irq;
static int temp_bugger;
static int temp_bugger,
temp_isamem[ISAMEM_MAX];
/* Floppy drives category. */
static int temp_fdd_types[FDD_NUM],
@@ -169,7 +171,7 @@ settings_msgbox(int type, void *arg)
static void
settings_init(void)
{
int i = 0;
int i;
/* Machine category */
temp_machine = machine;
@@ -223,8 +225,12 @@ settings_init(void)
temp_ide_qua_irq = ide_irq[3];
temp_bugger = bugger_enabled;
/* ISA memory boards. */
for (i = 0; i < ISAMEM_MAX; i++)
temp_isamem[i] = isamem_type[i];
/* Floppy drives category */
for (i=0; i<FDD_NUM; i++) {
for (i = 0; i < FDD_NUM; i++) {
temp_fdd_types[i] = fdd_get_type(i);
temp_fdd_turbo[i] = fdd_get_turbo(i);
temp_fdd_check_bpb[i] = fdd_get_check_bpb(i);
@@ -298,11 +304,15 @@ settings_changed(void)
i = i || (temp_ide_qua_irq != ide_irq[3]);
i = i || (temp_bugger != bugger_enabled);
/* ISA memory boards. */
for (j = 0; j < ISAMEM_MAX; j++)
i = i || (temp_isamem[j] != isamem_type[j]);
/* Hard disks category */
i = i || memcmp(hdd, temp_hdd, HDD_NUM * sizeof(hard_disk_t));
/* Floppy drives category */
for (j=0; j<FDD_NUM; j++) {
for (j = 0; j < FDD_NUM; j++) {
i = i || (temp_fdd_types[j] != fdd_get_type(j));
i = i || (temp_fdd_turbo[j] != fdd_get_turbo(j));
i = i || (temp_fdd_check_bpb[j] != fdd_get_check_bpb(j));
@@ -401,11 +411,15 @@ settings_save(void)
ide_irq[3] = temp_ide_qua_irq;
bugger_enabled = temp_bugger;
/* ISA memory boards. */
for (i = 0; i < ISAMEM_MAX; i++)
isamem_type[i] = temp_isamem[i];
/* Hard disks category */
memcpy(hdd, temp_hdd, HDD_NUM * sizeof(hard_disk_t));
/* Floppy drives category */
for (i=0; i<FDD_NUM; i++) {
for (i = 0; i < FDD_NUM; i++) {
fdd_set_type(i, temp_fdd_types[i]);
fdd_set_turbo(i, temp_fdd_turbo[i]);
fdd_set_check_bpb(i, temp_fdd_check_bpb[i]);
@@ -547,7 +561,7 @@ static BOOL
insert_categories(HWND hwndList)
{
LVITEM lvI;
int i = 0;
int i;
lvI.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
lvI.stateMask = lvI.iSubItem = lvI.state = 0;
@@ -592,16 +606,6 @@ dlg_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
image_list_init(h);
insert_categories(h);
ListView_SetItemState(h, 0, LVIS_FOCUSED|LVIS_SELECTED, 0x000F);
#if 0
/*Leave this commented out until we do localization. */
h = GetDlgItem(hdlg, IDC_COMBO_LANG); /* This is currently disabled, I am going to add localization options in the future. */
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
h = GetDlgItem(hdlg, IDS_LANG_ENUS); /*was:2047 !*/
EnableWindow(h, FALSE);
ShowWindow(h, SW_HIDE);
#endif
return(TRUE);
case WM_NOTIFY:

View File

@@ -8,7 +8,7 @@
*
* Implementation of the Settings dialog.
*
* Version: @(#)win_settings_periph.h 1.0.9 2018/05/29
* Version: @(#)win_settings_periph.h 1.0.10 2018/08/18
*
* Authors: Fred N. van Kempen, <decwiz@yahoo.com>
* Miran Grca, <mgrca8@gmail.com>
@@ -210,6 +210,38 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
h = GetDlgItem(hdlg, IDC_CHECK_BUGGER);
SendMessage(h, BM_SETCHECK, temp_bugger, 0);
/* Populate the ISA memory card dropdowns. */
for (c = 0; c < ISAMEM_MAX; c++) {
h = GetDlgItem(hdlg, IDC_COMBO_ISAMEM_1 + c);
d = 0;
for (;;) {
stransi = isamem_get_internal_name(d);
if (stransi == NULL)
break;
if (d == 0) {
/* Translate "None". */
SendMessage(h, CB_ADDSTRING, 0,
(LPARAM)get_string(IDS_NONE));
} else {
stransi = isamem_get_name(d);
mbstowcs(temp, stransi, sizeof_w(temp));
SendMessage(h, CB_ADDSTRING, 0, (LPARAM)temp);
}
d++;
}
SendMessage(h, CB_SETCURSEL, temp_isamem[c], 0);
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1 + c);
if (temp_isamem[c] != 0)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
}
return TRUE;
case WM_COMMAND:
@@ -249,6 +281,29 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
else
EnableWindow(h, FALSE);
break;
case IDC_COMBO_ISAMEM_1:
case IDC_COMBO_ISAMEM_2:
case IDC_COMBO_ISAMEM_3:
case IDC_COMBO_ISAMEM_4:
c = LOWORD(wParam) - IDC_COMBO_ISAMEM_1;
h = GetDlgItem(hdlg, LOWORD(wParam));
temp_isamem[c] = SendMessage(h, CB_GETCURSEL, 0, 0);
h = GetDlgItem(hdlg, IDC_CONFIGURE_ISAMEM_1 + c);
if (temp_isamem[c] != 0)
EnableWindow(h, TRUE);
else
EnableWindow(h, FALSE);
break;
case IDC_CONFIGURE_ISAMEM_1:
case IDC_CONFIGURE_ISAMEM_2:
case IDC_CONFIGURE_ISAMEM_3:
case IDC_CONFIGURE_ISAMEM_4:
c = LOWORD(wParam) - IDC_CONFIGURE_ISAMEM_1;
temp_deviceconfig |= dlg_devconf(hdlg, (void *)isamem_get_device(c));
break;
}
return FALSE;
@@ -279,6 +334,7 @@ peripherals_proc(HWND hdlg, UINT message, WPARAM wParam, LPARAM lParam)
h = GetDlgItem(hdlg, IDC_CHECK_BUGGER);
temp_bugger = SendMessage(h, BM_GETCHECK, 0, 0);
return FALSE;
default: