From 3b2f25c6c468b29f53ad8a0d78f26a7c1529a5a2 Mon Sep 17 00:00:00 2001 From: Rui Barbosa Date: Thu, 11 Jun 2026 01:02:28 +0100 Subject: [PATCH 1/4] Template as submodule --- .gitmodules | 3 + template | 1 + template/.clang-format | 40 ------ template/.dockerignore | 5 - template/.gitattributes | 2 - template/.gitignore | 32 ----- template/.vscode/.gitignore | 6 - .../linux-docker/c_cpp_properties.json | 41 ------ .../configurations/linux-docker/settings.json | 14 -- .../configurations/linux-docker/tasks.json | 130 ------------------ .../windows-docker/c_cpp_properties.json | 42 ------ .../windows-docker/settings.json | 14 -- .../configurations/windows-docker/tasks.json | 130 ------------------ template/.vscode/extensions.json | 9 -- template/Dockerfile | 8 -- template/Makefile | 33 ----- template/bin/.gitignore | 4 - template/docker-compose.yml | 16 --- template/inc/racer_game.hpp | 19 --- template/linux-pcsx2.sh | 77 ----------- template/obj/.gitignore | 4 - template/res/.gitignore | 4 - template/run.ps1 | 4 - template/run.sh | 4 - template/src/main.cpp | 10 -- template/src/racer_game.cpp | 14 -- template/windows-pcsx2.ps1 | 76 ---------- 27 files changed, 4 insertions(+), 738 deletions(-) create mode 100644 .gitmodules create mode 160000 template delete mode 100644 template/.clang-format delete mode 100644 template/.dockerignore delete mode 100644 template/.gitattributes delete mode 100644 template/.gitignore delete mode 100644 template/.vscode/.gitignore delete mode 100644 template/.vscode/configurations/linux-docker/c_cpp_properties.json delete mode 100644 template/.vscode/configurations/linux-docker/settings.json delete mode 100644 template/.vscode/configurations/linux-docker/tasks.json delete mode 100644 template/.vscode/configurations/windows-docker/c_cpp_properties.json delete mode 100644 template/.vscode/configurations/windows-docker/settings.json delete mode 100644 template/.vscode/configurations/windows-docker/tasks.json delete mode 100644 template/.vscode/extensions.json delete mode 100644 template/Dockerfile delete mode 100644 template/Makefile delete mode 100644 template/bin/.gitignore delete mode 100644 template/docker-compose.yml delete mode 100644 template/inc/racer_game.hpp delete mode 100755 template/linux-pcsx2.sh delete mode 100644 template/obj/.gitignore delete mode 100644 template/res/.gitignore delete mode 100644 template/run.ps1 delete mode 100755 template/run.sh delete mode 100644 template/src/main.cpp delete mode 100644 template/src/racer_game.cpp delete mode 100644 template/windows-pcsx2.ps1 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..7062035 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "template"] + path = template + url = https://git.ruifpb.pt/RuiFPB/tyra-linux-template diff --git a/template b/template new file mode 160000 index 0000000..401fce7 --- /dev/null +++ b/template @@ -0,0 +1 @@ +Subproject commit 401fce7918a3904e89a108932439c73205ca5e66 diff --git a/template/.clang-format b/template/.clang-format deleted file mode 100644 index ce4cc1b..0000000 --- a/template/.clang-format +++ /dev/null @@ -1,40 +0,0 @@ -# Use the Google style in this project. -BasedOnStyle: Google - -# Some folks prefer to write "int& foo" while others prefer "int &foo". The -# Google Style Guide only asks for consistency within a project, we chose -# "int& foo" for this project: -DerivePointerAlignment: false -PointerAlignment: Left - -SortIncludes: false - -IncludeBlocks: Merge -IncludeCategories: -# Matches common headers first, but sorts them after project includes -- Regex: '^\"google/cloud/internal/disable_deprecation_warnings.inc\"$' - Priority: -1 -- Regex: '^\"google/cloud/(internal/|grpc_utils/|testing_util/|[^/]+\.h)' - Priority: 1000 -- Regex: '^\"google/cloud/' # project includes should sort first - Priority: 500 -- Regex: '^\"' - Priority: 1500 -- Regex: '^' - Priority: 5000 - -# Format raw string literals with a `pb` or `proto` tag as proto. -RawStringFormats: -- Language: TextProto - Delimiters: - - 'pb' - - 'proto' - BasedOnStyle: Google - -CommentPragmas: '(@copydoc)' \ No newline at end of file diff --git a/template/.dockerignore b/template/.dockerignore deleted file mode 100644 index b63d312..0000000 --- a/template/.dockerignore +++ /dev/null @@ -1,5 +0,0 @@ -*.elf -.git/ -.vscode/ -docs/ -tools/ \ No newline at end of file diff --git a/template/.gitattributes b/template/.gitattributes deleted file mode 100644 index 9103071..0000000 --- a/template/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Ignore all differences in line endings -* -crlf \ No newline at end of file diff --git a/template/.gitignore b/template/.gitignore deleted file mode 100644 index e5fc9f7..0000000 --- a/template/.gitignore +++ /dev/null @@ -1,32 +0,0 @@ -# --- - -# Prerequisites -*.d - -# Compiled Object files -*.slo -*.lo -*.o -*.vsm - -# Precompiled Headers -*.gch -*.pch - -# Compiled Dynamic libraries -*.so -*.dylib -*.dll - -# Compiled Static libraries -*.lai -*.la -*.a -*.lib - -# Executables -*.exe -*.out -*.app -*.erl -*.elf diff --git a/template/.vscode/.gitignore b/template/.vscode/.gitignore deleted file mode 100644 index dae89fb..0000000 --- a/template/.vscode/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -*.log - -# Configuration files -/c_cpp_properties.json -/tasks.json -/settings.json diff --git a/template/.vscode/configurations/linux-docker/c_cpp_properties.json b/template/.vscode/configurations/linux-docker/c_cpp_properties.json deleted file mode 100644 index 9c65761..0000000 --- a/template/.vscode/configurations/linux-docker/c_cpp_properties.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "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 -} \ No newline at end of file diff --git a/template/.vscode/configurations/linux-docker/settings.json b/template/.vscode/configurations/linux-docker/settings.json deleted file mode 100644 index 85108a6..0000000 --- a/template/.vscode/configurations/linux-docker/settings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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" - } -} \ No newline at end of file diff --git a/template/.vscode/configurations/linux-docker/tasks.json b/template/.vscode/configurations/linux-docker/tasks.json deleted file mode 100644 index e1038b0..0000000 --- a/template/.vscode/configurations/linux-docker/tasks.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "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" - } - ] -} \ No newline at end of file diff --git a/template/.vscode/configurations/windows-docker/c_cpp_properties.json b/template/.vscode/configurations/windows-docker/c_cpp_properties.json deleted file mode 100644 index 0aeba68..0000000 --- a/template/.vscode/configurations/windows-docker/c_cpp_properties.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "configurations": [ - { - "name": "Docker PS2SDK", - "includePath": [ - "${workspaceFolder}/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/tyra/inc/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/common/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/ee/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/iop/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ps2sdk/ports/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/include-fixed/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/install-tools/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/lib/gcc/mips64r5900el-ps2-elf/11.3.0/plugin/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/ee/mips64r5900el-ps2-elf/sys-include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/gsKit/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/install-tools/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/plugin/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-elf/11.3.0/include-fixed/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/install-tools/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/ps2dev-intellisense/iop/lib/gcc/mipsel-ps2-irx/11.3.0/plugin/include/**", - "C:/Users/YOUR-INTELLISENSE-PATH/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 -} \ No newline at end of file diff --git a/template/.vscode/configurations/windows-docker/settings.json b/template/.vscode/configurations/windows-docker/settings.json deleted file mode 100644 index f5f4d52..0000000 --- a/template/.vscode/configurations/windows-docker/settings.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "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" - } -} \ No newline at end of file diff --git a/template/.vscode/configurations/windows-docker/tasks.json b/template/.vscode/configurations/windows-docker/tasks.json deleted file mode 100644 index 18e713a..0000000 --- a/template/.vscode/configurations/windows-docker/tasks.json +++ /dev/null @@ -1,130 +0,0 @@ -{ - "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" - } - ] -} \ No newline at end of file diff --git a/template/.vscode/extensions.json b/template/.vscode/extensions.json deleted file mode 100644 index e1776e9..0000000 --- a/template/.vscode/extensions.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "recommendations": [ - "ms-vscode.cpptools-extension-pack", - "ryzngard.vscode-header-source", - "maziac.asm-code-lens", - "dmnsgn.vscode-wavefront", - "spmeesseman.vscode-taskexplorer" - ] -} \ No newline at end of file diff --git a/template/Dockerfile b/template/Dockerfile deleted file mode 100644 index 09e5223..0000000 --- a/template/Dockerfile +++ /dev/null @@ -1,8 +0,0 @@ -# syntax=docker/dockerfile:1 -FROM h4570/tyra - -RUN apt-get update -RUN apt-get install git -y - -WORKDIR /src -CMD ["/bin/bash"] \ No newline at end of file diff --git a/template/Makefile b/template/Makefile deleted file mode 100644 index 24c9a97..0000000 --- a/template/Makefile +++ /dev/null @@ -1,33 +0,0 @@ -TARGET := racer.elf -ENGINEDIR := /tyra/engine - -#The Directories, Source, Includes, Objects, Binary and Resources -SRCDIR := src -INCDIR := inc -BUILDDIR := obj -TARGETDIR := bin -RESDIR := res -SRCEXT := cpp -VSMEXT := vsm -VCLEXT := vcl -VCLPPEXT := vclpp -DEPEXT := d -OBJEXT := o - -#Flags, Libraries and Includes -CFLAGS := -LIB := -ltyra -LIBDIRS := -L$(ENGINEDIR)/bin -INC := -I$(INCDIR) -I$(ENGINEDIR)/inc -INCDEP := -I$(INCDIR) -I$(ENGINEDIR)/inc - -include /tyra/Makefile.base - -clean-engine: - cd $(ENGINEDIR) && $(MAKE) cleaner - -build-engine: - cd $(ENGINEDIR) && $(MAKE) - -build-release-engine: - cd $(ENGINEDIR) && $(MAKE) release \ No newline at end of file diff --git a/template/bin/.gitignore b/template/bin/.gitignore deleted file mode 100644 index 44c5ea8..0000000 --- a/template/bin/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/template/docker-compose.yml b/template/docker-compose.yml deleted file mode 100644 index 56ce57a..0000000 --- a/template/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -version: "3.9" -volumes: - tyra-game-volume: -services: - compiler: - environment: - TERM: xterm-256color - network_mode: host - build: - context: ./ - dockerfile: Dockerfile - tty: true - container_name: tyra-game-compiler - volumes: - - tyra-game-volume:/src - - ./:/host diff --git a/template/inc/racer_game.hpp b/template/inc/racer_game.hpp deleted file mode 100644 index 01436c6..0000000 --- a/template/inc/racer_game.hpp +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once - -#include - -namespace Racer { - -class RacerGame : public Tyra::Game { - public: - RacerGame(Tyra::Engine* engine); - ~RacerGame(); - - void init(); - void loop(); - - private: - Tyra::Engine* engine; -}; - -} // namespace Racer diff --git a/template/linux-pcsx2.sh b/template/linux-pcsx2.sh deleted file mode 100755 index 3324589..0000000 --- a/template/linux-pcsx2.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/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 diff --git a/template/obj/.gitignore b/template/obj/.gitignore deleted file mode 100644 index 44c5ea8..0000000 --- a/template/obj/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/template/res/.gitignore b/template/res/.gitignore deleted file mode 100644 index 44c5ea8..0000000 --- a/template/res/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -# Ignore everything in this directory -* -# Except this file -!.gitignore \ No newline at end of file diff --git a/template/run.ps1 b/template/run.ps1 deleted file mode 100644 index b2f7754..0000000 --- a/template/run.ps1 +++ /dev/null @@ -1,4 +0,0 @@ -$ConfigFile = Join-Path $PSScriptRoot './windows-pcsx2.ps1' -. $ConfigFile - -RunPCSX2 diff --git a/template/run.sh b/template/run.sh deleted file mode 100755 index 6e8e2db..0000000 --- a/template/run.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -SCRIPT_DIR=$(dirname "$(readlink -f "$0")") -cd "$SCRIPT_DIR" || exit 1 -./linux-pcsx2.sh diff --git a/template/src/main.cpp b/template/src/main.cpp deleted file mode 100644 index b9d8bde..0000000 --- a/template/src/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include "racer_game.hpp" - -int main() { - Tyra::Engine engine; - Racer::RacerGame game(&engine); - engine.run(&game); - SleepThread(); - return 0; -} diff --git a/template/src/racer_game.cpp b/template/src/racer_game.cpp deleted file mode 100644 index a004e61..0000000 --- a/template/src/racer_game.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "racer_game.hpp" - -namespace Racer { - -using namespace Tyra; - -RacerGame::RacerGame(Engine* t_engine) { engine = t_engine; } -RacerGame::~RacerGame() {} - -void RacerGame::init() { TYRA_LOG("Hello!"); } - -void RacerGame::loop() { TYRA_LOG("Loop!"); } - -} // namespace Racer diff --git a/template/windows-pcsx2.ps1 b/template/windows-pcsx2.ps1 deleted file mode 100644 index 6543a59..0000000 --- a/template/windows-pcsx2.ps1 +++ /dev/null @@ -1,76 +0,0 @@ -# ======================= -$CUSTOM_PCSX2_PATH = "" # "D:/My/Path/To/PCSX2" -# ======================= - -function GetTargetELFName { - return (Select-String -Path './Makefile' -Pattern "[^ ]*.elf").Matches.Value -} - -function FindPCSX2Directory { - if (-not [string]::IsNullOrEmpty($CUSTOM_PCSX2_PATH)) { - return $CUSTOM_PCSX2_PATH - } - else { - # Try to find in program files - $pcsx2Path = "${Env:ProgramFiles}/PCSX2" - $pcsx2Pathx86 = "${Env:ProgramFiles(x86)}/PCSX2" - - if (Test-Path -Path $pcsx2Path) { - return $pcsx2Path - } - elseif (Test-Path -Path $pcsx2Pathx86) { - return $pcsx2Pathx86 - } - else { - throw "PCSX2 directory not found!" - return $null - } - } -} - -function IsNewQtVersionOfPCSX2 { - param ( - [string]$path - ) - - return Test-Path -Path "$path/qt.conf" -} - -function FindPCSX2Executable { - param ( - [string]$directory - ) - - $pcsx2ExePath = Join-Path -Path $directory -ChildPath 'pcsx2.exe' - $pcsx2QtExePath = Join-Path -Path $directory -ChildPath 'pcsx2-qt.exe' - - if (Test-Path -Path $pcsx2ExePath) { - return 'pcsx2.exe' - } - elseif (Test-Path -Path $pcsx2QtExePath) { - return 'pcsx2-qt.exe' - } - else { - throw "PCSX2 executable not found in: $directory!" - return $null - } -} - -function RunPCSX2 { - $dirPath = FindPCSX2Directory - $isNewVersion = IsNewQtVersionOfPCSX2 -path $dirPath - $executableName = FindPCSX2Executable -directory $dirPath - $executableNameWithoutExt = (Split-Path $executableName -Leaf).Split('.')[0] - $targetFileName = "$PWD/bin/$(GetTargetELFName)" - - Stop-Process -Name $executableNameWithoutExt -ErrorAction 'SilentlyContinue' - - if ($isNewVersion) { - Start-Process -FilePath "$dirPath/$executableName" -ArgumentList "-elf", $targetFileName - } - else { # Old version of PCSX2 - Start-Process -FilePath "$dirPath/$executableName" -ArgumentList "--elf=$targetFileName" - } -} - -RunPCSX2 \ No newline at end of file -- 2.52.0 From 7f3e46c66f48b2d1faaf3abe19da9f6e0cc2d30b Mon Sep 17 00:00:00 2001 From: Rui Barbosa Date: Thu, 11 Jun 2026 01:10:41 +0100 Subject: [PATCH 2/4] Update format check workflow and use 4 jobs for pr-build-check --- .github/workflows/pr-build-check.yml | 2 +- .github/workflows/pr-format-check.yml | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-build-check.yml b/.github/workflows/pr-build-check.yml index 41b0f3a..be768e4 100644 --- a/.github/workflows/pr-build-check.yml +++ b/.github/workflows/pr-build-check.yml @@ -25,7 +25,7 @@ jobs: - name: Compile engine run: | - make clean all -C engine + make clean all -C engine -j4 - name: Compile tutorials run: | diff --git a/.github/workflows/pr-format-check.yml b/.github/workflows/pr-format-check.yml index 075e80d..e795c15 100644 --- a/.github/workflows/pr-format-check.yml +++ b/.github/workflows/pr-format-check.yml @@ -27,6 +27,10 @@ jobs: runs-on: ubuntu-latest steps: + - name: Install Node + run: | + apt-get update -y + apt-get install -y nodejs - uses: actions/checkout@v2 - uses: DoozyX/clang-format-lint-action@v0.12 with: -- 2.52.0 From 71a3cf92eef75dacaad0861e2627192000d96d96 Mon Sep 17 00:00:00 2001 From: Rui Barbosa Date: Thu, 11 Jun 2026 01:24:18 +0100 Subject: [PATCH 3/4] Second attempt to fix format-check --- .github/workflows/pr-build-check.yml | 24 ++++++++++++------------ .github/workflows/pr-format-check.yml | 4 ---- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/.github/workflows/pr-build-check.yml b/.github/workflows/pr-build-check.yml index be768e4..267b238 100644 --- a/.github/workflows/pr-build-check.yml +++ b/.github/workflows/pr-build-check.yml @@ -25,24 +25,24 @@ jobs: - name: Compile engine run: | - make clean all -C engine -j4 + make clean all -j4 -C engine - name: Compile tutorials run: | - make clean all -C tutorials/01-hello - make clean all -C tutorials/02-sprite - make clean all -C tutorials/03-minecraft - make clean all -C tutorials/04-de_dust2 - make clean all -C tutorials/05-animation - make clean all -C tutorials/06-audio - make clean all -C tutorials/07-lighting - make clean all -C tutorials/08-skybox-debug - make clean all -C tutorials/09-manual-mode - make clean all -C tutorials/10-sprite-sheet + make clean all -j4 -C tutorials/01-hello + make clean all -j4 -C tutorials/02-sprite + make clean all -j4 -C tutorials/03-minecraft + make clean all -j4 -C tutorials/04-de_dust2 + make clean all -j4 -C tutorials/05-animation + make clean all -j4 -C tutorials/06-audio + make clean all -j4 -C tutorials/07-lighting + make clean all -j4 -C tutorials/08-skybox-debug + make clean all -j4 -C tutorials/09-manual-mode + make clean all -j4 -C tutorials/10-sprite-sheet - name: Compile demo run: | - make clean all -C demo + make clean all -j4 -C demo - name: Get short SHA id: slug diff --git a/.github/workflows/pr-format-check.yml b/.github/workflows/pr-format-check.yml index e795c15..075e80d 100644 --- a/.github/workflows/pr-format-check.yml +++ b/.github/workflows/pr-format-check.yml @@ -27,10 +27,6 @@ jobs: runs-on: ubuntu-latest steps: - - name: Install Node - run: | - apt-get update -y - apt-get install -y nodejs - uses: actions/checkout@v2 - uses: DoozyX/clang-format-lint-action@v0.12 with: -- 2.52.0 From 1fd1dea07864ce30102dae09501a648a85632619 Mon Sep 17 00:00:00 2001 From: Rui Barbosa Date: Thu, 11 Jun 2026 01:32:14 +0100 Subject: [PATCH 4/4] Test setting the run container --- .github/workflows/pr-format-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-format-check.yml b/.github/workflows/pr-format-check.yml index 075e80d..e76db14 100644 --- a/.github/workflows/pr-format-check.yml +++ b/.github/workflows/pr-format-check.yml @@ -25,10 +25,12 @@ jobs: check-format: name: Check clang format runs-on: ubuntu-latest + container: + image: catthehacker/ubuntu:act-latest steps: - uses: actions/checkout@v2 - - uses: DoozyX/clang-format-lint-action@v0.12 + - uses: DoozyX/clang-format-lint-action@v0.18 with: source: '.' extensions: 'hpp, cpp, h' -- 2.52.0