[APU] Physical address in XE_XMA_REG_CONTEXT_ARRAY_ADDRESS

This commit is contained in:
Triang3l 2019-08-16 21:20:10 +03:00
parent e35c609224
commit b25c50164f
1 changed files with 6 additions and 1 deletions

View File

@ -105,12 +105,17 @@ X_STATUS XmaDecoder::Setup(kernel::KernelState* kernel_state) {
reinterpret_cast<cpu::MMIOWriteCallback>(MMIOWriteRegisterThunk));
// Setup XMA context data.
// The Xbox 360 kernel allocates the contexts with X_PAGE_NOCACHE |
// X_PAGE_READWRITE and writes MmGetPhysicalAddress for the address to the
// register.
context_data_first_ptr_ = memory()->SystemHeapAlloc(
sizeof(XMA_CONTEXT_DATA) * kContextCount, 256, kSystemHeapPhysical);
context_data_last_ptr_ =
context_data_first_ptr_ + (sizeof(XMA_CONTEXT_DATA) * kContextCount - 1);
register_file_[XE_XMA_REG_CONTEXT_ARRAY_ADDRESS].u32 =
context_data_first_ptr_;
memory()
->LookupHeap(context_data_first_ptr_)
->GetPhysicalAddress(context_data_first_ptr_);
// Setup XMA contexts.
for (int i = 0; i < kContextCount; ++i) {