From c717093294f65b98f4fc94c995a3ace240c2d417 Mon Sep 17 00:00:00 2001 From: Nishi Date: Sun, 29 Sep 2024 05:55:18 +0000 Subject: [PATCH] wip but should work git-svn-id: file:///raid/svn-personal/tewi/trunk@193 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Platform/ps3.mk | 2 +- Server/Makefile | 4 ++-- Server/main.c | 30 +++++++++++++++--------------- Server/tw_version.h | 2 +- ps3.sh | 21 +++++++++++++++++++++ psp.sh | 4 ++-- 6 files changed, 42 insertions(+), 21 deletions(-) create mode 100755 ps3.sh diff --git a/Platform/ps3.mk b/Platform/ps3.mk index 8d3c96a..ba0e58a 100644 --- a/Platform/ps3.mk +++ b/Platform/ps3.mk @@ -1,6 +1,6 @@ # $Id$ -PREFIX = /dev_hdd0/httpd +PREFIX = /dev_hdd0/game/TEWI_00-0/USRDIR CC = ppu-gcc AR = ppu-ar diff --git a/Server/Makefile b/Server/Makefile index 6ed2ed9..e773e5b 100644 --- a/Server/Makefile +++ b/Server/Makefile @@ -28,8 +28,8 @@ tewi.self: tewi_strip$(EXEC) 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 diff --git a/Server/main.c b/Server/main.c index 0dce5df..3af5b8d 100644 --- a/Server/main.c +++ b/Server/main.c @@ -308,42 +308,42 @@ int tt_height; 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; @@ -387,17 +387,17 @@ void tt_printf(const char* tmpl, ...) { 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); diff --git a/Server/tw_version.h b/Server/tw_version.h index b4785ac..b0a2698 100644 --- a/Server/tw_version.h +++ b/Server/tw_version.h @@ -7,7 +7,7 @@ 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); diff --git a/ps3.sh b/ps3.sh new file mode 100755 index 0000000..e153d2b --- /dev/null +++ b/ps3.sh @@ -0,0 +1,21 @@ +#!/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 diff --git a/psp.sh b/psp.sh index fe455ab..8a73bcf 100755 --- a/psp.sh +++ b/psp.sh @@ -4,7 +4,7 @@ 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 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: @@ -12,7 +12,7 @@ cp Server/tewi.pbp httpd/EBOOT.PBP 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 -- 2.45.2