Kernel: Capture SharedMemory attributes at creation, not when mapping

This commit is contained in:
Yuri Kunde Schlesner
2015-05-10 19:47:07 -03:00
parent 088f6ae2c6
commit c96f22490a
7 changed files with 51 additions and 28 deletions

View File

@ -48,7 +48,7 @@ static u32 next_touch_index;
// * Set PadData.current_state.circle_right = 1 if current PadEntry.circle_pad_y <= -41
void Update() {
SharedMem* mem = reinterpret_cast<SharedMem*>(shared_mem->GetPointer().ValueOr(nullptr));
SharedMem* mem = reinterpret_cast<SharedMem*>(shared_mem->GetPointer());
const PadState state = VideoCore::g_emu_window->GetPadState();
if (mem == nullptr) {
@ -163,7 +163,9 @@ void Init() {
AddService(new HID_U_Interface);
AddService(new HID_SPVR_Interface);
shared_mem = SharedMemory::Create("HID:SharedMem");
using Kernel::MemoryPermission;
shared_mem = SharedMemory::Create(0x1000, MemoryPermission::ReadWrite,
MemoryPermission::Read, "HID:SharedMem");
next_pad_index = 0;
next_touch_index = 0;