Skip to content

Commit

Permalink
Added a Reboot function to Xam
Browse files Browse the repository at this point in the history
  • Loading branch information
ClementDreptin committed Nov 7, 2022
1 parent d60641c commit d53533c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions include/Xam_.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ class Xam

// Check if an address is accessible and writable.
static bool IsAddressValid(void *pAddress);

// Reboot the console.
static void Reboot();
};

}
10 changes: 10 additions & 0 deletions src/Xam_.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ extern "C"
DWORD XamGetCurrentTitleId();

bool MmIsAddressValid(void *pAddress);

void HalReturnToFirmware(uint32_t powerDownMode);
}

namespace XexUtils
Expand Down Expand Up @@ -116,4 +118,12 @@ bool Xam::IsAddressValid(void *pAddress)
return MmIsAddressValid(pAddress);
}

void Xam::Reboot()
{
// Declared in xkelib
const uint32_t rebootRoutine = 1;

HalReturnToFirmware(rebootRoutine);
}

}

0 comments on commit d53533c

Please sign in to comment.