------------------------------------------------------------------
Description of commands used by hdd.h
------------------------------------------------------------------

    s32 dd_create(void);
    
	Generates the Disk processing thread and performs the 
	necessary initialization. It returns -1 with normal 
	termination; if it has already been called, it does 
	nothing and returns 0.  By specifying the following 
	options when compiling dd.c, the operation of this 
	function can be changed as described. 

	Option: 
        START_FROM_CASSETTE      
                                
	Effect: 
	Calls LeoCJCreateLeoManager rather than 
	LeoCreateLeoManager. Checks the Disk Drive connection.  
	Cancels reset status. 
        
	START_FROM_CASSETTE suboptions: 
            NO_USE_RTC:  The RTC is not checked. 
            NEED_DISK:   Prompts for Disk insertion if no Disk 
			 inserted at initialization. 


    s32 dd_exec( TMessage4dd * msg );
       
	Posts commands to the Disk thread.  Serves as an 
	asynchronous function if msg->retQ is set.  In this case, 
	msg must be received by dd_checkGate(). Note that retQ 
	cannot be a temporary local variable. For information on 
	commands that can be posted, see command.txt.


    s32 dd_checkGate( TMessage4dd * msg );  

	Returns -1 if processing for a Disk thread started by 
	dd_exec( ) has been completed and 0 if processing is still
	being performed.  This function does not block the thread.
	It merely indicates whether the next call to dd_exec() can
	be issued.  Only when the return value of this function is
	true does the Disk thread store a meaningful value in msg. 


    s32 dd_thaw(s32 target_err);

	Resumes error handling in a suspended Disk thread.
	target_err is used for an integrity check and must match 
	dd_getStatus( )->errno.  It also must correspond one for 
	one with dd_freeze(), a static function in this module. 


    void dd_flush(void);

	An auxiliary function necessary to enable functioning of 
	dd_wait( ), the wait function for the Disk thread.  When 
	using the hdd.h module, this function should be called 
	from the main scheduler for each frame. 


    TDDStatus  *dd_getStatus(void);

        Returns Disk thread information. 


    s32 dd_saveID(LEODiskID * det);

        Sets det as the current Disk ID.  Used mainly when a Disk
	is to be changed. 


    s32 dd_driveExist(void);

        Returns 1 if a drive is connected. 
 

    u32 dd_getVersion(void);

        Returns version information obtained by LeoInquiry as
	32-byte data. 
        

    s32 dd_getBlockSize(s32 lba,s32 size);

	A LeoLBAToByte() parameter.  Returns the number of bytes
	in size blocks, beginning from lba. 

    void dd_change_mode_USA(void);
    
	When creating cassette-startup Disk games for use in the
	U.S., call this function before executing dd_create().


    void dd_errHook(s32 func_no , s32 err_no , s32 count );

	A function for debugging the module itself.  Please ensure
	that func_no references leofunc_t in hdd_internal.h.
	Subsequently, when the Leo function specified by func_no
	is executed, the error err_no is forcibly returned count
	number of times.  With each forced error, count is passed
	1.
       
	Only one Leo function can be hooked at a time. 
    
    

The following are static functions, but they should be used only
after being modified by the application.

 
    s32 dd_checkSum(void);
    
	Describes a method of data checking when a RAM area read
	is performed. This method must correspond with the write
	method of dd_makeSum().


    s32 dd_makeSum(void);
        
	Prescribes the data format for the RAM area.  The format
	corresponds with the data check of dd_checkSum().


    s32 dd_restoreData(void);

	Prescribes the restoration method used when RAM area data
	are destroyed. 

