Found at 800113CC

Summary

Request function that allows callers to load part of a file from the CD.

Behavior

Checks the cdIoState to see if we are errored or streaming. If we are abort the stream or recovery then flush the command buffer by executing all pending commands. Calls write_pos_size to store the BCD MSF position into a stack variable, the size is also stored but as the caller knows the size of the file the value is unused. CdPosToInt is then called to get the LBA location of the file from the MSF with the caller passed offset added to the LBA value. This value is then changed back to MSF with CdIntToPos and written to the cdArgs union. The caller passed load address and sector count file size is also passed to the cdArgs union.

Enqueue cd commands that will load the file. The commands do as follows:

  • Set the bit for double speed all other bits to 0
  • Set the seek target position (set loc)
  • Execute a nop (probably to wait?)
  • Read the file from the Cd

Return

Notes

  • This version seems to be used to load a file from the CD but start the read at an offset in order to not load the whole file.
  • It expects the caller to know both from what offset off start to read the file as well as the size of the file in sector count.

Function Signature

Parameters: 4

fileArchiveIndex: the index to the file archive
offset: the offset where the CD will begin to read the file
sectorCt: the size of the file in sectors after the offset
load address: the address in ram of where to load the file

Returns: Int

Always 0

References

Calls

Sony Functions:
Custom Functions:

Called By

Memory Referenced