Found at 800114D8
Summary
Request function to for moving the seek head to the start of a file.
Behavior
Using the caller pass index get the gameAssetEntryPtr from the gameAssetPtrTable then update the asset_ptr and asset_ptr_table_index values in the CD library state. A call to is_first_asset_loaded is made passing in the gameAssetTableIndex global variable and the asset_ptr_table_idx.
cdlib_queue_seek seems to use this function to decided if the seek head needs to be moved to the location of the first or second asset file.
The asset table group index in the CD library state is updated to either 0 or 1 depending on whether the head is moving to the location of the first or the second asset file. We then get the position and size of the file in BCD MSF format and bytes respectively with a call to write_pos_size.
The preseek_target_lba is updated with the lba value we want to move the seek head to.
Finally the cd commands that will move the seek head are enqueued. These are:
- Set the bit for double speed all other bits to 0
- Set the seek target position (set loc)
- Execute a nop (probably to wait?)
- Execute the seek
- Execute a nop
Unknowns
- Not sure on is_first_added_needed, this is just a guess based on observed behavior. See the function for more details.
Function Signature
Parameters: 1
asset_ptr_table_index: pointer to the asset pointer table
Returns: Int
Always 0