Merge branch 'refactor' of github.com:smealum/ctrulib into refactor
Conflicts: libctru/include/3ds/types.h
This commit is contained in:
commit
335acee5d5
3
examples/.gitignore
vendored
Normal file
3
examples/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
build/
|
||||||
|
*.3dsx
|
||||||
|
*.elf
|
@ -2,7 +2,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/3ds.h>
|
#include <3ds.h>
|
||||||
#include "math.h"
|
#include "math.h"
|
||||||
#include "test_vsh_shbin.h"
|
#include "test_vsh_shbin.h"
|
||||||
#include "test_png_bin.h"
|
#include "test_png_bin.h"
|
||||||
|
32
libctru/include/3ds.h
Normal file
32
libctru/include/3ds.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//might be missing some
|
||||||
|
#include <3ds/types.h>
|
||||||
|
#include <3ds/svc.h>
|
||||||
|
#include <3ds/srv.h>
|
||||||
|
#include <3ds/os.h>
|
||||||
|
#include <3ds/gfx.h>
|
||||||
|
|
||||||
|
#include <3ds/services/ac.h>
|
||||||
|
#include <3ds/services/apt.h>
|
||||||
|
#include <3ds/services/cfgnor.h>
|
||||||
|
#include <3ds/services/csnd.h>
|
||||||
|
#include <3ds/services/fs.h>
|
||||||
|
#include <3ds/services/gsp.h>
|
||||||
|
#include <3ds/services/hid.h>
|
||||||
|
#include <3ds/services/httpc.h>
|
||||||
|
#include <3ds/services/ir.h>
|
||||||
|
#include <3ds/services/ptm.h>
|
||||||
|
#include <3ds/services/soc.h>
|
||||||
|
|
||||||
|
#include <3ds/gpu/gx.h>
|
||||||
|
#include <3ds/gpu/gpu.h>
|
||||||
|
#include <3ds/gpu/shdr.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
@ -1,16 +0,0 @@
|
|||||||
#ifndef __3DS_H
|
|
||||||
|
|
||||||
//might be missing some
|
|
||||||
#include <3ds/types.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/APT.h>
|
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/GX.h>
|
|
||||||
#include <3ds/GPU.h>
|
|
||||||
#include <3ds/HID.h>
|
|
||||||
#include <3ds/SHDR.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/os.h>
|
|
||||||
#include <3ds/gfx.h>
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,6 +1,4 @@
|
|||||||
#ifndef GFX_H
|
#pragma once
|
||||||
#define GFX_H
|
|
||||||
|
|
||||||
#include <3ds/types.h>
|
#include <3ds/types.h>
|
||||||
|
|
||||||
typedef enum
|
typedef enum
|
||||||
@ -34,5 +32,3 @@ void* gfxAllocLinear(size_t size);
|
|||||||
extern u8* gfxTopLeftFramebuffers[2];
|
extern u8* gfxTopLeftFramebuffers[2];
|
||||||
extern u8* gfxSubFramebuffers[2];
|
extern u8* gfxSubFramebuffers[2];
|
||||||
extern u8* gfxBottomFramebuffers[2];
|
extern u8* gfxBottomFramebuffers[2];
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef GPU_H
|
#pragma once
|
||||||
#define GPU_H
|
|
||||||
|
|
||||||
void GPU_Init(Handle *gsphandle);
|
void GPU_Init(Handle *gsphandle);
|
||||||
void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize);
|
void GPU_Reset(u32* gxbuf, u32* gpuBuf, u32 gpuBufSize);
|
||||||
@ -96,5 +95,3 @@ void GPU_SetTexEnv(u8 id, u16 rgbSources, u16 alphaSources, u16 rgbOperands, u16
|
|||||||
|
|
||||||
void GPU_DrawArray(GPU_Primitive_t primitive, u32 n);
|
void GPU_DrawArray(GPU_Primitive_t primitive, u32 n);
|
||||||
void GPU_DrawElements(GPU_Primitive_t primitive, u32* indexArray, u32 n);
|
void GPU_DrawElements(GPU_Primitive_t primitive, u32* indexArray, u32 n);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef GX_H
|
#pragma once
|
||||||
#define GX_H
|
|
||||||
|
|
||||||
#define GX_BUFFER_DIM(w, h) (((h)<<16)|((w)&0xFFFF))
|
#define GX_BUFFER_DIM(w, h) (((h)<<16)|((w)&0xFFFF))
|
||||||
|
|
||||||
@ -9,5 +8,3 @@ Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0v, u32* buf0e, u16 width
|
|||||||
Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags);
|
Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 flags);
|
||||||
Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags);
|
Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags);
|
||||||
Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
|
Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef SHDR_H
|
#pragma once
|
||||||
#define SHDR_H
|
|
||||||
|
|
||||||
typedef enum{
|
typedef enum{
|
||||||
VERTEX_SHDR=0x0,
|
VERTEX_SHDR=0x0,
|
||||||
@ -67,5 +66,3 @@ void DVLP_SendOpDesc(DVLP_s* dvlp);
|
|||||||
|
|
||||||
void DVLE_SendOutmap(DVLE_s* dvle);
|
void DVLE_SendOutmap(DVLE_s* dvle);
|
||||||
void DVLE_SendConstants(DVLE_s* dvle);
|
void DVLE_SendConstants(DVLE_s* dvle);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef OS_H
|
#pragma once
|
||||||
#define OS_H
|
|
||||||
|
|
||||||
#define SYSTEM_VERSION(major, minor, revision) \
|
#define SYSTEM_VERSION(major, minor, revision) \
|
||||||
(((major)<<24)|((minor)<<16)|((revision)<<8))
|
(((major)<<24)|((minor)<<16)|((revision)<<8))
|
||||||
@ -8,5 +7,3 @@ u32 osConvertVirtToPhys(u32 vaddr);
|
|||||||
const char* osStrError(u32 error);
|
const char* osStrError(u32 error);
|
||||||
u32 osGetFirmVersion();
|
u32 osGetFirmVersion();
|
||||||
u32 osGetKernelVersion();
|
u32 osGetKernelVersion();
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,11 +1,7 @@
|
|||||||
#ifndef AC_H
|
#pragma once
|
||||||
#define AC_H
|
|
||||||
|
|
||||||
Result acInit();
|
Result acInit();
|
||||||
Result acExit();
|
Result acExit();
|
||||||
|
|
||||||
Result ACU_GetWifiStatus(Handle* servhandle, u32 *out);
|
Result ACU_GetWifiStatus(Handle* servhandle, u32 *out);
|
||||||
Result ACU_WaitInternetConnection();
|
Result ACU_WaitInternetConnection();
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef APT_H
|
#pragma once
|
||||||
#define APT_H
|
|
||||||
|
|
||||||
// TODO : find a better place to put this
|
// TODO : find a better place to put this
|
||||||
#define RUNFLAG_APTWORKAROUND (BIT(0))
|
#define RUNFLAG_APTWORKAROUND (BIT(0))
|
||||||
@ -68,5 +67,3 @@ Result APT_ReplySleepQuery(Handle* handle, NS_APPID appID, u32 a);
|
|||||||
Result APT_ReplySleepNotificationComplete(Handle* handle, NS_APPID appID);
|
Result APT_ReplySleepNotificationComplete(Handle* handle, NS_APPID appID);
|
||||||
Result APT_PrepareToCloseApplication(Handle* handle, u8 a);
|
Result APT_PrepareToCloseApplication(Handle* handle, u8 a);
|
||||||
Result APT_CloseApplication(Handle* handle, u32 a, u32 b, u32 c);
|
Result APT_CloseApplication(Handle* handle, u32 a, u32 b, u32 c);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef CFGNOR_H
|
#pragma once
|
||||||
#define CFGNOR_H
|
|
||||||
|
|
||||||
Result CFGNOR_Initialize(u8 value);
|
Result CFGNOR_Initialize(u8 value);
|
||||||
Result CFGNOR_Shutdown();
|
Result CFGNOR_Shutdown();
|
||||||
@ -7,6 +6,3 @@ Result CFGNOR_ReadData(u32 offset, u32 *buf, u32 size);
|
|||||||
Result CFGNOR_WriteData(u32 offset, u32 *buf, u32 size);
|
Result CFGNOR_WriteData(u32 offset, u32 *buf, u32 size);
|
||||||
Result CFGNOR_DumpFlash(u32 *buf, u32 size);
|
Result CFGNOR_DumpFlash(u32 *buf, u32 size);
|
||||||
Result CFGNOR_WriteFlash(u32 *buf, u32 size);
|
Result CFGNOR_WriteFlash(u32 *buf, u32 size);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef CSND_H
|
#pragma once
|
||||||
#define CSND_H
|
|
||||||
|
|
||||||
#define CSND_SHAREDMEM_DEFAULT 0x10004000
|
#define CSND_SHAREDMEM_DEFAULT 0x10004000
|
||||||
|
|
||||||
@ -29,6 +28,3 @@ Result CSND_sharedmemtype0_cmdupdatestate(int waitdone);
|
|||||||
|
|
||||||
Result CSND_getchannelstate(u32 entryindex, u32 *out);
|
Result CSND_getchannelstate(u32 entryindex, u32 *out);
|
||||||
Result CSND_getchannelstate_isplaying(u32 entryindex, u8 *status);
|
Result CSND_getchannelstate_isplaying(u32 entryindex, u8 *status);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,20 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#ifndef FS_H
|
#include <string.h>
|
||||||
#define FS_H
|
#include <3ds/types.h>
|
||||||
|
|
||||||
/*! @file FS.h
|
/*! @file FS.h
|
||||||
*
|
*
|
||||||
* Filesystem Services
|
* Filesystem Services
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#include <3ds/types.h>
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C"
|
|
||||||
{
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*! @defgroup fs_open_flags FS Open Flags
|
/*! @defgroup fs_open_flags FS Open Flags
|
||||||
*
|
*
|
||||||
* @sa FSUSER_OpenFile
|
* @sa FSUSER_OpenFile
|
||||||
@ -147,6 +139,9 @@ Result FSUSER_CloseArchive(Handle* handle, FS_archive* archive);
|
|||||||
Result FSUSER_CreateDirectory(Handle* handle, FS_archive archive, FS_path dirLowPath);
|
Result FSUSER_CreateDirectory(Handle* handle, FS_archive archive, FS_path dirLowPath);
|
||||||
Result FSUSER_DeleteFile(Handle *handle, FS_archive archive, FS_path fileLowPath);
|
Result FSUSER_DeleteFile(Handle *handle, FS_archive archive, FS_path fileLowPath);
|
||||||
Result FSUSER_DeleteDirectory(Handle *handle, FS_archive archive, FS_path dirLowPath);
|
Result FSUSER_DeleteDirectory(Handle *handle, FS_archive archive, FS_path dirLowPath);
|
||||||
|
Result FSUSER_GetSdmcArchiveResource(Handle *handle, u32 *sectorSize, u32 *clusterSize, u32 *numClusters, u32 *freeClusters);
|
||||||
|
Result FSUSER_IsSdmcDetected(Handle *handle, u32 *detected);
|
||||||
|
Result FSUSER_IsSdmcWritable(Handle *handle, u32 *writable);
|
||||||
|
|
||||||
Result FSFILE_Close(Handle handle);
|
Result FSFILE_Close(Handle handle);
|
||||||
Result FSFILE_Read(Handle handle, u32 *bytesRead, u64 offset, void *buffer, u32 size);
|
Result FSFILE_Read(Handle handle, u32 *bytesRead, u64 offset, void *buffer, u32 size);
|
||||||
@ -159,9 +154,3 @@ Result FSFILE_Flush(Handle handle);
|
|||||||
|
|
||||||
Result FSDIR_Read(Handle handle, u32 *entriesRead, u32 entrycount, FS_dirent *buffer);
|
Result FSDIR_Read(Handle handle, u32 *entriesRead, u32 entrycount, FS_dirent *buffer);
|
||||||
Result FSDIR_Close(Handle handle);
|
Result FSDIR_Close(Handle handle);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef GSP_H
|
#pragma once
|
||||||
#define GSP_H
|
|
||||||
|
|
||||||
#define GSP_REBASE_REG(r) ((r)-0x1EB00000)
|
#define GSP_REBASE_REG(r) ((r)-0x1EB00000)
|
||||||
|
|
||||||
@ -80,5 +79,3 @@ Result GSPGPU_RegisterInterruptRelayQueue(Handle *handle, Handle eventHandle, u3
|
|||||||
Result GSPGPU_UnregisterInterruptRelayQueue(Handle* handle);
|
Result GSPGPU_UnregisterInterruptRelayQueue(Handle* handle);
|
||||||
Result GSPGPU_TriggerCmdReqQueue(Handle *handle);
|
Result GSPGPU_TriggerCmdReqQueue(Handle *handle);
|
||||||
Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8], Handle* handle);
|
Result GSPGPU_SubmitGxCommand(u32* sharedGspCmdBuf, u32 gxCommand[0x8], Handle* handle);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef HID_H
|
#pragma once
|
||||||
#define HID_H
|
|
||||||
|
|
||||||
#define HID_SHAREDMEM_DEFAULT (0x10000000)
|
#define HID_SHAREDMEM_DEFAULT (0x10000000)
|
||||||
|
|
||||||
@ -66,5 +65,3 @@ Result HIDUSER_EnableAccelerometer();
|
|||||||
Result HIDUSER_DisableAccelerometer();
|
Result HIDUSER_DisableAccelerometer();
|
||||||
Result HIDUSER_EnableGyroscope();
|
Result HIDUSER_EnableGyroscope();
|
||||||
Result HIDUSER_DisableGyroscope();
|
Result HIDUSER_DisableGyroscope();
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef HTTPC_H
|
#pragma once
|
||||||
#define HTTPC_H
|
|
||||||
|
|
||||||
Result HTTPC_Initialize(Handle handle);
|
Result HTTPC_Initialize(Handle handle);
|
||||||
Result HTTPC_InitializeConnectionSession(Handle handle, Handle contextHandle);
|
Result HTTPC_InitializeConnectionSession(Handle handle, Handle contextHandle);
|
||||||
@ -9,5 +8,3 @@ Result HTTPC_SetProxyDefault(Handle handle, Handle contextHandle);
|
|||||||
Result HTTPC_AddRequestHeaderField(Handle handle, Handle contextHandle, char* name, char* value);
|
Result HTTPC_AddRequestHeaderField(Handle handle, Handle contextHandle, char* name, char* value);
|
||||||
Result HTTPC_BeginRequest(Handle handle, Handle contextHandle);
|
Result HTTPC_BeginRequest(Handle handle, Handle contextHandle);
|
||||||
Result HTTPC_ReceiveData(Handle handle, Handle contextHandle, u8* buffer, u32 size);
|
Result HTTPC_ReceiveData(Handle handle, Handle contextHandle, u8* buffer, u32 size);
|
||||||
|
|
||||||
#endif
|
|
@ -1,5 +1,4 @@
|
|||||||
#ifndef IR_H
|
#pragma once
|
||||||
#define IR_H
|
|
||||||
|
|
||||||
Result IRU_Initialize(u32 *sharedmem_addr, u32 sharedmem_size);//The permissions for the specified memory is set to RO. This memory must be already mapped.
|
Result IRU_Initialize(u32 *sharedmem_addr, u32 sharedmem_size);//The permissions for the specified memory is set to RO. This memory must be already mapped.
|
||||||
Result IRU_Shutdown();
|
Result IRU_Shutdown();
|
||||||
@ -10,6 +9,3 @@ Result IRU_SetBitRate(u8 value);
|
|||||||
Result IRU_GetBitRate(u8 *out);
|
Result IRU_GetBitRate(u8 *out);
|
||||||
Result IRU_SetIRLEDState(u32 value);
|
Result IRU_SetIRLEDState(u32 value);
|
||||||
Result IRU_GetIRLEDRecvState(u32 *out);
|
Result IRU_GetIRLEDRecvState(u32 *out);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -1,10 +1,7 @@
|
|||||||
#ifndef PTM_H
|
#pragma once
|
||||||
#define PTM_H
|
|
||||||
|
|
||||||
Result ptmInit();
|
Result ptmInit();
|
||||||
Result ptmExit();
|
Result ptmExit();
|
||||||
|
|
||||||
Result PTMU_GetBatteryLevel(Handle* servhandle, u8 *out);
|
Result PTMU_GetBatteryLevel(Handle* servhandle, u8 *out);
|
||||||
Result PTMU_GetBatteryChargeState(Handle* servhandle, u8 *out);
|
Result PTMU_GetBatteryChargeState(Handle* servhandle, u8 *out);
|
||||||
|
|
||||||
#endif
|
|
@ -1,8 +1,5 @@
|
|||||||
#ifndef SOC_H
|
#pragma once
|
||||||
#define SOC_H
|
|
||||||
|
|
||||||
Result SOC_Initialize(u32 *context_addr, u32 context_size);//Example context_size: 0x48000. The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access.
|
Result SOC_Initialize(u32 *context_addr, u32 context_size);//Example context_size: 0x48000. The specified context buffer can no longer be accessed by the process which called this function, since the userland permissions for this block are set to no-access.
|
||||||
Result SOC_Shutdown();
|
Result SOC_Shutdown();
|
||||||
int SOC_GetErrno();
|
int SOC_GetErrno();
|
||||||
|
|
||||||
#endif
|
|
@ -1,9 +1,6 @@
|
|||||||
#ifndef SRV_H
|
#pragma once
|
||||||
#define SRV_H
|
|
||||||
|
|
||||||
Result srvInit();
|
Result srvInit();
|
||||||
Result srvExit();
|
Result srvExit();
|
||||||
Result srvRegisterClient();
|
Result srvRegisterClient();
|
||||||
Result srvGetServiceHandle(Handle* out, char* name);
|
Result srvGetServiceHandle(Handle* out, char* name);
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
types.h _ Various system types.
|
types.h _ Various system types.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef TYPES_H
|
#pragma once
|
||||||
#define TYPES_H
|
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#define U64_MAX UINT64_MAX
|
#define U64_MAX UINT64_MAX
|
||||||
|
|
||||||
@ -36,5 +36,3 @@ typedef s32 Result;
|
|||||||
typedef void (*ThreadFunc)(u32);
|
typedef void (*ThreadFunc)(u32);
|
||||||
|
|
||||||
#define BIT(n) (1U<<(n))
|
#define BIT(n) (1U<<(n))
|
||||||
|
|
||||||
#endif
|
|
||||||
|
@ -1,12 +1,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <3ds.h>
|
||||||
#include <3ds/types.h>
|
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/GX.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/gfx.h>
|
|
||||||
|
|
||||||
GSP_FramebufferInfo topFramebufferInfo, bottomFramebufferInfo;
|
GSP_FramebufferInfo topFramebufferInfo, bottomFramebufferInfo;
|
||||||
|
|
||||||
|
@ -4,11 +4,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/GX.h>
|
|
||||||
#include <3ds/GPU.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
u32* gpuCmdBuf;
|
u32* gpuCmdBuf;
|
||||||
u32 gpuCmdBufSize;
|
u32 gpuCmdBufSize;
|
||||||
|
@ -4,12 +4,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/GX.h>
|
|
||||||
#include <3ds/GPU.h>
|
|
||||||
#include <3ds/SHDR.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
|
|
||||||
//please don't feed this an invalid SHBIN
|
//please don't feed this an invalid SHBIN
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
#include <sys/iosupport.h>
|
#include <sys/iosupport.h>
|
||||||
#include <3ds/types.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <3ds.h>
|
||||||
|
|
||||||
// System globals we define here
|
// System globals we define here
|
||||||
int __system_argc;
|
int __system_argc;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/os.h>
|
|
||||||
|
|
||||||
u32 osConvertVirtToPhys(u32 vaddr)
|
u32 osConvertVirtToPhys(u32 vaddr)
|
||||||
{
|
{
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/AC.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
|
|
||||||
static Handle acHandle;
|
static Handle acHandle;
|
||||||
|
|
||||||
|
@ -4,11 +4,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/APT.h>
|
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
#define APT_HANDLER_STACKSIZE (0x1000)
|
#define APT_HANDLER_STACKSIZE (0x1000)
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/CFGNOR.h>
|
|
||||||
|
|
||||||
Handle CFGNOR_handle = 0;
|
Handle CFGNOR_handle = 0;
|
||||||
|
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/os.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/CSND.h>
|
|
||||||
|
|
||||||
//See here regarding CSND shared-mem commands, etc: http://3dbrew.org/wiki/CSND_Shared_Memory
|
//See here regarding CSND shared-mem commands, etc: http://3dbrew.org/wiki/CSND_Shared_Memory
|
||||||
|
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/FS.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
/*! @internal
|
/*! @internal
|
||||||
*
|
*
|
||||||
@ -609,6 +606,156 @@ FSUSER_CloseArchive(Handle *handle,
|
|||||||
return cmdbuf[1];
|
return cmdbuf[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*! Get SD FAT information
|
||||||
|
*
|
||||||
|
* @param[in] handle fs:USER handle
|
||||||
|
* @param[out] sectorSize Sector size (bytes)
|
||||||
|
* @param[out] clusterSize Cluster size (bytes)
|
||||||
|
* @param[out] numClusters Total number of clusters
|
||||||
|
* @param[out] freeClusters Number of free clusters
|
||||||
|
*
|
||||||
|
* @returns error
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* #### Request
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code [0x08140000]
|
||||||
|
*
|
||||||
|
* #### Response
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code
|
||||||
|
* 1 | Result code
|
||||||
|
* 2 | Sector (bytes)
|
||||||
|
* 3 | Cluster (bytes)
|
||||||
|
* 4 | Partition capacity (clusters)
|
||||||
|
* 5 | Free space (clusters)
|
||||||
|
*/
|
||||||
|
Result
|
||||||
|
FSUSER_GetSdmcArchiveResource(Handle *handle,
|
||||||
|
u32 *sectorSize,
|
||||||
|
u32 *clusterSize,
|
||||||
|
u32 *numClusters,
|
||||||
|
u32 *freeClusters)
|
||||||
|
{
|
||||||
|
if(!handle)
|
||||||
|
handle = &fsuHandle;
|
||||||
|
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = 0x08140000;
|
||||||
|
|
||||||
|
Result ret = 0;
|
||||||
|
if((ret = svcSendSyncRequest(*handle)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if(sectorSize)
|
||||||
|
*sectorSize = cmdbuf[2];
|
||||||
|
|
||||||
|
if(clusterSize)
|
||||||
|
*clusterSize = cmdbuf[3];
|
||||||
|
|
||||||
|
if(numClusters)
|
||||||
|
*numClusters = cmdbuf[4];
|
||||||
|
|
||||||
|
if(freeClusters)
|
||||||
|
*freeClusters = cmdbuf[5];
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Check if SD card is detected
|
||||||
|
*
|
||||||
|
* @param[in] handle fs:USER handle
|
||||||
|
* @param[out] detected Output detected state
|
||||||
|
*
|
||||||
|
* @returns error
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* #### Request
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code [0x08170000]
|
||||||
|
*
|
||||||
|
* #### Response
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code
|
||||||
|
* 1 | Result code
|
||||||
|
* 2 | Whether SD is detected
|
||||||
|
*/
|
||||||
|
Result
|
||||||
|
FSUSER_IsSdmcDetected(Handle *handle,
|
||||||
|
u32 *detected)
|
||||||
|
{
|
||||||
|
if(!handle)
|
||||||
|
handle = &fsuHandle;
|
||||||
|
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = 0x08170000;
|
||||||
|
|
||||||
|
Result ret = 0;
|
||||||
|
if((ret = svcSendSyncRequest(*handle)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if(detected)
|
||||||
|
*detected = cmdbuf[2];
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! Check if SD card is writable
|
||||||
|
*
|
||||||
|
* @param[in] handle fs:USER handle
|
||||||
|
* @param[out] writable Output writable state
|
||||||
|
*
|
||||||
|
* @returns error
|
||||||
|
*
|
||||||
|
* @internal
|
||||||
|
*
|
||||||
|
* #### Request
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code [0x08180000]
|
||||||
|
*
|
||||||
|
* #### Response
|
||||||
|
*
|
||||||
|
* Index Word | Description
|
||||||
|
* -----------|-------------------------
|
||||||
|
* 0 | Header code
|
||||||
|
* 1 | Result code
|
||||||
|
* 2 | Whether SD is writable
|
||||||
|
*/
|
||||||
|
Result
|
||||||
|
FSUSER_IsSdmcWritable(Handle *handle,
|
||||||
|
u32 *writable)
|
||||||
|
{
|
||||||
|
if(!handle)
|
||||||
|
handle = &fsuHandle;
|
||||||
|
|
||||||
|
u32 *cmdbuf = getThreadCommandBuffer();
|
||||||
|
|
||||||
|
cmdbuf[0] = 0x08180000;
|
||||||
|
|
||||||
|
Result ret = 0;
|
||||||
|
if((ret = svcSendSyncRequest(*handle)))
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
if(writable)
|
||||||
|
*writable = cmdbuf[2];
|
||||||
|
|
||||||
|
return cmdbuf[1];
|
||||||
|
}
|
||||||
|
|
||||||
/*! Close an open file
|
/*! Close an open file
|
||||||
*
|
*
|
||||||
* @param[in] handle Open file handle
|
* @param[in] handle Open file handle
|
||||||
|
@ -4,10 +4,7 @@
|
|||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
|
|
||||||
#define GSP_EVENT_STACK_SIZE 0x1000
|
#define GSP_EVENT_STACK_SIZE 0x1000
|
||||||
|
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/GSP.h>
|
|
||||||
#include <3ds/GX.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length)
|
Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length)
|
||||||
{
|
{
|
||||||
|
@ -3,10 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/HID.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
Handle hidHandle;
|
Handle hidHandle;
|
||||||
Handle hidMemHandle;
|
Handle hidMemHandle;
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/HTTPC.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
Result HTTPC_Initialize(Handle handle)
|
Result HTTPC_Initialize(Handle handle)
|
||||||
{
|
{
|
||||||
|
@ -1,9 +1,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/IR.h>
|
|
||||||
|
|
||||||
static Handle iru_handle=0;
|
static Handle iru_handle=0;
|
||||||
static Handle iru_sharedmem_handle=0;
|
static Handle iru_sharedmem_handle=0;
|
||||||
|
@ -1,8 +1,5 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/PTM.h>
|
|
||||||
|
|
||||||
static Handle ptmHandle;
|
static Handle ptmHandle;
|
||||||
|
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
#include <3ds/types.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/SOC.h>
|
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
@ -10,6 +5,7 @@
|
|||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <3ds.h>
|
||||||
|
|
||||||
Handle SOCU_handle = 0;
|
Handle SOCU_handle = 0;
|
||||||
static int SOCU_errno = 0;
|
static int SOCU_errno = 0;
|
||||||
|
@ -3,9 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <3ds/types.h>
|
#include <3ds.h>
|
||||||
#include <3ds/srv.h>
|
|
||||||
#include <3ds/svc.h>
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user