diff --git a/src/xenia/kernel/xboxkrnl_audio.cc b/src/xenia/kernel/xboxkrnl_audio.cc index 6ea55ea6f..21818ca59 100644 --- a/src/xenia/kernel/xboxkrnl_audio.cc +++ b/src/xenia/kernel/xboxkrnl_audio.cc @@ -52,22 +52,6 @@ SHIM_CALL XMAReleaseContext_shim( } -SHIM_CALL XAudioGetVoiceCategoryVolume_shim( - PPCContext* ppc_state, KernelState* state) { - uint32_t unk_0 = SHIM_GET_ARG_32(0); - uint32_t out_ptr = SHIM_GET_ARG_32(1); - - XELOGD( - "XAudioGetVoiceCategoryVolume(%.8X, %.8X)", - unk_0, out_ptr); - - // Expects a floating point single. Volume %? - SHIM_SET_MEM_32(out_ptr, 0); - - SHIM_SET_RETURN(X_ERROR_SUCCESS); -} - - SHIM_CALL XAudioGetSpeakerConfig_shim( PPCContext* ppc_state, KernelState* state) { uint32_t config_ptr = SHIM_GET_ARG_32(0); @@ -82,6 +66,43 @@ SHIM_CALL XAudioGetSpeakerConfig_shim( } +SHIM_CALL XAudioGetVoiceCategoryVolumeChangeMask_shim( + PPCContext* ppc_state, KernelState* state) { + uint32_t driver_ptr = SHIM_GET_ARG_32(0); + uint32_t out_ptr = SHIM_GET_ARG_32(1); + + XELOGD( + "XAudioGetVoiceCategoryVolumeChangeMask(%.8X, %.8X)", + driver_ptr, out_ptr); + + XEASSERT(driver_ptr == 0xAADD1100); + + // Checking these bits to see if any voice volume changed. + // I think. + SHIM_SET_MEM_32(out_ptr, 0); + + SHIM_SET_RETURN(X_ERROR_SUCCESS); +} + + +SHIM_CALL XAudioGetVoiceCategoryVolume_shim( + PPCContext* ppc_state, KernelState* state) { + uint32_t driver_ptr = SHIM_GET_ARG_32(0); + uint32_t out_ptr = SHIM_GET_ARG_32(1); + + XELOGD( + "XAudioGetVoiceCategoryVolume(%.8X, %.8X)", + driver_ptr, out_ptr); + + XEASSERT(driver_ptr == 0xAADD1100); + + // Expects a floating point single. Volume %? + SHIM_SET_MEM_32(out_ptr, 0); + + SHIM_SET_RETURN(X_ERROR_SUCCESS); +} + + SHIM_CALL XAudioRegisterRenderDriverClient_shim( PPCContext* ppc_state, KernelState* state) { uint32_t callback_ptr = SHIM_GET_ARG_32(0); @@ -166,9 +187,11 @@ void xe::kernel::xboxkrnl::RegisterAudioExports( // SHIM_SET_MAPPING("xboxkrnl.exe", XMASetInputBufferReadOffset, state); // SHIM_SET_MAPPING("xboxkrnl.exe", XMAGetInputBufferReadOffset, state); - SHIM_SET_MAPPING("xboxkrnl.exe", XAudioGetVoiceCategoryVolume, state); SHIM_SET_MAPPING("xboxkrnl.exe", XAudioGetSpeakerConfig, state); + SHIM_SET_MAPPING("xboxkrnl.exe", XAudioGetVoiceCategoryVolumeChangeMask, state); + SHIM_SET_MAPPING("xboxkrnl.exe", XAudioGetVoiceCategoryVolume, state); + SHIM_SET_MAPPING("xboxkrnl.exe", XAudioRegisterRenderDriverClient, state); SHIM_SET_MAPPING("xboxkrnl.exe", XAudioUnregisterRenderDriverClient, state); SHIM_SET_MAPPING("xboxkrnl.exe", XAudioSubmitRenderDriverFrame, state);