@database "ramdrive"
@master "AMIDEV:NDK/Autodocs/ramdrive.doc"

@Node Main "ramdrive.doc"
@toc "Autodocs/AG/INDEX/Main"
    @{" CMD_CLEAR " Link "CMD_CLEAR"}
    @{" CMD_READ " Link "CMD_READ"}
    @{" CMD_UPDATE " Link "CMD_UPDATE"}
    @{" CMD_WRITE " Link "CMD_WRITE"}
    @{" KillRAD() " Link "KillRAD()"}
    @{" KillRAD0() " Link "KillRAD0()"}
    @{" TD_CHANGENUM " Link "TD_CHANGENUM"}
    @{" TD_CHANGESTATE " Link "TD_CHANGESTATE"}
    @{" TD_FORMAT " Link "TD_FORMAT"}
    @{" TD_GETGEOMETRY " Link "TD_GETGEOMETRY"}
    @{" TD_MOTOR " Link "TD_MOTOR"}
    @{" TD_PROTSTATUS " Link "TD_PROTSTATUS"}
@EndNode

@Node "CMD_CLEAR" "ramdrive.device/CMD_CLEAR"

@{b}   NAME@{ub}
	CMD_CLEAR/ETD_CLEAR -- mark the internal buffer as containing
			       invalid data.

@{b}   FUNCTION@{ub}
	As the ramdrive.device does not have an internal buffer, this
	command performs no operation. It is only implemented to be
	consistent with the trackdisk.device type of interface.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	CMD_CLEAR or ETD_CLEAR
	io_Flags	0 or IOF_QUICK

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   SEE ALSO@{ub}
	@{"CMD_WRITE" Link "CMD_WRITE"}, @{"CMD_UPDATE" Link "CMD_UPDATE"}

@EndNode

@Node "CMD_READ" "ramdrive.device/CMD_READ"

@{b}   NAME@{ub}
	CMD_READ/ETD_READ -- read data from ramdrive.

@{b}   FUNCTION@{ub}
	These commands transfer data from the ramdrive to a supplied buffer.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	CMD_READ or ETD_READ
	io_Flags	0 or IOF_QUICK
	io_Data		pointer to the buffer where the data should be put
	io_Length	number of bytes to read
	io_Offset	byte offset from the start of the card describing
			where to read data from.

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   NOTES@{ub}

@{b}   SEE ALSO@{ub}
	@{"CMD_WRITE" Link "CMD_WRITE"}

@EndNode

@Node "CMD_UPDATE" "ramdrive.device/CMD_UPDATE"

@{b}   NAME@{ub}
	CMD_UPDATE/ETD_UPDATE -- write out internal buffers to ram.

@{b}   FUNCTION@{ub}
	As the ramdrive.device does not buffer data internally, this
	command performs no operation and returns immediately. It is
	implemented to support file systems that use it as part of the
	regular trackdisk-type device interface.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	CMD_UPDATE or ETD_UPDATE
	io_Flags	0 or IOF_QUICK

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   SEE ALSO@{ub}
	@{"CMD_WRITE" Link "CMD_WRITE"}

@EndNode

@Node "CMD_WRITE" "ramdrive.device/CMD_WRITE"

@{b}   NAME@{ub}
	CMD_WRITE/ETD_WRITE -- write data to ramdrive.

@{b}   FUNCTION@{ub}
	These commands transfer data from a supplied buffer to ram.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	CMD_WRITE or ETD_WRITE
	io_Flags	0 or IOF_QUICK
	io_Data		pointer to the buffer where the data should be put
	io_Length	number of bytes to write.
	io_Offset	byte offset from the start of the card describing
			where to write data to.

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   NOTES@{ub}

@{b}   SEE ALSO@{ub}
	@{"CMD_READ" Link "CMD_READ"}, @{"TD_FORMAT" Link "TD_FORMAT"}

@EndNode

@Node "KillRAD()" "ramdrive.device/KillRAD"

@{b}   NAME@{ub}
	KillRAD -- kill ramdrive.device unit

@{b}   SYNOPSIS@{ub}
	devName = KillRAD(unit)

	char *KillRAD( ULONG );

@{b}   FUNCTION@{ub}
	Kill a RAD: disk and return its memory.  First, remove the
	system hooks that recover the disk memory after reset, then
	free the disk memory, and return the dos device name.

@{b}   INPUTS@{ub}
	unit - the unit of the ramdrive.device to kill.

@{b}   RESULTS@{ub}
	devName - a pointer to the colon terminated device name that
		was associated with this unit.  This is a null
		terminated C string.

@EndNode

@Node "KillRAD0()" "ramdrive.device/KillRAD0"

@{b}   NAME@{ub}
	KillRAD0 -- kill ramdrive.device unit 0

@{b}   SYNOPSIS@{ub}
	devName = KillRAD(unit)

	char *KillRAD( ULONG );

@{b}   FUNCTION@{ub}
	Perform a KillRAD(0).  This function is retained for
	historical reasons.

@{b}   SEE ALSO@{ub}
	@{"ramdrive.device/KillRAD" Link "ramdrive/KillRAD()"}

@EndNode

@Node "TD_CHANGENUM" "ramdrive.device/TD_CHANGENUM"

@{b}   NAME@{ub}
	TD_CHANGENUM -- return the current value of the counter.

@{b}   FUNCTION@{ub}
	This command returns the current value of the ramdrive counter (as
	used by the enhanced commands). The change counter is always 1.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_CHANGENUM
	io_Flags	0 or IOF_QUICK

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.
	io_Actual - is always 1.

@EndNode

@Node "TD_CHANGESTATE" "ramdrive.device/TD_CHANGESTATE"

@{b}   NAME@{ub}
	TD_CHANGESTATE -- check if the ramdrive is currently available.

@{b}   FUNCTION@{ub}
	This command checks to see if the ramdrive is available. As it
	always is, this command always returns 0.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_CHANGESTATE
	io_Flags	0 or IOF_QUICK

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.
	io_Actual - 0, indicating that the ram can be read from or
		    written to.

@EndNode

@Node "TD_FORMAT" "ramdrive.device/TD_FORMAT"

@{b}   NAME@{ub}
	TD_FORMAT/ETD_FORMAT -- @{"Write" Link "dos/Write()"} data to memory

@{b}   FUNCTION@{ub}
	This function is traditionally used to write data to a disk
	that has not yet been formatted before or has had a hard error
	on a standard write command. None of these states apply to the
	ramdrive.device, and as such, this command is identical to
	@{"CMD_WRITE" Link "CMD_WRITE"}.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_FORMAT or ETD_FORMAT
	io_Flags	0 or IOF_QUICK
	io_Data		points to a buffer containing the data to write to the
			track, must be at least as large as io_Length.
	io_Length	number of bytes to write.
	io_Offset	byte offset from the start of the device.

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   NOTES@{ub}

@{b}   SEE ALSO@{ub}
	@{"CMD_WRITE" Link "CMD_WRITE"}, @{"TD_RAWWRITE" Link "trackdisk/TD_RAWWRITE"}

@EndNode

@Node "TD_GETGEOMETRY" "ramdrive.device/TD_GETGEOMETRY"

@{b}   NAME@{ub}
       TD_GETGEOMETRY -- return the geometry of the ramdrive.

@{b}   FUNCTION@{ub}
	This command returns a full set of information about the
	layout of the drive. The information is returned in the
	@{"DriveGeometry" Link "INCLUDE:devices/trackdisk.h/Main" 133} structure pointed to by io_Data.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_GETGEOMETRY
	io_Flags	0 or IOF_QUICK
	io_Data		Pointer to a @{"DriveGeometry" Link "INCLUDE:devices/trackdisk.h/Main" 133} structure
	io_Length	sizeof(struct DriveGeometry)

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.

@{b}   NOTE@{ub}

@{b}   SEE ALSO@{ub}
	@{"TD_GETDRIVETYPE" Link "trackdisk/TD_GETDRIVETYPE"}, @{"TD_GETNUMTRACKS" Link "trackdisk/TD_GETNUMTRACKS"}

@EndNode

@Node "TD_MOTOR" "ramdrive.device/TD_MOTOR"

@{b}   NAME@{ub}
	TD_MOTOR/ETD_MOTOR -- control the on/off state of the virtual motor.

@{b}   FUNCTION@{ub}
	This command would usually give control over the drive LED or
	motor of a drive. As the ramdrive does not have either, this command
	does nothing and always indicates success.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_MOTOR or ETD_MOTOR
	io_Flags	0 or IOF_QUICK
	io_Length	ignored.

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success
	io_Actual - always 1, indicating a running motor.

@EndNode

@Node "TD_PROTSTATUS" "ramdrive.device/TD_PROTSTATUS"

@{b}   NAME@{ub}
	TD_PROTSTATUS -- return whether the ram is write-protected.

@{b}   FUNCTION@{ub}
	This command is used to determine whether the ram drive is
	currently write-protected. The write protection status can
	be set with bit 0 of the flags value of @{"OpenDevice()" Link "trackdisk/OpenDevice()"}.

@{b}   IO REQUEST INPUT@{ub}
	io_Device	preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Unit		preset by the call to @{"OpenDevice()" Link "trackdisk/OpenDevice()"}
	io_Command	TD_PROTSTATUS
	io_Flags	0 or IOF_QUICK

@{b}   IO REQUEST RESULT@{ub}
	io_Error - 0 for success.
	io_Actual - if io_Error is 0, this tells you whether the device
		    is write-protected. 0 means the device is NOT write-
		    protected, while any other value indicates it is.

@EndNode

