foxygit / fake-08-xbox360 Log in
commit 8e8116b8fc012099aa797ca82801efa2a7c1c837
Author:     mrfox <jens.se@icloud.com>
AuthorDate: Tue Nov 24 21:34:42 2026 +0100
Commit:     mrfox <jens.se@icloud.com>
CommitDate: Tue Nov 24 21:34:42 2026 +0100

    Xbox 360: start from Aurora/FSD via XeLL Launch + loader xell.bin

    - platform/xenon/xell-loader: patch + build script for a XeLL Reloaded
      variant that boots fake08.elf from fake08/, Apps/FAKE-08/,
      Homebrew/FAKE-08/ or Applications/FAKE-08/ on any mounted device
      (USB or hard drive) before networking, falling back to normal XeLL.
      Together with the unchanged XeLL Launch XEX this makes FAKE-08 an app
      folder that Aurora/FSD can start.
    - Back+Start now reboots the console to the dashboard. Returning to XeLL
      would just autoboot FAKE-08 again.

    Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---
 .gitignore                                     |  1 +
 README.md                                      |  3 +-
 platform/xenon/source/XenonHost.cpp            |  6 ++
 platform/xenon/xell-loader/README.md           | 37 ++++++++++
 platform/xenon/xell-loader/build.sh            | 30 ++++++++
 platform/xenon/xell-loader/fake08-loader.patch | 95 ++++++++++++++++++++++++++
 6 files changed, 171 insertions(+), 1 deletion(-)

diff --git a/.gitignore b/.gitignore
index ea14a87..bd5981a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,4 @@ platform/libretro/obj/
 # libxenon (Xbox 360) build output
 *.elf32
 *.d
+platform/xenon/xell-loader/*.bin
diff --git a/README.md b/README.md
index 17388e8..a315e93 100644
--- a/README.md
+++ b/README.md
@@ -22,7 +22,8 @@ Requires a modded console (RGH/JTAG) that can boot XeLL (XeLL Reloaded, or launc

 - Format a USB stick as FAT32 (MBR, *not* exFAT) and put your carts in `p8carts/`. FAKE-08 uses the first USB device that has a `p8carts` folder and stores settings, save data and `pico.log` in `fake08/` on the same device.
 - Copy `FAKE-08_Xenon.elf32` to the root of the stick renamed to `xenon.elf`, or serve it as `xenon.elf` from a TFTP server. XeLL takes the TFTP server address from DHCP, or from `tftp_server=<ip>` in a `kboot.conf` (first line `#KBOOTCONFIG`) on the USB stick.
-- Controls: D-pad/left stick = arrows, `A`/`Y` = 🅾️, `B`/`X` = ❎ (swappable in settings), `Start` = pause menu, `Back` = cycle screen sizes, `Back`+`Start` = exit (returns to XeLL).
+- Controls: D-pad/left stick = arrows, `A`/`Y` = 🅾️, `B`/`X` = ❎ (swappable in settings), `Start` = pause menu, `Back` = cycle screen sizes, `Back`+`Start` = exit (reboots the console to the dashboard).
+- To start it from Aurora/FSD like a normal app, see `platform/xenon/xell-loader/README.md`.
 - Settings -> input has controller layout, stick deadzone and button debounce. Settings -> dev has a performance overlay. Settings are saved immediately, so it is safe to just switch the console off.

 Libretro cores are still in early development but should be working. Installation can be tricky however. In general you'll need to install the core (Load Core -> Install or Restore a Core -> {Navigate to core file location}) and also drop the fake08_libretro.info into the retroarch cores directory. This directory may be hidden and its location varies from platform to platform. Once that file is in place, you should be able to scan for Pico-8 carts using "Scan Directory." If that doesn't work for some reason, you can do a "Manual Scan." If doing a manual scan, choose the directory, set the custom system name to "Pico-8", set the default core to the one you just installed, and file extensions to "p8 png" and it should add a playlist of your Pico-8 carts associated with the newly installed core.
diff --git a/platform/xenon/source/XenonHost.cpp b/platform/xenon/source/XenonHost.cpp
index 0571de8..b157b46 100644
--- a/platform/xenon/source/XenonHost.cpp
+++ b/platform/xenon/source/XenonHost.cpp
@@ -31,6 +31,7 @@ extern "C" {
 #include <ppc/cache.h>
 #include <xenon_soc/xenon_power.h>
 #include <xenon_sound/sound.h>
+#include <xenon_smc/xenon_smc.h>
 #include <libfat/fat.h>
 int bdev_enum(int handle, const char **name);
 extern void (*stdout_hook)(const char *buf, int len);
@@ -434,6 +435,11 @@ void Host::oneTimeSetup(Audio *audio) {

 void Host::oneTimeCleanup() {
     saveSettingsIni();
+
+    // Exiting back to XeLL would just boot FAKE-08 again (XeLL autoboots
+    // fake08.elf/xenon.elf), so reboot the console to the dashboard instead.
+    xenon_smc_power_reboot();
+    for (;;) {}
 }

 void Host::setTargetFps(int targetFps) {
diff --git a/platform/xenon/xell-loader/README.md b/platform/xenon/xell-loader/README.md
new file mode 100644
index 0000000..9ceaacb
--- /dev/null
+++ b/platform/xenon/xell-loader/README.md
@@ -0,0 +1,37 @@
+# FAKE-08 as an Aurora / FSD app
+
+libxenon programs run bare metal, so Aurora cannot start them directly. The
+"XeLL Launch" XEX can: it shuts down the dashboard and starts `xell.bin` from
+its own folder. This directory builds a `xell.bin` (XeLL Reloaded with
+`fake08-loader.patch`) that boots `fake08.elf` immediately, before any
+networking, and only falls back to normal XeLL if it cannot find it.
+
+## Build
+
+From the repository root:
+
+    docker run --rm -v $PWD:/build_dir free60/libxenon:latest \
+      /bin/bash -ex /build_dir/platform/xenon/xell-loader/build.sh
+
+Produces `xell.bin` (the xell-2f variant, which is what the XeLL Launch
+v0.993 package ships) and `xell-1f.bin`.
+
+## Install
+
+Make a folder on the console's hard drive (or USB stick), for example
+`Hdd1:\Apps\FAKE-08\`, containing:
+
+| File | From |
+|---|---|
+| `default.xex` | XeLL Launch (`xelllaunch-v0.993` package), unchanged |
+| `xell.bin` | built here |
+| `fake08.elf` | `platform/xenon/FAKE-08_Xenon.elf32`, renamed |
+
+Add the folder as a path in Aurora/FSD and start it like any other app.
+
+The loader looks for `fake08.elf` in these folders on every mounted device
+(USB `ud*:`, hard drive content partition `hdd0:` = `Hdd1:` in Aurora):
+`fake08/`, `Apps/FAKE-08/`, `Homebrew/FAKE-08/`, `Applications/FAKE-08/`.
+
+Carts still go in `p8carts/` on a FAT32 USB stick. `Back`+`Start` in FAKE-08
+reboots the console to the dashboard.
diff --git a/platform/xenon/xell-loader/build.sh b/platform/xenon/xell-loader/build.sh
new file mode 100755
index 0000000..d76b8da
--- /dev/null
+++ b/platform/xenon/xell-loader/build.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+# Builds xell.bin for the "FAKE-08 as an Aurora/FSD app" setup:
+# XeLL Reloaded patched to boot fake08.elf straight away (see README.md here).
+#
+# Usage (from the repository root, inside the free60/libxenon image):
+#   docker run --rm -v $PWD:/build_dir free60/libxenon:latest \
+#     /bin/bash -ex /build_dir/platform/xenon/xell-loader/build.sh
+# Output: platform/xenon/xell-loader/xell.bin (xell-2f, what XeLL Launch ships)
+#         platform/xenon/xell-loader/xell-1f.bin
+set -e
+[ -f /etc/profile.d/99-devkitxenon.sh ] && . /etc/profile.d/99-devkitxenon.sh
+
+HERE=$(cd "$(dirname "$0")" && pwd)
+XELL_REPO=https://github.com/Free60Project/xell-reloaded.git
+XELL_COMMIT=b1bb00b
+WORK=$(mktemp -d)
+
+git clone -q "$XELL_REPO" "$WORK/xell"
+cd "$WORK/xell"
+git checkout -q "$XELL_COMMIT"
+git apply "$HERE/fake08-loader.patch"
+
+# build one variant at a time (the variants share build files)
+make xell-2f.build XELL_EXTRA=-DFAKE08_LOADER
+cp xell-2f.bin "$HERE/xell.bin"
+make xell-1f.build XELL_EXTRA=-DFAKE08_LOADER
+cp xell-1f.bin "$HERE/xell-1f.bin"
+
+rm -rf "$WORK"
+ls -la "$HERE"/*.bin
diff --git a/platform/xenon/xell-loader/fake08-loader.patch b/platform/xenon/xell-loader/fake08-loader.patch
new file mode 100644
index 0000000..cd79b7b
--- /dev/null
+++ b/platform/xenon/xell-loader/fake08-loader.patch
@@ -0,0 +1,95 @@
+diff --git a/Makefile_lv2.mk b/Makefile_lv2.mk
+index de8f5af..b38eed3 100644
+--- a/Makefile_lv2.mk
++++ b/Makefile_lv2.mk
+@@ -29,6 +29,8 @@ BINUTILS_VERSION = $(shell $(PREFIX)ld --version | grep ld | awk '{print $$5}')
+ #---------------------------------------------------------------------------------
+
+ CFLAGS	= -ffunction-sections -fdata-sections -g -Os -Wall -Werror $(MACHDEP) $(INCLUDE)
++# extra defines, e.g. XELL_EXTRA=-DFAKE08_LOADER
++CFLAGS	+= $(XELL_EXTRA)
+ CXXFLAGS	=	$(CFLAGS)
+ ASFLAGS		=	-m32
+
+diff --git a/source/lv2/main.c b/source/lv2/main.c
+index fca038c..8fd10c7 100644
+--- a/source/lv2/main.c
++++ b/source/lv2/main.c
+@@ -38,6 +38,40 @@
+
+ #include "log.h"
+
++#ifdef FAKE08_LOADER
++#include <sys/stat.h>
++
++/*
++ * FAKE-08 loader: boot fake08.elf straight away, before networking, so that
++ * "XeLL Launch" + this xell.bin acts like a FAKE-08 app in Aurora/FSD.
++ * Falls back to normal XeLL behaviour if no fake08.elf is found.
++ */
++static void fake08_autoboot(void)
++{
++	static const char *dirs[] = {
++		"fake08", "Apps/FAKE-08", "Homebrew/FAKE-08", "Applications/FAKE-08", NULL
++	};
++	char path[256];
++	struct stat st;
++	int i, d;
++
++	for (i = 3; i < STD_MAX; i++) {
++		if (!devoptab_list[i] || !devoptab_list[i]->structSize)
++			continue;
++		for (d = 0; dirs[d]; d++) {
++			snprintf(path, sizeof(path), "%s:/%s/fake08.elf",
++				 devoptab_list[i]->name, dirs[d]);
++			if (stat(path, &st) == 0) {
++				printf(" * FAKE-08: booting %s\n", path);
++				try_load_file(path, TYPE_ELF); /* only returns on failure */
++				printf(" ! FAKE-08: failed to boot %s\n", path);
++			}
++		}
++	}
++	printf(" * FAKE-08: fake08.elf not found, continuing as XeLL\n");
++}
++#endif
++
+ static const char *consoleNames[] =
+ {
+ 	"Xenon",
+@@ -145,6 +179,20 @@ int main(){
+
+ 	xenon_config_init();
+
++#ifdef FAKE08_LOADER
++	/* storage first, so FAKE-08 starts without waiting for DHCP */
++	printf(" * usb init\n");
++	usb_init();
++	usb_do_poll();
++	printf(" * sata hdd init\n");
++	xenon_ata_init();
++#ifndef NO_DVD
++	xenon_atapi_init();
++#endif
++	mount_all_devices();
++	fake08_autoboot();
++#endif
++
+ #ifndef NO_NETWORKING
+
+ 	printf(" * network init\n");
+@@ -156,6 +204,7 @@ int main(){
+
+ #endif
+
++#ifndef FAKE08_LOADER
+ 	printf(" * usb init\n");
+ 	usb_init();
+ 	usb_do_poll();
+@@ -171,6 +220,7 @@ int main(){
+ #endif
+
+ 	mount_all_devices();
++#endif
+
+ 	/*int device_list_size = */ // findDevices();
+