Template as submodule #1

Merged
RuiFPB merged 4 commits from submodules into master 2026-06-11 00:41:02 +00:00
29 changed files with 19 additions and 751 deletions
+12 -12
View File
@@ -25,24 +25,24 @@ jobs:
- name: Compile engine - name: Compile engine
run: | run: |
make clean all -C engine make clean all -j4 -C engine
- name: Compile tutorials - name: Compile tutorials
run: | run: |
make clean all -C tutorials/01-hello make clean all -j4 -C tutorials/01-hello
make clean all -C tutorials/02-sprite make clean all -j4 -C tutorials/02-sprite
make clean all -C tutorials/03-minecraft make clean all -j4 -C tutorials/03-minecraft
make clean all -C tutorials/04-de_dust2 make clean all -j4 -C tutorials/04-de_dust2
make clean all -C tutorials/05-animation make clean all -j4 -C tutorials/05-animation
make clean all -C tutorials/06-audio make clean all -j4 -C tutorials/06-audio
make clean all -C tutorials/07-lighting make clean all -j4 -C tutorials/07-lighting
make clean all -C tutorials/08-skybox-debug make clean all -j4 -C tutorials/08-skybox-debug
make clean all -C tutorials/09-manual-mode make clean all -j4 -C tutorials/09-manual-mode
make clean all -C tutorials/10-sprite-sheet make clean all -j4 -C tutorials/10-sprite-sheet
- name: Compile demo - name: Compile demo
run: | run: |
make clean all -C demo make clean all -j4 -C demo
- name: Get short SHA - name: Get short SHA
id: slug id: slug
+3 -1
View File
@@ -25,10 +25,12 @@ jobs:
check-format: check-format:
name: Check clang format name: Check clang format
runs-on: ubuntu-latest runs-on: ubuntu-latest
container:
image: catthehacker/ubuntu:act-latest
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: DoozyX/clang-format-lint-action@v0.12 - uses: DoozyX/clang-format-lint-action@v0.18
with: with:
source: '.' source: '.'
extensions: 'hpp, cpp, h' extensions: 'hpp, cpp, h'
+3
View File
@@ -0,0 +1,3 @@
[submodule "template"]
path = template
url = https://git.ruifpb.pt/RuiFPB/tyra-linux-template
Submodule
+1
Submodule template added at 401fce7918
-40
View File
@@ -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: '^<grpc/'
Priority: 2000
- Regex: '^<google/*'
Priority: 3000
- Regex: '^<.*/.*'
Priority: 4000
- 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)'
-5
View File
@@ -1,5 +0,0 @@
*.elf
.git/
.vscode/
docs/
tools/
-2
View File
@@ -1,2 +0,0 @@
# Ignore all differences in line endings
* -crlf
-32
View File
@@ -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
-6
View File
@@ -1,6 +0,0 @@
*.log
# Configuration files
/c_cpp_properties.json
/tasks.json
/settings.json
@@ -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
}
@@ -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"
}
}
-130
View File
@@ -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"
}
]
}
@@ -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
}
@@ -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"
}
}
@@ -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"
}
]
}
-9
View File
@@ -1,9 +0,0 @@
{
"recommendations": [
"ms-vscode.cpptools-extension-pack",
"ryzngard.vscode-header-source",
"maziac.asm-code-lens",
"dmnsgn.vscode-wavefront",
"spmeesseman.vscode-taskexplorer"
]
}
-8
View File
@@ -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"]
-33
View File
@@ -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
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-16
View File
@@ -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
-19
View File
@@ -1,19 +0,0 @@
#pragma once
#include <tyra>
namespace Racer {
class RacerGame : public Tyra::Game {
public:
RacerGame(Tyra::Engine* engine);
~RacerGame();
void init();
void loop();
private:
Tyra::Engine* engine;
};
} // namespace Racer
-77
View File
@@ -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
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-4
View File
@@ -1,4 +0,0 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore
-4
View File
@@ -1,4 +0,0 @@
$ConfigFile = Join-Path $PSScriptRoot './windows-pcsx2.ps1'
. $ConfigFile
RunPCSX2
-4
View File
@@ -1,4 +0,0 @@
#!/bin/bash
SCRIPT_DIR=$(dirname "$(readlink -f "$0")")
cd "$SCRIPT_DIR" || exit 1
./linux-pcsx2.sh
-10
View File
@@ -1,10 +0,0 @@
#include <tyra>
#include "racer_game.hpp"
int main() {
Tyra::Engine engine;
Racer::RacerGame game(&engine);
engine.run(&game);
SleepThread();
return 0;
}
-14
View File
@@ -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
-76
View File
@@ -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