Skip to content

Commit dbf5b94

Browse files
authored
Merge pull request #18 from fjtrujy/master
Upgrade to Posix toolchain
2 parents 9a9512e + 1444b01 commit dbf5b94

File tree

19 files changed

+130
-61
lines changed

19 files changed

+130
-61
lines changed

.github/workflows/compilation.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
repository_dispatch:
7+
types: [run_build]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
container: ghcr.io/pspdev/pspsdk:latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
16+
- name: Install dependencies
17+
run: |
18+
apk add build-base readline-dev libusb-compat-dev
19+
20+
- name: Compile project
21+
run: |
22+
make -j $(getconf _NPROCESSORS_ONLN) clean
23+
make -j $(getconf _NPROCESSORS_ONLN)
24+
make -j $(getconf _NPROCESSORS_ONLN) -C pspsh install
25+
make -j $(getconf _NPROCESSORS_ONLN) -C usbhostfs_pc
26+
make release
27+
28+
- name: Get short SHA
29+
id: slug
30+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
31+
32+
- name: Upload artifacts
33+
if: ${{ success() }}
34+
uses: actions/upload-artifact@v2
35+
with:
36+
name: psplinkusb-${{ steps.slug.outputs.sha8 }}
37+
path: release
38+
39+
- name: Extract tag name
40+
if: startsWith(github.ref, 'refs/tags/')
41+
id: tag
42+
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
43+
44+
- name: Compress & Rename bin folder
45+
run: |
46+
tar -zcvf psplinkusb.tar.gz release/psplink
47+
48+
- name: Create pre-release
49+
if: github.ref == 'refs/heads/master'
50+
uses: softprops/action-gh-release@v1
51+
with:
52+
files: |
53+
psplinkusb.tar.gz
54+
release/psplink_manual.pdf
55+
prerelease: true
56+
name: "Development build"
57+
tag_name: "latest"
58+
env:
59+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
60+
61+
- name: Release
62+
if: startsWith(github.ref, 'refs/tags/')
63+
uses: softprops/action-gh-release@v1
64+
with:
65+
files: |
66+
psplinkusb.tar.gz
67+
release/psplink_manual.pdf
68+
tag_name: ${{ steps.tag.outputs.VERSION }}
69+
env:
70+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
*.ko
44
*.obj
55
*.elf
6+
*.PBP
7+
*.prx
8+
*.SFO
69

710
# Precompiled Headers
811
*.gch
@@ -31,13 +34,12 @@
3134
# Debug files
3235
*.dSYM/
3336

34-
# PSP
35-
*.prx
36-
*.PBP
37-
*.SFO
37+
# Releases & oputput folders
38+
release/
39+
release_oe/
3840

3941
# Built tools
4042
pspsh/pspsh
4143
tools/remotejoy/pcsdl/remotejoy
4244
tools/remotejoy/pc/remotejoy
43-
usbhostfs_pc/usbhostfs_pc
45+
usbhostfs_pc/usbhostfs_pc

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ release:
1212
clean:
1313
$(MAKE) -f Makefile.psp clean
1414
$(MAKE) -f Makefile.tools clean
15+
rm -rf **/*.PBP **/*.SFO

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# PSPLINK 3.0.1
1+
# PSPLINK 3.0.2
22

33
Please read the manual document for installation instructions and an example
44
of usage.

bootstrap/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
release: all
2-
mksfoex -d MEMSIZE=1 'PSPLink v3.0.1' PARAM.SFO
2+
mksfoex -d MEMSIZE=1 'PSPLink v3.0.2' PARAM.SFO
33
pack-pbp EBOOT.PBP PARAM.SFO psplink.png NULL NULL NULL NULL psplink_boot.prx NULL
44

55
clean_release:
@@ -10,7 +10,7 @@ TARGET = psplink_boot
1010
OBJS = main.o
1111

1212
INCDIR =
13-
CFLAGS = -O2 -G0 -Wall
13+
CFLAGS = -O2 -G0 -Wall -g
1414
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
1515
ASFLAGS = $(CFLAGS)
1616

psplink/Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
TARGET = psplink
22
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
33

4-
# Use the kernel's small inbuilt libc
5-
USE_KERNEL_LIBC = 1
6-
#USE_PSPSDK_LIBC = 1
74
# Use only kernel libraries
85
USE_KERNEL_LIBS = 1
96

107
INCDIR = ../usbhostfs
11-
CFLAGS = -Os -G0 -Wall -fno-builtin-printf -ggdb
8+
CFLAGS = -Os -Wall -fno-builtin-printf -ggdb
129
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
1310
ASFLAGS = $(CFLAGS)
1411
LDFLAGS=-nodefaultlibs -L../libusbhostfs_driver

psplink/shell.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#include <pspdebug.h>
1414
#include <pspsdk.h>
1515
#include <stdio.h>
16-
#include <stdlib.h>
1716
#include <string.h>
1817
#include <pspusb.h>
1918
#include <pspusbstor.h>
@@ -1746,9 +1745,9 @@ static int list_dir(const char *name)
17461745

17471746
sprintf(p, " %8d ", (int) dir.d_stat.st_size);
17481747
p += strlen(p);
1749-
sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.st_mtime.day,
1750-
dir.d_stat.st_mtime.month, dir.d_stat.st_mtime.year,
1751-
dir.d_stat.st_mtime.hour, dir.d_stat.st_mtime.minute);
1748+
sprintf(p, "%02d-%02d-%04d %02d:%02d ", dir.d_stat.sce_st_ctime.day,
1749+
dir.d_stat.sce_st_ctime.month, dir.d_stat.sce_st_ctime.year,
1750+
dir.d_stat.sce_st_ctime.hour, dir.d_stat.sce_st_ctime.minute);
17521751
p += strlen(p);
17531752
sprintf(p, "%s", dir.d_name);
17541753
SHELL_PRINT("%s\n", buffer);
@@ -1997,6 +1996,23 @@ static int remap_cmd(int argc, char **argv, unsigned int *vRet)
19971996
return CMD_OK;
19981997
}
19991998

1999+
// Iterative function to implement `atoi()` function in C
2000+
static long atoi(const char* S)
2001+
{
2002+
long num = 0;
2003+
2004+
int i = 0;
2005+
2006+
// run till the end of the string is reached, or the
2007+
// current character is non-numeric
2008+
while (S[i] && (S[i] >= '0' && S[i] <= '9'))
2009+
{
2010+
num = num * 10 + (S[i] - '0');
2011+
i++;
2012+
}
2013+
2014+
return num;
2015+
}
20002016
static int meminfo_cmd(int argc, char **argv, unsigned int *vRet)
20012017
{
20022018
int i;

psplink/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
#ifndef __VERSION_H__
1313
#define __VERSION_H__
1414

15-
#define PSPLINK_VERSION "v3.0.1"
15+
#define PSPLINK_VERSION "v3.0.2"
1616

1717
#endif

psplink_user/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ BUILD_PRX=1
55
PRX_EXPORTS=exports.exp
66

77
INCDIR =
8-
CFLAGS = -O2 -G0 -Wall -I../libpsplink
8+
CFLAGS = -O2 -Wall -I../libpsplink
99
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
1010
LDFLAGS= -nostartfiles -L../libpsplink
1111
ASFLAGS = $(CFLAGS)

pspsh/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
OUTPUT=pspsh
22
OBJS=pspsh.o parse_args.o pspkerror.o asm.o disasm.o
33

4-
CXXFLAGS=-Wall -g -D_PCTERM -I../psplink
4+
ifeq ($(DEBUG), 1)
5+
CXXFLAGS += -O0 -g
6+
else
7+
CXXFLAGS += -O3
8+
endif
9+
10+
CXXFLAGS+= -Wall -D_PCTERM -I../psplink
511
LIBS=-lreadline -lcurses
612

713
PREFIX=$(shell psp-config --pspdev-path 2> /dev/null)

0 commit comments

Comments
 (0)