From 163c6d6493a1f26d69f7be4cec677bbe69078a3c Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Mon, 18 Sep 2023 21:16:34 +1000 Subject: [PATCH] Vita: Add missing files --- misc/vita/Makefile | 2 +- misc/vita/colored_alpha_f.cg | 7 ++++ misc/vita/colored_alpha_f.gxp | Bin 0 -> 304 bytes misc/vita/colored_alpha_f.h | 21 ++++++++++++ misc/vita/colored_f.cg | 5 +++ misc/vita/colored_f.gxp | Bin 0 -> 212 bytes misc/vita/colored_f.h | 16 +++++++++ misc/vita/colored_v.cg | 10 ++++++ misc/vita/colored_v.gxp | Bin 0 -> 320 bytes misc/vita/colored_v.h | 22 ++++++++++++ misc/vita/gxp_to_c.c | 60 +++++++++++++++++++++++++++++++++ misc/vita/readme.txt | 9 +++++ misc/vita/textured_alpha_f.cg | 10 ++++++ misc/vita/textured_alpha_f.gxp | Bin 0 -> 372 bytes misc/vita/textured_alpha_f.h | 26 ++++++++++++++ misc/vita/textured_f.cg | 7 ++++ misc/vita/textured_f.gxp | Bin 0 -> 288 bytes misc/vita/textured_f.h | 20 +++++++++++ misc/vita/textured_v.cg | 13 +++++++ misc/vita/textured_v.gxp | Bin 0 -> 348 bytes misc/vita/textured_v.h | 24 +++++++++++++ src/SystemFonts.c | 2 +- src/Window_PSVita.c | 2 +- 23 files changed, 253 insertions(+), 3 deletions(-) create mode 100644 misc/vita/colored_alpha_f.cg create mode 100644 misc/vita/colored_alpha_f.gxp create mode 100644 misc/vita/colored_alpha_f.h create mode 100644 misc/vita/colored_f.cg create mode 100644 misc/vita/colored_f.gxp create mode 100644 misc/vita/colored_f.h create mode 100644 misc/vita/colored_v.cg create mode 100644 misc/vita/colored_v.gxp create mode 100644 misc/vita/colored_v.h create mode 100644 misc/vita/gxp_to_c.c create mode 100644 misc/vita/readme.txt create mode 100644 misc/vita/textured_alpha_f.cg create mode 100644 misc/vita/textured_alpha_f.gxp create mode 100644 misc/vita/textured_alpha_f.h create mode 100644 misc/vita/textured_f.cg create mode 100644 misc/vita/textured_f.gxp create mode 100644 misc/vita/textured_f.h create mode 100644 misc/vita/textured_v.cg create mode 100644 misc/vita/textured_v.gxp create mode 100644 misc/vita/textured_v.h diff --git a/misc/vita/Makefile b/misc/vita/Makefile index b50004321..0f4a2a279 100644 --- a/misc/vita/Makefile +++ b/misc/vita/Makefile @@ -10,7 +10,7 @@ C_FILES := $(foreach dir,$(SOURCE_DIRS),$(wildcard $(dir)/*.c)) OBJS := $(addprefix $(BUILD_DIR)/, $(notdir $(C_FILES:%.c=%.o))) # Needed by psvDebugScreenPrintf -LIBS += -lm -lSceDisplay_stub -lSceCtrl_stub -lSceTouch_stub -lSceGxm_stub +LIBS += -lm -lSceDisplay_stub -lSceCtrl_stub -lSceTouch_stub -lSceGxm_stub -lScePvf_stub #--------------------------------------------------------------------------------- diff --git a/misc/vita/colored_alpha_f.cg b/misc/vita/colored_alpha_f.cg new file mode 100644 index 000000000..928d7105c --- /dev/null +++ b/misc/vita/colored_alpha_f.cg @@ -0,0 +1,7 @@ +float4 main( + float4 out_color: COLOR) : COLOR +{ + if (out_color.a < 0.5) discard; + + return out_color; +} \ No newline at end of file diff --git a/misc/vita/colored_alpha_f.gxp b/misc/vita/colored_alpha_f.gxp new file mode 100644 index 0000000000000000000000000000000000000000..00a87e885c7eea985662311e5b22cbb4f7dea6c7 GIT binary patch literal 304 zcmZ>d2w-4jWnea7WPk%s0SP!8#^3B5D`uc>28KC63<6sq6vGlI4H5^LJq5}~P>d`faTXxvUvPmBByIpApnx65V08J_ z)4)7o;;~K-pg|891R5tcFfcseU}y|wWZ*JrW$f?(D*eF5V(=5B#etFK2Z&~1clpKC cAi1E9x4{A8HwFeKpfHRLG>JhNqz>qM0G5j!-T(jq literal 0 HcmV?d00001 diff --git a/misc/vita/colored_alpha_f.h b/misc/vita/colored_alpha_f.h new file mode 100644 index 000000000..25f508df4 --- /dev/null +++ b/misc/vita/colored_alpha_f.h @@ -0,0 +1,21 @@ +const char colored_alpha_f[304] = { + 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x00, 0x03, 0x30, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x01, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x09, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x90, 0x3a, 0x03, 0x00, + 0x03, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x94, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0f, 0xa0, 0xd0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0xfa, + 0x8c, 0x80, 0x03, 0x90, 0x91, 0xc6, 0x89, 0x48, 0x00, 0x01, 0x00, 0xe0, 0x00, 0x10, 0x81, 0x91, + 0x80, 0x00, 0x00, 0xe0, 0x08, 0x00, 0x81, 0x55, 0x01, 0x00, 0x0a, 0x30, 0x85, 0x01, 0x88, 0x48, + 0x00, 0x00, 0x00, 0xf0, 0x06, 0x04, 0x30, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x04, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xfa, 0x02, 0x80, 0x19, 0xa0, 0x7e, 0x0d, 0x80, 0x40, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00 +}; \ No newline at end of file diff --git a/misc/vita/colored_f.cg b/misc/vita/colored_f.cg new file mode 100644 index 000000000..7d23a719e --- /dev/null +++ b/misc/vita/colored_f.cg @@ -0,0 +1,5 @@ +float4 main( + float4 out_color: COLOR) : COLOR +{ + return out_color; +} \ No newline at end of file diff --git a/misc/vita/colored_f.gxp b/misc/vita/colored_f.gxp new file mode 100644 index 0000000000000000000000000000000000000000..f626c95a7f105caeb38ce8fbe370e381da41db77 GIT binary patch literal 212 zcmZ>d2w-4jWnjL-fB=jF5(o~IwFXER05J<(hLM2@$Zmo1D}ZzfTn>|w0~DHI#SE56 vfJ#R|=>RD00i_+FG=gGeVFYqOcJnW|zy}gH01?Q5-Q^ckgXDrb-UbH%bc77# literal 0 HcmV?d00001 diff --git a/misc/vita/colored_f.h b/misc/vita/colored_f.h new file mode 100644 index 000000000..234ce8615 --- /dev/null +++ b/misc/vita/colored_f.h @@ -0,0 +1,16 @@ +const char colored_f[212] = { + 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x00, 0x03, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x10, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6c, 0x00, 0x00, 0x00, 0x90, 0x3a, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x0f, 0xa0, 0xd0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xfa, 0x02, 0x80, 0x19, 0xa0, + 0x7e, 0x0d, 0x80, 0x40 +}; \ No newline at end of file diff --git a/misc/vita/colored_v.cg b/misc/vita/colored_v.cg new file mode 100644 index 000000000..a9d1b3b05 --- /dev/null +++ b/misc/vita/colored_v.cg @@ -0,0 +1,10 @@ +void main( + float3 in_position, + float4 in_color, + uniform float4x4 mvp_matrix, + out float4 out_position: POSITION, + out float4 out_color: COLOR) +{ + out_position = mul(mvp_matrix, float4(in_position, 1.0f)); + out_color = in_color; +} \ No newline at end of file diff --git a/misc/vita/colored_v.gxp b/misc/vita/colored_v.gxp new file mode 100644 index 0000000000000000000000000000000000000000..113ce7e54bab4cfcbbd4f683710ed2e41a98df39 GIT binary patch literal 320 zcmZ>d2w-4jWngw-WIzIvAhrNZfEma*0mKDB%mEi>WMBpI8-N%DN`M$7j}3qfY5?L1 zRv?ogYLV#_uqXpV43GvnBLvF-4yECg1kieHfZgR+0|Q61qHKc&Q$yqWIlK)H42x_J zG#X5hU|>*Kz!0GRn-8o{fWZJnvq0 +#include +#include +#include + +// Inspired by the public domain bin2c https://github.com/gwilymk/bin2c +// TODO: log errors +void convert_gxp(const char* src) { + char* copy = strdup(src); + char* name = strtok(copy, "."); + char dst[256]; + sprintf(dst, "%s.h", name); + printf(" %s --> %s\n", src, dst); + + FILE* file_in = fopen(src, "r"); + if (!file_in) return; + + FILE* file_out = fopen(dst, "w"); + if (!file_out) return; + + fseek(file_in, 0, SEEK_END); + int file_size = ftell(file_in); + fseek(file_in, 0, SEEK_SET); + + char* data = malloc(file_size); + fread(data, file_size, 1, file_in); + fclose(file_in); + + int comma = 0; + fprintf(file_out, "const char %s[%i] = {", name, file_size); + + for (int i = 0; i < file_size; i++) + { + if (comma) fprintf(file_out, ", "); + if ((i % 16) == 0) fprintf(file_out, "\n\t"); + + fprintf(file_out, "0x%.2x", data[i] & 0xFF); + comma = 1; + } + + fprintf(file_out, "\n};"); + fclose(file_out); +} + +int main(void) { + struct dirent* e; + DIR* d = opendir("."); + if (!d) return 0; + + while ((e = readdir(d))) { + printf("checking %s\n", e->d_name); + + if (strstr(e->d_name, ".gxp")) { + convert_gxp(e->d_name); + } + } + + closedir(d); + return 0; +} diff --git a/misc/vita/readme.txt b/misc/vita/readme.txt new file mode 100644 index 000000000..e34f0eafb --- /dev/null +++ b/misc/vita/readme.txt @@ -0,0 +1,9 @@ +Shaders on the PS Vita use the proprietary .gxp binary format + +To compile CG shaders to .gxp you need to use +1) Extract libshacccg.suprx - see https://cimmerian.gitbook.io/vita-troubleshooting-guide/shader-compiler/extract-libshacccg.suprx +2) Use vitaShaRK to compile the CG shader (see sample 3 in https://github.com/Rinnegatamante/vitaShaRK for some reference) + +You can then use compiled gxp_to_c to convert all the .gxp shaders into .h files, which src/Graphics_PSVita.c can then include + +Note that you only need to perform these steps if you want to compile modified shaders - you don't need libshacccg.suprx to run ClassiCube \ No newline at end of file diff --git a/misc/vita/textured_alpha_f.cg b/misc/vita/textured_alpha_f.cg new file mode 100644 index 000000000..1945904bd --- /dev/null +++ b/misc/vita/textured_alpha_f.cg @@ -0,0 +1,10 @@ +float4 main( + uniform sampler2D tex, + float4 out_color: COLOR, + float2 out_texcoord : TEXCOORD0) : COLOR +{ + float4 color = tex2D(tex, out_texcoord) * out_color; + + if (color.a < 0.5) discard; + return color; +} \ No newline at end of file diff --git a/misc/vita/textured_alpha_f.gxp b/misc/vita/textured_alpha_f.gxp new file mode 100644 index 0000000000000000000000000000000000000000..cec48c152ca3f973fde0b1ab9e7d1c13a0bde54c GIT binary patch literal 372 zcmZ>d2w-4jWneC0WPk%s2?;P8CIq4-fJ6b1=3roks$*i{2C_P!yb2&)0%gM}m`V`; z0uWEIVg~D8166PYN^gPEAaRggOMrL>R188fvM>T=SU{YW7x+Nb2Ou^8F@S&*LIE|q z{9+}F>f50TrII)3&;Q<#zV<;m7*M?Tc4iBK# z4{R(3KS4$~FtYpr(G2V^zu1~27u4}KIKaYy2`CI>Gdy5m5C*9O`Ud0%Ca~+k0t}4E No`wjakR_=V3;;6}Coup3 literal 0 HcmV?d00001 diff --git a/misc/vita/textured_alpha_f.h b/misc/vita/textured_alpha_f.h new file mode 100644 index 000000000..e07981e97 --- /dev/null +++ b/misc/vita/textured_alpha_f.h @@ -0,0 +1,26 @@ +const char textured_alpha_f[372] = { + 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x00, 0x03, 0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x0b, 0x00, 0x00, 0x00, + 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x90, 0x3a, 0x03, 0x00, + 0x03, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xac, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0xb8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0xa9, 0xd0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x44, 0xfa, + 0x02, 0x00, 0x84, 0xa0, 0x86, 0x41, 0xa4, 0x08, 0x43, 0x00, 0xc4, 0xa0, 0x8a, 0x41, 0xc0, 0x08, + 0x8c, 0x81, 0x03, 0x90, 0x91, 0xc6, 0x89, 0x48, 0x00, 0x01, 0x00, 0xe0, 0x02, 0x10, 0x81, 0x91, + 0x80, 0x00, 0x00, 0xe0, 0x0a, 0x00, 0x81, 0x55, 0x01, 0x00, 0x0a, 0xb0, 0x85, 0x01, 0x88, 0x48, + 0x00, 0x00, 0x00, 0xf0, 0x06, 0x04, 0x30, 0xf9, 0x00, 0x00, 0x00, 0x00, 0x40, 0x01, 0x04, 0xf8, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xfa, 0x06, 0x82, 0x19, 0xa0, 0x7e, 0x0d, 0x80, 0x40, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, + 0x30, 0x00, 0x00, 0x00, 0x02, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x74, 0x65, 0x78, 0x00 +}; \ No newline at end of file diff --git a/misc/vita/textured_f.cg b/misc/vita/textured_f.cg new file mode 100644 index 000000000..0386696af --- /dev/null +++ b/misc/vita/textured_f.cg @@ -0,0 +1,7 @@ +float4 main( + uniform sampler2D tex, + float4 out_color: COLOR, + float2 out_texcoord : TEXCOORD0) : COLOR +{ + return tex2D(tex, out_texcoord) * out_color; +} \ No newline at end of file diff --git a/misc/vita/textured_f.gxp b/misc/vita/textured_f.gxp new file mode 100644 index 0000000000000000000000000000000000000000..83df3e5e99c4200beb3d37b013a6c99a7580e6e6 GIT binary patch literal 288 zcmZ>d2w-4jWnfldWPk%!2?;P8CIq670C52jbAV+)1S110kZghSD}Zzfl#Pu7sheQM z43+|^1p$zGAdmr}7!sg#1dvXFvLO^B3nS1z77%CU1wIh<0f-Gi3>aW{`2}J+a5DU0 tYM8lx5AOj7wx*pxy1}7_pM{~#eTe`_Jrmd@h$cpeb08cnWJziT0|1;h7oh+E literal 0 HcmV?d00001 diff --git a/misc/vita/textured_f.h b/misc/vita/textured_f.h new file mode 100644 index 000000000..033305beb --- /dev/null +++ b/misc/vita/textured_f.h @@ -0,0 +1,20 @@ +const char textured_f[288] = { + 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x00, 0x03, 0x20, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x05, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc4, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x84, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x84, 0x00, 0x00, 0x00, 0x90, 0x3a, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x04, 0x01, 0x00, 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x00, 0xa9, 0xd0, 0x0e, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xfa, 0x00, 0x00, 0x00, 0x00, + 0x40, 0x09, 0x00, 0xf8, 0x02, 0x80, 0x99, 0xaf, 0xbc, 0x0d, 0xc0, 0x40, 0x06, 0x82, 0xb9, 0xaf, + 0xbc, 0x0d, 0x80, 0x40, 0x7c, 0x0f, 0x04, 0x00, 0x86, 0x47, 0xa4, 0x10, 0x30, 0x00, 0x00, 0x00, + 0x02, 0x04, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x00 +}; \ No newline at end of file diff --git a/misc/vita/textured_v.cg b/misc/vita/textured_v.cg new file mode 100644 index 000000000..4b822160f --- /dev/null +++ b/misc/vita/textured_v.cg @@ -0,0 +1,13 @@ +void main( + float3 in_position, + float4 in_color, + float2 in_texcoord, + uniform float4x4 mvp_matrix, + out float4 out_position : POSITION, + out float4 out_color : COLOR, + out float2 out_texcoord: TEXCOORD0) +{ + out_position = mul(mvp_matrix, float4(in_position, 1.0f)); + out_color = in_color; + out_texcoord = in_texcoord; +} \ No newline at end of file diff --git a/misc/vita/textured_v.gxp b/misc/vita/textured_v.gxp new file mode 100644 index 0000000000000000000000000000000000000000..46577ec51474c6fb5ca5be9c4c0cece3c27eec19 GIT binary patch literal 348 zcmZ>d2w-4jWnhkBWIzIvAhrNZfCb1n0mKDB%mWu@WMBpI8-N%DN`M$7j}3qfY5?L1 zR?J{&kXjIc(J2rvLky4xIU@wh{|-?Oc9EGY6Tb^Ks3-pFmr5>_&{L>QzSkIkZlOWj8DK?Kr#%O rdGQ7L#hE3U`FS9Aa(+&J5r|QeT9KTeUzEa-TUHRCn^;nmS-}7R8w@8r literal 0 HcmV?d00001 diff --git a/misc/vita/textured_v.h b/misc/vita/textured_v.h new file mode 100644 index 000000000..e8b212fc2 --- /dev/null +++ b/misc/vita/textured_v.h @@ -0,0 +1,24 @@ +const char textured_v[348] = { + 0x47, 0x58, 0x50, 0x00, 0x01, 0x05, 0x00, 0x03, 0x5c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0xc8, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x0c, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, + 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x70, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x90, 0x3a, 0x03, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, + 0x01, 0x00, 0x00, 0x00, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf7, 0x03, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x0a, + 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x44, 0xfa, 0x80, 0x00, 0x08, 0x83, 0x21, 0x2d, 0x80, 0x38, + 0x02, 0x80, 0x81, 0xaf, 0x9c, 0x0d, 0x80, 0x40, 0x00, 0xa2, 0x3d, 0xc0, 0x81, 0x30, 0x90, 0x18, + 0x00, 0x00, 0x20, 0xa0, 0x00, 0x50, 0x27, 0xfb, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, + 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x3c, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x35, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x31, 0x00, 0x00, 0x00, 0x01, 0xe4, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x69, 0x6e, 0x5f, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x69, 0x6e, 0x5f, 0x63, + 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0x69, 0x6e, 0x5f, 0x74, 0x65, 0x78, 0x63, 0x6f, 0x6f, 0x72, 0x64, + 0x00, 0x6d, 0x76, 0x70, 0x5f, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x78, 0x00 +}; \ No newline at end of file diff --git a/src/SystemFonts.c b/src/SystemFonts.c index 048f33981..b42559eda 100644 --- a/src/SystemFonts.c +++ b/src/SystemFonts.c @@ -721,7 +721,7 @@ int SysFont_TextWidth(struct DrawTextArgs* args) { void SysFont_DrawText(struct DrawTextArgs* args, struct Bitmap* bmp, int x, int y, cc_bool shadow) { interop_SysTextDraw(args, bmp, x, y, shadow); } -#elif defined CC_BUILD_PSP +#elif defined CC_BUILD_PSP || defined CC_BUILD_XBOX void SysFonts_Register(const cc_string* path) { } const cc_string* SysFonts_UNSAFE_GetDefault(void) { return &String_Empty; } diff --git a/src/Window_PSVita.c b/src/Window_PSVita.c index 7c67eb033..248fc1e27 100644 --- a/src/Window_PSVita.c +++ b/src/Window_PSVita.c @@ -122,7 +122,7 @@ static void ProcessTouchInput(void) { if (touch.reportNum > 0) { int x = touch.report[0].x; int y = touch.report[0].y; - ProcessTouchPress(X, Y); + ProcessTouchPress(x, y); } Input_SetNonRepeatable(CCMOUSE_L, touch.reportNum > 0); }