diff --git a/Makefile b/Makefile index 9124573..f491ca1 100644 --- a/Makefile +++ b/Makefile @@ -75,8 +75,8 @@ OBJS := $(addsuffix .o,$(BINFILES)) $(CFILES:.c=.o) $(CPPFILES:.cpp=.o) PREFIX = arm-vita-eabi CC = $(PREFIX)-gcc CXX = $(PREFIX)-g++ -CFLAGS = -w -fno-lto -Wl,-q -Wall -O3 -g -Did386="0" -DGLQUAKE -DHAVE_OGGVORBIS -DHAVE_MPG123 -DHAVE_LIBSPEEXDSP -DUSE_AUDIO_RESAMPLER -DWANT_FMMIDI=1 -DQUAKE2RJ -DRJNET -fno-short-enums -ffast-math -CXXFLAGS = $(CFLAGS) -fno-exceptions -std=gnu++11 +CFLAGS = -w -Wl,-q -Wall -O3 -g -Did386="0" -DGLQUAKE -DHAVE_OGGVORBIS -DHAVE_MPG123 -DHAVE_LIBSPEEXDSP -DUSE_AUDIO_RESAMPLER -DWANT_FMMIDI=1 -DQUAKE2RJ -DRJNET -fno-short-enums -ffast-math +CXXFLAGS = $(CFLAGS) -fpermissive -fno-exceptions -std=gnu++11 ASFLAGS = $(CFLAGS) all: $(TARGET).vpk @@ -87,7 +87,7 @@ $(TARGET).vpk: $(TARGET).velf cp -f param.sfo build/sce_sys/param.sfo #------------ Comment this if you don't have 7zip ------------------ - 7z a -tzip ../$(TARGET).vpk -r build\sce_sys\* build\eboot.bin + 7z a -tzip $(TARGET).vpk -r ./build/sce_sys ./build/eboot.bin ./build/shaders #------------------------------------------------------------------- %.velf: %.elf @@ -98,7 +98,7 @@ $(TARGET).elf: $(OBJS) $(CXX) $(CXXFLAGS) $^ $(LIBS) -o $@ clean: - @rm -rf $(TARGET).velf $(TARGET).elf $(OBJS) + @rm -rf $(TARGET).velf $(TARGET).elf $(OBJS) $(TARGET).elf.unstripped.elf $(TARGET).vpk build/eboot.bin build/sce_sys/param.sfo ./param.sfo run: $(TARGET).velf @sh run_homebrew_unity.sh $(TARGET).velf diff --git a/build/shaders/modulate_alpha_f.gxp b/build/shaders/modulate_alpha_f.gxp new file mode 100644 index 0000000..e685f10 Binary files /dev/null and b/build/shaders/modulate_alpha_f.gxp differ diff --git a/build/shaders/modulate_f.gxp b/build/shaders/modulate_f.gxp new file mode 100644 index 0000000..204d95d Binary files /dev/null and b/build/shaders/modulate_f.gxp differ diff --git a/build/shaders/modulate_rgba_alpha_f.gxp b/build/shaders/modulate_rgba_alpha_f.gxp new file mode 100644 index 0000000..649c410 Binary files /dev/null and b/build/shaders/modulate_rgba_alpha_f.gxp differ diff --git a/build/shaders/modulate_rgba_f.gxp b/build/shaders/modulate_rgba_f.gxp new file mode 100644 index 0000000..b70351a Binary files /dev/null and b/build/shaders/modulate_rgba_f.gxp differ diff --git a/build/shaders/replace_alpha_f.gxp b/build/shaders/replace_alpha_f.gxp new file mode 100644 index 0000000..2ab2d60 Binary files /dev/null and b/build/shaders/replace_alpha_f.gxp differ diff --git a/build/shaders/replace_f.gxp b/build/shaders/replace_f.gxp new file mode 100644 index 0000000..2efd302 Binary files /dev/null and b/build/shaders/replace_f.gxp differ diff --git a/build/shaders/rgba_alpha_f.gxp b/build/shaders/rgba_alpha_f.gxp new file mode 100644 index 0000000..75ea3f1 Binary files /dev/null and b/build/shaders/rgba_alpha_f.gxp differ diff --git a/build/shaders/rgba_f.gxp b/build/shaders/rgba_f.gxp new file mode 100644 index 0000000..aa503e8 Binary files /dev/null and b/build/shaders/rgba_f.gxp differ diff --git a/build/shaders/rgba_v.gxp b/build/shaders/rgba_v.gxp new file mode 100644 index 0000000..6073361 Binary files /dev/null and b/build/shaders/rgba_v.gxp differ diff --git a/build/shaders/texture2d_rgba_v.gxp b/build/shaders/texture2d_rgba_v.gxp new file mode 100644 index 0000000..e7f3fcf Binary files /dev/null and b/build/shaders/texture2d_rgba_v.gxp differ diff --git a/build/shaders/texture2d_v.gxp b/build/shaders/texture2d_v.gxp new file mode 100644 index 0000000..de62d57 Binary files /dev/null and b/build/shaders/texture2d_v.gxp differ diff --git a/build/shaders/vertex_f.gxp b/build/shaders/vertex_f.gxp new file mode 100644 index 0000000..2cc880b Binary files /dev/null and b/build/shaders/vertex_f.gxp differ diff --git a/build/shaders/vertex_v.gxp b/build/shaders/vertex_v.gxp new file mode 100644 index 0000000..c344ed0 Binary files /dev/null and b/build/shaders/vertex_v.gxp differ diff --git a/shaders/modulate_alpha_f.cg b/shaders/modulate_alpha_f.cg new file mode 100644 index 0000000..72b7232 --- /dev/null +++ b/shaders/modulate_alpha_f.cg @@ -0,0 +1,10 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + uniform float4 vColor, + uniform sampler2D tex + ) +{ + float4 c = tex2D(tex, vTexcoord) * vColor; + if (c.a > 0.666) return c; + else discard; +} diff --git a/shaders/modulate_f.cg b/shaders/modulate_f.cg new file mode 100644 index 0000000..e26b7b3 --- /dev/null +++ b/shaders/modulate_f.cg @@ -0,0 +1,8 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + uniform float4 vColor, + uniform sampler2D tex + ) +{ + return tex2D(tex, vTexcoord) * vColor; +} diff --git a/shaders/modulate_rgba_alpha_f.cg b/shaders/modulate_rgba_alpha_f.cg new file mode 100644 index 0000000..ebc1080 --- /dev/null +++ b/shaders/modulate_rgba_alpha_f.cg @@ -0,0 +1,10 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + float4 vColor : COLOR, + uniform sampler2D tex + ) +{ + float4 c = tex2D(tex, vTexcoord) * vColor; + if (c.a > 0.666) return c; + else discard; +} diff --git a/shaders/modulate_rgba_f.cg b/shaders/modulate_rgba_f.cg new file mode 100644 index 0000000..950e94f --- /dev/null +++ b/shaders/modulate_rgba_f.cg @@ -0,0 +1,8 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + float4 vColor : COLOR, + uniform sampler2D tex + ) +{ + return tex2D(tex, vTexcoord) * vColor; +} diff --git a/shaders/replace_alpha_f.cg b/shaders/replace_alpha_f.cg new file mode 100644 index 0000000..ecfe41b --- /dev/null +++ b/shaders/replace_alpha_f.cg @@ -0,0 +1,9 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + uniform sampler2D tex + ) +{ + float4 c = tex2D(tex, vTexcoord); + if (c.a > 0.666) return c; + else discard; +} diff --git a/shaders/replace_f.cg b/shaders/replace_f.cg new file mode 100644 index 0000000..06ad7df --- /dev/null +++ b/shaders/replace_f.cg @@ -0,0 +1,7 @@ +float4 main( + float2 vTexcoord : TEXCOORD0, + uniform sampler2D tex + ) +{ + return tex2D(tex, vTexcoord); +} diff --git a/shaders/rgba_alpha_f.cg b/shaders/rgba_alpha_f.cg new file mode 100644 index 0000000..c579ba8 --- /dev/null +++ b/shaders/rgba_alpha_f.cg @@ -0,0 +1,5 @@ +float4 main(float4 vColor : COLOR) : COLOR +{ + if (vColor.a > 0.666) return vColor; + else discard; +} diff --git a/shaders/rgba_f.cg b/shaders/rgba_f.cg new file mode 100644 index 0000000..39ef1af --- /dev/null +++ b/shaders/rgba_f.cg @@ -0,0 +1,4 @@ +float4 main(float4 vColor : COLOR) : COLOR +{ + return vColor; +} diff --git a/shaders/rgba_v.cg b/shaders/rgba_v.cg new file mode 100644 index 0000000..93786fd --- /dev/null +++ b/shaders/rgba_v.cg @@ -0,0 +1,11 @@ +void main( + float3 aPosition, + float4 aColor, + column_major uniform float4x4 wvp, + float4 out vPosition: POSITION, + float4 out vColor: COLOR) +{ + vPosition = mul(float4(aPosition, 1.f), wvp); + vColor = aColor; +} + diff --git a/shaders/texture2d_rgba_v.cg b/shaders/texture2d_rgba_v.cg new file mode 100644 index 0000000..043f635 --- /dev/null +++ b/shaders/texture2d_rgba_v.cg @@ -0,0 +1,13 @@ +void main( + float3 position, + float2 texcoord, + float4 color, + column_major uniform float4x4 wvp, + float4 out vPosition : POSITION, + float2 out vTexcoord : TEXCOORD0, + float4 out vColor : COLOR) +{ + vPosition = mul(float4(position, 1.f), wvp); + vTexcoord = texcoord; + vColor = color; +} diff --git a/shaders/texture2d_v.cg b/shaders/texture2d_v.cg new file mode 100644 index 0000000..094371d --- /dev/null +++ b/shaders/texture2d_v.cg @@ -0,0 +1,10 @@ +void main( + float3 position, + float2 texcoord, + column_major uniform float4x4 wvp, + float4 out vPosition : POSITION, + float2 out vTexcoord : TEXCOORD0) +{ + vPosition = mul(float4(position, 1.f), wvp); + vTexcoord = texcoord; +} diff --git a/shaders/vertex_f.cg b/shaders/vertex_f.cg new file mode 100644 index 0000000..71d9f39 --- /dev/null +++ b/shaders/vertex_f.cg @@ -0,0 +1,4 @@ +float4 main(uniform float4 color) : COLOR +{ + return color; +} diff --git a/shaders/vertex_v.cg b/shaders/vertex_v.cg new file mode 100644 index 0000000..010f280 --- /dev/null +++ b/shaders/vertex_v.cg @@ -0,0 +1,8 @@ +void main( + float3 aPosition, + column_major uniform float4x4 wvp, + float4 out vPosition: POSITION) +{ + vPosition = mul(float4(aPosition, 1.f), wvp); +} +