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:
parent
0105970ab7
commit
b4d025d602
17 changed files with 205 additions and 131 deletions
|
|
@ -1,39 +1,30 @@
|
|||
; setup constants
|
||||
.const c20, 0.0, 0.0, 0.0, 1.0
|
||||
; Outputs
|
||||
.out outpos position
|
||||
.out outtc0 texcoord0
|
||||
.out outclr color
|
||||
|
||||
; setup outmap
|
||||
.out o0, result.position, 0xF
|
||||
.out o1, result.texcoord0, 0x3
|
||||
.out o2, result.color, 0xF
|
||||
; Inputs
|
||||
.alias inpos v0
|
||||
.alias inarg v1
|
||||
|
||||
; setup uniform map (not required)
|
||||
.uniform c0, c3, projection
|
||||
; Uniforms
|
||||
.fvec projection[4]
|
||||
|
||||
.vsh vmain, end_vmain
|
||||
; Constants
|
||||
.constf RGBA8_TO_FLOAT4(0.00392156862, 0, 0, 0)
|
||||
|
||||
;code
|
||||
vmain:
|
||||
; result.pos = projMtx * in.pos
|
||||
dp4 o0, c0, v0 (0x0)
|
||||
dp4 o0, c1, v0 (0x1)
|
||||
dp4 o0, c2, v0 (0x2)
|
||||
dp4 o0, c3, v0 (0x3)
|
||||
; result.texcoord = in.texcoord
|
||||
mov o1, v1 (0x5)
|
||||
; result.color = in.color
|
||||
mov o2, v1 (0x5)
|
||||
nop
|
||||
end
|
||||
end_vmain:
|
||||
|
||||
;operand descriptors
|
||||
.opdesc x___, xyzw, xyzw ; 0x0
|
||||
.opdesc _y__, xyzw, xyzw ; 0x1
|
||||
.opdesc __z_, xyzw, xyzw ; 0x2
|
||||
.opdesc ___w, xyzw, xyzw ; 0x3
|
||||
.opdesc xyz_, xyzw, xyzw ; 0x4
|
||||
.opdesc xyzw, xyzw, xyzw ; 0x5
|
||||
.opdesc x_zw, xyzw, xyzw ; 0x6
|
||||
.opdesc xyzw, yyyw, xyzw ; 0x7
|
||||
.opdesc xyz_, wwww, wwww ; 0x8
|
||||
.opdesc xyz_, yyyy, xyzw ; 0x9
|
||||
.proc main
|
||||
; outpos = projection * in.pos
|
||||
dp4 outpos.x, projection[0].wzyx, inpos
|
||||
dp4 outpos.y, projection[1].wzyx, inpos
|
||||
dp4 outpos.z, projection[2].wzyx, inpos
|
||||
dp4 outpos.w, projection[3].wzyx, inpos
|
||||
|
||||
; outtc0 = in.texcoord
|
||||
mov outtc0, inarg
|
||||
|
||||
; outclr = RGBA8_TO_FLOAT4(in.color)
|
||||
mul outclr, RGBA8_TO_FLOAT4.xxxx, inarg
|
||||
|
||||
end
|
||||
.end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue