Skip to content

Commit

Permalink
tidy ppc uart implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
israpps committed Oct 17, 2024
1 parent ed91363 commit 120fca8
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ jobs:
strategy:
fail-fast: false
matrix:
debug: [debug, iopcore_debug, ingame_debug, deci2_debug, eesio_debug,
debug_ppctty, iopcore_ppctty_debug, ingame_ppctty_debug,
]
debug: [iopcore_debug, ingame_debug, eesio_debug, iopcore_ppctty_debug, ingame_ppctty_debug]
runs-on: ubuntu-latest
container: ghcr.io/ps2homebrew/ps2homebrew:main
steps:
Expand Down
25 changes: 14 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ EXTRAVERSION = Beta
# How to DEBUG?
# Simply type "make <debug mode>" to build OPL with the necessary debugging functionality.
# Debug modes:
# debug - UI-side debug mode (UDPTTY)
# iopcore_debug - UI-side + iopcore debug mode (UDPTTY).
# ingame_debug - UI-side + in-game debug mode. IOP core modules will not be built as debug versions (UDPTTY).
# eesio_debug - UI-side + eecore debug mode (EE SIO)
# deci2_debug - UI-side + in-game DECI2 debug mode (EE-side only).
# debug - UI-side debug mode (UDPTTY)
# iopcore_debug - UI-side + iopcore debug mode (UDPTTY).
# ingame_debug - UI-side + in-game debug mode. IOP core modules will not be built as debug versions (UDPTTY).
# debug_ppctty - UI-side debug mode (PowerPC UART)
# iopcore_ppctty_debug - UI-side + iopcore debug mode (PowerPC UART).
# ingame_ppctty_debug - UI-side + in-game debug mode. IOP core modules will not be built as debug versions (PowerPC UART).
# eesio_debug - UI-side + eecore debug mode (EE SIO)
# deci2_debug - UI-side + in-game DECI2 debug mode (EE-side only).

# I want to put my name in my custom build! How can I do it?
# Type "make LOCALVERSION=-foobar"
Expand Down Expand Up @@ -177,9 +180,9 @@ ifeq ($(DEBUG),1)
CDVDMAN_DEBUG_FLAGS = IOPCORE_DEBUG=1
MCEMU_DEBUG_FLAGS = IOPCORE_DEBUG=1
SMSTCPIP_INGAME_CFLAGS =
ifeq ($(TTY_APPROACH),UDP)
ifeq ($(TTY_APPROACH),UDP)
IOP_OBJS += udptty-ingame.o
endif
endif
else ifeq ($(EESIO_DEBUG),1)
EE_CFLAGS += -D__EESIO_DEBUG
EE_LIBS += -lsiocookie
Expand Down Expand Up @@ -222,7 +225,7 @@ EE_LDFLAGS += -fdata-sections -ffunction-sections -Wl,--gc-sections

.SILENT:

.PHONY: all release debug iopcore_debug eesio_debug ingame_debug deci2_debug clean rebuild pc_tools pc_tools_win32 oplversion format format-check ps2sdk-not-setup download_lng download_lwNBD languages
.PHONY: all release debug iopcore_debug eesio_debug ingame_debug deci2_debug debug_ppctty iopcore_ppctty_debug ingame_ppctty_debug clean rebuild pc_tools pc_tools_win32 oplversion format format-check ps2sdk-not-setup download_lng download_lwNBD languages

ifdef PS2SDK

Expand Down Expand Up @@ -253,13 +256,13 @@ deci2_debug:
$(MAKE) DEBUG=1 INGAME_DEBUG=1 DECI2_DEBUG=1 all

debug_ppctty:
$(MAKE) DEBUG=1 all TTY_APPROACH=PPC_UART
$(MAKE) DEBUG=1 TTY_APPROACH=PPC_UART all

iopcore_ppctty_debug:
$(MAKE) DEBUG=1 IOPCORE_DEBUG=1 all TTY_APPROACH=PPC_UART
$(MAKE) DEBUG=1 IOPCORE_DEBUG=1 TTY_APPROACH=PPC_UART all

ingame_ppctty_debug:
$(MAKE) DEBUG=1 INGAME_DEBUG=1 all TTY_APPROACH=PPC_UART
$(MAKE) DEBUG=1 INGAME_DEBUG=1 TTY_APPROACH=PPC_UART all

clean: download_lwNBD
echo "Cleaning..."
Expand Down
12 changes: 6 additions & 6 deletions ee_core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,19 @@ ifeq ($(EESIO_DEBUG),1)
endif

ifeq ($(DTL_T10000),1)
EE_CFLAGS += -D_DTL_T10000
EE_CFLAGS += -D_DTL_T10000
endif

ifeq ($(LOAD_DEBUG_MODULES),1)
EE_CFLAGS += -D__LOAD_DEBUG_MODULES
ifeq ($(DECI2_DEBUG),1)
ifeq ($(DECI2_DEBUG),1)
EE_CFLAGS += -D__DECI2_DEBUG
endif
ifeq ($(TTY_APPROACH),UDP)
endif
ifeq ($(TTY_APPROACH),UDP)
EE_CFLAGS += -DTTY_UDP
else ifeq ($(TTY_APPROACH),PPC_UART)
else ifeq ($(TTY_APPROACH),PPC_UART)
EE_CFLAGS += -DTTY_PPC
endif
endif
endif

ifeq ($(IGS),1)
Expand Down
4 changes: 3 additions & 1 deletion ee_core/src/iopmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,15 +98,17 @@ static void ResetIopSpecial(const char *args, unsigned int arglen)
DPRINTF("Loading extra IOP modules...\n");

#ifdef __LOAD_DEBUG_MODULES
#if !defined(TTY_PPC)
LoadOPLModule(OPL_MODULE_ID_SMSTCPIP, 0, 0, NULL);
LoadOPLModule(OPL_MODULE_ID_SMAP, 0, g_ipconfig_len, g_ipconfig);
#endif
#ifdef __DECI2_DEBUG
LoadOPLModule(OPL_MODULE_ID_DRVTIF, 0, 0, NULL);
LoadOPLModule(OPL_MODULE_ID_TIFINET, 0, 0, NULL);
#elif defined(TTY_UDP)
LoadOPLModule(OPL_MODULE_ID_UDPTTY, 0, 0, NULL);
LoadOPLModule(OPL_MODULE_ID_IOPTRAP, 0, 0, NULL);
#elif defined(TTY_PPC_UART)
#elif defined(TTY_PPC)
LoadOPLModule(OPL_MODULE_ID_PPCTTY, 0, 0, NULL);
LoadOPLModule(OPL_MODULE_ID_IOPTRAP, 0, 0, NULL);
#endif
Expand Down
2 changes: 2 additions & 0 deletions src/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,10 @@ int debugSetActive(void)
#ifndef _DTL_T10000
int ret;

#if defined(TTY_UDP) || defined(__DECI2_DEBUG)
if ((ret = ethLoadInitModules()) != 0)
return -1;
#endif

#ifdef __DECI2_DEBUG
LOG("[DRVTIF]:\n");
Expand Down
5 changes: 4 additions & 1 deletion src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,7 +832,10 @@ void sysLaunchLoaderElf(const char *filename, const char *mode_str, int size_cdv
#ifdef __DECI2_DEBUG
modules |= CORE_IRX_DECI2 | CORE_IRX_ETH;
#elif defined(__INGAME_DEBUG)
modules |= CORE_IRX_DEBUG | CORE_IRX_ETH;
modules |= CORE_IRX_DEBUG;
#ifdef TTY_UDP
modules |= CORE_IRX_ETH;
#endif
#endif

modules |= CORE_IRX_VMC;
Expand Down

0 comments on commit 120fca8

Please sign in to comment.