From 4fc5d29b5efbecb1aeafdd142e1af3871f5a1ea5 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Thu, 20 May 2004 11:11:45 +0000 Subject: [PATCH] added freesize to mount Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@1804 --- README | 12 +++++++++--- src/dos/dos_programs.cpp | 11 ++++++++++- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/README b/README index fedaf568..46484459 100644 --- a/README +++ b/README @@ -73,7 +73,7 @@ In addition, the following commands are available: MOUNT "Emulated Drive letter" "Real Drive or Directory" [-t type] [-aspi] [-ioctl] [-usecd number] [-size drivesize] - [-label drivelabel] + [-label drivelabel] [-freesize sizemb] MOUNT -cd Program to mount local directories as drives inside DOSBox. @@ -93,6 +93,10 @@ MOUNT -cd -size drivesize Sets the size of the drive. + -freesize sizemb + Sets the amount of freespace avaiable on a drive in MB's. This + is a more simple version of -size. + -label drivelabel Sets the name of the drive to "drivelabel". Needed on some systems if the cd label isn't read correctly. Useful when a @@ -136,9 +140,11 @@ MOUNT -cd 3. To mount system cdrom drive at mountpoint /media/cdrom as cdrom drive D in dosbox: mount d /media/cdrom -t cdrom -usecd 0 - 4. To mount a drive with 870 mb free diskspace (rarely needed! experts only): + 4. To mount a drive with 870 mb free diskspace (simple version): + mount c d:\ -freesize 870 + 5. To mount a drive with 870 mb free diskspace (experts only, full control): mount c d:\ -size 4025,127,16513,1700 - 5. To mount /home/dos/dosgames as drive C in DOSBox: + 6. To mount /home/dos/dosgames as drive C in DOSBox: mount c /home/dos/dosgames MEM diff --git a/src/dos/dos_programs.cpp b/src/dos/dos_programs.cpp index 58f13873..6c91e723 100644 --- a/src/dos/dos_programs.cpp +++ b/src/dos/dos_programs.cpp @@ -16,7 +16,7 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* $Id: dos_programs.cpp,v 1.24 2004-05-04 18:34:08 qbix79 Exp $ */ +/* $Id: dos_programs.cpp,v 1.25 2004-05-20 11:11:45 qbix79 Exp $ */ #include #include @@ -84,6 +84,15 @@ public: WriteOut(MSG_Get("PROGAM_MOUNT_ILL_TYPE"),type.c_str()); return; } + /* Parse the free space in mb's */ + std::string mb_size; + if(cmd->FindString("-freesize",mb_size,true)) { + char teststr[1024]; + Bit16u sizemb = static_cast(atoi(mb_size.c_str())); + sprintf(teststr,"512,127,16513,%d",sizemb*1024*1024/(512*127)); + str_size=teststr; + } + cmd->FindString("-size",str_size,true); char number[20];const char * scan=str_size.c_str(); Bitu index=0;Bitu count=0;