mirror of https://github.com/ClassiCube/ClassiCube
Xbox: Keep generated vs/ps ASM files
This commit is contained in:
parent
c6fada2c1f
commit
9283b69c00
|
|
@ -139,6 +139,10 @@ $(BUILD_DIR)/%.o: src/ps3/%.S
|
|||
$(BUILD_DIR)/%.o: third_party/bearssl/%.c
|
||||
$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
|
||||
|
||||
|
||||
# prevent the .asm files from being deleted
|
||||
.PRECIOUS: $(BUILD_DIR)/%.vpo $(BUILD_DIR)/%.fpo
|
||||
|
||||
$(BUILD_DIR)/%.vpo: $(SHADERS)/%.vcg
|
||||
$(CGCOMP) -v $(CGCFLAGS) $^ $@
|
||||
$(BUILD_DIR)/%.fpo: $(SHADERS)/%.fcg
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ $(BUILD_DIR):
|
|||
#---------------------------------------------------------------------------------
|
||||
# Executable generation
|
||||
#---------------------------------------------------------------------------------
|
||||
$(OBJS) : $(SHADER_OBJS)
|
||||
$(BUILD_DIR)/Graphics_Xbox.o : $(SHADER_OBJS)
|
||||
|
||||
$(TARGET).iso: $(TARGET).xbe
|
||||
mkdir -p $(BUILD_DIR)/cd
|
||||
|
|
@ -111,15 +111,21 @@ $(BUILD_DIR)/%.o: src/xbox/%.S
|
|||
$(BUILD_DIR)/%.o: third_party/bearssl/%.c
|
||||
nxdk-cc $(NXDK_CFLAGS) $(CFLAGS) -c $< -o $@
|
||||
|
||||
%.inl: %.vs.cg
|
||||
$(CGC) -profile vp20 -o $@.$$$$ $< && \
|
||||
$(VP20COMPILER) $@.$$$$ > $@ && \
|
||||
rm -rf $@.$$$$
|
||||
|
||||
%.inl: %.ps.cg
|
||||
$(CGC) -profile fp20 -o $@.$$$$ $< && \
|
||||
$(FP20COMPILER) $@.$$$$ > $@ && \
|
||||
rm -rf $@.$$$$
|
||||
# prevent the .asm files from being deleted
|
||||
.PRECIOUS: vs_%.asm ps_%.asm
|
||||
|
||||
vs_%.inl: vs_%.asm
|
||||
$(VP20COMPILER) $< > $@
|
||||
|
||||
vs_%.asm: vs_%.cg
|
||||
$(CGC) -profile vp20 $< -o $@
|
||||
|
||||
ps_%.inl: ps_%.asm
|
||||
$(FP20COMPILER) $< > $@
|
||||
|
||||
ps_%.asm: ps_%.cg
|
||||
$(CGC) -profile fp20 $< -o $@
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -5,3 +5,7 @@ To see debug log messages in Xemu:
|
|||
----
|
||||
|
||||
To launch directly, `-dvd_path cc-xbox.iso`
|
||||
|
||||
####
|
||||
|
||||
The .asm files are auto generated from the .cg files, and shouldn't be manually edited.
|
||||
|
|
|
|||
|
|
@ -0,0 +1,14 @@
|
|||
// nvparse 1.0 output generated by NVIDIA Cg compiler
|
||||
// cgc version 3.1.0013, build date Apr 24 2012
|
||||
// command line args: -profile fp20
|
||||
// source file: misc/xbox/ps_coloured.cg
|
||||
//vendor NVIDIA Corporation
|
||||
//version 3.1.0.13
|
||||
//profile fp20
|
||||
//program main
|
||||
//var float4 input.color : $vin.COLOR : COLOR0 : 0 : 1
|
||||
//var float4 main : $vout.COLOR : COLOR : -1 : 1
|
||||
!!RC1.0
|
||||
out.rgb = unsigned(col0.rgb);
|
||||
out.a = unsigned(col0.a);
|
||||
// 0 instructions
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
// nvparse 1.0 output generated by NVIDIA Cg compiler
|
||||
// cgc version 3.1.0013, build date Apr 24 2012
|
||||
// command line args: -profile fp20
|
||||
// source file: misc/xbox/ps_textured.cg
|
||||
//vendor NVIDIA Corporation
|
||||
//version 3.1.0.13
|
||||
//profile fp20
|
||||
//program main
|
||||
//semantic main.tex
|
||||
//var sampler2D tex : : 0 : 1 : 1
|
||||
//var float4 input.color : $vin.COLOR : COLOR0 : 0 : 1
|
||||
//var float2 input.tex0 : $vin.TEXCOORD0 : TEXCOORD0 : 0 : 1
|
||||
//var float4 main : $vout.COLOR : COLOR : -1 : 1
|
||||
!!TS1.0
|
||||
texture_2d();
|
||||
// End of program
|
||||
!!RC1.0
|
||||
{
|
||||
rgb
|
||||
{
|
||||
col0 = tex0.rgb * col0.rgb;
|
||||
}
|
||||
alpha
|
||||
{
|
||||
col0 = tex0.a * col0.a;
|
||||
}
|
||||
}
|
||||
out.rgb = unsigned(col0.rgb);
|
||||
out.a = unsigned(col0.a);
|
||||
// 3 instructions
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
!!VP1.1
|
||||
# cgc version 3.1.0013, build date Apr 24 2012
|
||||
# command line args: -profile vp20
|
||||
# source file: misc/xbox/vs_coloured.cg
|
||||
#vendor NVIDIA Corporation
|
||||
#version 3.1.0.13
|
||||
#profile vp20
|
||||
#program main
|
||||
#semantic main.mvp
|
||||
#var float4 input.col : $vin.DIFFUSE : ATTR3 : 0 : 1
|
||||
#var float4 input.pos : $vin.POSITION : ATTR0 : 0 : 1
|
||||
#var float4x4 mvp : : c[0], 4 : 1 : 1
|
||||
#var float4 main.col : $vout.COLOR : COL0 : -1 : 1
|
||||
#var float4 main.pos : $vout.POSITION : HPOS : -1 : 1
|
||||
MUL R0, v[0].y, c[1];
|
||||
MAD R0, v[0].x, c[0], R0;
|
||||
MAD R0, v[0].z, c[2], R0;
|
||||
ADD R0, R0, c[3];
|
||||
RCP R1.x, R0.w;
|
||||
MUL o[HPOS].xyz, R0, R1.x;
|
||||
MOV o[COL0], v[3];
|
||||
MOV o[HPOS].w, R0;
|
||||
END
|
||||
# 8 instructions, 0 R-regs
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
!!VP1.1
|
||||
# cgc version 3.1.0013, build date Apr 24 2012
|
||||
# command line args: -profile vp20
|
||||
# source file: misc/xbox/vs_offset.cg
|
||||
#vendor NVIDIA Corporation
|
||||
#version 3.1.0.13
|
||||
#profile vp20
|
||||
#program main
|
||||
#semantic main.mvp
|
||||
#semantic main.tex_offset
|
||||
#var float4 input.tex : $vin.TEXCOORD : TEXCOORD0 : 0 : 1
|
||||
#var float4 input.col : $vin.DIFFUSE : ATTR3 : 0 : 1
|
||||
#var float4 input.pos : $vin.POSITION : ATTR0 : 0 : 1
|
||||
#var float4x4 mvp : : c[0], 4 : 1 : 1
|
||||
#var float4 tex_offset : : c[4] : 2 : 1
|
||||
#var float4 main.pos : $vout.POSITION : HPOS : -1 : 1
|
||||
#var float4 main.col : $vout.COLOR : COL0 : -1 : 1
|
||||
#var float4 main.tex : $vout.TEXCOORD0 : TEX0 : -1 : 1
|
||||
MUL R0, v[0].y, c[1];
|
||||
MAD R0, v[0].x, c[0], R0;
|
||||
MAD R0, v[0].z, c[2], R0;
|
||||
ADD R0, R0, c[3];
|
||||
RCP R1.x, R0.w;
|
||||
MUL o[HPOS].xyz, R0, R1.x;
|
||||
MOV o[HPOS].w, R0;
|
||||
MOV o[COL0], v[3];
|
||||
ADD o[TEX0], v[8], c[4];
|
||||
END
|
||||
# 9 instructions, 0 R-regs
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
// cgc version 3.1.0013, build date Apr 24 2012
|
||||
// command line args: -profile vp20
|
||||
// source file: misc/xbox/vs_offset.vs.cg
|
||||
// source file: misc/xbox/vs_offset.cg
|
||||
//vendor NVIDIA Corporation
|
||||
//version 3.1.0.13
|
||||
//profile vp20
|
||||
|
|
|
|||
|
|
@ -0,0 +1,27 @@
|
|||
!!VP1.1
|
||||
# cgc version 3.1.0013, build date Apr 24 2012
|
||||
# command line args: -profile vp20
|
||||
# source file: misc/xbox/vs_textured.cg
|
||||
#vendor NVIDIA Corporation
|
||||
#version 3.1.0.13
|
||||
#profile vp20
|
||||
#program main
|
||||
#semantic main.mvp
|
||||
#var float4 input.tex : $vin.TEXCOORD : TEXCOORD0 : 0 : 1
|
||||
#var float4 input.col : $vin.DIFFUSE : ATTR3 : 0 : 1
|
||||
#var float4 input.pos : $vin.POSITION : ATTR0 : 0 : 1
|
||||
#var float4x4 mvp : : c[0], 4 : 1 : 1
|
||||
#var float4 main.pos : $vout.POSITION : HPOS : -1 : 1
|
||||
#var float4 main.col : $vout.COLOR : COL0 : -1 : 1
|
||||
#var float4 main.tex : $vout.TEXCOORD0 : TEX0 : -1 : 1
|
||||
MUL R0, v[0].y, c[1];
|
||||
MAD R0, v[0].x, c[0], R0;
|
||||
MAD R0, v[0].z, c[2], R0;
|
||||
ADD R0, R0, c[3];
|
||||
RCP R1.x, R0.w;
|
||||
MUL o[HPOS].xyz, R0, R1.x;
|
||||
MOV o[HPOS].w, R0;
|
||||
MOV o[COL0], v[3];
|
||||
MOV o[TEX0], v[8];
|
||||
END
|
||||
# 9 instructions, 0 R-regs
|
||||
|
|
@ -250,10 +250,8 @@ enum
|
|||
|
||||
static bool C3D_FrameBegin(u8 flags);
|
||||
static bool C3D_FrameDrawOn(C3D_RenderTarget* target);
|
||||
static void C3D_FrameSplit(u8 flags);
|
||||
static void C3D_FrameEnd(u8 flags);
|
||||
|
||||
static void C3D_RenderTargetDelete(C3D_RenderTarget* target);
|
||||
static void C3D_RenderTargetSetOutput(C3D_RenderTarget* target, gfxScreen_t screen, gfx3dSide_t side, u32 transferFlags);
|
||||
|
||||
static inline void C3D_RenderTargetDetachOutput(C3D_RenderTarget* target)
|
||||
|
|
@ -832,8 +830,6 @@ static C3D_RenderTarget *linkedTarget[3];
|
|||
static bool inFrame, inSafeTransfer;
|
||||
static bool swapPending, isTopStereo;
|
||||
|
||||
static void C3Di_RenderTargetDestroy(C3D_RenderTarget* target);
|
||||
|
||||
static void onQueueFinish(gxCmdQueue_s* queue)
|
||||
{
|
||||
if (inSafeTransfer)
|
||||
|
|
@ -907,20 +903,15 @@ static bool C3D_FrameDrawOn(C3D_RenderTarget* target)
|
|||
return true;
|
||||
}
|
||||
|
||||
static void C3D_FrameSplit(u8 flags)
|
||||
{
|
||||
u32 *cmdBuf, cmdBufSize;
|
||||
if (!inFrame) return;
|
||||
if (C3Di_SplitFrame(&cmdBuf, &cmdBufSize))
|
||||
GX_ProcessCommandList(cmdBuf, cmdBufSize*4, flags);
|
||||
}
|
||||
|
||||
static void C3D_FrameEnd(u8 flags)
|
||||
{
|
||||
C3D_Context* ctx = C3Di_GetContext();
|
||||
if (!inFrame) return;
|
||||
|
||||
C3D_FrameSplit(flags);
|
||||
u32 *cmdBuf, cmdBufSize;
|
||||
if (C3Di_SplitFrame(&cmdBuf, &cmdBufSize))
|
||||
GX_ProcessCommandList(cmdBuf, cmdBufSize*4, flags);
|
||||
|
||||
GPUCMD_SetBuffer(NULL, 0, 0);
|
||||
inFrame = false;
|
||||
|
||||
|
|
@ -984,23 +975,6 @@ static void C3D_RenderTargetDepth(C3D_RenderTarget* target, GPU_DEPTHBUF depthFm
|
|||
C3D_FrameBufDepth(fb, depthBuf, depthFmt);
|
||||
}
|
||||
|
||||
static void C3Di_RenderTargetDestroy(C3D_RenderTarget* target)
|
||||
{
|
||||
vramFree(target->frameBuf.colorBuf);
|
||||
vramFree(target->frameBuf.depthBuf);
|
||||
}
|
||||
|
||||
static void C3D_RenderTargetDelete(C3D_RenderTarget* target)
|
||||
{
|
||||
if (inFrame)
|
||||
svcBreak(USERBREAK_PANIC); // Shouldn't happen.
|
||||
if (target->linked)
|
||||
C3D_RenderTargetDetachOutput(target);
|
||||
else
|
||||
C3Di_WaitAndClearQueue(-1);
|
||||
C3Di_RenderTargetDestroy(target);
|
||||
}
|
||||
|
||||
static void C3D_RenderTargetSetOutput(C3D_RenderTarget* target, gfxScreen_t screen, gfx3dSide_t side, u32 transferFlags)
|
||||
{
|
||||
int id = 0;
|
||||
|
|
@ -1079,6 +1053,9 @@ static void C3Di_OnRestore(void)
|
|||
ctx->flags |= C3DiF_FogLut;
|
||||
}
|
||||
|
||||
#define GXQUEUE_MAX_ENTRIES 32
|
||||
static gxCmdEntry_s queue_entries[GXQUEUE_MAX_ENTRIES];
|
||||
|
||||
static bool C3D_Init(size_t cmdBufSize)
|
||||
{
|
||||
int i;
|
||||
|
|
@ -1093,13 +1070,8 @@ static bool C3D_Init(size_t cmdBufSize)
|
|||
if (!ctx->cmdBuf)
|
||||
return false;
|
||||
|
||||
ctx->gxQueue.maxEntries = 32;
|
||||
ctx->gxQueue.entries = (gxCmdEntry_s*)malloc(ctx->gxQueue.maxEntries*sizeof(gxCmdEntry_s));
|
||||
if (!ctx->gxQueue.entries)
|
||||
{
|
||||
linearFree(ctx->cmdBuf);
|
||||
return false;
|
||||
}
|
||||
ctx->gxQueue.maxEntries = GXQUEUE_MAX_ENTRIES;
|
||||
ctx->gxQueue.entries = queue_entries;
|
||||
|
||||
ctx->flags = C3DiF_Active | C3DiF_TexEnvBuf | C3DiF_Effect | C3DiF_TexStatus | C3DiF_TexAll | C3DiF_Reset;
|
||||
|
||||
|
|
@ -1308,7 +1280,6 @@ static void C3D_Fini(void)
|
|||
return;
|
||||
|
||||
C3Di_RenderQueueExit();
|
||||
free(ctx->gxQueue.entries);
|
||||
linearFree(ctx->cmdBuf);
|
||||
ctx->flags = 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue