Skip to content

Commit c0e2b3b

Browse files
authored
Merge pull request #10 from AKuHAK/patch-3
Windows build and GitHub actions fixed
2 parents 8236fba + e1af223 commit c0e2b3b

File tree

14 files changed

+244
-106
lines changed

14 files changed

+244
-106
lines changed

.editorconfig

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# EditorConfig: http://EditorConfig.org
2+
3+
# Top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
charset = utf-8
12+
13+
# 1 space indentation
14+
[*.{c,h,js,css,html}]
15+
indent_style = space
16+
indent_size = 1
17+
18+
# Tab indentation
19+
[Makefile*]
20+
indent_style = tab

.github/workflows/compilation.yml

Lines changed: 79 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,101 @@ name: CI
33
on:
44
push:
55
pull_request:
6-
repository_dispatch:
7-
types: [run_build]
86

97
jobs:
108
build:
119
runs-on: ${{ matrix.os }}
1210
strategy:
1311
matrix:
1412
os: [macos-latest, ubuntu-latest]
15-
16-
steps:
13+
14+
steps:
1715
- uses: actions/checkout@v2
18-
19-
- name: Runs all the stages in the shell
16+
17+
- name: Compile native versions
2018
run: |
21-
export PS2DEV=$PWD/ps2dev
22-
export PS2SDK=$PS2DEV/ps2sdk
23-
export GSKIT=$PS2DEV/gsKit
24-
export PATH=$PATH:$PS2DEV/bin:$PS2DEV/ee/bin:$PS2DEV/iop/bin:$PS2DEV/dvp/bin:$PS2SDK/bin
25-
make clean all install
26-
19+
make --debug
20+
2721
- name: Get short SHA
2822
id: slug
2923
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
30-
31-
- name: Compress bin folder
32-
run: |
33-
tar -zcvf bin.tar.gz ps2dev/bin
34-
24+
25+
- name: Create tar archive (keep executable bit)
26+
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}.tar.gz bin
27+
3528
- uses: actions/upload-artifact@v2
3629
with:
3730
name: ps2client-${{ steps.slug.outputs.sha8 }}-${{matrix.os}}
38-
path: ps2dev/bin/
31+
path: |
32+
*tar.gz
33+
34+
build-win:
35+
runs-on: ubuntu-latest
36+
container: dockcross/windows-static-x86:latest
3937

40-
- name: Extract tag name
41-
if: startsWith(github.ref, 'refs/tags/')
42-
id: tag
43-
uses: actions/github-script@0.9.0
38+
steps:
39+
- uses: actions/checkout@v2
40+
41+
- name: Compile windows version with cross-compilator
42+
run: |
43+
make -f Makefile.mingw32 --trace
44+
45+
- name: Get short SHA
46+
id: slug
47+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
48+
49+
- name: Create tar archive
50+
run: tar -zcvf ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest.tar.gz bin
51+
52+
- uses: actions/upload-artifact@v2
4453
with:
45-
github-token: ${{ secrets.GITHUB_TOKEN }}
46-
script: |
47-
return context.payload.ref.replace(/\/refs\/tags\//, '');
54+
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
55+
path: |
56+
*tar.gz
57+
58+
release:
59+
needs: [build, build-win]
60+
runs-on: ubuntu-latest
61+
if: startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/master'
62+
steps:
63+
- uses: actions/checkout@v2
4864

49-
- name: Release
50-
if: startsWith(github.ref, 'refs/tags/')
51-
uses: softprops/action-gh-release@v1
65+
- name: Get short SHA
66+
id: slug
67+
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
68+
69+
- name: Download Mac artifact
70+
uses: actions/download-artifact@v2
71+
with:
72+
name: ps2client-${{ steps.slug.outputs.sha8 }}-macos-latest
73+
74+
- name: Download Ubuntu artifact
75+
uses: actions/download-artifact@v2
76+
with:
77+
name: ps2client-${{ steps.slug.outputs.sha8 }}-ubuntu-latest
78+
79+
- name: Download Windows artifact
80+
uses: actions/download-artifact@v2
81+
with:
82+
name: ps2client-${{ steps.slug.outputs.sha8 }}-windows-latest
83+
84+
- name: Create pre-release
85+
if: github.ref == 'refs/heads/master'
86+
uses: marvinpinto/action-automatic-releases@latest
87+
with:
88+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
89+
prerelease: true
90+
automatic_release_tag: "latest"
91+
title: "Development build"
92+
files: |
93+
*tar.gz
94+
95+
- name: Create Tagged Release Draft
96+
if: startsWith(github.ref, 'refs/tags/v')
97+
uses: marvinpinto/action-automatic-releases@latest
5298
with:
53-
files: ps2dev.tar.gz
54-
tag_name: ${{ steps.tag.outputs.result }}
55-
env:
56-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
99+
repo_token: "${{ secrets.GITHUB_TOKEN }}"
100+
prerelease: false
101+
draft: true
102+
files: |
103+
*tar.gz

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
else
1111
LIBS = -lwsock32 -lpthreadGC2
1212
endif
13-
13+
1414
ifeq "x$(PREFIX)" "x"
1515
PREFIX = $(PS2DEV)
1616
endif

Makefile.mingw32

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

2-
GCC = i586-mingw32msvc-gcc -Wall
3-
INC = -I ../pthreads-win32
4-
LIB = -lwsock32 -lpthreadGC2 -L ../pthreads-win32
2+
#CC = i686-w64-mingw32.static-gcc -Wall
3+
LIB = -lwsock32 -lpthread
54

65
ifeq "x$(PREFIX)" "x"
76
PREFIX = $(PS2DEV)
@@ -19,31 +18,31 @@
1918
OFILES += obj/network.o
2019
obj/network.o: src/network.c src/network.h
2120
@mkdir -p obj
22-
$(GCC) $(INC) -c src/network.c -o obj/network.o
21+
$(CC) $(INC) -c src/network.c -o obj/network.o
2322

2423
OFILES += obj/ps2link.o
2524
obj/ps2link.o: src/ps2link.c src/ps2link.h
2625
@mkdir -p obj
27-
$(GCC) $(INC) -c src/ps2link.c -o obj/ps2link.o
26+
$(CC) $(INC) -c src/ps2link.c -o obj/ps2link.o
2827

2928
OFILES += obj/ps2netfs.o
3029
obj/ps2netfs.o: src/ps2netfs.c
3130
@mkdir -p obj
32-
$(GCC) $(INC) -c src/ps2netfs.c -o obj/ps2netfs.o
31+
$(CC) $(INC) -c src/ps2netfs.c -o obj/ps2netfs.o
3332

3433
OFILES += obj/utility.o
3534
obj/utility.o: src/utility.c src/utility.h
3635
@mkdir -p obj
37-
$(GCC) $(INC) -c src/utility.c -o obj/utility.o
36+
$(CC) $(INC) -c src/utility.c -o obj/utility.o
3837

3938
#####################
4039
## CLIENT PROGRAMS ##
4140
#####################
4241

4342
bin/fsclient.exe: $(OFILES) src/fsclient.c
4443
@mkdir -p bin
45-
$(GCC) $(INC) $(OFILES) src/fsclient.c -o bin/fsclient.exe $(LIB)
44+
$(CC) $(INC) $(OFILES) src/fsclient.c -o bin/fsclient.exe $(LIB)
4645

4746
bin/ps2client.exe: $(OFILES) src/ps2client.c
4847
@mkdir -p bin
49-
$(GCC) $(INC) $(OFILES) src/ps2client.c -o bin/ps2client.exe $(LIB)
48+
$(CC) $(INC) $(OFILES) src/ps2client.c -o bin/ps2client.exe $(LIB)

README.md

Lines changed: 103 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,105 @@
11
# PS2Client
22

3-
![CI](https://github.com/ps2dev/ps2client/workflows/CI/badge.svg)
3+
![CI](https://github.com/ps2dev/ps2client/workflows/CI/badge.svg)
4+
5+
6+
## PS2CLIENT USAGE AND INFORMATION
7+
8+
### THE INTRODUCTION
9+
10+
These programs, ps2client & fsclient, are command line tools used for interacting with a ps2 system running ps2link and/or ps2netfs. It will allow you to send various commands as well as respond to requests for data. This program was written and tested under Linux, Cygwin and Mac OS X but should compile on any reasonably unixlike system.
11+
12+
### BUILDING THE CLIENTS
13+
Building and installing is very simple:
14+
15+
`make clean; make install`
16+
17+
There are some build options, however:
18+
19+
`PREFIX=/dir`
20+
21+
Install directory, defaults to: `$PS2DEV`. `/bin` will be automatically appended.
22+
The software will be installed to the `/bin` sub-directory, under `PREFIX` (`PREFIX/bin`).
23+
24+
These options can be used as follows:
25+
26+
`make clean; make PREFIX=/new/path/prefix install`
27+
28+
### BUILDING WINDOWS BINARIES
29+
For building windows binaries on Unix system, you need to setup mingw cross-compiler and win32 threads.
30+
Build command:
31+
32+
`make -f Makefile.mingw32`
33+
34+
### BASIC CLIENT USAGE
35+
Basic usage:
36+
37+
```
38+
ps2client [-h hostname] [-t timeout] <command> [arguments]
39+
fsclient [-h hostname] <command> <arguments>
40+
```
41+
42+
**[-h hostname]**
43+
44+
The address of the remote ps2. This can be an IP or a hostname. If none is given, the environment variable `$PS2HOSTNAME` will be checked for a valid address. If this variable isn't set, a default of 192.168.0.10 will be used.
45+
46+
**[-t timeout]**
47+
48+
An idle timeout period in seconds that the client will wait before exiting. This is useful to allow a script to continue after calling ps2client to send a command to ps2link or ps2netfs.
49+
50+
### PS2LINK COMMANDS
51+
- `reset`
52+
53+
Send a reset request to ps2link.
54+
55+
- `execiop <filename> [arguments]`
56+
57+
Tell ps2link to load and execute a file on the IOP.
58+
59+
- `execee <filename> [arguments]`
60+
61+
Tell ps2link to load and execute a file on the EE.
62+
63+
- `poweroff`
64+
65+
Send a poweroff request to ps2link.
66+
67+
- `scrdump`
68+
69+
Tell ps2link to dump exceptions to the screen.
70+
71+
- `netdump`
72+
73+
Tell ps2link to dump execetions to the network console.
74+
75+
- `dumpmem <offset> <size> <filename>`
76+
77+
Dump the contents of memory into a file.
78+
79+
- `startvu <vu>`
80+
81+
Tell the specified vector unit to start operation.
82+
83+
- `stopvu <vu>`
84+
85+
Tell the specified vector unit to stop operation.
86+
87+
- `dumpreg <type> <filename>`
88+
89+
Dump the registers of a given type into a file.
90+
91+
- `gsexec <size> <filename>`
92+
93+
Tell ps2link to load and send a file to the GS.
94+
95+
- `writemem <offset> <size> <filename>`
96+
97+
Write the contents of a file into memory.
98+
99+
- `iopexcep`
100+
101+
I really don't know! OH NOES!!
102+
103+
- `listen`
104+
105+
Listen to the ps2link network console.

doc/license.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
* notice, this list of conditions and the following disclaimer in the
1515
* documentation and/or other materials provided with the distribution.
1616
*
17-
* 3. The name of the author(s) may not be used to endorse or promote products
17+
* 3. The name of the author(s) may not be used to endorse or promote products
1818
* derived from this software without specific prior written permission.
1919
*
2020
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2121
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2222
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2323
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT,
24-
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25-
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24+
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
25+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
2626
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
27+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2828
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2929
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3030
* SUCH DAMAGE.

doc/ps2link-protocol.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
tell it what to do. These are simple commands sent as single packets for
3232
executing programs, resetting ps2link or other things. This list may grow
3333
as time goes on and new functionality is added to ps2link.
34-
34+
3535
----------------------------
3636
0xBABE0201 (reset command)
3737
----------------------------

doc/readme-mingw32.txt

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,5 @@
88
----------------------------------
99

1010
Since now, ps2client uses the pthread library to work, you need the
11-
pthreads-win32 native library to compile ps2client using a mingw32
12-
compiler. You want to download the prebuilt binaries and headers
13-
from ftp://sources.redhat.com/pub/pthreads-win32 and put them
14-
in the ../pthreads-win32 directory. You need the following files:
15-
16-
libpthreadGC2.a
17-
pthread.h
18-
pthreadGC2.dll
19-
sched.h
20-
semaphore.h
21-
22-
Note that if you're using a linux host to cross compile, you probably
23-
want to dos2unix *.h before compiling.
24-
25-
------------------
26-
MORE INFORMATION
27-
------------------
28-
29-
If you want to get into the wonderful world of homebrew ps2
30-
development, there's a few places you can check out:
31-
32-
http://www.ps2dev.org - News, tutorials and documentation.
33-
34-
http://forums.ps2dev.org - The official ps2dev forums.
35-
36-
#ps2dev on efnet (IRC) - Come banter in realtime.
11+
threads support. For example you can use MXE/MinGW-w64 with win32
12+
threads.

0 commit comments

Comments
 (0)