]> Git repositories of Nishi - tewi.git/commitdiff
will try to fix ps2 later
authorNishi <nishi@nishi.boats>
Sun, 29 Sep 2024 00:37:00 +0000 (00:37 +0000)
committerNishi <nishi@nishi.boats>
Sun, 29 Sep 2024 00:37:00 +0000 (00:37 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@189 8739d7e6-ffea-ec47-b151-bdff447c6205

Platform/ps2.mk [new file with mode: 0644]
Server/Makefile
Server/config.c
Server/main.c
Server/module.c
Server/server.c
Server/strptime.h
config.h.tmpl

diff --git a/Platform/ps2.mk b/Platform/ps2.mk
new file mode 100644 (file)
index 0000000..ba5843c
--- /dev/null
@@ -0,0 +1,13 @@
+# $Id$
+
+PREFIX = /dev_hdd0/httpd
+
+CC = mips64r5900el-ps2-elf-gcc
+AR = mips64r5900el-ps2-elf-ar
+CFLAGS = -O2 -D_EE -DPREFIX=\"$(PREFIX)\" -I $(PWD)/Common -I /usr/local/ps2dev/ps2sdk/ee/include -I /usr/local/ps2dev/ps2sdk/common/include
+LDFLAGS = -T/usr/local/ps2dev/ps2sdk/ee/startup/linkfile -L /usr/local/ps2dev/ps2sdk/ee/lib -O2
+LIBS = -ldebug -lsocket
+EXEC = .elf
+LIB = .so
+MODULE =
+SERVADD = mips64r5900el-ps2-elf-strip tewi.elf -o tewi_strip.elf
index 306be72be862ef6dc5ffc652793cfaadf35f9ecc..2b1ba83fc81a33ef2729aa5c74f9e2c157b7ea76 100644 (file)
@@ -5,14 +5,14 @@ include $(PWD)/Platform/$(PLATFORM).mk
 .PHONY: all clean
 .SUFFIXES: .c .o
 
-OBJS = version.o main.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
+OBJS = main.o version.o config.o server.o http.o module.o strptime.o $(EXTOBJS) $(PREOBJS)
 
 all: tewi$(EXEC) $(TARGET)
 
 tewi_strip$(EXEC): tewi$(EXEC)
 
 tewi$(EXEC): $(OBJS) ../Common/common.a
-       $(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) $(LIBS) ../Common/common.a
+       $(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) ../Common/common.a $(LIBS)
        $(SERVADD)
 
 tewi.pbp: tewi_strip$(EXEC) param.sfo
index a76cd1aaffce6a312d87df200dbfd59fc9fa04bc..627c6a925fee968141b42e256ab17ca6c0a03c93 100644 (file)
@@ -105,6 +105,8 @@ void tw_config_init(void) {
        strcpy(config.hostname, "psp");
 #elif defined(__PPU__)
        strcpy(config.hostname, "ps3");
+#elif defined(__ps2sdk__)
+       strcpy(config.hostname, "ps2");
 #else
        gethostname(config.hostname, 1024);
 #endif
index 9e902e86561bff28acbc22dd5f380de3438c2d30..1d180398182db9c55f07154e1574b6b8624efc69 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "../config.h"
 
+#include <unistd.h>
 #include <stdio.h>
 #include <stdbool.h>
 #include <string.h>
@@ -39,6 +40,12 @@ PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
 
 #define printf(...) pspDebugScreenPrintf(__VA_ARGS__)
 #define STDERR_LOG(...) pspDebugScreenPrintf(__VA_ARGS__)
+#elif defined(__ps2sdk__)
+#include <debug.h>
+#include <sifrpc.h>
+
+#define printf(...) scr_printf(__VA_ARGS__)
+#define STDERR_LOG(...) scr_printf(__VA_ARGS__)
 #else
 #define STDERR_LOG(...) fprintf(stderr, __VA_ARGS__)
 #endif
@@ -243,6 +250,12 @@ int main(int argc, char** argv) {
 #elif defined(__PPU__)
        printf("PS3 Bootstrap, Tewi/%s\n", tw_get_version());
        netInitialize();
+#elif defined(__ps2sdk__)
+       SifInitRpc(0);
+       init_scr();
+       scr_printf("PS2 Bootstrap, Tewi/%s\n", tw_get_version());
+       while(1)
+               ;
 #endif
        int st = startup(argc, argv);
        if(st != -1) {
index f5eb5e68adf32fa1642eccc4f50a61c690aa1113..f4292f134cde9ebf7dd3bf4dc328e50531b2ea52 100644 (file)
@@ -15,7 +15,7 @@
 
 extern struct tw_config config;
 
-#if defined(_PSP) || defined(__PPU__)
+#if defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)
 void* tw_module_load(const char* path) { return NULL; }
 
 void* tw_module_symbol(void* mod, const char* sym) { return NULL; }
index 193bf42fbc06f4b1dea7b56964dc809116a255ab..865cf2849b6220461026174f3e4c26d3cacb1b58 100644 (file)
@@ -61,7 +61,7 @@
 #endif
 #endif
 
-#ifdef _PSP
+#if defined(_PSP) || defined(__ps2sdk__)
 #include "strptime.h"
 #endif
 
@@ -521,7 +521,7 @@ int tw_server_pass(void* ptr) {
                                } else if(cm_strcaseequ(req.headers[i], "If-Modified-Since")) {
                                        struct tm tm;
                                        strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm);
-#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__)
+#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)
                                        time_t t = 0;
                                        struct tm* btm = localtime(&t);
                                        cmtime = mktime(&tm);
index a26974b134e33eca352a1315397ba05cbe3b1e6c..e792cf12604bc34588ba3754cde3eea098bd53c1 100644 (file)
@@ -7,7 +7,7 @@ extern "C" {
 
 #include <time.h>
 
-#if defined(_WIN32) || defined(_PSP)
+#if defined(_WIN32) || defined(_PSP) || defined(__ps2sdk__)
 char* strptime(const char *buf, const char *fmt, struct tm *tm);
 #endif
 
index ac30b97a83507771fd39103ab2c0ae39cfa9dcab..35baaca2fb1968d58686f2da031e19acae41342d 100644 (file)
 /* Windows should not have chroot */
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_IPV6)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && !defined(NO_IPV6)
 #define NO_IPV6
-/* PSP/PS3 does not have IPv6 */
+/* PSP/PS2/PS3 does not have IPv6 */
 #endif
 
-#if (defined(_PSP)) && defined(USE_POLL)
+#if (defined(_PSP) || defined(__ps2sdk__)) && defined(USE_POLL)
 #undef USE_POLL
-/* Force select(2) for PSP */
+/* Force select(2) for PSP/PS2 */
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && defined(HAS_CHROOT)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && defined(HAS_CHROOT)
 #undef HAS_CHROOT
-/* PSP/PS3 should not have chroot */
+/* PSP/PS2/PS3 should not have chroot */
 #endif
 
-#if (defined(_PSP) || defined(__PPU__)) && !defined(NO_GETADDRINFO)
+#if (defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__)) && !defined(NO_GETADDRINFO)
 #define NO_GETADDRINFO
-/* PSP/PS3 should not have getaddrinfo */
+/* PSP/PS2/PS3 should not have getaddrinfo */
 #endif
 
 #endif