Permalink
Browse files

0.0.1

  • Loading branch information...
0 parents commit 61dd296bc62b2476aa5f94c368ccfd45d16270ed Giovanni committed Mar 20, 2012

Large diffs are not rendered by default.

Oops, something went wrong.
BIN ICON0.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
144 Makefile
@@ -0,0 +1,144 @@
+#---------------------------------------------------------------------------------
+# Clear the implicit built in rules
+#---------------------------------------------------------------------------------
+.SUFFIXES:
+#---------------------------------------------------------------------------------
+ifeq ($(strip $(PSL1GHT)),)
+$(error "Please set PSL1GHT in your environment. export PSL1GHT=<path>")
+endif
+
+include $(PSL1GHT)/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 := $(notdir $(CURDIR))
+BUILD := build
+SOURCES := source
+DATA := data
+INCLUDES := include
+
+TITLE := PS Seismograph
+APPID := PSEISM0GR
+CONTENTID := UP0001-$(APPID)_00-0000000000000000
+ICON0 := $(CURDIR)/ICON0.PNG
+
+#---------------------------------------------------------------------------------
+# options for code generation
+#---------------------------------------------------------------------------------
+
+CFLAGS = -O2 -Wall -mcpu=cell $(MACHDEP) $(INCLUDE)
+CXXFLAGS = $(CFLAGS)
+
+LDFLAGS = $(MACHDEP) -Wl,-Map,$(notdir $@).map
+
+#---------------------------------------------------------------------------------
+# any extra libraries we wish to link with the project
+#---------------------------------------------------------------------------------
+LIBS := -lgcm_sys -lrsx -lsysutil -lio -lcairo -lm -lfreetype -lz -lpixman-1 -lrt -llv2 -lsysmodule -lpng -lpngdec -ljpgdec
+
+#---------------------------------------------------------------------------------
+# list of directories containing libraries, this must be the top level containing
+# include and lib
+#---------------------------------------------------------------------------------
+LIBDIRS := $(PORTLIBS)
+
+#---------------------------------------------------------------------------------
+# 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,$(DATA),$(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)))
+CPPFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.cpp)))
+sFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.s)))
+SFILES := $(foreach dir,$(SOURCES),$(notdir $(wildcard $(dir)/*.S)))
+BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.*)))
+
+#---------------------------------------------------------------------------------
+# use CXX for linking C++ projects, CC for standard C
+#---------------------------------------------------------------------------------
+ifeq ($(strip $(CPPFILES)),)
+ export LD := $(CC)
+else
+ export LD := $(CXX)
+endif
+
+export OFILES := $(addsuffix .o,$(BINFILES)) \
+ $(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
+ $(sFILES:.s=.o) $(SFILES:.S=.o)
+
+#---------------------------------------------------------------------------------
+# 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)/Makefile
+
+#---------------------------------------------------------------------------------
+clean:
+ @echo clean ...
+ @rm -fr $(BUILD) *.elf *.self *.pkg
+
+#---------------------------------------------------------------------------------
+run:
+ ps3load $(OUTPUT).self
+
+#---------------------------------------------------------------------------------
+pkg: $(BUILD) $(OUTPUT).pkg
+
+#---------------------------------------------------------------------------------
+else
+
+DEPENDS := $(OFILES:.o=.d)
+
+#---------------------------------------------------------------------------------
+# main targets
+#---------------------------------------------------------------------------------
+$(OUTPUT).self: $(OUTPUT).elf
+$(OUTPUT).elf: $(OFILES)
+
+#---------------------------------------------------------------------------------
+# This rule links in binary data with the .bin extension
+#---------------------------------------------------------------------------------
+%.bin.o : %.bin
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+-include $(DEPENDS)
+
+#---------------------------------------------------------------------------------
+endif
+#---------------------------------------------------------------------------------
@@ -0,0 +1,15 @@
+PS Seismograph - a simple seismograph for PS3
+=============================================
+
+This is a simple Seismograph for ps3. it uses all the axis of the first controller.
+it uses 1920x1080 resolution, so i don't know if it will ever work on SD tv.
+Anyway i hope this can show how people can use PSL1GHT SDK
+
+Authors
+-------
+ deroad
+
+Changelog:
+-------
+ - 0.0.1 -
+ Initial Version
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,36 @@
+/*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This program was created by Grazioli Giovanni Dante <wargio@libero.it>.
+*/
+
+#ifndef __NORSX_BACKGROUND_H__
+#define __NORSX_BACKGROUND_H__
+#include "Min.h"
+#include "Colors.h"
+
+class Background{
+public:
+ Background(Minimum *g);
+ ~Background(){}
+
+ void Mono(s32 Color);
+// void DoubleGradient(s32 Color1, s32 Color2);
+
+protected:
+ int frame;
+ Minimum *G;
+};
+
+#endif
@@ -0,0 +1,32 @@
+/*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This program was created by Grazioli Giovanni Dante <wargio@libero.it>.
+*/
+
+#ifndef __NORSX_COLOR_H__
+#define __NORSX_COLOR_H__
+
+#define COLOR_WHITE 0xFFFFFF
+#define COLOR_BLACK 0x000000
+#define COLOR_BLUE 0x0000FF
+#define COLOR_GREEN 0x00FF00
+#define COLOR_RED 0xFF0000
+#define COLOR_YELLOW 0xFFFF00
+#define COLOR_CYAN 0X00FFFF
+#define COLOR_GREY 0x808080
+#define COLOR_ORANGE 0xFF4500
+
+
+#endif
@@ -0,0 +1,38 @@
+/*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This program was created by Grazioli Giovanni Dante <wargio@libero.it>.
+*/
+
+#ifndef __NORSX_TEST_FONT_H__
+#define __NORSX_TEST_FONT_H__
+#include "Min.h"
+#include "Colors.h"
+#include "Image.h"
+#include "Font_Test_bin.h"
+
+class Font:public Image{
+public:
+ Font(Minimum *g);
+ ~Font(){}
+
+ void Print (u32 X, u32 Y, const char *txt, unsigned int Color);
+ void Printf(u32 x, u32 y,unsigned int Color ,const char *a, ...);
+
+
+private:
+ pngData P;
+};
+
+#endif
@@ -0,0 +1,60 @@
+/*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This program was created by Grazioli Giovanni Dante <wargio@libero.it>.
+*/
+
+#ifndef __NORSX_IMAGE_H__
+#define __NORSX_IMAGE_H__
+
+#include <pngdec/pngdec.h>
+#include <jpgdec/jpgdec.h>
+#include <sysutil/sysutil.h>
+#include <sysmodule/sysmodule.h>
+#include "Min.h"
+
+//#define CROMAKEY 0xffbcbc222
+
+class Image{
+public:
+ Image(Minimum *g){
+ G=g;
+ sysModuleLoad(SYSMODULE_FS);
+ sysModuleLoad(SYSMODULE_PNGDEC);
+ sysModuleLoad(SYSMODULE_JPGDEC);
+ }
+ ~Image(){
+ sysModuleUnload(SYSMODULE_FS);
+ sysModuleUnload(SYSMODULE_PNGDEC);
+ sysModuleUnload(SYSMODULE_JPGDEC);
+ }
+ void LoadPNG(const char* filename, pngData *png);
+ void LoadJPG(const char* filename, jpgData *jpg);
+ void LoadPNG_Buf(const void* name, u32 name_size, pngData *png);
+ void LoadJPG_Buf(const void* name, u32 name_size, jpgData *jpg);
+
+ void DrawIMG(int x, int y, pngData *png1);
+ void DrawIMG(int x, int y, jpgData *jpg1);
+
+protected:
+ Minimum *G;
+ void DrawPartialImage(int x, int y, unsigned int s_width, unsigned int s_height, unsigned int e_width, unsigned int e_height, unsigned int bg, unsigned int color, pngData *png1);
+ void DrawPartialImage(int x, int y, unsigned int s_width, unsigned int s_height, unsigned int e_width, unsigned int e_height, unsigned int bg, unsigned int color, jpgData *jpg1);
+
+
+};
+
+unsigned int AlphaBlend(const unsigned int bg, const unsigned int src);
+
+#endif
@@ -0,0 +1,37 @@
+/*
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+ This program was created by Grazioli Giovanni Dante <wargio@libero.it>.
+*/
+
+#ifndef __NORSX_MIN_H__
+#define __NORSX_MIN_H__
+#include <rsx/rsx.h>
+#include "rsxutil.h"
+#include <ppu-types.h>
+#include <io/pad.h>
+
+class Minimum{
+public:
+ u16 width;
+ u16 height;
+
+ rsxBuffer buffers[2];
+ gcmContextData *context;
+ int currentBuffer;
+};
+
+#endif
+
+
Oops, something went wrong.

0 comments on commit 61dd296

Please sign in to comment.