Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/thextech-smbx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: TheXTech-SMBX

on:
push:
paths:
- 'homebrew/TheXTech-SMBX/**'
tags:
- '*'
pull_request:
paths:
- 'homebrew/TheXTech-SMBX/**'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Install dependencies
run: |
sudo apt update
sudo apt install bash clang-18 lld-18
sudo apt install build-essential

- name: Install toolchain
run: |
wget https://github.com/ps5-payload-dev/pacbrew-repo/releases/latest/download/ps5-payload-dev.tar.gz
sudo tar xf ps5-payload-dev.tar.gz -C /

- name: Build
run: |
PS5_PAYLOAD_SDK=/opt/ps5-payload-sdk ./homebrew/TheXTech-SMBX/build.sh

- name: Zip build output
run: |
cd homebrew
zip -r ../TheXTech-SMBX.zip TheXTech-SMBX

- name: Upload zipped artifact
uses: actions/upload-artifact@v4
with:
name: TheXTech-SMBX
path: TheXTech-SMBX.zip
if-no-files-found: error

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write

steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: TheXTech-SMBX
path: .

- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
prerelease: true
files: TheXTech-SMBX.zip


8 changes: 5 additions & 3 deletions Makefile.pc
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ VERSION_TAG := $(shell git describe --abbrev=10 --dirty --always --tags)

PYTHON ?= python3

BIN := websrv.pc
SRCS := src/main.c src/websrv.c src/asset.c src/fs.c src/mime.c
SRCS += src/pc/sys.c
BIN := websrv.pc

SRCS := src/main.c src/websrv.c src/asset.c src/fs.c src/mime.c
SRCS += src/ssdp.c
SRCS += src/pc/sys.c

CFLAGS := -Wall -DVERSION_TAG=\"$(VERSION_TAG)\"
LDADD += `pkg-config libmicrohttpd --libs`
Expand Down
23 changes: 12 additions & 11 deletions Makefile.ps5
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,21 @@ VERSION_TAG := $(shell git describe --abbrev=10 --dirty --always --tags)

PYTHON ?= python3

BIN := websrv-ps5.elf
BIN := websrv-ps5.elf

SRCS := src/main.c src/websrv.c src/asset.c src/fs.c src/mime.c
SRCS += src/mdns.c src/smb.c
SRCS += src/ps5/sys.c src/ps5/pt.c src/ps5/elfldr.c src/ps5/hbldr.c
SRCS += src/ps5/notify.c src/ps5/http.c
SRCS := src/main.c src/websrv.c src/asset.c src/fs.c src/mime.c
SRCS += src/mdns.c src/ssdp.c src/smb.c
SRCS += src/ps5/sys.c src/ps5/pt.c src/ps5/elfldr.c src/ps5/hbldr.c
SRCS += src/ps5/notify.c src/ps5/http.c

CFLAGS := -g -O0 -Wall -Werror -Isrc -DVERSION_TAG=\"$(VERSION_TAG)\"
CFLAGS := -g -O2 -Wall -Werror -Isrc -DVERSION_TAG=\"$(VERSION_TAG)\"
CFLAGS += -DHAVE_MDNS -DHAVE_SMB

LDADD := -lkernel_sys -lSceSystemService -lSceUserService -lSceAppInstUtil
LDADD += -lSceSsl -lSceHttp
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config libmicrohttpd --libs`
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config microdns --libs`
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config libsmb2 --libs`
LDADD := -lkernel_sys -lSceSystemService -lSceUserService -lSceAppInstUtil
LDADD += -lSceSsl -lSceHttp
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config libmicrohttpd --libs`
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config microdns --libs`
LDADD += `$(PS5_PAYLOAD_SDK)/bin/prospero-pkg-config libsmb2 --libs`

ASSETS := $(wildcard assets/*)
GEN_SRCS := $(patsubst assets/%,gen/%, $(ASSETS:=.c))
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ Examples:
- http://ps5:8080/fs/?fmt=json - Browser the local filesystem (json)
- http://ps5:8080/fs/system_ex/app/NPXS40028/redis.conf - Download a local file
- http://ps5:8080/mdns - List mDNS services discovered by websrv (json)
- http://ps5:8080/ssdp - List SSDP (UPnP) services discovered by websrv (json)
- http://ps5:8080/ssdp?st=urn:schemas-upnp-org:device:MediaServer:1 - List discovered DLNA media servers (json)
- http://ps5:8080/smb?addr=192.168.1.1 - List shares on a remote SMB host (json)
- http://ps5:8080/smb/share?addr=192.168.1.1 - List files and folders shared by a remote SMB host (json)
- http://ps5:8080/smb/share/file?addr=192.168.1.1 - Download a remote SMB file via websrv
Expand Down
73 changes: 73 additions & 0 deletions homebrew/TheXTech-SMBX/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/usr/bin/env bash
# Copyright (C) 2026 John Törnblom
#
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING. If not see
# <http://www.gnu.org/licenses/>.

VER="v1.3.7.3"
URL="https://wohlsoft.ru/projects/TheXTech/_downloads/releases/thextech-full-src-$VER.tar.gz"
ASSETS="https://wohlsoft.ru/projects/TheXTech/_downloads/assets/thextech-smbx13-assets-full.7z"

SCRIPT_PATH="$(realpath "${BASH_SOURCE[0]}")"
SCRIPT_DIR="$(dirname "${SCRIPT_PATH}")"

if [[ -z "$PS5_PAYLOAD_SDK" ]]; then
echo "error: PS5_PAYLOAD_SDK is not set"
exit 1
fi

set -e

source "${PS5_PAYLOAD_SDK}/toolchain/prospero.sh"

TEMPDIR=$(mktemp -d)
trap 'rm -rf -- "$TEMPDIR"' EXIT

wget -O $TEMPDIR/smbx13.7z "${ASSETS}"

wget -O $TEMPDIR/thextech.tar.gz "${URL}"
tar xf $TEMPDIR/thextech.tar.gz -C $TEMPDIR

export SDL_CONFIG="${PS5_PAYLOAD_SDK}/bin/prospero-sdl2-config"

${CMAKE} -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
-DPGE_ENABLE_VIDEO_REC=OFF \
-DPGE_SHARED_SDLMIXER=OFF \
-DTHEXTECH_BUILD_GL_DESKTOP_MODERN=OFF \
-DTHEXTECH_BUILD_GL_ES_LEGACY=OFF \
-DTHEXTECH_BUILD_GL_ES_MODERN=OFF \
-DTHEXTECH_FORCE_FULLSCREEN=ON \
-DTHEXTECH_NO_BUILD_DATE=ON \
-DUSE_STATIC_LIBC=ON \
-DUSE_SYSTEM_SDL2=ON \
-B $TEMPDIR/build \
$TEMPDIR/thextech-full-src

# must set DESTDIR or it prefixes ${PS5_PAYLOAD_SDK}/target to the path and breaks building
${MAKE} -j$(nproc) -C $TEMPDIR/build DESTDIR="/"

7z x $TEMPDIR/smbx13.7z -o$TEMPDIR/assets/

# extract icon
mkdir -p "${SCRIPT_DIR}/sce_sys"
cp $TEMPDIR/assets/graphics/ui/icon/thextech_256.png "${SCRIPT_DIR}/sce_sys/icon0.png"

mv $TEMPDIR/build/output/bin/thextech "${SCRIPT_DIR}/thextech-smbx.elf"
cp "${PS5_SYSROOT}/${PS5_HBROOT}/lib/libOSMesa.so.8" "${SCRIPT_DIR}/libOSMesa.so.8"

mv $TEMPDIR/assets/* "${SCRIPT_DIR}/"
mv $TEMPDIR/thextech-full-src/LICENSE "${SCRIPT_DIR}/License.TheXTech.txt"
mv $TEMPDIR/thextech-full-src/README.md "${SCRIPT_DIR}/ReadMe.txt"
mv $TEMPDIR/thextech-full-src/changelog.txt "${SCRIPT_DIR}/"
85 changes: 85 additions & 0 deletions homebrew/TheXTech-SMBX/homebrew.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
/* Copyright (C) 2026 John Törnblom

This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 3, or (at your option) any
later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; see the file COPYING. If not, see
<http://www.gnu.org/licenses/>. */

async function main() {
const WORKDIR = window.workingDir;
const PAYLOAD = WORKDIR + '/thextech-smbx.elf';
const ENV = {HOME: window.workingDir,
LD_LIBRARY_PATH: window.workingDir};

return {
mainText: "Super Mario Bros. X",
secondaryText: 'Fan-made Mario game engine',
onclick: async() => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV
};
},
options: [{
text: "Speedrun Mode 1 (Native)",
onclick: () => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV,
args: '--speed-run-mode 1'
};
}
}, {
text: "Speedrun Mode 2 (SMBX2)",
onclick: () => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV,
args: '--speed-run-mode 2'
};
}
}, {
text: "Speedrun Mode 3 (Strict SMBX 1.3)",
onclick: () => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV,
args: '--speed-run-mode 3'
};
}
}, {
text: "SMBX2 compatibiltiy mode",
onclick: () => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV,
args: '--compat-level smbx2'
};
}
}, {
text: "SMBX 1.3 strict compatibiltiy mode",
onclick: () => {
return {
path: PAYLOAD,
cwd: WORKDIR,
env: ENV,
args: '--compat-level smbx13'
};
}
}]
};
}
6 changes: 6 additions & 0 deletions homebrew/TheXTech-SMBX/settings/thextech.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[advanced]
render = "opengl11"

[video]
internal-res = "smbx-wide"

11 changes: 10 additions & 1 deletion src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ along with this program; see the file COPYING. If not, see
#include <signal.h>

#include "mdns.h"
#include "ssdp.h"
#include "websrv.h"


Expand All @@ -39,10 +40,18 @@ main(int argc, char** argv) {
signal(SIGCHLD, SIG_IGN);

while(1) {
#ifdef __SCE__
#ifdef HAVE_MDNS
mdns_discovery_start();
#endif
ssdp_discovery_start();

websrv_listen(port);

#ifdef HAVE_MDNS
mdns_discovery_stop();
#endif
ssdp_discovery_stop();

sleep(3);
}

Expand Down
Loading
Loading