mirror of
https://github.com/ctruLua/ctruLua.git
synced 2025-10-27 16:39:29 +00:00
ADDED SOCKETS ! Added ROMFS support (maybe), Improved the news library, added a VBLank waiting function
Sockets are only very buggy/unstable TCP clients, but working. The library was written from scratch.
This commit is contained in:
parent
dcdeec6525
commit
8500bcb8fa
7 changed files with 222 additions and 16 deletions
18
source/gfx.c
18
source/gfx.c
|
|
@ -9,6 +9,7 @@ The `gfx` module.
|
|||
#include <sftd.h>
|
||||
|
||||
#include <3ds/vram.h>
|
||||
#include <3ds/services/gsp.h>
|
||||
|
||||
#include <lua.h>
|
||||
#include <lauxlib.h>
|
||||
|
|
@ -134,6 +135,22 @@ static int gfx_setVBlankWait(lua_State *L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/***
|
||||
Wait for the VBlank interruption.
|
||||
@function waitForVBlank
|
||||
@tparam[opt=GFX_TOP] number screen the screen's VBlank to wait for
|
||||
*/
|
||||
static int gfx_waitForVBlank(lua_State *L) {
|
||||
u8 screen = luaL_optinteger(L, 1, GFX_TOP);
|
||||
if (screen == GFX_TOP) {
|
||||
gspWaitForVBlank0();
|
||||
} else {
|
||||
gspWaitForVBlank1();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/***
|
||||
Get free VRAM space.
|
||||
@function vramSpaceFree
|
||||
|
|
@ -348,6 +365,7 @@ static const struct luaL_Reg gfx_lib[] = {
|
|||
{ "set3D", gfx_set3D },
|
||||
{ "get3D", gfx_get3D },
|
||||
{ "setVBlankWait", gfx_setVBlankWait },
|
||||
{ "waitForVBlank", gfx_waitForVBlank },
|
||||
{ "vramSpaceFree", gfx_vramSpaceFree },
|
||||
{ "line", gfx_line },
|
||||
{ "point", gfx_point },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue