Changeset 259 in xtideuniversalbios for trunk/Serial_Server/win32/Win32.cpp


Ignore:
Timestamp:
Feb 23, 2012, 7:14:06 AM (12 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

For function int13/0h, restored the code to only reset the floppy drives if a floppy drive was passed in for reset. Other minor optimizations. Better create new floppy support in Serial Server.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/win32/Win32.cpp

    r258 r259  
    3030        "  -n [megabytes]      Create new disk with given size or use -g geometry",
    3131        "                      Maximum size is " USAGE_MAXSECTORS,
     32        "                      Floppy images can also be created, such as \"360K\"",
    3233        "                      (default is a 32 MB disk, with CHS geometry 65:16:63)",
    3334        "",
     
    160161                if( atol(argv[t+1]) != 0 )
    161162                {
    162                     unsigned long size = atol(argv[++t]);
    163                     sect = 63;
    164                     head = 16;
    165                     cyl = (size*1024*2) / (16*63);
     163                    double size = atof(argv[++t]);
     164                    struct floppyInfo *fi;
     165                    char *c;
     166
     167                    size *= 2;
     168                    for( c = argv[t]; *c && *c != 'k' && *c != 'K'; c++ ) ;
     169                    if( !(*c) )
     170                        size *= 1000;
     171
     172                    if( (fi = FindFloppyInfoBySize( size )) )
     173                    {
     174                        sect = fi->sectors;
     175                        head = fi->heads;
     176                        cyl = fi->cylinders;
     177                    }
     178                    else
     179                    {
     180                        sect = 63;
     181                        head = 16;
     182                        cyl = size / (16*63);
     183                    }
    166184                }
    167185                break;
Note: See TracChangeset for help on using the changeset viewer.