Hard drive creation dialogue can now accept size in MB instead of/as well as specifying C/H/S settings.

This commit is contained in:
SarahW 2018-02-28 18:38:45 +00:00
commit b75c8376e6
3 changed files with 66 additions and 46 deletions

View file

@ -2274,7 +2274,7 @@
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>5</border>
<object class="wxStaticText">
<label>Size:</label>
<label>Size (MB):</label>
<wrap>-1</wrap>
</object>
</object>
@ -2282,9 +2282,8 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL|wxALL</flag>
<border>5</border>
<object class="wxStaticText" name="IDC_TEXT1">
<label>0mb</label>
<wrap>-1</wrap>
<object class="wxTextCtrl" name="IDC_EDIT4">
<value></value>
</object>
</object>
</object>

View file

@ -1376,6 +1376,7 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l
PcemHDC hd[4];
FILE *f;
int hd_type;
int size;
switch (message)
{
@ -1393,8 +1394,8 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDITC"));
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)"");
h = wx_getdlgitem(hdlg, WX_ID("IDC_TEXT1"));
sprintf(s, "%imb", (((511*16*63)*512)/1024)/1024);
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT4"));
sprintf(s, "%i", (((511*16*63)*512)/1024)/1024);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
// hd_type = 0;
@ -1481,8 +1482,8 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l
pclog("EDIT3: %s\n", s);
sscanf(s, "%i", &hd[0].tracks);
h = wx_getdlgitem(hdlg, WX_ID("IDC_TEXT1"));
sprintf(s, "%imb", (int)(((((uint64_t)hd[0].tracks*(uint64_t)hd[0].hpc)*(uint64_t)hd[0].spt)*512)/1024)/1024);
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT4"));
sprintf(s, "%i", (int)(((((uint64_t)hd[0].tracks*(uint64_t)hd[0].hpc)*(uint64_t)hd[0].spt)*512)/1024)/1024);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
hd_type = 0;
@ -1499,7 +1500,29 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l
wx_sendmessage(h, WX_CB_SETCURSEL, hd_type, 0);
return TRUE;
} else if (ID_IS("IDC_HDTYPE")) {
}
else if (ID_IS("IDC_EDIT4"))
{
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT4"));
wx_sendmessage(h, WX_WM_GETTEXT, 255, (LONG_PARAM)s);
pclog("EDIT4: %s\n", s);
sscanf(s, "%i", &size);
hd[0].spt = 63;
hd[0].hpc = 16;
hd[0].tracks = (int)(((int64_t)size * 1024 * 1024) / (16 * 63 * 512));
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT1"));
sprintf(s, "%i", 63);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT2"));
sprintf(s, "%i", 16);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT3"));
sprintf(s, "%i", hd[0].tracks);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
}
else if (ID_IS("IDC_HDTYPE")) {
h = wx_getdlgitem(hdlg, WX_ID("IDC_HDTYPE"));
hd_type = wx_sendmessage(h, WX_CB_GETCURSEL, 0, 0);
if (hd_type)
@ -1513,8 +1536,8 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT1"));
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)"17");
h = wx_getdlgitem(hdlg, WX_ID("IDC_TEXT1"));
sprintf(s, "%imb", (int)(((uint64_t)hd_types[hd_type-1].cylinders*hd_types[hd_type-1].heads*17*512)/1024)/1024);
h = wx_getdlgitem(hdlg, WX_ID("IDC_EDIT4"));
sprintf(s, "%i", (int)(((uint64_t)hd_types[hd_type-1].cylinders*hd_types[hd_type-1].heads*17*512)/1024)/1024);
wx_sendmessage(h, WX_WM_SETTEXT, 0, (LONG_PARAM)s);
}
return TRUE;

View file

@ -1784,7 +1784,7 @@ static unsigned char xml_res_file_25[] = {
87,93,129,205,251,40,255,176,89,15,134,167,154,149,127,4,24,0,227,17,114,
29,252,169,144,138,0,0,0,0,73,69,78,68,174,66,96,130};
static size_t xml_res_size_26 = 132032;
static size_t xml_res_size_26 = 131989;
static unsigned char xml_res_file_26[] = {
60,63,120,109,108,32,118,101,114,115,105,111,110,61,34,49,46,48,34,32,101,
110,99,111,100,105,110,103,61,34,85,84,70,45,56,34,63,62,10,60,33,45,45,
@ -6355,41 +6355,39 @@ static unsigned char xml_res_file_26[] = {
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,101,
99,116,32,99,108,97,115,115,61,34,119,120,83,116,97,116,105,99,84,101,120,
116,34,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
60,108,97,98,101,108,62,83,105,122,101,58,60,47,108,97,98,101,108,62,10,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,119,114,
97,112,62,45,49,60,47,119,114,97,112,62,10,32,32,32,32,32,32,32,32,32,32,
32,32,32,32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,101,99,116,32,99,
108,97,115,115,61,34,115,105,122,101,114,105,116,101,109,34,62,10,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,112,116,105,111,
110,62,48,60,47,111,112,116,105,111,110,62,10,32,32,32,32,32,32,32,32,32,
32,32,32,32,32,32,32,32,32,60,102,108,97,103,62,119,120,65,76,73,71,78,
95,67,69,78,84,69,82,95,86,69,82,84,73,67,65,76,124,119,120,65,76,76,60,
47,102,108,97,103,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
60,108,97,98,101,108,62,83,105,122,101,32,40,77,66,41,58,60,47,108,97,98,
101,108,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
32,60,119,114,97,112,62,45,49,60,47,119,114,97,112,62,10,32,32,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,47,111,98,106,101,99,
116,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,
101,99,116,32,99,108,97,115,115,61,34,115,105,122,101,114,105,116,101,109,
34,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,112,
116,105,111,110,62,48,60,47,111,112,116,105,111,110,62,10,32,32,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,60,102,108,97,103,62,119,120,65,
76,73,71,78,95,67,69,78,84,69,82,95,86,69,82,84,73,67,65,76,124,119,120,
65,76,76,60,47,102,108,97,103,62,10,32,32,32,32,32,32,32,32,32,32,32,32,
32,32,32,32,32,32,60,98,111,114,100,101,114,62,53,60,47,98,111,114,100,
101,114,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,
111,98,106,101,99,116,32,99,108,97,115,115,61,34,119,120,84,101,120,116,
67,116,114,108,34,32,110,97,109,101,61,34,73,68,67,95,69,68,73,84,52,34,
62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,118,
97,108,117,101,47,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,32,
32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,
32,32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,
32,32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,
32,32,32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,61,34,115,112,
97,99,101,114,34,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,
112,116,105,111,110,62,49,60,47,111,112,116,105,111,110,62,10,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,60,102,108,97,103,62,119,120,69,88,80,
65,78,68,60,47,102,108,97,103,62,10,32,32,32,32,32,32,32,32,32,32,32,32,
32,32,60,98,111,114,100,101,114,62,53,60,47,98,111,114,100,101,114,62,10,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,101,
99,116,32,99,108,97,115,115,61,34,119,120,83,116,97,116,105,99,84,101,120,
116,34,32,110,97,109,101,61,34,73,68,67,95,84,69,88,84,49,34,62,10,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,108,97,98,101,
108,62,48,109,98,60,47,108,97,98,101,108,62,10,32,32,32,32,32,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,32,60,119,114,97,112,62,45,49,60,47,119,
114,97,112,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,
60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,
32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,
32,32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,
32,32,32,60,47,111,98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,
32,32,60,111,98,106,101,99,116,32,99,108,97,115,115,61,34,115,112,97,99,
101,114,34,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,112,116,
105,111,110,62,49,60,47,111,112,116,105,111,110,62,10,32,32,32,32,32,32,
32,32,32,32,32,32,32,32,60,102,108,97,103,62,119,120,69,88,80,65,78,68,
60,47,102,108,97,103,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,
98,111,114,100,101,114,62,53,60,47,98,111,114,100,101,114,62,10,32,32,32,
32,32,32,32,32,32,32,32,32,32,32,60,115,105,122,101,62,48,44,48,60,47,115,
105,122,101,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,47,111,98,106,
101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,101,
99,116,32,99,108,97,115,115,61,34,115,105,122,101,114,105,116,101,109,34,
62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,112,116,105,111,
32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,115,105,122,101,62,48,44,48,
60,47,115,105,122,101,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,47,111,
98,106,101,99,116,62,10,32,32,32,32,32,32,32,32,32,32,32,32,60,111,98,106,
101,99,116,32,99,108,97,115,115,61,34,115,105,122,101,114,105,116,101,109,
34,62,10,32,32,32,32,32,32,32,32,32,32,32,32,32,32,60,111,112,116,105,111,
110,62,48,60,47,111,112,116,105,111,110,62,10,32,32,32,32,32,32,32,32,32,
32,32,32,32,32,60,102,108,97,103,62,119,120,65,76,76,32,124,32,119,120,
65,76,73,71,78,95,67,69,78,84,69,82,95,86,69,82,84,73,67,65,76,60,47,102,