(RSP HLE) Refactor some mixing routines