diff --git a/.github/workflows/compilation.yml b/.github/workflows/compilation.yml new file mode 100644 index 0000000..4d46418 --- /dev/null +++ b/.github/workflows/compilation.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + pull_request: + repository_dispatch: + types: [run_build] + +jobs: + build: + runs-on: ubuntu-latest + container: ghcr.io/pspdev/pspsdk:latest + steps: + - uses: actions/checkout@v2 + + - name: Install dependencies + run: | + apk add build-base readline-dev libusb-compat-dev + + - name: Compile project + run: | + make -j $(getconf _NPROCESSORS_ONLN) clean + make -j $(getconf _NPROCESSORS_ONLN) + make -j $(getconf _NPROCESSORS_ONLN) -C pspsh install + make -j $(getconf _NPROCESSORS_ONLN) -C usbhostfs_pc + make release + + - name: Get short SHA + id: slug + run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)" + + - name: Upload artifacts + if: ${{ success() }} + uses: actions/upload-artifact@v2 + with: + name: psplinkusb-${{ steps.slug.outputs.sha8 }} + path: release + + - name: Extract tag name + if: startsWith(github.ref, 'refs/tags/') + id: tag + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + + - name: Compress & Rename bin folder + run: | + tar -zcvf psplinkusb.tar.gz release/psplink + + - name: Create pre-release + if: github.ref == 'refs/heads/master' + uses: softprops/action-gh-release@v1 + with: + files: | + psplinkusb.tar.gz + release/psplink_manual.pdf + prerelease: true + name: "Development build" + tag_name: "latest" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Release + if: startsWith(github.ref, 'refs/tags/') + uses: softprops/action-gh-release@v1 + with: + files: | + psplinkusb.tar.gz + release/psplink_manual.pdf + tag_name: ${{ steps.tag.outputs.VERSION }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 54d1be5..7dd57b9 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,9 @@ *.ko *.obj *.elf +*.PBP +*.prx +*.SFO # Precompiled Headers *.gch @@ -31,13 +34,12 @@ # Debug files *.dSYM/ -# PSP -*.prx -*.PBP -*.SFO +# Releases & oputput folders +release/ +release_oe/ # Built tools pspsh/pspsh tools/remotejoy/pcsdl/remotejoy tools/remotejoy/pc/remotejoy -usbhostfs_pc/usbhostfs_pc +usbhostfs_pc/usbhostfs_pc \ No newline at end of file diff --git a/Makefile b/Makefile index 4cb33af..9cde474 100644 --- a/Makefile +++ b/Makefile @@ -12,3 +12,4 @@ release: clean: $(MAKE) -f Makefile.psp clean $(MAKE) -f Makefile.tools clean + rm -rf **/*.PBP **/*.SFO diff --git a/README.md b/README.md index d23c30b..5f7309a 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# PSPLINK 3.0.1 +# PSPLINK 3.0.2 Please read the manual document for installation instructions and an example of usage. diff --git a/bootstrap/Makefile b/bootstrap/Makefile index 048d6ec..c409b94 100644 --- a/bootstrap/Makefile +++ b/bootstrap/Makefile @@ -1,5 +1,5 @@ release: all - mksfoex -d MEMSIZE=1 'PSPLink v3.0.1' PARAM.SFO + mksfoex -d MEMSIZE=1 'PSPLink v3.0.2' PARAM.SFO pack-pbp EBOOT.PBP PARAM.SFO psplink.png NULL NULL NULL NULL psplink_boot.prx NULL clean_release: @@ -10,7 +10,7 @@ TARGET = psplink_boot OBJS = main.o INCDIR = -CFLAGS = -O2 -G0 -Wall +CFLAGS = -O2 -G0 -Wall -g CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) diff --git a/psplink/Makefile b/psplink/Makefile index f181b82..f8077c2 100644 --- a/psplink/Makefile +++ b/psplink/Makefile @@ -1,14 +1,11 @@ TARGET = psplink OBJS = main.o shell.o config.o bitmap.o tty.o decodeaddr.o memoryUID.o kmode.o exception.o exception_asm.o psplinkcnf.o util.o debug.o libs.o apihook.o thctx.o stdio.o usbshell.o modload.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 -#USE_PSPSDK_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = ../usbhostfs -CFLAGS = -Os -G0 -Wall -fno-builtin-printf -ggdb +CFLAGS = -Os -Wall -fno-builtin-printf -ggdb CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LDFLAGS=-nodefaultlibs -L../libusbhostfs_driver diff --git a/psplink/shell.c b/psplink/shell.c index f05156c..2fcda6c 100644 --- a/psplink/shell.c +++ b/psplink/shell.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include @@ -1746,9 +1745,9 @@ static int list_dir(const char *name) sprintf(p, " %8d ", (int) dir.d_stat.st_size); p += strlen(p); - sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.st_mtime.day, - dir.d_stat.st_mtime.month, dir.d_stat.st_mtime.year, - dir.d_stat.st_mtime.hour, dir.d_stat.st_mtime.minute); + sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.sce_st_ctime.day, + dir.d_stat.sce_st_ctime.month, dir.d_stat.sce_st_ctime.year, + dir.d_stat.sce_st_ctime.hour, dir.d_stat.sce_st_ctime.minute); p += strlen(p); sprintf(p, "%s", dir.d_name); SHELL_PRINT("%s\n", buffer); @@ -1997,6 +1996,23 @@ static int remap_cmd(int argc, char **argv, unsigned int *vRet) return CMD_OK; } +// Iterative function to implement `atoi()` function in C +static long atoi(const char* S) +{ + long num = 0; + + int i = 0; + + // run till the end of the string is reached, or the + // current character is non-numeric + while (S[i] && (S[i] >= '0' && S[i] <= '9')) + { + num = num * 10 + (S[i] - '0'); + i++; + } + + return num; +} static int meminfo_cmd(int argc, char **argv, unsigned int *vRet) { int i; diff --git a/psplink/version.h b/psplink/version.h index b51d13a..1dfe701 100644 --- a/psplink/version.h +++ b/psplink/version.h @@ -12,6 +12,6 @@ #ifndef __VERSION_H__ #define __VERSION_H__ -#define PSPLINK_VERSION "v3.0.1" +#define PSPLINK_VERSION "v3.0.2" #endif diff --git a/psplink_user/Makefile b/psplink_user/Makefile index d3977ed..76833c1 100644 --- a/psplink_user/Makefile +++ b/psplink_user/Makefile @@ -5,7 +5,7 @@ BUILD_PRX=1 PRX_EXPORTS=exports.exp INCDIR = -CFLAGS = -O2 -G0 -Wall -I../libpsplink +CFLAGS = -O2 -Wall -I../libpsplink CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti LDFLAGS= -nostartfiles -L../libpsplink ASFLAGS = $(CFLAGS) diff --git a/pspsh/Makefile b/pspsh/Makefile index 3d77eca..ca9612a 100644 --- a/pspsh/Makefile +++ b/pspsh/Makefile @@ -1,7 +1,13 @@ OUTPUT=pspsh OBJS=pspsh.o parse_args.o pspkerror.o asm.o disasm.o -CXXFLAGS=-Wall -g -D_PCTERM -I../psplink +ifeq ($(DEBUG), 1) + CXXFLAGS += -O0 -g +else + CXXFLAGS += -O3 +endif + +CXXFLAGS+= -Wall -D_PCTERM -I../psplink LIBS=-lreadline -lcurses PREFIX=$(shell psp-config --pspdev-path 2> /dev/null) diff --git a/tools/debugmenu/Makefile b/tools/debugmenu/Makefile index be91ff9..e4b8d83 100644 --- a/tools/debugmenu/Makefile +++ b/tools/debugmenu/Makefile @@ -1,8 +1,6 @@ TARGET = debugmenu OBJS = main.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 diff --git a/tools/remotejoy/Makefile b/tools/remotejoy/Makefile index e5ade13..44690d4 100644 --- a/tools/remotejoy/Makefile +++ b/tools/remotejoy/Makefile @@ -1,14 +1,11 @@ TARGET = remotejoy OBJS = main.o kmode.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../../usbhostfs -I../../psplink +CFLAGS = -Os -Wall -fno-builtin-printf -I../../usbhostfs -I../../psplink CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LDFLAGS = -L../../libpsplink_driver -L../../libusbhostfs_driver diff --git a/tools/scrkprintf/Makefile b/tools/scrkprintf/Makefile index 8f2e69f..e3390fb 100644 --- a/tools/scrkprintf/Makefile +++ b/tools/scrkprintf/Makefile @@ -1,14 +1,11 @@ TARGET = scrkprintf OBJS = main.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf +CFLAGS = -Os -Wall -fno-builtin-printf CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) diff --git a/tools/siokprintf/Makefile b/tools/siokprintf/Makefile index 0c19ee4..6790750 100644 --- a/tools/siokprintf/Makefile +++ b/tools/siokprintf/Makefile @@ -1,14 +1,11 @@ TARGET = siokprintf OBJS = main.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf +CFLAGS = -Os -Wall -fno-builtin-printf CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) diff --git a/tools/usbkprintf/Makefile b/tools/usbkprintf/Makefile index eee8fc7..26b637b 100644 --- a/tools/usbkprintf/Makefile +++ b/tools/usbkprintf/Makefile @@ -1,14 +1,11 @@ TARGET = usbkprintf OBJS = main.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf +CFLAGS = -Os -Wall -fno-builtin-printf CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) diff --git a/usbgdb/Makefile b/usbgdb/Makefile index d2954d8..c6f0f7d 100644 --- a/usbgdb/Makefile +++ b/usbgdb/Makefile @@ -1,14 +1,11 @@ TARGET = usbgdb OBJS = main.o gdb-stub.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs -I../psplink +CFLAGS = -Os -Wall -fno-builtin-printf -I../usbhostfs -I../psplink CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LDFLAGS = -L../libpsplink_driver -L../libusbhostfs_driver diff --git a/usbhostfs/Makefile b/usbhostfs/Makefile index 9fa4214..20e5cda 100644 --- a/usbhostfs/Makefile +++ b/usbhostfs/Makefile @@ -1,14 +1,11 @@ TARGET = usbhostfs OBJS = main.o host_driver.o kmode.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -O2 -G0 -Wall -fno-builtin-printf +CFLAGS = -Os -Wall -fno-builtin-printf CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) diff --git a/usbhostfs/host_driver.c b/usbhostfs/host_driver.c index e539ec7..872deda 100644 --- a/usbhostfs/host_driver.c +++ b/usbhostfs/host_driver.c @@ -784,18 +784,18 @@ static int io_chstat(PspIoDrvFileArg *arg, const char *file, SceIoStat *stat, in cmd.bits = bits; cmd.mode = stat->st_mode; cmd.size = stat->st_size; - cmd.atime.year = stat->st_atime.year; - cmd.atime.month = stat->st_atime.month; - cmd.atime.day = stat->st_atime.day; - cmd.atime.hour = stat->st_atime.hour; - cmd.atime.minute = stat->st_mtime.minute; - cmd.atime.second = stat->st_mtime.second; - cmd.mtime.year = stat->st_mtime.year; - cmd.mtime.month = stat->st_mtime.month; - cmd.mtime.day = stat->st_mtime.day; - cmd.mtime.hour = stat->st_mtime.hour; - cmd.mtime.minute = stat->st_mtime.minute; - cmd.mtime.second = stat->st_mtime.second; + cmd.atime.year = stat->sce_st_atime.year; + cmd.atime.month = stat->sce_st_atime.month; + cmd.atime.day = stat->sce_st_atime.day; + cmd.atime.hour = stat->sce_st_atime.hour; + cmd.atime.minute = stat->sce_st_mtime.minute; + cmd.atime.second = stat->sce_st_mtime.second; + cmd.mtime.year = stat->sce_st_mtime.year; + cmd.mtime.month = stat->sce_st_mtime.month; + cmd.mtime.day = stat->sce_st_mtime.day; + cmd.mtime.hour = stat->sce_st_mtime.hour; + cmd.mtime.minute = stat->sce_st_mtime.minute; + cmd.mtime.second = stat->sce_st_mtime.second; cmd.fsnum = arg->fs_num; if(usb_connected()) diff --git a/usbshell/Makefile b/usbshell/Makefile index 6062397..51010de 100644 --- a/usbshell/Makefile +++ b/usbshell/Makefile @@ -1,14 +1,11 @@ TARGET = usbshell OBJS = main.o exports.o -# Use the kernel's small inbuilt libc -USE_KERNEL_LIBC = 1 # Use only kernel libraries USE_KERNEL_LIBS = 1 INCDIR = -#CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -DDEBUG -CFLAGS = -Os -G0 -Wall -fno-builtin-printf -I../usbhostfs +CFLAGS = -Os -Wall -fno-builtin-printf -I../usbhostfs CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti ASFLAGS = $(CFLAGS) LDFLAGS = -L../libpsplink_driver -L../libusbhostfs_driver