diff --git a/libctru/include/3ds/os.h b/libctru/include/3ds/os.h index 7a4f952..78eaa4a 100644 --- a/libctru/include/3ds/os.h +++ b/libctru/include/3ds/os.h @@ -3,6 +3,10 @@ #define SYSTEM_VERSION(major, minor, revision) \ (((major)<<24)|((minor)<<16)|((revision)<<8)) +#define GET_VERSION_MAJOR(version) ((version) >>24) +#define GET_VERSION_MINOR(version) (((version)>>16)&0xFF) +#define GET_VERSION_REVISION(version) (((version)>> 8)&0xFF) + u32 osConvertVirtToPhys(u32 vaddr); u32 osConvertOldLINEARMemToNew(u32 addr);//Converts 0x14* vmem to 0x30*. Returns the input addr when it's already within the new vmem. Returns 0 when outside of either LINEAR mem areas. const char* osStrError(u32 error); diff --git a/libctru/source/os.c b/libctru/source/os.c index 9c07d94..99b8c5b 100644 --- a/libctru/source/os.c +++ b/libctru/source/os.c @@ -110,13 +110,13 @@ u64 osGetTime() { //--------------------------------------------------------------------------------- u32 osGetFirmVersion() { //--------------------------------------------------------------------------------- - return (*(u32*)0x1FF80000) & ~0xFF; + return (*(u32*)0x1FF80060) & ~0xFF; } //--------------------------------------------------------------------------------- u32 osGetKernelVersion() { //--------------------------------------------------------------------------------- - return (*(u32*)0x1FF80060) & ~0xFF; + return (*(u32*)0x1FF80000) & ~0xFF; } //---------------------------------------------------------------------------------