# $Id$
-PREFIX = /dev_hdd0/httpd
+PREFIX = /dev_hdd0/game/TEWI_00-0/USRDIR
CC = ppu-gcc
AR = ppu-ar
tewi.pkg: tewi.self
mkdir -p pkg/USRDIR
- cp /usr/local/ps3dev/bin/ICON0.PNG pkg/ICON0.PNG
- make_self_npdrm tewi.elf pkg/USRDIR/EBOOT.BIN UP0001-TEWI_00-0000000000000000
+ cp ../Binary/ps3.png pkg/ICON0.PNG
+ 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
pkg.py --contentid UP0001-TEWI_00-0000000000000000 pkg/ $@
rm -rf pkg
void tt_putstr(const char* str) {
int i;
- for(i = 0; str[i] != 0; i++){
+ for(i = 0; str[i] != 0; i++) {
tvram[tt_y * tt_width + tt_x] = str[i];
- if(str[i] == '\n'){
+ if(str[i] == '\n') {
tt_x = 0;
tt_y++;
- }else{
+ } else {
tt_x++;
- if(tt_x == tt_width){
+ if(tt_x == tt_width) {
tt_x = 0;
tt_y++;
}
}
- if(tt_y == tt_height){
+ if(tt_y == tt_height) {
tt_y--;
int x, y;
- for(y = 0; y < tt_height - 1; y++){
- for(x = 0; x < tt_width; x++){
+ for(y = 0; y < tt_height - 1; y++) {
+ for(x = 0; x < tt_width; x++) {
tvram[y * tt_width + x] = tvram[(y + 1) * tt_width + x];
}
}
- for(x = 0; x < tt_width; x++){
+ for(x = 0; x < tt_width; x++) {
tvram[(tt_height - 1) * tt_width + x] = 0;
}
}
}
}
-void tt_putchar(struct rsx_buffer* buffer, int x, int y, uint8_t c){
+void tt_putchar(struct rsx_buffer* buffer, int x, int y, uint8_t c) {
int i, j;
if(c < 0x20) c = 0x20;
if(c >= 0x7f) c = 0x20;
- for(i = 0; i < 7; i++){
+ for(i = 0; i < 7; i++) {
uint8_t l = font[(c - 0x20) * 8 + i];
- for(j = 0; j < 5; j++){
+ for(j = 0; j < 5; j++) {
uint32_t c = 0;
- if(l & (1 << 7)){
+ if(l & (1 << 7)) {
c = 0xffffff;
}
l = l << 1;
for(i = 0; tmpl[i] != 0; i++) {
if(tmpl[i] == '%') {
i++;
- if(tmpl[i] == 's'){
+ if(tmpl[i] == 's') {
char* tmp = log;
log = cm_strcat(tmp, va_arg(va, char*));
free(tmp);
- }else if(tmpl[i] == 'd'){
+ } else if(tmpl[i] == 'd') {
char buf[513];
sprintf(buf, "%d", va_arg(va, int));
char* tmp = log;
log = cm_strcat(tmp, buf);
free(tmp);
- }else if(tmpl[i] == '%'){
+ } else if(tmpl[i] == '%') {
char* tmp = log;
log = cm_strcat(tmp, "%");
free(tmp);
extern "C" {
#endif
-#define TW_VERSION "2.02-wip\0"
+#define TW_VERSION "2.03\0"
const char* tw_get_version(void);
const char* tw_get_platform(void);
--- /dev/null
+#!/bin/sh
+# $Id$
+export PSPDEV=/usr/local/pspdev
+export PATH=$PATH:/usr/local/pspdev/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
export PATH=$PATH:/usr/local/pspdev/bin
cat config.h.tmpl | sed -E 's/#undef (NO_SSL)/#define \1/g' > config.h
rm -rf httpd
-make PLATFORM=psp DESTDIR=httpd/ install
+make PLATFORM=psp DESTDIR=httpd/ install || exit 1
mv httpd/ms0:/PSP/GAME/httpd/* httpd/
rm -rf httpd/lib httpd/bin
rm -rf httpd/ms0:
echo "Tewi HTTPd $(make get-version) for PSP" > httpd/README
echo "========================" >> httpd/README
echo "To install, just copy this \`httpd' folder into your /PSP/GAME of the PSP memorystick." >> httpd/README
-cat httpd/readme
+cat httpd/README
rm -f tewidist.zip
zip -rv tewidist.zip httpd
rm -rf httpd