foxygit / xexkit Log in
commits tags

/docs/wiki/Home.md · 2.48 KB

raw

xexkit wiki

xexkit builds native Xbox 360 titles (default.xex) with GCC and no Microsoft XDK, for RGH/JTAG consoles running Aurora or FSD. These pages hold what we found out while porting FAKE-08 (a PICO-8 emulator) to the console. Most of it isn't written down anywhere else, so each page says what was seen on the console and why the runtime does what it does.

Pages

PageAbout
Getting startedBuild the tools, build a title, run it on the console
Toolchain and ABIGCC flags, the console calling convention, the link script, the stack, C++ start-up
VideoGetting a picture on screen at all, then sharp at 1080p: the LUT, the 0x60EC commit, the scaler, tiling, fast blits
The GuideMaking the Xbox button's Guide show over a title, and ending safely
AudioThe kernel's render driver, the frame format, latency
InputControllers through XAM
Files and storagePaths, devices, the FAT32 USB listing bug, deleting files
TimeThe 49.875 MHz time base, sleeping, frame pacing
Crashes and debuggingcrash.txt, addr2line, logging, diagnosing on hardware
Xenia vs. hardwareWhat Xenia Canary does differently
PitfallsMistakes that cost us hours: stale copies, FTP, Docker, screenshot plugins
Porting guidePorting a program, with FAKE-08 as the worked example
SourcesWhere the knowledge comes from

The short version

  1. A title's surface only reaches the screen once the **display LUT is

    filled and the surface is committed through 0x60EC**, as XAM does it. VdSwap alone, VdSetDisplayMode and VdTurnDisplayOn do nothing for it.

  2. For a sharp picture, make the front buffers the output's size and turn

    the scaler off. The kernel's 640x480 surface is stretched and blurred.

  3. Swap every frame with VdSwap and show XAM's surface when VdSwap hands it

    back. Otherwise the Guide never appears.

  4. The time base runs at 49.875 MHz, not the 50 MHz the kernel reports.
  5. Clear the buffer before every NtQueryDirectoryFile. A FAT32 USB

    stick's driver doesn't write NextEntryOffset.

  6. Functions the kernel calls back (audio, exceptions) must keep r14-r31

    whole in 64 bits.

  7. Never let a title end by itself while the Guide is open. The console

    hangs.