mirror of
https://github.com/joel16/3DSident.git
synced 2024-11-23 03:29:45 +00:00
Moved includes to include dir, and merged changes from GUI
This commit is contained in:
parent
884797d009
commit
c0fe6d3b9d
@ -1,25 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <string.h>
|
||||
|
||||
Handle frdHandle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 principalId;
|
||||
u64 localFriendCode;
|
||||
} FriendKey;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 region;
|
||||
u8 country;
|
||||
u8 area;
|
||||
u8 language;
|
||||
u8 platform;
|
||||
} FrdProfile;
|
||||
|
||||
Result frdInit();
|
||||
Result frdExit();
|
||||
Result frdSetClientSdkVersion(u32 sdkVer);
|
||||
u64 frdPrincipalIdToFriendCode(u64 *fc, u64 pid);
|
||||
Result frdGetMyFriendKey(FriendKey *key);
|
@ -1,21 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <malloc.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
Handle actHandle;
|
||||
int actRefCount;
|
||||
|
||||
u32 *act_shareMemAddr;
|
||||
u32 act_shareMemSize;
|
||||
Handle act_shareMemHandle;
|
||||
|
||||
Result actInit(u32 sdkVer, u32 sharedMemSize);
|
||||
void actExit(void);
|
||||
Result ACT_Initialize(u32 sdkVer, void *addr, u32 memSize);
|
||||
Result ACT_GetAccountInfo(void *buffer, u32 size, u32 blkId);
|
||||
Result actuInit(void);
|
||||
Result actuExit(void);
|
||||
Result ACTU_Initialize(u32 sdkVersion, u32 unknown, Handle handle);
|
||||
Result ACTU_GetAccountDataBlock(u32 unknown, u32 size, u32 blockId, void* output);
|
@ -1,8 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
Handle amHandle;
|
||||
|
||||
char * base64encode(const char * input);
|
||||
Result amNetGetDeviceCert(u8 const * buffer);
|
@ -1,7 +0,0 @@
|
||||
#include <3ds.h>
|
||||
|
||||
Handle cfgHandle;
|
||||
|
||||
Result cfgsInit();
|
||||
Result cfgsExit();
|
||||
Result cfgsSecureInfoGetSerialNo(char *serial);
|
62
source/frd.c
62
source/frd.c
@ -1,62 +0,0 @@
|
||||
#include "frd.h"
|
||||
|
||||
Result frdInit(u32 sdkVer)
|
||||
{
|
||||
Result ret;
|
||||
|
||||
ret = srvGetServiceHandle(&frdHandle, "frd:u");
|
||||
if(R_FAILED(ret)) ret = srvGetServiceHandle(&frdHandle, "frd:n");
|
||||
if(R_FAILED(ret)) ret = srvGetServiceHandle(&frdHandle, "frd:a");
|
||||
|
||||
frdSetClientSdkVersion(sdkVer);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
Result frdExit()
|
||||
{
|
||||
return svcCloseHandle(frdHandle);
|
||||
}
|
||||
|
||||
Result frdSetClientSdkVersion(u32 sdkVer)
|
||||
{
|
||||
Result ret=0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x32,1,2); // 0x00320042
|
||||
cmdbuf[1] = sdkVer;
|
||||
cmdbuf[2] = 0x20;
|
||||
|
||||
if(R_FAILED(ret = svcSendSyncRequest(frdHandle)))return ret;
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
u64 frdPrincipalIdToFriendCode(u64 *fc, u64 pid)
|
||||
{
|
||||
Result ret=0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(0x24,1,0); // 0x00240040
|
||||
cmdbuf[1] = pid;
|
||||
|
||||
if(R_FAILED(ret = svcSendSyncRequest(frdHandle)))return ret;
|
||||
|
||||
*fc = (u64)cmdbuf[2];
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
||||
|
||||
Result frdGetMyFriendKey(FriendKey *key)
|
||||
{
|
||||
Result ret=0;
|
||||
u32 *cmdbuf = getThreadCommandBuffer();
|
||||
|
||||
cmdbuf[0] = IPC_MakeHeader(5,0,0); // 0x00050000
|
||||
|
||||
if(R_FAILED(ret = svcSendSyncRequest(frdHandle)))return ret;
|
||||
|
||||
memcpy(key, &cmdbuf[2], 0x10);
|
||||
|
||||
return (Result)cmdbuf[1];
|
||||
}
|
25
source/frd.h
25
source/frd.h
@ -1,25 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <string.h>
|
||||
|
||||
Handle frdHandle;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u32 principalId;
|
||||
u64 localFriendCode;
|
||||
} FriendKey;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
u8 region;
|
||||
u8 country;
|
||||
u8 area;
|
||||
u8 language;
|
||||
u8 platform;
|
||||
} FrdProfile;
|
||||
|
||||
Result frdInit();
|
||||
Result frdExit();
|
||||
Result frdSetClientSdkVersion(u32 sdkVer);
|
||||
u64 frdPrincipalIdToFriendCode(u64 *fc, u64 pid);
|
||||
Result frdGetMyFriendKey(FriendKey *key);
|
13
source/fs.h
13
source/fs.h
@ -1,13 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
FS_Archive sdmcArchive;
|
||||
|
||||
void openSdArchive();
|
||||
void closeSdArchive();
|
||||
int makeDir(const char * path);
|
||||
bool fileExists(char * path);
|
||||
bool dirExists(const char * path);
|
||||
bool deleteFile(const char *path);
|
@ -1,5 +0,0 @@
|
||||
#include <3ds.h>
|
||||
|
||||
Handle gspLcdHandle;
|
||||
|
||||
Result GSPLCD_GetBrightness(u32 screen, u32 *brightness);
|
@ -123,7 +123,7 @@ int main(int argc, char *argv[])
|
||||
//-----------------------------System Info-----------------------------//
|
||||
//=====================================================================//
|
||||
|
||||
printf("\x1b[31;1m*\x1b[0m Model: \x1b[31;1m%s %s\n\x1b[0m", getModel(), getRegion());
|
||||
printf("\x1b[31;1m*\x1b[0m Model: \x1b[31;1m%s\x1b[0m (\x1b[31;1m%s\x1b[0m) \n\x1b[0m", getModel(), getRegion());
|
||||
printf("\x1b[31;1m*\x1b[0m Screen type: \x1b[31;1m %s \n\x1b[0m", getScreenType());
|
||||
printf("\x1b[31;1m*\x1b[0m Language: \x1b[31;1m%s\x1b[0m \n", getLang());
|
||||
printf("\x1b[31;1m*\x1b[0m NNID: \x1b[31;1m%s\x1b[0m ", (char*)getNNID());
|
||||
|
11
source/mcu.h
11
source/mcu.h
@ -1,11 +0,0 @@
|
||||
#include <3ds.h>
|
||||
|
||||
Handle mcuhwcHandle;
|
||||
|
||||
Result mcuInit();
|
||||
Result mcuExit();
|
||||
Result mcuGetBatteryLevel(u8* out);
|
||||
Result mcuGetBatteryVoltage(u8* out);
|
||||
Result mcuGetVolume(u8* out);
|
||||
Result GetMcuFwVerHigh(u8* out);
|
||||
Result GetMcuFwVerLow(u8* out);
|
@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <png.h>
|
||||
#include <zlib.h>
|
||||
#include <3ds.h>
|
||||
|
||||
#define NUM_LEVELS (Z_BEST_COMPRESSION - Z_NO_COMPRESSION + 1)
|
||||
|
||||
char fileName[256];
|
||||
|
||||
int level, screenCapture;
|
||||
unsigned int format_choice;
|
||||
GSPGPU_FramebufferFormats format; // = GSP_RGBA8_OES
|
||||
void captureScreenshot();
|
@ -9,21 +9,22 @@ const char * getModel()
|
||||
{
|
||||
const char *models[] =
|
||||
{
|
||||
"O3DS",
|
||||
"O3DS XL",
|
||||
"N3DS",
|
||||
"2DS",
|
||||
"N3DS XL",
|
||||
"Unknown"
|
||||
"OLD 3DS - CTR",
|
||||
"OLD 3DS XL - SPR",
|
||||
"NEW 3DS - KTR",
|
||||
"OLD 2DS - FTR",
|
||||
"NEW 3DS XL - RED",
|
||||
"NEW 2DS XL - JAN",
|
||||
"Unknown"
|
||||
};
|
||||
|
||||
u8 model = 0;
|
||||
CFGU_GetSystemModel(&model);
|
||||
|
||||
if (model < 5)
|
||||
if (model < 6)
|
||||
return models[model];
|
||||
else
|
||||
return models[5];
|
||||
return models[6];
|
||||
}
|
||||
|
||||
const char * getRegion()
|
||||
@ -225,4 +226,4 @@ char * getBrightness(u32 screen)
|
||||
return "5 (100%)";
|
||||
else
|
||||
return "n3DS only";
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +0,0 @@
|
||||
#include <3ds.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
char * base64Encode(u8 const * input);
|
Loading…
Reference in New Issue
Block a user