Compare commits
12 Commits
v2.7.1
..
c1d4f7b9db
| Author | SHA1 | Date | |
|---|---|---|---|
|
c1d4f7b9db
|
|||
|
a5e3fc57b3
|
|||
| 92c58f28b8 | |||
| d4dc1ac4c5 | |||
| bf1c41f3e1 | |||
| 92734168a2 | |||
| c0f5f06eb4 | |||
| b7bc5f2f0a | |||
| e8c0cfce1f | |||
| 1e396fb1a3 | |||
| 2b5839a4a8 | |||
| 0810f12949 |
@@ -12,8 +12,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update
|
apt-get update
|
||||||
apt install -y git make wget
|
apt-get install -y git make wget nodejs
|
||||||
|
|
||||||
- name: Set git safe directory
|
- name: Set git safe directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -12,8 +12,9 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: |
|
run: |
|
||||||
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
apt-get update
|
apt-get update
|
||||||
apt install -y git make wget
|
apt-get install -y git make wget nodejs
|
||||||
|
|
||||||
- name: Set git safe directory
|
- name: Set git safe directory
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Docker PS2SDK (Linux)",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/common/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/ee/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/iop/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/ports/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include-fixed/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/sys-include/**",
|
||||||
|
"~/ps2dev-intellisense/gsKit/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include-fixed/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include-fixed/**"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"_EE",
|
||||||
|
"_IOP",
|
||||||
|
"__SPU__",
|
||||||
|
"INTELLISENSE"
|
||||||
|
],
|
||||||
|
"cppStandard": "c++20",
|
||||||
|
"compilerPath": "", // Should be empty
|
||||||
|
"intelliSenseMode": "linux-gcc-x86",
|
||||||
|
"configurationProvider": "ms-vscode.cpptools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"buildDirectory": "demo",
|
||||||
|
"C_Cpp.default.intelliSenseMode": "gcc-x86",
|
||||||
|
"files.associations": {
|
||||||
|
"*.vcl": "asm-collection",
|
||||||
|
"*.i": "asm-collection",
|
||||||
|
"*.vsm": "asm-collection",
|
||||||
|
"*.vclpp": "asm-collection",
|
||||||
|
"*.hpp": "cpp",
|
||||||
|
"*.cpp": "cpp",
|
||||||
|
"*.h": "c",
|
||||||
|
"*.c": "c"
|
||||||
|
}
|
||||||
|
}
|
||||||
+119
@@ -0,0 +1,119 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build & run",
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"dependsOn": [
|
||||||
|
"1. Copy source code to docker volume",
|
||||||
|
"2. Compile via docker container",
|
||||||
|
"3. Copy binaries to host",
|
||||||
|
"4. Run PCSX2"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "1. Copy source code to docker volume",
|
||||||
|
"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/'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "2. Compile via docker container",
|
||||||
|
"command": "docker exec -t tyra-compiler sh -c 'cd ${config:buildDirectory} && make build-engine all'",
|
||||||
|
"problemMatcher": {
|
||||||
|
"base": "$gcc",
|
||||||
|
"fileLocation": [
|
||||||
|
"autoDetect"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "3. Copy binaries to host",
|
||||||
|
"command": "docker exec -t tyra-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"bin/**\" --exclude=\"*\" /src/ /host/'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "4. Run PCSX2",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${config:buildDirectory}"
|
||||||
|
},
|
||||||
|
"command": "./run.sh"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Convert WAV to ADPCM",
|
||||||
|
"dependsOn": [
|
||||||
|
"1. Copy source code to docker volume"
|
||||||
|
],
|
||||||
|
"command": "docker exec -t tyra-compiler sh -c 'adpenc ${input:wav2adpcmSource} ${input:wav2adpcmTarget} && rsync -zac /src/${input:wav2adpcmTarget} /host/${input:wav2adpcmTarget}'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Cleanup",
|
||||||
|
"command": "docker exec -t tyra-compiler sh -c 'rm -rf /src/*'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Send to PS2",
|
||||||
|
"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\")'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Open PS2 output logger",
|
||||||
|
"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'",
|
||||||
|
"runOptions": {
|
||||||
|
"instanceLimit": 1
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Start docker container",
|
||||||
|
"command": "docker compose up -d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Stop docker container",
|
||||||
|
"command": "docker compose down"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "[Debug] Copy obj directory to host",
|
||||||
|
"command": "docker exec -t tyra-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"obj/**\" --exclude=\"*\" /src/ /host/'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "wav2adpcmSource",
|
||||||
|
"description": "Source file path (ex. ):",
|
||||||
|
"default": "demo/res/sound.wav",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wav2adpcmTarget",
|
||||||
|
"description": "Target file path (ex. ):",
|
||||||
|
"default": "demo/res/sound.adpcm",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ps2Ip",
|
||||||
|
"description": "PS2link ip address:",
|
||||||
|
"default": "192.168.1.200",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "local2Ip",
|
||||||
|
"description": "Local ip address:",
|
||||||
|
"default": "192.168.1.245",
|
||||||
|
"type": "promptString"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
+1
-2
@@ -31,8 +31,7 @@ RUN make
|
|||||||
# Download VCL
|
# Download VCL
|
||||||
RUN mkdir -p /temp/vcl
|
RUN mkdir -p /temp/vcl
|
||||||
WORKDIR "/temp/vcl"
|
WORKDIR "/temp/vcl"
|
||||||
RUN wget http://apgcglz.cluster028.hosting.ovh.net/tyra/vcl.zip
|
RUN wget https://github.com/h4570/tyra/raw/master/assets/vcl
|
||||||
RUN unzip vcl.zip
|
|
||||||
|
|
||||||
# ------------------------------------------------------------------------------
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ Decision was simple - I need to create an engine which will handle 3D file loadi
|
|||||||
* 07 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/07-lighting) - Static lightmap and dynamic directional lights
|
* 07 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/07-lighting) - Static lightmap and dynamic directional lights
|
||||||
* 08 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/08-skybox-debug) - Skybox and debug rendering
|
* 08 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/08-skybox-debug) - Skybox and debug rendering
|
||||||
* 09 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/09-manual-mode) - Manual rendering (a'la OpenGL)
|
* 09 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/09-manual-mode) - Manual rendering (a'la OpenGL)
|
||||||
* 10 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/10-sprite=sheet) - Sprite sheet (font)
|
* 10 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/10-sprite-sheet) - Sprite sheet (font)
|
||||||
* 11 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/11-texture-region-repeat) - Texture repeating
|
* 11 - [Code](https://github.com/h4570/tyra/tree/master/tutorials/11-texture-region-repeat) - Texture repeating
|
||||||
* Demo game - [Code](https://github.com/h4570/tyra/tree/master/demo)
|
* Demo game - [Code](https://github.com/h4570/tyra/tree/master/demo)
|
||||||
---
|
---
|
||||||
@@ -152,7 +152,7 @@ Without these guys, Tyra would not happen:
|
|||||||
* And so many other guys. Thanks!
|
* And so many other guys. Thanks!
|
||||||
|
|
||||||
Project Link: [https://github.com/h4570/tyra](https://github.com/h4570/tyra)
|
Project Link: [https://github.com/h4570/tyra](https://github.com/h4570/tyra)
|
||||||
Sandro Sobczyński - sandro.sobczynski@gmail.com
|
Sandro Sobczyński - sandro.sobczynski@gmail.com (<a href="https://hasto.pl">hasto.pl</a>)
|
||||||
[![LinkedIn][linkedin-shield]](https://linkedin.com/in/sandro-sobczyński-28820b15a)
|
[![LinkedIn][linkedin-shield]](https://linkedin.com/in/sandro-sobczyński-28820b15a)
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../linux-pcsx2.sh
|
||||||
+1
-1
@@ -11,4 +11,4 @@ services:
|
|||||||
container_name: tyra-compiler
|
container_name: tyra-compiler
|
||||||
volumes:
|
volumes:
|
||||||
- tyra-volume:/src
|
- tyra-volume:/src
|
||||||
- ./:/host
|
- ./:/host:z
|
||||||
|
|||||||
@@ -58,9 +58,19 @@ texbuffer_t* RendererCoreTextureSender::allocateTextureCore(
|
|||||||
auto* result = new texbuffer_t;
|
auto* result = new texbuffer_t;
|
||||||
const auto* core = t_texture->core;
|
const auto* core = t_texture->core;
|
||||||
|
|
||||||
int coreWidth = core->width <= 64 ? 64 : core->width;
|
switch (core->psm) {
|
||||||
|
case GS_PSM_8:
|
||||||
|
case GS_PSM_4:
|
||||||
|
case GS_PSM_8H:
|
||||||
|
case GS_PSM_4HL:
|
||||||
|
case GS_PSM_4HH:
|
||||||
|
result->width = -128 & (core->width + 127);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
result->width = -64 & (core->width + 63);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
result->width = coreWidth;
|
|
||||||
result->psm = core->psm;
|
result->psm = core->psm;
|
||||||
result->info.components = core->components;
|
result->info.components = core->components;
|
||||||
|
|
||||||
|
|||||||
Executable
+74
@@ -0,0 +1,74 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
get_target_elf_name() {
|
||||||
|
if [ -f "./Makefile" ]; then
|
||||||
|
grep -oP '\S+\.elf' Makefile | head -n 1
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
find_pcsx2() {
|
||||||
|
if [ -n "$CUSTOM_PCSX2_PATH" ]; then
|
||||||
|
echo "$CUSTOM_PCSX2_PATH"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check flatpak
|
||||||
|
if command -v flatpak >/dev/null 2>&1 && flatpak list | grep -q "net.pcsx2.PCSX2"; then
|
||||||
|
echo "flatpak run net.pcsx2.PCSX2"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pcsx2-qt is in PATH
|
||||||
|
if command -v pcsx2-qt >/dev/null 2>&1; then
|
||||||
|
echo "pcsx2-qt"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pcsx2 is in PATH
|
||||||
|
if command -v pcsx2 >/dev/null 2>&1; then
|
||||||
|
echo "pcsx2"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Error: PCSX2 not found! Please install it, put it in PATH, or specify CUSTOM_PCSX2_PATH in this script." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
run_pcsx2() {
|
||||||
|
local pcsx2_cmd
|
||||||
|
pcsx2_cmd=$(find_pcsx2)
|
||||||
|
|
||||||
|
local elf_name
|
||||||
|
elf_name=$(get_target_elf_name)
|
||||||
|
if [ -z "$elf_name" ]; then
|
||||||
|
echo "Error: Could not find target ELF name in Makefile!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local target_file
|
||||||
|
target_file="$(pwd)/bin/$elf_name"
|
||||||
|
|
||||||
|
if [ ! -f "$target_file" ]; then
|
||||||
|
echo "Error: ELF file not found at $target_file. Did you build the project?" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill existing PCSX2 instances
|
||||||
|
if [[ "$pcsx2_cmd" == *"flatpak"* ]]; then
|
||||||
|
pkill -f "net.pcsx2.PCSX2" >/dev/null 2>&1 || true
|
||||||
|
pkill -f "pcsx2-qt" >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
local bin_name
|
||||||
|
bin_name=$(basename "$pcsx2_cmd")
|
||||||
|
pkill "$bin_name" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running PCSX2: $pcsx2_cmd -elf $target_file"
|
||||||
|
|
||||||
|
# Run PCSX2 in the background
|
||||||
|
$pcsx2_cmd -elf "$target_file" &
|
||||||
|
}
|
||||||
|
|
||||||
|
run_pcsx2
|
||||||
@@ -0,0 +1,41 @@
|
|||||||
|
{
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Docker PS2SDK (Linux)",
|
||||||
|
"includePath": [
|
||||||
|
"${workspaceFolder}/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/common/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/ee/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/iop/include/**",
|
||||||
|
"~/ps2dev-intellisense/ps2sdk/ports/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include-fixed/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/include/**",
|
||||||
|
"~/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/sys-include/**",
|
||||||
|
"~/ps2dev-intellisense/gsKit/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include-fixed/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/install-tools/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/plugin/include/**",
|
||||||
|
"~/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include-fixed/**"
|
||||||
|
],
|
||||||
|
"defines": [
|
||||||
|
"_EE",
|
||||||
|
"_IOP",
|
||||||
|
"__SPU__",
|
||||||
|
"INTELLISENSE"
|
||||||
|
],
|
||||||
|
"cppStandard": "c++20",
|
||||||
|
"compilerPath": "", // Should be empty
|
||||||
|
"intelliSenseMode": "linux-gcc-x86",
|
||||||
|
"configurationProvider": "ms-vscode.cpptools"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"version": 4
|
||||||
|
}
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"buildDirectory": "./",
|
||||||
|
"C_Cpp.default.intelliSenseMode": "gcc-x86",
|
||||||
|
"files.associations": {
|
||||||
|
"*.vcl": "asm-collection",
|
||||||
|
"*.i": "asm-collection",
|
||||||
|
"*.vsm": "asm-collection",
|
||||||
|
"*.vclpp": "asm-collection",
|
||||||
|
"*.hpp": "cpp",
|
||||||
|
"*.cpp": "cpp",
|
||||||
|
"*.h": "c",
|
||||||
|
"*.c": "c"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,130 @@
|
|||||||
|
{
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "Build & run",
|
||||||
|
"dependsOrder": "sequence",
|
||||||
|
"dependsOn": [
|
||||||
|
"1. Copy source code to docker volume",
|
||||||
|
"2. Compile via docker container",
|
||||||
|
"3. Copy binaries to host",
|
||||||
|
"4. Run PCSX2"
|
||||||
|
],
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "1. Copy source code to docker volume",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -ac --delete --exclude=\".git\" --exclude=\".vscode\" --exclude=\"*obj*/**\" --exclude=\"*bin*/**\" /host/ /src/'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "2. Compile via docker container",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'cd ${config:buildDirectory} && make'",
|
||||||
|
"problemMatcher": {
|
||||||
|
"base": "$gcc",
|
||||||
|
"fileLocation": [
|
||||||
|
"autoDetect"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "3. Copy binaries to host",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"*bin*/**\" --exclude=\"*\" /src/ /host/'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "4. Run PCSX2",
|
||||||
|
"options": {
|
||||||
|
"cwd": "${config:buildDirectory}"
|
||||||
|
},
|
||||||
|
"command": "./run.ps1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Convert WAV to ADPCM",
|
||||||
|
"dependsOn": [
|
||||||
|
"1. Copy source code to docker volume"
|
||||||
|
],
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'adpenc ${input:wav2adpcmSource} ${input:wav2adpcmTarget} && rsync -zac /src/${input:wav2adpcmTarget} /host/${input:wav2adpcmTarget}'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Cleanup",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'rm -rf /src/*'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Update Tyra",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'rm -rf /tyra && mkdir -p /tyra && git clone https://github.com/h4570/tyra.git /tyra && cd /tyra && git checkout ${input:tyraBranch} && cd engine && make'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Send to PS2",
|
||||||
|
"command": "docker exec -t tyra-game-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\")'"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Open PS2 output logger",
|
||||||
|
"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'",
|
||||||
|
"runOptions": {
|
||||||
|
"instanceLimit": 1
|
||||||
|
},
|
||||||
|
"presentation": {
|
||||||
|
"reveal": "always",
|
||||||
|
"panel": "new"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Start docker container",
|
||||||
|
"command": "docker compose up -d"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "Stop docker container",
|
||||||
|
"command": "docker compose down"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "shell",
|
||||||
|
"label": "[Debug] Copy obj directory to host",
|
||||||
|
"command": "docker exec -t tyra-game-compiler sh -c 'rsync -zac --include=\"*/\" --include=\"obj/**\" --exclude=\"*\" /src/ /host/'"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id": "wav2adpcmSource",
|
||||||
|
"description": "Source file path (ex. ):",
|
||||||
|
"default": "res/sound.wav",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "wav2adpcmTarget",
|
||||||
|
"description": "Target file path (ex. ):",
|
||||||
|
"default": "res/sound.adpcm",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "ps2Ip",
|
||||||
|
"description": "PS2link ip address:",
|
||||||
|
"default": "192.168.1.200",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "local2Ip",
|
||||||
|
"description": "Local ip address:",
|
||||||
|
"default": "192.168.1.245",
|
||||||
|
"type": "promptString"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "tyraBranch",
|
||||||
|
"description": "Tyra branch:",
|
||||||
|
"default": "master",
|
||||||
|
"type": "promptString"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Executable
+77
@@ -0,0 +1,77 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# =======================
|
||||||
|
CUSTOM_PCSX2_PATH="" # e.g. "/usr/bin/pcsx2" or "flatpak run net.pcsx2.PCSX2"
|
||||||
|
# =======================
|
||||||
|
|
||||||
|
get_target_elf_name() {
|
||||||
|
if [ -f "./Makefile" ]; then
|
||||||
|
grep -oP '\S+\.elf' Makefile | head -n 1
|
||||||
|
else
|
||||||
|
echo ""
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
find_pcsx2() {
|
||||||
|
if [ -n "$CUSTOM_PCSX2_PATH" ]; then
|
||||||
|
echo "$CUSTOM_PCSX2_PATH"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check flatpak
|
||||||
|
if command -v flatpak >/dev/null 2>&1 && flatpak list | grep -q "net.pcsx2.PCSX2"; then
|
||||||
|
echo "flatpak run net.pcsx2.PCSX2"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pcsx2-qt is in PATH
|
||||||
|
if command -v pcsx2-qt >/dev/null 2>&1; then
|
||||||
|
echo "pcsx2-qt"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Check if pcsx2 is in PATH
|
||||||
|
if command -v pcsx2 >/dev/null 2>&1; then
|
||||||
|
echo "pcsx2"
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Error: PCSX2 not found! Please install it, put it in PATH, or specify CUSTOM_PCSX2_PATH in this script." >&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
run_pcsx2() {
|
||||||
|
local pcsx2_cmd
|
||||||
|
pcsx2_cmd=$(find_pcsx2)
|
||||||
|
|
||||||
|
local elf_name
|
||||||
|
elf_name=$(get_target_elf_name)
|
||||||
|
if [ -z "$elf_name" ]; then
|
||||||
|
echo "Error: Could not find target ELF name in Makefile!" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
local target_file
|
||||||
|
target_file="$(pwd)/bin/$elf_name"
|
||||||
|
|
||||||
|
if [ ! -f "$target_file" ]; then
|
||||||
|
echo "Error: ELF file not found at $target_file. Did you build the project?" >&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Kill existing PCSX2 instances
|
||||||
|
if [[ "$pcsx2_cmd" == *"flatpak"* ]]; then
|
||||||
|
pkill -f "net.pcsx2.PCSX2" >/dev/null 2>&1 || true
|
||||||
|
pkill -f "pcsx2-qt" >/dev/null 2>&1 || true
|
||||||
|
else
|
||||||
|
local bin_name
|
||||||
|
bin_name=$(basename "$pcsx2_cmd")
|
||||||
|
pkill "$bin_name" >/dev/null 2>&1 || true
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Running PCSX2: $pcsx2_cmd -elf $target_file"
|
||||||
|
|
||||||
|
# Run PCSX2 in the background
|
||||||
|
$pcsx2_cmd -elf "$target_file" &
|
||||||
|
}
|
||||||
|
|
||||||
|
run_pcsx2
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
./linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Executable
+4
@@ -0,0 +1,4 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
|
||||||
|
cd "$SCRIPT_DIR" || exit 1
|
||||||
|
../../linux-pcsx2.sh
|
||||||
Reference in New Issue
Block a user