mfsHMediaFormat


Format: s32 mfsHMediaFormat(s32 drive, s32 mode, u8* name, u8 attr)

Arguments:

drive	Name of drive to be formatted ('A' or 'B')
mode	Format mode
*name	Volume name
attr	Volume attribute

Return value:Error

Function: Formats medium

Description: This function formats the medium to MFS format. The portion of the medium that can be formatted is the RAM area on a disk for which the disk ID's RAM area use is 1. Also, a disk having disk type 6 cannot be formatted.

The following format modes can be specified for mode.

MFS_FORMAT_NORMAL	0	Normal format
MFS_FORMAT_FORCE	1	Forced format

When MFS_FORMAT_NORMAL is specified, a check is performed to determine whether or not the disk is an MFS-format disk. If it is an MFS-format disk, the volume attribute is checked. If the volume attribute indicates that the disk is protected, the disk cannot be formatted. When MFS_FORMAT_FORCE is specified, the disk is formatted without checking whether or not it is an MFS-format disk and checking its attribute.

A volume name character string not exceeding 20 bytes is specified for name.

The following volume attributes can be specified for attr.

MFS_VOLUME_ATTR_VPROTECT	0x40	Volume protected
MFS_VOLUME_ATTR_WPROTECT	0x80	Write protected

When the MFS_VOLUME_ATTR_VPROTECT_WRITE bit is 1, it indicates that the disk is write protected from other games. The disk can be written to only when the company code and game code specified by the mfsHInit*Boot() or mfsSetGameCode() function match the company code and game code written in the system ID area of the disk.

When the MFS_VOLUME_ATTR_VPROTECT_READ bit is 1, it indicates that the disk is read protected from other games. The disk can be read from only when the company code and game code specified by the mfsHInit*Boot() or mfsSetGameCode() function match the company code and game code written in the system ID area of the disk.

When MFS_VOLUME_ATTR_WPROTECT is specified, the disk is write protected from all games.

Main errors:

MFS_ERR_NO		Normal termination
MFS_ERR_NOTMFSDISK	Not an MFS-format disk 
			The disk ID's disk use is not 1. 
MFS_ERR_VERSION		Different version MFS-format disk
			The version is an unsupported version. 
MFS_ERR_PROTECT		Write protected disk
			The volume attribute is write protected.  No error occurs in the case of MFS_FORMAT_FORCE.
MFS_ERR_REFUSE An attempt was made to format a non-RAM area