| 14 | |
| 15 | template<typename T> |
| 16 | inline Result GetHbloaderSetting(const char *key, T &out_value) { |
| 17 | u64 setting_size; |
| 18 | UL_RC_TRY(setsysGetSettingsItemValue(HbloaderSettingsSectionName, key, std::addressof(out_value), sizeof(out_value), &setting_size)); |
| 19 | |
| 20 | if(setting_size != sizeof(out_value)) { |
| 21 | return MAKERESULT(Module_Libnx, LibnxError_BadInput); |
| 22 | } |
| 23 | |
| 24 | return ul::ResultSuccess; |
| 25 | } |
| 26 | |
| 27 | constexpr size_t HeapSize = 64_KB; |
| 28 | u8 g_Heap[HeapSize] = {}; |