1
0
mirror of https://github.com/libretro/RetroArch synced 2024-07-03 00:38:44 +00:00

[ORBIS] add debugnet support

This commit is contained in:
Antonio Jose Ramos Marquez 2021-09-02 00:39:09 +02:00 committed by Francisco Javier Trujillo Mata
parent c6d51fdb32
commit 4dd779467d
3 changed files with 108 additions and 6 deletions

View File

@ -11,8 +11,10 @@ HAVE_KEYBOARD ?= 0
PS4_TITLE_ID := RETROARCH
PS4_TITLE_NAME := RetroArch
PC_DEVELOPMENT_IP_ADDRESS =
PC_DEVELOPMENT_UDP_PORT =
PC_DEVELOPMENT_IP_ADDRESS = 192.168.1.12
PC_DEVELOPMENT_UDP_PORT = 18194
DEBUG=1
AUTH_INFO = 000000000000000000000000001C004000FF000000000080000000000000000000000000000000000000008000400040000000000000008000000000000000080040FFFF000000F000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
OBJ :=
DEFINES :=
@ -160,13 +162,13 @@ ifeq ($(WHOLE_ARCHIVE_LINK), 1)
endif
PS4_LIBS += -lkernel_stub -lSceLibcInternal_stub -lSceSysmodule_stub -lSceSystemService_stub \
-lSceUserService_stub -lSceAudioOut_stub -lScePad_stub -lSceNet_stub -lSceNetCtl_stub -lScePigletv2VSH_stub
-lSceUserService_stub -lSceAudioOut_stub -lScePad_stub -lSceNet_stub -lSceNetCtl_stub -lScePigletv2VSH_stub -lSceOrbisCompat_stub -lorbis -lSceIme_stub
LIBS := $(WHOLE_START) -lretro_ps4 $(WHOLE_END) $(PS4_LIBS)
CFLAGS := -cc1 -triple x86_64-scei-ps4-elf -munwind-tables -mcmodel=large -Wno-zero-length-array -Wno-format-pedantic -emit-obj -std=c11 $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
CXXFLAGS := -cc1 -triple x86_64-scei-ps4-elf -munwind-tables -Wall -pedantic -m64 -mcmodel=large -Wno-zero-length-array -Wno-format-pedantic -emit-obj -std=c++11 $(ARCHFLAGS) $(INCDIRS) $(DEFINES)
LDFLAGS := -isysroot $(ORBISDEV)/usr -L. -Llib -Wl,--gc-sections -Wl,-z -Wl,max-page-size=0x4000 -Wl,--dynamic-linker="/libexec/ld-elf.so.1" -Wl,-pie -Wl,--eh-frame-hdr -L$(ORBISDEV)/usr/lib -target x86_64-scei-ps4-elf -T $(ORBISDEV)/linker.x $(PS4_LIBS)
LDFLAGS := -isysroot $(ORBISDEV)/usr -L. -Llib -Wl,--gc-sections -Wl,-z -Wl,max-page-size=0x4000 -Wl,--dynamic-linker="/libexec/ld-elf.so.1" -Wl,-pie -Wl,--eh-frame-hdr -L$(ORBISDEV)/usr/lib -target x86_64-scei-ps4-elf -T $(ORBISDEV)/linker.x
ARFLAGS := rcs
ifeq ($(DEBUG), 1)
@ -200,6 +202,14 @@ $(TARGET).a: $(OBJ)
$(AR) $(ARFLAGS) $(TARGET).a $(OBJ)
#$(OO_PS4_TOOLCHAIN)/bin/$(CDIR)/create-eboot -in=$(TARGET).elf -out=$(TARGET).oelf --paid 0x3800000000000011
install:
@cp homebrew.self /usr/local/orbisdev/git/ps4sh/bin/hostapp
@echo "Installed!"
oelf:
@orbis-elf-create $(TARGET).elf homebrew.oelf
eboot:
python $(ORBISDEV)/bin/make_fself.py --auth-info $(AUTH_INFO) homebrew.oelf homebrew.self
clean:
rm -f $(OBJ) $(TARGET).elf $(TARGET).oelf

View File

@ -37,6 +37,17 @@
#error "An UDP port for the PC logging server was not set in the Makefile, cannot continue."
#endif
#ifdef ORBIS
void logger_init(void)
{
debugNetInit(PC_DEVELOPMENT_IP_ADDRESS,PC_DEVELOPMENT_UDP_PORT,3);
}
void logger_shutdown(void)
{
debugNetFinish();
}
#else
/* TODO/FIXME - static global variables */
static int g_sid;
static struct sockaddr_in target;
@ -98,3 +109,4 @@ void logger_send_v(const char *__format, va_list args)
(struct sockaddr*)&target,
sizeof(target));
}
#endif

View File

@ -26,6 +26,10 @@
#include "config.h"
#endif
#ifdef ORBIS
#include <debugnet.h>
#endif
RETRO_BEGIN_DECLS
#define FILE_PATH_LOG_DBG "[DEBUG]"
@ -58,6 +62,44 @@ void logger_send_v(const char *__format, va_list args);
#ifdef IS_SALAMANDER
#ifdef ORBIS
#define RARCH_DBG(...) do { \
debugNetPrintf(DEBUGNET_DEBUG,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_DEBUG,tag,fmt,vp); \
} while (0)
#define RARCH_ERR(...) do { \
debugNetPrintf(DEBUGNET_ERROR,"" __VA_ARGS__); \
} while (0)
#define RARCH_ERR_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_ERROR,tag,fmt,vp); \
} while (0)
#define RARCH_WARN(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_WARN_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_DEBUG,tag,fmt,vp); \
} while (0)
#define RARCH_LOG_OUTPUT(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG_OUTPUT_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_INFO,tag,fmt,vp); \
} while (0)
#else
#define RARCH_DBG(...) do { \
logger_send("RetroArch Salamander: " __VA_ARGS__); \
} while (0)
@ -97,9 +139,47 @@ void logger_send_v(const char *__format, va_list args);
logger_send("[WARN] " tag); \
logger_send_v(fmt, vp); \
} while (0)
#endif
#else /* IS_SALAMANDER */
#ifdef ORBIS
#define RARCH_DBG(...) do { \
debugNetPrintf(DEBUGNET_DEBUG,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_DEBUG,tag,fmt,vp); \
} while (0)
#define RARCH_ERR(...) do { \
debugNetPrintf(DEBUGNET_ERROR,"" __VA_ARGS__); \
} while (0)
#define RARCH_ERR_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_ERROR,tag,fmt,vp); \
} while (0)
#define RARCH_WARN(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_WARN_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_DEBUG,tag,fmt,vp); \
} while (0)
#define RARCH_LOG_OUTPUT(...) do { \
debugNetPrintf(DEBUGNET_INFO,"" __VA_ARGS__); \
} while (0)
#define RARCH_LOG_OUTPUT_V(tag, fmt, vp) do { \
debugNetPrintf(DEBUGNET_INFO,tag,fmt,vp); \
} while (0)
#else
#define RARCH_DBG(...) do { \
logger_send("" __VA_ARGS__); \
} while (0)
@ -140,7 +220,7 @@ void logger_send_v(const char *__format, va_list args);
logger_send_v(fmt, vp); \
} while (0)
#endif
#endif
#define RARCH_LOG_BUFFER(...) do { } while (0)
#else /* HAVE_LOGGER */