Index: /trunk/Makefile
===================================================================
--- /trunk/Makefile	(revision 196)
+++ /trunk/Makefile	(revision 197)
@@ -12,5 +12,5 @@
 .PHONY: all format clean ./Server ./Common ./Module get-version
 
-all: ./Server $(MODULE) ./Tool/genconf ./Tool/itworks
+all: ./Server $(MODULE)
 
 ./Tool/option: ./Tool/option.c config.h
@@ -23,5 +23,5 @@
 	cc -o $@ ./Tool/itworks.c
 
-./Server:: ./Common ./Tool/option
+./Server:: ./Common ./Tool/option ./Tool/genconf ./Tool/itworks
 	$(MAKE) -C $@ $(FLAGS) EXTOBJS="`./Tool/option objs ../`" EXTLIBS="`./Tool/option libs ../`" EXTCFLAGS="`./Tool/option cflags ../`" EXTLDFLAGS="`./Tool/option ldflags ../`"
 
Index: /trunk/Platform/ps3.mk
===================================================================
--- /trunk/Platform/ps3.mk	(revision 196)
+++ /trunk/Platform/ps3.mk	(revision 197)
@@ -5,7 +5,7 @@
 CC = ppu-gcc
 AR = ppu-ar
-CFLAGS = -g -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/ps3dev/ppu/include
-LDFLAGS = -L /usr/local/ps3dev/ppu/lib
-LIBS = -lnet -lsysmodule -lsysutil -lrt -llv2 -lrsx -lgcm_sys
+CFLAGS = -g -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/ps3dev/ppu/include -I /usr/local/ps3dev/portlibs/ppu/include
+LDFLAGS = -L /usr/local/ps3dev/ppu/lib -L /usr/local/ps3dev/portlibs/ppu/lib 
+LIBS = -lnet -lsysmodule -lsysutil -lrt -llv2 -lrsx -lgcm_sys -lpng -lm -lz
 EXEC = .elf
 LIB = .so
Index: /trunk/Server/Makefile
===================================================================
--- /trunk/Server/Makefile	(revision 196)
+++ /trunk/Server/Makefile	(revision 197)
@@ -28,6 +28,11 @@
 
 tewi.pkg: tewi.self
-	mkdir -p pkg/USRDIR
+	mkdir -p pkg/USRDIR/etc
+	mkdir -p pkg/USRDIR/www
 	cp ../Binary/ps3.png pkg/ICON0.PNG
+	../Tool/genconf /dev_hdd0/game/TEWI_00-0/USRDIR lib/tewi so > pkg/USRDIR/etc/tewi.conf
+	cp ../Binary/pbtewi.gif pkg/USRDIR/www/
+	convert '../Binary/pbtewi.gif[0]' pkg/USRDIR/pbtewi.png
+	../Tool/itworks > pkg/USRDIR/www/index.html
 	make_self_npdrm tewi_strip$(EXEC) pkg/USRDIR/EBOOT.BIN UP0001-TEWI_00-0000000000000000
 	sfo.py --title "Tewi HTTPd" --appid "TEWI" -f /usr/local/ps3dev/bin/sfo.xml pkg/PARAM.SFO
Index: /trunk/Server/main.c
===================================================================
--- /trunk/Server/main.c	(revision 196)
+++ /trunk/Server/main.c	(revision 197)
@@ -54,4 +54,5 @@
 #include <sys/thread.h>
 #include <stdarg.h>
+#include <png.h>
 
 #define printf(...) tt_printf(__VA_ARGS__)
@@ -330,5 +331,5 @@
 			}
 			for(x = 0; x < tt_width; x++) {
-				tvram[(tt_height - 1) * tt_width + x] = 0;
+				tvram[(tt_height - 1) * tt_width + x] = 0x20;
 			}
 		}
@@ -338,15 +339,16 @@
 void tt_putchar(struct rsx_buffer* buffer, int x, int y, uint8_t c) {
 	int i, j;
+	if(c == 0) return;
 	if(c < 0x20) c = 0x20;
 	if(c >= 0x7f) c = 0x20;
-	for(i = 0; i < 7; i++) {
-		uint8_t l = font[(c - 0x20) * 8 + i];
-		for(j = 0; j < 5; j++) {
-			uint32_t c = 0;
+	for(i = 0; i < 8; i++) {
+		uint8_t l = i == 7 ? 0 : font[(c - 0x20) * 8 + i];
+		for(j = 0; j < 6; j++) {
+			uint32_t col = 0;
 			if(l & (1 << 7)) {
-				c = 0xffffff;
+				col = 0xffffff;
 			}
 			l = l << 1;
-			buffer->ptr[(y * 8 + i) * buffer->width + x * 6 + j] = c;
+			buffer->ptr[(y * 8 + i) * buffer->width + x * 6 + j] = col;
 		}
 	}
@@ -363,5 +365,5 @@
 }
 
-#define BUFFERS 2
+#define BUFFERS 1
 gcmContextData* ctx;
 struct rsx_buffer buffers[BUFFERS];
@@ -414,4 +416,64 @@
 }
 
+void show_png(void) {
+	FILE* f = fopen(PREFIX "/pbtewi.png", "rb");
+	if(f == NULL) {
+		f = fopen(PREFIX "/../ICON0.PNG", "rb");
+	}
+	if(f == NULL) return;
+	png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);
+	png_infop info = png_create_info_struct(png);
+	if(setjmp(png_jmpbuf(png))) {
+		png_destroy_read_struct(&png, &info, NULL);
+		fclose(f);
+		return;
+	}
+
+	png_init_io(png, f);
+	png_read_info(png, info);
+
+	int width = png_get_image_width(png, info);
+	int height = png_get_image_height(png, info);
+	int depth = png_get_bit_depth(png, info);
+	int type = png_get_color_type(png, info);
+
+	if(depth == 16) png_set_strip_16(png);
+	if(type == PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png);
+	if(type == PNG_COLOR_TYPE_GRAY && depth < 8) png_set_expand_gray_1_2_4_to_8(png);
+	if(png_get_valid(png, info, PNG_INFO_tRNS)) png_set_tRNS_to_alpha(png);
+	if(type == PNG_COLOR_TYPE_RGB || type == PNG_COLOR_TYPE_GRAY || type == PNG_COLOR_TYPE_PALETTE) png_set_filler(png, 0xFF, PNG_FILLER_AFTER);
+	if(type == PNG_COLOR_TYPE_GRAY || type == PNG_COLOR_TYPE_GRAY_ALPHA) png_set_gray_to_rgb(png);
+	png_read_update_info(png, info);
+	png_bytep* rows = (png_bytep*)malloc(sizeof(*rows) * (height));
+
+	int i;
+
+	for(i = 0; i < height; i++) {
+		rows[i] = (png_byte*)malloc(png_get_rowbytes(png, info));
+	}
+
+	png_read_image(png, rows);
+
+	for(i = 0; i < height; i++) {
+		int j;
+		for(j = 0; j < width; j++) {
+			png_bytep byte = &(rows[i][j * 4]);
+			uint32_t col = (byte[0] << 16) | (byte[1] << 8) | (byte[2]);
+			int k;
+			for(k = 0; k < BUFFERS; k++) {
+				buffers[k].ptr[buffers[k].width * i - width + j] = col;
+			}
+		}
+	}
+
+	png_destroy_read_struct(&png, &info, NULL);
+	fclose(f);
+
+	for(i = 0; i < height; i++) {
+		free(rows[i]);
+	}
+	free(rows);
+}
+
 #endif
 
@@ -561,4 +623,5 @@
 	sysThreadCreate(&id, text_thread, NULL, 1500, 0x1000, THREAD_JOINABLE, "TextThread");
 	printf("PS3 Bootstrap, Tewi/%s\n", tw_get_version());
+	show_png();
 	netInitialize();
 #elif defined(__ps2sdk__)
Index: unk/ps3.sh
===================================================================
--- /trunk/ps3.sh	(revision 196)
+++ 	(revision )
@@ -1,22 +1,0 @@
-#!/bin/sh
-# $Id$
-export PS3DEV="/usr/local/ps3dev"
-export PSL1GHT=$PS3DEV
-export PATH=$PATH:${PS3DEV}/bin:${PS3DEV}/ppu/bin:${PS3DEV}/spu/bin
-cat config.h.tmpl | sed -E 's/#undef (NO_SSL)/#define \1/g' > config.h
-rm -rf TEWI_00-0
-make PLATFORM=ps3 DESTDIR=TEWI_00-0/ install || exit 1
-mkdir -p TEWI_00-0/USRDIR
-mv TEWI_00-0/dev_hdd0/game/TEWI_00-0/USRDIR/* TEWI_00-0/USRDIR/
-rm -rf TEWI_00-0/USRDIR/lib TEWI_00-0/USRDIR/bin
-rm -rf TEWI_00-0/dev_hdd0
-make_self_npdrm Server/tewi_strip.elf TEWI_00-0/USRDIR/EBOOT.BIN UP0001-TEWI_00-0000000000000000
-sfo.py --title "Tewi HTTPd" --appid "TEWI" -f /usr/local/ps3dev/bin/sfo.xml TEWI_00-0/PARAM.SFO
-cp Binary/ps3.png TEWI_00-0/ICON0.PNG
-echo "Tewi HTTPd $(make get-version) for PS3" > TEWI_00-0/README
-echo "========================" >> TEWI_00-0/README
-echo "To install, just copy this \`TEWI_00-0' folder into your /game of PS3 HDD0." >> TEWI_00-0/README
-cat TEWI_00-0/README
-rm -f tewidist.zip
-zip -rv tewidist.zip TEWI_00-0
-rm -rf TEWI_00-0
