1
0
Fork 0
mirror of https://github.com/ctruLua/ctruLua.git synced 2025-10-28 00:39:30 +00:00

Updated the sf2dlib and sftdlib; Added the gfx.color.hex() function; Added the New3DS CPU mode control.

As the color order of the sf2dlib changed, you have to change it in your code, or use the color.hex() function.
To fix the problems, just change "0xRRGGBBAA" to "0xAABBGGRR".
Also, the shader compiler changed to Picasso, so you'll need it in order to compile.
https://github.com/fincs/picasso
This commit is contained in:
Firew0lf 2015-12-09 23:14:23 +01:00
parent 0105970ab7
commit b4d025d602
17 changed files with 205 additions and 131 deletions

View file

@ -4,7 +4,7 @@
static int sf2d_initialized = 0;
static u32 clear_color = RGBA8(0x00, 0x00, 0x00, 0xFF);
static u32 clear_color = 0;
static u32 *gpu_cmd = NULL;
//GPU init variables
static int gpu_cmd_size = 0;
@ -193,8 +193,9 @@ void sf2d_end_frame()
gspWaitForPPF();
//Clear the screen
GX_SetMemoryFill(NULL, gpu_fb_addr, clear_color, &gpu_fb_addr[0x2EE00],
0x201, gpu_depth_fb_addr, 0x00000000, &gpu_depth_fb_addr[0x2EE00], 0x201);
GX_SetMemoryFill(NULL,
gpu_fb_addr, clear_color, &gpu_fb_addr[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH,
gpu_depth_fb_addr, 0, &gpu_depth_fb_addr[240*400], GX_FILL_TRIGGER | GX_FILL_32BIT_DEPTH);
gspWaitForPSC0();
}
@ -245,6 +246,11 @@ void *sf2d_pool_memalign(u32 size, u32 alignment)
return NULL;
}
void *sf2d_pool_calloc(u32 nmemb, u32 size)
{
return sf2d_pool_memalign(nmemb * size, size);
}
unsigned int sf2d_pool_space_free()
{
return pool_size - pool_index;
@ -257,7 +263,11 @@ void sf2d_pool_reset()
void sf2d_set_clear_color(u32 color)
{
clear_color = color;
// GX_SetMemoryFill wants the color inverted?
clear_color = RGBA8_GET_R(color) << 24 |
RGBA8_GET_G(color) << 16 |
RGBA8_GET_B(color) << 8 |
RGBA8_GET_A(color) << 0;
}
void sf2d_set_scissor_test(GPU_SCISSORMODE mode, u32 x, u32 y, u32 w, u32 h)