Просмотр исходного кода

Kernel/SVC: Fixed the register order for svcCreateMemoryBlock.

R0 is used as the last parameter instead of R4.
Subv 10 лет назад
Родитель
Сommit
42a50da76b
2 измененных файлов с 3 добавлено и 2 удалено
  1. 2 1
      src/core/hle/function_wrappers.h
  2. 1 1
      src/core/hle/kernel/process.cpp

+ 2 - 1
src/core/hle/function_wrappers.h

@@ -170,7 +170,8 @@ template<ResultCode func(s64*, u32, s32)> void Wrap() {
 
 
 template<ResultCode func(u32*, u32, u32, u32, u32)> void Wrap() {
 template<ResultCode func(u32*, u32, u32, u32, u32)> void Wrap() {
     u32 param_1 = 0;
     u32 param_1 = 0;
-    u32 retval = func(&param_1, PARAM(1), PARAM(2), PARAM(3), PARAM(4)).raw;
+    // The last parameter is passed in R0 instead of R4
+    u32 retval = func(&param_1, PARAM(1), PARAM(2), PARAM(3), PARAM(0)).raw;
     Core::g_app_core->SetReg(1, param_1);
     Core::g_app_core->SetReg(1, param_1);
     FuncReturn(retval);
     FuncReturn(retval);
 }
 }

+ 1 - 1
src/core/hle/kernel/process.cpp

@@ -209,7 +209,7 @@ ResultVal<VAddr> Process::LinearAllocate(VAddr target, u32 size, VMAPermission p
         return ERR_INVALID_ADDRESS;
         return ERR_INVALID_ADDRESS;
     }
     }
 
 
-    // Expansion of the linear heap is only allowed if you do an allocation immediatelly at its
+    // Expansion of the linear heap is only allowed if you do an allocation immediately at its
     // end. It's possible to free gaps in the middle of the heap and then reallocate them later,
     // end. It's possible to free gaps in the middle of the heap and then reallocate them later,
     // but expansions are only allowed at the end.
     // but expansions are only allowed at the end.
     if (target == heap_end) {
     if (target == heap_end) {