Skip to content

Commit

Permalink
Merge branch 'master' into TCPIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Wolf3s committed Dec 30, 2023
2 parents 0f2bb98 + ab08a38 commit 6515f15
Show file tree
Hide file tree
Showing 23 changed files with 356 additions and 61 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/master-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Official build

on:
push:
branches: [ master ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
container: h4570/tyra
steps:
- name: Install dependencies
run: |
apt-get update
apt install -y git make wget
- name: Set git safe directory
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v3

- name: Compile engine
run: |
make clean all -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
- name: Compile demo
run: |
make clean all -C demo
- name: Upload tutorials
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: tutorials-elf
path: |
tutorials/01-hello/bin
tutorials/02-sprite/bin
tutorials/03-minecraft/bin
tutorials/04-de_dust2/bin
tutorials/05-animation/bin
tutorials/06-audio/bin
tutorials/07-lighting/bin
tutorials/08-skybox-debug/bin
tutorials/09-manual-mode/bin
tutorials/10-sprite-sheet/bin
- name: Upload demo
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: demo-elf
path: |
demo/bin
73 changes: 73 additions & 0 deletions .github/workflows/pr-build-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: PR build check

on:
pull_request:
branches: [ master ]

jobs:
build:
name: Build
runs-on: ubuntu-latest
container: h4570/tyra
steps:
- name: Install dependencies
run: |
apt-get update
apt install -y git make wget
- name: Set git safe directory
run: |
git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Checkout
uses: actions/checkout@v3

- name: Compile engine
run: |
make clean all -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
- name: Compile demo
run: |
make clean all -C demo
- name: Get short SHA
id: slug
run: |
echo "SHA8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV
- name: Get branch
id: branch
run: |
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/refs\///g' | sed 's/\//_/g')
echo "BRANCH=${BRANCH_NAME}" >> $GITHUB_ENV
- name: Upload build artifacts
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: binaries-${{ env.SHA8 }}-${{ env.BRANCH }}
path: |
tutorials/01-hello/bin
tutorials/02-sprite/bin
tutorials/03-minecraft/bin
tutorials/04-de_dust2/bin
tutorials/05-animation/bin
tutorials/06-audio/bin
tutorials/07-lighting/bin
tutorials/08-skybox-debug/bin
tutorials/09-manual-mode/bin
tutorials/10-sprite-sheet/bin
demo/bin
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#This is a modified version of the clang format check used on Open-PS2-Loader
name: CI-cpp-check
name: PR C++ format check

on:
push:
Expand All @@ -23,6 +23,7 @@ on:

jobs:
check-format:
name: Check clang format
runs-on: ubuntu-latest

steps:
Expand Down
2 changes: 1 addition & 1 deletion .vscode/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
/c_cpp_properties.json
/tasks.json
/settings.json
ps2dev-intellisense/
/ps2dev-intellisense
2 changes: 1 addition & 1 deletion .vscode/configurations/windows-docker/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"options": {
"cwd": "${config:buildDirectory}"
},
"command": "./run.ps1"
"command": "Start-Job { ./run.ps1 } | Receive-Job -Wait"
},
{
"type": "shell",
Expand Down
2 changes: 1 addition & 1 deletion Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ IRXEMBEDDEDEXT := irx-em
CFLAGS += -D_EE -Wall -O3
LINKFLAGS += -O3 -Wl,-zmax-page-size=128
ASFLAGS += -O3
LIB += -lstdc++ -ldma -lpacket2 -lgraph -ldraw -lmath3d -lpng -lz -lpad -laudsrv -lpatches -lcdvd
LIB += -lstdc++ -ldma -lpacket2 -lgraph -ldraw -lmath3d -lpng -ldebug -lz -lpad -laudsrv -lpatches -lcdvd
INC += -I$(PS2DEV)/ps2sdk/ee/include -I$(PS2DEV)/ps2sdk/common/include -I$(PS2DEV)/ps2sdk/ports/include

#---------------------------------------------------------------------------------
Expand Down
19 changes: 6 additions & 13 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<br />
<p align="center">
<a href="https://github.com/h4570/tyra">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/github-splash.png" alt="Logo" width="100%" height="auto">
<img src="https://raw.githubusercontent.com/h4570/tyra/master/assets/github-splash.png" alt="Logo" width="100%" height="auto">
</a>

<h3 align="center">Tyra</h3>
Expand All @@ -27,15 +27,12 @@
</p>
</p>

[![Stargazers repo roster for h4570/tyra](https://reporoster.com/stars/h4570/tyra)](https://github.com/h4570/tyra/stargazers)

## Table of Contents

* [About the project](#about-the-project)
* [Description](#description)
* [Tutorials](#tutorials)
* [Features](#features)
* [Branches](#branches)
* [Contributing](#contributing)
* [Games](#games)
* [License](#license)
Expand All @@ -45,8 +42,8 @@

## About the Project
<p align="center">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/tyra_code.gif" alt="Sample code" width="500" height="auto">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/showcase.gif " alt="Sample game" width="500" height="auto">
<img src="https://raw.githubusercontent.com/h4570/tyra/master/assets/tyra_code.gif" alt="Sample code" width="500" height="auto">
<img src="https://raw.githubusercontent.com/h4570/tyra/master/assets/showcase.gif " alt="Sample game" width="500" height="auto">
</p>

---
Expand Down Expand Up @@ -99,14 +96,10 @@ Decision was simple - I need to create an engine which will handle 3D file loadi
* `.md2` 3D file support
* `.png` Texture file support

### Branches
* `master` - stable releases - tested on PS2 & PCSX2.
* `develop` - daily builds.
## Contributing

See the [open issues](https://github.com/h4570/tyra/issues) for a list of proposed features (and known issues).

## Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.

1. Fork the Project
Expand Down Expand Up @@ -148,7 +141,7 @@ Distributed under the Apache License 2.0 License. See `LICENSE` for more informa
Without these guys, Tyra would not happen:
* [Dr Henry Fortuna](http://ps2-edu.tensioncore.com/index.html) - for code sources, PS2 academy tutorials
* Whole [PS2DEV](https://github.com/ps2dev) team, and specially to [Rick Gaiser](https://github.com/rickgaiser), [fjtrujy](https://github.com/fjtrujy) - for a lot of good tips!
* [Wellington Carvalho](https://github.com/Wellinator), [André Guilheme](https://github.com/wolfysdl) - for testing, contributing to Tyra and sharing cool ideas!
* [Wellington Carvalho](https://github.com/Wellinator), [André Guilheme](https://github.com/Wolf3s), [Matías Israelson](https://github.com/israpps) - for testing, contributing to Tyra and sharing cool ideas!
* [Leonardo Ono](https://github.com/leonardo-ono) - for software renderer example (with clipping!)
* [Lukasz D.K.](https://github.com/lukaszdk) - for huge archive of PS2 stuff
* [Guilherme Lampert](https://github.com/glampert) - for code sources
Expand All @@ -162,7 +155,7 @@ Sandro Sobczyński - sandro.sobczynski@gmail.com

<br />
<a href="https://github.com/h4570/tyra">
<img src="http://apgcglz.cluster028.hosting.ovh.net/tyra/github-splash2.png" alt="Logo" width="100%" height="auto">
<img src="https://raw.githubusercontent.com/h4570/tyra/master/assets/github-splash2.png" alt="Logo" width="100%" height="auto">
</a>

[contributors-shield]: https://img.shields.io/github/contributors/h4570/tyra.svg?style=flat-square
Expand Down
Binary file added assets/github-splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/github-splash2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/showcase.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/tyra_code.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/vcl
Binary file not shown.
18 changes: 18 additions & 0 deletions engine/inc/debug/debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#else // IF Debug

#include <stdio.h>
#include <debug.h>
#include <string>
#include <sstream>
#include <fstream>
Expand Down Expand Up @@ -81,7 +82,12 @@ class TyraDebug {
printf("%s", ss2.str().c_str());
}

init_scr();
for (;;) {
scr_setXY(20, 10);
scr_printf(ss1.str().c_str());
writeAssertLinesInScreen(args...);
scr_printf(ss2.str().c_str());
}
}

Expand All @@ -103,6 +109,18 @@ class TyraDebug {
printf("%s", ss.str().c_str());
}
}

template <typename Arg, typename... Args>
static void writeAssertLinesInScreen(Arg&& arg, Args&&... args) {
std::stringstream ss;

ss << "| " << std::forward<Arg>(arg) << "\n";
using expander = int[];
(void)expander{
0, (void(ss << "| " << std::forward<Args>(args) << "\n"), 0)...};

scr_printf(ss.str().c_str());
}
};

#endif // NDEBUG
8 changes: 5 additions & 3 deletions engine/inc/file/file_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#pragma once

#include <string>
#include <limits.h>
#include <syslimits.h>

namespace Tyra {

Expand Down Expand Up @@ -42,9 +44,9 @@ class FileUtils {

private:
// Argv name+path & just path
char cwd[255];
char elfName[255];
char elfPath[255 - 14];
char cwd[NAME_MAX];
char elfName[NAME_MAX];
char elfPath[NAME_MAX - 14];

void setPathInfo(const char* path);
};
Expand Down
1 change: 1 addition & 0 deletions engine/inc/irx/irx_loader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class IrxLoader {
void loadSio2man(const bool& verbose);
void loadPadman(const bool& verbose);
void loadLibsd(const bool& verbose);
void loadIO(const bool& verbose);
void loadUsbModules(const bool& verbose);
void loadAudsrv(const bool& verbose);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ class TextureBuilderData {
TextureBpp clutBpp;
unsigned char clutGsComponents;
};

} // namespace Tyra
3 changes: 0 additions & 3 deletions engine/inc/math/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,6 @@ class Math {
static int randomi(const int& min, const int& max);
static bool equalf(const float& a, const float& b,
const float& epsilon = 0.00001F);

private:
Math();
};

} // namespace Tyra
3 changes: 1 addition & 2 deletions engine/src/file/file_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
#include <tamtypes.h>
#include <cstdio>
#include <kernel.h>
#include <limits.h>
#include <syslimits.h>

#include <unistd.h>
#include <cstring>
#include "file/file_utils.hpp"
Expand Down
2 changes: 2 additions & 0 deletions engine/src/irx/fileXio.irx-em
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$PS2SDK/iop/irx/fileXio.irx
fileXio_irx
2 changes: 2 additions & 0 deletions engine/src/irx/iomanX.irx-em
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
$PS2SDK/iop/irx/iomanX.irx
iomanX_irx
Loading

0 comments on commit 6515f15

Please sign in to comment.