diff --git a/src/xenia/kernel/xboxkrnl_audio_xma.cc b/src/xenia/kernel/xboxkrnl_audio_xma.cc index 0d69f89f4..a620c90ba 100644 --- a/src/xenia/kernel/xboxkrnl_audio_xma.cc +++ b/src/xenia/kernel/xboxkrnl_audio_xma.cc @@ -94,13 +94,14 @@ void StoreXmaContextIndexedRegister(KernelState* kernel_state, audio_system->WriteRegister(reg_num, xe::byte_swap(reg_value)); } -struct X_XMA_CONTEXT_INIT_LOOP_DATA { +struct X_XMA_LOOP_DATA { xe::be loop_start; xe::be loop_end; xe::be loop_count; xe::be loop_subframe_end; xe::be loop_subframe_skip; }; +static_assert_size(X_XMA_LOOP_DATA, 12); struct X_XMA_CONTEXT_INIT { xe::be input_buffer_0_ptr; @@ -114,7 +115,7 @@ struct X_XMA_CONTEXT_INIT { xe::be subframe_decode_count; xe::be channel_count; xe::be sample_rate; - X_XMA_CONTEXT_INIT_LOOP_DATA loop_data; + X_XMA_LOOP_DATA loop_data; }; static_assert_size(X_XMA_CONTEXT_INIT, 56); @@ -164,12 +165,13 @@ SHIM_CALL XMASetLoopData_shim(PPCContext* ppc_context, XELOGD("XMASetLoopData(%.8X, %.8X)", context_ptr, loop_data_ptr); XMAContextData context(SHIM_MEM_ADDR(context_ptr)); + auto loop_data = (X_XMA_LOOP_DATA*)SHIM_MEM_ADDR(loop_data_ptr); - context.loop_start = SHIM_MEM_32(loop_data_ptr + 0); - context.loop_end = SHIM_MEM_32(loop_data_ptr + 4); - context.loop_count = SHIM_MEM_8(loop_data_ptr + 6); - context.loop_subframe_end = SHIM_MEM_8(loop_data_ptr + 6); - context.loop_subframe_skip = SHIM_MEM_8(loop_data_ptr + 7); + context.loop_start = loop_data->loop_start; + context.loop_end = loop_data->loop_end; + context.loop_count = loop_data->loop_count; + context.loop_subframe_end = loop_data->loop_subframe_end; + context.loop_subframe_skip = loop_data->loop_subframe_end; context.Store(SHIM_MEM_ADDR(context_ptr));