Found at 80012964

Summary

Flushes the command queue in two ways. Depending on the mode its called with, it discards all entries in the command queue or it pumps the cd state machine until all commands are caught up.

Behavior

Check that the queue is not empty and if it is exit the function. Otherwise if the queue isn’t empty check the mode the function was called with. If it was called with -1 discard all entries in the queue by setting the exec index equal to the enqueue index. Else for all other modes while the IO state is not idle, pump the cdlib_manager to clear the queue. Do this by calling cdlib_manager in a loop. After each call to the cdlib_manager force the IO state to ready if it ends up as error or streaming. Wait two Vblanks between cdlib_manager calls just like in cdlib_process_until_idle and keep looping until the IO state becomes idle. When it does, return.

Notes

  • The IO state should always be idle if the enqueue and exec index are equal to each other.

Unknowns

  • I assume we force the IO state to ready if it ends up as streaming or error because we want to flush the command queue as quickly as possible?

Function Signature

Parameters: 1

mode: used to select how the function will clear the queue.

Returns: None

References

Calls

Sony Functions:
Custom Functions:

Called By

Memory Referenced