Commit Graph

1015 Commits

Author SHA1 Message Date
smea
77b421aa6b nothing important 2014-10-23 22:11:50 -07:00
StapleButter
af31a7c861 * add code for alphablending, color logic op, alpha test and multitexturing.
* add GPU_FinishDrawing() to be called after a batch of GPU_DrawArray() calls if you're done drawing or if you intend to change the GPU configuration before drawing more. Also fix GPU_Finalize(). With those changes, the GPU no longer freezes if you call GPU_DrawArray() an even number of times.
* fix GPU_SetViewport() to allow color buffer reading, so blending and logicop work as expected.
2014-10-23 17:56:56 +02:00
StapleButter
1f413a7d44 Add synchronization mechanism for entering sleep mode.
When the APT status is APP_PREPARE_SLEEPMODE, the application main thread should call aptSignalReadyForSleep() to signal that it is ready to enter sleep mode, and then call aptWaitStatusEvent() as usual.

Example code:

APP_STATUS status;
while ((status = aptGetStatus()) != APP_EXITING)
{
	if(status==APP_RUNNING)
	{
		// application logic here
	}
	else if(status == APP_SUSPENDING)
	{
		aptReturnToMenu();
	}
	else if(status == APP_PREPARE_SLEEPMODE)
	{
		aptSignalReadyForSleep();
		aptWaitStatusEvent();
	}
}

This maybe isn't the proper/recommended way to do sleep mode, but I tested it multiple times and it always worked reliably.

(note: maybe the sample code above will not work if GPU drawing is done in a separate thread, haven't tested that)
2014-09-18 22:09:15 +02:00
fincs
27be99a793 Add proper linear heap allocator 2014-09-17 00:22:30 +02:00
fincs
2c589cd2ef linearAlloc: use 16-byte alignment 2014-09-16 22:24:26 +02:00
StapleButter
8b27dbe623 * Make the GSP event handler signal events in the right order (essential for proper PICA200 sync)
* Add some comments about the GSP events (based on my observations, may not be right)
2014-09-13 17:01:20 +02:00
StapleButter
ad08977e37 Fix FS init. 2014-09-11 21:02:56 +02:00
yellows8
a9f4b3402b Fixed broken CSND_playsound() code for looping(use vaddr1 for that instead of vaddr0, and adjust the size). 2014-09-06 17:49:48 -04:00
plutoo
449ead1141 os: Added osGetTime(). 2014-09-06 21:07:26 +02:00
yellows8
aa77f9b1e2 Added code for using the microphone and an example app for it. 2014-09-03 14:36:05 -04:00
profi200
3d34e123ee Added functions for sysCore usage 2014-09-01 15:49:32 +02:00
yellows8
62f26e8760 Improved HID code, and added Accelerometer/Gyroscope support. 2014-08-30 20:41:09 -04:00
yellows8
9425edc406 Added HID event code, based on the GSP event code. Added event id check in gspWaitForEvent(). 2014-08-29 16:19:58 -04:00
smea
2a1c7c8ea9 some GSP and GPU fixes 2014-08-28 22:53:45 -07:00
fincs
b41f1ca796 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor 2014-08-28 00:02:56 +02:00
fincs
0275d6a924 initSystem: fix global ctor/dtor code 2014-08-28 00:00:53 +02:00
fincs
125398a52f Refactor linear heap code (formerly known as GSP heap) 2014-08-27 23:44:38 +02:00
yellows8
f37a7b004f Added checks for the array index code in hid.c. 2014-08-27 17:42:53 -04:00
fincs
16544492a2 Fix KEY_CRIGHT/CLEFT 2014-08-27 12:03:25 +02:00
smea
335acee5d5 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor
Conflicts:
	libctru/include/3ds/types.h
2014-08-26 23:13:36 -07:00
smea
9e78466af8 added stdlibs for size_t 2014-08-26 23:12:33 -07:00
mtheall
43661f8263 Add FSUSER_GetSdmcArchiveResource(). 2014-08-26 19:01:00 -05:00
mtheall
a2911e4883 Add word 2 to response for FSUSER_IsSdmcDetected() and FSUSER_IsSdmcWritable(). 2014-08-26 17:54:52 -05:00
mtheall
2eadd6d0b2 FIX DERP. 2014-08-26 17:43:34 -05:00
fincs
9b370c7eff Reorganize includes 2014-08-26 23:18:14 +02:00
mtheall
a253b10b24 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor 2014-08-26 15:58:24 -05:00
mtheall
cad12973c8 Add FSUSER_IsSdmcDetected() and FSUSER_IsSdmcWritable(). 2014-08-26 15:58:18 -05:00
fincs
8b9666ac40 3ds/types.h: #include <stddef.h> 2014-08-26 22:56:38 +02:00
fincs
589c59fab7 Move 3ds.h to root, add C++ guard, use #pragma once 2014-08-26 22:53:00 +02:00
smea
8e86af967a added Makefile rule to compile vsh shader code to gpu example (fincs, can you see if you can improve it ?) 2014-08-25 23:26:36 -07:00
smea
0aff9c6902 so sick of all these includes 2014-08-25 22:55:12 -07:00
smea
d30d5283c6 GSP/GFX stuff 2014-08-25 21:48:00 -07:00
smea
b9d6ffe8f2 oops, looks like i was editing deprecated files 2014-08-25 21:35:53 -07:00
smea
d287719900 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor
Conflicts:
	libctru/source/gfx.c
2014-08-25 21:32:00 -07:00
smea
47284dcd34 GPU stuff 2014-08-25 21:31:12 -07:00
mtheall
91f7e56129 Fix NULL handling for PTMU_GetBatteryLevel() and PTMU_GetBatteryChargeState(). 2014-08-25 23:24:06 -05:00
mtheall
4c04373046 Update FS_dirent. 2014-08-25 19:38:17 -05:00
plutoo
716fd86057 Merge branch 'refactor' of https://github.com/smealum/ctrulib into refactor 2014-08-25 23:12:35 +02:00
plutoo
dc052c19ee gsp: Added gspAllocLinear() to allocate from LINEAR heap
Required by CSND, for example
2014-08-25 23:11:53 +02:00
smea
56d9f4abb3 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor 2014-08-25 09:40:10 -07:00
smea
8f3997e3a7 PTM & AC stuff 2014-08-25 09:14:48 -07:00
fincs
fa18d4750b gfxInit(): initialize GSP event handler, use __gsp_heap_size 2014-08-25 12:07:00 +02:00
smea
14312cf851 APT WORKAROUND fix 2014-08-24 23:36:37 -07:00
smea
4c9abef1a9 APT WORKAROUND (update 3dsx_crt0.s to https://gist.github.com/smealum/305802b2b9bf4c877ddb and recompile everything please) 2014-08-24 23:25:54 -07:00
smea
fb1dc89eab fsInit fix 2014-08-24 22:50:57 -07:00
smea
3fae8817cc minifix gfxSetFramebufferInfo (for 3D) 2014-08-24 22:03:47 -07:00
smea
3884ce985c added gfx for simplified framebuffer access 2014-08-24 21:37:49 -07:00
smea
f9fbfc3c48 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor 2014-08-24 21:01:35 -07:00
smea
d5ac7a7cb0 minor GSP adjustments 2014-08-24 21:01:21 -07:00
mtheall
c2315a618d Merge branch 'refactor_mtheall' into refactor 2014-08-24 22:37:34 -05:00
plutoo
41c2a759f8 Merge branch 'refactor' of https://github.com/smealum/ctrulib into refactor 2014-08-24 22:51:19 +02:00
plutoo
65878d99c6 gsp: Update header as part of renaming. 2014-08-24 22:42:23 +02:00
plutoo
4c2fe7d103 gpu: Added small description to gpu files. 2014-08-24 22:40:12 +02:00
plutoo
dc16d99b53 gsp: Renamed GSPGPU_submitGxCommand to GSPGPU_SubmitGxCommand. 2014-08-24 22:33:57 +02:00
plutoo
37fc01383f gpu: Moved all non-service-related gpu files into source/gpu/. 2014-08-24 22:31:02 +02:00
plutoo
6f57364680 apt: Trying to make code more managable. 2014-08-24 22:22:28 +02:00
mtheall
d5c39263d8 Add more filesystem service commands. 2014-08-21 21:47:25 -05:00
mtheall
ff76b94cf1 add doxygen support 2014-08-21 21:40:52 -05:00
fincs
94f59bb076 Update Makefile flags 2014-08-21 22:59:59 +02:00
fincs
8fccb570e5 Homogenize indentation (use tabs) 2014-08-21 22:59:42 +02:00
plutoo
a0f8a6d153 os: Changed Get*Version format. 2014-08-21 22:35:20 +02:00
plutoo
ef1323a3a1 APT: Enumerated the notification signals. 2014-08-21 20:54:23 +02:00
plutoo
8c3ecfc621 os: Added functions for getting Firm/Kernel version. 2014-08-21 20:41:51 +02:00
plutoo
5045c830a8 os: Added DSP memory to virt->phys translation. 2014-08-21 20:35:12 +02:00
plutoo
9ff9ce5ad4 os: Added osStrError().
This will summarize an error-code given by the OS/sysmodules in few words.
Useful for debugging.
2014-08-21 20:20:23 +02:00
plutoo
89e29dbe06 HID: Various improvements.
Added gyro enable/disable cmd.
Added accelerometer disable cmd.
Fixed hidInit() error handling.
hidInit() no longer enables accelerometer.
HIDUSER_GetInfo has been renamed to HIDUSER_GetSharedMem.
hid functions no longer require a NULL-ptr as arg0.
2014-08-21 20:08:08 +02:00
plutoo
7dbd7e535c Renamed ACU_cmd1 to ACU_GenerateDefaultConfig. 2014-08-21 19:25:54 +02:00
fincs
0e850119c9 HID: implement key/touch/circle pad access 2014-08-21 16:55:21 +02:00
fincs
9cef70bbd4 Remove #ifdef SRV_OVERRIDE_SUPPORT 2014-08-21 01:29:22 +02:00
fincs
af93d8e10c gspWaitForEvent(): add nextEvent parameter; GSPEVENT_count -> '_MAX 2014-08-21 00:24:24 +02:00
fincs
0d3ed55b88 GSP: add basic event handling system 2014-08-21 00:09:39 +02:00
fincs
66523edaae initSystem.c: revise heap code, disable global destructors due to crashes 2014-08-20 23:32:09 +02:00
fincs
0a1d0403d1 __ctru_exit(): perform svcExitProcess() if there's no retAddr 2014-08-20 22:16:28 +02:00
fincs
85a96370e0 Merge branch 'refactor' of github.com:smealum/ctrulib into refactor 2014-08-20 22:02:33 +02:00
mtheall
f58601037c Reset SOC_hostent_alias to NULL in case the user trashed it. 2014-08-20 15:01:56 -05:00
fincs
a90ee009f8 Implement initSystem(), __ctru_exit() and __system_argc/argv 2014-08-20 22:01:50 +02:00
mtheall
c3f7bfa7fd implement gethostbyname 2014-08-20 14:56:01 -05:00
smea
370707c663 use svcDuplicateHandle in handle override 2014-08-17 13:37:49 -07:00
smea
2b4a219f87 fsInit, fsExit 2014-08-16 17:11:13 -07:00
smea
aa7d9acbbe enable srv override + __service_ptr fix 2014-08-16 15:11:33 -07:00
smea
4e3c18863b various fixes 2014-08-16 14:48:05 -07:00
plutoo
bb5d5b290f Added functionality for service-list override.
Currently disabled due to devkitARM build system not in place.
2014-08-12 22:41:40 +02:00
plutoo
d35233fb1c Revamped "srv.c". 2014-07-28 23:26:13 +02:00
plutoo
ec9734bdeb Moved OS module back out. Renamed functions. 2014-07-28 22:31:20 +02:00
plutoo
314d53a922 Moved service source-files into source/services/. 2014-07-28 22:04:31 +02:00
plutoo
884df0ba75 Moved header files from ctr/ to 3ds/. 2014-07-28 21:41:48 +02:00
plutoo
15d2dc765d Renamed svc_camelCase to svcCamelCase. 2014-07-28 20:58:47 +02:00
yellows8
7a54bb623a Implemented svc_getProcessInfo(), and added comment to CSND.h. Implemented OS_ConvertVaddr2Physaddr() which is now used by CSND.c, this includes support for the v8.0 LINEAR memory. 2014-07-23 01:23:20 -04:00
smea
c4382042d6 HTTPC : added support for a handful of http:C commands. example will follow. 2014-07-22 21:13:40 -07:00
Dave Murphy
a18cc37dfa add network headers, remove libnds dependencies 2014-06-04 13:23:50 +01:00
smea
4beea43184 Merge branch 'master' of github.com:smealum/ctrulib
Conflicts:
	libctru/include/ctr/GSP.h
	libctru/source/GSP.c
2014-05-27 20:49:50 +02:00
smea
2aae159782 minifix test.vsh 2014-05-27 20:47:53 +02:00
yellows8
3e69e498bb Adjusted sleep-mode code so that on leaving sleep-mode, GSPGPU_SetLcdForceBlack() is only used when the status was APP_RUNNING(also removed GSPGPU_SetLcdForceBlack call for prepare sleep-mode signal). 2014-05-22 14:21:39 -04:00
yellows8
4260edd6c9 Adjusted sleep-mode code so that the APP_STATUS on leaving sleep-mode, would be set to the status which was set when the prepare sleep-mode signal was triggered(and other minor changes). 2014-05-22 13:56:16 -04:00
yellows8
d99ab43106 Enabled APT_AppletUtility code which was needed for aptReturnToMenu. 2014-05-22 13:06:50 -04:00
yellows8
ce92c8b20d Implemented APT_GetAppletManInfo. Implemented loading the menu AppID with APT_GetAppletManInfo, instead of using a hard-coded AppID. 2014-05-22 00:22:56 -04:00
yellows8
54757cfd60 Fixed issue where the application would no longer receive any NS signals/notifications once the system returns to the application, from home-menu. 2014-05-21 12:43:58 -04:00
yellows8
07bd9aa357 Fixed issues involving application termination. This fixed the applet launch hang after launching a ctrulib app, and fixed the issue where the power/HOME buttons did not work correctly under the power-off screen. 2014-05-20 23:27:50 -04:00
yellows8
8c656065a4 Implemented more APT and GSPGPU commands. Improved return-to-menu handling, screenshots for the suspended application are now handled as well. Implemented power-button handling, and implemented sleep-mode handling. Updated the example apps for the APT changes, and fixed other issues with the examples. 2014-05-20 15:49:03 -04:00
ichfly
624775d80e added prototype 2014-05-20 17:21:48 +02:00
ichfly
0e1b6ebe43 added FSFILE_SetSize 2014-05-20 16:14:47 +02:00
yellows8
9714dad309 Removed outdated SOC comment. 2014-05-10 21:25:26 -04:00
yellows8
271464ffc2 Improved SOC addr handling, and implemented addr handling for the sendto/recvfrom cmds. 2014-05-10 17:22:22 -04:00
Dave Murphy
7560f2f8ef ignore generated folders 2014-05-07 18:01:19 +01:00
Dave Murphy
e20c97a050 remove dodgy wchar type, use UINT64_MAX from stdint.h for U64_MAX 2014-05-07 17:19:33 +01:00
yellows8
7a5d01108a Added SOC error conversion, and implemented getsockopt, setsockopt, fcntl, sockatmark, gethostid, getsockname, and getpeername. 2014-05-04 21:55:59 -04:00
yellows8
4a1619f7c7 Added svc_signalEvent, svc_getSystemTick, and svc_getProcessId. Enabled using SOC cmd8/cmda, and other minor changes. 2014-04-27 21:28:48 -04:00
yellows8
c69bc04dff Added GSPGPU code for SetBufferSwap and InvalidateDataCache. 2014-04-22 20:18:21 -04:00
yellows8
c5250ab567 Added code for the cfg:nor service. 2014-04-22 16:13:18 -04:00
yellows8
06dfc9aace Added code for using the ir:u service. 2014-04-22 15:15:46 -04:00
yellows8
a3be8c58b3 Added code for using the ac:u service. 2014-04-21 22:58:05 -04:00
yellows8
9fcca821fe Added code for using the CSND service. 2014-04-21 19:12:56 -04:00
smea
933c86b4b0 GPU : GPU_SetTexEnv minifix (thanks gericom) 2014-03-21 16:42:39 +01:00
smea
883cc76df8 SHDR : fixed DVLE_SendOutmap 2014-03-20 23:30:11 +01:00
smea
04c2c2760a GPU : fixed DVLE_SendOutmap 2014-03-20 18:23:48 +01:00
smea
e9c912d757 GPU : GPU_SetTexEnv 2014-03-20 15:15:35 +01:00
smea
dbe4d95801 Merge branch 'master' of github.com:smealum/ctrulib 2014-03-20 14:41:10 +01:00
smea
a23ddb5bea GPU : GPU_SetAttributeBuffers, GPU_SetStencilTest, GPU_SetFaceCulling 2014-03-20 14:40:57 +01:00
Jean Baptiste Noblot
782372b27c risk to be platform dependent
I know. it's a feature
2014-03-20 09:27:12 +01:00
smea
1c2d235c64 GSP : critical fix in GSPGPU_submitGxCommand
GX : updated GX_SetMemoryFill
GPU : various crap
2014-03-19 23:23:53 +01:00
smea
9d68fa3d7a APT && HID && GSP : don't ignore errors yo 2014-03-17 18:38:20 +01:00
smea
791e7ed4db SHDR : updated DVLE_SendOutmap 2014-03-15 21:00:37 +01:00
smea
f3eb629d49 GPU : GPU_SetDepthTest 2014-03-14 21:29:42 +01:00
smea
8606893584 GPU : GPU_DepthRange && GPU_SetTexture 2014-03-13 19:54:52 +01:00
smea
05254a7f63 SHDR : minifix 2014-03-13 18:27:22 +01:00
Jordan Rabet
7c7d25f911 SHDR : SHDR_GetUniformRegister (untested) 2014-03-13 15:50:43 +01:00
Jordan Rabet
1a01acbd8e SHDR : uniform table (untested) 2014-03-13 15:34:01 +01:00
smea
bffbc975e2 GPU : added buffer setup commands to GPU_SetViewport 2014-03-12 20:11:34 +01:00
smea
21dbf5aa75 GPU : GPU_SetViewport 2014-03-12 18:28:25 +01:00
smea
fc708bddb6 GPU : GPU_Reset 2014-03-12 15:59:26 +01:00
smea
9bd8f1079a SHDR : DVLE_SendConstants && SHDR_UseProgram 2014-03-11 22:50:07 +01:00
smea
cd5fb3ac6e GPU : DVLE_SendOutmap fix 2014-03-11 20:18:57 +01:00
smea
0b44c62cc3 GX : GX_SetTextureCopy 2014-03-11 19:08:45 +01:00
smea
656cb1a923 SHDR : various fixes 2014-03-11 19:00:44 +01:00
smea
0761e6db1e GPU : GPU_SetUniform 2014-03-09 16:38:55 +01:00
smea
5683e006d0 SHDR : untested 2014-03-08 12:43:16 +01:00
smea
df0d3f5114 GPU : cleanup 2014-03-02 18:05:04 +01:00
smea
69613a3914 GPU : command buffer stuff 2014-03-02 16:55:05 +01:00
smea
04b1425f86 GPU : initial code (untested) 2014-03-02 16:01:57 +01:00
smea
43844aa282 GX : implemented some GX commands 2014-03-02 14:53:51 +01:00
smea
a8d15ce5ae HID : moved hidInit and hidExit into ctrulib 2014-02-03 18:21:17 +01:00
smea
2a518a9ae3 APT && misc : better app exiting code, fixed APPLICATION and BASE mem leak 2014-02-03 18:06:58 +01:00
smea
7c28d9acce APT : added ability to specify APPID to aptInit 2014-02-01 19:56:36 +01:00
smea
30e765f52c APT : preliminary support for exiting app 2014-02-01 13:27:52 +01:00
smea
4250f91d55 APT : preliminary/experimental return to menu support 2014-02-01 00:23:59 +01:00
smea
08afa38c10 misc : volatile types 2014-01-30 00:16:45 +01:00
smea
b974ac0775 Merge branch 'master' of github.com:smealum/ctrulib 2014-01-29 23:17:14 +01:00
smea
021911976f APT : glanceparameter/receiveparameter 2014-01-29 23:17:02 +01:00
yellows8
7b9555a82d Fixed SOC command headers, and fixed the size checks. 2014-01-29 11:13:06 -05:00
yellows8
4f5c8bba3c Added code for using the socket service. 2014-01-28 19:35:40 -05:00
smea
d09a8f2e83 misc : libnds includes, Result => s32 2014-01-29 00:18:43 +01:00
smea
fca68b0d4e svc : svc_createMemoryBlock 2014-01-28 23:50:51 +01:00
smea
9b9bbba181 srv : default srv handle
APT, GSP, HID : proper return values
2014-01-28 23:43:59 +01:00
smea
a8e5cb01f9 FS : FSUSER_OpenDirectory, FSUSER_OpenFile, FSDIR_Read 2014-01-28 18:36:54 +01:00
smea
fce1a24dbf FS : renamed FSUSER_OpenFile to FSUSER_OpenFileDirectly; added FSUSER_OpenArchive
SDMC : added fs:USER example for loading from SDMC; requires proper exheader
2014-01-24 23:33:46 +01:00
smea
8f406826ef FS : fixed FSFILE_Write (oops) 2014-01-23 23:15:41 +01:00
smea
8dcc7e5cce srv : mini-fix
FS : FSFILE_Write
2014-01-23 18:30:36 +01:00
smea
dd36d587eb FS : started implementing FS services (thanks yellows8) 2014-01-22 22:35:46 +01:00
smea
f2d577a3e9 misc : renamed svc_getData to getThreadCommandBuffer and srv_10002 to srv_Initialize 2014-01-22 22:04:12 +01:00
smea
5d7e2c389f APT : NS_APPID 2014-01-20 22:10:09 +01:00
smea
80b647d65e APT : added some stuff, plus proper lock handle use in arm11u example. 2014-01-20 20:57:54 +01:00
smea
567685f814 GSP : fixed potential inline asm hazard (thanks Pong20302000) 2014-01-19 23:49:08 +01:00
smea
cced2fff79 various fixes 2014-01-19 21:49:01 +01:00
smea
345b7208cd basic HID implementation 2014-01-19 13:33:28 +01:00
smea
0a6669dc01 initial commit 2014-01-18 23:18:03 +01:00