diff --git a/src/ide.c b/src/ide.c index 3f2b32e..3b738d7 100644 --- a/src/ide.c +++ b/src/ide.c @@ -164,7 +164,10 @@ static void ide_identify(IDE *ide) //ide->buffer[1] = 101; /* Cylinders */ - ide->buffer[1] = hdc[cur_ide[ide->board]].tracks; /* Cylinders */ + if ((hdc[cur_ide[ide->board]].tracks * hdc[cur_ide[ide->board]].hpc * hdc[cur_ide[ide->board]].spt) >= 16514064) + ide->buffer[1] = 16383; + else + ide->buffer[1] = hdc[cur_ide[ide->board]].tracks; /* Cylinders */ ide->buffer[3] = hdc[cur_ide[ide->board]].hpc; /* Heads */ ide->buffer[6] = hdc[cur_ide[ide->board]].spt; /* Sectors */ diff --git a/src/wx-config.c b/src/wx-config.c index 6ddd6ef..e539185 100644 --- a/src/wx-config.c +++ b/src/wx-config.c @@ -19,6 +19,8 @@ #include "video.h" #include "vid_voodoo.h" +//#define MAX_CYLINDERS ((((1 << 28)-1) / 16) / 63) +#define MAX_CYLINDERS 265264 /*Award 430VX won't POST with a larger drive*/ extern int pause; extern int is486; @@ -1435,9 +1437,11 @@ static int hdnew_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM l wx_messagebox(hdlg, "Drive has too many heads (maximum is 16)", "PCem error", WX_MB_OK); return TRUE; } - if (hd_new_cyl > 16383) + if (hd_new_cyl > MAX_CYLINDERS) { - wx_messagebox(hdlg, "Drive has too many cylinders (maximum is 16383)", "PCem error", WX_MB_OK); + char s[256]; + sprintf(s, "Drive has too many cylinders (maximum is %i)", MAX_CYLINDERS); + wx_messagebox(hdlg, s, "PCem error", WX_MB_OK); return TRUE; } @@ -1577,9 +1581,11 @@ static int hdsize_dlgproc(void* hdlg, int message, INT_PARAM wParam, LONG_PARAM wx_messagebox(hdlg,"Drive has too many heads (maximum is 16)","PCem error",WX_MB_OK); return TRUE; } - if (hd_new_cyl > 16383) + if (hd_new_cyl > MAX_CYLINDERS) { - wx_messagebox(hdlg,"Drive has too many cylinders (maximum is 16383)","PCem error",WX_MB_OK); + char s[256]; + sprintf(s, "Drive has too many cylinders (maximum is %i)", MAX_CYLINDERS); + wx_messagebox(hdlg,s,"PCem error",WX_MB_OK); return TRUE; }