Skip to content

Commit c8b22ff

Browse files
committed
tyrav2 init
1 parent 44c1ee4 commit c8b22ff

File tree

249 files changed

+18187
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

249 files changed

+18187
-0
lines changed

.clang-format

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Use the Google style in this project.
2+
BasedOnStyle: Google
3+
4+
# Some folks prefer to write "int& foo" while others prefer "int &foo". The
5+
# Google Style Guide only asks for consistency within a project, we chose
6+
# "int& foo" for this project:
7+
DerivePointerAlignment: false
8+
PointerAlignment: Left
9+
10+
SortIncludes: false
11+
12+
IncludeBlocks: Merge
13+
IncludeCategories:
14+
# Matches common headers first, but sorts them after project includes
15+
- Regex: '^\"google/cloud/internal/disable_deprecation_warnings.inc\"$'
16+
Priority: -1
17+
- Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)'
18+
Priority: 1000
19+
- Regex: '^\"google/cloud/' # project includes should sort first
20+
Priority: 500
21+
- Regex: '^\"'
22+
Priority: 1500
23+
- Regex: '^<grpc/'
24+
Priority: 2000
25+
- Regex: '^<google/*'
26+
Priority: 3000
27+
- Regex: '^<.*/.*'
28+
Priority: 4000
29+
- Regex: '^<[^/]*>'
30+
Priority: 5000
31+
32+
# Format raw string literals with a `pb` or `proto` tag as proto.
33+
RawStringFormats:
34+
- Language: TextProto
35+
Delimiters:
36+
- 'pb'
37+
- 'proto'
38+
BasedOnStyle: Google
39+
40+
CommentPragmas: '(@copydoc)'

.dockerignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.elf
2+
.git/
3+
.vscode/
4+
docs/
5+
tools/

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Ignore all differences in line endings
2+
* -crlf

.gitignore

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# ---
2+
3+
# Prerequisites
4+
*.d
5+
6+
# Compiled Object files
7+
*.slo
8+
*.lo
9+
*.o
10+
*.vsm
11+
12+
# Precompiled Headers
13+
*.gch
14+
*.pch
15+
16+
# Compiled Dynamic libraries
17+
*.so
18+
*.dylib
19+
*.dll
20+
21+
# Binary files
22+
bin/
23+
obj/
24+
res/
25+
26+
# Compiled Static libraries
27+
*.lai
28+
*.la
29+
*.a
30+
*.lib
31+
32+
# Executables
33+
*.exe
34+
*.out
35+
*.app
36+
*.erl
37+
*.elf

.vscode/.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*.log
2+
3+
# Configuration files
4+
/c_cpp_properties.json
5+
/tasks.json
6+
/settings.json
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"configurations": [
3+
{
4+
"name": "Docker PS2SDK",
5+
"includePath": [
6+
"${workspaceFolder}/**",
7+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/common/include/**",
8+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/ee/include/**",
9+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/iop/include/**",
10+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/ports/include/**",
11+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/include/**",
12+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include/**",
13+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include-fixed/**",
14+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/install-tools/include/**",
15+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/plugin/include/**",
16+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/include/**",
17+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/sys-include/**",
18+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/gsKit/include/**",
19+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include/**",
20+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/install-tools/include/**",
21+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/plugin/include/**",
22+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include-fixed/**",
23+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include/**",
24+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/install-tools/include/**",
25+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/plugin/include/**",
26+
"C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include-fixed/**"
27+
],
28+
"defines": [
29+
"_EE",
30+
"_IOP",
31+
"INTELLISENSE"
32+
],
33+
"cppStandard": "c++20",
34+
"compilerPath": "", // Should be empty
35+
"intelliSenseMode": "linux-gcc-x86",
36+
"configurationProvider": "ms-vscode.cpptools"
37+
}
38+
],
39+
"version": 4
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"buildDirectory": "samples/cube",
3+
"C_Cpp.default.intelliSenseMode": "gcc-x86",
4+
"files.associations": {
5+
"*.vcl": "asm-collection",
6+
"*.i": "asm-collection",
7+
"*.vsm": "asm-collection",
8+
"*.vclpp": "asm-collection",
9+
"*.hpp": "cpp",
10+
"*.cpp": "cpp",
11+
"*.h": "c",
12+
"*.c": "c"
13+
}
14+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Build & run",
6+
"dependsOrder": "sequence",
7+
"dependsOn": [
8+
"1. Copy source code to docker volume",
9+
"2. Compile via docker container",
10+
"3. Copy binaries to host",
11+
"4. Run PCSX2"
12+
],
13+
"group": {
14+
"kind": "build",
15+
"isDefault": true
16+
}
17+
},
18+
{
19+
"type": "shell",
20+
"label": "1. Copy source code to docker volume",
21+
"command": "docker exec -t tyra-compiler sh -c 'rsync -ac --delete --exclude \".git\" --exclude \"docs\" --exclude \".vscode\" --exclude \"tools\" --exclude \"*obj*/**\" --exclude \"*bin*/**\" /host/ /src/'"
22+
},
23+
{
24+
"type": "shell",
25+
"label": "2. Compile via docker container",
26+
"command": "docker exec -t tyra-compiler sh -c 'cd ${config:buildDirectory} && make build-engine all'",
27+
"problemMatcher": {
28+
"base": "$gcc",
29+
"fileLocation": [
30+
"autoDetect"
31+
]
32+
}
33+
},
34+
{
35+
"type": "shell",
36+
"label": "3. Copy binaries to host",
37+
"command": "docker exec -t tyra-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"*bin*/**\" --exclude=\"*\" /src/ /host/'",
38+
},
39+
{
40+
"type": "shell",
41+
"label": "4. Run PCSX2",
42+
"options": {
43+
"cwd": "${config:buildDirectory}"
44+
},
45+
"command": "./run.ps1"
46+
},
47+
{
48+
"type": "shell",
49+
"label": "Cleanup",
50+
"command": "docker exec -t tyra-compiler sh -c 'rm -rf /src/*'"
51+
},
52+
{
53+
"type": "shell",
54+
"label": "Send to PS2",
55+
"command": "docker exec -t tyra-compiler sh -c 'cd ${config:buildDirectory}/bin && killall -v ps2client || true && ps2client -h ${input:ps2Ip} reset && ps2client -h ${input:ps2Ip} reset && ps2client -h ${input:ps2Ip} execee host:$(find . -maxdepth 1 -type f -name \"*.elf\")'"
56+
},
57+
{
58+
"type": "shell",
59+
"label": "Open PS2 output logger",
60+
"command": "docker stop ps2-logs || true && docker run -t --rm --name=ps2-logs -p ${input:local2Ip}:18194:18194/udp h4570/tyra sh -c 'ps2client -h ${input:ps2Ip} listen'",
61+
"runOptions": {
62+
"instanceLimit": 1
63+
},
64+
"presentation": {
65+
"reveal": "always",
66+
"panel": "new"
67+
}
68+
},
69+
{
70+
"type": "shell",
71+
"label": "Start docker container",
72+
"command": "docker compose up -d"
73+
},
74+
{
75+
"type": "shell",
76+
"label": "Stop docker container",
77+
"command": "docker compose down"
78+
}
79+
],
80+
"inputs": [
81+
{
82+
"id": "ps2Ip",
83+
"description": "PS2link ip address:",
84+
"default": "192.168.1.200",
85+
"type": "promptString"
86+
},
87+
{
88+
"id": "local2Ip",
89+
"description": "Local ip address:",
90+
"default": "192.168.1.245",
91+
"type": "promptString"
92+
}
93+
]
94+
}

.vscode/extensions.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"recommendations": [
3+
"ms-vscode.cpptools-extension-pack",
4+
"ryzngard.vscode-header-source",
5+
"maziac.asm-code-lens"
6+
]
7+
}

Dockerfile

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# syntax=docker/dockerfile:1
2+
FROM ubuntu:20.04
3+
4+
# Install necessary packages for PS2DEV, VCLPP and VCL.
5+
RUN apt-get update
6+
ARG DEBIAN_FRONTEND=noninteractive
7+
RUN apt-get install -y git make g++ texinfo bison flex gettext libgmp3-dev \
8+
libmpfr-dev libmpc-dev gcc binutils cmake wget patch zlib1g-dev libgsl-dev \
9+
unzip
10+
11+
# Setup PS2DEV env
12+
ENV PS2DEV /usr/local/ps2dev
13+
RUN mkdir -p $PS2DEV
14+
RUN chown -R $USER: $PS2DEV
15+
ENV PS2SDK $PS2DEV/ps2sdk
16+
ENV GSKIT $PS2DEV/gsKit
17+
ENV PATH $PATH:${PS2DEV}/bin:${PS2DEV}/ee/bin:${PS2DEV}/iop/bin:${PS2DEV}/dvp/bin:${PS2SDK}/bin
18+
19+
# Compile PS2DEV
20+
RUN mkdir -p /temp/ps2dev
21+
RUN git clone https://github.com/ps2dev/ps2dev.git /temp/ps2dev
22+
WORKDIR "/temp/ps2dev"
23+
RUN ./build-all.sh
24+
25+
# Compile VCLPP
26+
RUN mkdir -p /temp/vclpp
27+
RUN git clone https://github.com/glampert/vclpp.git /temp/vclpp
28+
WORKDIR "/temp/vclpp"
29+
RUN make
30+
31+
# Download VCL
32+
RUN mkdir -p /temp/vcl
33+
WORKDIR "/temp/vcl"
34+
RUN wget http://apgcglz.cluster028.hosting.ovh.net/tyra/vcl.zip
35+
RUN unzip vcl.zip
36+
37+
# ------------------------------------------------------------------------------
38+
39+
# Start from clean image
40+
FROM ubuntu:20.04
41+
42+
# Set ENV variables
43+
ENV PS2DEV /usr/local/ps2dev
44+
ENV PS2SDK $PS2DEV/ps2sdk
45+
ENV PATH $PATH:${PS2DEV}/bin:${PS2DEV}/ee/bin:${PS2DEV}/iop/bin:${PS2DEV}/dvp/bin:${PS2SDK}/bin
46+
47+
# Copy stuff from previous stage
48+
COPY --from=0 ${PS2DEV} ${PS2DEV}
49+
COPY --from=0 /temp/vcl/vcl /usr/bin/vcl
50+
COPY --from=0 /temp/vclpp/vclpp /usr/bin/vclpp
51+
52+
# Install packages for emulating x86 and Tyra (make, libmpc, psmisc)
53+
RUN apt-get update
54+
RUN apt-get install -y make rsync libmpc-dev qemu qemu-user-static binfmt-support psmisc
55+
56+
# Add 32bit executables support for VCL
57+
RUN dpkg --add-architecture i386
58+
RUN apt-get update
59+
RUN apt-get install -y libstdc++5:i386
60+
RUN update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'
61+
62+
# Set chmod
63+
RUN chmod 755 /usr/bin/vclpp
64+
RUN chmod 755 /usr/bin/vcl
65+
66+
WORKDIR /src
67+
CMD ["/bin/bash"]

0 commit comments

Comments
 (0)