Permalink
Browse files

new version 0.1.9

  • Loading branch information...
1 parent 61dd296 commit 70cb993b54ef5a715846c2b23d55cbb77f3ad57b @wargio committed Jun 8, 2012
View
BIN ICON0.PNG
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -21,8 +21,11 @@ SOURCES := source
DATA := data
INCLUDES := include
-TITLE := PS Seismograph
+TITLE := PS Seismograph - Just a Strong Motion Seismometer
APPID := PSEISM0GR
+PKGFILES := $(CURDIR)/pkgfiles
+SFOXML := $(CURDIR)/sfo.xml
+PIC1 := $(CURDIR)/pkgfiles/PIC1.PNG
CONTENTID := UP0001-$(APPID)_00-0000000000000000
ICON0 := $(CURDIR)/ICON0.PNG
@@ -38,7 +41,7 @@ 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
+LIBS := -lgcm_sys -lrsx -lsysutil -lio -lm -lfreetype -lz -lpixman-1 -lrt -llv2 -lsysmodule -lpng -lpngdec -ljpgdec
#---------------------------------------------------------------------------------
# list of directories containing libraries, this must be the top level containing
@@ -69,7 +72,12 @@ 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)/*.*)))
+BINFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.bin)))
+PNGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.png)))
+JPGFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.jpg)))
+TTFFILES := $(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ttf)))
+VCGFILES := $(foreach dir,$(SHADERS),$(notdir $(wildcard $(dir)/*.vcg)))
+FCGFILES := $(foreach dir,$(SHADERS),$(notdir $(wildcard $(dir)/*.fcg)))
#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
@@ -81,6 +89,11 @@ else
endif
export OFILES := $(addsuffix .o,$(BINFILES)) \
+ $(addsuffix .o,$(TTFFILES)) \
+ $(addsuffix .o,$(VPOFILES)) \
+ $(addsuffix .o,$(FPOFILES)) \
+ $(addsuffix .o,$(PNGFILES)) \
+ $(addsuffix .o,$(JPGFILES)) \
$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
$(sFILES:.s=.o) $(SFILES:.S=.o)
@@ -137,6 +150,35 @@ $(OUTPUT).elf: $(OFILES)
@echo $(notdir $<)
@$(bin2o)
+#---------------------------------------------------------------------------------
+%.ttf.o : %.ttf
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+#---------------------------------------------------------------------------------
+%.vpo.o : %.vpo
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+#---------------------------------------------------------------------------------
+%.fpo.o : %.fpo
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
+#---------------------------------------------------------------------------------
+%.jpg.o : %.jpg
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+#---------------------------------------------------------------------------------
+%.png.o : %.png
+#---------------------------------------------------------------------------------
+ @echo $(notdir $<)
+ @$(bin2o)
+
-include $(DEPENDS)
#---------------------------------------------------------------------------------
File renamed without changes
View
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -20,7 +20,7 @@
#include "Min.h"
#include "Colors.h"
#include "Image.h"
-#include "Font_Test_bin.h"
+#include "Font_Test_png.h"
class Font:public Image{
public:
View
@@ -46,6 +46,8 @@ class Image{
void DrawIMG(int x, int y, pngData *png1);
void DrawIMG(int x, int y, jpgData *jpg1);
+ void AlphaDrawIMG(int x, int y, pngData *png1);
+ void NoBGDrawIMG(int x, int y, unsigned int bg, pngData *png1);
protected:
Minimum *G;
View
@@ -25,10 +25,11 @@ class Object{
Object(Minimum *g);
~Object(){}
- void Rectangle(u32 X, u32 Y, u32 width, u32 height, s32 Color);
+ void Rectangle(u32 X, u32 Y, u32 width, u32 height, u32 Color);
+ void Circle(u32 X, u32 Y, u32 r, u32 Color);
+ void Line(u32 X, u32 Y, u32 width, u32 height, u32 Color);
void Pixel4(u32 X, u32 Y, u32 Color);
-
private:
Minimum *G;
int Pixel(u32 X, u32 Y, u32 Color);
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
39 sfo.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" ?>
+<sfo>
+ <value name="APP_VER" type="string">
+ 01.90
+ </value>
+ <value name="ATTRIBUTE" type="integer">
+ 0
+ </value>
+ <value name="BOOTABLE" type="integer">
+ 1
+ </value>
+ <value name="CATEGORY" type="string">
+ HG
+ </value>
+ <value name="LICENSE" type="string">
+ This application was created with the official non-official SDK called PSL1GHT, for more information visit http://www.psl1ght.com/ . This is in no way associated with Sony Computer Entertainment Inc., please do not contact them for help, they will not be able to provide it.
+ </value>
+ <value name="PARENTAL_LEVEL" type="integer">
+ 0
+ </value>
+ <value name="PS3_SYSTEM_VER" type="string">
+ 03.4000
+ </value>
+ <value name="RESOLUTION" type="integer">
+ 63
+ </value>
+ <value name="SOUND_FORMAT" type="integer">
+ 279
+ </value>
+ <value name="TITLE" type="string">
+ PS Seismograph - Just a Strong Motion Seismometer
+ </value>
+ <value name="TITLE_ID" type="string">
+ PSEISM0GR
+ </value>
+ <value name="VERSION" type="string">
+ 02.00
+ </value>
+</sfo>
View
@@ -6,11 +6,11 @@
const char Alphabet[]={ 'A','B','C','D','E','F','G','H','I','J','K','L','M' //12
,'N','O','P','Q','R','S','T','U','V','W','X','Y','Z' //13 (25)
- ,',','.',';','!','?',' ' //6 (31)
+ ,'.','-',':','!','?',' ' //6 (31)
,'1','2','3','4','5','6','7','8','9','0'}; //10 (41)
Font::Font(Minimum *g):Image(g){
- LoadPNG_Buf(Font_Test_bin,Font_Test_bin_size,&P);
+ LoadPNG_Buf(Font_Test_png,Font_Test_png_size,&P);
}
void Font::Print(u32 x, u32 y, const char *txt, unsigned int Color){
View
@@ -94,21 +94,67 @@ void Image::DrawPartialImage(int x, int y, unsigned int s_width, unsigned int s_
}
}
+void Image::AlphaDrawIMG(int x, int y, pngData *png1){
+ if(png1->bmp_out){
+ u32 *scr = (u32 *)G->buffers[G->currentBuffer].ptr;
+ u32 *png= (u32 *)(void *)png1->bmp_out;
+ unsigned int n, m;
+
+ scr += y*G->buffers[G->currentBuffer].width+x;
+ for(n=0;n<png1->height;n++){
+ if((y+n)>=G->buffers[G->currentBuffer].height) break;
+ for(m=0;m<png1->width;m++){
+ if((x+m)>=G->buffers[G->currentBuffer].width) break;
+ unsigned int a = png[m] >> 24; // alpha
+ if (0 != a)
+ scr[m] = (png[m] & 0xff000000) | ( (((((png[m] & 0x00ff00ff) * a) + ((scr[m] & 0x00ff00ff) *
+ (0xff - a))) & 0xff00ff00) | ((((png[m] & 0x0000ff00) * a) + ((scr[m] & 0x0000ff00) *
+ (0xff - a))) & 0x00ff0000)) >> 8);
+ }
+ png+=png1->pitch>>2;
+ scr+=G->buffers[G->currentBuffer].width;
+ }
+ }
+}
+void Image::NoBGDrawIMG(int x, int y, unsigned int bg, pngData *png1){
+ if(png1->bmp_out){
+ u32 *scr = (u32 *)G->buffers[G->currentBuffer].ptr;
+ u32 *png= (u32 *)(void *)png1->bmp_out;
+ unsigned int n, m;
-/* alpha blend routine */
-unsigned int AlphaBlend(const unsigned int bg, const unsigned int src){
- unsigned int a = src >> 24; /* alpha */
+ scr += y*G->buffers[G->currentBuffer].width+x;
+ for(n=0;n<png1->height;n++){
+ if((y+n)>=G->buffers[G->currentBuffer].height) break;
+ for(m=0;m<png1->width;m++){
+ if((x+m)>=G->buffers[G->currentBuffer].width) break;
+ if(png[m]!=bg) scr[m]=png[m];
+ }
+ png+=png1->pitch>>2;
+ scr+=G->buffers[G->currentBuffer].width;
+ }
+ }
+}
- /* If source pixel is transparent, just return the background */
- if (0 == a)
- return bg;
+/*
- /* alpha blending the source and background colors */
- unsigned int rb = (((src & 0x00ff00ff) * a) +
- ((bg & 0x00ff00ff) * (0xff - a))) & 0xff00ff00;
- unsigned int g = (((src & 0x0000ff00) * a) +
- ((bg & 0x0000ff00) * (0xff - a))) & 0x00ff0000;
+void Image::AlphaDrawIMG(int x, int y, pngData *png1){
+G->start = __mftb();
+ if(png1->bmp_out){
+ u32 *scr = (u32 *)G->buffers[G->currentBuffer].ptr;
+ u32 *png= (u32 *)(void *)png1->bmp_out;
+ unsigned int n, m;
- return (src & 0xff000000) | ((rb | g) >> 8);
+ scr += y*G->buffers[G->currentBuffer].width+x;
+ for(n=0;n<png1->height;n++){
+ if((y+n)>=G->buffers[G->currentBuffer].height) break;
+ for(m=0;m<png1->width;m++){
+ if((x+m)>=G->buffers[G->currentBuffer].width) break;
+ scr[m]=AlphaBlend(scr[m],png[m]);
+ }
+ png+=png1->pitch>>2;
+ scr+=G->buffers[G->currentBuffer].width;
+ }
+ }G->end = __mftb();
}
+*/
View
@@ -1,27 +1,70 @@
#include "Objects.h"
+#include <math.h>
+
Object::Object(Minimum *g){
G=g;
}
//Object::
-void Object::Rectangle(u32 X, u32 Y, u32 width, u32 height, s32 Color){
+void Object::Rectangle(u32 X, u32 Y, u32 width, u32 height, u32 Color){
s32 i, j;
for(i = Y; i < (height+Y); i++) {
for(j = X; j < (width+X); j++)
- G->buffers[G->currentBuffer].ptr[i* G->buffers[G->currentBuffer].width + j] = Color;
+ Pixel(i,j,Color);
}
}
-/*
-void Object::Circle(u32 X, u32 Y, u32 r, s32 Color){
- s32 i, j;
- for(i = 0; i < G->buffers[G->currentBuffer].height; i++) {
- for(j = 0; j < G->buffers[G->currentBuffer].width; j++)
- G->buffers[G->currentBuffer].ptr[i* G->buffers[G->currentBuffer].width + j] = Color;
+
+void Object::Circle(u32 X, u32 Y, u32 r, u32 Color){
+ for(u32 y=0;y<r;y++){
+ u32 width=sqrt(r*r-y*y);
+ for(u32 x=0;x<width;x++){
+ Pixel4(X+x, Y+y, Color);
+ Pixel4(X+x, Y-y, Color);
+ Pixel4(X-x, Y+y, Color);
+ Pixel4(X-x, Y-y, Color);
+ }
+ }
+}
+
+void Object::Line(u32 X, u32 Y, u32 width, u32 height, u32 Color){
+ int t, distance;
+ int xerr=0, yerr=0, delta_x, delta_y;
+ int incx, incy;
+
+ delta_x=width-X;
+ delta_y=height-Y;
+
+ if(delta_x>0) incx=1;
+ else if(delta_x==0) incx=0;
+ else incx=-1;
+
+ if(delta_y>0) incy=1;
+ else if(delta_y==0) incy=0;
+ else incy=-1;
+
+ delta_x=abs(delta_x);
+ delta_y=abs(delta_y);
+ if(delta_x>delta_y) distance=delta_x;
+ else distance=delta_y;
+
+ /* draw the line */
+ for(t=0; t<=distance+1; t++) {
+ Pixel4(X, Y, Color);
+
+ xerr+=delta_x;
+ yerr+=delta_y;
+ if(xerr>distance) {
+ xerr-=distance;
+ X+=incx;
+ }
+ if(yerr>distance) {
+ yerr-=distance;
+ Y+=incy;
+ }
}
}
-*/
void Object::Pixel4(u32 X, u32 Y, u32 Color){
Pixel(X,Y,Color);
Oops, something went wrong.

0 comments on commit 70cb993

Please sign in to comment.