Skip to content
Closed
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
71 changes: 70 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,75 @@ concurrency:
# when authoring new shaders (offline by the contributor).

jobs:
# The boot animation's shaders (theseus/desktop/shaders/xboot/) for D3D11,
# the renderer bgfx picks by default on Windows. shaderc hands HLSL to
# fxc, which only exists on Windows, so the Linux and macOS jobs cannot
# make these. This job builds shaderc, compiles them and checks them
# against the .bin files in Data/shaders/dx11/; when they differ the new
# ones are in the job's artifact (and in its log, base64) to commit.
shaders-dx11:
name: Shaders / D3D11
runs-on: windows-latest
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v4

- name: Checkout bgfx
id: bgfx
run: |
git submodule update --init --depth 1 theseus/third-party/bx theseus/third-party/bimg theseus/third-party/bgfx
echo "sha=$(git rev-parse HEAD:theseus/third-party/bgfx)" >> "$GITHUB_OUTPUT"

- name: Cache shaderc
id: cache-shaderc
uses: actions/cache@v4
with:
path: theseus/third-party/bgfx/.build/win64_vs2022/bin/shadercRelease.exe
key: shaderc-win64-${{ steps.bgfx.outputs.sha }}

- uses: microsoft/setup-msbuild@v2
if: steps.cache-shaderc.outputs.cache-hit != 'true'

- name: Build shaderc
if: steps.cache-shaderc.outputs.cache-hit != 'true'
run: |
cd theseus/third-party/bgfx
../bx/tools/bin/windows/genie.exe --with-tools vs2022
MSBuild.exe .build/projects/vs2022/shaderc.vcxproj -p:Configuration=Release -p:Platform=x64 -m -v:minimal

- name: Compile and compare
run: |
SHADERC=theseus/third-party/bgfx/.build/win64_vs2022/bin/shadercRelease.exe
SRC=theseus/desktop/shaders/xboot
OUT=out/dx11
mkdir -p "$OUT"
for SC in "$SRC"/vs_*.sc "$SRC"/fs_*.sc; do
NAME=$(basename "$SC" .sc)
case $NAME in vs_*) T=v ;; *) T=f ;; esac
"$SHADERC" -f "$SC" -o "$OUT/xboot_$NAME.bin" --type $T --platform windows --profile s_5_0 \
--varyingdef "$SRC/varying.def.sc" -i theseus/third-party/bgfx/src -i "$SRC"
done
STALE=0
for F in "$OUT"/*.bin; do
cmp -s "$F" "Data/shaders/dx11/$(basename "$F")" || { echo "differs: $(basename "$F")"; STALE=1; }
done
if [ $STALE = 1 ]; then
echo "Data/shaders/dx11 is out of date. Commit the job's artifact, or decode this:"
tar czf - -C "$OUT" . | base64 -w 0
echo
exit 1
fi

- name: Upload D3D11 shaders
if: always()
uses: actions/upload-artifact@v4
with:
name: xboot-shaders-dx11
path: out/dx11/
if-no-files-found: ignore

desktop-macos:
name: Desktop / macOS
runs-on: macos-latest
Expand Down Expand Up @@ -319,7 +388,7 @@ jobs:
cp -R ~/builds/theseus/desktop-win64/. "$DROP/"
find "$DROP" -name '*.o' -delete
find "$DROP" -name '*.d' -delete
rm -rf "$DROP/desktop" "$DROP/shared" "$DROP/engine" "$DROP/render" "$DROP/xbox" || true
rm -rf "$DROP/desktop" "$DROP/shared" "$DROP/engine" "$DROP/render" "$DROP/xbox" "$DROP/xboot" || true
ls -la "$DROP"

- name: Upload Win64 build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ jobs:
# Zip up; remove the *.o cruft from object subdirs first.
find "${DROP}" -name '*.o' -delete
find "${DROP}" -name '*.d' -delete
rm -rf "${DROP}/desktop" "${DROP}/shared" "${DROP}/engine" "${DROP}/render" "${DROP}/xbox" || true
rm -rf "${DROP}/desktop" "${DROP}/shared" "${DROP}/engine" "${DROP}/render" "${DROP}/xbox" "${DROP}/xboot" || true
zip -r "${DROP}.zip" "${DROP}"
echo "ARCHIVE=${DROP}.zip" >> "$GITHUB_ENV"

Expand Down
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@
path = theseus/third-party/libdatachannel
url = https://github.com/paullouisageneau/libdatachannel.git
ignore = untracked
[submodule "theseus/third-party/xboot"]
path = theseus/third-party/xboot
url = https://github.com/austinbaccus/re-xbox-boot.git
ignore = untracked
Binary file removed Configs/xbox_boot.mp4
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_blob.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_depth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_drop.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_logod.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_plain.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_present.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_relief.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_fs_veil.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_blob.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_depth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_drop.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_logod.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_plain.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_present.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_relief.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/dx11/xboot_vs_veil.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_blob.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_depth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_drop.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_logod.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_plain.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_present.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_relief.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_fs_veil.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_blob.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_depth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_drop.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_logod.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_plain.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_present.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_relief.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/essl/xboot_vs_veil.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_blob.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_depth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_drop.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_logod.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_plain.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_present.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_relief.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_fs_veil.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_blob.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_depth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_drop.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_logod.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_plain.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_present.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_relief.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/glsl/xboot_vs_veil.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_blob.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_depth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_drop.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_logod.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_plain.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_present.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_relief.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_fs_veil.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_blob.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_depth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_drop.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_logod.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_plain.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_present.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_relief.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/metal/xboot_vs_veil.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_blob.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_depth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_drop.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_logod.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_plain.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_present.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_relief.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_fs_veil.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_blob.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_depth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_drop.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_fixed.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_lightdepth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_logod.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_plain.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_present.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_relief.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_smooth.bin
Binary file not shown.
Binary file added Data/shaders/spirv/xboot_vs_veil.bin
Binary file not shown.
3 changes: 3 additions & 0 deletions LICENSE-THIRD-PARTY.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,12 @@ Used by the desktop port:
| [ImGuiColorTextEdit](https://github.com/BalazsJako/ImGuiColorTextEdit) | MIT | XAP script editor with syntax highlighting |
| [stb_image](https://github.com/nothings/stb) | Public Domain (or MIT, dual-licensed) | Image loading on the desktop side |
| [GLEW](https://glew.sourceforge.net/) | Modified BSD / MIT | OpenGL extension loader (Windows desktop build only) |
| [re-xbox-boot](https://github.com/austinbaccus/re-xbox-boot) (`theseus/third-party/xboot`) | MIT | The boot animation, reconstructed from the BIOS: portable C core, renderer ported to bgfx in `boot_anim.cpp` and `shaders/xboot/` |

All of the above are GPL-3.0-compatible, either by being permissive (MIT, BSD, zlib, public domain) or by being LGPL (linkable from GPL).

The boot animation's data pack is built from `theseus/third-party/xboot/data/`, geometry, samples and tables extracted from the original BIOS. As that repository notes, their content is Microsoft's work; the boot animation itself was created by Pipeworks Software in 2001.

## Xbox Dashboard Assets (`xboxfs/`)

The XIPs and skin assets in `xboxfs/` are authored by [UIX Lite](https://github.com/OfficialTeamUIX/UIX-Lite) and contain TeamUIX modifications of dashboard scripts present on every retail Xbox console. The `uixdata` directory layout is a convention established by JbOnE's earlier source-level modification, *User.Interface.X* (UIX); Theseus follows that convention so the same content runs on both projects. UIX Lite's modifications are licensed under GPL-3.0-or-later. The underlying script formats and any unmodified original components are referenced for compatibility and preservation; Microsoft retains its rights to its original work. Every Xbox owner already possesses the equivalent original files on their console.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ A drop-in replacement for the stock Xbox dashboard on modded consoles. Same look

The Theseus engine compiled for your computer, with the modern features bolted on. macOS, Linux, Windows, Steam Deck friendly.

- **The original boot animation**, rendered live from the [reverse engineered BIOS animation](https://github.com/austinbaccus/re-xbox-boot) with its synthesized sound, then straight into the dashboard (Settings > Show Boot Animation; Esc, Enter, Space or A/B/Start skips it)
- **3D launcher** for native PC games, Steam libraries, RetroArch ROMs, and Xbox ISOs via [xemu](https://xemu.app)
- **xCloud / Game Pass streaming** signs in with your Xbox account and drops your whole cloud library into the games grid, box art and all. Remote play for your own console shows up under "Your Xbox"
- **Media library** that scans your Movies and TV folders, pulls posters from [TMDB](https://www.themoviedb.org/), and plays back through libmpv. [Plex](https://www.plex.tv/) and [Jellyfin](https://jellyfin.org/) servers browse and stream in the same UI (Jellyfin signs in with Quick Connect)
Expand Down Expand Up @@ -196,6 +197,7 @@ manipulation don't translate to a stick. Keyboard equivalents:
| F4 | Settings |
| F5 | Xbox HDD browser |
| F6 | Playlist Maker |
| F9 | FPS / debug overlay |
| F10 | Toggle menu bar |
| F11 | Toggle fullscreen |
| Ctrl+M | Mute |
Expand Down
Binary file added art/logo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions build/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -772,6 +772,41 @@ DESKTOP_ALL_SRCS = \
$(DESKTOP_SRCS_IMGUI)

DESKTOP_OBJS = $(patsubst $(THESEUS_SRC)/%.cpp,$(DESKTOP_DIR)/%.o,$(DESKTOP_ALL_SRCS))

# ------------------------------------------------------------------------
# Boot animation core (third-party/xboot, the re-xbox-boot repo). Portable
# C99, compiled with the flags its own build uses (core/build.py) so the
# numerics stay as the boot repo measured them. Its data pack is built from
# the repo's data/ by its own tools/pack/pack.py (checked against the
# SHA-256 it ships) and embedded into the binary as a header, so there is
# no runtime file to lose. Every desktop target below links these objects;
# boot_anim.cpp is the only C++ user.
# ------------------------------------------------------------------------
XBOOT_ROOT := $(THESEUS_SRC)/third-party/xboot
XBOOT_C_SRCS := $(sort $(wildcard $(XBOOT_ROOT)/core/src/*.c))
XBOOT_PAK := $(XBOOT_ROOT)/out/pack/xboot.pak
XBOOT_PAK_H := $(XBOOT_ROOT)/out/xboot_pak.h
XBOOT_INC := -I$(XBOOT_ROOT)/core/include -I$(XBOOT_ROOT)/out
XBOOT_CFLAGS := -std=c99 $(if $(DEBUG),-g -O0,-O2) -MMD -MP \
-ffp-contract=off -fno-fast-math -fno-math-errno \
-I$(XBOOT_ROOT)/core/include -I$(XBOOT_ROOT)/core/src
PYTHON ?= python3

$(XBOOT_ROOT)/core/include/xboot.h:
@echo "xboot submodule not initialized; running git submodule update..."
cd $(THESEUS_SRC)/.. && git submodule update --init --depth 1 theseus/third-party/xboot

$(XBOOT_PAK_H): $(XBOOT_ROOT)/core/include/xboot.h $(THESEUS_SRC)/../build/embed_xboot_pak.py
$(PYTHON) $(XBOOT_ROOT)/tools/pack/pack.py --check
$(PYTHON) $(THESEUS_SRC)/../build/embed_xboot_pak.py $(XBOOT_PAK) $@

DESKTOP_CFLAGS += $(XBOOT_INC)
DESKTOP_OBJS += $(patsubst $(XBOOT_ROOT)/core/src/%.c,$(DESKTOP_DIR)/xboot/%.o,$(XBOOT_C_SRCS))
$(DESKTOP_DIR)/desktop/boot_anim.o: $(XBOOT_PAK_H)
$(DESKTOP_DIR)/xboot/%.o: $(XBOOT_ROOT)/core/src/%.c
@mkdir -p $(dir $@)
$(DESKTOP_CC) $(XBOOT_CFLAGS) -c -o $@ $<

DESKTOP_DEPS = $(DESKTOP_OBJS:.o=.d)
-include $(DESKTOP_DEPS)

Expand Down Expand Up @@ -914,6 +949,38 @@ shaders-bgfx-dx11:
@echo "=== bgfx shaders compiled to $(SHADERS_OUT_DIR)/dx11/ ==="


# The boot animation's shaders (theseus/desktop/shaders/xboot/, see
# boot_anim.cpp) have a varying.def.sc of their own and land next to the
# others as Data/shaders/<backend>/xboot_<name>.bin. Same tools and
# profiles as above; dx11 again only on Windows (fxc).
# make -C build shaders-xboot metal, spirv, glsl, essl
# make -C build shaders-xboot-dx11 dx11, on Windows
XBOOT_SHADERS_DIR := $(SHADERS_SRC_DIR)/xboot
# $(call xboot-shaders,<subdir>,<platform>,<profile>)
define xboot-shaders
@mkdir -p $(SHADERS_OUT_DIR)/$(1)
@for SC in $(XBOOT_SHADERS_DIR)/vs_*.sc $(XBOOT_SHADERS_DIR)/fs_*.sc; do \
NAME=$$(basename $$SC .sc); \
case $$NAME in vs_*) T=v ;; *) T=f ;; esac; \
echo "shaderc [$(1)] xboot_$$NAME"; \
$(SHADERC) -f $$SC -o $(SHADERS_OUT_DIR)/$(1)/xboot_$$NAME.bin \
--type $$T --platform $(2) --profile $(3) \
--varyingdef $(XBOOT_SHADERS_DIR)/varying.def.sc \
-i $(BGFX_SHADER_INC) -i $(XBOOT_SHADERS_DIR) \
|| exit 1; \
done
endef

.PHONY: shaders-xboot shaders-xboot-dx11
shaders-xboot:
$(call xboot-shaders,metal,osx,metal)
$(call xboot-shaders,spirv,windows,spirv)
$(call xboot-shaders,glsl,linux,150)
$(call xboot-shaders,essl,android,300_es)

shaders-xboot-dx11:
$(call xboot-shaders,dx11,windows,s_5_0)

desktop: projectm-deps $(DESKTOP_TARGET)
@echo "=== desktop build complete: $(DESKTOP_TARGET) ==="

Expand Down Expand Up @@ -1195,6 +1262,16 @@ WIN64_SRCS += $(THESEUS_SRC)/desktop/imgui_impl_bgfx.cpp

# Same source list as desktop. the compiler reads the same files.
WIN64_OBJS = $(patsubst $(THESEUS_SRC)/%.cpp,$(WIN64_DIR)/%.o,$(WIN64_SRCS))

# The boot animation's core, as for the native desktop target.
WIN64_CC = x86_64-w64-mingw32-gcc
WIN64_CFLAGS += $(XBOOT_INC)
WIN64_OBJS += $(patsubst $(XBOOT_ROOT)/core/src/%.c,$(WIN64_DIR)/xboot/%.o,$(XBOOT_C_SRCS))
$(WIN64_DIR)/desktop/boot_anim.o: $(XBOOT_PAK_H)
$(WIN64_DIR)/xboot/%.o: $(XBOOT_ROOT)/core/src/%.c
@mkdir -p $(dir $@)
$(WIN64_CC) $(XBOOT_CFLAGS) -c -o $@ $<

WIN64_DEPS = $(WIN64_OBJS:.o=.d)
-include $(WIN64_DEPS)

Expand Down Expand Up @@ -1395,6 +1472,16 @@ LINUX_ARM64_LDFLAGS = \

# Same source list as desktop. the compiler reads the same files.
LINUX_ARM64_OBJS = $(patsubst $(THESEUS_SRC)/%.cpp,$(LINUX_ARM64_DIR)/%.o,$(DESKTOP_ALL_SRCS))

# The boot animation's core, as for the native desktop target.
LINUX_ARM64_CC = aarch64-linux-gnu-gcc
LINUX_ARM64_CFLAGS += $(XBOOT_INC)
LINUX_ARM64_OBJS += $(patsubst $(XBOOT_ROOT)/core/src/%.c,$(LINUX_ARM64_DIR)/xboot/%.o,$(XBOOT_C_SRCS))
$(LINUX_ARM64_DIR)/desktop/boot_anim.o: $(XBOOT_PAK_H)
$(LINUX_ARM64_DIR)/xboot/%.o: $(XBOOT_ROOT)/core/src/%.c
@mkdir -p $(dir $@)
$(LINUX_ARM64_CC) $(XBOOT_CFLAGS) -c -o $@ $<

LINUX_ARM64_DEPS = $(LINUX_ARM64_OBJS:.o=.d)
-include $(LINUX_ARM64_DEPS)

Expand Down
33 changes: 33 additions & 0 deletions build/embed_xboot_pak.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""Writes the boot animation's data pack as a C++ header.

python3 build/embed_xboot_pak.py <xboot.pak> <xboot_pak.h>

The pack comes from theseus/third-party/xboot/tools/pack/pack.py (the
Makefile runs it first). The core reads the pack in place and wants it
aligned to 16 bytes (XB_ALIGN), so the array is declared that way.
"""

import sys


def main():
src, dst = sys.argv[1], sys.argv[2]
data = open(src, 'rb').read()
lines = [
'// Generated by build/embed_xboot_pak.py from %s. Do not edit.' % src.replace('\\', '/').split('/')[-1],
'#pragma once',
'#include <stddef.h>',
'',
'alignas(16) static const unsigned char kXbootPak[%d] = {' % len(data),
]
for i in range(0, len(data), 16):
lines.append('\t' + ', '.join('0x%02x' % b for b in data[i:i + 16]) + ',')
lines.append('};')
lines.append('static const size_t kXbootPakSize = sizeof(kXbootPak);')
lines.append('')
with open(dst, 'w', newline='\n') as f:
f.write('\n'.join(lines))


if __name__ == '__main__':
main()
Loading