Skip to content

Commit

Permalink
add arcade UART variant
Browse files Browse the repository at this point in the history
  • Loading branch information
israpps committed Sep 5, 2024
1 parent 1bf2b27 commit 9e11d77
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ jobs:
fail-fast: false
matrix:
eth: ["ETH=0", "ETH=1"]
bdmstuff: ["EXFAT=0", "EXFAT=1", "EXFAT=1 MX4SIO=1"]
ds34: ["DS34=0", "DS34=1"]
coh: ["COH=0", "COH=1"]
bdmstuff: ["EXFAT=1", "EXFAT=1 MX4SIO=1"] #"EXFAT=0",
#ds34: ["DS34=0", "DS34=1"]
coh: ["COH=1", "COH=1 ACUART=1"] #"COH=0",
exclude:
- bdmstuff: "EXFAT=1 MX4SIO=1"
coh: "COH=1"
Expand Down
8 changes: 7 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ CDVDFSV ?= 1
# ----------------------------- #
.SILENT:

BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_SMB)$(HAS_DVRP)$(HAS_XFROM)$(HAS_MX4SIO)$(HAS_COH)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_TTY2SIOR)$(HAS_IOP_RESET)
BIN_NAME = $(HAS_EXFAT)$(HAS_DS34)$(HAS_ETH)$(HAS_SMB)$(HAS_DVRP)$(HAS_XFROM)$(HAS_MX4SIO)$(HAS_COH)$(HAS_EESIO)$(HAS_UDPTTY)$(HAS_ACUART)$(HAS_IOP_RESET)
ifeq ($(DEBUG), 0)
EE_BIN = UNC-BOOT$(BIN_NAME).ELF
EE_BIN_PKD = BOOT$(BIN_NAME).ELF
Expand Down Expand Up @@ -65,6 +65,12 @@ ifeq ($(COH), 1)
EE_CFLAGS += -DSUPPORT_SYSTEM_2X6
HOMEBREW_DONGLEMAN = 1
EE_OBJS += mcman_irx.o
ifeq ($(ACUART), 1)
$(info -- adding support for arcade UART)
EE_OBJS += acuart_tty_irx.o
EE_CFLAGS += -DACUART
HAS_ACUART = -ACUART
endif
endif

ifeq ($(XFROM),1)
Expand Down
4 changes: 2 additions & 2 deletions embed.make
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,8 @@ $(EE_ASM_DIR)ps2kbd_irx.s: $(PS2SDK)/iop/irx/ps2kbd.irx | $(EE_ASM_DIR)
$(EE_ASM_DIR)sior_irx.s: $(PS2SDK)/iop/irx/sior.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ sior_irx

$(EE_ASM_DIR)tty2sior_irx.s:iop/__precompiled/tty2sior.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ tty2sior_irx
$(EE_ASM_DIR)acuart_tty_irx.s: iop/__precompiled/acuart_tty.irx | $(EE_ASM_DIR)
$(BIN2S) $< $@ acuart_tty_irx

iop/AllowDVDV.irx: iop/AllowDVDV
$(MAKE) -C $<
Expand Down
Binary file added iop/__precompiled/acuart_tty.irx
Binary file not shown.
28 changes: 22 additions & 6 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ IMPORT_BIN2C(dvrfile_irx);
IMPORT_BIN2C(cdvd_irx);
#endif

#ifdef ACUART
IMPORT_BIN2C(acuart_tty_irx);
#endif

// Mandatory IRX
IMPORT_BIN2C(iomanx_irx);
IMPORT_BIN2C(filexio_irx);
Expand Down Expand Up @@ -440,7 +444,7 @@ static void Show_build_info(void)
" MX4SIO=0"
#endif
, COLOR_TEXT);
#if defined(UDPTTY) || defined(SIO_DEBUG) || defined(TTY2SIOR) || defined(NO_IOP_RESET)
#if defined(UDPTTY) || defined(SIO_DEBUG) || defined(ACUART) || defined(NO_IOP_RESET)


PrintPos(-1, hpos, "Debug Features:", COLOR_SELECT);
Expand All @@ -462,10 +466,10 @@ static void Show_build_info(void)
#else
" SIO_DEBUG=0"
#endif
#ifdef TTY2SIOR
" TTY2SIOR=1"
#ifdef ACUART
" ACUART=1"
#else
" TTY2SIOR=0"
" ACUART=0"
#endif
, COLOR_TEXT);
#endif
Expand Down Expand Up @@ -2480,12 +2484,19 @@ static void Reset()
#ifdef XFROM
have_Flash_modules = 0;
#endif

#ifdef UDPTTY
int i, d;
int i, d;
load_ps2ip();
i = SifExecModuleBuffer(&udptty_irx, size_udptty_irx, 0, NULL, &d);
DPRINTF(" [UDPTTY]: id=%d, ret=%d\n", i, d);
#endif
#ifdef ACUART
int i, d;
i = SifExecModuleBuffer(&acuart_tty_irx, size_acuart_tty_irx, 0, NULL, &d);
DPRINTF(" [ACUART]: id=%d, ret=%d\n", i, d);
#endif

loadBasicModules();
#ifndef SUPPORT_SYSTEM_2X6
loadCdModules();
Expand Down Expand Up @@ -2798,7 +2809,12 @@ int main(int argc, char *argv[])
break;
}
}
sprintf(mainMsg + strlen(mainMsg), (i == -1) ? " | ACJVLOAD.IRX loaded" : " | ACJVLOAD.IRX not found");
sprintf(mainMsg + strlen(mainMsg), (i == -1) ? " | ACJVLOAD loaded" : " | ACJVLOAD not found");

Check warning on line 2812 in src/main.c

View check run for this annotation

codefactor.io / CodeFactor

src/main.c#L2812

Buffer copy without checking size of input (CWE-120) (flawfinder7-sprintf)
if (exists("mass:watchdog.opt") || exists("watchdog.opt")) {
DPRINTF("Starting watchdog\n");
id = SifLoadStartModule("rom0:DAEMON", 0, NULL, &ret);
sprintf(mainMsg + strlen(mainMsg), (id > 0 && ret != 1) ? " | watchdog running" : " | watchdog error");

Check warning on line 2816 in src/main.c

View check run for this annotation

codefactor.io / CodeFactor

src/main.c#L2816

Buffer copy without checking size of input (CWE-120) (flawfinder7-sprintf)
}
DPRINTF("%s\n",mainMsg);
#endif

Expand Down

0 comments on commit 9e11d77

Please sign in to comment.