Fixup .gsh files

This commit is contained in:
UnknownShadow200 2025-03-14 18:30:17 +11:00
parent 5cad6edec0
commit c731d5770c
9 changed files with 20 additions and 18 deletions

View File

@ -80,15 +80,13 @@ export DEPSDIR := $(CURDIR)/$(BUILD)
CFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*))) \
$(foreach dir,$(SHADERS),$(notdir $(wildcard $(dir)/*.gsh)))
BINFILES := $(foreach dir,$(SHADERS),$(notdir $(wildcard $(dir)/*.gsh)))
export LD := $(CC)
export OFILES_BIN := $(addsuffix .o,$(BINFILES))
export OFILES_SRC := $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) $(SFILES:.s=.o)
export OFILES := $(OFILES_BIN) $(OFILES_SRC)
export HFILES_BIN := $(addsuffix .h,$(subst .,_,$(BINFILES)))
export INCLUDE := $(foreach dir,$(INCLUDES),-I$(CURDIR)/$(dir)) \
$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
@ -153,8 +151,6 @@ $(OUTPUT).wuhb : $(OUTPUT).rpx
$(OUTPUT).rpx : $(OUTPUT).elf
$(OUTPUT).elf : $(OFILES)
$(OFILES_SRC) : $(HFILES_BIN)
# you need a rule like this for each extension you use as binary data
#-------------------------------------------------------------------------------
%.bin.o %_bin.h : %.bin

View File

@ -1,5 +1,11 @@
ASSEMBLER=/home/minty/emulators/decaf-emu-ubuntu-20.04/bin/latte-assembler
$ASSEMBLER assemble coloured.gsh --vsh coloured.vsh --psh coloured.psh
$ASSEMBLER assemble textured.gsh --vsh textured.vsh --psh textured.psh
$ASSEMBLER assemble textured_offset.gsh --vsh textured_offset.vsh
assemble()
{
echo "Assembling $1 from VS $2 + PS $3"
$ASSEMBLER assemble $1 --vsh $2 --psh $3
}
assemble coloured_none.gsh vs_coloured.vsh ps_coloured_none.psh
assemble textured_none.gsh vs_textured.vsh ps_textured_none.psh
assemble textured_ofst.gsh vs_textured_offset.vsh ps_textured_none.psh

BIN
misc/wiiu/coloured_none.gsh Normal file

Binary file not shown.

View File

@ -25,7 +25,7 @@
; -------- Disassembly --------------------
00 TEX: ADDR(48) CNT(1) VALID_PIX
0 SAMPLE R2, R2.xy0x, t0, s0
01 ALU: ADDR(32) CNT(14)
01 ALU: ADDR(32) CNT(4)
1 x: MUL ____, R1.y, R2.y
y: MUL ____, R1.x, R2.x
z: MUL ____, R1.z, R2.z

View File

@ -25,7 +25,7 @@
; -------- Disassembly --------------------
00 TEX: ADDR(48) CNT(1) VALID_PIX
0 SAMPLE R2, R2.xy0x, t0, s0
01 ALU: ADDR(32) CNT(13)
01 ALU: ADDR(32) CNT(4)
1 x: MUL ____, R1.x, R2.x
y: MUL ____, R1.z, R2.z
z: MUL ____, R1.y, R2.y

BIN
misc/wiiu/textured_none.gsh Normal file

Binary file not shown.

BIN
misc/wiiu/textured_ofst.gsh Normal file

Binary file not shown.

View File

@ -69,9 +69,9 @@ static void CompileFetchShaders(void) {
/*########################################################################################################################*
*---------------------------------------------------------General---------------------------------------------------------*
*#########################################################################################################################*/
extern const uint8_t coloured_gsh[];
extern const uint8_t textured_gsh[];
extern const uint8_t textured_offset_gsh[];
extern const uint8_t coloured_none_gsh[];
extern const uint8_t textured_none_gsh[];
extern const uint8_t textured_ofst_gsh[];
static GX2VertexShader *texture_VS, *colour_VS, *offset_VS;
static GX2PixelShader *texture_PS, *colour_PS;
@ -85,13 +85,13 @@ static void InitGfx(void) {
CompileFetchShaders();
GX2InitSampler(&sampler, GX2_TEX_CLAMP_MODE_WRAP, GX2_TEX_XY_FILTER_MODE_POINT);
colour_VS = WHBGfxLoadGFDVertexShader(0, coloured_gsh);
colour_PS = WHBGfxLoadGFDPixelShader(0, coloured_gsh);
colour_VS = WHBGfxLoadGFDVertexShader(0, coloured_none_gsh);
colour_PS = WHBGfxLoadGFDPixelShader(0, coloured_none_gsh);
texture_VS = WHBGfxLoadGFDVertexShader(0, textured_gsh);
texture_PS = WHBGfxLoadGFDPixelShader(0, textured_gsh);
texture_VS = WHBGfxLoadGFDVertexShader(0, textured_none_gsh);
texture_PS = WHBGfxLoadGFDPixelShader(0, textured_none_gsh);
offset_VS = WHBGfxLoadGFDVertexShader(0, textured_offset_gsh);
offset_VS = WHBGfxLoadGFDVertexShader(0, textured_ofst_gsh);
}
void Gfx_Create(void) {