- use a constant for the maximum disk size calculated from max. cylinder bits

- increased maximum disk size to 8 TB (should work with growing and sparse disks)
This commit is contained in:
Volker Ruppert 2012-07-26 16:15:48 +00:00
parent e0729e32b8
commit 9a008c8e3c
3 changed files with 13 additions and 8 deletions

View File

@ -57,6 +57,9 @@ Changes after 2.5.1 release:
- Added VGA graphics blinking support
- More accurate vertical and horizontal retrace emulation
(based on the DOSBox implementation)
- hard drive / hdimage
- undoable mode: added coherency check (flat image size and timestamp)
- sparse mode: fixed read support
- Sound
- implemented PC speaker beep using the lowlevel sound interface
- added SDL audio output support
@ -90,13 +93,14 @@ Changes after 2.5.1 release:
- Tools
- bxcommit: added support for converting growing to flat mode images
- bxcommit: support command line options and non-interactive (quiet) mode
- bximage: increased maximum disk size to 8 TB
- SF patches applied
[3540389] Patch 5 : Change memory reference functions argument order by Yeong-uk Jo
[3539254] Patch 4 : Memory reference optimization 2 by Yeong-uk Jo
[3539251] Patch 3 : Memory reference optimization by Yeong-uk Jo
[3539237] Patch 2 : Some optimization by Yeong-uk Jo
[3539228] Patch 1 : ROM BIOS Compatibility patch by Yeong-uk Jo
[3539228] Patch 1 : ROM BIOS Compatibility patch by Yeong-uk Jo
[3505209] Fixed combo box size by Konrad Grochowski
[2864391] Gui debugger default regs by Thomas Nilsen
[3486555] Fix critical stack leak in Win32 GUI by Carlo Bramini

View File

@ -5889,7 +5889,7 @@ by pressing <keycap>Enter</keycap>. Then, bximage will ask
for the size of the disk image you want to create, in Megabytes:
<screen>
Enter the hard disk size in megabytes, between 1 and 32255
Enter the hard disk size in megabytes, between 1 and 8257535
[10]
</screen>
</para>
@ -8922,7 +8922,7 @@ Please type hd or fd. [hd] hd
What kind of image should I create?
Please type flat, sparse or growing. [flat]
Enter the hard disk size in megabytes, between 1 and 32255
Enter the hard disk size in megabytes, between 1 and 8257535
[10] 2048
I will create a hard disk image with

View File

@ -29,8 +29,9 @@
#define HDIMAGE_HEADERS_ONLY 1
#include "../iodev/hdimage.h"
#define BX_MAX_HD_MEGS 2064383
#define BX_MAX_CYL_BITS 22
#define BX_MAX_CYL_BITS 24 // 8 TB
const int bx_max_hd_megs = (int)(((1 << BX_MAX_CYL_BITS) - 1) * 16.0 * 63.0 / 2048.0);
int bx_hdimage;
int bx_fdsize_idx;
@ -564,7 +565,7 @@ int parse_cmdline(int argc, char *argv[])
if (sscanf(&argv[arg][6], "%d", &bx_hdsize) != 1) {
printf("Error in hard disk image size argument: %s\n\n", &argv[arg][6]);
ret = 0;
} else if ((bx_hdsize < 1) || (bx_hdsize > BX_MAX_HD_MEGS)) {
} else if ((bx_hdsize < 1) || (bx_hdsize > bx_max_hd_megs)) {
printf("Hard disk image size out of range\n\n");
ret = 0;
}
@ -637,8 +638,8 @@ int CDECL main(int argc, char *argv[])
if (bx_interactive) {
if (ask_menu(hdmode_menu, hdmode_n_choices, hdmode_choices, bx_hdimagemode, &mode) < 0)
fatal (EOF_ERR);
sprintf(prompt, "\nEnter the hard disk size in megabytes, between 1 and %d\n", BX_MAX_HD_MEGS);
if (ask_int(prompt, 1, BX_MAX_HD_MEGS, bx_hdsize, &hdsize) < 0)
sprintf(prompt, "\nEnter the hard disk size in megabytes, between 1 and %d\n", bx_max_hd_megs);
if (ask_int(prompt, 1, bx_max_hd_megs, bx_hdsize, &hdsize) < 0)
fatal(EOF_ERR);
} else {
mode = bx_hdimagemode;