GX : GX_SetTextureCopy

This commit is contained in:
smea 2014-03-11 19:08:45 +01:00
parent 656cb1a923
commit 0b44c62cc3
4 changed files with 61 additions and 2 deletions

43
gpu/source/test.vsh Normal file
View File

@ -0,0 +1,43 @@
; setup constants
.const 5, 0.0, 1.0, 2.0, 3.0
; setup outmap
.out o0, result.position
.out o1, result.color
.out o2, result.texcoord0
.out o3, result.texcoord1
.out o4, result.texcoord2
; setup uniform map (not required)
.uniform 0x10, 0x13, mdlvMtx
.uniform 0x14, 0x17, projMtx
;code
main:
; result.pos = mdlvMtx * in.pos
dp4 d40, d40, d00 (0x0)
dp4 d40, d41, d00 (0x1)
dp4 d40, d42, d00 (0x2)
mov d40, d25 (0x4)
; result.pos = projMtx * in.pos
dp4 d00, d44, d40 (0x0)
dp4 d00, d45, d40 (0x1)
dp4 d00, d46, d40 (0x2)
dp4 d00, d47, d40 (0x3)
; result.color = in.pos
mov d04, d25 (0x5)
; result.texcoord = const
mov d08, d25 (0x5)
mov d0C, d25 (0x5)
mov d10, d25 (0x5)
flush
end
endmain:
;operand descriptors
.opdesc x___, xyzw, xyzw ; 0x0
.opdesc _y__, xyzw, xyzw ; 0x1
.opdesc __z_, xyzw, xyzw ; 0x2
.opdesc ___w, xyzw, xyzw ; 0x3
.opdesc ___w, yyyy, xyzw ; 0x4
.opdesc xyzw, xyzw, xyzw ; 0x5

View File

@ -7,6 +7,7 @@ Result GX_RequestDma(u32* gxbuf, u32* src, u32* dst, u32 length);
Result GX_SetCommandList_Last(u32* gxbuf, u32* buf0a, u32 buf0s, u8 flags);
Result GX_SetMemoryFill(u32* gxbuf, u32* buf0a, u32 buf0s, u32 buf0d, u16 width0, u32* buf1a, u32 buf1s, u32 buf1d, u16 width1);
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_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s);
#endif

View File

@ -61,6 +61,21 @@ Result GX_SetDisplayTransfer(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32
return GSPGPU_submitGxCommand(gxbuf, gxCommand, NULL);
}
Result GX_SetTextureCopy(u32* gxbuf, u32* inadr, u32 indim, u32* outadr, u32 outdim, u32 size, u32 flags)
{
u32 gxCommand[0x8];
gxCommand[0]=0x04; //CommandID
gxCommand[1]=(u32)inadr;
gxCommand[2]=(u32)outadr;
gxCommand[3]=size;
gxCommand[4]=indim;
gxCommand[5]=outdim;
gxCommand[6]=flags;
gxCommand[7]=0x0;
return GSPGPU_submitGxCommand(gxbuf, gxCommand, NULL);
}
Result GX_SetCommandList_First(u32* gxbuf, u32* buf0a, u32 buf0s, u32* buf1a, u32 buf1s, u32* buf2a, u32 buf2s)
{
u32 gxCommand[0x8];

View File

@ -53,12 +53,12 @@ DVLB_s* SHDR_ParseSHBIN(u32* shbinData, u32 shbinSize)
}
//hm
static inline minu8(u8 a, u8 b)
static inline u8 minu8(u8 a, u8 b)
{
if(a<b)return a;
return b;
}
static inline maxu8(u8 a, u8 b)
static inline u8 maxu8(u8 a, u8 b)
{
if(a<b)return b;
return a;