summary refs log tree commit diff
path: root/misc/ps3
diff options
context:
space:
mode:
authorWlodekM <[email protected]>2024-06-16 10:35:45 +0300
committerWlodekM <[email protected]>2024-06-16 10:35:45 +0300
commitabef6da56913f1c55528103e60a50451a39628b1 (patch)
treeb3c8092471ecbb73e568cd0d336efa0e7871ee8d /misc/ps3
initial commit
Diffstat (limited to 'misc/ps3')
-rw-r--r--misc/ps3/ICON0.pngbin0 -> 9052 bytes
-rw-r--r--misc/ps3/Makefile144
-rw-r--r--misc/ps3/ps_coloured.fcg7
-rw-r--r--misc/ps3/ps_textured.fcg9
-rw-r--r--misc/ps3/vs_coloured.vcg11
-rw-r--r--misc/ps3/vs_offset.vcg15
-rw-r--r--misc/ps3/vs_textured.vcg14
7 files changed, 200 insertions, 0 deletions
diff --git a/misc/ps3/ICON0.png b/misc/ps3/ICON0.png
new file mode 100644
index 0000000..f6446f9
--- /dev/null
+++ b/misc/ps3/ICON0.png
Binary files differdiff --git a/misc/ps3/Makefile b/misc/ps3/Makefile
new file mode 100644
index 0000000..1ab8320
--- /dev/null
+++ b/misc/ps3/Makefile
@@ -0,0 +1,144 @@
+#---------------------------------------------------------------------------------
+# Clear the implicit built in rules
+#---------------------------------------------------------------------------------
+.SUFFIXES:
+#---------------------------------------------------------------------------------
+ifeq ($(strip $(PS3DEV)),)
+$(error "Please set PS3DEV in your environment. export PS3DEV=<path>")
+endif
+ifeq ($(strip $(PSL1GHT)),)
+$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
+endif
+
+include $(PS3DEV)/ppu_rules
+
+#---------------------------------------------------------------------------------
+# TARGET is the name of the output
+# BUILD is the directory where object files & intermediate files will be placed
+# SOURCES is a list of directories containing source code
+# INCLUDES is a list of directories containing extra header files
+#---------------------------------------------------------------------------------
+TARGET		:=	ClassiCube-PS3
+BUILD		:=	build-ps3
+SOURCES		:=	src third_party/bearssl/src
+INCLUDES	:= third_party/bearssl/inc
+SHADERS		:=	misc/ps3
+
+TITLE		:=	ClassiCube
+APPID		:=	CUBE00200
+CONTENTID	:=	UP0001-$(APPID)_00-0000000000000000
+ICON0		:=	../misc/ps3/ICON0.png
+#---------------------------------------------------------------------------------
+# options for code generation
+#---------------------------------------------------------------------------------
+
+CFLAGS		=	-O2 -DPLAT_PS3 -Wall -mcpu=cell -fno-math-errno $(MACHDEP) $(INCLUDE)
+CXXFLAGS	=	$(CFLAGS)
+
+LDFLAGS	=	$(MACHDEP) -Wl,-Map,$(notdir $@).map -fno-use-linker-plugin
+
+#---------------------------------------------------------------------------------
+# any extra libraries we wish to link with the project
+#---------------------------------------------------------------------------------
+LIBS	:=	-lrsx -lgcm_sys -lio -lsysutil -lrt -llv2 -lm -lnet -lsysmodule 
+
+#---------------------------------------------------------------------------------
+# list of directories containing libraries, this must be the top level containing
+# include and lib
+#---------------------------------------------------------------------------------
+LIBDIRS	:=
+
+#---------------------------------------------------------------------------------
+# no real need to edit anything past this point unless you need to add additional
+# rules for different file extensions
+#---------------------------------------------------------------------------------
+ifneq ($(BUILD),$(notdir $(CURDIR)))
+#---------------------------------------------------------------------------------
+
+export OUTPUT	:=	$(CURDIR)/$(TARGET)
+
+export VPATH	:=	$(foreach dir,$(SOURCES),$(CURDIR)/$(dir)) \
+			$(foreach dir,$(SHADERS),$(CURDIR)/$(dir))
+
+export DEPSDIR	:=	$(CURDIR)/$(BUILD)
+
+export BUILDDIR	:=	$(CURDIR)/$(BUILD)
+
+#---------------------------------------------------------------------------------
+# automatically build a list of object files for our project
+#---------------------------------------------------------------------------------
+CFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.c)))
+sFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+SFILES		:=	$(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
+VCGFILES	:=	$(notdir $(wildcard misc/ps3/*.vcg))
+FCGFILES	:=	$(notdir $(wildcard misc/ps3/*.fcg))
+
+VPOFILES	:=	$(VCGFILES:.vcg=.vpo)
+FPOFILES	:=	$(FCGFILES:.fcg=.fpo)
+
+#---------------------------------------------------------------------------------
+# use CXX for linking C++ projects, CC for standard C
+#---------------------------------------------------------------------------------
+export LD	:=	$(CC)
+export OFILES	:=	$(CFILES:.c=.o) $(sFILES:.s=.o) $(SFILES:.S=.o) \
+			$(addsuffix .o,$(VPOFILES)) \
+			$(addsuffix .o,$(FPOFILES))
+			
+#---------------------------------------------------------------------------------
+# build a list of include paths
+#---------------------------------------------------------------------------------
+export INCLUDE	:=	$(foreach dir,$(INCLUDES), -I$(CURDIR)/$(dir)) \
+					$(foreach dir,$(LIBDIRS),-I$(dir)/include) \
+					$(LIBPSL1GHT_INC) \
+					-I$(CURDIR)/$(BUILD)
+
+#---------------------------------------------------------------------------------
+# build a list of library paths
+#---------------------------------------------------------------------------------
+export LIBPATHS	:=	$(foreach dir,$(LIBDIRS),-L$(dir)/lib) \
+					$(LIBPSL1GHT_LIB)
+
+export OUTPUT	:=	$(CURDIR)/$(TARGET)
+.PHONY: $(BUILD) clean
+
+#---------------------------------------------------------------------------------
+$(BUILD):
+	@[ -d $@ ] || mkdir -p $@
+	@$(MAKE) --no-print-directory -C $(BUILD) -f $(CURDIR)/misc/ps3/Makefile
+
+#---------------------------------------------------------------------------------
+clean:
+	@echo clean ...
+	@rm -fr $(BUILD) $(OUTPUT).elf $(OUTPUT).self
+
+#---------------------------------------------------------------------------------
+else
+
+DEPENDS	:=	$(OFILES:.o=.d)
+
+#---------------------------------------------------------------------------------
+# main targets
+#---------------------------------------------------------------------------------
+$(OUTPUT).pkg: $(OUTPUT).self
+$(OUTPUT).self: $(OUTPUT).elf
+$(OUTPUT).elf:	$(OFILES)
+
+#---------------------------------------------------------------------------------
+# This rule links in binary data with the .bin extension
+%.bin.o : %.bin
+	@echo $(notdir $<)
+	@$(bin2o)
+	
+%.vpo.o : %.vpo
+	@echo $(notdir $<)
+	@$(bin2o)
+
+%.fpo.o : %.fpo
+	@echo $(notdir $<)
+	@$(bin2o)
+
+-include $(DEPENDS)
+
+#---------------------------------------------------------------------------------
+endif
+#---------------------------------------------------------------------------------
diff --git a/misc/ps3/ps_coloured.fcg b/misc/ps3/ps_coloured.fcg
new file mode 100644
index 0000000..928ade4
--- /dev/null
+++ b/misc/ps3/ps_coloured.fcg
@@ -0,0 +1,7 @@
+float4 main
+(
+	float4 in_color : COLOR
+) : COLOR
+{
+	return in_color;
+}
\ No newline at end of file
diff --git a/misc/ps3/ps_textured.fcg b/misc/ps3/ps_textured.fcg
new file mode 100644
index 0000000..d800712
--- /dev/null
+++ b/misc/ps3/ps_textured.fcg
@@ -0,0 +1,9 @@
+float4 main
+(
+	float4 in_color : COLOR,
+	float2 in_tex0  : TEXCOORD0,
+	uniform sampler2D tex
+) : COLOR
+{
+	return tex2D(tex, in_tex0) * in_color;
+}
\ No newline at end of file
diff --git a/misc/ps3/vs_coloured.vcg b/misc/ps3/vs_coloured.vcg
new file mode 100644
index 0000000..b41f690
--- /dev/null
+++ b/misc/ps3/vs_coloured.vcg
@@ -0,0 +1,11 @@
+void main(
+	float4 in_position : POSITION,
+	float4 in_color    : DIFFUSE,
+	uniform float4x4 mvp,
+	out float4 out_pos   : POSITION, 
+	out float4 out_color : COLOR)
+{
+	float4 pos = float4(in_position.xyz, 1.0f);	
+	out_pos    = mul(pos, mvp);
+	out_color  = in_color;
+}
\ No newline at end of file
diff --git a/misc/ps3/vs_offset.vcg b/misc/ps3/vs_offset.vcg
new file mode 100644
index 0000000..000e16e
--- /dev/null
+++ b/misc/ps3/vs_offset.vcg
@@ -0,0 +1,15 @@
+void main(
+	float4 in_position : POSITION,
+	float4 in_color    : DIFFUSE,
+	float4 in_tex      : TEXCOORD,
+	uniform float4x4 mvp,
+	uniform float4 uv_offset,
+	out float4 out_pos   : POSITION, 
+	out float4 out_color : COLOR, 
+	out float2 out_tex   : TEXCOORD0)
+{
+	float4 pos = float4(in_position.xyz, 1.0f);	
+	out_pos    = mul(pos, mvp);
+	out_color  = in_color;
+	out_tex    = in_tex + uv_offset;
+}
\ No newline at end of file
diff --git a/misc/ps3/vs_textured.vcg b/misc/ps3/vs_textured.vcg
new file mode 100644
index 0000000..f0edbfa
--- /dev/null
+++ b/misc/ps3/vs_textured.vcg
@@ -0,0 +1,14 @@
+void main(
+	float4 in_position : POSITION,
+	float4 in_color    : DIFFUSE,
+	float4 in_tex      : TEXCOORD,
+	uniform float4x4 mvp,
+	out float4 out_pos   : POSITION, 
+	out float4 out_color : COLOR, 
+	out float2 out_tex   : TEXCOORD0)
+{
+	float4 pos = float4(in_position.xyz, 1.0f);	
+	out_pos    = mul(pos, mvp);
+	out_color  = in_color;
+	out_tex    = in_tex;
+}
\ No newline at end of file