components/prboom/mmus2mid.c
//
// ReadTime()
//
// Read a time value from the MUS buffer, advancing the position in it
//
// A time value is a variable length sequence of 8 bit bytes, with all
// but the last having bit 8 set.
//
// Passed a pointer to the pointer to the MUS buffer
// Returns the integer unsigned long time value there and advances the pointer
//
ReadTime()
Read a time value from the MUS buffer, advancing the position in it

A time value is a variable length sequence of 8 bit bytes, with all
but the last having bit 8 set.

Passed a pointer to the pointer to the MUS buffer
Returns the integer unsigned long time value there and advances the pointer
ReadTime () Read a time value from the MUS buffer advancing the position in it A time value is a variable length sequence of 8 bit bytes with all but the last having bit 8 set . Passed a pointer to the pointer to the MUS buffer Returns the integer unsigned long time value there and advances the pointer
static ULONG ReadTime(const UBYTE **musptrp)
{
  register ULONG timeval = 0;
  int byte;
  do    
  {
    byte = *(*musptrp)++;
    timeval = (timeval << 7) + (byte & 0x7F);
  }
  while(byte & 0x80);
  return timeval;
}
static ULONG ReadTime ( const UBYTE * * musptrp ) { register ULONG timeval = 0 ; int byte ; do { byte = * ( * musptrp ) ++ ; timeval = ( timeval << 7 ) + ( byte & 0x7F ) ; } while ( byte & 0x80 ) ; return timeval ; }
ReadTime()
Read a time value from the MUS buffer, advancing the position in it
ReadTime () Read a time value from the MUS buffer advancing the position in it
// shift each byte read up in the result until a byte with bit 8 clear