##### Shinobi Library - Memory Card Function

# buFormatDisk

Formats a memory card

### FORMAT

`

  buFormatDisk( drive, *volume, icon, *time, flag )
  Sint32 drive
  const Uint8 *volume
  Sint32 icon
  BUS_TIME *time
  Sint32 flag

`

### PARAMETER

  `drive` | Extension socket number
  `*volume` | Volume data
  `icon` | Icon number(0 to 123)
  `*time` | Time stamp
  `flag` | Format flag
  `` | TRUE:Full format
  `` | FALSE:Quick format

### RETURN

  BUD_ERR_OK | Processing request was accepted |
  BUD_ERR_BUSY | Request could not be accepted because processing was in progress |

### DESCRIPTION

  Formats a memory card.

  The following values can be designated for the argument `drive` that specifies extension sockets.

  BUD_DRIVE_A1 | Extension socket 1 on board A
  BUD_DRIVE_A2 | Extension socket 2 on board A
  BUD_DRIVE_B1 | Extension socket 1 on board B
  BUD_DRIVE_B2 | Extension socket 2 on board B
  BUD_DRIVE_C1 | Extension socket 1 on board C
  BUD_DRIVE_C2 | Extension socket 2 on board C
  BUD_DRIVE_D1 | Extension socket 1 on board D
  BUD_DRIVE_D2 | Extension socket 2 on board D

### EXAMPLE

        Sint32 ret;
        BUS_TIME time;
        SYS_RTC_DATE rtc;
        Uint8 volume[32];
        Sint32 icon_no;
        syRtcGetDate( &rtc );
        time = ( BUS_TIME )rtc;  /* Set time stamp */
        icon_no = 0; /* Set icon number */
        /* Set body color to blue */
        memset(volume, 0, sizeof(volume));
        volume[0] = 0x01;  /* Body color information found */
        volume[1] = 0xbf;  /* B */
        volume[2] = 0x00;  /* G */
        volume[3] = 0x00;  /* R */
        volume[4] = 0xff;  /* A */
        ret = buFormatDisk(BD_DRIVE_A1, volume, icon_no, &time, TRUE);
        while (buStat(BUD_DRIVE_A1) == BUD_STAT_BUSY) {
        }
        if (buGetLastError(BUD_DRIVE_A1) != BUD_ERR_OK) return NG;
        return OK;

### NOTE

  The following are the completion statuses for this function that are obtained by `buStat():`

  BUD_ERR_OK | Normal end
  BUD_ERR_NO_DISK | Memory card not found

buFormatDisk

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999