Added a file for the cfg:u service.
Implemented the CFGU_GetSystemModel function
This commit is contained in:
parent
b0c29ba658
commit
e8c551b114
@ -15,6 +15,7 @@ extern "C" {
|
|||||||
#include <3ds/services/ac.h>
|
#include <3ds/services/ac.h>
|
||||||
#include <3ds/services/apt.h>
|
#include <3ds/services/apt.h>
|
||||||
#include <3ds/services/cfgnor.h>
|
#include <3ds/services/cfgnor.h>
|
||||||
|
#include <3ds/services/cfgu.h>
|
||||||
#include <3ds/services/csnd.h>
|
#include <3ds/services/csnd.h>
|
||||||
#include <3ds/services/fs.h>
|
#include <3ds/services/fs.h>
|
||||||
#include <3ds/services/gsp.h>
|
#include <3ds/services/gsp.h>
|
||||||
|
6
libctru/include/3ds/services/cfgu.h
Normal file
6
libctru/include/3ds/services/cfgu.h
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
Result CFGU_Initialize(void);
|
||||||
|
Result CFGU_Shutdown(void);
|
||||||
|
|
||||||
|
Result CFGU_GetSystemModel(u8* model);
|
31
libctru/source/services/cfgu.c
Normal file
31
libctru/source/services/cfgu.c
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <3ds.h>
|
||||||
|
|
||||||
|
Handle CFGU_handle = 0;
|
||||||
|
|
||||||
|
Result CFGU_Initialize()
|
||||||
|
{
|
||||||
|
return srvGetServiceHandle(&CFGU_handle, "cfg:u");
|
||||||
|
}
|
||||||
|
|
||||||
|
Result CFGU_Shutdown()
|
||||||
|
{
|
||||||
|
Result ret = svcCloseHandle(CFGU_handle);
|
||||||
|
CFGU_handle = 0;
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
Result CFGU_GetSystemModel(u8* model)
|
||||||
|
{
|
||||||
|
Result ret = 0;
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = 0x00050000;
|
||||||
|
|
||||||
|
if((ret = svcSendSyncRequest(CFGU_handle))!=0)return ret;
|
||||||
|
|
||||||
|
*model = (u8)cmdbuf[2];
|
||||||
|
|
||||||
|
return (Result)cmdbuf[1];
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user