Changeset 284 in xtideuniversalbios for trunk/Serial_Server/library


Ignore:
Timestamp:
Feb 29, 2012, 6:13:11 PM (13 years ago)
Author:
gregli@…
google:author:
gregli@hotmail.com
Message:

Increased the width of the drive Model name that the boot menu display, better accomodating serial drives on auto detect which include the COM port and baud rate information.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Serial_Server/library/Image.cpp

    r277 r284  
    192192
    193193#define ATA_strModel 27
    194 #define ATA_strModel_Length 40
     194#define ATA_strModel_Length 40                 // Maximum allowable length of the string according to the ATA spec
     195#define XTIDEBIOS_strModel_Length 30           // Maximum length copied out of the ATA information by the BIOS
    195196
    196197#define ATA_wCaps 49
     
    240241{
    241242    char formatBuff[ 128 ];
     243    char speedBuff[ 128 ];
    242244
    243245    memset( &buff[0], 0, 514 );
     
    256258
    257259        if( comPort )
    258             sprintf( formatBuff, "%.15s (COM%c/%s) ", shortFileName, comPort, baudRate->display );
     260            sprintf( speedBuff, " (COM%c/%s)", comPort, baudRate->display );
    259261        else
    260             sprintf( formatBuff, "%.25s (%s baud) ", shortFileName, baudRate->display );
     262            sprintf( speedBuff, " (%s baud)", shortFileName, baudRate->display );
     263
     264        sprintf( formatBuff, "%.*s%s ", XTIDEBIOS_strModel_Length - strlen(speedBuff), shortFileName, speedBuff );
    261265    }
    262266    else
    263         sprintf( formatBuff, "%.30s ", shortFileName );
     267        sprintf( formatBuff, "%.*s ", XTIDEBIOS_strModel_Length, shortFileName );
    264268    strncpy( (char *) &buff[ATA_strModel], formatBuff, ATA_strModel_Length );
    265269    flipEndian( &buff[ATA_strModel], ATA_strModel_Length );
     
    302306    buff[ ATA_wGenCfg ] = ATA_wGenCfg_FIXED;
    303307}
     308
Note: See TracChangeset for help on using the changeset viewer.